dal-code 1.0.50 → 1.0.51
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 +1039 -5
- package/dist/bundle/chunks/anthropic-messages-2P3UGLIO.js +5 -0
- package/dist/bundle/chunks/anthropic.js +74 -0
- package/dist/bundle/chunks/azure-openai-responses-S4GNH2XC.js +1 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +88 -0
- package/dist/bundle/chunks/chunk-2KOJ4RNS.js +43 -0
- package/dist/bundle/chunks/chunk-3YGHTGYM.js +7 -0
- package/dist/bundle/chunks/chunk-4LDEEFCY.js +1 -0
- package/dist/bundle/chunks/chunk-4UTLMBZZ.js +13 -0
- package/dist/bundle/chunks/chunk-567OJLS7.js +1 -0
- package/dist/bundle/chunks/chunk-5AGIVGSV.js +5 -0
- package/dist/bundle/chunks/chunk-6QGV3IWD.js +5 -0
- package/dist/bundle/chunks/chunk-723ZGEZ2.js +1 -0
- package/dist/bundle/chunks/chunk-7DDKXS2Q.js +1 -0
- package/dist/bundle/chunks/chunk-7ZC4UXSL.js +1 -0
- package/dist/bundle/chunks/chunk-AL7NZVPP.js +1 -0
- package/dist/bundle/chunks/chunk-ATQJO2OE.js +3 -0
- package/dist/bundle/chunks/chunk-B7NRFMLU.js +8 -0
- package/dist/bundle/chunks/chunk-BEDAM2M7.js +81 -0
- package/dist/bundle/chunks/chunk-CF5GWZHW.js +30 -0
- package/dist/bundle/chunks/chunk-CFPQOC7P.js +1 -0
- package/dist/bundle/chunks/chunk-D2WTLI2T.js +19 -0
- package/dist/bundle/chunks/chunk-EH7SFF47.js +129 -0
- package/dist/bundle/chunks/chunk-FCKLBLA4.js +1 -0
- package/dist/bundle/chunks/chunk-FFMDRXC4.js +9 -0
- package/dist/bundle/chunks/chunk-GSGE3ULF.js +15 -0
- package/dist/bundle/chunks/chunk-H5FHS6BV.js +1 -0
- package/dist/bundle/chunks/chunk-HXK5EFBE.js +1172 -0
- package/dist/bundle/chunks/chunk-IEBK4HQA.js +1 -0
- package/dist/bundle/chunks/chunk-JE6UXK35.js +30 -0
- package/dist/bundle/chunks/chunk-JXWJOIH4.js +1 -0
- package/dist/bundle/chunks/chunk-K7VBBYTT.js +1 -0
- package/dist/bundle/chunks/chunk-L2ZPNLYD.js +1 -0
- package/dist/bundle/chunks/chunk-LVVZS2NO.js +11 -0
- package/dist/bundle/chunks/chunk-ML5DIOWR.js +1 -0
- package/dist/bundle/chunks/chunk-NUIR7PPD.js +25 -0
- package/dist/bundle/chunks/chunk-P7FPUEYA.js +1 -0
- package/dist/bundle/chunks/chunk-PGXDEOVV.js +1 -0
- package/dist/bundle/chunks/chunk-PJACZCIR.js +1 -0
- package/dist/bundle/chunks/chunk-PRRNXB7S.js +1 -0
- package/dist/bundle/chunks/chunk-PWZRJWNP.js +17 -0
- package/dist/bundle/chunks/chunk-R44HF4S5.js +9 -0
- package/dist/bundle/chunks/chunk-R47JBGS3.js +1 -0
- package/dist/bundle/chunks/chunk-RCVVRHMF.js +9 -0
- package/dist/bundle/chunks/chunk-RDZVAGPR.js +1 -0
- package/dist/bundle/chunks/chunk-RR3ZP63P.js +56 -0
- package/dist/bundle/chunks/chunk-SE42OS3U.js +21 -0
- package/dist/bundle/chunks/chunk-TMTOQ7H7.js +1 -0
- package/dist/bundle/chunks/chunk-UTB4DTYQ.js +1 -0
- package/dist/bundle/chunks/chunk-VNHNHA4V.js +1 -0
- package/dist/bundle/chunks/chunk-XJFQKN3N.js +2 -0
- package/dist/bundle/chunks/chunk-ZG74NES2.js +1 -0
- package/dist/bundle/chunks/cli-FWMQKBFA.js +30 -0
- package/dist/bundle/chunks/cli-ZEDY5U67.js +52 -0
- package/dist/bundle/chunks/cloudflare-workers-ai-system-one-E6TEENDO.js +1 -0
- package/dist/bundle/chunks/codemode-worker.js +480 -0
- package/dist/bundle/chunks/dist-D3WIBXB5.js +10 -0
- package/dist/bundle/chunks/easter-egg-3d-5TFBCTIS.js +1 -0
- package/dist/bundle/chunks/execute-62LDYHXA.js +506 -0
- package/dist/bundle/chunks/github-copilot.js +1 -0
- package/dist/bundle/chunks/google-generative-ai-V5DLXTF7.js +1 -0
- package/dist/bundle/chunks/google-vertex-K3KYGGLI.js +1 -0
- package/dist/bundle/chunks/http-proxy-KF35JLJN.js +1 -0
- package/dist/bundle/chunks/https-proxy-agent-LVOO5TPL.js +12 -0
- package/dist/bundle/chunks/image-resize-worker.js +1 -0
- package/dist/bundle/chunks/jiti-loader-GL4HJFAD.js +20 -0
- package/dist/bundle/chunks/jiti-static-loader-2RCDI6B4.js +1 -0
- package/dist/bundle/chunks/kimi-coding.js +1 -0
- package/dist/bundle/chunks/lib-4AVRLBHM.js +8 -0
- package/dist/bundle/chunks/llama-cpp-classify-JCTIEHTL.js +21 -0
- package/dist/bundle/chunks/mcp-VF7EY5WC.js +10 -0
- package/dist/bundle/chunks/meta.js +1 -0
- package/dist/bundle/chunks/mistral-conversations-LVBXTF6R.js +4 -0
- package/dist/bundle/chunks/multipart-parser-FMGQ7342.js +2 -0
- package/dist/bundle/chunks/node-AUOGOBCN.js +1 -0
- package/dist/bundle/chunks/node-ZTHARAQV.js +15 -0
- package/dist/bundle/chunks/office-PONBADQP.js +419 -0
- package/dist/bundle/chunks/openai-chatgpt.js +74 -0
- package/dist/bundle/chunks/openai-codex-responses-WBZKNYLX.js +9 -0
- package/dist/bundle/chunks/openai-codex.js +74 -0
- package/dist/bundle/chunks/openai-completions-HMHQRGX4.js +6 -0
- package/dist/bundle/chunks/openai-decisions-R7OFRKLL.js +4 -0
- package/dist/bundle/chunks/openai-responses-BHXRQFCI.js +3 -0
- package/dist/bundle/chunks/openrouter-images-BIMNIXQZ.js +1 -0
- package/dist/bundle/chunks/openrouter.js +74 -0
- package/dist/bundle/chunks/pi-messages-X5YTLXQJ.js +7 -0
- package/dist/bundle/chunks/radius.js +74 -0
- package/dist/bundle/chunks/review-WCGIBVLM.js +80 -0
- package/dist/bundle/chunks/rewind-2OYLDDHH.js +8 -0
- package/dist/bundle/chunks/router-7E5LU7US.js +3 -0
- package/dist/bundle/chunks/runtime-5PTUOEM2.js +1 -0
- package/dist/bundle/chunks/sdk-ZUFIGPSS.js +1 -0
- package/dist/bundle/chunks/src-QKGKDFSU.js +3 -0
- package/dist/bundle/chunks/sync-LOX6TIM6.js +4 -0
- package/dist/bundle/chunks/typesafe-system-one-KOIOG3HP.js +1 -0
- package/dist/bundle/chunks/usage-2EVEFGNI.js +1 -0
- package/dist/bundle/chunks/virtual-modules-MYMONT3Y.js +1 -0
- package/dist/bundle/chunks/xai.js +1 -0
- package/dist/bundle/cli-runtime.js +2 -0
- package/dist/bundle/cli.js +2 -0
- package/dist/bundle/index.js +1 -0
- package/dist/bundle/rpc-entry.js +2 -0
- package/dist/cli/args.js +1 -1
- package/dist/cli/auth-command.js +9 -6
- package/dist/cli/auth-login.js +2 -0
- package/dist/cli/auth-logout.js +1 -0
- package/dist/cli/auth-terminal.js +5 -0
- package/dist/cli/config-selector.js +1 -1
- package/dist/config.d.ts +5 -0
- package/dist/config.js +1 -1
- package/dist/core/agent-session-runtime.js +1 -1
- package/dist/core/agent-session-services.js +1 -1
- package/dist/core/agent-session.d.ts +8 -1
- package/dist/core/agent-session.js +12 -9
- package/dist/core/auth-storage.js +1 -1
- package/dist/core/bash-executor.js +1 -1
- package/dist/core/bug-report.js +3 -3
- package/dist/core/cache-warmer.d.ts +3 -15
- package/dist/core/cache-warmer.js +1 -1
- package/dist/core/compaction/branch-summarization.d.ts +3 -2
- package/dist/core/compaction/branch-summarization.js +5 -5
- package/dist/core/compaction/compaction.d.ts +1 -0
- package/dist/core/compaction/compaction.js +14 -14
- package/dist/core/compaction/tool-output-pruning.js +1 -1
- package/dist/core/compaction/utils.d.ts +0 -1
- package/dist/core/compaction/utils.js +8 -8
- package/dist/core/exec.d.ts +2 -0
- package/dist/core/exec.js +1 -1
- package/dist/core/export-html/template.css +9 -0
- package/dist/core/export-html/template.js +46 -39
- package/dist/core/export-html/tool-renderer.js +1 -1
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/loader.js +1 -1
- package/dist/core/extensions/pi-ai-extension-view.js +1 -0
- package/dist/core/extensions/runner.js +1 -1
- package/dist/core/extensions/types.d.ts +25 -7
- package/dist/core/extensions/virtual-modules.js +1 -1
- package/dist/core/keybindings.d.ts +1 -1
- package/dist/core/keybindings.js +1 -1
- package/dist/core/mcp-servers.d.ts +6 -17
- package/dist/core/mcp-servers.js +1 -1
- package/dist/core/model-config.d.ts +1912 -2211
- package/dist/core/model-config.js +4 -4
- package/dist/core/model-resolver.js +1 -1
- package/dist/core/model-runtime.d.ts +1 -0
- package/dist/core/model-runtime.js +1 -1
- package/dist/core/package-manager.d.ts +10 -1
- package/dist/core/package-manager.js +2 -2
- package/dist/core/pi-ai-schemas.js +1 -0
- package/dist/core/pi-manifest.js +1 -1
- package/dist/core/preferred-providers.js +1 -0
- package/dist/core/project-trust.js +2 -2
- package/dist/core/prompt-templates.js +2 -2
- package/dist/core/provider-composer.js +1 -1
- package/dist/core/provider-matching.js +1 -0
- package/dist/core/radius-mcp.js +1 -0
- package/dist/core/remote-catalog-provider.js +1 -1
- package/dist/core/resource-loader.d.ts +3 -1
- package/dist/core/resource-loader.js +1 -1
- package/dist/core/runtime-credentials.js +1 -1
- package/dist/core/sdk.js +1 -1
- package/dist/core/session-cwd.js +3 -7
- package/dist/core/session-manager.d.ts +1 -0
- package/dist/core/session-manager.js +12 -12
- package/dist/core/settings-defaults.js +1 -1
- package/dist/core/settings-manager.d.ts +4 -0
- package/dist/core/settings-manager.js +1 -1
- package/dist/core/settings-schema.d.ts +4 -2
- package/dist/core/settings-schema.js +1 -1
- package/dist/core/skills.js +3 -3
- package/dist/core/slash-commands.js +1 -1
- package/dist/core/source-info.d.ts +8 -0
- package/dist/core/source-info.js +1 -1
- package/dist/core/system-prompt.js +3 -3
- package/dist/core/tools/bash.d.ts +2 -2
- package/dist/core/tools/bash.js +15 -15
- package/dist/core/tools/edit-diff.d.ts +9 -4
- package/dist/core/tools/edit-diff.js +22 -15
- package/dist/core/tools/edit.d.ts +3 -3
- package/dist/core/tools/edit.js +3 -3
- package/dist/core/tools/find.d.ts +2 -2
- package/dist/core/tools/find.js +10 -11
- package/dist/core/tools/grep.d.ts +3 -3
- package/dist/core/tools/grep.js +8 -12
- package/dist/core/tools/ls.d.ts +2 -2
- package/dist/core/tools/ls.js +4 -4
- package/dist/core/tools/powershell.js +6 -2
- package/dist/core/tools/read.d.ts +5 -2
- package/dist/core/tools/read.js +20 -19
- package/dist/core/tools/render-utils.js +5 -5
- package/dist/core/tools/renderers/write.js +10 -10
- package/dist/core/tools/tool-definition-wrapper.d.ts +11 -0
- package/dist/core/tools/truncate.d.ts +2 -8
- package/dist/core/tools/truncate.js +10 -10
- package/dist/core/tools/write.d.ts +2 -2
- package/dist/core/trust-manager.js +2 -2
- package/dist/core/usage-totals.js +1 -1
- package/dist/extensions/codemode/execute.js +12 -12
- package/dist/extensions/codemode/renderer.js +6 -6
- package/dist/extensions/codemode/tool.d.ts +2 -1
- package/dist/extensions/codemode/tool.js +11 -10
- package/dist/extensions/llama/client.js +5 -5
- package/dist/extensions/llama/ui.js +2 -2
- package/dist/extensions/mcp/cli.js +21 -19
- package/dist/extensions/mcp/config.js +2 -2
- package/dist/extensions/mcp/index.js +7 -7
- package/dist/extensions/mcp/oauth.d.ts +3 -22
- package/dist/extensions/mcp/oauth.js +2 -2
- package/dist/extensions/mcp/resources.d.ts +1 -1
- package/dist/extensions/mcp/resources.js +1 -1
- package/dist/extensions/mcp/runtime.d.ts +2 -2
- package/dist/extensions/mcp/runtime.js +3 -3
- package/dist/extensions/mcp/tools.d.ts +1 -8
- package/dist/extensions/mcp/tools.js +4 -9
- package/dist/extensions/mcp/ui.js +1 -1
- package/dist/extensions/tool-search/tool.js +4 -4
- package/dist/index.d.ts +2 -2
- package/dist/main.js +4 -4
- package/dist/modes/interactive/components/assistant-message.d.ts +4 -1
- package/dist/modes/interactive/components/assistant-message.js +2 -2
- package/dist/modes/interactive/components/branch-summary-message.d.ts +5 -1
- package/dist/modes/interactive/components/branch-summary-message.js +2 -2
- package/dist/modes/interactive/components/compaction-summary-message.d.ts +5 -1
- package/dist/modes/interactive/components/compaction-summary-message.js +2 -2
- package/dist/modes/interactive/components/config-selector.js +1 -1
- package/dist/modes/interactive/components/custom-editor.js +1 -1
- package/dist/modes/interactive/components/custom-entry.js +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts +5 -2
- package/dist/modes/interactive/components/custom-message.js +3 -3
- package/dist/modes/interactive/components/diff.js +3 -3
- package/dist/modes/interactive/components/extension-editor.d.ts +1 -0
- package/dist/modes/interactive/components/extension-editor.js +1 -1
- package/dist/modes/interactive/components/extension-selector.js +2 -2
- package/dist/modes/interactive/components/login-dialog.d.ts +5 -0
- package/dist/modes/interactive/components/login-dialog.js +1 -1
- package/dist/modes/interactive/components/markdown-transform.js +1 -1
- package/dist/modes/interactive/components/mermaid.js +4 -4
- package/dist/modes/interactive/components/model-selector.d.ts +1 -0
- package/dist/modes/interactive/components/model-selector.js +2 -2
- package/dist/modes/interactive/components/oauth-selector.d.ts +2 -1
- package/dist/modes/interactive/components/oauth-selector.js +1 -1
- package/dist/modes/interactive/components/provider-brand.js +1 -0
- package/dist/modes/interactive/components/radius-login-selector.js +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.js +1 -1
- package/dist/modes/interactive/components/session-selector-search.js +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts +2 -1
- package/dist/modes/interactive/components/session-selector.js +2 -2
- package/dist/modes/interactive/components/settings-submenu.js +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +5 -1
- package/dist/modes/interactive/components/skill-invocation-message.js +2 -2
- package/dist/modes/interactive/components/tool-execution.d.ts +1 -0
- package/dist/modes/interactive/components/tool-execution.js +3 -3
- package/dist/modes/interactive/components/tree-selector.d.ts +2 -0
- package/dist/modes/interactive/components/tree-selector.js +1 -1
- package/dist/modes/interactive/components/user-message-selector.d.ts +1 -0
- package/dist/modes/interactive/components/user-message-selector.js +1 -1
- package/dist/modes/interactive/components/user-message.d.ts +2 -1
- package/dist/modes/interactive/components/user-message.js +1 -1
- package/dist/modes/interactive/external-editor.js +3 -3
- package/dist/modes/interactive/interactive-mode.d.ts +10 -1
- package/dist/modes/interactive/interactive-mode.js +45 -40
- package/dist/modes/interactive/model-search.js +1 -1
- package/dist/modes/interactive/theme/theme.d.ts +4 -0
- package/dist/modes/interactive/theme/theme.js +3 -6
- package/dist/modes/print-mode.js +7 -7
- package/dist/modes/rpc/rpc-mode.js +1 -1
- package/dist/node_modules/@dalcode/dal-advisor/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-awake/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-bridge/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-capabilities/package.json +4 -4
- package/dist/node_modules/@dalcode/dal-codeindex/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-compat/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-dap/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-gateway/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-goal/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-guard/package.json +4 -4
- package/dist/node_modules/@dalcode/dal-halo/package.json +1 -1
- package/dist/node_modules/@dalcode/dal-interactive/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-lang/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-learn/package.json +3 -2
- package/dist/node_modules/@dalcode/dal-learn/src/index.js +16 -16
- package/dist/node_modules/@dalcode/dal-learn/src/lesson-events.js +1 -0
- package/dist/node_modules/@dalcode/dal-lsp/package.json +4 -4
- package/dist/node_modules/@dalcode/dal-mcp/package.json +6 -6
- package/dist/node_modules/@dalcode/dal-office/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-pi-kit/dist/i18n.js +3 -2
- package/dist/node_modules/@dalcode/dal-pi-kit/package.json +1 -1
- package/dist/node_modules/@dalcode/dal-pi-kit/src/i18n.js +4 -3
- package/dist/node_modules/@dalcode/dal-plugins/package.json +4 -4
- package/dist/node_modules/@dalcode/dal-recall/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-remote/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-review/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-rewind/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-router/package.json +6 -6
- package/dist/node_modules/@dalcode/dal-rtk/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-skills/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-statusline/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-structured/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-subagent/package.json +5 -5
- package/dist/node_modules/@dalcode/dal-sync/package.json +4 -4
- package/dist/node_modules/@dalcode/dal-telemetry/package.json +4 -4
- package/dist/node_modules/@dalcode/dal-terminal/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-tool-catalog/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-usage/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-web/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-workflow/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-workflow/src/todo-snapshot.js +2 -2
- package/dist/node_modules/@dalcode/dal-workflow/src/todo.js +3 -3
- package/dist/node_modules/@dalcode/deepailab/package.json +3 -3
- package/dist/node_modules/@earendil-works/pi-agent-core/README.md +8 -6
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/proxy.d.ts +1 -1
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/proxy.js +2 -2
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts +8 -5
- package/dist/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
- package/dist/node_modules/@earendil-works/pi-ai/README.md +58 -39
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +5 -5
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.lazy.d.ts +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.lazy.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/constrained-sampling.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/google-shared.js +2 -2
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/lazy.d.ts +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/lazy.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +4 -4
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts +2 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +5 -5
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js +9 -9
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +3 -3
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/openrouter-images.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.d.ts +2 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.js +3 -3
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/strict-tool-limits.js +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/auth/oauth/kimi-coding.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/auth/oauth/load.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/auth/oauth/meta.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/auth/oauth/radius.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/auth/oauth/trusted-url.js +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/auth/types.d.ts +2 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/cache-warming.d.ts +21 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/cache-warming.js +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/cli.js +5 -5
- package/dist/node_modules/@earendil-works/pi-ai/dist/compat/extension-oauth-types.d.ts +2 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/index.d.ts +3 -3
- package/dist/node_modules/@earendil-works/pi-ai/dist/index.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/lazy-bedrock-provider.js +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/lazy-oauth.js +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/models.d.ts +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts +4 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/models.generated.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/models.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/all.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/compat-schema.d.ts +485 -498
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/compat-schema.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/amazon-bedrock.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/anthropic.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/azure.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/baseten.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-ai-gateway.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-workers-ai.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/fireworks.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/github-copilot.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/google-vertex.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/google.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/huggingface.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/kimi-coding.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/meta.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/mistral.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/moonshotai-cn.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/moonshotai.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/nvidia.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/openai-codex.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/openai.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan-cn.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan-individual-cn.json +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan-individual.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/radius.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/together.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/xai.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi-token-plan-ams.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi-token-plan-cn.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi-token-plan-sgp.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/zai-coding-cn.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/zai.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/faux.js +5 -5
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/model-schema.d.ts +65 -65
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/model-schema.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/qwen-token-plan-individual-cn.js +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/qwen-token-plan-individual-cn.models.d.ts +5 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/qwen-token-plan-individual-cn.models.js +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/radius-config.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/schema-builders.js +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/telemetry.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/types.d.ts +4 -3
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/error-body.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/openrouter-cost.js +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/streaming-json.d.ts +26 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/streaming-json.js +4 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/{typebox-helpers.d.ts → string-enum.d.ts} +2 -2
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/string-enum.js +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/text.d.ts +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/text.js +2 -2
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/validation.js +4 -4
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/version.d.ts +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/version.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/package.json +12 -5
- package/dist/node_modules/@earendil-works/pi-codemode/README.md +2 -2
- package/dist/node_modules/@earendil-works/pi-codemode/dist/declarations.d.ts +1 -0
- package/dist/node_modules/@earendil-works/pi-codemode/dist/declarations.js +4 -4
- package/dist/node_modules/@earendil-works/pi-codemode/dist/index.d.ts +1 -1
- package/dist/node_modules/@earendil-works/pi-codemode/dist/index.js +1 -1
- package/dist/node_modules/@earendil-works/pi-codemode/dist/runtime/prelude-source.js +2 -0
- package/dist/node_modules/@earendil-works/pi-codemode/package.json +1 -1
- package/dist/node_modules/@earendil-works/pi-coding-agent/package.json +1 -1
- package/dist/node_modules/@earendil-works/pi-mcp/CHANGELOG.md +32 -0
- package/dist/node_modules/@earendil-works/pi-mcp/README.md +60 -5
- package/dist/node_modules/@earendil-works/pi-mcp/dist/config.d.ts +45 -0
- package/dist/node_modules/@earendil-works/pi-mcp/dist/config.js +1 -0
- package/dist/node_modules/@earendil-works/pi-mcp/dist/index.d.ts +5 -0
- package/dist/node_modules/@earendil-works/pi-mcp/dist/index.js +1 -1
- package/dist/node_modules/@earendil-works/pi-mcp/dist/input-schema.d.ts +1 -0
- package/dist/node_modules/@earendil-works/pi-mcp/dist/input-schema.js +1 -0
- package/dist/node_modules/@earendil-works/pi-mcp/dist/naming.d.ts +2 -0
- package/dist/node_modules/@earendil-works/pi-mcp/dist/naming.js +1 -0
- package/dist/node_modules/@earendil-works/pi-mcp/dist/oauth/auth-provider.d.ts +18 -0
- package/dist/node_modules/@earendil-works/pi-mcp/dist/oauth/auth-provider.js +1 -0
- package/dist/node_modules/@earendil-works/pi-mcp/dist/oauth/callback.js +1 -1
- package/dist/node_modules/@earendil-works/pi-mcp/dist/oauth/client-settings.d.ts +42 -0
- package/dist/node_modules/@earendil-works/pi-mcp/dist/oauth/client-settings.js +1 -0
- package/dist/node_modules/@earendil-works/pi-mcp/dist/oauth/errors.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-mcp/dist/oauth/errors.js +1 -1
- package/dist/node_modules/@earendil-works/pi-mcp/dist/oauth/flow.d.ts +2 -0
- package/dist/node_modules/@earendil-works/pi-mcp/dist/oauth/flow.js +1 -1
- package/dist/node_modules/@earendil-works/pi-mcp/dist/oauth/index.d.ts +5 -1
- package/dist/node_modules/@earendil-works/pi-mcp/dist/oauth/index.js +1 -1
- package/dist/node_modules/@earendil-works/pi-mcp/dist/oauth/loopback.d.ts +22 -0
- package/dist/node_modules/@earendil-works/pi-mcp/dist/oauth/loopback.js +1 -0
- package/dist/node_modules/@earendil-works/pi-mcp/dist/oauth/sign-in.d.ts +28 -0
- package/dist/node_modules/@earendil-works/pi-mcp/dist/oauth/sign-in.js +1 -0
- package/dist/node_modules/@earendil-works/pi-mcp/dist/oauth/types.d.ts +1 -0
- package/dist/node_modules/@earendil-works/pi-mcp/dist/oauth/types.js +1 -1
- package/dist/node_modules/@earendil-works/pi-mcp/dist/output-limit.d.ts +8 -0
- package/dist/node_modules/@earendil-works/pi-mcp/dist/output-limit.js +11 -0
- package/dist/node_modules/@earendil-works/pi-mcp/dist/transports/lines.js +1 -0
- package/dist/node_modules/@earendil-works/pi-mcp/dist/transports/pipe.d.ts +34 -0
- package/dist/node_modules/@earendil-works/pi-mcp/dist/transports/pipe.js +2 -0
- package/dist/node_modules/@earendil-works/pi-mcp/dist/transports/stdio.d.ts +1 -4
- package/dist/node_modules/@earendil-works/pi-mcp/dist/transports/stdio.js +2 -2
- package/dist/node_modules/@earendil-works/pi-mcp/dist/transports/streamable-http.js +6 -4
- package/dist/node_modules/@earendil-works/pi-mcp/package.json +2 -2
- package/dist/node_modules/@earendil-works/pi-schema/CHANGELOG.md +37 -0
- package/dist/node_modules/@earendil-works/pi-schema/LICENSE +21 -0
- package/dist/node_modules/@earendil-works/pi-schema/README.md +319 -0
- package/dist/node_modules/@earendil-works/pi-schema/THIRD_PARTY_NOTICES/typebox-LICENSE +23 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/annotations.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/builders.d.ts +89 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/builders.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/checks.d.ts +51 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/checks.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/coerce.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/compiler.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/explain.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/formats/index.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/formats/typebox/date.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/formats/typebox/date_time.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/formats/typebox/duration.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/formats/typebox/email.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/formats/typebox/hostname.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/formats/typebox/idn_email.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/formats/typebox/idn_hostname.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/formats/typebox/idna/format/bidi.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/formats/typebox/idna/format/puny.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/formats/typebox/idna/hostname.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/formats/typebox/idna/idn-hostname.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/formats/typebox/idna/index.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/formats/typebox/idna/label/ascii.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/formats/typebox/idna/label/puny.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/formats/typebox/idna/label/unicode.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/formats/typebox/idna/pattern/pattern.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/formats/typebox/ipv4.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/formats/typebox/ipv6.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/formats/typebox/iri.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/formats/typebox/iri_reference.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/formats/typebox/json_pointer.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/formats/typebox/json_pointer_uri_fragment.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/formats/typebox/regex.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/formats/typebox/relative_json_pointer.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/formats/typebox/time.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/formats/typebox/uri.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/formats/typebox/uri_reference.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/formats/typebox/uri_template.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/formats/typebox/url.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/formats/typebox/uuid.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/index.d.ts +4 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/index.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/resolver.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/shared.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/typebox-static.d.ts +54 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/typebox-static.js +0 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/types.d.ts +25 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/types.js +0 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/validator.d.ts +20 -0
- package/dist/node_modules/@earendil-works/pi-schema/dist/validator.js +1 -0
- package/dist/node_modules/@earendil-works/pi-schema/package.json +43 -0
- package/dist/node_modules/@earendil-works/pi-telemetry/dist/index.d.ts +1 -1
- package/dist/node_modules/@earendil-works/pi-telemetry/dist/index.js +1 -1
- package/dist/node_modules/@earendil-works/pi-telemetry/dist/memory.d.ts +1 -0
- package/dist/node_modules/@earendil-works/pi-telemetry/dist/memory.js +1 -1
- package/dist/node_modules/@earendil-works/pi-telemetry/dist/render.js +2 -2
- package/dist/node_modules/@earendil-works/pi-telemetry/package.json +3 -1
- package/dist/node_modules/@earendil-works/pi-tui/README.md +2 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts +1 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/components/editor.js +3 -3
- package/dist/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts +4 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +11 -10
- package/dist/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts +1 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/components/select-list.js +1 -1
- package/dist/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts +1 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js +1 -1
- package/dist/node_modules/@earendil-works/pi-tui/dist/components/text.js +1 -1
- package/dist/node_modules/@earendil-works/pi-tui/dist/fuzzy.js +1 -1
- package/dist/node_modules/@earendil-works/pi-tui/dist/index.d.ts +2 -2
- package/dist/node_modules/@earendil-works/pi-tui/dist/index.js +1 -1
- package/dist/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts +1 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/keybindings.js +1 -1
- package/dist/node_modules/@earendil-works/pi-tui/dist/keys.js +5 -5
- package/dist/node_modules/@earendil-works/pi-tui/dist/layout.js +1 -1
- package/dist/node_modules/@earendil-works/pi-tui/dist/program-status.js +1 -1
- package/dist/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts +1 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +1 -1
- package/dist/node_modules/@earendil-works/pi-tui/dist/terminal.js +1 -1
- package/dist/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts +1 -1
- package/dist/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js +4 -4
- package/dist/node_modules/@earendil-works/pi-tui/dist/tui-main-screen.js +13 -13
- package/dist/node_modules/@earendil-works/pi-tui/dist/tui.d.ts +1 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/tui.js +2 -2
- package/dist/node_modules/@earendil-works/pi-tui/dist/utils.d.ts +1 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/utils.js +1 -1
- package/dist/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/dist/package-manager-cli.js +17 -16
- package/dist/utils/ansi.js +1 -1
- package/dist/utils/changelog.js +3 -3
- package/dist/utils/clipboard-command.js +1 -1
- package/dist/utils/image-resize-core.js +1 -1
- package/dist/utils/image-resize.js +1 -1
- package/dist/utils/open-browser.js +1 -1
- package/dist/utils/paths.js +1 -1
- package/dist/utils/shell.js +3 -3
- package/dist/utils/syntax-highlight.js +4 -4
- package/dist/utils/terminal-question.js +1 -0
- package/dist/utils/tools-manager.js +1 -1
- package/dist/utils/web-url.js +1 -0
- package/examples/extensions/README.md +2 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +14 -14
- package/examples/extensions/debug-provider.ts +2 -2
- package/examples/extensions/gondolin/package-lock.json +19 -29
- package/examples/extensions/gondolin/package.json +2 -2
- package/examples/extensions/plan-mode/index.ts +20 -9
- package/examples/extensions/plan-mode/utils.ts +42 -16
- package/examples/extensions/preset.ts +2 -0
- package/examples/extensions/reload-runtime.ts +17 -5
- package/examples/extensions/subagent/README.md +14 -11
- package/examples/extensions/subagent/index.ts +392 -171
- package/examples/extensions/todo.ts +7 -0
- package/examples/extensions/tools.ts +2 -0
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +20 -20
- package/examples/tsconfig.json +208 -0
- package/npm-shrinkwrap.json +407 -383
- package/package.json +6 -7
- package/examples/extensions/sandbox/index.ts +0 -327
- package/examples/extensions/sandbox/package-lock.json +0 -92
- package/examples/extensions/sandbox/package.json +0 -19
- /package/dist/node_modules/@earendil-works/pi-mcp/{LICENSES → THIRD_PARTY_NOTICES}/modelcontextprotocol-typescript-sdk.txt +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var A=Object.defineProperty;var s=(n,e)=>A(n,"name",{value:e,configurable:!0});import{spawnSync as N}from"child_process";import{chmodSync as U,createWriteStream as _,existsSync as y,mkdirSync as E,readdirSync as R,renameSync as k,rmSync as S}from"fs";import{arch as $,platform as f}from"os";import{join as c}from"path";import{Readable as B}from"stream";import{pipeline as M}from"stream/promises";import{getBinDir as O,VERSION as z}from"../config.js";import{fetchWithRetry as v}from"./management-http.js";import{isOfflineModeEnabled as C}from"./offline.js";import{getPiUserAgent as D}from"./pi-user-agent.js";const u=O(),I=1e4,L=12e4;function T(n,e){const t=e==="arm64"?"aarch64":e==="x64"?"x86_64":void 0;if(t){if(n==="darwin")return`${t}-apple-darwin.tar.gz`;if(n==="linux")return`${t}-unknown-linux-musl.tar.gz`;if(n==="win32")return`${t}-pc-windows-msvc.zip`}}s(T,"getReleaseTarget");const x={fd:{name:"fd",repo:"sharkdp/fd",binaryName:"fd",systemBinaryNames:["fd","fdfind"],minSystemVersion:"8.7.0",tagPrefix:"v",getAssetName:s((n,e)=>`fd-v${n}-${e}`,"getAssetName")},rg:{name:"ripgrep",repo:"BurntSushi/ripgrep",binaryName:"rg",tagPrefix:"",getAssetName:s((n,e)=>`ripgrep-${n}-${e}`,"getAssetName")}};function W(n,e){const t=n.split(".").map(Number),r=e.split(".").map(Number);for(let i=0;i<Math.max(t.length,r.length);i++){const a=(t[i]??0)-(r[i]??0);if(a!==0)return a>0}return!0}s(W,"versionAtLeast");function j(n,e){try{const t=N(n,["--version"],{stdio:"pipe"});if(t.error!==void 0&&t.error!==null)return!1;if(!e)return!0;const r=/(\d+)\.(\d+)\.(\d+)/.exec(String(t.stdout??""));return r!==null&&W(r[0],e)}catch{return!1}}s(j,"commandExists");function H(n){const e=x[n];if(!e)return null;const t=c(u,e.binaryName+(f()==="win32"?".exe":""));if(y(t))return t;const r=e.systemBinaryNames??[e.binaryName];for(const i of r)if(j(i,e.minSystemVersion))return i;return null}s(H,"getToolPath");async function V(n){const e=await v(`https://github.com/${n}/releases/latest`,{headers:{"User-Agent":D(z)},redirect:"manual"},{timeoutMs:I});try{await e.body?.cancel()}catch{}const t=e.status>=300&&e.status<400?e.headers.get("location"):null;if(!t)throw new Error(`Failed to resolve latest ${n} release: HTTP ${e.status} without redirect`);const r=new URL(t,"https://github.com").pathname.split("/").pop();if(!r||!t.includes("/releases/tag/"))throw new Error(`Failed to resolve latest ${n} release: unexpected redirect to ${t}`);return decodeURIComponent(r).replace(/^v/,"")}s(V,"getLatestVersion");async function G(n,e){const t=await v(n,void 0,{timeoutMs:L});if(!t.ok)throw new Error(`Download failed with HTTP ${t.status}: ${n}`);if(!t.body)throw new Error("No response body");const r=_(e);await M(B.fromWeb(t.body),r)}s(G,"downloadFile");function K(n,e){const t=[n];for(;t.length>0;){const r=t.pop();if(!r)continue;const i=R(r,{withFileTypes:!0});for(const a of i){const o=c(r,a.name);if(a.isFile()&&a.name===e)return o;a.isDirectory()&&t.push(o)}}return null}s(K,"findBinaryRecursively");function q(n){if(n.error?.message)return n.error.message;const e=n.stderr?.toString().trim();if(e)return e;const t=n.stdout?.toString().trim();return t||`exit status ${n.status??"unknown"}`}s(q,"formatSpawnFailure");function m(n,e){const t=N(n,e,{stdio:"pipe"});return!t.error&&t.status===0?null:`${n}: ${q(t)}`}s(m,"runExtractionCommand");function X(n,e,t){const r=m("tar",["xzf",n,"-C",e]);if(r)throw new Error(`Failed to extract ${t}: ${r}`)}s(X,"extractTarGzArchive");function Z(){const n=process.env.SystemRoot;if(n){const e=c(n,"System32","tar.exe");if(y(e))return e}return"tar.exe"}s(Z,"getWindowsTarCommand");function J(n,e,t){const r=[];if(f()==="win32"){const i=m(Z(),["xf",n,"-C",e]);if(!i)return;r.push(i);const o=m("powershell.exe",["-NoLogo","-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-Command","& { param($archive, $destination) $ErrorActionPreference = 'Stop'; Expand-Archive -LiteralPath $archive -DestinationPath $destination -Force }",n,e]);if(!o)return;r.push(o)}else{const i=m("unzip",["-q",n,"-d",e]);if(!i)return;r.push(i);const a=m("tar",["xf",n,"-C",e]);if(!a)return;r.push(a)}throw new Error(`Failed to extract ${t}: ${r.join("; ")}`)}s(J,"extractZipArchive");async function Q(n){const e=x[n];if(!e)throw new Error(`Unknown tool: ${n}`);const t=f(),r=$(),i=T(t,r);if(!i)throw new Error(`Unsupported platform: ${t}/${r}`);const a=n==="fd"&&t==="darwin"&&r==="x64"?"10.3.0":await V(e.repo),o=e.getAssetName(a,i);E(u,{recursive:!0});const l=`https://github.com/${e.repo}/releases/download/${e.tagPrefix}${a}/${o}`,p=c(u,o),b=t==="win32"?".exe":"",w=c(u,e.binaryName+b);await G(l,p);const d=c(u,`extract_tmp_${e.binaryName}_${process.pid}_${Date.now()}_${Math.random().toString(36).slice(2,10)}`);E(d,{recursive:!0});try{if(o.endsWith(".tar.gz"))X(p,d,o);else if(o.endsWith(".zip"))J(p,d,o);else throw new Error(`Unsupported archive format: ${o}`);const g=e.binaryName+b,F=c(d,o.replace(/\.(tar\.gz|zip)$/,""));let h=[c(F,g),c(d,g)].find(P=>y(P));if(h||(h=K(d,g)??void 0),h)k(h,w);else throw new Error(`Binary not found in archive: expected ${g} under ${d}`);t!=="win32"&&U(w,493)}finally{S(p,{force:!0}),S(d,{recursive:!0,force:!0})}return w}s(Q,"downloadTool");const Y={fd:"fd",rg:"ripgrep"};async function ee(n,e){const t=H(n);if(t)return t;const r=x[n];if(r){if(C()){e?.({type:"warning",message:`${r.name} not found. Offline mode enabled, skipping download.`});return}if(f()==="android"){const i=Y[n]??n;e?.({type:"warning",message:`${r.name} not found. Install with: pkg install ${i}`});return}if(!T(f(),$())){e?.({type:"warning",message:`${r.name} not found. Automatic download is not supported on ${f()}/${$()}. Install ${r.name} with your system package manager.`});return}e?.({type:"info",message:`${r.name} not found. Downloading...`});try{const i=await Q(n);return e?.({type:"info",message:`${r.name} installed to ${i}`}),i}catch(i){const a=[];for(let o=i,l=0;o instanceof Error&&l<5;o=o.cause,l++)a.includes(o.message)||a.push(o.message);e?.({type:"warning",message:`Failed to download ${r.name}: ${a.length>0?a.join(": "):String(i)}`});return}}}s(ee,"ensureTool");function ne(n){return(/(?:^|[\s:])(rg|fd): (?:command )?not found/m.exec(n)??/command not found: (rg|fd)\b/.exec(n)??/Unknown command:? '?(rg|fd)'?/.exec(n))?.[1]}s(ne,"missingManagedTool");async function pe(n,e=ee){const t=ne(n);if(!t)return;const r=await e(t);return r?`[${t} was not installed; it is now (${r}). Run the command again.]`:t==="rg"?"[rg is not available on this machine. Use the grep tool, or `grep -rn` instead.]":"[fd is not available on this machine. Use the find tool, or `find` instead.]"}s(pe,"missingManagedToolHint");export{ee as ensureTool,V as getLatestVersion,H as getToolPath,ne as missingManagedTool,pe as missingManagedToolHint};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var o=Object.defineProperty;var n=(r,t)=>o(r,"name",{value:t,configurable:!0});import{replaceControlCharacters as e}from"@earendil-works/pi-tui";function p(r){if(!URL.canParse(r))return;const t=new URL(r);return t.protocol==="https:"||t.protocol==="http:"?t.href:void 0}n(p,"webUrl");function i(r){return p(r)??e(r)}n(i,"displayUrl");export{i as displayUrl,p as webUrl};
|
|
@@ -23,9 +23,10 @@ cp permission-gate.ts ~/.dal/agent/extensions/
|
|
|
23
23
|
| `protected-paths.ts` | Blocks writes to protected paths (.env, .git/, node_modules/) |
|
|
24
24
|
| `confirm-destructive.ts` | Confirms before destructive session actions (clear, switch, fork) |
|
|
25
25
|
| `dirty-repo-guard.ts` | Prevents session changes with uncommitted git changes |
|
|
26
|
-
| `sandbox/` | OS-level sandboxing using `@anthropic-ai/sandbox-runtime` with per-project config |
|
|
27
26
|
| `gondolin/` | Route built-in tools and `!` commands into a Gondolin micro-VM |
|
|
28
27
|
|
|
28
|
+
For isolation setup and limitations, see [Run Pi in an isolated environment](../../docs/containerization.md).
|
|
29
|
+
|
|
29
30
|
### Custom Tools
|
|
30
31
|
|
|
31
32
|
| Extension | Description |
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
"name": "pi-extension-custom-provider-gitlab-duo",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "1.0.51",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"clean": "echo 'nothing to clean'",
|
|
8
|
+
"build": "echo 'nothing to build'",
|
|
9
|
+
"check": "echo 'nothing to check'"
|
|
10
|
+
},
|
|
11
|
+
"pi": {
|
|
12
|
+
"extensions": [
|
|
13
|
+
"./index.ts"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
16
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* as expandable custom entries.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
10
10
|
import { Box, Text } from "@earendil-works/pi-tui";
|
|
11
11
|
|
|
12
12
|
const ENTRY_TYPE = "debug-provider-events";
|
|
@@ -24,7 +24,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
24
24
|
let activeEvents: unknown[] | undefined;
|
|
25
25
|
let completedEntry: ProviderDebugEntry | undefined;
|
|
26
26
|
|
|
27
|
-
pi.registerEntryRenderer<ProviderDebugEntry>(ENTRY_TYPE, (entry, { expanded }, theme) => {
|
|
27
|
+
pi.registerEntryRenderer<ProviderDebugEntry>(ENTRY_TYPE, (entry, { expanded, keyHint }, theme) => {
|
|
28
28
|
const data = entry.data;
|
|
29
29
|
if (!data) return new Text(theme.fg("warning", "[provider debug] Missing event data"), 0, 0);
|
|
30
30
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-gondolin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.51",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-gondolin",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "1.0.51",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@earendil-works/gondolin": "0.
|
|
11
|
+
"@earendil-works/gondolin": "0.14.0"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"node_modules/@cto.af/wtf8": {
|
|
@@ -21,31 +21,30 @@
|
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
"node_modules/@earendil-works/gondolin": {
|
|
24
|
-
"version": "0.
|
|
25
|
-
"resolved": "https://registry.npmjs.org/@earendil-works/gondolin/-/gondolin-0.
|
|
26
|
-
"integrity": "sha512-
|
|
24
|
+
"version": "0.14.0",
|
|
25
|
+
"resolved": "https://registry.npmjs.org/@earendil-works/gondolin/-/gondolin-0.14.0.tgz",
|
|
26
|
+
"integrity": "sha512-MSw+EGcqFJeyKHdXEfm+nMRr74ytT4x8DGIohav0oPCHeVQAB9AajquM94cv2xqvIU3VDAaZZVC07IXsOY6OVQ==",
|
|
27
27
|
"license": "Apache-2.0",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"cbor2": "^2.3.0",
|
|
30
|
-
"node-forge": "^1.3.3",
|
|
31
30
|
"ssh2": "^1.17.0",
|
|
32
|
-
"undici": "^6.
|
|
31
|
+
"undici": "^6.29.0"
|
|
33
32
|
},
|
|
34
33
|
"bin": {
|
|
35
34
|
"gondolin": "dist/bin/gondolin.js"
|
|
36
35
|
},
|
|
37
36
|
"engines": {
|
|
38
|
-
"node": ">=
|
|
37
|
+
"node": ">=22.19.0"
|
|
39
38
|
},
|
|
40
39
|
"optionalDependencies": {
|
|
41
|
-
"@earendil-works/gondolin-krun-runner-darwin-arm64": "0.
|
|
42
|
-
"@earendil-works/gondolin-krun-runner-linux-x64": "0.
|
|
40
|
+
"@earendil-works/gondolin-krun-runner-darwin-arm64": "0.14.0",
|
|
41
|
+
"@earendil-works/gondolin-krun-runner-linux-x64": "0.14.0"
|
|
43
42
|
}
|
|
44
43
|
},
|
|
45
44
|
"node_modules/@earendil-works/gondolin-krun-runner-darwin-arm64": {
|
|
46
|
-
"version": "0.
|
|
47
|
-
"resolved": "https://registry.npmjs.org/@earendil-works/gondolin-krun-runner-darwin-arm64/-/gondolin-krun-runner-darwin-arm64-0.
|
|
48
|
-
"integrity": "sha512-
|
|
45
|
+
"version": "0.14.0",
|
|
46
|
+
"resolved": "https://registry.npmjs.org/@earendil-works/gondolin-krun-runner-darwin-arm64/-/gondolin-krun-runner-darwin-arm64-0.14.0.tgz",
|
|
47
|
+
"integrity": "sha512-fvuhz1CZPaEbmXC0luZoXd1obAb0bjaaGJz33Jo63bhMlosYunAahItakh7cU0dnTlNFzufOSnpGOPqtuYjnpQ==",
|
|
49
48
|
"cpu": [
|
|
50
49
|
"arm64"
|
|
51
50
|
],
|
|
@@ -59,9 +58,9 @@
|
|
|
59
58
|
}
|
|
60
59
|
},
|
|
61
60
|
"node_modules/@earendil-works/gondolin-krun-runner-linux-x64": {
|
|
62
|
-
"version": "0.
|
|
63
|
-
"resolved": "https://registry.npmjs.org/@earendil-works/gondolin-krun-runner-linux-x64/-/gondolin-krun-runner-linux-x64-0.
|
|
64
|
-
"integrity": "sha512-
|
|
61
|
+
"version": "0.14.0",
|
|
62
|
+
"resolved": "https://registry.npmjs.org/@earendil-works/gondolin-krun-runner-linux-x64/-/gondolin-krun-runner-linux-x64-0.14.0.tgz",
|
|
63
|
+
"integrity": "sha512-91iw4smoOH/yOoAuQS6N2UZOxqSFwRhtk8rTyrokXBoWiWcveAzg4kHvnLcm40ZlNrWwzIDFrere4bkZeGDQcA==",
|
|
65
64
|
"cpu": [
|
|
66
65
|
"x64"
|
|
67
66
|
],
|
|
@@ -134,15 +133,6 @@
|
|
|
134
133
|
"license": "MIT",
|
|
135
134
|
"optional": true
|
|
136
135
|
},
|
|
137
|
-
"node_modules/node-forge": {
|
|
138
|
-
"version": "1.4.0",
|
|
139
|
-
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.4.0.tgz",
|
|
140
|
-
"integrity": "sha512-LarFH0+6VfriEhqMMcLX2F7SwSXeWwnEAJEsYm5QKWchiVYVvJyV9v7UDvUv+w5HO23ZpQTXDv/GxdDdMyOuoQ==",
|
|
141
|
-
"license": "(BSD-3-Clause OR GPL-2.0)",
|
|
142
|
-
"engines": {
|
|
143
|
-
"node": ">= 6.13.0"
|
|
144
|
-
}
|
|
145
|
-
},
|
|
146
136
|
"node_modules/safer-buffer": {
|
|
147
137
|
"version": "2.1.2",
|
|
148
138
|
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
|
@@ -173,9 +163,9 @@
|
|
|
173
163
|
"license": "Unlicense"
|
|
174
164
|
},
|
|
175
165
|
"node_modules/undici": {
|
|
176
|
-
"version": "6.
|
|
177
|
-
"resolved": "https://registry.npmjs.org/undici/-/undici-6.
|
|
178
|
-
"integrity": "sha512-
|
|
166
|
+
"version": "6.29.1",
|
|
167
|
+
"resolved": "https://registry.npmjs.org/undici/-/undici-6.29.1.tgz",
|
|
168
|
+
"integrity": "sha512-EvRlUt/QqAEvXdQeRMYUfwOQsfzpDztykrG2owGEE/rBOBoYv9uF39ZzsNDh4lTFHhTr2XOZjKkYgueD12ZmGA==",
|
|
179
169
|
"license": "MIT",
|
|
180
170
|
"engines": {
|
|
181
171
|
"node": ">=18.17"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-gondolin",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "1.0.51",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"clean": "echo 'nothing to clean'",
|
|
@@ -14,6 +14,6 @@
|
|
|
14
14
|
]
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@earendil-works/gondolin": "0.
|
|
17
|
+
"@earendil-works/gondolin": "0.14.0"
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -16,7 +16,7 @@ import type { AgentMessage } from "@earendil-works/pi-agent-core";
|
|
|
16
16
|
import type { AssistantMessage, TextContent } from "@earendil-works/pi-ai";
|
|
17
17
|
import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
18
18
|
import { Key } from "@earendil-works/pi-tui";
|
|
19
|
-
import { extractTodoItems, isSafeCommand, markCompletedSteps, type TodoItem } from "./utils.ts";
|
|
19
|
+
import { allStepsComplete, extractTodoItems, isSafeCommand, markCompletedSteps, type TodoItem } from "./utils.ts";
|
|
20
20
|
|
|
21
21
|
// Tools
|
|
22
22
|
const PLAN_MODE_TOOLS = ["read", "bash", "grep", "find", "ls", "questionnaire"];
|
|
@@ -36,11 +36,16 @@ function isAssistantMessage(m: AgentMessage): m is AssistantMessage {
|
|
|
36
36
|
return m.role === "assistant" && Array.isArray(m.content);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
// Extract text content from an assistant message
|
|
39
|
+
// Extract text content from an assistant message.
|
|
40
|
+
// Includes thinking blocks: with reasoning-max models the [DONE:n] tags and
|
|
41
|
+
// plan drafts usually land in thinking, not the visible text.
|
|
40
42
|
function getTextContent(message: AssistantMessage): string {
|
|
41
43
|
return message.content
|
|
42
|
-
.
|
|
43
|
-
|
|
44
|
+
.map((block) => {
|
|
45
|
+
if (block.type === "text") return block.text;
|
|
46
|
+
if (block.type === "thinking") return (block as { thinking?: string }).thinking ?? "";
|
|
47
|
+
return "";
|
|
48
|
+
})
|
|
44
49
|
.join("\n");
|
|
45
50
|
}
|
|
46
51
|
|
|
@@ -247,10 +252,9 @@ After completing a step, include a [DONE:n] tag in your response.`,
|
|
|
247
252
|
if (!executionMode || todoItems.length === 0) return;
|
|
248
253
|
if (!isAssistantMessage(event.message)) return;
|
|
249
254
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
}
|
|
255
|
+
markCompletedSteps(getTextContent(event.message), todoItems);
|
|
256
|
+
// Always refresh: cheap, keeps the widget consistent even when nothing matched.
|
|
257
|
+
updateStatus(ctx);
|
|
254
258
|
persistState();
|
|
255
259
|
});
|
|
256
260
|
|
|
@@ -258,11 +262,18 @@ After completing a step, include a [DONE:n] tag in your response.`,
|
|
|
258
262
|
pi.on("agent_end", async (event, ctx) => {
|
|
259
263
|
// Check if execution is complete
|
|
260
264
|
if (executionMode && todoItems.length > 0) {
|
|
265
|
+
// Fallback: the model wrapped up without [DONE:n] tags ("All steps complete").
|
|
266
|
+
const lastAssistant = [...event.messages].reverse().find(isAssistantMessage);
|
|
267
|
+
if (lastAssistant && allStepsComplete(getTextContent(lastAssistant))) {
|
|
268
|
+
for (const t of todoItems) t.completed = true;
|
|
269
|
+
}
|
|
261
270
|
if (todoItems.every((t) => t.completed)) {
|
|
262
271
|
const completedList = todoItems.map((t) => `~~${t.text}~~`).join("\n");
|
|
263
272
|
pi.sendMessage(
|
|
264
273
|
{ customType: "plan-complete", content: `**Plan Complete!** ✓\n\n${completedList}`, display: true },
|
|
265
|
-
|
|
274
|
+
// nextTurn: delivered with the next user prompt instead of triggering an
|
|
275
|
+
// extra (expensive, reasoning-max) LLM turn to acknowledge the card.
|
|
276
|
+
{ deliverAs: "nextTurn" },
|
|
266
277
|
);
|
|
267
278
|
executionMode = false;
|
|
268
279
|
todoItems = [];
|
|
@@ -120,26 +120,30 @@ export function cleanStepText(text: string): string {
|
|
|
120
120
|
if (cleaned.length > 0) {
|
|
121
121
|
cleaned = cleaned.charAt(0).toUpperCase() + cleaned.slice(1);
|
|
122
122
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
123
|
+
// Keep full text: the exec message and widget display need the whole step.
|
|
124
|
+
// The widget truncates for display (see updateStatus in index.ts).
|
|
126
125
|
return cleaned;
|
|
127
126
|
}
|
|
128
127
|
|
|
129
128
|
export function extractTodoItems(message: string): TodoItem[] {
|
|
130
129
|
const items: TodoItem[] = [];
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
const
|
|
135
|
-
|
|
130
|
+
// Take the LAST "Plan:" section: since getTextContent includes thinking blocks,
|
|
131
|
+
// a draft in the reasoning block can precede the user-visible plan in the text
|
|
132
|
+
// block — the text block comes last in content order.
|
|
133
|
+
const headers = [...message.matchAll(/\*{0,2}Plan:\*{0,2}\s*\n/gi)];
|
|
134
|
+
if (headers.length === 0) return items;
|
|
135
|
+
const lastHeader = headers[headers.length - 1];
|
|
136
|
+
const planSection = message.slice((lastHeader.index ?? 0) + lastHeader[0].length);
|
|
137
|
+
// Full-line capture: step titles may contain bold/italic/backticks ("1. **Step** \`x\` …").
|
|
138
|
+
// cleanStepText strips the markdown; / and - items are still skipped below.
|
|
139
|
+
const numberedPattern = /^\s*(\d+)[.)]\s+(.+)$/gm;
|
|
136
140
|
|
|
137
141
|
for (const match of planSection.matchAll(numberedPattern)) {
|
|
138
142
|
const text = match[2]
|
|
139
143
|
.trim()
|
|
140
144
|
.replace(/\*{1,2}$/, "")
|
|
141
145
|
.trim();
|
|
142
|
-
if (text.length > 5 && !text.startsWith("
|
|
146
|
+
if (text.length > 5 && !text.startsWith("/") && !text.startsWith("-")) {
|
|
143
147
|
const cleaned = cleanStepText(text);
|
|
144
148
|
if (cleaned.length > 3) {
|
|
145
149
|
items.push({ step: items.length + 1, text: cleaned, completed: false });
|
|
@@ -151,18 +155,40 @@ export function extractTodoItems(message: string): TodoItem[] {
|
|
|
151
155
|
|
|
152
156
|
export function extractDoneSteps(message: string): number[] {
|
|
153
157
|
const steps: number[] = [];
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
158
|
+
// Canonical and bracket variants: [DONE:1], [DONE: 1], [DONE 1], [Done:1]
|
|
159
|
+
for (const match of message.matchAll(/\[DONE\s*:?\s*(\d+)\]/gi)) {
|
|
160
|
+
steps.push(Number(match[1]));
|
|
161
|
+
}
|
|
162
|
+
// "Done: 1" without brackets
|
|
163
|
+
for (const match of message.matchAll(/\bDone\s*:\s*(\d+)\b/gi)) {
|
|
164
|
+
steps.push(Number(match[1]));
|
|
165
|
+
}
|
|
166
|
+
// "Step 1 done", "Step 2 is complete", "Step 3 finished" — adjacency-anchored,
|
|
167
|
+
// so "Step 9 is not done" / "Step 9 incomplete" never match.
|
|
168
|
+
for (const match of message.matchAll(/\bStep\s*(\d+)\s+(?:is\s+)?(?:done|complete|completed|finished)\b/gi)) {
|
|
169
|
+
steps.push(Number(match[1]));
|
|
157
170
|
}
|
|
158
|
-
return steps;
|
|
171
|
+
return [...new Set(steps)];
|
|
159
172
|
}
|
|
160
173
|
|
|
161
174
|
export function markCompletedSteps(text: string, items: TodoItem[]): number {
|
|
162
175
|
const doneSteps = extractDoneSteps(text);
|
|
176
|
+
let marked = 0;
|
|
163
177
|
for (const step of doneSteps) {
|
|
164
|
-
const item = items.find((t) => t.step === step);
|
|
165
|
-
if (item)
|
|
178
|
+
const item = items.find((t) => t.step === step && !t.completed);
|
|
179
|
+
if (item) {
|
|
180
|
+
item.completed = true;
|
|
181
|
+
marked++;
|
|
182
|
+
}
|
|
166
183
|
}
|
|
167
|
-
return
|
|
184
|
+
return marked;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// Whole-plan completion phrasing, used as a fallback when the model summarizes
|
|
188
|
+
// without [DONE:n] tags. Only consulted on the run's final message (agent_end).
|
|
189
|
+
export function allStepsComplete(message: string): boolean {
|
|
190
|
+
return (
|
|
191
|
+
/(?:all|every)\s+steps?\s+(?:are|is\s+)?(?:done|complete|completed|finished)/i.test(message) ||
|
|
192
|
+
/\b(?:the\s+)?plan\s+(?:is\s+)?(?:complete|completed|done)\b/i.test(message)
|
|
193
|
+
);
|
|
168
194
|
}
|
|
@@ -252,6 +252,8 @@ export default function presetExtension(pi: ExtensionAPI) {
|
|
|
252
252
|
container.addChild(new DynamicBorder((str) => theme.fg("accent", str)));
|
|
253
253
|
|
|
254
254
|
return {
|
|
255
|
+
// Let PageUp/PageDown page the list instead of scrolling the fullscreen transcript.
|
|
256
|
+
capturesViewportInput: selectList.capturesViewportInput,
|
|
255
257
|
render(width: number) {
|
|
256
258
|
return container.render(width);
|
|
257
259
|
},
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Reload Runtime Extension
|
|
3
3
|
*
|
|
4
4
|
* Demonstrates ctx.reload() from ExtensionCommandContext and an LLM-callable
|
|
5
|
-
* tool that
|
|
5
|
+
* tool that requests a reload once the agent has settled.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
@@ -19,19 +19,31 @@ export default function (pi: ExtensionAPI) {
|
|
|
19
19
|
},
|
|
20
20
|
});
|
|
21
21
|
|
|
22
|
-
// LLM-callable tool. Tools
|
|
23
|
-
//
|
|
22
|
+
// LLM-callable tool. Tools do not receive ExtensionCommandContext, so they cannot call
|
|
23
|
+
// ctx.reload(), and Pi cannot reload while the agent is running. The tool records the
|
|
24
|
+
// request and ends the run; the agent_settled handler then runs the command above.
|
|
25
|
+
let reloadRequested = false;
|
|
26
|
+
|
|
24
27
|
pi.registerTool({
|
|
25
28
|
name: "reload_runtime",
|
|
26
29
|
label: "Reload Runtime",
|
|
27
30
|
description: "Reload extensions, skills, prompts, themes, and context files",
|
|
28
31
|
parameters: Type.Object({}),
|
|
29
32
|
async execute() {
|
|
30
|
-
|
|
33
|
+
reloadRequested = true;
|
|
31
34
|
return {
|
|
32
|
-
content: [{ type: "text", text: "
|
|
35
|
+
content: [{ type: "text", text: "Reload requested. Pi reloads after this response." }],
|
|
33
36
|
details: {},
|
|
37
|
+
terminate: true,
|
|
34
38
|
};
|
|
35
39
|
},
|
|
36
40
|
});
|
|
41
|
+
|
|
42
|
+
pi.on("agent_settled", () => {
|
|
43
|
+
if (!reloadRequested) return;
|
|
44
|
+
reloadRequested = false;
|
|
45
|
+
// Sent from agent_settled, the command runs after every settled handler finishes, while
|
|
46
|
+
// the agent is idle. expandPromptTemplates dispatches it as a command, not as model input.
|
|
47
|
+
pi.sendUserMessage("/reload-runtime", { expandPromptTemplates: true });
|
|
48
|
+
});
|
|
37
49
|
}
|
|
@@ -8,7 +8,7 @@ Delegate tasks to specialized subagents with isolated context windows.
|
|
|
8
8
|
- **Streaming output**: See tool calls and progress as they happen
|
|
9
9
|
- **Parallel streaming**: All parallel tasks stream updates simultaneously
|
|
10
10
|
- **Markdown rendering**: Final output rendered with proper formatting (expanded view)
|
|
11
|
-
- **Usage
|
|
11
|
+
- **Usage display**: Shows turns, tokens, cost, and context usage inside each subagent result
|
|
12
12
|
- **Abort support**: Ctrl+C propagates to kill subagent processes
|
|
13
13
|
|
|
14
14
|
## Structure
|
|
@@ -62,7 +62,7 @@ This tool executes a separate `pi` subprocess with a delegated system prompt and
|
|
|
62
62
|
|
|
63
63
|
To enable project-local agents, pass `agentScope: "both"` (or `"project"`). Only do this for repositories you trust.
|
|
64
64
|
|
|
65
|
-
When running interactively, the tool prompts for confirmation before running project-local agents
|
|
65
|
+
When running interactively, the tool prompts for confirmation before running project-local agents unless the session trust context reports trusted and the agents come from that session project's `.dal/agents` directory. Agents loaded from another task `cwd` still require confirmation. Set `confirmProjectAgents: false` to disable confirmation.
|
|
66
66
|
|
|
67
67
|
## Usage
|
|
68
68
|
|
|
@@ -112,8 +112,8 @@ Use a chain: first have scout find the read tool, then have planner suggest impr
|
|
|
112
112
|
**Parallel mode streaming**:
|
|
113
113
|
- Shows all tasks with live status (⏳ running, ✓ done, ✗ failed)
|
|
114
114
|
- Updates as each task makes progress
|
|
115
|
-
-
|
|
116
|
-
- Returns each completed task
|
|
115
|
+
- Distinguishes pending, running, completed, failed, and aborted tasks
|
|
116
|
+
- Returns each completed task summary to the parent model with its own 50 KB limit
|
|
117
117
|
- Returns failure diagnostics from stderr/error messages when a child exits before producing output
|
|
118
118
|
|
|
119
119
|
**Tool call formatting** (mimics built-in tools):
|
|
@@ -140,7 +140,7 @@ System prompt for the agent goes here.
|
|
|
140
140
|
When `model` is omitted, the subagent inherits the dispatching session's active model and thinking level.
|
|
141
141
|
|
|
142
142
|
**Locations:**
|
|
143
|
-
- `~/.dal/agent/agents/*.md` - User-level (
|
|
143
|
+
- `~/.dal/agent/agents/*.md` - User-level (with `agentScope: "user"` or `"both"`)
|
|
144
144
|
- `.dal/agents/*.md` - Project-level (only with `agentScope: "project"` or `"both"`)
|
|
145
145
|
|
|
146
146
|
Project agents override user agents with the same name when `agentScope: "both"`.
|
|
@@ -164,14 +164,17 @@ Project agents override user agents with the same name when `agentScope: "both"`
|
|
|
164
164
|
|
|
165
165
|
## Error Handling
|
|
166
166
|
|
|
167
|
-
- **Exit code != 0**: Tool returns error with stderr/output
|
|
168
|
-
- **
|
|
169
|
-
- **stopReason "
|
|
170
|
-
- **
|
|
167
|
+
- **Exit code != 0 or signal termination**: Tool returns an error with preserved stderr/output
|
|
168
|
+
- **Spawn errors**: Tool returns the spawn diagnostic
|
|
169
|
+
- **stopReason "error"**: LLM error is propagated with its error message
|
|
170
|
+
- **Abort**: Ctrl+C sends SIGTERM, escalates to SIGKILL after five seconds if needed, and preserves partial details/usage
|
|
171
|
+
- **Chain mode**: Stops at the first failing step and reports which step failed
|
|
171
172
|
|
|
172
173
|
## Limitations
|
|
173
174
|
|
|
174
175
|
- Output truncated to last 10 items in collapsed view (expand to see all)
|
|
175
|
-
-
|
|
176
|
-
-
|
|
176
|
+
- Single and chain output is capped at 50 KB/2,000 lines; full results remain in tool details
|
|
177
|
+
- Parallel output keeps a separate 50 KB budget per task, allowing up to roughly 400 KB across eight tasks
|
|
178
|
+
- Child usage is displayed in tool details but is not added to the calling session's usage totals
|
|
179
|
+
- Agents are snapshotted from each task's effective cwd when the tool invocation starts; relative task cwd values resolve from the session cwd
|
|
177
180
|
- Parallel mode limited to 8 tasks, 4 concurrent
|