pi-mono-all 1.0.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/CHANGELOG.md +13 -0
- package/LICENCE.md +7 -0
- package/node_modules/pi-common/package.json +22 -0
- package/node_modules/pi-common/src/auth-config.ts +290 -0
- package/node_modules/pi-common/src/auth.ts +63 -0
- package/node_modules/pi-common/src/cache.ts +60 -0
- package/node_modules/pi-common/src/errors.ts +47 -0
- package/node_modules/pi-common/src/http-client.ts +118 -0
- package/node_modules/pi-common/src/index.ts +7 -0
- package/node_modules/pi-common/src/rate-limiter.ts +32 -0
- package/node_modules/pi-common/src/tool-result.ts +27 -0
- package/node_modules/pi-mono-ask-user-question/CHANGELOG.md +185 -0
- package/node_modules/pi-mono-ask-user-question/README.md +226 -0
- package/node_modules/pi-mono-ask-user-question/index.ts +923 -0
- package/node_modules/pi-mono-ask-user-question/package.json +29 -0
- package/node_modules/pi-mono-auto-fix/CHANGELOG.md +59 -0
- package/node_modules/pi-mono-auto-fix/README.md +77 -0
- package/node_modules/pi-mono-auto-fix/index.ts +488 -0
- package/node_modules/pi-mono-auto-fix/package.json +23 -0
- package/node_modules/pi-mono-btw/CHANGELOG.md +180 -0
- package/node_modules/pi-mono-btw/README.md +24 -0
- package/node_modules/pi-mono-btw/index.ts +499 -0
- package/node_modules/pi-mono-btw/package.json +29 -0
- package/node_modules/pi-mono-clear/CHANGELOG.md +180 -0
- package/node_modules/pi-mono-clear/README.md +40 -0
- package/node_modules/pi-mono-clear/index.ts +45 -0
- package/node_modules/pi-mono-clear/package.json +29 -0
- package/node_modules/pi-mono-context/CHANGELOG.md +12 -0
- package/node_modules/pi-mono-context/README.md +74 -0
- package/node_modules/pi-mono-context/index.ts +641 -0
- package/node_modules/pi-mono-context/package.json +29 -0
- package/node_modules/pi-mono-context-guard/CHANGELOG.md +195 -0
- package/node_modules/pi-mono-context-guard/README.md +81 -0
- package/node_modules/pi-mono-context-guard/index.ts +212 -0
- package/node_modules/pi-mono-context-guard/package.json +23 -0
- package/node_modules/pi-mono-figma/CHANGELOG.md +59 -0
- package/node_modules/pi-mono-figma/README.md +236 -0
- package/node_modules/pi-mono-figma/__tests__/code-connect.test.ts +32 -0
- package/node_modules/pi-mono-figma/__tests__/figma-assets.test.ts +38 -0
- package/node_modules/pi-mono-figma/__tests__/figma-component-hints.test.ts +23 -0
- package/node_modules/pi-mono-figma/__tests__/figma-implementation-layout.test.ts +47 -0
- package/node_modules/pi-mono-figma/__tests__/figma-search.test.ts +51 -0
- package/node_modules/pi-mono-figma/__tests__/figma-summarizer.test.ts +65 -0
- package/node_modules/pi-mono-figma/__tests__/fixtures/complex-auto-layout.json +115 -0
- package/node_modules/pi-mono-figma/__tests__/fixtures/component-instance.json +50 -0
- package/node_modules/pi-mono-figma/__tests__/fixtures/hidden-and-vectors.json +28 -0
- package/node_modules/pi-mono-figma/__tests__/fixtures/variables-and-styles.json +40 -0
- package/node_modules/pi-mono-figma/docs/live-selection-bridge.md +16 -0
- package/node_modules/pi-mono-figma/index.ts +6 -0
- package/node_modules/pi-mono-figma/package.json +33 -0
- package/node_modules/pi-mono-figma/skills/figma/SKILL.md +143 -0
- package/node_modules/pi-mono-figma/src/code-connect.ts +110 -0
- package/node_modules/pi-mono-figma/src/figma-assets.ts +146 -0
- package/node_modules/pi-mono-figma/src/figma-cache.ts +6 -0
- package/node_modules/pi-mono-figma/src/figma-client.ts +471 -0
- package/node_modules/pi-mono-figma/src/figma-component-hints.ts +87 -0
- package/node_modules/pi-mono-figma/src/figma-implementation.ts +264 -0
- package/node_modules/pi-mono-figma/src/figma-schemas.ts +139 -0
- package/node_modules/pi-mono-figma/src/figma-search.ts +195 -0
- package/node_modules/pi-mono-figma/src/figma-summarizer.ts +673 -0
- package/node_modules/pi-mono-figma/src/figma-tokens.ts +57 -0
- package/node_modules/pi-mono-figma/src/figma-tools.ts +352 -0
- package/node_modules/pi-mono-linear/CHANGELOG.md +44 -0
- package/node_modules/pi-mono-linear/README.md +159 -0
- package/node_modules/pi-mono-linear/index.ts +6 -0
- package/node_modules/pi-mono-linear/package.json +30 -0
- package/node_modules/pi-mono-linear/skills/linear/SKILL.md +107 -0
- package/node_modules/pi-mono-linear/src/linear-client.ts +339 -0
- package/node_modules/pi-mono-linear/src/linear-queries.ts +101 -0
- package/node_modules/pi-mono-linear/src/linear-schemas.ts +90 -0
- package/node_modules/pi-mono-linear/src/linear-tools.ts +362 -0
- package/node_modules/pi-mono-loop/CHANGELOG.md +163 -0
- package/node_modules/pi-mono-loop/README.md +54 -0
- package/node_modules/pi-mono-loop/index.ts +291 -0
- package/node_modules/pi-mono-loop/package.json +26 -0
- package/node_modules/pi-mono-multi-edit/CHANGELOG.md +232 -0
- package/node_modules/pi-mono-multi-edit/README.md +244 -0
- package/node_modules/pi-mono-multi-edit/__tests__/classic.test.ts +277 -0
- package/node_modules/pi-mono-multi-edit/__tests__/diff.test.ts +77 -0
- package/node_modules/pi-mono-multi-edit/__tests__/patch.test.ts +287 -0
- package/node_modules/pi-mono-multi-edit/benchmark-edits.ts +966 -0
- package/node_modules/pi-mono-multi-edit/classic.ts +435 -0
- package/node_modules/pi-mono-multi-edit/diff.ts +143 -0
- package/node_modules/pi-mono-multi-edit/index.ts +266 -0
- package/node_modules/pi-mono-multi-edit/package.json +37 -0
- package/node_modules/pi-mono-multi-edit/patch.ts +463 -0
- package/node_modules/pi-mono-multi-edit/types.ts +53 -0
- package/node_modules/pi-mono-multi-edit/workspace.ts +85 -0
- package/node_modules/pi-mono-review/CHANGELOG.md +190 -0
- package/node_modules/pi-mono-review/README.md +30 -0
- package/node_modules/pi-mono-review/common.ts +930 -0
- package/node_modules/pi-mono-review/index.ts +8 -0
- package/node_modules/pi-mono-review/package.json +29 -0
- package/node_modules/pi-mono-review/review-tui.ts +194 -0
- package/node_modules/pi-mono-review/review.ts +119 -0
- package/node_modules/pi-mono-review/reviewer.ts +339 -0
- package/node_modules/pi-mono-sentinel/CHANGELOG.md +158 -0
- package/node_modules/pi-mono-sentinel/README.md +87 -0
- package/node_modules/pi-mono-sentinel/__tests__/output-scanner.test.ts +109 -0
- package/node_modules/pi-mono-sentinel/__tests__/permissions.test.ts +202 -0
- package/node_modules/pi-mono-sentinel/__tests__/whitelist.test.ts +59 -0
- package/node_modules/pi-mono-sentinel/guards/execution-tracker.ts +281 -0
- package/node_modules/pi-mono-sentinel/guards/output-scanner.ts +232 -0
- package/node_modules/pi-mono-sentinel/guards/permission-gate.ts +170 -0
- package/node_modules/pi-mono-sentinel/index.ts +43 -0
- package/node_modules/pi-mono-sentinel/package.json +26 -0
- package/node_modules/pi-mono-sentinel/patterns/permissions.ts +175 -0
- package/node_modules/pi-mono-sentinel/patterns/read-targets.ts +104 -0
- package/node_modules/pi-mono-sentinel/patterns/secrets.ts +143 -0
- package/node_modules/pi-mono-sentinel/session.ts +95 -0
- package/node_modules/pi-mono-sentinel/specs/2026/04/sentinel/001-permission-gate.md +145 -0
- package/node_modules/pi-mono-sentinel/types.ts +39 -0
- package/node_modules/pi-mono-sentinel/whitelist.ts +86 -0
- package/node_modules/pi-mono-simplify/CHANGELOG.md +163 -0
- package/node_modules/pi-mono-simplify/README.md +56 -0
- package/node_modules/pi-mono-simplify/index.ts +78 -0
- package/node_modules/pi-mono-simplify/package.json +29 -0
- package/node_modules/pi-mono-status-line/CHANGELOG.md +180 -0
- package/node_modules/pi-mono-status-line/README.md +96 -0
- package/node_modules/pi-mono-status-line/basic.ts +89 -0
- package/node_modules/pi-mono-status-line/expert.ts +689 -0
- package/node_modules/pi-mono-status-line/index.ts +54 -0
- package/node_modules/pi-mono-status-line/package.json +29 -0
- package/node_modules/pi-mono-team-mode/CHANGELOG.md +278 -0
- package/node_modules/pi-mono-team-mode/README.md +246 -0
- package/node_modules/pi-mono-team-mode/__tests__/agent-manager-transient.test.ts +75 -0
- package/node_modules/pi-mono-team-mode/__tests__/delegation-manager.test.ts +118 -0
- package/node_modules/pi-mono-team-mode/__tests__/formatters.test.ts +104 -0
- package/node_modules/pi-mono-team-mode/__tests__/model-config.test.ts +272 -0
- package/node_modules/pi-mono-team-mode/__tests__/notification-box.test.ts +34 -0
- package/node_modules/pi-mono-team-mode/__tests__/parallel-utils.test.ts +32 -0
- package/node_modules/pi-mono-team-mode/__tests__/pi-stream-parser.test.ts +64 -0
- package/node_modules/pi-mono-team-mode/__tests__/prompts.test.ts +106 -0
- package/node_modules/pi-mono-team-mode/__tests__/store.test.ts +164 -0
- package/node_modules/pi-mono-team-mode/__tests__/tasks.test.ts +267 -0
- package/node_modules/pi-mono-team-mode/__tests__/teammate-specs.test.ts +114 -0
- package/node_modules/pi-mono-team-mode/__tests__/widget.test.ts +41 -0
- package/node_modules/pi-mono-team-mode/__tests__/worktree.test.ts +78 -0
- package/node_modules/pi-mono-team-mode/core/chain-utils.ts +90 -0
- package/node_modules/pi-mono-team-mode/core/fs-utils.ts +44 -0
- package/node_modules/pi-mono-team-mode/core/model-config.ts +432 -0
- package/node_modules/pi-mono-team-mode/core/parallel-utils.ts +48 -0
- package/node_modules/pi-mono-team-mode/core/prompts.ts +158 -0
- package/node_modules/pi-mono-team-mode/core/store.ts +156 -0
- package/node_modules/pi-mono-team-mode/core/tasks.ts +99 -0
- package/node_modules/pi-mono-team-mode/core/teammate-specs.ts +124 -0
- package/node_modules/pi-mono-team-mode/core/types.ts +160 -0
- package/node_modules/pi-mono-team-mode/index.ts +825 -0
- package/node_modules/pi-mono-team-mode/managers/agent-manager.ts +654 -0
- package/node_modules/pi-mono-team-mode/managers/delegation-manager.ts +211 -0
- package/node_modules/pi-mono-team-mode/managers/task-manager.ts +238 -0
- package/node_modules/pi-mono-team-mode/managers/team-manager.ts +59 -0
- package/node_modules/pi-mono-team-mode/package.json +33 -0
- package/node_modules/pi-mono-team-mode/runtime/pi-stream-parser.ts +194 -0
- package/node_modules/pi-mono-team-mode/runtime/subprocess.ts +183 -0
- package/node_modules/pi-mono-team-mode/runtime/transient-session.ts +196 -0
- package/node_modules/pi-mono-team-mode/runtime/worktree.ts +90 -0
- package/node_modules/pi-mono-team-mode/ui/formatters.ts +149 -0
- package/node_modules/pi-mono-team-mode/ui/notification-box.ts +55 -0
- package/node_modules/pi-mono-team-mode/ui/widget.ts +94 -0
- package/package.json +76 -0
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
# pi-mono-ask-user-question
|
|
2
|
+
|
|
3
|
+
## 1.7.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
### Fixed: form text wrapping
|
|
8
|
+
|
|
9
|
+
- Tab bar now uses compact Q1/Q2/Q3 labels with active and answered indicators so long question labels do not truncate the navigation row.
|
|
10
|
+
- Radio and checkbox option labels now wrap across multiple lines with indented continuation text.
|
|
11
|
+
- Option descriptions now wrap instead of being cut off.
|
|
12
|
+
- The full active question text is shown below the tab bar.
|
|
13
|
+
|
|
14
|
+
## 1.7.2
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
### Fixed: ask-user-question
|
|
19
|
+
|
|
20
|
+
- Remove unused `StringEnum` import from `@mariozechner/pi-ai`.
|
|
21
|
+
|
|
22
|
+
## 1.7.1
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
### Fixed: team-mode
|
|
27
|
+
|
|
28
|
+
- Widget no longer mislabels blocked or approval-pending teams as "running smoothly" — blockers and pending approvals are now detected via team summaries.
|
|
29
|
+
- Preserve in-flight work on re-emitted `session_start` events instead of tearing the runtime down and SIGTERM-ing live teammates.
|
|
30
|
+
- Auto-relaunch leaders for `running` teams after a session reset; surface failures as both a team signal and a UI notification.
|
|
31
|
+
- `createTeam` now defaults `repoRoots` to `[process.cwd()]` when the caller passes an empty array.
|
|
32
|
+
- Archive `process.json` into `history/` before a new task reuses the same role slot, so the prior task's final state is no longer silently clobbered.
|
|
33
|
+
|
|
34
|
+
### Enhanced: team-mode
|
|
35
|
+
|
|
36
|
+
- Durable intent queue for subprocess handoff: `team_spawn_teammate` calls made from a teammate subprocess are written to disk and executed by the main session's `LeaderRuntime` instead of spawning orphaned grand-children.
|
|
37
|
+
- New tool `team_task_create_batch` lets the leader emit the full initial task DAG in one call, removing per-task LLM round-trips during bootstrap.
|
|
38
|
+
- `team_create` / `launchLeader` accept an `awaitBootstrap` option so the user sees the task graph before the tool returns; leader launch retries up to 3 times on transient failures.
|
|
39
|
+
- Persist per-turn debug artifacts (prompt, invocation, stderr, raw event stream) for both leader and teammate subprocesses, exposed via `TeammateSummary.debugArtifacts`.
|
|
40
|
+
- Track `exitCode`, `exitSignal`, `terminationReason`, `stderrTail`, `toolExecutions`, `model` and `modelProvider` on every `TeammateProcess` record.
|
|
41
|
+
- Provider detection now consults pi's `settings.json` and `auth.json` in addition to env vars; default model IDs aligned with the provider/model scheme.
|
|
42
|
+
- `collectPiOutput` supports `AbortSignal` cancellation.
|
|
43
|
+
|
|
44
|
+
### Tests
|
|
45
|
+
|
|
46
|
+
- New `intent-queue` and `model-config` suites; expanded coverage across `leader-runtime`, `team-manager`, `team-query-tool` and `formatters`.
|
|
47
|
+
|
|
48
|
+
## 1.7.0
|
|
49
|
+
|
|
50
|
+
### Minor Changes
|
|
51
|
+
|
|
52
|
+
### Enhanced: status-line
|
|
53
|
+
|
|
54
|
+
- Improved progress rendering and colors in expert mode
|
|
55
|
+
|
|
56
|
+
### Enhanced: team-mode
|
|
57
|
+
|
|
58
|
+
- **LLM-driven leader** — replaced the hardcoded `research → synthesis → implementation → verification` state machine with a pi subprocess coordinator that authors the task graph via tool calls
|
|
59
|
+
- **New tool `team_task_create`** so the leader can author tasks at runtime
|
|
60
|
+
- **New tool `team_handoff`** for explicit teammate → teammate context handoffs (replaces regex-scraping of `Handoffs:` output sections)
|
|
61
|
+
- **File-based teammate specs** — drop `.claude/teammates/<role>.md` frontmatter files (`name`, `description`, `needsWorktree`, `hasMemory`, `modelTier`) to extend or override the seven built-in roles
|
|
62
|
+
- **Event-driven leader wakes** — mailbox messages addressed to the leader (or broadcast) trigger a debounced (~200ms) cycle instead of waiting for the 20s polling tick
|
|
63
|
+
- **Templates accept any string** — `fullstack` / `research` / `refactor` remain as built-ins, but unknown template keys are accepted and no-op gracefully
|
|
64
|
+
- **Provider config per team** — per-team model overrides via `/team models`
|
|
65
|
+
- Reduced leader overhead and parent-session token churn
|
|
66
|
+
- `spawnTeammate` now always appends the full runtime-built context (signals, mailbox, dependencies, team memory) so teammates get the richer snapshot even when the caller's `context` argument is brief
|
|
67
|
+
|
|
68
|
+
### Breaking changes: team-mode
|
|
69
|
+
|
|
70
|
+
- Removed `LeaderPhase` enum and `currentPhase` field from `TeamRecord` / `TeamSummary`
|
|
71
|
+
- Removed `parseExplicitHandoffs` export and the legacy `Handoffs:` output parser — peer handoffs must go through the `team_handoff` tool
|
|
72
|
+
- Removed the deterministic auto-spawn loop (`ensureBootstrapTasks`) — all task authoring and teammate spawning is now the LLM leader's responsibility
|
|
73
|
+
- Removed `StringEnum` gate on `team_create`'s `template` parameter (now plain string)
|
|
74
|
+
|
|
75
|
+
### Fixed: review
|
|
76
|
+
|
|
77
|
+
- Annotate diff lines so the model picks correct line numbers
|
|
78
|
+
- Fix slice chunk around lines for comments in the reviewer TUI
|
|
79
|
+
|
|
80
|
+
### Documentation
|
|
81
|
+
|
|
82
|
+
- Updated root README and sentinel extension README
|
|
83
|
+
- Documented the new file-based teammate spec format and event-driven leader wake in the team-mode README
|
|
84
|
+
|
|
85
|
+
## 1.6.0
|
|
86
|
+
|
|
87
|
+
### Minor Changes
|
|
88
|
+
|
|
89
|
+
### New Extension: sentinel
|
|
90
|
+
|
|
91
|
+
Replaced the `grep` extension with a new security-focused `sentinel` extension for monitoring and guarding sensitive operations.
|
|
92
|
+
|
|
93
|
+
### Enhanced: team-mode
|
|
94
|
+
|
|
95
|
+
- Added comprehensive test suite with integration tests
|
|
96
|
+
- New mock helpers for subprocess testing
|
|
97
|
+
- Improved signal manager with better error handling
|
|
98
|
+
- Leader runtime refactoring for stability
|
|
99
|
+
- Team query tool with dedicated tests
|
|
100
|
+
|
|
101
|
+
### Enhanced: status-line
|
|
102
|
+
|
|
103
|
+
- Added basic and expert mode displays
|
|
104
|
+
- Improved index.ts with better state management
|
|
105
|
+
|
|
106
|
+
### Enhanced: clear
|
|
107
|
+
|
|
108
|
+
- Updated keyboard shortcut to `Ctrl+Shift+L`
|
|
109
|
+
- Better busy-state handling for shortcuts
|
|
110
|
+
- Added warning/cancel handling and error notifications
|
|
111
|
+
|
|
112
|
+
### Enhanced: context-guard
|
|
113
|
+
|
|
114
|
+
- Improved read deduplication across sessions
|
|
115
|
+
- Added `context-guard:file-modified` event for cache eviction
|
|
116
|
+
|
|
117
|
+
### Documentation
|
|
118
|
+
|
|
119
|
+
- Added dedicated README for `clear` extension
|
|
120
|
+
- Added dedicated README for `context-guard` extension
|
|
121
|
+
- Updated main README with improved extension descriptions
|
|
122
|
+
|
|
123
|
+
## 1.5.0
|
|
124
|
+
|
|
125
|
+
### Minor Changes
|
|
126
|
+
|
|
127
|
+
- ### `multi-edit` — diverge from upstream fork
|
|
128
|
+
|
|
129
|
+
The extension was originally derived from [mitsuhiko/agent-stuff](https://github.com/mitsuhiko/agent-stuff)'s `pi-extensions/multi-edit.ts`. This release rewrites the largest unmodified subsystems so the implementation is structurally distinct from upstream while keeping the public contract intact.
|
|
130
|
+
- **Modularized layout** — the 953-line `index.ts` is split into purpose-scoped modules: `types.ts`, `workspace.ts`, `classic.ts`, `patch.ts`, `diff.ts`, and a slim `index.ts` (~180 lines of registration + dispatch wiring).
|
|
131
|
+
- **New patch engine** — `patch.ts` is now a recursive-descent parser over a `LineCursor` class with `indexOf`-based hunk anchoring. Hunks are stored as `{ oldBlock, newBlock }` raw strings (previously `{ oldLines[], newLines[] }` arrays), letting the applier splice content directly instead of reconstructing line arrays per apply.
|
|
132
|
+
- **Two-pass diff renderer** — `diff.ts` now walks `diffLines` parts into a typed `Entry[]` stream and makes all gutter / context-collapse decisions in a second pass, replacing the prior single-loop state-flag design.
|
|
133
|
+
- **Polished classic edits** — extracted `groupEditsByPath`, `sortGroupByPosition`, `applyGroupToContent`, and `rollbackSnapshots` helpers; formalized the quote-fallback as an ordered `MATCH_PASSES` array so new normalizers (dashes, NBSP, etc.) can be added by appending one entry.
|
|
134
|
+
- **First contract test suite** — 34 tests under `__tests__/` cover classic edits (positional reordering, redundant-pair skip, quote fallback, atomic rollback, read-only preflight), patch operations (Add/Delete/Update round-trips, move-rejection, multi-op batches), and diff rendering (line-number gutter, context collapse, add/remove-only cases). Runs via `npm test` (`tsx --test`).
|
|
135
|
+
- **Dropped Codex apply_patch edge cases** (documented in `README.md` → "Codex apply_patch compatibility"): `*** End of File` sentinel hunks, 4-pass fuzzy `seekSequence` matching, implicit first hunk without `@@`, whitespace-tolerant anchoring. Common paths (Add/Delete/Update-single-chunk, Update with multiple hunks, Add+Update+Delete batches) are fully tested and preserved.
|
|
136
|
+
- **README attribution** — new "Origins" section crediting `mitsuhiko/agent-stuff` as the original source.
|
|
137
|
+
|
|
138
|
+
## 1.4.0
|
|
139
|
+
|
|
140
|
+
### Minor Changes
|
|
141
|
+
|
|
142
|
+
- Add teammate progress heartbeats and widget refresh improvements to team mode.
|
|
143
|
+
|
|
144
|
+
## 1.3.0
|
|
145
|
+
|
|
146
|
+
## 1.2.0
|
|
147
|
+
|
|
148
|
+
### Minor Changes
|
|
149
|
+
|
|
150
|
+
- ### `multi-edit` — robustness improvements
|
|
151
|
+
- **No-op write guard**: skip file write and `context-guard:file-modified` event when new content is identical to what was last read — prevents unnecessary watcher churn
|
|
152
|
+
- **Early write-access check**: virtual workspace `checkWriteAccess` now validates real-filesystem permissions during the preflight pass so read-only files fail fast before any real file is touched
|
|
153
|
+
- **Curly-quote normalization**: new `findActualString` helper falls back to normalized quote matching (`"` / `'` ↔ `"` / `'`) when exact `oldText` search fails — the most common class of preflight mismatch
|
|
154
|
+
- **Atomic batch rollback**: `applyClassicEdits` gains a `rollbackOnError` option that restores all successfully written files when a later edit in the same batch fails
|
|
155
|
+
|
|
156
|
+
### `ask-user-question` — UX fixes
|
|
157
|
+
- **Reliable text capture on submit**: answer is read directly from the editor before it clears itself, fixing a race where the stored value was always empty
|
|
158
|
+
- **Unified advance logic**: `advanceTab()` and `saveOtherModeText()` helpers replace scattered single-question fast-paths — behaviour is now consistent regardless of form length
|
|
159
|
+
- **Auto-advance on Enter / Tab**: pressing Enter or Tab in any question (text, radio with "Other", checkbox with "Other") advances to the next tab without requiring a separate click
|
|
160
|
+
|
|
161
|
+
### `team-mode` — stability fixes
|
|
162
|
+
- **Infinite retry loop eliminated**: subprocess guard (`PI_TEAM_SUBPROCESS=1`) prevents spawned pi subprocesses from launching a ghost `LeaderRuntime` that immediately marks in-progress tasks as stalled
|
|
163
|
+
- **Stall detection grace period**: tasks updated within the last 2 × `LEADER_POLL_MS` (10 s) are skipped by `detectStalledTasks` — eliminates false positives on the spawning cycle
|
|
164
|
+
- **Circuit breaker**: tasks that stall more than `MAX_TASK_RETRIES` (3) times are permanently cancelled with a clear error signal instead of being silently re-queued
|
|
165
|
+
- **Concurrent cycle guard**: `runLeaderCycle` returns early if a cycle is already in-flight for the same team, preventing overlapping read-modify-write from the poll interval and completion handlers
|
|
166
|
+
- **Widget cleanup**: cancelled and completed teams are no longer shown in the team widget — only `initializing | running | paused | failed` states are displayed
|
|
167
|
+
- **Shorter auto-generated names**: `objectiveToName` now splits on non-alphanumeric characters (handles path separators), filters stopwords and extreme-length tokens, and hard-caps at 32 characters
|
|
168
|
+
|
|
169
|
+
## 1.1.1
|
|
170
|
+
|
|
171
|
+
### Patch Changes
|
|
172
|
+
|
|
173
|
+
- chore: update all packages for consistency and include team-mode fixes
|
|
174
|
+
|
|
175
|
+
## 1.1.0
|
|
176
|
+
|
|
177
|
+
## 1.0.0
|
|
178
|
+
|
|
179
|
+
### Major Changes
|
|
180
|
+
|
|
181
|
+
- 199c367: First version of the extensions to upload to GitHub
|
|
182
|
+
|
|
183
|
+
### Patch Changes
|
|
184
|
+
|
|
185
|
+
- Bump all packages to 0.1.1
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
# ask-user-question — Interactive Form Tool for pi
|
|
2
|
+
|
|
3
|
+
A [pi](https://github.com/mariozechner/pi-coding-agent) extension that registers a tool the LLM can call to ask the user structured questions using rich form controls: **radio buttons**, **checkboxes**, and **text inputs**.
|
|
4
|
+
|
|
5
|
+
Instead of the LLM asking questions in plain text and waiting for a freeform response, this tool presents an interactive TUI form where each question is typed, validated, and returned as structured data.
|
|
6
|
+
|
|
7
|
+
## How It Works
|
|
8
|
+
|
|
9
|
+
1. **LLM calls the tool** — Passes a JSON schema of questions with types, options, and metadata.
|
|
10
|
+
2. **Form renders** — An interactive panel appears in the terminal with typed controls for each question.
|
|
11
|
+
3. **User answers** — Navigate between questions, select options, type text, toggle checkboxes.
|
|
12
|
+
4. **Structured return** — Answers are returned to the LLM in a clean, structured format.
|
|
13
|
+
|
|
14
|
+
## Question Types
|
|
15
|
+
|
|
16
|
+
### Radio (single-select)
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
❯ ◉ PostgreSQL
|
|
20
|
+
○ MySQL
|
|
21
|
+
○ SQLite
|
|
22
|
+
○ Other...
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Pick exactly one option. Press Enter to select. The "Other..." option opens a text editor for a custom answer.
|
|
26
|
+
|
|
27
|
+
### Checkbox (multi-select)
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
❯ ☑ Unit tests
|
|
31
|
+
☑ Integration tests
|
|
32
|
+
☐ E2E tests
|
|
33
|
+
☐ Other...
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Toggle multiple options with Space. The "Other..." option opens a text editor. Press Enter to advance.
|
|
37
|
+
|
|
38
|
+
### Text (free input)
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
┌─────────────────────────────────┐
|
|
42
|
+
│ Describe the migration strategy │
|
|
43
|
+
└─────────────────────────────────┘
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
A full multi-line editor. Shift+Enter for newlines, Enter to submit.
|
|
47
|
+
|
|
48
|
+
## Tool Schema
|
|
49
|
+
|
|
50
|
+
```json
|
|
51
|
+
{
|
|
52
|
+
"title": "Project Setup",
|
|
53
|
+
"description": "Let me configure the project based on your preferences",
|
|
54
|
+
"questions": [
|
|
55
|
+
{
|
|
56
|
+
"id": "database",
|
|
57
|
+
"type": "radio",
|
|
58
|
+
"prompt": "Which database should we use?",
|
|
59
|
+
"label": "Database",
|
|
60
|
+
"options": [
|
|
61
|
+
{ "value": "postgres", "label": "PostgreSQL", "description": "Best for complex queries" },
|
|
62
|
+
{ "value": "mysql", "label": "MySQL", "description": "Widely supported" },
|
|
63
|
+
{ "value": "sqlite", "label": "SQLite", "description": "Lightweight, file-based" }
|
|
64
|
+
],
|
|
65
|
+
"allowOther": true
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"id": "testing",
|
|
69
|
+
"type": "checkbox",
|
|
70
|
+
"prompt": "Which test types should we set up?",
|
|
71
|
+
"label": "Testing",
|
|
72
|
+
"options": [
|
|
73
|
+
{ "value": "unit", "label": "Unit tests" },
|
|
74
|
+
{ "value": "integration", "label": "Integration tests" },
|
|
75
|
+
{ "value": "e2e", "label": "E2E tests" }
|
|
76
|
+
],
|
|
77
|
+
"allowOther": true
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"id": "notes",
|
|
81
|
+
"type": "text",
|
|
82
|
+
"prompt": "Any additional notes or requirements?",
|
|
83
|
+
"label": "Notes",
|
|
84
|
+
"required": false,
|
|
85
|
+
"placeholder": "Type any extra context here..."
|
|
86
|
+
}
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Question Fields
|
|
92
|
+
|
|
93
|
+
| Field | Type | Default | Description |
|
|
94
|
+
| ------------- | --------------------------------- | ---------------------- | ----------------------------------------------------- |
|
|
95
|
+
| `id` | `string` | _required_ | Unique identifier |
|
|
96
|
+
| `type` | `"radio"` \| `"checkbox"` \| `"text"` | _required_ | Control type |
|
|
97
|
+
| `prompt` | `string` | _required_ | The question text |
|
|
98
|
+
| `label` | `string` | `Q1`, `Q2`... | Short label for tab bar |
|
|
99
|
+
| `options` | `Option[]` | `[]` | Choices for radio/checkbox |
|
|
100
|
+
| `allowOther` | `boolean` | `true` (radio/checkbox) | Show "Other..." option with text input |
|
|
101
|
+
| `required` | `boolean` | `true` | Must be answered before submit |
|
|
102
|
+
| `placeholder` | `string` | — | Placeholder text for text inputs |
|
|
103
|
+
| `default` | `string` \| `string[]` | — | Default value(s) |
|
|
104
|
+
|
|
105
|
+
### Option Fields
|
|
106
|
+
|
|
107
|
+
| Field | Type | Description |
|
|
108
|
+
| ------------- | -------- | ---------------------------------- |
|
|
109
|
+
| `value` | `string` | Value returned to the LLM |
|
|
110
|
+
| `label` | `string` | Display label |
|
|
111
|
+
| `description` | `string` | Help text shown below the label |
|
|
112
|
+
|
|
113
|
+
## Panel Interface
|
|
114
|
+
|
|
115
|
+
### Single Question
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
──────────────────────────────────────────────────────
|
|
119
|
+
Which database should we use? [single-select]
|
|
120
|
+
*required
|
|
121
|
+
|
|
122
|
+
❯ ◉ PostgreSQL
|
|
123
|
+
Best for complex queries
|
|
124
|
+
○ MySQL
|
|
125
|
+
Widely supported
|
|
126
|
+
○ SQLite
|
|
127
|
+
Lightweight, file-based
|
|
128
|
+
○ Other...
|
|
129
|
+
|
|
130
|
+
↑↓ navigate • Enter select • Esc cancel
|
|
131
|
+
──────────────────────────────────────────────────────
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Multiple Questions (tab bar)
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
──────────────────────────────────────────────────────
|
|
138
|
+
Project Setup
|
|
139
|
+
Let me configure the project based on your preferences
|
|
140
|
+
|
|
141
|
+
✓ Database │· Testing │· Notes │✓ Submit
|
|
142
|
+
|
|
143
|
+
Which test types should we set up? [multi-select]
|
|
144
|
+
*required
|
|
145
|
+
|
|
146
|
+
❯ ☑ Unit tests
|
|
147
|
+
☑ Integration tests
|
|
148
|
+
☐ E2E tests
|
|
149
|
+
☐ Other...
|
|
150
|
+
|
|
151
|
+
↑↓ navigate • Space toggle • Tab/←→ navigate • Enter next • Esc cancel
|
|
152
|
+
──────────────────────────────────────────────────────
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Submit Tab (review)
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
──────────────────────────────────────────────────────
|
|
159
|
+
✓ Database │✓ Testing │✓ Notes │✓ Submit
|
|
160
|
+
|
|
161
|
+
Review & Submit
|
|
162
|
+
|
|
163
|
+
Database: PostgreSQL
|
|
164
|
+
Testing: unit, integration
|
|
165
|
+
Notes: Focus on API layer first
|
|
166
|
+
|
|
167
|
+
Press Enter to submit
|
|
168
|
+
|
|
169
|
+
Tab/←→ navigate questions • Enter submit • Esc cancel
|
|
170
|
+
──────────────────────────────────────────────────────
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## Keyboard Reference
|
|
174
|
+
|
|
175
|
+
### Navigation
|
|
176
|
+
|
|
177
|
+
| Key | Action |
|
|
178
|
+
| ----------------- | ------------------------------------- |
|
|
179
|
+
| `Tab` / `→` | Next question (multi-question mode) |
|
|
180
|
+
| `Shift+Tab` / `←` | Previous question |
|
|
181
|
+
| `↑` / `↓` | Navigate options within a question |
|
|
182
|
+
|
|
183
|
+
### Selection
|
|
184
|
+
|
|
185
|
+
| Key | Action |
|
|
186
|
+
| ----------------- | ------------------------------------- |
|
|
187
|
+
| `Enter` | Select radio option / advance / submit |
|
|
188
|
+
| `Space` | Toggle checkbox option |
|
|
189
|
+
| `Enter` (text) | Submit text answer |
|
|
190
|
+
| `Shift+Enter` | Newline in text/other editor |
|
|
191
|
+
|
|
192
|
+
### Other
|
|
193
|
+
|
|
194
|
+
| Key | Action |
|
|
195
|
+
| ----------------- | ------------------------------------- |
|
|
196
|
+
| `Esc` | Cancel (in "Other" mode: go back) |
|
|
197
|
+
|
|
198
|
+
## Output Format
|
|
199
|
+
|
|
200
|
+
The tool returns structured text to the LLM:
|
|
201
|
+
|
|
202
|
+
```
|
|
203
|
+
Database: PostgreSQL
|
|
204
|
+
Testing: unit, integration, (wrote) GraphQL tests
|
|
205
|
+
Notes: Focus on API layer first
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Custom "Other" answers are prefixed with `(wrote)` so the LLM knows they were user-typed.
|
|
209
|
+
|
|
210
|
+
## System Prompt Integration
|
|
211
|
+
|
|
212
|
+
The tool includes `promptSnippet` and `promptGuidelines` so the LLM knows when and how to use it:
|
|
213
|
+
|
|
214
|
+
- Prefers `ask_user_question` over plain-text questions
|
|
215
|
+
- Uses radio for single-choice, checkbox for multi-choice, text for open-ended
|
|
216
|
+
- Groups related questions in a single call
|
|
217
|
+
- Includes "Other" escape hatches by default
|
|
218
|
+
|
|
219
|
+
## Dependencies
|
|
220
|
+
|
|
221
|
+
| Package | Role |
|
|
222
|
+
| ------------------------------- | ------------------------------------------------- |
|
|
223
|
+
| `@mariozechner/pi-coding-agent` | Extension API, theme types |
|
|
224
|
+
| `@mariozechner/pi-tui` | TUI primitives: Editor, Key, matchesKey, etc. |
|
|
225
|
+
| `@mariozechner/pi-ai` | `StringEnum` for Google-compatible enum schemas |
|
|
226
|
+
| `@sinclair/typebox` | JSON Schema definitions for tool parameters |
|