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
|
-
{"openai-responses":{"chat:grok-4.3":{"id":"grok-4.3","name":"Grok 4.3","api":"openai-responses","provider":"xai","baseUrl":"https://api.x.ai/v1","
|
|
1
|
+
{"openai-responses":{"chat:grok-4.3":{"id":"grok-4.3","name":"Grok 4.3","api":"openai-responses","provider":"xai","baseUrl":"https://api.x.ai/v1","reasoning":true,"input":["text","image"],"cost":{"input":1.25,"output":2.5,"cacheRead":0.2,"cacheWrite":0,"tiers":[{"inputTokensAbove":200000,"input":2.5,"output":5,"cacheRead":0.4,"cacheWrite":0}]},"contextWindow":1000000,"maxTokens":30000,"compat":{"supportsLongCacheRetention":false},"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":null},"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:grok-4.5":{"id":"grok-4.5","name":"Grok 4.5","api":"openai-responses","provider":"xai","baseUrl":"https://api.x.ai/v1","reasoning":true,"input":["text","image"],"cost":{"input":2,"output":6,"cacheRead":0.3,"cacheWrite":0,"tiers":[{"inputTokensAbove":200000,"input":4,"output":12,"cacheRead":0.6,"cacheWrite":0}]},"contextWindow":500000,"maxTokens":500000,"compat":{"supportsLongCacheRetention":false},"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":null},"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:grok-4.6":{"id":"grok-4.6","name":"Grok 4.6","api":"openai-responses","provider":"xai","baseUrl":"https://api.x.ai/v1","reasoning":true,"input":["text","image"],"cost":{"input":2,"output":6,"cacheRead":0.5,"cacheWrite":0,"tiers":[{"inputTokensAbove":200000,"input":4,"output":12,"cacheRead":1,"cacheWrite":0}]},"contextWindow":500000,"maxTokens":500000,"compat":{"supportsLongCacheRetention":false},"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":null},"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:grok-4.7":{"id":"grok-4.7","name":"Grok 4.7","api":"openai-responses","provider":"xai","baseUrl":"https://api.x.ai/v1","reasoning":true,"input":["text","image"],"cost":{"input":2,"output":6,"cacheRead":0.5,"cacheWrite":0,"tiers":[{"inputTokensAbove":200000,"input":4,"output":12,"cacheRead":1,"cacheWrite":0}]},"contextWindow":500000,"maxTokens":500000,"compat":{"supportsLongCacheRetention":false},"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":null},"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"}}}
|
package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi-token-plan-ams.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"openai-completions":{"chat:mimo-v2.6-flash":{"id":"mimo-v2.6-flash","name":"MiMo-V2.6-Flash","api":"openai-completions","provider":"xiaomi-token-plan-ams","baseUrl":"https://token-plan-ams.xiaomimimo.com/v1","
|
|
1
|
+
{"openai-completions":{"chat:mimo-v2.6-flash":{"id":"mimo-v2.6-flash","name":"MiMo-V2.6-Flash","api":"openai-completions","provider":"xiaomi-token-plan-ams","baseUrl":"https://token-plan-ams.xiaomimimo.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072,"compat":{"supportsStrictMode":true,"supportsReasoningEffort":false,"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek"},"thinkingLevelMap":{"off":"off","minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":null},"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:mimo-v2.6-pro":{"id":"mimo-v2.6-pro","name":"MiMo-V2.6-Pro","api":"openai-completions","provider":"xiaomi-token-plan-ams","baseUrl":"https://token-plan-ams.xiaomimimo.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072,"compat":{"supportsStrictMode":true,"supportsReasoningEffort":false,"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek"},"thinkingLevelMap":{"off":"off","minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":null},"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"}}}
|
package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi-token-plan-cn.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"openai-completions":{"chat:mimo-v2.6-flash":{"id":"mimo-v2.6-flash","name":"MiMo-V2.6-Flash","api":"openai-completions","provider":"xiaomi-token-plan-cn","baseUrl":"https://token-plan-cn.xiaomimimo.com/v1","
|
|
1
|
+
{"openai-completions":{"chat:mimo-v2.6-flash":{"id":"mimo-v2.6-flash","name":"MiMo-V2.6-Flash","api":"openai-completions","provider":"xiaomi-token-plan-cn","baseUrl":"https://token-plan-cn.xiaomimimo.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072,"compat":{"supportsStrictMode":true,"supportsReasoningEffort":false,"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek"},"thinkingLevelMap":{"off":"off","minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":null},"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:mimo-v2.6-pro":{"id":"mimo-v2.6-pro","name":"MiMo-V2.6-Pro","api":"openai-completions","provider":"xiaomi-token-plan-cn","baseUrl":"https://token-plan-cn.xiaomimimo.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072,"compat":{"supportsStrictMode":true,"supportsReasoningEffort":false,"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek"},"thinkingLevelMap":{"off":"off","minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":null},"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"}}}
|
package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi-token-plan-sgp.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"openai-completions":{"chat:mimo-v2.6-flash":{"id":"mimo-v2.6-flash","name":"MiMo-V2.6-Flash","api":"openai-completions","provider":"xiaomi-token-plan-sgp","baseUrl":"https://token-plan-sgp.xiaomimimo.com/v1","
|
|
1
|
+
{"openai-completions":{"chat:mimo-v2.6-flash":{"id":"mimo-v2.6-flash","name":"MiMo-V2.6-Flash","api":"openai-completions","provider":"xiaomi-token-plan-sgp","baseUrl":"https://token-plan-sgp.xiaomimimo.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072,"compat":{"supportsStrictMode":true,"supportsReasoningEffort":false,"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek"},"thinkingLevelMap":{"off":"off","minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":null},"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:mimo-v2.6-pro":{"id":"mimo-v2.6-pro","name":"MiMo-V2.6-Pro","api":"openai-completions","provider":"xiaomi-token-plan-sgp","baseUrl":"https://token-plan-sgp.xiaomimimo.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072,"compat":{"supportsStrictMode":true,"supportsReasoningEffort":false,"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek"},"thinkingLevelMap":{"off":"off","minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":null},"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"openai-completions":{"chat:mimo-v2.6-flash":{"id":"mimo-v2.6-flash","name":"MiMo-V2.6-Flash","api":"openai-completions","provider":"xiaomi","baseUrl":"https://api.xiaomimimo.com/v1","
|
|
1
|
+
{"openai-completions":{"chat:mimo-v2.6-flash":{"id":"mimo-v2.6-flash","name":"MiMo-V2.6-Flash","api":"openai-completions","provider":"xiaomi","baseUrl":"https://api.xiaomimimo.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.14,"output":0.28,"cacheRead":0.0028,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072,"compat":{"supportsStrictMode":true,"supportsReasoningEffort":false,"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek"},"thinkingLevelMap":{"off":"off","minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":null},"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:mimo-v2.6-pro":{"id":"mimo-v2.6-pro","name":"MiMo-V2.6-Pro","api":"openai-completions","provider":"xiaomi","baseUrl":"https://api.xiaomimimo.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.435,"output":0.87,"cacheRead":0.0036,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072,"compat":{"supportsStrictMode":true,"supportsReasoningEffort":false,"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek"},"thinkingLevelMap":{"off":"off","minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":null},"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:mimo-v2.6-pro-ultraspeed":{"id":"mimo-v2.6-pro-ultraspeed","name":"MiMo-V2.6-Pro-UltraSpeed","api":"openai-completions","provider":"xiaomi","baseUrl":"https://api.xiaomimimo.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":4.35,"output":8.7,"cacheRead":0.036,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072,"compat":{"supportsStrictMode":true,"supportsReasoningEffort":false,"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek"},"thinkingLevelMap":{"off":"off","minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":null},"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"openai-completions":{"chat:glm-4.6v":{"id":"glm-4.6v","name":"GLM-4.6V","api":"openai-completions","provider":"zai-coding-cn","baseUrl":"https://open.bigmodel.cn/api/coding/paas/v4","reasoning":true,"input":["text","image"],"cost":{"input":0.3,"output":0.9,"cacheRead":0.05,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","thinkingFormat":"zai","supportsStrictMode":true,"zaiToolStream":true},"
|
|
1
|
+
{"openai-completions":{"chat:glm-4.6v":{"id":"glm-4.6v","name":"GLM-4.6V","api":"openai-completions","provider":"zai-coding-cn","baseUrl":"https://open.bigmodel.cn/api/coding/paas/v4","reasoning":true,"input":["text","image"],"cost":{"input":0.3,"output":0.9,"cacheRead":0.05,"cacheWrite":0},"contextWindow":128000,"maxTokens":32768,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","thinkingFormat":"zai","supportsStrictMode":true,"zaiToolStream":true},"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:glm-5.3":{"id":"glm-5.3","name":"GLM-5.3","api":"openai-completions","provider":"zai-coding-cn","baseUrl":"https://open.bigmodel.cn/api/coding/paas/v4","reasoning":true,"input":["text"],"cost":{"input":1.4,"output":4.4,"cacheRead":0.26,"cacheWrite":0},"contextWindow":1000000,"maxTokens":131072,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"maxTokensField":"max_tokens","thinkingFormat":"zai","supportsStrictMode":true,"zaiToolStream":true},"type":"chat"},"chat:glm-5.3-flash":{"id":"glm-5.3-flash","name":"GLM-5.3-Flash","api":"openai-completions","provider":"zai-coding-cn","baseUrl":"https://open.bigmodel.cn/api/coding/paas/v4","reasoning":true,"input":["text","image"],"cost":{"input":0.15,"output":0.5,"cacheRead":0.03,"cacheWrite":0},"contextWindow":1000000,"maxTokens":131072,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"maxTokensField":"max_tokens","thinkingFormat":"zai","supportsStrictMode":true,"zaiToolStream":true},"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:glm-5.3-highspeed":{"id":"glm-5.3-highspeed","name":"GLM-5.3 Highspeed","api":"openai-completions","provider":"zai-coding-cn","baseUrl":"https://open.bigmodel.cn/api/coding/paas/v4","reasoning":true,"input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":1000000,"maxTokens":131072,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"maxTokensField":"max_tokens","thinkingFormat":"zai","supportsStrictMode":true,"zaiToolStream":true},"type":"chat"}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"openai-completions":{"chat:glm-4.7":{"id":"glm-4.7","name":"GLM-4.7","api":"openai-completions","provider":"zai","baseUrl":"https://api.z.ai/api/coding/paas/v4","reasoning":true,"input":["text"],"cost":{"input":0.6,"output":2.2,"cacheRead":0.11,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","thinkingFormat":"zai","supportsStrictMode":true,"zaiToolStream":true},"
|
|
1
|
+
{"openai-completions":{"chat:glm-4.7":{"id":"glm-4.7","name":"GLM-4.7","api":"openai-completions","provider":"zai","baseUrl":"https://api.z.ai/api/coding/paas/v4","reasoning":true,"input":["text"],"cost":{"input":0.6,"output":2.2,"cacheRead":0.11,"cacheWrite":0},"contextWindow":204800,"maxTokens":131072,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","thinkingFormat":"zai","supportsStrictMode":true,"zaiToolStream":true},"type":"chat"},"chat:glm-5-turbo":{"id":"glm-5-turbo","name":"GLM-5-Turbo","api":"openai-completions","provider":"zai","baseUrl":"https://api.z.ai/api/coding/paas/v4","reasoning":true,"input":["text"],"cost":{"input":1.2,"output":4,"cacheRead":0.24,"cacheWrite":0},"contextWindow":200000,"maxTokens":131072,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","thinkingFormat":"zai","supportsStrictMode":true,"zaiToolStream":true},"type":"chat"},"chat:glm-5.2":{"id":"glm-5.2","name":"GLM-5.2","api":"openai-completions","provider":"zai","baseUrl":"https://api.z.ai/api/coding/paas/v4","reasoning":true,"input":["text"],"cost":{"input":1.4,"output":4.4,"cacheRead":0.26,"cacheWrite":0},"contextWindow":1000000,"maxTokens":131072,"thinkingLevelMap":{"off":"none","minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":"max"},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"maxTokensField":"max_tokens","thinkingFormat":"zai","supportsStrictMode":true,"zaiToolStream":true},"type":"chat"},"chat:glm-5.2-highspeed":{"id":"glm-5.2-highspeed","name":"GLM-5.2 Highspeed","api":"openai-completions","provider":"zai","baseUrl":"https://api.z.ai/api/coding/paas/v4","reasoning":true,"input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":1000000,"maxTokens":131072,"thinkingLevelMap":{"off":"none","minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":"max"},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"maxTokensField":"max_tokens","thinkingFormat":"zai","supportsStrictMode":true,"zaiToolStream":true},"type":"chat"},"chat:glm-5.3":{"id":"glm-5.3","name":"GLM-5.3","api":"openai-completions","provider":"zai","baseUrl":"https://api.z.ai/api/coding/paas/v4","reasoning":true,"input":["text"],"cost":{"input":1.4,"output":4.4,"cacheRead":0.26,"cacheWrite":0},"contextWindow":1000000,"maxTokens":131072,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"maxTokensField":"max_tokens","thinkingFormat":"zai","supportsStrictMode":true,"zaiToolStream":true},"type":"chat"},"chat:glm-5.3-flash":{"id":"glm-5.3-flash","name":"GLM-5.3-Flash","api":"openai-completions","provider":"zai","baseUrl":"https://api.z.ai/api/coding/paas/v4","reasoning":true,"input":["text","image"],"cost":{"input":0.15,"output":0.5,"cacheRead":0.03,"cacheWrite":0},"contextWindow":1000000,"maxTokens":131072,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"maxTokensField":"max_tokens","thinkingFormat":"zai","supportsStrictMode":true,"zaiToolStream":true},"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:glm-5.3-highspeed":{"id":"glm-5.3-highspeed","name":"GLM-5.3 Highspeed","api":"openai-completions","provider":"zai","baseUrl":"https://api.z.ai/api/coding/paas/v4","reasoning":true,"input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":1000000,"maxTokens":131072,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"maxTokensField":"max_tokens","thinkingFormat":"zai","supportsStrictMode":true,"zaiToolStream":true},"type":"chat"}}}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var Z=Object.defineProperty;var s=(e,t)=>Z(e,"name",{value:t,configurable:!0});import{createProvider as G}from"../models.js";import{createAssistantMessageEventStream as F}from"../utils/event-stream.js";import{
|
|
1
|
+
var Z=Object.defineProperty;var s=(e,t)=>Z(e,"name",{value:t,configurable:!0});import{createProvider as G}from"../models.js";import{createAssistantMessageEventStream as F}from"../utils/event-stream.js";import{ToolCallArgumentsStream as V}from"../utils/streaming-json.js";import{getSystemMessageText as X}from"../utils/text.js";const C="faux",S="faux",v="faux-1",H="Faux Model",Q="http://localhost:0",Y=3,L=5,D={input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}};function q(e){return{type:"text",text:e}}s(q,"fauxText");function fe(e){return{type:"thinking",thinking:e}}s(fe,"fauxThinking");function he(e,t,n={}){return{type:"toolCall",id:n.id??A("tool"),name:e,arguments:t}}s(he,"fauxToolCall");function ee(e){return typeof e=="string"?[q(e)]:Array.isArray(e)?e:[e]}s(ee,"normalizeFauxAssistantContent");function ge(e,t={}){return{role:"assistant",content:ee(e),api:C,provider:S,model:v,usage:D,stopReason:t.stopReason??"stop",...t.deferred===void 0?{}:{deferred:t.deferred},...t.errorMessage===void 0?{}:{errorMessage:t.errorMessage},...t.responseId===void 0?{}:{responseId:t.responseId},timestamp:t.timestamp??Date.now()}}s(ge,"fauxAssistantMessage");function b(e){return Math.ceil(e.length/4)}s(b,"estimateTokens");function A(e){return`${e}:${Date.now()}:${Math.random().toString(36).slice(2)}`}s(A,"randomId");function U(e){return typeof e=="string"?e:e.map(t=>t.type==="text"?t.text:`[image:${t.mimeType}:${t.data.length}]`).join(`
|
|
2
2
|
`)}s(U,"contentToText");function $(e){return e.map(t=>t.type==="text"?t.text:t.type==="thinking"?t.thinking:`${t.name}:${JSON.stringify(t.arguments)}`).join(`
|
|
3
|
-
`)}s($,"assistantContentToText");function
|
|
4
|
-
`)}s(
|
|
5
|
-
`):e.role==="user"?U(e.content):e.role==="assistant"?$(e.content):
|
|
3
|
+
`)}s($,"assistantContentToText");function te(e){return[e.toolName,...e.content.map(t=>U([t]))].join(`
|
|
4
|
+
`)}s(te,"toolResultToText");function ne(e){return e.role==="system"?[X(e),...e.toolsRemoved?.map(t=>`tool-:${JSON.stringify(t)}`)??[],...e.toolsAdded?.map(t=>`tool+:${JSON.stringify(t)}`)??[]].filter(t=>t.length>0).join(`
|
|
5
|
+
`):e.role==="user"?U(e.content):e.role==="assistant"?$(e.content):te(e)}s(ne,"messageToText");function P(e,t=e.length){let n=t>0?(t-1)*2:0;for(let o=0;o<t;o++)n+=e[o].length;return n}s(P,"joinedLength");function re(e,t){let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;const o=s(d=>n===d.length?"":(n>0?`
|
|
6
6
|
|
|
7
7
|
`:"")+d.slice(n).join(`
|
|
8
8
|
|
|
9
|
-
`),"rest");return P(e,n)+
|
|
9
|
+
`),"rest");return P(e,n)+oe(o(e),o(t))}s(re,"commonPromptPrefixLength");function oe(e,t){const n=Math.min(e.length,t.length);let o=0;for(;o<n&&e[o]===t[o];)o++;return o}s(oe,"commonPrefixLength");function N(e,t,n,o){const d=t.messages.map(w=>`${w.role}:${ne(w)}`),m=P(d),a=Math.ceil(m/4),i=b($(e.content));let f=a,y=0,u=0;const g=n?.sessionId;if(g&&n?.cacheRetention!=="none"){const w=o.get(g);if(w){const T=re(w,d);y=Math.ceil(T/4),u=Math.max(0,a-y)}else u=a;f=0,o.set(g,d)}return{...e,usage:{input:f,output:i,cacheRead:y,cacheWrite:u,totalTokens:f+i+y+u,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}}}}s(N,"withUsageEstimate");function k(e,t,n){const o=[];let d=0;for(;d<e.length;){const m=t+Math.floor(Math.random()*(n-t+1)),a=Math.max(1,m*4);o.push(e.slice(d,d+a)),d+=a}return o.length>0?o:[""]}s(k,"splitStringByTokenSize");function ae(e,t,n,o){const d=structuredClone(e);return{...d,api:t,provider:n,model:o,timestamp:d.timestamp??Date.now(),usage:d.usage??D}}s(ae,"cloneMessage");function W(e,t){return{role:"assistant",content:[],api:e.api,provider:e.provider,model:e.id,usage:D,stopReason:"deferred",deferred:t,timestamp:Date.now()}}s(W,"createDeferredMessage");function _(e,t,n,o){return{role:"assistant",content:[],api:t,provider:n,model:o,usage:D,stopReason:"error",errorMessage:e instanceof Error?e.message:String(e),timestamp:Date.now()}}s(_,"createErrorMessage");function M(e){return{...e,stopReason:"aborted",errorMessage:"Request was aborted",timestamp:Date.now()}}s(M,"createAbortedMessage");function I(e,t){if(!t||t<=0)return new Promise(o=>queueMicrotask(o));const n=b(e)/t*1e3;return new Promise(o=>setTimeout(o,n))}s(I,"scheduleChunk");async function E(e,t,n,o,d,m){const a={...t,content:[],stopReason:"pending"};if(m?.aborted){const i=M(a);e.push({type:"error",reason:"aborted",error:i}),e.end(i);return}e.push({type:"start",partial:{...a}});for(let i=0;i<t.content.length;i++){if(m?.aborted){const u=M(a);e.push({type:"error",reason:"aborted",error:u}),e.end(u);return}const f=t.content[i];if(f.type==="thinking"){a.content=[...a.content,{type:"thinking",thinking:""}],e.push({type:"thinking_start",contentIndex:i,partial:{...a}});for(const u of k(f.thinking,n,o)){if(await I(u,d),m?.aborted){const g=M(a);e.push({type:"error",reason:"aborted",error:g}),e.end(g);return}a.content[i].thinking+=u,e.push({type:"thinking_delta",contentIndex:i,delta:u,partial:{...a}})}e.push({type:"thinking_end",contentIndex:i,content:f.thinking,partial:{...a}});continue}if(f.type==="text"){a.content=[...a.content,{type:"text",text:""}],e.push({type:"text_start",contentIndex:i,partial:{...a}});for(const u of k(f.text,n,o)){if(await I(u,d),m?.aborted){const g=M(a);e.push({type:"error",reason:"aborted",error:g}),e.end(g);return}a.content[i].text+=u,e.push({type:"text_delta",contentIndex:i,delta:u,partial:{...a}})}e.push({type:"text_end",contentIndex:i,content:f.text,partial:{...a}});continue}a.content=[...a.content,{type:"toolCall",id:f.id,name:f.name,arguments:{}}],e.push({type:"toolcall_start",contentIndex:i,partial:{...a}});const y=new V;for(const u of k(JSON.stringify(f.arguments),n,o)){if(await I(u,d),m?.aborted){const g=M(a);e.push({type:"error",reason:"aborted",error:g}),e.end(g);return}a.content[i].arguments=y.append(u),e.push({type:"toolcall_delta",contentIndex:i,delta:u,partial:{...a}})}a.content[i].arguments=f.arguments,e.push({type:"toolcall_end",contentIndex:i,toolCall:f,partial:{...a}})}if(t.stopReason==="pending")throw new Error("Faux response ended without a stop reason");if(t.stopReason==="error"||t.stopReason==="aborted"){e.push({type:"error",reason:t.stopReason,error:t}),e.end(t);return}e.push({type:"done",reason:t.stopReason,message:t}),e.end(t)}s(E,"streamWithDeltas");function se(e){const t=e.api??A(C),n=e.provider??S,o=Math.max(1,Math.min(e.tokenSize?.min??Y,e.tokenSize?.max??L)),d=Math.max(o,e.tokenSize?.max??L);let m=[];const a=e.tokensPerSecond,i={callCount:0,deferredFetchCount:0,cancelledDeferred:[]},f=new Map,y=new Map,g=(e.models?.length?e.models:[{id:v,name:H,reasoning:!1,input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:16384}]).map(r=>({id:r.id,name:r.name??r.id,api:t,provider:n,baseUrl:Q,reasoning:r.reasoning??!1,input:r.input??["text","image"],inputLimits:r.inputLimits,cost:r.cost??{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:r.contextWindow??128e3,maxTokens:r.maxTokens??16384})),w=s(async(r,p,h,l)=>{const c=typeof r=="function"?await r(p,h,i,l):r;return N(ae(c,t,n,l.id),p,h,f)},"resolveResponse"),T=s((r,p,h)=>{const l=F(),c=m.shift();return i.callCount++,queueMicrotask(async()=>{try{if(await h?.onResponse?.({status:200,headers:{}},r),!c){let x=_(new Error("No more faux responses queued"),t,n,r.id);x=N(x,p,h,f),l.push({type:"error",reason:"error",error:x}),l.end(x);return}if(h?.deferred){const x={provider:r.provider,modelId:r.id,api:r.api,id:A("deferred"),...e.deferred?.pollAfterMs!==void 0?{pollAfterMs:e.deferred.pollAfterMs}:{}};y.set(x.id,{handle:x,step:c,context:p,options:h,model:r,pendingFetches:Math.max(0,Math.floor(e.deferred?.pendingFetches??0)),cancelled:!1}),await E(l,W(r,x),o,d,a,h.signal);return}const R=await w(c,p,h,r);await E(l,R,o,d,a,h?.signal)}catch(R){const x=_(R,t,n,r.id);l.push({type:"error",reason:"error",error:x}),l.end(x)}}),l},"stream"),j=s((r,p,h)=>T(r,p,h),"streamSimple"),z=s((r,p,h)=>{const l=F();return i.deferredFetchCount++,queueMicrotask(async()=>{try{await h?.onResponse?.({status:200,headers:{}},r);const c=y.get(p.id);if(!c||c.handle.provider!==p.provider||c.handle.modelId!==p.modelId||c.handle.api!==p.api)throw new Error(`Unknown faux deferred response: ${p.id}`);if(c.cancelled)throw new Error(`Faux deferred response was cancelled: ${p.id}`);if(c.pendingFetches>0){c.pendingFetches--,await E(l,W(r,c.handle),o,d,a,h?.signal);return}if(!c.final){const{deferred:R,signal:x,onResponse:ie,...B}=c.options??{};try{c.final=await w(c.step,c.context,B,c.model)}catch(O){c.final=_(O,t,n,c.model.id)}}await E(l,c.final,o,d,a,h?.signal)}catch(c){const R=_(c,t,n,r.id);l.push({type:"error",reason:"error",error:R}),l.end(R)}}),l},"fetchDeferred"),J=s(async(r,p,h)=>{i.cancelledDeferred.push(structuredClone(p));const l=y.get(p.id);l&&(l.cancelled=!0),await h?.onResponse?.({status:200,headers:{}},r)},"cancelDeferred");function K(r){return r?g.find(p=>p.id===r):g[0]}return s(K,"getModel"),{api:t,provider:n,models:g,stream:T,streamSimple:j,fetchDeferred:z,cancelDeferred:J,getModel:K,state:i,setResponses(r){m=[...r]},appendResponses(r){m.push(...r)},getPendingResponseCount(){return m.length}}}s(se,"createFauxCore");function me(e={}){const t=se(e);return{provider:G({id:t.provider,auth:{apiKey:{name:"Faux",resolve:s(async()=>({auth:{}}),"resolve")}},models:t.models,api:{stream:t.stream,streamSimple:t.streamSimple,fetchDeferred:t.fetchDeferred,cancelDeferred:t.cancelDeferred}}),api:t.api,models:t.models,getModel:t.getModel,state:t.state,setResponses:t.setResponses,appendResponses:t.appendResponses,getPendingResponseCount:t.getPendingResponseCount}}s(me,"fauxProvider");export{se as createFauxCore,ge as fauxAssistantMessage,me as fauxProvider,q as fauxText,fe as fauxThinking,he as fauxToolCall};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var p=Object.defineProperty;var t=(e,i)=>p(e,"name",{value:i,configurable:!0});import{anthropicMessagesApi as a}from"../api/anthropic-messages.lazy.js";import{openAICompletionsApi as n}from"../api/openai-completions.lazy.js";import{openAIResponsesApi as l}from"../api/openai-responses.lazy.js";import{typesafeSystemOneApi as m}from"../api/typesafe-system-one.lazy.js";import{envApiKeyAuth as f}from"../auth/helpers.js";import{createProvider as u}from"../models.js";import{GITHUB_COPILOT_CLASSIFIER_MODELS as c,GITHUB_COPILOT_MODELS as y}from"./github-copilot.models.js";function b(e){return{classify:t((i,o,r)=>e.classify({...i,baseUrl:`${i.baseUrl.replace(/\/+$/u,"")}/v1`},o,r),"classify")}}t(b,"copilotSystemOne");function T(){return u({id:"github-copilot",name:"GitHub Copilot",baseUrl:"https://api.individual.githubcopilot.com",auth:{apiKey:f("GitHub Copilot token",["COPILOT_GITHUB_TOKEN"])},models:[...Object.values(y),...Object.values(c)],filterModels:t((e,i)=>{if(i?.type!=="oauth")return e;const o=i.availableModelIds;if(!Array.isArray(o)||!o.every(s=>typeof s=="string"))return e;const r=new Set(o);return e.filter(s=>r.has(s.id))},"filterModels"),api:{"anthropic-messages":a(),"openai-completions":n(),"openai-responses":l()},classifiers:{"typesafe-system-one":b(m())}})}t(T,"githubCopilotProvider");export{T as githubCopilotProvider};
|
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
import { type Static
|
|
1
|
+
import { type Static } from "@earendil-works/pi-schema";
|
|
2
2
|
export declare const THINKING_LEVELS: readonly ["minimal", "low", "medium", "high", "xhigh", "max"];
|
|
3
3
|
export declare const MODEL_THINKING_LEVELS: readonly ["off", "minimal", "low", "medium", "high", "xhigh", "max"];
|
|
4
4
|
export declare const MODEL_INPUT_MODALITIES: readonly ["text", "image"];
|
|
5
5
|
export declare const CACHE_RETENTIONS: readonly ["none", "short", "long"];
|
|
6
6
|
export declare const MODEL_PROMPT_CACHE_RETENTIONS: readonly ["short", "long"];
|
|
7
|
-
export declare const ThinkingLevelSchema:
|
|
8
|
-
export declare const ModelThinkingLevelSchema:
|
|
9
|
-
export declare const ModelInputModalitySchema:
|
|
10
|
-
export declare const CacheRetentionSchema:
|
|
11
|
-
export declare const ThinkingLevelMapSchema:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
medium
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
export declare const ThinkingLevelSchema: import("@earendil-works/pi-schema").Schema<"high" | "low" | "max" | "medium" | "minimal" | "xhigh">;
|
|
8
|
+
export declare const ModelThinkingLevelSchema: import("@earendil-works/pi-schema").Schema<"high" | "low" | "max" | "medium" | "minimal" | "off" | "xhigh">;
|
|
9
|
+
export declare const ModelInputModalitySchema: import("@earendil-works/pi-schema").Schema<"image" | "text">;
|
|
10
|
+
export declare const CacheRetentionSchema: import("@earendil-works/pi-schema").Schema<"long" | "none" | "short">;
|
|
11
|
+
export declare const ThinkingLevelMapSchema: import("@earendil-works/pi-schema").Schema<{
|
|
12
|
+
off?: string | null | undefined;
|
|
13
|
+
minimal?: string | null | undefined;
|
|
14
|
+
low?: string | null | undefined;
|
|
15
|
+
medium?: string | null | undefined;
|
|
16
|
+
high?: string | null | undefined;
|
|
17
|
+
xhigh?: string | null | undefined;
|
|
18
|
+
max?: string | null | undefined;
|
|
19
19
|
}>;
|
|
20
|
-
export declare const ModelPromptCacheSchema:
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
export declare const ModelPromptCacheSchema: import("@earendil-works/pi-schema").Schema<{
|
|
21
|
+
short?: number | undefined;
|
|
22
|
+
long?: number | undefined;
|
|
23
23
|
}>;
|
|
24
|
-
export declare const ModelCostRatesSchema:
|
|
25
|
-
input:
|
|
26
|
-
output:
|
|
27
|
-
cacheRead:
|
|
28
|
-
cacheWrite:
|
|
24
|
+
export declare const ModelCostRatesSchema: import("@earendil-works/pi-schema").Schema<{
|
|
25
|
+
input: number;
|
|
26
|
+
output: number;
|
|
27
|
+
cacheRead: number;
|
|
28
|
+
cacheWrite: number;
|
|
29
29
|
}>;
|
|
30
|
-
export declare const ModelCostTierSchema:
|
|
31
|
-
input:
|
|
32
|
-
output:
|
|
33
|
-
cacheRead:
|
|
34
|
-
cacheWrite:
|
|
35
|
-
inputTokensAbove:
|
|
30
|
+
export declare const ModelCostTierSchema: import("@earendil-works/pi-schema").Schema<{
|
|
31
|
+
input: number;
|
|
32
|
+
output: number;
|
|
33
|
+
cacheRead: number;
|
|
34
|
+
cacheWrite: number;
|
|
35
|
+
inputTokensAbove: number;
|
|
36
36
|
}>;
|
|
37
|
-
export declare const ModelCostSchema:
|
|
38
|
-
input:
|
|
39
|
-
output:
|
|
40
|
-
cacheRead:
|
|
41
|
-
cacheWrite:
|
|
42
|
-
tiers
|
|
43
|
-
input:
|
|
44
|
-
output:
|
|
45
|
-
cacheRead:
|
|
46
|
-
cacheWrite:
|
|
47
|
-
inputTokensAbove:
|
|
48
|
-
}
|
|
37
|
+
export declare const ModelCostSchema: import("@earendil-works/pi-schema").Schema<{
|
|
38
|
+
input: number;
|
|
39
|
+
output: number;
|
|
40
|
+
cacheRead: number;
|
|
41
|
+
cacheWrite: number;
|
|
42
|
+
tiers?: {
|
|
43
|
+
input: number;
|
|
44
|
+
output: number;
|
|
45
|
+
cacheRead: number;
|
|
46
|
+
cacheWrite: number;
|
|
47
|
+
inputTokensAbove: number;
|
|
48
|
+
}[] | undefined;
|
|
49
49
|
}>;
|
|
50
|
-
export declare const ModelImageResizeOptionsSchema:
|
|
51
|
-
maxWidth
|
|
52
|
-
maxHeight
|
|
53
|
-
maxBytes
|
|
54
|
-
jpegQuality
|
|
50
|
+
export declare const ModelImageResizeOptionsSchema: import("@earendil-works/pi-schema").Schema<{
|
|
51
|
+
maxWidth?: number | undefined;
|
|
52
|
+
maxHeight?: number | undefined;
|
|
53
|
+
maxBytes?: number | undefined;
|
|
54
|
+
jpegQuality?: number | undefined;
|
|
55
55
|
}>;
|
|
56
|
-
export declare const ModelImageInputLimitsSchema:
|
|
57
|
-
resize
|
|
58
|
-
maxWidth
|
|
59
|
-
maxHeight
|
|
60
|
-
maxBytes
|
|
61
|
-
jpegQuality
|
|
62
|
-
}
|
|
63
|
-
maxPerMessage
|
|
64
|
-
maxPerRequest
|
|
56
|
+
export declare const ModelImageInputLimitsSchema: import("@earendil-works/pi-schema").Schema<{
|
|
57
|
+
resize?: {
|
|
58
|
+
maxWidth?: number | undefined;
|
|
59
|
+
maxHeight?: number | undefined;
|
|
60
|
+
maxBytes?: number | undefined;
|
|
61
|
+
jpegQuality?: number | undefined;
|
|
62
|
+
} | undefined;
|
|
63
|
+
maxPerMessage?: number | undefined;
|
|
64
|
+
maxPerRequest?: number | undefined;
|
|
65
65
|
}>;
|
|
66
|
-
export declare const ModelInputLimitsSchema:
|
|
67
|
-
maxRequestBytes
|
|
68
|
-
images
|
|
69
|
-
resize
|
|
70
|
-
maxWidth
|
|
71
|
-
maxHeight
|
|
72
|
-
maxBytes
|
|
73
|
-
jpegQuality
|
|
74
|
-
}
|
|
75
|
-
maxPerMessage
|
|
76
|
-
maxPerRequest
|
|
77
|
-
}
|
|
66
|
+
export declare const ModelInputLimitsSchema: import("@earendil-works/pi-schema").Schema<{
|
|
67
|
+
maxRequestBytes?: number | undefined;
|
|
68
|
+
images?: {
|
|
69
|
+
resize?: {
|
|
70
|
+
maxWidth?: number | undefined;
|
|
71
|
+
maxHeight?: number | undefined;
|
|
72
|
+
maxBytes?: number | undefined;
|
|
73
|
+
jpegQuality?: number | undefined;
|
|
74
|
+
} | undefined;
|
|
75
|
+
maxPerMessage?: number | undefined;
|
|
76
|
+
maxPerRequest?: number | undefined;
|
|
77
|
+
} | undefined;
|
|
78
78
|
}>;
|
|
79
79
|
export type ThinkingLevel = Static<typeof ThinkingLevelSchema>;
|
|
80
80
|
export type ModelThinkingLevel = Static<typeof ModelThinkingLevelSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var d=Object.defineProperty;var a=(r,l)=>d(r,"name",{value:l,configurable:!0});import{arr as u,int as i,nul as x,num as n,oneOf as s,opt as e,str as g,union as M}from"@earendil-works/pi-schema";import{openObject as t}from"./schema-builders.js";const c=["minimal","low","medium","high","xhigh","max"],S=["off",...c],f=["text","image"],v=["none","short","long"],R=["short","long"],O=s(c),P=s(S),w=s(f),y=s(v),o=M([g(),x()]),N=t({off:e(o),minimal:e(o),low:e(o),medium:e(o),high:e(o),xhigh:e(o),max:e(o)},{description:"Provider value sent for each thinking level. null marks a level unsupported. Levels the model does not map use the provider's default value through high; xhigh and max are unsupported."}),p=n({exclusiveMinimum:0}),_=t({short:e(p),long:e(p)},{description:"Best-effort prompt cache lifetime in seconds for the short and long retention tiers. Pi warms only tiers with a known lifetime."}),m={input:n({description:"Input cost in USD per million tokens."}),output:n({description:"Output cost in USD per million tokens."}),cacheRead:n({description:"Cache-read cost in USD per million tokens."}),cacheWrite:n({description:"Cache-write cost in USD per million tokens."})},z=t(m),I=t({inputTokensAbove:n({description:"Use this tier when total request input exceeds this token count."}),...m}),D=t({...m,tiers:e(u(I,{description:"Request-wide pricing tiers. The highest matching input threshold applies to the full request."}))}),L={maxWidth:e(i({minimum:1})),maxHeight:e(i({minimum:1})),maxBytes:e(i({minimum:1,description:"Maximum base64-encoded payload size in bytes."})),jpegQuality:e(i({minimum:1,maximum:100}))};function h(r){return t(L,r)}a(h,"modelImageResizeOptions");const b=h(),T=t({resize:e(h({description:"Cache-safe resize profile applied before a new image enters conversation history."})),maxPerMessage:e(i({minimum:1,description:"Maximum images accepted in one provider message."})),maxPerRequest:e(i({minimum:1,description:"Maximum images accepted across one provider request."}))}),q=t({maxRequestBytes:e(i({minimum:1,description:"Maximum serialized provider request size in bytes."})),images:e(T)});export{v as CACHE_RETENTIONS,y as CacheRetentionSchema,f as MODEL_INPUT_MODALITIES,R as MODEL_PROMPT_CACHE_RETENTIONS,S as MODEL_THINKING_LEVELS,z as ModelCostRatesSchema,D as ModelCostSchema,I as ModelCostTierSchema,T as ModelImageInputLimitsSchema,b as ModelImageResizeOptionsSchema,q as ModelInputLimitsSchema,w as ModelInputModalitySchema,_ as ModelPromptCacheSchema,P as ModelThinkingLevelSchema,c as THINKING_LEVELS,N as ThinkingLevelMapSchema,O as ThinkingLevelSchema};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var p=Object.defineProperty;var e=(o,r)=>p(o,"name",{value:r,configurable:!0});import{openAICodexResponsesApi as t}from"../api/openai-codex-responses.lazy.js";import{createProvider as
|
|
1
|
+
var p=Object.defineProperty;var e=(o,r)=>p(o,"name",{value:r,configurable:!0});import{openAICodexResponsesApi as t}from"../api/openai-codex-responses.lazy.js";import{createProvider as i}from"../models.js";import{OPENAI_CODEX_MODELS as a}from"./openai-codex.models.js";function s(){return i({id:"openai-codex",name:"OpenAI Codex",baseUrl:"https://chatgpt.com/backend-api",auth:{},models:Object.values(a),api:t()})}e(s,"openaiCodexProvider");export{s as openaiCodexProvider};
|
package/dist/node_modules/@earendil-works/pi-ai/dist/providers/qwen-token-plan-individual-cn.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var o=Object.defineProperty;var n=(e,i)=>o(e,"name",{value:i,configurable:!0});import{openAICompletionsApi as a}from"../api/openai-completions.lazy.js";import{envApiKeyAuth as r}from"../auth/helpers.js";import{createProvider as t}from"../models.js";import{QWEN_TOKEN_PLAN_INDIVIDUAL_CN_MODELS as l}from"./qwen-token-plan-individual-cn.models.js";function _(){return t({id:"qwen-token-plan-individual-cn",name:"Qwen Token Plan Individual CN",baseUrl:"https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",auth:{apiKey:r("Qwen Token Plan Individual CN API key",["QWEN_TOKEN_PLAN_CN_API_KEY"])},models:Object.values(l),api:a()})}n(_,"qwenTokenPlanIndividualCnProvider");export{_ as qwenTokenPlanIndividualCnProvider};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import values from "./data/qwen-token-plan-individual-cn.json";
|
|
2
|
+
import { type ChatModelCatalog, type ClassifierModelCatalog, type ImageModelCatalog } from "../model-catalog.ts";
|
|
3
|
+
export declare const QWEN_TOKEN_PLAN_INDIVIDUAL_CN_MODELS: ChatModelCatalog<typeof values, "qwen-token-plan-individual-cn">;
|
|
4
|
+
export declare const QWEN_TOKEN_PLAN_INDIVIDUAL_CN_IMAGE_MODELS: ImageModelCatalog<typeof values, "qwen-token-plan-individual-cn">;
|
|
5
|
+
export declare const QWEN_TOKEN_PLAN_INDIVIDUAL_CN_CLASSIFIER_MODELS: ClassifierModelCatalog<typeof values, "qwen-token-plan-individual-cn">;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"./data/qwen-token-plan-individual-cn.json"with{type:"json"};import{flattenChatModelCatalog as n,flattenClassifierModelCatalog as o,flattenImageModelCatalog as a}from"../model-catalog.js";const _=n("qwen-token-plan-individual-cn",t),N=a("qwen-token-plan-individual-cn",t),i=o("qwen-token-plan-individual-cn",t);export{i as QWEN_TOKEN_PLAN_INDIVIDUAL_CN_CLASSIFIER_MODELS,N as QWEN_TOKEN_PLAN_INDIVIDUAL_CN_IMAGE_MODELS,_ as QWEN_TOKEN_PLAN_INDIVIDUAL_CN_MODELS};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var u=Object.defineProperty;var
|
|
1
|
+
var u=Object.defineProperty;var o=(t,r)=>u(t,"name",{value:r,configurable:!0});import{ownedSlice as f}from"../utils/text.js";const w="https://radius.pi.dev";function c(t){if(typeof t!="object"||t===null||Array.isArray(t))return!1;const r=t;return typeof r.id=="string"&&typeof r.name=="string"&&typeof r.reasoning=="boolean"&&Array.isArray(r.input)&&typeof r.cost=="object"&&r.cost!==null&&!Array.isArray(r.cost)&&typeof r.contextWindow=="number"&&typeof r.maxTokens=="number"}o(c,"isRadiusGatewayModel");function a(t){if(typeof t!="object"||t===null||Array.isArray(t))return;const{baseUrl:r,models:e}=t;if(!(typeof r!="string"||!Array.isArray(e)))return{baseUrl:r,models:e.filter(c).map(n=>({...n}))}}o(a,"sanitizeRadiusGatewayConfig");function g(t){return(/^https?:\/\//iu.test(t)?t:`https://${t}`).replace(/\/+$/u,"")}o(g,"normalizeRadiusGatewayUrl");function d(t){return a(t?.gatewayConfig)}o(d,"getRadiusCredentialConfig");function p(t,r){return r.models.map(e=>({...e,api:"pi-messages",provider:t,baseUrl:r.baseUrl}))}o(p,"getRadiusModelsFromConfig");function A(t,r){const e=d(r);return e?p(t,e):[]}o(A,"getRadiusModels");function l(t){const r=t.trim();return r.length>512?`${f(r,0,512)}\u2026`:r}o(l,"truncateHttpBody");async function h(t,r,e){const n={accept:"application/json"};r&&(n.authorization=`Bearer ${r}`);const i=await fetch(new URL("/v1/config",t),{headers:n,signal:e});if(!i.ok)throw new Error(`Could not load Radius config from ${t}: ${i.status}: ${l(await i.text())}`);const s=a(await i.json());if(!s)throw new Error(`Invalid Radius config from ${t}`);return s}o(h,"loadRadiusGatewayConfig");export{w as DEFAULT_RADIUS_GATEWAY,d as getRadiusCredentialConfig,A as getRadiusModels,p as getRadiusModelsFromConfig,h as loadRadiusGatewayConfig,g as normalizeRadiusGatewayUrl};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var p=Object.defineProperty;var r=(t,n)=>p(t,"name",{value:n,configurable:!0});import{obj as c}from"@earendil-works/pi-schema";function u(t,n={}){const{additionalProperties:e,...i}=n,o=c(t,{...i,open:!0});return e?{...o,additionalProperties:e}:o}r(u,"openObject");function f(t,n={}){return{type:"string",const:t,...n}}r(f,"stringLiteral");function b(t,n={}){return{type:"object",patternProperties:{"^.*$":t},...n}}r(b,"stringRecord");export{u as openObject,f as stringLiteral,b as stringRecord};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var C=Object.defineProperty;var u=(n,t)=>C(n,"name",{value:t,configurable:!0});import{createTypedMetrics as I,createTypedSpanStarter as S,defineTelemetrySchema as A,NOOP_TELEMETRY_CONTEXT as M,NOOP_TELEMETRY_METRICS as O}from"@earendil-works/pi-telemetry";const o={type:"string",description:"Provider identifier.",required:!0},s={type:"string",description:"Requested model identifier.",required:!0},b={type:"string",description:"Normalized stop reason.",values:["pending","stop","length","toolUse","error","aborted","deferred"]},_={description:"One logical model request, including authentication and provider setup.",parents:{kind:"any"},startAttributes:{provider:o,api:{type:"string",description:"API identifier.",required:!0},model:s,reasoning:{type:"string",description:"Scalar requested reasoning level.",required:!1}},endAttributes:{stop:b,"usage.input":{type:"number",description:"Uncached input tokens."},"usage.output":{type:"number",description:"Output tokens."},"usage.cache_read":{type:"number",description:"Cache-read tokens."},"usage.cache_write":{type:"number",description:"Cache-write tokens."},"cost.total":{type:"number",description:"Total request cost in USD."},"response.id":{type:"string",description:"Provider response identifier.",cardinality:"high"}},events:{"pi.ai.first_chunk":{description:"First normalized stream event delivered.",attributes:{}},"pi.ai.block":{description:"A completed content block; content is never recorded.",attributes:{type:{type:"string",description:"Block kind.",values:["text","thinking","tool_call"],required:!0},index:{type:"number",description:"Content block index.",required:!0},chars:{type:"number",description:"UTF-16 character count.",required:!0},tool:{type:"string",description:"Tool name, for tool-call blocks only.",required:!1}}}},status:{default:"ok",errorWhen:"Stop reason is error: provider_error with at most 500 error-message characters. Aborted stays ok."}},q=A({version:1,spans:{"pi.ai.request":_,"pi.ai.poll":{..._,description:"One deferred-response poll, not the deferred request's lifetime."}},metrics:{"pi.ai.request.duration":{kind:"histogram",description:"Logical request or poll duration.",unit:"ms",attributes:{provider:o,model:s,stop:{...b,required:!0}}},"pi.ai.first_chunk.duration":{kind:"histogram",description:"Time to the first normalized stream event.",unit:"ms",attributes:{provider:o,model:s}},"pi.ai.tokens":{kind:"counter",description:"Reported model token usage; pending and deferred polls are excluded.",unit:"token",attributes:{provider:o,model:s,kind:{type:"string",description:"Token usage category.",values:["input","output","cache_read","cache_write"],required:!0}}},"pi.ai.cost":{kind:"counter",description:"Reported model cost; pending and deferred polls are excluded.",unit:"USD",attributes:{provider:o,model:s}}}});function
|
|
1
|
+
var C=Object.defineProperty;var u=(n,t)=>C(n,"name",{value:t,configurable:!0});import{createTypedMetrics as I,createTypedSpanStarter as S,defineTelemetrySchema as A,NOOP_TELEMETRY_CONTEXT as M,NOOP_TELEMETRY_METRICS as O}from"@earendil-works/pi-telemetry";import{ownedSlice as D}from"./utils/text.js";const o={type:"string",description:"Provider identifier.",required:!0},s={type:"string",description:"Requested model identifier.",required:!0},b={type:"string",description:"Normalized stop reason.",values:["pending","stop","length","toolUse","error","aborted","deferred"]},_={description:"One logical model request, including authentication and provider setup.",parents:{kind:"any"},startAttributes:{provider:o,api:{type:"string",description:"API identifier.",required:!0},model:s,reasoning:{type:"string",description:"Scalar requested reasoning level.",required:!1}},endAttributes:{stop:b,"usage.input":{type:"number",description:"Uncached input tokens."},"usage.output":{type:"number",description:"Output tokens."},"usage.cache_read":{type:"number",description:"Cache-read tokens."},"usage.cache_write":{type:"number",description:"Cache-write tokens."},"cost.total":{type:"number",description:"Total request cost in USD."},"response.id":{type:"string",description:"Provider response identifier.",cardinality:"high"}},events:{"pi.ai.first_chunk":{description:"First normalized stream event delivered.",attributes:{}},"pi.ai.block":{description:"A completed content block; content is never recorded.",attributes:{type:{type:"string",description:"Block kind.",values:["text","thinking","tool_call"],required:!0},index:{type:"number",description:"Content block index.",required:!0},chars:{type:"number",description:"UTF-16 character count.",required:!0},tool:{type:"string",description:"Tool name, for tool-call blocks only.",required:!1}}}},status:{default:"ok",errorWhen:"Stop reason is error: provider_error with at most 500 error-message characters. Aborted stays ok."}},q=A({version:1,spans:{"pi.ai.request":_,"pi.ai.poll":{..._,description:"One deferred-response poll, not the deferred request's lifetime."}},metrics:{"pi.ai.request.duration":{kind:"histogram",description:"Logical request or poll duration.",unit:"ms",attributes:{provider:o,model:s,stop:{...b,required:!0}}},"pi.ai.first_chunk.duration":{kind:"histogram",description:"Time to the first normalized stream event.",unit:"ms",attributes:{provider:o,model:s}},"pi.ai.tokens":{kind:"counter",description:"Reported model token usage; pending and deferred polls are excluded.",unit:"token",attributes:{provider:o,model:s,kind:{type:"string",description:"Token usage category.",values:["input","output","cache_read","cache_write"],required:!0}}},"pi.ai.cost":{kind:"counter",description:"Reported model cost; pending and deferred polls are excluded.",unit:"USD",attributes:{provider:o,model:s}}}});function P(n){const t=I(n,[q]);return{requestDuration:t.histogram("pi.ai.request.duration"),firstChunkDuration:t.histogram("pi.ai.first_chunk.duration"),tokens:t.counter("pi.ai.tokens"),cost:t.counter("pi.ai.cost")}}u(P,"createInstruments");const x=new WeakMap;function W(n,t,l){const h=performance.now(),r={provider:n.provider,model:n.id},p=t?.telemetry?.metrics??O;let a=x.get(p);a||(a=P(p),x.set(p,a));const{requestDuration:T,firstChunkDuration:E,tokens:d,cost:R}=a;let i,f,g=!0;const c=new Map,w=new Promise(e=>{f=e}),k=u(e=>(i=e,w),"run"),y={...r,api:n.api,...typeof t?.reasoning=="string"?{reasoning:t.reasoning}:{}},m=S(t?.telemetry??M,[q]);return m(l?"pi.ai.poll":"pi.ai.request",y,k),{onEvent(e){if(g&&(g=!1,i.addEvent("pi.ai.first_chunk"),E.record(performance.now()-h,r,i)),e.type==="toolcall_delta")c.set(e.contentIndex,(c.get(e.contentIndex)??0)+e.delta.length);else if(e.type==="text_end"||e.type==="thinking_end")i.addEvent("pi.ai.block",{type:e.type==="text_end"?"text":"thinking",index:e.contentIndex,chars:e.content.length});else if(e.type==="toolcall_end"){const v=c.get(e.contentIndex)??0;c.delete(e.contentIndex),i.addEvent("pi.ai.block",{type:"tool_call",index:e.contentIndex,chars:v,tool:e.toolCall.name})}},onResult(e){e&&(i.setAttributes({stop:e.stopReason,"usage.input":e.usage.input,"usage.output":e.usage.output,"usage.cache_read":e.usage.cacheRead,"usage.cache_write":e.usage.cacheWrite,"cost.total":e.usage.cost.total,"response.id":e.responseId}),e.stopReason==="error"&&i.setStatus({status:"error",error:{name:"provider_error",message:D(e.errorMessage??"",0,500)}}),T.record(performance.now()-h,{...r,stop:e.stopReason},i),(!l||e.stopReason!=="pending"&&e.stopReason!=="deferred")&&(d.add(e.usage.input,{...r,kind:"input"}),d.add(e.usage.output,{...r,kind:"output"}),d.add(e.usage.cacheRead,{...r,kind:"cache_read"}),d.add(e.usage.cacheWrite,{...r,kind:"cache_write"}),R.add(e.usage.cost.total,r))),f()}}}u(W,"observeModelRequest");export{q as AI_TELEMETRY_SCHEMA,W as observeModelRequest};
|
|
@@ -23,7 +23,7 @@ export type KnownImageApi = "openrouter-images";
|
|
|
23
23
|
export type ImageApi = KnownImageApi | (string & {});
|
|
24
24
|
export type KnownClassifierApi = "typesafe-system-one" | "cloudflare-workers-ai-system-one" | "llama-cpp-classify" | "openai-decisions";
|
|
25
25
|
export type ClassifierApi = KnownClassifierApi | (string & {});
|
|
26
|
-
export type KnownProvider = "amazon-bedrock" | "ant-ling" | "anthropic" | "google" | "google-vertex" | "openai" | "azure" | "openai-codex" | "radius" | "typesafe" | "nvidia" | "deepseek" | "github-copilot" | "xai" | "groq" | "cerebras" | "openrouter" | "vercel-ai-gateway" | "zai" | "zai-coding-cn" | "mistral" | "minimax" | "minimax-cn" | "moonshotai" | "moonshotai-cn" | "huggingface" | "fireworks" | "together" | "baseten" | "opencode" | "opencode-go" | "kimi-coding" | "meta" | "cloudflare-workers-ai" | "cloudflare-ai-gateway" | "qwen-token-plan" | "qwen-token-plan-cn" | "qwen-token-plan-individual" | "xiaomi" | "xiaomi-token-plan-cn" | "xiaomi-token-plan-ams" | "xiaomi-token-plan-sgp";
|
|
26
|
+
export type KnownProvider = "amazon-bedrock" | "ant-ling" | "anthropic" | "google" | "google-vertex" | "openai" | "azure" | "openai-codex" | "radius" | "typesafe" | "nvidia" | "deepseek" | "github-copilot" | "xai" | "groq" | "cerebras" | "openrouter" | "vercel-ai-gateway" | "zai" | "zai-coding-cn" | "mistral" | "minimax" | "minimax-cn" | "moonshotai" | "moonshotai-cn" | "huggingface" | "fireworks" | "together" | "baseten" | "opencode" | "opencode-go" | "kimi-coding" | "meta" | "cloudflare-workers-ai" | "cloudflare-ai-gateway" | "qwen-token-plan" | "qwen-token-plan-cn" | "qwen-token-plan-individual" | "qwen-token-plan-individual-cn" | "xiaomi" | "xiaomi-token-plan-cn" | "xiaomi-token-plan-ams" | "xiaomi-token-plan-sgp";
|
|
27
27
|
export type ProviderId = KnownProvider | string;
|
|
28
28
|
export type ToolChoice = "auto" | "none";
|
|
29
29
|
export type SamplingParams = Record<string, unknown>;
|
|
@@ -65,6 +65,7 @@ export interface StreamOptions extends ProviderRequestOptions<Model<Api>> {
|
|
|
65
65
|
transport?: Transport;
|
|
66
66
|
cacheRetention?: CacheRetention;
|
|
67
67
|
sessionId?: string;
|
|
68
|
+
disableContinuation?: boolean;
|
|
68
69
|
websocketConnectTimeoutMs?: number;
|
|
69
70
|
metadata?: Record<string, unknown>;
|
|
70
71
|
}
|
|
@@ -160,6 +161,7 @@ export interface Usage {
|
|
|
160
161
|
cacheRead: number;
|
|
161
162
|
cacheWrite: number;
|
|
162
163
|
total: number;
|
|
164
|
+
totalFromProvider?: boolean;
|
|
163
165
|
};
|
|
164
166
|
}
|
|
165
167
|
export type StopReason = "pending" | "stop" | "length" | "toolUse" | "error" | "aborted" | "deferred";
|
|
@@ -328,7 +330,6 @@ export interface ClassifierResult {
|
|
|
328
330
|
errorMessage?: string;
|
|
329
331
|
timestamp: number;
|
|
330
332
|
}
|
|
331
|
-
import type { TSchema } from "typebox";
|
|
332
333
|
export type GrammarFormat = "openai_lark" | "openai_regex";
|
|
333
334
|
export type GrammarVariants = Partial<Record<GrammarFormat, string>>;
|
|
334
335
|
export type ConstrainedSamplingConfig = {
|
|
@@ -338,7 +339,7 @@ export type ConstrainedSamplingConfig = {
|
|
|
338
339
|
type: "grammar";
|
|
339
340
|
variants: GrammarVariants;
|
|
340
341
|
};
|
|
341
|
-
export interface Tool<TParameters extends
|
|
342
|
+
export interface Tool<TParameters extends object = object> {
|
|
342
343
|
name: string;
|
|
343
344
|
description: string;
|
|
344
345
|
parameters: TParameters;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var r=Object.defineProperty;var s=(t,e)=>r(t,"name",{value:e,configurable:!0});import{ownedSlice as a}from"./text.js";const c=4e3;function C(t){if(!(t instanceof Error))return{message:f(t),messageCarriesBody:!1};const e=t,i=g(e),n=m(e),u=n===void 0||t.message.includes(n),d=i===void 0&&n===void 0?y(t):t.message;return{status:i,body:n,message:d,messageCarriesBody:u}}s(C,"normalizeProviderError");const p=5;function y(t){let e,i=t.cause;for(let d=0;d<p&&i instanceof Error;d++)e=i,i=i.cause;if(!e)return t.message;let n=(e.message||e.name).trim();const u=e.code;return(typeof u=="string"||typeof u=="number")&&!n.includes(String(u))&&(n=n?`${n} (${u})`:String(u)),!n||t.message.includes(n)?t.message:t.message?`${t.message}: ${n}`:n}s(y,"withCauseDetail");function g(t){if(typeof t.statusCode=="number")return t.statusCode;if(typeof t.status=="number")return t.status;if(typeof t.$metadata?.httpStatusCode=="number")return t.$metadata.httpStatusCode;if(typeof t.$response?.statusCode=="number")return t.$response.statusCode}s(g,"extractStatus");function m(t){const e=b(t);if(e===void 0)return;const i=e.trim();if(i.length!==0)return $(i,c)}s(m,"extractBody");function b(t){if(typeof t.body=="string")return t.body;if(o(t.error))return f(t.error);const e=t.$response?.body;if(typeof e=="string")return e;if(!l(e)&&o(e))return f(e)}s(b,"pickBodyText");function l(t){return typeof t=="object"&&t!==null&&"pipe"in t&&typeof t.pipe=="function"}s(l,"isReadableStreamLike");function o(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return e!==Object.prototype&&e!==null?!1:Object.keys(t).length>0}s(o,"isPlainNonEmptyObject");function O(t,e){return t.messageCarriesBody||t.status===void 0||t.body===void 0?e!==void 0&&t.status!==void 0?`${e} (${t.status}): ${t.message}`:t.message:e!==void 0?`${e} (${t.status}): ${t.body}`:`${t.status}: ${t.body}`}s(O,"formatProviderError");function $(t,e){return t.length<=e?t:`${a(t,0,e)}... [truncated ${t.length-e} chars]`}s($,"truncateErrorText");function f(t){try{const e=JSON.stringify(t);return e===void 0?String(t):e}catch{return String(t)}}s(f,"safeJsonStringify");export{c as MAX_PROVIDER_ERROR_BODY_CHARS,O as formatProviderError,C as normalizeProviderError,f as safeJsonStringify,$ as truncateErrorText,y as withCauseDetail};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s=Object.defineProperty;var n=(t,e)=>s(t,"name",{value:e,configurable:!0});function i(t){return typeof t=="number"&&Number.isFinite(t)&&t>=0}n(i,"isValidCost");function u(t){return t.provider==="openrouter"||t.baseUrl.includes("openrouter.ai")}n(u,"isOpenRouterModel");function p(t,e){if(i(e.cost)){if(e.is_byok===!1){t.cost.total=e.cost,t.cost.totalFromProvider=!0;return}if(e.is_byok===!0){const o=e.cost_details;if(!o)return;let r=o.upstream_inference_cost;if(r===null){if(!i(o.upstream_inference_prompt_cost)||!i(o.upstream_inference_completions_cost))return;r=o.upstream_inference_prompt_cost+o.upstream_inference_completions_cost}if(!i(r))return;t.cost.total=e.cost+r,t.cost.totalFromProvider=!0}}}n(p,"applyOpenRouterReportedCost");export{p as applyOpenRouterReportedCost,u as isOpenRouterModel};
|