@fyeeme/pi-ask-user 2.0.0 → 2.0.1

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/CHANGELOG.md CHANGED
@@ -2,52 +2,48 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
- ## [2.0.0] - 2026-08-25
5
+ ## [2.0.1] - 2026-08-27
6
6
 
7
- **Major release — first npm publication.** Ships as part of the 2.0 extensions family wave (pi-review / pi-dynamic-workflows / pi-subagents). Highlights below.
7
+ Renamed to `@fyeeme/pi-ask-user` (formerly `@fyeeme/pi-omp-ask`, whose 2.0.0 release carried this codebase); the lightweight `ask_user` extension formerly published under this name now lives as `@fyeeme/pi-ask-user-lite`.
8
8
 
9
- ### Added
9
+ ### Changed
10
10
 
11
- - Review page: multi-question dialogs summarize all answers (custom inputs, notes, unanswered warnings) after the last question; `enter` confirms, `left` revises before submitting. Single-question dialogs keep submitting immediately.
12
- - Per-question status strip (`●`/`○` chips labeled with `header`) showing which questions are answered.
13
- - Inline free-text editor for `Other` answers and notes: the option list stays visible while typing, `esc` returns to the rows, an empty submit declines, and revising prefills the previous text. The dialog no longer closes and reopens around a plain input.
14
- - Numbered options: rows render `1. label` and answers echo the number back to the LLM (`auth: 1. JWT`).
15
- - `tab` / `shift+tab` as aliases for `right` / `left` question navigation.
11
+ - README synced with the current code: per-answer-note and chat-redirect references removed, the transcript description updated to the compact one-line render, and the timeout expiry wording fixed (recommended option, not "noted or recommended"); added a sister-extension comparison table and a user-facing Features section.
12
+ - Transcript subtraction: `renderResult` now renders one compact `question → answer` line per question (multi-question lines prefixed `[id]`) instead of a framed block that re-listed every option with radio/checkbox markers; unselected options no longer appear in the transcript, and the framed chrome (`FramedComponent`) is gone.
13
+ - The Submit review tab now appears only for 3+ questions or any `multi` question; 1–2 single-select questions advance Enter-to-submit without a review page.
14
+ - Side-by-side preview: on wide terminals (inner width ≥ 80) questions carrying previews split into an options pane and a preview pane that follows the cursor (fzf-style, anchored at the top of the body); narrow terminals keep the inline preview under each option.
16
15
 
17
16
  ### Fixed
18
17
 
19
- - Single-select questions no longer look multi-selectable: `space` is now a no-op outside `multi` mode, and selecting a different option replaces the previous `(o)` marker instead of stacking another one.
20
- - Multi-select `enter` with nothing checked is now a no-op instead of recording an empty answer that lit the status chip `●` but echoed `(no selection)` back to the LLM. Users who mean "none of these" can say so via `Other`.
21
-
22
- ### Changed
23
-
24
- - Submitting a custom `Other` answer now also clears stale checkbox marks from the same question.
25
- - Answering a revisited question now jumps to the next unanswered question (or straight to the review page when everything is answered) instead of always stepping one forward and forcing a re-walk of already-answered questions.
18
+ - IME drift in the custom-input prompt, fixed the way pi's TUI documents it (Focusable / "Container Components with Embedded Inputs"): the dialog now implements `Focusable` (propagating focus to an embedded pi-tui `Input` while the prompt is open), and the `Input` renders the input line itself — emitting `CURSOR_MARKER` at the cursor so the TUI positions the hardware cursor and the IME candidate window at the input point — with the full pi-tui input semantics for free: multi-char CJK IME commits, grapheme-aware cursor/delete (emoji as one unit), bracketed paste buffering, kitty CSI-u printable decoding, undo, and kill ring.
19
+ - Transcript no longer shows the questions twice around an ask: `renderCall` now renders only a `Ask · N questions`
20
+ summary line while the dialog is pending, and the full framed question/options/answer block renders once from
21
+ `renderResult` after the user answers. omp updates the framed block in place; pi's `ToolExecutionComponent` appends
22
+ result renders below call renders, so the call-side block was removed instead of duplicated. The call-side
23
+ streaming-args normalization (`normalizeRenderOptions`/`normalizeRenderQuestions`) became dead code and was removed.
24
+ ### Removed
26
25
 
