@ashx-j/lunr 0.2.26 → 0.2.27
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 +16 -1
- package/LICENSE +22 -0
- package/dist/builtin-extensions/ashxj-thinking.d.ts +1 -1
- package/dist/builtin-extensions/ashxj-thinking.d.ts.map +1 -1
- package/dist/builtin-extensions/ashxj-thinking.js +1 -1
- package/dist/builtin-extensions/ashxj-thinking.js.map +1 -1
- package/dist/builtin-extensions/ashxj-tui.d.ts +11 -1
- package/dist/builtin-extensions/ashxj-tui.d.ts.map +1 -1
- package/dist/builtin-extensions/ashxj-tui.js +6 -10
- package/dist/builtin-extensions/ashxj-tui.js.map +1 -1
- package/dist/builtin-extensions/lunr-cron.d.ts +4 -5
- package/dist/builtin-extensions/lunr-cron.d.ts.map +1 -1
- package/dist/builtin-extensions/lunr-cron.js +94 -108
- package/dist/builtin-extensions/lunr-cron.js.map +1 -1
- package/dist/builtin-extensions/lunr-local-providers/local-servers.d.ts.map +1 -1
- package/dist/builtin-extensions/lunr-local-providers/local-servers.js +3 -1
- package/dist/builtin-extensions/lunr-local-providers/local-servers.js.map +1 -1
- package/dist/builtin-extensions/narumiruna-pi-goal/src/commands.d.ts.map +1 -1
- package/dist/builtin-extensions/narumiruna-pi-goal/src/commands.js +2 -2
- package/dist/builtin-extensions/narumiruna-pi-goal/src/commands.js.map +1 -1
- package/dist/builtin-extensions/narumiruna-pi-goal/src/goal.d.ts.map +1 -1
- package/dist/builtin-extensions/narumiruna-pi-goal/src/goal.js +1 -1
- package/dist/builtin-extensions/narumiruna-pi-goal/src/goal.js.map +1 -1
- package/dist/builtin-extensions/narumiruna-pi-goal/src/runtime.d.ts.map +1 -1
- package/dist/builtin-extensions/narumiruna-pi-goal/src/runtime.js +1 -1
- package/dist/builtin-extensions/narumiruna-pi-goal/src/runtime.js.map +1 -1
- package/dist/builtin-extensions/pi-intercom/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-intercom/index.js +2 -2
- package/dist/builtin-extensions/pi-intercom/index.js.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/bemol-extension/index.d.ts +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/bemol-extension/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/bemol-extension/index.js +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/bemol-extension/index.js.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/index.js +1 -15
- package/dist/builtin-extensions/pi-lsp-extension/src/index.js.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/lsp-client.d.ts +6 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/lsp-client.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/lsp-client.js +187 -132
- package/dist/builtin-extensions/pi-lsp-extension/src/lsp-client.js.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/lsp-manager.d.ts +8 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/lsp-manager.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/lsp-manager.js +142 -112
- package/dist/builtin-extensions/pi-lsp-extension/src/lsp-manager.js.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/code-rewrite.d.ts +12 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/code-rewrite.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/code-rewrite.js +14 -7
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/code-rewrite.js.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/rewrite-engine.d.ts +11 -3
- package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/rewrite-engine.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/rewrite-engine.js +67 -41
- package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/rewrite-engine.js.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/search-engine.d.ts +4 -2
- package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/search-engine.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/search-engine.js +3 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/search-engine.js.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/commands.d.ts +2 -1
- package/dist/builtin-extensions/pi-mcp-adapter/commands.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/commands.js +6 -6
- package/dist/builtin-extensions/pi-mcp-adapter/commands.js.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/config.d.ts +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/config.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/config.js +11 -5
- package/dist/builtin-extensions/pi-mcp-adapter/config.js.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tool-executor.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tool-executor.js +2 -2
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tool-executor.js.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/host-html-template.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/host-html-template.js +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/host-html-template.js.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/index.js +48 -40
- package/dist/builtin-extensions/pi-mcp-adapter/index.js.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/init.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/init.js +3 -1
- package/dist/builtin-extensions/pi-mcp-adapter/init.js.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-auth-flow.d.ts +12 -40
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-auth-flow.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-auth-flow.js +166 -235
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-auth-flow.js.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-callback-server.d.ts +5 -0
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-callback-server.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-callback-server.js +43 -13
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-callback-server.js.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-oauth-provider.d.ts +14 -3
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-oauth-provider.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-oauth-provider.js +73 -21
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-oauth-provider.js.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/proxy-modes.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/proxy-modes.js +4 -4
- package/dist/builtin-extensions/pi-mcp-adapter/proxy-modes.js.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/server-manager.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/server-manager.js +2 -2
- package/dist/builtin-extensions/pi-mcp-adapter/server-manager.js.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/state.d.ts +2 -0
- package/dist/builtin-extensions/pi-mcp-adapter/state.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/state.js.map +1 -1
- package/dist/builtin-extensions/pi-ollama-cloud/index.d.ts +1 -1
- package/dist/builtin-extensions/pi-ollama-cloud/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-ollama-cloud/index.js +1 -1
- package/dist/builtin-extensions/pi-ollama-cloud/index.js.map +1 -1
- package/dist/builtin-extensions/pi-ollama-cloud/models.d.ts +11 -5
- package/dist/builtin-extensions/pi-ollama-cloud/models.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-ollama-cloud/models.js +12 -32
- package/dist/builtin-extensions/pi-ollama-cloud/models.js.map +1 -1
- package/dist/builtin-extensions/pi-prompt-template-model/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-prompt-template-model/index.js +5 -3
- package/dist/builtin-extensions/pi-prompt-template-model/index.js.map +1 -1
- package/dist/builtin-extensions/pi-prompt-template-model/prompt-loader.d.ts +2 -1
- package/dist/builtin-extensions/pi-prompt-template-model/prompt-loader.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-prompt-template-model/prompt-loader.js +21 -12
- package/dist/builtin-extensions/pi-prompt-template-model/prompt-loader.js.map +1 -1
- package/dist/builtin-extensions/pi-prompt-template-model/tool-manager.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-prompt-template-model/tool-manager.js +7 -24
- package/dist/builtin-extensions/pi-prompt-template-model/tool-manager.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/index.js +39 -77
- package/dist/builtin-extensions/pi-subagents/src/extension/index.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/notify.d.ts +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/notify.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/notify.js +15 -31
- package/dist/builtin-extensions/pi-subagents/src/runs/background/notify.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/result-watcher.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/result-watcher.js +7 -2
- package/dist/builtin-extensions/pi-subagents/src/runs/background/result-watcher.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.js +10 -2
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.js +8 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.js +106 -24
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js +25 -5
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.d.ts +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.d.ts +7 -8
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.js +60 -32
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/utils.d.ts +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/utils.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/utils.js +15 -5
- package/dist/builtin-extensions/pi-subagents/src/shared/utils.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/prompt-workflows.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/prompt-workflows.js +4 -3
- package/dist/builtin-extensions/pi-subagents/src/slash/prompt-workflows.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts +1 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/render.js +17 -8
- package/dist/builtin-extensions/pi-subagents/src/tui/render.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/review.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/review.js +3 -3
- package/dist/builtin-extensions/pi-subagents/src/watchdog/review.js.map +1 -1
- package/dist/builtin-extensions/pi-tps.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-tps.js +20 -17
- package/dist/builtin-extensions/pi-tps.js.map +1 -1
- package/dist/builtin-extensions/pi-web-access/activity.d.ts +1 -0
- package/dist/builtin-extensions/pi-web-access/activity.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-web-access/activity.js +27 -5
- package/dist/builtin-extensions/pi-web-access/activity.js.map +1 -1
- package/dist/builtin-extensions/pi-web-access/bounded-body.d.ts +3 -0
- package/dist/builtin-extensions/pi-web-access/bounded-body.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-web-access/bounded-body.js +43 -0
- package/dist/builtin-extensions/pi-web-access/bounded-body.js.map +1 -0
- package/dist/builtin-extensions/pi-web-access/content-page.d.ts +24 -0
- package/dist/builtin-extensions/pi-web-access/content-page.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-web-access/content-page.js +57 -0
- package/dist/builtin-extensions/pi-web-access/content-page.js.map +1 -0
- package/dist/builtin-extensions/pi-web-access/extract.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-web-access/extract.js +7 -2
- package/dist/builtin-extensions/pi-web-access/extract.js.map +1 -1
- package/dist/builtin-extensions/pi-web-access/github-extract.d.ts +0 -1
- package/dist/builtin-extensions/pi-web-access/github-extract.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-web-access/github-extract.js +147 -36
- package/dist/builtin-extensions/pi-web-access/github-extract.js.map +1 -1
- package/dist/builtin-extensions/pi-web-access/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-web-access/index.js +48 -73
- package/dist/builtin-extensions/pi-web-access/index.js.map +1 -1
- package/dist/builtin-extensions/pi-web-access/session-cleanup.d.ts +12 -4
- package/dist/builtin-extensions/pi-web-access/session-cleanup.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-web-access/session-cleanup.js +35 -12
- package/dist/builtin-extensions/pi-web-access/session-cleanup.js.map +1 -1
- package/dist/builtin-extensions/pi-web-access/storage.d.ts +9 -6
- package/dist/builtin-extensions/pi-web-access/storage.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-web-access/storage.js +36 -24
- package/dist/builtin-extensions/pi-web-access/storage.js.map +1 -1
- package/dist/builtin-extensions/simple-pi-memory.d.ts +1 -1
- package/dist/builtin-extensions/simple-pi-memory.d.ts.map +1 -1
- package/dist/builtin-extensions/simple-pi-memory.js +1 -1
- package/dist/builtin-extensions/simple-pi-memory.js.map +1 -1
- package/dist/cli/install-cli.d.ts.map +1 -1
- package/dist/cli/install-cli.js +38 -30
- package/dist/cli/install-cli.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +13 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +75 -11
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-services.d.ts +1 -0
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +1 -0
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session.d.ts +40 -6
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +309 -76
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/browser/runtime.d.ts +2 -0
- package/dist/core/browser/runtime.d.ts.map +1 -1
- package/dist/core/browser/runtime.js +80 -45
- package/dist/core/browser/runtime.js.map +1 -1
- package/dist/core/browser/setup.d.ts.map +1 -1
- package/dist/core/browser/setup.js +12 -1
- package/dist/core/browser/setup.js.map +1 -1
- package/dist/core/computer-use/adapter.d.ts.map +1 -1
- package/dist/core/computer-use/adapter.js +7 -2
- package/dist/core/computer-use/adapter.js.map +1 -1
- package/dist/core/computer-use/image.d.ts.map +1 -1
- package/dist/core/computer-use/image.js +17 -5
- package/dist/core/computer-use/image.js.map +1 -1
- package/dist/core/computer-use/schemas.d.ts.map +1 -1
- package/dist/core/computer-use/schemas.js +23 -6
- package/dist/core/computer-use/schemas.js.map +1 -1
- package/dist/core/computer-use/workflow.d.ts.map +1 -1
- package/dist/core/computer-use/workflow.js +459 -119
- package/dist/core/computer-use/workflow.js.map +1 -1
- package/dist/core/cron/jobs.d.ts +26 -8
- package/dist/core/cron/jobs.d.ts.map +1 -1
- package/dist/core/cron/jobs.js +357 -232
- package/dist/core/cron/jobs.js.map +1 -1
- package/dist/core/cron/origin-context.d.ts +1 -0
- package/dist/core/cron/origin-context.d.ts.map +1 -1
- package/dist/core/cron/origin-context.js.map +1 -1
- package/dist/core/cron/scheduler.d.ts +22 -17
- package/dist/core/cron/scheduler.d.ts.map +1 -1
- package/dist/core/cron/scheduler.js +153 -73
- package/dist/core/cron/scheduler.js.map +1 -1
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +1 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +8 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +8 -0
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts +4 -0
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js +22 -1
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/large-subagent-launch.d.ts +1 -1
- package/dist/core/large-subagent-launch.d.ts.map +1 -1
- package/dist/core/large-subagent-launch.js +7 -7
- package/dist/core/large-subagent-launch.js.map +1 -1
- package/dist/core/model-registry.d.ts +2 -0
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +5 -0
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-runtime.d.ts +4 -1
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +40 -4
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/permissions.d.ts +3 -3
- package/dist/core/permissions.d.ts.map +1 -1
- package/dist/core/permissions.js +11 -35
- package/dist/core/permissions.js.map +1 -1
- package/dist/core/plan-mode.d.ts +5 -13
- package/dist/core/plan-mode.d.ts.map +1 -1
- package/dist/core/plan-mode.js +126 -116
- package/dist/core/plan-mode.js.map +1 -1
- package/dist/core/project-trust.d.ts.map +1 -1
- package/dist/core/project-trust.js +1 -1
- package/dist/core/project-trust.js.map +1 -1
- package/dist/core/prompt-resource-bridge.d.ts +12 -0
- package/dist/core/prompt-resource-bridge.d.ts.map +1 -0
- package/dist/core/prompt-resource-bridge.js +9 -0
- package/dist/core/prompt-resource-bridge.js.map +1 -0
- package/dist/core/protected-targets.d.ts +6 -0
- package/dist/core/protected-targets.d.ts.map +1 -0
- package/dist/core/protected-targets.js +45 -0
- package/dist/core/protected-targets.js.map +1 -0
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +7 -0
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/rollback.d.ts +19 -3
- package/dist/core/rollback.d.ts.map +1 -1
- package/dist/core/rollback.js +172 -56
- package/dist/core/rollback.js.map +1 -1
- package/dist/core/runtime-credentials.d.ts +3 -0
- package/dist/core/runtime-credentials.d.ts.map +1 -1
- package/dist/core/runtime-credentials.js +14 -1
- package/dist/core/runtime-credentials.js.map +1 -1
- package/dist/core/sdk.d.ts +3 -0
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +1 -0
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager.d.ts +6 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +95 -32
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/session-ownership.d.ts.map +1 -1
- package/dist/core/session-ownership.js +8 -3
- package/dist/core/session-ownership.js.map +1 -1
- package/dist/core/session-retention.d.ts.map +1 -1
- package/dist/core/session-retention.js +18 -7
- package/dist/core/session-retention.js.map +1 -1
- package/dist/core/session-startup-settings.d.ts +10 -0
- package/dist/core/session-startup-settings.d.ts.map +1 -0
- package/dist/core/session-startup-settings.js +70 -0
- package/dist/core/session-startup-settings.js.map +1 -0
- package/dist/core/subscriptions.d.ts +16 -7
- package/dist/core/subscriptions.d.ts.map +1 -1
- package/dist/core/subscriptions.js +96 -55
- package/dist/core/subscriptions.js.map +1 -1
- package/dist/core/trust-manager.d.ts +2 -1
- package/dist/core/trust-manager.d.ts.map +1 -1
- package/dist/core/trust-manager.js +6 -1
- package/dist/core/trust-manager.js.map +1 -1
- package/dist/core/update-check.d.ts.map +1 -1
- package/dist/core/update-check.js.map +1 -1
- package/dist/core/usage-adapters/kimi-coding.d.ts +2 -2
- package/dist/core/usage-adapters/kimi-coding.d.ts.map +1 -1
- package/dist/core/usage-adapters/kimi-coding.js +2 -2
- package/dist/core/usage-adapters/kimi-coding.js.map +1 -1
- package/dist/core/usage-adapters/openai-codex.d.ts +3 -2
- package/dist/core/usage-adapters/openai-codex.d.ts.map +1 -1
- package/dist/core/usage-adapters/openai-codex.js +3 -3
- package/dist/core/usage-adapters/openai-codex.js.map +1 -1
- package/dist/core/usage-adapters/xai.d.ts +2 -2
- package/dist/core/usage-adapters/xai.d.ts.map +1 -1
- package/dist/core/usage-adapters/xai.js +3 -3
- package/dist/core/usage-adapters/xai.js.map +1 -1
- package/dist/core/usage-adapters/zai.d.ts +2 -2
- package/dist/core/usage-adapters/zai.d.ts.map +1 -1
- package/dist/core/usage-adapters/zai.js +2 -2
- package/dist/core/usage-adapters/zai.js.map +1 -1
- package/dist/core/usage-service.d.ts +9 -2
- package/dist/core/usage-service.d.ts.map +1 -1
- package/dist/core/usage-service.js +95 -50
- package/dist/core/usage-service.js.map +1 -1
- package/dist/gateway/agent-bridge.d.ts +9 -1
- package/dist/gateway/agent-bridge.d.ts.map +1 -1
- package/dist/gateway/agent-bridge.js +91 -37
- package/dist/gateway/agent-bridge.js.map +1 -1
- package/dist/gateway/buttons.d.ts +8 -1
- package/dist/gateway/buttons.d.ts.map +1 -1
- package/dist/gateway/buttons.js +76 -18
- package/dist/gateway/buttons.js.map +1 -1
- package/dist/gateway/commands.d.ts +1 -0
- package/dist/gateway/commands.d.ts.map +1 -1
- package/dist/gateway/commands.js +10 -4
- package/dist/gateway/commands.js.map +1 -1
- package/dist/gateway/cron.d.ts +12 -11
- package/dist/gateway/cron.d.ts.map +1 -1
- package/dist/gateway/cron.js +65 -56
- package/dist/gateway/cron.js.map +1 -1
- package/dist/gateway/index.d.ts.map +1 -1
- package/dist/gateway/index.js +2 -1
- package/dist/gateway/index.js.map +1 -1
- package/dist/gateway/mobile-commands.d.ts +1 -0
- package/dist/gateway/mobile-commands.d.ts.map +1 -1
- package/dist/gateway/mobile-commands.js +56 -14
- package/dist/gateway/mobile-commands.js.map +1 -1
- package/dist/gateway/presenter.d.ts +12 -2
- package/dist/gateway/presenter.d.ts.map +1 -1
- package/dist/gateway/presenter.js +73 -38
- package/dist/gateway/presenter.js.map +1 -1
- package/dist/gateway/router.d.ts +2 -2
- package/dist/gateway/router.d.ts.map +1 -1
- package/dist/gateway/router.js +17 -2
- package/dist/gateway/router.js.map +1 -1
- package/dist/gateway/service.d.ts +2 -0
- package/dist/gateway/service.d.ts.map +1 -1
- package/dist/gateway/service.js +153 -0
- package/dist/gateway/service.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +86 -33
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +6 -4
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/copyable-text.d.ts.map +1 -1
- package/dist/modes/interactive/components/copyable-text.js +3 -2
- package/dist/modes/interactive/components/copyable-text.js.map +1 -1
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-editor.js +1 -1
- package/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +2 -2
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +96 -109
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/smooth-streaming.d.ts.map +1 -1
- package/dist/modes/interactive/smooth-streaming.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +2 -1
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/node-runtime/{adapter-VFG7WNPX.js → adapter-247RTYLS.js} +4 -5
- package/dist/node-runtime/agent-session-services-KDMSPQDY.js +53 -0
- package/dist/node-runtime/{brave-UWDA3I22.js → brave-2AFFAXNN.js} +1 -1
- package/dist/node-runtime/{builtin-extensions-I2HIFEMY.js → builtin-extensions-OX6KELNX.js} +8 -7
- package/dist/node-runtime/{chunk-QH6YL7VK.js → chunk-252ZVPPF.js} +3 -3
- package/dist/node-runtime/{chunk-PCEW76PM.js → chunk-2OIPYKLZ.js} +6 -6
- package/dist/node-runtime/{chunk-XBWPBZBN.js → chunk-2SWW7KMW.js} +1 -1
- package/dist/node-runtime/{chunk-UQUCFAJ3.js → chunk-2VIW3IMF.js} +40 -7
- package/dist/node-runtime/{chunk-UOEDI7RP.js → chunk-4KNKQGHM.js} +2 -2
- package/dist/node-runtime/{chunk-FQMM2EZ2.js → chunk-64XTQNLA.js} +29 -7
- package/dist/node-runtime/{chunk-SPVDBUOS.js → chunk-6O3IW3IA.js} +2 -2
- package/dist/node-runtime/{chunk-5ZQXRPMC.js → chunk-6ZZHGUSA.js} +2 -2
- package/dist/node-runtime/chunk-A2WO6WIN.js +1197 -0
- package/dist/node-runtime/{chunk-WIF24I7G.js → chunk-APVM5NEU.js} +149 -144
- package/dist/node-runtime/{chunk-RCR3XAQY.js → chunk-AYHH7YSD.js} +177 -144
- package/dist/node-runtime/{chunk-LWYIVUGV.js → chunk-B2IBAXNX.js} +48 -31
- package/dist/node-runtime/{chunk-M3LZLQW2.js → chunk-BDRGN3L2.js} +1 -0
- package/dist/node-runtime/{chunk-GJ2RDBRL.js → chunk-BYC6RKCN.js} +4 -2
- package/dist/node-runtime/{chunk-UVWCDQYF.js → chunk-C3P6Q3B2.js} +455 -278
- package/dist/node-runtime/{chunk-SN2KSMPQ.js → chunk-DQSCFU7R.js} +13 -7
- package/dist/node-runtime/{chunk-4SBQAI4T.js → chunk-EBLAZVSA.js} +2058 -73
- package/dist/node-runtime/{chunk-2KIPT4HJ.js → chunk-EPR2F3GU.js} +68 -20
- package/dist/node-runtime/{chunk-CSFI6YXL.js → chunk-ES6PBSIE.js} +1 -1
- package/dist/node-runtime/{chunk-IF24A3FH.js → chunk-EVM653DD.js} +4 -4
- package/dist/node-runtime/{chunk-HTFRRDSF.js → chunk-F2SMQ6ES.js} +3 -2
- package/dist/node-runtime/chunk-F2V2F4ZG.js +114 -0
- package/dist/node-runtime/{chunk-IKU6Y7DL.js → chunk-FE3WZI7F.js} +9 -6
- package/dist/node-runtime/{chunk-GYIXXQAO.js → chunk-FIRA54AC.js} +2 -5
- package/dist/node-runtime/{chunk-6VYZ5UFP.js → chunk-FLGEEH27.js} +1 -1
- package/dist/node-runtime/{chunk-5EFIU3OM.js → chunk-FTKEZL27.js} +1 -1
- package/dist/node-runtime/{chunk-RGQAEOM5.js → chunk-FYIFPFXE.js} +23 -6
- package/dist/node-runtime/{chunk-HMBGROQK.js → chunk-GLDXBBL6.js} +3 -3
- package/dist/node-runtime/{chunk-KWA4OC2J.js → chunk-H6YBCWKG.js} +1 -1
- package/dist/node-runtime/{chunk-2MI5OPMN.js → chunk-HNNHHJAB.js} +68 -50
- package/dist/node-runtime/{chunk-I74LN5JG.js → chunk-HUD2RFJW.js} +2 -2
- package/dist/node-runtime/{chunk-I54LGHWM.js → chunk-I2H5QMWW.js} +3 -3
- package/dist/node-runtime/{chunk-XHIRAZ26.js → chunk-IAZSK7KK.js} +1 -1
- package/dist/node-runtime/{chunk-X3PGBLQ7.js → chunk-IHHTWSXN.js} +9 -9
- package/dist/node-runtime/{chunk-DAPBPCBP.js → chunk-IPP5BIV5.js} +25 -3
- package/dist/node-runtime/{chunk-QFWG2RVL.js → chunk-IXG6F4NT.js} +11 -0
- package/dist/node-runtime/{chunk-RDDAZOMU.js → chunk-JL4HYQXK.js} +1 -1
- package/dist/node-runtime/{chunk-CDVHZOOK.js → chunk-JQYNHAKX.js} +1 -1
- package/dist/node-runtime/{chunk-L24TPBS4.js → chunk-JWEVT363.js} +37 -29
- package/dist/node-runtime/{chunk-2HMIRK7W.js → chunk-LHV3V67B.js} +5 -5
- package/dist/node-runtime/{chunk-UAEOTO52.js → chunk-MNQXDFPV.js} +6 -2
- package/dist/node-runtime/{chunk-T4DA4XE7.js → chunk-MQPKUHRN.js} +162 -82
- package/dist/node-runtime/{chunk-MPKSOJBT.js → chunk-NHATCSOI.js} +4 -7
- package/dist/node-runtime/{chunk-RMQZU2YU.js → chunk-NNNR3QIY.js} +1 -1
- package/dist/node-runtime/{chunk-RWTKOC3B.js → chunk-QBTJG3UM.js} +1 -1
- package/dist/node-runtime/{chunk-P7XBVXGT.js → chunk-QNVMKNNN.js} +18 -14
- package/dist/node-runtime/{chunk-GS42T6MX.js → chunk-QW3AAHWN.js} +1 -1
- package/dist/node-runtime/{chunk-DVQSHCVP.js → chunk-R4WSB2MQ.js} +5 -5
- package/dist/node-runtime/{chunk-B4HP6ZWM.js → chunk-RHCGYWO7.js} +1 -1
- package/dist/node-runtime/{chunk-2CFDTH5B.js → chunk-RLGY2QIL.js} +45 -59
- package/dist/node-runtime/{chunk-KKUTQQV7.js → chunk-RYRGL7P4.js} +1 -1
- package/dist/node-runtime/{chunk-5Q4A37RB.js → chunk-TCT6PCUR.js} +32 -11
- package/dist/node-runtime/{chunk-D5UCKPBQ.js → chunk-UBWW2PID.js} +1 -1
- package/dist/node-runtime/{chunk-E75WFZ33.js → chunk-UNUZICC4.js} +3 -3
- package/dist/node-runtime/{chunk-RAK2QA2B.js → chunk-UYRKUKFE.js} +4 -4
- package/dist/node-runtime/{chunk-LWJXTA6Z.js → chunk-VSUEAI7O.js} +1377 -45
- package/dist/node-runtime/{chunk-NAY6UUQZ.js → chunk-WDIVLMOH.js} +1 -1
- package/dist/node-runtime/{chunk-E24EO34J.js → chunk-WPXUR3HE.js} +1 -1
- package/dist/node-runtime/{chunk-SLVOAQOY.js → chunk-WXYNALHD.js} +113 -1
- package/dist/node-runtime/{chunk-KJ6DWS3K.js → chunk-XEOCUEUJ.js} +121 -60
- package/dist/node-runtime/chunk-YD3IZAZ7.js +47 -0
- package/dist/node-runtime/chunk-YSB6URMT.js +41 -0
- package/dist/node-runtime/{chunk-LJTIVM7I.js → chunk-ZDJUR45D.js} +427 -126
- package/dist/node-runtime/{chunk-YWOJIGFY.js → chunk-ZEVFBFNF.js} +95 -142
- package/dist/node-runtime/{chunk-5B6VKFEV.js → chunk-ZIQUS5QO.js} +1 -1
- package/dist/node-runtime/cli-runtime.js +4 -4
- package/dist/node-runtime/{command-FSBU2EVZ.js → command-3HMSY6W2.js} +5 -5
- package/dist/node-runtime/{commands-EMBQQVVT.js → commands-D6A6H4TS.js} +11 -18
- package/dist/node-runtime/{commands-NAAL7KNT.js → commands-OCSSEEWJ.js} +16 -16
- package/dist/node-runtime/{config-QDD5PUE2.js → config-CU7M7BTK.js} +1 -1
- package/dist/node-runtime/{config-D4QUPAHX.js → config-DS7XLMEM.js} +2 -2
- package/dist/node-runtime/{direct-tool-executor-4D7UXYU4.js → direct-tool-executor-2QJXVQD2.js} +6 -11
- package/dist/node-runtime/{exa-LL64QZR2.js → exa-6VBZNPGE.js} +1 -1
- package/dist/node-runtime/{export-html-VM4J2MNR.js → export-html-BRWF5AHI.js} +4 -4
- package/dist/node-runtime/{extension-input-E7BJZ35H.js → extension-input-VBBMX7YV.js} +5 -5
- package/dist/node-runtime/{extension-selector-WU42XDTU.js → extension-selector-T5AOG5XB.js} +5 -5
- package/dist/node-runtime/{extract-EQJE7FZZ.js → extract-BFX2N35A.js} +3 -3
- package/dist/node-runtime/{gateway-DQM333YV.js → gateway-6623C2U3.js} +51 -42
- package/dist/node-runtime/{gemini-search-35OCRFLN.js → gemini-search-C66QHDT6.js} +2 -2
- package/dist/node-runtime/{gemini-url-context-UQY3PHHW.js → gemini-url-context-T7DEK73R.js} +3 -3
- package/dist/node-runtime/{github-extract-F64RZOEA.js → github-extract-HOGE3D6F.js} +107 -38
- package/dist/node-runtime/{goal-NJEE5CTU.js → goal-AIHEDUYA.js} +5 -5
- package/dist/node-runtime/index.js +50 -48
- package/dist/node-runtime/{init-P5AUV77I.js → init-JBQJIPYI.js} +3 -6
- package/dist/node-runtime/{install-cli-NN4YAU44.js → install-cli-INGHIVBY.js} +30 -25
- package/dist/node-runtime/interactive-mode-FM5DNUSW.js +74 -0
- package/dist/node-runtime/{interactive-view-NGFAMHPW.js → interactive-view-K33PM4OS.js} +8 -8
- package/dist/node-runtime/{lsp-manager-3ASUSO4T.js → lsp-manager-S554V5HR.js} +240 -155
- package/dist/node-runtime/{lunr-browser-IR7TL3J7.js → lunr-browser-H4FDOR3C.js} +7 -7
- package/dist/node-runtime/{lunr-computer-use-Y23CCDIJ.js → lunr-computer-use-VDP2QNRQ.js} +9 -9
- package/dist/node-runtime/{lunr-cron-USHC4LXH.js → lunr-cron-LKVA5CZZ.js} +93 -80
- package/dist/node-runtime/main.js +42 -41
- package/dist/node-runtime/{mobile-commands-O5LCHL32.js → mobile-commands-XT3NQXLD.js} +12 -12
- package/dist/node-runtime/{model-runtime-OO5HFLWE.js → model-runtime-MZ2JMDV4.js} +4 -4
- package/dist/node-runtime/{openai-search-B3MSNCQA.js → openai-search-K72LJDYN.js} +1 -1
- package/dist/node-runtime/{package-manager-cli-Q7BL6KZO.js → package-manager-cli-CYM262SI.js} +20 -20
- package/dist/node-runtime/{parallel-AI2MNSCU.js → parallel-X724NCNU.js} +1 -1
- package/dist/node-runtime/{perplexity-QVJW3I35.js → perplexity-RDHQHVMK.js} +2 -2
- package/dist/node-runtime/{pi-intercom-QM53RLTS.js → pi-intercom-NHHEPBMI.js} +2 -2
- package/dist/node-runtime/{pi-mcp-adapter-3PHF4KZ4.js → pi-mcp-adapter-PP3GQJQ2.js} +98 -94
- package/dist/node-runtime/{pi-ollama-cloud-2F3Y2QNM.js → pi-ollama-cloud-4MNWIMFN.js} +11 -24
- package/dist/node-runtime/{pi-prompt-template-model-QWTCGLJU.js → pi-prompt-template-model-FTGELLS5.js} +32 -36
- package/dist/node-runtime/{pi-subagents-7IBSSGEW.js → pi-subagents-LT3CTO4E.js} +98 -106
- package/dist/node-runtime/{pi-web-access-WTGMNZ32.js → pi-web-access-Z3LP246C.js} +144 -108
- package/dist/node-runtime/{print-mode-XQ76CYMT.js → print-mode-2XHN5SUA.js} +3 -3
- package/dist/node-runtime/{process-registry-4FAKZQOL.js → process-registry-Q4QWIU33.js} +3 -3
- package/dist/node-runtime/{proxy-modes-5FAPSZEZ.js → proxy-modes-VEGC6QG5.js} +8 -15
- package/dist/node-runtime/rpc-entry.js +42 -41
- package/dist/node-runtime/{rpc-mode-O3XV4SID.js → rpc-mode-32DHJPEJ.js} +4 -4
- package/dist/node-runtime/{runtime-4VA6JKNF.js → runtime-EDUUGAQD.js} +56 -46
- package/dist/node-runtime/{runtime-EFPPD2UW.js → runtime-UGXM4NPQ.js} +2 -2
- package/dist/node-runtime/{runtime-bridges-7WVCLI76.js → runtime-bridges-DNKMNJCF.js} +7 -7
- package/dist/node-runtime/{service-MDQIPQ26.js → service-IHLGFLBT.js} +6 -4
- package/dist/node-runtime/{session-handoff-GWARVEWT.js → session-handoff-LNSPDTKY.js} +4 -4
- package/dist/node-runtime/{session-manager-JB5J6XBN.js → session-manager-YIFIAVGC.js} +3 -3
- package/dist/node-runtime/{session-selector-GIM4DHQ2.js → session-selector-I73U3EIO.js} +7 -7
- package/dist/node-runtime/{settings-manager-DJDM5AHM.js → settings-manager-P2TKGYTR.js} +5 -5
- package/dist/node-runtime/{setup-JBKOLJ6F.js → setup-H7CCELIL.js} +15 -1
- package/dist/node-runtime/{setup-PFBWRNUI.js → setup-OLQ4GXWS.js} +17 -17
- package/dist/node-runtime/{src-IVPNZ2BX.js → src-6RV4PXKJ.js} +64 -36
- package/dist/node-runtime/{subagent-executor-LPZ4BHWE.js → subagent-executor-Q5F7DBVM.js} +119 -58
- package/dist/node-runtime/{tavily-WEZFVFP7.js → tavily-KZBFYQB6.js} +1 -1
- package/dist/node-runtime/{theme-UOO5RVFN.js → theme-YLVZKKZD.js} +2 -2
- package/dist/node-runtime/{trust-manager-MMISNCYO.js → trust-manager-ZCU76D23.js} +2 -2
- package/dist/node-runtime/{update-cli-HNMOTNGX.js → update-cli-F3XXJANQ.js} +6 -6
- package/dist/node-runtime/{usage-service-LFB2SWYV.js → usage-service-CPAGBED5.js} +1 -1
- package/dist/node-runtime/{video-extract-OOZHR7SU.js → video-extract-UPKYIBW3.js} +3 -3
- package/dist/node-runtime/{workflow-OHPBEFO4.js → workflow-ICDI4N3J.js} +208 -78
- package/dist/node-runtime/{youtube-extract-FNPAUNHU.js → youtube-extract-77NT7FWH.js} +4 -4
- package/dist/utils/clipboard-image.d.ts.map +1 -1
- package/dist/utils/clipboard-image.js.map +1 -1
- package/dist/utils/exif-orientation.d.ts.map +1 -1
- package/dist/utils/exif-orientation.js +25 -10
- package/dist/utils/exif-orientation.js.map +1 -1
- package/dist/utils/image-resize-core.d.ts.map +1 -1
- package/dist/utils/image-resize-core.js +2 -0
- package/dist/utils/image-resize-core.js.map +1 -1
- package/dist/utils/paths.d.ts +4 -0
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +33 -2
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/sanitize-terminal-text.d.ts +7 -0
- package/dist/utils/sanitize-terminal-text.d.ts.map +1 -0
- package/dist/utils/sanitize-terminal-text.js +67 -0
- package/dist/utils/sanitize-terminal-text.js.map +1 -0
- package/docs/browser.md +1 -1
- package/docs/custom-provider.md +3 -3
- package/docs/extensions.md +8 -4
- package/docs/features.md +15 -7
- package/docs/keybindings.md +1 -1
- package/docs/models.md +5 -5
- package/docs/packages.md +1 -1
- package/docs/providers.md +2 -2
- package/docs/rpc.md +7 -7
- package/docs/security.md +10 -5
- package/docs/sessions.md +2 -2
- package/docs/skills.md +1 -1
- package/docs/terminal-setup.md +7 -7
- package/docs/themes.md +1 -1
- package/docs/usage.md +1 -1
- package/examples/extensions/auto-commit-on-exit.ts +1 -1
- package/examples/extensions/bash-spawn-hook.ts +1 -1
- package/examples/extensions/built-in-tool-renderer.ts +1 -1
- package/examples/extensions/claude-rules.ts +1 -1
- package/examples/extensions/commands.ts +1 -1
- package/examples/extensions/custom-compaction.ts +1 -1
- package/examples/extensions/custom-provider-anthropic/index.ts +3 -3
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/index.ts +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/doom-overlay/index.ts +1 -1
- package/examples/extensions/git-merge-and-resolve.ts +2 -2
- package/examples/extensions/gondolin/index.ts +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/hidden-thinking-label.ts +1 -1
- package/examples/extensions/inline-bash.ts +2 -2
- package/examples/extensions/input-transform-streaming.ts +2 -2
- package/examples/extensions/input-transform.ts +2 -2
- package/examples/extensions/interactive-shell.ts +1 -1
- package/examples/extensions/kimi-deferred-tools.ts +1 -1
- package/examples/extensions/mac-system-theme.ts +1 -1
- package/examples/extensions/minimal-mode.ts +1 -1
- package/examples/extensions/modal-editor.ts +1 -1
- package/examples/extensions/model-status.ts +1 -1
- package/examples/extensions/notify.ts +3 -3
- package/examples/extensions/overlay-qa-tests.ts +1 -1
- package/examples/extensions/overlay-test.ts +1 -1
- package/examples/extensions/pirate.ts +1 -1
- package/examples/extensions/preset.ts +3 -3
- package/examples/extensions/project-trust.ts +4 -4
- package/examples/extensions/prompt-customizer.ts +1 -1
- package/examples/extensions/rainbow-editor.ts +1 -1
- package/examples/extensions/rpc-demo.ts +1 -1
- package/examples/extensions/sandbox/index.ts +7 -7
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/shutdown-command.ts +5 -5
- package/examples/extensions/ssh.ts +2 -2
- package/examples/extensions/subagent/README.md +3 -3
- package/examples/extensions/subagent/index.ts +2 -2
- package/examples/extensions/titlebar-spinner.ts +1 -1
- package/examples/extensions/tool-override.ts +1 -1
- package/examples/extensions/tools.ts +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/extensions/working-indicator.ts +1 -1
- package/examples/extensions/working-message-test.ts +1 -1
- package/examples/sdk/01-minimal.ts +1 -1
- package/examples/sdk/03-custom-prompt.ts +1 -1
- package/examples/sdk/04-skills.ts +1 -1
- package/examples/sdk/06-extensions.ts +2 -2
- package/examples/sdk/08-prompt-templates.ts +1 -1
- package/install-lock/package-lock.json +24 -24
- package/install-lock/package.json +2 -2
- package/npm-shrinkwrap.json +60 -24
- package/package.json +9 -9
- package/dist/modes/interactive/components/exit-card.d.ts +0 -22
- package/dist/modes/interactive/components/exit-card.d.ts.map +0 -1
- package/dist/modes/interactive/components/exit-card.js +0 -69
- package/dist/modes/interactive/components/exit-card.js.map +0 -1
- package/dist/node-runtime/agent-session-services-5YXS2PLF.js +0 -51
- package/dist/node-runtime/chunk-2IDTZAG5.js +0 -1415
- package/dist/node-runtime/chunk-3MISGG4S.js +0 -769
- package/dist/node-runtime/chunk-4HXHDDCF.js +0 -16
- package/dist/node-runtime/chunk-5B5QN3ZQ.js +0 -356
- package/dist/node-runtime/chunk-7IQGBKBJ.js +0 -2033
- package/dist/node-runtime/chunk-AUXVGBO4.js +0 -19
- package/dist/node-runtime/chunk-PTFBPO3C.js +0 -50
- package/dist/node-runtime/interactive-mode-YOHZVMKX.js +0 -74
- package/dist/node-runtime/mcp-auth-flow-QVLFVLEO.js +0 -33
|
@@ -29,11 +29,13 @@ import { emitSessionShutdownEvent } from "./extensions/runner.js";
|
|
|
29
29
|
import { MEMORY_TOOL_NAMES } from "./memory-cap.js";
|
|
30
30
|
import { isUserInstructionsPath, loadSelectedUserInstructions } from "./model-instructions.js";
|
|
31
31
|
import { ModelRegistry } from "./model-registry.js";
|
|
32
|
-
import { gateToolCall } from "./permissions.js";
|
|
32
|
+
import { AUTO_MODE_ADDENDUM, deletePermissionContext, gateToolCall, getPermissionMode, initializePermissionContext, setPermissionMode, } from "./permissions.js";
|
|
33
|
+
import { READ_ONLY_MODE_ADDENDUM } from "./plan-mode.js";
|
|
33
34
|
import { expandPromptTemplate } from "./prompt-templates.js";
|
|
34
35
|
import { rollbackSnapshotBeforeWrite } from "./rollback.js";
|
|
35
36
|
import { CURRENT_SESSION_VERSION, getLatestCompactionEntry } from "./session-manager.js";
|
|
36
37
|
import { createSyntheticSourceInfo } from "./source-info.js";
|
|
38
|
+
import { isSubagentChildProcess, resolveChildRuntimePermissionMode, SUBAGENT_CHILD_PERMISSION_ENV, } from "./subagent-permission-inherit.js";
|
|
37
39
|
import { registerSubagentWaitInterruptionOwner, } from "./subagent-wait-interruption.js";
|
|
38
40
|
import { buildSystemPrompt } from "./system-prompt.js";
|
|
39
41
|
import { measureStartup } from "./timings.js";
|
|
@@ -113,7 +115,12 @@ export class AgentSession {
|
|
|
113
115
|
_retryAbortController = undefined;
|
|
114
116
|
_retryAttempt = 0;
|
|
115
117
|
// Bash execution state
|
|
116
|
-
|
|
118
|
+
_bashOperations = new Map();
|
|
119
|
+
_operations = new Set();
|
|
120
|
+
_closing = false;
|
|
121
|
+
_disposed = false;
|
|
122
|
+
_drainPromise;
|
|
123
|
+
_shutdownPromise;
|
|
117
124
|
_pendingBashMessages = [];
|
|
118
125
|
// Extension system
|
|
119
126
|
_extensionRunner;
|
|
@@ -146,7 +153,7 @@ export class AgentSession {
|
|
|
146
153
|
_baseSystemPrompt = "";
|
|
147
154
|
_baseSystemPromptOptions;
|
|
148
155
|
_systemPromptOverride;
|
|
149
|
-
//
|
|
156
|
+
// Optional host-owned prompt append, separate from session permission guidance.
|
|
150
157
|
_systemPromptAppend;
|
|
151
158
|
// lunr: core-owned tool-call gates (read-only mode) checked before extension tool_call handlers
|
|
152
159
|
_toolCallGates = [];
|
|
@@ -154,6 +161,13 @@ export class AgentSession {
|
|
|
154
161
|
this.agent = config.agent;
|
|
155
162
|
this.sessionManager = config.sessionManager;
|
|
156
163
|
this.settingsManager = config.settingsManager;
|
|
164
|
+
const permissionMode = config.permissionMode ??
|
|
165
|
+
(isSubagentChildProcess()
|
|
166
|
+
? resolveChildRuntimePermissionMode(process.env[SUBAGENT_CHILD_PERMISSION_ENV])
|
|
167
|
+
: undefined) ??
|
|
168
|
+
this.sessionManager.getPermissionMode() ??
|
|
169
|
+
this.settingsManager.getDefaultPermissionMode();
|
|
170
|
+
initializePermissionContext(this.sessionId, permissionMode, config.permissionMode);
|
|
157
171
|
this._scopedModels = config.scopedModels ?? [];
|
|
158
172
|
this._resourceLoader = config.resourceLoader;
|
|
159
173
|
this._customTools = config.customTools ?? [];
|
|
@@ -435,6 +449,8 @@ export class AgentSession {
|
|
|
435
449
|
}
|
|
436
450
|
}
|
|
437
451
|
}
|
|
452
|
+
if (event.type === "message_end")
|
|
453
|
+
this._activePromptRun?.completion?.messages.push(event.message);
|
|
438
454
|
// Emit to extensions first
|
|
439
455
|
await this._emitExtensionEvent(event);
|
|
440
456
|
// Notify all listeners
|
|
@@ -659,27 +675,80 @@ export class AgentSession {
|
|
|
659
675
|
}
|
|
660
676
|
assertCanStartWork() {
|
|
661
677
|
this.sessionManager.assertWritable();
|
|
678
|
+
if (this._closing)
|
|
679
|
+
throw new Error("Session is closing. New work is not accepted.");
|
|
662
680
|
if (this.transferring)
|
|
663
681
|
throw new Error("Session transfer is in progress. Wait or reclaim the session.");
|
|
664
682
|
}
|
|
665
|
-
|
|
683
|
+
/** Stop admission synchronously, retaining listeners and session ownership. */
|
|
684
|
+
stopAdmission() {
|
|
685
|
+
this._closing = true;
|
|
666
686
|
this._invalidateWaitPromptHandoffs("Session closed before the pending prompt could run.");
|
|
667
|
-
|
|
668
|
-
|
|
687
|
+
}
|
|
688
|
+
async _trackOperation(operation) {
|
|
689
|
+
let settle = () => { };
|
|
690
|
+
const completion = new Promise((resolve) => {
|
|
691
|
+
settle = resolve;
|
|
692
|
+
});
|
|
693
|
+
this._operations.add(completion);
|
|
669
694
|
try {
|
|
670
|
-
|
|
671
|
-
this.abortCompaction();
|
|
672
|
-
this.abortBranchSummary();
|
|
673
|
-
this.abortBash();
|
|
674
|
-
this.agent.abort();
|
|
695
|
+
return await operation();
|
|
675
696
|
}
|
|
676
|
-
|
|
677
|
-
|
|
697
|
+
finally {
|
|
698
|
+
this._operations.delete(completion);
|
|
699
|
+
settle();
|
|
678
700
|
}
|
|
701
|
+
}
|
|
702
|
+
/** Cancel owned work and wait for final persistence before extension shutdown. */
|
|
703
|
+
drain() {
|
|
704
|
+
if (this._drainPromise)
|
|
705
|
+
return this._drainPromise;
|
|
706
|
+
this.stopAdmission();
|
|
707
|
+
if (this._activePromptRun)
|
|
708
|
+
this._activePromptRun.gracefulStopRequested = true;
|
|
709
|
+
this.abortRetry();
|
|
710
|
+
this.abortCompaction();
|
|
711
|
+
this.abortBranchSummary();
|
|
712
|
+
this.abortBash();
|
|
713
|
+
this.clearQueue();
|
|
714
|
+
this.agent.abort();
|
|
715
|
+
this._drainPromise = (async () => {
|
|
716
|
+
await Promise.all([...this._operations]);
|
|
717
|
+
await this.waitForIdle();
|
|
718
|
+
await this.agent.waitForIdle();
|
|
719
|
+
this._flushPendingBashMessages();
|
|
720
|
+
})();
|
|
721
|
+
return this._drainPromise;
|
|
722
|
+
}
|
|
723
|
+
/** Await cancellation and persistence, then release listeners and ownership. */
|
|
724
|
+
shutdown() {
|
|
725
|
+
if (!this._shutdownPromise) {
|
|
726
|
+
this._shutdownPromise = this.drain().then(() => this._disposeSettled());
|
|
727
|
+
}
|
|
728
|
+
return this._shutdownPromise;
|
|
729
|
+
}
|
|
730
|
+
/** Compatibility wrapper. Use await shutdown() when release must be complete. */
|
|
731
|
+
dispose() {
|
|
732
|
+
if (this._operations.size === 0 && !this._isAgentRunActive && !this.agent.state.isStreaming) {
|
|
733
|
+
this.stopAdmission();
|
|
734
|
+
this._disposeSettled();
|
|
735
|
+
return;
|
|
736
|
+
}
|
|
737
|
+
void this.shutdown().catch(() => {
|
|
738
|
+
/* Awaitable callers receive shutdown failures. */
|
|
739
|
+
});
|
|
740
|
+
}
|
|
741
|
+
_disposeSettled() {
|
|
742
|
+
if (this._disposed)
|
|
743
|
+
return;
|
|
744
|
+
this._disposed = true;
|
|
745
|
+
for (const unregister of this._unregisterSubagentWaitInterruptionOwners.splice(0))
|
|
746
|
+
unregister();
|
|
679
747
|
this._extensionRunner.invalidate("This extension ctx is stale after session replacement or reload. Do not use a captured pi or command ctx after ctx.newSession(), ctx.fork(), ctx.switchSession(), or ctx.reload(). For newSession, fork, and switchSession, move post-replacement work into withSession and use the ctx passed to withSession. For reload, do not use the old ctx after await ctx.reload().");
|
|
680
748
|
this._disconnectFromAgent();
|
|
681
749
|
this._eventListeners = [];
|
|
682
750
|
cleanupSessionResources(this.sessionId);
|
|
751
|
+
deletePermissionContext(this.sessionId);
|
|
683
752
|
this.sessionManager.dispose();
|
|
684
753
|
}
|
|
685
754
|
// =========================================================================
|
|
@@ -737,8 +806,23 @@ export class AgentSession {
|
|
|
737
806
|
this._systemPromptAppend = next;
|
|
738
807
|
this.agent.state.systemPrompt = this._withSystemPromptAppend(this._systemPromptOverride ?? this._baseSystemPrompt);
|
|
739
808
|
}
|
|
809
|
+
get permissionMode() {
|
|
810
|
+
return getPermissionMode(this.sessionId);
|
|
811
|
+
}
|
|
812
|
+
_permissionAddendum(mode) {
|
|
813
|
+
return mode === "read-only" ? READ_ONLY_MODE_ADDENDUM : mode === "auto" ? AUTO_MODE_ADDENDUM : undefined;
|
|
814
|
+
}
|
|
815
|
+
/** Update the same permission context consulted by headless and interactive tools. */
|
|
816
|
+
setPermissionMode(mode) {
|
|
817
|
+
this.assertCanStartWork();
|
|
818
|
+
setPermissionMode(mode, this.sessionId);
|
|
819
|
+
this.sessionManager.setPermissionMode(mode);
|
|
820
|
+
this.agent.state.systemPrompt = this._withSystemPromptAppend(this._systemPromptOverride ?? this._baseSystemPrompt);
|
|
821
|
+
}
|
|
740
822
|
_withSystemPromptAppend(prompt) {
|
|
741
|
-
return this.
|
|
823
|
+
return [prompt, this._permissionAddendum(this.permissionMode), this._systemPromptAppend]
|
|
824
|
+
.filter(Boolean)
|
|
825
|
+
.join("\n\n");
|
|
742
826
|
}
|
|
743
827
|
/** Current retry attempt (0 if not retrying) */
|
|
744
828
|
get retryAttempt() {
|
|
@@ -944,28 +1028,67 @@ export class AgentSession {
|
|
|
944
1028
|
for (const reservation of handoff.reservations.splice(0))
|
|
945
1029
|
reservation.reject(error);
|
|
946
1030
|
}
|
|
947
|
-
|
|
1031
|
+
_reservePromptRun() {
|
|
1032
|
+
this.assertCanStartWork();
|
|
1033
|
+
if (this._isAgentRunActive || this._manualCompactionPromise) {
|
|
1034
|
+
throw new Error("Agent is already processing. Specify streamingBehavior ('steer' or 'followUp') to queue the message.");
|
|
1035
|
+
}
|
|
948
1036
|
const run = { waits: new Set(), gracefulStopRequested: false };
|
|
949
1037
|
this._activePromptRun = run;
|
|
950
1038
|
this._isAgentRunActive = true;
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
1039
|
+
return run;
|
|
1040
|
+
}
|
|
1041
|
+
async _releasePromptRun(run) {
|
|
1042
|
+
if (this._activePromptRun !== run)
|
|
1043
|
+
return;
|
|
1044
|
+
this._activePromptRun = undefined;
|
|
1045
|
+
this._systemPromptOverride = undefined;
|
|
1046
|
+
this._flushPendingBashMessages();
|
|
1047
|
+
await this._emitAgentSettled();
|
|
1048
|
+
}
|
|
1049
|
+
async _runAgentPrompt(messages, owner) {
|
|
1050
|
+
const run = owner ?? this._reservePromptRun();
|
|
1051
|
+
await this._trackOperation(async () => {
|
|
1052
|
+
try {
|
|
1053
|
+
this.assertCanStartWork();
|
|
1054
|
+
if (run.gracefulStopRequested)
|
|
1055
|
+
throw new Error("Prompt was cancelled during preparation.");
|
|
1056
|
+
await this.agent.prompt(Array.isArray(messages) ? messages : [messages], {
|
|
1057
|
+
consumeFollowUps: !run.completion,
|
|
1058
|
+
});
|
|
1059
|
+
while (await this._handlePostAgentRun(run)) {
|
|
1060
|
+
if (run.gracefulStopRequested || this._closing || run.completion?.cancelled)
|
|
1061
|
+
break;
|
|
1062
|
+
await this.agent.continue({ consumeFollowUps: !run.completion });
|
|
1063
|
+
}
|
|
1064
|
+
if (run.completion) {
|
|
1065
|
+
const completion = run.completion;
|
|
1066
|
+
run.completion = undefined;
|
|
1067
|
+
completion.detach?.();
|
|
1068
|
+
const hasQueuedWork = !run.gracefulStopRequested && !this._closing && this.agent.hasQueuedMessages();
|
|
1069
|
+
if (!hasQueuedWork)
|
|
1070
|
+
await this._releasePromptRun(run);
|
|
1071
|
+
completion.settle();
|
|
1072
|
+
// Later queued work retains normal session lifecycle, with a fresh queue admission.
|
|
1073
|
+
if (hasQueuedWork) {
|
|
1074
|
+
await this.agent.continueQueued();
|
|
1075
|
+
while (await this._handlePostAgentRun(run)) {
|
|
1076
|
+
if (run.gracefulStopRequested || this._closing)
|
|
1077
|
+
break;
|
|
1078
|
+
await this.agent.continue();
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
955
1082
|
}
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
this._systemPromptOverride = undefined;
|
|
961
|
-
this._flushPendingBashMessages();
|
|
962
|
-
await this._emitAgentSettled();
|
|
963
|
-
}
|
|
1083
|
+
finally {
|
|
1084
|
+
await this._releasePromptRun(run);
|
|
1085
|
+
}
|
|
1086
|
+
});
|
|
964
1087
|
}
|
|
965
1088
|
async _handlePostAgentRun(run) {
|
|
966
1089
|
const msg = this._lastAssistantMessage;
|
|
967
1090
|
this._lastAssistantMessage = undefined;
|
|
968
|
-
if (!msg || run.gracefulStopRequested) {
|
|
1091
|
+
if (!msg || run.gracefulStopRequested || run.completion?.signal?.aborted) {
|
|
969
1092
|
return false;
|
|
970
1093
|
}
|
|
971
1094
|
// lunr: quota-dead or auth-invalid keys rotate immediately — same-key backoff
|
|
@@ -992,9 +1115,9 @@ export class AgentSession {
|
|
|
992
1115
|
if (await this._checkCompaction(msg)) {
|
|
993
1116
|
return true;
|
|
994
1117
|
}
|
|
995
|
-
//
|
|
996
|
-
//
|
|
997
|
-
return this.agent.hasQueuedMessages();
|
|
1118
|
+
// Correlated requests leave follow-ups queued. Ordinary runs also continue
|
|
1119
|
+
// messages queued by agent_end extension handlers.
|
|
1120
|
+
return !run.completion && this.agent.hasQueuedMessages();
|
|
998
1121
|
}
|
|
999
1122
|
/**
|
|
1000
1123
|
* Send a prompt to the agent.
|
|
@@ -1007,36 +1130,116 @@ export class AgentSession {
|
|
|
1007
1130
|
*/
|
|
1008
1131
|
async prompt(text, options) {
|
|
1009
1132
|
this.assertCanStartWork();
|
|
1010
|
-
const
|
|
1011
|
-
|
|
1012
|
-
|
|
1133
|
+
const commandName = text.startsWith("/") ? text.slice(1).split(" ")[0] : undefined;
|
|
1134
|
+
// Lifecycle commands may replace the session; they cannot own a run they must drain.
|
|
1135
|
+
if ((options?.expandPromptTemplates ?? true) && commandName && this._extensionRunner.getCommand(commandName)) {
|
|
1136
|
+
try {
|
|
1137
|
+
await this._tryExecuteExtensionCommand(text);
|
|
1138
|
+
options?.preflightResult?.(true);
|
|
1139
|
+
}
|
|
1140
|
+
catch (error) {
|
|
1141
|
+
options?.preflightResult?.(false);
|
|
1142
|
+
throw error;
|
|
1143
|
+
}
|
|
1144
|
+
return;
|
|
1145
|
+
}
|
|
1146
|
+
return this._trackOperation(() => this._prompt(text, options));
|
|
1147
|
+
}
|
|
1148
|
+
async _prompt(text, options, completion) {
|
|
1149
|
+
let run;
|
|
1150
|
+
let accepted = false;
|
|
1013
1151
|
try {
|
|
1014
|
-
|
|
1152
|
+
this.assertCanStartWork();
|
|
1153
|
+
const wasStreaming = this.isStreaming;
|
|
1154
|
+
if (!wasStreaming) {
|
|
1155
|
+
run = this._reservePromptRun();
|
|
1156
|
+
run.completion = completion;
|
|
1157
|
+
if (completion?.signal) {
|
|
1158
|
+
const owner = run;
|
|
1159
|
+
const cancel = () => {
|
|
1160
|
+
if (this._activePromptRun !== owner || owner.completion !== completion)
|
|
1161
|
+
return;
|
|
1162
|
+
completion.cancelled = true;
|
|
1163
|
+
this.agent.abort();
|
|
1164
|
+
this.abortRetry();
|
|
1165
|
+
this._autoCompactionAbortController?.abort();
|
|
1166
|
+
};
|
|
1167
|
+
completion.signal.addEventListener("abort", cancel, { once: true });
|
|
1168
|
+
completion.detach = () => completion.signal?.removeEventListener("abort", cancel);
|
|
1169
|
+
completion.signal.throwIfAborted();
|
|
1170
|
+
}
|
|
1171
|
+
}
|
|
1172
|
+
else if (!options?.streamingBehavior) {
|
|
1173
|
+
throw new Error("Agent is already processing. Specify streamingBehavior ('steer' or 'followUp') to queue the message.");
|
|
1174
|
+
}
|
|
1175
|
+
const prepared = await this._preparePromptInput(text, options, wasStreaming ? options?.streamingBehavior : undefined);
|
|
1176
|
+
this.assertCanStartWork();
|
|
1177
|
+
run?.completion?.signal?.throwIfAborted();
|
|
1178
|
+
if (run?.gracefulStopRequested)
|
|
1179
|
+
throw new Error("Prompt was cancelled during preparation.");
|
|
1015
1180
|
if (!prepared) {
|
|
1016
|
-
|
|
1181
|
+
accepted = true;
|
|
1182
|
+
options?.preflightResult?.(true);
|
|
1017
1183
|
return;
|
|
1018
1184
|
}
|
|
1019
|
-
if (this.isStreaming) {
|
|
1020
|
-
if (
|
|
1021
|
-
throw new Error("Agent is already processing. Specify streamingBehavior ('steer' or 'followUp') to queue the message.");
|
|
1022
|
-
}
|
|
1023
|
-
if (options.streamingBehavior === "followUp") {
|
|
1185
|
+
if (wasStreaming && this.isStreaming) {
|
|
1186
|
+
if (options?.streamingBehavior === "followUp")
|
|
1024
1187
|
await this._queueFollowUp(prepared.text, prepared.images);
|
|
1025
|
-
|
|
1026
|
-
else {
|
|
1188
|
+
else
|
|
1027
1189
|
await this._queueSteer(prepared.text, prepared.images);
|
|
1028
|
-
|
|
1029
|
-
preflightResult?.(true);
|
|
1190
|
+
accepted = true;
|
|
1191
|
+
options?.preflightResult?.(true);
|
|
1030
1192
|
return;
|
|
1031
1193
|
}
|
|
1032
|
-
|
|
1194
|
+
run ??= this._reservePromptRun();
|
|
1195
|
+
run.completion = completion;
|
|
1196
|
+
const messages = await this._createPromptMessages(prepared);
|
|
1197
|
+
this.assertCanStartWork();
|
|
1198
|
+
run.completion?.signal?.throwIfAborted();
|
|
1199
|
+
if (run.gracefulStopRequested)
|
|
1200
|
+
throw new Error("Prompt was cancelled during preparation.");
|
|
1201
|
+
accepted = true;
|
|
1202
|
+
options?.preflightResult?.(true);
|
|
1203
|
+
await this._runAgentPrompt(messages, run);
|
|
1033
1204
|
}
|
|
1034
1205
|
catch (error) {
|
|
1035
|
-
|
|
1206
|
+
if (!accepted)
|
|
1207
|
+
options?.preflightResult?.(false);
|
|
1036
1208
|
throw error;
|
|
1037
1209
|
}
|
|
1038
|
-
|
|
1039
|
-
|
|
1210
|
+
finally {
|
|
1211
|
+
completion?.detach?.();
|
|
1212
|
+
if (run)
|
|
1213
|
+
await this._releasePromptRun(run);
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
/**
|
|
1217
|
+
* Admit one scheduled request, including steering, retries and compaction.
|
|
1218
|
+
* Completes before later follow-ups; signal cancellation belongs only to this request.
|
|
1219
|
+
*/
|
|
1220
|
+
async promptWithCompletion(text, options) {
|
|
1221
|
+
this.assertCanStartWork();
|
|
1222
|
+
if (!this.isIdle || this.isBashRunning || this.isCompacting || this.pendingMessageCount > 0) {
|
|
1223
|
+
throw new Error("Session is busy. Retry the scheduled prompt after its work settles.");
|
|
1224
|
+
}
|
|
1225
|
+
if (text.startsWith("/") && (options?.expandPromptTemplates ?? true))
|
|
1226
|
+
this._throwIfExtensionCommand(text);
|
|
1227
|
+
options?.signal?.throwIfAborted();
|
|
1228
|
+
const messages = [];
|
|
1229
|
+
return new Promise((resolve, reject) => {
|
|
1230
|
+
const completion = {
|
|
1231
|
+
messages,
|
|
1232
|
+
signal: options?.signal,
|
|
1233
|
+
settle: () => {
|
|
1234
|
+
if (completion.cancelled)
|
|
1235
|
+
reject(completion.signal?.reason);
|
|
1236
|
+
else
|
|
1237
|
+
resolve({ messages });
|
|
1238
|
+
},
|
|
1239
|
+
};
|
|
1240
|
+
// Track the full session operation while returning only the admitted request's completion.
|
|
1241
|
+
void this._trackOperation(() => this._prompt(text, options, completion)).then(completion.settle, reject);
|
|
1242
|
+
});
|
|
1040
1243
|
}
|
|
1041
1244
|
async _preparePromptInput(text, options, streamingBehavior) {
|
|
1042
1245
|
const expandPromptTemplates = options?.expandPromptTemplates ?? true;
|
|
@@ -1113,7 +1316,9 @@ export class AgentSession {
|
|
|
1113
1316
|
return messages;
|
|
1114
1317
|
}
|
|
1115
1318
|
async interruptSubagentWaitWithPrompt(text, options) {
|
|
1116
|
-
|
|
1319
|
+
this.assertCanStartWork();
|
|
1320
|
+
const previousAcceptance = this._waitPromptAcceptance;
|
|
1321
|
+
const acceptance = this._trackOperation(() => previousAcceptance.then(() => this._reserveWaitPrompt(text, options)));
|
|
1117
1322
|
this._waitPromptAcceptance = acceptance.then(() => { }, () => { });
|
|
1118
1323
|
return acceptance;
|
|
1119
1324
|
}
|
|
@@ -1147,6 +1352,9 @@ export class AgentSession {
|
|
|
1147
1352
|
}
|
|
1148
1353
|
throw error;
|
|
1149
1354
|
}
|
|
1355
|
+
this.assertCanStartWork();
|
|
1356
|
+
if (handoff.generation !== this._waitPromptGeneration)
|
|
1357
|
+
throw new Error("Pending prompt was cancelled during preparation.");
|
|
1150
1358
|
if (!prepared) {
|
|
1151
1359
|
if (handoff.reservations.length === 0 && this._waitPromptHandoff === handoff) {
|
|
1152
1360
|
this._waitPromptHandoff = undefined;
|
|
@@ -1176,17 +1384,21 @@ export class AgentSession {
|
|
|
1176
1384
|
handoff.generation === this._waitPromptGeneration &&
|
|
1177
1385
|
handoff.reservations.length > 0) {
|
|
1178
1386
|
const reservation = handoff.reservations[0];
|
|
1387
|
+
let run;
|
|
1179
1388
|
try {
|
|
1180
1389
|
this.assertCanStartWork();
|
|
1390
|
+
run = this._reservePromptRun();
|
|
1181
1391
|
const messages = await this._createPromptMessages(reservation.input);
|
|
1182
1392
|
handoff.accepting = false;
|
|
1183
|
-
await this._runAgentPrompt(messages);
|
|
1393
|
+
await this._runAgentPrompt(messages, run);
|
|
1184
1394
|
reservation.resolve();
|
|
1185
1395
|
}
|
|
1186
1396
|
catch (error) {
|
|
1187
1397
|
reservation.reject(error);
|
|
1188
1398
|
}
|
|
1189
1399
|
finally {
|
|
1400
|
+
if (run)
|
|
1401
|
+
await this._releasePromptRun(run);
|
|
1190
1402
|
if (handoff.reservations[0] === reservation)
|
|
1191
1403
|
handoff.reservations.shift();
|
|
1192
1404
|
}
|
|
@@ -1448,8 +1660,13 @@ export class AgentSession {
|
|
|
1448
1660
|
async abort() {
|
|
1449
1661
|
this._invalidateWaitPromptHandoffs("The active run was aborted before the pending prompt could run.");
|
|
1450
1662
|
this.abortRetry();
|
|
1663
|
+
if (this._activePromptRun && !this.agent.signal)
|
|
1664
|
+
this._activePromptRun.gracefulStopRequested = true;
|
|
1665
|
+
const bash = [...this._bashOperations.values()];
|
|
1666
|
+
this.abortBash();
|
|
1451
1667
|
this.agent.abort();
|
|
1452
1668
|
await this.waitForIdle();
|
|
1669
|
+
await Promise.all(bash);
|
|
1453
1670
|
}
|
|
1454
1671
|
async waitForIdle() {
|
|
1455
1672
|
if (this.isIdle) {
|
|
@@ -1690,12 +1907,13 @@ export class AgentSession {
|
|
|
1690
1907
|
* @param customInstructions Optional instructions for the compaction summary
|
|
1691
1908
|
*/
|
|
1692
1909
|
async compact(customInstructions) {
|
|
1910
|
+
this.assertCanStartWork();
|
|
1693
1911
|
const existing = this._latestCompactionResult();
|
|
1694
1912
|
if (existing)
|
|
1695
1913
|
return existing;
|
|
1696
1914
|
if (this._manualCompactionPromise)
|
|
1697
1915
|
return this._manualCompactionPromise;
|
|
1698
|
-
const promise = this._compact(customInstructions);
|
|
1916
|
+
const promise = this._trackOperation(() => this._compact(customInstructions));
|
|
1699
1917
|
this._manualCompactionPromise = promise;
|
|
1700
1918
|
try {
|
|
1701
1919
|
return await promise;
|
|
@@ -1706,16 +1924,15 @@ export class AgentSession {
|
|
|
1706
1924
|
}
|
|
1707
1925
|
}
|
|
1708
1926
|
async _compact(customInstructions) {
|
|
1709
|
-
this._disconnectFromAgent();
|
|
1710
1927
|
await this.abort();
|
|
1928
|
+
this.assertCanStartWork();
|
|
1711
1929
|
const existing = this._latestCompactionResult();
|
|
1712
|
-
if (existing)
|
|
1713
|
-
this._reconnectToAgent();
|
|
1930
|
+
if (existing)
|
|
1714
1931
|
return existing;
|
|
1715
|
-
|
|
1932
|
+
this._disconnectFromAgent();
|
|
1716
1933
|
this._compactionAbortController = new AbortController();
|
|
1717
|
-
this._emit({ type: "compaction_start", reason: "manual" });
|
|
1718
1934
|
try {
|
|
1935
|
+
this._emit({ type: "compaction_start", reason: "manual" });
|
|
1719
1936
|
if (!this.model) {
|
|
1720
1937
|
throw new Error(formatNoModelSelectedMessage());
|
|
1721
1938
|
}
|
|
@@ -2046,9 +2263,9 @@ export class AgentSession {
|
|
|
2046
2263
|
}
|
|
2047
2264
|
return true;
|
|
2048
2265
|
}
|
|
2049
|
-
//
|
|
2050
|
-
//
|
|
2051
|
-
return this.agent.hasQueuedMessages();
|
|
2266
|
+
// Only ordinary runs continue queued requests after successful compaction.
|
|
2267
|
+
// Correlated completion must settle before those requests begin.
|
|
2268
|
+
return !this._activePromptRun?.completion && this.agent.hasQueuedMessages();
|
|
2052
2269
|
}
|
|
2053
2270
|
catch (error) {
|
|
2054
2271
|
const errorMessage = error instanceof Error ? error.message : "compaction failed";
|
|
@@ -2310,6 +2527,7 @@ export class AgentSession {
|
|
|
2310
2527
|
}, {
|
|
2311
2528
|
getModel: () => this.resolvedCatalogModel(),
|
|
2312
2529
|
isIdle: () => this.isIdle,
|
|
2530
|
+
promptWithCompletion: (text, options) => this.promptWithCompletion(text, options),
|
|
2313
2531
|
isProjectTrusted: () => this.settingsManager.isProjectTrusted(),
|
|
2314
2532
|
getSignal: () => this.agent.signal,
|
|
2315
2533
|
abort: () => {
|
|
@@ -2569,19 +2787,17 @@ export class AgentSession {
|
|
|
2569
2787
|
* false when rotation is impossible, leaving the error as the final message.
|
|
2570
2788
|
*/
|
|
2571
2789
|
async _tryRotateSubscriptionKey(message) {
|
|
2572
|
-
const
|
|
2573
|
-
if (!
|
|
2790
|
+
const requestKey = this._modelRuntime.getRequestSubscriptionKey(message);
|
|
2791
|
+
if (!requestKey)
|
|
2574
2792
|
return false;
|
|
2575
|
-
const providerId =
|
|
2793
|
+
const providerId = requestKey.providerId;
|
|
2576
2794
|
// A runtime --api-key override wins over auth.json in RuntimeCredentials.read(),
|
|
2577
2795
|
// so mirroring a rotated key into the store would have no effect — skip rotation.
|
|
2578
2796
|
if (this._modelRuntime.hasRuntimeApiKey(providerId))
|
|
2579
2797
|
return false;
|
|
2580
2798
|
const manager = this._modelRuntime.subscriptionManager;
|
|
2581
|
-
if ((await manager.list(providerId)).length < 2)
|
|
2582
|
-
return false;
|
|
2583
2799
|
const errorMessage = message.errorMessage ?? "Unknown error";
|
|
2584
|
-
const entry = await manager.rotateOnFailure(providerId, errorMessage);
|
|
2800
|
+
const entry = await manager.rotateOnFailure(providerId, errorMessage, requestKey.fingerprint);
|
|
2585
2801
|
if (!entry)
|
|
2586
2802
|
return false;
|
|
2587
2803
|
// Close out any in-flight retry indicator; a fresh key gets a fresh retry budget.
|
|
@@ -2630,21 +2846,29 @@ export class AgentSession {
|
|
|
2630
2846
|
*/
|
|
2631
2847
|
async executeBash(command, onChunk, options) {
|
|
2632
2848
|
this.assertCanStartWork();
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
const
|
|
2636
|
-
|
|
2637
|
-
|
|
2849
|
+
const controller = new AbortController();
|
|
2850
|
+
let settle = () => { };
|
|
2851
|
+
const completion = new Promise((resolve) => {
|
|
2852
|
+
settle = resolve;
|
|
2853
|
+
});
|
|
2854
|
+
this._bashOperations.set(controller, completion);
|
|
2855
|
+
this._operations.add(completion);
|
|
2638
2856
|
try {
|
|
2857
|
+
// Apply the configured shell prefix within this operation's cleanup boundary.
|
|
2858
|
+
const prefix = this.settingsManager.getShellCommandPrefix();
|
|
2859
|
+
const shellPath = this.settingsManager.getShellPath();
|
|
2860
|
+
const resolvedCommand = prefix ? `${prefix}\n${command}` : command;
|
|
2639
2861
|
const result = await executeBashWithOperations(resolvedCommand, this.sessionManager.getCwd(), options?.operations ?? createLocalBashOperations({ shellPath, sessionId: this.sessionId }), {
|
|
2640
2862
|
onChunk,
|
|
2641
|
-
signal:
|
|
2863
|
+
signal: controller.signal,
|
|
2642
2864
|
});
|
|
2643
2865
|
this.recordBashResult(command, result, options);
|
|
2644
2866
|
return result;
|
|
2645
2867
|
}
|
|
2646
2868
|
finally {
|
|
2647
|
-
this.
|
|
2869
|
+
this._bashOperations.delete(controller);
|
|
2870
|
+
this._operations.delete(completion);
|
|
2871
|
+
settle();
|
|
2648
2872
|
}
|
|
2649
2873
|
}
|
|
2650
2874
|
/**
|
|
@@ -2676,14 +2900,15 @@ export class AgentSession {
|
|
|
2676
2900
|
}
|
|
2677
2901
|
}
|
|
2678
2902
|
/**
|
|
2679
|
-
* Cancel running bash
|
|
2903
|
+
* Cancel every running direct bash operation.
|
|
2680
2904
|
*/
|
|
2681
2905
|
abortBash() {
|
|
2682
|
-
this.
|
|
2906
|
+
for (const controller of this._bashOperations.keys())
|
|
2907
|
+
controller.abort();
|
|
2683
2908
|
}
|
|
2684
2909
|
/** Whether a bash command is currently running */
|
|
2685
2910
|
get isBashRunning() {
|
|
2686
|
-
return this.
|
|
2911
|
+
return this._bashOperations.size > 0;
|
|
2687
2912
|
}
|
|
2688
2913
|
/** Whether there are pending bash messages waiting to be flushed */
|
|
2689
2914
|
get hasPendingBashMessages() {
|
|
@@ -2731,6 +2956,12 @@ export class AgentSession {
|
|
|
2731
2956
|
* @returns Result with editorText (if user message) and cancelled status
|
|
2732
2957
|
*/
|
|
2733
2958
|
async navigateTree(targetId, options = {}) {
|
|
2959
|
+
this.assertCanStartWork();
|
|
2960
|
+
if (this._branchSummaryAbortController)
|
|
2961
|
+
throw new Error("Tree navigation is already in progress.");
|
|
2962
|
+
return this._trackOperation(() => this._navigateTree(targetId, options));
|
|
2963
|
+
}
|
|
2964
|
+
async _navigateTree(targetId, options = {}) {
|
|
2734
2965
|
const oldLeafId = this.sessionManager.getLeafId();
|
|
2735
2966
|
// No-op if already at target
|
|
2736
2967
|
if (targetId === oldLeafId) {
|
|
@@ -2824,6 +3055,8 @@ export class AgentSession {
|
|
|
2824
3055
|
summaryText = extensionSummary.summary;
|
|
2825
3056
|
summaryDetails = extensionSummary.details;
|
|
2826
3057
|
}
|
|
3058
|
+
if (this._branchSummaryAbortController.signal.aborted)
|
|
3059
|
+
return { cancelled: true, aborted: true };
|
|
2827
3060
|
// Determine the new leaf position based on target type
|
|
2828
3061
|
let newLeafId;
|
|
2829
3062
|
let editorText;
|