@oh-my-pi/pi-coding-agent 16.3.5 → 16.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +78 -0
- package/dist/cli.js +3625 -3596
- package/dist/types/advisor/index.d.ts +6 -6
- package/dist/types/advisor/runtime.d.ts +1 -1
- package/dist/types/advisor/watchdog.d.ts +1 -1
- package/dist/types/async/index.d.ts +1 -1
- package/dist/types/auto-thinking/classifier.d.ts +2 -2
- package/dist/types/autolearn/controller.d.ts +2 -2
- package/dist/types/autoresearch/dashboard.d.ts +2 -2
- package/dist/types/autoresearch/git.d.ts +1 -1
- package/dist/types/autoresearch/helpers.d.ts +1 -1
- package/dist/types/autoresearch/index.d.ts +1 -1
- package/dist/types/autoresearch/state.d.ts +3 -3
- package/dist/types/autoresearch/storage.d.ts +1 -1
- package/dist/types/autoresearch/tools/init-experiment.d.ts +2 -2
- package/dist/types/autoresearch/tools/log-experiment.d.ts +2 -2
- package/dist/types/autoresearch/tools/run-experiment.d.ts +2 -2
- package/dist/types/autoresearch/tools/update-notes.d.ts +2 -2
- package/dist/types/autoresearch/types.d.ts +3 -3
- package/dist/types/capability/context-file.d.ts +2 -2
- package/dist/types/capability/extension-module.d.ts +2 -2
- package/dist/types/capability/extension.d.ts +3 -3
- package/dist/types/capability/hook.d.ts +2 -2
- package/dist/types/capability/index.d.ts +3 -3
- package/dist/types/capability/instruction.d.ts +2 -2
- package/dist/types/capability/mcp.d.ts +2 -2
- package/dist/types/capability/prompt.d.ts +2 -2
- package/dist/types/capability/rule-buckets.d.ts +2 -2
- package/dist/types/capability/rule.d.ts +2 -2
- package/dist/types/capability/settings.d.ts +2 -2
- package/dist/types/capability/skill.d.ts +2 -2
- package/dist/types/capability/slash-command.d.ts +2 -2
- package/dist/types/capability/ssh.d.ts +2 -2
- package/dist/types/capability/system-prompt.d.ts +2 -2
- package/dist/types/capability/tool.d.ts +2 -2
- package/dist/types/cli/args.d.ts +1 -1
- package/dist/types/cli/bench-cli.d.ts +2 -2
- package/dist/types/cli/dry-balance-cli.d.ts +1 -1
- package/dist/types/cli/extension-flags.d.ts +1 -1
- package/dist/types/cli/flag-tables.d.ts +2 -2
- package/dist/types/cli/gallery-cli.d.ts +1 -1
- package/dist/types/cli/gallery-fixtures/agentic.d.ts +1 -1
- package/dist/types/cli/gallery-fixtures/codeintel.d.ts +1 -1
- package/dist/types/cli/gallery-fixtures/edit.d.ts +1 -1
- package/dist/types/cli/gallery-fixtures/fs.d.ts +1 -1
- package/dist/types/cli/gallery-fixtures/index.d.ts +2 -2
- package/dist/types/cli/gallery-fixtures/interaction.d.ts +1 -1
- package/dist/types/cli/gallery-fixtures/memory.d.ts +1 -1
- package/dist/types/cli/gallery-fixtures/misc.d.ts +1 -1
- package/dist/types/cli/gallery-fixtures/search.d.ts +1 -1
- package/dist/types/cli/gallery-fixtures/shell.d.ts +1 -1
- package/dist/types/cli/gallery-fixtures/types.d.ts +1 -1
- package/dist/types/cli/gallery-fixtures/web.d.ts +1 -1
- package/dist/types/cli/gallery-screenshot.d.ts +1 -1
- package/dist/types/cli/initial-message.d.ts +1 -1
- package/dist/types/cli/models-cli.d.ts +1 -1
- package/dist/types/cli/plugin-cli.d.ts +1 -1
- package/dist/types/cli/session-picker.d.ts +1 -1
- package/dist/types/cli/startup-cwd.d.ts +1 -1
- package/dist/types/cli/tiny-models-cli.d.ts +1 -1
- package/dist/types/cli/web-search-cli.d.ts +1 -1
- package/dist/types/collab/crypto.d.ts +1 -1
- package/dist/types/collab/display-name.d.ts +1 -1
- package/dist/types/collab/guest.d.ts +4 -4
- package/dist/types/collab/host.d.ts +2 -2
- package/dist/types/collab/protocol.d.ts +3 -3
- package/dist/types/collab/relay-client.d.ts +1 -1
- package/dist/types/commands/auth-broker.d.ts +1 -1
- package/dist/types/commands/auth-gateway.d.ts +1 -1
- package/dist/types/commands/config.d.ts +1 -1
- package/dist/types/commands/plugin.d.ts +1 -1
- package/dist/types/commands/setup.d.ts +2 -2
- package/dist/types/commands/ssh.d.ts +1 -1
- package/dist/types/commands/tiny-models.d.ts +1 -1
- package/dist/types/commands/ttsr.d.ts +2 -2
- package/dist/types/commit/agentic/agent.d.ts +4 -4
- package/dist/types/commit/agentic/fallback.d.ts +2 -2
- package/dist/types/commit/agentic/index.d.ts +1 -1
- package/dist/types/commit/agentic/state.d.ts +1 -1
- package/dist/types/commit/agentic/tools/analyze-file.d.ts +5 -5
- package/dist/types/commit/agentic/tools/git-file-diff.d.ts +2 -2
- package/dist/types/commit/agentic/tools/git-hunk.d.ts +1 -1
- package/dist/types/commit/agentic/tools/git-overview.d.ts +2 -2
- package/dist/types/commit/agentic/tools/index.d.ts +5 -5
- package/dist/types/commit/agentic/tools/propose-changelog.d.ts +2 -2
- package/dist/types/commit/agentic/tools/propose-commit.d.ts +2 -2
- package/dist/types/commit/agentic/tools/recent-commits.d.ts +1 -1
- package/dist/types/commit/agentic/tools/split-commit.d.ts +2 -2
- package/dist/types/commit/agentic/topo-sort.d.ts +1 -1
- package/dist/types/commit/agentic/trivial.d.ts +1 -1
- package/dist/types/commit/agentic/validation.d.ts +1 -1
- package/dist/types/commit/analysis/conventional.d.ts +1 -1
- package/dist/types/commit/analysis/index.d.ts +4 -4
- package/dist/types/commit/analysis/scope.d.ts +1 -1
- package/dist/types/commit/analysis/summary.d.ts +1 -1
- package/dist/types/commit/analysis/validation.d.ts +1 -1
- package/dist/types/commit/changelog/detect.d.ts +1 -1
- package/dist/types/commit/changelog/generate.d.ts +1 -1
- package/dist/types/commit/changelog/parse.d.ts +1 -1
- package/dist/types/commit/cli.d.ts +1 -1
- package/dist/types/commit/git/diff.d.ts +1 -1
- package/dist/types/commit/index.d.ts +1 -1
- package/dist/types/commit/map-reduce/index.d.ts +1 -1
- package/dist/types/commit/map-reduce/map-phase.d.ts +1 -1
- package/dist/types/commit/map-reduce/reduce-phase.d.ts +1 -1
- package/dist/types/commit/message.d.ts +1 -1
- package/dist/types/commit/model-selection.d.ts +3 -3
- package/dist/types/commit/pipeline.d.ts +1 -1
- package/dist/types/commit/shared-llm.d.ts +1 -1
- package/dist/types/commit/utils.d.ts +1 -1
- package/dist/types/config/model-discovery.d.ts +1 -1
- package/dist/types/config/model-registry.d.ts +3 -3
- package/dist/types/config/model-resolver.d.ts +4 -4
- package/dist/types/config/model-roles.d.ts +2 -2
- package/dist/types/config/models-config.d.ts +2 -2
- package/dist/types/config/service-tier.d.ts +1 -1
- package/dist/types/config/settings-schema.d.ts +7 -13
- package/dist/types/config/settings.d.ts +7 -7
- package/dist/types/config.d.ts +1 -1
- package/dist/types/dap/client.d.ts +1 -1
- package/dist/types/dap/config.d.ts +1 -1
- package/dist/types/dap/index.d.ts +4 -4
- package/dist/types/dap/session.d.ts +3 -3
- package/dist/types/debug/index.d.ts +1 -1
- package/dist/types/debug/log-viewer.d.ts +1 -1
- package/dist/types/debug/raw-sse.d.ts +1 -1
- package/dist/types/debug/report-bundle.d.ts +1 -1
- package/dist/types/discovery/agents.d.ts +1 -1
- package/dist/types/discovery/helpers.d.ts +4 -4
- package/dist/types/discovery/index.d.ts +47 -47
- package/dist/types/discovery/omp-extension-roots.d.ts +1 -1
- package/dist/types/edit/apply-patch/index.d.ts +2 -2
- package/dist/types/edit/apply-patch/parser.d.ts +1 -1
- package/dist/types/edit/diff.d.ts +1 -1
- package/dist/types/edit/file-snapshot-store.d.ts +4 -2
- package/dist/types/edit/hashline/execute.d.ts +4 -4
- package/dist/types/edit/hashline/filesystem.d.ts +3 -3
- package/dist/types/edit/hashline/index.d.ts +5 -5
- package/dist/types/edit/index.d.ts +19 -19
- package/dist/types/edit/modes/apply-patch.d.ts +1 -1
- package/dist/types/edit/modes/patch.d.ts +3 -3
- package/dist/types/edit/modes/replace.d.ts +3 -3
- package/dist/types/edit/renderer.d.ts +15 -16
- package/dist/types/edit/snapshot-details.d.ts +1 -1
- package/dist/types/edit/streaming.d.ts +2 -2
- package/dist/types/eval/agent-bridge.d.ts +4 -4
- package/dist/types/eval/backend-helpers.d.ts +3 -3
- package/dist/types/eval/backend.d.ts +2 -2
- package/dist/types/eval/bridge-timeout.d.ts +1 -1
- package/dist/types/eval/budget-bridge.d.ts +2 -2
- package/dist/types/eval/completion-bridge.d.ts +2 -2
- package/dist/types/eval/concurrency-bridge.d.ts +2 -2
- package/dist/types/eval/executor-base.d.ts +3 -3
- package/dist/types/eval/index.d.ts +6 -6
- package/dist/types/eval/jl/executor.d.ts +4 -4
- package/dist/types/eval/jl/index.d.ts +2 -2
- package/dist/types/eval/jl/kernel.d.ts +5 -5
- package/dist/types/eval/js/context-manager.d.ts +4 -4
- package/dist/types/eval/js/executor.d.ts +3 -3
- package/dist/types/eval/js/index.d.ts +2 -2
- package/dist/types/eval/js/shared/helpers.d.ts +1 -1
- package/dist/types/eval/js/shared/runtime.d.ts +2 -2
- package/dist/types/eval/js/tool-bridge.d.ts +5 -5
- package/dist/types/eval/js/worker-core.d.ts +1 -1
- package/dist/types/eval/js/worker-protocol.d.ts +2 -2
- package/dist/types/eval/kernel-base.d.ts +1 -1
- package/dist/types/eval/py/executor.d.ts +3 -3
- package/dist/types/eval/py/index.d.ts +2 -2
- package/dist/types/eval/py/kernel.d.ts +5 -5
- package/dist/types/eval/py/tool-bridge.d.ts +2 -2
- package/dist/types/eval/rb/executor.d.ts +3 -3
- package/dist/types/eval/rb/index.d.ts +2 -2
- package/dist/types/eval/rb/kernel.d.ts +6 -6
- package/dist/types/eval/session-id.d.ts +1 -1
- package/dist/types/eval/types.d.ts +1 -1
- package/dist/types/exa/index.d.ts +2 -2
- package/dist/types/exa/mcp-client.d.ts +3 -3
- package/dist/types/exec/bash-executor.d.ts +1 -1
- package/dist/types/export/html/index.d.ts +2 -2
- package/dist/types/export/share.d.ts +3 -3
- package/dist/types/export/ttsr.d.ts +2 -2
- package/dist/types/extensibility/custom-commands/bundled/ci-green/index.d.ts +2 -2
- package/dist/types/extensibility/custom-commands/bundled/review/index.d.ts +2 -2
- package/dist/types/extensibility/custom-commands/index.d.ts +2 -2
- package/dist/types/extensibility/custom-commands/loader.d.ts +1 -1
- package/dist/types/extensibility/custom-commands/types.d.ts +3 -3
- package/dist/types/extensibility/custom-tools/index.d.ts +3 -3
- package/dist/types/extensibility/custom-tools/loader.d.ts +3 -3
- package/dist/types/extensibility/custom-tools/types.d.ts +13 -11
- package/dist/types/extensibility/custom-tools/wrapper.d.ts +2 -2
- package/dist/types/extensibility/extensions/compact-handler.d.ts +1 -1
- package/dist/types/extensibility/extensions/get-commands-handler.d.ts +5 -5
- package/dist/types/extensibility/extensions/index.d.ts +5 -5
- package/dist/types/extensibility/extensions/loader.d.ts +2 -2
- package/dist/types/extensibility/extensions/model-api.d.ts +3 -3
- package/dist/types/extensibility/extensions/runner.d.ts +6 -6
- package/dist/types/extensibility/extensions/types.d.ts +43 -31
- package/dist/types/extensibility/extensions/wrapper.d.ts +2 -2
- package/dist/types/extensibility/hooks/index.d.ts +6 -6
- package/dist/types/extensibility/hooks/loader.d.ts +4 -4
- package/dist/types/extensibility/hooks/runner.d.ts +5 -5
- package/dist/types/extensibility/hooks/tool-wrapper.d.ts +1 -1
- package/dist/types/extensibility/hooks/types.d.ts +18 -18
- package/dist/types/extensibility/legacy-pi-ai-shim.d.ts +12 -4
- package/dist/types/extensibility/legacy-pi-coding-agent-shim.d.ts +194 -5
- package/dist/types/extensibility/plugins/doctor.d.ts +1 -1
- package/dist/types/extensibility/plugins/index.d.ts +7 -7
- package/dist/types/extensibility/plugins/installer.d.ts +1 -1
- package/dist/types/extensibility/plugins/legacy-pi-compat.d.ts +1 -1
- package/dist/types/extensibility/plugins/loader.d.ts +1 -1
- package/dist/types/extensibility/plugins/manager.d.ts +1 -1
- package/dist/types/extensibility/plugins/marketplace/fetcher.d.ts +1 -1
- package/dist/types/extensibility/plugins/marketplace/index.d.ts +6 -6
- package/dist/types/extensibility/plugins/marketplace/manager.d.ts +1 -1
- package/dist/types/extensibility/plugins/marketplace/registry.d.ts +1 -1
- package/dist/types/extensibility/plugins/marketplace/source-resolver.d.ts +1 -1
- package/dist/types/extensibility/plugins/runtime-config.d.ts +1 -1
- package/dist/types/extensibility/session-handler-types.d.ts +1 -1
- package/dist/types/extensibility/shared-events.d.ts +12 -5
- package/dist/types/extensibility/skills.d.ts +3 -3
- package/dist/types/extensibility/slash-commands.d.ts +1 -1
- package/dist/types/extensibility/typebox.d.ts +1 -1
- package/dist/types/extensibility/utils.d.ts +1 -1
- package/dist/types/goals/guided-setup.d.ts +1 -1
- package/dist/types/goals/index.d.ts +3 -3
- package/dist/types/goals/runtime.d.ts +1 -1
- package/dist/types/goals/state.d.ts +1 -1
- package/dist/types/goals/tools/goal-tool.d.ts +4 -4
- package/dist/types/hindsight/backend.d.ts +2 -2
- package/dist/types/hindsight/bank.d.ts +2 -2
- package/dist/types/hindsight/client.d.ts +1 -1
- package/dist/types/hindsight/config.d.ts +1 -1
- package/dist/types/hindsight/index.d.ts +8 -8
- package/dist/types/hindsight/mental-models.d.ts +3 -3
- package/dist/types/hindsight/state.d.ts +5 -5
- package/dist/types/hindsight/transcript.d.ts +2 -2
- package/dist/types/index.d.ts +38 -38
- package/dist/types/internal-urls/agent-protocol.d.ts +1 -1
- package/dist/types/internal-urls/artifact-protocol.d.ts +1 -1
- package/dist/types/internal-urls/filesystem-resource.d.ts +1 -1
- package/dist/types/internal-urls/history-protocol.d.ts +1 -1
- package/dist/types/internal-urls/index.d.ts +16 -16
- package/dist/types/internal-urls/issue-pr-protocol.d.ts +1 -1
- package/dist/types/internal-urls/local-protocol.d.ts +1 -1
- package/dist/types/internal-urls/mcp-protocol.d.ts +1 -1
- package/dist/types/internal-urls/memory-protocol.d.ts +1 -1
- package/dist/types/internal-urls/omp-protocol.d.ts +1 -1
- package/dist/types/internal-urls/parse.d.ts +1 -1
- package/dist/types/internal-urls/router.d.ts +1 -1
- package/dist/types/internal-urls/rule-protocol.d.ts +1 -1
- package/dist/types/internal-urls/skill-protocol.d.ts +1 -1
- package/dist/types/internal-urls/ssh-protocol.d.ts +1 -1
- package/dist/types/internal-urls/types.d.ts +2 -2
- package/dist/types/internal-urls/vault-protocol.d.ts +1 -1
- package/dist/types/irc/bus.d.ts +2 -2
- package/dist/types/lib/xai-http.d.ts +1 -1
- package/dist/types/lsp/client.d.ts +23 -1
- package/dist/types/lsp/clients/biome-client.d.ts +1 -1
- package/dist/types/lsp/clients/index.d.ts +4 -4
- package/dist/types/lsp/clients/lsp-linter-client.d.ts +1 -1
- package/dist/types/lsp/clients/swiftlint-client.d.ts +1 -1
- package/dist/types/lsp/config.d.ts +1 -1
- package/dist/types/lsp/diagnostics-ledger.d.ts +1 -1
- package/dist/types/lsp/edits.d.ts +1 -1
- package/dist/types/lsp/index.d.ts +6 -6
- package/dist/types/lsp/render.d.ts +2 -2
- package/dist/types/lsp/startup-events.d.ts +1 -1
- package/dist/types/lsp/utils.d.ts +2 -2
- package/dist/types/main.d.ts +12 -12
- package/dist/types/markit/converters/docx.d.ts +1 -1
- package/dist/types/markit/converters/epub.d.ts +1 -1
- package/dist/types/markit/converters/pdf/columns.d.ts +1 -1
- package/dist/types/markit/converters/pdf/extract.d.ts +1 -1
- package/dist/types/markit/converters/pdf/grid.d.ts +1 -1
- package/dist/types/markit/converters/pdf/headers.d.ts +1 -1
- package/dist/types/markit/converters/pdf/index.d.ts +1 -1
- package/dist/types/markit/converters/pdf/render.d.ts +1 -1
- package/dist/types/markit/converters/pptx.d.ts +1 -1
- package/dist/types/markit/converters/xlsx.d.ts +1 -1
- package/dist/types/markit/index.d.ts +2 -2
- package/dist/types/markit/registry.d.ts +1 -1
- package/dist/types/mcp/client.d.ts +1 -1
- package/dist/types/mcp/config-writer.d.ts +1 -1
- package/dist/types/mcp/config.d.ts +2 -2
- package/dist/types/mcp/index.d.ts +12 -12
- package/dist/types/mcp/loader.d.ts +5 -5
- package/dist/types/mcp/manager.d.ts +7 -7
- package/dist/types/mcp/oauth-credentials.d.ts +3 -3
- package/dist/types/mcp/oauth-flow.d.ts +1 -1
- package/dist/types/mcp/render.d.ts +3 -3
- package/dist/types/mcp/smithery-registry.d.ts +1 -1
- package/dist/types/mcp/tool-bridge.d.ts +5 -5
- package/dist/types/mcp/tool-cache.d.ts +2 -2
- package/dist/types/mcp/transports/http.d.ts +1 -1
- package/dist/types/mcp/transports/index.d.ts +3 -3
- package/dist/types/mcp/transports/sse.d.ts +1 -1
- package/dist/types/mcp/transports/stdio.d.ts +1 -1
- package/dist/types/mcp/types.d.ts +1 -1
- package/dist/types/memories/index.d.ts +4 -4
- package/dist/types/memory-backend/index.d.ts +7 -7
- package/dist/types/memory-backend/local-backend.d.ts +1 -1
- package/dist/types/memory-backend/off-backend.d.ts +1 -1
- package/dist/types/memory-backend/resolve.d.ts +2 -2
- package/dist/types/memory-backend/runtime.d.ts +2 -2
- package/dist/types/memory-backend/types.d.ts +5 -5
- package/dist/types/mnemopi/backend.d.ts +2 -2
- package/dist/types/mnemopi/config.d.ts +1 -1
- package/dist/types/mnemopi/embed-client.d.ts +2 -2
- package/dist/types/mnemopi/embed-worker.d.ts +1 -1
- package/dist/types/mnemopi/index.d.ts +3 -3
- package/dist/types/mnemopi/state.d.ts +38 -2
- package/dist/types/modes/acp/acp-agent.d.ts +2 -2
- package/dist/types/modes/acp/acp-client-bridge.d.ts +1 -1
- package/dist/types/modes/acp/acp-event-mapper.d.ts +1 -1
- package/dist/types/modes/acp/acp-mode.d.ts +1 -1
- package/dist/types/modes/acp/index.d.ts +2 -2
- package/dist/types/modes/components/advisor-config.d.ts +3 -3
- package/dist/types/modes/components/advisor-message.d.ts +2 -2
- package/dist/types/modes/components/agent-dashboard.d.ts +2 -2
- package/dist/types/modes/components/agent-hub.d.ts +11 -9
- package/dist/types/modes/components/agent-transcript-viewer.d.ts +6 -6
- package/dist/types/modes/components/assistant-message.d.ts +17 -12
- package/dist/types/modes/components/background-tan-message.d.ts +2 -2
- package/dist/types/modes/components/bash-execution.d.ts +7 -1
- package/dist/types/modes/components/bordered-loader.d.ts +1 -1
- package/dist/types/modes/components/chat-transcript-builder.d.ts +3 -3
- package/dist/types/modes/components/collab-prompt-message.d.ts +2 -2
- package/dist/types/modes/components/compaction-summary-message.d.ts +1 -1
- package/dist/types/modes/components/copy-selector.d.ts +1 -1
- package/dist/types/modes/components/custom-editor.d.ts +1 -1
- package/dist/types/modes/components/custom-message.d.ts +2 -2
- package/dist/types/modes/components/eval-execution.d.ts +7 -1
- package/dist/types/modes/components/execution-shared.d.ts +1 -1
- package/dist/types/modes/components/extensions/extension-dashboard.d.ts +2 -2
- package/dist/types/modes/components/extensions/extension-list.d.ts +1 -1
- package/dist/types/modes/components/extensions/index.d.ts +5 -5
- package/dist/types/modes/components/extensions/inspector-panel.d.ts +1 -1
- package/dist/types/modes/components/extensions/state-manager.d.ts +1 -1
- package/dist/types/modes/components/extensions/types.d.ts +1 -1
- package/dist/types/modes/components/footer.d.ts +1 -1
- package/dist/types/modes/components/history-search.d.ts +1 -1
- package/dist/types/modes/components/hook-message.d.ts +2 -2
- package/dist/types/modes/components/index.d.ts +38 -38
- package/dist/types/modes/components/keybinding-hints.d.ts +1 -1
- package/dist/types/modes/components/logout-account-selector.d.ts +1 -1
- package/dist/types/modes/components/mcp-add-wizard.d.ts +1 -1
- package/dist/types/modes/components/message-frame.d.ts +1 -1
- package/dist/types/modes/components/model-selector.d.ts +3 -3
- package/dist/types/modes/components/oauth-selector.d.ts +1 -1
- package/dist/types/modes/components/plan-review-overlay.d.ts +1 -1
- package/dist/types/modes/components/plugin-settings.d.ts +3 -3
- package/dist/types/modes/components/read-tool-group.d.ts +1 -1
- package/dist/types/modes/components/reset-usage-selector.d.ts +1 -1
- package/dist/types/modes/components/segment-track.d.ts +1 -1
- package/dist/types/modes/components/session-selector.d.ts +1 -1
- package/dist/types/modes/components/settings-defs.d.ts +1 -1
- package/dist/types/modes/components/settings-selector.d.ts +2 -2
- package/dist/types/modes/components/skill-message.d.ts +1 -1
- package/dist/types/modes/components/status-line/component.d.ts +2 -2
- package/dist/types/modes/components/status-line/context-thresholds.d.ts +1 -1
- package/dist/types/modes/components/status-line/index.d.ts +5 -5
- package/dist/types/modes/components/status-line/presets.d.ts +1 -1
- package/dist/types/modes/components/status-line/segments.d.ts +2 -2
- package/dist/types/modes/components/status-line/separators.d.ts +2 -2
- package/dist/types/modes/components/status-line/types.d.ts +8 -4
- package/dist/types/modes/components/tiny-title-download-progress.d.ts +2 -2
- package/dist/types/modes/components/todo-reminder.d.ts +1 -1
- package/dist/types/modes/components/tool-execution.d.ts +4 -14
- package/dist/types/modes/components/transcript-container.d.ts +26 -28
- package/dist/types/modes/components/tree-selector.d.ts +2 -2
- package/dist/types/modes/components/ttsr-notification.d.ts +1 -1
- package/dist/types/modes/controllers/btw-controller.d.ts +1 -1
- package/dist/types/modes/controllers/command-controller-shared.d.ts +2 -2
- package/dist/types/modes/controllers/command-controller.d.ts +7 -7
- package/dist/types/modes/controllers/event-controller.d.ts +3 -3
- package/dist/types/modes/controllers/extension-ui-controller.d.ts +5 -5
- package/dist/types/modes/controllers/extension-ui-controller.test.d.ts +1 -0
- package/dist/types/modes/controllers/input-controller.d.ts +2 -2
- package/dist/types/modes/controllers/mcp-command-controller.d.ts +1 -1
- package/dist/types/modes/controllers/omfg-controller.d.ts +1 -1
- package/dist/types/modes/controllers/omfg-rule.d.ts +1 -1
- package/dist/types/modes/controllers/selector-controller.d.ts +2 -2
- package/dist/types/modes/controllers/session-focus-controller.d.ts +4 -4
- package/dist/types/modes/controllers/ssh-command-controller.d.ts +1 -1
- package/dist/types/modes/controllers/streaming-reveal.d.ts +11 -3
- package/dist/types/modes/controllers/tan-command-controller.d.ts +1 -1
- package/dist/types/modes/controllers/todo-command-controller.d.ts +1 -1
- package/dist/types/modes/controllers/tool-args-reveal.d.ts +6 -2
- package/dist/types/modes/image-references.d.ts +1 -1
- package/dist/types/modes/index.d.ts +3 -3
- package/dist/types/modes/interactive-mode.d.ts +34 -34
- package/dist/types/modes/orchestrate.d.ts +1 -1
- package/dist/types/modes/print-mode.d.ts +1 -1
- package/dist/types/modes/prompt-action-autocomplete.d.ts +1 -1
- package/dist/types/modes/rpc/host-tools.d.ts +1 -1
- package/dist/types/modes/rpc/host-uris.d.ts +3 -3
- package/dist/types/modes/rpc/rpc-client.d.ts +3 -3
- package/dist/types/modes/rpc/rpc-mode.d.ts +6 -6
- package/dist/types/modes/rpc/rpc-subagents.d.ts +3 -3
- package/dist/types/modes/rpc/rpc-types.d.ts +7 -7
- package/dist/types/modes/running-subagent-badge.d.ts +1 -1
- package/dist/types/modes/runtime-init.d.ts +2 -2
- package/dist/types/modes/session-observer-registry.d.ts +2 -2
- package/dist/types/modes/setup-wizard/index.d.ts +6 -6
- package/dist/types/modes/setup-wizard/lazy.d.ts +1 -1
- package/dist/types/modes/setup-wizard/scenes/glyph.d.ts +1 -1
- package/dist/types/modes/setup-wizard/scenes/providers.d.ts +1 -1
- package/dist/types/modes/setup-wizard/scenes/sign-in.d.ts +1 -1
- package/dist/types/modes/setup-wizard/scenes/theme.d.ts +1 -1
- package/dist/types/modes/setup-wizard/scenes/types.d.ts +1 -1
- package/dist/types/modes/setup-wizard/scenes/web-search.d.ts +1 -1
- package/dist/types/modes/setup-wizard/startup-splash.d.ts +1 -1
- package/dist/types/modes/setup-wizard/wizard-overlay.d.ts +2 -2
- package/dist/types/modes/shared.d.ts +1 -1
- package/dist/types/modes/skill-command.d.ts +2 -2
- package/dist/types/modes/theme/shimmer.d.ts +1 -1
- package/dist/types/modes/theme/theme.d.ts +1 -1
- package/dist/types/modes/types.d.ts +31 -31
- package/dist/types/modes/ultrathink.d.ts +1 -1
- package/dist/types/modes/utils/context-usage.d.ts +5 -5
- package/dist/types/modes/utils/hotkeys-markdown.d.ts +1 -1
- package/dist/types/modes/utils/interactive-context-helpers.d.ts +2 -2
- package/dist/types/modes/utils/tools-markdown.d.ts +1 -1
- package/dist/types/modes/utils/transcript-render-helpers.d.ts +25 -8
- package/dist/types/modes/utils/transcript-render-helpers.test.d.ts +1 -0
- package/dist/types/modes/utils/ui-helpers.d.ts +2 -2
- package/dist/types/modes/workflow.d.ts +1 -1
- package/dist/types/plan-mode/plan-handoff.d.ts +1 -1
- package/dist/types/registry/agent-lifecycle.d.ts +2 -2
- package/dist/types/registry/agent-registry.d.ts +1 -1
- package/dist/types/sdk.d.ts +40 -36
- package/dist/types/secrets/index.d.ts +2 -2
- package/dist/types/secrets/obfuscator.d.ts +1 -1
- package/dist/types/session/agent-session.d.ts +57 -41
- package/dist/types/session/agent-storage.d.ts +1 -1
- package/dist/types/session/auth-broker-config.d.ts +1 -1
- package/dist/types/session/codex-auto-reset.d.ts +1 -1
- package/dist/types/session/exit-diagnostics.d.ts +1 -1
- package/dist/types/session/indexed-session-storage.d.ts +2 -2
- package/dist/types/session/messages.d.ts +22 -3
- package/dist/types/session/redis-session-storage.d.ts +1 -1
- package/dist/types/session/session-context.d.ts +1 -1
- package/dist/types/session/session-entries.d.ts +4 -0
- package/dist/types/session/session-listing.d.ts +1 -1
- package/dist/types/session/session-loader.d.ts +4 -4
- package/dist/types/session/session-manager.d.ts +9 -8
- package/dist/types/session/session-migrations.d.ts +1 -1
- package/dist/types/session/session-paths.d.ts +1 -1
- package/dist/types/session/session-persistence.d.ts +2 -2
- package/dist/types/session/session-storage.d.ts +1 -1
- package/dist/types/session/session-title-slot.d.ts +1 -1
- package/dist/types/session/settings-stream-fn.d.ts +1 -1
- package/dist/types/session/sql-session-storage.d.ts +1 -1
- package/dist/types/session/unexpected-stop-classifier.d.ts +2 -2
- package/dist/types/slash-commands/acp-builtins.d.ts +2 -2
- package/dist/types/slash-commands/available-commands.d.ts +5 -5
- package/dist/types/slash-commands/builtin-registry.d.ts +2 -2
- package/dist/types/slash-commands/helpers/active-oauth-account.d.ts +1 -1
- package/dist/types/slash-commands/helpers/context-report.d.ts +1 -1
- package/dist/types/slash-commands/helpers/format.d.ts +1 -1
- package/dist/types/slash-commands/helpers/logout.d.ts +1 -1
- package/dist/types/slash-commands/helpers/marketplace-manager.d.ts +2 -2
- package/dist/types/slash-commands/helpers/mcp.d.ts +1 -1
- package/dist/types/slash-commands/helpers/parse.d.ts +1 -1
- package/dist/types/slash-commands/helpers/reset-usage.d.ts +1 -1
- package/dist/types/slash-commands/helpers/ssh.d.ts +1 -1
- package/dist/types/slash-commands/helpers/todo.d.ts +1 -1
- package/dist/types/slash-commands/helpers/usage-report.d.ts +1 -1
- package/dist/types/slash-commands/types.d.ts +6 -4
- package/dist/types/ssh/file-transfer.d.ts +1 -1
- package/dist/types/ssh/ssh-executor.d.ts +1 -1
- package/dist/types/ssh/sshfs-mount.d.ts +1 -1
- package/dist/types/stt/asr-client.d.ts +3 -3
- package/dist/types/stt/asr-protocol.d.ts +1 -1
- package/dist/types/stt/asr-worker.d.ts +1 -1
- package/dist/types/stt/downloader.d.ts +1 -1
- package/dist/types/stt/index.d.ts +8 -8
- package/dist/types/stt/models.d.ts +1 -1
- package/dist/types/system-prompt.d.ts +4 -4
- package/dist/types/task/agents.d.ts +1 -1
- package/dist/types/task/discovery.d.ts +1 -1
- package/dist/types/task/executor.d.ts +20 -20
- package/dist/types/task/index.d.ts +11 -11
- package/dist/types/task/isolation-runner.d.ts +7 -6
- package/dist/types/task/persisted-revive.d.ts +5 -5
- package/dist/types/task/provider-concurrency.d.ts +2 -2
- package/dist/types/task/render.d.ts +3 -3
- package/dist/types/task/renderer.d.ts +1 -1
- package/dist/types/task/repair-args.d.ts +1 -1
- package/dist/types/task/subprocess-tool-registry.d.ts +1 -1
- package/dist/types/task/types.d.ts +2 -2
- package/dist/types/task/yield-assembly.d.ts +1 -1
- package/dist/types/tiny/title-client.d.ts +2 -2
- package/dist/types/tiny/title-protocol.d.ts +1 -1
- package/dist/types/tiny/worker.d.ts +1 -1
- package/dist/types/tool-discovery/mode.d.ts +2 -2
- package/dist/types/tools/__tests__/glob.test.d.ts +1 -0
- package/dist/types/tools/acp-bridge.d.ts +2 -2
- package/dist/types/tools/ask.d.ts +3 -3
- package/dist/types/tools/ast-edit.d.ts +4 -4
- package/dist/types/tools/ast-grep.d.ts +4 -4
- package/dist/types/tools/bash-command-fixup.d.ts +3 -11
- package/dist/types/tools/bash-interactive.d.ts +1 -1
- package/dist/types/tools/bash-interceptor.d.ts +1 -1
- package/dist/types/tools/bash-skill-urls.d.ts +3 -3
- package/dist/types/tools/bash.d.ts +4 -6
- package/dist/types/tools/browser/cmux/cmux-tab.d.ts +6 -6
- package/dist/types/tools/browser/cmux/rpc.d.ts +1 -1
- package/dist/types/tools/browser/registry.d.ts +3 -3
- package/dist/types/tools/browser/render.d.ts +3 -3
- package/dist/types/tools/browser/tab-supervisor.d.ts +14 -4
- package/dist/types/tools/browser/tab-worker.d.ts +1 -1
- package/dist/types/tools/browser.d.ts +9 -9
- package/dist/types/tools/checkpoint.d.ts +2 -2
- package/dist/types/tools/conflict-detect.d.ts +1 -1
- package/dist/types/tools/context.d.ts +2 -2
- package/dist/types/tools/debug.d.ts +4 -4
- package/dist/types/tools/eval-backends.d.ts +1 -1
- package/dist/types/tools/eval-render.d.ts +3 -5
- package/dist/types/tools/eval.d.ts +3 -3
- package/dist/types/tools/fetch.d.ts +7 -7
- package/dist/types/tools/gh-renderer.d.ts +3 -3
- package/dist/types/tools/gh.d.ts +5 -5
- package/dist/types/tools/github-cache.d.ts +1 -1
- package/dist/types/tools/glob.d.ts +7 -5
- package/dist/types/tools/grep.d.ts +5 -5
- package/dist/types/tools/image-gen.d.ts +2 -2
- package/dist/types/tools/index.d.ts +70 -70
- package/dist/types/tools/inspect-image-renderer.d.ts +2 -2
- package/dist/types/tools/inspect-image.d.ts +2 -2
- package/dist/types/tools/irc.d.ts +5 -5
- package/dist/types/tools/job.d.ts +3 -3
- package/dist/types/tools/json-tree.d.ts +1 -1
- package/dist/types/tools/learn.d.ts +1 -1
- package/dist/types/tools/list-limit.d.ts +1 -1
- package/dist/types/tools/manage-skill.d.ts +1 -1
- package/dist/types/tools/memory-edit.d.ts +1 -1
- package/dist/types/tools/memory-recall.d.ts +1 -1
- package/dist/types/tools/memory-reflect.d.ts +1 -1
- package/dist/types/tools/memory-render.d.ts +2 -2
- package/dist/types/tools/memory-retain.d.ts +1 -1
- package/dist/types/tools/output-meta.d.ts +3 -3
- package/dist/types/tools/path-utils.d.ts +2 -2
- package/dist/types/tools/plan-mode-guard.d.ts +1 -1
- package/dist/types/tools/read.d.ts +7 -7
- package/dist/types/tools/render-utils.d.ts +3 -3
- package/dist/types/tools/renderers.d.ts +2 -22
- package/dist/types/tools/report-tool-issue.d.ts +2 -2
- package/dist/types/tools/resolve.d.ts +3 -3
- package/dist/types/tools/review.d.ts +2 -2
- package/dist/types/tools/search-tool-bm25.d.ts +4 -4
- package/dist/types/tools/ssh.d.ts +5 -7
- package/dist/types/tools/todo.d.ts +4 -4
- package/dist/types/tools/tool-result.d.ts +2 -2
- package/dist/types/tools/tts.d.ts +1 -1
- package/dist/types/tools/write.d.ts +8 -8
- package/dist/types/tools/yield.d.ts +1 -1
- package/dist/types/tts/index.d.ts +10 -10
- package/dist/types/tts/models.d.ts +1 -1
- package/dist/types/tts/speech-enhancer.d.ts +2 -2
- package/dist/types/tts/streaming-player.d.ts +1 -1
- package/dist/types/tts/tts-client.d.ts +2 -2
- package/dist/types/tts/tts-protocol.d.ts +1 -1
- package/dist/types/tts/tts-worker.d.ts +1 -1
- package/dist/types/tts/vocalizer.d.ts +7 -1
- package/dist/types/tui/code-cell.d.ts +1 -1
- package/dist/types/tui/file-list.d.ts +1 -1
- package/dist/types/tui/index.d.ts +9 -9
- package/dist/types/tui/output-block.d.ts +2 -2
- package/dist/types/tui/status-line.d.ts +2 -2
- package/dist/types/tui/tree-list.d.ts +2 -2
- package/dist/types/tui/types.d.ts +1 -1
- package/dist/types/tui/utils.d.ts +2 -2
- package/dist/types/utils/changelog.d.ts +1 -1
- package/dist/types/utils/commit-message-generator.d.ts +2 -2
- package/dist/types/utils/git.d.ts +1 -1
- package/dist/types/utils/image-loading.d.ts +1 -1
- package/dist/types/utils/image-vision-fallback.d.ts +3 -3
- package/dist/types/utils/markit.d.ts +1 -1
- package/dist/types/utils/title-generator.d.ts +2 -2
- package/dist/types/web/parallel.d.ts +1 -1
- package/dist/types/web/scrapers/artifacthub.d.ts +1 -1
- package/dist/types/web/scrapers/arxiv.d.ts +1 -1
- package/dist/types/web/scrapers/aur.d.ts +1 -1
- package/dist/types/web/scrapers/biorxiv.d.ts +1 -1
- package/dist/types/web/scrapers/bluesky.d.ts +1 -1
- package/dist/types/web/scrapers/brew.d.ts +1 -1
- package/dist/types/web/scrapers/cheatsh.d.ts +1 -1
- package/dist/types/web/scrapers/chocolatey.d.ts +1 -1
- package/dist/types/web/scrapers/choosealicense.d.ts +1 -1
- package/dist/types/web/scrapers/cisa-kev.d.ts +1 -1
- package/dist/types/web/scrapers/clojars.d.ts +1 -1
- package/dist/types/web/scrapers/coingecko.d.ts +1 -1
- package/dist/types/web/scrapers/crates-io.d.ts +1 -1
- package/dist/types/web/scrapers/crossref.d.ts +1 -1
- package/dist/types/web/scrapers/devto.d.ts +1 -1
- package/dist/types/web/scrapers/discogs.d.ts +1 -1
- package/dist/types/web/scrapers/discourse.d.ts +1 -1
- package/dist/types/web/scrapers/dockerhub.d.ts +1 -1
- package/dist/types/web/scrapers/docs-rs.d.ts +8 -1
- package/dist/types/web/scrapers/fdroid.d.ts +1 -1
- package/dist/types/web/scrapers/firefox-addons.d.ts +1 -1
- package/dist/types/web/scrapers/flathub.d.ts +1 -1
- package/dist/types/web/scrapers/github-gist.d.ts +1 -1
- package/dist/types/web/scrapers/github.d.ts +1 -1
- package/dist/types/web/scrapers/gitlab.d.ts +1 -1
- package/dist/types/web/scrapers/go-pkg.d.ts +1 -1
- package/dist/types/web/scrapers/hackage.d.ts +1 -1
- package/dist/types/web/scrapers/hackernews.d.ts +1 -1
- package/dist/types/web/scrapers/hex.d.ts +1 -1
- package/dist/types/web/scrapers/huggingface.d.ts +1 -1
- package/dist/types/web/scrapers/iacr.d.ts +1 -1
- package/dist/types/web/scrapers/index.d.ts +77 -77
- package/dist/types/web/scrapers/jetbrains-marketplace.d.ts +1 -1
- package/dist/types/web/scrapers/lemmy.d.ts +1 -1
- package/dist/types/web/scrapers/lobsters.d.ts +1 -1
- package/dist/types/web/scrapers/mastodon.d.ts +1 -1
- package/dist/types/web/scrapers/maven.d.ts +1 -1
- package/dist/types/web/scrapers/mdn.d.ts +1 -1
- package/dist/types/web/scrapers/metacpan.d.ts +1 -1
- package/dist/types/web/scrapers/musicbrainz.d.ts +1 -1
- package/dist/types/web/scrapers/npm.d.ts +1 -1
- package/dist/types/web/scrapers/nuget.d.ts +1 -1
- package/dist/types/web/scrapers/nvd.d.ts +1 -1
- package/dist/types/web/scrapers/ollama.d.ts +1 -1
- package/dist/types/web/scrapers/open-vsx.d.ts +1 -1
- package/dist/types/web/scrapers/opencorporates.d.ts +1 -1
- package/dist/types/web/scrapers/openlibrary.d.ts +1 -1
- package/dist/types/web/scrapers/orcid.d.ts +1 -1
- package/dist/types/web/scrapers/osv.d.ts +1 -1
- package/dist/types/web/scrapers/packagist.d.ts +1 -1
- package/dist/types/web/scrapers/pub-dev.d.ts +1 -1
- package/dist/types/web/scrapers/pubmed.d.ts +1 -1
- package/dist/types/web/scrapers/pypi.d.ts +1 -1
- package/dist/types/web/scrapers/rawg.d.ts +1 -1
- package/dist/types/web/scrapers/readthedocs.d.ts +1 -1
- package/dist/types/web/scrapers/reddit.d.ts +1 -1
- package/dist/types/web/scrapers/repology.d.ts +1 -1
- package/dist/types/web/scrapers/rfc.d.ts +1 -1
- package/dist/types/web/scrapers/rubygems.d.ts +1 -1
- package/dist/types/web/scrapers/searchcode.d.ts +1 -1
- package/dist/types/web/scrapers/sec-edgar.d.ts +1 -1
- package/dist/types/web/scrapers/semantic-scholar.d.ts +1 -1
- package/dist/types/web/scrapers/snapcraft.d.ts +1 -1
- package/dist/types/web/scrapers/sourcegraph.d.ts +1 -1
- package/dist/types/web/scrapers/spdx.d.ts +1 -1
- package/dist/types/web/scrapers/spotify.d.ts +1 -1
- package/dist/types/web/scrapers/stackoverflow.d.ts +1 -1
- package/dist/types/web/scrapers/terraform.d.ts +1 -1
- package/dist/types/web/scrapers/tldr.d.ts +1 -1
- package/dist/types/web/scrapers/twitter.d.ts +1 -1
- package/dist/types/web/scrapers/types.d.ts +1 -1
- package/dist/types/web/scrapers/vimeo.d.ts +1 -1
- package/dist/types/web/scrapers/vscode-marketplace.d.ts +1 -1
- package/dist/types/web/scrapers/w3c.d.ts +1 -1
- package/dist/types/web/scrapers/wikidata.d.ts +1 -1
- package/dist/types/web/scrapers/wikipedia.d.ts +1 -1
- package/dist/types/web/scrapers/youtube.d.ts +1 -1
- package/dist/types/web/search/index.d.ts +7 -7
- package/dist/types/web/search/provider.d.ts +5 -5
- package/dist/types/web/search/providers/anthropic.d.ts +3 -3
- package/dist/types/web/search/providers/base.d.ts +1 -1
- package/dist/types/web/search/providers/brave.d.ts +3 -3
- package/dist/types/web/search/providers/codex.d.ts +3 -3
- package/dist/types/web/search/providers/duckduckgo.d.ts +3 -3
- package/dist/types/web/search/providers/exa.d.ts +3 -3
- package/dist/types/web/search/providers/firecrawl.d.ts +3 -3
- package/dist/types/web/search/providers/gemini.d.ts +3 -3
- package/dist/types/web/search/providers/jina.d.ts +3 -3
- package/dist/types/web/search/providers/kagi.d.ts +3 -3
- package/dist/types/web/search/providers/kimi.d.ts +3 -3
- package/dist/types/web/search/providers/parallel.d.ts +3 -3
- package/dist/types/web/search/providers/perplexity.d.ts +3 -3
- package/dist/types/web/search/providers/searxng.d.ts +3 -3
- package/dist/types/web/search/providers/synthetic.d.ts +3 -3
- package/dist/types/web/search/providers/tavily.d.ts +3 -3
- package/dist/types/web/search/providers/tinyfish.d.ts +3 -3
- package/dist/types/web/search/providers/utils.d.ts +2 -2
- package/dist/types/web/search/providers/xai.d.ts +3 -3
- package/dist/types/web/search/providers/zai.d.ts +3 -3
- package/dist/types/web/search/render.d.ts +3 -3
- package/package.json +12 -12
- package/src/advisor/__tests__/advisor.test.ts +59 -0
- package/src/auto-thinking/classifier.ts +6 -5
- package/src/collab/relay-client.ts +73 -7
- package/src/config/model-registry.ts +43 -2
- package/src/config/model-resolver.ts +1 -1
- package/src/config/settings-schema.ts +5 -12
- package/src/config/settings.ts +25 -5
- package/src/edit/file-snapshot-store.ts +5 -2
- package/src/edit/hashline/filesystem.ts +19 -1
- package/src/edit/modes/patch.ts +9 -1
- package/src/edit/modes/replace.ts +1 -1
- package/src/edit/renderer.ts +42 -35
- package/src/eval/__tests__/agent-bridge.test.ts +19 -0
- package/src/eval/__tests__/budget-bridge.test.ts +12 -1
- package/src/eval/agent-bridge.ts +27 -19
- package/src/eval/js/context-manager.ts +3 -0
- package/src/export/ttsr.ts +10 -0
- package/src/extensibility/custom-tools/types.ts +2 -0
- package/src/extensibility/extensions/loader.ts +2 -2
- package/src/extensibility/extensions/types.ts +16 -4
- package/src/extensibility/hooks/loader.ts +3 -3
- package/src/extensibility/hooks/types.ts +4 -4
- package/src/extensibility/legacy-pi-ai-shim.ts +17 -4
- package/src/extensibility/legacy-pi-coding-agent-shim.ts +554 -2
- package/src/extensibility/plugins/legacy-pi-compat.ts +190 -58
- package/src/extensibility/shared-events.ts +9 -1
- package/src/internal-urls/docs-index.generated.txt +1 -1
- package/src/internal-urls/memory-protocol.ts +105 -3
- package/src/lsp/client.ts +70 -0
- package/src/lsp/index.ts +65 -12
- package/src/main.ts +5 -3
- package/src/markit/converters/pdf/extract.ts +26 -2
- package/src/mnemopi/state.ts +76 -0
- package/src/modes/acp/acp-agent.ts +5 -1
- package/src/modes/components/agent-hub.ts +27 -9
- package/src/modes/components/assistant-message.ts +134 -82
- package/src/modes/components/bash-execution.ts +9 -0
- package/src/modes/components/chat-transcript-builder.ts +15 -7
- package/src/modes/components/copy-selector.ts +16 -4
- package/src/modes/components/eval-execution.ts +9 -0
- package/src/modes/components/model-selector.ts +17 -17
- package/src/modes/components/session-selector.ts +12 -4
- package/src/modes/components/status-line/component.ts +4 -0
- package/src/modes/components/status-line/segments.ts +6 -5
- package/src/modes/components/status-line/types.ts +4 -0
- package/src/modes/components/tool-execution.ts +12 -53
- package/src/modes/components/transcript-container.ts +82 -432
- package/src/modes/components/tree-selector.ts +9 -3
- package/src/modes/controllers/command-controller.ts +10 -3
- package/src/modes/controllers/event-controller.ts +78 -17
- package/src/modes/controllers/extension-ui-controller.test.ts +58 -0
- package/src/modes/controllers/extension-ui-controller.ts +12 -7
- package/src/modes/controllers/input-controller.ts +12 -10
- package/src/modes/controllers/selector-controller.ts +18 -9
- package/src/modes/controllers/streaming-reveal.ts +12 -5
- package/src/modes/controllers/tool-args-reveal.ts +13 -6
- package/src/modes/interactive-mode.ts +66 -36
- package/src/modes/prompt-action-autocomplete.ts +18 -0
- package/src/modes/theme/shimmer.ts +37 -1
- package/src/modes/utils/transcript-render-helpers.test.ts +38 -0
- package/src/modes/utils/transcript-render-helpers.ts +54 -13
- package/src/modes/utils/ui-helpers.ts +17 -8
- package/src/prompts/system/workflow-notice.md +1 -1
- package/src/prompts/tools/bash.md +9 -7
- package/src/prompts/tools/grep.md +1 -1
- package/src/prompts/tools/memory-edit.md +2 -0
- package/src/prompts/tools/recall.md +2 -0
- package/src/sdk.ts +113 -12
- package/src/session/agent-session.ts +350 -61
- package/src/session/messages.ts +102 -2
- package/src/session/session-context.ts +67 -10
- package/src/session/session-entries.ts +4 -0
- package/src/session/session-history-format.ts +12 -0
- package/src/session/session-manager.ts +129 -10
- package/src/session/settings-stream-fn.ts +1 -0
- package/src/session/unexpected-stop-classifier.ts +6 -3
- package/src/slash-commands/builtin-registry.ts +7 -4
- package/src/slash-commands/helpers/usage-report.ts +3 -0
- package/src/slash-commands/types.ts +2 -0
- package/src/task/executor.ts +23 -3
- package/src/task/isolation-runner.ts +38 -9
- package/src/tools/__tests__/glob.test.ts +37 -0
- package/src/tools/acp-bridge.ts +11 -1
- package/src/tools/bash-command-fixup.ts +3 -36
- package/src/tools/bash.ts +4 -17
- package/src/tools/browser/render.ts +6 -4
- package/src/tools/browser/tab-supervisor.ts +47 -3
- package/src/tools/eval-render.ts +0 -20
- package/src/tools/glob.ts +11 -1
- package/src/tools/index.ts +1 -1
- package/src/tools/inspect-image-renderer.ts +5 -4
- package/src/tools/read.ts +76 -28
- package/src/tools/render-utils.ts +4 -1
- package/src/tools/renderers.ts +0 -20
- package/src/tools/ssh.ts +0 -16
- package/src/tools/write.ts +22 -13
- package/src/tts/speech-enhancer.ts +7 -5
- package/src/tts/vocalizer.ts +9 -0
- package/src/utils/commit-message-generator.ts +7 -5
- package/src/utils/shell-snapshot.ts +10 -0
- package/src/utils/title-generator.ts +12 -7
- package/src/web/scrapers/docs-rs.ts +12 -1
- package/src/web/search/providers/xai.ts +43 -47
|
@@ -6,6 +6,7 @@ import * as fs from "node:fs/promises";
|
|
|
6
6
|
import * as path from "node:path";
|
|
7
7
|
import {
|
|
8
8
|
type Agent,
|
|
9
|
+
AgentBusyError,
|
|
9
10
|
type AgentMessage,
|
|
10
11
|
type AgentToolResult,
|
|
11
12
|
EventLoopKeepalive,
|
|
@@ -205,29 +206,37 @@ interface WorkingMessageAccentCacheKey {
|
|
|
205
206
|
sessionAccentEnabled: boolean;
|
|
206
207
|
}
|
|
207
208
|
|
|
209
|
+
/**
|
|
210
|
+
* Intern the shimmer palettes for each `WorkingMessageAccent` so `compile()`
|
|
211
|
+
* inside `shimmerSegments` sees a stable palette object between animation
|
|
212
|
+
* ticks. Allocating fresh palette literals every frame guaranteed a cache miss
|
|
213
|
+
* on the Symbol-keyed compiled-ANSI slot and forced `resolveTierAnsi` to walk
|
|
214
|
+
* every tier open/close for the ~30fps loader redraw (issue #4377).
|
|
215
|
+
*/
|
|
216
|
+
const workingMessagePaletteCache = new WeakMap<WorkingMessageAccent, { main: ShimmerPalette; hint: ShimmerPalette }>();
|
|
217
|
+
|
|
218
|
+
function workingMessagePalettes(accent: WorkingMessageAccent): { main: ShimmerPalette; hint: ShimmerPalette } {
|
|
219
|
+
let entry = workingMessagePaletteCache.get(accent);
|
|
220
|
+
if (!entry) {
|
|
221
|
+
entry = {
|
|
222
|
+
main: { low: "dim", mid: { ansi: accent.main }, high: { ansi: accent.main }, bold: true },
|
|
223
|
+
hint: { low: "dim", mid: { ansi: accent.dim }, high: { ansi: accent.dim } },
|
|
224
|
+
};
|
|
225
|
+
workingMessagePaletteCache.set(accent, entry);
|
|
226
|
+
}
|
|
227
|
+
return entry;
|
|
228
|
+
}
|
|
229
|
+
|
|
208
230
|
function renderWorkingMessage(message: string, accent?: WorkingMessageAccent): string {
|
|
209
|
-
const
|
|
210
|
-
|
|
211
|
-
low: "dim",
|
|
212
|
-
mid: { ansi: accent.main },
|
|
213
|
-
high: { ansi: accent.main },
|
|
214
|
-
bold: true,
|
|
215
|
-
} satisfies ShimmerPalette)
|
|
216
|
-
: undefined;
|
|
231
|
+
const palettes = accent ? workingMessagePalettes(accent) : undefined;
|
|
232
|
+
const palette = palettes?.main;
|
|
217
233
|
const hint = interruptHint();
|
|
218
234
|
if (!message.endsWith(hint)) return shimmerText(message, theme, palette);
|
|
219
235
|
const header = message.slice(0, -hint.length);
|
|
220
|
-
const hintPalette = accent
|
|
221
|
-
? ({
|
|
222
|
-
low: "dim",
|
|
223
|
-
mid: { ansi: accent.dim },
|
|
224
|
-
high: { ansi: accent.dim },
|
|
225
|
-
} satisfies ShimmerPalette)
|
|
226
|
-
: HINT_SHIMMER_PALETTE;
|
|
227
236
|
return shimmerSegments(
|
|
228
237
|
[
|
|
229
238
|
{ text: header, palette },
|
|
230
|
-
{ text: hint, palette:
|
|
239
|
+
{ text: hint, palette: palettes?.hint ?? HINT_SHIMMER_PALETTE },
|
|
231
240
|
],
|
|
232
241
|
theme,
|
|
233
242
|
);
|
|
@@ -635,7 +644,7 @@ export class InteractiveMode implements InteractiveModeContext {
|
|
|
635
644
|
// unless the user opts in, and never emits raw escapes on other terminals.
|
|
636
645
|
setTerminalTextSizing(settings.get("tui.textSizing") && TERMINAL.textSizing);
|
|
637
646
|
this.chatContainer = new TranscriptContainer();
|
|
638
|
-
this.pendingMessagesContainer = new
|
|
647
|
+
this.pendingMessagesContainer = new AnchoredLiveContainer();
|
|
639
648
|
this.statusContainer = new AnchoredLiveContainer();
|
|
640
649
|
this.todoContainer = new AnchoredLiveContainer();
|
|
641
650
|
this.subagentContainer = new AnchoredLiveContainer();
|
|
@@ -930,6 +939,17 @@ export class InteractiveMode implements InteractiveModeContext {
|
|
|
930
939
|
pushTerminalTitle();
|
|
931
940
|
setSessionTerminalTitle(this.sessionManager.getSessionName(), this.sessionManager.getCwd());
|
|
932
941
|
this.updateEditorBorderColor();
|
|
942
|
+
// Single side-effect point for title changes: every setSessionName caller
|
|
943
|
+
// (first-input titling, /rename, extension renames, plan seeding, replan
|
|
944
|
+
// refresh) gets the terminal title + accent updates from here. Registered
|
|
945
|
+
// before initHooksAndCustomTools/#reconcileModeFromSession/#enterPlanMode —
|
|
946
|
+
// all of which can reach setSessionName during init.
|
|
947
|
+
this.#eventBusUnsubscribers.push(
|
|
948
|
+
this.sessionManager.onSessionNameChanged(() => {
|
|
949
|
+
setSessionTerminalTitle(this.sessionManager.getSessionName(), this.sessionManager.getCwd());
|
|
950
|
+
this.#handleSessionAccentInputsChanged();
|
|
951
|
+
}),
|
|
952
|
+
);
|
|
933
953
|
this.#syncEditorMaxHeight();
|
|
934
954
|
this.isInitialized = true;
|
|
935
955
|
this.ui.requestRender(true);
|
|
@@ -986,9 +1006,6 @@ export class InteractiveMode implements InteractiveModeContext {
|
|
|
986
1006
|
this.session.subscribe(event => {
|
|
987
1007
|
void this.#handleGoalSessionEvent(event);
|
|
988
1008
|
}),
|
|
989
|
-
this.sessionManager.onSessionNameChanged(() => {
|
|
990
|
-
this.#handleSessionAccentInputsChanged();
|
|
991
|
-
}),
|
|
992
1009
|
onStatusLineSessionAccentChanged(() => {
|
|
993
1010
|
this.#syncStatusLineSettings();
|
|
994
1011
|
this.#handleSessionAccentInputsChanged();
|
|
@@ -2606,8 +2623,16 @@ export class InteractiveMode implements InteractiveModeContext {
|
|
|
2606
2623
|
// the try/finally is idempotent and kept for the !compactBeforeExecute
|
|
2607
2624
|
// branch.
|
|
2608
2625
|
this.session.setPlanReferencePath(options.planFilePath);
|
|
2609
|
-
|
|
2610
|
-
|
|
2626
|
+
// Ride the plan-mode distillation prompt through as `internalGuidance`
|
|
2627
|
+
// so it reaches native summarization without leaking into the public
|
|
2628
|
+
// `customInstructions` channel on `session_before_compact` — extensions
|
|
2629
|
+
// there treat that field as user focus and would query-bias the
|
|
2630
|
+
// summary toward the plan boilerplate (issue #4359).
|
|
2631
|
+
compactOutcome = await this.handleCompactCommand(
|
|
2632
|
+
undefined,
|
|
2633
|
+
undefined,
|
|
2634
|
+
outcome => this.#applyDeferredPlanModelTransition(outcome, options.executionModel),
|
|
2635
|
+
compactionPrompt,
|
|
2611
2636
|
);
|
|
2612
2637
|
}
|
|
2613
2638
|
} finally {
|
|
@@ -2658,11 +2683,7 @@ export class InteractiveMode implements InteractiveModeContext {
|
|
|
2658
2683
|
// when the user has already chosen a name (preserveContext paths).
|
|
2659
2684
|
const seededName = humanizePlanTitle(options.title);
|
|
2660
2685
|
if (seededName && !this.sessionManager.getSessionName()) {
|
|
2661
|
-
|
|
2662
|
-
if (applied) {
|
|
2663
|
-
setSessionTerminalTitle(this.sessionManager.getSessionName(), this.sessionManager.getCwd());
|
|
2664
|
-
this.updateEditorBorderColor();
|
|
2665
|
-
}
|
|
2686
|
+
await this.sessionManager.setSessionName(seededName, "auto");
|
|
2666
2687
|
}
|
|
2667
2688
|
|
|
2668
2689
|
// markPlanReferenceSent fires only on the dispatch path so the synthetic
|
|
@@ -2672,16 +2693,24 @@ export class InteractiveMode implements InteractiveModeContext {
|
|
|
2672
2693
|
planFilePath: options.planFilePath,
|
|
2673
2694
|
contextPreserved: options.preserveContext === true,
|
|
2674
2695
|
});
|
|
2675
|
-
//
|
|
2676
|
-
//
|
|
2677
|
-
//
|
|
2678
|
-
// AgentBusyError
|
|
2679
|
-
//
|
|
2680
|
-
//
|
|
2696
|
+
// A user turn queued during compaction was already fired by
|
|
2697
|
+
// `flushCompactionQueue` before we returned from `handleCompactCommand`; the
|
|
2698
|
+
// old abort-then-prompt path would have discarded that operator turn AND
|
|
2699
|
+
// still surfaced `AgentBusyError` when the queued turn kicked off in the
|
|
2700
|
+
// synchronous gap. Preserve the in-flight work and queue the hidden
|
|
2701
|
+
// execution directive behind it as a synthetic follow-up. If `isStreaming`
|
|
2702
|
+
// flips true between the check and dispatch (the same fire-and-forget race
|
|
2703
|
+
// noted below), catch `AgentBusyError` and fall back to the same queue.
|
|
2681
2704
|
if (this.session.isStreaming) {
|
|
2682
|
-
await this
|
|
2705
|
+
await this.session.followUp(planModePrompt, undefined, { synthetic: true });
|
|
2706
|
+
return;
|
|
2707
|
+
}
|
|
2708
|
+
try {
|
|
2709
|
+
await this.session.prompt(planModePrompt, { synthetic: true });
|
|
2710
|
+
} catch (error) {
|
|
2711
|
+
if (!(error instanceof AgentBusyError)) throw error;
|
|
2712
|
+
await this.session.followUp(planModePrompt, undefined, { synthetic: true });
|
|
2683
2713
|
}
|
|
2684
|
-
await this.session.prompt(planModePrompt, { synthetic: true });
|
|
2685
2714
|
}
|
|
2686
2715
|
async #abortPlanApprovalTurnSilently(): Promise<void> {
|
|
2687
2716
|
this.session.markPlanInternalAbortPending();
|
|
@@ -3900,8 +3929,9 @@ export class InteractiveMode implements InteractiveModeContext {
|
|
|
3900
3929
|
customInstructions?: string,
|
|
3901
3930
|
mode?: CompactMode,
|
|
3902
3931
|
beforeFlush?: (outcome: CompactionOutcome) => void | Promise<void>,
|
|
3932
|
+
internalGuidance?: string,
|
|
3903
3933
|
): Promise<CompactionOutcome> {
|
|
3904
|
-
return this.#commandController.handleCompactCommand(customInstructions, mode, beforeFlush);
|
|
3934
|
+
return this.#commandController.handleCompactCommand(customInstructions, mode, beforeFlush, internalGuidance);
|
|
3905
3935
|
}
|
|
3906
3936
|
|
|
3907
3937
|
handleHandoffCommand(customInstructions?: string): Promise<void> {
|
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
type AutocompleteItem,
|
|
3
3
|
type AutocompleteProvider,
|
|
4
4
|
CombinedAutocompleteProvider,
|
|
5
|
+
findLeadingSlashCommandStart,
|
|
5
6
|
getKeybindings,
|
|
6
7
|
type SlashCommand,
|
|
7
8
|
} from "@oh-my-pi/pi-tui";
|
|
@@ -94,11 +95,13 @@ function getPromptActionPrefix(textBeforeCursor: string): string | null {
|
|
|
94
95
|
}
|
|
95
96
|
|
|
96
97
|
export class PromptActionAutocompleteProvider implements AutocompleteProvider {
|
|
98
|
+
#commands: SlashCommand[];
|
|
97
99
|
#baseProvider: CombinedAutocompleteProvider;
|
|
98
100
|
#actions: PromptActionDefinition[];
|
|
99
101
|
#basePath: string;
|
|
100
102
|
|
|
101
103
|
constructor(commands: SlashCommand[], basePath: string, actions: PromptActionDefinition[]) {
|
|
104
|
+
this.#commands = commands;
|
|
102
105
|
this.#baseProvider = new CombinedAutocompleteProvider(commands, basePath);
|
|
103
106
|
this.#basePath = basePath;
|
|
104
107
|
this.#actions = actions;
|
|
@@ -111,6 +114,21 @@ export class PromptActionAutocompleteProvider implements AutocompleteProvider {
|
|
|
111
114
|
): Promise<{ items: AutocompleteItem[]; prefix: string } | null> {
|
|
112
115
|
const currentLine = lines[cursorLine] || "";
|
|
113
116
|
const textBeforeCursor = currentLine.slice(0, cursorCol);
|
|
117
|
+
const leadingSlashStart = findLeadingSlashCommandStart(textBeforeCursor);
|
|
118
|
+
const hasPromptTextBeforeCursorLine = lines.slice(0, cursorLine).some(line => (line || "").trim() !== "");
|
|
119
|
+
const commandText =
|
|
120
|
+
leadingSlashStart !== null && !hasPromptTextBeforeCursorLine
|
|
121
|
+
? textBeforeCursor.slice(leadingSlashStart)
|
|
122
|
+
: null;
|
|
123
|
+
const spaceIndex = commandText?.indexOf(" ") ?? -1;
|
|
124
|
+
if (commandText !== null && spaceIndex !== -1) {
|
|
125
|
+
const commandName = commandText.slice(1, spaceIndex);
|
|
126
|
+
const command = this.#commands.find(cmd => cmd.name === commandName || cmd.aliases?.includes(commandName));
|
|
127
|
+
if (command && (!("allowArgs" in command) || command.allowArgs !== false)) {
|
|
128
|
+
return this.#baseProvider.getSuggestions(lines, cursorLine, cursorCol);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
114
132
|
const promptActionPrefix = getPromptActionPrefix(textBeforeCursor);
|
|
115
133
|
if (promptActionPrefix) {
|
|
116
134
|
const query = promptActionPrefix.slice(1).toLowerCase();
|
|
@@ -207,6 +207,14 @@ export function shimmerSegments(segments: readonly ShimmerSegment[], theme: Shim
|
|
|
207
207
|
const time = Date.now();
|
|
208
208
|
const intensityFn = mode === "kitt" ? kittIntensity : classicIntensity;
|
|
209
209
|
|
|
210
|
+
// Fast-path window: outside `[bandLo, bandHi]` the intensity is guaranteed
|
|
211
|
+
// zero (tier "low"), so we can skip `intensityFn` + `tierFor` entirely for
|
|
212
|
+
// the prefix/suffix of every segment. On the typical ~60-char working
|
|
213
|
+
// message the classic band spans ~12 cells, so ~80% of the per-char loop
|
|
214
|
+
// disappears — the intensity call and the tier compare were the residual
|
|
215
|
+
// per-frame cost after #4353 removed the allocation hotspot (issue #4377).
|
|
216
|
+
const { lo: bandLo, hi: bandHi } = activeBand(mode, time, total);
|
|
217
|
+
|
|
210
218
|
let out = "";
|
|
211
219
|
let index = 0;
|
|
212
220
|
for (const { text, palette } of perSeg) {
|
|
@@ -224,7 +232,7 @@ export function shimmerSegments(segments: readonly ShimmerSegment[], theme: Shim
|
|
|
224
232
|
const c2 = text.charCodeAt(i + 1);
|
|
225
233
|
if (c2 >= 0xdc00 && c2 <= 0xdfff) step = 2;
|
|
226
234
|
}
|
|
227
|
-
const tier = tierFor(intensityFn(time, index, total));
|
|
235
|
+
const tier: Tier = index < bandLo || index > bandHi ? "low" : tierFor(intensityFn(time, index, total));
|
|
228
236
|
if (tier !== runTier) {
|
|
229
237
|
if (runTier !== null && runEnd > runStart) {
|
|
230
238
|
const seq = compiled[runTier];
|
|
@@ -245,6 +253,34 @@ export function shimmerSegments(segments: readonly ShimmerSegment[], theme: Shim
|
|
|
245
253
|
return out;
|
|
246
254
|
}
|
|
247
255
|
|
|
256
|
+
/**
|
|
257
|
+
* Sweep window (code-point indices) outside which the intensity is guaranteed
|
|
258
|
+
* zero for `mode` at `time` over `total` cells. Widening the window is safe —
|
|
259
|
+
* the per-char intensity call still runs inside the window and reports 0 for
|
|
260
|
+
* off-band code points — but narrower windows skip more of the per-char loop.
|
|
261
|
+
*/
|
|
262
|
+
function activeBand(mode: "classic" | "kitt", time: number, total: number): { lo: number; hi: number } {
|
|
263
|
+
if (mode === "classic") {
|
|
264
|
+
const period = total + CLASSIC_PADDING * 2;
|
|
265
|
+
const pos = ((time / 1000) * SHIMMER_SPEED_CELLS_PER_S) % period;
|
|
266
|
+
return {
|
|
267
|
+
lo: pos - CLASSIC_PADDING - CLASSIC_BAND_HALF_WIDTH,
|
|
268
|
+
hi: pos - CLASSIC_PADDING + CLASSIC_BAND_HALF_WIDTH,
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
const range = total - 1;
|
|
272
|
+
if (range <= 0) return { lo: 0, hi: total };
|
|
273
|
+
const cycleCells = 2 * range;
|
|
274
|
+
const sweep = ((time / 1000) * SHIMMER_SPEED_CELLS_PER_S) % cycleCells;
|
|
275
|
+
const goingRight = sweep < range;
|
|
276
|
+
const head = goingRight ? sweep : cycleCells - sweep;
|
|
277
|
+
// The trail always lies behind the head for the current direction — chars
|
|
278
|
+
// ahead of the head are dark. See {@link kittIntensity} for the exact rule.
|
|
279
|
+
return goingRight
|
|
280
|
+
? { lo: head - KITT_HEAD_HALF - KITT_TRAIL_LEN, hi: head + KITT_HEAD_HALF }
|
|
281
|
+
: { lo: head - KITT_HEAD_HALF, hi: head + KITT_HEAD_HALF + KITT_TRAIL_LEN };
|
|
282
|
+
}
|
|
283
|
+
|
|
248
284
|
function countCodePoints(text: string): number {
|
|
249
285
|
let n = 0;
|
|
250
286
|
let i = 0;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { describe, expect, it } from "bun:test";
|
|
2
|
+
import type { AssistantMessage, Usage } from "@oh-my-pi/pi-ai";
|
|
3
|
+
import { assistantUsageIsBilled } from "./transcript-render-helpers";
|
|
4
|
+
|
|
5
|
+
function usage(overrides: Partial<Usage> = {}): Usage {
|
|
6
|
+
return {
|
|
7
|
+
input: 0,
|
|
8
|
+
output: 0,
|
|
9
|
+
cacheRead: 0,
|
|
10
|
+
cacheWrite: 0,
|
|
11
|
+
totalTokens: 0,
|
|
12
|
+
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },
|
|
13
|
+
...overrides,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
describe("assistantUsageIsBilled", () => {
|
|
18
|
+
it("suppresses the token badge only for turns that consumed nothing", () => {
|
|
19
|
+
expect(assistantUsageIsBilled(usage())).toBe(false);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it("preserves cost transparency for empty replies whose prompt still cost input tokens", () => {
|
|
23
|
+
expect(assistantUsageIsBilled(usage({ input: 321 }))).toBe(true);
|
|
24
|
+
expect(assistantUsageIsBilled(usage({ output: 0, cacheRead: 512 }))).toBe(true);
|
|
25
|
+
expect(assistantUsageIsBilled(usage({ cacheWrite: 128 }))).toBe(true);
|
|
26
|
+
expect(assistantUsageIsBilled(usage({ premiumRequests: 1 }))).toBe(true);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
// Documents the live/resume parity contract for #4532: both paths ask
|
|
30
|
+
// `assistantUsageIsBilled` about `message.usage`, so an empty automated
|
|
31
|
+
// reply that still cost input tokens renders identically on both surfaces.
|
|
32
|
+
it("matches whether the assistant carrier renders visible content", () => {
|
|
33
|
+
const emptyBilledMessage: Pick<AssistantMessage, "usage"> = { usage: usage({ input: 321 }) };
|
|
34
|
+
const emptyFreeMessage: Pick<AssistantMessage, "usage"> = { usage: usage() };
|
|
35
|
+
expect(assistantUsageIsBilled(emptyBilledMessage.usage)).toBe(true);
|
|
36
|
+
expect(assistantUsageIsBilled(emptyFreeMessage.usage)).toBe(false);
|
|
37
|
+
});
|
|
38
|
+
});
|
|
@@ -7,8 +7,14 @@
|
|
|
7
7
|
import type { AgentMessage } from "@oh-my-pi/pi-agent-core";
|
|
8
8
|
import { type Component, Text } from "@oh-my-pi/pi-tui";
|
|
9
9
|
import { formatBytes, formatDuration } from "@oh-my-pi/pi-utils";
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
type CustomMessage,
|
|
12
|
+
type FileMentionMessage,
|
|
13
|
+
resolveAbortLabel,
|
|
14
|
+
shouldRenderAbortReason,
|
|
15
|
+
} from "../../session/messages";
|
|
11
16
|
import { createIrcMessageCard } from "../../tools/irc";
|
|
17
|
+
import { replaceTabs, TRUNCATE_LENGTHS, truncateToWidth } from "../../tools/render-utils";
|
|
12
18
|
import { canonicalizeMessage } from "../../utils/thinking-display";
|
|
13
19
|
import { TranscriptBlock } from "../components/transcript-container";
|
|
14
20
|
import { theme } from "../theme/theme";
|
|
@@ -138,20 +144,55 @@ export function normalizeToolArgs(args: unknown): Record<string, unknown> {
|
|
|
138
144
|
return args && typeof args === "object" && !Array.isArray(args) ? (args as Record<string, unknown>) : {};
|
|
139
145
|
}
|
|
140
146
|
|
|
147
|
+
export type AssistantErrorPresentation =
|
|
148
|
+
| { kind: "none" }
|
|
149
|
+
| { kind: "full"; text: string; isError: true }
|
|
150
|
+
| { kind: "compact-recovered"; text: string; isError: false };
|
|
151
|
+
|
|
152
|
+
function sanitizeRecoveredRetryNote(note: string): string {
|
|
153
|
+
const normalized = replaceTabs(note).replace(/\s+/g, " ").trim();
|
|
154
|
+
return truncateToWidth(normalized || "retried", TRUNCATE_LENGTHS.CONTENT);
|
|
155
|
+
}
|
|
156
|
+
|
|
141
157
|
/**
|
|
142
|
-
* Resolve the
|
|
143
|
-
* Silent aborts yield no label.
|
|
158
|
+
* Resolve the turn-ending assistant error presentation, if any.
|
|
159
|
+
* Silent and user-interrupt aborts yield no label. Recovered auto-retry errors
|
|
160
|
+
* collapse to a single non-error note; terminal errors keep the full red presentation.
|
|
144
161
|
*/
|
|
145
|
-
export function
|
|
162
|
+
export function resolveAssistantErrorPresentation(
|
|
146
163
|
message: AssistantAgentMessage,
|
|
147
164
|
retryAttempt = 0,
|
|
148
|
-
):
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
165
|
+
): AssistantErrorPresentation {
|
|
166
|
+
if (message.retryRecovery?.status === "recovered") {
|
|
167
|
+
return {
|
|
168
|
+
kind: "compact-recovered",
|
|
169
|
+
text: sanitizeRecoveredRetryNote(message.retryRecovery.note),
|
|
170
|
+
isError: false,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
if (message.stopReason === "aborted") {
|
|
174
|
+
if (!shouldRenderAbortReason(message)) return { kind: "none" };
|
|
175
|
+
return { kind: "full", text: resolveAbortLabel(message, retryAttempt), isError: true };
|
|
176
|
+
}
|
|
177
|
+
if (message.stopReason === "error") {
|
|
178
|
+
return { kind: "full", text: message.errorMessage || "Error", isError: true };
|
|
179
|
+
}
|
|
180
|
+
if (message.errorMessage && shouldRenderAbortReason(message)) {
|
|
181
|
+
return { kind: "full", text: message.errorMessage, isError: true };
|
|
182
|
+
}
|
|
183
|
+
return { kind: "none" };
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Whether an assistant turn's `usage` reflects work the operator was billed
|
|
188
|
+
* for. Empty automated turns from providers that emit `usage: 0` collapse to
|
|
189
|
+
* `false`, but any input, output, cache, or premium request keeps the row so
|
|
190
|
+
* cost transparency survives — the live path and the resume/rebuild path
|
|
191
|
+
* agree turn-by-turn.
|
|
192
|
+
*/
|
|
193
|
+
export function assistantUsageIsBilled(usage: AssistantAgentMessage["usage"]): boolean {
|
|
194
|
+
if (usage.input > 0 || usage.output > 0) return true;
|
|
195
|
+
if (usage.cacheRead > 0 || usage.cacheWrite > 0) return true;
|
|
196
|
+
if ((usage.premiumRequests ?? 0) > 0) return true;
|
|
197
|
+
return false;
|
|
157
198
|
}
|
|
@@ -50,11 +50,12 @@ import { buildSkillCommandPrompt, invokeSkillCommandFromText, isKnownSkillComman
|
|
|
50
50
|
import { createAssistantMessageComponent } from "./interactive-context-helpers";
|
|
51
51
|
import {
|
|
52
52
|
assistantHasVisibleContent,
|
|
53
|
+
assistantUsageIsBilled,
|
|
53
54
|
buildAsyncResultBlock,
|
|
54
55
|
buildFileMentionBlock,
|
|
55
56
|
buildIrcMessageCard,
|
|
56
57
|
normalizeToolArgs,
|
|
57
|
-
|
|
58
|
+
resolveAssistantErrorPresentation,
|
|
58
59
|
} from "./transcript-render-helpers";
|
|
59
60
|
|
|
60
61
|
type TextBlock = { type: "text"; text: string };
|
|
@@ -317,7 +318,11 @@ export class UiHelpers {
|
|
|
317
318
|
const previous = waitingPoll;
|
|
318
319
|
if (!previous) return;
|
|
319
320
|
waitingPoll = null;
|
|
320
|
-
if (
|
|
321
|
+
if (
|
|
322
|
+
nextToolName === "job" &&
|
|
323
|
+
previous.isDisplaceableBlock() &&
|
|
324
|
+
this.ctx.chatContainer.isBlockUncommitted(previous)
|
|
325
|
+
) {
|
|
321
326
|
this.ctx.chatContainer.removeChild(previous);
|
|
322
327
|
}
|
|
323
328
|
// Sealing freezes the block and stops the waiting-poll spinner that
|
|
@@ -334,7 +339,9 @@ export class UiHelpers {
|
|
|
334
339
|
}
|
|
335
340
|
if (previous.canBeDisplacedBy(nextToolName)) {
|
|
336
341
|
todoSnapshot = null;
|
|
337
|
-
this.ctx.chatContainer.
|
|
342
|
+
if (this.ctx.chatContainer.isBlockUncommitted(previous)) {
|
|
343
|
+
this.ctx.chatContainer.removeChild(previous);
|
|
344
|
+
}
|
|
338
345
|
previous.seal();
|
|
339
346
|
return;
|
|
340
347
|
}
|
|
@@ -372,10 +379,9 @@ export class UiHelpers {
|
|
|
372
379
|
readGroup?.seal();
|
|
373
380
|
readGroup = null;
|
|
374
381
|
}
|
|
375
|
-
const
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
);
|
|
382
|
+
const errorPresentation = resolveAssistantErrorPresentation(message, this.ctx.viewSession.retryAttempt);
|
|
383
|
+
const hasErrorStop = errorPresentation.kind === "full";
|
|
384
|
+
const errorMessage = hasErrorStop ? errorPresentation.text : null;
|
|
379
385
|
|
|
380
386
|
// Render tool call components
|
|
381
387
|
for (const content of message.content) {
|
|
@@ -458,7 +464,10 @@ export class UiHelpers {
|
|
|
458
464
|
this.ctx.pendingTools.set(content.id, component);
|
|
459
465
|
}
|
|
460
466
|
}
|
|
461
|
-
pendingUsage =
|
|
467
|
+
pendingUsage =
|
|
468
|
+
this.ctx.settings.get("display.showTokenUsage") && assistantUsageIsBilled(message.usage)
|
|
469
|
+
? message.usage
|
|
470
|
+
: undefined;
|
|
462
471
|
pendingUsageDuration = message.duration;
|
|
463
472
|
pendingUsageTtft = message.ttft;
|
|
464
473
|
} else if (message.role === "toolResult") {
|
|
@@ -13,7 +13,7 @@ Worth it when the task benefits from decomposition + parallel coverage, or from
|
|
|
13
13
|
<helpers>
|
|
14
14
|
State persists across eval calls, so scout in one call and fan out in the next. Every eval call has:
|
|
15
15
|
|
|
16
|
-
- `agent(prompt, *, agent="task", model=None, label=None, schema=None, isolated=None, apply=None, merge=None, handle=False)` — run ONE subagent; returns its final text, or the validated object when `schema` (a JSON Schema dict) is given. With `schema` the subagent is forced to emit structured output that is validated for you — branch on the object, not on parsed prose. `agent` picks a discovered agent ("explore", "reviewer", …); `label` names the artifact. Shared background goes in a `local://` file referenced from each prompt, not a parameter. Subagents are told their final text IS the return value, so they hand back raw data. `agent()` blocks until the subagent finishes;
|
|
16
|
+
- `agent(prompt, *, agent="task", model=None, label=None, schema=None, isolated=None, apply=None, merge=None, handle=False)` — run ONE subagent; returns its final text, or the validated object when `schema` (a JSON Schema dict) is given. With `schema` the subagent is forced to emit structured output that is validated for you — branch on the object, not on parsed prose. `agent` picks a discovered agent ("explore", "reviewer", …); `label` names the artifact. Shared background goes in a `local://` file referenced from each prompt, not a parameter. Subagents are told their final text IS the return value, so they hand back raw data. `agent()` blocks until the subagent finishes. Recursion follows `task.maxRecursionDepth` (default 2; `-1` uses eval's hard cap 3): main agent depth = 0, each `agent()` child increments depth by 1, and a spawner may call `agent()` only while its current `taskDepth < effective cap`. Pass `isolated=True` to run the spawn in a copy-on-write worktree so parallel `agent()` calls can edit overlapping files safely — strict opt-in, mirrors the `task` tool, defaults off regardless of `task.isolation.mode`; `isolated=True` while the setting is `"none"` errors out instead of silently downgrading. With isolation, `apply=False` keeps changes in the worktree, and `merge=False` forces patch mode even when the setting is `"branch"`. Captured root patch path, branch name, nested repo patches, and apply summary reach the workflow through `handle=True` — combine it with `apply=False` (or `apply=False, schema=…`) and read `node["patch_path"]`, `node["branch_name"]`, `node["nested_patches"]`, `node["changes_applied"]`, `node["isolation_summary"]` (JS: same keys camelCased) to recover artifacts.
|
|
17
17
|
- `parallel(thunks)` — run zero-arg callables concurrently through a bounded pool, preserving input order; returns once all finish. The pool is bounded by the session's `task` concurrency — don't hand-tune it; fan out as wide as the work divides. A thunk that raises propagates — wrap risky work in `try/except` inside the thunk to keep partial results. In a loop, bind each closure's value with a default arg (`lambda d=d: …`) or every thunk captures the last one.
|
|
18
18
|
- `pipeline(items, *stages)` — map items through `stages` left-to-right. There is a BARRIER between stages: ALL items clear stage N before stage N+1 begins. Each stage is a one-arg callable; stage 1 gets the original item, later stages get the previous result. Same pool width as `parallel()`.
|
|
19
19
|
- `completion(prompt, *, model="default", system=None, schema=None)` — oneshot, stateless model call (no tools, no history). Tiers: "smol", "default", "slow". Cheap classification/scoring inside a fan-out.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
Runs
|
|
1
|
+
Runs commands in the embedded shell — terminal ops: git, bun, cargo, python.
|
|
2
2
|
|
|
3
3
|
# When to use bash — and when not to
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The shell invokes **real binaries** with simple args. It is NOT full GNU Bash.
|
|
6
6
|
|
|
7
|
-
Use bash ONLY for: a single binary call, or one short pipeline that COMPUTES a fact (`wc -l`, `sort | uniq -c`, `comm`, `diff`, a checksum, `git status`).
|
|
7
|
+
Use bash ONLY for: a single binary call, or one short pipeline that COMPUTES a fact and does not depend on shell-specific regex/quoting (`wc -l`, `sort | uniq -c`, `comm`, `diff`, a checksum, `git status`).
|
|
8
8
|
|
|
9
9
|
Anything below → `eval` cell, not bash:
|
|
10
10
|
- Inline interpreter scripts (`-e`/`-c`/`--eval`) when an eval runtime exists for that language
|
|
@@ -13,6 +13,7 @@ Anything below → `eval` cell, not bash:
|
|
|
13
13
|
- Pipelines with more than two stages, or stages that need control flow or quote/JSON escaping
|
|
14
14
|
- Multiline commands, `&&`-chains mixing control flow
|
|
15
15
|
- Quote/JSON escaping that fights the shell
|
|
16
|
+
- GNU grep BRE extensions are not guaranteed in the embedded shell: use `grep -E 'json|tool'` for alternation instead of `grep 'json\|tool'`; use the built-in `grep` tool with `pattern: "json|tool"` (Rust regex, so `\bword\b` works there), or `eval` for exact text processing.
|
|
16
17
|
|
|
17
18
|
<instruction>
|
|
18
19
|
- `cwd` sets the working dir, not `cd dir && …`
|
|
@@ -22,13 +23,14 @@ Anything below → `eval` cell, not bash:
|
|
|
22
23
|
- `;` only when later commands should run despite earlier failures
|
|
23
24
|
- Multiple bash calls per message run concurrently. NEVER split order-dependent commands across parallel calls — chain with `&&` in one call.
|
|
24
25
|
- Internal URIs (`skill://`, `agent://`, …) auto-resolve to FS paths
|
|
26
|
+
- Need exact pipeline semantics (`cmd | head`, multi-stage filtering) or output truncation? Prefer `eval` and process the stream directly.
|
|
25
27
|
{{#if asyncEnabled}}
|
|
26
28
|
- `async: true` for long-running commands when you don't need immediate output: returns a background job ID; result delivered as a follow-up.
|
|
27
29
|
{{/if}}
|
|
28
30
|
</instruction>
|
|
29
31
|
|
|
30
32
|
<critical>
|
|
31
|
-
-
|
|
33
|
+
- The embedded shell invokes real binaries with simple args; it is NOT full GNU Bash. Loops, conditionals, heredocs, inline interpreter scripts (`-e`/`-c`/`--eval`) when an eval runtime exists, several piped stages, exact pipeline semantics, or quote/JSON escaping mean you're writing a program → use `eval` cells: restartable, stateful, and free of shell-quoting traps.
|
|
32
34
|
</critical>
|
|
33
35
|
|
|
34
36
|
<output>
|
|
@@ -39,9 +41,9 @@ Anything below → `eval` cell, not bash:
|
|
|
39
41
|
{{#if asyncEnabled}}
|
|
40
42
|
# Timeout and async
|
|
41
43
|
|
|
42
|
-
- `timeout`
|
|
43
|
-
- `async: true` defers only reporting — it does NOT extend the timeout; a daemon
|
|
44
|
-
-
|
|
44
|
+
- `timeout` is seconds, clamped to `1..3600`; the process is killed on elapse.
|
|
45
|
+
- `async: true` defers only reporting — it does NOT extend the timeout; a daemon with `async: true` is still killed at the clamped timeout.
|
|
46
|
+
- Need >3600s? Detach/manage lifecycle yourself (`cmd &`, supervisor, self-restarting script). The shell session persists across calls.
|
|
45
47
|
{{/if}}
|
|
46
48
|
{{#if autoBackgroundEnabled}}
|
|
47
49
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Greps files using regex.
|
|
2
2
|
|
|
3
3
|
<instruction>
|
|
4
|
-
- Rust regex (RE2-style)
|
|
4
|
+
- Rust regex (RE2-style): alternation is `foo|bar`, not GNU BRE-style `foo\|bar`; Rust word boundaries like `\bword\b` are supported. Use line anchors or post-filters instead of lookaround/backreferences.
|
|
5
5
|
- `path`: SHOULD scope to a known path (e.g. `src`); pass several as a delimited list (`src; tests`).
|
|
6
6
|
- Cross-line patterns detected from literal `\n` or `\\n` in `pattern`.
|
|
7
7
|
</instruction>
|
|
@@ -6,3 +6,5 @@ Use only with ids returned by the `recall` tool. Operations:
|
|
|
6
6
|
- `invalidate`: softly supersede a working or episodic memory, optionally pointing at `replacement_id`.
|
|
7
7
|
|
|
8
8
|
Prefer `invalidate` when a memory became stale but its history may still be useful. Use `forget` only for content that should be hard-deleted.
|
|
9
|
+
|
|
10
|
+
**Always read the full memory before `update`.** Recall results are clipped previews (the trailing `…` marks a truncation and `full_length` reports the original size); `update` replaces content wholesale, so overwriting the preview would delete the unseen tail. Fetch the row first with `read memory://<id>`, then pass the merged content in `content`.
|
|
@@ -3,3 +3,5 @@ Search long-term memory for relevant information. Returns raw matching entries r
|
|
|
3
3
|
Use proactively — before answering questions about past conversations, user preferences, project decisions, or any topic where prior context would help accuracy. When in doubt, recall first.
|
|
4
4
|
|
|
5
5
|
Prefer `recall` when you need specific facts or entries. Use `reflect` instead when you need a synthesized answer across many memories.
|
|
6
|
+
|
|
7
|
+
Content in each result is a preview. A trailing `…` marks a truncation (`truncated: true`, `full_length` gives the original size). Fetch the full row with `read memory://<id>` — required before any `memory_edit update`.
|