@staff0rd/assist 0.959.0 → 0.961.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -288,7 +288,7 @@ Rules are `- **<code>** — **<title>** — <text>` bullets, the title optional,
288
288
 
289
289
  ### Hooks
290
290
 
291
- - `assist cli-hook` - PreToolUse hook auto-approving CLI commands from `allowed.cli-reads` / `allowed.cli-writes`, and denying reads of `~/.assist/restricted`
291
+ - `assist cli-hook` - PreToolUse hook auto-approving CLI commands from `allowed.cli-reads` / `allowed.cli-writes`, denying reads of `~/.assist/restricted`, and (with `sessions.askQuestion` on) denying `AskUserQuestion` in assist sessions in favour of `assist ask-question`
292
292
  - `assist cli-hook add <cli>` - Discover a CLI's commands and auto-permit read-only ones
293
293
  - `assist cli-hook check <command> [--tool <tool>]` - Check whether a command would be auto-approved
294
294
  - `assist cli-hook deny` - List all deny rules
@@ -0,0 +1,6 @@
1
+ ---
2
+ title: Asking questions
3
+ when: askQuestion
4
+ ---
5
+
6
+ In an assist session (`ASSIST_SESSION=1`), don't use the built-in AskUserQuestion tool; the user answers from the session's web preview pane, which can't drive the terminal prompt. Write the same AskUserQuestion input as JSON (`{"questions": [...]}`, 1-4 questions each with `question`, `header`, `multiSelect` and 2-4 `options` of `label`, `description` and optional `preview`) to a scratch file and run `assist ask-question --json - < <file>` as a background task, doing no other work until it returns. It opens as a form in the preview pane and blocks until answered. Answering exits 0 and prints the same answer text AskUserQuestion returns; dismissing exits non-zero, meaning the user declined to answer. To revise a still-pending question, re-run it directly; the earlier task then exits 0 as superseded — ignore its result. Outside an assist session it exits non-zero, so use AskUserQuestion.
@@ -26,6 +26,10 @@
26
26
  "matcher": "Read|Grep|Glob",
27
27
  "hooks": [{ "type": "command", "command": "assist cli-hook" }]
28
28
  },
29
+ {
30
+ "matcher": "AskUserQuestion",
31
+ "hooks": [{ "type": "command", "command": "assist cli-hook" }]
32
+ },
29
33
  {
30
34
  "matcher": "Edit|Write|MultiEdit",
31
35
  "hooks": [{ "type": "command", "command": "assist edit-hook" }]