@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
|
@@ -2,6 +2,7 @@ import * as fs from "node:fs/promises";
|
|
|
2
2
|
import * as path from "node:path";
|
|
3
3
|
import { getAgentDir, isEnoent } from "@oh-my-pi/pi-utils";
|
|
4
4
|
import { getMemoryRoot } from "../memories";
|
|
5
|
+
import { getMnemopiSessionState, type MnemopiScopedMemoryHit, type MnemopiSessionState } from "../mnemopi/state";
|
|
5
6
|
import { AgentRegistry } from "../registry/agent-registry";
|
|
6
7
|
import { buildDirectoryResource } from "./filesystem-resource";
|
|
7
8
|
import { validateRelativePath } from "./skill-protocol";
|
|
@@ -124,6 +125,75 @@ async function tryResolveInRoot(url: InternalUrl, memoryRoot: string): Promise<I
|
|
|
124
125
|
};
|
|
125
126
|
}
|
|
126
127
|
|
|
128
|
+
/**
|
|
129
|
+
* Snapshot of live mnemopi session states, deduplicated. A mnemopi backend
|
|
130
|
+
* always keeps its state on the {@link AgentSession} it was initialised for;
|
|
131
|
+
* subagents alias their parent's state, so different `session` objects can
|
|
132
|
+
* point at the same underlying banks. The dedupe below picks the
|
|
133
|
+
* canonical (non-aliased) state per bank set so `memory://<id>` resolves in
|
|
134
|
+
* one pass regardless of how many subagents are alive.
|
|
135
|
+
*/
|
|
136
|
+
function mnemopiSessionStatesFromRegistry(): MnemopiSessionState[] {
|
|
137
|
+
const seen = new Set<unknown>();
|
|
138
|
+
const states: MnemopiSessionState[] = [];
|
|
139
|
+
for (const ref of AgentRegistry.global().list()) {
|
|
140
|
+
const session = ref.session;
|
|
141
|
+
if (!session) continue;
|
|
142
|
+
const state = getMnemopiSessionState(session);
|
|
143
|
+
if (!state) continue;
|
|
144
|
+
const primary = state.aliasOf ?? state;
|
|
145
|
+
if (seen.has(primary)) continue;
|
|
146
|
+
seen.add(primary);
|
|
147
|
+
states.push(primary);
|
|
148
|
+
}
|
|
149
|
+
return states;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Look up a mnemopi memory row by id across every live session's scoped banks.
|
|
154
|
+
* First hit wins; returns `null` when the id is not stored anywhere in scope.
|
|
155
|
+
*/
|
|
156
|
+
function tryResolveMnemopiMemory(id: string): MnemopiScopedMemoryHit | null {
|
|
157
|
+
for (const state of mnemopiSessionStatesFromRegistry()) {
|
|
158
|
+
const hit = state?.getScopedMemory(id);
|
|
159
|
+
if (hit) return hit;
|
|
160
|
+
}
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Render a mnemopi memory row as text/markdown with a small YAML-front-matter
|
|
166
|
+
* header. The frontmatter carries the metadata an agent needs to reason about
|
|
167
|
+
* a working vs episodic memory (bank, store, timestamps, importance) without
|
|
168
|
+
* having to reconstruct it from the recall preview.
|
|
169
|
+
*/
|
|
170
|
+
function renderMnemopiMemory(url: InternalUrl, hit: MnemopiScopedMemoryHit): InternalResource {
|
|
171
|
+
const { row, bank, store } = hit;
|
|
172
|
+
const meta = row.metadata == null ? "" : `metadata: ${JSON.stringify(row.metadata)}\n`;
|
|
173
|
+
const header =
|
|
174
|
+
"---\n" +
|
|
175
|
+
`id: ${row.id}\n` +
|
|
176
|
+
`bank: ${bank}\n` +
|
|
177
|
+
`store: ${store}\n` +
|
|
178
|
+
(row.memory_type ? `memory_type: ${row.memory_type}\n` : "") +
|
|
179
|
+
(row.source ? `source: ${row.source}\n` : "") +
|
|
180
|
+
(row.timestamp ? `timestamp: ${row.timestamp}\n` : "") +
|
|
181
|
+
(row.created_at ? `created_at: ${row.created_at}\n` : "") +
|
|
182
|
+
(row.importance != null ? `importance: ${row.importance}\n` : "") +
|
|
183
|
+
(row.veracity ? `veracity: ${row.veracity}\n` : "") +
|
|
184
|
+
(row.session_id ? `session_id: ${row.session_id}\n` : "") +
|
|
185
|
+
meta +
|
|
186
|
+
"---\n\n";
|
|
187
|
+
const content = `${header}${row.content}`;
|
|
188
|
+
return {
|
|
189
|
+
url: url.href,
|
|
190
|
+
content,
|
|
191
|
+
contentType: "text/markdown",
|
|
192
|
+
size: Buffer.byteLength(content, "utf-8"),
|
|
193
|
+
notes: [],
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
|
|
127
197
|
/**
|
|
128
198
|
* Protocol handler for memory:// URLs.
|
|
129
199
|
*
|
|
@@ -136,8 +206,31 @@ export class MemoryProtocolHandler implements ProtocolHandler {
|
|
|
136
206
|
readonly immutable = true;
|
|
137
207
|
|
|
138
208
|
async resolve(url: InternalUrl): Promise<InternalResource> {
|
|
139
|
-
const
|
|
209
|
+
const namespace = url.rawHost || url.hostname;
|
|
210
|
+
if (!namespace) {
|
|
211
|
+
throw new Error("memory:// URL requires a namespace: memory://root or memory://<memory-id>");
|
|
212
|
+
}
|
|
140
213
|
|
|
214
|
+
// Mnemopi rows live in SQLite banks per session, keyed by memory id.
|
|
215
|
+
// Any host other than the file-backed `root` namespace is treated as a
|
|
216
|
+
// mnemopi memory id lookup. This is the read counterpart to
|
|
217
|
+
// `memory_edit update` and lets agents inspect the full content of a
|
|
218
|
+
// clipped recall preview before overwriting it (issue #4443).
|
|
219
|
+
if (namespace !== MEMORY_NAMESPACE) {
|
|
220
|
+
const mnemopiStates = mnemopiSessionStatesFromRegistry();
|
|
221
|
+
if (mnemopiStates.length === 0) {
|
|
222
|
+
throw new Error(
|
|
223
|
+
`Unknown memory namespace: ${namespace}. Supported: ${MEMORY_NAMESPACE} (file-backed memory summary), or a mnemopi memory id when memory.backend=mnemopi is active.`,
|
|
224
|
+
);
|
|
225
|
+
}
|
|
226
|
+
const hit = tryResolveMnemopiMemory(namespace);
|
|
227
|
+
if (hit) return renderMnemopiMemory(url, hit);
|
|
228
|
+
throw new Error(
|
|
229
|
+
`Mnemopi memory ${namespace} not found in any scoped bank. Use \`recall\` to list available ids.`,
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
const roots = memoryRootsFromRegistry();
|
|
141
234
|
if (roots.length === 0) {
|
|
142
235
|
throw new Error(
|
|
143
236
|
"Memory artifacts are not available for this project yet. Run a session with memories enabled first.",
|
|
@@ -167,7 +260,16 @@ export class MemoryProtocolHandler implements ProtocolHandler {
|
|
|
167
260
|
}
|
|
168
261
|
|
|
169
262
|
async complete(): Promise<UrlCompletion[]> {
|
|
170
|
-
|
|
171
|
-
|
|
263
|
+
const completions: UrlCompletion[] = [];
|
|
264
|
+
if (memoryRootsFromRegistry().length > 0) {
|
|
265
|
+
completions.push({ value: MEMORY_NAMESPACE, description: "Project memory summary" });
|
|
266
|
+
}
|
|
267
|
+
if (mnemopiSessionStatesFromRegistry().length > 0) {
|
|
268
|
+
completions.push({
|
|
269
|
+
value: "<memory-id>",
|
|
270
|
+
description: "Full mnemopi memory by id (from recall)",
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
return completions;
|
|
172
274
|
}
|
|
173
275
|
}
|
package/src/lsp/client.ts
CHANGED
|
@@ -176,6 +176,19 @@ const CLIENT_CAPABILITIES = {
|
|
|
176
176
|
},
|
|
177
177
|
};
|
|
178
178
|
|
|
179
|
+
/** LSP `FileChangeType` values for workspace/didChangeWatchedFiles notifications. */
|
|
180
|
+
export enum FileChangeType {
|
|
181
|
+
Created = 1,
|
|
182
|
+
Changed = 2,
|
|
183
|
+
Deleted = 3,
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/** Filesystem change authored by the harness and announced to active LSP clients. */
|
|
187
|
+
export interface WatchedFileChange {
|
|
188
|
+
filePath: string;
|
|
189
|
+
type: FileChangeType;
|
|
190
|
+
}
|
|
191
|
+
|
|
179
192
|
// =============================================================================
|
|
180
193
|
// LSP Message Protocol
|
|
181
194
|
// =============================================================================
|
|
@@ -944,6 +957,63 @@ export async function notifySaved(client: LspClient, filePath: string, signal?:
|
|
|
944
957
|
client.lastActivity = Date.now();
|
|
945
958
|
}
|
|
946
959
|
|
|
960
|
+
function isPathInsideWorkspace(filePath: string, workspace: string): boolean {
|
|
961
|
+
const relative = path.relative(workspace, path.resolve(filePath));
|
|
962
|
+
return relative === "" || (!relative.startsWith("..") && !path.isAbsolute(relative));
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
/** Budget for the one-way watched-files notification: a wedged server that
|
|
966
|
+
* stops draining stdin must never hang the filesystem mutation that
|
|
967
|
+
* triggered it. Failures degrade to a debug log below. */
|
|
968
|
+
const WATCHED_FILES_NOTIFY_TIMEOUT_MS = 2_000;
|
|
969
|
+
|
|
970
|
+
/**
|
|
971
|
+
* Announce harness-authored filesystem changes to active LSP clients for `cwd`.
|
|
972
|
+
*
|
|
973
|
+
* This covers sibling files that are not open text documents, such as generated
|
|
974
|
+
* CSS modules or type files that another edited document imports immediately.
|
|
975
|
+
*
|
|
976
|
+
* The underlying stdin flush is self-bounded by
|
|
977
|
+
* {@link WATCHED_FILES_NOTIFY_TIMEOUT_MS}; only an abort of the caller's
|
|
978
|
+
* `signal` rejects.
|
|
979
|
+
*/
|
|
980
|
+
export async function notifyWorkspaceWatchedFiles(
|
|
981
|
+
cwd: string,
|
|
982
|
+
changes: readonly WatchedFileChange[],
|
|
983
|
+
signal?: AbortSignal,
|
|
984
|
+
): Promise<void> {
|
|
985
|
+
throwIfAborted(signal);
|
|
986
|
+
if (changes.length === 0) return;
|
|
987
|
+
|
|
988
|
+
const workspace = path.resolve(cwd);
|
|
989
|
+
const activeClients = Array.from(clients.values()).filter(
|
|
990
|
+
client => client.status === "ready" && path.resolve(client.cwd) === workspace,
|
|
991
|
+
);
|
|
992
|
+
if (activeClients.length === 0) return;
|
|
993
|
+
|
|
994
|
+
const timeoutSignal = AbortSignal.timeout(WATCHED_FILES_NOTIFY_TIMEOUT_MS);
|
|
995
|
+
const sendSignal = signal ? AbortSignal.any([signal, timeoutSignal]) : timeoutSignal;
|
|
996
|
+
const results = await Promise.allSettled(
|
|
997
|
+
activeClients.map(async client => {
|
|
998
|
+
const clientChanges = changes
|
|
999
|
+
.filter(change => isPathInsideWorkspace(change.filePath, workspace))
|
|
1000
|
+
.map(change => {
|
|
1001
|
+
const uri = fileToUri(change.filePath);
|
|
1002
|
+
client.diagnostics.delete(uri);
|
|
1003
|
+
return { uri, type: change.type };
|
|
1004
|
+
});
|
|
1005
|
+
if (clientChanges.length === 0) return;
|
|
1006
|
+
await sendNotification(client, "workspace/didChangeWatchedFiles", { changes: clientChanges }, sendSignal);
|
|
1007
|
+
}),
|
|
1008
|
+
);
|
|
1009
|
+
throwIfAborted(signal);
|
|
1010
|
+
for (const result of results) {
|
|
1011
|
+
if (result.status === "rejected") {
|
|
1012
|
+
logger.debug("LSP watched-files notification failed", { cwd, error: String(result.reason) });
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
|
|
947
1017
|
/**
|
|
948
1018
|
* Refresh a file in the LSP client.
|
|
949
1019
|
* Increments version, sends didChange and didSave notifications.
|
package/src/lsp/index.ts
CHANGED
|
@@ -18,10 +18,12 @@ import { ToolAbortError, ToolError, throwIfAborted } from "../tools/tool-errors"
|
|
|
18
18
|
import { clampTimeout } from "../tools/tool-timeouts";
|
|
19
19
|
import {
|
|
20
20
|
ensureFileOpen,
|
|
21
|
+
FileChangeType,
|
|
21
22
|
getActiveClients,
|
|
22
23
|
getOrCreateClient,
|
|
23
24
|
type LspServerStatus,
|
|
24
25
|
notifySaved,
|
|
26
|
+
notifyWorkspaceWatchedFiles,
|
|
25
27
|
refreshFile,
|
|
26
28
|
sendNotification,
|
|
27
29
|
sendRequest,
|
|
@@ -946,6 +948,7 @@ interface PendingWritethrough {
|
|
|
946
948
|
dst: string;
|
|
947
949
|
content: string;
|
|
948
950
|
file?: BunFile;
|
|
951
|
+
changeType: FileChangeType;
|
|
949
952
|
}
|
|
950
953
|
|
|
951
954
|
interface LspWritethroughBatchRequest {
|
|
@@ -1139,6 +1142,7 @@ async function runLspWritethrough(
|
|
|
1139
1142
|
content: string,
|
|
1140
1143
|
cwd: string,
|
|
1141
1144
|
options: ResolvedWritethroughOptions,
|
|
1145
|
+
changeType: FileChangeType,
|
|
1142
1146
|
signal?: AbortSignal,
|
|
1143
1147
|
file?: BunFile,
|
|
1144
1148
|
deferred?: {
|
|
@@ -1147,16 +1151,42 @@ async function runLspWritethrough(
|
|
|
1147
1151
|
},
|
|
1148
1152
|
): Promise<FileDiagnosticsResult | undefined> {
|
|
1149
1153
|
const { enableFormat, enableDiagnostics } = options;
|
|
1154
|
+
|
|
1155
|
+
let finalContent = content;
|
|
1156
|
+
const writeContent = async (value: string) => (file ? file.write(value) : Bun.write(dst, value));
|
|
1157
|
+
const getWritePromise = once(() => writeContent(finalContent));
|
|
1158
|
+
let writeNotified = false;
|
|
1159
|
+
const notifyWriteCommitted = async (notifySignal: AbortSignal | undefined = signal) => {
|
|
1160
|
+
if (writeNotified) return;
|
|
1161
|
+
writeNotified = true;
|
|
1162
|
+
try {
|
|
1163
|
+
await notifyWorkspaceWatchedFiles(cwd, [{ filePath: dst, type: changeType }], notifySignal);
|
|
1164
|
+
} catch (error) {
|
|
1165
|
+
if (notifySignal?.aborted && !signal?.aborted) {
|
|
1166
|
+
// The operation budget died mid-notify while the caller is still
|
|
1167
|
+
// live: allow the post-write retry below to re-announce with the
|
|
1168
|
+
// caller's signal (didChangeWatchedFiles is idempotent).
|
|
1169
|
+
writeNotified = false;
|
|
1170
|
+
return;
|
|
1171
|
+
}
|
|
1172
|
+
throw error;
|
|
1173
|
+
}
|
|
1174
|
+
};
|
|
1175
|
+
if (!enableFormat && !enableDiagnostics) {
|
|
1176
|
+
await getWritePromise();
|
|
1177
|
+
await notifyWriteCommitted();
|
|
1178
|
+
return undefined;
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1150
1181
|
const config = getConfig(cwd);
|
|
1151
1182
|
const servers = getServersForFile(config, dst);
|
|
1183
|
+
|
|
1152
1184
|
if (servers.length === 0) {
|
|
1153
|
-
|
|
1185
|
+
await getWritePromise();
|
|
1186
|
+
await notifyWriteCommitted();
|
|
1187
|
+
return undefined;
|
|
1154
1188
|
}
|
|
1155
1189
|
const { lspServers, customLinterServers } = splitServers(servers);
|
|
1156
|
-
|
|
1157
|
-
let finalContent = content;
|
|
1158
|
-
const writeContent = async (value: string) => (file ? file.write(value) : Bun.write(dst, value));
|
|
1159
|
-
const getWritePromise = once(() => writeContent(finalContent));
|
|
1160
1190
|
const useCustomFormatter = enableFormat && customLinterServers.length > 0;
|
|
1161
1191
|
|
|
1162
1192
|
// Capture diagnostic versions BEFORE syncing to detect stale diagnostics
|
|
@@ -1169,6 +1199,7 @@ async function runLspWritethrough(
|
|
|
1169
1199
|
let diagnostics: FileDiagnosticsResult | undefined;
|
|
1170
1200
|
let timedOut = false;
|
|
1171
1201
|
let synced = false;
|
|
1202
|
+
let operationSignal: AbortSignal | undefined;
|
|
1172
1203
|
try {
|
|
1173
1204
|
const timeoutSignal = AbortSignal.timeout(5_000);
|
|
1174
1205
|
timeoutSignal.addEventListener(
|
|
@@ -1178,7 +1209,7 @@ async function runLspWritethrough(
|
|
|
1178
1209
|
},
|
|
1179
1210
|
{ once: true },
|
|
1180
1211
|
);
|
|
1181
|
-
|
|
1212
|
+
operationSignal = signal ? AbortSignal.any([signal, timeoutSignal]) : timeoutSignal;
|
|
1182
1213
|
await untilAborted(operationSignal, async () => {
|
|
1183
1214
|
if (useCustomFormatter) {
|
|
1184
1215
|
// Custom linters (e.g. Biome CLI) require on-disk input.
|
|
@@ -1186,6 +1217,7 @@ async function runLspWritethrough(
|
|
|
1186
1217
|
finalContent = await formatContent(dst, content, cwd, customLinterServers, operationSignal);
|
|
1187
1218
|
formatter = finalContent !== content ? FileFormatResult.FORMATTED : FileFormatResult.UNCHANGED;
|
|
1188
1219
|
await writeContent(finalContent);
|
|
1220
|
+
await notifyWriteCommitted(operationSignal);
|
|
1189
1221
|
await syncFileContent(dst, finalContent, cwd, lspServers, operationSignal);
|
|
1190
1222
|
} else {
|
|
1191
1223
|
// 1. Sync original content to LSP servers
|
|
@@ -1204,6 +1236,7 @@ async function runLspWritethrough(
|
|
|
1204
1236
|
|
|
1205
1237
|
// 4. Write to disk
|
|
1206
1238
|
await getWritePromise();
|
|
1239
|
+
await notifyWriteCommitted(operationSignal);
|
|
1207
1240
|
}
|
|
1208
1241
|
|
|
1209
1242
|
if (enableDiagnostics) {
|
|
@@ -1232,6 +1265,10 @@ async function runLspWritethrough(
|
|
|
1232
1265
|
}
|
|
1233
1266
|
}
|
|
1234
1267
|
await getWritePromise();
|
|
1268
|
+
// The write above committed even though the operation budget elapsed:
|
|
1269
|
+
// announce it on the caller's signal — the dead `operationSignal` would
|
|
1270
|
+
// abort the notify before it ever reaches the server.
|
|
1271
|
+
await notifyWriteCommitted();
|
|
1235
1272
|
}
|
|
1236
1273
|
|
|
1237
1274
|
if (synced && enableDiagnostics) {
|
|
@@ -1279,7 +1316,16 @@ async function flushWritethroughBatch(
|
|
|
1279
1316
|
onDeferredDiagnostics: bundle.onDeferredDiagnostics,
|
|
1280
1317
|
signal: bundle.signal,
|
|
1281
1318
|
} as const);
|
|
1282
|
-
const diag = await runLspWritethrough(
|
|
1319
|
+
const diag = await runLspWritethrough(
|
|
1320
|
+
entry.dst,
|
|
1321
|
+
entry.content,
|
|
1322
|
+
cwd,
|
|
1323
|
+
options,
|
|
1324
|
+
entry.changeType,
|
|
1325
|
+
signal,
|
|
1326
|
+
entry.file,
|
|
1327
|
+
deferredInner,
|
|
1328
|
+
);
|
|
1283
1329
|
bundle?.finalize(diag);
|
|
1284
1330
|
results.push(diag);
|
|
1285
1331
|
}
|
|
@@ -1293,9 +1339,6 @@ export function createLspWritethrough(cwd: string, options?: WritethroughOptions
|
|
|
1293
1339
|
enableDiagnostics: options?.enableDiagnostics ?? false,
|
|
1294
1340
|
transformDiagnostics: options?.transformDiagnostics,
|
|
1295
1341
|
};
|
|
1296
|
-
if (!resolvedOptions.enableFormat && !resolvedOptions.enableDiagnostics) {
|
|
1297
|
-
return writethroughNoop;
|
|
1298
|
-
}
|
|
1299
1342
|
return async (
|
|
1300
1343
|
dst: string,
|
|
1301
1344
|
content: string,
|
|
@@ -1304,6 +1347,7 @@ export function createLspWritethrough(cwd: string, options?: WritethroughOptions
|
|
|
1304
1347
|
batch?: LspWritethroughBatchRequest,
|
|
1305
1348
|
getDeferred?: (dst: string) => WritethroughDeferredHandle | undefined,
|
|
1306
1349
|
) => {
|
|
1350
|
+
const changeType = (await Bun.file(dst).exists()) ? FileChangeType.Changed : FileChangeType.Created;
|
|
1307
1351
|
if (!batch) {
|
|
1308
1352
|
const bundle = getDeferred?.(dst);
|
|
1309
1353
|
const deferredInner =
|
|
@@ -1312,13 +1356,22 @@ export function createLspWritethrough(cwd: string, options?: WritethroughOptions
|
|
|
1312
1356
|
onDeferredDiagnostics: bundle.onDeferredDiagnostics,
|
|
1313
1357
|
signal: bundle.signal,
|
|
1314
1358
|
} as const);
|
|
1315
|
-
const diagnostics = await runLspWritethrough(
|
|
1359
|
+
const diagnostics = await runLspWritethrough(
|
|
1360
|
+
dst,
|
|
1361
|
+
content,
|
|
1362
|
+
cwd,
|
|
1363
|
+
resolvedOptions,
|
|
1364
|
+
changeType,
|
|
1365
|
+
signal,
|
|
1366
|
+
file,
|
|
1367
|
+
deferredInner,
|
|
1368
|
+
);
|
|
1316
1369
|
bundle?.finalize(diagnostics);
|
|
1317
1370
|
return diagnostics;
|
|
1318
1371
|
}
|
|
1319
1372
|
|
|
1320
1373
|
const state = getOrCreateWritethroughBatch(batch.id, resolvedOptions);
|
|
1321
|
-
state.entries.set(dst, { dst, content, file });
|
|
1374
|
+
state.entries.set(dst, { dst, content, file, changeType });
|
|
1322
1375
|
|
|
1323
1376
|
if (!batch.flush) {
|
|
1324
1377
|
await writethroughNoop(dst, content, signal, file);
|
package/src/main.ts
CHANGED
|
@@ -806,11 +806,13 @@ async function buildSessionOptions(
|
|
|
806
806
|
|
|
807
807
|
// Auto-discover SYSTEM.md if no CLI system prompt provided
|
|
808
808
|
const systemPromptSource = parsed.systemPrompt ?? discoverSystemPromptFile();
|
|
809
|
-
const resolvedSystemPrompt = await resolvePromptInput(systemPromptSource, "system prompt");
|
|
810
809
|
const appendPromptSource = parsed.appendSystemPrompt ?? discoverAppendSystemPromptFile();
|
|
811
|
-
const resolvedAppendPrompt = await resolvePromptInput(appendPromptSource, "append system prompt");
|
|
812
810
|
const titleSystemPromptSource = discoverTitleSystemPromptFile();
|
|
813
|
-
const titleSystemPrompt = await
|
|
811
|
+
const [resolvedSystemPrompt, resolvedAppendPrompt, titleSystemPrompt] = await Promise.all([
|
|
812
|
+
resolvePromptInput(systemPromptSource, "system prompt"),
|
|
813
|
+
resolvePromptInput(appendPromptSource, "append system prompt"),
|
|
814
|
+
resolvePromptInput(titleSystemPromptSource, "title system prompt"),
|
|
815
|
+
]);
|
|
814
816
|
|
|
815
817
|
if (sessionManager) {
|
|
816
818
|
options.sessionManager = sessionManager;
|
|
@@ -398,12 +398,13 @@ function extractSegmentsFromContentStream(raw: string, pageNumber: number): Segm
|
|
|
398
398
|
|
|
399
399
|
/**
|
|
400
400
|
* Fast tokenizer for PDF content streams.
|
|
401
|
-
* Splits on whitespace, skipping comments and
|
|
401
|
+
* Splits on whitespace, skipping comments, string literals, and inline image payloads.
|
|
402
402
|
*/
|
|
403
403
|
function tokenizeContentStream(raw: string): string[] {
|
|
404
404
|
const tokens: string[] = [];
|
|
405
405
|
const len = raw.length;
|
|
406
406
|
let i = 0;
|
|
407
|
+
let inInlineImage = false;
|
|
407
408
|
while (i < len) {
|
|
408
409
|
const ch = raw.charCodeAt(i);
|
|
409
410
|
// Skip whitespace
|
|
@@ -449,6 +450,12 @@ function tokenizeContentStream(raw: string): string[] {
|
|
|
449
450
|
i += 2;
|
|
450
451
|
continue;
|
|
451
452
|
}
|
|
453
|
+
// Skip stray closing delimiters from malformed streams. They cannot start
|
|
454
|
+
// a token, so leaving i unchanged would spin forever.
|
|
455
|
+
if (ch === 41 || ch === 62) {
|
|
456
|
+
i++;
|
|
457
|
+
continue;
|
|
458
|
+
}
|
|
452
459
|
// Regular token: read until whitespace or delimiter
|
|
453
460
|
const start = i;
|
|
454
461
|
while (i < len) {
|
|
@@ -457,7 +464,24 @@ function tokenizeContentStream(raw: string): string[] {
|
|
|
457
464
|
i++;
|
|
458
465
|
}
|
|
459
466
|
if (i > start) {
|
|
460
|
-
|
|
467
|
+
const token = raw.substring(start, i);
|
|
468
|
+
tokens.push(token);
|
|
469
|
+
if (token === "BI") {
|
|
470
|
+
inInlineImage = true;
|
|
471
|
+
} else if (token === "ID" && inInlineImage) {
|
|
472
|
+
while (i < len && raw.charCodeAt(i) <= 32) i++;
|
|
473
|
+
while (i < len) {
|
|
474
|
+
const c = raw.charCodeAt(i);
|
|
475
|
+
const prev = i === 0 ? 32 : raw.charCodeAt(i - 1);
|
|
476
|
+
const next = i + 2 >= len ? 32 : raw.charCodeAt(i + 2);
|
|
477
|
+
if (c === 69 && raw.charCodeAt(i + 1) === 73 && prev <= 32 && next <= 32) {
|
|
478
|
+
i += 2;
|
|
479
|
+
break;
|
|
480
|
+
}
|
|
481
|
+
i++;
|
|
482
|
+
}
|
|
483
|
+
inInlineImage = false;
|
|
484
|
+
}
|
|
461
485
|
}
|
|
462
486
|
}
|
|
463
487
|
return tokens;
|
package/src/mnemopi/state.ts
CHANGED
|
@@ -114,8 +114,41 @@ export interface MnemopiMemoryEditResult {
|
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
interface MnemopiStoredMemoryRow {
|
|
117
|
+
id?: unknown;
|
|
118
|
+
content?: unknown;
|
|
119
|
+
source?: unknown;
|
|
120
|
+
timestamp?: unknown;
|
|
121
|
+
importance?: unknown;
|
|
122
|
+
veracity?: unknown;
|
|
123
|
+
created_at?: unknown;
|
|
117
124
|
memory_store?: unknown;
|
|
125
|
+
memory_type?: unknown;
|
|
118
126
|
session_id?: unknown;
|
|
127
|
+
metadata?: unknown;
|
|
128
|
+
metadata_json?: unknown;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Full-row lookup result produced by {@link MnemopiSessionState.getScopedMemory}.
|
|
133
|
+
* Mirrors the shape stored in mnemopi's working/episodic tables, tagged with
|
|
134
|
+
* the scoped bank that actually held the row so callers can render it with
|
|
135
|
+
* meaningful context.
|
|
136
|
+
*/
|
|
137
|
+
export interface MnemopiScopedMemoryHit {
|
|
138
|
+
bank: string;
|
|
139
|
+
store: "working" | "episodic";
|
|
140
|
+
row: {
|
|
141
|
+
id: string;
|
|
142
|
+
content: string;
|
|
143
|
+
source: string | null;
|
|
144
|
+
timestamp: string | null;
|
|
145
|
+
importance: number | null;
|
|
146
|
+
veracity: string | null;
|
|
147
|
+
created_at: string | null;
|
|
148
|
+
session_id: string | null;
|
|
149
|
+
memory_type: string | null;
|
|
150
|
+
metadata: unknown;
|
|
151
|
+
};
|
|
119
152
|
}
|
|
120
153
|
|
|
121
154
|
type MnemopiRetentionMessage = { role: string; content: string };
|
|
@@ -201,6 +234,49 @@ export class MnemopiSessionState {
|
|
|
201
234
|
return this.scoped.retain;
|
|
202
235
|
}
|
|
203
236
|
|
|
237
|
+
/**
|
|
238
|
+
* Read counterpart to {@link editScopedMemory}: fetch a memory row by id
|
|
239
|
+
* from any bank this session recalls from (retain, recall, global). First
|
|
240
|
+
* hit wins in the same order {@link editScopedMemory} would touch, so the
|
|
241
|
+
* shape matches what an `update`/`forget`/`invalidate` on the same id will
|
|
242
|
+
* see. Returns `null` when the id is not found anywhere in scope.
|
|
243
|
+
*
|
|
244
|
+
* Backs the coding-agent `memory://<id>` URL so agents can inspect the
|
|
245
|
+
* FULL content of a recall preview (recall clips content — see
|
|
246
|
+
* {@link RecallResult.truncated}) before issuing a wholesale
|
|
247
|
+
* `memory_edit update` that would otherwise overwrite unseen bytes
|
|
248
|
+
* (issue #4443).
|
|
249
|
+
*/
|
|
250
|
+
getScopedMemory(id: string): MnemopiScopedMemoryHit | null {
|
|
251
|
+
const targets = dedupeScopedTargets([
|
|
252
|
+
this.scoped.retain,
|
|
253
|
+
...this.scoped.recall,
|
|
254
|
+
...(this.scoped.global ? [this.scoped.global] : []),
|
|
255
|
+
]);
|
|
256
|
+
for (const target of targets) {
|
|
257
|
+
const raw = target.memory.get(id) as MnemopiStoredMemoryRow | null;
|
|
258
|
+
if (!raw) continue;
|
|
259
|
+
const store: MnemopiScopedMemoryHit["store"] = raw.memory_store === "episodic" ? "episodic" : "working";
|
|
260
|
+
return {
|
|
261
|
+
bank: target.bank,
|
|
262
|
+
store,
|
|
263
|
+
row: {
|
|
264
|
+
id: typeof raw.id === "string" ? raw.id : id,
|
|
265
|
+
content: typeof raw.content === "string" ? raw.content : "",
|
|
266
|
+
source: typeof raw.source === "string" ? raw.source : null,
|
|
267
|
+
timestamp: typeof raw.timestamp === "string" ? raw.timestamp : null,
|
|
268
|
+
importance: typeof raw.importance === "number" ? raw.importance : null,
|
|
269
|
+
veracity: typeof raw.veracity === "string" ? raw.veracity : null,
|
|
270
|
+
created_at: typeof raw.created_at === "string" ? raw.created_at : null,
|
|
271
|
+
session_id: typeof raw.session_id === "string" ? raw.session_id : null,
|
|
272
|
+
memory_type: typeof raw.memory_type === "string" ? raw.memory_type : null,
|
|
273
|
+
metadata: raw.metadata ?? raw.metadata_json ?? null,
|
|
274
|
+
},
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
return null;
|
|
278
|
+
}
|
|
279
|
+
|
|
204
280
|
editScopedMemory(
|
|
205
281
|
op: MnemopiMemoryEditOperation,
|
|
206
282
|
id: string,
|
|
@@ -1823,6 +1823,10 @@ export class AcpAgent implements Agent {
|
|
|
1823
1823
|
output: usage.output,
|
|
1824
1824
|
cacheRead: usage.cacheRead,
|
|
1825
1825
|
cacheWrite: usage.cacheWrite,
|
|
1826
|
+
totalTokens: usage.totalTokens,
|
|
1827
|
+
orchestrationInput: usage.orchestrationInput,
|
|
1828
|
+
orchestrationOutput: usage.orchestrationOutput,
|
|
1829
|
+
orchestrationCacheRead: usage.orchestrationCacheRead,
|
|
1826
1830
|
premiumRequests: usage.premiumRequests,
|
|
1827
1831
|
cost: usage.cost,
|
|
1828
1832
|
};
|
|
@@ -1833,7 +1837,7 @@ export class AcpAgent implements Agent {
|
|
|
1833
1837
|
const outputTokens = Math.max(0, current.output - previous.output);
|
|
1834
1838
|
const cachedReadTokens = Math.max(0, current.cacheRead - previous.cacheRead);
|
|
1835
1839
|
const cachedWriteTokens = Math.max(0, current.cacheWrite - previous.cacheWrite);
|
|
1836
|
-
const totalTokens =
|
|
1840
|
+
const totalTokens = Math.max(0, current.totalTokens - previous.totalTokens);
|
|
1837
1841
|
|
|
1838
1842
|
if (totalTokens === 0) {
|
|
1839
1843
|
return undefined;
|
|
@@ -68,16 +68,23 @@ function statusBadge(status: AgentStatus): string {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
function registerPersistedSubagents(
|
|
71
|
+
async function registerPersistedSubagents(
|
|
72
|
+
registry: AgentRegistry,
|
|
73
|
+
sessionFile: string | null | undefined,
|
|
74
|
+
): Promise<void> {
|
|
72
75
|
if (!sessionFile?.endsWith(".jsonl")) return;
|
|
73
76
|
const root = sessionFile.slice(0, -6);
|
|
74
|
-
registerPersistedSubagentsFromDir(registry, root, undefined);
|
|
77
|
+
await registerPersistedSubagentsFromDir(registry, root, undefined);
|
|
75
78
|
}
|
|
76
79
|
|
|
77
|
-
function registerPersistedSubagentsFromDir(
|
|
80
|
+
async function registerPersistedSubagentsFromDir(
|
|
81
|
+
registry: AgentRegistry,
|
|
82
|
+
dir: string,
|
|
83
|
+
parentId: string | undefined,
|
|
84
|
+
): Promise<void> {
|
|
78
85
|
let entries: fs.Dirent[];
|
|
79
86
|
try {
|
|
80
|
-
entries = fs.
|
|
87
|
+
entries = await fs.promises.readdir(dir, { withFileTypes: true });
|
|
81
88
|
} catch {
|
|
82
89
|
return;
|
|
83
90
|
}
|
|
@@ -126,7 +133,7 @@ function registerPersistedSubagentsFromDir(registry: AgentRegistry, dir: string,
|
|
|
126
133
|
status: "parked",
|
|
127
134
|
});
|
|
128
135
|
}
|
|
129
|
-
registerPersistedSubagentsFromDir(registry, path.join(dir, id), id);
|
|
136
|
+
await registerPersistedSubagentsFromDir(registry, path.join(dir, id), id);
|
|
130
137
|
}
|
|
131
138
|
}
|
|
132
139
|
|
|
@@ -192,6 +199,8 @@ export class AgentHubOverlayComponent extends Container {
|
|
|
192
199
|
#unsubscribers: Array<() => void> = [];
|
|
193
200
|
#ageTimer: NodeJS.Timeout | undefined;
|
|
194
201
|
#remote: AgentHubRemote | undefined;
|
|
202
|
+
/** Resolves after persisted historical subagents have been registered and rows refreshed. */
|
|
203
|
+
readonly persistedSubagentsReady: Promise<void>;
|
|
195
204
|
|
|
196
205
|
// Table state
|
|
197
206
|
#rows: AgentRef[] = [];
|
|
@@ -247,14 +256,23 @@ export class AgentHubOverlayComponent extends Container {
|
|
|
247
256
|
this.#ageTimer = setInterval(() => this.#requestRender(), AGE_TICK_MS);
|
|
248
257
|
this.#ageTimer.unref?.();
|
|
249
258
|
|
|
250
|
-
|
|
259
|
+
this.persistedSubagentsReady = this.#remote
|
|
260
|
+
? Promise.resolve()
|
|
261
|
+
: registerPersistedSubagents(this.#registry, deps.sessionFile)
|
|
262
|
+
.catch((error: unknown) => {
|
|
263
|
+
logger.warn("Failed to register persisted subagents", { error });
|
|
264
|
+
})
|
|
265
|
+
.then(() => {
|
|
266
|
+
this.#refreshRows();
|
|
267
|
+
})
|
|
268
|
+
.finally(() => this.#requestRender());
|
|
251
269
|
this.#refreshRows();
|
|
252
270
|
}
|
|
253
271
|
|
|
254
272
|
/**
|
|
255
|
-
* Whether the table view has no agents to show (every registered agent
|
|
256
|
-
* Main
|
|
257
|
-
*
|
|
273
|
+
* Whether the current table view has no agents to show (every registered agent
|
|
274
|
+
* except Main). Persisted historical rows may arrive later; callers that need
|
|
275
|
+
* those included must wait for {@link persistedSubagentsReady} first.
|
|
258
276
|
*/
|
|
259
277
|
get isEmpty(): boolean {
|
|
260
278
|
return this.#rows.length === 0;
|