@astralyn/pi 0.99.0 → 1.0.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 +39 -3
- package/dist/bundle/chunks/anthropic-messages-CG2BSDQS.js +6 -0
- package/dist/bundle/chunks/anthropic.js +2 -2
- package/dist/bundle/chunks/{azure-openai-responses-RPBERDXD.js → azure-openai-responses-PBA4QKCM.js} +1 -1
- package/dist/bundle/chunks/bedrock-converse-stream.js +2 -2
- package/dist/bundle/chunks/{chunk-ABVRAYXT.js → chunk-6UFFVA7M.js} +2 -2
- package/dist/bundle/chunks/chunk-GIG5IHES.js +2 -0
- package/dist/bundle/chunks/{chunk-VW2P3X6P.js → chunk-HESRDUKO.js} +414 -666
- package/dist/bundle/chunks/{chunk-A576H74Y.js → chunk-PFZKRUMO.js} +1 -1
- package/dist/bundle/chunks/chunk-SGLYRVQL.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-Z2RKSI3O.js +2 -0
- package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-ZYSAFXXL.js → cloudflare-workers-ai-system-one-YB7XPPP4.js} +1 -1
- package/dist/bundle/chunks/codemode-worker.js +67 -8
- package/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/bundle/chunks/{google-generative-ai-SDNQVVXA.js → google-generative-ai-V5ZM5MCL.js} +1 -1
- package/dist/bundle/chunks/{google-vertex-LZXOLBIO.js → google-vertex-22THOFP5.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-WHSCJJWP.js} +1 -1
- package/dist/bundle/chunks/openai-chatgpt.js +1 -1
- package/dist/bundle/chunks/{openai-codex-responses-HZ4VUDXD.js → openai-codex-responses-N7GDPBPP.js} +1 -1
- package/dist/bundle/chunks/openai-codex.js +1 -1
- package/dist/bundle/chunks/{openai-completions-SKDGF6OE.js → openai-completions-RGGQK5UW.js} +1 -1
- package/dist/bundle/chunks/{openai-responses-FPML4SSG.js → openai-responses-3ZLD5JYI.js} +1 -1
- 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-4RQ2L6W4.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.js +1 -1
- 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 +16 -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 +64 -11
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +13 -1
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/types.d.ts +6 -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 +34 -7
- package/dist/core/mcp-servers.d.ts.map +1 -1
- package/dist/core/mcp-servers.js +52 -11
- package/dist/core/mcp-servers.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-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/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/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 +20 -5
- package/dist/extensions/mcp/cli.js.map +1 -1
- package/dist/extensions/mcp/config.d.ts +4 -2
- package/dist/extensions/mcp/config.d.ts.map +1 -1
- package/dist/extensions/mcp/config.js +14 -2
- package/dist/extensions/mcp/config.js.map +1 -1
- package/dist/extensions/mcp/index.d.ts +32 -8
- package/dist/extensions/mcp/index.d.ts.map +1 -1
- package/dist/extensions/mcp/index.js +235 -61
- package/dist/extensions/mcp/index.js.map +1 -1
- package/dist/extensions/mcp/oauth.d.ts +10 -7
- package/dist/extensions/mcp/oauth.d.ts.map +1 -1
- package/dist/extensions/mcp/oauth.js +56 -31
- 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 +16 -9
- package/dist/extensions/mcp/runtime.js.map +1 -1
- package/dist/extensions/mcp/tools.d.ts +5 -4
- package/dist/extensions/mcp/tools.d.ts.map +1 -1
- package/dist/extensions/mcp/tools.js +33 -15
- 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 +4 -2
- 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 +2 -4
- 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/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-animation.d.ts +68 -0
- package/dist/modes/interactive/components/pi-logo-animation.d.ts.map +1 -0
- package/dist/modes/interactive/components/pi-logo-animation.js +1076 -0
- package/dist/modes/interactive/components/pi-logo-animation.js.map +1 -0
- package/dist/modes/interactive/components/pi-logo-animation.lazy.d.ts +7 -0
- package/dist/modes/interactive/components/pi-logo-animation.lazy.d.ts.map +1 -0
- package/dist/modes/interactive/components/pi-logo-animation.lazy.js +12 -0
- package/dist/modes/interactive/components/pi-logo-animation.lazy.js.map +1 -0
- 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 +10 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +167 -40
- 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/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 +7 -9
- package/docs/keybindings.md +13 -6
- package/docs/mcp.md +142 -82
- package/docs/models.md +21 -0
- 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 +69 -58
- package/package.json +11 -10
- package/dist/bundle/chunks/anthropic-messages-KIXY7EDT.js +0 -6
- package/dist/bundle/chunks/chunk-CLLDCO64.js +0 -2
- package/dist/bundle/chunks/chunk-UUSTLCVC.js +0 -2
- package/dist/bundle/chunks/chunk-VWCWZD6E.js +0 -2
- 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/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
|
@@ -4,8 +4,9 @@ import { keyHint, rawKeyHint } from "../../../modes/interactive/components/keybi
|
|
|
4
4
|
import { builtinDefaults } from "../catalog.js";
|
|
5
5
|
import { API_TYPES, INPUT_TYPES, truncate } from "../constants.js";
|
|
6
6
|
import { DELETE } from "../store.js";
|
|
7
|
+
import { ChoicePane, InlineEdit, moveSelection } from "./controls.js";
|
|
7
8
|
import { baseUrlHint, validateBaseUrlValue } from "./provider-fields.js";
|
|
8
|
-
import { isPrintableInput, renderInfoLine, renderKeyValueLine, renderPlainLine
|
|
9
|
+
import { isPrintableInput, renderInfoLine, renderKeyValueLine, renderPlainLine } from "./value-row.js";
|
|
9
10
|
// -------------------------------------------------------------------------
|
|
10
11
|
// reasoning
|
|
11
12
|
// -------------------------------------------------------------------------
|
|
@@ -15,61 +16,15 @@ const REASONING_OPTIONS = [
|
|
|
15
16
|
{ label: "default (false)", value: undefined },
|
|
16
17
|
];
|
|
17
18
|
/** Radio sub-page for reasoning — consistent with the other nested model settings. */
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
render(width) {
|
|
29
|
-
const theme = this.host.theme;
|
|
30
|
-
const current = this.model.read().reasoning;
|
|
31
|
-
return REASONING_OPTIONS.map((option, optionIndex) => {
|
|
32
|
-
const selected = option.value === undefined ? current === undefined : current === option.value;
|
|
33
|
-
return renderPlainLine(theme, `${selected ? "●" : "○"} ${option.label}`, {
|
|
34
|
-
active: optionIndex === this.index,
|
|
35
|
-
paneFocused: this.focused,
|
|
36
|
-
dim: option.value === undefined,
|
|
37
|
-
width,
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
handleInput(data) {
|
|
42
|
-
const kb = this.host.keybindings;
|
|
43
|
-
if (kb.matches(data, "tui.select.up")) {
|
|
44
|
-
this.index = this.index === 0 ? REASONING_OPTIONS.length - 1 : this.index - 1;
|
|
45
|
-
this.host.refresh();
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
if (kb.matches(data, "tui.select.down")) {
|
|
49
|
-
this.index = (this.index + 1) % REASONING_OPTIONS.length;
|
|
50
|
-
this.host.refresh();
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
if (kb.matches(data, "tui.select.cancel")) {
|
|
54
|
-
this.host.popPane();
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
if (kb.matches(data, "tui.select.confirm") || kb.matches(data, "app.list.toggle")) {
|
|
58
|
-
const option = REASONING_OPTIONS[this.index];
|
|
59
|
-
this.host.mutate(() => this.model.setField(["reasoning"], option.value === undefined ? DELETE : option.value));
|
|
60
|
-
this.host.popPane();
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
setFocused(focused) {
|
|
64
|
-
this.focused = focused;
|
|
65
|
-
}
|
|
66
|
-
hints() {
|
|
67
|
-
return [
|
|
68
|
-
rawKeyHint("↑↓", "move"),
|
|
69
|
-
keyHint("tui.select.confirm", "set"),
|
|
70
|
-
keyHint("tui.select.cancel", "back"),
|
|
71
|
-
].join(" ");
|
|
72
|
-
}
|
|
19
|
+
export function createReasoningPane(host, model) {
|
|
20
|
+
return new ChoicePane(host, "reasoning", {
|
|
21
|
+
current: () => model.read().reasoning,
|
|
22
|
+
choices: () => REASONING_OPTIONS.map((option) => ({ ...option, dim: option.value === undefined })),
|
|
23
|
+
choose: (value) => {
|
|
24
|
+
model.setField(["reasoning"], value === undefined ? DELETE : value);
|
|
25
|
+
return undefined;
|
|
26
|
+
},
|
|
27
|
+
});
|
|
73
28
|
}
|
|
74
29
|
// -------------------------------------------------------------------------
|
|
75
30
|
// input modalities
|
|
@@ -103,13 +58,9 @@ export class InputTypesPane {
|
|
|
103
58
|
}
|
|
104
59
|
handleInput(data) {
|
|
105
60
|
const kb = this.host.keybindings;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
this.
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
if (kb.matches(data, "tui.select.down")) {
|
|
112
|
-
this.index = (this.index + 1) % INPUT_TYPES.length;
|
|
61
|
+
const next = moveSelection(kb, data, this.index, INPUT_TYPES.length);
|
|
62
|
+
if (next !== undefined) {
|
|
63
|
+
this.index = next;
|
|
113
64
|
this.host.refresh();
|
|
114
65
|
return;
|
|
115
66
|
}
|
|
@@ -129,7 +80,7 @@ export class InputTypesPane {
|
|
|
129
80
|
}
|
|
130
81
|
this.error = undefined;
|
|
131
82
|
const next = INPUT_TYPES.filter((entry) => selected.has(entry));
|
|
132
|
-
this.
|
|
83
|
+
this.model.setField(["input"], [...next]);
|
|
133
84
|
return;
|
|
134
85
|
}
|
|
135
86
|
if (kb.matches(data, "tui.select.confirm") || kb.matches(data, "tui.select.cancel")) {
|
|
@@ -158,6 +109,7 @@ export class CostPane {
|
|
|
158
109
|
this.index = 0;
|
|
159
110
|
this.focused = false;
|
|
160
111
|
this.host = host;
|
|
112
|
+
this.edit = new InlineEdit(() => host.refresh());
|
|
161
113
|
this.model = model;
|
|
162
114
|
}
|
|
163
115
|
cost() {
|
|
@@ -178,7 +130,7 @@ export class CostPane {
|
|
|
178
130
|
unset: value === undefined,
|
|
179
131
|
active: rowIndex === this.index,
|
|
180
132
|
paneFocused: this.focused,
|
|
181
|
-
editing: this.
|
|
133
|
+
editing: this.edit.editor(rate),
|
|
182
134
|
width,
|
|
183
135
|
}));
|
|
184
136
|
}
|
|
@@ -186,26 +138,17 @@ export class CostPane {
|
|
|
186
138
|
if (tiers && tiers.length > 0) {
|
|
187
139
|
lines.push(renderInfoLine(theme, `tiers: ${tiers.length} (read-only; kept as-is)`, width));
|
|
188
140
|
}
|
|
189
|
-
if (this.error)
|
|
190
|
-
lines.push(theme.fg("error", truncate(this.error, Math.max(10, width - 2))));
|
|
141
|
+
if (this.edit.error)
|
|
142
|
+
lines.push(theme.fg("error", truncate(this.edit.error, Math.max(10, width - 2))));
|
|
191
143
|
return lines;
|
|
192
144
|
}
|
|
193
145
|
handleInput(data) {
|
|
194
146
|
const kb = this.host.keybindings;
|
|
195
|
-
if (this.
|
|
196
|
-
if (kb.matches(data, "tui.select.up") || kb.matches(data, "tui.select.down"))
|
|
197
|
-
return;
|
|
198
|
-
this.editing.handleInput(data);
|
|
199
|
-
this.host.refresh();
|
|
200
|
-
return;
|
|
201
|
-
}
|
|
202
|
-
if (kb.matches(data, "tui.select.up")) {
|
|
203
|
-
this.index = this.index === 0 ? COST_RATES.length - 1 : this.index - 1;
|
|
204
|
-
this.host.refresh();
|
|
147
|
+
if (this.edit.handleInput(data, kb))
|
|
205
148
|
return;
|
|
206
|
-
|
|
207
|
-
if (
|
|
208
|
-
this.index =
|
|
149
|
+
const next = moveSelection(kb, data, this.index, COST_RATES.length);
|
|
150
|
+
if (next !== undefined) {
|
|
151
|
+
this.index = next;
|
|
209
152
|
this.host.refresh();
|
|
210
153
|
return;
|
|
211
154
|
}
|
|
@@ -225,53 +168,30 @@ export class CostPane {
|
|
|
225
168
|
beginEdit(mode, firstData) {
|
|
226
169
|
const rate = COST_RATES[this.index];
|
|
227
170
|
const current = this.cost()?.[rate];
|
|
228
|
-
|
|
229
|
-
onCommit: (value) => this.commit(rate, value),
|
|
230
|
-
onCancel: () => {
|
|
231
|
-
this.editing = undefined;
|
|
232
|
-
this.editingRate = undefined;
|
|
233
|
-
this.error = undefined;
|
|
234
|
-
this.host.refresh();
|
|
235
|
-
},
|
|
236
|
-
});
|
|
237
|
-
this.editing = editor;
|
|
238
|
-
this.editingRate = rate;
|
|
239
|
-
editor.focused = this.focused;
|
|
240
|
-
if (mode === "overwrite")
|
|
241
|
-
editor.beginOverwrite(firstData);
|
|
242
|
-
else
|
|
243
|
-
editor.beginTweak(current === undefined ? "" : String(current));
|
|
244
|
-
this.host.refresh();
|
|
171
|
+
this.edit.begin(rate, current === undefined ? "" : String(current), mode, this.focused, (value) => this.commit(rate, value), firstData);
|
|
245
172
|
}
|
|
246
173
|
commit(rate, raw) {
|
|
247
174
|
const value = raw.trim();
|
|
248
175
|
const parsed = value === "" ? 0 : Number(value);
|
|
249
176
|
if (!Number.isFinite(parsed) || parsed < 0) {
|
|
250
|
-
|
|
251
|
-
this.host.refresh();
|
|
252
|
-
return;
|
|
177
|
+
return "cost rates must be finite non-negative numbers.";
|
|
253
178
|
}
|
|
254
|
-
this.error = undefined;
|
|
255
|
-
this.editing = undefined;
|
|
256
|
-
this.editingRate = undefined;
|
|
257
179
|
// A cost object must stay complete: first edit materializes the other rates as 0; tiers are preserved.
|
|
258
|
-
this.
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
});
|
|
180
|
+
if (this.model.read().cost)
|
|
181
|
+
this.model.setField(["cost", rate], parsed);
|
|
182
|
+
else
|
|
183
|
+
this.model.setField(["cost"], { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, [rate]: parsed });
|
|
184
|
+
return undefined;
|
|
264
185
|
}
|
|
265
186
|
setFocused(focused) {
|
|
266
187
|
this.focused = focused;
|
|
267
|
-
|
|
268
|
-
this.editing.focused = focused;
|
|
188
|
+
this.edit.setFocused(focused);
|
|
269
189
|
}
|
|
270
190
|
isEditing() {
|
|
271
|
-
return this.editing
|
|
191
|
+
return this.edit.editing;
|
|
272
192
|
}
|
|
273
193
|
hints() {
|
|
274
|
-
if (this.editing)
|
|
194
|
+
if (this.edit.editing)
|
|
275
195
|
return [keyHint("tui.input.submit", "save"), keyHint("tui.select.cancel", "cancel")].join(" ");
|
|
276
196
|
return [
|
|
277
197
|
rawKeyHint("type", "overwrite"),
|
|
@@ -295,6 +215,7 @@ export class ModelSpecificApiPane {
|
|
|
295
215
|
this.index = 0;
|
|
296
216
|
this.focused = false;
|
|
297
217
|
this.host = host;
|
|
218
|
+
this.edit = new InlineEdit(() => host.refresh());
|
|
298
219
|
this.model = model;
|
|
299
220
|
}
|
|
300
221
|
/** Where an unset model field resolves from; undefined when nothing resolves it. */
|
|
@@ -313,36 +234,22 @@ export class ModelSpecificApiPane {
|
|
|
313
234
|
const lines = [];
|
|
314
235
|
for (const [rowIndex, row] of this.rows.entries()) {
|
|
315
236
|
const active = rowIndex === this.index;
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
}
|
|
330
|
-
else {
|
|
331
|
-
const override = current.api;
|
|
332
|
-
const inherited = override ? undefined : this.inherited("api");
|
|
333
|
-
lines.push(renderKeyValueLine(theme, {
|
|
334
|
-
keyLabel: "API Type",
|
|
335
|
-
valueText: override ?? inherited?.value ?? "not set",
|
|
336
|
-
unset: !override,
|
|
337
|
-
note: inherited ? `· ${inherited.via}` : undefined,
|
|
338
|
-
active,
|
|
339
|
-
paneFocused: this.focused,
|
|
340
|
-
width,
|
|
341
|
-
}));
|
|
342
|
-
}
|
|
237
|
+
const key = row === "apiType" ? "api" : row;
|
|
238
|
+
const override = current[key];
|
|
239
|
+
const inherited = override ? undefined : this.inherited(key);
|
|
240
|
+
lines.push(renderKeyValueLine(theme, {
|
|
241
|
+
keyLabel: row === "apiType" ? "API Type" : row,
|
|
242
|
+
valueText: override ?? inherited?.value ?? "not set",
|
|
243
|
+
unset: !override,
|
|
244
|
+
note: inherited ? `· ${inherited.via}` : undefined,
|
|
245
|
+
active,
|
|
246
|
+
paneFocused: this.focused,
|
|
247
|
+
editing: row === "baseUrl" ? this.edit.editor(row) : undefined,
|
|
248
|
+
width,
|
|
249
|
+
}));
|
|
343
250
|
}
|
|
344
|
-
if (this.error)
|
|
345
|
-
lines.push(theme.fg("error", truncate(this.error, Math.max(10, width - 2))));
|
|
251
|
+
if (this.edit.error)
|
|
252
|
+
lines.push(theme.fg("error", truncate(this.edit.error, Math.max(10, width - 2))));
|
|
346
253
|
const hint = baseUrlHint(this.host.effectiveApi(current));
|
|
347
254
|
if (hint)
|
|
348
255
|
lines.push(renderInfoLine(theme, hint, width));
|
|
@@ -350,20 +257,11 @@ export class ModelSpecificApiPane {
|
|
|
350
257
|
}
|
|
351
258
|
handleInput(data) {
|
|
352
259
|
const kb = this.host.keybindings;
|
|
353
|
-
if (this.
|
|
354
|
-
if (kb.matches(data, "tui.select.up") || kb.matches(data, "tui.select.down"))
|
|
355
|
-
return;
|
|
356
|
-
this.editing.handleInput(data);
|
|
357
|
-
this.host.refresh();
|
|
260
|
+
if (this.edit.handleInput(data, kb))
|
|
358
261
|
return;
|
|
359
|
-
|
|
360
|
-
if (
|
|
361
|
-
this.index =
|
|
362
|
-
this.host.refresh();
|
|
363
|
-
return;
|
|
364
|
-
}
|
|
365
|
-
if (kb.matches(data, "tui.select.down")) {
|
|
366
|
-
this.index = (this.index + 1) % this.rows.length;
|
|
262
|
+
const next = moveSelection(kb, data, this.index, this.rows.length);
|
|
263
|
+
if (next !== undefined) {
|
|
264
|
+
this.index = next;
|
|
367
265
|
this.host.refresh();
|
|
368
266
|
return;
|
|
369
267
|
}
|
|
@@ -373,7 +271,7 @@ export class ModelSpecificApiPane {
|
|
|
373
271
|
}
|
|
374
272
|
if (kb.matches(data, "tui.select.confirm")) {
|
|
375
273
|
if (this.rows[this.index] === "apiType")
|
|
376
|
-
this.host.pushPane(
|
|
274
|
+
this.host.pushPane(createModelApiPane(this.host, this.model));
|
|
377
275
|
else
|
|
378
276
|
this.beginEdit("tweak");
|
|
379
277
|
return;
|
|
@@ -387,48 +285,29 @@ export class ModelSpecificApiPane {
|
|
|
387
285
|
}
|
|
388
286
|
/** Tweak starts from the inherited value, so adjusting it writes the override directly. */
|
|
389
287
|
beginEdit(mode, firstData) {
|
|
390
|
-
const
|
|
391
|
-
|
|
392
|
-
const editor = new ValueEditor({
|
|
393
|
-
onCommit: (value) => this.commit(value),
|
|
394
|
-
onCancel: () => {
|
|
395
|
-
this.editing = undefined;
|
|
396
|
-
this.error = undefined;
|
|
397
|
-
this.host.refresh();
|
|
398
|
-
},
|
|
399
|
-
});
|
|
400
|
-
this.editing = editor;
|
|
401
|
-
editor.focused = this.focused;
|
|
402
|
-
if (mode === "overwrite")
|
|
403
|
-
editor.beginOverwrite(firstData);
|
|
404
|
-
else
|
|
405
|
-
editor.beginTweak(base);
|
|
406
|
-
this.host.refresh();
|
|
288
|
+
const base = this.model.read().baseUrl ?? this.inherited("baseUrl")?.value ?? "";
|
|
289
|
+
this.edit.begin("baseUrl", base, mode, this.focused, (value) => this.commit(value), firstData);
|
|
407
290
|
}
|
|
408
291
|
commit(raw) {
|
|
409
292
|
const value = raw.trim();
|
|
410
293
|
if (value) {
|
|
411
294
|
const invalid = validateBaseUrlValue(value);
|
|
412
295
|
if (invalid) {
|
|
413
|
-
|
|
414
|
-
this.host.refresh();
|
|
415
|
-
return;
|
|
296
|
+
return invalid;
|
|
416
297
|
}
|
|
417
298
|
}
|
|
418
|
-
this.
|
|
419
|
-
|
|
420
|
-
this.host.mutate(() => this.model.setField(["baseUrl"], value === "" ? DELETE : value));
|
|
299
|
+
this.model.setField(["baseUrl"], value === "" ? DELETE : value);
|
|
300
|
+
return undefined;
|
|
421
301
|
}
|
|
422
302
|
setFocused(focused) {
|
|
423
303
|
this.focused = focused;
|
|
424
|
-
|
|
425
|
-
this.editing.focused = focused;
|
|
304
|
+
this.edit.setFocused(focused);
|
|
426
305
|
}
|
|
427
306
|
isEditing() {
|
|
428
|
-
return this.editing
|
|
307
|
+
return this.edit.editing;
|
|
429
308
|
}
|
|
430
309
|
hints() {
|
|
431
|
-
if (this.editing)
|
|
310
|
+
if (this.edit.editing)
|
|
432
311
|
return [keyHint("tui.input.submit", "save"), keyHint("tui.select.cancel", "cancel")].join(" ");
|
|
433
312
|
return [
|
|
434
313
|
rawKeyHint("type", "overwrite"),
|
|
@@ -438,93 +317,33 @@ export class ModelSpecificApiPane {
|
|
|
438
317
|
}
|
|
439
318
|
}
|
|
440
319
|
/** Single-select model api: the inherited default plus every known API tag. Enter applies and returns. */
|
|
441
|
-
export
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
options.push({ label: api, value: api });
|
|
470
|
-
if (current && !API_TYPES.includes(current))
|
|
471
|
-
options.push({ label: current, value: current });
|
|
472
|
-
return options;
|
|
473
|
-
}
|
|
474
|
-
render(width) {
|
|
475
|
-
const theme = this.host.theme;
|
|
476
|
-
const current = this.model.read().api;
|
|
477
|
-
const lines = this.options().map((option, rowIndex) => {
|
|
478
|
-
const selected = option.value === current;
|
|
479
|
-
return renderPlainLine(theme, `${selected ? "●" : "○"} ${option.label}`, {
|
|
480
|
-
active: rowIndex === this.index,
|
|
481
|
-
paneFocused: this.focused,
|
|
482
|
-
dim: option.value === undefined,
|
|
483
|
-
width,
|
|
484
|
-
});
|
|
485
|
-
});
|
|
486
|
-
if (this.error)
|
|
487
|
-
lines.push(theme.fg("error", truncate(this.error, Math.max(10, width - 2))));
|
|
488
|
-
return lines;
|
|
489
|
-
}
|
|
490
|
-
handleInput(data) {
|
|
491
|
-
const kb = this.host.keybindings;
|
|
492
|
-
const options = this.options();
|
|
493
|
-
if (kb.matches(data, "tui.select.up")) {
|
|
494
|
-
this.index = this.index === 0 ? options.length - 1 : this.index - 1;
|
|
495
|
-
this.host.refresh();
|
|
496
|
-
return;
|
|
497
|
-
}
|
|
498
|
-
if (kb.matches(data, "tui.select.down")) {
|
|
499
|
-
this.index = (this.index + 1) % options.length;
|
|
500
|
-
this.host.refresh();
|
|
501
|
-
return;
|
|
502
|
-
}
|
|
503
|
-
if (kb.matches(data, "tui.select.cancel")) {
|
|
504
|
-
this.host.popPane();
|
|
505
|
-
return;
|
|
506
|
-
}
|
|
507
|
-
if (kb.matches(data, "tui.select.confirm") || kb.matches(data, "app.list.toggle")) {
|
|
508
|
-
const option = options[this.index];
|
|
509
|
-
if (option.value === undefined && !this.fallback()) {
|
|
510
|
-
this.error = "Nothing to inherit — pick an API.";
|
|
511
|
-
this.host.refresh();
|
|
512
|
-
return;
|
|
513
|
-
}
|
|
514
|
-
this.error = undefined;
|
|
515
|
-
this.host.mutate(() => this.model.setField(["api"], option.value ?? DELETE));
|
|
516
|
-
this.host.popPane();
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
setFocused(focused) {
|
|
520
|
-
this.focused = focused;
|
|
521
|
-
}
|
|
522
|
-
hints() {
|
|
523
|
-
return [
|
|
524
|
-
rawKeyHint("↑↓", "move"),
|
|
525
|
-
keyHint("tui.select.confirm", "select"),
|
|
526
|
-
keyHint("tui.select.cancel", "back"),
|
|
527
|
-
].join(" ");
|
|
528
|
-
}
|
|
320
|
+
export function createModelApiPane(host, model) {
|
|
321
|
+
const fallback = () => {
|
|
322
|
+
const provider = host.store.getProvider(host.providerId);
|
|
323
|
+
return provider?.api ?? builtinDefaults(host.providerId, model.read().id, provider?.api).api;
|
|
324
|
+
};
|
|
325
|
+
return new ChoicePane(host, "API Type", {
|
|
326
|
+
current: () => model.read().api,
|
|
327
|
+
choices: () => {
|
|
328
|
+
const providerApi = host.store.getProvider(host.providerId)?.api;
|
|
329
|
+
const inherited = fallback();
|
|
330
|
+
const label = providerApi
|
|
331
|
+
? `provider: ${providerApi}`
|
|
332
|
+
: inherited
|
|
333
|
+
? `built-in: ${inherited}`
|
|
334
|
+
: "no provider or built-in API";
|
|
335
|
+
const values = [undefined, ...API_TYPES];
|
|
336
|
+
const current = model.read().api;
|
|
337
|
+
if (current && !values.includes(current))
|
|
338
|
+
values.push(current);
|
|
339
|
+
return values.map((value) => ({ value, label: value ?? label, dim: value === undefined }));
|
|
340
|
+
},
|
|
341
|
+
choose: (value) => {
|
|
342
|
+
if (value === undefined && !fallback())
|
|
343
|
+
return "Nothing to inherit — pick an API.";
|
|
344
|
+
model.setField(["api"], value ?? DELETE);
|
|
345
|
+
return undefined;
|
|
346
|
+
},
|
|
347
|
+
});
|
|
529
348
|
}
|
|
530
349
|
//# sourceMappingURL=model-options.js.map
|