@ensocode/server 0.3.3 → 0.3.5
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/README.md +10 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/CHANGELOG.md +117 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/anthropic-messages-MGNURJ72.js +6 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{azure-openai-responses-FSC6BAW3.js → azure-openai-responses-4WDOP7MF.js} +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/bedrock-converse-stream.js +3 -3
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-4KSTFUIK.js +19 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-4UNPP53I.js +55 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-CCYGJPSU.js +2 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-4EYXVSA5.js → chunk-FF6XOTWB.js} +9 -9
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-FMPAMX2W.js +82 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-GFUN2N5K.js +2 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-C2WU32PX.js → chunk-H4W2F2IO.js} +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-IEBK4HQA.js +2 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-EOO47QGR.js → chunk-JLFZH7C6.js} +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-LCB5FO32.js +4 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-GN3QYODH.js → chunk-LQUBM7HF.js} +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-MABPTPMF.js +30 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-MPEFJ3RP.js +2 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-EBFHJFEE.js → chunk-PYBKJQVF.js} +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-VKJQ6CME.js +8 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-B46VJEHW.js → chunk-VUPOM3AH.js} +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-3TGLJEWK.js → chunk-WL4TUXY7.js} +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-V6KH5QG4.js → chunk-XM4MQFQV.js} +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-YZKQS34S.js → chunk-Y55SJART.js} +5 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-ZG74NES2.js +2 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-ZKNSXGL5.js +1243 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{cli-MCOUW5WS.js → cli-35W4A75E.js} +7 -7
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{cloudflare-workers-ai-system-one-WLAFJSP6.js → cloudflare-workers-ai-system-one-WKRH5HZA.js} +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/codemode-worker.js +2 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{easter-egg-3d-WMBNSJ4M.js → easter-egg-3d-GEVPKQF6.js} +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{execute-4CEBORGZ.js → execute-L2EEDV3L.js} +5 -3
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/github-copilot.js +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{google-generative-ai-INGKNW72.js → google-generative-ai-VSMFCHJU.js} +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{google-vertex-IBTX6MBF.js → google-vertex-35UTLZJN.js} +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{llama-cpp-classify-V5U3QKXI.js → llama-cpp-classify-Z3SS4FP4.js} +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{mistral-conversations-S4OWXIXQ.js → mistral-conversations-LWJTUFIM.js} +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openai-codex-responses-YYIXDJWF.js +10 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{openai-completions-EJNYB6IX.js → openai-completions-X2I4TQ2L.js} +3 -3
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{openai-decisions-IXI34BYG.js → openai-decisions-GG3FBAIF.js} +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openai-responses-5CX3GG6R.js +4 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{openrouter-images-PISKSFMS.js → openrouter-images-WHNK2UQG.js} +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{pi-messages-NORUKF4E.js → pi-messages-5CXWY5I7.js} +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{runtime-FQB7RU7U.js → runtime-J5ZSBGTX.js} +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{typesafe-system-one-CHVC2UUI.js → typesafe-system-one-KA2SBSSD.js} +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/virtual-modules-7ZY53V4K.js +2 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/cli-runtime.js +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/index.js +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/rpc-entry.js +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.js +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/cli/auth-command.js +26 -2
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/cli/auth-login.d.ts +15 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/cli/auth-login.js +232 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/cli/auth-logout.d.ts +14 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/cli/auth-logout.js +57 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/cli/auth-terminal.d.ts +17 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/cli/auth-terminal.js +63 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/cli/config-selector.js +3 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-runtime.d.ts +5 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-runtime.js +7 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.d.ts +25 -6
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js +139 -50
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js +3 -2
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/bash-executor.js +3 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/cache-warmer.d.ts +4 -37
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/cache-warmer.js +11 -89
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/utils.js +2 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/index.d.ts +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/loader.js +10 -5
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.d.ts +1 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.js +9 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.d.ts +28 -6
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings.d.ts +2 -2
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings.js +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/mcp-servers.d.ts +12 -37
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/mcp-servers.js +42 -121
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/model-config.d.ts +52 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.js +20 -19
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/model-runtime.d.ts +5 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/model-runtime.js +11 -4
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.d.ts +10 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js +50 -5
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/pi-ai-schemas.d.ts +4 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/preferred-providers.d.ts +17 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/preferred-providers.js +24 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/prompt-templates.js +18 -2
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-composer.js +3 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-matching.d.ts +6 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-matching.js +8 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/radius-mcp.d.ts +13 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/radius-mcp.js +29 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/remote-catalog-provider.js +2 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/runtime-credentials.d.ts +8 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/runtime-credentials.js +15 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-defaults.d.ts +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-defaults.js +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.js +35 -5
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit-diff.d.ts +23 -14
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit-diff.js +182 -41
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.js +8 -7
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/find.js +82 -36
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/grep.d.ts +5 -3
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/grep.js +87 -75
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/ls.js +2 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/powershell.js +15 -2
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.d.ts +8 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js +141 -25
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/truncate.d.ts +4 -14
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/truncate.js +23 -29
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/execute.js +4 -4
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/tool.js +34 -12
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/extensions/llama/client.d.ts +2 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/extensions/llama/client.js +23 -2
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/extensions/llama/ui.js +15 -3
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/cli.d.ts +2 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/cli.js +49 -14
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/config.js +4 -7
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/index.js +4 -3
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/oauth.d.ts +11 -49
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/oauth.js +56 -319
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/resources.d.ts +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/resources.js +4 -3
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/runtime.d.ts +4 -3
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/runtime.js +7 -5
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/tools.d.ts +2 -23
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/tools.js +6 -58
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/extensions/tool-search/tool.js +18 -6
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/index.d.ts +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/main.js +46 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.d.ts +5 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.js +12 -4
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.d.ts +5 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.js +12 -4
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-message.d.ts +5 -2
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-message.js +10 -3
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/diff.js +11 -5
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/extension-selector.js +9 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/login-dialog.js +1 -18
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/mermaid.d.ts +2 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/mermaid.js +25 -20
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/model-selector.js +14 -6
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/oauth-selector.d.ts +10 -3
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/oauth-selector.js +32 -5
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/provider-brand.d.ts +14 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/provider-brand.js +66 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/radius-login-selector.d.ts +1 -2
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/radius-login-selector.js +6 -37
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.d.ts +5 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.js +12 -4
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/tree-selector.d.ts +1 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/tree-selector.js +19 -10
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +11 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js +110 -63
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.js +4 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/print-mode.js +19 -10
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.js +53 -23
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js +39 -8
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/utils/changelog.d.ts +2 -2
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/utils/changelog.js +12 -6
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize.js +3 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/utils/terminal-question.d.ts +8 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/utils/terminal-question.js +24 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/utils/web-url.d.ts +12 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/utils/web-url.js +20 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/docs/cli.md +14 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/docs/extensions.md +27 -7
- package/out/node_modules/@earendil-works/pi-coding-agent/docs/keybindings.md +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/docs/llama-cpp.md +4 -7
- package/out/node_modules/@earendil-works/pi-coding-agent/docs/models-configuration.md +6 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/docs/models.md +2 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/docs/prompt-templates.md +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/docs/providers.md +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/docs/rpc.md +4 -2
- package/out/node_modules/@earendil-works/pi-coding-agent/docs/settings.md +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/docs/tui.md +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/out/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/examples/extensions/gondolin/package-lock.json +2 -2
- package/out/node_modules/@earendil-works/pi-coding-agent/examples/extensions/gondolin/package.json +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/examples/extensions/plan-mode/index.ts +23 -13
- package/out/node_modules/@earendil-works/pi-coding-agent/examples/extensions/plan-mode/utils.ts +42 -16
- package/out/node_modules/@earendil-works/pi-coding-agent/examples/extensions/subagent/README.md +14 -11
- package/out/node_modules/@earendil-works/pi-coding-agent/examples/extensions/subagent/index.ts +392 -171
- package/out/node_modules/@earendil-works/pi-coding-agent/examples/extensions/with-deps/package-lock.json +2 -2
- package/out/node_modules/@earendil-works/pi-coding-agent/examples/extensions/with-deps/package.json +1 -1
- package/out/node_modules/@earendil-works/pi-coding-agent/examples/tsconfig.json +63 -35
- package/out/node_modules/@earendil-works/pi-coding-agent/package.json +7 -7
- package/out/node_modules/@earendil-works/pi-coding-agent/schemas/models.schema.json +29 -0
- package/out/node_modules/@earendil-works/pi-coding-agent/schemas/settings.schema.json +1 -1
- package/out/phone/assets/{abnfDiagram-VCTEODGH-CLgfII9z.js → abnfDiagram-VCTEODGH-k76opPl1.js} +1 -1
- package/out/phone/assets/architecture-7GRP2DOG-DFA8x3QF.js +1 -0
- package/out/phone/assets/{architectureDiagram-5GKGNRK7-I2RDn32D.js → architectureDiagram-5GKGNRK7-yxQH9IuZ.js} +1 -1
- package/out/phone/assets/{blockDiagram-I7D4REHJ-D5xNQZkS.js → blockDiagram-I7D4REHJ-DoHteZpO.js} +1 -1
- package/out/phone/assets/{c4Diagram-7LVT6UL2-CRKpzdlA.js → c4Diagram-7LVT6UL2-DQVO6L4q.js} +1 -1
- package/out/phone/assets/channel-BBjWfdZr.js +1 -0
- package/out/phone/assets/{chunk-4HAMMTFA-CcezrqKz.js → chunk-4HAMMTFA-N9Rw4SGW.js} +1 -1
- package/out/phone/assets/{chunk-75Z2AOVW-DDCXp4y1.js → chunk-75Z2AOVW-DKJ8pOxp.js} +1 -1
- package/out/phone/assets/{chunk-DU6HZSFF-CjWveEkB.js → chunk-DU6HZSFF-BqGW8Nbd.js} +1 -1
- package/out/phone/assets/{chunk-F27PBJKO-Bgl_xI02.js → chunk-F27PBJKO-PkFmkghF.js} +1 -1
- package/out/phone/assets/{chunk-GMAD6QVW-EmL8nOme.js → chunk-GMAD6QVW-C9VeD3Jk.js} +1 -1
- package/out/phone/assets/{chunk-GVQU2GXP-Dox_nphF.js → chunk-GVQU2GXP-COhntOeE.js} +1 -1
- package/out/phone/assets/{chunk-IMKFNOWR-BapGpI4S.js → chunk-IMKFNOWR-B87ghLVD.js} +1 -1
- package/out/phone/assets/{chunk-L3NEJ4N5-Cq_UZI8A.js → chunk-L3NEJ4N5-C3N2izjg.js} +1 -1
- package/out/phone/assets/{chunk-OSK3NFVY-2VVlErAd.js → chunk-OSK3NFVY-DaAlvVhz.js} +1 -1
- package/out/phone/assets/{chunk-P2QGCYS3-Cci-G-p1.js → chunk-P2QGCYS3-BQpKr8IZ.js} +1 -1
- package/out/phone/assets/{chunk-POPQ4Y6H-CJ47EOfE.js → chunk-POPQ4Y6H-B2TZMY6U.js} +1 -1
- package/out/phone/assets/{chunk-PWAF6VOD-D9dLdFqC.js → chunk-PWAF6VOD-CgRhpUJy.js} +1 -1
- package/out/phone/assets/{chunk-SHT3W25Y-BlGSiWZn.js → chunk-SHT3W25Y-BySMFA99.js} +1 -1
- package/out/phone/assets/{chunk-SVP7TREG-C0zdsa_A.js → chunk-SVP7TREG-EDGanDUX.js} +1 -1
- package/out/phone/assets/{chunk-TICWLB2K-DAQW8nQU.js → chunk-TICWLB2K-BtCZ8R2k.js} +1 -1
- package/out/phone/assets/classDiagram-ZZMXUADV-CXXjdIIU.js +1 -0
- package/out/phone/assets/classDiagram-v2-VYDZK3BY-CXXjdIIU.js +1 -0
- package/out/phone/assets/{cynefin-OW5HDTMX-_zsx5mdV.js → cynefin-OW5HDTMX-CdZmp44V.js} +1 -1
- package/out/phone/assets/{cynefinDiagram-5FMLGOSQ-Cww-w0ex.js → cynefinDiagram-5FMLGOSQ-BCz9KwUb.js} +1 -1
- package/out/phone/assets/{dagre-GXQ25YYZ-C0i7DPqX.js → dagre-GXQ25YYZ-CgFeNgh6.js} +1 -1
- package/out/phone/assets/desk-C_b7mE6l.js +2 -0
- package/out/phone/assets/{diagram-S7CK7UJ4-Bx-G5hYz.js → diagram-S7CK7UJ4-CwvaZIBf.js} +1 -1
- package/out/phone/assets/{diagram-UQ7AKVKN-DaTblkjV.js → diagram-UQ7AKVKN-DqnD4XoZ.js} +1 -1
- package/out/phone/assets/{diagram-VSXAHHWV-gmN2e1b4.js → diagram-VSXAHHWV-Kqc9GudQ.js} +1 -1
- package/out/phone/assets/{diagram-VX7I27RA-WYtRtOo8.js → diagram-VX7I27RA-B_0DLDQ0.js} +1 -1
- package/out/phone/assets/{diagram-Z3DM3KII-Cr6uUB5B.js → diagram-Z3DM3KII-CppKBEPW.js} +1 -1
- package/out/phone/assets/{ebnfDiagram-PWID7BFC-BCicfvpA.js → ebnfDiagram-PWID7BFC-DeYPNCu9.js} +1 -1
- package/out/phone/assets/{erDiagram-RLTQ6QDP-B3QlJvfQ.js → erDiagram-RLTQ6QDP-MsfxDUmk.js} +1 -1
- package/out/phone/assets/eventmodeling-NTZA5JFV-D4a6gbOs.js +1 -0
- package/out/phone/assets/flowDiagram-HODETNUW-BBTtB5oX.js +1 -0
- package/out/phone/assets/{ganttDiagram-EL5Y4UJY-LYy2mfCh.js → ganttDiagram-EL5Y4UJY-DaScS1os.js} +1 -1
- package/out/phone/assets/{gitGraph-4MIJSDKK-dT22Z2jG.js → gitGraph-4MIJSDKK-C-FzqpZm.js} +1 -1
- package/out/phone/assets/{gitGraphDiagram-WWUBYQGX-DHNdY57l.js → gitGraphDiagram-WWUBYQGX-4Yv-hAwf.js} +1 -1
- package/out/phone/assets/{info-A6RAGUB7-nIu8NSOs.js → info-A6RAGUB7-CGLEP4t7.js} +1 -1
- package/out/phone/assets/{infoDiagram-27XIBGKW-DGkWZIMT.js → infoDiagram-27XIBGKW-DapEgYQa.js} +1 -1
- package/out/phone/assets/{ishikawaDiagram-5VMMS53U-C8EPXru-.js → ishikawaDiagram-5VMMS53U-D1B2lZSG.js} +1 -1
- package/out/phone/assets/{journeyDiagram-3NMN7TZE-Dyd9L3l3.js → journeyDiagram-3NMN7TZE-BSAtMVJw.js} +1 -1
- package/out/phone/assets/{kanban-definition-UXKFOSKX-DehTYcsL.js → kanban-definition-UXKFOSKX-CfZ4oI7A.js} +1 -1
- package/out/phone/assets/{line-Db4SulF4.js → line-DAXmUM4p.js} +1 -1
- package/out/phone/assets/main-B0yD1pMI.js +1643 -0
- package/out/phone/assets/main-DNRbLxEx.css +1 -0
- package/out/phone/assets/{mermaid-parser.core-D7h_8WV8.js → mermaid-parser.core-IObm7oM0.js} +3 -3
- package/out/phone/assets/{mermaid.core-Dw_E5kj4.js → mermaid.core-C1wA-mhD.js} +4 -4
- package/out/phone/assets/{mindmap-definition-YA3MSWOX-_5Mxqxsy.js → mindmap-definition-YA3MSWOX-3ph0EaB9.js} +1 -1
- package/out/phone/assets/{packet-AYTQ26CC-_cgeMDdN.js → packet-AYTQ26CC-BbDAe9Au.js} +1 -1
- package/out/phone/assets/{pegDiagram-XKGWAZYB-BhBwaNEr.js → pegDiagram-XKGWAZYB-EsuDcX_3.js} +1 -1
- package/out/phone/assets/{pie-WAS4IAKB-BepY80_0.js → pie-WAS4IAKB-BQfIj1fu.js} +1 -1
- package/out/phone/assets/{pieDiagram-E7YTZNPT-CQQgqmI8.js → pieDiagram-E7YTZNPT-Cw19z5Ip.js} +1 -1
- package/out/phone/assets/{quadrantDiagram-AXDQQJYC-DEEatC1J.js → quadrantDiagram-AXDQQJYC-Bqwz_sa8.js} +1 -1
- package/out/phone/assets/{radar-RG4KPBEZ-BqsiI_qQ.js → radar-RG4KPBEZ-Dmp-89iD.js} +1 -1
- package/out/phone/assets/{railroad-74A4TZTK-C_2pEUjD.js → railroad-74A4TZTK-dq2H8w8Y.js} +1 -1
- package/out/phone/assets/railroad-abnf-HS5TGJTU-DddVaVQM.js +1 -0
- package/out/phone/assets/railroad-ebnf-LZEXJU2U-BjvyqMjh.js +1 -0
- package/out/phone/assets/railroad-peg-WCYAUIDC-lBl4CV1_.js +1 -0
- package/out/phone/assets/{railroadDiagram-O6MQD6OU-B7786u7W.js → railroadDiagram-O6MQD6OU-D2Sbc7Wn.js} +1 -1
- package/out/phone/assets/{requirementDiagram-BXWQKSXE-Ci3b5uwm.js → requirementDiagram-BXWQKSXE-CLNUqxbl.js} +1 -1
- package/out/phone/assets/{sankeyDiagram-P5KCCOFB-PwT2gJjH.js → sankeyDiagram-P5KCCOFB-Dme5iwcw.js} +1 -1
- package/out/phone/assets/{sequenceDiagram-WJ2MYXX4-H6sgB5RI.js → sequenceDiagram-WJ2MYXX4-C5dYSwPE.js} +1 -1
- package/out/phone/assets/{stateDiagram-D77RDMKH-BxyRe7OB.js → stateDiagram-D77RDMKH-BuxkPvJ6.js} +1 -1
- package/out/phone/assets/stateDiagram-v2-MP3YSRHH-Exd8xDBD.js +1 -0
- package/out/phone/assets/storage-p-WxHA1h.js +1 -0
- package/out/phone/assets/{swimlanes-42K2YHIH-DWT3f1Hk.js → swimlanes-42K2YHIH-DHyXnytv.js} +1 -1
- package/out/phone/assets/swimlanesDiagram-VR7AAH4N-B62_42fO.js +8 -0
- package/out/phone/assets/{timeline-definition-24CTP7MA-D67esSVY.js → timeline-definition-24CTP7MA-Bm8Z0u2Z.js} +1 -1
- package/out/phone/assets/{treeView-Q6P3EWNA-BTIfu3Qr.js → treeView-Q6P3EWNA-DFUxvDDO.js} +1 -1
- package/out/phone/assets/{treemap-WGGIJYW6-DkPf6LQc.js → treemap-WGGIJYW6-CMC-hwzt.js} +1 -1
- package/out/phone/assets/{vennDiagram-4TSXK5OY-DRMRxJ4f.js → vennDiagram-4TSXK5OY-CNL4gZsd.js} +1 -1
- package/out/phone/assets/{wardley-WFR3VGLG-hOvC_8-W.js → wardley-WFR3VGLG-CHQoq9KJ.js} +1 -1
- package/out/phone/assets/{wardleyDiagram-VM6X3IG4-a5aYRgrw.js → wardleyDiagram-VM6X3IG4-DAuBfK1O.js} +1 -1
- package/out/phone/assets/{xychartDiagram-S5SC5T6Z-DXjoRFDL.js → xychartDiagram-S5SC5T6Z-B2T9ECKd.js} +1 -1
- package/out/phone/desk.html +2 -2
- package/out/phone/index.html +3 -3
- package/out/renderer/assets/{abnfDiagram-VCTEODGH-DhskujJf.js → abnfDiagram-VCTEODGH-gdhrQbX6.js} +1 -1
- package/out/renderer/assets/{arc-BcW67t47.js → arc-D6-Q4l2d.js} +1 -1
- package/out/renderer/assets/{architectureDiagram-5GKGNRK7-D-x057Ia.js → architectureDiagram-5GKGNRK7-C4y0SbLT.js} +1 -1
- package/out/renderer/assets/{blockDiagram-I7D4REHJ-DR3sZkhW.js → blockDiagram-I7D4REHJ-DrsoSFRK.js} +1 -1
- package/out/renderer/assets/{c4Diagram-7LVT6UL2-CQ4lScWs.js → c4Diagram-7LVT6UL2-1DD8BlM8.js} +1 -1
- package/out/renderer/assets/channel-Sck-tAAK.js +1 -0
- package/out/renderer/assets/{chunk-2Q5K7J3B-CtT0yqF3.js → chunk-2Q5K7J3B-DRyc0B7g.js} +1 -1
- package/out/renderer/assets/{chunk-5VM5RSS4-DlCfddrY.js → chunk-5VM5RSS4-BJe8SghE.js} +1 -1
- package/out/renderer/assets/{chunk-F27PBJKO-BAJ5dGzo.js → chunk-F27PBJKO-BIipq4SK.js} +1 -1
- package/out/renderer/assets/{chunk-IMKFNOWR-Dlah_YbP.js → chunk-IMKFNOWR-D5Ak3Xd9.js} +1 -1
- package/out/renderer/assets/{chunk-JWPE2WC7-BiXd3nUZ.js → chunk-JWPE2WC7-BcaWCpW-.js} +1 -1
- package/out/renderer/assets/{chunk-POPQ4Y6H-Ch86i4EJ.js → chunk-POPQ4Y6H-C1TwLrrN.js} +1 -1
- package/out/renderer/assets/{chunk-SVP7TREG-z3inDV-H.js → chunk-SVP7TREG-DDOXG_t3.js} +1 -1
- package/out/renderer/assets/{chunk-TICWLB2K-B34A2AKD.js → chunk-TICWLB2K-BqT15hZi.js} +1 -1
- package/out/renderer/assets/{chunk-XXDRQBXY-Do_L0wRR.js → chunk-XXDRQBXY-D01ts6SC.js} +1 -1
- package/out/renderer/assets/classDiagram-ZZMXUADV-DnB4QNNe.js +1 -0
- package/out/renderer/assets/classDiagram-v2-VYDZK3BY-DnB4QNNe.js +1 -0
- package/out/renderer/assets/{cose-bilkent-JH36ORCC-BQraKmgl.js → cose-bilkent-JH36ORCC-C7NVrT2_.js} +1 -1
- package/out/renderer/assets/{cynefin-OW5HDTMX-BwixoR4r.js → cynefin-OW5HDTMX-2LxdFmSk.js} +1 -1
- package/out/renderer/assets/{cynefinDiagram-5FMLGOSQ-BLTBma3J.js → cynefinDiagram-5FMLGOSQ-_AN_Mulc.js} +1 -1
- package/out/renderer/assets/{cytoscape-fcose-BRpJ5tyq.js → cytoscape-fcose-COZkZZmX.js} +1 -1
- package/out/renderer/assets/{dagre-GXQ25YYZ-aWsjA_wn.js → dagre-GXQ25YYZ-BUTwlM6j.js} +1 -1
- package/out/renderer/assets/{diagram-S7CK7UJ4-Cur2zK4q.js → diagram-S7CK7UJ4-CseZZ-y2.js} +1 -1
- package/out/renderer/assets/{diagram-UQ7AKVKN-DlrY8YcD.js → diagram-UQ7AKVKN-Cb7llS-8.js} +1 -1
- package/out/renderer/assets/{diagram-VSXAHHWV-BBdjreqR.js → diagram-VSXAHHWV-CtuGqQvp.js} +1 -1
- package/out/renderer/assets/{diagram-VX7I27RA-XiWMdc8S.js → diagram-VX7I27RA-BA8eov-1.js} +1 -1
- package/out/renderer/assets/{diagram-Z3DM3KII-CBB5leat.js → diagram-Z3DM3KII-VZOjj6Hg.js} +1 -1
- package/out/renderer/assets/{ebnfDiagram-PWID7BFC-nl8RPo8j.js → ebnfDiagram-PWID7BFC-YBIrle6d.js} +1 -1
- package/out/renderer/assets/{erDiagram-RLTQ6QDP-C_oaG80x.js → erDiagram-RLTQ6QDP-BiKyPEqW.js} +1 -1
- package/out/renderer/assets/{flowDiagram-HODETNUW-nDoVZFS7.js → flowDiagram-HODETNUW-7wmZyLHw.js} +1 -1
- package/out/renderer/assets/{ganttDiagram-EL5Y4UJY-DOrcuM3Q.js → ganttDiagram-EL5Y4UJY-D4j4GJaT.js} +1 -1
- package/out/renderer/assets/{gitGraphDiagram-WWUBYQGX-D_DB3jro.js → gitGraphDiagram-WWUBYQGX-BqveM1NI.js} +1 -1
- package/out/renderer/assets/globals-C9M_MZZV.js +2539 -0
- package/out/renderer/assets/globals-l3kDGoYH.css +1 -0
- package/out/renderer/assets/index-BzSTiwH2.js +117 -0
- package/out/renderer/assets/{infoDiagram-27XIBGKW-BbBrANxo.js → infoDiagram-27XIBGKW-DLPLnIFP.js} +1 -1
- package/out/renderer/assets/{ishikawaDiagram-5VMMS53U-7UlfWlWV.js → ishikawaDiagram-5VMMS53U-48drIAMR.js} +1 -1
- package/out/renderer/assets/{journeyDiagram-3NMN7TZE-CJP9bosH.js → journeyDiagram-3NMN7TZE-vjigqUq_.js} +1 -1
- package/out/renderer/assets/{kanban-definition-UXKFOSKX-D772kW7T.js → kanban-definition-UXKFOSKX-CpsYVONZ.js} +1 -1
- package/out/renderer/assets/{layout-BzVfJEvx.js → layout-DqfoORoO.js} +1 -1
- package/out/renderer/assets/{linear-DBjhr05m.js → linear-CJzBBHcp.js} +1 -1
- package/out/renderer/assets/{mermaid.core-CJpNSowm.js → mermaid.core-DdrGP-Hn.js} +5 -5
- package/out/renderer/assets/{mindmap-definition-YA3MSWOX-C2oqlH5E.js → mindmap-definition-YA3MSWOX-D68tLNxp.js} +1 -1
- package/out/renderer/assets/{pegDiagram-XKGWAZYB-CcZ8Hae-.js → pegDiagram-XKGWAZYB-DkgLTcrv.js} +1 -1
- package/out/renderer/assets/{pieDiagram-E7YTZNPT-DTw-_k2D.js → pieDiagram-E7YTZNPT-bz5NuX1w.js} +1 -1
- package/out/renderer/assets/{quadrantDiagram-AXDQQJYC-D5eX0DO7.js → quadrantDiagram-AXDQQJYC-o_VKLyJA.js} +1 -1
- package/out/renderer/assets/{railroadDiagram-O6MQD6OU-DzpBB_Re.js → railroadDiagram-O6MQD6OU-Dkf03e07.js} +1 -1
- package/out/renderer/assets/{requirementDiagram-BXWQKSXE-UbOUXLgl.js → requirementDiagram-BXWQKSXE-CBUz_3YU.js} +1 -1
- package/out/renderer/assets/{sankeyDiagram-P5KCCOFB-jRbXLLsa.js → sankeyDiagram-P5KCCOFB-B0pjUr9g.js} +1 -1
- package/out/renderer/assets/{sequenceDiagram-WJ2MYXX4-s0WBQQPf.js → sequenceDiagram-WJ2MYXX4-ClugIL0e.js} +1 -1
- package/out/renderer/assets/settings-DvhrDn2q.js +34 -0
- package/out/renderer/assets/{sizeCapture-INFHLROL-DvUs5rDx.js → sizeCapture-INFHLROL-D6y0rctc.js} +1 -1
- package/out/renderer/assets/{stateDiagram-D77RDMKH-C1_V497y.js → stateDiagram-D77RDMKH-DiftQepS.js} +1 -1
- package/out/renderer/assets/stateDiagram-v2-MP3YSRHH-DxB2-9tl.js +1 -0
- package/out/renderer/assets/{swimlanes-42K2YHIH-BulPeZ6y.js → swimlanes-42K2YHIH-DhuTjCNj.js} +1 -1
- package/out/renderer/assets/swimlanesDiagram-VR7AAH4N-CYDUqExO.js +8 -0
- package/out/renderer/assets/{timeline-definition-24CTP7MA-gQ5OygZn.js → timeline-definition-24CTP7MA-CrXqgptd.js} +1 -1
- package/out/renderer/assets/{vennDiagram-4TSXK5OY-A8QyA5Ix.js → vennDiagram-4TSXK5OY-CDm8SO8U.js} +1 -1
- package/out/renderer/assets/{wardleyDiagram-VM6X3IG4-CfP6E41T.js → wardleyDiagram-VM6X3IG4-CxyunHwQ.js} +1 -1
- package/out/renderer/assets/{xychartDiagram-S5SC5T6Z-DTG5UHh7.js → xychartDiagram-S5SC5T6Z-CvC5YMSy.js} +1 -1
- package/out/renderer/index.html +3 -3
- package/out/renderer/plugin-view.html +39 -0
- package/out/renderer/settings.html +4 -4
- package/out/renderer/web-preload.js +1 -1
- package/out/server/agent.js +2022 -860
- package/out/server/chunks/{agent-BhQn6jGA.js → agent-_G_O-Cpa.js} +359 -227
- package/out/server/chunks/{gpuBackendInstall-CdExgjGi.js → gpuBackendInstall-Cb6TFh_8.js} +11 -9
- package/out/server/chunks/{loadProvider-BnkyjMSW.js → loadProvider-Be9Lu1Oi.js} +7 -20
- package/out/server/chunks/{manifest-2odvnxjZ.js → manifest-CB63GQ-i.js} +129 -6
- package/out/server/chunks/{workflowPresets-DqSsjOj6.js → workflowPresets-Djlp5LPV.js} +4004 -2054
- package/out/server/index.js +8251 -6660
- package/out/server/plugin-host.js +36 -26
- package/package.json +10 -10
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/anthropic-messages-BWGCKOF4.js +0 -6
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-44DLKSKE.js +0 -1234
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-62VOPMLK.js +0 -65
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-7O7QKK6A.js +0 -2
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-CHWNPHIS.js +0 -82
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-NL4X6LBY.js +0 -4
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-NZY7EIPA.js +0 -4
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-R2EGYMOO.js +0 -7
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-UKVNB6C4.js +0 -2
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-USJZMAIR.js +0 -2
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-VOLAXWGI.js +0 -2
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openai-codex-responses-QAWLOQSN.js +0 -10
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openai-responses-MD3562FB.js +0 -4
- package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/virtual-modules-O76XM3OB.js +0 -2
- package/out/phone/assets/architecture-7GRP2DOG-CQOPTv6S.js +0 -1
- package/out/phone/assets/channel-DdXebl9x.js +0 -1
- package/out/phone/assets/classDiagram-ZZMXUADV-BCctWEp1.js +0 -1
- package/out/phone/assets/classDiagram-v2-VYDZK3BY-BCctWEp1.js +0 -1
- package/out/phone/assets/desk-mfuEW2n4.js +0 -2
- package/out/phone/assets/eventmodeling-NTZA5JFV-BtfapP6M.js +0 -1
- package/out/phone/assets/flowDiagram-HODETNUW-BsyiyBtD.js +0 -1
- package/out/phone/assets/main-Dv9ve8mT.css +0 -1
- package/out/phone/assets/main-uMMbioCA.js +0 -1638
- package/out/phone/assets/railroad-abnf-HS5TGJTU-TmODpceI.js +0 -1
- package/out/phone/assets/railroad-ebnf-LZEXJU2U-BTCjNR9u.js +0 -1
- package/out/phone/assets/railroad-peg-WCYAUIDC-DjhKNo8j.js +0 -1
- package/out/phone/assets/stateDiagram-v2-MP3YSRHH-Cncmf_cL.js +0 -1
- package/out/phone/assets/storage-D9RW_4__.js +0 -1
- package/out/phone/assets/swimlanesDiagram-VR7AAH4N-DAahG4fH.js +0 -8
- package/out/renderer/assets/channel-CudRig7z.js +0 -1
- package/out/renderer/assets/classDiagram-ZZMXUADV-DL20WkD0.js +0 -1
- package/out/renderer/assets/classDiagram-v2-VYDZK3BY-DL20WkD0.js +0 -1
- package/out/renderer/assets/globals-Bkw7iiQG.css +0 -1
- package/out/renderer/assets/globals-D1ocHHQV.js +0 -2533
- package/out/renderer/assets/index-Cm5iq85v.js +0 -117
- package/out/renderer/assets/settings-DxYo7s4h.js +0 -34
- package/out/renderer/assets/stateDiagram-v2-MP3YSRHH-C9dfLXR8.js +0 -1
- package/out/renderer/assets/swimlanesDiagram-VR7AAH4N-LXwy6qGO.js +0 -8
|
@@ -9,12 +9,11 @@
|
|
|
9
9
|
* the tool's `structuredContent`, and every MCP tool declares a `CallToolResult` output schema. MCP
|
|
10
10
|
* errors (`isError`) are error results for the model, but scripts still resolve to the result.
|
|
11
11
|
*/
|
|
12
|
-
import {
|
|
13
|
-
import { toLlmContent, } from "@earendil-works/pi-mcp";
|
|
12
|
+
import { limitMcpContent, normalizeMcpInputSchema, toLlmContent, } from "@earendil-works/pi-mcp";
|
|
14
13
|
import { Container, Spacer, Text } from "@earendil-works/pi-tui";
|
|
15
14
|
import { READ_MCP_RESOURCE_TOOL } from "../../core/mcp-servers.js";
|
|
16
15
|
import { formatToolCallWithArgs, getTextOutput, replaceTabs } from "../../core/tools/render-utils.js";
|
|
17
|
-
import { formatSize
|
|
16
|
+
import { formatSize } from "../../core/tools/truncate.js";
|
|
18
17
|
import { keyHint } from "../../modes/interactive/components/keybinding-hints.js";
|
|
19
18
|
import { VisualLinePreview } from "../../modes/interactive/components/visual-truncate.js";
|
|
20
19
|
import { writeOutputFile } from "../../utils/output-files.js";
|
|
@@ -25,30 +24,14 @@ import { writeOutputFile } from "../../utils/output-files.js";
|
|
|
25
24
|
export function toToolExposure(exposure) {
|
|
26
25
|
return exposure === "codemode" ? "deferred" : exposure;
|
|
27
26
|
}
|
|
28
|
-
/** Provider tool names are limited to 64 characters of `[A-Za-z0-9_-]`. */
|
|
29
|
-
const MAX_TOOL_NAME_LENGTH = 64;
|
|
30
|
-
/** Model-facing text of an MCP result beyond this is cut in the middle. */
|
|
31
|
-
export const MCP_OUTPUT_MAX_BYTES = 20 * 1024;
|
|
32
27
|
/** Visual (wrapped) result lines shown before the output is expanded. */
|
|
33
28
|
const OUTPUT_PREVIEW_LINES = 5;
|
|
34
29
|
/** Tool that reads the resources named by resource links. */
|
|
35
30
|
export { READ_MCP_RESOURCE_TOOL };
|
|
31
|
+
/** Saves the full text of a truncated result, or a binary resource, to a temp file and returns its path. */
|
|
36
32
|
export function saveToTempFile(data, extension) {
|
|
37
33
|
return writeOutputFile("pi-mcp", extension, data);
|
|
38
34
|
}
|
|
39
|
-
/**
|
|
40
|
-
* `mcp__<server>__<tool>`, sanitized and shortened with a hash suffix when too long. Like Codex,
|
|
41
|
-
* everything but `[A-Za-z0-9_]` becomes `_`, so the name is also the identifier codemode scripts
|
|
42
|
-
* call it by. `isTaken` reports names used by a different MCP tool: sanitizing can map two tools to
|
|
43
|
-
* one name (`a-b` and `a_b`), which then get the hash suffix.
|
|
44
|
-
*/
|
|
45
|
-
export function createMcpToolName(server, tool, isTaken = () => false) {
|
|
46
|
-
const name = `mcp__${server}__${tool}`.replace(/[^A-Za-z0-9_]/g, "_");
|
|
47
|
-
if (name.length <= MAX_TOOL_NAME_LENGTH && !isTaken(name))
|
|
48
|
-
return name;
|
|
49
|
-
const hash = createHash("sha256").update(`${server}\0${tool}`).digest("hex").slice(0, 8);
|
|
50
|
-
return `${name.slice(0, MAX_TOOL_NAME_LENGTH - hash.length - 1)}_${hash}`;
|
|
51
|
-
}
|
|
52
35
|
function textOf(content) {
|
|
53
36
|
return content
|
|
54
37
|
.filter((block) => block.type === "text")
|
|
@@ -128,31 +111,6 @@ export function createMcpResultSchema(structuredContentSchema) {
|
|
|
128
111
|
additionalProperties: true,
|
|
129
112
|
};
|
|
130
113
|
}
|
|
131
|
-
/**
|
|
132
|
-
* Keep model-facing text within {@link MCP_OUTPUT_MAX_BYTES}. Longer text becomes one text block in
|
|
133
|
-
* Codex's truncation format, followed by the path of the file with the full text; images follow it.
|
|
134
|
-
*/
|
|
135
|
-
export async function limitMcpContent(content, saveOutput = saveToTempFile) {
|
|
136
|
-
const combined = textOf(content);
|
|
137
|
-
const truncation = truncateMiddle(combined, MCP_OUTPUT_MAX_BYTES);
|
|
138
|
-
if (!truncation.truncated)
|
|
139
|
-
return { content };
|
|
140
|
-
let fullOutputPath;
|
|
141
|
-
let where;
|
|
142
|
-
try {
|
|
143
|
-
fullOutputPath = await saveOutput(combined, ".txt");
|
|
144
|
-
where = `[Full output: ${fullOutputPath} (read it with offset/limit)]`;
|
|
145
|
-
}
|
|
146
|
-
catch (error) {
|
|
147
|
-
where = `[Could not save the full output: ${error instanceof Error ? error.message : String(error)}]`;
|
|
148
|
-
}
|
|
149
|
-
const tokens = Math.ceil(truncation.totalBytes / 4);
|
|
150
|
-
const text = `Warning: truncated output (original token count: ${tokens})\nTotal output lines: ${truncation.totalLines}\n\n${truncation.content}\n\n${where}`;
|
|
151
|
-
return {
|
|
152
|
-
content: [{ type: "text", text }, ...content.filter((block) => block.type === "image")],
|
|
153
|
-
...(fullOutputPath ? { fullOutputPath } : {}),
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
114
|
/** File extension for a saved binary resource: the one its URI ends in, else `.bin`. */
|
|
157
115
|
function extensionOf(uri) {
|
|
158
116
|
const path = URL.canParse(uri) ? new URL(uri).pathname : uri;
|
|
@@ -206,7 +164,7 @@ export async function convertMcpResult(server, tool, result, options = {}) {
|
|
|
206
164
|
if (result.isError && textOf(converted) === "") {
|
|
207
165
|
converted.push({ type: "text", text: `MCP tool ${server}/${tool} returned an error` });
|
|
208
166
|
}
|
|
209
|
-
const { content, fullOutputPath } = await limitMcpContent(converted, options.saveOutput);
|
|
167
|
+
const { content, fullOutputPath } = await limitMcpContent(converted, options.saveOutput ?? saveToTempFile);
|
|
210
168
|
const { _meta: _ignored, ...scriptResult } = result;
|
|
211
169
|
return {
|
|
212
170
|
content,
|
|
@@ -215,17 +173,6 @@ export async function convertMcpResult(server, tool, result, options = {}) {
|
|
|
215
173
|
...(result.isError ? { isError: true } : {}),
|
|
216
174
|
};
|
|
217
175
|
}
|
|
218
|
-
/**
|
|
219
|
-
* Tool input schemas must be objects. MCP servers may omit `type`, and some providers reject object
|
|
220
|
-
* schemas without `properties`.
|
|
221
|
-
*/
|
|
222
|
-
function toParameters(schema) {
|
|
223
|
-
return {
|
|
224
|
-
...schema,
|
|
225
|
-
type: schema.type ?? "object",
|
|
226
|
-
...(schema.properties === undefined ? { properties: {} } : {}),
|
|
227
|
-
};
|
|
228
|
-
}
|
|
229
176
|
const ANNOTATION_HINTS = ["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"];
|
|
230
177
|
/** The boolean hints of an MCP tool's annotations, or undefined when it has none. */
|
|
231
178
|
function toToolAnnotations(tool) {
|
|
@@ -246,7 +193,8 @@ export function createMcpToolDefinition(options) {
|
|
|
246
193
|
name: options.name,
|
|
247
194
|
label,
|
|
248
195
|
description: tool.description?.trim() || title || `MCP tool ${tool.name} from server ${server}`,
|
|
249
|
-
|
|
196
|
+
// An object schema, which is what TypeBox schemas are at runtime.
|
|
197
|
+
parameters: normalizeMcpInputSchema(tool.inputSchema),
|
|
250
198
|
outputSchema: createMcpResultSchema(tool.outputSchema),
|
|
251
199
|
exposure: toToolExposure(options.exposure),
|
|
252
200
|
namespace: options.namespace,
|
package/out/node_modules/@earendil-works/pi-coding-agent/dist/extensions/tool-search/tool.js
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* next model call. Loading goes through the active tool set, so it is recorded in the transcript
|
|
8
8
|
* like any other tool change and survives `/tree`, resume, and fork on that branch.
|
|
9
9
|
*/
|
|
10
|
+
import { resolveSchemaRef } from "@earendil-works/pi-codemode/declarations";
|
|
10
11
|
import { Type } from "typebox";
|
|
11
12
|
export const TOOL_SEARCH_TOOL_NAME = "tool_search";
|
|
12
13
|
export const DEFAULT_TOOL_SEARCH_LIMIT = 8;
|
|
@@ -64,24 +65,35 @@ export function tokenize(text) {
|
|
|
64
65
|
function isObject(value) {
|
|
65
66
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
66
67
|
}
|
|
67
|
-
/**
|
|
68
|
-
|
|
68
|
+
/**
|
|
69
|
+
* Schema descriptions and property names, recursively, following local `$ref`s into `root`. `seen` holds the
|
|
70
|
+
* subschemas already reached through a reference, so recursive and shared definitions are read once, and
|
|
71
|
+
* definitions no property references are not read.
|
|
72
|
+
*/
|
|
73
|
+
function schemaText(schema, root, parts, seen) {
|
|
69
74
|
if (!isObject(schema))
|
|
70
75
|
return;
|
|
76
|
+
if (typeof schema.$ref === "string") {
|
|
77
|
+
const target = resolveSchemaRef(schema.$ref, root);
|
|
78
|
+
if (isObject(target) && !seen.has(target)) {
|
|
79
|
+
seen.add(target);
|
|
80
|
+
schemaText(target, root, parts, seen);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
71
83
|
if (typeof schema.description === "string")
|
|
72
84
|
parts.push(schema.description);
|
|
73
85
|
if (isObject(schema.properties)) {
|
|
74
86
|
for (const [name, property] of Object.entries(schema.properties)) {
|
|
75
87
|
parts.push(name);
|
|
76
|
-
schemaText(property, parts);
|
|
88
|
+
schemaText(property, root, parts, seen);
|
|
77
89
|
}
|
|
78
90
|
}
|
|
79
|
-
schemaText(schema.items, parts);
|
|
91
|
+
schemaText(schema.items, root, parts, seen);
|
|
80
92
|
for (const key of ["anyOf", "oneOf", "allOf"]) {
|
|
81
93
|
const variants = schema[key];
|
|
82
94
|
if (Array.isArray(variants))
|
|
83
95
|
for (const variant of variants)
|
|
84
|
-
schemaText(variant, parts);
|
|
96
|
+
schemaText(variant, root, parts, seen);
|
|
85
97
|
}
|
|
86
98
|
}
|
|
87
99
|
/**
|
|
@@ -90,7 +102,7 @@ function schemaText(schema, parts) {
|
|
|
90
102
|
*/
|
|
91
103
|
export function createToolSearchDocument(tool, namespace) {
|
|
92
104
|
const parts = [tool.description];
|
|
93
|
-
schemaText(tool.parameters, parts);
|
|
105
|
+
schemaText(tool.parameters, tool.parameters, parts, new Set([tool.parameters]));
|
|
94
106
|
const namespaceText = namespace
|
|
95
107
|
? [namespace.name, namespace.description ?? "", namespace.instructions ?? ""].join(" ")
|
|
96
108
|
: "";
|
|
@@ -5,7 +5,7 @@ export { readStoredCredential } from "./core/auth-storage.ts";
|
|
|
5
5
|
export type { CacheWarmingDecision, CacheWarmingStatus } from "./core/cache-warmer.ts";
|
|
6
6
|
export { type BranchPreparation, type BranchSummaryResult, type CollectEntriesResult, type CompactionResult, type CutPointResult, calculateContextTokens, collectEntriesForBranchSummary, compact, DEFAULT_COMPACTION_SETTINGS, estimateTokens, type FileOperations, findCutPoint, findTurnStartIndex, type GenerateBranchSummaryOptions, generateBranchSummary, generateSummary, generateSummaryWithUsage, getLastAssistantUsage, prepareBranchEntries, serializeConversation, shouldCompact, } from "./core/compaction/index.ts";
|
|
7
7
|
export { createEventBus, type EventBus, type EventBusController } from "./core/event-bus.ts";
|
|
8
|
-
export type { AfterProviderResponseEvent, AgentActivityOutcome, AgentBeforeSettleEvent, AgentBeforeSettleEventResult, AgentEndEvent, AgentSettledEvent, AgentStartEvent, AgentToolResult, AgentToolUpdateCallback, AppKeybinding, AutocompleteProviderFactory, BashToolCallEvent, BeforeAgentStartCustomEvent, BeforeAgentStartEvent, BeforeAgentStartEventResult, BeforeAgentStartUserEvent, BeforeProviderHeadersEvent, BeforeProviderRequestEvent, BeforeProviderRequestEventResult, BoundaryContextPreview, BoundaryResult, BoundaryState, BuildSystemPromptOptions, CacheWarmingDecisionEvent, CacheWarmingDecisionEventResult, CompactionEntryDraft, CompactOptions, ContextEditEntryDraft, ContextEvent, ContextEventResult, ContextUsage, ContextWithSystemEvent, CustomEntryDraft, CustomMessageEntryDraft, CustomToolCallEvent, EditToolCallEvent, EntryRenderer, EntryRenderOptions, ExecOptions, ExecResult, ExecuteToolOptions, Extension, ExtensionActions, ExtensionAPI, ExtensionCommandContext, ExtensionCommandContextActions, ExtensionContext, ExtensionContextActions, ExtensionError, ExtensionEvent, ExtensionFactory, ExtensionFlag, ExtensionHandler, ExtensionRuntime, ExtensionShortcut, ExtensionToolContext, ExtensionUIContext, ExtensionUIDialogOptions, ExtensionVirtualModel, ExtensionWidgetOptions, FindToolCallEvent, GrepToolCallEvent, InlineExtension, InputEvent, InputEventResult, InputSource, KeybindingHints, KeybindingsManager, LoadExtensionsResult, LsToolCallEvent, MarkdownTransformContext, MarkdownTransformer, McpServersChangeEvent, MessageEndEvent, MessageEndEventResult, MessageRenderer, MessageRenderOptions, MessageStartEvent, MessageUpdateEvent, ModelSelectEvent, ModelSelectSource, NormalizedBuildSystemPromptOptions, PowerShellToolCallEvent, ProjectTrustContext, ProjectTrustEvent, ProjectTrustEventDecision, ProjectTrustEventResult, ProjectTrustHandler, ProviderConfig, ProviderModelConfig, ProviderStreamEvent, ReadToolCallEvent, RegisteredCommand, RegisteredTool, ResolvedCommand, ResourcesDiscoverEvent, ResourcesDiscoverResult, SessionBeforeCompactEvent, SessionBeforeCompactResult, SessionBeforeForkEvent, SessionBeforeForkResult, SessionBeforeSwitchEvent, SessionBeforeSwitchResult, SessionBeforeTreeEvent, SessionBeforeTreeResult, SessionBoundaryDraft, SessionCompactEvent, SessionCompactFailedEvent, SessionInfoChangedEvent, SessionShutdownEvent, SessionStartEvent, SessionTreeEvent, SlashCommandInfo, SlashCommandSource, SourceInfo, TerminalInputHandler, ThinkingLevelSelectEvent, ToolAnnotations, ToolCallEvent, ToolCallEventResult, ToolDefinition, ToolExecutionEndEvent, ToolExecutionMode, ToolExecutionStartEvent, ToolExecutionUpdateEvent, ToolExposure, ToolInfo, ToolLoadout, ToolLoadoutChanges, ToolNamespace, ToolRendererResolver, ToolRenderers, ToolRenderResultOptions, ToolResultEvent, ToolResultEventResult, TurnEndEvent, TurnEndEventResult, TurnStartEvent, UIPromptEndEvent, UIPromptKind, UIPromptStartEvent, UserBashEvent, UserBashEventResult, WidgetPlacement, WorkingIndicatorOptions, WriteToolCallEvent, } from "./core/extensions/index.ts";
|
|
8
|
+
export type { AfterProviderResponseEvent, AgentActivityOutcome, AgentBeforeSettleEvent, AgentBeforeSettleEventResult, AgentEndEvent, AgentSettledEvent, AgentStartEvent, AgentToolResult, AgentToolUpdateCallback, AppKeybinding, AutocompleteProviderFactory, BashToolCallEvent, BeforeAgentStartCustomEvent, BeforeAgentStartEvent, BeforeAgentStartEventResult, BeforeAgentStartUserEvent, BeforeProviderHeadersEvent, BeforeProviderRequestEvent, BeforeProviderRequestEventResult, BoundaryContextPreview, BoundaryResult, BoundaryState, BuildSystemPromptOptions, CacheWarmingDecisionEvent, CacheWarmingDecisionEventResult, CompactionEntryDraft, CompactOptions, ContextEditEntryDraft, ContextEvent, ContextEventResult, ContextUsage, ContextWithSystemEvent, CustomEntryDraft, CustomMessageEntryDraft, CustomToolCallEvent, EditToolCallEvent, EntryRenderer, EntryRenderOptions, ExecOptions, ExecResult, ExecuteToolOptions, Extension, ExtensionActions, ExtensionAPI, ExtensionCommandContext, ExtensionCommandContextActions, ExtensionContext, ExtensionContextActions, ExtensionError, ExtensionEvent, ExtensionFactory, ExtensionFlag, ExtensionHandler, ExtensionRuntime, ExtensionShortcut, ExtensionToolContext, ExtensionUIContext, ExtensionUIDialogOptions, ExtensionVirtualModel, ExtensionWidgetOptions, FindToolCallEvent, GrepToolCallEvent, InlineExtension, InputEvent, InputEventResult, InputSource, KeybindingHints, KeybindingsManager, LoadExtensionsResult, LsToolCallEvent, MarkdownMessageType, MarkdownTransformContext, MarkdownTransformer, MarkdownTransformerOptions, MarkdownTransformerRegistration, McpServersChangeEvent, MessageEndEvent, MessageEndEventResult, MessageRenderer, MessageRenderOptions, MessageStartEvent, MessageUpdateEvent, ModelSelectEvent, ModelSelectSource, NormalizedBuildSystemPromptOptions, PowerShellToolCallEvent, ProjectTrustContext, ProjectTrustEvent, ProjectTrustEventDecision, ProjectTrustEventResult, ProjectTrustHandler, ProviderConfig, ProviderModelConfig, ProviderStreamEvent, ReadToolCallEvent, RegisteredCommand, RegisteredTool, ResolvedCommand, ResourcesDiscoverEvent, ResourcesDiscoverResult, SessionBeforeCompactEvent, SessionBeforeCompactResult, SessionBeforeForkEvent, SessionBeforeForkResult, SessionBeforeSwitchEvent, SessionBeforeSwitchResult, SessionBeforeTreeEvent, SessionBeforeTreeResult, SessionBoundaryDraft, SessionCompactEvent, SessionCompactFailedEvent, SessionInfoChangedEvent, SessionShutdownEvent, SessionStartEvent, SessionTreeEvent, SlashCommandInfo, SlashCommandSource, SourceInfo, TerminalInputHandler, ThinkingLevelSelectEvent, ToolAnnotations, ToolCallEvent, ToolCallEventResult, ToolDefinition, ToolExecutionEndEvent, ToolExecutionMode, ToolExecutionStartEvent, ToolExecutionUpdateEvent, ToolExposure, ToolInfo, ToolLoadout, ToolLoadoutChanges, ToolNamespace, ToolRendererResolver, ToolRenderers, ToolRenderResultOptions, ToolResultEvent, ToolResultEventResult, TurnEndEvent, TurnEndEventResult, TurnStartEvent, UIPromptEndEvent, UIPromptKind, UIPromptStartEvent, UserBashEvent, UserBashEventResult, WidgetPlacement, WorkingIndicatorOptions, WriteToolCallEvent, } from "./core/extensions/index.ts";
|
|
9
9
|
export { createExtensionRuntime, defineTool, discoverAndLoadExtensions, ExtensionRunner, isBashToolResult, isEditToolResult, isFindToolResult, isGrepToolResult, isLsToolResult, isPowerShellToolResult, isReadToolResult, isToolCallEventType, isWriteToolResult, wrapRegisteredTool, wrapRegisteredTools, } from "./core/extensions/index.ts";
|
|
10
10
|
export type { ReadonlyFooterDataProvider } from "./core/footer-data-provider.ts";
|
|
11
11
|
export type { RegisteredMcpServer } from "./core/mcp-servers.ts";
|
|
@@ -11,6 +11,9 @@ import chalk from "chalk";
|
|
|
11
11
|
import { normalizeSessionName, parseArgs, printHelp } from "./cli/args.js";
|
|
12
12
|
import { checkProviderAuth, createAuthCheckModelRuntime, getProviderCredential, } from "./cli/auth-check.js";
|
|
13
13
|
import { AuthCommandError, getAuthCommandName, getAuthCommandUsage, isAuthCommandHelp, parseAuthCommand, printAuthCommandHelp, validateAuthCommandArgs, } from "./cli/auth-command.js";
|
|
14
|
+
import { runAuthLogin } from "./cli/auth-login.js";
|
|
15
|
+
import { runAuthLogout } from "./cli/auth-logout.js";
|
|
16
|
+
import { createProcessLoginTerminal } from "./cli/auth-terminal.js";
|
|
14
17
|
import { resolveCredentialForPrint } from "./cli/credential-print.js";
|
|
15
18
|
import { processFileArguments } from "./cli/file-processor.js";
|
|
16
19
|
import { buildInitialMessage } from "./cli/initial-message.js";
|
|
@@ -96,11 +99,53 @@ function toPrintOutputMode(appMode) {
|
|
|
96
99
|
function isPlainRuntimeMetadataCommand(parsed) {
|
|
97
100
|
return !parsed.print && parsed.mode === undefined && (parsed.help === true || parsed.listModels !== undefined);
|
|
98
101
|
}
|
|
102
|
+
async function runAuthLoginCommand(args) {
|
|
103
|
+
const cwd = process.cwd();
|
|
104
|
+
const agentDir = getAgentDir();
|
|
105
|
+
const settingsManager = SettingsManager.create(cwd, agentDir, { projectTrusted: false });
|
|
106
|
+
applyHttpProxySettings(settingsManager.getGlobalSettings().httpProxy);
|
|
107
|
+
configureHttpDispatcher(settingsManager.getHttpIdleTimeoutMs());
|
|
108
|
+
const modelRuntime = await ModelRuntime.create({ allowModelNetwork: false, signal: AbortSignal.timeout(15_000) });
|
|
109
|
+
const controller = new AbortController();
|
|
110
|
+
const interrupt = () => controller.abort();
|
|
111
|
+
process.on("SIGINT", interrupt);
|
|
112
|
+
try {
|
|
113
|
+
return await runAuthLogin(args, {
|
|
114
|
+
modelRuntime,
|
|
115
|
+
terminal: createProcessLoginTerminal(interrupt),
|
|
116
|
+
agentDir,
|
|
117
|
+
cwd,
|
|
118
|
+
getDeviceId: () => settingsManager.getOrCreateDeviceId(),
|
|
119
|
+
signal: controller.signal,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
finally {
|
|
123
|
+
process.off("SIGINT", interrupt);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
async function runAuthLogoutCommand(args) {
|
|
127
|
+
const signal = AbortSignal.timeout(15_000);
|
|
128
|
+
const modelRuntime = await ModelRuntime.create({ allowModelNetwork: false, signal });
|
|
129
|
+
return runAuthLogout(args, {
|
|
130
|
+
modelRuntime,
|
|
131
|
+
terminal: { write: (line) => console.log(line), error: (line) => console.error(line) },
|
|
132
|
+
signal,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
99
135
|
async function runAuthCommand(args) {
|
|
100
136
|
if (isAuthCommandHelp(args)) {
|
|
101
137
|
printAuthCommandHelp();
|
|
102
138
|
return true;
|
|
103
139
|
}
|
|
140
|
+
if (args[0] === "auth" && args[1] === "login") {
|
|
141
|
+
// main() already applied --offline.
|
|
142
|
+
process.exitCode = await runAuthLoginCommand(args.slice(2).filter((arg) => arg !== "--offline"));
|
|
143
|
+
return true;
|
|
144
|
+
}
|
|
145
|
+
if (args[0] === "auth" && args[1] === "logout") {
|
|
146
|
+
process.exitCode = await runAuthLogoutCommand(args.slice(2).filter((arg) => arg !== "--offline"));
|
|
147
|
+
return true;
|
|
148
|
+
}
|
|
104
149
|
let command;
|
|
105
150
|
try {
|
|
106
151
|
command = parseAuthCommand(args);
|
|
@@ -802,6 +847,7 @@ export async function main(args, options) {
|
|
|
802
847
|
// (Kitty keyboard protocol, device attributes, cell size) before restoring the terminal.
|
|
803
848
|
await new Promise((resolve) => setTimeout(resolve, 150));
|
|
804
849
|
interactiveMode.stop();
|
|
850
|
+
await runtime.dispose();
|
|
805
851
|
stopThemeWatcher();
|
|
806
852
|
printTimings();
|
|
807
853
|
if (process.stdout.writableLength > 0) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Box, type MarkdownTheme } from "@earendil-works/pi-tui";
|
|
2
|
+
import type { MarkdownTransformer } from "../../../core/extensions/types.ts";
|
|
2
3
|
import type { BranchSummaryMessage } from "../../../core/messages.ts";
|
|
3
4
|
/**
|
|
4
5
|
* Component that renders a branch summary message with collapsed/expanded state.
|
|
@@ -8,7 +9,10 @@ export declare class BranchSummaryMessageComponent extends Box {
|
|
|
8
9
|
private expanded;
|
|
9
10
|
private message;
|
|
10
11
|
private markdownTheme;
|
|
11
|
-
|
|
12
|
+
private markdownTransformers;
|
|
13
|
+
private messageId?;
|
|
14
|
+
private timestamp?;
|
|
15
|
+
constructor(message: BranchSummaryMessage, markdownTheme?: MarkdownTheme, outputPad?: number, markdownTransformers?: readonly MarkdownTransformer[], messageId?: string, timestamp?: string);
|
|
12
16
|
setExpanded(expanded: boolean): void;
|
|
13
17
|
setOutputPad(outputPad: number): void;
|
|
14
18
|
invalidate(): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Box, Container, Markdown, MouseRegion, Spacer, Text } from "@earendil-works/pi-tui";
|
|
2
2
|
import { getMarkdownTheme, theme } from "../theme/theme.js";
|
|
3
3
|
import { keyText } from "./keybinding-hints.js";
|
|
4
|
+
import { createMarkdownTransform } from "./markdown-transform.js";
|
|
4
5
|
/**
|
|
5
6
|
* Component that renders a branch summary message with collapsed/expanded state.
|
|
6
7
|
* Uses same background color as custom messages for visual consistency.
|
|
@@ -9,10 +10,16 @@ export class BranchSummaryMessageComponent extends Box {
|
|
|
9
10
|
expanded = false;
|
|
10
11
|
message;
|
|
11
12
|
markdownTheme;
|
|
12
|
-
|
|
13
|
+
markdownTransformers;
|
|
14
|
+
messageId;
|
|
15
|
+
timestamp;
|
|
16
|
+
constructor(message, markdownTheme = getMarkdownTheme(), outputPad = 1, markdownTransformers = [], messageId, timestamp) {
|
|
13
17
|
super(outputPad, 1, (t) => theme.bg("customMessageBg", t));
|
|
14
18
|
this.message = message;
|
|
15
19
|
this.markdownTheme = markdownTheme;
|
|
20
|
+
this.markdownTransformers = markdownTransformers;
|
|
21
|
+
this.messageId = messageId;
|
|
22
|
+
this.timestamp = timestamp;
|
|
16
23
|
this.updateDisplay();
|
|
17
24
|
}
|
|
18
25
|
setExpanded(expanded) {
|
|
@@ -34,9 +41,10 @@ export class BranchSummaryMessageComponent extends Box {
|
|
|
34
41
|
content.addChild(new Spacer(1));
|
|
35
42
|
if (this.expanded) {
|
|
36
43
|
const header = "**Branch Summary**\n\n";
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
44
|
+
const transform = createMarkdownTransform("summary", () => false, this.markdownTransformers, this.messageId, this.timestamp);
|
|
45
|
+
content.addChild(new Markdown(this.message.summary, 0, 0, this.markdownTheme, { color: (text) => theme.fg("customMessageText", text) },
|
|
46
|
+
// Transformers see only the summary content, not Pi's header.
|
|
47
|
+
{ transform: (markdown, width) => header + transform(markdown, width) }));
|
|
40
48
|
}
|
|
41
49
|
else {
|
|
42
50
|
content.addChild(new Text(theme.fg("customMessageText", "Branch summary (") +
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Box, type MarkdownTheme } from "@earendil-works/pi-tui";
|
|
2
|
+
import type { MarkdownTransformer } from "../../../core/extensions/types.ts";
|
|
2
3
|
import type { CompactionSummaryMessage } from "../../../core/messages.ts";
|
|
3
4
|
/**
|
|
4
5
|
* Component that renders a compaction message with collapsed/expanded state.
|
|
@@ -8,7 +9,10 @@ export declare class CompactionSummaryMessageComponent extends Box {
|
|
|
8
9
|
private expanded;
|
|
9
10
|
private message;
|
|
10
11
|
private markdownTheme;
|
|
11
|
-
|
|
12
|
+
private markdownTransformers;
|
|
13
|
+
private messageId?;
|
|
14
|
+
private timestamp?;
|
|
15
|
+
constructor(message: CompactionSummaryMessage, markdownTheme?: MarkdownTheme, outputPad?: number, markdownTransformers?: readonly MarkdownTransformer[], messageId?: string, timestamp?: string);
|
|
12
16
|
setExpanded(expanded: boolean): void;
|
|
13
17
|
setOutputPad(outputPad: number): void;
|
|
14
18
|
invalidate(): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Box, Container, Markdown, MouseRegion, Spacer, Text } from "@earendil-works/pi-tui";
|
|
2
2
|
import { getMarkdownTheme, theme } from "../theme/theme.js";
|
|
3
3
|
import { keyText } from "./keybinding-hints.js";
|
|
4
|
+
import { createMarkdownTransform } from "./markdown-transform.js";
|
|
4
5
|
/**
|
|
5
6
|
* Component that renders a compaction message with collapsed/expanded state.
|
|
6
7
|
* Uses same background color as custom messages for visual consistency.
|
|
@@ -9,10 +10,16 @@ export class CompactionSummaryMessageComponent extends Box {
|
|
|
9
10
|
expanded = false;
|
|
10
11
|
message;
|
|
11
12
|
markdownTheme;
|
|
12
|
-
|
|
13
|
+
markdownTransformers;
|
|
14
|
+
messageId;
|
|
15
|
+
timestamp;
|
|
16
|
+
constructor(message, markdownTheme = getMarkdownTheme(), outputPad = 1, markdownTransformers = [], messageId, timestamp) {
|
|
13
17
|
super(outputPad, 1, (t) => theme.bg("customMessageBg", t));
|
|
14
18
|
this.message = message;
|
|
15
19
|
this.markdownTheme = markdownTheme;
|
|
20
|
+
this.markdownTransformers = markdownTransformers;
|
|
21
|
+
this.messageId = messageId;
|
|
22
|
+
this.timestamp = timestamp;
|
|
16
23
|
this.updateDisplay();
|
|
17
24
|
}
|
|
18
25
|
setExpanded(expanded) {
|
|
@@ -35,9 +42,10 @@ export class CompactionSummaryMessageComponent extends Box {
|
|
|
35
42
|
content.addChild(new Spacer(1));
|
|
36
43
|
if (this.expanded) {
|
|
37
44
|
const header = `**Compacted from ${tokenStr} tokens**\n\n`;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
45
|
+
const transform = createMarkdownTransform("summary", () => false, this.markdownTransformers, this.messageId, this.timestamp);
|
|
46
|
+
content.addChild(new Markdown(this.message.summary, 0, 0, this.markdownTheme, { color: (text) => theme.fg("customMessageText", text) },
|
|
47
|
+
// Transformers see only the summary content, not Pi's header.
|
|
48
|
+
{ transform: (markdown, width) => header + transform(markdown, width) }));
|
|
41
49
|
}
|
|
42
50
|
else {
|
|
43
51
|
content.addChild(new Text(theme.fg("customMessageText", `Compacted from ${tokenStr} tokens (`) +
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Container, type MarkdownTheme } from "@earendil-works/pi-tui";
|
|
2
|
-
import type { MessageRenderer } from "../../../core/extensions/types.ts";
|
|
2
|
+
import type { MarkdownTransformer, MessageRenderer } from "../../../core/extensions/types.ts";
|
|
3
3
|
import type { CustomMessage } from "../../../core/messages.ts";
|
|
4
4
|
/**
|
|
5
5
|
* Component that renders a custom message entry from extensions.
|
|
@@ -13,7 +13,10 @@ export declare class CustomMessageComponent extends Container {
|
|
|
13
13
|
private markdownTheme;
|
|
14
14
|
private _expanded;
|
|
15
15
|
private outputPad;
|
|
16
|
-
|
|
16
|
+
private markdownTransformers;
|
|
17
|
+
private messageId?;
|
|
18
|
+
private timestamp?;
|
|
19
|
+
constructor(message: CustomMessage<unknown>, customRenderer?: MessageRenderer, markdownTheme?: MarkdownTheme, outputPad?: number, markdownTransformers?: readonly MarkdownTransformer[], messageId?: string, timestamp?: string);
|
|
17
20
|
setExpanded(expanded: boolean): void;
|
|
18
21
|
setOutputPad(outputPad: number): void;
|
|
19
22
|
invalidate(): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Box, Container, Markdown, Spacer, Text } from "@earendil-works/pi-tui";
|
|
2
2
|
import { getMarkdownTheme, theme } from "../theme/theme.js";
|
|
3
3
|
import { keyHint, keyText } from "./keybinding-hints.js";
|
|
4
|
+
import { createMarkdownTransform } from "./markdown-transform.js";
|
|
4
5
|
/**
|
|
5
6
|
* Component that renders a custom message entry from extensions.
|
|
6
7
|
* Uses distinct styling to differentiate from user messages.
|
|
@@ -13,12 +14,18 @@ export class CustomMessageComponent extends Container {
|
|
|
13
14
|
markdownTheme;
|
|
14
15
|
_expanded = false;
|
|
15
16
|
outputPad;
|
|
16
|
-
|
|
17
|
+
markdownTransformers;
|
|
18
|
+
messageId;
|
|
19
|
+
timestamp;
|
|
20
|
+
constructor(message, customRenderer, markdownTheme = getMarkdownTheme(), outputPad = 1, markdownTransformers = [], messageId, timestamp) {
|
|
17
21
|
super();
|
|
18
22
|
this.message = message;
|
|
19
23
|
this.customRenderer = customRenderer;
|
|
20
24
|
this.markdownTheme = markdownTheme;
|
|
21
25
|
this.outputPad = outputPad;
|
|
26
|
+
this.markdownTransformers = markdownTransformers;
|
|
27
|
+
this.messageId = messageId;
|
|
28
|
+
this.timestamp = timestamp;
|
|
22
29
|
this.addChild(new Spacer(1));
|
|
23
30
|
// Create box with purple background (used for default rendering)
|
|
24
31
|
this.box = new Box(1, 1, (t) => theme.bg("customMessageBg", t));
|
|
@@ -81,8 +88,8 @@ export class CustomMessageComponent extends Container {
|
|
|
81
88
|
.map((c) => c.text)
|
|
82
89
|
.join("\n");
|
|
83
90
|
}
|
|
84
|
-
this.box.addChild(new Markdown(text, 0, 0, this.markdownTheme, {
|
|
85
|
-
|
|
91
|
+
this.box.addChild(new Markdown(text, 0, 0, this.markdownTheme, { color: (text) => theme.fg("customMessageText", text) }, {
|
|
92
|
+
transform: createMarkdownTransform("custom", () => false, this.markdownTransformers, this.messageId, this.timestamp),
|
|
86
93
|
}));
|
|
87
94
|
}
|
|
88
95
|
}
|
package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/diff.js
CHANGED
|
@@ -18,13 +18,19 @@ function replaceTabs(text) {
|
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* Compute word-level diff and render with inverse on changed parts.
|
|
21
|
-
*
|
|
22
|
-
* Strips leading whitespace from inverse to avoid highlighting indentation.
|
|
21
|
+
* Separates common indentation before diffing so a leading insertion cannot consume it.
|
|
23
22
|
*/
|
|
24
23
|
function renderIntraLineDiff(oldContent, newContent) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
let commonIndentLength = 0;
|
|
25
|
+
while (commonIndentLength < oldContent.length &&
|
|
26
|
+
oldContent[commonIndentLength] === newContent[commonIndentLength] &&
|
|
27
|
+
/\s/.test(oldContent[commonIndentLength])) {
|
|
28
|
+
commonIndentLength++;
|
|
29
|
+
}
|
|
30
|
+
const commonIndent = oldContent.slice(0, commonIndentLength);
|
|
31
|
+
const wordDiff = Diff.diffWords(oldContent.slice(commonIndentLength), newContent.slice(commonIndentLength));
|
|
32
|
+
let removedLine = commonIndent;
|
|
33
|
+
let addedLine = commonIndent;
|
|
28
34
|
let isFirstRemoved = true;
|
|
29
35
|
let isFirstAdded = true;
|
|
30
36
|
for (const part of wordDiff) {
|
|
@@ -50,13 +50,21 @@ export class ExtensionSelectorComponent extends Container {
|
|
|
50
50
|
}
|
|
51
51
|
updateList() {
|
|
52
52
|
this.listContainer.clear();
|
|
53
|
-
|
|
53
|
+
const maxVisible = 10;
|
|
54
|
+
// Center the window on the selection, then clamp it to the list boundaries.
|
|
55
|
+
const startIndex = Math.max(0, Math.min(this.selectedIndex - Math.floor(maxVisible / 2), this.options.length - maxVisible));
|
|
56
|
+
const endIndex = Math.min(startIndex + maxVisible, this.options.length);
|
|
57
|
+
for (let i = startIndex; i < endIndex; i++) {
|
|
54
58
|
const isSelected = i === this.selectedIndex;
|
|
55
59
|
const text = isSelected
|
|
56
60
|
? theme.fg("accent", "→ ") + theme.fg("accent", this.options[i])
|
|
57
61
|
: ` ${theme.fg("text", this.options[i])}`;
|
|
58
62
|
this.listContainer.addChild(new Text(text, 1, 0));
|
|
59
63
|
}
|
|
64
|
+
if (startIndex > 0 || endIndex < this.options.length) {
|
|
65
|
+
const scrollInfo = theme.fg("muted", ` (${this.selectedIndex + 1}/${this.options.length})`);
|
|
66
|
+
this.listContainer.addChild(new Text(scrollInfo, 0, 0));
|
|
67
|
+
}
|
|
60
68
|
}
|
|
61
69
|
handleInput(keyData) {
|
|
62
70
|
const kb = getKeybindings();
|
|
@@ -1,28 +1,11 @@
|
|
|
1
1
|
import { Container, getKeybindings, hyperlink, Input, replaceControlCharacters, Spacer, Text, TruncatedText, } from "@earendil-works/pi-tui";
|
|
2
2
|
import { copyToClipboard } from "../../../utils/clipboard.js";
|
|
3
3
|
import { openBrowser } from "../../../utils/open-browser.js";
|
|
4
|
+
import { displayUrl, webUrl } from "../../../utils/web-url.js";
|
|
4
5
|
import { theme } from "../theme/theme.js";
|
|
5
6
|
import { AuthUrlComponent } from "./auth-url.js";
|
|
6
7
|
import { DynamicBorder } from "./dynamic-border.js";
|
|
7
8
|
import { keyHint } from "./keybinding-hints.js";
|
|
8
|
-
/**
|
|
9
|
-
* The `http:` or `https:` URL `value` names, normalized, or undefined. The shared launcher also opens files and custom
|
|
10
|
-
* protocols, so login only opens web URLs. Normalizing percent-encodes control characters, which would otherwise end a
|
|
11
|
-
* terminal hyperlink early.
|
|
12
|
-
*/
|
|
13
|
-
function webUrl(value) {
|
|
14
|
-
if (!URL.canParse(value))
|
|
15
|
-
return undefined;
|
|
16
|
-
const url = new URL(value);
|
|
17
|
-
return url.protocol === "https:" || url.protocol === "http:" ? url.href : undefined;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* `value` normalized as a web URL, else with control characters replaced: an untrusted string printed as is could end a
|
|
21
|
-
* hyperlink early or send its own escape sequences to the terminal.
|
|
22
|
-
*/
|
|
23
|
-
function displayUrl(value) {
|
|
24
|
-
return webUrl(value) ?? replaceControlCharacters(value);
|
|
25
|
-
}
|
|
26
9
|
/** `text` as a terminal hyperlink to `url` when that is a web URL, else plain `text`. */
|
|
27
10
|
function webLink(text, url) {
|
|
28
11
|
const target = webUrl(url);
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { MarkdownTransformer } from "../../../core/extensions/types.ts";
|
|
2
2
|
import type { MermaidRenderingMode } from "../../../core/settings-manager.ts";
|
|
3
3
|
import type { Theme } from "../theme/theme.ts";
|
|
4
|
+
type MermaidTheme = Pick<Theme, "fg" | "getFgAnsi">;
|
|
4
5
|
interface MermaidTransformerOptions {
|
|
5
6
|
getMode: () => MermaidRenderingMode;
|
|
6
|
-
theme?:
|
|
7
|
+
theme?: MermaidTheme;
|
|
7
8
|
}
|
|
8
9
|
/** Create a transformer that replaces top-level Mermaid code blocks with Unicode terminal diagrams. */
|
|
9
10
|
export declare function createMermaidMarkdownTransformer(options: MermaidTransformerOptions): MarkdownTransformer;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Marked } from "@earendil-works/pi-tui";
|
|
2
|
-
import { render } from "
|
|
1
|
+
import { getCapabilities, Marked } from "@earendil-works/pi-tui";
|
|
2
|
+
import { render, toAnsi } from "lovely-mermaid";
|
|
3
3
|
const markdownParser = new Marked();
|
|
4
4
|
function isMermaid(token) {
|
|
5
5
|
return token.type === "code" && token.lang?.trim().split(/\s+/, 1)[0]?.toLowerCase() === "mermaid";
|
|
@@ -23,31 +23,36 @@ function codeSpan(line) {
|
|
|
23
23
|
const padding = content.startsWith("`") || content.endsWith("`") ? " " : "";
|
|
24
24
|
return `${fence}${padding}${content}${padding}${fence}`;
|
|
25
25
|
}
|
|
26
|
-
function styleSpan(span, theme) {
|
|
27
|
-
switch (span.cls) {
|
|
28
|
-
case "border":
|
|
29
|
-
return theme.fg("borderMuted", span.text);
|
|
30
|
-
case "text":
|
|
31
|
-
return theme.fg("text", span.text);
|
|
32
|
-
case "edge":
|
|
33
|
-
return theme.fg("accent", span.text);
|
|
34
|
-
case "edgeLabel":
|
|
35
|
-
return theme.fg("muted", span.text);
|
|
36
|
-
case "title":
|
|
37
|
-
return theme.fg("accent", theme.bold(span.text));
|
|
38
|
-
case "none":
|
|
39
|
-
return span.text;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
26
|
function themedLines(art, theme) {
|
|
43
|
-
|
|
27
|
+
const foreground = (color) => theme.getFgAnsi(color).slice(2, -1);
|
|
28
|
+
const ansiTheme = {
|
|
29
|
+
border: foreground("borderMuted"),
|
|
30
|
+
text: foreground("text"),
|
|
31
|
+
edge: foreground("accent"),
|
|
32
|
+
edgeLabel: foreground("text"),
|
|
33
|
+
title: `1;${foreground("accent")}`,
|
|
34
|
+
};
|
|
35
|
+
const linkLabels = getCapabilities().hyperlinks;
|
|
36
|
+
const displayArt = {
|
|
37
|
+
...art,
|
|
38
|
+
// Only osc 8 the text, not the whole box.
|
|
39
|
+
styled: art.styled.map((row) => row.map((span) => {
|
|
40
|
+
if (span.href === undefined || (linkLabels && span.role === "text"))
|
|
41
|
+
return span;
|
|
42
|
+
const unlinked = { ...span };
|
|
43
|
+
delete unlinked.href;
|
|
44
|
+
return unlinked;
|
|
45
|
+
})),
|
|
46
|
+
};
|
|
47
|
+
return toAnsi(displayArt, ansiTheme);
|
|
44
48
|
}
|
|
45
49
|
/** Create a transformer that replaces top-level Mermaid code blocks with Unicode terminal diagrams. */
|
|
46
50
|
export function createMermaidMarkdownTransformer(options) {
|
|
47
51
|
return (markdown, context) => {
|
|
48
52
|
const mode = options.getMode();
|
|
53
|
+
// Diagrams render in user and assistant text and in model-written summaries, not in thinking or other surfaces.
|
|
49
54
|
if (mode === "off" ||
|
|
50
|
-
context.messageType
|
|
55
|
+
(context.messageType !== "user" && context.messageType !== "assistant" && context.messageType !== "summary") ||
|
|
51
56
|
(context.isStreaming && mode !== "streaming")) {
|
|
52
57
|
return markdown;
|
|
53
58
|
}
|
|
@@ -152,8 +152,10 @@ export class ModelSelectorComponent extends Container {
|
|
|
152
152
|
this.refreshStatusSuccess = true;
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
+
const selectedModel = this.filteredModels[this.selectedIndex]?.model;
|
|
155
156
|
this.loadModelsFromSnapshot();
|
|
156
|
-
|
|
157
|
+
// The user may have moved while the refresh was in flight, and the refresh can shift rows.
|
|
158
|
+
this.filterModels(this.searchInput.getValue(), selectedModel);
|
|
157
159
|
this.tui.requestRender();
|
|
158
160
|
}
|
|
159
161
|
catch (error) {
|
|
@@ -226,7 +228,7 @@ export class ModelSelectorComponent extends Container {
|
|
|
226
228
|
this.scopeText.setText(this.getScopeText());
|
|
227
229
|
}
|
|
228
230
|
}
|
|
229
|
-
filterModels(query) {
|
|
231
|
+
filterModels(query, preferredModel) {
|
|
230
232
|
if (query) {
|
|
231
233
|
const filtered = fuzzyFilter(this.activeModels, query, (item) => {
|
|
232
234
|
const defaultText = this.isDefaultModel(item.model) ? " default" : "";
|
|
@@ -247,10 +249,16 @@ export class ModelSelectorComponent extends Container {
|
|
|
247
249
|
else {
|
|
248
250
|
this.filteredModels = this.activeModels;
|
|
249
251
|
}
|
|
250
|
-
//
|
|
251
|
-
//
|
|
252
|
-
// clamped to the (restored) list length.
|
|
253
|
-
|
|
252
|
+
// Keep the preferred model selected if it is still listed. Otherwise, when filtering
|
|
253
|
+
// by a query, move the selector to the top row so the best match is highlighted.
|
|
254
|
+
// When the query is cleared, keep the current position clamped to the (restored) list length.
|
|
255
|
+
const preferredIndex = preferredModel
|
|
256
|
+
? this.filteredModels.findIndex((item) => modelsAreEqual(preferredModel, item.model))
|
|
257
|
+
: -1;
|
|
258
|
+
if (preferredIndex >= 0)
|
|
259
|
+
this.selectedIndex = preferredIndex;
|
|
260
|
+
else
|
|
261
|
+
this.selectedIndex = query ? 0 : Math.min(this.selectedIndex, Math.max(0, this.filteredModels.length - 1));
|
|
254
262
|
this.updateList();
|
|
255
263
|
}
|
|
256
264
|
updateList() {
|