dal-code 1.0.49 → 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 +1043 -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 +4 -3
- 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/image-budget.js +1 -0
- package/dist/node_modules/@dalcode/dal-workflow/src/index.js +4 -4
- 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
package/dist/core/bug-report.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var R=Object.defineProperty;var s=(e,t)=>R(e,"name",{value:t,configurable:!0});import*as g from"node:os";import{contentText as T,normalizeContext as x,uuidv7 as E}from"@earendil-works/pi-ai";import{APP_TITLE as h,VERSION as f}from"../config.js";import{getPiUserAgent as I}from"../utils/pi-user-agent.js";import{writeZipArchive as O}from"../utils/zip.js";import{completeSummarization as _,getSummarizationFailure as
|
|
1
|
+
var R=Object.defineProperty;var s=(e,t)=>R(e,"name",{value:t,configurable:!0});import*as g from"node:os";import{contentText as T,normalizeContext as x,uuidv7 as E}from"@earendil-works/pi-ai";import{APP_TITLE as h,VERSION as f}from"../config.js";import{getPiUserAgent as I}from"../utils/pi-user-agent.js";import{writeZipArchive as O}from"../utils/zip.js";import{completeSummarization as _,estimateTokens as b,getSummarizationFailure as k}from"./compaction/compaction.js";import{serializeConversation as M}from"./compaction/utils.js";import{convertToLlm as N}from"./messages.js";const H="pi.bug-report",y=1,v="<redacted>",P=/(?:^|[-_])(api[-_]?key|secret|token|password|passwd|credential|authorization|cookie)(?:$|[-_])/i;function w(e){return P.test(e.replace(/([a-z0-9])([A-Z])/g,"$1_$2"))}s(w,"isSensitiveKey");function u(e){const t=/^([a-z][a-z0-9+.-]*:)([a-z][a-z0-9+.-]*:\/\/.*)$/i.exec(e);if(t)return`${t[1]}${u(t[2])}`;try{const n=new URL(e);let o=!1;(n.username||n.password)&&(n.username="",n.password="",o=!0);for(const a of n.searchParams.keys())w(a)&&(n.searchParams.set(a,v),o=!0);return o?n.toString():e}catch{return e}}s(u,"redactUrl");function m(e){if(e!==void 0)return JSON.parse(JSON.stringify(e,(t,n)=>n!=null&&w(t)?v:typeof n=="string"?u(n):n))}s(m,"redactJsonValue");function S(e){const{deviceId:t,...n}=e;return m(n)}s(S,"redactSettings");function U(){const e=s(t=>process.env[t]||null,"env");return{version:f,userAgent:I(f),runtime:process.versions.bun?`bun/${process.versions.bun}`:`node/${process.version}`,platform:process.platform,arch:process.arch,osRelease:g.release(),osVersion:g.version(),shell:process.env.SHELL?.split(/[\\/]/).pop()||null,terminal:{term:e("TERM"),program:e("TERM_PROGRAM"),programVersion:e("TERM_PROGRAM_VERSION"),colorterm:e("COLORTERM"),tmux:!!process.env.TMUX,ssh:!!(process.env.SSH_CONNECTION||process.env.SSH_CLIENT||process.env.SSH_TTY),ci:!!process.env.CI},piEnvironmentVariables:Object.keys(process.env).filter(t=>t.startsWith("PI_")).sort()}}s(U,"collectEnvironment");function $(e){return{provider:e.provider,id:e.id,name:e.name,api:e.api,baseUrl:u(e.baseUrl),reasoning:e.reasoning,input:e.input,contextWindow:e.contextWindow,maxTokens:e.maxTokens,samplingParams:e.samplingParams?m(e.samplingParams):null,compat:e.compat?m(e.compat):null,thinkingLevelMap:e.thinkingLevelMap??null,headerNames:Object.keys(e.headers??{}).sort()}}s($,"describeModel");function A(e,t){const n=[];return t.auth.apiKey&&n.push("api_key"),t.auth.oauth&&n.push("oauth"),{id:t.id,name:t.name,baseUrl:t.baseUrl?u(t.baseUrl):null,headerNames:Object.keys(t.headers??{}).sort(),authTypes:n,authStatus:e.getProviderAuthStatus(t.id),usingOAuth:e.isUsingOAuth(t.id),registeredByExtension:e.getRegisteredProviderIds().includes(t.id)}}s(A,"describeProvider");function C(e){return{path:e.path,source:u(e.sourceInfo.source),scope:e.sourceInfo.scope,origin:e.sourceInfo.origin,hidden:e.hidden===!0}}s(C,"describeExtension");function q(e){const t=e.hint?.trim()||null,n=e.model?e.modelRuntime.getProvider(e.model.provider):void 0;return{schemaVersion:y,id:e.id??E(),createdAt:new Date().toISOString(),hint:t,environment:U(),session:{id:e.sessionId,included:e.includeSession,summaryIncluded:e.includeSummary,messageCount:e.messageCount,...e.includeSession?{cwd:e.cwd}:{}},model:e.model?$(e.model):null,provider:n?A(e.modelRuntime,n):null,thinkingLevel:e.thinkingLevel,extensions:e.extensions.map(C),extensionErrors:e.extensionErrors.map(({path:o,error:a})=>({path:o,error:a})),settings:{global:S(e.globalSettings),project:S(e.projectSettings)}}}s(q,"collectBugReportMetadata");function Z(e,t=[]){const n=e.getEntries(),o=[];let a=0;for(const i of n){if(i.type!=="message"||i.message.role!=="assistant")continue;a++;const r=i.message,c=r.diagnostics??[];c.length===0&&r.stopReason!=="error"&&r.stopReason!=="aborted"&&!r.errorMessage||o.push({entryId:i.id,timestamp:i.timestamp,provider:r.provider,model:r.model,api:r.api,stopReason:r.stopReason,...r.rawStopReason===void 0?{}:{rawStopReason:r.rawStopReason},...r.errorMessage===void 0?{}:{errorMessage:r.errorMessage},diagnostics:c})}return{schemaVersion:y,sessionId:e.getSessionId(),entryCount:n.length,assistantMessageCount:a,assistant:o,crashes:t.map(({notified:i,...r})=>r)}}s(Z,"collectBugReportDiagnostics");function B(e){const t=[{name:"report.json",contentType:"application/json",data:`${JSON.stringify(e.metadata,null,2)}
|
|
2
2
|
`},{name:"diagnostics.json",contentType:"application/json",data:`${JSON.stringify(e.diagnostics,null,2)}
|
|
3
3
|
`}];return e.sessionJsonl!==void 0&&t.push({name:"session.jsonl",contentType:"application/x-ndjson",data:e.sessionJsonl}),e.summary!==void 0&&t.push({name:"summary.md",contentType:"text/markdown",data:e.summary.endsWith(`
|
|
4
4
|
`)?e.summary:`${e.summary}
|
|
@@ -18,10 +18,10 @@ Numbered list, as specific as the transcript allows.
|
|
|
18
18
|
## Relevant details
|
|
19
19
|
Tool calls involved, files touched, model behavior, anything else that helps a developer reproduce or locate the problem.
|
|
20
20
|
|
|
21
|
-
Do not include file contents, secrets, or credentials from the transcript; refer to files by path only. Keep the report factual and concise.`;function z(e,t){const n=[];let o=0;for(let a=e.length-1;a>=0;a--){const i=e[a],r=
|
|
21
|
+
Do not include file contents, secrets, or credentials from the transcript; refer to files by path only. Keep the report factual and concise.`;function z(e,t){const n=[];let o=0;for(let a=e.length-1;a>=0;a--){const i=e[a],r=b(i);if(n.length>0&&o+r>t)break;n.push(i),o+=r}return n.reverse()}s(z,"selectMessages");async function ee(e){const{model:t}=e,n=t.contextWindow>0?t.contextWindow:128e3,o=z(e.messages,Math.floor(n*.6)),a=e.hint?.trim(),i=[o.length<e.messages.length?`Note: only the last ${o.length} of ${e.messages.length} messages are shown.`:void 0,`<conversation>
|
|
22
22
|
${M(N(o))}
|
|
23
23
|
</conversation>`,a?`<user-report>
|
|
24
24
|
${a}
|
|
25
25
|
</user-report>`:void 0,j].filter(l=>l!==void 0).join(`
|
|
26
26
|
|
|
27
|
-
`),r={maxTokens:Math.min(4096,t.maxTokens>0?t.maxTokens:Number.POSITIVE_INFINITY),signal:e.signal,apiKey:e.apiKey,headers:e.headers,env:e.env,sessionId:e.sessionId,...t.reasoning&&e.thinkingLevel&&e.thinkingLevel!=="off"?{reasoning:e.thinkingLevel}:{}},c=await _(t,x({systemPrompt:L,messages:[{role:"user",content:[{type:"text",text:i}],timestamp:Date.now()}]}),r,e.streamFn,e.retry);if(c.stopReason==="aborted")throw new Error("Bug report summary was cancelled");const p=
|
|
27
|
+
`),r={maxTokens:Math.min(4096,t.maxTokens>0?t.maxTokens:Number.POSITIVE_INFINITY),signal:e.signal,apiKey:e.apiKey,headers:e.headers,env:e.env,sessionId:e.sessionId,...t.reasoning&&e.thinkingLevel&&e.thinkingLevel!=="off"?{reasoning:e.thinkingLevel}:{}},c=await _(t,x({systemPrompt:L,messages:[{role:"user",content:[{type:"text",text:i}],timestamp:Date.now()}]}),r,e.streamFn,e.retry);if(c.stopReason==="aborted")throw new Error("Bug report summary was cancelled");const p=k(c,"Bug report summary");if(p)throw new Error(p);if(c.content.some(l=>l.type==="toolCall"))throw new Error("Bug report summary attempted to call a tool");const d=T(c.content).trim();if(!d)throw new Error("Bug report summary was empty");return d}s(ee,"generateBugReportSummary");export{H as BUG_REPORT_CUSTOM_ENTRY_TYPE,X as bugReportArchiveFileName,B as bugReportFiles,Z as collectBugReportDiagnostics,q as collectBugReportMetadata,ee as generateBugReportSummary,m as redactJsonValue,u as redactUrl,Q as writeBugReportArchive};
|
|
@@ -1,20 +1,8 @@
|
|
|
1
|
-
import { type Api, type
|
|
1
|
+
import { type Api, type CacheWarmingAction, type CacheWarmingDecision, type Context, type Model, type ModelsSimpleStreamOptions } from "@earendil-works/pi-ai";
|
|
2
2
|
import type { ModelRuntime } from "./model-runtime.ts";
|
|
3
3
|
import type { SessionManager, UsageEntry } from "./session-manager.ts";
|
|
4
4
|
import type { CacheWarmingMode } from "./settings-manager.ts";
|
|
5
|
-
export
|
|
6
|
-
export declare function getPromptCacheTtlMs(model: Model<Api>, options: SimpleStreamOptions | undefined): number | undefined;
|
|
7
|
-
export declare function isReplayable(model: Model<Api>, options: SimpleStreamOptions | undefined): boolean;
|
|
8
|
-
export type CacheWarmingAction = "warm" | "stop";
|
|
9
|
-
export interface CacheWarmingDecision {
|
|
10
|
-
phase: "streaming" | "idle";
|
|
11
|
-
warmCost: number;
|
|
12
|
-
missCost: number;
|
|
13
|
-
continuationProbability: number;
|
|
14
|
-
expectedSavings: number;
|
|
15
|
-
economicsAvailable: boolean;
|
|
16
|
-
action: CacheWarmingAction;
|
|
17
|
-
}
|
|
5
|
+
export type { CacheWarmingAction, CacheWarmingDecision };
|
|
18
6
|
export interface CacheWarmingDecisionEvent extends Pick<CacheWarmingDecision, "warmCost" | "missCost" | "continuationProbability" | "action"> {
|
|
19
7
|
type: "cache_warming_decision";
|
|
20
8
|
}
|
|
@@ -57,4 +45,4 @@ export declare class CacheWarmer {
|
|
|
57
45
|
private evaluate;
|
|
58
46
|
}
|
|
59
47
|
export declare function formatCacheWarmingStatus(status: CacheWarmingStatus, now?: number): string;
|
|
60
|
-
export declare function formatCacheWarmingUsage(
|
|
48
|
+
export declare function formatCacheWarmingUsage(totalCost: number, note?: string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var m=Object.defineProperty;var c=(i,e)=>m(i,"name",{value:e,configurable:!0});import{CACHE_WARMING_MAX_AGE_MS as u,CACHE_WARMING_MAX_IDLE_AGE_MS as h,CACHE_WARMING_MINIMUM_EXPECTED_SAVINGS as p,evaluateCacheWarming as g,getCacheWarmingDelayMs as v,getCacheWarmingRequestOptions as M,getPromptCacheTtlMs as x,isCacheWarmingReplayable as b}from"@earendil-works/pi-ai";function A(i){for(let e=i.length-1;e>=0;e--){const t=i[e];if(t.type==="message"&&t.message.role==="assistant"){const n=t.message.usage;return n.input+n.cacheRead+n.cacheWrite}}return 0}c(A,"lastPromptTokens");class w{static{c(this,"CacheWarmer")}run;inactive;models;sessionManager;getMode;decide;onWarmed;constructor(e,t,n,s=async o=>o.action){this.models=e,this.sessionManager=t,this.getMode=n,this.decide=s,this.inactive={state:"inactive",reason:"waiting for first request"}}get status(){if(this.getMode()==="off")return{state:"inactive",reason:"cache warming disabled"};const e=this.run;if(!e)return this.inactive;if(!e.isCurrent())return{state:"inactive",reason:"conversation context changed"};const t=this.evaluate(e),n=e.timer===void 0;return!t.economicsAvailable&&!n?{state:"inactive",reason:"cache economics unavailable"}:{state:n?"refreshing":"scheduled",nextWarmAt:e.nextWarmAt,decision:t,extensionOverride:e.extensionOverride}}start(e,t){if(this.clearRun(),this.getMode()==="off"){this.stop("cache warming disabled");return}if(!b(e.model,e.options)){this.stop("request cannot be replayed safely");return}const s=x(e.model,e.options);if(s===void 0){this.stop(e.options.cacheRetention==="none"?"request disabled prompt caching":"cache lifetime unavailable");return}const o=v(s);if(o===void 0){this.stop("cache lifetime unavailable");return}this.run={...e,isCurrent:t,ttlMs:s,delayMs:o,refreshDeadlineAt:0,startedAt:Date.now(),controller:new AbortController,phase:"streaming",nextWarmAt:0,extensionOverride:!1},this.schedule(this.run)}onAgentSettled(){const e=this.run;if(!e)return;if(this.getMode()==="streaming"){this.stop("agent run settled");return}e.phase="idle";const t=e.startedAt+h;(e.nextWarmAt>t||Date.now()>=t)&&this.stop("30-minute idle safety limit reached")}onModeChanged(){const e=this.run;if(!e)return;const t=this.getModeStopReason(e);t&&this.stop(t)}cancel(){this.stop("inactive")}clearRun(){const e=this.run;e&&(this.run=void 0,e.timer&&clearTimeout(e.timer),e.controller.abort())}stop(e,t){this.clearRun(),this.inactive={state:"inactive",reason:e,...t}}schedule(e){e.extensionOverride=!1,e.nextWarmAt=Date.now()+e.delayMs,e.refreshDeadlineAt=e.nextWarmAt+Math.floor((e.ttlMs-e.delayMs)/2);const t=e.startedAt+(e.phase==="idle"?h:u);if(e.nextWarmAt>t||Date.now()>=t){this.stop(e.phase==="idle"?"30-minute idle safety limit reached":"one-hour safety limit reached");return}e.timer=setTimeout(()=>{this.refresh(e)},Math.max(0,e.nextWarmAt-Date.now())),e.timer.unref?.()}async refresh(e){if(e.timer=void 0,!this.validateRun(e)||this.refreshDeadlineMissed(e))return;const t=this.evaluate(e),{warmCost:n,missCost:s,continuationProbability:o}=t;let a=t.action;try{a=await this.decide({type:"cache_warming_decision",warmCost:n,missCost:s,continuationProbability:o,action:a})}catch{}if(!this.validateRun(e)||this.refreshDeadlineMissed(e))return;const d=a!==t.action;if(a==="stop"){const r=d?"stopped by extension":t.economicsAvailable?"expected savings below threshold":"cache economics unavailable";this.stop(r,{decision:t,extensionOverride:d});return}e.extensionOverride=d;try{const r=await this.models.streamSimple(e.model,e.context,M(e.options,e.controller.signal)).result();if(!this.validateRun(e))return;if(r.stopReason!=="error"&&r.stopReason!=="aborted"){const f=this.sessionManager.appendUsage("cache_warm",r.provider,r.responseModel??r.model,r.usage,d?"extension override":void 0);this.onWarmed?.(f)}}catch{}this.run===e&&this.schedule(e)}refreshDeadlineMissed(e){return Date.now()<=e.refreshDeadlineAt?!1:(this.stop("cache refresh deadline missed"),!0)}validateRun(e){if(this.run!==e)return!1;const t=this.getModeStopReason(e)??(e.isCurrent()?void 0:"conversation context changed");return t?(this.stop(t),!1):!0}getModeStopReason(e){const t=this.getMode();if(t==="off")return"cache warming disabled";if(t==="streaming"&&e.phase==="idle")return"agent run settled"}evaluate(e){return g(e.model,A(this.sessionManager.getBranch()),e.phase)}}function $(i){return i<0?`-$${Math.abs(i).toFixed(3)}`:`$${i.toFixed(3)}`}c($,"formatDollars");function l(i){if(!i.economicsAvailable)return"cache economics unavailable";const e=Math.round(i.continuationProbability*100),t=i.phase==="streaming"?`${e}% continuation probability while agent is running`:`${e}% continuation probability`,n=i.action==="warm"?">=":"<";return`${t}, expected savings ${$(i.expectedSavings)} ${n} $${p.toFixed(3)}`}c(l,"formatCacheWarmingEconomics");function y(i,e){if(i===void 0||i<=e)return"Decision now";let t=Math.ceil((i-e)/1e3);const n=Math.floor(t/3600);t%=3600;const s=Math.floor(t/60),o=t%60,a=[];return n>0&&a.push(`${n}h`),s>0&&a.push(`${s}m`),(o>0||a.length===0)&&a.push(`${o}s`),`Decision in ${a.join(" ")}`}c(y,"formatCacheWarmingDecisionTime");function D(i,e=Date.now()){const t=i.decision;if(!t||i.state==="inactive"&&!t.economicsAvailable&&!i.extensionOverride)return`Inactive (${i.reason??"unknown reason"})`;const n=i.extensionOverride?`extension override, ${l(t)}`:`${l(t)} -> ${t.action}`;return i.state==="inactive"?`Stopped (${n})`:i.state==="refreshing"?`Warming cache (${n})`:`${y(i.nextWarmAt,e)} (${n})`}c(D,"formatCacheWarmingStatus");function R(i,e){const t=e?` (${e})`:"",n=i.toFixed(6).replace(/(\.\d{3}\d*?)0+$/,"$1");return`Cache warmed${t}: $${n}`}c(R,"formatCacheWarmingUsage");export{w as CacheWarmer,D as formatCacheWarmingStatus,R as formatCacheWarmingUsage};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { AgentMessage, StreamFn } from "@earendil-works/pi-agent-core";
|
|
1
|
+
import type { AgentMessage, StreamFn, ThinkingLevel } from "@earendil-works/pi-agent-core";
|
|
2
2
|
import type { RetryCallbacks, RetryPolicy } from "@earendil-works/pi-ai";
|
|
3
3
|
import type { Model, Usage } from "@earendil-works/pi-ai/compat";
|
|
4
|
-
import type
|
|
4
|
+
import { type ReadonlySessionManager, type SessionEntry } from "../session-manager.ts";
|
|
5
5
|
import { type FileOperations } from "./utils.ts";
|
|
6
6
|
export interface BranchSummaryResult {
|
|
7
7
|
summary?: string;
|
|
@@ -31,6 +31,7 @@ export interface GenerateBranchSummaryOptions {
|
|
|
31
31
|
headers?: Record<string, string>;
|
|
32
32
|
env?: Record<string, string>;
|
|
33
33
|
signal: AbortSignal;
|
|
34
|
+
thinkingLevel?: ThinkingLevel;
|
|
34
35
|
customInstructions?: string;
|
|
35
36
|
replaceInstructions?: boolean;
|
|
36
37
|
reserveTokens?: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
1
|
+
var O=Object.defineProperty;var l=(e,o)=>O(e,"name",{value:o,configurable:!0});import{contentText as R,normalizeContext as E}from"@earendil-works/pi-ai";import{convertToLlm as I,createBranchSummaryMessage as z,createCompactionSummaryMessage as N,createCustomMessage as W}from"../messages.js";import{projectContextEntry as M}from"../session-manager.js";import{completeSummarization as D,estimateTokens as U,getSummarizationFailure as $}from"./compaction.js";import{computeFileLists as H,createFileOps as K,extractFileOpsFromMessage as Y,formatFileOperations as q,SUMMARIZATION_SYSTEM_PROMPT as L,serializeConversation as j}from"./utils.js";function re(e,o,a){if(!o)return{entries:[],commonAncestorId:null};const i=new Set(e.getBranch(o).map(t=>t.id)),r=e.getBranch(a);let c=null;for(let t=r.length-1;t>=0;t--)if(i.has(r[t].id)){c=r[t].id;break}const s=[];let n=o;for(;n&&n!==c;){const t=e.getEntry(n);if(!t)break;s.push(t),n=t.parentId}return s.reverse(),{entries:s,commonAncestorId:c}}l(re,"collectEntriesForBranchSummary");function G(e,o){switch(e.type){case"message":return e.message.role==="toolResult"?void 0:o?M(e,o)[0]:e.message;case"custom_message":return o?M(e,o)[0]:W(e.customType,e.content,e.display,e.details,e.timestamp);case"branch_summary":return z(e.summary,e.fromId,e.timestamp);case"compaction":return N(e.summary,e.tokensBefore,e.timestamp);case"thinking_level_change":case"model_change":case"custom":case"label":case"session_info":return}}l(G,"getMessageFromEntry");function X(e,o=0){const a=[],i=K();let r=0;for(const s of e)if(s.type==="branch_summary"&&!s.fromHook&&s.details){const n=s.details;if(Array.isArray(n.readFiles))for(const t of n.readFiles)i.read.add(t);if(Array.isArray(n.modifiedFiles))for(const t of n.modifiedFiles)i.edited.add(t)}const c=new Map;for(const s of e)s.type==="context_edit"&&c.set(s.targetId,s);for(let s=e.length-1;s>=0;s--){const n=e[s],t=G(n,c.get(n.id));if(!t)continue;Y(t,i);const m=U(t);if(o>0&&r+m>o){(n.type==="compaction"||n.type==="branch_summary")&&r<o*.9&&(a.unshift(t),r+=m);break}a.unshift(t),r+=m}return{messages:a,fileOps:i,totalTokens:r}}l(X,"prepareBranchEntries");const Z=`The user explored a different conversation branch before returning here.
|
|
2
2
|
Summary of that exploration:
|
|
3
3
|
|
|
4
|
-
`,
|
|
4
|
+
`,A=`Create a structured summary of this conversation branch for context when returning later.
|
|
5
5
|
|
|
6
6
|
Use this EXACT format:
|
|
7
7
|
|
|
@@ -28,10 +28,10 @@ Use this EXACT format:
|
|
|
28
28
|
## Next Steps
|
|
29
29
|
1. [What should happen next to continue this work]
|
|
30
30
|
|
|
31
|
-
Keep each section concise. Preserve exact file paths, function names, and error messages.`;async function
|
|
31
|
+
Keep each section concise. Preserve exact file paths, function names, and error messages.`;async function ae(e,o){const{model:a,apiKey:i,headers:r,env:c,signal:s,thinkingLevel:n,customInstructions:t,replaceInstructions:m,reserveTokens:b=16384,streamFn:k,retry:F,callbacks:T}=o,_=(a.contextWindow||128e3)-b,{messages:d,fileOps:v}=X(e,_);if(d.length===0)return{summary:"No content to summarize"};const w=I(d),S=j(w);let f;m&&t?f=t:t?f=`${A}
|
|
32
32
|
|
|
33
|
-
Additional focus: ${t}`:
|
|
33
|
+
Additional focus: ${t}`:f=A;const B=[{role:"user",content:[{type:"text",text:`<conversation>
|
|
34
34
|
${S}
|
|
35
35
|
</conversation>
|
|
36
36
|
|
|
37
|
-
${
|
|
37
|
+
${f}`}],timestamp:Date.now()}],C=E({systemPrompt:L,messages:B}),h={apiKey:i,headers:r,env:c,signal:s};a.reasoning&&n&&n!=="off"&&(h.reasoning=n);const u=await D(a,C,h,k,F,T);if(u.stopReason==="aborted")return{aborted:!0};const g=$(u,"Branch summarization");if(g)return{error:g};if(u.content.some(P=>P.type==="toolCall"))return{error:"Branch summarization attempted to call a tool"};let p=R(u.content);p=Z+p;const{readFiles:y,modifiedFiles:x}=H(v);return p+=q(y,x),{summary:p||"No summary generated",usage:u.usage,readFiles:y,modifiedFiles:x}}l(ae,"generateBranchSummary");export{re as collectEntriesForBranchSummary,ae as generateBranchSummary,X as prepareBranchEntries};
|
|
@@ -36,6 +36,7 @@ export declare function estimateProjectedContextTokens(projection: SessionProjec
|
|
|
36
36
|
export declare const MIN_COMPACTION_HEADROOM_TOKENS = 32000;
|
|
37
37
|
export declare function compactionThreshold(contextWindow: number, settings: CompactionSettings, baseTokens?: number): number;
|
|
38
38
|
export declare function shouldCompact(contextTokens: number, contextWindow: number, settings: CompactionSettings, baseTokens?: number): boolean;
|
|
39
|
+
export declare function estimateTokens(message: AgentMessage): number;
|
|
39
40
|
export declare function findTurnStartIndex(entries: SessionEntry[], entryIndex: number, startIndex: number): number;
|
|
40
41
|
export interface CutPointResult {
|
|
41
42
|
firstKeptEntryIndex: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var V=Object.defineProperty;var
|
|
1
|
+
var V=Object.defineProperty;var u=(e,t)=>V(e,"name",{value:t,configurable:!0});import{contentText as _,getCurrentSystemMessage as H,normalizeContext as J,retryAssistantCall as Y,uuidv7 as Q}from"@earendil-works/pi-ai";import{completeSimple as ee}from"@earendil-works/pi-ai/compat";import{convertToLlm as N}from"../messages.js";import{buildSessionProjection as te,sessionEntryToContextMessages as I}from"../session-manager.js";import{DEFAULT_COMPACTION_MAX_CONTEXT_TOKENS as ne}from"../settings-manager.js";import{combineUsage as se}from"../usage-totals.js";import{shrinkToolResultsForSummary as oe}from"./tool-output-pruning.js";import{computeFileLists as re,createFileOps as ie,extractFileOpsFromMessage as D,formatFileOperations as ae,SUMMARIZATION_SYSTEM_PROMPT as ce,serializeConversation as F}from"./utils.js";function ue(e,t,s){const n=ie();if(s>=0){const o=t[s];if(!o.fromHook&&o.details){const r=o.details;if(Array.isArray(r.readFiles))for(const a of r.readFiles)n.read.add(a);if(Array.isArray(r.modifiedFiles))for(const a of r.modifiedFiles)n.edited.add(a)}}for(const o of e)D(o,n);return n}u(ue,"extractFileOperations");function z(e){return e.sourceEntry.type==="compaction"?[]:e.messages.filter(t=>t.role!=="system")}u(z,"getMessagesFromProjectedEntryForCompaction");const _e={enabled:!0,reserveTokens:16384,keepRecentTokens:2e4};function K(e){return e.totalTokens||e.input+e.output+e.cacheRead+e.cacheWrite}u(K,"calculateContextTokens");function $(e){if(e.role==="assistant"&&"usage"in e){const t=e;if(t.stopReason!=="aborted"&&t.stopReason!=="error"&&t.usage&&K(t.usage)>0)return t.usage}}u($,"getAssistantUsage");function Ne(e){for(let t=e.length-1;t>=0;t--){const s=e[t];if(s.type==="message"){const n=$(s.message);if(n)return n}}}u(Ne,"getLastAssistantUsage");function le(e){for(let t=e.length-1;t>=0;t--){const s=$(e[t]);if(s)return{usage:s,index:t}}}u(le,"getLastAssistantUsageInfo");function me(e){const t=le(e);if(!t){let o=0;for(const r of e)o+=S(r);return{tokens:o,usageTokens:0,trailingTokens:o,lastUsageIndex:null}}const s=K(t.usage);let n=0;for(let o=t.index+1;o<e.length;o++)n+=S(e[o]);return{tokens:s+n,usageTokens:s,trailingTokens:n,lastUsageIndex:t.index}}u(me,"estimateContextTokens");function fe(e,t){const s=me(e.messages);if(s.lastUsageIndex!==null){let r=0,a;for(const m of e.entries){const c=r+m.messages.length;if(s.lastUsageIndex<c){a=m.sourceEntry.id;break}r=c}const l=a?t.findIndex(m=>m.id===a):-1;let f=-1;for(let m=t.length-1;m>=0;m--){const c=t[m];if(c.type==="context_edit"||c.type==="compaction"){f=m;break}}if(l>f)return s}const n=H(e.messages);let o=n?S(n):0;for(const r of e.messages)r.role!=="system"&&(o+=S(r));return{tokens:o,usageTokens:0,trailingTokens:o,lastUsageIndex:null}}u(fe,"estimateProjectedContextTokens");const de=32e3;function pe(e,t,s=0){const n=e-t.reserveTokens;if(!t.maxContextTokens)return n;if(t.maxContextTokens!==ne)return Math.min(n,t.maxContextTokens);const o=s+t.keepRecentTokens+de;return Math.min(n,Math.max(t.maxContextTokens,o))}u(pe,"compactionThreshold");function De(e,t,s,n=0){return s.enabled?e>pe(t,s,n):!1}u(De,"shouldCompact");const he=4800;function O(e){if(typeof e=="string")return e.length;let t=0;for(const s of e)s.type==="text"&&s.text?t+=s.text.length:s.type==="image"&&(t+=he);return t}u(O,"estimateTextAndImageContentChars");function S(e){let t=0;switch(e.role){case"system":{const s=e;if(t=O(s.content),s.sections)for(const n of Object.values(s.sections))n&&(t+=n.length);return s.toolsAdded&&(t+=JSON.stringify(s.toolsAdded).length),Math.ceil(t/4)}case"user":return t=O(e.content),Math.ceil(t/4);case"assistant":{const s=e;for(const n of s.content)n.type==="text"?t+=n.text.length:n.type==="thinking"?t+=n.thinking.length:n.type==="toolCall"&&(t+=n.name.length+JSON.stringify(n.arguments).length);return Math.ceil(t/4)}case"custom":case"toolResult":return t=O(e.content),Math.ceil(t/4);case"bashExecution":return t=e.command.length+e.output.length,Math.ceil(t/4);case"branchSummary":case"compactionSummary":return t=e.summary.length,Math.ceil(t/4)}return 0}u(S,"estimateTokens");function W(e){switch(e.role){case"user":case"assistant":case"bashExecution":case"custom":case"branchSummary":case"compactionSummary":return!0;case"toolResult":return!1}return!1}u(W,"isCutPointMessage");function j(e){switch(e.role){case"user":case"bashExecution":case"custom":case"branchSummary":case"compactionSummary":return!0;case"assistant":case"toolResult":return!1}return!1}u(j,"isTurnStartMessage");function L(e){return e.type==="compaction"?!1:I(e).some(j)}u(L,"isTurnStartEntry");function ge(e,t,s){const n=[];for(let o=t;o<s;o++){const r=e[o];r.type!=="compaction"&&I(r).some(W)&&n.push(o)}return n}u(ge,"findValidCutPoints");function ye(e,t,s){for(let n=t;n>=s;n--)if(L(e[n]))return n;return-1}u(ye,"findTurnStartIndex");function Fe(e,t,s,n){const o=ge(e,t,s);if(o.length===0)return{firstKeptEntryIndex:t,turnStartIndex:-1,isSplitTurn:!1};let r=0,a=o[0];for(let c=s-1;c>=t;c--){const h=e[c],y=I(h).reduce((x,p)=>x+S(p),0);if(y!==0&&(r+=y,r>=n)){a=o.find(x=>x>=c)??o[o.length-1];break}}for(;a>t;){const c=e[a-1];if(c.type==="compaction"||I(c).length>0)break;a--}const l=e[a],f=L(l),m=f?-1:ye(e,a,t);return{firstKeptEntryIndex:a,turnStartIndex:m,isSplitTurn:!f&&m!==-1}}u(Fe,"findCutPoint");const xe=`The messages above are a conversation to summarize. Create a structured context checkpoint summary that another LLM will use to continue the work.
|
|
2
2
|
|
|
3
3
|
Use this EXACT format:
|
|
4
4
|
|
|
@@ -37,7 +37,7 @@ Use this EXACT format:
|
|
|
37
37
|
- [Any data, examples, or references needed to continue: commands that work in this environment (package manager, how tests are run), ids, URLs, exact error messages]
|
|
38
38
|
- [Or "(none)" if not applicable]
|
|
39
39
|
|
|
40
|
-
Keep each section concise. Preserve exact file paths, function names, and error messages. Record facts that would otherwise have to be looked up again (git state, which commands work), so the work can continue without re-checking them.`,
|
|
40
|
+
Keep each section concise. Preserve exact file paths, function names, and error messages. Record facts that would otherwise have to be looked up again (git state, which commands work), so the work can continue without re-checking them.`,Te=`Update the existing structured summary with new information. RULES:
|
|
41
41
|
- PRESERVE all existing information from the previous summary
|
|
42
42
|
- ADD new progress, decisions, and context from the new messages
|
|
43
43
|
- UPDATE the Progress section: move items from "In Progress" to "Done" when completed
|
|
@@ -79,19 +79,19 @@ Use this EXACT format:
|
|
|
79
79
|
## Critical Context
|
|
80
80
|
- [Preserve important context, add new if needed]
|
|
81
81
|
|
|
82
|
-
Keep each section concise. Preserve exact file paths, function names, and error messages.`,
|
|
82
|
+
Keep each section concise. Preserve exact file paths, function names, and error messages.`,ke=`The messages above are NEW conversation messages to incorporate into the existing summary provided in <previous-summary> tags.
|
|
83
83
|
|
|
84
|
-
${
|
|
84
|
+
${Te}`;function B(e,t){if(e.stopReason==="error")return`${t} failed: ${e.errorMessage||"Unknown error"}`;if(e.stopReason==="length")return`${t} failed: generation hit the token cap and the summary is incomplete`}u(B,"getSummarizationFailure");function X(e,t,s,n,o,r,a){const l={signal:o,apiKey:t,headers:s,env:n,sessionId:a};return e.reasoning&&r&&r!=="off"&&(l.reasoning=r),l}u(X,"createSummarizationOptions");async function Z(e,t,s,n,o,r){const a={...s,cacheRetention:"none",sessionId:s.sessionId??Q()};return Y(u(async()=>n?(await n(e,t,a)).result():ee(e,t,a),"produce"),o,a.signal,r)}u(Z,"completeSummarization");async function ze(e,t,s,n,o,r,a,l,f,m,c,h,y,x){return(await A(e,t,s,n,o,r,a,l,f,m,c,h,y,x)).text}u(ze,"generateSummary");function q(e){return J({systemPrompt:ce,messages:[{role:"user",content:[{type:"text",text:e}],timestamp:Date.now()}]})}u(q,"buildSummarizationContext");async function A(e,t,s,n,o,r,a,l,f,m,c,h,y,x){let p=l?ke:xe;a&&(p=`${p}
|
|
85
85
|
|
|
86
|
-
Additional focus: ${
|
|
87
|
-
${
|
|
86
|
+
Additional focus: ${a}`);const g=N(e);let d=`<conversation>
|
|
87
|
+
${F(g)}
|
|
88
88
|
</conversation>
|
|
89
89
|
|
|
90
|
-
`;
|
|
91
|
-
${
|
|
90
|
+
`;l&&(d+=`<previous-summary>
|
|
91
|
+
${l}
|
|
92
92
|
</previous-summary>
|
|
93
93
|
|
|
94
|
-
`),d+=p;const k=
|
|
94
|
+
`),d+=p;const k=X(t,n,o,c,r,f,x),T=await Z(t,q(d),k,m,h,y),E=B(T,"Summarization");if(E)throw new Error(E);if(T.content.some(P=>P.type==="toolCall"))throw new Error("Summarization attempted to call a tool");return{text:_(T.content),usage:T.usage}}u(A,"generateSummaryWithUsage");function G(e){return e.sourceEntry.type==="compaction"?!1:e.messages.some(j)}u(G,"isProjectedTurnStart");function we(e,t,s){for(let n=t;n>=s;n--)if(G(e[n]))return n;return-1}u(we,"findProjectedTurnStartIndex");function Se(e,t,s,n){const o=[];for(let i=t;i<s;i++){const d=e[i];d.sourceEntry.type!=="compaction"&&d.messages.some(W)&&o.push(i)}if(o.length===0)return{firstKeptEntryIndex:t,turnStartIndex:-1,isSplitTurn:!1};let r=0,a=!1,l=o[0];for(let i=s-1;i>=t;i--){const d=e[i].messages.reduce((k,T)=>k+S(T),0);if(d!==0&&(r+=d,r>=n)){a=!0,l=o.find(k=>k>=i)??o[o.length-1];break}}const f=e.slice(l+1,s),m=u(i=>i.sourceEntry.type!=="context_edit"&&I(i.sourceEntry).length>0,"isIntrinsicallyVisible"),c=u(i=>m(i)&&i.messages.length===0,"isOmitted"),h=new Set(f.filter(c).map(i=>i.sourceEntry.id)),y=f.some(i=>i.sourceEntry.type==="context_edit"&&i.sourceEntry.replacement!==null&&!h.has(i.sourceEntry.targetId));for(a&&!y&&f.some(i=>i.sourceEntry.type==="message"&&i.sourceEntry.message.role==="assistant"&&c(i))&&f.every(i=>i.sourceEntry.type!=="compaction"&&(!m(i)||c(i)))&&l++;l>t;){const i=e[l-1];if(i.sourceEntry.type==="compaction"||i.messages.length>0)break;l--}const p=G(e[l]),g=p?-1:we(e,l,t);return{firstKeptEntryIndex:l,turnStartIndex:g,isSplitTurn:!p&&g!==-1}}u(Se,"findProjectedCutPoint");function Ke(e,t){if(e.length>0&&e[e.length-1].type==="compaction")return;const s=te(e),n=s.entries,o=n.map(d=>d.sourceEntry),r=n.findIndex(d=>d.sourceEntry.type==="compaction"&&d.messages.length>0);let a,l=0;r>=0&&(a=n[r].sourceEntry.summary,l=r+1);const f=n.length,m=fe(s,e).tokens,c=Se(n,l,f,t.keepRecentTokens),h=n[c.firstKeptEntryIndex]?.sourceEntry;if(!h?.id)return;const y=h.id,x=c.isSplitTurn?c.turnStartIndex:c.firstKeptEntryIndex,p=n.slice(l,x).flatMap(z),g=c.isSplitTurn?n.slice(c.turnStartIndex,c.firstKeptEntryIndex).flatMap(z):[];if(p.length===0&&g.length===0)return;const i=ue(p,o,r);if(c.isSplitTurn)for(const d of g)D(d,i);return{firstKeptEntryId:y,messagesToSummarize:p,turnPrefixMessages:g,isSplitTurn:c.isSplitTurn,tokensBefore:m,previousSummary:a,fileOps:i,settings:t}}u(Ke,"prepareCompaction");const Ee=`The messages above are earlier context from an ongoing conversation. Later messages are stored separately and do not need to be reconstructed.
|
|
95
95
|
|
|
96
96
|
Create a concise checkpoint of the user's request and the progress shown above. This checkpoint will be placed before the later messages so the conversation can continue with the necessary context.
|
|
97
97
|
|
|
@@ -107,16 +107,16 @@ Create a concise checkpoint of the user's request and the progress shown above.
|
|
|
107
107
|
## Context Needed to Continue
|
|
108
108
|
- [Information from these messages needed to understand the later work: commands that work here (package manager, how tests run), ids, exact error messages]
|
|
109
109
|
|
|
110
|
-
Only summarize information explicitly present above. Do not infer or recreate later messages.`;async function
|
|
110
|
+
Only summarize information explicitly present above. Do not infer or recreate later messages.`;async function $e(e,t,s,n,o,r,a,l,f,m,c,h){const{firstKeptEntryId:y,isSplitTurn:x,tokensBefore:p,previousSummary:g,fileOps:i,settings:d}=e,k=d.pruneToolOutputs===!1?w=>w:oe,T=k(e.messagesToSummarize),E=k(e.turnPrefixMessages);let C,P;if(x&&E.length>0){let w=g??"No prior history.",v;if(T.length>0){const U=await A(T,t,void 0,s,n,r,o,g,a,l,f,m,c,h);w=U.text,v=U.usage}const M=await Ce(E,t,s,n,f,r,a,l,m,c,h,o);C=`${w}
|
|
111
111
|
|
|
112
112
|
---
|
|
113
113
|
|
|
114
114
|
**Turn Context (split turn):**
|
|
115
115
|
|
|
116
|
-
${M.text}`,
|
|
117
|
-
${
|
|
116
|
+
${M.text}`,P=v?se(v,M.usage):M.usage}else{const w=await A(T,t,void 0,s,n,r,o,g,a,l,f,m,c,h);C=w.text,P=w.usage}const{readFiles:b,modifiedFiles:R}=re(i);if(C+=ae(b,R),!y)throw new Error("First kept entry has no UUID - session may need migration");return{summary:C,firstKeptEntryId:y,tokensBefore:p,usage:P,details:{readFiles:b,modifiedFiles:R}}}u($e,"compact");async function Ce(e,t,s,n,o,r,a,l,f,m,c,h){const y=N(e);let p=`# Conversation
|
|
117
|
+
${F(y)}
|
|
118
118
|
|
|
119
119
|
# Instructions
|
|
120
|
-
${
|
|
120
|
+
${Ee}`;h&&(p=`${p}
|
|
121
121
|
|
|
122
|
-
Additional focus: ${
|
|
122
|
+
Additional focus: ${h}`);const g=await Z(t,q(p),X(t,s,n,o,r,a,c),l,f,m),i=B(g,"Turn prefix summarization");if(i)throw new Error(i);if(g.content.some(d=>d.type==="toolCall"))throw new Error("Turn prefix summarization attempted to call a tool");return{text:_(g.content),usage:g.usage}}u(Ce,"generateTurnPrefixSummary");export{_e as DEFAULT_COMPACTION_SETTINGS,de as MIN_COMPACTION_HEADROOM_TOKENS,K as calculateContextTokens,$e as compact,pe as compactionThreshold,Z as completeSummarization,me as estimateContextTokens,fe as estimateProjectedContextTokens,S as estimateTokens,Fe as findCutPoint,ye as findTurnStartIndex,ze as generateSummary,A as generateSummaryWithUsage,Ne as getLastAssistantUsage,B as getSummarizationFailure,Ke as prepareCompaction,De as shouldCompact};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var N=Object.defineProperty;var u=(t,o)=>N(t,"name",{value:o,configurable:!0});import{estimateTokens as g}from"./
|
|
1
|
+
var N=Object.defineProperty;var u=(t,o)=>N(t,"name",{value:o,configurable:!0});import{estimateTokens as g}from"./compaction.js";const m="[Earlier tool output shortened to save context",R=600,y=8,$=15,P=20,E=300,L=/\b(?:error|errors|fail|failed|failure|failing|fatal|panic|exception|traceback|assert(?:ion)?|denied|segfault|cannot|unable)\b|✗|✘|×/i,O=/Full output: ([^\]\n]+?)(?:\]|$)/m;function I(t){const o=new Map;for(const n of t)if(n.role==="assistant")for(const e of n.content)e.type==="toolCall"&&o.set(e.id,e.arguments);return o}u(I,"toolArgs");function A(t,o){if(t.role!=="toolResult"||t.content.some(s=>s.type!=="text")||g(t)<R)return;const n=t.content.map(s=>s.type==="text"?s.text:"").join(`
|
|
2
2
|
`),e=S(n,t.toolName,o.get(t.toolCallId));return e===void 0?void 0:[{type:"text",text:e}]}u(A,"shrinkToolResult");function b(t){const o=I(t);return t.map(n=>{const e=A(n,o);return e?{...n,content:e}:n})}u(b,"shrinkToolResultsForSummary");function T(t){return t.length>E?`${t.slice(0,E)}\u2026`:t}u(T,"clipLine");function k(t,o,n){const e=O.exec(t)?.[1]?.trim();if(e)return`Full output: ${e} (read it if you need more).`;if(o==="bash"&&typeof n?.command=="string"){const l=n.command.replace(/\s+/g," ").trim();return`Re-run \`${l.length>200?`${l.slice(0,200)}\u2026`:l}\` if you need the full output.`}const s=typeof n?.path=="string"?n.path:typeof n?.file_path=="string"?n.file_path:"";return o==="read"&&s?`Re-read ${s} if you need it (it may have changed since).`:`Repeat the ${o} call if you need the full result.`}u(k,"recoveryHint");function S(t,o,n){if(t.includes(m))return;const e=t.split(`
|
|
3
3
|
`);if(e.length<=y+$+2){if(t.length<4*R)return;const c=t.slice(0,1200),d=t.slice(-1200),_=`${m}: ${t.length} chars \u2192 ${c.length+d.length} shown. ${k(t,o,n)}]
|
|
4
4
|
${c}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { AgentMessage } from "@earendil-works/pi-agent-core";
|
|
2
2
|
import { type Message } from "@earendil-works/pi-ai";
|
|
3
|
-
export declare function estimateTokens(message: AgentMessage): number;
|
|
4
3
|
export interface FileOperations {
|
|
5
4
|
read: Set<string>;
|
|
6
5
|
written: Set<string>;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
var
|
|
2
|
-
${e.join(`
|
|
3
|
-
`)}
|
|
4
|
-
</read-files>`),n.length>0&&t.push(`<modified-files>
|
|
1
|
+
var d=Object.defineProperty;var r=(n,e)=>d(n,"name",{value:e,configurable:!0});import{contentText as s}from"@earendil-works/pi-ai";import{sliceHead as p}from"../tools/truncate.js";function g(){return{read:new Set,written:new Set,edited:new Set}}r(g,"createFileOps");function w(n,e){if(n.role==="toolResult"){for(const t of n.nestedCalls?.calls??[])a(t.name,t.arguments,e);return}if(n.role==="assistant"&&!(!("content"in n)||!Array.isArray(n.content)))for(const t of n.content)typeof t!="object"||t===null||!("type"in t)||t.type!=="toolCall"||!("arguments"in t)||!("name"in t)||a(t.name,t.arguments,e)}r(w,"extractFileOpsFromMessage");function a(n,e,t){const o=typeof e?.path=="string"?e.path:void 0;if(o)switch(n){case"read":t.read.add(o);break;case"write":t.written.add(o);break;case"edit":t.edited.add(o);break}}r(a,"addFileOp");function A(n){const e=new Set([...n.edited,...n.written]),t=[...n.read].filter(i=>!e.has(i)).sort(),o=[...e].sort();return{readFiles:t,modifiedFiles:o}}r(A,"computeFileLists");function O(n,e){const t=[];return n.length>0&&t.push(`<read-files>
|
|
5
2
|
${n.join(`
|
|
6
3
|
`)}
|
|
4
|
+
</read-files>`),e.length>0&&t.push(`<modified-files>
|
|
5
|
+
${e.join(`
|
|
6
|
+
`)}
|
|
7
7
|
</modified-files>`),t.length===0?"":`
|
|
8
8
|
|
|
9
9
|
${t.join(`
|
|
10
10
|
|
|
11
|
-
`)}`}r(
|
|
11
|
+
`)}`}r(O,"formatFileOperations");const m=2e3;function h(n,e){if(n.length<=e)return n;const t=n.length-e;return`${p(n,e)}
|
|
12
12
|
|
|
13
|
-
[... ${t} more characters truncated]`}r(
|
|
13
|
+
[... ${t} more characters truncated]`}r(h,"truncateForSummary");function T(n){const e=[];for(const t of n)if(t.role==="user"){const o=s(t.content,"");o&&e.push(`[User]: ${o}`)}else if(t.role==="assistant"){const o=[];for(const i of t.content)if(i.type==="toolCall"){const c=i.arguments,u=Object.entries(c).map(([l,f])=>`${l}=${JSON.stringify(f)}`).join(", ");o.push(`${i.name}(${u})`)}t.content.some(i=>i.type==="text")&&e.push(`[Assistant]: ${s(t.content)}`),o.length>0&&e.push(`[Assistant tool calls]: ${o.join("; ")}`)}else if(t.role==="toolResult"){const o=s(t.content,"");o&&e.push(`[Tool result]: ${h(o,m)}`)}return e.join(`
|
|
14
14
|
|
|
15
|
-
`)}r(
|
|
15
|
+
`)}r(T,"serializeConversation");const b=`You are a context summarization assistant. Your task is to read a conversation between a user and an AI assistant, then produce a structured summary following the exact format specified.
|
|
16
16
|
|
|
17
|
-
Do NOT continue the conversation. Do NOT respond to any questions in the conversation. ONLY output the structured summary.`;export{
|
|
17
|
+
Do NOT continue the conversation. Do NOT respond to any questions in the conversation. ONLY output the structured summary.`;export{b as SUMMARIZATION_SYSTEM_PROMPT,A as computeFileLists,g as createFileOps,w as extractFileOpsFromMessage,O as formatFileOperations,T as serializeConversation};
|
package/dist/core/exec.d.ts
CHANGED
|
@@ -2,11 +2,13 @@ export interface ExecOptions {
|
|
|
2
2
|
signal?: AbortSignal;
|
|
3
3
|
timeout?: number;
|
|
4
4
|
cwd?: string;
|
|
5
|
+
maxBuffer?: number;
|
|
5
6
|
}
|
|
6
7
|
export interface ExecResult {
|
|
7
8
|
stdout: string;
|
|
8
9
|
stderr: string;
|
|
9
10
|
code: number;
|
|
10
11
|
killed: boolean;
|
|
12
|
+
truncated: boolean;
|
|
11
13
|
}
|
|
12
14
|
export declare function execCommand(command: string, args: string[], cwd: string, options?: ExecOptions): Promise<ExecResult>;
|
package/dist/core/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var y=Object.defineProperty;var u=(a,f)=>y(a,"name",{value:f,configurable:!0});import{constants as g}from"node:buffer";import{spawn as G}from"node:child_process";import{StringDecoder as b}from"node:string_decoder";import{waitForChildProcess as k}from"../utils/child-process.js";const x=Math.min(256*1024*1024,g.MAX_STRING_LENGTH),M=5e3;async function B(a,f,C,n){const l=n?.maxBuffer??x;if(!Number.isInteger(l)||l<0||l>g.MAX_STRING_LENGTH)throw new RangeError(`maxBuffer must be an integer between 0 and ${g.MAX_STRING_LENGTH} bytes`);const t=G(a,f,{cwd:C,shell:!1,stdio:["ignore","pipe","pipe"]});let c="",i="";const E=new b("utf8"),T=new b("utf8");let _=0,o=!1,d=!1,h,w;const s=u(()=>{d||(d=!0,t.kill("SIGTERM"),w=setTimeout(()=>{t.exitCode===null&&t.signalCode===null&&t.kill("SIGKILL")},M))},"killProcess");n?.signal&&(n.signal.aborted?s():n.signal.addEventListener("abort",s,{once:!0})),n?.timeout&&n.timeout>0&&(h=setTimeout(s,n.timeout));const L=u(e=>{if(o)return;const r=l-_;return e.length<=r?(_+=e.length,e):(o=!0,t.stdout?.destroy(),t.stderr?.destroy(),s(),r>0?e.subarray(0,r):void 0)},"takeWithinCap");t.stdout?.on("data",e=>{const r=L(e);r&&(c+=E.write(r))}),t.stderr?.on("data",e=>{const r=L(e);r&&(i+=T.write(r))});let m;try{m=await k(t)}catch(e){if(!(e instanceof Error))throw e;m=1,i||(i=e.message)}finally{clearTimeout(h),clearTimeout(w),n?.signal?.removeEventListener("abort",s)}o||(c+=E.end(),i+=T.end());const I=m??0;return{stdout:c,stderr:i,code:o&&I===0?1:I,killed:d,truncated:o}}u(B,"execCommand");export{B as execCommand};
|
|
@@ -687,6 +687,15 @@
|
|
|
687
687
|
display: block;
|
|
688
688
|
}
|
|
689
689
|
|
|
690
|
+
.system-entry > .message-timestamp {
|
|
691
|
+
padding-left: var(--line-height);
|
|
692
|
+
margin-bottom: 4px;
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
.system-entry > :last-child {
|
|
696
|
+
margin-bottom: 0;
|
|
697
|
+
}
|
|
698
|
+
|
|
690
699
|
.system-prompt.provider-prompt {
|
|
691
700
|
border-left: 3px solid var(--warning);
|
|
692
701
|
}
|