27
- ## [1.2.0] - 2026-07-20
26
+ - The per-answer note subsystem (`n` key, `✎ note` markers, note lines in the Submit review and transcript, `note` fields in results/details, and the legacy path's note plumbing).
27
+ - Dead chat-redirect surface: `ExtensionAskDialogChatResult`, `AskToolDetails.chatRedirect`/`questions`, and the unreachable `kind: "chat"` branches (the dialog never produced a chat result).
28
28
 
29
- ### Added
30
-
31
- - `/ask-demo` command: interactive four-phase battery covering all question types, free-form `Other` input, timeout auto-selection, chat redirect, and cancel semantics — each phase reports the exact text the LLM would receive.
32
29
 
33
- ## [1.1.0] - 2026-07-20
30
+ ## [0.1.0] - 2026-08-23
34
31
 
35
- ### Added
32
+ ### Fixed
36
33
 
37
- - Single full-screen dialog for all questions: `[n/m]` progress counter, `←`/`→` navigation between questions, answer revision with preserved cursor/selection state.
38
- - `timeoutSeconds` parameter: overall budget; on expiry unanswered questions auto-select the recommended option and are flagged `timedOut` in the result.
39
- - `header` question chip, option `preview` lines rendered under the cursored row, and `note` attachment via the `n` key.
40
- - `Chat about this` reserved row: ends the call with a `chatRedirect` result so the LLM can switch to discussion.
41
- - Reserved-label collision check in the execution path (fails fast instead of rendering duplicate rows).
42
- - Agent abort now closes an open dialog and settles the tool as cancelled instead of leaving it pending.
34
+ - Embedded prompt (Other/note) submit ordering: the input is now applied to state before the deferred timeout runs, so a countdown that expires mid-typing keeps the user's answer instead of discarding it and force-picking (omp `#promptForCustomInput` ordering; the old behavior was also asserted by a test, now corrected).
35
+ - Transcript rendering now measures at the live frame width instead of a hardcoded 80 columns, so narrow terminals no longer clip question text.
36
+ - `raceWithSignal` propagates dialog failures instead of swallowing them as a phantom "user cancelled" outcome (matches omp `untilAborted` and the local legacy-path helper).
37
+ - Restored omp's `helpText` construction for the legacy path's select dialogs.
43
38
 
44
39
  ### Changed
45
40
 
46
- - Multi-select `enter` records the current checkbox set as-is (`space` toggles); re-selecting a single-select option replaces a previous custom input.
47
-
48
- ## [1.0.0] - 2026-07-20
41
+ - Terminal bell on ask can be disabled with `PI_OMK_ASK_NOTIFY=0`; the `timeoutSeconds` schema description now states exactly when the countdown resets and what expiry picks.
42
+ - Removed unused imports and zero-call-site helper exports; typed the test harness result.
49
43
 
50
44
  ### Added
51
45
 
52
- - `ask_user` tool: multi-question clarifying prompts with single/multi select, recommended defaults, option descriptions, and free-form "Other" input.
53
- - Custom TUI picker (radio/checkbox) rendered via `ctx.ui.custom`; answers persisted in tool result details for branch-safe replay.
46
+ - Source migration of oh-my-pi's `ask` tool into a pi extension: `AskTool.execute` (chat redirect, empty-single-select cancellation, multi-question navigation loop), the tabbed `AskDialogComponent` (Submit review tab, radio/checkbox markers, per-answer notes, markdown/code previews, fixed-height panel, cursor-following scroll, inactivity countdown with deferred expiry mid-prompt), the legacy per-question selector path (multi-select toggle loop, `+ Done selecting`, timeout tolerance heuristic), the countdown timer, overlay box chrome, theme symbol defaults, and the `ask.md` tool description.
47
+ - pi host adaptation: rich dialog via `ctx.ui.custom()`, RPC degradation to native `ui.select`/`ui.editor`, headless hiding through `session_start` + `setActiveTools` with an execute backstop, `executionMode: "sequential"` in place of omp's exclusive concurrency, `timeoutSeconds` parameter replacing the settings-driven `ask.timeout`, terminal bell replacing desktop notifications, and keybinding-aware select keys via the injected `KeybindingsManager`.
48
+ - omp error semantics: cancel aborts the agent turn (`ctx.abort()` + tool error); unreachable hosts raise a distinct "question was never shown" error.
49
+ - 45 tests covering the dialog component, the legacy selector logic (driven against the full omp UIContext contract), and the tool's host gating.
package/README.md CHANGED
@@ -1,75 +1,129 @@
1
1
  # pi-ask-user
2
2
 
3
- **2.0.0 — first npm release**, part of the 2.0 extensions family wave. Release highlights:
3
+ - **Faithful omp port** — the tabbed ask dialog (Submit review tab, radio/checkbox markers, markdown/code previews with fence splitting and render caching), the inactivity countdown, and the legacy per-question selector path carried over file-by-file.
4
+ - **Compact transcript** — the pending call renders only an `Ask · N questions` summary; the result renders one compact `question → answer` line per question (multi-question lines prefixed `[id]`) — no framed block, no re-listed options.
5
+ - **Robustness fixes over the omp source** — countdown expiry mid-typing keeps the user's answer, live frame-width measurement replaces the hardcoded 80 columns, and dialog failures propagate instead of degrading to a phantom "user cancelled".
6
+ - **Headless-safe** — print/JSON hosts cannot prompt, so the tool is stripped from the active set; a stray call throws a "question was never shown" error instead of hanging.
4
7
 
5
- - **Review page** — multi-question dialogs summarize every answer (custom inputs, notes, unanswered warnings) before submitting; `enter` confirms, `left` revises.
6
- - **Inline free-text editor** — `Other` answers and notes type directly inside the dialog (option list stays visible, `esc` returns, empty submit declines).
7
- - **Numbered options** — rows render `1. label` and answers echo the number back (`auth: 1. JWT`), plus a per-question status strip and `tab`/`shift+tab` navigation.
8
- - Selection semantics hardened: single-select no longer stacks markers, multi-select `enter` with nothing checked is a no-op, custom `Other` answers clear stale checkboxes.
8
+ oh-my-pi's `ask` tool, migrated to a [pi](https://github.com/earendil-works/pi-coding-agent) extension.
9
9
 
10
- Structured `ask_user` tool for [pi](https://github.com/earendil-works/pi-coding-agent). It lets the LLM surface clarifying questions with selectable options while it works, instead of guessing when choices have materially different tradeoffs.
11
-
12
- Ported from the interactive ask flow of [oh-my-pi](https://github.com/can1357/oh-my-pi), adapted to pi's public extension API.
10
+ This is a source migration of the interactive ask feature from
11
+ [oh-my-pi](https://github.com/can1357/oh-my-pi) (a fork of badlogic/pi-mono), not a reimplementation: the tool flow,
12
+ the tabbed ask dialog, the legacy per-question selector path, and the result wording are carried over from
13
+ `packages/coding-agent/src/tools/ask.ts` and `src/modes/components/ask-dialog.ts`, then adapted file-by-file to pi's
14
+ public extension API. Sister extension of [pi-ask-user-lite](../pi-ask-user-lite); the two expose different tools
15
+ (`ask` vs `ask_user`) and should not be enabled together — see
16
+ [pi-ask-user or pi-ask-user-lite?](#pi-ask-user-or-pi-ask-user-lite) below.
13
17
 
14
18
  ## Features
15
19
 
16
- - **Multiple questions in one dialog** — all questions presented through a single dialog with a `[1/3]` progress counter and a per-question status strip (`● Framework ○ Style`); `←` revisits earlier questions to revise answers (cursor and selections preserved), `→` moves forward once the current question is answered.
17
- - **Review before submit** — after the last question, multi-question dialogs show a summary page listing every answer (custom inputs, notes, unanswered warnings); `enter` confirms, `←` goes back to revise. Single-question dialogs still submit immediately.
18
- - **Smart advance** — answering jumps to the next unanswered question, or straight to the review page once everything is answered; revising an earlier answer never forces a re-walk of already-answered ones.
19
- - **Single or multi select** — `multi: true` renders checkboxes (`space` toggles, `enter` records the set and is a no-op while nothing is checked); single-select renders radio markers with the recommended option pre-cursored and suffixed `(Recommended)`.
20
- - **Timeout auto-selection** — optional `timeoutSeconds` budget for the whole dialog; on expiry unanswered questions auto-select the recommended option (or the first) and are flagged `timedOut` so the LLM knows no human chose them.
21
- - **Option descriptions & previews** — short tradeoff text under each label; an option's `preview` lines render while the cursor rests on it. Options render and echo back numbered (`1. label`), so answers read `auth: 1. JWT`.
22
- - **Free-form "Other"** — every question gets an automatic `Other (type your own)` row that opens an editor embedded in the dialog: the option list stays visible while typing, `esc` returns to the rows, and an empty submit declines. Re-selecting an option clears a previous custom input.
23
- - **Answer notes** — press `n` to attach a note through the same inline editor (prefilled when revising); notes are echoed back to the LLM.
24
- - **"Chat about this" redirect** — a reserved row that ends the call with a `chatRedirect` result, telling the LLM the user prefers discussing over answering.
25
- - **Abort-safe** — if the agent turn is aborted while a question is open, the dialog closes and the tool settles as cancelled instead of hanging.
26
- - **Branch-safe state** — answers live in the tool result `details`, so `/tree` branching and session replay see exactly what was asked and answered.
27
- - **Headless-safe** — throws a proper tool error in `-p`/JSON modes instead of hanging.
20
+ - **Tabbed multi-question dialog** — one question per tab with `header` chips in the tab bar, radio markers for single-select, checkboxes for `multi`; select keys resolve through the injected `KeybindingsManager`, so rebound keys keep working.
21
+ - **Submit review gate** — calls with 3+ questions or any `multi` question get a Submit review tab before the answers go out; 1–2 single-select questions advance Enter-to-submit without a review page.
22
+ - **Markdown/code previews** — an option's `preview` (markdown, fenced code) renders fence-split with render caching. On wide terminals (inner width ≥ 80) the dialog splits into an options pane and a cursor-following preview pane (fzf-style); narrow terminals keep the preview inline under the cursored row.
23
+ - **Inline `Other` input with real editor semantics** — the dialog implements pi's `Focusable` contract and embeds a pi-tui `Input` that renders the input line itself: the hardware cursor and IME candidate window sit at the input point, with multi-char CJK IME commits, grapheme-aware cursor/delete (emoji as one unit), bracketed paste, kitty CSI-u decoding, undo, and kill ring. A countdown expiring mid-typing keeps the typed answer.
24
+ - **Inactivity countdown** — `timeoutSeconds` is an idle budget: dialog keypresses reset it (not while typing); expiry auto-picks the recommended option (or the first) and marks it `auto-selected after timeout`.
25
+ - **Compact transcript** — the pending call renders a single `Ask · N questions` line; the result renders one compact `question → answer` line per question (`[id]`-prefixed on multi-question calls) without re-listing unselected options.
26
+ - **omp semantics kept** — cancelling aborts the agent turn; headless hosts (print/JSON) strip the tool at `session_start` with an execute backstop that errors "question was never shown"; a terminal bell rings on ask (opt out with `PI_OMK_ASK_NOTIFY=0`); answers persist in the tool result `details`.
27
+
28
+ ## What migrated
29
+
30
+ | oh-my-pi source | Here | Notes |
31
+ |---|---|---|
32
+ | `tools/ask.ts` — `AskTool.execute` | `index.ts` | result-count validation, empty-single-select cancellation (#8265), multi-question loop with navigation state, cancel-aborts-turn semantics |
33
+ | `tools/ask.ts` — `askSingleQuestion` + custom-input title windowing | `src/ask-legacy.ts` | multi-select toggle loop with `+ Done selecting`, recommended suffixes, `Other` via editor, timeout tolerance heuristic (`TIMEOUT_DETECTION_TOLERANCE_MS`), `(i/n)` progress titles |
34
+ | `modes/components/ask-dialog.ts` — `AskDialogComponent` | `src/ask-dialog.ts` | tabbed dialog, Submit review tab, radio/checkbox markers, markdown/code previews with fence splitting and render caching, fixed-height panel sizing, cursor-following scroll, inactivity countdown, malformed-args normalization |
35
+ | `modes/components/countdown-timer.ts` | `src/countdown-timer.ts` | verbatim |
36
+ | `modes/components/overlay-box.ts` (subset) | `src/overlay-box.ts` | `topBorder`/`divider`/`row`/`bottomBorder`/`fit` |
37
+ | `prompts/tools/ask.md` | `index.ts` | tool description, verbatim |
38
+ | theme symbol defaults (`modes/theme/symbols.ts`) | `src/compat.ts` | `❯ ◉ ○ ☑ ☐ ╭╮╰╯` |
39
+
40
+ ## Adaptation notes (omp surface → pi extension API)
41
+
42
+ Each omp-internal surface maps onto the closest public pi extension boundary:
43
+
44
+ - **`AgentTool` + `createIf` gate** → `pi.registerTool` + `session_start` strip: print/JSON hosts cannot prompt, so the
45
+ tool is removed from the active set; if it is still called, `execute` throws with a "question was never shown" error
46
+ so the model stops retrying instead of misreading a cancel.
47
+ - **ArkType schema + reserved-label narrow** → typebox schema; the narrow runs at the top of `execute`.
48
+ - **`concurrency: "exclusive"`** → `executionMode: "sequential"` (pi tool batches).
49
+ - **`ExtensionUIContext.askDialog`** → `ctx.ui.custom()` mounting `AskDialogComponent`.
50
+ - **`#presentDialog` serial queue** → not needed: `ui.custom()` is a single editor slot and the sequential execution
51
+ mode already serializes ask calls.
52
+ - **Nested `HookEditorComponent` prompts** (Other) → an embedded prompt mode inside the dialog: pi extensions own
53
+ one custom component slot, so the dialog renders the input row itself (`#promptActive`) with Enter confirm / Esc back.
54
+ - **Keybindings** — omp's global `matchesSelectUp/…` matchers resolve through the `KeybindingsManager` pi injects into
55
+ `ui.custom()`, so rebound select keys keep working; footer hints use the configured keys.
56
+ - **`ui.select` dialog options** — pi's select accepts only `{signal, timeout}`. The legacy path keeps the full omp
57
+ `UIContext` logic (initial index, navigation, markers, timeout callbacks) and degrades on pi: no radio/checkbox
58
+ markers, no initial cursor, no ←/→ question navigation, and option descriptions are dropped from the visible list.
59
+ - **`ui.editor` prompt style** → pi's `ui.editor` (multi-line) with a signal race; falls back to `ui.input`.
60
+ - **settings `ask.timeout` / `ask.notify`** → `timeoutSeconds` tool parameter + terminal bell, opt-out with
61
+ `PI_OMK_ASK_NOTIFY=0` (pi extensions cannot read pi settings or send desktop notifications).
62
+ - **`ToolAbortError` + `context.abort()`** → `ctx.abort()` + thrown error (cancel aborts the agent turn, omp semantics).
63
+ - **Transcript renderer** — omp merges call+result in one framed block that updates in place when the user answers;
64
+ pi's tool rows append the result render below the call render, so the call slot renders only a `Ask · N questions`
65
+ summary line while pending, and the result slot renders one compact `question → answer` line per question
66
+ (multi-question lines prefixed `[id]`, with the `auto-selected after timeout — not a user choice` marker).
67
+
68
+ **Dropped (no pi extension surface):** TTS vocalizer, plan-mode timeout suppression, collab guest racing, ACP
69
+ elicitation forms, `/tree` re-answer, `loadMode: "discoverable"`, the draft-editor input guard, and
70
+ `renderInlineMarkdown` for labels (labels render as plain text; block markdown in questions/previews still uses pi's
71
+ Markdown component + `getMarkdownTheme`). Post-2.0 the per-answer note subsystem and the dead chat-redirect surface
72
+ were also removed (see [Unreleased](./CHANGELOG.md)).
28
73
 
29
74
  ## Tool schema
30
75
 
31
76
  ```text
32
- ask_user(
77
+ ask(
33
78
  questions: [
34
79
  {
35
80
  id: string // stable identifier, echoed in the answer
36
81
  question: string // shown to the user
37
- header?: string // short chip rendered next to the progress counter
38
- options: [{ // 2-6 options
82
+ header?: string // short chip in the tab bar
83
+ options: [{
39
84
  label,
40
85
  description?, // tradeoff text under the label
41
- preview? // lines shown while the cursor rests on the option
86
+ preview? // markdown / fenced code shown under the cursored option
42
87
  }]
43
88
  multi?: boolean // allow multiple selections
44
- recommended?: number // 0-based index of the recommended option
89
+ recommended?: number // 0-based index; "(Recommended)" added automatically
45
90
  }
46
91
  ],
47
- timeoutSeconds?: number // overall budget; expiry auto-selects recommended
92
+ timeoutSeconds?: number // omp settings ask.timeout, parameterized; idle budget,
93
+ // dialog keypresses reset it (not while typing Other),
94
+ // expiry auto-picks the recommended option (or the first)
48
95
  )
49
96
  ```
50
97
 
51
- ## Keys
98
+ ## Result semantics (omp wording, verbatim)
52
99
 
53
- | Key | Action |
54
- |-----|--------|
55
- | `up` / `down` | Move cursor across rows |
56
- | `space` | Toggle checkbox (multi-select only) |
57
- | `enter` | Select / record answer / advance to the next unanswered question (no-op in multi-select with nothing checked); on the review page, submit |
58
- | `←` / `→` | Previous / next question (`→` requires an answer first) |
59
- | `tab` / `shift+tab` | Aliases for `→` / `←` |
60
- | `n` | Attach a note to the current answer |
61
- | `esc` | Cancel the whole call (inside the inline editor: back to the rows) |
100
+ ```text
101
+ User selected: JWT
102
+ User provided custom input: mTLS everywhere
103
+ User answers:
104
+ auth: JWT
105
+ deploy: [staging, prod]
106
+ deploy: staging (auto-selected after timeout)
107
+ ```
62
108
 
63
- ## Trying it out: `/ask-demo`
109
+ Cancelling (Escape) aborts the agent turn — omp's "cancel the whole call" semantics, via `ctx.abort()` plus a tool
110
+ error. An unreachable host (print/JSON) raises a different error stating the question was never displayed.
64
111
 
65
- The extension registers an interactive battery that exercises every feature end-to-end:
112
+ ## pi-ask-user or pi-ask-user-lite?
66
113
 
67
- 1. **All question types** — single-select with `(Recommended)` + cursor-rest `preview`, multi-select checkboxes, and an `Other (type your own)` free-form answer (add a note with `n` on the last question), then confirm on the review page.
68
- 2. **Timeout** — a dialog with a 6-second budget; do nothing and watch it auto-select the recommended option.
69
- 3. **Chat redirect** — pick the `Chat about this` row.
70
- 4. **Cancel** — press `Esc` on the first of two questions and confirm the second is never asked.
114
+ Sister packages with intentionally different scopes — pick one, do not enable both:
71
115
 
72
- Each phase reports the collected answers back through a notification so you can verify what the LLM would receive.
116
+ | | pi-ask-user (this one, tool `ask`) | pi-ask-user-lite (tool `ask_user`) |
117
+ |---|---|---|
118
+ | Lineage | File-by-file source port of oh-my-pi's `ask` tool | Pi-native reimplementation of the ask flow |
119
+ | Dialog | Tabbed dialog; Submit review tab for 3+ questions or any `multi`; fzf-style side-by-side preview pane on wide terminals | Single question-page dialog with `[n/m]` counter and per-question status strip; review page after the last question |
120
+ | Option rows | omp radio/checkbox markers | Numbered (`1. label`); answers echo the number back |
121
+ | Previews | Markdown/code, fence-split with render caching | Plain `preview` lines under the cursored option |
122
+ | Timeout | Inactivity countdown reset by keypresses (paused while typing); expiry auto-picks the recommended option | Whole-dialog budget; expiry auto-selects recommended and flags `timedOut` |
123
+ | Notes | Not available (removed post-2.0) | Per-answer notes via `n`, echoed to the LLM |
124
+ | Chat redirect | Removed (dead omp surface) | Reserved `Chat about this` row |
125
+ | Cancel | Aborts the agent turn (omp semantics) | Tool settles cancelled; the LLM is told to proceed conservatively |
126
+ | Extras | Terminal bell (opt out with `PI_OMK_ASK_NOTIFY=0`) | `/ask-demo` interactive battery |
73
127
 
74
128
  ## Install
75
129
 
@@ -87,48 +141,14 @@ Or load ad hoc:
87
141
  pi -e ./packages/extensions/pi-ask-user/index.ts
88
142
  ```
89
143
 
90
- ## Usage
91
-
92
- Just ask the agent something ambiguous; with the tool active the LLM can call:
93
-
94
- ```json
95
- {
96
- "questions": [
97
- {
98
- "id": "storage",
99
- "question": "Which storage backend should this feature use?",
100
- "options": [
101
- { "label": "SQLite", "description": "Zero-config, file-based" },
102
- { "label": "PostgreSQL", "description": "Full server, richer types" }
103
- ],
104
- "recommended": 0
105
- },
106
- {
107
- "id": "flags",
108
- "question": "Which extras should be enabled?",
109
- "multi": true,
110
- "options": [{ "label": "Telemetry" }, { "label": "Auto-update" }]
111
- }
112
- ]
113
- }
114
- ```
115
-
116
- The user picks with arrow keys (`space` toggles in multi mode, `enter` submits, `←` revises earlier answers, `esc` cancels). Cancelling marks the call cancelled and tells the LLM to proceed conservatively.
117
-
118
- ## Boundaries
119
-
120
- - Requires an interactive session (TUI or RPC); in print/JSON mode the tool errors out.
121
- - No per-question timers: `timeoutSeconds` budgets the whole dialog, not each question.
122
- - No TTS, system-level notifications, or `/tree` re-answer branching — pi's extension API does not expose those surfaces; answers remain inspectable via persisted `details`.
123
-
124
144
  ## Development
125
145
 
126
146
  ```bash
127
- npm install --ignore-scripts
147
+ npm install
128
148
  npm run typecheck
129
149
  npm test
130
150
  ```
131
151
 
132
152
  ## License
133
153
 
134
- MIT
154
+ MIT — the migrated oh-my-pi sources retain their upstream origin (can1357/oh-my-pi, fork of badlogic/pi-mono).