pi-ui-extend 1.0.41 → 1.0.45
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 +50 -13
- package/dist/app/app.d.ts +13 -0
- package/dist/app/app.js +158 -8
- package/dist/app/cli/install.js +2 -2
- package/dist/app/commands/command-controller.d.ts +4 -0
- package/dist/app/commands/command-controller.js +11 -0
- package/dist/app/commands/command-git-actions.d.ts +25 -0
- package/dist/app/commands/command-git-actions.js +381 -0
- package/dist/app/commands/command-host.d.ts +4 -0
- package/dist/app/commands/command-host.js +5 -2
- package/dist/app/commands/command-model-actions.d.ts +1 -0
- package/dist/app/commands/command-model-actions.js +57 -35
- package/dist/app/commands/command-navigation-actions.d.ts +1 -0
- package/dist/app/commands/command-navigation-actions.js +16 -3
- package/dist/app/commands/command-registry.d.ts +2 -0
- package/dist/app/commands/command-registry.js +15 -1
- package/dist/app/commands/command-session-actions.js +9 -3
- package/dist/app/commands/reload-context-inventory.d.ts +11 -0
- package/dist/app/commands/reload-context-inventory.js +70 -0
- package/dist/app/extensions/extension-actions-controller.d.ts +1 -0
- package/dist/app/extensions/extension-actions-controller.js +6 -0
- package/dist/app/extensions/subagent-catalog-state.d.ts +9 -0
- package/dist/app/extensions/subagent-catalog-state.js +23 -0
- package/dist/app/input/autocomplete-controller.js +61 -34
- package/dist/app/input/input-action-controller.d.ts +2 -0
- package/dist/app/input/input-action-controller.js +8 -1
- package/dist/app/input/input-controller.d.ts +2 -1
- package/dist/app/input/input-controller.js +7 -2
- package/dist/app/input/prompt-enhancer-controller.js +53 -35
- package/dist/app/input/voice-controller.d.ts +41 -45
- package/dist/app/input/voice-controller.js +351 -419
- package/dist/app/model/model-usage-controller.js +17 -7
- package/dist/app/model/model-usage-status.d.ts +4 -1
- package/dist/app/model/model-usage-status.js +270 -46
- package/dist/app/popup/menu-items-controller.d.ts +13 -3
- package/dist/app/popup/menu-items-controller.js +37 -21
- package/dist/app/popup/popup-action-controller.d.ts +12 -2
- package/dist/app/popup/popup-action-controller.js +77 -24
- package/dist/app/popup/popup-menu-controller.d.ts +36 -14
- package/dist/app/popup/popup-menu-controller.js +239 -69
- package/dist/app/rendering/dcp-stats.d.ts +9 -4
- package/dist/app/rendering/dcp-stats.js +40 -425
- package/dist/app/rendering/editor-panels.js +10 -4
- package/dist/app/rendering/popup-menu-renderer.d.ts +3 -5
- package/dist/app/rendering/popup-menu-renderer.js +42 -37
- package/dist/app/rendering/render-controller.js +23 -2
- package/dist/app/rendering/status-line-renderer.d.ts +5 -0
- package/dist/app/rendering/status-line-renderer.js +41 -5
- package/dist/app/rendering/tab-line-renderer.js +26 -20
- package/dist/app/runtime.d.ts +12 -1
- package/dist/app/runtime.js +120 -12
- package/dist/app/screen/mouse-controller.d.ts +2 -0
- package/dist/app/screen/mouse-controller.js +17 -7
- package/dist/app/screen/status-controller.d.ts +4 -0
- package/dist/app/screen/status-controller.js +5 -0
- package/dist/app/session/lazy-session-manager.js +34 -0
- package/dist/app/session/session-event-controller.d.ts +1 -0
- package/dist/app/session/session-event-controller.js +10 -1
- package/dist/app/session/session-history.d.ts +1 -0
- package/dist/app/session/session-history.js +12 -1
- package/dist/app/session/session-lifecycle-controller.d.ts +7 -1
- package/dist/app/session/session-lifecycle-controller.js +16 -1
- package/dist/app/session/tabs-controller.d.ts +26 -1
- package/dist/app/session/tabs-controller.js +454 -147
- package/dist/app/subagents/subagents-files.js +60 -1
- package/dist/app/subagents/subagents-model.d.ts +1 -0
- package/dist/app/subagents/subagents-model.js +18 -2
- package/dist/app/subagents/subagents-widget-controller.d.ts +1 -0
- package/dist/app/subagents/subagents-widget-controller.js +6 -0
- package/dist/app/types.d.ts +16 -1
- package/dist/app/workspace/workspace-actions-controller.js +10 -2
- package/dist/app/workspace/workspace-undo.d.ts +1 -0
- package/dist/app/workspace/workspace-undo.js +1 -0
- package/dist/bundled-extensions/question/index.js +9 -1
- package/dist/bundled-extensions/question/remote.d.ts +4 -0
- package/dist/bundled-extensions/question/remote.js +33 -0
- package/dist/bundled-extensions/telegram-connector/bot.d.ts +43 -0
- package/dist/bundled-extensions/telegram-connector/bot.js +166 -0
- package/dist/bundled-extensions/telegram-connector/config.d.ts +8 -0
- package/dist/bundled-extensions/telegram-connector/config.js +87 -0
- package/dist/bundled-extensions/telegram-connector/coordinator.d.ts +66 -0
- package/dist/bundled-extensions/telegram-connector/coordinator.js +413 -0
- package/dist/bundled-extensions/telegram-connector/index.d.ts +3 -0
- package/dist/bundled-extensions/telegram-connector/index.js +195 -0
- package/dist/bundled-extensions/terminal-bell/index.d.ts +0 -8
- package/dist/bundled-extensions/terminal-bell/index.js +0 -76
- package/dist/bundled-extensions/workspace-undo/index.d.ts +26 -0
- package/dist/bundled-extensions/workspace-undo/index.js +191 -0
- package/dist/config.d.ts +21 -2
- package/dist/config.js +159 -32
- package/dist/default-pix-config.js +25 -5
- package/dist/schemas/index.d.ts +1 -0
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/pi-tools-suite-schema.d.ts +88 -62
- package/dist/schemas/pi-tools-suite-schema.js +54 -83
- package/dist/schemas/pix-schema.d.ts +19 -2
- package/dist/schemas/pix-schema.js +47 -5
- package/dist/schemas/tasks-schema.d.ts +18 -0
- package/dist/schemas/tasks-schema.js +41 -0
- package/docs/concurrency.md +9 -1
- package/docs/desktop-mvp.md +22 -6
- package/docs/desktop-task-manager.md +148 -84
- package/docs/release.md +30 -6
- package/external/pi-tools-suite/README.md +197 -84
- package/external/pi-tools-suite/docs/evals.md +1 -1
- package/external/pi-tools-suite/docs/session-recovery.md +47 -14
- package/external/pi-tools-suite/docs/subagent-model-pools.md +48 -30
- package/external/pi-tools-suite/docs/ui-qa-subagent.md +440 -0
- package/external/pi-tools-suite/package.json +6 -1
- package/external/pi-tools-suite/src/antigravity-auth/auth-store.ts +2 -1
- package/external/pi-tools-suite/src/antigravity-auth/constants.ts +9 -3
- package/external/pi-tools-suite/src/antigravity-auth/headers.ts +41 -3
- package/external/pi-tools-suite/src/antigravity-auth/models.ts +94 -21
- package/external/pi-tools-suite/src/antigravity-auth/oauth.ts +5 -17
- package/external/pi-tools-suite/src/antigravity-auth/payload.ts +72 -7
- package/external/pi-tools-suite/src/antigravity-auth/stream.ts +13 -1
- package/external/pi-tools-suite/src/async-subagents/agents/frontier-review.md +23 -0
- package/external/pi-tools-suite/src/async-subagents/agents/implement.md +1 -1
- package/external/pi-tools-suite/src/async-subagents/agents/presets.jsonc +16 -0
- package/external/pi-tools-suite/src/async-subagents/agents/research.md +5 -3
- package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/backends/browser.mjs +346 -0
- package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/backends/desktop.mjs +1038 -0
- package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/backends/tui.mjs +759 -0
- package/external/pi-tools-suite/src/async-subagents/agents/{browser-qa → ui-qa/browser}/scripts/browser-qa-runner.mjs +32 -23
- package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/drivers/chrome-devtools/chrome-devtools-provider.mjs +895 -0
- package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/drivers/linux/linux-atspi.py +494 -0
- package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/drivers/macos/macos-accessibility.swift +1085 -0
- package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/drivers/native-terminal/bridge-client.mjs +50 -0
- package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/drivers/native-terminal/native-terminal-host.mjs +501 -0
- package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/drivers/windows/windows-uia.ps1 +454 -0
- package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/browser-auth.md +114 -0
- package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/browser-chrome-devtools.md +91 -0
- package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/browser-playwright.md +145 -0
- package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/browser.md +82 -0
- package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/desktop-linux.md +26 -0
- package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/desktop-macos.md +29 -0
- package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/desktop-windows.md +23 -0
- package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/desktop.md +54 -0
- package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/tui-native-terminal.md +59 -0
- package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/tui-pty.md +37 -0
- package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/tui.md +60 -0
- package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/scripts/ui-qa-runner.mjs +535 -0
- package/external/pi-tools-suite/src/async-subagents/agents/ui-qa.md +75 -0
- package/external/pi-tools-suite/src/async-subagents/commands.ts +15 -71
- package/external/pi-tools-suite/src/async-subagents/core/activity.ts +33 -0
- package/external/pi-tools-suite/src/async-subagents/core/agent-catalog.ts +5 -4
- package/external/pi-tools-suite/src/async-subagents/core/agent-strategy.ts +1 -1
- package/external/pi-tools-suite/src/async-subagents/core/agents-dir.ts +8 -5
- package/external/pi-tools-suite/src/async-subagents/core/browser-qa.ts +16 -2
- package/external/pi-tools-suite/src/async-subagents/core/config.ts +160 -327
- package/external/pi-tools-suite/src/async-subagents/core/model-selection.ts +2 -1
- package/external/pi-tools-suite/src/async-subagents/core/registry.ts +158 -33
- package/external/pi-tools-suite/src/async-subagents/core/routing.ts +21 -5
- package/external/pi-tools-suite/src/async-subagents/core/spawn.ts +40 -26
- package/external/pi-tools-suite/src/async-subagents/core/state.ts +40 -0
- package/external/pi-tools-suite/src/async-subagents/core/types.ts +7 -0
- package/external/pi-tools-suite/src/async-subagents/core/ultrawork-auto.ts +51 -45
- package/external/pi-tools-suite/src/async-subagents/index.ts +69 -5
- package/external/pi-tools-suite/src/async-subagents/lib.ts +16 -9
- package/external/pi-tools-suite/src/async-subagents/tools/spawn.ts +8 -5
- package/external/pi-tools-suite/src/async-subagents/tools/subagents.ts +5 -4
- package/external/pi-tools-suite/src/async-subagents/types.ts +1 -0
- package/external/pi-tools-suite/src/coding-discipline/index.ts +90 -59
- package/external/pi-tools-suite/src/config.ts +55 -1
- package/external/pi-tools-suite/src/context-gateway/accounting-log.ts +282 -0
- package/external/pi-tools-suite/src/context-gateway/config.ts +77 -3
- package/external/pi-tools-suite/src/context-gateway/efficiency.ts +414 -0
- package/external/pi-tools-suite/src/context-gateway/enforcement.ts +222 -0
- package/external/pi-tools-suite/src/context-gateway/index.ts +206 -19
- package/external/pi-tools-suite/src/context-gateway/storeless-capabilities.ts +7 -7
- package/external/pi-tools-suite/src/context-gateway/telemetry.ts +101 -28
- package/external/pi-tools-suite/src/context-gateway/types.ts +16 -3
- package/external/pi-tools-suite/src/context-inventory.ts +99 -0
- package/external/pi-tools-suite/src/dcp/auto-compress-budget.ts +39 -4
- package/external/pi-tools-suite/src/dcp/auto-compress.ts +128 -49
- package/external/pi-tools-suite/src/dcp/commands.ts +32 -156
- package/external/pi-tools-suite/src/dcp/compress-tool.ts +177 -46
- package/external/pi-tools-suite/src/dcp/compression-blocks.ts +6 -58
- package/external/pi-tools-suite/src/dcp/compression-preview.ts +9 -0
- package/external/pi-tools-suite/src/dcp/compression-progress.ts +22 -0
- package/external/pi-tools-suite/src/dcp/config.ts +114 -17
- package/external/pi-tools-suite/src/dcp/conversation-index.ts +36 -9
- package/external/pi-tools-suite/src/dcp/diagnostics.ts +41 -0
- package/external/pi-tools-suite/src/dcp/fresh-tool-results.ts +38 -0
- package/external/pi-tools-suite/src/dcp/index.ts +338 -66
- package/external/pi-tools-suite/src/dcp/journal.ts +126 -4
- package/external/pi-tools-suite/src/dcp/progress-controller.ts +2 -1
- package/external/pi-tools-suite/src/dcp/prompts.ts +83 -192
- package/external/pi-tools-suite/src/dcp/protected-continuity.ts +175 -0
- package/external/pi-tools-suite/src/dcp/pruner-candidates.ts +93 -3
- package/external/pi-tools-suite/src/dcp/pruner-message-ids.ts +6 -10
- package/external/pi-tools-suite/src/dcp/pruner-nudge.ts +36 -33
- package/external/pi-tools-suite/src/dcp/pruner-tools.ts +6 -3
- package/external/pi-tools-suite/src/dcp/pruner.ts +1 -0
- package/external/pi-tools-suite/src/dcp/routine-pressure.ts +86 -0
- package/external/pi-tools-suite/src/dcp/state.ts +9 -0
- package/external/pi-tools-suite/src/dcp/statistics.d.ts +8 -0
- package/external/pi-tools-suite/src/dcp/statistics.js +156 -0
- package/external/pi-tools-suite/src/default-pi-tools-suite-config.ts +78 -22
- package/external/pi-tools-suite/src/index.ts +7 -1
- package/external/pi-tools-suite/src/lib/project.ts +36 -1
- package/external/pi-tools-suite/src/model-tools/index.ts +10 -7
- package/external/pi-tools-suite/src/repo-discovery/index.ts +304 -4
- package/external/pi-tools-suite/src/resource-registry/index.ts +2551 -0
- package/external/pi-tools-suite/src/session-recovery/index.ts +17 -0
- package/external/pi-tools-suite/src/shell-command-policy.ts +219 -0
- package/external/pi-tools-suite/src/todo/index.ts +21 -0
- package/external/pi-tools-suite/src/todo/todo.ts +19 -1
- package/external/pi-tools-suite/src/tool-descriptions.ts +47 -19
- package/package.json +10 -9
- package/schemas/pi-tools-suite.json +466 -287
- package/schemas/pix.json +129 -11
- package/schemas/tasks.json +131 -0
- package/skills/simplify/SKILL.md +33 -5
- package/docs/desktop-markdown-media.md +0 -77
- package/external/pi-tools-suite/docs/browser-qa-subagent.md +0 -177
- package/external/pi-tools-suite/docs/dcp-emergency-current-turn.md +0 -102
- package/external/pi-tools-suite/src/async-subagents/agents/browser-qa.md +0 -598
- package/external/pi-tools-suite/src/async-subagents/async-subagents.sample.jsonc +0 -54
- package/external/pi-tools-suite/src/skill-installer/index.ts +0 -333
- package/skills/playwright-cli/SKILL.md +0 -420
- package/skills/playwright-cli/references/element-attributes.md +0 -23
- package/skills/playwright-cli/references/playwright-tests.md +0 -50
- package/skills/playwright-cli/references/request-mocking.md +0 -87
- package/skills/playwright-cli/references/running-code.md +0 -241
- package/skills/playwright-cli/references/session-management.md +0 -273
- package/skills/playwright-cli/references/spec-driven-testing.md +0 -311
- package/skills/playwright-cli/references/storage-state.md +0 -290
- package/skills/playwright-cli/references/test-generation.md +0 -142
- package/skills/playwright-cli/references/tracing.md +0 -154
- package/skills/playwright-cli/references/video-recording.md +0 -147
- package/skills/spec-lite/SKILL.md +0 -140
- /package/external/pi-tools-suite/src/async-subagents/agents/{browser-qa → ui-qa/browser}/examples/qa-auth.example.jsonc +0 -0
- /package/external/pi-tools-suite/src/async-subagents/agents/{browser-qa → ui-qa/browser}/examples/qa-flow.example.jsonc +0 -0
- /package/external/pi-tools-suite/src/async-subagents/agents/{browser-qa → ui-qa/browser}/vendor/fflate.LICENSE +0 -0
- /package/external/pi-tools-suite/src/async-subagents/agents/{browser-qa → ui-qa/browser}/vendor/fflate.mjs +0 -0
|
@@ -7,13 +7,14 @@ This package keeps shared Pi tools as ordinary source folders under `src/` and r
|
|
|
7
7
|
- `src/coding-discipline` — injects a deduplicated silent-mode and quality-discipline block at the very top of the main-session per-turn system prompt for GLM main-session models only (`isGlmModel`) immediately before the LLM request; text-only GLM models get the `lookup` bridge while vision-capable `zai/glm-5.3-flash` inspects images directly; non-GLM models are left untouched; disabled for async sub-agents
|
|
8
8
|
- `src/credential-firewall` — opt-in secret firewall for high-confidence outbound/session credential redaction; disabled by default
|
|
9
9
|
- `src/ast-grep` — `ast_grep` / `ast_apply`
|
|
10
|
-
- `src/async-subagents` — `subagents` tool and sub-agent slash commands, including oh-my-openagent-style `/ultrawork` (`/ulw`) and `/hyperplan` orchestration prompts
|
|
10
|
+
- `src/async-subagents` — `subagents` tool and sub-agent slash commands, including oh-my-openagent-style `/ultrawork` (`/ulw`) and `/hyperplan` orchestration prompts; agent roles are Markdown files under `src/async-subagents/agents/*.md` plus project `.pi/agents/*.md`, while `/subagent-preset` selects model-pool presets from the bundled/project `agents/presets.jsonc`; includes the `oracle` profile for strong second opinions; enforces a 30-minute per-agent execution timeout, project-wide concurrency queueing, optional per-agent retry/backoff, and `result.json` structured metadata/chaining fields next to raw `result.md`; stores project-local run files and a registry under `.pi/subagents/` so result/status collection can recover after compaction or reload while the main session remains alive
|
|
11
11
|
- `src/lsp` — shared LSP diagnostics hook/library that enriches mutating tool results with diagnostics and shuts down language servers on session shutdown
|
|
12
12
|
- `src/comment-checker` — AI-slop comment guard that listens to the `tool_result` event for `write` / `edit` / `apply_patch` mutations, extracts net-new code comment lines, classifies them (filler phrasing, restating code, decorative separators, generic paraphrasing, or — under aggressive strictness — any non-valuable comment), and appends a short nudge to the tool result so the agent removes unnecessary comments on its next turn; TODO/FIXME, license headers, docstrings, pragmas, linter directives, shebangs, and decorators are never flagged; language-agnostic across `//` / `/* */` / `#` / `--` / `<!-- -->` / triple-quote comment styles; per-session deduplication (at most one nudge per 30 s) prevents fix/remark loops; configured via the `commentChecker` section (`enabled`, `strictness`: `conservative` | `balanced` | `aggressive`, default `balanced`) or `PI_COMMENT_CHECKER_ENABLED` / `PI_COMMENT_CHECKER_STRICTNESS`
|
|
13
13
|
- `src/session-name` — `session_name` tool for reading or setting the current session title directly from tool calls, without relying on slash-command parsing
|
|
14
14
|
- `src/session-recovery` — branch- and compaction-aware `session_overview`, `session_read_section`, `session_search`, and `session_recovery_context` tools for bounded recovery from Pi's raw append-only session history
|
|
15
|
-
- `src/
|
|
16
|
-
- `src/
|
|
15
|
+
- `src/context-gateway` — off/observe/enforce result shaping; enforce keeps safe test/build compacts and bounds over-budget structured `web_search` / `web_fetch` provider content while retaining the complete producer details in raw session history for `session-recovery`; active modes also keep a privacy-safe rotated JSONL efficiency log with gross avoided context, recovery/artifact-read tax, conservative net estimates, and finalized provider usage
|
|
16
|
+
- `src/repo-discovery` — `/idx-init`, `/idx-update`, and idx-backed `repo_architecture` / `repo_structure` / `repo_ast` / `repo_search` / `repo_explain` / `repo_deps` plus the unified `repo_knowledge` contract/wiki tool; repo tools and repo-aware mutation guidance register only when the launch project has `.indexer-cli` **and** an executable `idx` is available on `PATH`
|
|
17
|
+
- `src/antigravity-auth` — `antigravity` custom provider with Google Antigravity OAuth login, startup account list, auth.json-only runtime account loading, `/antigravity-add-account` OAuth append into rotation, `/antigravity-account` status display, account rotation/failover, model registration with live route mapping (current Antigravity catalog: Gemini 3.5/3.6/3.7/3.8 Flash, Gemini 3.1 Pro, Claude Sonnet 4.6 Thinking, Claude Opus 4.6 Thinking, GPT-OSS 120B Medium, plus legacy Antigravity aliases and Gemini CLI mirrors), and streaming through the Cloud Code Assist unified gateway
|
|
17
18
|
- `src/opencode-import` — `/opencode-import` for bounded migration of supported OpenCode OpenAI/Codex, GitHub Copilot, Z.ai, and Antigravity credentials into Pi; existing entries are preserved unless `--force` is passed
|
|
18
19
|
- `src/todo` — `todo` tool, `/todos`, `/todos-persist`, `/todos-scope`, and `/todos-clear` (also `/todos clear`); supports parent/subtask hierarchy, blockers, ready-task filtering, deferred out-of-scope items, batch operations, JSON/Markdown import/export, automatic clearing when all visible todos are completed, and optional project persistence via `/todos persist on` or `/todos-persist on`; localization/i18n has been removed
|
|
19
20
|
- `src/model-tools` — model-specific tool aliases such as Claude/GLM-style `Read` / `Edit` / `Write` / `Bash` / `Grep` / `Glob` / `LS`, GPT/Codex-style `shell`, and model-gated `apply_patch`
|
|
@@ -21,11 +22,58 @@ This package keeps shared Pi tools as ordinary source folders under `src/` and r
|
|
|
21
22
|
- `src/web-search` — `web_search` and `web_fetch` tools migrated from `@ollama/pi-web-search`; uses local Ollama by default or the official Ollama cloud API when an API key is configured, supports Tavily Search/Extract fallback, provides `/web-credentials` for secure user-level key storage, honors `OLLAMA_HOST`, supports request timeouts via `timeout_ms` / `PI_WEB_SEARCH_TIMEOUT_MS`, and reports provider-specific errors
|
|
22
23
|
- `src/dcp` — headless Dynamic Context Pruning ported from `opencode-dynamic-context-pruning` for the Pi SDK: explicit `compress` tool with range and message modes, `/dcp` commands (context, stats, sweep, manual, decompress, recompress, compress), same-call overlap validation, recoverable compressed-block rollups, grouped message-mode skip diagnostics, stable raw-message anchors when available, protected user/tool preservation, deduplication, error purging, and context nudges; visualization is left to `compress` tool responses and the renderer-owned context-percent click dialog
|
|
23
24
|
- `src/prompt-commands` — user slash-command builder: `/prompt-commands` opens a CRUD menu for saved prompt-backed slash commands, stores them under `promptCommands` in `~/.config/pi/pi-tools-suite.jsonc`, reloads after edits, and runs each saved prompt as a normal user message
|
|
24
|
-
- `src/
|
|
25
|
+
- `src/resource-registry` — `/registry` manages one private Git registry with global reusable `skills/` and `agents/` plus project-scoped `projects/<project-key>/tasks.jsonc`, `projects/<project-key>/task-attachments/`, `projects/<project-key>/plans/`, and `projects/<project-key>/TODO.md`; skills install into `.pi/skills/<name>/`, agents into `.pi/agents/<name>.md`, while `push tasks|plans|todo|project` and `pull tasks|plans|todo|project` synchronize `.pi/tasks.jsonc` (with referenced `.pi/task-attachments` rebased through portable registry-only markers), `.pi/plans/`, and `.pi/TODO.md` only for the current project; the project key is normally derived from Git `origin` (SSH and HTTPS forms normalize to the same key) and can be overridden per project with `/registry project-key <key>` in `.pi/pi-tools-suite.jsonc`; `status` fetches and groups skills, agents, tasks, plans, and TODO by state (up to date, updates, conflicts, local-only, remote-only, and so on) using `.pi/registry.json` provenance, and the tasks hash includes referenced attachment bytes; reusable `install`, `update`, `push`, remote-only `remove`, and local-only `uninstall` support TUI flows and bulk `all` forms, `delete`/`rm` alias remote `remove`, `remove-local`/`local-remove` alias `uninstall`, destructive bulk operations require interactive confirmation, and every successful skill/agent mutation reloads resources once; `/registry configure <git-url> [branch]` stores the registry remote in the user config; Git authentication is delegated to the user's normal Git/SSH credential setup and the local clone is only a disposable cache
|
|
25
26
|
|
|
26
27
|
`index.ts` is intentionally only a thin auto-discovery shim that re-exports `src/index.ts`. There is no `pi.extensions` manifest here, so local Pi auto-discovery loads the suite once via `~/.pi/agent/extensions/pi-tools-suite/index.ts` and does not double-register tools.
|
|
27
28
|
|
|
28
|
-
Registration order is preserved in `src/index.ts`: coding-discipline, ast-grep, async-subagents, lsp, comment-checker, session-name, session-recovery, repo-discovery command/tool gate, antigravity-auth provider, OpenCode import, todo, model-tools, usage, web-search, dcp, prompt-commands,
|
|
29
|
+
Registration order is preserved in `src/index.ts`: coding-discipline, ast-grep, async-subagents, lsp, comment-checker, session-name, session-recovery, repo-discovery command/tool gate, antigravity-auth provider, OpenCode import, todo, model-tools, usage, web-search, context-gateway, truncation-metadata-normalizer, dcp, prompt-commands, resource-registry, credential-firewall, then codex-reasoning-fix. Tool metadata and active model-specific tool sets have two modes: standard and repo-aware. Repo-aware mode requires both project `.indexer-cli` state and an executable `idx`; when enabled, `repo_*` tools stay active ahead of overlapping lower-level aliases. If `idx` is unavailable, the suite falls back to ordinary Read/Grep/LSP/sub-agent guidance and does **not** implicitly install, initialize, or create index state. `/idx-init` is the explicit setup/repair path and should be run only with user permission.
|
|
30
|
+
|
|
31
|
+
## Repository knowledge and spec maintenance
|
|
32
|
+
|
|
33
|
+
When repo-aware mode is available, `repo_knowledge` is the single model-facing
|
|
34
|
+
surface for behavioral specs/contracts. It wraps the first-class `idx context`
|
|
35
|
+
and `idx wiki` knowledge layer while ordinary file tools remain responsible for
|
|
36
|
+
editing the primary spec documents themselves.
|
|
37
|
+
|
|
38
|
+
Read/query actions:
|
|
39
|
+
|
|
40
|
+
- `context` — primary contract + implementation ranges + tests + freshness in a
|
|
41
|
+
bounded response;
|
|
42
|
+
- `search` / `show` — find or inspect authoritative project knowledge;
|
|
43
|
+
- `status` / `audit` / `catalog` — freshness and project knowledge health;
|
|
44
|
+
- `discover` — classify new/moved/changed document candidates, including
|
|
45
|
+
low-signal documents through the explicit all-unclassified mode;
|
|
46
|
+
- `impact` — review known and uncovered contract impact for this task's changed
|
|
47
|
+
paths (preferred) or a Git base fallback.
|
|
48
|
+
|
|
49
|
+
Metadata mutation actions are explicit: `record`, `relate`, `verify`, and
|
|
50
|
+
`remove`. They do not edit primary documents. The wrapper requires a source
|
|
51
|
+
review acknowledgement before `record`, concrete semantic evidence review before
|
|
52
|
+
`relate`/`verify`, and an explicit metadata-only acknowledgement before `remove`.
|
|
53
|
+
|
|
54
|
+
For a **material behavior-changing implementation** in repo-aware mode, the
|
|
55
|
+
model-facing contract is:
|
|
56
|
+
|
|
57
|
+
1. Find the existing primary behavioral contract before or while implementing.
|
|
58
|
+
2. Keep that primary spec aligned with the intended behavior in the same task.
|
|
59
|
+
If no suitable primary contract exists, create a focused spec with the normal
|
|
60
|
+
Edit/Write/`apply_patch` tools before recording its metadata.
|
|
61
|
+
3. After implementation, run task-scoped `repo_knowledge` `impact` on the files
|
|
62
|
+
changed by this task; review uncovered paths and new/moved documents.
|
|
63
|
+
4. Repair only evidence-backed relations. Similarity or graph proximity alone
|
|
64
|
+
never authorizes a durable relation, and a reviewed no-impact result is valid.
|
|
65
|
+
5. `record` means classified/indexed, **not verified**. Run `verify` only after
|
|
66
|
+
reading the primary source and checking relevant code/tests/evidence. Changed
|
|
67
|
+
code never automatically rewrites spec semantics.
|
|
68
|
+
|
|
69
|
+
Mechanical refactors, typo/formatting edits, exact renames, and other changes
|
|
70
|
+
that do not alter project behavior do not require this knowledge-maintenance
|
|
71
|
+
lifecycle. When `idx` is unavailable or the project is not indexed, none of
|
|
72
|
+
these requirements are injected; use the normal repository workflow instead.
|
|
73
|
+
For repo-aware projects, completing a todo when only the final active todo
|
|
74
|
+
remains adds one compact reminder to reconcile affected specs and repo knowledge
|
|
75
|
+
before closing that final todo. File mutations themselves do not emit knowledge
|
|
76
|
+
reminders.
|
|
29
77
|
|
|
30
78
|
## Session recovery
|
|
31
79
|
|
|
@@ -105,6 +153,7 @@ DCP settings are stored only under `dcp` in the user shared config file `~/.conf
|
|
|
105
153
|
"enabled": false,
|
|
106
154
|
"patience": 2,
|
|
107
155
|
"summarizerModel": [],
|
|
156
|
+
"summarizerFallbackModels": [],
|
|
108
157
|
"timeoutMs": 20000
|
|
109
158
|
}
|
|
110
159
|
},
|
|
@@ -176,11 +225,16 @@ DCP settings are stored only under `dcp` in the user shared config file `~/.conf
|
|
|
176
225
|
|
|
177
226
|
`minContextPercent` / `maxContextPercent` accept legacy fractions (`0.25`), percent strings (`"25%"`), or absolute token counts when Pi knows the current model context window. `minContextLimit` / `maxContextLimit` and `modelMinContextLimits` / `modelMaxContextLimits` are explicit absolute-or-percent aliases. `modelOverrides` and the `modelMin*` / `modelMax*` maps support exact model keys plus `*` / `?` wildcard patterns; matching is applied from generic to specific so exact bare-model matches override bare wildcards, and exact `provider/model` matches override provider wildcards. Array fields are union-merged, so model-specific `protectedTools` extend the defaults instead of replacing them. If `compress.protectUserMessages` is enabled, range compression appends selected user messages verbatim instead of rejecting the range; individual message compression still skips protected raw user messages. Protected tool outputs are copied into summaries for tools protected by name or `protectedFilePatterns`; protected `subagents` result reads also try to include the saved `result.md` artifact when available.
|
|
178
227
|
|
|
179
|
-
`compress.autoCompress.enabled` is `false` by default. When explicitly enabled, its `patience` counts completed correlated main-provider opportunities, not repeated context transforms; `summarizerModel
|
|
228
|
+
`compress.autoCompress.enabled` is `false` by default. When explicitly enabled, its `patience` counts completed correlated main-provider opportunities, not repeated context transforms; `summarizerModel` supplies the primary summarizer list and `summarizerFallbackModels` appends explicit ordered fallbacks. Existing multi-entry `summarizerModel` configs remain supported. When both lists are empty, DCP uses the bounded extractive fallback without a model call. A configured model summarizer receives a bounded sub-deadline (75% of `timeoutMs`) so deterministic extractive fallback and durable publication retain time inside the whole operation budget. After a failed model-backed auto-compression attempt, subsequent automatic attempts in that session skip the model summarizer and use deterministic extraction. Auto commit is accepted only when the full projected replacement has positive gain and meets the current budget-recovery target.
|
|
180
229
|
|
|
181
|
-
`strategies.emergencyCurrentTurnPruning` is the default-enabled lossy safety floor for a single unfinished turn
|
|
230
|
+
`strategies.emergencyCurrentTurnPruning` is the default-enabled lossy safety floor for a single unfinished turn. DCP first emits emergency reminders and offers only safe old same-turn tool-result candidates. After `patience` completed ignored opportunities, at the model-independent `hardContextPercent`, or when exact auto-compression fails while input capacity is already exceeded, it replaces eligible oldest result bodies until the estimated provider context reaches `targetContextPercent` or a safe capacity margin. User messages, configured/protected data, the newest `keepRecentToolPairs`, and results without **completed** provider evidence are never selected. HTTP 2xx alone is not evidence; DCP promotes eligibility only after an unambiguously correlated successful finalized assistant response, and ambiguous retries/interleaving fail closed. If eligible recovery still cannot fit the request, DCP emits a user-visible blocked diagnostic with the capacity reason before abort/handoff. The raw session transcript is unchanged. Setting `enabled` to `false` disables same-turn candidates and lossy pruning, but keeps the non-destructive emergency reminder.
|
|
182
231
|
|
|
183
|
-
DCP
|
|
232
|
+
DCP durable state is journaled as append-only `dcp-journal` custom entries in
|
|
233
|
+
the Pi session JSONL. Resume/reload replays that journal; the current
|
|
234
|
+
implementation has no legacy sidecar importer or dual-write path. Protected
|
|
235
|
+
subagent artifacts are optional bounded recovery input: reads are async, rooted
|
|
236
|
+
at the session cwd, reject symlink escapes and oversized files, and never
|
|
237
|
+
silently truncate a required protected artifact.
|
|
184
238
|
|
|
185
239
|
Set `dcp.debug: true` to write a JSONL debug log of DCP context/prune/compress events to `~/.pi/agent/dcp-debug.jsonl` (override the path with `PI_DCP_DEBUG_LOG`, or enable without config via `PI_DCP_DEBUG=1`); off by default. The log is size-limited and rotated: once it reaches `dcp.debugLog.maxBytes` (default `5242880` = 5 MB) it is renamed to `.1`, older backups shift down (`.1`→`.2`, …) and the oldest beyond `dcp.debugLog.maxBackups` (default `3`, minimum `1`) is dropped; override either with `PI_DCP_DEBUG_MAX_BYTES` / `PI_DCP_DEBUG_MAX_BACKUPS`.
|
|
186
240
|
|
|
@@ -444,10 +498,11 @@ Explicit task/CLI model overrides bypass the pool. Setting
|
|
|
444
498
|
`PI_SUBAGENTS_FORCE_CURRENT_MODEL=1`) deliberately selects the parent model and
|
|
445
499
|
strips conflicting model arguments; this is not the economical default.
|
|
446
500
|
|
|
447
|
-
The
|
|
501
|
+
The six built-in modes are `research` (read-only evidence and independent
|
|
448
502
|
review), `implement` (bounded code, docs, tests, or UI changes), `verify`
|
|
449
|
-
(run checks and diagnose logs without fixing files), `
|
|
450
|
-
|
|
503
|
+
(run checks and diagnose logs without fixing files), `ui-qa` (real browser,
|
|
504
|
+
terminal/TUI, and desktop-GUI verification), `frontier-review` (independent
|
|
505
|
+
post-implementation review), and `oracle` (deliberate strong second opinion).
|
|
451
506
|
Ordinary workers use economical model candidates; no built-in parent-tier
|
|
452
507
|
rule promotes them to a flagship. Oracle is the exception, not an automatic
|
|
453
508
|
retry for difficult work. Task-specific discipline belongs in the brief.
|
|
@@ -473,13 +528,14 @@ contract, configuration examples, override rules and legacy compatibility.
|
|
|
473
528
|
The parent normally selects an explicit `subagentType` from the effective
|
|
474
529
|
system-prompt catalog, preferring a matching project-local specialist. Valid
|
|
475
530
|
explicit types bypass the LLM router entirely; presets, model selection, tools,
|
|
476
|
-
|
|
531
|
+
and role instructions are still applied by the normal config resolver.
|
|
477
532
|
Model/thinking overrides are not substitutes for selecting a role.
|
|
478
533
|
|
|
479
534
|
The router remains enabled as a fallback for omitted types: use it when the role
|
|
480
535
|
is unclear or the user explicitly requests automatic routing. Only omitted
|
|
481
536
|
tasks are classified, in one batch; the parent's explicit choices are preserved.
|
|
482
|
-
Real
|
|
537
|
+
Real UI QA still requires explicit `subagentType: "ui-qa"`. Explicit legacy
|
|
538
|
+
`browser-qa` requests normalize to `ui-qa` for compatibility.
|
|
483
539
|
|
|
484
540
|
Unknown explicit types and failed/incomplete automatic routing reject the
|
|
485
541
|
**entire spawn batch before run state or child processes are created**. The tool
|
|
@@ -520,35 +576,86 @@ You are this project's staff reviewer. Apply the repo rules from
|
|
|
520
576
|
AGENTS.md before approving anything; cite file paths first.
|
|
521
577
|
```
|
|
522
578
|
|
|
523
|
-
- Frontmatter keys: `name` (must match the filename), `description`, `icon`, `models`, `thinking`, `tools`, `
|
|
579
|
+
- Frontmatter keys: `name` (must match the filename), `description`, `icon`, `models`, `thinking`, `tools`, `extraArgs`, `promptAppend`, `promptOverride`, `retry`, `maxResultBytes`, `timeoutMs`. Legacy `model`, `fallbackModels`, and `modelByParent` still load. Unknown keys are rejected with an error naming the file.
|
|
524
580
|
- Array fields accept block lists (`- item`), inline arrays (`[a, b]`), or comma-separated strings (`tools: read, grep, bash`). The frontmatter YAML subset is intentionally small: scalars, quoted strings, numbers, comments, lists, and nested maps for `modelByParent`/`retry`. Tabs, block scalars (`|`/`>`), anchors/aliases, and flow maps are hard errors naming file and line.
|
|
525
581
|
- The markdown body becomes `promptAppend`: it is appended after the standard generated prompt (parent objective + task + output format), so the agent still receives its task in the usual structure. Use frontmatter `promptOverride` for full prompt replacement.
|
|
526
|
-
- Precedence:
|
|
582
|
+
- Precedence: bundled Markdown defines the built-ins, then the nearest project `.pi/agents/*.md` file overrides the same-named built-in field-by-field. Markdown is the only source of agent role/profile definitions. The removed `asyncSubagents` section and old standalone config-path variables are not read.
|
|
527
583
|
- Files without frontmatter are skipped (a `README.md` there is fine). Definition loading is uncached: edits apply on the next config read/spawn without a restart, and the effective system-prompt catalog is rebuilt at parent-agent start.
|
|
528
584
|
- Bundled roles use the same format internally under `src/async-subagents/agents/*.md`; built-in and project-local profiles therefore share one parser and normalization path instead of maintaining a second role-description schema in TypeScript.
|
|
529
585
|
- `icon` names an agent glyph for UIs that render sub-agent widgets (pix TUI panel, Pix Desktop subagents panel): `agent` (neutral default), `search`, `code`, `flask`, `globe`, `sparkles`, `brain`, `wrench`, `terminal`, `bug`, `book`, `eye`, `zap`, `rocket`. The value is passed through opaquely; unknown names render as the neutral agent icon, and status stays color-coded next to it.
|
|
530
586
|
|
|
531
|
-
###
|
|
532
|
-
|
|
533
|
-
The built-in `
|
|
534
|
-
`openai-codex/gpt-5.6-luna` as its fallback. Its
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
`
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
587
|
+
### Real UI QA (browser, TUI, and desktop GUI)
|
|
588
|
+
|
|
589
|
+
The built-in `ui-qa` role runs on `zai/glm-5.3-flash`, with
|
|
590
|
+
`openai-codex/gpt-5.6-luna` as its fallback. Its Markdown body
|
|
591
|
+
(`src/async-subagents/agents/ui-qa.md`) is a deliberately thin common contract:
|
|
592
|
+
test the real user-facing target, classify only the top-level backend, route
|
|
593
|
+
through on-demand guides, run through the unified runner, and keep deterministic
|
|
594
|
+
assertions as the oracle with bounded execution, owned cleanup, and private
|
|
595
|
+
evidence. Provider/presentation/platform details are intentionally absent from
|
|
596
|
+
the initial role body. The normal profile loader appends that body to the QA
|
|
597
|
+
child's task prompt; the parent and LLM router receive only the short
|
|
598
|
+
`description`. There is no additional QA skill to discover or read.
|
|
599
|
+
|
|
600
|
+
Backend specifics use progressive disclosure through bundled guides under
|
|
601
|
+
`src/async-subagents/agents/ui-qa/guides/`. `browser.md`, `tui.md`, and
|
|
602
|
+
`desktop.md` are compact routers; backend-scoped detail topics cover the actual
|
|
603
|
+
browser provider, TUI presentation, desktop platform driver, and explicit
|
|
604
|
+
browser-auth workflow. The child loads the matching base guide, then only the
|
|
605
|
+
routed detail topic read-only via the runner:
|
|
606
|
+
|
|
607
|
+
```sh
|
|
608
|
+
node "$PI_UI_QA_RUNNER" guide --backend browser # or: tui | desktop
|
|
609
|
+
node "$PI_UI_QA_RUNNER" guide --backend browser --topic playwright
|
|
610
|
+
# other examples: chrome-devtools, tui/native-terminal, desktop/windows-uia
|
|
611
|
+
```
|
|
612
|
+
|
|
613
|
+
The command resolves the guide from a backend-scoped fixed allowlist bundled
|
|
614
|
+
with the suite (never a model-composed path), rejects unknown/cross-backend
|
|
615
|
+
topics/options and extra arguments, bounds guide size, and prints only the
|
|
616
|
+
requested document. `probe` returns authoritative
|
|
617
|
+
`selection.guide = {backend, topic}`; the child reconciles that route before
|
|
618
|
+
`run`.
|
|
619
|
+
|
|
620
|
+
`ui-qa` authors one private declarative flow and invokes the capability-first
|
|
621
|
+
runner supplied in `PI_UI_QA_RUNNER`. The runner selects exactly one backend
|
|
622
|
+
from the target descriptor and reports candidate capabilities plus its selection
|
|
623
|
+
rationale. Browser routing selects the trusted Playwright backend or the
|
|
624
|
+
capability-probed Chrome DevTools provider. TUI routing selects PTY semantics or
|
|
625
|
+
the native-terminal mirror. Desktop routing selects the capability-probed macOS
|
|
626
|
+
Accessibility, Windows UI Automation, or Linux AT-SPI implementation. Evidence
|
|
627
|
+
capabilities remain platform-specific and never replace deterministic
|
|
628
|
+
assertions. Unsupported platforms or missing required control permissions
|
|
629
|
+
return `BLOCKED`. QA does not
|
|
630
|
+
install GUI automation dependencies, change OS privacy/accessibility settings,
|
|
631
|
+
disable sandboxing, or operate unrelated user windows. Static or mock checks do
|
|
632
|
+
not substitute for the requested UI.
|
|
633
|
+
|
|
634
|
+
Unified flows and native/TUI evidence—including automatic recordings—stay in the owning agent's private
|
|
635
|
+
`.pi/subagents/<run>/<agent-id>/ui-qa/` workspace. Pass/fail requires a
|
|
636
|
+
product-visible deterministic oracle such as terminal content/state,
|
|
637
|
+
accessibility/app-driver state, window/dialog state, or visible control values;
|
|
638
|
+
screenshots are supporting evidence, not the sole oracle. Cleanup is scoped to
|
|
639
|
+
the PTY/session/app process created by the QA run.
|
|
640
|
+
|
|
641
|
+
#### Browser backend and project auth
|
|
642
|
+
|
|
643
|
+
The capability-first runner and all backend resources live under
|
|
644
|
+
`src/async-subagents/agents/ui-qa/`; the trusted browser runner, vendor code,
|
|
645
|
+
license, and examples are grouped under its `browser/` directory. The launcher
|
|
646
|
+
supplies absolute paths in `PI_UI_QA_RUNNER` and `PI_BROWSER_QA_RUNNER`. Normal
|
|
647
|
+
probe/run uses the former;
|
|
648
|
+
the latter is invoked directly only for browser auth profile discovery and
|
|
649
|
+
form-auth scaffolding. These non-secret paths are set only for QA children.
|
|
650
|
+
Every async sub-agent launches with `--no-skills`, and skill flags in
|
|
651
|
+
`extraArgs` are stripped rather than forwarded. Agent roles are self-contained;
|
|
652
|
+
there is no profile field for injecting skills and no built-in QA `--skill`.
|
|
653
|
+
|
|
654
|
+
Model/thinking/tool-only overrides should use a project `ui-qa.md` and inherit
|
|
655
|
+
the bundled Markdown workflow. A legacy project `browser-qa.md` is migrated to
|
|
656
|
+
the canonical `ui-qa` profile when no `ui-qa.md` override exists. A project
|
|
657
|
+
Markdown body replaces the inherited
|
|
658
|
+
`promptAppend` under the usual field-level merge rules; custom QA instructions must preserve the runner-only,
|
|
552
659
|
credential, target, and evidence contracts. Runner-enforced isolation and
|
|
553
660
|
credential handling remain in code, not in the prompt.
|
|
554
661
|
|
|
@@ -594,9 +701,10 @@ video recording begins on the login page and captures the field-filling and subm
|
|
|
594
701
|
sequence; password inputs remain browser-masked, but the private video may show
|
|
595
702
|
other visible login identifiers and must be treated as sensitive evidence. Tracing
|
|
596
703
|
starts only after login succeeds and is sanitized before retention. The launcher
|
|
597
|
-
provides each
|
|
598
|
-
`.pi/subagents/<run>/<agent-id>/browser-qa/` workspace.
|
|
599
|
-
|
|
704
|
+
provides each UI QA process with its general `ui-qa/` workspace plus the browser
|
|
705
|
+
backend's `.pi/subagents/<run>/<agent-id>/browser-qa/` workspace. Unified flows
|
|
706
|
+
stay under `ui-qa/flows/`; browser adapter flows, screenshots, video, sanitized
|
|
707
|
+
traces, and result manifests stay under the backend workspace, so normal
|
|
600
708
|
session shutdown or `subagents cleanup` removes them with the run directory.
|
|
601
709
|
The runner validates the owning agent metadata and refuses flows outside that
|
|
602
710
|
workspace; reusing an agent id clears stale browser QA files first. Trace archives
|
|
@@ -607,7 +715,7 @@ creating a template. Only an explicit authenticated request may create the
|
|
|
607
715
|
private template. Missing, rejected, or expired selected auth returns
|
|
608
716
|
`QA_AUTH_UPDATE_REQUIRED`, naming only the profile/file/reason needed for the
|
|
609
717
|
parent to ask the user for an update and rerun. See
|
|
610
|
-
`src/async-subagents/agents/
|
|
718
|
+
`src/async-subagents/agents/ui-qa/browser/examples/qa-auth.example.jsonc`
|
|
611
719
|
for complete profile shapes and `examples/qa-flow.example.jsonc` beside it for
|
|
612
720
|
the declarative, non-executable QA action/assertion format.
|
|
613
721
|
|
|
@@ -621,7 +729,7 @@ so screenshots and assertions remain state-focused.
|
|
|
621
729
|
|
|
622
730
|
Async-subagents also injects a lightweight oh-my-openagent-style system-prompt strategy by model: non-GPT parents get `parallel-first`, an orchestration-first hint that favors ultrawork/subagents for broad work, while GPT-like parents get `deep-work`, a direct deep-worker hint that uses subagents only when clearly useful. Explicit custom system prompts (`--system-prompt`, `SYSTEM.md`, custom templates) are respected and skip this injection by default. Disable it with `PI_AGENT_STRATEGY=off`; force a strategy with `PI_AGENT_STRATEGY=parallel-first` or `PI_AGENT_STRATEGY=deep-work`; set `PI_AGENT_STRATEGY_WITH_CUSTOM_PROMPT=1` to append it even when a custom prompt is present.
|
|
623
731
|
|
|
624
|
-
For blind-model screenshot/image inspection, use the main-session `coding-discipline` lookup tool; the bundled default uses vision-capable `zai/glm-5.3-flash`. Async-subagents still supports `imagePaths` on tasks when a broader delegated track genuinely needs images, but it no longer ships a dedicated `vision` role.
|
|
732
|
+
For blind-model screenshot/image inspection, use the main-session `coding-discipline` lookup tool; the bundled default uses vision-capable `zai/glm-5.3-flash`. `lookupFallbackModels` is the ordered fallback array for `lookupModel` and defaults to `[]`; lookup tries the configured chain in order. Async-subagents still supports `imagePaths` on tasks when a broader delegated track genuinely needs images, but it no longer ships a dedicated `vision` role. Provider image metadata is supplemented by an internal compatibility list for known blind models so the parent does not falsely claim visual access; this is runtime capability policy, not agent configuration.
|
|
625
733
|
|
|
626
734
|
When `subagentType` is omitted, the lightweight role router classifies the task
|
|
627
735
|
using the descriptions. Explicit types bypass it. Unknown types or failed
|
|
@@ -638,7 +746,7 @@ Pool order does not change preference and pool-only models are never appended.
|
|
|
638
746
|
Without a preset, the full agent list is eligible. Candidate order expresses
|
|
639
747
|
the configured budget preference; runtime does not infer current API prices.
|
|
640
748
|
|
|
641
|
-
Image-bearing tasks and `
|
|
749
|
+
Image-bearing tasks and `ui-qa` require confirmed image support; configured
|
|
642
750
|
blind-model masks override runtime image metadata. Remaining eligible models
|
|
643
751
|
form the quota fallback chain, so neither quota history nor image fallback can
|
|
644
752
|
escape the pool. Antigravity account rotation still happens before provider
|
|
@@ -653,39 +761,28 @@ Explicit task/CLI model overrides and `FORCE_CURRENT_MODEL` remain deliberate
|
|
|
653
761
|
escape hatches and disable automatic model fallback for that task. They do not
|
|
654
762
|
bypass the image-capability check.
|
|
655
763
|
|
|
656
|
-
|
|
657
|
-
|
|
764
|
+
Bundled pools live in `src/async-subagents/agents/presets.jsonc`. Add or override
|
|
765
|
+
project pools in the nearest `.pi/agents/presets.jsonc`. Select a saved pool
|
|
766
|
+
with `/subagent-preset`; use `AGENTS_PRESET=<name>` or
|
|
658
767
|
`/subagent-preset session <name>` for a process-only override and
|
|
659
768
|
`/subagent-preset session-clear` to remove it. The saved selection lives in
|
|
660
|
-
`~/.pi/agent/subagent-preset-selection.json`. `/subagent-preset
|
|
661
|
-
|
|
769
|
+
`~/.pi/agent/subagent-preset-selection.json`. `/subagent-preset path` shows the
|
|
770
|
+
bundled and project preset paths. The shipped pools are `cheap` (GLM), `gpt`,
|
|
662
771
|
and `deep` (the retained legacy name for the mixed pool, not worker escalation).
|
|
663
|
-
|
|
664
|
-
|
|
772
|
+
Agent descriptions, instructions, model order, thinking, tools, retry, and
|
|
773
|
+
timeouts remain in agent Markdown; selecting a pool never changes them.
|
|
665
774
|
|
|
666
|
-
Example
|
|
775
|
+
Example project `.pi/agents/presets.jsonc`:
|
|
667
776
|
|
|
668
777
|
```jsonc
|
|
669
778
|
{
|
|
670
|
-
"
|
|
671
|
-
"
|
|
672
|
-
"
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
"presets": {
|
|
678
|
-
"cheap": {
|
|
679
|
-
"description": "GLM workers with a strong oracle candidate.",
|
|
680
|
-
"models": ["zai/glm-5-turbo", "zai/glm-5.3-flash", "zai/glm-5.3"]
|
|
681
|
-
}
|
|
682
|
-
},
|
|
683
|
-
"types": {
|
|
684
|
-
"research": {
|
|
685
|
-
"models": ["zai/glm-5-turbo", "openai-codex/gpt-5.6-luna"],
|
|
686
|
-
"thinking": "low"
|
|
687
|
-
}
|
|
688
|
-
}
|
|
779
|
+
"cheap": {
|
|
780
|
+
"description": "GLM workers with a strong oracle candidate.",
|
|
781
|
+
"models": ["zai/glm-5-turbo", "zai/glm-5.3-flash", "zai/glm-5.3"]
|
|
782
|
+
},
|
|
783
|
+
"project-gpt": {
|
|
784
|
+
"description": "GPT models approved for this project.",
|
|
785
|
+
"models": ["openai-codex/gpt-5.6-luna", "openai-codex/gpt-5.6-terra"]
|
|
689
786
|
}
|
|
690
787
|
}
|
|
691
788
|
```
|
|
@@ -694,21 +791,19 @@ Example shared async-subagents config section:
|
|
|
694
791
|
|
|
695
792
|
Old built-in role names are no longer implicit aliases. `quick`, `scan`,
|
|
696
793
|
`review`, `deep`, `docs`, `frontend`, and `tests` are valid only when explicitly
|
|
697
|
-
defined as ordinary
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
Runtime retry structures and the separate role router continue to use the
|
|
711
|
-
term `fallbackModels` for actual fallback-only lists, not agent candidates.
|
|
794
|
+
defined as ordinary project `.pi/agents/<name>.md` files.
|
|
795
|
+
|
|
796
|
+
Within an agent Markdown file, legacy `model` plus `fallbackModels` and
|
|
797
|
+
`modelByParent` remain readable. `models` is a complete replacement list: it
|
|
798
|
+
clears inherited legacy model/fallback/parent routing. New built-ins use ordered
|
|
799
|
+
`models` lists and contain no parent-tier escalation maps.
|
|
800
|
+
|
|
801
|
+
The removed `asyncSubagents` section is not part of the public schema or generated
|
|
802
|
+
user config and is no longer read at runtime. Existing files can remain on disk
|
|
803
|
+
without being rewritten, but they have no effect: migrate role definitions to
|
|
804
|
+
`.pi/agents/*.md` and custom model pools to `.pi/agents/presets.jsonc`. Runtime
|
|
805
|
+
retry structures and the separate role router continue to use the term
|
|
806
|
+
`fallbackModels` for actual fallback-only lists, not agent candidates.
|
|
712
807
|
|
|
713
808
|
Sub-agents run with `--no-session` by default to avoid writing duplicate Pi session JSONL files for fire-and-forget background work. Set `ASYNC_SUBAGENTS_ENABLE_SESSIONS=1` to restore persisted per-agent sessions under each agent's `sessions/` directory; this also registers the session-navigation slash commands (`/sub-open`, `/sub-back`, `/sub-where`) needed for switching and deeper post-mortem navigation.
|
|
714
809
|
|
|
@@ -716,7 +811,7 @@ Sub-agent runs are stored in the current project's `.pi/subagents/` directory wh
|
|
|
716
811
|
|
|
717
812
|
Runtime logs are minimized by default: successful agents do not keep `events.jsonl`, and `stderr.log` is discarded unless the agent fails. Set `ASYNC_SUBAGENTS_DEBUG_LOGS=1` / `PI_SUBAGENTS_DEBUG_LOGS=1` to keep diagnostic logs for successful agents too; debug event logs store a compact RPC event summary instead of the full streaming transcript. Defaults are 0 bytes for `events.jsonl` without debug, 32 MiB for debug `events.jsonl`, 8 MiB for retained `stderr.log`, and 8 MiB for a single RPC JSON line; override with `ASYNC_SUBAGENTS_MAX_EVENTS_BYTES` / `PI_SUBAGENTS_MAX_EVENTS_BYTES`, `ASYNC_SUBAGENTS_MAX_STDERR_BYTES` / `PI_SUBAGENTS_MAX_STDERR_BYTES`, and `ASYNC_SUBAGENTS_MAX_RPC_LINE_CHARS` / `PI_SUBAGENTS_MAX_RPC_LINE_CHARS`.
|
|
718
813
|
|
|
719
|
-
|
|
814
|
+
Runtime concurrency defaults to 5 agents per project and the global result summary bound defaults to 100000 bytes. These are internal engine defaults rather than normal user configuration. Per-agent `retry`, `maxResultBytes`, and `timeoutMs` belong in agent Markdown; spawn calls and individual task objects can pass `timeoutSeconds` to shorten the watchdog for synthetic tests or bounded probes. Stop requests mark running, queued planned, and retry-pending agents as `stopped` so queued work is not launched later. Completed agents write `result.json` with status/duration/model/retry metadata plus best-effort `summary`, `findings`, `files`, `risks`, `nextActions`, and `confidence` fields for parent-agent chaining.
|
|
720
815
|
|
|
721
816
|
## OpenCode credential import
|
|
722
817
|
|
|
@@ -736,6 +831,14 @@ Without an Ollama API key, both tools default to `http://localhost:11434/api/exp
|
|
|
736
831
|
|
|
737
832
|
Configure a Tavily key to enable automatic fallback for both tools. Ollama remains the primary provider; if any Ollama request or response fails, `web_search` retries through `https://api.tavily.com/search` and `web_fetch` retries through `https://api.tavily.com/extract`. The Tavily key is sent only in Tavily's bearer authorization header and is never accepted as a tool parameter or included in result details. Fallback results set `details.provider` to `tavily` and include the primary Ollama error under `details.fallbackFrom`; ordinary results set `details.provider` to `ollama`.
|
|
738
833
|
|
|
834
|
+
When Context Gateway is in `enforce` mode, an over-budget `web_search` or
|
|
835
|
+
`web_fetch` result with complete structured producer details is delivered to the
|
|
836
|
+
next model as a bounded `web-recoverable-compact` view. The original structured
|
|
837
|
+
details stay in the raw session tool result (they are not serialized into the
|
|
838
|
+
provider request) and can be found by `toolCallId` with `session_search`, then
|
|
839
|
+
read or paged with `session_read_section`. Unsupported web result shapes remain
|
|
840
|
+
passthrough instead of being irreversibly sliced.
|
|
841
|
+
|
|
739
842
|
The recommended interactive setup is:
|
|
740
843
|
|
|
741
844
|
```text
|
|
@@ -780,17 +883,27 @@ pi-tools-suite/
|
|
|
780
883
|
package.json
|
|
781
884
|
src/
|
|
782
885
|
index.ts
|
|
886
|
+
coding-discipline/
|
|
783
887
|
ast-grep/
|
|
784
888
|
async-subagents/
|
|
785
889
|
lsp/
|
|
890
|
+
comment-checker/
|
|
891
|
+
session-name/
|
|
892
|
+
session-recovery/
|
|
786
893
|
repo-discovery/
|
|
787
894
|
antigravity-auth/
|
|
895
|
+
opencode-import/
|
|
788
896
|
todo/
|
|
789
897
|
model-tools/
|
|
790
898
|
usage/
|
|
791
899
|
web-search/
|
|
900
|
+
context-gateway/
|
|
901
|
+
truncation-metadata-normalizer/
|
|
792
902
|
dcp/
|
|
793
903
|
prompt-commands/
|
|
904
|
+
resource-registry/
|
|
905
|
+
credential-firewall/
|
|
906
|
+
codex-reasoning-fix/
|
|
794
907
|
docs/
|
|
795
908
|
licenses/
|
|
796
909
|
scripts/
|
|
@@ -137,7 +137,7 @@ The current extension registry covers all 19 modules:
|
|
|
137
137
|
| `web-search` | web-search tests | deterministic only |
|
|
138
138
|
| `dcp` | DCP prompt/pruning/state tests | existing prompt evals |
|
|
139
139
|
| `prompt-commands` | eval extension contracts | deterministic only |
|
|
140
|
-
| `
|
|
140
|
+
| `resource-registry` | resource-registry integration + eval extension contracts | deterministic only |
|
|
141
141
|
| `credential-firewall` | firewall tests | deterministic only |
|
|
142
142
|
| `codex-reasoning-fix` | reasoning-fix tests | deterministic only |
|
|
143
143
|
|
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Status: implemented MVP contract (semantic search is intentionally deferred).
|
|
4
4
|
|
|
5
|
+
## Type
|
|
6
|
+
|
|
7
|
+
As-is
|
|
8
|
+
|
|
9
|
+
## Lifecycle
|
|
10
|
+
|
|
11
|
+
Active implemented contract.
|
|
12
|
+
|
|
5
13
|
## Goal
|
|
6
14
|
|
|
7
15
|
Let an agent recover the task, recent instructions, file activity, and useful raw
|
|
@@ -28,19 +36,36 @@ active model context by compaction remains discoverable.
|
|
|
28
36
|
|
|
29
37
|
A section starts at the first selected entry, a user message, a compaction, or a
|
|
30
38
|
branch summary. Its stable ID is derived from the start entry ID. The overview
|
|
31
|
-
reports bounded
|
|
32
|
-
role/tool/error/file statistics.
|
|
39
|
+
reports bounded section pages with entry ranges, counts, and compact
|
|
40
|
+
role/tool/error/file statistics. When more sections exist it returns an opaque
|
|
41
|
+
`nextCursor`; continuing with that cursor resumes after the last delivered
|
|
42
|
+
section. Labels are previews, not inferred decisions.
|
|
33
43
|
|
|
34
44
|
### Reading and search
|
|
35
45
|
|
|
36
|
-
`session_read_section`
|
|
37
|
-
|
|
46
|
+
`session_read_section` accepts either a section ID produced for the same scope or
|
|
47
|
+
one exact raw `entry_id`. Direct entry reads avoid scanning from the start of a
|
|
48
|
+
section and are useful when overview/search already identified the exact entry.
|
|
49
|
+
Without a continuation cursor, callers must pass exactly one of `section_id` or
|
|
50
|
+
`entry_id`.
|
|
51
|
+
|
|
52
|
+
The reader renders message roles/text, tool calls/arguments, tool results,
|
|
38
53
|
compaction summaries, and branch summaries with per-entry and total output
|
|
39
|
-
limits.
|
|
54
|
+
limits. Long entry bodies and multi-entry pages return an opaque `nextCursor`;
|
|
55
|
+
passing that cursor continues at the exact entry/body offset and must use the
|
|
56
|
+
same scope.
|
|
57
|
+
|
|
58
|
+
When Context Gateway has delivered a `web-recoverable-compact` result,
|
|
59
|
+
`session_search` can locate its raw tool-result entry by `toolCallId`, and
|
|
60
|
+
`session_read_section` exposes the retained structured `toolResult.details`
|
|
61
|
+
under `recoverable_raw_details`. The compact provider view is therefore not the
|
|
62
|
+
only copy of the web result: recovery reads the original structured data from
|
|
63
|
+
the append-only session and never refetches the URL.
|
|
40
64
|
|
|
41
65
|
`session_search` is case-insensitive by default and searches message text, tool
|
|
42
66
|
arguments/results, custom-message content, and compaction or branch summaries.
|
|
43
|
-
It returns entry and section IDs plus bounded snippets.
|
|
67
|
+
It returns entry and section IDs plus bounded snippets. Search pages use an
|
|
68
|
+
opaque cursor bound to scope, query, and case-sensitivity. Regex and semantic
|
|
44
69
|
search are out of scope for the MVP.
|
|
45
70
|
|
|
46
71
|
### Recovery context
|
|
@@ -60,6 +85,8 @@ tools are not guessed to be mutations.
|
|
|
60
85
|
|
|
61
86
|
- Results use small defaults and hard caps for result count, entry body size,
|
|
62
87
|
and total text size.
|
|
88
|
+
- Overview, read, and search pagination use opaque validated cursors; a cursor
|
|
89
|
+
from another scope/query or a stale section is rejected rather than guessed.
|
|
63
90
|
- Empty or in-memory sessions return a normal explanatory result.
|
|
64
91
|
- Unknown or partially shaped entries are ignored or rendered conservatively.
|
|
65
92
|
- Concurrent sibling tool results might not yet be visible when recovery runs.
|
|
@@ -68,17 +95,23 @@ tools are not guessed to be mutations.
|
|
|
68
95
|
- Parent-session metadata is reported when Pi exposes it; parent files are not
|
|
69
96
|
traversed.
|
|
70
97
|
|
|
98
|
+
## Related files
|
|
99
|
+
|
|
100
|
+
- `external/pi-tools-suite/src/session-recovery/index.ts`
|
|
101
|
+
- `external/pi-tools-suite/src/tool-descriptions.ts`
|
|
102
|
+
- `external/pi-tools-suite/test/session-recovery.test.ts`
|
|
103
|
+
|
|
71
104
|
## Verification
|
|
72
105
|
|
|
73
106
|
Deterministic tests cover active versus all branches, raw pre-compaction search,
|
|
74
|
-
stable section IDs,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
107
|
+
stable section IDs, overview/search pagination, direct late-entry reads,
|
|
108
|
+
continued long bodies, Unicode case-insensitive search, bounded output, empty
|
|
109
|
+
sessions, DCP-control filtering, current-call exclusion, recent errors, file
|
|
110
|
+
carry-forward details, and conservative handling of unknown entries. Release
|
|
111
|
+
verification runs the suite typecheck/tests/smoke gate and host checks.
|
|
79
112
|
|
|
80
113
|
## Evidence
|
|
81
114
|
|
|
82
|
-
Evidence is recorded by
|
|
83
|
-
`test/session-recovery.test.ts` and the
|
|
84
|
-
|
|
115
|
+
Evidence is recorded by
|
|
116
|
+
`external/pi-tools-suite/test/session-recovery.test.ts` and the implementation
|
|
117
|
+
in `external/pi-tools-suite/src/session-recovery/index.ts`.
|