@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
|
@@ -81,6 +81,8 @@ import type { ProtectedToolMatcher } from "@oh-my-pi/pi-agent-core/compaction/to
|
|
|
81
81
|
import type {
|
|
82
82
|
AssistantMessage,
|
|
83
83
|
AssistantMessageEvent,
|
|
84
|
+
AssistantRetryRecovery,
|
|
85
|
+
AssistantRetryRecoveryKind,
|
|
84
86
|
Context,
|
|
85
87
|
ImageContent,
|
|
86
88
|
Message,
|
|
@@ -219,6 +221,7 @@ import { createExtensionModelQuery } from "../extensibility/extensions/model-api
|
|
|
219
221
|
import type { CompactOptions, ContextUsage } from "../extensibility/extensions/types";
|
|
220
222
|
import { ExtensionToolWrapper } from "../extensibility/extensions/wrapper";
|
|
221
223
|
import type { HookCommandContext } from "../extensibility/hooks/types";
|
|
224
|
+
import type { RecoveredRetryError } from "../extensibility/shared-events";
|
|
222
225
|
import type { Skill, SkillWarning } from "../extensibility/skills";
|
|
223
226
|
import { expandSlashCommand, type FileSlashCommand } from "../extensibility/slash-commands";
|
|
224
227
|
import { GoalRuntime } from "../goals/runtime";
|
|
@@ -334,11 +337,16 @@ import {
|
|
|
334
337
|
import {
|
|
335
338
|
type BashExecutionMessage,
|
|
336
339
|
type CustomMessage,
|
|
340
|
+
type CustomMessagePayload,
|
|
337
341
|
convertToLlm,
|
|
338
342
|
demoteInterruptedThinking,
|
|
343
|
+
type FileMentionMessage,
|
|
344
|
+
type HookMessage,
|
|
339
345
|
INTERRUPTED_THINKING_MESSAGE_TYPE,
|
|
340
346
|
type InterruptedThinkingDetails,
|
|
347
|
+
isEmptyErrorTurn,
|
|
341
348
|
isUserInterruptAbort,
|
|
349
|
+
normalizeCustomMessagePayload,
|
|
342
350
|
type PythonExecutionMessage,
|
|
343
351
|
readQueueChipText,
|
|
344
352
|
SILENT_ABORT_MARKER,
|
|
@@ -497,7 +505,13 @@ export type AgentSessionEvent =
|
|
|
497
505
|
errorMessage: string;
|
|
498
506
|
errorId?: number;
|
|
499
507
|
}
|
|
500
|
-
| {
|
|
508
|
+
| {
|
|
509
|
+
type: "auto_retry_end";
|
|
510
|
+
success: boolean;
|
|
511
|
+
attempt: number;
|
|
512
|
+
finalError?: string;
|
|
513
|
+
recoveredErrors?: RecoveredRetryError[];
|
|
514
|
+
}
|
|
501
515
|
| { type: "retry_fallback_applied"; from: string; to: string; role: string }
|
|
502
516
|
| { type: "retry_fallback_succeeded"; model: string; role: string }
|
|
503
517
|
| { type: "ttsr_triggered"; rules: Rule[] }
|
|
@@ -837,6 +851,16 @@ export interface PromptOptions {
|
|
|
837
851
|
skipCompactionCheck?: boolean;
|
|
838
852
|
}
|
|
839
853
|
|
|
854
|
+
/** Options for AgentSession.followUp() */
|
|
855
|
+
export interface FollowUpOptions {
|
|
856
|
+
/** Enqueue as a hidden developer message (agent-attributed by default) instead of a user follow-up. */
|
|
857
|
+
synthetic?: boolean;
|
|
858
|
+
/** Whether to expand file-based prompt templates (default: true). */
|
|
859
|
+
expandPromptTemplates?: boolean;
|
|
860
|
+
/** Explicit billing/initiator attribution. Defaults to `agent` for synthetic follow-ups. */
|
|
861
|
+
attribution?: MessageAttribution;
|
|
862
|
+
}
|
|
863
|
+
|
|
840
864
|
/** Result from a handoff operation. */
|
|
841
865
|
export interface HandoffResult {
|
|
842
866
|
document: string;
|
|
@@ -1425,6 +1449,13 @@ type MessageEndPersistenceSlot = {
|
|
|
1425
1449
|
persist: (persistMessage: () => void) => Promise<void>;
|
|
1426
1450
|
release: () => void;
|
|
1427
1451
|
};
|
|
1452
|
+
type PendingRecoveredRetryError = {
|
|
1453
|
+
entryId: string;
|
|
1454
|
+
persistenceKey: string;
|
|
1455
|
+
recovery: AssistantRetryRecoveryKind;
|
|
1456
|
+
attempt: number;
|
|
1457
|
+
note: string;
|
|
1458
|
+
};
|
|
1428
1459
|
|
|
1429
1460
|
type PostPromptSkipReason = "aborted" | "stale-generation";
|
|
1430
1461
|
|
|
@@ -1581,6 +1612,7 @@ export class AgentSession {
|
|
|
1581
1612
|
#retryPromise: Promise<void> | undefined = undefined;
|
|
1582
1613
|
#retryResolve: (() => void) | undefined = undefined;
|
|
1583
1614
|
#activeRetryFallback: ActiveRetryFallbackState | undefined = undefined;
|
|
1615
|
+
#pendingRecoveredRetryErrors: PendingRecoveredRetryError[] = [];
|
|
1584
1616
|
// Todo completion reminder state
|
|
1585
1617
|
#todoReminderCount = 0;
|
|
1586
1618
|
/**
|
|
@@ -1654,6 +1686,7 @@ export class AgentSession {
|
|
|
1654
1686
|
#turnIndex = 0;
|
|
1655
1687
|
#messageEndPersistenceTail: Promise<void> = Promise.resolve();
|
|
1656
1688
|
#pendingMessageEndPersistence = new Map<string, Promise<void>>();
|
|
1689
|
+
#persistedMessageKeys: { anchor: string; keys: Set<string> } | undefined;
|
|
1657
1690
|
|
|
1658
1691
|
#skills: Skill[];
|
|
1659
1692
|
#skillWarnings: SkillWarning[];
|
|
@@ -2322,7 +2355,19 @@ export class AgentSession {
|
|
|
2322
2355
|
model = sel.model;
|
|
2323
2356
|
thinkingLevel = concreteThinkingLevel(sel.thinkingLevel);
|
|
2324
2357
|
}
|
|
2325
|
-
|
|
2358
|
+
// Clamp the effort against the resolved model. Historically we defaulted
|
|
2359
|
+
// to `ThinkingLevel.Medium` unconditionally, which threw at first stream
|
|
2360
|
+
// on reasoning models that expose no controllable effort surface
|
|
2361
|
+
// (e.g. `devin-agent`: Cascade routes by sibling model id, not a wire
|
|
2362
|
+
// param; `getSupportedEfforts` returns `[]`). `resolveThinkingLevelForModel`
|
|
2363
|
+
// preserves an explicit `off`, clamps a concrete effort into the model's
|
|
2364
|
+
// supported range, and returns `undefined` for reasoning models without
|
|
2365
|
+
// controllable efforts — for that case we forward `Inherit` so no effort
|
|
2366
|
+
// is sent and reasoning stays enabled (matching the `auto`-path fix for
|
|
2367
|
+
// Devin models via `clampAutoThinkingEffort`). See #4579.
|
|
2368
|
+
const requestedLevel = thinkingLevel ?? ThinkingLevel.Medium;
|
|
2369
|
+
const resolvedLevel = resolveThinkingLevelForModel(model, requestedLevel);
|
|
2370
|
+
const advisorThinkingLevel: ThinkingLevel = resolvedLevel ?? ThinkingLevel.Inherit;
|
|
2326
2371
|
descriptors.push({
|
|
2327
2372
|
config,
|
|
2328
2373
|
name: config.name,
|
|
@@ -3256,13 +3301,20 @@ export class AgentSession {
|
|
|
3256
3301
|
/**
|
|
3257
3302
|
* Index every message entry on the current branch by persistence key, so
|
|
3258
3303
|
* the mid-run-compaction planner can ask "is this turn message already on
|
|
3259
|
-
* the branch?" in O(1)
|
|
3304
|
+
* the branch?" in O(1). The set is memoized through the current leaf path
|
|
3305
|
+
* and validated at use time against a (session file, leaf id) anchor.
|
|
3260
3306
|
*
|
|
3261
3307
|
* The mid-run ordering check uses key identity alone: same-key content
|
|
3262
3308
|
* variants are one logical message at this boundary, because otherwise a
|
|
3263
3309
|
* display-side rewrite can make the assistant look missing after its tool
|
|
3264
3310
|
* results have already persisted.
|
|
3265
3311
|
*
|
|
3312
|
+
* Coherency is anchor-based, not invalidation-based: every branch mutation
|
|
3313
|
+
* (rewind, branch switch, new session, custom-entry append) changes the
|
|
3314
|
+
* session manager's leaf id or session file, so `#ensurePersistedMessageKeys`
|
|
3315
|
+
* detects staleness itself and rebuilds. No mutation call site has to
|
|
3316
|
+
* remember to invalidate anything.
|
|
3317
|
+
*
|
|
3266
3318
|
* Pre-#3629 the equivalent was `sessionManager.getBranch()` called twice
|
|
3267
3319
|
* per turn message, each call rebuilding the path via O(n²) `unshift` and
|
|
3268
3320
|
* structurally JSON-comparing every entry — seconds of synchronous work
|
|
@@ -3270,6 +3322,24 @@ export class AgentSession {
|
|
|
3270
3322
|
* `ui.loop-blocked` warnings in the bug report.
|
|
3271
3323
|
*/
|
|
3272
3324
|
#indexPersistedMessageKeys(): Set<string> {
|
|
3325
|
+
return this.#ensurePersistedMessageKeys();
|
|
3326
|
+
}
|
|
3327
|
+
|
|
3328
|
+
#persistedMessageKeysAnchor(): string {
|
|
3329
|
+
return `${this.sessionManager.getSessionFile() ?? ""}\u0000${this.sessionManager.getLeafId() ?? ""}`;
|
|
3330
|
+
}
|
|
3331
|
+
|
|
3332
|
+
#ensurePersistedMessageKeys(): Set<string> {
|
|
3333
|
+
const anchor = this.#persistedMessageKeysAnchor();
|
|
3334
|
+
let cache = this.#persistedMessageKeys;
|
|
3335
|
+
if (cache === undefined || cache.anchor !== anchor) {
|
|
3336
|
+
cache = { anchor, keys: this.#buildPersistedMessageKeySet() };
|
|
3337
|
+
this.#persistedMessageKeys = cache;
|
|
3338
|
+
}
|
|
3339
|
+
return cache.keys;
|
|
3340
|
+
}
|
|
3341
|
+
|
|
3342
|
+
#buildPersistedMessageKeySet(): Set<string> {
|
|
3273
3343
|
const keys = new Set<string>();
|
|
3274
3344
|
for (const entry of this.sessionManager.getBranch()) {
|
|
3275
3345
|
if (entry.type !== "message") continue;
|
|
@@ -3281,20 +3351,16 @@ export class AgentSession {
|
|
|
3281
3351
|
|
|
3282
3352
|
/**
|
|
3283
3353
|
* True when {@link message} is structurally identical to a message already
|
|
3284
|
-
* appended to the current branch.
|
|
3285
|
-
*
|
|
3286
|
-
*
|
|
3287
|
-
* millisecond with `undefined` responseId) still count as DISTINCT.
|
|
3354
|
+
* appended to the current branch. Uses the current branch's memoized
|
|
3355
|
+
* persistence-key cache for the common missing-key case, and only walks the
|
|
3356
|
+
* branch to verify content when a key hit could be a rare collision.
|
|
3288
3357
|
*/
|
|
3289
3358
|
#sessionMessageAlreadyPersisted(message: AgentMessage): boolean {
|
|
3290
3359
|
const key = sessionMessagePersistenceKey(message);
|
|
3291
3360
|
if (key === undefined) return false;
|
|
3361
|
+
const keys = this.#ensurePersistedMessageKeys();
|
|
3362
|
+
if (!keys.has(key)) return false;
|
|
3292
3363
|
const branch = this.sessionManager.getBranch();
|
|
3293
|
-
// Reverse walk: recently-appended entries are at the tail, so the common
|
|
3294
|
-
// "is the message I just emitted already in the branch?" lookup short-
|
|
3295
|
-
// circuits in O(1) hot, O(branch) cold. Cheap-key compare for every
|
|
3296
|
-
// entry; content compare only when the cheap check matches, so the
|
|
3297
|
-
// expensive `JSON.stringify(content)` path stays off the hot loop.
|
|
3298
3364
|
for (let index = branch.length - 1; index >= 0; index--) {
|
|
3299
3365
|
const entry = branch[index];
|
|
3300
3366
|
if (entry.type !== "message") continue;
|
|
@@ -3304,6 +3370,26 @@ export class AgentSession {
|
|
|
3304
3370
|
return false;
|
|
3305
3371
|
}
|
|
3306
3372
|
|
|
3373
|
+
#appendSessionMessage(
|
|
3374
|
+
message:
|
|
3375
|
+
| Message
|
|
3376
|
+
| CustomMessage
|
|
3377
|
+
| HookMessage
|
|
3378
|
+
| BashExecutionMessage
|
|
3379
|
+
| PythonExecutionMessage
|
|
3380
|
+
| FileMentionMessage,
|
|
3381
|
+
): string {
|
|
3382
|
+
const cache = this.#persistedMessageKeys;
|
|
3383
|
+
const wasFresh = cache !== undefined && cache.anchor === this.#persistedMessageKeysAnchor();
|
|
3384
|
+
const entryId = this.sessionManager.appendMessage(message);
|
|
3385
|
+
const key = sessionMessagePersistenceKey(message);
|
|
3386
|
+
if (wasFresh && cache && key) {
|
|
3387
|
+
cache.keys.add(key);
|
|
3388
|
+
cache.anchor = this.#persistedMessageKeysAnchor();
|
|
3389
|
+
}
|
|
3390
|
+
return entryId;
|
|
3391
|
+
}
|
|
3392
|
+
|
|
3307
3393
|
#persistSessionMessageIfMissing(message: AgentMessage): void {
|
|
3308
3394
|
if (
|
|
3309
3395
|
message.role !== "user" &&
|
|
@@ -3318,6 +3404,7 @@ export class AgentSession {
|
|
|
3318
3404
|
if (message.role === "assistant") {
|
|
3319
3405
|
const assistantMsg = message as AssistantMessage;
|
|
3320
3406
|
if (this.#isClassifierRefusal(assistantMsg)) return;
|
|
3407
|
+
if (isEmptyErrorTurn(assistantMsg)) return;
|
|
3321
3408
|
if (assistantMsg.stopReason !== "aborted" && assistantMsg.stopReason !== "error" && assistantMsg.usage) {
|
|
3322
3409
|
assistantMsg.contextSnapshot = {
|
|
3323
3410
|
promptTokens: calculatePromptTokens(assistantMsg.usage),
|
|
@@ -3330,7 +3417,7 @@ export class AgentSession {
|
|
|
3330
3417
|
message.toolName === "rewind" &&
|
|
3331
3418
|
this.#rewoundToolResultIds.delete(message.toolCallId);
|
|
3332
3419
|
if (!skipPersistedRewindResult) {
|
|
3333
|
-
this
|
|
3420
|
+
this.#appendSessionMessage(message);
|
|
3334
3421
|
}
|
|
3335
3422
|
}
|
|
3336
3423
|
|
|
@@ -3663,11 +3750,14 @@ export class AgentSession {
|
|
|
3663
3750
|
role: this.#activeRetryFallback.role,
|
|
3664
3751
|
});
|
|
3665
3752
|
}
|
|
3753
|
+
const recoveredErrors = await this.#markPendingRecoveredRetryErrors(assistantMsg);
|
|
3666
3754
|
await this.#emitSessionEvent({
|
|
3667
3755
|
type: "auto_retry_end",
|
|
3668
3756
|
success: true,
|
|
3669
3757
|
attempt: this.#retryAttempt,
|
|
3758
|
+
recoveredErrors,
|
|
3670
3759
|
});
|
|
3760
|
+
this.#clearPendingRecoveredRetryErrors();
|
|
3671
3761
|
this.#retryAttempt = 0;
|
|
3672
3762
|
}
|
|
3673
3763
|
if (assistantMsg.provider === "opencode-go") {
|
|
@@ -5337,6 +5427,7 @@ export class AgentSession {
|
|
|
5337
5427
|
success: event.success,
|
|
5338
5428
|
attempt: event.attempt,
|
|
5339
5429
|
finalError: event.finalError,
|
|
5430
|
+
recoveredErrors: event.recoveredErrors,
|
|
5340
5431
|
});
|
|
5341
5432
|
} else if (event.type === "ttsr_triggered") {
|
|
5342
5433
|
await this.#extensionRunner.emit({ type: "ttsr_triggered", rules: event.rules });
|
|
@@ -7569,15 +7660,22 @@ export class AgentSession {
|
|
|
7569
7660
|
const promptAttribution: "user" | "agent" | undefined =
|
|
7570
7661
|
"attribution" in message ? message.attribution : undefined;
|
|
7571
7662
|
for (const msg of result.messages) {
|
|
7663
|
+
const normalized = normalizeCustomMessagePayload(msg);
|
|
7664
|
+
const hasExplicitAttribution =
|
|
7665
|
+
msg !== null &&
|
|
7666
|
+
typeof msg === "object" &&
|
|
7667
|
+
!Array.isArray(msg) &&
|
|
7668
|
+
(msg.attribution === "user" || msg.attribution === "agent");
|
|
7572
7669
|
messages.push(
|
|
7573
7670
|
await this.#normalizeAgentMessageImages({
|
|
7574
7671
|
role: "custom",
|
|
7575
|
-
customType:
|
|
7576
|
-
content:
|
|
7577
|
-
display:
|
|
7578
|
-
details:
|
|
7579
|
-
attribution:
|
|
7580
|
-
|
|
7672
|
+
customType: normalized.customType,
|
|
7673
|
+
content: normalized.content,
|
|
7674
|
+
display: normalized.display,
|
|
7675
|
+
details: normalized.details,
|
|
7676
|
+
attribution: hasExplicitAttribution
|
|
7677
|
+
? normalized.attribution
|
|
7678
|
+
: (promptAttribution ?? (message.role === "user" ? "user" : "agent")),
|
|
7581
7679
|
timestamp: Date.now(),
|
|
7582
7680
|
}),
|
|
7583
7681
|
);
|
|
@@ -7792,14 +7890,42 @@ export class AgentSession {
|
|
|
7792
7890
|
|
|
7793
7891
|
/**
|
|
7794
7892
|
* Queue a follow-up message to process after the agent would otherwise stop.
|
|
7893
|
+
* Set `options.synthetic` to enqueue a hidden developer message (agent-attributed
|
|
7894
|
+
* by default) instead of a user-attributed follow-up; the plan-approval flow
|
|
7895
|
+
* uses this to land its execution directive behind a queued user turn without
|
|
7896
|
+
* flipping advisor auto-resume.
|
|
7795
7897
|
*/
|
|
7796
|
-
async followUp(text: string, images?: ImageContent[]): Promise<void> {
|
|
7898
|
+
async followUp(text: string, images?: ImageContent[], options?: FollowUpOptions): Promise<void> {
|
|
7797
7899
|
if (text.startsWith("/")) {
|
|
7798
7900
|
this.#throwIfExtensionCommand(text);
|
|
7799
7901
|
}
|
|
7800
7902
|
|
|
7801
|
-
const expandedText =
|
|
7802
|
-
|
|
7903
|
+
const expandedText =
|
|
7904
|
+
options?.expandPromptTemplates === false ? text : expandPromptTemplate(text, [...this.#promptTemplates]);
|
|
7905
|
+
if (!options?.synthetic) {
|
|
7906
|
+
await this.#queueUserMessage(expandedText, images, "followUp");
|
|
7907
|
+
return;
|
|
7908
|
+
}
|
|
7909
|
+
// Synthetic branch: agent-initiated hidden developer message. Bypass
|
|
7910
|
+
// #queueUserMessage (which clears advisor auto-resume suppression and
|
|
7911
|
+
// enqueues as a user-attributed message) and place the developer message
|
|
7912
|
+
// directly on the follow-up queue.
|
|
7913
|
+
const normalizedImages = await this.#normalizeImagesForModel(images);
|
|
7914
|
+
const content: (TextContent | ImageContent)[] = [{ type: "text", text: expandedText }];
|
|
7915
|
+
if (normalizedImages?.length) {
|
|
7916
|
+
content.push(...normalizedImages);
|
|
7917
|
+
}
|
|
7918
|
+
const imageDescriptionNotice = normalizedImages?.length
|
|
7919
|
+
? await this.#buildImageDescriptionNotice(normalizedImages)
|
|
7920
|
+
: undefined;
|
|
7921
|
+
if (imageDescriptionNotice) this.agent.followUp(imageDescriptionNotice);
|
|
7922
|
+
this.agent.followUp({
|
|
7923
|
+
role: "developer",
|
|
7924
|
+
content,
|
|
7925
|
+
attribution: options.attribution ?? "agent",
|
|
7926
|
+
timestamp: Date.now(),
|
|
7927
|
+
});
|
|
7928
|
+
this.#scheduleIdleQueueDrain();
|
|
7803
7929
|
}
|
|
7804
7930
|
|
|
7805
7931
|
async #queueUserMessage(
|
|
@@ -8040,26 +8166,26 @@ export class AgentSession {
|
|
|
8040
8166
|
* use this to avoid acting on a turn that never ran.
|
|
8041
8167
|
*/
|
|
8042
8168
|
async sendCustomMessage<T = unknown>(
|
|
8043
|
-
message:
|
|
8169
|
+
message: CustomMessagePayload<T>,
|
|
8044
8170
|
options?: { triggerTurn?: boolean; deliverAs?: "steer" | "followUp" | "nextTurn"; queueChipText?: string },
|
|
8045
8171
|
): Promise<boolean> {
|
|
8172
|
+
const normalizedPayload = normalizeCustomMessagePayload<T>(message);
|
|
8046
8173
|
const details =
|
|
8047
8174
|
options?.queueChipText && options.deliverAs !== "nextTurn"
|
|
8048
8175
|
? ({
|
|
8049
|
-
...((
|
|
8050
|
-
|
|
8051
|
-
unknown
|
|
8052
|
-
>),
|
|
8176
|
+
...((normalizedPayload.details && typeof normalizedPayload.details === "object"
|
|
8177
|
+
? normalizedPayload.details
|
|
8178
|
+
: {}) as Record<string, unknown>),
|
|
8053
8179
|
__queueChipText: options.queueChipText,
|
|
8054
8180
|
} as T)
|
|
8055
|
-
:
|
|
8181
|
+
: normalizedPayload.details;
|
|
8056
8182
|
const appMessage: CustomMessage<T> = {
|
|
8057
8183
|
role: "custom",
|
|
8058
|
-
customType:
|
|
8059
|
-
content:
|
|
8060
|
-
display:
|
|
8184
|
+
customType: normalizedPayload.customType,
|
|
8185
|
+
content: normalizedPayload.content,
|
|
8186
|
+
display: normalizedPayload.display,
|
|
8061
8187
|
details,
|
|
8062
|
-
attribution:
|
|
8188
|
+
attribution: normalizedPayload.attribution,
|
|
8063
8189
|
timestamp: Date.now(),
|
|
8064
8190
|
};
|
|
8065
8191
|
const normalizedAppMessage = await this.#normalizeAgentMessageImages(appMessage);
|
|
@@ -8091,9 +8217,9 @@ export class AgentSession {
|
|
|
8091
8217
|
this.sessionManager.appendCustomMessageEntry(
|
|
8092
8218
|
normalizedAppMessage.customType,
|
|
8093
8219
|
normalizedAppMessage.content,
|
|
8094
|
-
|
|
8095
|
-
|
|
8096
|
-
|
|
8220
|
+
normalizedAppMessage.display,
|
|
8221
|
+
normalizedAppMessage.details,
|
|
8222
|
+
normalizedAppMessage.attribution,
|
|
8097
8223
|
);
|
|
8098
8224
|
return false;
|
|
8099
8225
|
}
|
|
@@ -8111,9 +8237,9 @@ export class AgentSession {
|
|
|
8111
8237
|
this.sessionManager.appendCustomMessageEntry(
|
|
8112
8238
|
normalizedAppMessage.customType,
|
|
8113
8239
|
normalizedAppMessage.content,
|
|
8114
|
-
|
|
8115
|
-
|
|
8116
|
-
|
|
8240
|
+
normalizedAppMessage.display,
|
|
8241
|
+
normalizedAppMessage.details,
|
|
8242
|
+
normalizedAppMessage.attribution,
|
|
8117
8243
|
);
|
|
8118
8244
|
return false;
|
|
8119
8245
|
}
|
|
@@ -8507,6 +8633,7 @@ export class AgentSession {
|
|
|
8507
8633
|
await this.sessionManager.flush();
|
|
8508
8634
|
}
|
|
8509
8635
|
await this.sessionManager.newSession(options);
|
|
8636
|
+
|
|
8510
8637
|
this.#clearCheckpointRuntimeState();
|
|
8511
8638
|
this.setTodoPhases([]);
|
|
8512
8639
|
this.#freshProviderSessionId = undefined;
|
|
@@ -9122,24 +9249,26 @@ export class AgentSession {
|
|
|
9122
9249
|
|
|
9123
9250
|
/**
|
|
9124
9251
|
* `/fast on|off` targets the family of the currently selected model: it sets
|
|
9125
|
-
* (or clears) that family's `priority` tier.
|
|
9126
|
-
*
|
|
9252
|
+
* (or clears) that family's `priority` tier. Returns `false` when the model
|
|
9253
|
+
* has no service-tier family, so callers can report that fast mode is
|
|
9254
|
+
* unavailable instead of claiming success.
|
|
9127
9255
|
*/
|
|
9128
|
-
setFastMode(enabled: boolean):
|
|
9256
|
+
setFastMode(enabled: boolean): boolean {
|
|
9129
9257
|
const family = this.model ? serviceTierFamily(this.model) : undefined;
|
|
9130
9258
|
if (!family) {
|
|
9131
9259
|
this.emitNotice("info", "The current model has no service-tier control for /fast to toggle.", "priority");
|
|
9132
|
-
return;
|
|
9260
|
+
return false;
|
|
9133
9261
|
}
|
|
9134
9262
|
if (!enabled) {
|
|
9135
9263
|
if (this.#serviceTierByFamily[family] === "priority") this.setServiceTierFamily(family, undefined);
|
|
9136
|
-
return;
|
|
9264
|
+
return true;
|
|
9137
9265
|
}
|
|
9138
9266
|
this.setServiceTierFamily(family, "priority");
|
|
9267
|
+
return true;
|
|
9139
9268
|
}
|
|
9140
9269
|
|
|
9141
9270
|
toggleFastMode(): boolean {
|
|
9142
|
-
this.setFastMode(!this.isFastModeEnabled());
|
|
9271
|
+
if (!this.setFastMode(!this.isFastModeEnabled())) return false;
|
|
9143
9272
|
return this.isFastModeEnabled();
|
|
9144
9273
|
}
|
|
9145
9274
|
|
|
@@ -9417,7 +9546,11 @@ export class AgentSession {
|
|
|
9417
9546
|
// Modes that produce no LLM summary (snapcompact) have nothing to focus.
|
|
9418
9547
|
// Reject focus text loudly so programmatic callers don't silently lose
|
|
9419
9548
|
// instructions (the slash path pre-validates via parseCompactArgs).
|
|
9420
|
-
|
|
9549
|
+
// `internalGuidance` counts the same way — plan-mode approval never
|
|
9550
|
+
// combines with a rejects-focus mode, but reject early if a caller ever
|
|
9551
|
+
// wires it up so we don't silently drop the directive on the snapcompact
|
|
9552
|
+
// fallback (issue #4359).
|
|
9553
|
+
if (compactMode?.rejectsFocus && (customInstructions || options?.internalGuidance)) {
|
|
9421
9554
|
throw new Error(`/compact ${compactMode.name} does not take focus instructions.`);
|
|
9422
9555
|
}
|
|
9423
9556
|
const compactionAbortController = new AbortController();
|
|
@@ -9498,12 +9631,16 @@ export class AgentSession {
|
|
|
9498
9631
|
|
|
9499
9632
|
const compactionPrep = await this.#prepareCompactionFromHooks(preparation, hookCompaction);
|
|
9500
9633
|
|
|
9501
|
-
// Strategy honored on manual /compact too. Custom instructions
|
|
9502
|
-
//
|
|
9503
|
-
//
|
|
9634
|
+
// Strategy honored on manual /compact too. Custom instructions (public
|
|
9635
|
+
// user focus OR internal plan-mode guidance) imply a directed LLM
|
|
9636
|
+
// summary; a text-only model cannot read snapcompact frames. When
|
|
9637
|
+
// snapcompact itself was requested, fail locally instead of silently
|
|
9504
9638
|
// converting the "no LLM call" path into a provider-backed summary.
|
|
9505
9639
|
const wantsSnapcompact =
|
|
9506
|
-
compactionPrep.kind !== "fromHook" &&
|
|
9640
|
+
compactionPrep.kind !== "fromHook" &&
|
|
9641
|
+
effectiveSettings.strategy === "snapcompact" &&
|
|
9642
|
+
!customInstructions &&
|
|
9643
|
+
!options?.internalGuidance;
|
|
9507
9644
|
const snapcompactReady = wantsSnapcompact;
|
|
9508
9645
|
const snapcompactShapeSetting = this.settings.get("snapcompact.shape");
|
|
9509
9646
|
let snapcompactShape: snapcompact.Shape | undefined;
|
|
@@ -9529,11 +9666,11 @@ export class AgentSession {
|
|
|
9529
9666
|
const percent = (renderScan.unrenderableRatio * 100).toFixed(1);
|
|
9530
9667
|
this.emitNotice(
|
|
9531
9668
|
"warning",
|
|
9532
|
-
`snapcompact disabled:
|
|
9669
|
+
`snapcompact disabled: unsupported characters for selected snapcompact font (${percent}%). No LLM fallback was attempted.`,
|
|
9533
9670
|
"compaction",
|
|
9534
9671
|
);
|
|
9535
9672
|
throw new Error(
|
|
9536
|
-
`snapcompact cannot render this conversation locally:
|
|
9673
|
+
`snapcompact cannot render this conversation locally: unsupported characters for selected snapcompact font (${percent}%).`,
|
|
9537
9674
|
);
|
|
9538
9675
|
}
|
|
9539
9676
|
}
|
|
@@ -9636,7 +9773,7 @@ export class AgentSession {
|
|
|
9636
9773
|
try {
|
|
9637
9774
|
const result = await this.#compactWithFallbackModel(
|
|
9638
9775
|
preparation,
|
|
9639
|
-
customInstructions,
|
|
9776
|
+
options?.internalGuidance ?? customInstructions,
|
|
9640
9777
|
compactionAbortController.signal,
|
|
9641
9778
|
{
|
|
9642
9779
|
promptOverride: this.#obfuscateTextForProvider(compactionPrep.hookPrompt),
|
|
@@ -9904,6 +10041,7 @@ export class AgentSession {
|
|
|
9904
10041
|
await this.sessionManager.flush();
|
|
9905
10042
|
this.#cancelOwnAsyncJobs();
|
|
9906
10043
|
await this.sessionManager.newSession(previousSessionFile ? { parentSession: previousSessionFile } : undefined);
|
|
10044
|
+
|
|
9907
10045
|
this.#clearCheckpointRuntimeState();
|
|
9908
10046
|
// agent.reset() clears the core steering/follow-up queues. Preserve any queued
|
|
9909
10047
|
// steers/follow-ups (RPC/SDK steer()/followUp() issued during the handoff, or a
|
|
@@ -10386,6 +10524,133 @@ export class AgentSession {
|
|
|
10386
10524
|
return undefined;
|
|
10387
10525
|
}
|
|
10388
10526
|
|
|
10527
|
+
#clearPendingRecoveredRetryErrors(): void {
|
|
10528
|
+
this.#pendingRecoveredRetryErrors = [];
|
|
10529
|
+
}
|
|
10530
|
+
|
|
10531
|
+
async #persistRetryLifecycleErrorMessage(message: AssistantMessage): Promise<void> {
|
|
10532
|
+
await this.#waitForSessionMessagePersistence(message);
|
|
10533
|
+
if (!isEmptyErrorTurn(message)) return;
|
|
10534
|
+
if (this.#sessionMessageAlreadyPersisted(message)) return;
|
|
10535
|
+
this.#appendSessionMessage(message);
|
|
10536
|
+
}
|
|
10537
|
+
|
|
10538
|
+
#retryRecoveryKind(
|
|
10539
|
+
id: number,
|
|
10540
|
+
switchedCredential: boolean,
|
|
10541
|
+
switchedModel: boolean,
|
|
10542
|
+
delayMs: number,
|
|
10543
|
+
): AssistantRetryRecoveryKind {
|
|
10544
|
+
if (switchedCredential) return "credential";
|
|
10545
|
+
if (switchedModel) return "model";
|
|
10546
|
+
if (AIError.is(id, AIError.Flag.UsageLimit) && delayMs > 0) return "wait";
|
|
10547
|
+
return "plain";
|
|
10548
|
+
}
|
|
10549
|
+
|
|
10550
|
+
#retryRecoveryNote(recovery: AssistantRetryRecoveryKind, rateLimited: boolean): string {
|
|
10551
|
+
const parts: string[] = [];
|
|
10552
|
+
if (rateLimited) {
|
|
10553
|
+
parts.push("rate-limited");
|
|
10554
|
+
} else if (recovery === "plain") {
|
|
10555
|
+
parts.push("error");
|
|
10556
|
+
}
|
|
10557
|
+
if (recovery === "credential") {
|
|
10558
|
+
parts.push("switched account");
|
|
10559
|
+
} else if (recovery === "model") {
|
|
10560
|
+
parts.push("switched model");
|
|
10561
|
+
} else if (recovery === "wait") {
|
|
10562
|
+
parts.push("waited");
|
|
10563
|
+
}
|
|
10564
|
+
parts.push("retried");
|
|
10565
|
+
return parts.join("; ");
|
|
10566
|
+
}
|
|
10567
|
+
|
|
10568
|
+
async #recordPendingRecoveredRetryError(
|
|
10569
|
+
message: AssistantMessage,
|
|
10570
|
+
id: number,
|
|
10571
|
+
options: { switchedCredential: boolean; switchedModel: boolean; delayMs: number },
|
|
10572
|
+
): Promise<void> {
|
|
10573
|
+
await this.#persistRetryLifecycleErrorMessage(message);
|
|
10574
|
+
const persistenceKey = sessionMessagePersistenceKey(message);
|
|
10575
|
+
if (!persistenceKey) return;
|
|
10576
|
+
let branchEntry: SessionEntry | undefined;
|
|
10577
|
+
for (const entry of this.sessionManager.getBranch().slice().reverse()) {
|
|
10578
|
+
if (entry.type !== "message" || entry.message.role !== "assistant") continue;
|
|
10579
|
+
if (sessionMessagePersistenceKey(entry.message) !== persistenceKey) continue;
|
|
10580
|
+
if (!sameMessageContent(entry.message, message) && !this.#isSameAssistantMessage(entry.message, message)) {
|
|
10581
|
+
continue;
|
|
10582
|
+
}
|
|
10583
|
+
branchEntry = entry;
|
|
10584
|
+
break;
|
|
10585
|
+
}
|
|
10586
|
+
if (!branchEntry) return;
|
|
10587
|
+
if (this.#pendingRecoveredRetryErrors.some(error => error.entryId === branchEntry.id)) return;
|
|
10588
|
+
const rateLimited = AIError.is(id, AIError.Flag.UsageLimit);
|
|
10589
|
+
const recovery = this.#retryRecoveryKind(id, options.switchedCredential, options.switchedModel, options.delayMs);
|
|
10590
|
+
const note = this.#retryRecoveryNote(recovery, rateLimited);
|
|
10591
|
+
this.#pendingRecoveredRetryErrors.push({
|
|
10592
|
+
entryId: branchEntry.id,
|
|
10593
|
+
persistenceKey,
|
|
10594
|
+
recovery,
|
|
10595
|
+
attempt: this.#retryAttempt,
|
|
10596
|
+
note,
|
|
10597
|
+
});
|
|
10598
|
+
}
|
|
10599
|
+
|
|
10600
|
+
async #markPendingRecoveredRetryErrors(supersedingMessage: AssistantMessage): Promise<RecoveredRetryError[]> {
|
|
10601
|
+
if (this.#pendingRecoveredRetryErrors.length === 0) return [];
|
|
10602
|
+
const branch = this.sessionManager.getBranch();
|
|
10603
|
+
const branchById = new Map<string, SessionEntry>();
|
|
10604
|
+
for (const entry of branch) {
|
|
10605
|
+
branchById.set(entry.id, entry);
|
|
10606
|
+
}
|
|
10607
|
+
const recoveredAt = new Date().toISOString();
|
|
10608
|
+
const supersededBy: AssistantRetryRecovery["supersededBy"] = {
|
|
10609
|
+
timestamp: supersedingMessage.timestamp,
|
|
10610
|
+
provider: supersedingMessage.provider,
|
|
10611
|
+
model: supersedingMessage.model,
|
|
10612
|
+
};
|
|
10613
|
+
if (supersedingMessage.responseId) {
|
|
10614
|
+
supersededBy.responseId = supersedingMessage.responseId;
|
|
10615
|
+
}
|
|
10616
|
+
const recoveredErrors: RecoveredRetryError[] = [];
|
|
10617
|
+
for (const pending of this.#pendingRecoveredRetryErrors) {
|
|
10618
|
+
let entry = branchById.get(pending.entryId);
|
|
10619
|
+
if (entry?.type !== "message" || entry.message.role !== "assistant") {
|
|
10620
|
+
entry = branch
|
|
10621
|
+
.slice()
|
|
10622
|
+
.reverse()
|
|
10623
|
+
.find(
|
|
10624
|
+
candidate =>
|
|
10625
|
+
candidate.type === "message" &&
|
|
10626
|
+
candidate.message.role === "assistant" &&
|
|
10627
|
+
sessionMessagePersistenceKey(candidate.message) === pending.persistenceKey,
|
|
10628
|
+
);
|
|
10629
|
+
}
|
|
10630
|
+
if (entry?.type !== "message" || entry.message.role !== "assistant") continue;
|
|
10631
|
+
const retryRecovery: AssistantRetryRecovery = {
|
|
10632
|
+
kind: "auto-retry",
|
|
10633
|
+
status: "recovered",
|
|
10634
|
+
attempt: pending.attempt,
|
|
10635
|
+
recoveredAt,
|
|
10636
|
+
recovery: pending.recovery,
|
|
10637
|
+
note: pending.note,
|
|
10638
|
+
supersededBy,
|
|
10639
|
+
};
|
|
10640
|
+
entry.message.retryRecovery = retryRecovery;
|
|
10641
|
+
recoveredErrors.push({
|
|
10642
|
+
entryId: entry.id,
|
|
10643
|
+
persistenceKey: pending.persistenceKey,
|
|
10644
|
+
note: retryRecovery.note,
|
|
10645
|
+
retryRecovery,
|
|
10646
|
+
});
|
|
10647
|
+
}
|
|
10648
|
+
if (recoveredErrors.length > 0) {
|
|
10649
|
+
await this.sessionManager.rewriteEntries();
|
|
10650
|
+
}
|
|
10651
|
+
return recoveredErrors;
|
|
10652
|
+
}
|
|
10653
|
+
|
|
10389
10654
|
async #handleEmptyAssistantStop(assistantMessage: AssistantMessage): Promise<boolean> {
|
|
10390
10655
|
if (!this.#isEmptyAssistantStop(assistantMessage)) {
|
|
10391
10656
|
this.#emptyStopRetryCount = 0;
|
|
@@ -10406,6 +10671,7 @@ export class AgentSession {
|
|
|
10406
10671
|
attempt: this.#retryAttempt,
|
|
10407
10672
|
finalError: "Assistant returned empty stop after retry cap",
|
|
10408
10673
|
});
|
|
10674
|
+
this.#clearPendingRecoveredRetryErrors();
|
|
10409
10675
|
this.#retryAttempt = 0;
|
|
10410
10676
|
}
|
|
10411
10677
|
this.#resolveRetry();
|
|
@@ -10593,7 +10859,7 @@ export class AgentSession {
|
|
|
10593
10859
|
}
|
|
10594
10860
|
|
|
10595
10861
|
#restoreFailedAssistantTurn(assistantMessage: AssistantMessage): void {
|
|
10596
|
-
this.sessionManager.appendMessage(assistantMessage);
|
|
10862
|
+
if (!isEmptyErrorTurn(assistantMessage)) this.sessionManager.appendMessage(assistantMessage);
|
|
10597
10863
|
const lastMessage = this.agent.state.messages.at(-1);
|
|
10598
10864
|
if (
|
|
10599
10865
|
lastMessage?.role === "assistant" &&
|
|
@@ -10696,6 +10962,7 @@ export class AgentSession {
|
|
|
10696
10962
|
});
|
|
10697
10963
|
this.sessionManager.branchWithSummary(null, report, { startedAt: checkpointState.startedAt });
|
|
10698
10964
|
}
|
|
10965
|
+
|
|
10699
10966
|
const rewoundAt = new Date().toISOString();
|
|
10700
10967
|
const details = { report, startedAt: checkpointState.startedAt, rewoundAt };
|
|
10701
10968
|
this.sessionManager.appendCustomMessageEntry(
|
|
@@ -12188,7 +12455,7 @@ export class AgentSession {
|
|
|
12188
12455
|
// + a summary message carrying the imaged archive at FRAME_TOKEN_ESTIMATE
|
|
12189
12456
|
// per frame; #computeSnapcompactMaxFrames sizes the frame cap from the
|
|
12190
12457
|
// live window so we don't run snapcompact just to overflow every threshold
|
|
12191
|
-
// tick. Any local blocker (
|
|
12458
|
+
// tick. Any local blocker (unsupported snapcompact glyphs, kept-history too large,
|
|
12192
12459
|
// post-render overflow) downgrades auto maintenance to a context-full LLM
|
|
12193
12460
|
// summary instead of wedging the session (#3659) — auto runs the default
|
|
12194
12461
|
// strategy on the user's behalf, so a fallback that lets the session keep
|
|
@@ -12210,11 +12477,11 @@ export class AgentSession {
|
|
|
12210
12477
|
const renderScan = snapcompact.scanRenderability(probeText, { shape });
|
|
12211
12478
|
if (!renderScan.isSafe) {
|
|
12212
12479
|
const percent = (renderScan.unrenderableRatio * 100).toFixed(1);
|
|
12213
|
-
logger.warn("Snapcompact disabled:
|
|
12480
|
+
logger.warn("Snapcompact disabled: unsupported characters for selected snapcompact font", {
|
|
12214
12481
|
model: this.model?.id,
|
|
12215
12482
|
unrenderableRatio: renderScan.unrenderableRatio,
|
|
12216
12483
|
});
|
|
12217
|
-
snapcompactBlocker = `snapcompact disabled:
|
|
12484
|
+
snapcompactBlocker = `snapcompact disabled: unsupported characters for selected snapcompact font (${percent}%); using context-full auto-compaction instead.`;
|
|
12218
12485
|
} else {
|
|
12219
12486
|
const maxFrames = this.#computeSnapcompactMaxFrames(preparation, compactionSettings);
|
|
12220
12487
|
if (maxFrames < 1) {
|
|
@@ -13258,6 +13525,7 @@ export class AgentSession {
|
|
|
13258
13525
|
}
|
|
13259
13526
|
|
|
13260
13527
|
if (this.#retryAttempt > retrySettings.maxRetries) {
|
|
13528
|
+
await this.#persistRetryLifecycleErrorMessage(message);
|
|
13261
13529
|
// Max retries exceeded, emit final failure and reset
|
|
13262
13530
|
await this.#emitSessionEvent({
|
|
13263
13531
|
type: "auto_retry_end",
|
|
@@ -13265,6 +13533,7 @@ export class AgentSession {
|
|
|
13265
13533
|
attempt: this.#retryAttempt - 1,
|
|
13266
13534
|
finalError: message.errorMessage,
|
|
13267
13535
|
});
|
|
13536
|
+
this.#clearPendingRecoveredRetryErrors();
|
|
13268
13537
|
this.#retryAttempt = 0;
|
|
13269
13538
|
this.#resolveRetry(); // Resolve so waitForRetry() completes
|
|
13270
13539
|
return false;
|
|
@@ -13376,6 +13645,7 @@ export class AgentSession {
|
|
|
13376
13645
|
// can act on it.
|
|
13377
13646
|
const maxDelayMs = retrySettings.maxDelayMs;
|
|
13378
13647
|
if (maxDelayMs > 0 && delayMs > maxDelayMs && !switchedCredential && !switchedModel) {
|
|
13648
|
+
await this.#persistRetryLifecycleErrorMessage(message);
|
|
13379
13649
|
const attempt = this.#retryAttempt;
|
|
13380
13650
|
this.#retryAttempt = 0;
|
|
13381
13651
|
await this.#emitSessionEvent({
|
|
@@ -13384,10 +13654,13 @@ export class AgentSession {
|
|
|
13384
13654
|
attempt,
|
|
13385
13655
|
finalError: `Provider requested ${delayMs}ms wait, exceeds retry.maxDelayMs (${maxDelayMs}ms). Original error: ${errorMessage}`,
|
|
13386
13656
|
});
|
|
13657
|
+
this.#clearPendingRecoveredRetryErrors();
|
|
13387
13658
|
this.#resolveRetry();
|
|
13388
13659
|
return false;
|
|
13389
13660
|
}
|
|
13390
13661
|
|
|
13662
|
+
await this.#recordPendingRecoveredRetryError(message, id, { switchedCredential, switchedModel, delayMs });
|
|
13663
|
+
|
|
13391
13664
|
await this.#emitSessionEvent({
|
|
13392
13665
|
type: "auto_retry_start",
|
|
13393
13666
|
attempt: this.#retryAttempt,
|
|
@@ -13425,6 +13698,7 @@ export class AgentSession {
|
|
|
13425
13698
|
attempt,
|
|
13426
13699
|
finalError: "Retry cancelled",
|
|
13427
13700
|
});
|
|
13701
|
+
this.#clearPendingRecoveredRetryErrors();
|
|
13428
13702
|
this.#resolveRetry();
|
|
13429
13703
|
return false;
|
|
13430
13704
|
}
|
|
@@ -14097,9 +14371,17 @@ export class AgentSession {
|
|
|
14097
14371
|
continue;
|
|
14098
14372
|
}
|
|
14099
14373
|
if (event.type === "done") {
|
|
14374
|
+
// A well-formed provider "done" event carries `content: AssistantContentBlock[]`,
|
|
14375
|
+
// but a proxy/wrapper (custom extension providers, gateway-wrapped OAuth streams,
|
|
14376
|
+
// see #4323) can hand back a message whose `content` was dropped or replaced with
|
|
14377
|
+
// `undefined`. Downstream `.content.filter` at the sanitize step below would then
|
|
14378
|
+
// crash the recap turn with `TypeError: undefined is not an object (evaluating
|
|
14379
|
+
// 'H.content.filter')`. Normalize to `[]` so the recap surfaces an empty reply
|
|
14380
|
+
// instead of turning a malformed side-channel response into a session-mute crash.
|
|
14381
|
+
const rawContent = Array.isArray(event.message.content) ? event.message.content : [];
|
|
14100
14382
|
assistantMessage = this.#obfuscator?.hasSecrets()
|
|
14101
|
-
? { ...event.message, content: deobfuscateAssistantContent(this.#obfuscator,
|
|
14102
|
-
: event.message;
|
|
14383
|
+
? { ...event.message, content: deobfuscateAssistantContent(this.#obfuscator, rawContent) }
|
|
14384
|
+
: { ...event.message, content: rawContent };
|
|
14103
14385
|
break;
|
|
14104
14386
|
}
|
|
14105
14387
|
if (event.type === "error") {
|
|
@@ -14133,7 +14415,7 @@ export class AgentSession {
|
|
|
14133
14415
|
#buildEphemeralSnapshot(promptText: string): AgentMessage[] {
|
|
14134
14416
|
const messages = [...this.messages];
|
|
14135
14417
|
const streaming = this.agent.state.streamMessage;
|
|
14136
|
-
if (streaming && streaming.role === "assistant") {
|
|
14418
|
+
if (streaming && streaming.role === "assistant" && Array.isArray(streaming.content)) {
|
|
14137
14419
|
const preservedBlocks: AssistantMessage["content"] = [];
|
|
14138
14420
|
// Preserve thinking blocks: DeepSeek-class encoders replay them as
|
|
14139
14421
|
// `reasoning_content` and reject the request (HTTP 400) when the field
|
|
@@ -14602,6 +14884,7 @@ export class AgentSession {
|
|
|
14602
14884
|
this.#cancelOwnAsyncJobs();
|
|
14603
14885
|
|
|
14604
14886
|
this.sessionManager.createBranchedSession(leafId);
|
|
14887
|
+
|
|
14605
14888
|
this.#rehydrateCheckpointRewindState();
|
|
14606
14889
|
this.sessionManager.appendMessage({
|
|
14607
14890
|
role: "user",
|
|
@@ -14785,6 +15068,7 @@ export class AgentSession {
|
|
|
14785
15068
|
if (summaryText) {
|
|
14786
15069
|
// Create summary at target position (can be null for root)
|
|
14787
15070
|
const summaryId = this.sessionManager.branchWithSummary(newLeafId, summaryText, summaryDetails, fromExtension);
|
|
15071
|
+
|
|
14788
15072
|
summaryEntry = this.sessionManager.getEntry(summaryId) as BranchSummaryEntry;
|
|
14789
15073
|
} else if (newLeafId === null) {
|
|
14790
15074
|
// No summary, navigating to root - reset leaf
|
|
@@ -14869,6 +15153,7 @@ export class AgentSession {
|
|
|
14869
15153
|
let totalCacheRead = 0;
|
|
14870
15154
|
let totalReasoning = 0;
|
|
14871
15155
|
let totalCacheWrite = 0;
|
|
15156
|
+
let totalTokens = 0;
|
|
14872
15157
|
let totalCost = 0;
|
|
14873
15158
|
let totalPremiumRequests = 0;
|
|
14874
15159
|
|
|
@@ -14889,6 +15174,7 @@ export class AgentSession {
|
|
|
14889
15174
|
totalReasoning += assistantMsg.usage.reasoningTokens ?? 0;
|
|
14890
15175
|
totalCacheRead += assistantMsg.usage.cacheRead;
|
|
14891
15176
|
totalCacheWrite += assistantMsg.usage.cacheWrite;
|
|
15177
|
+
totalTokens += assistantMsg.usage.totalTokens;
|
|
14892
15178
|
totalPremiumRequests += assistantMsg.usage.premiumRequests ?? 0;
|
|
14893
15179
|
totalCost += assistantMsg.usage.cost.total;
|
|
14894
15180
|
}
|
|
@@ -14901,6 +15187,7 @@ export class AgentSession {
|
|
|
14901
15187
|
totalReasoning += usage.reasoningTokens ?? 0;
|
|
14902
15188
|
totalCacheRead += usage.cacheRead;
|
|
14903
15189
|
totalCacheWrite += usage.cacheWrite;
|
|
15190
|
+
totalTokens += usage.totalTokens;
|
|
14904
15191
|
totalPremiumRequests += usage.premiumRequests ?? 0;
|
|
14905
15192
|
totalCost += usage.cost.total;
|
|
14906
15193
|
}
|
|
@@ -14921,7 +15208,7 @@ export class AgentSession {
|
|
|
14921
15208
|
reasoning: totalReasoning,
|
|
14922
15209
|
cacheRead: totalCacheRead,
|
|
14923
15210
|
cacheWrite: totalCacheWrite,
|
|
14924
|
-
total:
|
|
15211
|
+
total: totalTokens,
|
|
14925
15212
|
},
|
|
14926
15213
|
cost: totalCost,
|
|
14927
15214
|
premiumRequests: totalPremiumRequests,
|
|
@@ -15567,6 +15854,7 @@ export class AgentSession {
|
|
|
15567
15854
|
let reasoning = 0;
|
|
15568
15855
|
let cacheRead = 0;
|
|
15569
15856
|
let cacheWrite = 0;
|
|
15857
|
+
let totalTokens = 0;
|
|
15570
15858
|
let cost = 0;
|
|
15571
15859
|
let user = 0;
|
|
15572
15860
|
let assistant = 0;
|
|
@@ -15580,6 +15868,7 @@ export class AgentSession {
|
|
|
15580
15868
|
reasoning += assistantMsg.usage.reasoningTokens ?? 0;
|
|
15581
15869
|
cacheRead += assistantMsg.usage.cacheRead;
|
|
15582
15870
|
cacheWrite += assistantMsg.usage.cacheWrite;
|
|
15871
|
+
totalTokens += assistantMsg.usage.totalTokens;
|
|
15583
15872
|
cost += assistantMsg.usage.cost.total;
|
|
15584
15873
|
}
|
|
15585
15874
|
}
|
|
@@ -15588,7 +15877,7 @@ export class AgentSession {
|
|
|
15588
15877
|
model,
|
|
15589
15878
|
contextWindow: model.contextWindow ?? 0,
|
|
15590
15879
|
contextTokens,
|
|
15591
|
-
tokens: { input, output, reasoning, cacheRead, cacheWrite, total:
|
|
15880
|
+
tokens: { input, output, reasoning, cacheRead, cacheWrite, total: totalTokens },
|
|
15592
15881
|
cost,
|
|
15593
15882
|
messages: { user, assistant, total: messages.length },
|
|
15594
15883
|
};
|