pi-agent-flow 1.8.28 → 1.8.30
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 +121 -19
- package/agents/build.md +0 -3
- package/agents/ideas.md +0 -4
- package/agents/scout.md +0 -3
- package/dist/agents.d.ts +0 -2
- package/dist/agents.d.ts.map +1 -1
- package/dist/agents.js +0 -11
- package/dist/agents.js.map +1 -1
- package/dist/ask-user.d.ts +1 -1
- package/dist/ask-user.d.ts.map +1 -1
- package/dist/ask-user.js +35 -9
- package/dist/ask-user.js.map +1 -1
- package/dist/batch/batch-bash.d.ts +5 -0
- package/dist/batch/batch-bash.d.ts.map +1 -1
- package/dist/batch/batch-bash.js +39 -5
- package/dist/batch/batch-bash.js.map +1 -1
- package/dist/batch/constants.d.ts +2 -6
- package/dist/batch/constants.d.ts.map +1 -1
- package/dist/batch/constants.js +2 -0
- package/dist/batch/constants.js.map +1 -1
- package/dist/batch/execute.js +4 -4
- package/dist/batch/render.d.ts +1 -1
- package/dist/batch/render.d.ts.map +1 -1
- package/dist/batch/render.js +19 -3
- package/dist/batch/render.js.map +1 -1
- package/dist/executor.d.ts.map +1 -1
- package/dist/executor.js +6 -0
- package/dist/executor.js.map +1 -1
- package/dist/flow-prompt.d.ts +3 -2
- package/dist/flow-prompt.d.ts.map +1 -1
- package/dist/flow-prompt.js +3 -5
- package/dist/flow-prompt.js.map +1 -1
- package/dist/flow.d.ts +0 -1
- package/dist/flow.d.ts.map +1 -1
- package/dist/flow.js +1 -5
- package/dist/flow.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +41 -20
- package/dist/index.js.map +1 -1
- package/dist/notify-state.d.ts +33 -0
- package/dist/notify-state.d.ts.map +1 -0
- package/dist/notify-state.js +38 -0
- package/dist/notify-state.js.map +1 -0
- package/dist/notify.d.ts.map +1 -1
- package/dist/notify.js +69 -2
- package/dist/notify.js.map +1 -1
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +280 -92
- package/dist/render.js.map +1 -1
- package/dist/scramble.d.ts +171 -0
- package/dist/scramble.d.ts.map +1 -0
- package/dist/scramble.js +2236 -0
- package/dist/scramble.js.map +1 -0
- package/dist/settings-resolver.js +2 -2
- package/dist/settings-resolver.js.map +1 -1
- package/dist/single-select-layout.js +1 -1
- package/dist/snapshot.d.ts +1 -6
- package/dist/snapshot.d.ts.map +1 -1
- package/dist/snapshot.js +38 -17
- package/dist/snapshot.js.map +1 -1
- package/dist/spec-mode.d.ts +13 -0
- package/dist/spec-mode.d.ts.map +1 -0
- package/dist/spec-mode.js +90 -0
- package/dist/spec-mode.js.map +1 -0
- package/dist/steering-hint.d.ts +45 -0
- package/dist/steering-hint.d.ts.map +1 -0
- package/dist/steering-hint.js +186 -0
- package/dist/steering-hint.js.map +1 -0
- package/dist/tool-utils.d.ts +0 -1
- package/dist/tool-utils.d.ts.map +1 -1
- package/dist/tool-utils.js +0 -7
- package/dist/tool-utils.js.map +1 -1
- package/dist/transitions.js +1 -1
- package/dist/transitions.js.map +1 -1
- package/dist/types.d.ts +3 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -1
- package/dist/web-tool.d.ts +13 -2
- package/dist/web-tool.d.ts.map +1 -1
- package/dist/web-tool.js +54 -11
- package/dist/web-tool.js.map +1 -1
- package/package.json +1 -1
- package/dist/sliding-prompt.d.ts +0 -40
- package/dist/sliding-prompt.d.ts.map +0 -1
- package/dist/sliding-prompt.js +0 -121
- package/dist/sliding-prompt.js.map +0 -1
package/README.md
CHANGED
|
@@ -54,15 +54,19 @@ pi install .
|
|
|
54
54
|
- **Cycle prevention** — blocks re-entering flows already in the ancestor stack
|
|
55
55
|
- **Model tiering & failover** — flows map to `lite` / `flash` / `full` tiers with primary + failover model chains
|
|
56
56
|
- **Persistent flow mode** — switch global model strategies with `--flow-mode`; written to `settings.json` and remembered across sessions
|
|
57
|
-
- **Flow-mode notification** — concise (`mode: name | lite: model
|
|
57
|
+
- **Flow-mode notification** — concise (`mode: name | lite: model - flash: model - full: model`) or verbose (with per-tier flow-name labels) startup message
|
|
58
58
|
- **Unified batch tools** — `batch` (read/write/edit/delete) and `batch_read` replace separate file tools for cross-cutting work
|
|
59
59
|
- **Web tool** — built-in `web` search (Brave + DuckDuckGo) and page fetch with HTML→Markdown conversion
|
|
60
|
-
- **
|
|
61
|
-
- **Session snapshot sanitization** — removes
|
|
60
|
+
- **Steering hint** — lightweight routing reminder dynamically injected before each user message (never part of the static system prompt); switches between spec-driven planning and implement modes based on the `/spec` toggle, stripped from child snapshots to avoid duplication
|
|
61
|
+
- **Session snapshot sanitization** — removes steering hints, reasoning/thinking artifacts, and non-inheritable content before forking; compresses prior flow results into compact context maps
|
|
62
62
|
- **Shared context inheritance** — child flows receive the parent's sanitized session automatically; write forward-looking intents and let the child pick up context from its inherited snapshot
|
|
63
63
|
- **Project flow confirmation** — prompts before running project-local flows from `.pi/agents/` for security
|
|
64
|
-
- **Rich TUI rendering** — collapsed activity-panel view with per-flow stats, live countdowns, and expanded view with full reports and tool traces
|
|
64
|
+
- **Rich TUI rendering** — collapsed activity-panel view with per-flow stats, live countdowns, scramble-animated act/msg/tps lines, and expanded view with full reports and tool traces
|
|
65
65
|
- **Smooth streaming metrics** — token counters and smoothed TPS increment tick-by-tick during active streaming
|
|
66
|
+
- **Quad-mode TUI scramble** — `stream`, `cascade`, `ripple`, and `illuminate` text animations on act, msg, TPS lines, and tool results (batch, web, ask_user) in the collapsed activity panel (default: `illuminate`)
|
|
67
|
+
- **`/spec` command** — toggle spec-driven planning mode that guides the orchestrator through investigate → discuss → plan → delegate
|
|
68
|
+
- **Dynamic notifications** — terminal and desktop alerts adapt their title/body based on flow completion state or pending `ask_user` decisions
|
|
69
|
+
- **Preferred-choice guidance** — `ask_user` prompts can mark a recommended option with `[preferred]` and place it first
|
|
66
70
|
|
|
67
71
|
---
|
|
68
72
|
|
|
@@ -88,7 +92,7 @@ When you delegate to a flow, the child agent receives an automatic **sanitized f
|
|
|
88
92
|
### How it works
|
|
89
93
|
|
|
90
94
|
1. **Snapshot serialized** — your conversation (files read, commands run, prior flow results) is serialized into a JSONL snapshot.
|
|
91
|
-
2. **Sanitized** —
|
|
95
|
+
2. **Sanitized** — steering hints, reasoning/thinking artifacts, and other non-inheritable content are stripped.
|
|
92
96
|
3. **Compressed** — prior flow tool results are compacted into short summaries: files touched, commands used, outcome status.
|
|
93
97
|
4. **Forked** — the child agent loads this snapshot via `--session` at startup.
|
|
94
98
|
|
|
@@ -116,12 +120,12 @@ The child's `<context-seal>` prompt tells it: *"The conversation above is sealed
|
|
|
116
120
|
|
|
117
121
|
| Flow | Purpose | Tools | Tier |
|
|
118
122
|
|------|---------|-------|------|
|
|
119
|
-
| `[scout]` | Discover files, trace code paths, map architecture | `batch`, `bash`, `find`, `grep`, `ls` | `lite` |
|
|
120
|
-
| `[debug]` | Investigate logs, errors, stack traces, root causes | `batch`, `bash`, `find`, `grep`, `ls` | `lite` |
|
|
121
|
-
| `[build]` | Implement features, fix bugs, write tests,
|
|
122
|
-
| `[craft]` | Plan structure, break down requirements, design solutions | `batch`, `bash`, `find`, `grep`, `ls` | `full` |
|
|
123
|
-
| `[audit]` | Audit security, quality, correctness; fix safe issues autonomously | `batch`, `bash`, `find`, `grep`, `ls` | `flash` |
|
|
124
|
-
| `[ideas]` | Generate ideas
|
|
123
|
+
| `[scout]` | Discover files, trace code paths, map architecture | `batch`, `bash`, `find`, `grep`, `ls`, `web` | `lite` |
|
|
124
|
+
| `[debug]` | Investigate logs, errors, stack traces, root causes, and fix bugs | `batch`, `bash`, `find`, `grep`, `ls`, `web` | `lite` |
|
|
125
|
+
| `[build]` | Implement features, fix bugs, write tests, deploy, and ship | `batch`, `bash`, `find`, `grep`, `ls`, `web` | `flash` |
|
|
126
|
+
| `[craft]` | Plan structure, break down requirements, design solutions | `batch`, `bash`, `find`, `grep`, `ls`, `web` | `full` |
|
|
127
|
+
| `[audit]` | Audit security, quality, correctness; fix safe issues autonomously | `batch`, `bash`, `find`, `grep`, `ls`, `web` | `flash` |
|
|
128
|
+
| `[ideas]` | Generate ideas, explore possibilities, and think creatively using inherited context | `batch`, `bash`, `web` | `full` |
|
|
125
129
|
|
|
126
130
|
> **Note:** All bundled flows have `maxDepth: 0`, meaning they do not delegate further by default. Custom flows can override this via front-matter.
|
|
127
131
|
|
|
@@ -169,6 +173,27 @@ Flows are aware of their deadline from the moment they start:
|
|
|
169
173
|
|
|
170
174
|
---
|
|
171
175
|
|
|
176
|
+
## `/spec` Command
|
|
177
|
+
|
|
178
|
+
Toggle spec-driven planning mode with the `/spec` command. When active, the steering hint instructs the orchestrator to follow a four-phase workflow:
|
|
179
|
+
|
|
180
|
+
1. **Investigate** — read package files, tests, and config directly; delegate broad discovery to `[scout]`
|
|
181
|
+
2. **Discuss** — ask 2–3 targeted, evidence-based questions via `ask_user`, marking the recommended choice with `[preferred]`
|
|
182
|
+
3. **Recommend Exit** — prompt the user to type `/spec` when ready to proceed; do not initiate builds yourself
|
|
183
|
+
4. **Synthesize** — on `/spec` deactivation, a plan is auto-generated from the conversation and placed in the editor for review
|
|
184
|
+
|
|
185
|
+
Run `/spec` with a prompt to activate immediately and start investigating:
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
/spec Add a REST API endpoint for user preferences
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Run `/spec` without arguments to toggle the mode on or off. When off, the orchestrator uses the standard implement-mode behavior: investigate first, then delegate directly to flows.
|
|
192
|
+
|
|
193
|
+
When you deactivate spec mode, a new session is created and the orchestrator synthesizes a full implementation plan from the conversation history, placing it in the editor for review.
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
172
197
|
## Flow Definitions
|
|
173
198
|
|
|
174
199
|
Create `.md` files in `~/.pi/agent/agents/` (user-level) or `.pi/agents/` (project-level):
|
|
@@ -207,7 +232,7 @@ flow [myflow] accomplished
|
|
|
207
232
|
|-------|------|-------------|
|
|
208
233
|
| `name` | `string` | Flow identifier (lowercase, required) |
|
|
209
234
|
| `description` | `string` | Short summary (required) |
|
|
210
|
-
| `tools` | `string[]` | Tools available to this flow |
|
|
235
|
+
| `tools` | `string \| string[]` | Tools available to this flow |
|
|
211
236
|
| `model` | `string` | Override the model for this flow |
|
|
212
237
|
| `thinking` | `string` | Thinking budget (e.g., `"low"`, `"medium"`, `"high"`) |
|
|
213
238
|
| `maxDepth` | `number` | How many more delegation levels this flow may spawn |
|
|
@@ -280,7 +305,7 @@ Advisories are smart: if the agent already included the suggested flow in the sa
|
|
|
280
305
|
### Single flow
|
|
281
306
|
|
|
282
307
|
```json
|
|
283
|
-
{ "flow": [{ "type": "scout", "intent": "Find all authentication-related code and trace JWT validation", "aim": "Find auth code and trace JWT" }] }
|
|
308
|
+
{ "flow": [{ "type": "scout", "intent": "Find all authentication-related code and trace JWT validation", "aim": "Find auth code and trace JWT", "acceptance": "All auth files identified with JWT flow traced" }] }
|
|
284
309
|
```
|
|
285
310
|
|
|
286
311
|
### Batch multiple flows
|
|
@@ -315,6 +340,8 @@ Suppress the confirmation prompt before running project-local flows:
|
|
|
315
340
|
}
|
|
316
341
|
```
|
|
317
342
|
|
|
343
|
+
Each flow item also accepts an optional `acceptance` field — a one-sentence success criteria stating what "done" looks like. This helps the flow self-assess completion.
|
|
344
|
+
|
|
318
345
|
|
|
319
346
|
|
|
320
347
|
---
|
|
@@ -332,6 +359,10 @@ When **tool optimization** is enabled (default), the separate `read` / `write` /
|
|
|
332
359
|
- **`batch`** — sequential read, write, edit, and delete operations in one call. Edits use fuzzy matching and preserve line endings.
|
|
333
360
|
- **`batch_read`** — read-only variant for multiple reads. Small full-file reads return raw content; large full-file reads return code/infra context maps or total line counts, and oversized targeted reads are capped with continuation guidance.
|
|
334
361
|
|
|
362
|
+
### `batch_bash_poll` — poll pending bash commands
|
|
363
|
+
|
|
364
|
+
For child flows using the `batch` tool, `batch_bash_poll` lets the agent check on pending bash operations that exceeded the soft timeout. Pass the operation IDs from the pending results to retrieve completed output or see updated partial output.
|
|
365
|
+
|
|
335
366
|
### `web` — search and fetch
|
|
336
367
|
|
|
337
368
|
Built-in web operations (no API keys required):
|
|
@@ -339,6 +370,21 @@ Built-in web operations (no API keys required):
|
|
|
339
370
|
- **Search** — queries Brave and DuckDuckGo HTML endpoints, returns top results with titles, URLs, and snippets.
|
|
340
371
|
- **Fetch** — downloads a page, converts HTML to Markdown via JSDOM + Turndown, saves to a temp file in the session directory, and returns a preview. Falls back through direct fetch → `r.jina.ai` → `curl`.
|
|
341
372
|
|
|
373
|
+
In the collapsed activity panel, web operations display as compact one-line summaries (e.g., `search: "query"` or `fetch: example.com`). Like other tools, web results are scramble-animated in the collapsed view.
|
|
374
|
+
|
|
375
|
+
### `ask_user` — interactive prompts
|
|
376
|
+
|
|
377
|
+
Parameters beyond the basic `question`, `options`, `allowMultiple`, `allowFreeform`, `allowCancel`:
|
|
378
|
+
|
|
379
|
+
| Parameter | Type | Description |
|
|
380
|
+
|-----------|------|-------------|
|
|
381
|
+
| `context` | `string` | Summary of findings to show before the question |
|
|
382
|
+
| `allowComment` | `boolean` | Collect an optional freeform comment after selection (default: false) |
|
|
383
|
+
| `displayMode` | `"overlay" \| "inline"` | UI rendering mode; overlay shows a centered modal, inline renders in-place (default: overlay) |
|
|
384
|
+
| `overlayToggleKey` | `string` | Shortcut for hiding/showing the overlay popup (default: `alt+o`; pass `"off"` to disable) |
|
|
385
|
+
| `commentToggleKey` | `string` | Shortcut for toggling the comment row when `allowComment` is true (default: `ctrl+g`) |
|
|
386
|
+
| `timeout` | `number` | Auto-dismiss after N milliseconds; returns null (cancelled) when expired |
|
|
387
|
+
|
|
342
388
|
---
|
|
343
389
|
|
|
344
390
|
## Configuration
|
|
@@ -390,7 +436,7 @@ pi --flow-mode quality
|
|
|
390
436
|
On startup, the selected mode is printed in a compact notification:
|
|
391
437
|
|
|
392
438
|
```
|
|
393
|
-
mode: balance | lite: gpt-5.4-mini
|
|
439
|
+
mode: balance | lite: gpt-5.4-mini - flash: gpt-5.5 - full: gpt-5.5
|
|
394
440
|
```
|
|
395
441
|
|
|
396
442
|
Failover-only tiers are shown as `failover: model-a, model-b`. Verbose mode includes the flow names associated with each tier.
|
|
@@ -405,7 +451,7 @@ You can also set flow runtime defaults under `flowSettings`:
|
|
|
405
451
|
"sessionMode": "default",
|
|
406
452
|
"maxConcurrency": 4,
|
|
407
453
|
"toolOptimize": true,
|
|
408
|
-
"structuredOutput": true
|
|
454
|
+
"structuredOutput": true
|
|
409
455
|
}
|
|
410
456
|
}
|
|
411
457
|
```
|
|
@@ -430,7 +476,7 @@ per-flow sessionMode > --flow-session-mode > PI_FLOW_SESSION_MODE > flowSettings
|
|
|
430
476
|
| `--flow-max-depth [n]` | Maximum delegation depth | `3` |
|
|
431
477
|
| `--flow-prevent-cycles` | Block cyclic delegation | `true` |
|
|
432
478
|
| `--no-flow-prevent-cycles` | Disable cycle prevention | — |
|
|
433
|
-
| `--flow-model-config [name]` | Select a named model strategy for this invocation | `
|
|
479
|
+
| `--flow-model-config [name]` | Select a named model strategy for this invocation | `default` |
|
|
434
480
|
| `--flow-mode [name]` | Persistently switch the global model strategy and apply it immediately | — |
|
|
435
481
|
| `--flow-lite-model [model]` | Override the lite-tier model | — |
|
|
436
482
|
| `--flow-flash-model [model]` | Override the flash-tier model | — |
|
|
@@ -438,9 +484,6 @@ per-flow sessionMode > --flow-session-mode > PI_FLOW_SESSION_MODE > flowSettings
|
|
|
438
484
|
| `--flow-session-mode [mode]` | Default child-flow session mode | `default` |
|
|
439
485
|
| `--flow-max-concurrency [n]` | Maximum parallel flows | `4` |
|
|
440
486
|
| `--tool-optimize` | Use unified `batch`/`batch_read` | `true` |
|
|
441
|
-
| `--no-tool-optimize` | Disable tool optimization; use legacy read/write/edit | — |
|
|
442
|
-
| `--structured-output` | Inject structured JSON output instructions | `true` |
|
|
443
|
-
| `--no-structured-output` | Disable structured output injection | — |
|
|
444
487
|
|
|
445
488
|
### Environment variables
|
|
446
489
|
|
|
@@ -454,6 +497,65 @@ per-flow sessionMode > --flow-session-mode > PI_FLOW_SESSION_MODE > flowSettings
|
|
|
454
497
|
| `PI_FLOW_SESSION_MODE` | Default child-flow session mode: `fast`, `default`, `long`, or `extreme_long` |
|
|
455
498
|
| `PI_FLOW_MAX_CONCURRENCY` | Maximum parallel flows |
|
|
456
499
|
| `PI_FLOW_SPAWN_COMMAND` | Override the spawn command for exotic runtime environments (e.g. bundled with pkg/nexe) |
|
|
500
|
+
| `PI_FLOW_DEADLINE_MS` | Absolute deadline timestamp (ms) propagated to child flows for timeout awareness |
|
|
501
|
+
| `PI_FLOW_TOOL_SUMMARY_GRACE_MS` | Time before hard timeout when the agent should stop tool use and summarize (ms) |
|
|
502
|
+
| `PI_FLOW_REMINDER_FILE` | Path to a file the parent writes warning messages into; the timed-bash wrapper reads it before each tool call |
|
|
503
|
+
| `PI_FLOW_DEBUG_CONTEXT` | Set to `1` to emit context-compression telemetry to stderr |
|
|
504
|
+
| `PI_OFFLINE` | Always set to `1` for child flow processes |
|
|
505
|
+
| `PI_FLOW_NO_STRATEGIC_HINT` | Set to `1` to suppress the strategic planning hints appended after tool calls |
|
|
506
|
+
| `PI_ASK_USER_DISPLAY_MODE` | Default display mode for `ask_user`: `overlay` or `inline` |
|
|
507
|
+
| `PI_ASK_USER_OVERLAY_TOGGLE_KEY` | Default shortcut for hiding/showing the overlay popup (e.g. `alt+o`) |
|
|
508
|
+
| `PI_ASK_USER_COMMENT_TOGGLE_KEY` | Default shortcut for toggling the comment row (e.g. `ctrl+g`) |
|
|
509
|
+
|
|
510
|
+
### Notifications
|
|
511
|
+
|
|
512
|
+
Terminal and desktop notifications fire when the agent finishes a turn and is waiting for you. They adapt dynamically: if a flow completed, the title shows the flow name and acceptance summary; if `ask_user` is pending, the title changes to "Decision Required".
|
|
513
|
+
|
|
514
|
+
Configure notifications with global `~/.pi/agent/extensions/notify.json` or project `.pi/notify.json`. Project settings override global.
|
|
515
|
+
|
|
516
|
+
```json
|
|
517
|
+
{
|
|
518
|
+
"enabled": true,
|
|
519
|
+
"onlyWhenInteractive": true,
|
|
520
|
+
"title": "π",
|
|
521
|
+
"body": "task accomplished!",
|
|
522
|
+
"channels": {
|
|
523
|
+
"terminal": true,
|
|
524
|
+
"desktop": true,
|
|
525
|
+
"bell": true,
|
|
526
|
+
"sound": false
|
|
527
|
+
},
|
|
528
|
+
"terminal": { "backend": "auto" },
|
|
529
|
+
"desktop": { "backend": "auto" },
|
|
530
|
+
"sound": {
|
|
531
|
+
"backend": "auto",
|
|
532
|
+
"name": "Glass",
|
|
533
|
+
"linuxSoundId": "complete",
|
|
534
|
+
"frequencyHz": 1000,
|
|
535
|
+
"durationMs": 250,
|
|
536
|
+
"command": ""
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
```
|
|
540
|
+
|
|
541
|
+
| Key | Description |
|
|
542
|
+
|-----|-------------|
|
|
543
|
+
| `enabled` | Master switch for notifications |
|
|
544
|
+
| `onlyWhenInteractive` | Only notify when a UI is attached |
|
|
545
|
+
| `channels.terminal` | OSC 777/99 terminal notifications |
|
|
546
|
+
| `channels.desktop` | OS native notifications (macOS, Linux, Windows) |
|
|
547
|
+
| `channels.bell` | Terminal bell |
|
|
548
|
+
| `channels.sound` | System beep or custom sound |
|
|
549
|
+
|
|
550
|
+
**Backends**
|
|
551
|
+
|
|
552
|
+
| Channel | Backends |
|
|
553
|
+
|---------|----------|
|
|
554
|
+
| Terminal | `auto` (detect OSC support), `osc777`, `osc99`, `none` |
|
|
555
|
+
| Desktop | `auto` (detect OS), `macos`, `linux`, `windows-toast`, `none` |
|
|
556
|
+
| Sound | `auto`, `macos`, `linux`, `windows-beep`, `command`, `none` |
|
|
557
|
+
|
|
558
|
+
When the terminal channel is active and the emulator supports visual OSC notifications (e.g. Warp, iTerm2, kitty), the auto-detected desktop channel is skipped to avoid duplicates.
|
|
457
559
|
|
|
458
560
|
---
|
|
459
561
|
|
package/agents/build.md
CHANGED
|
@@ -35,6 +35,3 @@ During this build flow — your mission is to implement and verify changes. Be a
|
|
|
35
35
|
- If CI/CD fails, diagnose, fix, commit, push, and repeat until green.
|
|
36
36
|
- After merging a branch into `main` and verifying all tests pass, delete the merged branch (local and remote) to keep the repository clean.
|
|
37
37
|
- If an unexpected error or trace is needed, recommend [debug] rather than guessing.
|
|
38
|
-
|
|
39
|
-
## Note
|
|
40
|
-
Treat this as a clean-slate system rewrite, unless explicitly mentioned in the requirements. Perform a comprehensive migration with zero requirements for backwards compatibility. You must ensure that all residual code, variable names, test suites, and documentation are fully refactored and perfectly aligned with the new architecture.
|
package/agents/ideas.md
CHANGED
|
@@ -105,7 +105,3 @@ Escalation ladder:
|
|
|
105
105
|
After attempt 2:
|
|
106
106
|
- If the boundary is a **significant design conflict** or **horizon choice**: **stop and mark blocked**. Do not continue emitting decision blocks.
|
|
107
107
|
- If the boundary is **ambiguity-only** and the user says "your call" or equivalent: proceed with the most reversible default, state assumptions explicitly, and continue.
|
|
108
|
-
|
|
109
|
-
## Note
|
|
110
|
-
|
|
111
|
-
Treat this as a clean-slate system rewrite, unless explicitly mentioned in the requirements. Perform a comprehensive migration with zero requirements for backwards compatibility. You must ensure that all residual code, variable names, test suites, and documentation are fully refactored and perfectly aligned with the new architecture.
|
package/agents/scout.md
CHANGED
|
@@ -25,6 +25,3 @@ During this scout flow — your mission is to discover relevant context. Move fa
|
|
|
25
25
|
- Include relevant snippets or evidence inline so citations are verifiable.
|
|
26
26
|
- Show actual code/data, not excessive summaries.
|
|
27
27
|
- If something is not found, say so directly — do not guess.
|
|
28
|
-
|
|
29
|
-
## Note
|
|
30
|
-
Treat this as a clean-slate system rewrite, unless explicitly mentioned in the requirements. Perform a comprehensive migration with zero requirements for backwards compatibility. You must ensure that all residual code, variable names, test suites, and documentation are fully refactored and perfectly aligned with the new architecture.
|
package/dist/agents.d.ts
CHANGED
|
@@ -30,8 +30,6 @@ export interface FlowDiscoveryResult {
|
|
|
30
30
|
}
|
|
31
31
|
/** Determine the model tier for a given flow name. */
|
|
32
32
|
export declare function getFlowTier(flowName: string): FlowTier;
|
|
33
|
-
/** Return the bundled flow names associated with a given tier. */
|
|
34
|
-
export declare function getTierFlowNames(tier: FlowTier): string[];
|
|
35
33
|
/**
|
|
36
34
|
* Discover all available flows according to the requested scope.
|
|
37
35
|
*
|
package/dist/agents.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../src/agents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAOH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,KAAK,CAAC;AAExE,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAEjD,MAAM,WAAW,UAAU;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;IACvC,QAAQ,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IACnC,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED,sDAAsD;AACtD,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAetD;
|
|
1
|
+
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../src/agents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAOH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,KAAK,CAAC;AAExE,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAEjD,MAAM,WAAW,UAAU;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;IACvC,QAAQ,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IACnC,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED,sDAAsD;AACtD,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAetD;AA2MD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,mBAAmB,CAsBhF"}
|
package/dist/agents.js
CHANGED
|
@@ -30,17 +30,6 @@ export function getFlowTier(flowName) {
|
|
|
30
30
|
return "flash";
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
/** Return the bundled flow names associated with a given tier. */
|
|
34
|
-
export function getTierFlowNames(tier) {
|
|
35
|
-
switch (tier) {
|
|
36
|
-
case "lite":
|
|
37
|
-
return ["scout", "debug"];
|
|
38
|
-
case "flash":
|
|
39
|
-
return ["build", "audit"];
|
|
40
|
-
case "full":
|
|
41
|
-
return ["ideas", "craft"];
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
33
|
// ---------------------------------------------------------------------------
|
|
45
34
|
// Internal helpers
|
|
46
35
|
// ---------------------------------------------------------------------------
|
package/dist/agents.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../src/agents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAyBlC,sDAAsD;AACtD,MAAM,UAAU,WAAW,CAAC,QAAgB;IAC3C,MAAM,UAAU,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;IACjD,QAAQ,UAAU,EAAE,CAAC;QACpB,KAAK,OAAO,CAAC;QACb,KAAK,OAAO;YACX,OAAO,MAAM,CAAC;QACf,KAAK,OAAO,CAAC;QACb,KAAK,OAAO;YACX,OAAO,OAAO,CAAC;QAChB,KAAK,OAAO,CAAC;QACb,KAAK,OAAO;YACX,OAAO,MAAM,CAAC;QACf;YACC,OAAO,OAAO,CAAC;IACjB,CAAC;AACF,CAAC;AAED,
|
|
1
|
+
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../src/agents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAyBlC,sDAAsD;AACtD,MAAM,UAAU,WAAW,CAAC,QAAgB;IAC3C,MAAM,UAAU,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;IAC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Y,EAAE,SAAS,EAAE,YAAY,CAAC;QACxD,eAAe;KACf,CAAC;AACH,CAAC"}
|
package/dist/ask-user.d.ts
CHANGED
|
@@ -69,7 +69,7 @@ export declare function createAskUserTool(): {
|
|
|
69
69
|
};
|
|
70
70
|
}>;
|
|
71
71
|
renderCall(args: any, theme: any): Text;
|
|
72
|
-
renderResult(result: any, options: any, theme: any): Text;
|
|
72
|
+
renderResult(result: any, options: any, theme: any, args?: Record<string, unknown>): Text;
|
|
73
73
|
};
|
|
74
74
|
export {};
|
|
75
75
|
//# sourceMappingURL=ask-user.d.ts.map
|
package/dist/ask-user.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ask-user.d.ts","sourceRoot":"","sources":["../src/ask-user.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAS,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"ask-user.d.ts","sourceRoot":"","sources":["../src/ask-user.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAS,MAAM,+BAA+B,CAAC;AAO7E,OAAO,EAeJ,IAAI,EAIN,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAA0B,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAsBxF,KAAK,cAAc,GAAG,cAAc,GAAG,MAAM,CAAC;AAE9C,KAAK,cAAc,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE3C,UAAU,SAAS;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,cAAc,EAAE,CAAC;IAC3B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,KAAK,WAAW,GACX;IACC,IAAI,EAAE,WAAW,CAAC;IAClB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CACnB,GACC;IACC,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACf,CAAC;AAEL,UAAU,cAAc;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAC;IAC7B,SAAS,EAAE,OAAO,CAAC;CACrB;AAs1CD,wBAAgB,iBAAiB;;;;;;;yBAqEA,MAAM,UAAU,SAAS,UAAU,WAAW,GAAG,SAAS,YAAY,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC,GAAG,SAAS,OAAO,gBAAgB;;;;;iBAM1D,cAAc;;;;;;;;iBAiDP,cAAc;;;;;;;;;;;qBAiIrG,GAAG,SAAS,GAAG;yBAoBX,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;EAoEvF"}
|
package/dist/ask-user.js
CHANGED
|
@@ -7,6 +7,9 @@
|
|
|
7
7
|
import { getMarkdownTheme } from "@mariozechner/pi-coding-agent";
|
|
8
8
|
import { Type } from "@sinclair/typebox";
|
|
9
9
|
import { appendStrategicHintOnce } from "./tool-utils.js";
|
|
10
|
+
import { setPendingDecision } from "./notify-state.js";
|
|
11
|
+
import { scrambleManager, runScrambleTimer } from "./scramble.js";
|
|
12
|
+
import { stripAnsi } from "./render-utils.js";
|
|
10
13
|
import { Container, decodeKittyPrintable, Editor, fuzzyFilter, Key, Markdown, matchesKey, Spacer, Text, truncateToWidth, wrapTextWithAnsi, } from "@mariozechner/pi-tui";
|
|
11
14
|
import { renderSingleSelectRows } from "./single-select-layout.js";
|
|
12
15
|
const ASK_USER_VERSION = "0.11.0";
|
|
@@ -413,7 +416,7 @@ class MultiSelectList {
|
|
|
413
416
|
const isSelected = i === this.selectedIndex;
|
|
414
417
|
const prefix = isSelected ? theme.fg("accent", "▶") : " ";
|
|
415
418
|
if (this.isCommentToggleRow(i)) {
|
|
416
|
-
const checkbox = this.commentEnabled ? theme.fg("success", "[
|
|
419
|
+
const checkbox = this.commentEnabled ? theme.fg("success", "[✔]") : theme.fg("dim", "[ ]");
|
|
417
420
|
const label = isSelected
|
|
418
421
|
? theme.fg("accent", theme.bold(COMMENT_TOGGLE_LABEL))
|
|
419
422
|
: theme.fg("text", theme.bold(COMMENT_TOGGLE_LABEL));
|
|
@@ -430,7 +433,7 @@ class MultiSelectList {
|
|
|
430
433
|
const option = this.options[i];
|
|
431
434
|
if (!option)
|
|
432
435
|
continue;
|
|
433
|
-
const checkbox = this.checked.has(i) ? theme.fg("success", "[
|
|
436
|
+
const checkbox = this.checked.has(i) ? theme.fg("success", "[✔]") : theme.fg("dim", "[ ]");
|
|
434
437
|
const num = theme.fg("dim", `${i + 1}.`);
|
|
435
438
|
const title = isSelected
|
|
436
439
|
? theme.fg("accent", theme.bold(option.title))
|
|
@@ -1147,7 +1150,7 @@ export function createAskUserTool() {
|
|
|
1147
1150
|
return {
|
|
1148
1151
|
name: "ask_user",
|
|
1149
1152
|
label: "Ask User",
|
|
1150
|
-
description: "Ask the user a question with optional multiple-choice answers. Use this to gather information interactively. Ask exactly one focused question per call. Before calling, gather context with tools (read/web/ref) and pass a short summary via the context field.",
|
|
1153
|
+
description: "Ask the user a question with optional multiple-choice answers. Use this to gather information interactively. Ask exactly one focused question per call. Before calling, gather context with tools (read/web/ref) and pass a short summary via the context field. When presenting options, mark your recommended choice with [preferred] and place it first. Base your recommendation on evidence gathered from tools or investigation.",
|
|
1151
1154
|
promptSnippet: "Ask the user one focused question with optional multiple-choice answers to gather information interactively",
|
|
1152
1155
|
promptGuidelines: [
|
|
1153
1156
|
"Before calling ask_user, gather context with tools (read/web/ref) and pass a short summary via the context field.",
|
|
@@ -1183,6 +1186,7 @@ export function createAskUserTool() {
|
|
|
1183
1186
|
timeout: Type.Optional(Type.Number({ description: "Auto-dismiss after N milliseconds. Returns null (cancelled) when expired." })),
|
|
1184
1187
|
}),
|
|
1185
1188
|
async execute(_toolCallId, params, signal, onUpdate, ctx) {
|
|
1189
|
+
setPendingDecision();
|
|
1186
1190
|
if (signal?.aborted) {
|
|
1187
1191
|
return {
|
|
1188
1192
|
content: [{ type: "text", text: "Cancelled" }],
|
|
@@ -1332,10 +1336,18 @@ export function createAskUserTool() {
|
|
|
1332
1336
|
}
|
|
1333
1337
|
return new Text(text, 0, 0);
|
|
1334
1338
|
},
|
|
1335
|
-
renderResult(result, options, theme) {
|
|
1339
|
+
renderResult(result, options, theme, args) {
|
|
1336
1340
|
const details = result.details;
|
|
1341
|
+
const canAnimate = !!args?.invalidate && !!args?.state;
|
|
1342
|
+
const now = Date.now();
|
|
1343
|
+
const id = args?.toolCallId || args?.id || "ask_user";
|
|
1337
1344
|
if (details?.error) {
|
|
1338
|
-
|
|
1345
|
+
const line = theme.fg("error", `✖ ${details.error}`);
|
|
1346
|
+
if (!canAnimate)
|
|
1347
|
+
return new Text(line, 0, 0);
|
|
1348
|
+
const scrambled = scrambleManager.updateText(id, "result", stripAnsi(line), now, false).content;
|
|
1349
|
+
runScrambleTimer(args);
|
|
1350
|
+
return new Text(scrambled, 0, 0);
|
|
1339
1351
|
}
|
|
1340
1352
|
if (options.isPartial) {
|
|
1341
1353
|
const waitingText = result.content
|
|
@@ -1343,13 +1355,23 @@ export function createAskUserTool() {
|
|
|
1343
1355
|
.map((part) => part.text ?? "")
|
|
1344
1356
|
.join("\n")
|
|
1345
1357
|
.trim() || "Waiting for user input...";
|
|
1346
|
-
|
|
1358
|
+
const line = theme.fg("muted", waitingText);
|
|
1359
|
+
if (!canAnimate)
|
|
1360
|
+
return new Text(line, 0, 0);
|
|
1361
|
+
const scrambled = scrambleManager.updateText(id, "result", stripAnsi(line), now, false).content;
|
|
1362
|
+
runScrambleTimer(args);
|
|
1363
|
+
return new Text(scrambled, 0, 0);
|
|
1347
1364
|
}
|
|
1348
1365
|
if (!details || details.cancelled || !details.response) {
|
|
1349
|
-
|
|
1366
|
+
const line = theme.fg("warning", "Cancelled");
|
|
1367
|
+
if (!canAnimate)
|
|
1368
|
+
return new Text(line, 0, 0);
|
|
1369
|
+
const scrambled = scrambleManager.updateText(id, "result", stripAnsi(line), now, false).content;
|
|
1370
|
+
runScrambleTimer(args);
|
|
1371
|
+
return new Text(scrambled, 0, 0);
|
|
1350
1372
|
}
|
|
1351
1373
|
const response = details.response;
|
|
1352
|
-
let text = theme.fg("success", "
|
|
1374
|
+
let text = theme.fg("success", "✔ ");
|
|
1353
1375
|
if (response.kind === "freeform") {
|
|
1354
1376
|
text += theme.fg("muted", "(wrote) ");
|
|
1355
1377
|
}
|
|
@@ -1372,7 +1394,11 @@ export function createAskUserTool() {
|
|
|
1372
1394
|
}
|
|
1373
1395
|
}
|
|
1374
1396
|
}
|
|
1375
|
-
|
|
1397
|
+
if (!canAnimate)
|
|
1398
|
+
return new Text(text, 0, 0);
|
|
1399
|
+
const scrambled = scrambleManager.updateText(id, "result", stripAnsi(text), now, false).content;
|
|
1400
|
+
runScrambleTimer(args);
|
|
1401
|
+
return new Text(scrambled, 0, 0);
|
|
1376
1402
|
},
|
|
1377
1403
|
};
|
|
1378
1404
|
}
|