rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:Zekilou/dsh-ask-form
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
A community plugin for DeepSeek Harness that lets the model ask structured questions as one form — typed fields, conditions, validation and targeted re-asks — and receive typed JSON answers.
The built-in ask_user_question tool is a flat option list shown one question per page. ask_form adds field types, cross-field constraints and a single submission, and it degrades to the built-in flow on any surface that cannot render it.
English | 中文
confirm, single, multi, text, longtext, number, integer, date, tags, scale, slider, ranking, matrix, budgetvisible_if, validate (a whitelisted expression language, never eval), pattern, max_length, min/max, sum_tomax_roundsscale/slider/number → number, ranking → ordered array, matrix → {row: choice}, budget → {option: number}, tags → string arrayrequirement-intake, design-choice, release-gate, incident-intake, tunable through pack_argssingle, multi and tags (allow_other: false closes the list). The whole row is the target: clicking it focuses the field, typing selects it on single, Enter turns it into a removable chip on multi/tags.mode: "script" renders a custom React element, but only on a page that sets window.__DSH_ASK_FORM_SCRIPT__ = true: arbitrary JS can freeze the tab and nothing in a browser can interrupt it. Declare script.fallback for other surfacesrenderer: "generic". Script mode fails loud instead of degrading silently.Prerequisites: a Harness profile with the plugin_manager tool (the web profile has it).
Install the bundle — ask the agent in the Harness, or run the plugin_manager tool with:
action: install_bundle
target: github:Zekilou/dsh-ask-form
From a local clone, pass its absolute path instead: /absolute/path/to/dsh-ask-form.
Reload the Harness Web page once, so the client bundle registers (client.js owns the form surface).
The ask_form tool is now available next to ask_user_question.
A form is one tool call. Fields are ordered; the first option of a list is the recommended one by convention.
{
"title": "Runtime decision",
"intro": "Pick the runtime and weight the criteria.",
"fields": [
{ "name": "runtime", "type": "single", "label": "Runtime",
"options": ["Node 22 (Recommended)", "Bun", "Deno"] },
{ "name": "needs_wasm", "type": "confirm", "label": "Do you need WASM?",
"visible_if": "runtime == 'Bun'" },
{ "name": "weights", "type": "budget", "label": "Criteria weights (sum 100)",
"options": ["Performance", "Ecosystem", "Footprint"], "sum_to": 100 },
{ "name": "priority", "type": "ranking", "label": "Priority order",
"options": ["Ship fast", "Stay small", "Be portable"] },
{ "name": "scores", "type": "matrix", "label": "Score each dimension",
"rows": ["Performance", "Cost"], "options": ["High", "Medium", "Low"] }
],
"notes": true
}
A ready-made interview:
{ "pack": "requirement-intake", "pack_args": { "topic": "cache layer" }, "notes": true }
The result carries typed values plus provenance:
{ "status": "answered", "rounds": 1, "renderer": "form",
"values": { "runtime": "Bun", "needs_wasm": true,
"weights": { "Performance": 50, "Ecosystem": 30, "Footprint": 20 },
"priority": ["Be portable", "Ship fast", "Stay small"],
"scores": { "Performance": "High", "Cost": "Low" } },
"notes": "…" }
status is one of answered, incomplete, cancelled, aborted, no_answerer, unavailable, script_error.
The bundle has two halves and no build step.
Host half (index.js) registers the ask_form tool over the existing ctx.userQuestions seam. It compiles the typed form into ordinary AskUserQuestionItem[] — so any answerer can still answer it — and carries the rich spec to its own renderer through the marker item's intent. Afterwards it decodes either the renderer's JSON envelope or plain option/label answers, validates on the Host, and re-asks only the failures.
Client half (client.js) registers one low-priority entry in the conversation.composer chain. It claims a pending request only when a question carries this plugin's intent.kind, renders the whole form as a centered floating layer (react-dom portal, native modal geometry), and answers with the JSON envelope. Every other pending request — including plan reviews — returns null and stays with the shipped composer, so installing this bundle cannot change the built-in flow.
Notable behaviours:
undefined property makes the Remote event gateway reject the whole request.window.__DSH_ASK_FORM_PROBE__ = true, then a form titled DSH_ASK_FORM_PROBE answers itself with a DOM report (card rect, computed styles, elementFromPoint hit tests). Off by default: a form that answers itself is a hazard, not a feature.try/catch and checks that the slot chain exists; a broken registration costs the form surface, never the page.document.head, not in the rendered tree, so the script and error surfaces are styled even when they are the first thing on screen.Three standalone suites, no monorepo install and no browser needed:
node tests/host.test.mjs # compile -> decode -> validate -> rounds -> cancellation
node tests/client.test.mjs # render tree, marker selector, submit envelope
node tests/interaction.test.mjs # real state: typing, Enter, chips, blur races, steps
The first drives the Host half against scripted answerers. The other two drive the real component
tree: client.test.mjs on stateless hook stubs (structure and protocol), interaction.test.mjs
on a small hook runtime with real useState/useRef/useEffect, so a handler can be fired and
the following render inspected — that is how the free-text "other" row, the numeric field and the
tag blur race are covered. Both read the bundle id from package.json, so a rename cannot
desynchronise them.
Layout, focus and hit-testing need a browser. tests/lab/ is an offline lab that serves the real
client.js with the real Host-compiled payload and React 18 from tests/lab/vendor/:
node tests/lab/serve.mjs --port 7321 # then open http://127.0.0.1:7321/?form=single
node tests/lab/browser.mjs http://127.0.0.1:7321 # real clicks, real keystrokes, hit tests
node tests/lab/shots.mjs http://127.0.0.1:7321 # before/after screenshots (?client=old)
Before/after of the free-text row (old bundle vs. 0.5.0): before · after, multi before · multi after
browser.mjs needs playwright-core resolvable from its directory; run it next to an installed
node_modules, on a machine whose screen nobody is using.
ctx.tools and ctx.userQuestions.conversation.composer chain and react-dom as a shell seed word (both present in the Web app).@deepseek-ai/dsh-* packages of the 0.2.0-rc.2 era; those APIs may move.pointer-events:none and sits below the app's own dialogs, so an approval
prompt or a settings dialog can never end up underneath it.取消 and the close button are
live even while a submit is in flight, and closing is a local operation — one dropped socket
cannot leave a full-page layer with no way out. Closing also answers cancelled on a
best-effort basis, and drafts are keyed by form so a re-ask restores what was typed.The client-side styles are adapted from MIT-licensed Harness client packages, with class names renamed under this plugin's prefix:
@deepseek-ai/dsh-client-ui-primitives — Button, Input, Tag, SegmentedControl, Modal geometry@deepseek-ai/dsh-client-ui-user-questions — the question card structure, option rows, recommendation badgeMIT — see LICENSE.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。