@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
package/src/session/messages.ts
CHANGED
|
@@ -37,6 +37,23 @@ export const SKILL_PROMPT_MESSAGE_TYPE = "skill-prompt";
|
|
|
37
37
|
export const LSP_LATE_DIAGNOSTIC_MESSAGE_TYPE = "lsp-late-diagnostic";
|
|
38
38
|
export const BACKGROUND_TAN_DISPATCH_MESSAGE_TYPE = "background-tan-dispatch";
|
|
39
39
|
|
|
40
|
+
/** Fallback type for extension-injected messages that omit a custom type. */
|
|
41
|
+
export const DEFAULT_CUSTOM_MESSAGE_TYPE = "custom-message";
|
|
42
|
+
|
|
43
|
+
/** Content shape accepted for extension-injected messages. */
|
|
44
|
+
export type CustomMessageContent = string | (TextContent | ImageContent)[];
|
|
45
|
+
|
|
46
|
+
/** Public input accepted by `pi.sendMessage` and `AgentSession.sendCustomMessage`. */
|
|
47
|
+
export type CustomMessagePayload<T = unknown> =
|
|
48
|
+
| string
|
|
49
|
+
| Partial<Pick<CustomMessage<T>, "customType" | "content" | "display" | "details" | "attribution">>;
|
|
50
|
+
|
|
51
|
+
/** Custom message payload after applying runtime defaults. */
|
|
52
|
+
export type NormalizedCustomMessagePayload<T = unknown> = Pick<
|
|
53
|
+
CustomMessage<T>,
|
|
54
|
+
"customType" | "content" | "display" | "details" | "attribution"
|
|
55
|
+
>;
|
|
56
|
+
|
|
40
57
|
/** Custom message type for hidden interrupted-thinking continuity context. */
|
|
41
58
|
export const INTERRUPTED_THINKING_MESSAGE_TYPE = "interrupted-thinking";
|
|
42
59
|
|
|
@@ -183,6 +200,33 @@ export function shouldRenderAbortReason(message: Pick<AssistantMessage, "errorId
|
|
|
183
200
|
return !isSilentAbort(message) && !isUserInterruptAbort(message);
|
|
184
201
|
}
|
|
185
202
|
|
|
203
|
+
/** A provider-rejection turn carrying nothing but the error flag: stopReason
|
|
204
|
+
* "error" with no text, thinking, or tool calls — e.g. a request the provider
|
|
205
|
+
* rejected before any output (an oversized 413 payload). Persisting it writes an
|
|
206
|
+
* empty assistant turn that replays on reload and re-sends the rejected context;
|
|
207
|
+
* the error is surfaced live (pinned) instead. A turn that streamed partial text,
|
|
208
|
+
* reasoning, or tool calls is NOT empty and stays in history. */
|
|
209
|
+
export function isEmptyErrorTurn(message: Pick<AssistantMessage, "stopReason" | "content">): boolean {
|
|
210
|
+
if (message.stopReason !== "error") return false;
|
|
211
|
+
return !message.content.some(block => {
|
|
212
|
+
switch (block.type) {
|
|
213
|
+
case "text":
|
|
214
|
+
return block.text.trim().length > 0;
|
|
215
|
+
case "thinking":
|
|
216
|
+
return block.thinking.trim().length > 0 || (block.thinkingSignature?.trim().length ?? 0) > 0;
|
|
217
|
+
case "redactedThinking":
|
|
218
|
+
return block.data.trim().length > 0;
|
|
219
|
+
case "toolCall":
|
|
220
|
+
return true;
|
|
221
|
+
case "fallback":
|
|
222
|
+
return false;
|
|
223
|
+
// Unknown/new block kinds count as content: never silently discard a turn.
|
|
224
|
+
default:
|
|
225
|
+
return true;
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
|
|
186
230
|
/** Sentinel `errorMessage` the agent stamps on any abort that carried no custom
|
|
187
231
|
* reason (bare `abort()`). Renderers treat it as "no specific reason given". */
|
|
188
232
|
export const GENERIC_ABORT_SENTINEL = "Request was aborted";
|
|
@@ -248,6 +292,59 @@ export function stripInternalDetailsFields<T>(details: T | undefined): T | undef
|
|
|
248
292
|
return cleaned as T;
|
|
249
293
|
}
|
|
250
294
|
|
|
295
|
+
/** True when a persisted or extension-supplied value can be sent as custom-message content. */
|
|
296
|
+
export function isCustomMessageContent(content: unknown): content is CustomMessageContent {
|
|
297
|
+
return typeof content === "string" || Array.isArray(content);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
function normalizeCustomMessageContent(content: unknown): CustomMessageContent {
|
|
301
|
+
return isCustomMessageContent(content) ? content : "";
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
function normalizeCustomMessageType(customType: unknown): string {
|
|
305
|
+
return typeof customType === "string" && customType.length > 0 ? customType : DEFAULT_CUSTOM_MESSAGE_TYPE;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
function normalizeCustomMessageAttribution(attribution: unknown): MessageAttribution {
|
|
309
|
+
return attribution === "user" ? "user" : "agent";
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
function isCustomMessagePayloadObject<T>(
|
|
313
|
+
payload: unknown,
|
|
314
|
+
): payload is Partial<Pick<CustomMessage<T>, "customType" | "content" | "display" | "details" | "attribution">> {
|
|
315
|
+
return payload !== null && typeof payload === "object" && !Array.isArray(payload);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/** Normalizes extension-provided custom message input before it reaches session state or disk. */
|
|
319
|
+
export function normalizeCustomMessagePayload<T = unknown>(
|
|
320
|
+
payload: CustomMessagePayload<T> | unknown,
|
|
321
|
+
): NormalizedCustomMessagePayload<T> {
|
|
322
|
+
if (typeof payload === "string") {
|
|
323
|
+
return {
|
|
324
|
+
customType: DEFAULT_CUSTOM_MESSAGE_TYPE,
|
|
325
|
+
content: payload,
|
|
326
|
+
display: true,
|
|
327
|
+
attribution: "agent",
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
if (!isCustomMessagePayloadObject<T>(payload)) {
|
|
331
|
+
const content = payload === undefined || payload === null ? "" : String(payload);
|
|
332
|
+
return {
|
|
333
|
+
customType: DEFAULT_CUSTOM_MESSAGE_TYPE,
|
|
334
|
+
content,
|
|
335
|
+
display: content.length > 0,
|
|
336
|
+
attribution: "agent",
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
return {
|
|
340
|
+
customType: normalizeCustomMessageType(payload.customType),
|
|
341
|
+
content: normalizeCustomMessageContent(payload.content),
|
|
342
|
+
display: typeof payload.display === "boolean" ? payload.display : false,
|
|
343
|
+
details: payload.details,
|
|
344
|
+
attribution: normalizeCustomMessageAttribution(payload.attribution),
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
|
|
251
348
|
function isSteeringUserMessage(message: AgentMessage | undefined): message is UserMessage & { steering: true } {
|
|
252
349
|
return message?.role === "user" && message.steering === true;
|
|
253
350
|
}
|
|
@@ -454,7 +551,7 @@ export interface PythonExecutionMessage {
|
|
|
454
551
|
export interface CustomMessage<T = unknown> {
|
|
455
552
|
role: "custom";
|
|
456
553
|
customType: string;
|
|
457
|
-
content:
|
|
554
|
+
content: CustomMessageContent;
|
|
458
555
|
display: boolean;
|
|
459
556
|
details?: T;
|
|
460
557
|
/** Who initiated this message for billing/attribution semantics. */
|
|
@@ -468,7 +565,7 @@ export interface CustomMessage<T = unknown> {
|
|
|
468
565
|
export interface HookMessage<T = unknown> {
|
|
469
566
|
role: "hookMessage";
|
|
470
567
|
customType: string;
|
|
471
|
-
content:
|
|
568
|
+
content: CustomMessageContent;
|
|
472
569
|
display: boolean;
|
|
473
570
|
details?: T;
|
|
474
571
|
/** Who initiated this message for billing/attribution semantics. */
|
|
@@ -592,6 +689,7 @@ function isUserInvokedSkillPrompt(message: CustomMessage): boolean {
|
|
|
592
689
|
}
|
|
593
690
|
|
|
594
691
|
function convertImageBearingCustomMessage(message: CustomMessage | HookMessage): Message[] | undefined {
|
|
692
|
+
if (!isCustomMessageContent(message.content)) return undefined;
|
|
595
693
|
if (typeof message.content === "string") return undefined;
|
|
596
694
|
const textBlocks = message.content.filter((content): content is TextContent => content.type === "text");
|
|
597
695
|
const imageBlocks = message.content.filter((content): content is ImageContent => content.type === "image");
|
|
@@ -690,6 +788,7 @@ export function convertToLlm(messages: AgentMessage[]): Message[] {
|
|
|
690
788
|
return out;
|
|
691
789
|
}
|
|
692
790
|
case "custom": {
|
|
791
|
+
if (!isCustomMessageContent(m.content)) return [];
|
|
693
792
|
if (isUserInvokedSkillPrompt(m)) {
|
|
694
793
|
return [
|
|
695
794
|
{
|
|
@@ -706,6 +805,7 @@ export function convertToLlm(messages: AgentMessage[]): Message[] {
|
|
|
706
805
|
return converted ? [converted] : [];
|
|
707
806
|
}
|
|
708
807
|
case "hookMessage": {
|
|
808
|
+
if (!isCustomMessageContent(m.content)) return [];
|
|
709
809
|
const split = convertImageBearingCustomMessage(m);
|
|
710
810
|
if (split) return split;
|
|
711
811
|
const converted = convertMessageToLlm(m);
|
|
@@ -1,9 +1,59 @@
|
|
|
1
1
|
import type { AgentMessage } from "@oh-my-pi/pi-agent-core";
|
|
2
2
|
import { coerceServiceTierByFamily, type ProviderPayload, type ServiceTierByFamily } from "@oh-my-pi/pi-ai";
|
|
3
3
|
import * as snapcompact from "@oh-my-pi/snapcompact";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
createBranchSummaryMessage,
|
|
6
|
+
createCompactionSummaryMessage,
|
|
7
|
+
createCustomMessage,
|
|
8
|
+
isCustomMessageContent,
|
|
9
|
+
normalizeCustomMessagePayload,
|
|
10
|
+
} from "./messages";
|
|
5
11
|
import { type CompactionEntry, EPHEMERAL_MODEL_CHANGE_ROLE, type SessionEntry } from "./session-entries";
|
|
6
12
|
|
|
13
|
+
// #4470 crash artifacts had legacy frames (no shape metadata) with 17 frames,
|
|
14
|
+
// ~306k archive chars, and ~1.5M truncated chars. Current snapcompact frames
|
|
15
|
+
// carry shape metadata; only legacy archives with frame payload risk get this
|
|
16
|
+
// conservative LLM-payload guard, and transcript rendering remains intact.
|
|
17
|
+
const LEGACY_SNAPCOMPACT_FRAME_COUNT_GUARD = 16;
|
|
18
|
+
const LEGACY_SNAPCOMPACT_ARCHIVE_TEXT_GUARD = 250_000;
|
|
19
|
+
const LEGACY_SNAPCOMPACT_TRUNCATED_CHARS_GUARD = 1_000_000;
|
|
20
|
+
|
|
21
|
+
function hasLegacySnapcompactFrames(archive: snapcompact.Archive): boolean {
|
|
22
|
+
return archive.frames.some(frame => frame.font === undefined && frame.variant === undefined);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function hasCrashRiskSnapcompactFramePayload(archive: snapcompact.Archive): boolean {
|
|
26
|
+
return (
|
|
27
|
+
archive.frames.length >= LEGACY_SNAPCOMPACT_FRAME_COUNT_GUARD ||
|
|
28
|
+
snapcompact.frameDataBytes(archive.frames) >= snapcompact.FRAME_DATA_BYTES_BUDGET
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function hasCrashRiskSnapcompactArchiveSize(archive: snapcompact.Archive): boolean {
|
|
33
|
+
return (
|
|
34
|
+
archive.frames.length >= LEGACY_SNAPCOMPACT_FRAME_COUNT_GUARD ||
|
|
35
|
+
archive.truncatedChars >= LEGACY_SNAPCOMPACT_TRUNCATED_CHARS_GUARD ||
|
|
36
|
+
(snapcompact.archiveSourceText(archive)?.length ?? 0) >= LEGACY_SNAPCOMPACT_ARCHIVE_TEXT_GUARD
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function isCrashRiskLegacySnapcompactArchive(archive: snapcompact.Archive): boolean {
|
|
41
|
+
return (
|
|
42
|
+
hasLegacySnapcompactFrames(archive) &&
|
|
43
|
+
hasCrashRiskSnapcompactFramePayload(archive) &&
|
|
44
|
+
hasCrashRiskSnapcompactArchiveSize(archive)
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function snapcompactHistoryBlockOptions(
|
|
49
|
+
archive: snapcompact.Archive,
|
|
50
|
+
options: BuildSessionContextOptions | undefined,
|
|
51
|
+
): snapcompact.HistoryBlockOptions | undefined {
|
|
52
|
+
if (options?.transcript) return undefined;
|
|
53
|
+
if (isCrashRiskLegacySnapcompactArchive(archive)) return { maxFrameDataBytes: 0 };
|
|
54
|
+
return { maxFrameDataBytes: snapcompact.FRAME_DATA_BYTES_BUDGET };
|
|
55
|
+
}
|
|
56
|
+
|
|
7
57
|
export interface SessionContext {
|
|
8
58
|
messages: AgentMessage[];
|
|
9
59
|
thinkingLevel?: string;
|
|
@@ -82,10 +132,7 @@ function snapcompactHistoryBlocksForContext(
|
|
|
82
132
|
options: BuildSessionContextOptions | undefined,
|
|
83
133
|
) {
|
|
84
134
|
if (!archive) return undefined;
|
|
85
|
-
return snapcompact.historyBlocks(
|
|
86
|
-
archive,
|
|
87
|
-
options?.transcript ? undefined : { maxFrameDataBytes: snapcompact.FRAME_DATA_BYTES_BUDGET },
|
|
88
|
-
);
|
|
135
|
+
return snapcompact.historyBlocks(archive, snapcompactHistoryBlockOptions(archive, options));
|
|
89
136
|
}
|
|
90
137
|
|
|
91
138
|
export function buildSessionContext(
|
|
@@ -251,16 +298,26 @@ export function buildSessionContext(
|
|
|
251
298
|
const appendMessage = (entry: SessionEntry) => {
|
|
252
299
|
handleEntryResetTracking(entry);
|
|
253
300
|
if (entry.type === "message") {
|
|
301
|
+
if (
|
|
302
|
+
!options?.transcript &&
|
|
303
|
+
entry.message.role === "assistant" &&
|
|
304
|
+
entry.message.retryRecovery?.status === "recovered"
|
|
305
|
+
) {
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
254
308
|
pushMessage(entry.message);
|
|
255
309
|
} else if (entry.type === "custom_message") {
|
|
310
|
+
if (!isCustomMessageContent(entry.content)) return;
|
|
311
|
+
const normalized = normalizeCustomMessagePayload(entry);
|
|
312
|
+
const attribution = entry.attribution === undefined ? undefined : normalized.attribution;
|
|
256
313
|
pushMessage(
|
|
257
314
|
createCustomMessage(
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
315
|
+
normalized.customType,
|
|
316
|
+
normalized.content,
|
|
317
|
+
normalized.display,
|
|
318
|
+
normalized.details,
|
|
262
319
|
entry.timestamp,
|
|
263
|
-
|
|
320
|
+
attribution,
|
|
264
321
|
),
|
|
265
322
|
);
|
|
266
323
|
} else if (entry.type === "branch_summary" && entry.summary) {
|
|
@@ -236,6 +236,10 @@ export interface UsageStatistics {
|
|
|
236
236
|
output: number;
|
|
237
237
|
cacheRead: number;
|
|
238
238
|
cacheWrite: number;
|
|
239
|
+
totalTokens: number;
|
|
240
|
+
orchestrationInput: number;
|
|
241
|
+
orchestrationOutput: number;
|
|
242
|
+
orchestrationCacheRead: number;
|
|
239
243
|
premiumRequests: number;
|
|
240
244
|
cost: number;
|
|
241
245
|
}
|
|
@@ -229,6 +229,11 @@ function executionLine(
|
|
|
229
229
|
*/
|
|
230
230
|
export const PRIMARY_CONTEXT_CUSTOM_TYPES: ReadonlySet<string> = new Set(["plan-mode-context", "plan-mode-reference"]);
|
|
231
231
|
|
|
232
|
+
/** Hidden non-primary custom messages whose content is needed to understand visible transcript entries. */
|
|
233
|
+
const CONTEXTUAL_NON_PRIMARY_HIDDEN_CUSTOM_TYPES: Record<string, true> = {
|
|
234
|
+
"image-attachment-description": true,
|
|
235
|
+
};
|
|
236
|
+
|
|
232
237
|
/** One-liner for custom/hook messages: `[irc] A → B: body…`. */
|
|
233
238
|
function customOneLiner(msg: CustomMessage | HookMessage): string {
|
|
234
239
|
const details = (msg.details ?? {}) as Record<string, unknown>;
|
|
@@ -355,6 +360,13 @@ export function formatSessionHistoryMarkdown(messages: unknown[], opts?: History
|
|
|
355
360
|
case "custom":
|
|
356
361
|
case "hookMessage": {
|
|
357
362
|
const custom = msg as CustomMessage | HookMessage;
|
|
363
|
+
if (
|
|
364
|
+
custom.display === false &&
|
|
365
|
+
!PRIMARY_CONTEXT_CUSTOM_TYPES.has(custom.customType) &&
|
|
366
|
+
CONTEXTUAL_NON_PRIMARY_HIDDEN_CUSTOM_TYPES[custom.customType] !== true
|
|
367
|
+
) {
|
|
368
|
+
break;
|
|
369
|
+
}
|
|
358
370
|
if (opts?.expandPrimaryContext && PRIMARY_CONTEXT_CUSTOM_TYPES.has(custom.customType)) {
|
|
359
371
|
const text = contentToText(custom.content).trim();
|
|
360
372
|
if (text) {
|
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
type CustomMessage,
|
|
25
25
|
type FileMentionMessage,
|
|
26
26
|
type HookMessage,
|
|
27
|
+
normalizeCustomMessagePayload,
|
|
27
28
|
type PythonExecutionMessage,
|
|
28
29
|
sanitizeRehydratedOpenAIResponsesAssistantMessage,
|
|
29
30
|
stripInternalDetailsFields,
|
|
@@ -73,6 +74,7 @@ import {
|
|
|
73
74
|
import { type SessionTitleUpdate, serializeTitleSlot } from "./session-title-slot";
|
|
74
75
|
|
|
75
76
|
const JSONL_SUFFIX_LENGTH = ".jsonl".length;
|
|
77
|
+
const DRAFT_ONLY_SESSION_MARKER = ".draft-only-session";
|
|
76
78
|
const SUPERSEDED_COMPACTION_SUMMARY = "[Superseded compaction summary elided after a newer compaction]";
|
|
77
79
|
const SUPERSEDED_COMPACTION_SHORT_SUMMARY = "Superseded compaction elided";
|
|
78
80
|
|
|
@@ -114,7 +116,18 @@ function resolveBreadcrumbToInteractiveRoot(sessionFile: string): string {
|
|
|
114
116
|
}
|
|
115
117
|
|
|
116
118
|
function emptyUsageStatistics(): UsageStatistics {
|
|
117
|
-
return {
|
|
119
|
+
return {
|
|
120
|
+
input: 0,
|
|
121
|
+
output: 0,
|
|
122
|
+
cacheRead: 0,
|
|
123
|
+
cacheWrite: 0,
|
|
124
|
+
totalTokens: 0,
|
|
125
|
+
orchestrationInput: 0,
|
|
126
|
+
orchestrationOutput: 0,
|
|
127
|
+
orchestrationCacheRead: 0,
|
|
128
|
+
premiumRequests: 0,
|
|
129
|
+
cost: 0,
|
|
130
|
+
};
|
|
118
131
|
}
|
|
119
132
|
|
|
120
133
|
function taskUsageFrom(details: unknown): Usage | undefined {
|
|
@@ -137,6 +150,10 @@ function addUsage(target: UsageStatistics, usage: Usage | undefined): void {
|
|
|
137
150
|
target.output += usage.output;
|
|
138
151
|
target.cacheRead += usage.cacheRead;
|
|
139
152
|
target.cacheWrite += usage.cacheWrite;
|
|
153
|
+
target.totalTokens += usage.totalTokens;
|
|
154
|
+
target.orchestrationInput += usage.orchestration?.input ?? 0;
|
|
155
|
+
target.orchestrationOutput += usage.orchestration?.output ?? 0;
|
|
156
|
+
target.orchestrationCacheRead += usage.orchestration?.cacheRead ?? 0;
|
|
140
157
|
target.premiumRequests += usage.premiumRequests ?? 0;
|
|
141
158
|
target.cost += usage.cost.total;
|
|
142
159
|
}
|
|
@@ -145,6 +162,25 @@ function isAssistantEntry(entry: SessionEntry): boolean {
|
|
|
145
162
|
return entry.type === "message" && entry.message.role === "assistant";
|
|
146
163
|
}
|
|
147
164
|
|
|
165
|
+
function isDraftOnlyMetadataEntry(entry: SessionEntry): boolean {
|
|
166
|
+
// Startup-recorded selector state that does not survive as user intent
|
|
167
|
+
// once the draft is cleared. `mode_change` covers the `plan.defaultOnStartup`
|
|
168
|
+
// path (interactive-mode.ts enters plan mode before draft restoration) and
|
|
169
|
+
// `/plan` toggles that leave the session otherwise empty; entries carrying
|
|
170
|
+
// real conversation state — messages, compactions, branch summaries,
|
|
171
|
+
// custom/custom_message, session_init, labels, title/tool selection — never
|
|
172
|
+
// reach this branch and always keep the file resumable.
|
|
173
|
+
switch (entry.type) {
|
|
174
|
+
case "model_change":
|
|
175
|
+
case "thinking_level_change":
|
|
176
|
+
case "service_tier_change":
|
|
177
|
+
case "mode_change":
|
|
178
|
+
return true;
|
|
179
|
+
default:
|
|
180
|
+
return false;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
148
184
|
function orderedByTimestamp(a: SessionTreeNode, b: SessionTreeNode): number {
|
|
149
185
|
return new Date(a.entry.timestamp).getTime() - new Date(b.entry.timestamp).getTime();
|
|
150
186
|
}
|
|
@@ -317,6 +353,7 @@ interface SessionManagerStateSnapshot {
|
|
|
317
353
|
hasTitleSlot: boolean;
|
|
318
354
|
onDisk: boolean;
|
|
319
355
|
needsRewrite: boolean;
|
|
356
|
+
draftOnlySessionCleanupArmed: boolean;
|
|
320
357
|
header: SessionHeader;
|
|
321
358
|
entries: SessionEntry[];
|
|
322
359
|
}
|
|
@@ -363,6 +400,12 @@ export class SessionManager {
|
|
|
363
400
|
#rewriteRequired = false;
|
|
364
401
|
/** Lazy gate crossed (ensureOnDisk / loaded file): every entry must persist from now on. */
|
|
365
402
|
#forceFileCreation = false;
|
|
403
|
+
/**
|
|
404
|
+
* Armed only when this manager observed a draft sidecar lifecycle that
|
|
405
|
+
* materialized an otherwise metadata-only session file. Explicit
|
|
406
|
+
* ensureOnDisk() callers (ACP session/new, handoff) must survive close().
|
|
407
|
+
*/
|
|
408
|
+
#draftOnlySessionCleanupArmed = false;
|
|
366
409
|
|
|
367
410
|
/**
|
|
368
411
|
* Collab replication tap: invoked for every appended entry with the
|
|
@@ -748,6 +791,7 @@ export class SessionManager {
|
|
|
748
791
|
this.#fileIsCurrent = false;
|
|
749
792
|
this.#rewriteRequired = false;
|
|
750
793
|
this.#forceFileCreation = false;
|
|
794
|
+
this.#draftOnlySessionCleanupArmed = false;
|
|
751
795
|
this.#turnBudgetTotal = null;
|
|
752
796
|
this.#turnBudgetHard = false;
|
|
753
797
|
this.#turnOutputBaseline = 0;
|
|
@@ -800,6 +844,32 @@ export class SessionManager {
|
|
|
800
844
|
return artifactsDir ? path.join(artifactsDir, "draft.txt") : null;
|
|
801
845
|
}
|
|
802
846
|
|
|
847
|
+
#draftOnlySessionMarkerPath(): string | null {
|
|
848
|
+
const artifactsDir = this.getArtifactsDir();
|
|
849
|
+
return artifactsDir ? path.join(artifactsDir, DRAFT_ONLY_SESSION_MARKER) : null;
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
#hasDraftOnlySessionMarker(): boolean {
|
|
853
|
+
const markerPath = this.#draftOnlySessionMarkerPath();
|
|
854
|
+
return markerPath !== null && this.#storage.existsSync(markerPath);
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
async #writeDraftOnlySessionMarker(): Promise<void> {
|
|
858
|
+
const markerPath = this.#draftOnlySessionMarkerPath();
|
|
859
|
+
if (!markerPath) return;
|
|
860
|
+
await this.#storage.writeText(markerPath, "");
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
async #clearDraftOnlySessionMarker(): Promise<void> {
|
|
864
|
+
const markerPath = this.#draftOnlySessionMarkerPath();
|
|
865
|
+
if (!markerPath) return;
|
|
866
|
+
try {
|
|
867
|
+
await this.#storage.unlink(markerPath);
|
|
868
|
+
} catch (err) {
|
|
869
|
+
if (!isEnoent(err)) throw err;
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
|
|
803
873
|
#artifactManagerForSession(): ArtifactManager | null {
|
|
804
874
|
if (this.#adoptedArtifactManager) return this.#adoptedArtifactManager;
|
|
805
875
|
|
|
@@ -856,6 +926,7 @@ export class SessionManager {
|
|
|
856
926
|
sessionFile: this.#sessionFile,
|
|
857
927
|
onDisk: this.#fileIsCurrent,
|
|
858
928
|
needsRewrite: this.#rewriteRequired,
|
|
929
|
+
draftOnlySessionCleanupArmed: this.#draftOnlySessionCleanupArmed,
|
|
859
930
|
// Snapshot header + entries by reference: switch/reload replaces the
|
|
860
931
|
// active header/array wholesale, so rollback needs no deep clone.
|
|
861
932
|
header: this.#header,
|
|
@@ -874,6 +945,7 @@ export class SessionManager {
|
|
|
874
945
|
this.#fileIsCurrent = snapshot.onDisk;
|
|
875
946
|
this.#rewriteRequired = snapshot.needsRewrite;
|
|
876
947
|
this.#forceFileCreation = snapshot.onDisk;
|
|
948
|
+
this.#draftOnlySessionCleanupArmed = snapshot.draftOnlySessionCleanupArmed;
|
|
877
949
|
this.#applyEntries(snapshot.header, [...snapshot.entries]);
|
|
878
950
|
this.#sessionName = snapshot.sessionName;
|
|
879
951
|
this.#titleSource = snapshot.titleSource;
|
|
@@ -890,6 +962,7 @@ export class SessionManager {
|
|
|
890
962
|
async setSessionFile(sessionFile: string): Promise<void> {
|
|
891
963
|
await this.#drainAndCloseWriter();
|
|
892
964
|
this.#clearDiskError();
|
|
965
|
+
this.#draftOnlySessionCleanupArmed = false;
|
|
893
966
|
|
|
894
967
|
const resolvedSessionFile = path.resolve(sessionFile);
|
|
895
968
|
this.#sessionFile = resolvedSessionFile;
|
|
@@ -985,6 +1058,7 @@ export class SessionManager {
|
|
|
985
1058
|
this.#fileIsCurrent = false;
|
|
986
1059
|
this.#rewriteRequired = false;
|
|
987
1060
|
this.#forceFileCreation = true;
|
|
1061
|
+
this.#draftOnlySessionCleanupArmed = false;
|
|
988
1062
|
this.#artifactManager = null;
|
|
989
1063
|
this.#artifactManagerSessionFile = null;
|
|
990
1064
|
this.#rememberBreadcrumb(this.#cwd, this.#sessionFile);
|
|
@@ -1134,6 +1208,38 @@ export class SessionManager {
|
|
|
1134
1208
|
if (this.#diskFailure) throw this.#diskFailure;
|
|
1135
1209
|
}
|
|
1136
1210
|
|
|
1211
|
+
/**
|
|
1212
|
+
* Drop only session files that this manager saw materialized for a draft and
|
|
1213
|
+
* that still contain no durable conversation or extension state. Explicit
|
|
1214
|
+
* ensureOnDisk() records (ACP session/new, handoff) stay resumable.
|
|
1215
|
+
*/
|
|
1216
|
+
async #dropIfEmptyAndNoDraft(): Promise<void> {
|
|
1217
|
+
if (!this.#draftOnlySessionCleanupArmed) return;
|
|
1218
|
+
const sessionFile = this.#sessionFile;
|
|
1219
|
+
if (!sessionFile || !this.#storage.existsSync(sessionFile)) {
|
|
1220
|
+
this.#draftOnlySessionCleanupArmed = false;
|
|
1221
|
+
return;
|
|
1222
|
+
}
|
|
1223
|
+
const draftPath = this.#draftPath();
|
|
1224
|
+
if (draftPath && this.#storage.existsSync(draftPath)) return;
|
|
1225
|
+
if (!this.#entries.every(isDraftOnlyMetadataEntry)) {
|
|
1226
|
+
await this.#clearDraftOnlySessionMarker();
|
|
1227
|
+
this.#draftOnlySessionCleanupArmed = false;
|
|
1228
|
+
return;
|
|
1229
|
+
}
|
|
1230
|
+
try {
|
|
1231
|
+
await this.#storage.deleteSessionWithArtifacts(sessionFile);
|
|
1232
|
+
this.#fileIsCurrent = false;
|
|
1233
|
+
this.#forceFileCreation = false;
|
|
1234
|
+
this.#hasTitleSlot = false;
|
|
1235
|
+
this.#draftOnlySessionCleanupArmed = false;
|
|
1236
|
+
} catch (err) {
|
|
1237
|
+
if (!isEnoent(err)) {
|
|
1238
|
+
logger.warn("Failed to drop empty session on close", { sessionFile, error: String(err) });
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1137
1243
|
/** Flush, then close the append writer. */
|
|
1138
1244
|
async close(): Promise<void> {
|
|
1139
1245
|
if (!this.#persist) return;
|
|
@@ -1143,6 +1249,7 @@ export class SessionManager {
|
|
|
1143
1249
|
if (hadWriter || (this.#sessionFile && this.#storage.existsSync(this.#sessionFile)))
|
|
1144
1250
|
this.#fileIsCurrent = true;
|
|
1145
1251
|
});
|
|
1252
|
+
await this.#dropIfEmptyAndNoDraft();
|
|
1146
1253
|
// Wait for any queued backing writes (IndexedSessionStorage per-path
|
|
1147
1254
|
// tail) to become durable so a graceful shutdown does not exit while
|
|
1148
1255
|
// a fire-and-forget publish is still on the wire.
|
|
@@ -1235,8 +1342,17 @@ export class SessionManager {
|
|
|
1235
1342
|
return;
|
|
1236
1343
|
}
|
|
1237
1344
|
|
|
1345
|
+
const sessionFile = this.#sessionFile;
|
|
1346
|
+
const draftWillMaterializeMetadataOnlyFile =
|
|
1347
|
+
sessionFile !== undefined &&
|
|
1348
|
+
!this.#storage.existsSync(sessionFile) &&
|
|
1349
|
+
this.#entries.every(isDraftOnlyMetadataEntry);
|
|
1238
1350
|
// Force the header onto disk so resume can find the file this draft attaches to.
|
|
1239
1351
|
await this.ensureOnDisk();
|
|
1352
|
+
if (draftWillMaterializeMetadataOnlyFile) {
|
|
1353
|
+
await this.#writeDraftOnlySessionMarker();
|
|
1354
|
+
this.#draftOnlySessionCleanupArmed = true;
|
|
1355
|
+
}
|
|
1240
1356
|
await this.#storage.writeText(draftPath, text);
|
|
1241
1357
|
}
|
|
1242
1358
|
|
|
@@ -1257,6 +1373,8 @@ export class SessionManager {
|
|
|
1257
1373
|
} catch (err) {
|
|
1258
1374
|
if (!isEnoent(err)) throw err;
|
|
1259
1375
|
}
|
|
1376
|
+
if (this.#entries.every(isDraftOnlyMetadataEntry) && this.#hasDraftOnlySessionMarker())
|
|
1377
|
+
this.#draftOnlySessionCleanupArmed = true;
|
|
1260
1378
|
|
|
1261
1379
|
return draft;
|
|
1262
1380
|
}
|
|
@@ -1450,20 +1568,21 @@ export class SessionManager {
|
|
|
1450
1568
|
* @param attribution Who initiated this message for billing/attribution semantics
|
|
1451
1569
|
*/
|
|
1452
1570
|
appendCustomMessageEntry<T = unknown>(
|
|
1453
|
-
customType: string,
|
|
1454
|
-
content: string | (TextContent | ImageContent)[],
|
|
1455
|
-
display: boolean,
|
|
1571
|
+
customType: string | undefined,
|
|
1572
|
+
content: string | (TextContent | ImageContent)[] | undefined,
|
|
1573
|
+
display: boolean | undefined,
|
|
1456
1574
|
details?: T,
|
|
1457
|
-
attribution: MessageAttribution = "agent",
|
|
1575
|
+
attribution: MessageAttribution | undefined = "agent",
|
|
1458
1576
|
): string {
|
|
1577
|
+
const normalized = normalizeCustomMessagePayload<T>({ customType, content, display, details, attribution });
|
|
1459
1578
|
const entry: CustomMessageEntry<T> = {
|
|
1460
1579
|
type: "custom_message",
|
|
1461
|
-
customType,
|
|
1462
|
-
content,
|
|
1463
|
-
display,
|
|
1580
|
+
customType: normalized.customType,
|
|
1581
|
+
content: normalized.content,
|
|
1582
|
+
display: normalized.display,
|
|
1464
1583
|
// Drop AgentSession-internal transient fields before disk persistence.
|
|
1465
|
-
details: stripInternalDetailsFields(details),
|
|
1466
|
-
attribution,
|
|
1584
|
+
details: stripInternalDetailsFields(normalized.details),
|
|
1585
|
+
attribution: normalized.attribution,
|
|
1467
1586
|
...this.#freshEntryFields(),
|
|
1468
1587
|
};
|
|
1469
1588
|
this.#recordEntry(entry);
|
|
@@ -66,6 +66,7 @@ export function createSettingsAwareStreamFn(settings: Settings, base: StreamFn =
|
|
|
66
66
|
checkAssistantContent: settings.get("model.loopGuard.checkAssistantContent"),
|
|
67
67
|
...streamOptions?.loopGuard,
|
|
68
68
|
},
|
|
69
|
+
hideThinkingSummary: streamOptions?.hideThinkingSummary ?? settings.get("omitThinking"),
|
|
69
70
|
...(fallbacks !== undefined ? { fallbacks } : {}),
|
|
70
71
|
};
|
|
71
72
|
return base(model, context, merged);
|
|
@@ -16,8 +16,11 @@ const CLASSIFIER_SYSTEM_PROMPT = prompt.render(unexpectedStopClassifierPrompt);
|
|
|
16
16
|
*/
|
|
17
17
|
const ANSWER_MAX_TOKENS = 16;
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
19
|
+
* Online classifier budget. Sized to survive backends that ignore
|
|
20
|
+
* `disableReasoning` (e.g. Qwen3 via llama.cpp catalogued `reasoning: false`
|
|
21
|
+
* but still emitting thinking): the yes/no keyword needs to land after any
|
|
22
|
+
* unavoidable thinking preamble. `maxTokens` is a hard cap — non-thinking
|
|
23
|
+
* completions still return in a single word (issue #4355).
|
|
21
24
|
*/
|
|
22
25
|
const REASONING_SAFE_MAX_TOKENS = 1024;
|
|
23
26
|
|
|
@@ -74,7 +77,7 @@ async function classifyOnline(text: string, deps: ClassifyUnexpectedStopDeps): P
|
|
|
74
77
|
throw new Error(`unexpected-stop: no API key for ${model.provider}/${model.id}`);
|
|
75
78
|
}
|
|
76
79
|
const metadata = deps.metadataResolver?.(model.provider);
|
|
77
|
-
const maxTokens =
|
|
80
|
+
const maxTokens = REASONING_SAFE_MAX_TOKENS;
|
|
78
81
|
|
|
79
82
|
const response = await completeSimple(
|
|
80
83
|
model,
|
|
@@ -380,8 +380,8 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<SlashCommandSpec> = [
|
|
|
380
380
|
return commandConsumed();
|
|
381
381
|
}
|
|
382
382
|
if (arg === "on") {
|
|
383
|
-
runtime.session.setFastMode(true);
|
|
384
|
-
await runtime.output("Fast mode enabled.");
|
|
383
|
+
const supported = runtime.session.setFastMode(true);
|
|
384
|
+
await runtime.output(supported ? "Fast mode enabled." : "Fast mode is unavailable for the current model.");
|
|
385
385
|
return commandConsumed();
|
|
386
386
|
}
|
|
387
387
|
if (arg === "off") {
|
|
@@ -405,9 +405,11 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<SlashCommandSpec> = [
|
|
|
405
405
|
return;
|
|
406
406
|
}
|
|
407
407
|
if (arg === "on") {
|
|
408
|
-
runtime.ctx.session.setFastMode(true);
|
|
408
|
+
const supported = runtime.ctx.session.setFastMode(true);
|
|
409
409
|
refreshStatusLine(runtime.ctx);
|
|
410
|
-
runtime.ctx.showStatus(
|
|
410
|
+
runtime.ctx.showStatus(
|
|
411
|
+
supported ? "Fast mode enabled." : "Fast mode is unavailable for the current model.",
|
|
412
|
+
);
|
|
411
413
|
runtime.ctx.editor.setText("");
|
|
412
414
|
return;
|
|
413
415
|
}
|
|
@@ -2437,6 +2439,7 @@ export const BUILTIN_SLASH_COMMAND_DEFS: ReadonlyArray<BuiltinSlashCommand> = BU
|
|
|
2437
2439
|
command => ({
|
|
2438
2440
|
name: command.name,
|
|
2439
2441
|
aliases: command.aliases,
|
|
2442
|
+
allowArgs: command.allowArgs === true,
|
|
2440
2443
|
description: command.description,
|
|
2441
2444
|
subcommands: command.subcommands,
|
|
2442
2445
|
inlineHint: command.inlineHint,
|
|
@@ -150,12 +150,15 @@ export async function buildUsageReportText(runtime: SlashCommandRuntime): Promis
|
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
const stats = runtime.session.sessionManager.getUsageStatistics();
|
|
153
|
+
const orchestrationTokens = stats.orchestrationInput + stats.orchestrationOutput + stats.orchestrationCacheRead;
|
|
153
154
|
return [
|
|
154
155
|
"Usage",
|
|
155
156
|
`Input tokens: ${stats.input}`,
|
|
156
157
|
`Output tokens: ${stats.output}`,
|
|
157
158
|
`Cache read tokens: ${stats.cacheRead}`,
|
|
158
159
|
`Cache write tokens: ${stats.cacheWrite}`,
|
|
160
|
+
`Total tokens: ${stats.totalTokens}`,
|
|
161
|
+
...(orchestrationTokens > 0 ? [`Orchestration tokens: ${orchestrationTokens}`] : []),
|
|
159
162
|
`Premium requests: ${stats.premiumRequests}`,
|
|
160
163
|
`Cost: $${stats.cost.toFixed(6)}`,
|
|
161
164
|
].join("\n");
|
|
@@ -16,6 +16,8 @@ export interface BuiltinSlashCommand {
|
|
|
16
16
|
name: string;
|
|
17
17
|
aliases?: string[];
|
|
18
18
|
description: string;
|
|
19
|
+
/** Whether the command consumes text after the command name. */
|
|
20
|
+
allowArgs?: boolean;
|
|
19
21
|
/** Subcommands for dropdown completion (e.g. /mcp add, /mcp list). */
|
|
20
22
|
subcommands?: SubcommandDef[];
|
|
21
23
|
/** Static inline hint when command takes a simple argument (no subcommands). */
|