@astralyn/pi 0.99.0 → 1.0.1
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 +58 -3
- package/dist/bundle/chunks/anthropic-messages-YET4T7BO.js +6 -0
- package/dist/bundle/chunks/anthropic.js +2 -2
- package/dist/bundle/chunks/azure-openai-responses-SBLL5YN3.js +2 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +3 -3
- package/dist/bundle/chunks/chunk-4TT2QGFL.js +2 -0
- package/dist/bundle/chunks/chunk-GIG5IHES.js +2 -0
- package/dist/bundle/chunks/{chunk-VW2P3X6P.js → chunk-H2N2THAO.js} +436 -668
- package/dist/bundle/chunks/{chunk-A576H74Y.js → chunk-IZ3S3GDX.js} +1 -1
- package/dist/bundle/chunks/{chunk-ABVRAYXT.js → chunk-NY3CWK44.js} +2 -2
- package/dist/bundle/chunks/chunk-SVJ7OGEB.js +2 -0
- package/dist/bundle/chunks/chunk-TRHTWM3C.js +2 -0
- package/dist/bundle/chunks/{chunk-DEWXBB6W.js → chunk-V66VGGOM.js} +1 -1
- package/dist/bundle/chunks/chunk-XDYM2567.js +20 -0
- package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-ZYSAFXXL.js → cloudflare-workers-ai-system-one-QI46LUZ6.js} +1 -1
- package/dist/bundle/chunks/codemode-worker.js +90 -10
- package/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/bundle/chunks/{google-generative-ai-SDNQVVXA.js → google-generative-ai-YTZCSHQN.js} +1 -1
- package/dist/bundle/chunks/{google-vertex-LZXOLBIO.js → google-vertex-OTFZJJXQ.js} +1 -1
- package/dist/bundle/chunks/{llama-cpp-classify-7IYGGPND.js → llama-cpp-classify-R7DQLTQN.js} +1 -1
- package/dist/bundle/chunks/{mistral-conversations-VYKPSSAM.js → mistral-conversations-ELH4V4TY.js} +1 -1
- package/dist/bundle/chunks/node-USQQ7C6M.js +16 -0
- package/dist/bundle/chunks/openai-chatgpt.js +2 -2
- package/dist/bundle/chunks/{openai-codex-responses-HZ4VUDXD.js → openai-codex-responses-OLVTU4UA.js} +1 -1
- package/dist/bundle/chunks/openai-codex.js +1 -1
- package/dist/bundle/chunks/openai-completions-53M2KJ67.js +7 -0
- package/dist/bundle/chunks/openai-responses-4ABDEL4Z.js +3 -0
- package/dist/bundle/chunks/{openrouter-images-5524IQHX.js → openrouter-images-YP3YVB54.js} +1 -1
- package/dist/bundle/chunks/openrouter.js +1 -1
- package/dist/bundle/chunks/radius.js +1 -1
- package/dist/bundle/chunks/{typesafe-system-one-Z2CDLKEY.js → typesafe-system-one-RREJAKWB.js} +1 -1
- package/dist/bundle/chunks/virtual-modules-YFKU7JZF.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 +5 -2
- package/dist/cli/args.js.map +1 -1
- package/dist/config.d.ts +5 -8
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +19 -13
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session.d.ts +21 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +65 -12
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/export-html/tool-renderer.d.ts +3 -3
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/dist/core/export-html/tool-renderer.js +3 -3
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- package/dist/core/extensions/index.d.ts +2 -2
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +18 -1
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +3 -1
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +6 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +15 -1
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/keybindings.d.ts +51 -11
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +11 -3
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/mcp-servers.d.ts +40 -7
- package/dist/core/mcp-servers.d.ts.map +1 -1
- package/dist/core/mcp-servers.js +63 -11
- package/dist/core/mcp-servers.js.map +1 -1
- package/dist/core/model-config.d.ts +36 -0
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +14 -2
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-registry.d.ts +3 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +4 -0
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.js +1 -1
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +6 -0
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +22 -18
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/provider-composer.d.ts +2 -1
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +13 -0
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/radius.d.ts +2 -0
- package/dist/core/radius.d.ts.map +1 -1
- package/dist/core/radius.js +2 -0
- package/dist/core/radius.js.map +1 -1
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +4 -9
- package/dist/core/remote-catalog-provider.js.map +1 -1
- 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/settings-manager.d.ts +7 -5
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +2 -1
- package/dist/core/settings-manager.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/format.d.ts +7 -0
- package/dist/core/tasks/format.d.ts.map +1 -0
- package/dist/core/tasks/format.js +14 -0
- package/dist/core/tasks/format.js.map +1 -0
- package/dist/core/tasks/history.d.ts.map +1 -1
- package/dist/core/tasks/history.js +0 -19
- package/dist/core/tasks/history.js.map +1 -1
- package/dist/core/tasks/output.d.ts +8 -0
- package/dist/core/tasks/output.d.ts.map +1 -1
- package/dist/core/tasks/output.js +19 -0
- package/dist/core/tasks/output.js.map +1 -1
- package/dist/core/tasks/presentation.d.ts +1 -3
- package/dist/core/tasks/presentation.d.ts.map +1 -1
- package/dist/core/tasks/presentation.js +79 -166
- package/dist/core/tasks/presentation.js.map +1 -1
- package/dist/core/tasks/runtime.d.ts +16 -9
- package/dist/core/tasks/runtime.d.ts.map +1 -1
- package/dist/core/tasks/runtime.js +89 -106
- package/dist/core/tasks/runtime.js.map +1 -1
- package/dist/core/tasks/session.d.ts.map +1 -1
- package/dist/core/tasks/session.js +13 -4
- package/dist/core/tasks/session.js.map +1 -1
- package/dist/core/tasks/store.d.ts +20 -6
- package/dist/core/tasks/store.d.ts.map +1 -1
- package/dist/core/tasks/store.js +45 -18
- package/dist/core/tasks/store.js.map +1 -1
- package/dist/core/tasks/types.d.ts +14 -54
- package/dist/core/tasks/types.d.ts.map +1 -1
- package/dist/core/tasks/types.js +1 -5
- package/dist/core/tasks/types.js.map +1 -1
- package/dist/core/tools/renderers/bash.d.ts.map +1 -1
- package/dist/core/tools/renderers/bash.js +11 -34
- package/dist/core/tools/renderers/bash.js.map +1 -1
- package/dist/core/tools/renderers/index.d.ts +2 -2
- package/dist/core/tools/renderers/index.d.ts.map +1 -1
- package/dist/core/tools/renderers/index.js.map +1 -1
- package/dist/core/tools/shell-execution.d.ts +0 -1
- package/dist/core/tools/shell-execution.d.ts.map +1 -1
- package/dist/core/tools/shell-execution.js +3 -10
- package/dist/core/tools/shell-execution.js.map +1 -1
- package/dist/core/tools/shell-tool.d.ts.map +1 -1
- package/dist/core/tools/shell-tool.js +2 -4
- package/dist/core/tools/shell-tool.js.map +1 -1
- package/dist/core/tools/tasks/actions.d.ts +1 -1
- package/dist/core/tools/tasks/actions.d.ts.map +1 -1
- package/dist/core/tools/tasks/actions.js +26 -12
- package/dist/core/tools/tasks/actions.js.map +1 -1
- package/dist/core/tools/tasks/constants.d.ts +2 -6
- package/dist/core/tools/tasks/constants.d.ts.map +1 -1
- package/dist/core/tools/tasks/constants.js +2 -6
- package/dist/core/tools/tasks/constants.js.map +1 -1
- package/dist/core/tools/tasks/schema.d.ts +1 -1
- package/dist/core/tools/tasks/schema.d.ts.map +1 -1
- package/dist/core/tools/tasks/schema.js +8 -7
- package/dist/core/tools/tasks/schema.js.map +1 -1
- package/dist/core/tools/tasks/types.d.ts +8 -38
- package/dist/core/tools/tasks/types.d.ts.map +1 -1
- package/dist/core/tools/tasks/types.js +6 -11
- package/dist/core/tools/tasks/types.js.map +1 -1
- package/dist/core/virtual-models.d.ts +2 -0
- package/dist/core/virtual-models.d.ts.map +1 -1
- package/dist/core/virtual-models.js +19 -12
- package/dist/core/virtual-models.js.map +1 -1
- package/dist/extensions/btw/agent.d.ts +17 -8
- package/dist/extensions/btw/agent.d.ts.map +1 -1
- package/dist/extensions/btw/agent.js +74 -76
- package/dist/extensions/btw/agent.js.map +1 -1
- package/dist/extensions/btw/controller.d.ts +0 -1
- package/dist/extensions/btw/controller.d.ts.map +1 -1
- package/dist/extensions/btw/controller.js +26 -33
- package/dist/extensions/btw/controller.js.map +1 -1
- package/dist/extensions/btw/panel.d.ts +13 -14
- package/dist/extensions/btw/panel.d.ts.map +1 -1
- package/dist/extensions/btw/panel.js +38 -29
- package/dist/extensions/btw/panel.js.map +1 -1
- package/dist/extensions/codemode/execute.d.ts.map +1 -1
- package/dist/extensions/codemode/execute.js +197 -51
- package/dist/extensions/codemode/execute.js.map +1 -1
- package/dist/extensions/codemode/renderer.d.ts.map +1 -1
- package/dist/extensions/codemode/renderer.js +43 -25
- package/dist/extensions/codemode/renderer.js.map +1 -1
- package/dist/extensions/codemode/tool.d.ts +12 -11
- package/dist/extensions/codemode/tool.d.ts.map +1 -1
- package/dist/extensions/codemode/tool.js +73 -129
- package/dist/extensions/codemode/tool.js.map +1 -1
- package/dist/extensions/codemode/worker.d.ts +1 -1
- package/dist/extensions/codemode/worker.js +1 -1
- package/dist/extensions/codemode/worker.js.map +1 -1
- package/dist/extensions/deepwiki/schema.d.ts +1 -1
- package/dist/extensions/index.d.ts.map +1 -1
- package/dist/extensions/index.js +0 -2
- package/dist/extensions/index.js.map +1 -1
- package/dist/extensions/mcp/cli.d.ts.map +1 -1
- package/dist/extensions/mcp/cli.js +23 -5
- package/dist/extensions/mcp/cli.js.map +1 -1
- package/dist/extensions/mcp/config.d.ts +19 -5
- package/dist/extensions/mcp/config.d.ts.map +1 -1
- package/dist/extensions/mcp/config.js +60 -12
- package/dist/extensions/mcp/config.js.map +1 -1
- package/dist/extensions/mcp/index.d.ts +36 -9
- package/dist/extensions/mcp/index.d.ts.map +1 -1
- package/dist/extensions/mcp/index.js +309 -100
- package/dist/extensions/mcp/index.js.map +1 -1
- package/dist/extensions/mcp/oauth.d.ts +14 -8
- package/dist/extensions/mcp/oauth.d.ts.map +1 -1
- package/dist/extensions/mcp/oauth.js +105 -36
- package/dist/extensions/mcp/oauth.js.map +1 -1
- package/dist/extensions/mcp/runtime.d.ts +2 -0
- package/dist/extensions/mcp/runtime.d.ts.map +1 -1
- package/dist/extensions/mcp/runtime.js +17 -9
- package/dist/extensions/mcp/runtime.js.map +1 -1
- package/dist/extensions/mcp/tools.d.ts +8 -5
- package/dist/extensions/mcp/tools.d.ts.map +1 -1
- package/dist/extensions/mcp/tools.js +50 -26
- package/dist/extensions/mcp/tools.js.map +1 -1
- package/dist/extensions/mcp/ui.d.ts.map +1 -1
- package/dist/extensions/mcp/ui.js +7 -1
- package/dist/extensions/mcp/ui.js.map +1 -1
- package/dist/extensions/provider/catalog.d.ts +8 -1
- package/dist/extensions/provider/catalog.d.ts.map +1 -1
- package/dist/extensions/provider/catalog.js +31 -0
- package/dist/extensions/provider/catalog.js.map +1 -1
- package/dist/extensions/provider/connection.d.ts +4 -1
- package/dist/extensions/provider/connection.d.ts.map +1 -1
- package/dist/extensions/provider/connection.js +1 -5
- package/dist/extensions/provider/connection.js.map +1 -1
- package/dist/extensions/provider/editing.d.ts +36 -0
- package/dist/extensions/provider/editing.d.ts.map +1 -0
- package/dist/extensions/provider/editing.js +99 -0
- package/dist/extensions/provider/editing.js.map +1 -0
- package/dist/extensions/provider/json-fields.d.ts +5 -0
- package/dist/extensions/provider/json-fields.d.ts.map +1 -0
- package/dist/extensions/provider/json-fields.js +31 -0
- package/dist/extensions/provider/json-fields.js.map +1 -0
- package/dist/extensions/provider/store.d.ts +1 -4
- package/dist/extensions/provider/store.d.ts.map +1 -1
- package/dist/extensions/provider/store.js +2 -30
- package/dist/extensions/provider/store.js.map +1 -1
- package/dist/extensions/provider/ui/builtin-data.d.ts +0 -2
- package/dist/extensions/provider/ui/builtin-data.d.ts.map +1 -1
- package/dist/extensions/provider/ui/builtin-data.js +14 -79
- package/dist/extensions/provider/ui/builtin-data.js.map +1 -1
- package/dist/extensions/provider/ui/compat.d.ts.map +1 -1
- package/dist/extensions/provider/ui/compat.js +6 -9
- package/dist/extensions/provider/ui/compat.js.map +1 -1
- package/dist/extensions/provider/ui/controls.d.ts +48 -0
- package/dist/extensions/provider/ui/controls.d.ts.map +1 -0
- package/dist/extensions/provider/ui/controls.js +108 -0
- package/dist/extensions/provider/ui/controls.js.map +1 -0
- package/dist/extensions/provider/ui/dictionary.d.ts.map +1 -1
- package/dist/extensions/provider/ui/dictionary.js +6 -9
- package/dist/extensions/provider/ui/dictionary.js.map +1 -1
- package/dist/extensions/provider/ui/editor.d.ts +3 -3
- package/dist/extensions/provider/ui/editor.d.ts.map +1 -1
- package/dist/extensions/provider/ui/editor.js +35 -140
- package/dist/extensions/provider/ui/editor.js.map +1 -1
- package/dist/extensions/provider/ui/fetch-models.d.ts +0 -3
- package/dist/extensions/provider/ui/fetch-models.d.ts.map +1 -1
- package/dist/extensions/provider/ui/fetch-models.js +49 -44
- package/dist/extensions/provider/ui/fetch-models.js.map +1 -1
- package/dist/extensions/provider/ui/model-fields.d.ts.map +1 -1
- package/dist/extensions/provider/ui/model-fields.js +11 -14
- package/dist/extensions/provider/ui/model-fields.js.map +1 -1
- package/dist/extensions/provider/ui/model-options.d.ts +4 -34
- package/dist/extensions/provider/ui/model-options.d.ts.map +1 -1
- package/dist/extensions/provider/ui/model-options.js +90 -271
- package/dist/extensions/provider/ui/model-options.js.map +1 -1
- package/dist/extensions/provider/ui/pane.d.ts +4 -18
- package/dist/extensions/provider/ui/pane.d.ts.map +1 -1
- package/dist/extensions/provider/ui/pane.js.map +1 -1
- package/dist/extensions/provider/ui/provider-fields.d.ts +2 -19
- package/dist/extensions/provider/ui/provider-fields.d.ts.map +1 -1
- package/dist/extensions/provider/ui/provider-fields.js +58 -171
- package/dist/extensions/provider/ui/provider-fields.js.map +1 -1
- package/dist/extensions/provider/ui/thinking-map.d.ts.map +1 -1
- package/dist/extensions/provider/ui/thinking-map.js +6 -9
- package/dist/extensions/provider/ui/thinking-map.js.map +1 -1
- package/dist/extensions/question/detail-pane.d.ts +7 -2
- package/dist/extensions/question/detail-pane.d.ts.map +1 -1
- package/dist/extensions/question/detail-pane.js +16 -5
- package/dist/extensions/question/detail-pane.js.map +1 -1
- package/dist/extensions/question/dialog-view.d.ts +41 -0
- package/dist/extensions/question/dialog-view.d.ts.map +1 -0
- package/dist/extensions/question/dialog-view.js +329 -0
- package/dist/extensions/question/dialog-view.js.map +1 -0
- package/dist/extensions/question/dialog.d.ts +3 -3
- package/dist/extensions/question/dialog.d.ts.map +1 -1
- package/dist/extensions/question/dialog.js +220 -634
- package/dist/extensions/question/dialog.js.map +1 -1
- package/dist/extensions/question/index.d.ts.map +1 -1
- package/dist/extensions/question/index.js +2 -3
- package/dist/extensions/question/index.js.map +1 -1
- package/dist/extensions/question/render.d.ts.map +1 -1
- package/dist/extensions/question/render.js +22 -32
- package/dist/extensions/question/render.js.map +1 -1
- package/dist/extensions/question/results.d.ts.map +1 -1
- package/dist/extensions/question/results.js +56 -12
- package/dist/extensions/question/results.js.map +1 -1
- package/dist/extensions/question/schema.d.ts +21 -6
- package/dist/extensions/question/schema.d.ts.map +1 -1
- package/dist/extensions/question/schema.js.map +1 -1
- package/dist/extensions/question/state.d.ts +9 -7
- package/dist/extensions/question/state.d.ts.map +1 -1
- package/dist/extensions/question/state.js +63 -54
- package/dist/extensions/question/state.js.map +1 -1
- package/dist/extensions/question/types.d.ts +41 -18
- package/dist/extensions/question/types.d.ts.map +1 -1
- package/dist/extensions/question/types.js.map +1 -1
- package/dist/extensions/statusline/index.d.ts +4 -0
- package/dist/extensions/statusline/index.d.ts.map +1 -1
- package/dist/extensions/statusline/index.js +18 -355
- package/dist/extensions/statusline/index.js.map +1 -1
- package/dist/extensions/statusline/render.d.ts +19 -0
- package/dist/extensions/statusline/render.d.ts.map +1 -0
- package/dist/extensions/statusline/render.js +163 -0
- package/dist/extensions/statusline/render.js.map +1 -0
- package/dist/extensions/statusline/usage.d.ts +12 -0
- package/dist/extensions/statusline/usage.d.ts.map +1 -0
- package/dist/extensions/statusline/usage.js +36 -0
- package/dist/extensions/statusline/usage.js.map +1 -0
- package/dist/extensions/tool-search/tool.d.ts +5 -4
- package/dist/extensions/tool-search/tool.d.ts.map +1 -1
- package/dist/extensions/tool-search/tool.js +7 -28
- package/dist/extensions/tool-search/tool.js.map +1 -1
- package/dist/extensions/web-search/execute.d.ts +1 -5
- package/dist/extensions/web-search/execute.d.ts.map +1 -1
- package/dist/extensions/web-search/execute.js +4 -9
- package/dist/extensions/web-search/execute.js.map +1 -1
- package/dist/extensions/web-search/format.d.ts +12 -3
- package/dist/extensions/web-search/format.d.ts.map +1 -1
- package/dist/extensions/web-search/format.js +33 -25
- package/dist/extensions/web-search/format.js.map +1 -1
- package/dist/extensions/web-search/index.d.ts.map +1 -1
- package/dist/extensions/web-search/index.js +6 -29
- package/dist/extensions/web-search/index.js.map +1 -1
- package/dist/extensions/web-search/providers/deepseek.d.ts.map +1 -1
- package/dist/extensions/web-search/providers/deepseek.js +0 -1
- package/dist/extensions/web-search/providers/deepseek.js.map +1 -1
- package/dist/extensions/web-search/providers/http.d.ts +1 -1
- package/dist/extensions/web-search/providers/http.d.ts.map +1 -1
- package/dist/extensions/web-search/providers/http.js.map +1 -1
- package/dist/extensions/web-search/providers/minimax.d.ts.map +1 -1
- package/dist/extensions/web-search/providers/minimax.js +0 -1
- package/dist/extensions/web-search/providers/minimax.js.map +1 -1
- package/dist/extensions/web-search/render.d.ts +7 -2
- package/dist/extensions/web-search/render.d.ts.map +1 -1
- package/dist/extensions/web-search/render.js +32 -4
- package/dist/extensions/web-search/render.js.map +1 -1
- package/dist/extensions/web-search/results.d.ts.map +1 -1
- package/dist/extensions/web-search/results.js +3 -8
- package/dist/extensions/web-search/results.js.map +1 -1
- package/dist/extensions/web-search/types.d.ts +4 -2
- package/dist/extensions/web-search/types.d.ts.map +1 -1
- package/dist/extensions/web-search/types.js.map +1 -1
- package/dist/index.d.ts +3 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +6 -0
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/armin.d.ts +3 -0
- package/dist/modes/interactive/components/armin.d.ts.map +1 -1
- package/dist/modes/interactive/components/armin.js +7 -5
- package/dist/modes/interactive/components/armin.js.map +1 -1
- package/dist/modes/interactive/components/auth-url.d.ts +14 -0
- package/dist/modes/interactive/components/auth-url.d.ts.map +1 -0
- package/dist/modes/interactive/components/auth-url.js +34 -0
- package/dist/modes/interactive/components/auth-url.js.map +1 -0
- package/dist/modes/interactive/components/easter-egg-3d.d.ts +104 -0
- package/dist/modes/interactive/components/easter-egg-3d.d.ts.map +1 -0
- package/dist/modes/interactive/components/easter-egg-3d.js +1123 -0
- package/dist/modes/interactive/components/easter-egg-3d.js.map +1 -0
- package/dist/modes/interactive/components/easter-egg-3d.lazy.d.ts +6 -0
- package/dist/modes/interactive/components/easter-egg-3d.lazy.d.ts.map +1 -0
- package/dist/modes/interactive/components/easter-egg-3d.lazy.js +24 -0
- package/dist/modes/interactive/components/easter-egg-3d.lazy.js.map +1 -0
- package/dist/modes/interactive/components/index.d.ts +0 -1
- package/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/dist/modes/interactive/components/index.js +0 -1
- package/dist/modes/interactive/components/index.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts +2 -0
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +9 -5
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts +8 -2
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +24 -21
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/pi-logo.d.ts +7 -0
- package/dist/modes/interactive/components/pi-logo.d.ts.map +1 -1
- package/dist/modes/interactive/components/pi-logo.js +13 -1
- package/dist/modes/interactive/components/pi-logo.js.map +1 -1
- package/dist/modes/interactive/components/radius-login-selector.d.ts +15 -0
- package/dist/modes/interactive/components/radius-login-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/radius-login-selector.js +83 -0
- package/dist/modes/interactive/components/radius-login-selector.js.map +1 -0
- package/dist/modes/interactive/components/settings-selector.d.ts +3 -3
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +5 -5
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/status-marker.d.ts +0 -2
- package/dist/modes/interactive/components/status-marker.d.ts.map +1 -1
- package/dist/modes/interactive/components/status-marker.js +0 -4
- package/dist/modes/interactive/components/status-marker.js.map +1 -1
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.js +5 -4
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/components/visual-truncate.d.ts +27 -3
- package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -1
- package/dist/modes/interactive/components/visual-truncate.js +36 -6
- package/dist/modes/interactive/components/visual-truncate.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +12 -2
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +180 -55
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/tasks/completion-render.d.ts +1 -1
- package/dist/modes/interactive/tasks/completion-render.d.ts.map +1 -1
- package/dist/modes/interactive/tasks/completion-render.js +28 -82
- package/dist/modes/interactive/tasks/completion-render.js.map +1 -1
- package/dist/modes/interactive/tasks/index.d.ts.map +1 -1
- package/dist/modes/interactive/tasks/index.js +18 -13
- package/dist/modes/interactive/tasks/index.js.map +1 -1
- package/dist/modes/interactive/tasks/inspector.d.ts +35 -0
- package/dist/modes/interactive/tasks/inspector.d.ts.map +1 -0
- package/dist/modes/interactive/tasks/inspector.js +93 -0
- package/dist/modes/interactive/tasks/inspector.js.map +1 -0
- package/dist/modes/interactive/tasks/layout.d.ts +40 -0
- package/dist/modes/interactive/tasks/layout.d.ts.map +1 -0
- package/dist/modes/interactive/tasks/layout.js +212 -0
- package/dist/modes/interactive/tasks/layout.js.map +1 -0
- package/dist/modes/interactive/tasks/list.d.ts +21 -0
- package/dist/modes/interactive/tasks/list.d.ts.map +1 -0
- package/dist/modes/interactive/tasks/list.js +96 -0
- package/dist/modes/interactive/tasks/list.js.map +1 -0
- package/dist/modes/interactive/tasks/manager.d.ts +29 -36
- package/dist/modes/interactive/tasks/manager.d.ts.map +1 -1
- package/dist/modes/interactive/tasks/manager.js +315 -315
- package/dist/modes/interactive/tasks/manager.js.map +1 -1
- package/dist/modes/interactive/tasks/model.d.ts +21 -0
- package/dist/modes/interactive/tasks/model.d.ts.map +1 -0
- package/dist/modes/interactive/tasks/model.js +41 -0
- package/dist/modes/interactive/tasks/model.js.map +1 -0
- package/dist/modes/interactive/tasks/render.d.ts +5 -19
- package/dist/modes/interactive/tasks/render.d.ts.map +1 -1
- package/dist/modes/interactive/tasks/render.js +18 -102
- package/dist/modes/interactive/tasks/render.js.map +1 -1
- package/dist/modes/interactive/tasks/task-view.d.ts +8 -48
- package/dist/modes/interactive/tasks/task-view.d.ts.map +1 -1
- package/dist/modes/interactive/tasks/task-view.js +11 -51
- package/dist/modes/interactive/tasks/task-view.js.map +1 -1
- package/dist/modes/interactive/tasks/text.d.ts +1 -7
- package/dist/modes/interactive/tasks/text.d.ts.map +1 -1
- package/dist/modes/interactive/tasks/text.js +6 -29
- package/dist/modes/interactive/tasks/text.js.map +1 -1
- package/dist/modes/interactive/tasks/viewport.d.ts +2 -0
- package/dist/modes/interactive/tasks/viewport.d.ts.map +1 -1
- package/dist/modes/interactive/tasks/viewport.js +17 -7
- package/dist/modes/interactive/tasks/viewport.js.map +1 -1
- package/dist/modes/interactive/tasks/views.d.ts +9 -0
- package/dist/modes/interactive/tasks/views.d.ts.map +1 -0
- package/dist/modes/interactive/tasks/views.js +42 -0
- package/dist/modes/interactive/tasks/views.js.map +1 -0
- package/dist/modes/interactive/theme/system-theme.d.ts +2 -1
- package/dist/modes/interactive/theme/system-theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/system-theme.js +16 -5
- package/dist/modes/interactive/theme/system-theme.js.map +1 -1
- package/dist/modes/interactive/tool-view/tool-execution.d.ts +4 -19
- package/dist/modes/interactive/tool-view/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/tool-view/tool-execution.js +23 -67
- package/dist/modes/interactive/tool-view/tool-execution.js.map +1 -1
- package/dist/utils/image-convert.d.ts +12 -0
- package/dist/utils/image-convert.d.ts.map +1 -1
- package/dist/utils/image-convert.js +45 -6
- package/dist/utils/image-convert.js.map +1 -1
- package/docs/bundled/README.md +0 -1
- package/docs/bundled/extensions/question.md +2 -2
- package/docs/bundled/extensions/statusline.md +24 -15
- package/docs/bundled/tasks.md +34 -48
- package/docs/codemode.md +207 -0
- package/docs/docs.json +4 -4
- package/docs/environment-variables.md +1 -1
- package/docs/extensions.md +11 -9
- package/docs/keybindings.md +14 -7
- package/docs/mcp.md +164 -82
- package/docs/models.md +51 -3
- package/docs/providers.md +8 -0
- package/docs/sdk.md +2 -2
- package/docs/session-format.md +12 -22
- package/docs/settings.md +4 -2
- package/docs/tui.md +1 -1
- package/docs/usage.md +6 -16
- package/examples/README.md +1 -1
- package/examples/extensions/README.md +1 -2
- package/examples/extensions/built-in-tool-renderer.ts +16 -40
- 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/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/minimal-mode.ts +24 -96
- 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/sdk/14-codemode-mcp.ts +2 -2
- package/npm-shrinkwrap.json +73 -62
- package/package.json +11 -10
- package/dist/bundle/chunks/anthropic-messages-KIXY7EDT.js +0 -6
- package/dist/bundle/chunks/azure-openai-responses-RPBERDXD.js +0 -2
- package/dist/bundle/chunks/chunk-CLLDCO64.js +0 -2
- package/dist/bundle/chunks/chunk-PJVFYVHE.js +0 -42
- package/dist/bundle/chunks/chunk-UUSTLCVC.js +0 -2
- package/dist/bundle/chunks/chunk-VWCWZD6E.js +0 -2
- package/dist/bundle/chunks/node-CXWYTK2I.js +0 -16
- package/dist/bundle/chunks/openai-completions-SKDGF6OE.js +0 -7
- package/dist/bundle/chunks/openai-responses-FPML4SSG.js +0 -3
- package/dist/bundle/chunks/virtual-modules-TQRORWJQ.js +0 -2
- package/dist/core/tasks/view-data.d.ts +0 -8
- package/dist/core/tasks/view-data.d.ts.map +0 -1
- package/dist/core/tasks/view-data.js +0 -61
- package/dist/core/tasks/view-data.js.map +0 -1
- package/dist/core/tasks/view.d.ts +0 -30
- package/dist/core/tasks/view.d.ts.map +0 -1
- package/dist/core/tasks/view.js +0 -50
- package/dist/core/tasks/view.js.map +0 -1
- package/dist/core/tools/renderers/shell-task.d.ts +0 -4
- package/dist/core/tools/renderers/shell-task.d.ts.map +0 -1
- package/dist/core/tools/renderers/shell-task.js +0 -35
- package/dist/core/tools/renderers/shell-task.js.map +0 -1
- package/dist/extensions/todo/constants.d.ts +0 -16
- package/dist/extensions/todo/constants.d.ts.map +0 -1
- package/dist/extensions/todo/constants.js +0 -30
- package/dist/extensions/todo/constants.js.map +0 -1
- package/dist/extensions/todo/index.d.ts +0 -3
- package/dist/extensions/todo/index.d.ts.map +0 -1
- package/dist/extensions/todo/index.js +0 -98
- package/dist/extensions/todo/index.js.map +0 -1
- package/dist/extensions/todo/schema.d.ts +0 -60
- package/dist/extensions/todo/schema.d.ts.map +0 -1
- package/dist/extensions/todo/schema.js +0 -56
- package/dist/extensions/todo/schema.js.map +0 -1
- package/dist/extensions/todo/state.d.ts +0 -34
- package/dist/extensions/todo/state.d.ts.map +0 -1
- package/dist/extensions/todo/state.js +0 -425
- package/dist/extensions/todo/state.js.map +0 -1
- package/dist/extensions/todo/view.d.ts +0 -36
- package/dist/extensions/todo/view.d.ts.map +0 -1
- package/dist/extensions/todo/view.js +0 -580
- package/dist/extensions/todo/view.js.map +0 -1
- package/dist/extensions/todo/widget.d.ts +0 -15
- package/dist/extensions/todo/widget.d.ts.map +0 -1
- package/dist/extensions/todo/widget.js +0 -50
- package/dist/extensions/todo/widget.js.map +0 -1
- package/dist/modes/interactive/components/daxnuts.d.ts +0 -23
- package/dist/modes/interactive/components/daxnuts.d.ts.map +0 -1
- package/dist/modes/interactive/components/daxnuts.js +0 -138
- package/dist/modes/interactive/components/daxnuts.js.map +0 -1
- package/dist/modes/interactive/tasks/fallback-view.d.ts +0 -4
- package/dist/modes/interactive/tasks/fallback-view.d.ts.map +0 -1
- package/dist/modes/interactive/tasks/fallback-view.js +0 -27
- package/dist/modes/interactive/tasks/fallback-view.js.map +0 -1
- package/docs/bundled/extensions/todo.md +0 -104
- package/examples/extensions/todo.ts +0 -297
|
@@ -1,380 +1,380 @@
|
|
|
1
|
-
/**
|
|
2
|
-
import {
|
|
1
|
+
/** Panel lifecycle and input routing; selection, output ownership and layout have separate owners. */
|
|
2
|
+
import { Input, } from "@earendil-works/pi-tui";
|
|
3
3
|
import { isTaskTerminal } from "../../../core/tasks/types.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
4
|
+
import { STATUS_SPINNER_INTERVAL_MS } from "../components/status-marker.js";
|
|
5
|
+
import { TaskInspector } from "./inspector.js";
|
|
6
|
+
import { renderTasksLayout } from "./layout.js";
|
|
7
|
+
import { TaskList } from "./list.js";
|
|
8
|
+
import { TaskSelection } from "./model.js";
|
|
9
|
+
import { cleanTaskText } from "./text.js";
|
|
10
10
|
import { TaskViewport } from "./viewport.js";
|
|
11
|
-
const
|
|
12
|
-
|
|
11
|
+
const actions = [
|
|
12
|
+
"app.tasks.search",
|
|
13
|
+
"app.tasks.kill",
|
|
14
|
+
"app.tasks.detachSelected",
|
|
15
|
+
"app.tasks.previousTab",
|
|
16
|
+
"app.tasks.nextTab",
|
|
17
|
+
"app.tasks.follow",
|
|
18
|
+
"app.tasks.top",
|
|
19
|
+
"app.tasks.bottom",
|
|
20
|
+
"app.tasks.nextFocus",
|
|
21
|
+
"app.tasks.previousFocus",
|
|
22
|
+
"app.tasks.help",
|
|
23
|
+
];
|
|
13
24
|
export class TasksMenu {
|
|
14
25
|
constructor(options) {
|
|
15
26
|
this.focused = false;
|
|
16
|
-
this.
|
|
17
|
-
this.viewGeneration = 0;
|
|
18
|
-
this.positions = new Map();
|
|
27
|
+
this.list = new TaskList();
|
|
19
28
|
this.focus = "list";
|
|
20
|
-
this.
|
|
21
|
-
this.
|
|
29
|
+
this.searching = false;
|
|
30
|
+
this.dirty = true;
|
|
31
|
+
this.tickQueued = false;
|
|
32
|
+
this.refreshQueued = false;
|
|
22
33
|
this.disposed = false;
|
|
23
|
-
this.lastFrame = "";
|
|
24
34
|
this.options = options;
|
|
25
35
|
this.width = options.tui.terminal.columns;
|
|
36
|
+
this.selection = new TaskSelection(options.state ?? { tab: "output" });
|
|
37
|
+
this.inspector = new TaskInspector({
|
|
38
|
+
host: options.host,
|
|
39
|
+
theme: options.theme,
|
|
40
|
+
requestRender: () => options.tui.requestRender(),
|
|
41
|
+
});
|
|
42
|
+
this.search = new Input({ prompt: "Find task: ", placeholder: "title, command, kind or ID" });
|
|
26
43
|
this.sync();
|
|
27
44
|
this.unsubscribe = options.host.subscribe(() => {
|
|
28
|
-
this.
|
|
29
|
-
if (this.selected && isTaskTerminal(this.selected.status))
|
|
30
|
-
this.queueTick();
|
|
31
|
-
});
|
|
32
|
-
this.unsubscribeViews = options.views?.subscribe(() => {
|
|
33
|
-
this.syncView();
|
|
45
|
+
this.dirty = true;
|
|
34
46
|
this.queueTick();
|
|
47
|
+
options.tui.requestRender();
|
|
35
48
|
});
|
|
36
|
-
this.pollTimer = setInterval(() =>
|
|
49
|
+
this.pollTimer = setInterval(() => {
|
|
50
|
+
this.queueTick(true);
|
|
51
|
+
if (this.selection.activeCount)
|
|
52
|
+
options.tui.requestRender();
|
|
53
|
+
}, options.pollIntervalMs ?? 1000);
|
|
37
54
|
this.pollTimer.unref?.();
|
|
38
|
-
this.queueTick();
|
|
39
|
-
}
|
|
40
|
-
invalidate() {
|
|
41
|
-
this.lastFrame = "";
|
|
42
|
-
this.view?.info.invalidate();
|
|
43
|
-
this.view?.output.invalidate();
|
|
44
|
-
}
|
|
45
|
-
dispose() {
|
|
46
|
-
if (this.disposed)
|
|
47
|
-
return;
|
|
48
|
-
this.disposed = true;
|
|
49
|
-
clearInterval(this.pollTimer);
|
|
50
|
-
clearInterval(this.animationTimer);
|
|
51
|
-
this.clearKill();
|
|
52
|
-
this.unsubscribe();
|
|
53
|
-
this.unsubscribeViews?.();
|
|
54
|
-
this.disposeView();
|
|
55
|
-
this.releasePin?.();
|
|
56
|
-
this.positions.clear();
|
|
55
|
+
this.queueTick(true);
|
|
57
56
|
}
|
|
58
57
|
sync() {
|
|
59
|
-
if (this.disposed)
|
|
58
|
+
if (this.disposed || !this.dirty)
|
|
60
59
|
return;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
// The watched terminal task is absent from the selectable list.
|
|
71
|
-
const retained = new Set([...this.tasks.map((task) => task.id), this.selected?.id]);
|
|
72
|
-
for (const id of this.positions.keys())
|
|
73
|
-
if (!retained.has(id))
|
|
74
|
-
this.positions.delete(id);
|
|
75
|
-
if (this.pendingKill && !this.tasks.some((task) => task.id === this.pendingKill))
|
|
60
|
+
this.dirty = false;
|
|
61
|
+
const previous = this.selection.selected;
|
|
62
|
+
this.selection.sync(this.options.host.list());
|
|
63
|
+
this.inspector.select(this.selection.selected);
|
|
64
|
+
this.inspector.prune(new Set(this.selection.all.map((task) => task.id)));
|
|
65
|
+
const selected = this.selection.selected;
|
|
66
|
+
if (selected && isTaskTerminal(selected.status) && previous && !isTaskTerminal(previous.status))
|
|
67
|
+
this.feedback = undefined;
|
|
68
|
+
if (this.pendingKill && (this.pendingKill !== selected?.id || (selected && isTaskTerminal(selected.status))))
|
|
76
69
|
this.clearKill();
|
|
77
|
-
this.
|
|
78
|
-
if (
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
this.animationTimer.unref?.();
|
|
82
|
-
}
|
|
70
|
+
const animates = this.selection.all.some((task) => task.status === "running");
|
|
71
|
+
if (animates && !this.animationTimer) {
|
|
72
|
+
this.animationTimer = setInterval(() => this.options.tui.requestRender(), STATUS_SPINNER_INTERVAL_MS);
|
|
73
|
+
this.animationTimer.unref?.();
|
|
83
74
|
}
|
|
84
|
-
else {
|
|
75
|
+
else if (!animates) {
|
|
85
76
|
clearInterval(this.animationTimer);
|
|
86
77
|
this.animationTimer = undefined;
|
|
87
78
|
}
|
|
88
79
|
}
|
|
89
|
-
|
|
90
|
-
if (
|
|
91
|
-
this.selected = task;
|
|
80
|
+
queueTick(refresh = false) {
|
|
81
|
+
if (this.disposed)
|
|
92
82
|
return;
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
this.
|
|
97
|
-
|
|
98
|
-
|
|
83
|
+
this.refreshQueued ||= refresh;
|
|
84
|
+
if (this.tickQueued)
|
|
85
|
+
return;
|
|
86
|
+
this.tickQueued = true;
|
|
87
|
+
void Promise.resolve()
|
|
88
|
+
.then(async () => {
|
|
89
|
+
this.tickQueued = false;
|
|
90
|
+
if (this.disposed)
|
|
91
|
+
return;
|
|
92
|
+
const refresh = this.refreshQueued;
|
|
93
|
+
this.refreshQueued = false;
|
|
94
|
+
this.sync();
|
|
95
|
+
if (refresh || (this.inspector.task && isTaskTerminal(this.inspector.task.status)))
|
|
96
|
+
await this.inspector.refresh();
|
|
97
|
+
})
|
|
98
|
+
.catch(() => {
|
|
99
|
+
/* Task observers cannot reject execution. */
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
invalidate() {
|
|
103
|
+
this.inspector.invalidate();
|
|
104
|
+
}
|
|
105
|
+
clearKill() {
|
|
106
|
+
this.pendingKill = undefined;
|
|
107
|
+
}
|
|
108
|
+
selectedChanged() {
|
|
99
109
|
this.clearKill();
|
|
100
|
-
this.
|
|
110
|
+
this.list.showSelection();
|
|
111
|
+
this.inspector.select(this.selection.selected);
|
|
112
|
+
this.queueTick(true);
|
|
101
113
|
}
|
|
102
|
-
|
|
103
|
-
this.
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
114
|
+
stop(confirm = false) {
|
|
115
|
+
const task = this.selection.selected;
|
|
116
|
+
if (confirm) {
|
|
117
|
+
const id = this.pendingKill;
|
|
118
|
+
this.clearKill();
|
|
119
|
+
if (!id || id !== task?.id || isTaskTerminal(task.status))
|
|
120
|
+
return;
|
|
121
|
+
this.feedback = this.options.host.kill(id)
|
|
122
|
+
? "Cancellation requested; waiting for cleanup."
|
|
123
|
+
: "No new cancellation requested.";
|
|
108
124
|
}
|
|
109
|
-
|
|
110
|
-
|
|
125
|
+
else if (task && !isTaskTerminal(task.status) && task.status !== "stopping") {
|
|
126
|
+
this.pendingKill = task.id;
|
|
111
127
|
}
|
|
112
|
-
this.view = undefined;
|
|
113
128
|
}
|
|
114
|
-
|
|
115
|
-
const
|
|
116
|
-
if (
|
|
129
|
+
finishSearch(cancel) {
|
|
130
|
+
const id = cancel ? this.beforeSearch?.id : this.selection.state.selectedId;
|
|
131
|
+
if (!cancel && !id)
|
|
117
132
|
return;
|
|
118
|
-
this.
|
|
119
|
-
this.
|
|
120
|
-
this.
|
|
121
|
-
this.
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
try {
|
|
126
|
-
this.view = provider.create({
|
|
127
|
-
theme: this.options.theme,
|
|
128
|
-
requestRender: () => {
|
|
129
|
-
if (!this.disposed && generation === this.viewGeneration)
|
|
130
|
-
this.options.tui.requestRender();
|
|
131
|
-
},
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
catch (error) {
|
|
135
|
-
this.failView(error);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
failView(error) {
|
|
139
|
-
this.disposeView();
|
|
140
|
-
this.viewError = `Task view unavailable: ${clean(String(error))}`;
|
|
141
|
-
this.view = fallbackTaskView.create({ theme: this.options.theme, requestRender: () => { } });
|
|
133
|
+
this.focus = cancel ? (this.beforeSearch?.focus ?? "list") : "list";
|
|
134
|
+
this.searching = false;
|
|
135
|
+
this.search.focused = false;
|
|
136
|
+
this.selection.query = "";
|
|
137
|
+
this.selection.select(id);
|
|
138
|
+
this.beforeSearch = undefined;
|
|
139
|
+
this.selectedChanged();
|
|
142
140
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
this.
|
|
141
|
+
action(key) {
|
|
142
|
+
switch (key) {
|
|
143
|
+
case "app.tasks.search":
|
|
144
|
+
this.beforeSearch = { id: this.selection.state.selectedId, focus: this.focus };
|
|
145
|
+
this.focus = "list";
|
|
146
|
+
this.searching = true;
|
|
147
|
+
this.search.focused = true;
|
|
148
|
+
this.search.setValue("");
|
|
149
|
+
break;
|
|
150
|
+
case "app.tasks.previousTab":
|
|
151
|
+
case "app.tasks.nextTab":
|
|
152
|
+
if (this.focus === "inspector")
|
|
153
|
+
this.selection.state.tab = key === "app.tasks.previousTab" ? "output" : "info";
|
|
154
|
+
break;
|
|
155
|
+
case "app.tasks.nextFocus":
|
|
156
|
+
case "app.tasks.previousFocus":
|
|
157
|
+
this.focus = this.focus === "list" ? "inspector" : "list";
|
|
158
|
+
break;
|
|
159
|
+
case "app.tasks.follow":
|
|
160
|
+
if (this.focus === "inspector" && this.selection.state.tab === "output") {
|
|
161
|
+
this.inspector.position.output.jump(true, true);
|
|
162
|
+
this.queueTick(true);
|
|
163
|
+
}
|
|
164
|
+
break;
|
|
165
|
+
case "app.tasks.top":
|
|
166
|
+
case "app.tasks.bottom":
|
|
167
|
+
if (this.focus === "list") {
|
|
168
|
+
this.selection.select(key === "app.tasks.top" ? this.selection.rows[0]?.id : this.selection.rows.at(-1)?.id);
|
|
169
|
+
this.selectedChanged();
|
|
170
|
+
}
|
|
171
|
+
else
|
|
172
|
+
this.inspector.position[this.selection.state.tab].jump(key === "app.tasks.bottom", this.selection.state.tab === "output");
|
|
173
|
+
break;
|
|
174
|
+
case "app.tasks.kill":
|
|
175
|
+
this.stop();
|
|
176
|
+
break;
|
|
177
|
+
case "app.tasks.confirmStop":
|
|
178
|
+
this.stop(true);
|
|
179
|
+
break;
|
|
180
|
+
case "app.tasks.detachSelected": {
|
|
181
|
+
const task = this.selection.selected;
|
|
182
|
+
if (task?.mode === "foreground" &&
|
|
183
|
+
!isTaskTerminal(task.status) &&
|
|
184
|
+
task.status !== "stopping" &&
|
|
185
|
+
this.options.host.enabled !== false) {
|
|
186
|
+
this.feedback = this.options.host.detach?.(task.id)
|
|
187
|
+
? "Selected task moved to background; execution continues."
|
|
188
|
+
: "This task cannot move to background.";
|
|
189
|
+
}
|
|
190
|
+
break;
|
|
191
|
+
}
|
|
192
|
+
case "app.tasks.help":
|
|
193
|
+
this.help = this.help ? undefined : new TaskViewport();
|
|
194
|
+
break;
|
|
150
195
|
}
|
|
151
|
-
return position;
|
|
152
|
-
}
|
|
153
|
-
queueTick() {
|
|
154
|
-
void this.tick().catch(() => {
|
|
155
|
-
/* The observer cannot reject execution. */
|
|
156
|
-
});
|
|
157
196
|
}
|
|
158
|
-
|
|
159
|
-
if (this.
|
|
160
|
-
|
|
161
|
-
this.sync();
|
|
162
|
-
await this.refresh();
|
|
163
|
-
if (this.disposed)
|
|
197
|
+
move(direction, page = false) {
|
|
198
|
+
if (this.help) {
|
|
199
|
+
this.help.move(direction, page, false);
|
|
164
200
|
return;
|
|
165
|
-
const frame = this.render(this.width).join("\n");
|
|
166
|
-
if (frame !== this.lastFrame) {
|
|
167
|
-
this.lastFrame = frame;
|
|
168
|
-
this.options.tui.requestRender();
|
|
169
201
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
if (!task || this.provider?.outputMode !== "tail" || this.viewError || this.reading)
|
|
174
|
-
return;
|
|
175
|
-
const position = this.position();
|
|
176
|
-
if (position.read && (!position.output.follow || isTaskTerminal(position.read.task.status)))
|
|
177
|
-
return;
|
|
178
|
-
this.reading = true;
|
|
179
|
-
try {
|
|
180
|
-
const read = await this.options.host.read(task.id, { mode: "tail", bytes: 48 * 1024 });
|
|
181
|
-
if (this.disposed || this.selected?.id !== task.id || (!position.output.follow && position.read))
|
|
202
|
+
if (this.focus === "list") {
|
|
203
|
+
const rows = this.selection.rows;
|
|
204
|
+
if (!rows.length)
|
|
182
205
|
return;
|
|
183
|
-
|
|
206
|
+
const index = rows.findIndex((task) => task.id === this.selection.state.selectedId);
|
|
207
|
+
const next = page
|
|
208
|
+
? Math.max(0, Math.min(rows.length - 1, index + direction * (this.layout?.listPageSize ?? 1)))
|
|
209
|
+
: (index + direction + rows.length) % rows.length;
|
|
210
|
+
this.selection.select(rows[next]?.id);
|
|
211
|
+
this.selectedChanged();
|
|
184
212
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
position.read = {
|
|
188
|
-
task,
|
|
189
|
-
text: "",
|
|
190
|
-
readError: `Cannot read output: ${clean(String(error))}`,
|
|
191
|
-
totalBytes: 0,
|
|
192
|
-
truncated: false,
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
finally {
|
|
197
|
-
this.reading = false;
|
|
198
|
-
if (!this.disposed && this.selected?.id !== task.id)
|
|
199
|
-
this.queueTick();
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
clearKill() {
|
|
203
|
-
clearTimeout(this.killTimer);
|
|
204
|
-
this.killTimer = undefined;
|
|
205
|
-
this.pendingKill = undefined;
|
|
213
|
+
else
|
|
214
|
+
this.inspector.position[this.selection.state.tab].move(direction, page, this.selection.state.tab === "output");
|
|
206
215
|
}
|
|
207
216
|
handleInput(data) {
|
|
208
217
|
if (this.disposed)
|
|
209
218
|
return;
|
|
219
|
+
this.sync();
|
|
220
|
+
this.render(this.width);
|
|
210
221
|
const kb = this.options.keybindings;
|
|
211
222
|
this.feedback = undefined;
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
this.
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
223
|
+
try {
|
|
224
|
+
if (this.help) {
|
|
225
|
+
if (kb.matches(data, "tui.select.cancel") || kb.matches(data, "app.tasks.help"))
|
|
226
|
+
this.help = undefined;
|
|
227
|
+
else if (kb.matches(data, "app.tasks.top") || kb.matches(data, "app.tasks.bottom"))
|
|
228
|
+
this.help.jump(kb.matches(data, "app.tasks.bottom"), false);
|
|
229
|
+
else if (kb.matches(data, "tui.select.up") || kb.matches(data, "tui.editor.pageUp"))
|
|
230
|
+
this.help.move(-1, kb.matches(data, "tui.editor.pageUp"), false);
|
|
231
|
+
else if (kb.matches(data, "tui.select.down") || kb.matches(data, "tui.editor.pageDown"))
|
|
232
|
+
this.help.move(1, kb.matches(data, "tui.editor.pageDown"), false);
|
|
233
|
+
}
|
|
234
|
+
else if (this.searching) {
|
|
235
|
+
if (kb.matches(data, "tui.select.cancel"))
|
|
236
|
+
this.finishSearch(true);
|
|
237
|
+
else if (kb.matches(data, "tui.select.confirm"))
|
|
238
|
+
this.finishSearch(false);
|
|
239
|
+
else if (kb.matches(data, "tui.select.up") || kb.matches(data, "tui.select.pageUp"))
|
|
240
|
+
this.move(-1, kb.matches(data, "tui.select.pageUp"));
|
|
241
|
+
else if (kb.matches(data, "tui.select.down") || kb.matches(data, "tui.select.pageDown"))
|
|
242
|
+
this.move(1, kb.matches(data, "tui.select.pageDown"));
|
|
243
|
+
else {
|
|
244
|
+
this.search.handleInput(data);
|
|
245
|
+
this.selection.query = this.search.getValue().slice(0, 512);
|
|
246
|
+
this.selection.refresh();
|
|
247
|
+
this.selectedChanged();
|
|
221
248
|
}
|
|
222
249
|
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
250
|
+
else if (this.pendingKill) {
|
|
251
|
+
if (kb.matches(data, "app.tasks.confirmStop"))
|
|
252
|
+
this.stop(true);
|
|
253
|
+
else if (kb.matches(data, "tui.select.cancel"))
|
|
254
|
+
this.clearKill();
|
|
255
|
+
}
|
|
256
|
+
else if (kb.matches(data, "tui.select.cancel")) {
|
|
228
257
|
this.dispose();
|
|
229
258
|
this.options.onClose();
|
|
230
259
|
return;
|
|
231
260
|
}
|
|
261
|
+
else {
|
|
262
|
+
const pageUp = kb.matches(data, this.focus === "list" ? "tui.select.pageUp" : "tui.editor.pageUp");
|
|
263
|
+
const pageDown = kb.matches(data, this.focus === "list" ? "tui.select.pageDown" : "tui.editor.pageDown");
|
|
264
|
+
if (pageUp || kb.matches(data, "tui.select.up"))
|
|
265
|
+
this.move(-1, pageUp);
|
|
266
|
+
else if (pageDown || kb.matches(data, "tui.select.down"))
|
|
267
|
+
this.move(1, pageDown);
|
|
268
|
+
else if (kb.matches(data, "tui.select.confirm"))
|
|
269
|
+
return;
|
|
270
|
+
else {
|
|
271
|
+
const key = actions.find((key) => kb.matches(data, key));
|
|
272
|
+
if (key)
|
|
273
|
+
this.action(key);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
232
276
|
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
277
|
+
catch (error) {
|
|
278
|
+
this.feedback = cleanTaskText(error instanceof Error ? error.message : String(error));
|
|
279
|
+
}
|
|
280
|
+
this.queueTick(true);
|
|
281
|
+
this.options.tui.requestRender();
|
|
282
|
+
}
|
|
283
|
+
handleMouse(event) {
|
|
284
|
+
if (this.disposed || event.ctrl || event.alt || event.shift)
|
|
285
|
+
return;
|
|
286
|
+
this.render(event.width);
|
|
287
|
+
const layout = this.layout;
|
|
288
|
+
if (event.type === "wheel" && event.wheelDelta) {
|
|
289
|
+
if (!this.pendingKill && event.y >= 2 && event.y < this.options.tui.terminal.rows - 3) {
|
|
290
|
+
const delta = Math.sign(event.wheelDelta) * Math.min(20, Math.abs(event.wheelDelta));
|
|
291
|
+
const region = this.width >= 100 ? (event.x < layout.listWidth ? "list" : "inspector") : this.focus;
|
|
292
|
+
if (this.help)
|
|
293
|
+
this.help.move(delta, false, false);
|
|
294
|
+
else if (region === "list")
|
|
295
|
+
this.list.scroll(delta);
|
|
296
|
+
else if (!this.searching)
|
|
297
|
+
this.inspector.position[this.selection.state.tab].move(delta, false, this.selection.state.tab === "output");
|
|
241
298
|
}
|
|
242
299
|
}
|
|
243
|
-
else if (
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
const next = index < 0
|
|
258
|
-
? direction > 0
|
|
259
|
-
? 0
|
|
260
|
-
: this.tasks.length - 1
|
|
261
|
-
: pageUp || pageDown
|
|
262
|
-
? Math.max(0, Math.min(this.tasks.length - 1, index + direction * this.listHeight))
|
|
263
|
-
: (index + direction + this.tasks.length) % this.tasks.length;
|
|
264
|
-
this.select(this.tasks[next]);
|
|
265
|
-
this.sync();
|
|
300
|
+
else if (event.type === "click" && event.button === "left") {
|
|
301
|
+
const hit = layout.hits.find((hit) => hit.y === event.y && event.x >= hit.x && event.x < hit.x + hit.width);
|
|
302
|
+
try {
|
|
303
|
+
if (hit?.cancel) {
|
|
304
|
+
if (this.searching)
|
|
305
|
+
this.finishSearch(true);
|
|
306
|
+
else if (this.help)
|
|
307
|
+
this.help = undefined;
|
|
308
|
+
else if (this.pendingKill)
|
|
309
|
+
this.clearKill();
|
|
310
|
+
else {
|
|
311
|
+
this.dispose();
|
|
312
|
+
this.options.onClose();
|
|
313
|
+
}
|
|
266
314
|
}
|
|
267
|
-
else if (
|
|
268
|
-
this.
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
315
|
+
else if (hit?.taskId) {
|
|
316
|
+
this.selection.select(hit.taskId);
|
|
317
|
+
this.selectedChanged();
|
|
318
|
+
this.focus = "list";
|
|
319
|
+
if (this.searching)
|
|
320
|
+
this.finishSearch(false);
|
|
321
|
+
}
|
|
322
|
+
else if (hit?.tab) {
|
|
323
|
+
this.focus = "inspector";
|
|
324
|
+
this.selection.state.tab = hit.tab;
|
|
273
325
|
}
|
|
274
|
-
|
|
275
|
-
|
|
326
|
+
else if (hit?.key) {
|
|
327
|
+
if (hit.key === "app.tasks.follow")
|
|
328
|
+
this.focus = "inspector";
|
|
329
|
+
this.action(hit.key);
|
|
276
330
|
}
|
|
331
|
+
else if (!this.pendingKill &&
|
|
332
|
+
!this.searching &&
|
|
333
|
+
!this.help &&
|
|
334
|
+
event.y >= 1 &&
|
|
335
|
+
event.y < this.options.tui.terminal.rows - 2 &&
|
|
336
|
+
this.width >= 100)
|
|
337
|
+
this.focus = event.x < layout.listWidth ? "list" : "inspector";
|
|
277
338
|
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
this.options.tui.requestRender();
|
|
281
|
-
}
|
|
282
|
-
regionLines(width) {
|
|
283
|
-
if (!this.selected || !this.view)
|
|
284
|
-
return { info: [], output: [] };
|
|
285
|
-
try {
|
|
286
|
-
const read = this.position().read;
|
|
287
|
-
if (this.selected !== this.viewSnapshot || read !== this.viewRead) {
|
|
288
|
-
this.view.update(this.selected, read);
|
|
289
|
-
this.viewSnapshot = this.selected;
|
|
290
|
-
this.viewRead = read;
|
|
339
|
+
catch (error) {
|
|
340
|
+
this.feedback = cleanTaskText(error instanceof Error ? error.message : String(error));
|
|
291
341
|
}
|
|
292
|
-
return { info: this.view.info.render(width), output: this.view.output.render(width) };
|
|
293
|
-
}
|
|
294
|
-
catch (error) {
|
|
295
|
-
this.failView(error);
|
|
296
|
-
this.view.update(this.selected);
|
|
297
|
-
return { info: this.view.info.render(width), output: this.view.output.render(width) };
|
|
298
342
|
}
|
|
343
|
+
else
|
|
344
|
+
return;
|
|
345
|
+
this.queueTick(true);
|
|
346
|
+
this.options.tui.requestRender();
|
|
347
|
+
return { handled: true, focus: event.type === "click" };
|
|
299
348
|
}
|
|
300
349
|
render(width) {
|
|
301
|
-
if (width < 1)
|
|
302
|
-
return [];
|
|
303
350
|
this.width = width;
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
const selectedIndex = this.tasks.findIndex((task) => task.id === this.selected?.id);
|
|
320
|
-
const first = Math.max(0, selectedIndex - this.listHeight + 1);
|
|
321
|
-
const list = this.tasks.slice(first, first + this.listHeight).map((task) => {
|
|
322
|
-
const marker = statusMarker(task.status);
|
|
323
|
-
const selected = task.id === this.selected?.id;
|
|
324
|
-
const cursor = selected ? theme.fg(this.focus === "list" ? "accent" : "muted", "→ ") : " ";
|
|
325
|
-
const suffix = theme.fg("dim", `${task.mode === "foreground" ? "fg" : "bg"} · ${runtimeLabel(task)}`);
|
|
326
|
-
const prefix = `${cursor}${theme.fg(marker.color, marker.glyph)} `;
|
|
327
|
-
const label = clean(task.command ?? task.title).replace(/\s+/g, " ");
|
|
328
|
-
return `${prefix}${pad(theme.fg(selected && this.focus === "list" ? "accent" : "text", label), listWidth - visibleWidth(prefix) - visibleWidth(suffix) - 1)} ${suffix}`;
|
|
351
|
+
this.sync();
|
|
352
|
+
this.layout = renderTasksLayout({
|
|
353
|
+
width,
|
|
354
|
+
height: this.options.tui.terminal.rows,
|
|
355
|
+
theme: this.options.theme,
|
|
356
|
+
keybindings: this.options.keybindings,
|
|
357
|
+
selection: this.selection,
|
|
358
|
+
inspector: this.inspector,
|
|
359
|
+
list: this.list,
|
|
360
|
+
focus: this.focus,
|
|
361
|
+
searchLine: this.searching ? (width) => this.search.render(width).join("") : undefined,
|
|
362
|
+
pendingKill: this.pendingKill,
|
|
363
|
+
feedback: this.feedback,
|
|
364
|
+
help: this.help,
|
|
365
|
+
canDetach: this.options.host.enabled !== false && !!this.options.host.detach,
|
|
329
366
|
});
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
: [theme.fg("muted", "Select an ongoing task.")];
|
|
342
|
-
if (this.viewError)
|
|
343
|
-
common.push(theme.fg("error", this.viewError));
|
|
344
|
-
const infoHeight = Math.max(1, Math.min(Math.floor(available * 0.4), common.length + regions.info.length));
|
|
345
|
-
const outputHeight = Math.max(1, available - infoHeight - 2);
|
|
346
|
-
const position = this.position();
|
|
347
|
-
const info = position.info.layout([...common, ...regions.info], rightWidth, infoHeight);
|
|
348
|
-
const output = position.output.layout(regions.output, rightWidth, outputHeight);
|
|
349
|
-
const heading = (label, focus, suffix) => {
|
|
350
|
-
const text = `─ ${theme.fg(this.focus === focus ? "accent" : "muted", label)} ${theme.fg("dim", suffix)} `;
|
|
351
|
-
return pad(text + theme.fg("borderMuted", "─".repeat(Math.max(0, rightWidth - visibleWidth(text)))), rightWidth);
|
|
352
|
-
};
|
|
353
|
-
const tail = this.provider?.outputMode === "tail" && !this.viewError
|
|
354
|
-
? ` · ${position.output.follow ? "following" : "browsing"}`
|
|
355
|
-
: "";
|
|
356
|
-
const right = [
|
|
357
|
-
heading("Information", "info", position.info.range),
|
|
358
|
-
...info,
|
|
359
|
-
...Array.from({ length: Math.max(0, infoHeight - info.length) }, () => ""),
|
|
360
|
-
heading("Output", "output", position.output.range + tail),
|
|
361
|
-
...output,
|
|
362
|
-
];
|
|
363
|
-
const body = wide
|
|
364
|
-
? Array.from({ length: bodyHeight }, (_, i) => `${pad(list[i] ?? "", listWidth)}${theme.fg("borderMuted", "│")}${pad(right[i] ?? "", rightWidth)}`)
|
|
365
|
-
: [...list, ...Array.from({ length: Math.max(0, this.listHeight - list.length) }, () => ""), ...right];
|
|
366
|
-
while (body.length < bodyHeight)
|
|
367
|
-
body.push("");
|
|
368
|
-
const hint = (id) => keyLabel(id, { keybindings });
|
|
369
|
-
const hints = this.focus === "list"
|
|
370
|
-
? `${hint("tui.select.up")}/${hint("tui.select.down")} select · ${hint("app.tasks.focusInfo")} info · ${hint("app.tasks.focusPreview")} output · ${hint("app.tasks.kill")} stop · ${hint("tui.select.cancel")} close`
|
|
371
|
-
: `${hint("tui.select.up")}/${hint("tui.select.down")} scroll · ${hint("tui.editor.pageUp")}/${hint("tui.editor.pageDown")} page · ${hint("app.tasks.focusList")} list · ${hint("app.tasks.focusInfo")} info · ${hint("app.tasks.focusPreview")} output · ${hint("tui.select.cancel")} back`;
|
|
372
|
-
const title = theme.fg("accent", theme.bold("Tasks")) +
|
|
373
|
-
(this.tasks.length ? theme.fg("muted", ` · ${this.tasks.length} ongoing`) : "");
|
|
374
|
-
const footer = this.pendingKill
|
|
375
|
-
? theme.fg("warning", `Stop ${this.pendingKill} (whole task)? y/N`)
|
|
376
|
-
: theme.fg("dim", this.feedback ?? hints);
|
|
377
|
-
return [rule, title, ...body.slice(0, bodyHeight), rule, footer, rule].map((line) => pad(line, width));
|
|
367
|
+
return this.layout.lines;
|
|
368
|
+
}
|
|
369
|
+
dispose() {
|
|
370
|
+
if (this.disposed)
|
|
371
|
+
return;
|
|
372
|
+
this.disposed = true;
|
|
373
|
+
clearInterval(this.pollTimer);
|
|
374
|
+
clearInterval(this.animationTimer);
|
|
375
|
+
this.clearKill();
|
|
376
|
+
this.unsubscribe();
|
|
377
|
+
this.inspector.dispose();
|
|
378
378
|
}
|
|
379
379
|
}
|
|
380
380
|
//# sourceMappingURL=manager.js.map
|