@ashx-j/lunr 0.2.26 → 0.2.28
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 +25 -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/accounting.d.ts.map +1 -1
- package/dist/builtin-extensions/narumiruna-pi-goal/src/accounting.js +5 -2
- package/dist/builtin-extensions/narumiruna-pi-goal/src/accounting.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/chain-root-attachment.d.ts +4 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/chain-root-attachment.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/chain-root-attachment.js +2 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/chain-root-attachment.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/notify.d.ts +6 -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 +17 -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 +5 -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 +78 -42
- 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 +0 -3
- 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 +134 -28
- 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 +26 -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/session-tokens.d.ts +7 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/session-tokens.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/session-tokens.js +70 -38
- package/dist/builtin-extensions/pi-subagents/src/shared/session-tokens.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts +9 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/types.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/slash/slash-commands.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.js +13 -62
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.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 +18 -9
- 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 +28 -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/catalog/models.json +1 -1
- package/dist/catalog/providers/google-vertex.json +1 -1
- package/dist/catalog/providers/google.json +1 -1
- package/dist/catalog/publication.json +3 -3
- 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 +46 -21
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +344 -126
- 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/cache-stats.d.ts +1 -1
- package/dist/core/cache-stats.d.ts.map +1 -1
- package/dist/core/cache-stats.js +1 -1
- package/dist/core/cache-stats.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts +2 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +1 -0
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +5 -11
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +38 -92
- package/dist/core/compaction/compaction.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/context-breakdown.d.ts +2 -2
- package/dist/core/context-breakdown.d.ts.map +1 -1
- package/dist/core/context-breakdown.js +22 -20
- package/dist/core/context-breakdown.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 +11 -1
- 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 +11 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +111 -33
- 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-accounting.d.ts +47 -0
- package/dist/core/usage-accounting.d.ts.map +1 -0
- package/dist/core/usage-accounting.js +205 -0
- package/dist/core/usage-accounting.js.map +1 -0
- 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-history.d.ts +1 -18
- package/dist/core/usage-history.d.ts.map +1 -1
- package/dist/core/usage-history.js +46 -114
- package/dist/core/usage-history.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 +69 -15
- 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/context-view.d.ts.map +1 -1
- package/dist/modes/interactive/components/context-view.js +2 -2
- package/dist/modes/interactive/components/context-view.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/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +8 -12
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/usage-view.d.ts +5 -0
- package/dist/modes/interactive/components/usage-view.d.ts.map +1 -1
- package/dist/modes/interactive/components/usage-view.js +21 -6
- package/dist/modes/interactive/components/usage-view.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +3 -7
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +151 -131
- 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-RTUGP3XR.js +54 -0
- package/dist/node-runtime/{brave-UWDA3I22.js → brave-2AFFAXNN.js} +1 -1
- package/dist/node-runtime/{builtin-extensions-I2HIFEMY.js → builtin-extensions-N4EUD6SB.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-4QRUZ64T.js +1203 -0
- 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-WIF24I7G.js → chunk-APVM5NEU.js} +149 -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-LJTIVM7I.js → chunk-BMRXLQWQ.js} +464 -160
- package/dist/node-runtime/{chunk-GJ2RDBRL.js → chunk-BYC6RKCN.js} +4 -2
- package/dist/node-runtime/{chunk-T4DA4XE7.js → chunk-DFMPRAQQ.js} +162 -82
- package/dist/node-runtime/{chunk-SN2KSMPQ.js → chunk-DQSCFU7R.js} +13 -7
- package/dist/node-runtime/{chunk-UVWCDQYF.js → chunk-E5DQGNJI.js} +455 -278
- package/dist/node-runtime/{chunk-4SBQAI4T.js → chunk-EBLAZVSA.js} +2058 -73
- 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-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-XHIRAZ26.js → chunk-IAZSK7KK.js} +1 -1
- package/dist/node-runtime/{chunk-GYIXXQAO.js → chunk-ICKGAKWX.js} +23 -59
- 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-L24TPBS4.js → chunk-JEK35V2M.js} +45 -31
- package/dist/node-runtime/{chunk-RDDAZOMU.js → chunk-JL4HYQXK.js} +1 -1
- 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-MPKSOJBT.js → chunk-NHATCSOI.js} +4 -7
- package/dist/node-runtime/{chunk-RMQZU2YU.js → chunk-NNNR3QIY.js} +1 -1
- package/dist/node-runtime/{chunk-2KIPT4HJ.js → chunk-PWHTSQC4.js} +83 -21
- package/dist/node-runtime/{chunk-RWTKOC3B.js → chunk-QBTJG3UM.js} +1 -1
- package/dist/node-runtime/{chunk-RCR3XAQY.js → chunk-QT3F6UEV.js} +233 -169
- 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-CDVHZOOK.js → chunk-RY3FJ6WI.js} +29 -27
- package/dist/node-runtime/{chunk-KKUTQQV7.js → chunk-RYRGL7P4.js} +1 -1
- package/dist/node-runtime/{chunk-I54LGHWM.js → chunk-STMX7W5I.js} +3 -3
- package/dist/node-runtime/chunk-SWWHZ2RI.js +158 -0
- package/dist/node-runtime/{chunk-5Q4A37RB.js → chunk-TCT6PCUR.js} +32 -11
- package/dist/node-runtime/{chunk-P7XBVXGT.js → chunk-U3YVZ6UC.js} +18 -14
- 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-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-YRT7I2BW.js} +5 -5
- package/dist/node-runtime/{commands-NAAL7KNT.js → commands-2ETOWWRA.js} +16 -16
- package/dist/node-runtime/{commands-EMBQQVVT.js → commands-D6A6H4TS.js} +11 -18
- 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-DBQRRMAY.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-V6K2CDWN.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-J7TYMOBK.js} +14 -8
- package/dist/node-runtime/index.js +51 -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-ASZ7APYP.js +75 -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-WD3YH4CR.js} +93 -80
- package/dist/node-runtime/main.js +43 -41
- package/dist/node-runtime/{mobile-commands-O5LCHL32.js → mobile-commands-ICUXFW5V.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-QPU3OXE4.js} +114 -167
- 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 +43 -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-LYH53ESV.js} +4 -4
- package/dist/node-runtime/{session-manager-JB5J6XBN.js → session-manager-ZJ3N5Q74.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-UI6SHG3X.js} +412 -288
- 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 +25 -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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
2
2
|
|
|
3
3
|
// packages/coding-agent/dist/builtin-extensions/pi-web-access/lazy.js
|
|
4
|
-
var loadExtract = () => import("./extract-
|
|
4
|
+
var loadExtract = () => import("./extract-BFX2N35A.js"), loadGeminiSearch = () => import("./gemini-search-C66QHDT6.js"), loadCuratorServer = () => import("./curator-server-XCM43VEF.js"), loadSummaryReview = () => import("./summary-review-YSMXKITO.js"), loadGeminiWeb = () => import("./gemini-web-MM446SEH.js"), loadGeminiApi = () => import("./gemini-api-QE7ANVDZ.js"), loadOpenAISearch = () => import("./openai-search-K72LJDYN.js"), loadBrave = () => import("./brave-2AFFAXNN.js"), loadParallel = () => import("./parallel-X724NCNU.js"), loadTavily = () => import("./tavily-KZBFYQB6.js"), loadPerplexity = () => import("./perplexity-RDHQHVMK.js"), loadExa = () => import("./exa-6VBZNPGE.js"), loadGithubExtract = () => import("./github-extract-HOGE3D6F.js"), loadPdfExtract = () => import("./pdf-extract-IPE6H4HP.js"), loadYoutubeExtract = () => import("./youtube-extract-77NT7FWH.js"), loadVideoExtract = () => import("./video-extract-UPKYIBW3.js"), loadGeminiUrlContext = () => import("./gemini-url-context-T7DEK73R.js");
|
|
5
5
|
|
|
6
6
|
export {
|
|
7
7
|
loadExtract,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
getAgentDir
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-64XTQNLA.js";
|
|
5
5
|
|
|
6
6
|
// packages/coding-agent/dist/gateway/service.js
|
|
7
7
|
import { spawn, spawnSync } from "node:child_process";
|
|
@@ -171,6 +171,117 @@ async function stopGatewayService() {
|
|
|
171
171
|
}
|
|
172
172
|
throw new Error("Gateway is still stopping after 30 seconds. Inspect the log; no unrelated process was terminated.");
|
|
173
173
|
}
|
|
174
|
+
async function teardownGatewayService() {
|
|
175
|
+
let dir = serviceDirectory(), ownerPath = join(dir, "lock", "owner.json"), status = readGatewayStatus(), lockOwner = readGatewayStatus(ownerPath);
|
|
176
|
+
if (existsSync(statusPath()) && !status || existsSync(join(dir, "lock")) && !lockOwner)
|
|
177
|
+
throw new Error("Gateway ownership is unresolved. Profile retained; run lunr gateway doctor.");
|
|
178
|
+
if (status && lockOwner && (status.instance !== lockOwner.instance || status.pid !== lockOwner.pid))
|
|
179
|
+
throw new Error("Gateway status and lock ownership disagree. Profile retained.");
|
|
180
|
+
let owner = status ?? lockOwner;
|
|
181
|
+
if (owner && processExists(owner.pid) && !lockOwner)
|
|
182
|
+
throw new Error("Running gateway has no ownership lock. Profile retained.");
|
|
183
|
+
let rawSettings = readJson(settingsPath());
|
|
184
|
+
if (existsSync(settingsPath()) && (!rawSettings || typeof rawSettings != "object" || !("startup" in rawSettings) || !["off", "login", "boot"].includes(String(rawSettings.startup))))
|
|
185
|
+
throw new Error("Gateway startup settings are unresolved. Profile retained.");
|
|
186
|
+
let mode = loadServiceSettings().startup, user = userInfo(), options = {
|
|
187
|
+
home: homedir(),
|
|
188
|
+
agentDir: getAgentDir(),
|
|
189
|
+
node: process.execPath,
|
|
190
|
+
cli: cliPath(),
|
|
191
|
+
username: user.username,
|
|
192
|
+
uid: user.uid
|
|
193
|
+
}, spec = mode === "off" ? void 0 : startupSpec(process.platform, mode, options), startupFileMissing = !!spec && !existsSync(spec.path);
|
|
194
|
+
if (spec)
|
|
195
|
+
if (startupFileMissing)
|
|
196
|
+
confirmStartupRemoval(spec);
|
|
197
|
+
else {
|
|
198
|
+
if (readFileSync(spec.path, "utf8") !== spec.content)
|
|
199
|
+
throw new Error("Gateway startup file does not match this installation. Profile retained.");
|
|
200
|
+
if (process.platform === "linux") {
|
|
201
|
+
let unit = spec.verify.at(-1), registration = serviceQuery([
|
|
202
|
+
"systemctl",
|
|
203
|
+
"--user",
|
|
204
|
+
"show",
|
|
205
|
+
unit,
|
|
206
|
+
"--property=FragmentPath",
|
|
207
|
+
"--property=DropInPaths"
|
|
208
|
+
]), properties = new Map(registration.stdout.trim().split(`
|
|
209
|
+
`).map((line) => {
|
|
210
|
+
let separator = line.indexOf("=");
|
|
211
|
+
return [line.slice(0, separator), line.slice(separator + 1)];
|
|
212
|
+
}));
|
|
213
|
+
if (registration.status !== 0 || properties.get("FragmentPath") !== spec.path || properties.get("DropInPaths") !== "")
|
|
214
|
+
throw new Error("Gateway systemd ownership could not be verified. Profile retained.");
|
|
215
|
+
} else if (process.platform === "win32") {
|
|
216
|
+
let name = `${servicePrefix}-${createHash("sha256").update(resolve(getAgentDir())).digest("hex").slice(0, 10)}`, actionArgs = `-NoProfile -NonInteractive -WindowStyle Hidden -ExecutionPolicy Bypass -File "${spec.path}"`;
|
|
217
|
+
execute([
|
|
218
|
+
"powershell.exe",
|
|
219
|
+
"-NoProfile",
|
|
220
|
+
"-Command",
|
|
221
|
+
`$ErrorActionPreference='Stop'; $t=Get-ScheduledTask -TaskName ${ps(name)}; if($t.Actions.Count -ne 1 -or $t.Actions[0].Execute -ne 'powershell.exe' -or $t.Actions[0].Arguments -ne ${ps(actionArgs)}){throw 'Gateway task ownership mismatch'}`
|
|
222
|
+
]);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
else if (["linux", "darwin", "win32"].includes(process.platform) && ["login", "boot"].some((candidate) => existsSync(startupSpec(process.platform, candidate, options).path)))
|
|
226
|
+
throw new Error("Gateway startup file exists without active ownership settings. Profile retained.");
|
|
227
|
+
if (owner && processExists(owner.pid) && atomicJson(controlPath(), { instance: owner.instance, action: "stop" }), spec && !startupFileMissing) {
|
|
228
|
+
if (process.platform === "linux") {
|
|
229
|
+
let unit = spec.verify.at(-1);
|
|
230
|
+
execute(["systemctl", "--user", "disable", "--now", unit]);
|
|
231
|
+
let disabled = serviceQuery(spec.verify);
|
|
232
|
+
if (disabled.status !== 1 || disabled.stdout.trim() !== "disabled")
|
|
233
|
+
throw new Error("Gateway startup disable could not be confirmed. Profile retained.");
|
|
234
|
+
} else
|
|
235
|
+
for (let command of spec.remove) {
|
|
236
|
+
let removed = serviceQuery(command);
|
|
237
|
+
if (removed.status !== 0 && !(process.platform === "darwin" && /Could not find (?:specified )?service/i.test(removed.stderr)))
|
|
238
|
+
throw new Error("Gateway startup removal failed. Profile retained.");
|
|
239
|
+
}
|
|
240
|
+
process.platform === "darwin" && mode === "boot" ? execute(["sudo", "rm", "-f", spec.path]) : rmSync(spec.path), confirmStartupRemoval(spec);
|
|
241
|
+
}
|
|
242
|
+
spec && atomicJson(settingsPath(), { startup: "off" });
|
|
243
|
+
for (let i = 0; owner && processExists(owner.pid); i++) {
|
|
244
|
+
if (i >= 150)
|
|
245
|
+
throw new Error("Gateway shutdown could not be confirmed after 30 seconds. Profile retained.");
|
|
246
|
+
await sleep(200);
|
|
247
|
+
}
|
|
248
|
+
let remaining = readGatewayStatus(), remainingLock = readGatewayStatus(ownerPath);
|
|
249
|
+
if (remaining && processExists(remaining.pid) || remainingLock && processExists(remainingLock.pid))
|
|
250
|
+
throw new Error("Gateway ownership changed during teardown. Profile retained.");
|
|
251
|
+
}
|
|
252
|
+
function confirmStartupRemoval(spec) {
|
|
253
|
+
if (process.platform === "linux") {
|
|
254
|
+
execute(["systemctl", "--user", "daemon-reload"]);
|
|
255
|
+
let removed = serviceQuery([
|
|
256
|
+
"systemctl",
|
|
257
|
+
"--user",
|
|
258
|
+
"show",
|
|
259
|
+
spec.verify.at(-1),
|
|
260
|
+
"--property=LoadState",
|
|
261
|
+
"--value"
|
|
262
|
+
]);
|
|
263
|
+
if (removed.status !== 0 || removed.stdout.trim() !== "not-found")
|
|
264
|
+
throw new Error("Gateway startup removal could not be confirmed. Profile retained.");
|
|
265
|
+
} else if (process.platform === "darwin") {
|
|
266
|
+
let removed = serviceQuery(spec.verify);
|
|
267
|
+
if (removed.status === 0 || !/Could not find (?:specified )?service/i.test(removed.stderr))
|
|
268
|
+
throw new Error("Gateway launchd removal could not be confirmed. Profile retained.");
|
|
269
|
+
} else {
|
|
270
|
+
let name = `${servicePrefix}-${createHash("sha256").update(resolve(getAgentDir())).digest("hex").slice(0, 10)}`;
|
|
271
|
+
execute([
|
|
272
|
+
"powershell.exe",
|
|
273
|
+
"-NoProfile",
|
|
274
|
+
"-Command",
|
|
275
|
+
`$ErrorActionPreference='Stop'; if(Get-ScheduledTask | Where-Object {$_.TaskName -eq ${ps(name)}}){throw 'Gateway task still registered'}`
|
|
276
|
+
]);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
function serviceQuery(command) {
|
|
280
|
+
let [file, ...args] = command, result = spawnSync(file, args, { encoding: "utf8", windowsHide: !0, timeout: 12e4 });
|
|
281
|
+
if (result.error)
|
|
282
|
+
throw result.error;
|
|
283
|
+
return result;
|
|
284
|
+
}
|
|
174
285
|
function xml(value) {
|
|
175
286
|
return value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """);
|
|
176
287
|
}
|
|
@@ -345,6 +456,7 @@ export {
|
|
|
345
456
|
claimGateway,
|
|
346
457
|
startGatewayService,
|
|
347
458
|
stopGatewayService,
|
|
459
|
+
teardownGatewayService,
|
|
348
460
|
startupSpec,
|
|
349
461
|
configureStartup,
|
|
350
462
|
serviceStatusText,
|
|
@@ -4,16 +4,16 @@ import {
|
|
|
4
4
|
} from "./chunk-URD2SLIT.js";
|
|
5
5
|
import {
|
|
6
6
|
getShellConfig
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ES6PBSIE.js";
|
|
8
8
|
import {
|
|
9
9
|
clearPlanUsageCache
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-HNNHHJAB.js";
|
|
11
11
|
import {
|
|
12
12
|
VERSION,
|
|
13
13
|
getAgentDir,
|
|
14
14
|
getPackageDir,
|
|
15
15
|
normalizePath
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-64XTQNLA.js";
|
|
17
17
|
import {
|
|
18
18
|
__toESM
|
|
19
19
|
} from "./chunk-BRJX2PRC.js";
|
|
@@ -1875,9 +1875,11 @@ function configuredRequestAuthStatus(config, extension) {
|
|
|
1875
1875
|
}
|
|
1876
1876
|
|
|
1877
1877
|
// packages/coding-agent/dist/core/runtime-credentials.js
|
|
1878
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
1878
1879
|
var RuntimeCredentials = class {
|
|
1879
1880
|
store;
|
|
1880
1881
|
overrides = /* @__PURE__ */ new Map();
|
|
1882
|
+
requestReads = new AsyncLocalStorage();
|
|
1881
1883
|
constructor(store) {
|
|
1882
1884
|
this.store = store;
|
|
1883
1885
|
}
|
|
@@ -1892,7 +1894,14 @@ var RuntimeCredentials = class {
|
|
|
1892
1894
|
}
|
|
1893
1895
|
async read(providerId) {
|
|
1894
1896
|
let override = this.overrides.get(providerId);
|
|
1895
|
-
|
|
1897
|
+
if (override)
|
|
1898
|
+
return { type: "api_key", key: override };
|
|
1899
|
+
let credential = await this.store.read(providerId), request = this.requestReads.getStore();
|
|
1900
|
+
return request?.providerId === providerId && request.observe(credential?.type === "api_key" ? credential.key : void 0), credential;
|
|
1901
|
+
}
|
|
1902
|
+
/** Observe the actual stored read for this request, excluding runtime overrides. */
|
|
1903
|
+
withStoredApiKeyRead(providerId, observe, resolve) {
|
|
1904
|
+
return this.requestReads.run({ providerId, observe }, resolve);
|
|
1896
1905
|
}
|
|
1897
1906
|
async list() {
|
|
1898
1907
|
let entries = new Map((await this.store.list()).map((entry) => [entry.providerId, entry]));
|
|
@@ -1909,6 +1918,7 @@ var RuntimeCredentials = class {
|
|
|
1909
1918
|
};
|
|
1910
1919
|
|
|
1911
1920
|
// packages/coding-agent/dist/core/subscriptions.js
|
|
1921
|
+
import { createHash as createHash3 } from "node:crypto";
|
|
1912
1922
|
import { join as join5 } from "path";
|
|
1913
1923
|
|
|
1914
1924
|
// packages/coding-agent/dist/core/usage-limit.js
|
|
@@ -1968,14 +1978,16 @@ function parseResetTimeMs(errorMessage) {
|
|
|
1968
1978
|
}
|
|
1969
1979
|
|
|
1970
1980
|
// packages/coding-agent/dist/core/subscriptions.js
|
|
1981
|
+
function subscriptionKeyFingerprint(providerId, key) {
|
|
1982
|
+
return createHash3("sha256").update(providerId).update("\0").update(key).digest("hex");
|
|
1983
|
+
}
|
|
1971
1984
|
var SubscriptionManager = class _SubscriptionManager {
|
|
1972
1985
|
data = {};
|
|
1973
|
-
loaded = !1;
|
|
1974
1986
|
storage;
|
|
1975
1987
|
authStorage;
|
|
1976
1988
|
// In-process write queue so mutations serialize even before the file lock.
|
|
1977
1989
|
queue = Promise.resolve();
|
|
1978
|
-
// Per-provider
|
|
1990
|
+
// Per-provider fingerprints exhausted without a parseable reset time.
|
|
1979
1991
|
// Process-local on purpose: infinite exhaustion is never persisted.
|
|
1980
1992
|
memoryExhausted = /* @__PURE__ */ new Map();
|
|
1981
1993
|
constructor(authStorage, storage) {
|
|
@@ -1992,29 +2004,50 @@ var SubscriptionManager = class _SubscriptionManager {
|
|
|
1992
2004
|
return storage.withLock(() => ({ result: void 0, next: JSON.stringify(data, null, 2) })), _SubscriptionManager.fromStorage(authStorage, storage);
|
|
1993
2005
|
}
|
|
1994
2006
|
parseStorageData(content) {
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
ensureLoaded() {
|
|
1998
|
-
if (this.loaded)
|
|
1999
|
-
return;
|
|
2000
|
-
this.loaded = !0;
|
|
2001
|
-
let content;
|
|
2007
|
+
if (content === void 0)
|
|
2008
|
+
return {};
|
|
2002
2009
|
try {
|
|
2003
|
-
|
|
2010
|
+
let parsed = JSON.parse(content);
|
|
2011
|
+
if (!parsed || typeof parsed != "object" || Array.isArray(parsed))
|
|
2012
|
+
throw new Error();
|
|
2013
|
+
for (let value of Object.values(parsed)) {
|
|
2014
|
+
if (!value || typeof value != "object")
|
|
2015
|
+
throw new Error();
|
|
2016
|
+
let pool = value;
|
|
2017
|
+
if (typeof pool.active != "string" || !Array.isArray(pool.keys))
|
|
2018
|
+
throw new Error();
|
|
2019
|
+
let ids = /* @__PURE__ */ new Set();
|
|
2020
|
+
for (let value2 of pool.keys) {
|
|
2021
|
+
if (!value2 || typeof value2 != "object")
|
|
2022
|
+
throw new Error();
|
|
2023
|
+
let entry = value2;
|
|
2024
|
+
if (typeof entry.id != "string" || ids.has(entry.id) || typeof entry.name != "string" || typeof entry.key != "string" || typeof entry.addedAt != "number" || !Number.isFinite(entry.addedAt) || entry.exhaustedUntil !== void 0 && (typeof entry.exhaustedUntil != "number" || !Number.isFinite(entry.exhaustedUntil)) || entry.lastError !== void 0 && typeof entry.lastError != "string")
|
|
2025
|
+
throw new Error();
|
|
2026
|
+
ids.add(entry.id);
|
|
2027
|
+
}
|
|
2028
|
+
if (!ids.has(pool.active))
|
|
2029
|
+
throw new Error();
|
|
2030
|
+
}
|
|
2031
|
+
return parsed;
|
|
2004
2032
|
} catch {
|
|
2033
|
+
throw new Error("Subscription storage is malformed. Repair it before changing subscriptions.");
|
|
2005
2034
|
}
|
|
2006
2035
|
}
|
|
2036
|
+
/**
|
|
2037
|
+
* Lock order is subscriptions then auth. Keep selection and its auth mirror
|
|
2038
|
+
* under the subscription lock so later selectors cannot overtake a mirror.
|
|
2039
|
+
* These files are not an atomic commit: a failed mirror aborts the pool write;
|
|
2040
|
+
* a later pool write failure can leave auth ahead and a repeated selection repairs it.
|
|
2041
|
+
*/
|
|
2007
2042
|
enqueue(fn) {
|
|
2008
|
-
let next = this.queue.then(
|
|
2043
|
+
let next = this.queue.then(() => this.storage.withLockAsync(async (current) => {
|
|
2044
|
+
this.data = this.parseStorageData(current);
|
|
2045
|
+
let before = JSON.stringify(this.data, null, 2), result = await fn(), after = JSON.stringify(this.data, null, 2);
|
|
2046
|
+
return { result, next: before === after ? void 0 : after };
|
|
2047
|
+
}));
|
|
2009
2048
|
return this.queue = next.catch(() => {
|
|
2010
2049
|
}), next;
|
|
2011
2050
|
}
|
|
2012
|
-
persist() {
|
|
2013
|
-
return this.storage.withLockAsync(async () => ({
|
|
2014
|
-
result: void 0,
|
|
2015
|
-
next: JSON.stringify(this.data, null, 2)
|
|
2016
|
-
}));
|
|
2017
|
-
}
|
|
2018
2051
|
/** Raw stored credential read via the modify path (returning undefined leaves it unchanged). */
|
|
2019
2052
|
async readRawCredential(providerId) {
|
|
2020
2053
|
let current;
|
|
@@ -2027,7 +2060,6 @@ var SubscriptionManager = class _SubscriptionManager {
|
|
|
2027
2060
|
* as "Sub 1" on first access. OAuth credentials are not imported.
|
|
2028
2061
|
*/
|
|
2029
2062
|
async ensurePool(providerId) {
|
|
2030
|
-
this.ensureLoaded();
|
|
2031
2063
|
let existing = this.data[providerId];
|
|
2032
2064
|
if (existing)
|
|
2033
2065
|
return existing;
|
|
@@ -2038,7 +2070,7 @@ var SubscriptionManager = class _SubscriptionManager {
|
|
|
2038
2070
|
active: "1",
|
|
2039
2071
|
keys: [{ id: "1", name: "Sub 1", key: credential.key, addedAt: Date.now() }]
|
|
2040
2072
|
};
|
|
2041
|
-
return this.data = { ...this.data, [providerId]: pool },
|
|
2073
|
+
return this.data = { ...this.data, [providerId]: pool }, pool;
|
|
2042
2074
|
}
|
|
2043
2075
|
nextId(pool) {
|
|
2044
2076
|
let max = 0;
|
|
@@ -2049,7 +2081,16 @@ var SubscriptionManager = class _SubscriptionManager {
|
|
|
2049
2081
|
return String(max + 1);
|
|
2050
2082
|
}
|
|
2051
2083
|
async mirrorActive(providerId, key) {
|
|
2052
|
-
|
|
2084
|
+
clearPlanUsageCache();
|
|
2085
|
+
try {
|
|
2086
|
+
await this.authStorage.modify(providerId, async (current) => ({
|
|
2087
|
+
type: "api_key",
|
|
2088
|
+
key,
|
|
2089
|
+
...current?.type === "api_key" && current.env ? { env: current.env } : {}
|
|
2090
|
+
}));
|
|
2091
|
+
} finally {
|
|
2092
|
+
clearPlanUsageCache();
|
|
2093
|
+
}
|
|
2053
2094
|
}
|
|
2054
2095
|
async list(providerId) {
|
|
2055
2096
|
return this.enqueue(async () => {
|
|
@@ -2065,9 +2106,8 @@ var SubscriptionManager = class _SubscriptionManager {
|
|
|
2065
2106
|
}
|
|
2066
2107
|
async addKey(providerId, key, name) {
|
|
2067
2108
|
return this.enqueue(async () => {
|
|
2068
|
-
this.ensureLoaded();
|
|
2069
2109
|
let pool = await this.ensurePool(providerId), id = pool ? this.nextId(pool) : "1", entry = { id, name: name ?? `Sub ${id}`, key, addedAt: Date.now() }, keys = [...pool?.keys ?? [], entry];
|
|
2070
|
-
return this.data = { ...this.data, [providerId]: { active: id, keys } }, await this.
|
|
2110
|
+
return this.data = { ...this.data, [providerId]: { active: id, keys } }, await this.mirrorActive(providerId, key), entry;
|
|
2071
2111
|
});
|
|
2072
2112
|
}
|
|
2073
2113
|
async removeKey(providerId, id) {
|
|
@@ -2075,20 +2115,25 @@ var SubscriptionManager = class _SubscriptionManager {
|
|
|
2075
2115
|
let pool = await this.ensurePool(providerId);
|
|
2076
2116
|
if (!pool || !pool.keys.some((entry) => entry.id === id))
|
|
2077
2117
|
return;
|
|
2078
|
-
let keys = pool.keys.filter((entry) => entry.id !== id);
|
|
2079
|
-
if (this.memoryExhausted.get(providerId)?.delete(
|
|
2118
|
+
let keys = pool.keys.filter((entry) => entry.id !== id), removed = pool.keys.find((entry) => entry.id === id);
|
|
2119
|
+
if (keys.some((entry) => entry.key === removed.key) || this.memoryExhausted.get(providerId)?.delete(subscriptionKeyFingerprint(providerId, removed.key)), keys.length === 0) {
|
|
2080
2120
|
let data = { ...this.data };
|
|
2081
|
-
delete data[providerId], this.data = data,
|
|
2121
|
+
delete data[providerId], this.data = data, clearPlanUsageCache();
|
|
2122
|
+
try {
|
|
2123
|
+
await this.authStorage.delete(providerId);
|
|
2124
|
+
} finally {
|
|
2125
|
+
clearPlanUsageCache();
|
|
2126
|
+
}
|
|
2082
2127
|
return;
|
|
2083
2128
|
}
|
|
2084
2129
|
let active = pool.active;
|
|
2085
2130
|
if (active === id) {
|
|
2086
|
-
active = keys[0]?.id ?? active, this.data = { ...this.data, [providerId]: { active, keys } }
|
|
2131
|
+
active = keys[0]?.id ?? active, this.data = { ...this.data, [providerId]: { active, keys } };
|
|
2087
2132
|
let promoted = keys.find((entry) => entry.id === active);
|
|
2088
2133
|
promoted && await this.mirrorActive(providerId, promoted.key);
|
|
2089
2134
|
return;
|
|
2090
2135
|
}
|
|
2091
|
-
this.data = { ...this.data, [providerId]: { active, keys } }
|
|
2136
|
+
this.data = { ...this.data, [providerId]: { active, keys } };
|
|
2092
2137
|
});
|
|
2093
2138
|
}
|
|
2094
2139
|
async renameKey(providerId, id, name) {
|
|
@@ -2097,57 +2142,58 @@ var SubscriptionManager = class _SubscriptionManager {
|
|
|
2097
2142
|
if (!pool)
|
|
2098
2143
|
return;
|
|
2099
2144
|
let keys = pool.keys.map((entry) => entry.id === id ? { ...entry, name } : entry);
|
|
2100
|
-
this.data = { ...this.data, [providerId]: { ...pool, keys } }
|
|
2145
|
+
this.data = { ...this.data, [providerId]: { ...pool, keys } };
|
|
2101
2146
|
});
|
|
2102
2147
|
}
|
|
2103
2148
|
async setActive(providerId, id) {
|
|
2104
2149
|
return this.enqueue(async () => {
|
|
2105
2150
|
let pool = await this.ensurePool(providerId), entry = pool?.keys.find((candidate) => candidate.id === id);
|
|
2106
|
-
!pool || !entry || (this.data = { ...this.data, [providerId]: { ...pool, active: id } }, await this.
|
|
2151
|
+
!pool || !entry || (this.data = { ...this.data, [providerId]: { ...pool, active: id } }, await this.mirrorActive(providerId, entry.key));
|
|
2107
2152
|
});
|
|
2108
2153
|
}
|
|
2109
2154
|
/**
|
|
2110
|
-
* Mark the
|
|
2155
|
+
* Mark the request's key exhausted and rotate to the next non-exhausted key in
|
|
2111
2156
|
* round-robin order. A parseable reset time is persisted as exhaustedUntil;
|
|
2112
|
-
* otherwise the exhaustion is process-local only.
|
|
2113
|
-
* or null when no
|
|
2157
|
+
* otherwise the exhaustion is process-local only. A later selection is preserved.
|
|
2158
|
+
* Returns the usable active key for retry, or null when no alternative exists.
|
|
2114
2159
|
*/
|
|
2115
|
-
async rotateOnFailure(providerId, errorMessage, now = Date.now()) {
|
|
2116
|
-
return this.enqueue(async () => {
|
|
2117
|
-
let pool =
|
|
2118
|
-
if (!pool)
|
|
2160
|
+
async rotateOnFailure(providerId, errorMessage, requestFingerprint, now = Date.now()) {
|
|
2161
|
+
return requestFingerprint ? this.enqueue(async () => {
|
|
2162
|
+
let pool = this.data[providerId];
|
|
2163
|
+
if (!pool || pool.keys.length < 2)
|
|
2119
2164
|
return null;
|
|
2120
2165
|
let currentIndex = pool.keys.findIndex((entry) => entry.id === pool.active);
|
|
2121
2166
|
if (currentIndex === -1)
|
|
2122
2167
|
return null;
|
|
2123
|
-
let current = pool.keys[currentIndex];
|
|
2124
|
-
if (!current)
|
|
2168
|
+
let current = pool.keys[currentIndex], matchesRequest = (entry) => subscriptionKeyFingerprint(providerId, entry.key) === requestFingerprint;
|
|
2169
|
+
if (!current || !pool.keys.some(matchesRequest))
|
|
2125
2170
|
return null;
|
|
2126
2171
|
let resetAt = parseResetTimeMs(errorMessage), keys = pool.keys;
|
|
2127
2172
|
if (resetAt !== void 0 && resetAt > now)
|
|
2128
|
-
keys = pool.keys.map((entry) => entry
|
|
2173
|
+
keys = pool.keys.map((entry) => matchesRequest(entry) ? { ...entry, exhaustedUntil: resetAt, lastError: errorMessage } : entry);
|
|
2129
2174
|
else {
|
|
2130
2175
|
let set = this.memoryExhausted.get(providerId) ?? /* @__PURE__ */ new Set();
|
|
2131
|
-
set.add(
|
|
2176
|
+
set.add(requestFingerprint), this.memoryExhausted.set(providerId, set);
|
|
2132
2177
|
}
|
|
2133
|
-
let isExhausted = (entry) => this.memoryExhausted.get(providerId)?.has(entry.
|
|
2178
|
+
let isExhausted = (entry) => this.memoryExhausted.get(providerId)?.has(subscriptionKeyFingerprint(providerId, entry.key)) === !0 || entry.exhaustedUntil !== void 0 && entry.exhaustedUntil > now;
|
|
2179
|
+
if (keys !== pool.keys && (this.data = { ...this.data, [providerId]: { ...pool, keys } }), !matchesRequest(current))
|
|
2180
|
+
return isExhausted(current) ? null : current;
|
|
2134
2181
|
for (let offset = 1; offset < keys.length; offset++) {
|
|
2135
2182
|
let candidate = keys[(currentIndex + offset) % keys.length];
|
|
2136
2183
|
if (!(!candidate || isExhausted(candidate)))
|
|
2137
|
-
return this.data = { ...this.data, [providerId]: { active: candidate.id, keys } }, await this.
|
|
2184
|
+
return this.data = { ...this.data, [providerId]: { active: candidate.id, keys } }, await this.mirrorActive(providerId, candidate.key), candidate;
|
|
2138
2185
|
}
|
|
2139
|
-
return
|
|
2140
|
-
});
|
|
2186
|
+
return null;
|
|
2187
|
+
}) : null;
|
|
2141
2188
|
}
|
|
2142
2189
|
/** Manual reactivate: clears persisted and process-local exhaustion for a key. */
|
|
2143
2190
|
async clearExhaustion(providerId, id) {
|
|
2144
2191
|
return this.enqueue(async () => {
|
|
2145
|
-
this.memoryExhausted.get(providerId)?.delete(id);
|
|
2146
2192
|
let pool = await this.ensurePool(providerId);
|
|
2147
2193
|
if (!pool)
|
|
2148
2194
|
return;
|
|
2149
2195
|
let target = pool.keys.find((entry) => entry.id === id);
|
|
2150
|
-
if (!target || target.exhaustedUntil === void 0 && target.lastError === void 0)
|
|
2196
|
+
if (target && this.memoryExhausted.get(providerId)?.delete(subscriptionKeyFingerprint(providerId, target.key)), !target || target.exhaustedUntil === void 0 && target.lastError === void 0)
|
|
2151
2197
|
return;
|
|
2152
2198
|
let keys = pool.keys.map((entry) => {
|
|
2153
2199
|
if (entry.id !== id)
|
|
@@ -2155,7 +2201,7 @@ var SubscriptionManager = class _SubscriptionManager {
|
|
|
2155
2201
|
let { exhaustedUntil: _exhaustedUntil, lastError: _lastError, ...rest } = entry;
|
|
2156
2202
|
return rest;
|
|
2157
2203
|
});
|
|
2158
|
-
this.data = { ...this.data, [providerId]: { ...pool, keys } }
|
|
2204
|
+
this.data = { ...this.data, [providerId]: { ...pool, keys } };
|
|
2159
2205
|
});
|
|
2160
2206
|
}
|
|
2161
2207
|
};
|
|
@@ -2313,6 +2359,7 @@ var ModelRuntime = class _ModelRuntime {
|
|
|
2313
2359
|
credentials;
|
|
2314
2360
|
/** lunr: per-provider subscription-key pools; rotation mirrors the active key into the credential store. */
|
|
2315
2361
|
subscriptionManager;
|
|
2362
|
+
requestSubscriptionKeys = /* @__PURE__ */ new WeakMap();
|
|
2316
2363
|
defaultBuiltins;
|
|
2317
2364
|
builtins = /* @__PURE__ */ new Map();
|
|
2318
2365
|
extensionProviders = /* @__PURE__ */ new Map();
|
|
@@ -2528,7 +2575,7 @@ var ModelRuntime = class _ModelRuntime {
|
|
|
2528
2575
|
return this.credentials.hasRuntimeApiKey(providerId);
|
|
2529
2576
|
}
|
|
2530
2577
|
async setRuntimeApiKey(providerId, apiKey, options) {
|
|
2531
|
-
this.credentials.setRuntimeApiKey(providerId, apiKey);
|
|
2578
|
+
clearPlanUsageCache(), this.credentials.setRuntimeApiKey(providerId, apiKey);
|
|
2532
2579
|
let auth = new Map(this.snapshot.auth).set(providerId, { type: "api_key", source: "runtime API key" }), configuredProviders = new Set(this.snapshot.configuredProviders).add(providerId), storedProviders = new Set(this.snapshot.storedProviders).add(providerId);
|
|
2533
2580
|
this.snapshot = {
|
|
2534
2581
|
...this.snapshot,
|
|
@@ -2539,7 +2586,7 @@ var ModelRuntime = class _ModelRuntime {
|
|
|
2539
2586
|
}, await this.refresh({ allowNetwork: options?.allowNetwork ?? this.allowModelNetwork });
|
|
2540
2587
|
}
|
|
2541
2588
|
async removeRuntimeApiKey(providerId) {
|
|
2542
|
-
this.credentials.removeRuntimeApiKey(providerId), await this.refresh({ allowNetwork: this.allowModelNetwork });
|
|
2589
|
+
clearPlanUsageCache(), this.credentials.removeRuntimeApiKey(providerId), await this.refresh({ allowNetwork: this.allowModelNetwork });
|
|
2543
2590
|
}
|
|
2544
2591
|
/** lunr: whether network model-catalog fetches are allowed (offline mode disables them). */
|
|
2545
2592
|
isNetworkAllowed() {
|
|
@@ -2563,14 +2610,17 @@ var ModelRuntime = class _ModelRuntime {
|
|
|
2563
2610
|
let provider = this.models.getProvider(model.provider);
|
|
2564
2611
|
if (!provider)
|
|
2565
2612
|
throw new ModelsError("provider", `Unknown provider: ${model.provider}`);
|
|
2566
|
-
let resolution = await this.
|
|
2613
|
+
let storedKeyFingerprint, resolution = await this.credentials.withStoredApiKeyRead(model.provider, (apiKey) => {
|
|
2614
|
+
storedKeyFingerprint = apiKey ? subscriptionKeyFingerprint(model.provider, apiKey) : void 0;
|
|
2615
|
+
}, () => this.getAuth(model, { apiKey: options?.apiKey, env: options?.env }));
|
|
2567
2616
|
if (!resolution)
|
|
2568
2617
|
throw new ModelsError("auth", `Provider is not configured: ${model.provider}`);
|
|
2569
2618
|
let { transformHeaders, ...providerOptions } = options ?? {}, route = anthropicRequestRoute(model.provider, resolution, options), headers = mergeHeaders(resolution.auth.headers, providerOptions.headers);
|
|
2570
2619
|
transformHeaders && (headers = await transformHeaders(headers ?? {}));
|
|
2571
|
-
let env = resolution.env || providerOptions.env ? { ...resolution.env ?? {}, ...providerOptions.env ?? {} } : void 0;
|
|
2620
|
+
let overridesAuth = Object.entries(headers ?? {}).some(([name, value]) => /^(authorization|x-api-key|api-key|x-goog-api-key)$/i.test(name) && value !== route.apiKey && value !== `Bearer ${route.apiKey}`), subscriptionKey = route.apiKey && options?.apiKey === void 0 && storedKeyFingerprint === subscriptionKeyFingerprint(model.provider, route.apiKey) && !overridesAuth ? { providerId: model.provider, fingerprint: subscriptionKeyFingerprint(model.provider, route.apiKey) } : void 0, env = resolution.env || providerOptions.env ? { ...resolution.env ?? {}, ...providerOptions.env ?? {} } : void 0;
|
|
2572
2621
|
return {
|
|
2573
2622
|
provider,
|
|
2623
|
+
subscriptionKey,
|
|
2574
2624
|
model: resolution.auth.baseUrl ? { ...model, baseUrl: resolution.auth.baseUrl } : model,
|
|
2575
2625
|
options: {
|
|
2576
2626
|
...providerOptions,
|
|
@@ -2580,30 +2630,41 @@ var ModelRuntime = class _ModelRuntime {
|
|
|
2580
2630
|
}
|
|
2581
2631
|
};
|
|
2582
2632
|
}
|
|
2633
|
+
/** The final response identity stays process-local and never enters saved chat. */
|
|
2634
|
+
getRequestSubscriptionKey(message) {
|
|
2635
|
+
return this.requestSubscriptionKeys.get(message);
|
|
2636
|
+
}
|
|
2583
2637
|
stream(model, context, options) {
|
|
2584
|
-
|
|
2638
|
+
let subscriptionKey, stream = lazyStream2(model, async () => {
|
|
2585
2639
|
let prepared = await this.prepareRequest(model, options);
|
|
2586
|
-
return prepared.provider.stream(prepared.model, context, prepared.options);
|
|
2640
|
+
return subscriptionKey = prepared.subscriptionKey, prepared.provider.stream(prepared.model, context, prepared.options);
|
|
2587
2641
|
});
|
|
2642
|
+
return stream.result().then((message) => {
|
|
2643
|
+
subscriptionKey && this.requestSubscriptionKeys.set(message, subscriptionKey);
|
|
2644
|
+
}), stream;
|
|
2588
2645
|
}
|
|
2589
2646
|
complete(model, context, options) {
|
|
2590
2647
|
return this.stream(model, context, options).result();
|
|
2591
2648
|
}
|
|
2592
2649
|
streamSimple(model, context, options) {
|
|
2593
|
-
|
|
2650
|
+
let subscriptionKey, stream = lazyStream2(model, async () => {
|
|
2594
2651
|
let prepared = await this.prepareRequest(model, options);
|
|
2595
|
-
return prepared.provider.streamSimple(prepared.model, context, prepared.options);
|
|
2652
|
+
return subscriptionKey = prepared.subscriptionKey, prepared.provider.streamSimple(prepared.model, context, prepared.options);
|
|
2596
2653
|
});
|
|
2654
|
+
return stream.result().then((message) => {
|
|
2655
|
+
subscriptionKey && this.requestSubscriptionKeys.set(message, subscriptionKey);
|
|
2656
|
+
}), stream;
|
|
2597
2657
|
}
|
|
2598
2658
|
completeSimple(model, context, options) {
|
|
2599
2659
|
return this.streamSimple(model, context, options).result();
|
|
2600
2660
|
}
|
|
2601
2661
|
async login(providerId, type, interaction) {
|
|
2662
|
+
clearPlanUsageCache();
|
|
2602
2663
|
let credential = await this.models.login(providerId, type, interaction);
|
|
2603
2664
|
return clearPlanUsageCache(), await this.refresh({ allowNetwork: this.allowModelNetwork }), credential;
|
|
2604
2665
|
}
|
|
2605
2666
|
async logout(providerId) {
|
|
2606
|
-
await this.models.logout(providerId), await this.modelsStore.delete(providerId), this.userModels.evictProvider(providerId), this.overlay.setLive(providerId, []), this.recomposeProvider(providerId), clearPlanUsageCache(), await this.refresh({ allowNetwork: this.allowModelNetwork });
|
|
2667
|
+
clearPlanUsageCache(), await this.models.logout(providerId), await this.modelsStore.delete(providerId), this.userModels.evictProvider(providerId), this.overlay.setLive(providerId, []), this.recomposeProvider(providerId), clearPlanUsageCache(), await this.refresh({ allowNetwork: this.allowModelNetwork });
|
|
2607
2668
|
}
|
|
2608
2669
|
/** Copy a live Grok CLI SuperGrok session into lunR `auth.json`. */
|
|
2609
2670
|
async importGrokCliXaiAuth() {
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
ActivityMonitor,
|
|
4
|
+
runWithActivity
|
|
5
|
+
} from "./chunk-IPP5BIV5.js";
|
|
6
|
+
|
|
7
|
+
// packages/coding-agent/dist/builtin-extensions/pi-web-access/session-cleanup.js
|
|
8
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
9
|
+
function createWebSession() {
|
|
10
|
+
return {
|
|
11
|
+
activity: new ActivityMonitor(),
|
|
12
|
+
cleanups: /* @__PURE__ */ new Set(),
|
|
13
|
+
closed: !1
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
var sessionScope = new AsyncLocalStorage(), pendingCleanups = /* @__PURE__ */ new WeakMap();
|
|
17
|
+
function getWebSession() {
|
|
18
|
+
return sessionScope.getStore();
|
|
19
|
+
}
|
|
20
|
+
function runWithWebSession(session, fn) {
|
|
21
|
+
return sessionScope.run(session, () => runWithActivity(session.activity, fn));
|
|
22
|
+
}
|
|
23
|
+
function runSessionCleanups(session) {
|
|
24
|
+
let existing = pendingCleanups.get(session);
|
|
25
|
+
if (existing)
|
|
26
|
+
return existing;
|
|
27
|
+
session.closed = !0;
|
|
28
|
+
let pending = [...session.cleanups].map(async (cleanup2) => cleanup2());
|
|
29
|
+
session.cleanups.clear();
|
|
30
|
+
let cleanup = Promise.allSettled(pending).then((results) => {
|
|
31
|
+
let errors = [];
|
|
32
|
+
for (let result of results)
|
|
33
|
+
result.status === "rejected" && errors.push(result.reason);
|
|
34
|
+
if (errors.length > 0) {
|
|
35
|
+
let details = errors.map((error) => error instanceof Error ? error.message : String(error)).join("; ");
|
|
36
|
+
throw new AggregateError(errors, `Web session cleanup failed: ${details}`);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
return pendingCleanups.set(session, cleanup), cleanup;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export {
|
|
43
|
+
createWebSession,
|
|
44
|
+
getWebSession,
|
|
45
|
+
runWithWebSession,
|
|
46
|
+
runSessionCleanups
|
|
47
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
2
|
+
|
|
3
|
+
// packages/coding-agent/dist/core/tools/file-mutation-queue.js
|
|
4
|
+
import { realpath } from "node:fs/promises";
|
|
5
|
+
import { resolve } from "node:path";
|
|
6
|
+
var fileMutationQueues = /* @__PURE__ */ new Map(), registrationQueue = Promise.resolve();
|
|
7
|
+
function isMissingPathError(error) {
|
|
8
|
+
return typeof error == "object" && error !== null && "code" in error && (error.code === "ENOENT" || error.code === "ENOTDIR");
|
|
9
|
+
}
|
|
10
|
+
async function getMutationQueueKey(filePath) {
|
|
11
|
+
let resolvedPath = resolve(filePath);
|
|
12
|
+
try {
|
|
13
|
+
return await realpath(resolvedPath);
|
|
14
|
+
} catch (error) {
|
|
15
|
+
if (isMissingPathError(error))
|
|
16
|
+
return resolvedPath;
|
|
17
|
+
throw error;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
async function withFileMutationQueue(filePath, fn) {
|
|
21
|
+
let registration = registrationQueue.then(async () => {
|
|
22
|
+
let key2 = await getMutationQueueKey(filePath), currentQueue2 = fileMutationQueues.get(key2) ?? Promise.resolve(), releaseNext2, nextQueue = new Promise((resolveQueue) => {
|
|
23
|
+
releaseNext2 = resolveQueue;
|
|
24
|
+
}), chainedQueue2 = currentQueue2.then(() => nextQueue);
|
|
25
|
+
return fileMutationQueues.set(key2, chainedQueue2), { key: key2, currentQueue: currentQueue2, chainedQueue: chainedQueue2, releaseNext: releaseNext2 };
|
|
26
|
+
});
|
|
27
|
+
registrationQueue = registration.then(() => {
|
|
28
|
+
}, () => {
|
|
29
|
+
});
|
|
30
|
+
let { key, currentQueue, chainedQueue, releaseNext } = await registration;
|
|
31
|
+
await currentQueue;
|
|
32
|
+
try {
|
|
33
|
+
return await fn();
|
|
34
|
+
} finally {
|
|
35
|
+
releaseNext(), fileMutationQueues.get(key) === chainedQueue && fileMutationQueues.delete(key);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export {
|
|
40
|
+
withFileMutationQueue
|
|
41
|
+
};
|