@astralyn/pi 0.87.5 → 0.99.0
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 +51 -6
- package/README.md +3 -3
- package/dist/bun/runtime-setup.js +4 -1
- package/dist/bun/runtime-setup.js.map +1 -1
- package/dist/bundle/chunks/anthropic-messages-KIXY7EDT.js +6 -0
- package/dist/bundle/chunks/anthropic.js +2 -2
- package/dist/bundle/chunks/azure-openai-responses-RPBERDXD.js +2 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +8 -8
- package/dist/bundle/chunks/{chunk-LPQCB2VJ.js → chunk-A576H74Y.js} +2 -2
- package/dist/bundle/chunks/{chunk-NW5FIDD7.js → chunk-ABVRAYXT.js} +3 -3
- package/dist/bundle/chunks/{chunk-I5IVW2WS.js → chunk-CLLDCO64.js} +1 -1
- package/dist/bundle/chunks/chunk-DEWXBB6W.js +2 -0
- package/dist/bundle/chunks/chunk-G4RY3GN7.js +11 -0
- package/dist/bundle/chunks/chunk-GCKVOFWP.js +2 -0
- package/dist/bundle/chunks/chunk-MPDALHNJ.js +2 -0
- package/dist/bundle/chunks/chunk-OO6DJ3CL.js +31 -0
- package/dist/bundle/chunks/{chunk-EWLAVDVN.js → chunk-VW2P3X6P.js} +921 -293
- package/dist/bundle/chunks/chunk-VWCWZD6E.js +2 -0
- package/dist/bundle/chunks/cloudflare-workers-ai-system-one-ZYSAFXXL.js +2 -0
- package/dist/bundle/chunks/codemode-worker.js +295 -0
- package/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/bundle/chunks/google-generative-ai-SDNQVVXA.js +2 -0
- package/dist/bundle/chunks/google-vertex-LZXOLBIO.js +2 -0
- package/dist/bundle/chunks/llama-cpp-classify-7IYGGPND.js +22 -0
- package/dist/bundle/chunks/meta.js +2 -0
- package/dist/bundle/chunks/mistral-conversations-VYKPSSAM.js +5 -0
- package/dist/bundle/chunks/openai-chatgpt.js +75 -0
- package/dist/bundle/chunks/openai-codex-responses-HZ4VUDXD.js +10 -0
- package/dist/bundle/chunks/openai-codex.js +2 -2
- package/dist/bundle/chunks/openai-completions-SKDGF6OE.js +7 -0
- package/dist/bundle/chunks/openai-responses-FPML4SSG.js +3 -0
- package/dist/bundle/chunks/{openrouter-images-6XDE2CEW.js → openrouter-images-5524IQHX.js} +1 -1
- package/dist/bundle/chunks/openrouter.js +2 -2
- package/dist/bundle/chunks/{pi-messages-MQMPIPNC.js → pi-messages-HZZ7GEEW.js} +2 -2
- package/dist/bundle/chunks/radius.js +2 -2
- package/dist/bundle/chunks/typesafe-system-one-Z2CDLKEY.js +2 -0
- package/dist/bundle/chunks/virtual-modules-TQRORWJQ.js +2 -0
- package/dist/bundle/cli.js +1 -1
- package/dist/bundle/index.js +1 -1
- package/dist/bundle/rpc-entry.js +1 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +4 -3
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/startup-ui.d.ts.map +1 -1
- package/dist/cli/startup-ui.js +38 -30
- package/dist/cli/startup-ui.js.map +1 -1
- package/dist/config.d.ts +18 -4
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +30 -4
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +1 -1
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +13 -13
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-services.d.ts +2 -2
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +14 -1
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session.d.ts +107 -58
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +505 -298
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/bug-report.js +1 -1
- package/dist/core/bug-report.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +1 -22
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/compaction/utils.d.ts +2 -1
- package/dist/core/compaction/utils.d.ts.map +1 -1
- package/dist/core/compaction/utils.js +25 -18
- package/dist/core/compaction/utils.js.map +1 -1
- package/dist/core/context-snapshot.d.ts +17 -4
- package/dist/core/context-snapshot.d.ts.map +1 -1
- package/dist/core/context-snapshot.js +48 -50
- package/dist/core/context-snapshot.js.map +1 -1
- package/dist/core/crash-log.d.ts.map +1 -1
- package/dist/core/crash-log.js +2 -1
- package/dist/core/crash-log.js.map +1 -1
- package/dist/core/export-html/template.css +10 -0
- package/dist/core/export-html/template.js +66 -17
- package/dist/core/extensions/distribution-api.d.ts +1 -8
- package/dist/core/extensions/distribution-api.d.ts.map +1 -1
- package/dist/core/extensions/distribution-api.js +6 -6
- package/dist/core/extensions/distribution-api.js.map +1 -1
- package/dist/core/extensions/index.d.ts +3 -3
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader.d.ts +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +58 -7
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +22 -3
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +124 -8
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +306 -30
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/extensions/wrapper.d.ts +2 -2
- package/dist/core/extensions/wrapper.d.ts.map +1 -1
- package/dist/core/extensions/wrapper.js +3 -3
- package/dist/core/extensions/wrapper.js.map +1 -1
- package/dist/core/keybindings.d.ts +40 -5
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +10 -1
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/mcp-servers.d.ts +98 -0
- package/dist/core/mcp-servers.d.ts.map +1 -0
- package/dist/core/mcp-servers.js +158 -0
- package/dist/core/mcp-servers.js.map +1 -0
- package/dist/core/model-registry.d.ts +13 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +25 -0
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts +2 -2
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +5 -5
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +41 -3
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +167 -17
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/nested-tool-calls.d.ts +102 -0
- package/dist/core/nested-tool-calls.d.ts.map +1 -0
- package/dist/core/nested-tool-calls.js +177 -0
- package/dist/core/nested-tool-calls.js.map +1 -0
- package/dist/core/package-manager.d.ts +4 -0
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +58 -12
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/provider-composer.d.ts +40 -21
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +92 -40
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/remote-catalog-provider.d.ts +8 -1
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +18 -3
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/resource-loader.d.ts +7 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +160 -35
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/sdk.d.ts +3 -3
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +84 -14
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager.d.ts +9 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +22 -22
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +36 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +108 -2
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +1 -0
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/source-info.d.ts +8 -0
- package/dist/core/source-info.d.ts.map +1 -1
- package/dist/core/source-info.js +16 -0
- package/dist/core/source-info.js.map +1 -1
- package/dist/core/system-prompt.js +1 -1
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tasks/delivery.d.ts +40 -0
- package/dist/core/tasks/delivery.d.ts.map +1 -0
- package/dist/core/tasks/delivery.js +157 -0
- package/dist/core/tasks/delivery.js.map +1 -0
- package/dist/core/tasks/history.d.ts +4 -0
- package/dist/core/tasks/history.d.ts.map +1 -0
- package/dist/core/{background → tasks}/history.js +24 -48
- package/dist/core/tasks/history.js.map +1 -0
- package/dist/core/{background → tasks}/output.d.ts +4 -4
- package/dist/core/tasks/output.d.ts.map +1 -0
- package/dist/core/{background → tasks}/output.js +11 -11
- package/dist/core/tasks/output.js.map +1 -0
- package/dist/core/tasks/presentation.d.ts +9 -0
- package/dist/core/tasks/presentation.d.ts.map +1 -0
- package/dist/core/{background → tasks}/presentation.js +53 -51
- package/dist/core/tasks/presentation.js.map +1 -0
- package/dist/core/{background/service.d.ts → tasks/runtime.d.ts} +22 -23
- package/dist/core/tasks/runtime.d.ts.map +1 -0
- package/dist/core/{background/service.js → tasks/runtime.js} +154 -198
- package/dist/core/tasks/runtime.js.map +1 -0
- package/dist/core/tasks/session.d.ts +49 -0
- package/dist/core/tasks/session.d.ts.map +1 -0
- package/dist/core/tasks/session.js +129 -0
- package/dist/core/tasks/session.js.map +1 -0
- package/dist/core/tasks/store.d.ts +32 -0
- package/dist/core/tasks/store.d.ts.map +1 -0
- package/dist/core/tasks/store.js +135 -0
- package/dist/core/tasks/store.js.map +1 -0
- package/dist/core/{background → tasks}/types.d.ts +80 -62
- package/dist/core/tasks/types.d.ts.map +1 -0
- package/dist/core/{background → tasks}/types.js +9 -9
- package/dist/core/tasks/types.js.map +1 -0
- package/dist/core/tasks/view-data.d.ts +8 -0
- package/dist/core/tasks/view-data.d.ts.map +1 -0
- package/dist/core/tasks/view-data.js +61 -0
- package/dist/core/tasks/view-data.js.map +1 -0
- package/dist/core/tasks/view.d.ts +30 -0
- package/dist/core/tasks/view.d.ts.map +1 -0
- package/dist/core/tasks/view.js +50 -0
- package/dist/core/tasks/view.js.map +1 -0
- package/dist/core/tools/bash.d.ts +8 -95
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +8 -240
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +0 -1
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts +2 -0
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +2 -1
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/index.d.ts +2 -1
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +9 -0
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js +0 -1
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/output-accumulator.d.ts +11 -0
- package/dist/core/tools/output-accumulator.d.ts.map +1 -1
- package/dist/core/tools/output-accumulator.js +36 -0
- package/dist/core/tools/output-accumulator.js.map +1 -1
- package/dist/core/tools/powershell.d.ts +6 -2
- package/dist/core/tools/powershell.d.ts.map +1 -1
- package/dist/core/tools/powershell.js +1 -1
- package/dist/core/tools/powershell.js.map +1 -1
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +0 -1
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/render-utils.d.ts +6 -7
- package/dist/core/tools/render-utils.d.ts.map +1 -1
- package/dist/core/tools/render-utils.js +26 -11
- package/dist/core/tools/render-utils.js.map +1 -1
- package/dist/core/tools/renderers/bash.d.ts +1 -1
- package/dist/core/tools/renderers/bash.d.ts.map +1 -1
- package/dist/core/tools/renderers/bash.js +65 -12
- package/dist/core/tools/renderers/bash.js.map +1 -1
- package/dist/core/tools/renderers/edit.d.ts.map +1 -1
- package/dist/core/tools/renderers/edit.js +4 -22
- package/dist/core/tools/renderers/edit.js.map +1 -1
- package/dist/core/tools/renderers/find.d.ts.map +1 -1
- package/dist/core/tools/renderers/find.js +7 -6
- package/dist/core/tools/renderers/find.js.map +1 -1
- package/dist/core/tools/renderers/grep.d.ts.map +1 -1
- package/dist/core/tools/renderers/grep.js +8 -7
- package/dist/core/tools/renderers/grep.js.map +1 -1
- package/dist/core/tools/renderers/index.d.ts.map +1 -1
- package/dist/core/tools/renderers/index.js +5 -7
- package/dist/core/tools/renderers/index.js.map +1 -1
- package/dist/core/tools/renderers/ls.d.ts.map +1 -1
- package/dist/core/tools/renderers/ls.js +3 -2
- package/dist/core/tools/renderers/ls.js.map +1 -1
- package/dist/core/tools/renderers/read.d.ts.map +1 -1
- package/dist/core/tools/renderers/read.js +10 -14
- package/dist/core/tools/renderers/read.js.map +1 -1
- package/dist/core/tools/renderers/shell-task.d.ts +4 -0
- package/dist/core/tools/renderers/shell-task.d.ts.map +1 -0
- package/dist/core/tools/renderers/shell-task.js +35 -0
- package/dist/core/tools/renderers/shell-task.js.map +1 -0
- package/dist/core/tools/renderers/write.d.ts.map +1 -1
- package/dist/core/tools/renderers/write.js +3 -2
- package/dist/core/tools/renderers/write.js.map +1 -1
- package/dist/core/tools/shell-execution.d.ts +4 -5
- package/dist/core/tools/shell-execution.d.ts.map +1 -1
- package/dist/core/tools/shell-execution.js +19 -3
- package/dist/core/tools/shell-execution.js.map +1 -1
- package/dist/core/tools/shell-tool.d.ts +93 -0
- package/dist/core/tools/shell-tool.d.ts.map +1 -0
- package/dist/core/tools/shell-tool.js +251 -0
- package/dist/core/tools/shell-tool.js.map +1 -0
- package/dist/core/tools/tasks/actions.d.ts +12 -0
- package/dist/core/tools/tasks/actions.d.ts.map +1 -0
- package/dist/{extensions/background → core/tools/tasks}/actions.js +20 -19
- package/dist/core/tools/tasks/actions.js.map +1 -0
- package/dist/core/tools/tasks/constants.d.ts +24 -0
- package/dist/core/tools/tasks/constants.d.ts.map +1 -0
- package/dist/{extensions/background → core/tools/tasks}/constants.js +11 -9
- package/dist/core/tools/tasks/constants.js.map +1 -0
- package/dist/{extensions/background → core/tools/tasks}/schema.d.ts +6 -6
- package/dist/core/tools/tasks/schema.d.ts.map +1 -0
- package/dist/{extensions/background → core/tools/tasks}/schema.js +17 -17
- package/dist/core/tools/tasks/schema.js.map +1 -0
- package/dist/{extensions/background → core/tools/tasks}/types.d.ts +15 -17
- package/dist/core/tools/tasks/types.d.ts.map +1 -0
- package/dist/core/tools/tasks/types.js.map +1 -0
- package/dist/core/tools/tasks.d.ts +14 -0
- package/dist/core/tools/tasks.d.ts.map +1 -0
- package/dist/core/tools/tasks.js +40 -0
- package/dist/core/tools/tasks.js.map +1 -0
- package/dist/core/tools/tool-definition-wrapper.d.ts +5 -8
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.js +4 -4
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
- package/dist/core/tools/truncate.d.ts +14 -0
- package/dist/core/tools/truncate.d.ts.map +1 -1
- package/dist/core/tools/truncate.js +29 -0
- package/dist/core/tools/truncate.js.map +1 -1
- package/dist/core/trust-manager.d.ts.map +1 -1
- package/dist/core/trust-manager.js +1 -0
- package/dist/core/trust-manager.js.map +1 -1
- package/dist/core/usage-totals.d.ts +5 -3
- package/dist/core/usage-totals.d.ts.map +1 -1
- package/dist/core/usage-totals.js +27 -4
- package/dist/core/usage-totals.js.map +1 -1
- package/dist/core/virtual-models.d.ts +115 -0
- package/dist/core/virtual-models.d.ts.map +1 -0
- package/dist/core/virtual-models.js +117 -0
- package/dist/core/virtual-models.js.map +1 -0
- package/dist/extensions/codemode/execute.d.ts +16 -0
- package/dist/extensions/codemode/execute.d.ts.map +1 -0
- package/dist/extensions/codemode/execute.js +390 -0
- package/dist/extensions/codemode/execute.js.map +1 -0
- package/dist/extensions/codemode/execute.lazy.d.ts +3 -0
- package/dist/extensions/codemode/execute.lazy.d.ts.map +1 -0
- package/dist/extensions/codemode/execute.lazy.js +3 -0
- package/dist/extensions/codemode/execute.lazy.js.map +1 -0
- package/dist/extensions/codemode/index.d.ts +21 -0
- package/dist/extensions/codemode/index.d.ts.map +1 -0
- package/dist/extensions/codemode/index.js +36 -0
- package/dist/extensions/codemode/index.js.map +1 -0
- package/dist/extensions/codemode/renderer.d.ts +12 -0
- package/dist/extensions/codemode/renderer.d.ts.map +1 -0
- package/dist/extensions/codemode/renderer.js +119 -0
- package/dist/extensions/codemode/renderer.js.map +1 -0
- package/dist/extensions/codemode/search.d.ts +33 -0
- package/dist/extensions/codemode/search.d.ts.map +1 -0
- package/dist/extensions/codemode/search.js +117 -0
- package/dist/extensions/codemode/search.js.map +1 -0
- package/dist/extensions/codemode/tool.d.ts +122 -0
- package/dist/extensions/codemode/tool.d.ts.map +1 -0
- package/dist/extensions/codemode/tool.js +324 -0
- package/dist/extensions/codemode/tool.js.map +1 -0
- package/dist/extensions/codemode/worker.d.ts +7 -0
- package/dist/extensions/codemode/worker.d.ts.map +1 -0
- package/dist/extensions/codemode/worker.js +7 -0
- package/dist/extensions/codemode/worker.js.map +1 -0
- package/dist/extensions/deepwiki/schema.d.ts +1 -1
- package/dist/extensions/index.d.ts.map +1 -1
- package/dist/extensions/index.js +14 -12
- package/dist/extensions/index.js.map +1 -1
- package/dist/extensions/llama/provider.d.ts +1 -1
- package/dist/extensions/llama/provider.d.ts.map +1 -1
- package/dist/extensions/llama/provider.js +65 -13
- package/dist/extensions/llama/provider.js.map +1 -1
- package/dist/extensions/mcp/cli.d.ts +21 -0
- package/dist/extensions/mcp/cli.d.ts.map +1 -0
- package/dist/extensions/mcp/cli.js +485 -0
- package/dist/extensions/mcp/cli.js.map +1 -0
- package/dist/extensions/mcp/cli.lazy.d.ts +3 -0
- package/dist/extensions/mcp/cli.lazy.d.ts.map +1 -0
- package/dist/extensions/mcp/cli.lazy.js +3 -0
- package/dist/extensions/mcp/cli.lazy.js.map +1 -0
- package/dist/extensions/mcp/config.d.ts +70 -0
- package/dist/extensions/mcp/config.d.ts.map +1 -0
- package/dist/extensions/mcp/config.js +146 -0
- package/dist/extensions/mcp/config.js.map +1 -0
- package/dist/extensions/mcp/index.d.ts +52 -0
- package/dist/extensions/mcp/index.d.ts.map +1 -0
- package/dist/extensions/mcp/index.js +904 -0
- package/dist/extensions/mcp/index.js.map +1 -0
- package/dist/extensions/mcp/log.d.ts +16 -0
- package/dist/extensions/mcp/log.d.ts.map +1 -0
- package/dist/extensions/mcp/log.js +64 -0
- package/dist/extensions/mcp/log.js.map +1 -0
- package/dist/extensions/mcp/oauth.d.ts +94 -0
- package/dist/extensions/mcp/oauth.d.ts.map +1 -0
- package/dist/extensions/mcp/oauth.js +330 -0
- package/dist/extensions/mcp/oauth.js.map +1 -0
- package/dist/extensions/mcp/resources.d.ts +43 -0
- package/dist/extensions/mcp/resources.d.ts.map +1 -0
- package/dist/extensions/mcp/resources.js +262 -0
- package/dist/extensions/mcp/resources.js.map +1 -0
- package/dist/extensions/mcp/runtime.d.ts +96 -0
- package/dist/extensions/mcp/runtime.d.ts.map +1 -0
- package/dist/extensions/mcp/runtime.js +372 -0
- package/dist/extensions/mcp/runtime.js.map +1 -0
- package/dist/extensions/mcp/runtime.lazy.d.ts +3 -0
- package/dist/extensions/mcp/runtime.lazy.d.ts.map +1 -0
- package/dist/extensions/mcp/runtime.lazy.js +3 -0
- package/dist/extensions/mcp/runtime.lazy.js.map +1 -0
- package/dist/extensions/mcp/tools.d.ts +83 -0
- package/dist/extensions/mcp/tools.d.ts.map +1 -0
- package/dist/extensions/mcp/tools.js +233 -0
- package/dist/extensions/mcp/tools.js.map +1 -0
- package/dist/extensions/mcp/ui.d.ts +60 -0
- package/dist/extensions/mcp/ui.d.ts.map +1 -0
- package/dist/extensions/mcp/ui.js +166 -0
- package/dist/extensions/mcp/ui.js.map +1 -0
- package/dist/extensions/question/detail-pane.d.ts +12 -0
- package/dist/extensions/question/detail-pane.d.ts.map +1 -0
- package/dist/extensions/question/detail-pane.js +42 -0
- package/dist/extensions/question/detail-pane.js.map +1 -0
- package/dist/extensions/question/dialog.d.ts.map +1 -1
- package/dist/extensions/question/dialog.js +175 -105
- package/dist/extensions/question/dialog.js.map +1 -1
- package/dist/extensions/question/option-window.d.ts +26 -0
- package/dist/extensions/question/option-window.d.ts.map +1 -0
- package/dist/extensions/question/option-window.js +53 -0
- package/dist/extensions/question/option-window.js.map +1 -0
- package/dist/extensions/question/render-cache.d.ts +4 -4
- package/dist/extensions/question/render-cache.d.ts.map +1 -1
- package/dist/extensions/question/render-cache.js +10 -11
- package/dist/extensions/question/render-cache.js.map +1 -1
- package/dist/extensions/statusline/index.js +2 -2
- package/dist/extensions/statusline/index.js.map +1 -1
- package/dist/extensions/todo/index.d.ts.map +1 -1
- package/dist/extensions/todo/index.js +12 -8
- package/dist/extensions/todo/index.js.map +1 -1
- package/dist/extensions/todo/view.d.ts +3 -3
- package/dist/extensions/todo/view.d.ts.map +1 -1
- package/dist/extensions/todo/view.js +7 -6
- package/dist/extensions/todo/view.js.map +1 -1
- package/dist/extensions/tool-search/index.d.ts +12 -0
- package/dist/extensions/tool-search/index.d.ts.map +1 -0
- package/dist/extensions/tool-search/index.js +20 -0
- package/dist/extensions/tool-search/index.js.map +1 -0
- package/dist/extensions/tool-search/tool.d.ts +72 -0
- package/dist/extensions/tool-search/tool.d.ts.map +1 -0
- package/dist/extensions/tool-search/tool.js +208 -0
- package/dist/extensions/tool-search/tool.js.map +1 -0
- package/dist/index.d.ts +13 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +10 -0
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +13 -3
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +3 -1
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.d.ts +4 -4
- package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.js +8 -2
- package/dist/modes/interactive/components/first-time-setup.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts +7 -0
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +42 -3
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/index.d.ts +1 -1
- package/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/dist/modes/interactive/components/index.js +1 -1
- package/dist/modes/interactive/components/index.js.map +1 -1
- package/dist/modes/interactive/components/pi-logo.d.ts +12 -0
- package/dist/modes/interactive/components/pi-logo.d.ts.map +1 -0
- package/dist/modes/interactive/components/pi-logo.js +25 -0
- package/dist/modes/interactive/components/pi-logo.js.map +1 -0
- package/dist/modes/interactive/components/settings-selector.d.ts +3 -1
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +28 -6
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/status-marker.d.ts +4 -4
- package/dist/modes/interactive/components/status-marker.js +4 -4
- package/dist/modes/interactive/components/status-marker.js.map +1 -1
- package/dist/modes/interactive/components/themed-text.d.ts +17 -0
- package/dist/modes/interactive/components/themed-text.d.ts.map +1 -0
- package/dist/modes/interactive/components/themed-text.js +28 -0
- package/dist/modes/interactive/components/themed-text.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +2 -4
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +221 -173
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/tasks/completion-render.d.ts +8 -0
- package/dist/modes/interactive/tasks/completion-render.d.ts.map +1 -0
- package/dist/{extensions/background → modes/interactive/tasks}/completion-render.js +33 -30
- package/dist/modes/interactive/tasks/completion-render.js.map +1 -0
- package/dist/modes/interactive/tasks/fallback-view.d.ts +4 -0
- package/dist/modes/interactive/tasks/fallback-view.d.ts.map +1 -0
- package/dist/modes/interactive/tasks/fallback-view.js +27 -0
- package/dist/modes/interactive/tasks/fallback-view.js.map +1 -0
- package/dist/modes/interactive/tasks/index.d.ts +12 -0
- package/dist/modes/interactive/tasks/index.d.ts.map +1 -0
- package/dist/modes/interactive/tasks/index.js +97 -0
- package/dist/modes/interactive/tasks/index.js.map +1 -0
- package/dist/modes/interactive/tasks/manager.d.ts +67 -0
- package/dist/modes/interactive/tasks/manager.d.ts.map +1 -0
- package/dist/modes/interactive/tasks/manager.js +380 -0
- package/dist/modes/interactive/tasks/manager.js.map +1 -0
- package/dist/{extensions/background → modes/interactive/tasks}/render.d.ts +13 -13
- package/dist/modes/interactive/tasks/render.d.ts.map +1 -0
- package/dist/{extensions/background → modes/interactive/tasks}/render.js +18 -18
- package/dist/modes/interactive/tasks/render.js.map +1 -0
- package/dist/{extensions/background → modes/interactive/tasks}/task-view.d.ts +7 -7
- package/dist/modes/interactive/tasks/task-view.d.ts.map +1 -0
- package/dist/{extensions/background → modes/interactive/tasks}/task-view.js +4 -4
- package/dist/modes/interactive/tasks/task-view.js.map +1 -0
- package/dist/{extensions/background → modes/interactive/tasks}/text.d.ts +1 -1
- package/dist/modes/interactive/tasks/text.d.ts.map +1 -0
- package/dist/{extensions/background → modes/interactive/tasks}/text.js +1 -1
- package/dist/modes/interactive/tasks/text.js.map +1 -0
- package/dist/modes/interactive/tasks/viewport.d.ts +15 -0
- package/dist/modes/interactive/tasks/viewport.d.ts.map +1 -0
- package/dist/modes/interactive/tasks/viewport.js +49 -0
- package/dist/modes/interactive/tasks/viewport.js.map +1 -0
- package/dist/modes/interactive/theme/dark.json +59 -72
- package/dist/modes/interactive/theme/light.json +57 -69
- package/dist/modes/interactive/theme/system-theme.d.ts +54 -0
- package/dist/modes/interactive/theme/system-theme.d.ts.map +1 -0
- package/dist/modes/interactive/theme/system-theme.js +535 -0
- package/dist/modes/interactive/theme/system-theme.js.map +1 -0
- package/dist/modes/interactive/theme/theme-controller.d.ts +46 -6
- package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-controller.js +125 -47
- package/dist/modes/interactive/theme/theme-controller.js.map +1 -1
- package/dist/modes/interactive/theme/theme-json.d.ts +1 -0
- package/dist/modes/interactive/theme/theme-json.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-json.js +3 -1
- package/dist/modes/interactive/theme/theme-json.js.map +1 -1
- package/dist/modes/interactive/theme/theme-schema.json +7 -2
- package/dist/modes/interactive/theme/theme.d.ts +70 -39
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +247 -314
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/interactive/tool-view/chat.d.ts +20 -0
- package/dist/modes/interactive/tool-view/chat.d.ts.map +1 -0
- package/dist/modes/interactive/tool-view/chat.js +46 -0
- package/dist/modes/interactive/tool-view/chat.js.map +1 -0
- package/dist/modes/interactive/tool-view/fallback.d.ts +14 -0
- package/dist/modes/interactive/tool-view/fallback.d.ts.map +1 -0
- package/dist/modes/interactive/tool-view/fallback.js +55 -0
- package/dist/modes/interactive/tool-view/fallback.js.map +1 -0
- package/dist/modes/interactive/tool-view/style.d.ts +63 -0
- package/dist/modes/interactive/tool-view/style.d.ts.map +1 -0
- package/dist/modes/interactive/tool-view/style.js +83 -0
- package/dist/modes/interactive/tool-view/style.js.map +1 -0
- package/dist/modes/interactive/{components → tool-view}/tool-execution.d.ts +17 -24
- package/dist/modes/interactive/tool-view/tool-execution.d.ts.map +1 -0
- package/dist/modes/interactive/{components → tool-view}/tool-execution.js +42 -116
- package/dist/modes/interactive/tool-view/tool-execution.js.map +1 -0
- package/dist/modes/interactive/tui-renderer.d.ts +2 -1
- package/dist/modes/interactive/tui-renderer.d.ts.map +1 -1
- package/dist/modes/interactive/tui-renderer.js +1 -0
- package/dist/modes/interactive/tui-renderer.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +6 -6
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +12 -8
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +7 -9
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +10 -1
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +6 -2
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/utils/clipboard-image.d.ts.map +1 -1
- package/dist/utils/clipboard-image.js +14 -17
- package/dist/utils/clipboard-image.js.map +1 -1
- package/dist/utils/clipboard.d.ts +2 -0
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js +5 -0
- package/dist/utils/clipboard.js.map +1 -1
- package/dist/utils/paths.d.ts +3 -3
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +5 -4
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/shell.d.ts +1 -3
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +3 -30
- package/dist/utils/shell.js.map +1 -1
- package/docs/bundled/README.md +22 -8
- package/docs/bundled/extensions/question.md +6 -5
- package/docs/bundled/extensions/statusline.md +2 -2
- package/docs/bundled/tasks.md +141 -0
- package/docs/bundled/tool-presentation.md +41 -31
- package/docs/custom-provider.md +44 -0
- package/docs/docs.json +10 -6
- package/docs/extensions.md +90 -90
- package/docs/index.md +2 -1
- package/docs/keybindings.md +19 -7
- package/docs/llama-cpp.md +12 -1
- package/docs/mcp.md +188 -0
- package/docs/models.md +35 -0
- package/docs/packages.md +4 -0
- package/docs/providers.md +6 -0
- package/docs/rpc.md +5 -3
- package/docs/sdk.md +26 -16
- package/docs/security.md +4 -0
- package/docs/session-format.md +18 -11
- package/docs/settings.md +26 -2
- package/docs/themes.md +27 -5
- package/docs/tui.md +20 -0
- package/docs/usage.md +61 -3
- package/docs/virtual-models.md +114 -0
- package/docs/windows.md +2 -0
- package/examples/README.md +1 -1
- package/examples/extensions/README.md +2 -0
- 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/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/test.ts +4 -4
- package/examples/extensions/debug-provider.ts +90 -0
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/jev-router.ts +113 -0
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/rpc-client.ts +1 -1
- package/examples/rpc-extension-ui.ts +1 -1
- package/examples/sdk/14-codemode-mcp.ts +61 -0
- package/examples/sdk/README.md +1 -0
- package/npm-shrinkwrap.json +409 -423
- package/package.json +13 -10
- package/dist/bundle/chunks/anthropic-messages-XWFTZP2N.js +0 -6
- package/dist/bundle/chunks/azure-openai-responses-HS35BQV6.js +0 -2
- package/dist/bundle/chunks/chunk-2IO5GDBS.js +0 -11
- package/dist/bundle/chunks/chunk-APQ4ACY3.js +0 -2
- package/dist/bundle/chunks/chunk-EDBLK2JQ.js +0 -2
- package/dist/bundle/chunks/chunk-NUHFSC37.js +0 -25
- package/dist/bundle/chunks/google-generative-ai-NOVAJBFC.js +0 -2
- package/dist/bundle/chunks/google-vertex-4VHCZJV5.js +0 -2
- package/dist/bundle/chunks/mistral-conversations-WC6A2WCJ.js +0 -5
- package/dist/bundle/chunks/openai-codex-responses-XCDG75W2.js +0 -10
- package/dist/bundle/chunks/openai-completions-SHS3CAEL.js +0 -7
- package/dist/bundle/chunks/openai-responses-UT6XFKC7.js +0 -2
- package/dist/bundle/chunks/virtual-modules-W3OGMIX7.js +0 -2
- package/dist/core/background/history.d.ts +0 -4
- package/dist/core/background/history.d.ts.map +0 -1
- package/dist/core/background/history.js.map +0 -1
- package/dist/core/background/output.d.ts.map +0 -1
- package/dist/core/background/output.js.map +0 -1
- package/dist/core/background/presentation.d.ts +0 -9
- package/dist/core/background/presentation.d.ts.map +0 -1
- package/dist/core/background/presentation.js.map +0 -1
- package/dist/core/background/service.d.ts.map +0 -1
- package/dist/core/background/service.js.map +0 -1
- package/dist/core/background/session.d.ts +0 -63
- package/dist/core/background/session.d.ts.map +0 -1
- package/dist/core/background/session.js +0 -222
- package/dist/core/background/session.js.map +0 -1
- package/dist/core/background/types.d.ts.map +0 -1
- package/dist/core/background/types.js.map +0 -1
- package/dist/core/model-stream-options.d.ts +0 -6
- package/dist/core/model-stream-options.d.ts.map +0 -1
- package/dist/core/model-stream-options.js +0 -20
- package/dist/core/model-stream-options.js.map +0 -1
- package/dist/extensions/background/actions.d.ts +0 -11
- package/dist/extensions/background/actions.d.ts.map +0 -1
- package/dist/extensions/background/actions.js.map +0 -1
- package/dist/extensions/background/completion-render.d.ts +0 -8
- package/dist/extensions/background/completion-render.d.ts.map +0 -1
- package/dist/extensions/background/completion-render.js.map +0 -1
- package/dist/extensions/background/constants.d.ts +0 -22
- package/dist/extensions/background/constants.d.ts.map +0 -1
- package/dist/extensions/background/constants.js.map +0 -1
- package/dist/extensions/background/index.d.ts +0 -7
- package/dist/extensions/background/index.d.ts.map +0 -1
- package/dist/extensions/background/index.js +0 -109
- package/dist/extensions/background/index.js.map +0 -1
- package/dist/extensions/background/keybindings.d.ts +0 -10
- package/dist/extensions/background/keybindings.d.ts.map +0 -1
- package/dist/extensions/background/keybindings.js +0 -14
- package/dist/extensions/background/keybindings.js.map +0 -1
- package/dist/extensions/background/manager.d.ts +0 -80
- package/dist/extensions/background/manager.d.ts.map +0 -1
- package/dist/extensions/background/manager.js +0 -673
- package/dist/extensions/background/manager.js.map +0 -1
- package/dist/extensions/background/render.d.ts.map +0 -1
- package/dist/extensions/background/render.js.map +0 -1
- package/dist/extensions/background/schema.d.ts.map +0 -1
- package/dist/extensions/background/schema.js.map +0 -1
- package/dist/extensions/background/task-view.d.ts.map +0 -1
- package/dist/extensions/background/task-view.js.map +0 -1
- package/dist/extensions/background/text.d.ts.map +0 -1
- package/dist/extensions/background/text.js.map +0 -1
- package/dist/extensions/background/types.d.ts.map +0 -1
- package/dist/extensions/background/types.js.map +0 -1
- package/dist/extensions/subagent/activity.d.ts +0 -34
- package/dist/extensions/subagent/activity.d.ts.map +0 -1
- package/dist/extensions/subagent/activity.js +0 -192
- package/dist/extensions/subagent/activity.js.map +0 -1
- package/dist/extensions/subagent/agents-command.d.ts +0 -4
- package/dist/extensions/subagent/agents-command.d.ts.map +0 -1
- package/dist/extensions/subagent/agents-command.js +0 -230
- package/dist/extensions/subagent/agents-command.js.map +0 -1
- package/dist/extensions/subagent/agents.d.ts +0 -6
- package/dist/extensions/subagent/agents.d.ts.map +0 -1
- package/dist/extensions/subagent/agents.js +0 -53
- package/dist/extensions/subagent/agents.js.map +0 -1
- package/dist/extensions/subagent/budget.d.ts +0 -15
- package/dist/extensions/subagent/budget.d.ts.map +0 -1
- package/dist/extensions/subagent/budget.js +0 -123
- package/dist/extensions/subagent/budget.js.map +0 -1
- package/dist/extensions/subagent/cancellation.d.ts +0 -29
- package/dist/extensions/subagent/cancellation.d.ts.map +0 -1
- package/dist/extensions/subagent/cancellation.js +0 -91
- package/dist/extensions/subagent/cancellation.js.map +0 -1
- package/dist/extensions/subagent/constants.d.ts +0 -25
- package/dist/extensions/subagent/constants.d.ts.map +0 -1
- package/dist/extensions/subagent/constants.js +0 -50
- package/dist/extensions/subagent/constants.js.map +0 -1
- package/dist/extensions/subagent/index.d.ts +0 -3
- package/dist/extensions/subagent/index.d.ts.map +0 -1
- package/dist/extensions/subagent/index.js +0 -151
- package/dist/extensions/subagent/index.js.map +0 -1
- package/dist/extensions/subagent/model-selection.d.ts +0 -16
- package/dist/extensions/subagent/model-selection.d.ts.map +0 -1
- package/dist/extensions/subagent/model-selection.js +0 -51
- package/dist/extensions/subagent/model-selection.js.map +0 -1
- package/dist/extensions/subagent/render.d.ts +0 -24
- package/dist/extensions/subagent/render.d.ts.map +0 -1
- package/dist/extensions/subagent/render.js +0 -336
- package/dist/extensions/subagent/render.js.map +0 -1
- package/dist/extensions/subagent/resolve.d.ts +0 -31
- package/dist/extensions/subagent/resolve.d.ts.map +0 -1
- package/dist/extensions/subagent/resolve.js +0 -111
- package/dist/extensions/subagent/resolve.js.map +0 -1
- package/dist/extensions/subagent/runner.d.ts +0 -35
- package/dist/extensions/subagent/runner.d.ts.map +0 -1
- package/dist/extensions/subagent/runner.js +0 -255
- package/dist/extensions/subagent/runner.js.map +0 -1
- package/dist/extensions/subagent/schema.d.ts +0 -28
- package/dist/extensions/subagent/schema.d.ts.map +0 -1
- package/dist/extensions/subagent/schema.js +0 -58
- package/dist/extensions/subagent/schema.js.map +0 -1
- package/dist/extensions/subagent/sdk-runner.d.ts +0 -33
- package/dist/extensions/subagent/sdk-runner.d.ts.map +0 -1
- package/dist/extensions/subagent/sdk-runner.js +0 -331
- package/dist/extensions/subagent/sdk-runner.js.map +0 -1
- package/dist/extensions/subagent/settings.d.ts +0 -8
- package/dist/extensions/subagent/settings.d.ts.map +0 -1
- package/dist/extensions/subagent/settings.js +0 -206
- package/dist/extensions/subagent/settings.js.map +0 -1
- package/dist/extensions/subagent/state.d.ts +0 -102
- package/dist/extensions/subagent/state.d.ts.map +0 -1
- package/dist/extensions/subagent/state.js +0 -383
- package/dist/extensions/subagent/state.js.map +0 -1
- package/dist/extensions/subagent/text.d.ts +0 -6
- package/dist/extensions/subagent/text.d.ts.map +0 -1
- package/dist/extensions/subagent/text.js +0 -66
- package/dist/extensions/subagent/text.js.map +0 -1
- package/dist/extensions/subagent/types.d.ts +0 -91
- package/dist/extensions/subagent/types.d.ts.map +0 -1
- package/dist/extensions/subagent/types.js +0 -2
- package/dist/extensions/subagent/types.js.map +0 -1
- package/dist/extensions/subagent/ui/agents-dialog.d.ts +0 -4
- package/dist/extensions/subagent/ui/agents-dialog.d.ts.map +0 -1
- package/dist/extensions/subagent/ui/agents-dialog.js +0 -84
- package/dist/extensions/subagent/ui/agents-dialog.js.map +0 -1
- package/dist/extensions/subagent/ui/choice-menu.d.ts +0 -39
- package/dist/extensions/subagent/ui/choice-menu.d.ts.map +0 -1
- package/dist/extensions/subagent/ui/choice-menu.js +0 -93
- package/dist/extensions/subagent/ui/choice-menu.js.map +0 -1
- package/dist/extensions/subagent/ui/choices.d.ts +0 -36
- package/dist/extensions/subagent/ui/choices.d.ts.map +0 -1
- package/dist/extensions/subagent/ui/choices.js +0 -54
- package/dist/extensions/subagent/ui/choices.js.map +0 -1
- package/dist/extensions/subagent/ui/model-list.d.ts +0 -66
- package/dist/extensions/subagent/ui/model-list.d.ts.map +0 -1
- package/dist/extensions/subagent/ui/model-list.js +0 -235
- package/dist/extensions/subagent/ui/model-list.js.map +0 -1
- package/dist/extensions/subagent/ui/model-picker.d.ts +0 -47
- package/dist/extensions/subagent/ui/model-picker.d.ts.map +0 -1
- package/dist/extensions/subagent/ui/model-picker.js +0 -143
- package/dist/extensions/subagent/ui/model-picker.js.map +0 -1
- package/dist/extensions/subagent/ui/profile-settings-menu.d.ts +0 -41
- package/dist/extensions/subagent/ui/profile-settings-menu.d.ts.map +0 -1
- package/dist/extensions/subagent/ui/profile-settings-menu.js +0 -98
- package/dist/extensions/subagent/ui/profile-settings-menu.js.map +0 -1
- package/dist/modes/interactive/components/tool-chrome.d.ts +0 -28
- package/dist/modes/interactive/components/tool-chrome.d.ts.map +0 -1
- package/dist/modes/interactive/components/tool-chrome.js +0 -84
- package/dist/modes/interactive/components/tool-chrome.js.map +0 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +0 -1
- package/dist/modes/interactive/components/tool-execution.js.map +0 -1
- package/dist/modes/interactive/components/tool-group.d.ts +0 -17
- package/dist/modes/interactive/components/tool-group.d.ts.map +0 -1
- package/dist/modes/interactive/components/tool-group.js +0 -78
- package/dist/modes/interactive/components/tool-group.js.map +0 -1
- package/dist/modes/interactive/tool-chat.d.ts +0 -21
- package/dist/modes/interactive/tool-chat.d.ts.map +0 -1
- package/dist/modes/interactive/tool-chat.js +0 -58
- package/dist/modes/interactive/tool-chat.js.map +0 -1
- package/docs/bundled/extensions/background.md +0 -132
- package/docs/bundled/extensions/subagent.md +0 -148
- /package/dist/{extensions/background → core/tools/tasks}/types.js +0 -0
|
@@ -1,673 +0,0 @@
|
|
|
1
|
-
/** Inline observer: selecting or closing a view never changes execution ownership. */
|
|
2
|
-
import "./keybindings.js";
|
|
3
|
-
import { homedir } from "node:os";
|
|
4
|
-
import { Markdown, stripTerminalSequences, truncateToWidth, visibleWidth, wrapTextWithAnsi, } from "@earendil-works/pi-tui";
|
|
5
|
-
import { isBackgroundTerminal, isForegroundShellTask, } from "../../core/background/types.js";
|
|
6
|
-
import { DynamicBorder } from "../../modes/interactive/components/dynamic-border.js";
|
|
7
|
-
import { keyLabel } from "../../modes/interactive/components/keybinding-hints.js";
|
|
8
|
-
import { STATUS_SPINNER_INTERVAL_MS, statusMarker } from "../../modes/interactive/components/status-marker.js";
|
|
9
|
-
import { getMarkdownTheme, highlightCode } from "../../modes/interactive/theme/theme.js";
|
|
10
|
-
import { sanitizeBinaryOutput } from "../../utils/shell.js";
|
|
11
|
-
import { exitSuffix, runtimeLabel, taskLabel, workerLabel } from "./task-view.js";
|
|
12
|
-
import { firstCommandLine, formatAge } from "./text.js";
|
|
13
|
-
const WIDE_MIN_WIDTH = 100;
|
|
14
|
-
const LIST_MIN_WIDTH = 28;
|
|
15
|
-
const LIST_MAX_WIDTH = 44;
|
|
16
|
-
const NARROW_LIST_MAX_ROWS = 7;
|
|
17
|
-
/** Below this the two-pane layout is unreadable; show a resize notice instead. */
|
|
18
|
-
const MIN_RENDER_WIDTH = 60;
|
|
19
|
-
const MIN_RENDER_HEIGHT = 12;
|
|
20
|
-
/** A pending kill confirmation auto-cancels instead of capturing input forever. */
|
|
21
|
-
const KILL_CONFIRM_TIMEOUT_MS = 5000;
|
|
22
|
-
const DETAIL_LABEL_WIDTH = 10;
|
|
23
|
-
const DETAIL_MAX_ROWS = 9;
|
|
24
|
-
const COMMAND_MAX_ROWS = 3;
|
|
25
|
-
const ERROR_MAX_ROWS = 2;
|
|
26
|
-
/** Long field values (worker model/usage) wrap up to this many rows instead of truncating. */
|
|
27
|
-
const DETAIL_VALUE_MAX_ROWS = 2;
|
|
28
|
-
const RENDER_CACHE_MAX = 8;
|
|
29
|
-
const clean = (text) => sanitizeBinaryOutput(stripTerminalSequences(text));
|
|
30
|
-
const pad = (text, width) => truncateToWidth(text, width, "…", true);
|
|
31
|
-
const padEnd = (text, width) => text + " ".repeat(Math.max(0, width - visibleWidth(text)));
|
|
32
|
-
const oneLine = (text) => clean(text).replace(/\s+/g, " ");
|
|
33
|
-
function headChars(text, width) {
|
|
34
|
-
let out = "";
|
|
35
|
-
let used = 0;
|
|
36
|
-
for (const char of text) {
|
|
37
|
-
const charWidth = visibleWidth(char);
|
|
38
|
-
if (used + charWidth > width)
|
|
39
|
-
break;
|
|
40
|
-
out += char;
|
|
41
|
-
used += charWidth;
|
|
42
|
-
}
|
|
43
|
-
return out;
|
|
44
|
-
}
|
|
45
|
-
function tailChars(text, width) {
|
|
46
|
-
let out = "";
|
|
47
|
-
let used = 0;
|
|
48
|
-
const chars = [...text];
|
|
49
|
-
for (let i = chars.length - 1; i >= 0; i--) {
|
|
50
|
-
const charWidth = visibleWidth(chars[i]);
|
|
51
|
-
if (used + charWidth > width)
|
|
52
|
-
break;
|
|
53
|
-
out = chars[i] + out;
|
|
54
|
-
used += charWidth;
|
|
55
|
-
}
|
|
56
|
-
return out;
|
|
57
|
-
}
|
|
58
|
-
function ellipsizeMiddle(text, width) {
|
|
59
|
-
if (visibleWidth(text) <= width)
|
|
60
|
-
return text;
|
|
61
|
-
if (width <= 1)
|
|
62
|
-
return truncateToWidth(text, Math.max(1, width), "…");
|
|
63
|
-
const head = Math.ceil((width - 1) / 2);
|
|
64
|
-
const tail = width - 1 - head;
|
|
65
|
-
return `${headChars(text, head)}…${tailChars(text, tail)}`;
|
|
66
|
-
}
|
|
67
|
-
function displayPath(path, width) {
|
|
68
|
-
const home = homedir();
|
|
69
|
-
const shortened = home && path.startsWith(home) ? `~${path.slice(home.length)}` : path;
|
|
70
|
-
return ellipsizeMiddle(shortened, width);
|
|
71
|
-
}
|
|
72
|
-
export class BackgroundTasksMenu {
|
|
73
|
-
constructor(options) {
|
|
74
|
-
this.focused = false;
|
|
75
|
-
this.rows = [];
|
|
76
|
-
this.runningCount = 0;
|
|
77
|
-
this.finishedCount = 0;
|
|
78
|
-
this.completedCount = 0;
|
|
79
|
-
this.failedCount = 0;
|
|
80
|
-
this.hiddenFinished = 0;
|
|
81
|
-
this.disposed = false;
|
|
82
|
-
this.focus = "list";
|
|
83
|
-
this.positions = new Map();
|
|
84
|
-
this.renderCache = new Map();
|
|
85
|
-
this.busy = false;
|
|
86
|
-
this.lastFrame = "";
|
|
87
|
-
this.options = options;
|
|
88
|
-
this.width = options.tui.terminal.columns;
|
|
89
|
-
this.sync();
|
|
90
|
-
this.unsubscribe = options.host.subscribe(() => {
|
|
91
|
-
this.sync();
|
|
92
|
-
// Coalesce high-frequency progress; polling reads only visible output.
|
|
93
|
-
});
|
|
94
|
-
this.pollTimer = setInterval(() => this.queueTick(), options.pollIntervalMs ?? 1000);
|
|
95
|
-
this.pollTimer.unref?.();
|
|
96
|
-
this.queueTick();
|
|
97
|
-
}
|
|
98
|
-
queueTick() {
|
|
99
|
-
void this.tick().catch(() => {
|
|
100
|
-
/* A failed repaint must not become an unhandled rejection. */
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
invalidate() {
|
|
104
|
-
this.lastFrame = "";
|
|
105
|
-
this.renderCache.clear();
|
|
106
|
-
}
|
|
107
|
-
dispose() {
|
|
108
|
-
if (this.disposed)
|
|
109
|
-
return;
|
|
110
|
-
this.disposed = true;
|
|
111
|
-
clearInterval(this.pollTimer);
|
|
112
|
-
clearInterval(this.animationTimer);
|
|
113
|
-
this.animationTimer = undefined;
|
|
114
|
-
this.clearPendingKill();
|
|
115
|
-
this.unsubscribe();
|
|
116
|
-
this.releasePin?.();
|
|
117
|
-
this.positions.clear();
|
|
118
|
-
}
|
|
119
|
-
clearPendingKill() {
|
|
120
|
-
this.pendingKill = undefined;
|
|
121
|
-
if (this.pendingKillTimer) {
|
|
122
|
-
clearTimeout(this.pendingKillTimer);
|
|
123
|
-
this.pendingKillTimer = undefined;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
current() {
|
|
127
|
-
return this.rows.find((row) => row.key === this.selected);
|
|
128
|
-
}
|
|
129
|
-
wide() {
|
|
130
|
-
return this.width >= WIDE_MIN_WIDTH;
|
|
131
|
-
}
|
|
132
|
-
/** Fullscreen overlay: body fills the terminal minus the frame (rule, title, rule, hints, rule). */
|
|
133
|
-
bodyHeight() {
|
|
134
|
-
return Math.max(6, this.options.tui.terminal.rows - 5);
|
|
135
|
-
}
|
|
136
|
-
sync() {
|
|
137
|
-
if (this.disposed)
|
|
138
|
-
return;
|
|
139
|
-
const tasks = this.options.host.list();
|
|
140
|
-
const running = tasks
|
|
141
|
-
.filter((task) => !isBackgroundTerminal(task.status))
|
|
142
|
-
.sort((a, b) => b.startedAt - a.startedAt);
|
|
143
|
-
// Finished includes every subagent group and background shell. Foreground
|
|
144
|
-
// shells deliver inline, except the selected row stays until selection moves.
|
|
145
|
-
const selectedTask = this.selected?.split("/")[0];
|
|
146
|
-
const settled = tasks
|
|
147
|
-
.filter((task) => isBackgroundTerminal(task.status))
|
|
148
|
-
.sort((a, b) => (b.endedAt ?? b.startedAt) - (a.endedAt ?? a.startedAt));
|
|
149
|
-
const finished = settled.filter((task) => !isForegroundShellTask(task) || task.id === selectedTask);
|
|
150
|
-
this.runningCount = running.length;
|
|
151
|
-
this.finishedCount = finished.length;
|
|
152
|
-
this.completedCount = finished.filter((task) => task.status === "completed").length;
|
|
153
|
-
this.failedCount = this.finishedCount - this.completedCount;
|
|
154
|
-
this.hiddenFinished = settled.length - finished.length;
|
|
155
|
-
this.rows = [...running, ...finished].flatMap((task) => [
|
|
156
|
-
{ key: task.id, task },
|
|
157
|
-
...(task.projection?.workers ?? []).map((worker) => ({ key: `${task.id}/${worker.id}`, task, worker })),
|
|
158
|
-
]);
|
|
159
|
-
if (!this.current()) {
|
|
160
|
-
this.selected = this.rows[0]?.key;
|
|
161
|
-
}
|
|
162
|
-
const keys = new Set(this.rows.map((row) => row.key));
|
|
163
|
-
for (const key of this.positions.keys())
|
|
164
|
-
if (!keys.has(key))
|
|
165
|
-
this.positions.delete(key);
|
|
166
|
-
const id = this.current()?.task.id;
|
|
167
|
-
if (id !== this.pinned) {
|
|
168
|
-
// Acquire before releasing so history eviction cannot steal the selection.
|
|
169
|
-
const release = id ? this.options.host.pin(id) : undefined;
|
|
170
|
-
const previous = this.releasePin;
|
|
171
|
-
this.pinned = id;
|
|
172
|
-
this.releasePin = release;
|
|
173
|
-
previous?.();
|
|
174
|
-
}
|
|
175
|
-
// Spinner frames must advance independently of output polling and pending reads.
|
|
176
|
-
if (this.rows.some((row) => (row.worker?.status ?? row.task.status) === "running")) {
|
|
177
|
-
if (!this.animationTimer) {
|
|
178
|
-
this.animationTimer = setInterval(() => this.options.tui.requestRender(), STATUS_SPINNER_INTERVAL_MS);
|
|
179
|
-
this.animationTimer.unref?.();
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
else {
|
|
183
|
-
clearInterval(this.animationTimer);
|
|
184
|
-
this.animationTimer = undefined;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
async tick() {
|
|
188
|
-
if (this.disposed)
|
|
189
|
-
return;
|
|
190
|
-
this.sync();
|
|
191
|
-
if (this.wide() || this.focus === "preview")
|
|
192
|
-
await this.refresh();
|
|
193
|
-
if (this.disposed)
|
|
194
|
-
return;
|
|
195
|
-
const frame = this.render(this.width).join("\n");
|
|
196
|
-
if (frame !== this.lastFrame) {
|
|
197
|
-
this.lastFrame = frame;
|
|
198
|
-
this.options.tui.requestRender();
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
async refresh() {
|
|
202
|
-
const row = this.current();
|
|
203
|
-
if (!row || row.worker || row.task.kind !== "bash" || this.busy)
|
|
204
|
-
return;
|
|
205
|
-
const position = this.position();
|
|
206
|
-
// Keep the bounded output with its row's scroll anchor while browsing.
|
|
207
|
-
// A new tail can otherwise move even lines that are still inside the read window.
|
|
208
|
-
if (position.output && (!position.follow || position.output.settled))
|
|
209
|
-
return;
|
|
210
|
-
this.busy = true;
|
|
211
|
-
try {
|
|
212
|
-
const slice = await this.options.host.read(row.task.id, { mode: "tail", bytes: 128 * 1024 });
|
|
213
|
-
if (this.disposed || this.selected !== row.key)
|
|
214
|
-
return;
|
|
215
|
-
// A read started while following may settle after the user scrolls up.
|
|
216
|
-
if (!position.follow && position.output)
|
|
217
|
-
return;
|
|
218
|
-
position.output = {
|
|
219
|
-
text: clean(slice.text).split("\n").slice(-2000).join("\n"),
|
|
220
|
-
readError: slice.readError ? clean(slice.readError).slice(0, 4096) : undefined,
|
|
221
|
-
settled: isBackgroundTerminal(slice.task.status),
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
catch (error) {
|
|
225
|
-
if (!this.disposed && this.selected === row.key && (position.follow || !position.output)) {
|
|
226
|
-
position.output = {
|
|
227
|
-
text: "",
|
|
228
|
-
readError: `Cannot read output: ${clean(String(error)).slice(0, 1000)}`,
|
|
229
|
-
settled: false,
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
finally {
|
|
234
|
-
this.busy = false;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
handleInput(data) {
|
|
238
|
-
if (this.disposed)
|
|
239
|
-
return;
|
|
240
|
-
const kb = this.options.keybindings;
|
|
241
|
-
this.feedback = undefined;
|
|
242
|
-
if (this.pendingKill) {
|
|
243
|
-
// The one raw-key exception: a pending y/N confirmation captures the next input.
|
|
244
|
-
const id = this.pendingKill;
|
|
245
|
-
this.clearPendingKill();
|
|
246
|
-
if (data === "y" || data === "Y") {
|
|
247
|
-
try {
|
|
248
|
-
this.feedback = this.options.host.kill(id)
|
|
249
|
-
? `stopping ${id}… (whole group)`
|
|
250
|
-
: `${id}: no new cancellation requested`;
|
|
251
|
-
}
|
|
252
|
-
catch (error) {
|
|
253
|
-
this.feedback = oneLine(String(error));
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
this.options.tui.requestRender();
|
|
257
|
-
return;
|
|
258
|
-
}
|
|
259
|
-
if (kb.matches(data, "tui.select.cancel")) {
|
|
260
|
-
if (this.focus === "preview")
|
|
261
|
-
this.focus = "list";
|
|
262
|
-
else {
|
|
263
|
-
this.dispose();
|
|
264
|
-
this.options.onClose();
|
|
265
|
-
return;
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
else if (kb.matches(data, "app.backgroundTasks.kill")) {
|
|
269
|
-
const row = this.current();
|
|
270
|
-
if (row) {
|
|
271
|
-
this.clearPendingKill();
|
|
272
|
-
this.pendingKill = row.task.id;
|
|
273
|
-
this.pendingKillTimer = setTimeout(() => {
|
|
274
|
-
this.pendingKill = undefined;
|
|
275
|
-
this.pendingKillTimer = undefined;
|
|
276
|
-
if (!this.disposed)
|
|
277
|
-
this.options.tui.requestRender();
|
|
278
|
-
}, KILL_CONFIRM_TIMEOUT_MS);
|
|
279
|
-
this.pendingKillTimer.unref?.();
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
else if (kb.matches(data, "app.backgroundTasks.focusList")) {
|
|
283
|
-
this.focus = "list";
|
|
284
|
-
}
|
|
285
|
-
else if (kb.matches(data, "app.backgroundTasks.focusPreview") || kb.matches(data, "tui.select.confirm")) {
|
|
286
|
-
this.focus = "preview";
|
|
287
|
-
this.queueTick();
|
|
288
|
-
}
|
|
289
|
-
else {
|
|
290
|
-
const pageUp = kb.matches(data, this.focus === "list" ? "tui.select.pageUp" : "tui.editor.pageUp");
|
|
291
|
-
const pageDown = kb.matches(data, this.focus === "list" ? "tui.select.pageDown" : "tui.editor.pageDown");
|
|
292
|
-
const direction = pageUp || kb.matches(data, "tui.select.up") ? -1 : pageDown || kb.matches(data, "tui.select.down") ? 1 : 0;
|
|
293
|
-
const layout = this.layout();
|
|
294
|
-
const delta = direction *
|
|
295
|
-
(pageUp || pageDown ? (this.focus === "preview" ? layout.contentHeight : layout.listVisible) : 1);
|
|
296
|
-
if (delta && this.focus === "preview")
|
|
297
|
-
this.scrollPreview(delta);
|
|
298
|
-
else if (delta && this.rows.length) {
|
|
299
|
-
const index = this.rows.findIndex((row) => row.key === this.selected);
|
|
300
|
-
const next = pageUp || pageDown
|
|
301
|
-
? Math.max(0, Math.min(this.rows.length - 1, index + delta))
|
|
302
|
-
: (index + delta + this.rows.length) % this.rows.length;
|
|
303
|
-
this.selected = this.rows[next]?.key;
|
|
304
|
-
this.sync();
|
|
305
|
-
this.queueTick();
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
this.options.tui.requestRender();
|
|
309
|
-
}
|
|
310
|
-
position() {
|
|
311
|
-
const key = this.selected ?? "";
|
|
312
|
-
let position = this.positions.get(key);
|
|
313
|
-
if (!position) {
|
|
314
|
-
position = { scroll: 0, follow: this.current()?.task.kind === "bash" && !this.current()?.worker };
|
|
315
|
-
if (this.selected)
|
|
316
|
-
this.positions.set(key, position);
|
|
317
|
-
}
|
|
318
|
-
return position;
|
|
319
|
-
}
|
|
320
|
-
/** Selectable rows interleaved with their section headers; headers are display-only and never selected. */
|
|
321
|
-
listItems() {
|
|
322
|
-
const items = [];
|
|
323
|
-
let section = "";
|
|
324
|
-
for (const row of this.rows) {
|
|
325
|
-
const next = isBackgroundTerminal(row.task.status) ? "Finished" : "Running";
|
|
326
|
-
if (next !== section) {
|
|
327
|
-
section = next;
|
|
328
|
-
items.push({ header: next });
|
|
329
|
-
}
|
|
330
|
-
items.push({ row });
|
|
331
|
-
}
|
|
332
|
-
return items;
|
|
333
|
-
}
|
|
334
|
-
cacheSet(key, lines) {
|
|
335
|
-
if (this.renderCache.size >= RENDER_CACHE_MAX) {
|
|
336
|
-
const oldest = this.renderCache.keys().next().value;
|
|
337
|
-
if (oldest !== undefined)
|
|
338
|
-
this.renderCache.delete(oldest);
|
|
339
|
-
}
|
|
340
|
-
this.renderCache.set(key, lines);
|
|
341
|
-
}
|
|
342
|
-
commandLines(task, width, maxRows) {
|
|
343
|
-
const first = firstCommandLine(task.command ?? "");
|
|
344
|
-
const key = `command|${task.id}|${width}|${first.length}`;
|
|
345
|
-
let lines = this.renderCache.get(key);
|
|
346
|
-
if (!lines) {
|
|
347
|
-
lines = wrapTextWithAnsi(highlightCode(first, "bash")[0] ?? "", Math.max(1, width));
|
|
348
|
-
this.cacheSet(key, lines);
|
|
349
|
-
}
|
|
350
|
-
return lines.slice(0, maxRows);
|
|
351
|
-
}
|
|
352
|
-
markdownLines(rowKey, section, text, width) {
|
|
353
|
-
const key = `${section}|${rowKey}|${width}|${text.length}`;
|
|
354
|
-
const cached = this.renderCache.get(key);
|
|
355
|
-
if (cached)
|
|
356
|
-
return cached;
|
|
357
|
-
const lines = new Markdown(text, 0, 0, getMarkdownTheme(), {
|
|
358
|
-
color: (value) => this.options.theme.fg("toolOutput", value),
|
|
359
|
-
}).render(Math.max(1, width));
|
|
360
|
-
this.cacheSet(key, lines);
|
|
361
|
-
return lines;
|
|
362
|
-
}
|
|
363
|
-
detailLines(row, valueWidth, compact) {
|
|
364
|
-
if (!row)
|
|
365
|
-
return [];
|
|
366
|
-
const { theme } = this.options;
|
|
367
|
-
const { task, worker } = row;
|
|
368
|
-
const now = Date.now();
|
|
369
|
-
const marker = statusMarker(worker?.status ?? task.status, { now });
|
|
370
|
-
const glyph = theme.fg(marker.color, marker.glyph);
|
|
371
|
-
const time = isBackgroundTerminal(task.status) && task.endedAt ? formatAge(task.endedAt, now) : runtimeLabel(task, now);
|
|
372
|
-
const field = (label, values) => values.map((value, index) => `${theme.fg("dim", padEnd(index === 0 ? label : "", DETAIL_LABEL_WIDTH))}${value}`);
|
|
373
|
-
const status = worker
|
|
374
|
-
? `${glyph} ${worker.status}`
|
|
375
|
-
: `${glyph} ${task.status} · ${task.mode} · ${time}${exitSuffix(task.exitCode, " · ")}`;
|
|
376
|
-
if (compact) {
|
|
377
|
-
const second = worker
|
|
378
|
-
? field("Worker", [truncateToWidth(clean(worker.label), valueWidth, "…")])
|
|
379
|
-
: task.command
|
|
380
|
-
? field("Command", this.commandLines(task, valueWidth, 1))
|
|
381
|
-
: field("Task", [truncateToWidth(task.id, valueWidth, "…")]);
|
|
382
|
-
return [...field("Status", [status]), ...second];
|
|
383
|
-
}
|
|
384
|
-
if (worker) {
|
|
385
|
-
// Model and usage get their own rows and wrap rather than truncate:
|
|
386
|
-
// one combined line always overflows at realistic widths.
|
|
387
|
-
const wrap = (value) => wrapTextWithAnsi(value, Math.max(1, valueWidth)).slice(0, DETAIL_VALUE_MAX_ROWS);
|
|
388
|
-
return [
|
|
389
|
-
...field("Status", [status]),
|
|
390
|
-
...field("Worker", [truncateToWidth(clean(worker.label), valueWidth, "…")]),
|
|
391
|
-
...field("Group", [truncateToWidth(task.id, valueWidth, "…")]),
|
|
392
|
-
...field("Model", wrap(worker.model ?? "—")),
|
|
393
|
-
...field("Usage", wrap(worker.usage ?? "—")),
|
|
394
|
-
];
|
|
395
|
-
}
|
|
396
|
-
const readError = this.positions.get(row.key)?.output?.readError;
|
|
397
|
-
const lines = [
|
|
398
|
-
...field("Status", [status]),
|
|
399
|
-
...field("Task", [truncateToWidth(task.id, valueWidth, "…")]),
|
|
400
|
-
...field("Error", [
|
|
401
|
-
task.error ? `Task error: ${oneLine(task.error)}` : "",
|
|
402
|
-
readError ? `Output read error: ${oneLine(readError)}` : "",
|
|
403
|
-
]
|
|
404
|
-
.filter(Boolean)
|
|
405
|
-
.flatMap((error) => wrapTextWithAnsi(theme.fg("error", error), Math.max(1, valueWidth)))
|
|
406
|
-
.slice(0, ERROR_MAX_ROWS)),
|
|
407
|
-
];
|
|
408
|
-
if (task.kind === "bash") {
|
|
409
|
-
if (task.command)
|
|
410
|
-
lines.push(...field("Command", this.commandLines(task, valueWidth, COMMAND_MAX_ROWS)));
|
|
411
|
-
if (task.cwd)
|
|
412
|
-
lines.push(...field("Directory", [truncateToWidth(displayPath(task.cwd, valueWidth), valueWidth, "…")]));
|
|
413
|
-
if (task.outputPath)
|
|
414
|
-
lines.push(...field("Output", [displayPath(task.outputPath, valueWidth)]));
|
|
415
|
-
}
|
|
416
|
-
return lines.slice(0, DETAIL_MAX_ROWS);
|
|
417
|
-
}
|
|
418
|
-
workerLines(row, width) {
|
|
419
|
-
const worker = row.worker;
|
|
420
|
-
if (!worker)
|
|
421
|
-
return [];
|
|
422
|
-
const { theme } = this.options;
|
|
423
|
-
const heading = (text) => theme.fg("dim", theme.bold(text));
|
|
424
|
-
const lines = [
|
|
425
|
-
heading("Prompt"),
|
|
426
|
-
...this.markdownLines(row.key, "prompt", worker.prompt, width),
|
|
427
|
-
"",
|
|
428
|
-
heading("Activity"),
|
|
429
|
-
];
|
|
430
|
-
for (const line of worker.activity ? clean(worker.activity).split("\n") : ["—"])
|
|
431
|
-
lines.push(theme.fg("toolOutput", line));
|
|
432
|
-
lines.push("");
|
|
433
|
-
if (worker.error)
|
|
434
|
-
lines.push(...wrapTextWithAnsi(theme.fg("error", oneLine(worker.error)), Math.max(1, width)).slice(0, ERROR_MAX_ROWS));
|
|
435
|
-
lines.push(heading("Outcome"));
|
|
436
|
-
if (worker.report.text)
|
|
437
|
-
lines.push(...this.markdownLines(row.key, "outcome", worker.report.text, width));
|
|
438
|
-
else if (worker.status === "queued" || worker.status === "running")
|
|
439
|
-
lines.push(theme.fg("muted", "Still running…"));
|
|
440
|
-
else
|
|
441
|
-
lines.push(theme.fg("muted", "No report returned."));
|
|
442
|
-
if (worker.report.truncated)
|
|
443
|
-
lines.push(theme.fg("warning", "[Saved report truncated.]"));
|
|
444
|
-
return lines;
|
|
445
|
-
}
|
|
446
|
-
contentLines(row, width) {
|
|
447
|
-
if (!row)
|
|
448
|
-
return [];
|
|
449
|
-
const { theme } = this.options;
|
|
450
|
-
const { task, worker } = row;
|
|
451
|
-
if (worker)
|
|
452
|
-
return this.workerLines(row, width);
|
|
453
|
-
if (task.kind !== "bash") {
|
|
454
|
-
const workers = task.projection?.workers ?? [];
|
|
455
|
-
const now = Date.now();
|
|
456
|
-
if (workers.length)
|
|
457
|
-
return workers.map((w) => {
|
|
458
|
-
const marker = statusMarker(w.status, { now });
|
|
459
|
-
// One truncated line per worker — an index of who did what. Model
|
|
460
|
-
// and usage live in the worker's own detail view.
|
|
461
|
-
const summary = oneLine(`${w.label} · ${w.status}${w.description ? ` — ${w.description}` : ""}`);
|
|
462
|
-
return `${theme.fg(marker.color, marker.glyph)} ${theme.fg("toolOutput", truncateToWidth(summary, Math.max(1, width), "…"))}`;
|
|
463
|
-
});
|
|
464
|
-
const fallback = task.projection?.text;
|
|
465
|
-
return fallback
|
|
466
|
-
? clean(fallback)
|
|
467
|
-
.split("\n")
|
|
468
|
-
.map((line) => theme.fg("toolOutput", line))
|
|
469
|
-
: [theme.fg("muted", "No workers.")];
|
|
470
|
-
}
|
|
471
|
-
const text = this.positions.get(row.key)?.output?.text ?? task.projection?.text ?? "Loading…";
|
|
472
|
-
return clean(text)
|
|
473
|
-
.split("\n")
|
|
474
|
-
.map((line) => theme.fg("toolOutput", line));
|
|
475
|
-
}
|
|
476
|
-
/** One geometry calculation shared by rendering and page/line navigation. */
|
|
477
|
-
layout() {
|
|
478
|
-
const wide = this.wide();
|
|
479
|
-
const listWidth = wide
|
|
480
|
-
? Math.min(LIST_MAX_WIDTH, Math.max(LIST_MIN_WIDTH, Math.floor((this.width - 1) * 0.36)))
|
|
481
|
-
: this.width;
|
|
482
|
-
const previewWidth = wide ? this.width - listWidth - 1 : this.width;
|
|
483
|
-
const bodyHeight = this.bodyHeight();
|
|
484
|
-
const items = this.listItems();
|
|
485
|
-
const selectedIndex = items.findIndex((item) => "row" in item && item.row.key === this.selected);
|
|
486
|
-
const listVisible = wide ? bodyHeight : Math.min(NARROW_LIST_MAX_ROWS, Math.max(1, bodyHeight - 4));
|
|
487
|
-
const listFirst = Math.max(0, selectedIndex - listVisible + 1);
|
|
488
|
-
const visibleItems = items.slice(listFirst, listFirst + listVisible);
|
|
489
|
-
const row = this.current();
|
|
490
|
-
const detail = this.detailLines(row, Math.max(1, previewWidth - DETAIL_LABEL_WIDTH), !wide).slice(0, wide ? Math.max(1, Math.min(DETAIL_MAX_ROWS, bodyHeight - 2)) : 2);
|
|
491
|
-
const contentHeight = wide
|
|
492
|
-
? Math.max(1, bodyHeight - detail.length - 1)
|
|
493
|
-
: Math.max(1, bodyHeight - visibleItems.length - detail.length - 1);
|
|
494
|
-
const wrapped = this.contentLines(row, previewWidth).flatMap((line, lineIndex) => {
|
|
495
|
-
let column = 0;
|
|
496
|
-
return wrapTextWithAnsi(line, Math.max(1, previewWidth)).map((text) => {
|
|
497
|
-
const entry = { text, line: lineIndex, column };
|
|
498
|
-
column += visibleWidth(text);
|
|
499
|
-
return entry;
|
|
500
|
-
});
|
|
501
|
-
});
|
|
502
|
-
const entries = row?.task.kind === "bash" && !row.worker ? wrapped.slice(-2000) : wrapped.slice(0, 2000);
|
|
503
|
-
const content = entries.map((entry) => entry.text);
|
|
504
|
-
const max = Math.max(0, content.length - contentHeight);
|
|
505
|
-
const position = this.position();
|
|
506
|
-
let offset = position.scroll;
|
|
507
|
-
if (position.anchor) {
|
|
508
|
-
const anchor = position.anchor;
|
|
509
|
-
const first = entries.findIndex((entry) => entry.line === anchor.line);
|
|
510
|
-
if (first >= 0) {
|
|
511
|
-
offset = first;
|
|
512
|
-
while (offset + 1 < entries.length &&
|
|
513
|
-
entries[offset + 1].line === anchor.line &&
|
|
514
|
-
entries[offset + 1].column <= anchor.column)
|
|
515
|
-
offset++;
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
const start = position.follow ? max : Math.min(offset, max);
|
|
519
|
-
return {
|
|
520
|
-
wide,
|
|
521
|
-
listWidth,
|
|
522
|
-
previewWidth,
|
|
523
|
-
bodyHeight,
|
|
524
|
-
visibleItems,
|
|
525
|
-
listVisible,
|
|
526
|
-
detail,
|
|
527
|
-
content,
|
|
528
|
-
contentHeight,
|
|
529
|
-
start,
|
|
530
|
-
max,
|
|
531
|
-
total: content.length,
|
|
532
|
-
entries,
|
|
533
|
-
};
|
|
534
|
-
}
|
|
535
|
-
scrollPreview(delta) {
|
|
536
|
-
const { start, max, entries } = this.layout();
|
|
537
|
-
const position = this.position();
|
|
538
|
-
const wasFollowing = position.follow;
|
|
539
|
-
position.scroll = Math.min(max, Math.max(0, start + delta));
|
|
540
|
-
const entry = entries[position.scroll];
|
|
541
|
-
position.anchor = entry ? { line: entry.line, column: entry.column } : undefined;
|
|
542
|
-
// Only an explicit downward movement resumes shell following, never resize/update.
|
|
543
|
-
position.follow =
|
|
544
|
-
delta > 0 && position.scroll === max && this.current()?.task.kind === "bash" && !this.current()?.worker;
|
|
545
|
-
if (position.follow && !wasFollowing)
|
|
546
|
-
this.queueTick();
|
|
547
|
-
}
|
|
548
|
-
listRowLine(row, width) {
|
|
549
|
-
const { theme } = this.options;
|
|
550
|
-
const selected = row.key === this.selected;
|
|
551
|
-
const now = Date.now();
|
|
552
|
-
const marker = statusMarker(row.worker?.status ?? row.task.status, { now });
|
|
553
|
-
const glyph = theme.fg(marker.color, marker.glyph);
|
|
554
|
-
const cursor = selected ? theme.fg(this.focus === "list" ? "accent" : "muted", "→ ") : " ";
|
|
555
|
-
const indent = row.worker ? " " : "";
|
|
556
|
-
const terminal = isBackgroundTerminal(row.task.status);
|
|
557
|
-
// Foreground mode stays explicit, including completed subagent groups.
|
|
558
|
-
let time = "";
|
|
559
|
-
if (!row.worker) {
|
|
560
|
-
time = terminal ? formatAge(row.task.endedAt ?? row.task.startedAt, now) : runtimeLabel(row.task, now);
|
|
561
|
-
const workers = row.task.projection?.workers;
|
|
562
|
-
if (workers && workers.length > 0) {
|
|
563
|
-
const settledCount = workers.filter((w) => w.status !== "queued" && w.status !== "running").length;
|
|
564
|
-
time = `${settledCount}/${workers.length} · ${time}`;
|
|
565
|
-
}
|
|
566
|
-
if (row.task.mode === "foreground")
|
|
567
|
-
time = `fg · ${time}`;
|
|
568
|
-
}
|
|
569
|
-
const timeWidth = time ? visibleWidth(time) + 1 : 0;
|
|
570
|
-
const labelWidth = Math.max(1, width - 2 - indent.length - visibleWidth(glyph) - 1 - timeWidth);
|
|
571
|
-
const labelColor = selected && this.focus === "list" ? "accent" : "text";
|
|
572
|
-
const label = theme.fg(labelColor, truncateToWidth(clean(row.worker ? workerLabel(row.worker) : taskLabel({ command: row.task.command ?? row.task.title })), labelWidth, "…"));
|
|
573
|
-
let line = `${cursor}${indent}${glyph} ${label}`;
|
|
574
|
-
if (time)
|
|
575
|
-
line += " ".repeat(Math.max(1, width - visibleWidth(line) - visibleWidth(time))) + theme.fg("dim", time);
|
|
576
|
-
return pad(line, width);
|
|
577
|
-
}
|
|
578
|
-
emptyLine(width) {
|
|
579
|
-
return this.centered(width, "No background tasks.");
|
|
580
|
-
}
|
|
581
|
-
/** Tiny-terminal fallback: the frame stays, the layout steps aside. */
|
|
582
|
-
renderTooSmall(width, rows) {
|
|
583
|
-
const { theme, keybindings } = this.options;
|
|
584
|
-
const rule = () => new DynamicBorder((text) => theme.fg("border", text)).render(width)[0] ?? "";
|
|
585
|
-
const message = `Terminal too small for /bg — resize to at least ${MIN_RENDER_WIDTH}×${MIN_RENDER_HEIGHT}.`;
|
|
586
|
-
const bodyHeight = Math.max(1, rows - 4);
|
|
587
|
-
const body = Array.from({ length: bodyHeight }, () => pad("", width));
|
|
588
|
-
body[Math.floor(bodyHeight / 2)] = this.centered(width, message);
|
|
589
|
-
const closeHint = pad(theme.fg("dim", `${keyLabel("tui.select.cancel", { keybindings })} close`), width);
|
|
590
|
-
return [rule(), ...body, rule(), closeHint, rule()];
|
|
591
|
-
}
|
|
592
|
-
centered(width, message) {
|
|
593
|
-
const leftPad = Math.max(0, Math.floor((width - visibleWidth(message)) / 2));
|
|
594
|
-
return pad(this.options.theme.fg("muted", `${" ".repeat(leftPad)}${message}`), width);
|
|
595
|
-
}
|
|
596
|
-
dividerLine(layout) {
|
|
597
|
-
const { theme } = this.options;
|
|
598
|
-
const row = this.current();
|
|
599
|
-
const label = row ? (row.worker ? "Worker" : row.task.kind === "bash" ? "Output" : "Workers") : "Output";
|
|
600
|
-
const styledLabel = theme.fg(this.focus === "preview" ? "accent" : "muted", label);
|
|
601
|
-
const shell = row !== undefined && row.task.kind === "bash" && !row.worker;
|
|
602
|
-
const suffix = shell ? theme.fg("muted", ` · tail · ${this.position().follow ? "following" : "browsing"}`) : "";
|
|
603
|
-
const range = theme.fg("muted", `${layout.total ? layout.start + 1 : 0}–${Math.min(layout.start + layout.contentHeight, layout.total)}/${layout.total}`);
|
|
604
|
-
const rule = (count) => theme.fg("borderMuted", "─".repeat(Math.max(0, count)));
|
|
605
|
-
const left = `${rule(1)} ${styledLabel}${suffix} `;
|
|
606
|
-
const right = ` ${range} ${rule(1)}`;
|
|
607
|
-
const fill = layout.previewWidth - visibleWidth(left) - visibleWidth(right);
|
|
608
|
-
return pad(`${left}${rule(fill)}${right}`, layout.previewWidth);
|
|
609
|
-
}
|
|
610
|
-
render(width) {
|
|
611
|
-
if (width < 1)
|
|
612
|
-
return [];
|
|
613
|
-
const terminalRows = this.options.tui.terminal.rows;
|
|
614
|
-
if (width < MIN_RENDER_WIDTH || terminalRows < MIN_RENDER_HEIGHT) {
|
|
615
|
-
return this.renderTooSmall(width, terminalRows);
|
|
616
|
-
}
|
|
617
|
-
const wasWide = this.wide();
|
|
618
|
-
this.width = width;
|
|
619
|
-
if (!wasWide && this.wide())
|
|
620
|
-
this.queueTick();
|
|
621
|
-
const { theme, keybindings } = this.options;
|
|
622
|
-
const layout = this.layout();
|
|
623
|
-
const rule = () => new DynamicBorder((text) => theme.fg("border", text)).render(width)[0] ?? "";
|
|
624
|
-
const title = theme.fg("accent", theme.bold("Background tasks"));
|
|
625
|
-
// Only non-zero segments show: a quiet header means nothing needs attention.
|
|
626
|
-
const segments = [];
|
|
627
|
-
if (this.runningCount > 0)
|
|
628
|
-
segments.push(theme.fg("accent", `${this.runningCount} running`));
|
|
629
|
-
if (this.completedCount > 0)
|
|
630
|
-
segments.push(theme.fg("muted", `${this.completedCount} completed`));
|
|
631
|
-
if (this.failedCount > 0)
|
|
632
|
-
segments.push(theme.fg("error", `${this.failedCount} failed`));
|
|
633
|
-
if (this.hiddenFinished > 0)
|
|
634
|
-
segments.push(theme.fg("muted", `${this.hiddenFinished} foreground shell${this.hiddenFinished === 1 ? "" : "s"} hidden`));
|
|
635
|
-
const stats = segments.join(theme.fg("muted", " · "));
|
|
636
|
-
const gap = width - visibleWidth(title) - visibleWidth(stats);
|
|
637
|
-
const titleLine = pad(stats && gap >= 1 ? `${title}${" ".repeat(gap)}${stats}` : title, width);
|
|
638
|
-
const hint = (id) => keyLabel(id, { keybindings });
|
|
639
|
-
const pageUp = this.focus === "list" ? "tui.select.pageUp" : "tui.editor.pageUp";
|
|
640
|
-
const pageDown = this.focus === "list" ? "tui.select.pageDown" : "tui.editor.pageDown";
|
|
641
|
-
const hints = [
|
|
642
|
-
`${hint("tui.select.up")}/${hint("tui.select.down")} select`,
|
|
643
|
-
`${hint("app.backgroundTasks.focusList")} list`,
|
|
644
|
-
`${hint("app.backgroundTasks.focusPreview")}/${hint("tui.select.confirm")} output`,
|
|
645
|
-
`${hint(pageUp)}/${hint(pageDown)} page`,
|
|
646
|
-
`${hint("app.backgroundTasks.kill")} stop`,
|
|
647
|
-
`${hint("tui.select.cancel")} close`,
|
|
648
|
-
].join(" · ");
|
|
649
|
-
const hintLine = pad(this.pendingKill
|
|
650
|
-
? theme.fg("warning", `Stop ${this.pendingKill} (whole group)? y/N`)
|
|
651
|
-
: theme.fg(this.feedback ? "muted" : "dim", this.feedback ?? hints), width);
|
|
652
|
-
const leftLines = layout.visibleItems.length
|
|
653
|
-
? layout.visibleItems.map((item) => "header" in item
|
|
654
|
-
? pad(theme.fg("dim", item.header), layout.listWidth)
|
|
655
|
-
: this.listRowLine(item.row, layout.listWidth))
|
|
656
|
-
: [this.emptyLine(layout.listWidth)];
|
|
657
|
-
const contentWindow = layout.content.slice(layout.start, layout.start + layout.contentHeight);
|
|
658
|
-
const divider = this.dividerLine(layout);
|
|
659
|
-
const body = [];
|
|
660
|
-
if (layout.wide) {
|
|
661
|
-
const right = [...layout.detail, divider, ...contentWindow];
|
|
662
|
-
for (let i = 0; i < layout.bodyHeight; i++)
|
|
663
|
-
body.push(pad(`${pad(leftLines[i] ?? "", layout.listWidth)}${theme.fg("borderMuted", "│")}${pad(right[i] ?? "", layout.previewWidth)}`, width));
|
|
664
|
-
}
|
|
665
|
-
else {
|
|
666
|
-
body.push(...[...leftLines, ...layout.detail, divider, ...contentWindow].map((line) => pad(line, width)));
|
|
667
|
-
while (body.length < layout.bodyHeight)
|
|
668
|
-
body.push(pad("", width));
|
|
669
|
-
}
|
|
670
|
-
return [rule(), titleLine, ...body.slice(0, layout.bodyHeight), rule(), hintLine, rule()].map((line) => pad(line, width));
|
|
671
|
-
}
|
|
672
|
-
}
|
|
673
|
-
//# sourceMappingURL=manager.js.map
|