dal-code 1.0.45 → 1.0.46
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 +76 -0
- package/NOTICE +49 -1
- package/dist/bun/register-bedrock.js +1 -0
- package/dist/cli/args.js +2 -2
- package/dist/cli/auth-check.js +1 -1
- package/dist/cli/auth-command.js +6 -5
- package/dist/cli/experimental/auth.js +1 -0
- package/dist/cli/experimental/cli.js +1 -0
- package/dist/cli/experimental/command-options.js +1 -0
- package/dist/cli/experimental/command.js +1 -0
- package/dist/cli/experimental/commands/client.js +1 -0
- package/dist/cli/experimental/commands/pi.js +1 -0
- package/dist/cli/experimental/commands/server.js +1 -0
- package/dist/cli/experimental/transport-address.js +1 -0
- package/dist/cli/list-models.js +2 -2
- package/dist/cli/piped-stdin.js +2 -0
- package/dist/cli/startup-diagnostics.js +1 -0
- package/dist/client/index.js +1 -0
- package/dist/client/remote-session.js +1 -0
- package/dist/client/transcript.js +1 -0
- package/dist/core/agent-log.d.ts +6 -0
- package/dist/core/agent-log.js +3 -0
- package/dist/core/agent-session-services.d.ts +0 -1
- package/dist/core/agent-session-services.js +1 -1
- package/dist/core/agent-session.d.ts +19 -2
- package/dist/core/agent-session.js +8 -8
- package/dist/core/client-identity.js +1 -0
- package/dist/core/compaction/branch-summarization.js +3 -3
- package/dist/core/compaction/compaction.d.ts +2 -2
- package/dist/core/compaction/compaction.js +11 -9
- package/dist/core/compaction-backoff.js +1 -0
- package/dist/core/dal-session-headers.js +1 -0
- package/dist/core/export-html/index.js +2 -2
- package/dist/core/export-html/template.html +1 -0
- package/dist/core/export-html/template.js +6 -6
- package/dist/core/export-html/vendor/marked-cjk-friendly.min.js +6 -0
- package/dist/core/export-html/vendor/marked.min.js +30 -29
- package/dist/core/extensions/loader.js +1 -1
- package/dist/core/extensions/runner.d.ts +6 -0
- package/dist/core/extensions/runner.js +1 -1
- package/dist/core/extensions/types.d.ts +1 -0
- package/dist/core/extensions/virtual-modules.js +1 -1
- package/dist/core/http-dispatcher.js +1 -1
- package/dist/core/model-config.d.ts +984 -0
- package/dist/core/model-config.js +5 -5
- package/dist/core/model-identity.js +2 -0
- package/dist/core/model-resolver.js +1 -1
- package/dist/core/model-runtime.d.ts +2 -0
- package/dist/core/model-runtime.js +2 -2
- package/dist/core/package-manager.d.ts +2 -0
- package/dist/core/package-manager.js +2 -2
- package/dist/core/provider-attribution.js +1 -1
- package/dist/core/provider-composer.d.ts +2 -1
- package/dist/core/provider-composer.js +1 -1
- package/dist/core/sandbox/bwrap-placeholders.js +1 -1
- package/dist/core/sandbox/index.d.ts +1 -1
- package/dist/core/sandbox/index.js +1 -1
- package/dist/core/sandbox/policy.d.ts +4 -0
- package/dist/core/sandbox/policy.js +1 -1
- package/dist/core/sandbox/runtime.d.ts +2 -0
- package/dist/core/sandbox/runtime.js +1 -1
- package/dist/core/sandbox/shell-sandbox.d.ts +2 -0
- package/dist/core/sandbox/shell-sandbox.js +6 -6
- package/dist/core/sdk.js +1 -1
- package/dist/core/session-stall-monitor.d.ts +41 -0
- package/dist/core/session-stall-monitor.js +2 -0
- package/dist/core/settings-manager.d.ts +4 -0
- package/dist/core/settings-manager.js +1 -1
- package/dist/core/settings-schema.d.ts +2 -0
- package/dist/core/settings-schema.js +1 -1
- package/dist/core/stall-watchdog.d.ts +55 -0
- package/dist/core/stall-watchdog.js +1 -0
- package/dist/core/system-prompt.js +10 -10
- package/dist/core/tools/bash.d.ts +1 -0
- package/dist/core/tools/bash.js +14 -14
- package/dist/core/tools/edit.d.ts +1 -1
- package/dist/core/tools/edit.js +3 -3
- package/dist/core/tools/grep.js +1 -1
- package/dist/core/tools/path-utils.d.ts +1 -0
- package/dist/core/tools/path-utils.js +1 -1
- package/dist/dal/builtins.js +2 -2
- package/dist/dal/manifest.d.ts +1 -0
- package/dist/dal/manifest.js +1 -1
- package/dist/dal/safety-net.js +3 -1
- package/dist/extensions/codemode/execute.js +22 -16
- package/dist/extensions/mcp/config.js +2 -2
- package/dist/extensions/mcp/oauth.js +2 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1 -1
- package/dist/main.js +4 -4
- package/dist/migrations.js +3 -5
- package/dist/modes/interactive/components/daxnuts.js +1 -0
- package/dist/modes/interactive/external-editor.js +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +7 -7
- package/dist/modes/interactive/interactive-mode.js +25 -25
- package/dist/modes/interactive/session-share.js +1 -1
- package/dist/modes/interactive/theme/theme-json.js +12 -0
- package/dist/modes/interactive/theme/theme-schema.json +356 -0
- package/dist/modes/print-mode.d.ts +1 -0
- package/dist/modes/print-mode.js +8 -7
- package/dist/modes/rpc/rpc-client.js +3 -3
- 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-capabilities/src/catalogue.js +1 -1
- package/dist/node_modules/@dalcode/dal-capabilities/src/index.js +10 -10
- package/dist/node_modules/@dalcode/dal-capabilities/src/match.js +1 -1
- package/dist/node_modules/@dalcode/dal-capabilities/src/state.js +3 -3
- package/dist/node_modules/@dalcode/dal-codeindex/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-codeindex/src/index.js +4 -4
- package/dist/node_modules/@dalcode/dal-compat/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-dap/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-dap/src/install.js +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 +5 -4
- package/dist/node_modules/@dalcode/dal-guard/src/credentials.js +7 -1
- package/dist/node_modules/@dalcode/dal-guard/src/edit-anchor-core.js +25 -23
- package/dist/node_modules/@dalcode/dal-guard/src/edit-anchor.js +4 -4
- package/dist/node_modules/@dalcode/dal-guard/src/index.js +4 -4
- package/dist/node_modules/@dalcode/dal-guard/src/policy.js +1 -1
- package/dist/node_modules/@dalcode/dal-guard/src/session-files.js +1 -0
- package/dist/node_modules/@dalcode/dal-guard/src/suspicion.js +1 -0
- package/dist/node_modules/@dalcode/dal-guard/src/workspace.js +2 -2
- 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 +4 -2
- package/dist/node_modules/@dalcode/dal-learn/src/engine.js +4 -4
- package/dist/node_modules/@dalcode/dal-learn/src/index.js +15 -14
- package/dist/node_modules/@dalcode/dal-learn/src/revisions.js +3 -0
- package/dist/node_modules/@dalcode/dal-learn/src/safety.js +1 -1
- package/dist/node_modules/@dalcode/dal-learn/src/skill-evolution.js +14 -14
- package/dist/node_modules/@dalcode/dal-lsp/package.json +5 -3
- package/dist/node_modules/@dalcode/dal-lsp/src/config.js +1 -1
- package/dist/node_modules/@dalcode/dal-lsp/src/index.js +14 -13
- package/dist/node_modules/@dalcode/dal-lsp/src/managed.js +1 -0
- package/dist/node_modules/@dalcode/dal-mcp/package.json +7 -6
- package/dist/node_modules/@dalcode/dal-mcp/src/child-env.js +3 -0
- package/dist/node_modules/@dalcode/dal-mcp/src/stdio-client.d.ts +1 -0
- package/dist/node_modules/@dalcode/dal-mcp/src/stdio-client.js +3 -3
- package/dist/node_modules/@dalcode/dal-office/package.json +3 -2
- package/dist/node_modules/@dalcode/dal-office/src/extract/cell.js +1 -0
- package/dist/node_modules/@dalcode/dal-office/src/extract/index.js +2 -2
- package/dist/node_modules/@dalcode/dal-office/src/extract/ooxml.js +4 -4
- package/dist/node_modules/@dalcode/dal-office/src/extract/pdf.js +4 -4
- package/dist/node_modules/@dalcode/dal-office/src/facts.d.ts +15 -0
- package/dist/node_modules/@dalcode/dal-office/src/facts.js +4 -0
- package/dist/node_modules/@dalcode/dal-office/src/index.js +1 -1
- package/dist/node_modules/@dalcode/dal-office/src/lazy.js +1 -0
- package/dist/node_modules/@dalcode/dal-office/src/{index.d.ts → office.d.ts} +2 -3
- package/dist/node_modules/@dalcode/dal-office/src/office.js +1 -0
- package/dist/node_modules/@dalcode/dal-office/src/render/capture.d.ts +21 -0
- package/dist/node_modules/@dalcode/dal-office/src/render/capture.js +13 -0
- package/dist/node_modules/@dalcode/dal-office/src/render/chart.d.ts +15 -0
- package/dist/node_modules/@dalcode/dal-office/src/render/chart.js +3 -3
- package/dist/node_modules/@dalcode/dal-office/src/render/docx.d.ts +4 -0
- package/dist/node_modules/@dalcode/dal-office/src/render/docx.js +1 -1
- package/dist/node_modules/@dalcode/dal-office/src/render/pptx.d.ts +2 -0
- package/dist/node_modules/@dalcode/dal-office/src/render/pptx.js +4 -3
- package/dist/node_modules/@dalcode/dal-office/src/render/table-layout.js +1 -0
- package/dist/node_modules/@dalcode/dal-office/src/render/xlsx-chart.d.ts +24 -0
- package/dist/node_modules/@dalcode/dal-office/src/render/xlsx-chart.js +1 -0
- package/dist/node_modules/@dalcode/dal-office/src/render/xlsx.d.ts +9 -0
- package/dist/node_modules/@dalcode/dal-office/src/render/xlsx.js +1 -1
- package/dist/node_modules/@dalcode/dal-office/src/scratchpad.d.ts +2 -0
- package/dist/node_modules/@dalcode/dal-office/src/scratchpad.js +1 -1
- package/dist/node_modules/@dalcode/dal-office/src/table-stats.js +2 -0
- package/dist/node_modules/@dalcode/dal-office/src/tools/chart-generate.js +4 -3
- package/dist/node_modules/@dalcode/dal-office/src/tools/doc-generate.js +2 -3
- package/dist/node_modules/@dalcode/dal-office/src/tools/docx-edit.js +5 -5
- package/dist/node_modules/@dalcode/dal-office/src/tools/drawio-generate.js +2 -3
- package/dist/node_modules/@dalcode/dal-office/src/tools/md-generate.js +2 -3
- package/dist/node_modules/@dalcode/dal-office/src/tools/ppt-generate.js +5 -3
- package/dist/node_modules/@dalcode/dal-office/src/tools/ppt-plan.js +4 -2
- package/dist/node_modules/@dalcode/dal-office/src/tools/pptx-edit.js +5 -5
- package/dist/node_modules/@dalcode/dal-office/src/tools/read-file.js +4 -3
- package/dist/node_modules/@dalcode/dal-office/src/tools/render-page.js +4 -0
- package/dist/node_modules/@dalcode/dal-office/src/tools/sheet-generate.js +3 -3
- package/dist/node_modules/@dalcode/dal-office/src/tools/xlsx-edit.js +3 -3
- package/dist/node_modules/@dalcode/dal-pi-kit/dist/i18n.js +15 -15
- package/dist/node_modules/@dalcode/dal-pi-kit/dist/index.js +1 -1
- package/dist/node_modules/@dalcode/dal-pi-kit/dist/project-size.js +1 -0
- package/dist/node_modules/@dalcode/dal-pi-kit/package.json +1 -1
- package/dist/node_modules/@dalcode/dal-pi-kit/src/i18n.js +15 -15
- package/dist/node_modules/@dalcode/dal-pi-kit/src/index.js +1 -1
- package/dist/node_modules/@dalcode/dal-pi-kit/src/project-size.js +1 -0
- package/dist/node_modules/@dalcode/dal-plugins/package.json +4 -5
- package/dist/node_modules/@dalcode/dal-plugins/src/index.js +11 -11
- package/dist/node_modules/@dalcode/dal-plugins/src/manage.js +7 -7
- package/dist/node_modules/@dalcode/dal-recall/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-recall/src/index.js +1 -1
- 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-rewind/src/commands.js +1 -1
- package/dist/node_modules/@dalcode/dal-rewind/src/core.d.ts +2 -0
- package/dist/node_modules/@dalcode/dal-rewind/src/core.js +6 -6
- package/dist/node_modules/@dalcode/dal-rewind/src/index.js +1 -1
- package/dist/node_modules/@dalcode/dal-rewind/src/state.js +1 -1
- package/dist/node_modules/@dalcode/dal-router/package.json +8 -9
- package/dist/node_modules/@dalcode/dal-router/src/commands.js +8 -9
- package/dist/node_modules/@dalcode/dal-router/src/config.d.ts +3 -36
- package/dist/node_modules/@dalcode/dal-router/src/config.js +2 -2
- package/dist/node_modules/@dalcode/dal-router/src/index.js +2 -4
- package/dist/node_modules/@dalcode/dal-router/src/notice.js +1 -0
- package/dist/node_modules/@dalcode/dal-router/src/roles/deliverables.js +4 -0
- package/dist/node_modules/@dalcode/dal-router/src/roles/index.js +10 -8
- package/dist/node_modules/@dalcode/dal-router/src/roles/planner.js +4 -0
- package/dist/node_modules/@dalcode/dal-router/src/roles/prompts.js +18 -16
- package/dist/node_modules/@dalcode/dal-router/src/roles/signals.js +2 -2
- package/dist/node_modules/@dalcode/dal-router/src/runtime.d.ts +0 -13
- package/dist/node_modules/@dalcode/dal-router/src/runtime.js +1 -1
- package/dist/node_modules/@dalcode/dal-router/src/subagent.js +1 -1
- package/dist/node_modules/@dalcode/dal-router/src/task-shape.d.ts +8 -0
- package/dist/node_modules/@dalcode/dal-router/src/task-shape.js +1 -0
- package/dist/node_modules/@dalcode/dal-rtk/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-skills/package.json +4 -3
- package/dist/node_modules/@dalcode/dal-skills/src/bundled/chart-design/SKILL.md +35 -0
- package/dist/node_modules/@dalcode/dal-skills/src/bundled/dal-slides/SKILL.md +17 -9
- package/dist/node_modules/@dalcode/dal-skills/src/bundled/diagram-design/SKILL.md +7 -5
- package/dist/node_modules/@dalcode/dal-skills/src/bundled/poster-design/SKILL.md +8 -6
- package/dist/node_modules/@dalcode/dal-skills/src/bundled/print-design/SKILL.md +21 -8
- package/dist/node_modules/@dalcode/dal-skills/src/bundled/visual-kit/diagram.html +1 -1
- package/dist/node_modules/@dalcode/dal-skills/src/bundled/visual-kit/mindmap.html +1 -1
- package/dist/node_modules/@dalcode/dal-skills/src/bundled/visual-kit/posters/event-poster.html +1 -1
- package/dist/node_modules/@dalcode/dal-skills/src/bundled/visual-kit/posters/poster.css +1 -1
- package/dist/node_modules/@dalcode/dal-skills/src/bundled/visual-kit/posters/square-card.html +1 -1
- package/dist/node_modules/@dalcode/dal-skills/src/bundled/visual-kit/posters/wechat-cover.html +1 -1
- package/dist/node_modules/@dalcode/dal-skills/src/bundled/visual-kit/posters/xhs-card.html +1 -1
- package/dist/node_modules/@dalcode/dal-skills/src/bundled/visual-kit/posters/xhs-cover.html +8 -5
- package/dist/node_modules/@dalcode/dal-skills/src/bundled/visual-kit/print/letter.html +1 -1
- package/dist/node_modules/@dalcode/dal-skills/src/bundled/visual-kit/print/report.html +1 -1
- package/dist/node_modules/@dalcode/dal-skills/src/bundled/visual-kit/print/resume.html +7 -3
- package/dist/node_modules/@dalcode/dal-skills/src/bundled/web-design/SKILL.md +4 -4
- package/dist/node_modules/@dalcode/dal-skills/src/bundled.js +1 -1
- package/dist/node_modules/@dalcode/dal-skills/src/catalog.js +3 -2
- package/dist/node_modules/@dalcode/dal-skills/src/hint.js +1 -0
- package/dist/node_modules/@dalcode/dal-skills/src/index.js +13 -14
- package/dist/node_modules/@dalcode/dal-skills/src/search.js +1 -1
- 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-subagent/src/background.js +10 -10
- package/dist/node_modules/@dalcode/dal-subagent/src/index.js +18 -20
- package/dist/node_modules/@dalcode/dal-telemetry/package.json +3 -3
- 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-tool-catalog/src/groups.js +1 -1
- package/dist/node_modules/@dalcode/dal-tool-catalog/src/index.js +4 -4
- 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/announce-check.js +3 -1
- package/dist/node_modules/@dalcode/dal-workflow/src/deliverable-scope.js +1 -0
- package/dist/node_modules/@dalcode/dal-workflow/src/index.js +4 -4
- package/dist/node_modules/@dalcode/dal-workflow/src/test-proof-note.js +3 -0
- package/dist/node_modules/@dalcode/dal-workflow/src/todo-snapshot.js +2 -2
- package/dist/node_modules/@dalcode/dal-workflow/src/todo.js +4 -4
- package/dist/node_modules/@dalcode/dal-workflow/src/truncation-check.js +1 -0
- package/dist/node_modules/@dalcode/dal-workflow/src/working-contract.js +1 -1
- package/dist/node_modules/@dalcode/deepailab/package.json +3 -3
- package/dist/node_modules/@dalcode/deepailab/src/index.js +3 -3
- package/dist/node_modules/@earendil-works/pi-agent-core/README.md +5 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts +2 -1
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +1 -1
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts +3 -1
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/agent.js +1 -1
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.js +37 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js +104 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/utils.js +16 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/config.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/context.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.js +10 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/events.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/assistant.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/effect-gate.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/tools.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/hooks.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.js +17 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/bash.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/bounded.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/chord.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/context.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/harness.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/hooks.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/index.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/jsonl.js +4 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/kinds/collapse.js +3 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/kinds/entries.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/kinds/frames.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/kinds/generation.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/kinds/job.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/kinds/plugin.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/kinds/post-tools.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/kinds/task-api.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/kinds/tool.js +3 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/membrane.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/memory.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/scheduler.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/session.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/system.js +8 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/types.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/view.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.js +5 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/reducer.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/result.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/boundary.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/checkpoint.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/deferred.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/generation.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/reconcile.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/recovery.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/response.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/retry.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/structural.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/terminal.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tool-placement.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tools.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/harness.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/index.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/lane.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/progress.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/reducer.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/restore.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/transcript.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/types.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/commit.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/context.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork-policy.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/in-memory-storage-state.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/index.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/codec.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/errors.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/fork.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/index.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/io.js +3 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/legacy-v3.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/repo.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/storage.js +8 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/types.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.js +5 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/mutation-line.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/state.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/datasets.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/session-repo.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/storage.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/session-repo.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/storage.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/gating-storage.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/index.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/instrumented-storage.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/storage-decorator.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/types.js +0 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/types.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/values.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.js +10 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/system-prompt.js +2 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/telemetry.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/bash.js +12 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/edit-diff.js +16 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/edit.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/file-mutation-queue.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/image.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/index.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/path-utils.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/read.js +14 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/tool-context.js +0 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/write.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/types.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/adaptive-publisher.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/output-capture.js +5 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.js +5 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/usage.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/node.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/search/index.js +0 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/search/scanning.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts +2 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
- package/dist/node_modules/@earendil-works/pi-ai/README.md +78 -3
- 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/classifier-shared.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-gateway-binding.js +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-workers-ai-system-one.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 +1 -1
- 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 +6 -2
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/lazy.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/llama-cpp-classify.js +5 -5
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +2 -2
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +6 -6
- 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 +10 -5
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +3 -2
- 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.js +4 -4
- 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/system-one-shared.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/typesafe-system-one.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/auth/oauth/oauth-page.js +74 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/cli.js +0 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/images-models.js +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/index.d.ts +2 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/index.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/models.d.ts +4 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/models.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.js +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/compat-schema.d.ts +180 -0
- 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/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/huggingface.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/minimax-cn.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/minimax.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/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/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/typesafe.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/model-schema.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/openrouter-images.js +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/telemetry.d.ts +286 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/telemetry.js +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/types.d.ts +20 -4
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/assistant-message-frame.js +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/deferred-tools.js +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.d.ts +4 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/identity.d.ts +27 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/identity.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/provider-retry.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/transcript.d.ts +3 -2
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/transcript.js +2 -2
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/version.d.ts +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/version.js +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/package.json +2 -2
- 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 +2 -0
- package/dist/node_modules/@earendil-works/pi-mcp/package.json +1 -1
- package/dist/node_modules/@earendil-works/pi-telemetry/README.md +167 -21
- package/dist/node_modules/@earendil-works/pi-telemetry/dist/index.d.ts +77 -2
- 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 +35 -2
- package/dist/node_modules/@earendil-works/pi-telemetry/dist/memory.js +1 -1
- package/dist/node_modules/@earendil-works/pi-telemetry/dist/metrics.d.ts +70 -0
- package/dist/node_modules/@earendil-works/pi-telemetry/dist/metrics.js +1 -0
- package/dist/node_modules/@earendil-works/pi-telemetry/dist/noop.d.ts +5 -2
- package/dist/node_modules/@earendil-works/pi-telemetry/dist/noop.js +1 -1
- package/dist/node_modules/@earendil-works/pi-telemetry/dist/render.js +2 -0
- package/dist/node_modules/@earendil-works/pi-telemetry/dist/testing/conformance.js +1 -1
- package/dist/node_modules/@earendil-works/pi-telemetry/package.json +6 -1
- package/dist/node_modules/@earendil-works/pi-tui/dist/autocomplete.js +2 -2
- package/dist/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +8 -7
- package/dist/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js +1 -1
- package/dist/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +1 -1
- package/dist/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts +3 -0
- 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 +2 -0
- 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.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/tui.js +2 -2
- package/dist/node_modules/@earendil-works/pi-tui/package.json +3 -2
- package/dist/package-manager-cli.js +9 -9
- package/dist/sdk/office.d.ts +1 -1
- package/dist/sdk/office.js +1 -1
- package/dist/sdk/router.d.ts +4 -4
- package/dist/sdk/router.js +1 -1
- package/dist/server/create-harness.js +1 -0
- package/dist/utils/clipboard-command.js +1 -1
- package/dist/utils/clipboard-native.js +1 -0
- package/dist/utils/pi-user-agent.js +1 -1
- package/dist/utils/shell.js +2 -2
- package/dist/utils/tools-manager.js +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +15 -2
- package/package.json +6 -2
- package/dist/node_modules/@dalcode/dal-guard/src/review.js +0 -3
- package/dist/node_modules/@dalcode/dal-office/src/scenes.js +0 -1
- package/dist/node_modules/@dalcode/dal-plugins/src/rank.js +0 -4
- package/dist/node_modules/@dalcode/dal-router/src/assist.js +0 -4
- package/dist/node_modules/@dalcode/dal-router/src/compact-defer.js +0 -3
- package/dist/node_modules/@dalcode/dal-router/src/jev.d.ts +0 -52
- package/dist/node_modules/@dalcode/dal-router/src/jev.js +0 -5
- package/dist/node_modules/@dalcode/dal-router/src/router.d.ts +0 -32
- package/dist/node_modules/@dalcode/dal-router/src/router.js +0 -1
- package/dist/node_modules/@dalcode/dal-router/src/services.js +0 -1
- package/dist/node_modules/@dalcode/dal-subagent/src/role-pick.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Type as e}from"typebox";export*from"./api/lazy.js";export*from"./auth/context.js";export*from"./auth/credential-store.js";export*from"./auth/helpers.js";import{setAmbientAuthPolicy as s}from"./auth/resolve.js";export*from"./auth/types.js";import{getEnvApiKey as n,setEnvApiKeyPolicy as
|
|
1
|
+
import{Type as e}from"typebox";export*from"./api/lazy.js";export*from"./auth/context.js";export*from"./auth/credential-store.js";export*from"./auth/helpers.js";import{setAmbientAuthPolicy as s}from"./auth/resolve.js";export*from"./auth/types.js";import{getEnvApiKey as n,setEnvApiKeyPolicy as A}from"./env-api-keys.js";export*from"./models.js";export*from"./models-store.js";export*from"./providers/faux.js";export*from"./session-resources.js";export*from"./types.js";export*from"./utils/diagnostics.js";export*from"./utils/event-stream.js";export*from"./utils/identity.js";export*from"./utils/json-parse.js";export*from"./utils/overflow.js";export*from"./utils/retry.js";import{contentText as K,getSystemMessageText as M,renderSystemMessageUpdate as _}from"./utils/text.js";export*from"./utils/transcript.js";export*from"./utils/typebox-helpers.js";import{uuidv7 as O}from"./utils/uuid.js";export*from"./utils/validation.js";import{PI_AI_VERSION as V}from"./utils/version.js";export{V as PI_AI_VERSION,e as Type,K as contentText,n as getEnvApiKey,M as getSystemMessageText,_ as renderSystemMessageUpdate,s as setAmbientAuthPolicy,A as setEnvApiKeyPolicy,O as uuidv7};
|
|
@@ -2,7 +2,9 @@ import { type AuthResolutionOverrides } from "./auth/resolve.ts";
|
|
|
2
2
|
import type { AuthCheck, AuthContext, AuthInteraction, AuthOperationOptions, AuthResult, AuthType, Credential, CredentialStore, LoginOptions, ProviderAuth } from "./auth/types.ts";
|
|
3
3
|
import { type ModelsStore, type ModelsStoreEntry } from "./models-store.ts";
|
|
4
4
|
import type { AnyModel, Api, ApiStreamOptions, AssistantImages, AssistantMessage, AssistantMessageEventStream, ClassifierApi, ClassifierContext, ClassifierModel, ClassifierOptions, ClassifierResult, Context, DeferredCancelOptions, DeferredFetchOptions, DeferredHandle, ImageApi, ImageModel, ImagesContext, ImagesOptions, Model, ModelThinkingLevel, ModelType, ModelTypeMap, ProviderClassifier, ProviderHeaders, ProviderImages, ProviderStreams, SimpleStreamOptions, TranscriptContext, Usage } from "./types.ts";
|
|
5
|
+
import { type ClientIdentity } from "./utils/identity.ts";
|
|
5
6
|
export { ModelsError, type ModelsErrorCode } from "./auth/resolve.ts";
|
|
7
|
+
export { AI_TELEMETRY_SCHEMA } from "./telemetry.ts";
|
|
6
8
|
export { getModelType, isModelType } from "./utils/model-operations.ts";
|
|
7
9
|
export interface ModelsPublication {
|
|
8
10
|
persist?: ModelsStoreEntry | null;
|
|
@@ -29,6 +31,7 @@ export interface ModelsRefreshResult {
|
|
|
29
31
|
}
|
|
30
32
|
export interface ModelsRequestTransforms {
|
|
31
33
|
transformHeaders?: (headers: ProviderHeaders) => ProviderHeaders | Promise<ProviderHeaders>;
|
|
34
|
+
firstTokenTimeoutMs?: number;
|
|
32
35
|
}
|
|
33
36
|
export type ModelsApiStreamOptions<TApi extends Api> = ApiStreamOptions<TApi> & ModelsRequestTransforms;
|
|
34
37
|
export type ModelsSimpleStreamOptions = SimpleStreamOptions & ModelsRequestTransforms;
|
|
@@ -92,6 +95,7 @@ export interface CreateModelsOptions {
|
|
|
92
95
|
credentials?: CredentialStore;
|
|
93
96
|
modelsStore?: ModelsStore;
|
|
94
97
|
authContext?: AuthContext;
|
|
98
|
+
identity?: ClientIdentity;
|
|
95
99
|
}
|
|
96
100
|
export declare function createModels(options?: CreateModelsOptions): MutableModels;
|
|
97
101
|
export interface CreateProviderOptions<TApi extends Api = Api> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var E=Object.defineProperty;var h=(o,e)=>E(o,"name",{value:e,configurable:!0});import{lazyStream as A}from"./api/lazy.js";import{defaultProviderAuthContext as K}from"./auth/context.js";import{InMemoryCredentialStore as L}from"./auth/credential-store.js";import{ModelsError as p,refreshStoredOAuthCredential as W,resolveProviderAuth as $}from"./auth/resolve.js";import{InMemoryModelsStore as _}from"./models-store.js";import{operationSignal as b,raceWithAbortSignal as P}from"./utils/abort.js";import{assertChatModel as N,assertClassifierInputSupported as U,assertClassifierModel as I,assertImageModel as G,classifierErrorResult as x,getModelType as C,imageErrorResult as D,isModelType as k}from"./utils/model-operations.js";import{normalizeContext as O}from"./utils/transcript.js";import{ModelsError as le}from"./auth/resolve.js";import{getModelType as fe,isModelType as ue}from"./utils/model-operations.js";const H={chat:!0,image:!0,classifier:!0};function T(o){return Object.hasOwn(H,C(o))}h(T,"hasKnownModelType");function j(o){return{...o,models:o.models.filter(T)}}h(j,"withKnownModelTypes");function R(o,e){if(!o&&!e)return;const r={...o};for(const[t,s]of Object.entries(e??{})){const i=t.toLowerCase();for(const a of Object.keys(r))a.toLowerCase()===i&&delete r[a];r[t]=s}return r}h(R,"mergeHeaders");class z{static{h(this,"ModelsImpl")}providers=new Map;credentials;modelsStore;authContext;refreshGenerations=new Map;refreshControllers=new Map;publicationChains=new Map;constructor(e){this.credentials=e?.credentials??new L,this.modelsStore=e?.modelsStore??new _,this.authContext=e?.authContext??K()}setProvider(e){this.supersedeProviderRefresh(e.id),this.providers.set(e.id,e)}deleteProvider(e){this.supersedeProviderRefresh(e),this.providers.delete(e)}clearProviders(){for(const e of new Set([...this.providers.keys(),...this.refreshControllers.keys()]))this.supersedeProviderRefresh(e);this.providers.clear()}getProviders(){return Array.from(this.providers.values())}getProvider(e){return this.providers.get(e)}getModels(e){if(e!==void 0){const t=this.providers.get(e);if(!t)return[];try{return t.getModels()}catch{return[]}}const r=[];for(const t of this.providers.values())try{r.push(...t.getModels())}catch{}return r}getAllModels(e){if(e!==void 0){const t=this.providers.get(e);if(!t)return[];try{return t.getAllModels?.()??t.getModels()}catch{return[]}}const r=[];for(const t of this.providers.values())try{r.push(...t.getAllModels?.()??t.getModels())}catch{}return r}getModelsOfType(e,r){return this.getAllModels(r).filter(t=>k(t,e))}getModel(e,r){return this.getModels(e).find(t=>t.id===r)}getModelOfType(e,r,t){return this.getModelsOfType(e,r).find(s=>s.id===t)}supersedeProviderRefresh(e){const r=(this.refreshGenerations.get(e)??0)+1;this.refreshGenerations.set(e,r);const t=this.refreshControllers.get(e);return t&&(this.refreshControllers.delete(e),t.abort()),r}beginProviderRefresh(e){const r=this.supersedeProviderRefresh(e),t=new AbortController;return this.refreshControllers.set(e,t),{generation:r,controller:t}}publishProviderModels(e,r,t,s){const i=this.publicationChains.get(e)??Promise.resolve(),a=(async()=>(await i.catch(()=>{}),t.aborted||this.refreshGenerations.get(e)!==r||(s.persist===null?await this.modelsStore.delete(e,{signal:t}):s.persist!==void 0&&await this.modelsStore.write(e,structuredClone(s.persist),{signal:t}),t.aborted||this.refreshGenerations.get(e)!==r)?!1:(s.update?.(),!0)))(),c=a.catch(()=>{});return this.publicationChains.set(e,c),c.then(()=>{this.publicationChains.get(e)===c&&this.publicationChains.delete(e)}),P(a,t)}async runProviderRefreshPhase(e,r,t,s,i,a){const c=await this.modelsStore.read(e.id,{signal:a});await e.refreshModels({credential:r,stored:c?j(structuredClone(c)):void 0,publish:h(d=>this.publishProviderModels(e.id,i,a,d),"publish"),allowNetwork:t,force:t?s:void 0,signal:a,baseUrl:e.baseUrl})}async refresh(e={}){const r=e.allowNetwork??!0,t=b(e.signal),s=new Map;if(t.aborted)return{aborted:!0,errors:s};const i=e.providers?new Set(e.providers):void 0,a=Array.from(this.providers.values()).filter(d=>d.refreshModels!==void 0&&(!i||i.has(d.id))),c=Promise.all(a.map(async d=>{const{generation:v,controller:y}=this.beginProviderRefresh(d.id),w=AbortSignal.any([t,y.signal]),M=(async()=>{let m,g;try{m=await this.readCredential(d.id,w)}catch(l){g=l}if(await this.runProviderRefreshPhase(d,m,!1,void 0,v,w),g!==void 0)throw g;if(!r||w.aborted)return;const n=await this.resolveRefreshCredential(d,m,w);n&&await this.runProviderRefreshPhase(d,n,!0,e.force,v,w)})();try{await P(M,w)}catch(m){w.aborted||s.set(d.id,m instanceof Error?m:new p("model_source",`Model refresh failed for ${d.id}`,{cause:m}))}finally{this.refreshControllers.get(d.id)===y&&this.refreshControllers.delete(d.id)}}));try{await P(c,t)}catch(d){if(!t.aborted)throw d}return{aborted:t.aborted,errors:new Map(s)}}async resolveRefreshCredential(e,r,t){if(r?.type==="oauth"){const c=e.auth.oauth;return c?Date.now()<r.expires?r:t.aborted?void 0:W(this.credentials,e.id,c,d=>Date.now()>=d.expires,t):void 0}const s=e.auth.apiKey;if(!s)return;const i=r?.type==="api_key"?r:void 0,a=await s.resolve({ctx:this.authContext,credential:i,signal:t});if(a)return{type:"api_key",key:a.auth.apiKey,env:a.env}}async readCredential(e,r){try{return await this.credentials.read(e,{signal:r})}catch(t){throw new p("auth",`Credential store read failed for ${e}`,{cause:t})}}async checkProviderAuth(e,r,t){if(r?.type==="oauth")return e.auth.oauth?{source:"OAuth",type:"oauth"}:void 0;const s=e.auth.apiKey;if(!s)return;if(s.check)try{return await s.check({ctx:this.authContext,credential:r?.type==="api_key"?r:void 0,signal:t})}catch(a){throw new p("auth",`API key auth check failed for provider ${e.id}`,{cause:a})}const i=await $(e,this.credentials,this.authContext,{signal:t});return i?{source:i.source,type:"api_key"}:void 0}checkAuth(e,r){const t=b(r?.signal),s=(async()=>{t.throwIfAborted();const i=this.providers.get(e);if(i)return this.checkProviderAuth(i,await this.readCredential(e,t),t)})();return P(s,t)}async getAuthenticatedProviders(e,r){r.throwIfAborted();const t=e?[this.providers.get(e)].filter(i=>i!==void 0):this.getProviders();return(await Promise.all(t.map(async i=>{const a=await this.readCredential(i.id,r);return{provider:i,credential:a,auth:await this.checkProviderAuth(i,a,r)}}))).filter(i=>i.auth!==void 0)}getAvailable(e,r){const t=b(r?.signal),s=(async()=>(await this.getAuthenticatedProviders(e,t)).flatMap(({provider:a,credential:c})=>{const d=a.getModels();return a.filterModels?.(d,c)??d}))();return P(s,t)}async getAvailableOfType(e,r,t){return(await this.getAllAvailable(r,t)).filter(s=>k(s,e))}getAllAvailable(e,r){const t=b(r?.signal),s=(async()=>(await this.getAuthenticatedProviders(e,t)).flatMap(({provider:a,credential:c})=>{const d=a.getAllModels?.()??a.getModels();if(a.filterAllModels)return a.filterAllModels(d,c);if(!a.filterModels)return d;const v=new Set(a.filterModels(a.getModels(),c).map(y=>y.id));return d.filter(y=>!k(y,"chat")||v.has(y.id))}))();return P(s,t)}async getAuth(e,r){const t=b(r?.signal),s=typeof e=="string"?e:e.provider,i=this.providers.get(s);if(!i)return;const a=await $(i,this.credentials,this.authContext,{...r,signal:t});return!a||typeof e=="string"||!e.headers?a:{...a,auth:{...a.auth,headers:R(a.auth.headers,e.headers)}}}async login(e,r,t,s){const i=b(t.signal);i.throwIfAborted();const a=this.providers.get(e);if(!a)throw new p("provider",`Unknown provider: ${e}`);const c=r==="oauth"?a.auth.oauth:a.auth.apiKey;if(!c?.login)throw new p("auth",`${a.name} does not support ${r} login`);const d=c.login({...t,signal:i},s),v=await P(d,i);let y=!1,w;const M=new Promise(g=>{w=g}),m=this.credentials.modify(e,async()=>(y=!0,w?.(),v),{signal:i});m.catch(()=>{});try{await new Promise((g,n)=>{const l=h(()=>{y||n(i.reason)},"onAbort");i.addEventListener("abort",l,{once:!0}),Promise.race([M,m]).then(()=>{i.removeEventListener("abort",l),g()},f=>{i.removeEventListener("abort",l),n(f)}),i.aborted&&l()}),await m}catch(g){throw i.throwIfAborted(),new p("auth",`Credential store modify failed for ${e}`,{cause:g})}return v}async logout(e,r){const t=b(r?.signal);t.throwIfAborted();try{await this.credentials.delete(e,{signal:t})}catch(s){throw t.throwIfAborted(),new p("auth",`Credential store delete failed for ${e}`,{cause:s})}}requireProvider(e){const r=this.providers.get(e.provider);if(!r)throw new p("provider",`Unknown provider: ${e.provider}`);return r}requireChatProvider(e){return N(e),this.requireProvider(e)}async applyAuth(e,r){this.requireProvider(e);const t=await this.getAuth(e,{apiKey:r?.apiKey,env:r?.env,signal:r?.signal});if(!t)throw new p("auth",`Provider is not configured: ${e.provider}`);const s=t.auth,i=r?.apiKey??s.apiKey;let a=R(s.headers,r?.headers);r?.transformHeaders&&(a=await r.transformHeaders(a??{}));const c=t.env||r?.env?{...t.env??{},...r?.env??{}}:void 0,d=s.baseUrl?{...e,baseUrl:s.baseUrl}:e,{transformHeaders:v,...y}=r??{},w={...y,apiKey:i,headers:a,env:c};return{requestModel:d,requestOptions:w}}stream(e,r,t){const s=O(r);return A(e,async()=>{const i=this.requireChatProvider(e),{requestModel:a,requestOptions:c}=await this.applyAuth(e,t);return i.stream(a,s,c)})}async complete(e,r,t){return this.stream(e,r,t).result()}streamSimple(e,r,t){const s=O(r);return A(e,async()=>{const i=this.requireChatProvider(e),{requestModel:a,requestOptions:c}=await this.applyAuth(e,t);return i.streamSimple(a,s,c)})}async completeSimple(e,r,t){return this.streamSimple(e,r,t).result()}streamDeferred(e,r,t){return A(e,async()=>{const s=this.requireChatProvider(e);if(!s.fetchDeferred)throw new p("provider",`Provider ${e.provider} does not support deferred responses`);const{requestModel:i,requestOptions:a}=await this.applyAuth(e,t);return s.fetchDeferred(i,r,a)})}async fetchDeferred(e,r,t){return this.streamDeferred(e,r,t).result()}async cancelDeferred(e,r,t){const s=this.requireChatProvider(e);if(!s.cancelDeferred)throw new p("provider",`Provider ${e.provider} does not support deferred responses`);const{requestModel:i,requestOptions:a}=await this.applyAuth(e,t);await s.cancelDeferred(i,r,a)}async generateImages(e,r,t){try{G(e);const s=this.requireProvider(e);if(!s.generateImages)throw new p("provider",`Provider ${e.provider} does not support image generation`);const{requestModel:i,requestOptions:a}=await this.applyAuth(e,t);return await s.generateImages(i,r,a)}catch(s){return D(e,s,t?.signal?.aborted)}}async classify(e,r,t){try{I(e),U(e,r);const s=this.requireProvider(e);if(!s.classify)throw new p("provider",`Provider ${e.provider} does not support classification`);const{requestModel:i,requestOptions:a}=await this.applyAuth(e,t);return await s.classify(i,r,a)}catch(s){return x(e,s,t?.signal?.aborted)}}}function re(o){return new z(o)}h(re,"createModels");function se(o){const e=o.api&&typeof o.api.stream=="function"?o.api:void 0,r=e||!o.api?void 0:o.api,t=o.images,s=o.classifiers,i=e?[e]:Object.values(r??{}).filter(n=>n!==void 0),a=Object.values(t??{}).filter(n=>n!==void 0),c=Object.values(s??{}).filter(n=>n!==void 0);if(i.length===0&&a.length===0&&c.length===0)throw new Error(`Provider ${o.id}: at least one of "api", "images", or "classifiers" is required.`);const d=o.models;let v=[];const y=o.fetchModels,w=h(()=>{const n=[...d];for(const l of v){const f=n.findIndex(u=>C(u)===C(l)&&u.id===l.id);f>=0?n[f]=l:n.push(l)}return n},"currentModels"),M=h(n=>e??r?.[n.api],"apiFor"),m=h((n,l)=>{const f=M(n);return f?l(f):A(n,async()=>{throw new p("stream",`Provider ${o.id} has no API implementation for "${n.api}"`)})},"dispatch"),g={id:o.id,name:o.name??o.id,baseUrl:o.baseUrl,headers:o.headers,auth:o.auth,getModels:h(()=>w().filter(n=>k(n,"chat")),"getModels"),getAllModels:w,refreshModels:y?async n=>{if(n.stored){const u=n.stored.models.filter(q=>q.provider===o.id).map(q=>q);if(!await n.publish({update:h(()=>{v=u},"update")}))return}if(!n.allowNetwork||n.signal.aborted)return;const l=await y(n);if(n.signal.aborted)return;const f=l.filter(T);await n.publish({persist:{models:f,checkedAt:Date.now()},update:h(()=>{v=f},"update")})}:void 0,filterModels:o.filterModels,supportsApi:h(n=>r?r[n]!==void 0:w().some(l=>l.api===n),"supportsApi"),filterAllModels:o.filterAllModels,stream:h((n,l,f)=>m(n,u=>u.stream(n,l,f)),"stream"),streamSimple:h((n,l,f)=>m(n,u=>u.streamSimple(n,l,f)),"streamSimple")};return i.some(n=>n.fetchDeferred!==void 0)&&(g.fetchDeferred=(n,l,f)=>A(n,async()=>{const u=M(n);if(!u?.fetchDeferred)throw new p("provider",`Provider ${o.id} does not support deferred responses for "${n.api}"`);return u.fetchDeferred(n,l,f)})),i.some(n=>n.cancelDeferred!==void 0)&&(g.cancelDeferred=async(n,l,f)=>{const u=M(n);if(!u?.cancelDeferred)throw new p("provider",`Provider ${o.id} cannot cancel deferred responses for "${n.api}"`);await u.cancelDeferred(n,l,f)}),t&&a.length>0&&(g.generateImages=async(n,l,f)=>{const u=t[n.api];return u?u.generateImages(n,l,f):D(n,new p("provider",`Provider ${o.id} has no image generation implementation for "${n.api}"`))}),s&&c.length>0&&(g.classify=async(n,l,f)=>{const u=s[n.api];return u?u.classify(n,l,f):x(n,new p("provider",`Provider ${o.id} has no classifier implementation for "${n.api}"`))}),g}h(se,"createProvider");function ie(o,e){return k(o,"chat")&&o.api===e}h(ie,"hasApi");function ne(o,e){const r=e.input+e.cacheRead+e.cacheWrite;let t=o.cost,s=-1;for(const c of o.cost.tiers??[])r>c.inputTokensAbove&&c.inputTokensAbove>s&&(t=c,s=c.inputTokensAbove);const i=e.cacheWrite1h??0,a=e.cacheWrite-i;return e.cost.input=t.input/1e6*e.input,e.cost.output=t.output/1e6*e.output,e.cost.cacheRead=t.cacheRead/1e6*e.cacheRead,e.cost.cacheWrite=(t.cacheWrite*a+t.input*2*i)/1e6,e.cost.total=e.cost.input+e.cost.output+e.cost.cacheRead+e.cost.cacheWrite,e.cost}h(ne,"calculateCost");const S=["off","minimal","low","medium","high","xhigh","max"];function F(o){return o.reasoning?S.filter(e=>{const r=o.thinkingLevelMap?.[e];return r===null?!1:e==="xhigh"||e==="max"?r!==void 0:!0}):["off"]}h(F,"getSupportedThinkingLevels");function ae(o,e){const r=F(o);if(r.includes(e))return e;const t=S.indexOf(e);if(t===-1)return r[0]??"off";for(let s=t;s<S.length;s++){const i=S[s];if(r.includes(i))return i}for(let s=t-1;s>=0;s--){const i=S[s];if(r.includes(i))return i}return r[0]??"off"}h(ae,"clampThinkingLevel");function oe(o,e){return!o||!e?!1:C(o)===C(e)&&o.id===e.id&&o.provider===e.provider}h(oe,"modelsAreEqual");export{le as ModelsError,ne as calculateCost,ae as clampThinkingLevel,re as createModels,se as createProvider,fe as getModelType,F as getSupportedThinkingLevels,ie as hasApi,ue as isModelType,oe as modelsAreEqual};
|
|
1
|
+
var I=Object.defineProperty;var h=(o,e)=>I(o,"name",{value:e,configurable:!0});import{lazyStream as P}from"./api/lazy.js";import{defaultProviderAuthContext as L}from"./auth/context.js";import{InMemoryCredentialStore as _}from"./auth/credential-store.js";import{ModelsError as p,refreshStoredOAuthCredential as W,resolveProviderAuth as $}from"./auth/resolve.js";import{InMemoryModelsStore as N}from"./models-store.js";import{observeModelRequest as q}from"./telemetry.js";import{operationSignal as b,raceWithAbortSignal as A}from"./utils/abort.js";import{withFirstTokenTimeout as D}from"./utils/event-stream.js";import{getOpenCodeSessionHeaders as U,mergeClientIdentity as H}from"./utils/identity.js";import{assertChatModel as G,assertClassifierInputSupported as j,assertClassifierModel as z,assertImageModel as F,classifierErrorResult as E,getModelType as C,imageErrorResult as O,isModelType as k}from"./utils/model-operations.js";import{normalizeContext as R}from"./utils/transcript.js";import{ModelsError as me}from"./auth/resolve.js";import{AI_TELEMETRY_SCHEMA as ve}from"./telemetry.js";import{getModelType as be,isModelType as Ae}from"./utils/model-operations.js";const Y={chat:!0,image:!0,classifier:!0};function K(o){return Object.hasOwn(Y,C(o))}h(K,"hasKnownModelType");function V(o){return{...o,models:o.models.filter(K)}}h(V,"withKnownModelTypes");function x(o,e){if(!o&&!e)return;const r={...o};for(const[t,s]of Object.entries(e??{})){const i=t.toLowerCase();for(const a of Object.keys(r))a.toLowerCase()===i&&delete r[a];r[t]=s}return r}h(x,"mergeHeaders");class X{static{h(this,"ModelsImpl")}providers=new Map;credentials;modelsStore;authContext;identity;refreshGenerations=new Map;refreshControllers=new Map;publicationChains=new Map;constructor(e){this.credentials=e?.credentials??new _,this.modelsStore=e?.modelsStore??new N,this.authContext=e?.authContext??L(),this.identity=e?.identity}setProvider(e){this.supersedeProviderRefresh(e.id),this.providers.set(e.id,e)}deleteProvider(e){this.supersedeProviderRefresh(e),this.providers.delete(e)}clearProviders(){for(const e of new Set([...this.providers.keys(),...this.refreshControllers.keys()]))this.supersedeProviderRefresh(e);this.providers.clear()}getProviders(){return Array.from(this.providers.values())}getProvider(e){return this.providers.get(e)}getModels(e){if(e!==void 0){const t=this.providers.get(e);if(!t)return[];try{return t.getModels()}catch{return[]}}const r=[];for(const t of this.providers.values())try{r.push(...t.getModels())}catch{}return r}getAllModels(e){if(e!==void 0){const t=this.providers.get(e);if(!t)return[];try{return t.getAllModels?.()??t.getModels()}catch{return[]}}const r=[];for(const t of this.providers.values())try{r.push(...t.getAllModels?.()??t.getModels())}catch{}return r}getModelsOfType(e,r){return this.getAllModels(r).filter(t=>k(t,e))}getModel(e,r){return this.getModels(e).find(t=>t.id===r)}getModelOfType(e,r,t){return this.getModelsOfType(e,r).find(s=>s.id===t)}supersedeProviderRefresh(e){const r=(this.refreshGenerations.get(e)??0)+1;this.refreshGenerations.set(e,r);const t=this.refreshControllers.get(e);return t&&(this.refreshControllers.delete(e),t.abort()),r}beginProviderRefresh(e){const r=this.supersedeProviderRefresh(e),t=new AbortController;return this.refreshControllers.set(e,t),{generation:r,controller:t}}publishProviderModels(e,r,t,s){const i=this.publicationChains.get(e)??Promise.resolve(),a=(async()=>(await i.catch(()=>{}),t.aborted||this.refreshGenerations.get(e)!==r||(s.persist===null?await this.modelsStore.delete(e,{signal:t}):s.persist!==void 0&&await this.modelsStore.write(e,structuredClone(s.persist),{signal:t}),t.aborted||this.refreshGenerations.get(e)!==r)?!1:(s.update?.(),!0)))(),d=a.catch(()=>{});return this.publicationChains.set(e,d),d.then(()=>{this.publicationChains.get(e)===d&&this.publicationChains.delete(e)}),A(a,t)}async runProviderRefreshPhase(e,r,t,s,i,a){const d=await this.modelsStore.read(e.id,{signal:a});await e.refreshModels({credential:r,stored:d?V(structuredClone(d)):void 0,publish:h(c=>this.publishProviderModels(e.id,i,a,c),"publish"),allowNetwork:t,force:t?s:void 0,signal:a,baseUrl:e.baseUrl})}async refresh(e={}){const r=e.allowNetwork??!0,t=b(e.signal),s=new Map;if(t.aborted)return{aborted:!0,errors:s};const i=e.providers?new Set(e.providers):void 0,a=Array.from(this.providers.values()).filter(c=>c.refreshModels!==void 0&&(!i||i.has(c.id))),d=Promise.all(a.map(async c=>{const{generation:v,controller:y}=this.beginProviderRefresh(c.id),g=AbortSignal.any([t,y.signal]),M=(async()=>{let m,w;try{m=await this.readCredential(c.id,g)}catch(l){w=l}if(await this.runProviderRefreshPhase(c,m,!1,void 0,v,g),w!==void 0)throw w;if(!r||g.aborted)return;const n=await this.resolveRefreshCredential(c,m,g);n&&await this.runProviderRefreshPhase(c,n,!0,e.force,v,g)})();try{await A(M,g)}catch(m){g.aborted||s.set(c.id,m instanceof Error?m:new p("model_source",`Model refresh failed for ${c.id}`,{cause:m}))}finally{this.refreshControllers.get(c.id)===y&&this.refreshControllers.delete(c.id)}}));try{await A(d,t)}catch(c){if(!t.aborted)throw c}return{aborted:t.aborted,errors:new Map(s)}}async resolveRefreshCredential(e,r,t){if(r?.type==="oauth"){const d=e.auth.oauth;return d?Date.now()<r.expires?r:t.aborted?void 0:W(this.credentials,e.id,d,c=>Date.now()>=c.expires,t):void 0}const s=e.auth.apiKey;if(!s)return;const i=r?.type==="api_key"?r:void 0,a=await s.resolve({ctx:this.authContext,credential:i,signal:t});if(a)return{type:"api_key",key:a.auth.apiKey,env:a.env}}async readCredential(e,r){try{return await this.credentials.read(e,{signal:r})}catch(t){throw new p("auth",`Credential store read failed for ${e}`,{cause:t})}}async checkProviderAuth(e,r,t){if(r?.type==="oauth")return e.auth.oauth?{source:"OAuth",type:"oauth"}:void 0;const s=e.auth.apiKey;if(!s)return;if(s.check)try{return await s.check({ctx:this.authContext,credential:r?.type==="api_key"?r:void 0,signal:t})}catch(a){throw new p("auth",`API key auth check failed for provider ${e.id}`,{cause:a})}const i=await $(e,this.credentials,this.authContext,{signal:t});return i?{source:i.source,type:"api_key"}:void 0}checkAuth(e,r){const t=b(r?.signal),s=(async()=>{t.throwIfAborted();const i=this.providers.get(e);if(i)return this.checkProviderAuth(i,await this.readCredential(e,t),t)})();return A(s,t)}async getAuthenticatedProviders(e,r){r.throwIfAborted();const t=e?[this.providers.get(e)].filter(i=>i!==void 0):this.getProviders();return(await Promise.all(t.map(async i=>{const a=await this.readCredential(i.id,r);return{provider:i,credential:a,auth:await this.checkProviderAuth(i,a,r)}}))).filter(i=>i.auth!==void 0)}getAvailable(e,r){const t=b(r?.signal),s=(async()=>(await this.getAuthenticatedProviders(e,t)).flatMap(({provider:a,credential:d})=>{const c=a.getModels();return a.filterModels?.(c,d)??c}))();return A(s,t)}async getAvailableOfType(e,r,t){return(await this.getAllAvailable(r,t)).filter(s=>k(s,e))}getAllAvailable(e,r){const t=b(r?.signal),s=(async()=>(await this.getAuthenticatedProviders(e,t)).flatMap(({provider:a,credential:d})=>{const c=a.getAllModels?.()??a.getModels();if(a.filterAllModels)return a.filterAllModels(c,d);if(!a.filterModels)return c;const v=new Set(a.filterModels(a.getModels(),d).map(y=>y.id));return c.filter(y=>!k(y,"chat")||v.has(y.id))}))();return A(s,t)}async getAuth(e,r){const t=b(r?.signal),s=typeof e=="string"?e:e.provider,i=this.providers.get(s);if(!i)return;const a=await $(i,this.credentials,this.authContext,{...r,signal:t});return!a||typeof e=="string"||!e.headers?a:{...a,auth:{...a.auth,headers:x(a.auth.headers,e.headers)}}}async login(e,r,t,s){const i=b(t.signal);i.throwIfAborted();const a=this.providers.get(e);if(!a)throw new p("provider",`Unknown provider: ${e}`);const d=r==="oauth"?a.auth.oauth:a.auth.apiKey;if(!d?.login)throw new p("auth",`${a.name} does not support ${r} login`);const c=d.login({...t,signal:i},s),v=await A(c,i);let y=!1,g;const M=new Promise(w=>{g=w}),m=this.credentials.modify(e,async()=>(y=!0,g?.(),v),{signal:i});m.catch(()=>{});try{await new Promise((w,n)=>{const l=h(()=>{y||n(i.reason)},"onAbort");i.addEventListener("abort",l,{once:!0}),Promise.race([M,m]).then(()=>{i.removeEventListener("abort",l),w()},f=>{i.removeEventListener("abort",l),n(f)}),i.aborted&&l()}),await m}catch(w){throw i.throwIfAborted(),new p("auth",`Credential store modify failed for ${e}`,{cause:w})}return v}async logout(e,r){const t=b(r?.signal);t.throwIfAborted();try{await this.credentials.delete(e,{signal:t})}catch(s){throw t.throwIfAborted(),new p("auth",`Credential store delete failed for ${e}`,{cause:s})}}requireProvider(e){const r=this.providers.get(e.provider);if(!r)throw new p("provider",`Unknown provider: ${e.provider}`);return r}requireChatProvider(e){return G(e),this.requireProvider(e)}async applyAuth(e,r){this.requireProvider(e);const t=await this.getAuth(e,{apiKey:r?.apiKey,env:r?.env,signal:r?.signal});if(!t)throw new p("auth",`Provider is not configured: ${e.provider}`);const s=t.auth,i=r?.apiKey??s.apiKey,a=s.baseUrl?{...e,baseUrl:s.baseUrl}:e,d=r&&"sessionId"in r&&typeof r.sessionId=="string"?r.sessionId:void 0;let c=x(x(U(a,d),s.headers),r?.headers);r?.transformHeaders&&(c=await r.transformHeaders(c??{}));const v=t.env||r?.env?{...t.env??{},...r?.env??{}}:void 0,y=H(this.identity,r?.identity),{transformHeaders:g,firstTokenTimeoutMs:M,...m}=r??{},w={...m,apiKey:i,headers:c,env:v,...y===void 0?{}:{identity:y}};return{requestModel:a,requestOptions:w}}stream(e,r,t){const s=R(r);return D(t,t?.firstTokenTimeoutMs,i=>P(e,async()=>{const a=this.requireChatProvider(e),{requestModel:d,requestOptions:c}=await this.applyAuth(e,i);return a.stream(d,s,c)},q(e,t,!1)))}async complete(e,r,t){return this.stream(e,r,t).result()}streamSimple(e,r,t){const s=R(r);return D(t,t?.firstTokenTimeoutMs,i=>P(e,async()=>{const a=this.requireChatProvider(e),{requestModel:d,requestOptions:c}=await this.applyAuth(e,i);return a.streamSimple(d,s,c)},q(e,t,!1)))}async completeSimple(e,r,t){return this.streamSimple(e,r,t).result()}streamDeferred(e,r,t){return P(e,async()=>{const s=this.requireChatProvider(e);if(!s.fetchDeferred)throw new p("provider",`Provider ${e.provider} does not support deferred responses`);const{requestModel:i,requestOptions:a}=await this.applyAuth(e,t);return s.fetchDeferred(i,r,a)},q(e,t,!0))}async fetchDeferred(e,r,t){return this.streamDeferred(e,r,t).result()}async cancelDeferred(e,r,t){const s=this.requireChatProvider(e);if(!s.cancelDeferred)throw new p("provider",`Provider ${e.provider} does not support deferred responses`);const{requestModel:i,requestOptions:a}=await this.applyAuth(e,t);await s.cancelDeferred(i,r,a)}async generateImages(e,r,t){try{F(e);const s=this.requireProvider(e);if(!s.generateImages)throw new p("provider",`Provider ${e.provider} does not support image generation`);const{requestModel:i,requestOptions:a}=await this.applyAuth(e,t);return await s.generateImages(i,r,a)}catch(s){return O(e,s,t?.signal?.aborted)}}async classify(e,r,t){try{z(e),j(e,r);const s=this.requireProvider(e);if(!s.classify)throw new p("provider",`Provider ${e.provider} does not support classification`);const{requestModel:i,requestOptions:a}=await this.applyAuth(e,t);return await s.classify(i,r,a)}catch(s){return E(e,s,t?.signal?.aborted)}}}function de(o){return new X(o)}h(de,"createModels");function le(o){const e=o.api&&typeof o.api.stream=="function"?o.api:void 0,r=e||!o.api?void 0:o.api,t=o.images,s=o.classifiers,i=e?[e]:Object.values(r??{}).filter(n=>n!==void 0),a=Object.values(t??{}).filter(n=>n!==void 0),d=Object.values(s??{}).filter(n=>n!==void 0);if(i.length===0&&a.length===0&&d.length===0)throw new Error(`Provider ${o.id}: at least one of "api", "images", or "classifiers" is required.`);const c=o.models;let v=[];const y=o.fetchModels,g=h(()=>{const n=[...c];for(const l of v){const f=n.findIndex(u=>C(u)===C(l)&&u.id===l.id);f>=0?n[f]=l:n.push(l)}return n},"currentModels"),M=h(n=>e??r?.[n.api],"apiFor"),m=h((n,l)=>{const f=M(n);return f?l(f):P(n,async()=>{throw new p("stream",`Provider ${o.id} has no API implementation for "${n.api}"`)})},"dispatch"),w={id:o.id,name:o.name??o.id,baseUrl:o.baseUrl,headers:o.headers,auth:o.auth,getModels:h(()=>g().filter(n=>k(n,"chat")),"getModels"),getAllModels:g,refreshModels:y?async n=>{if(n.stored){const u=n.stored.models.filter(S=>S.provider===o.id).map(S=>S);if(!await n.publish({update:h(()=>{v=u},"update")}))return}if(!n.allowNetwork||n.signal.aborted)return;const l=await y(n);if(n.signal.aborted)return;const f=l.filter(K);await n.publish({persist:{models:f,checkedAt:Date.now()},update:h(()=>{v=f},"update")})}:void 0,filterModels:o.filterModels,supportsApi:h(n=>r?r[n]!==void 0:g().some(l=>l.api===n),"supportsApi"),filterAllModels:o.filterAllModels,stream:h((n,l,f)=>m(n,u=>u.stream(n,l,f)),"stream"),streamSimple:h((n,l,f)=>m(n,u=>u.streamSimple(n,l,f)),"streamSimple")};return i.some(n=>n.fetchDeferred!==void 0)&&(w.fetchDeferred=(n,l,f)=>P(n,async()=>{const u=M(n);if(!u?.fetchDeferred)throw new p("provider",`Provider ${o.id} does not support deferred responses for "${n.api}"`);return u.fetchDeferred(n,l,f)})),i.some(n=>n.cancelDeferred!==void 0)&&(w.cancelDeferred=async(n,l,f)=>{const u=M(n);if(!u?.cancelDeferred)throw new p("provider",`Provider ${o.id} cannot cancel deferred responses for "${n.api}"`);await u.cancelDeferred(n,l,f)}),t&&a.length>0&&(w.generateImages=async(n,l,f)=>{const u=t[n.api];return u?u.generateImages(n,l,f):O(n,new p("provider",`Provider ${o.id} has no image generation implementation for "${n.api}"`))}),s&&d.length>0&&(w.classify=async(n,l,f)=>{const u=s[n.api];return u?u.classify(n,l,f):E(n,new p("provider",`Provider ${o.id} has no classifier implementation for "${n.api}"`))}),w}h(le,"createProvider");function he(o,e){return k(o,"chat")&&o.api===e}h(he,"hasApi");function fe(o,e){const r=e.input+e.cacheRead+e.cacheWrite;let t=o.cost,s=-1;for(const d of o.cost.tiers??[])r>d.inputTokensAbove&&d.inputTokensAbove>s&&(t=d,s=d.inputTokensAbove);const i=e.cacheWrite1h??0,a=e.cacheWrite-i;return e.cost.input=t.input/1e6*e.input,e.cost.output=t.output/1e6*e.output,e.cost.cacheRead=t.cacheRead/1e6*e.cacheRead,e.cost.cacheWrite=(t.cacheWrite*a+t.input*2*i)/1e6,e.cost.total=e.cost.input+e.cost.output+e.cost.cacheRead+e.cost.cacheWrite,e.cost}h(fe,"calculateCost");const T=["off","minimal","low","medium","high","xhigh","max"];function B(o){return o.reasoning?T.filter(e=>{const r=o.thinkingLevelMap?.[e];return r===null?!1:e==="xhigh"||e==="max"?r!==void 0:!0}):["off"]}h(B,"getSupportedThinkingLevels");function ue(o,e){const r=B(o);if(r.includes(e))return e;const t=T.indexOf(e);if(t===-1)return r[0]??"off";for(let s=t;s<T.length;s++){const i=T[s];if(r.includes(i))return i}for(let s=t-1;s>=0;s--){const i=T[s];if(r.includes(i))return i}return r[0]??"off"}h(ue,"clampThinkingLevel");function pe(o,e){return!o||!e?!1:C(o)===C(e)&&o.id===e.id&&o.provider===e.provider}h(pe,"modelsAreEqual");export{ve as AI_TELEMETRY_SCHEMA,me as ModelsError,fe as calculateCost,ue as clampThinkingLevel,de as createModels,le as createProvider,be as getModelType,B as getSupportedThinkingLevels,he as hasApi,Ae as isModelType,pe as modelsAreEqual};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var p=Object.defineProperty;var e=(r,o)=>p(r,"name",{value:o,configurable:!0});import{azureOpenAIResponsesApi as A}from"../api/azure-openai-responses.lazy.js";import{envApiKeyAuth as i}from"../auth/helpers.js";import{createProvider as n}from"../models.js";import{AZURE_OPENAI_RESPONSES_MODELS as s}from"./azure-openai-responses.models.js";function E(){return n({id:"azure-openai-responses",name:"Azure OpenAI",auth:{apiKey:i("Azure OpenAI API key",["AZURE_OPENAI_API_KEY"])},models:Object.values(s),api:A()})}e(E,"azureOpenAIResponsesProvider");export{E as azureOpenAIResponsesProvider};
|
package/dist/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import o from"./data/azure-openai-responses.json"with{type:"json"};import{flattenModelCatalog as e}from"../model-catalog.js";const a=e("azure-openai-responses",o);export{a as AZURE_OPENAI_RESPONSES_MODELS};
|
|
@@ -195,8 +195,183 @@ export declare const BedrockCompatSchema: Type.TObject<{
|
|
|
195
195
|
export declare const MistralConversationsCompatSchema: Type.TObject<{
|
|
196
196
|
supportsMidConvoSystemMessages: Type.TOptional<Type.TBoolean>;
|
|
197
197
|
}>;
|
|
198
|
+
export declare const SystemOneCompatSchema: Type.TObject<{
|
|
199
|
+
imageInput: Type.TOptional<Type.TUnion<[Type.TLiteral<"assets">, Type.TLiteral<"images">, Type.TLiteral<"state-image-urls">]>>;
|
|
200
|
+
sendImageOptInHeader: Type.TOptional<Type.TBoolean>;
|
|
201
|
+
}>;
|
|
198
202
|
type UnionToIntersection<Union> = (Union extends unknown ? (value: Union) => void : never) extends (value: infer Intersection) => void ? Intersection : never;
|
|
199
203
|
type MergedCompatProperties<PropertyGroups extends readonly TProperties[], Overrides extends TProperties> = Omit<UnionToIntersection<PropertyGroups[number]>, keyof Overrides> & Overrides;
|
|
204
|
+
export declare const CompatSchemasByApi: {
|
|
205
|
+
readonly "openai-completions": Type.TObject<{
|
|
206
|
+
supportsStore: Type.TOptional<Type.TBoolean>;
|
|
207
|
+
supportsDeveloperRole: Type.TOptional<Type.TBoolean>;
|
|
208
|
+
supportsReasoningEffort: Type.TOptional<Type.TBoolean>;
|
|
209
|
+
supportsUsageInStreaming: Type.TOptional<Type.TBoolean>;
|
|
210
|
+
supportsFinishReason: Type.TOptional<Type.TBoolean>;
|
|
211
|
+
maxTokensField: Type.TOptional<Type.TUnion<[Type.TLiteral<"max_completion_tokens">, Type.TLiteral<"max_tokens">]>>;
|
|
212
|
+
requiresToolResultName: Type.TOptional<Type.TBoolean>;
|
|
213
|
+
requiresAssistantAfterToolResult: Type.TOptional<Type.TBoolean>;
|
|
214
|
+
requiresThinkingAsText: Type.TOptional<Type.TBoolean>;
|
|
215
|
+
requiresReasoningContentOnAssistantMessages: Type.TOptional<Type.TBoolean>;
|
|
216
|
+
thinkingFormat: Type.TOptional<Type.TUnion<[Type.TLiteral<"openai">, Type.TLiteral<"openrouter">, Type.TLiteral<"deepseek">, Type.TLiteral<"together">, Type.TLiteral<"baseten">, Type.TLiteral<"zai">, Type.TLiteral<"qwen">, Type.TLiteral<"chat-template">, Type.TLiteral<"qwen-chat-template">, Type.TLiteral<"string-thinking">, Type.TLiteral<"ant-ling">]>>;
|
|
217
|
+
chatTemplateKwargs: Type.TOptional<Type.TRecord<"^.*$", Type.TUnion<[Type.TString, Type.TNumber, Type.TBoolean, Type.TNull, Type.TObject<{
|
|
218
|
+
$var: Type.TUnion<[Type.TLiteral<"thinking.enabled">, Type.TLiteral<"thinking.effort">, Type.TLiteral<"thinking.budget">]>;
|
|
219
|
+
omitWhenOff: Type.TOptional<Type.TBoolean>;
|
|
220
|
+
}>]>>>;
|
|
221
|
+
chatTemplateArgs: Type.TOptional<Type.TRecord<"^.*$", Type.TUnion<[Type.TString, Type.TNumber, Type.TBoolean, Type.TNull, Type.TObject<{
|
|
222
|
+
$var: Type.TUnion<[Type.TLiteral<"thinking.enabled">, Type.TLiteral<"thinking.effort">, Type.TLiteral<"thinking.budget">]>;
|
|
223
|
+
omitWhenOff: Type.TOptional<Type.TBoolean>;
|
|
224
|
+
}>]>>>;
|
|
225
|
+
openRouterRouting: Type.TOptional<Type.TObject<{
|
|
226
|
+
allow_fallbacks: Type.TOptional<Type.TBoolean>;
|
|
227
|
+
require_parameters: Type.TOptional<Type.TBoolean>;
|
|
228
|
+
data_collection: Type.TOptional<Type.TUnion<[Type.TLiteral<"deny">, Type.TLiteral<"allow">]>>;
|
|
229
|
+
zdr: Type.TOptional<Type.TBoolean>;
|
|
230
|
+
enforce_distillable_text: Type.TOptional<Type.TBoolean>;
|
|
231
|
+
order: Type.TOptional<Type.TArray<Type.TString>>;
|
|
232
|
+
only: Type.TOptional<Type.TArray<Type.TString>>;
|
|
233
|
+
ignore: Type.TOptional<Type.TArray<Type.TString>>;
|
|
234
|
+
quantizations: Type.TOptional<Type.TArray<Type.TString>>;
|
|
235
|
+
sort: Type.TOptional<Type.TUnion<[Type.TString, Type.TObject<{
|
|
236
|
+
by: Type.TOptional<Type.TString>;
|
|
237
|
+
partition: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
|
|
238
|
+
}>]>>;
|
|
239
|
+
max_price: Type.TOptional<Type.TObject<{
|
|
240
|
+
prompt: Type.TOptional<Type.TUnion<[Type.TNumber, Type.TString]>>;
|
|
241
|
+
completion: Type.TOptional<Type.TUnion<[Type.TNumber, Type.TString]>>;
|
|
242
|
+
image: Type.TOptional<Type.TUnion<[Type.TNumber, Type.TString]>>;
|
|
243
|
+
audio: Type.TOptional<Type.TUnion<[Type.TNumber, Type.TString]>>;
|
|
244
|
+
request: Type.TOptional<Type.TUnion<[Type.TNumber, Type.TString]>>;
|
|
245
|
+
}>>;
|
|
246
|
+
preferred_min_throughput: Type.TOptional<Type.TUnion<[Type.TNumber, Type.TObject<{
|
|
247
|
+
p50: Type.TOptional<Type.TNumber>;
|
|
248
|
+
p75: Type.TOptional<Type.TNumber>;
|
|
249
|
+
p90: Type.TOptional<Type.TNumber>;
|
|
250
|
+
p99: Type.TOptional<Type.TNumber>;
|
|
251
|
+
}>]>>;
|
|
252
|
+
preferred_max_latency: Type.TOptional<Type.TUnion<[Type.TNumber, Type.TObject<{
|
|
253
|
+
p50: Type.TOptional<Type.TNumber>;
|
|
254
|
+
p75: Type.TOptional<Type.TNumber>;
|
|
255
|
+
p90: Type.TOptional<Type.TNumber>;
|
|
256
|
+
p99: Type.TOptional<Type.TNumber>;
|
|
257
|
+
}>]>>;
|
|
258
|
+
}>>;
|
|
259
|
+
vercelGatewayRouting: Type.TOptional<Type.TObject<{
|
|
260
|
+
only: Type.TOptional<Type.TArray<Type.TString>>;
|
|
261
|
+
order: Type.TOptional<Type.TArray<Type.TString>>;
|
|
262
|
+
}>>;
|
|
263
|
+
zaiToolStream: Type.TOptional<Type.TBoolean>;
|
|
264
|
+
thinkingTokenBudgetField: Type.TOptional<Type.TUnion<[Type.TLiteral<"thinking_token_budget">, Type.TLiteral<"thinking_budget">, Type.TLiteral<"thinking_budget_tokens">]>>;
|
|
265
|
+
supportsThinkingTokenBudget: Type.TOptional<Type.TBoolean>;
|
|
266
|
+
supportsOpenAIGrammarTools: Type.TOptional<Type.TBoolean>;
|
|
267
|
+
supportsMidConvoSystemMessages: Type.TOptional<Type.TBoolean>;
|
|
268
|
+
supportsMidConvoToolAdditions: Type.TOptional<Type.TBoolean>;
|
|
269
|
+
supportsStrictMode: Type.TOptional<Type.TBoolean>;
|
|
270
|
+
cacheControlFormat: Type.TOptional<Type.TLiteral<"anthropic">>;
|
|
271
|
+
sendSessionAffinityHeaders: Type.TOptional<Type.TBoolean>;
|
|
272
|
+
sessionAffinityFormat: Type.TOptional<Type.TUnion<[Type.TLiteral<"openai">, Type.TLiteral<"openai-nosession">, Type.TLiteral<"openrouter">]>>;
|
|
273
|
+
supportsLongCacheRetention: Type.TOptional<Type.TBoolean>;
|
|
274
|
+
vllmPriority: Type.TOptional<Type.TNumber>;
|
|
275
|
+
dsmlToolCallsInContent: Type.TOptional<Type.TBoolean>;
|
|
276
|
+
responseModelCosts: Type.TOptional<Type.TRecord<"^.*$", Type.TObject<{
|
|
277
|
+
input: Type.TNumber;
|
|
278
|
+
output: Type.TNumber;
|
|
279
|
+
cacheRead: Type.TNumber;
|
|
280
|
+
cacheWrite: Type.TNumber;
|
|
281
|
+
tiers: Type.TOptional<Type.TArray<Type.TObject<{
|
|
282
|
+
input: Type.TNumber;
|
|
283
|
+
output: Type.TNumber;
|
|
284
|
+
cacheRead: Type.TNumber;
|
|
285
|
+
cacheWrite: Type.TNumber;
|
|
286
|
+
inputTokensAbove: Type.TNumber;
|
|
287
|
+
}>>>;
|
|
288
|
+
}>>>;
|
|
289
|
+
}>;
|
|
290
|
+
readonly "openai-responses": Type.TObject<{
|
|
291
|
+
supportsDeveloperRole: Type.TOptional<Type.TBoolean>;
|
|
292
|
+
supportsMidConvoSystemMessages: Type.TOptional<Type.TBoolean>;
|
|
293
|
+
sessionAffinityFormat: Type.TOptional<Type.TUnion<[Type.TLiteral<"openai">, Type.TLiteral<"openai-nosession">, Type.TLiteral<"openrouter">]>>;
|
|
294
|
+
supportsLongCacheRetention: Type.TOptional<Type.TBoolean>;
|
|
295
|
+
supportsStrictMode: Type.TOptional<Type.TBoolean>;
|
|
296
|
+
supportsOpenAIGrammarTools: Type.TOptional<Type.TBoolean>;
|
|
297
|
+
supportsAdditionalTools: Type.TOptional<Type.TBoolean>;
|
|
298
|
+
supportsToolSearch: Type.TOptional<Type.TBoolean>;
|
|
299
|
+
supportsExplicitPromptCacheMode: Type.TOptional<Type.TBoolean>;
|
|
300
|
+
supportsMidConvoEffort: Type.TOptional<Type.TBoolean>;
|
|
301
|
+
supportsMaxOutputTokens: Type.TOptional<Type.TBoolean>;
|
|
302
|
+
}>;
|
|
303
|
+
readonly "azure-openai-responses": Type.TObject<{
|
|
304
|
+
supportsDeveloperRole: Type.TOptional<Type.TBoolean>;
|
|
305
|
+
supportsMidConvoSystemMessages: Type.TOptional<Type.TBoolean>;
|
|
306
|
+
sessionAffinityFormat: Type.TOptional<Type.TUnion<[Type.TLiteral<"openai">, Type.TLiteral<"openai-nosession">, Type.TLiteral<"openrouter">]>>;
|
|
307
|
+
supportsLongCacheRetention: Type.TOptional<Type.TBoolean>;
|
|
308
|
+
supportsStrictMode: Type.TOptional<Type.TBoolean>;
|
|
309
|
+
supportsOpenAIGrammarTools: Type.TOptional<Type.TBoolean>;
|
|
310
|
+
supportsAdditionalTools: Type.TOptional<Type.TBoolean>;
|
|
311
|
+
supportsToolSearch: Type.TOptional<Type.TBoolean>;
|
|
312
|
+
supportsExplicitPromptCacheMode: Type.TOptional<Type.TBoolean>;
|
|
313
|
+
supportsMidConvoEffort: Type.TOptional<Type.TBoolean>;
|
|
314
|
+
supportsMaxOutputTokens: Type.TOptional<Type.TBoolean>;
|
|
315
|
+
}>;
|
|
316
|
+
readonly "openai-codex-responses": Type.TObject<{
|
|
317
|
+
supportsDeveloperRole: Type.TOptional<Type.TBoolean>;
|
|
318
|
+
supportsMidConvoSystemMessages: Type.TOptional<Type.TBoolean>;
|
|
319
|
+
sessionAffinityFormat: Type.TOptional<Type.TUnion<[Type.TLiteral<"openai">, Type.TLiteral<"openai-nosession">, Type.TLiteral<"openrouter">]>>;
|
|
320
|
+
supportsLongCacheRetention: Type.TOptional<Type.TBoolean>;
|
|
321
|
+
supportsStrictMode: Type.TOptional<Type.TBoolean>;
|
|
322
|
+
supportsOpenAIGrammarTools: Type.TOptional<Type.TBoolean>;
|
|
323
|
+
supportsAdditionalTools: Type.TOptional<Type.TBoolean>;
|
|
324
|
+
supportsToolSearch: Type.TOptional<Type.TBoolean>;
|
|
325
|
+
supportsExplicitPromptCacheMode: Type.TOptional<Type.TBoolean>;
|
|
326
|
+
supportsMidConvoEffort: Type.TOptional<Type.TBoolean>;
|
|
327
|
+
supportsMaxOutputTokens: Type.TOptional<Type.TBoolean>;
|
|
328
|
+
}>;
|
|
329
|
+
readonly "anthropic-messages": Type.TObject<{
|
|
330
|
+
supportsEagerToolInputStreaming: Type.TOptional<Type.TBoolean>;
|
|
331
|
+
supportsLongCacheRetention: Type.TOptional<Type.TBoolean>;
|
|
332
|
+
sendSessionAffinityHeaders: Type.TOptional<Type.TBoolean>;
|
|
333
|
+
sessionAffinityFormat: Type.TOptional<Type.TLiteral<"openrouter">>;
|
|
334
|
+
supportsCacheControlOnTools: Type.TOptional<Type.TBoolean>;
|
|
335
|
+
supportsTemperature: Type.TOptional<Type.TBoolean>;
|
|
336
|
+
forceAdaptiveThinking: Type.TOptional<Type.TBoolean>;
|
|
337
|
+
allowEmptySignature: Type.TOptional<Type.TBoolean>;
|
|
338
|
+
supportsStrictTools: Type.TOptional<Type.TBoolean>;
|
|
339
|
+
supportsMidConvoEffort: Type.TOptional<Type.TBoolean>;
|
|
340
|
+
supportsMidConvoSystemMessages: Type.TOptional<Type.TBoolean>;
|
|
341
|
+
supportsMidConvoToolChanges: Type.TOptional<Type.TBoolean>;
|
|
342
|
+
allowedFallbackModels: Type.TOptional<Type.TArray<Type.TObject<{
|
|
343
|
+
provider: Type.TString;
|
|
344
|
+
model: Type.TString;
|
|
345
|
+
cost: Type.TObject<{
|
|
346
|
+
input: Type.TNumber;
|
|
347
|
+
output: Type.TNumber;
|
|
348
|
+
cacheRead: Type.TNumber;
|
|
349
|
+
cacheWrite: Type.TNumber;
|
|
350
|
+
tiers: Type.TOptional<Type.TArray<Type.TObject<{
|
|
351
|
+
input: Type.TNumber;
|
|
352
|
+
output: Type.TNumber;
|
|
353
|
+
cacheRead: Type.TNumber;
|
|
354
|
+
cacheWrite: Type.TNumber;
|
|
355
|
+
inputTokensAbove: Type.TNumber;
|
|
356
|
+
}>>>;
|
|
357
|
+
}>;
|
|
358
|
+
}>>>;
|
|
359
|
+
}>;
|
|
360
|
+
readonly "bedrock-converse-stream": Type.TObject<{
|
|
361
|
+
supportsStrictMode: Type.TOptional<Type.TBoolean>;
|
|
362
|
+
}>;
|
|
363
|
+
readonly "mistral-conversations": Type.TObject<{
|
|
364
|
+
supportsMidConvoSystemMessages: Type.TOptional<Type.TBoolean>;
|
|
365
|
+
}>;
|
|
366
|
+
readonly "typesafe-system-one": Type.TObject<{
|
|
367
|
+
imageInput: Type.TOptional<Type.TUnion<[Type.TLiteral<"assets">, Type.TLiteral<"images">, Type.TLiteral<"state-image-urls">]>>;
|
|
368
|
+
sendImageOptInHeader: Type.TOptional<Type.TBoolean>;
|
|
369
|
+
}>;
|
|
370
|
+
readonly "cloudflare-workers-ai-system-one": Type.TObject<{
|
|
371
|
+
imageInput: Type.TOptional<Type.TUnion<[Type.TLiteral<"assets">, Type.TLiteral<"images">, Type.TLiteral<"state-image-urls">]>>;
|
|
372
|
+
sendImageOptInHeader: Type.TOptional<Type.TBoolean>;
|
|
373
|
+
}>;
|
|
374
|
+
};
|
|
200
375
|
export declare const ProviderCompatSchema: Type.TObject<MergedCompatProperties<({
|
|
201
376
|
supportsStore: Type.TOptional<Type.TBoolean>;
|
|
202
377
|
supportsDeveloperRole: Type.TOptional<Type.TBoolean>;
|
|
@@ -327,6 +502,9 @@ export declare const ProviderCompatSchema: Type.TObject<MergedCompatProperties<(
|
|
|
327
502
|
supportsStrictMode: Type.TOptional<Type.TBoolean>;
|
|
328
503
|
} | {
|
|
329
504
|
supportsMidConvoSystemMessages: Type.TOptional<Type.TBoolean>;
|
|
505
|
+
} | {
|
|
506
|
+
imageInput: Type.TOptional<Type.TUnion<[Type.TLiteral<"assets">, Type.TLiteral<"images">, Type.TLiteral<"state-image-urls">]>>;
|
|
507
|
+
sendImageOptInHeader: Type.TOptional<Type.TBoolean>;
|
|
330
508
|
})[], {
|
|
331
509
|
supportsDeveloperRole: Type.TOptional<Type.TBoolean>;
|
|
332
510
|
supportsMidConvoSystemMessages: Type.TOptional<Type.TBoolean>;
|
|
@@ -356,4 +534,6 @@ export interface BedrockCompat extends Static<typeof BedrockCompatSchema> {
|
|
|
356
534
|
}
|
|
357
535
|
export interface MistralConversationsCompat extends Static<typeof MistralConversationsCompatSchema> {
|
|
358
536
|
}
|
|
537
|
+
export interface SystemOneCompat extends Static<typeof SystemOneCompatSchema> {
|
|
538
|
+
}
|
|
359
539
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var g=Object.defineProperty;var s=(o,i)=>g(o,"name",{value:i,configurable:!0});import{Type as e}from"typebox";import{ModelCostSchema as d}from"./model-schema.js";function c(o){return e.Union([e.Literal("openai"),e.Literal("openai-nosession"),e.Literal("openrouter")],o)}s(c,"sessionAffinityFormat");const B=c({description:"Session-affinity header format used to route related requests consistently."});function h(o){return e.Union([e.Literal("thinking_token_budget"),e.Literal("thinking_budget"),e.Literal("thinking_budget_tokens")],o)}s(h,"thinkingTokenBudgetField");const q=h({description:'Top-level request field name used by OpenAI-compatible endpoints to cap reasoning tokens. "thinking_token_budget" is used by vLLM, "thinking_budget" by Qwen, DashScope, or SGLang, and "thinking_budget_tokens" by llama.cpp.'}),u=e.Union([e.String(),e.Number(),e.Boolean(),e.Null(),e.Object({$var:e.Union([e.Literal("thinking.enabled"),e.Literal("thinking.effort"),e.Literal("thinking.budget")]),omitWhenOff:e.Optional(e.Boolean())})]);function m(o){return e.Object({p50:e.Optional(e.Number({description:`${o} at the 50th percentile.`})),p75:e.Optional(e.Number({description:`${o} at the 75th percentile.`})),p90:e.Optional(e.Number({description:`${o} at the 90th percentile.`})),p99:e.Optional(e.Number({description:`${o} at the 99th percentile.`}))})}s(m,"percentileCutoffs");const y=e.Object({allow_fallbacks:e.Optional(e.Boolean({description:"Whether to allow backup providers to serve requests.",default:!0})),require_parameters:e.Optional(e.Boolean({description:"Whether to filter providers to only those that support all parameters in the request.",default:!1})),data_collection:e.Optional(e.Union([e.Literal("deny"),e.Literal("allow")],{description:'Data collection setting. "allow": allow providers that may store or train on data. "deny": only use providers that do not collect user data.',default:"allow"})),zdr:e.Optional(e.Boolean({description:"Whether to restrict routing to only ZDR (Zero Data Retention) endpoints."})),enforce_distillable_text:e.Optional(e.Boolean({description:"Whether to restrict routing to only models that allow text distillation."})),order:e.Optional(e.Array(e.String(),{description:"An ordered list of provider names or slugs to try in sequence, falling back to the next if unavailable."})),only:e.Optional(e.Array(e.String(),{description:"List of provider names or slugs to exclusively allow for this request."})),ignore:e.Optional(e.Array(e.String(),{description:"List of provider names or slugs to skip for this request."})),quantizations:e.Optional(e.Array(e.String(),{description:'A list of quantization levels to filter providers by, for example ["fp16", "bf16", "fp8", "fp6", "int8", "int4", "fp4", "fp32"].'})),sort:e.Optional(e.Union([e.String(),e.Object({by:e.Optional(e.String({description:'The sorting metric, such as "price", "throughput", or "latency".'})),partition:e.Optional(e.Union([e.String(),e.Null()],{description:'Partitioning strategy: "model" or "none".',default:"model"}))})],{description:'Sorting strategy. Can be a string such as "price", "throughput", or "latency", or an object.'})),max_price:e.Optional(e.Object({prompt:e.Optional(e.Union([e.Number(),e.String()],{description:"Price per million prompt tokens."})),completion:e.Optional(e.Union([e.Number(),e.String()],{description:"Price per million completion tokens."})),image:e.Optional(e.Union([e.Number(),e.String()],{description:"Price per image."})),audio:e.Optional(e.Union([e.Number(),e.String()],{description:"Price per audio unit."})),request:e.Optional(e.Union([e.Number(),e.String()],{description:"Price per request."}))},{description:"Maximum price per million tokens in USD."})),preferred_min_throughput:e.Optional(e.Union([e.Number(),m("Minimum tokens per second")],{description:"Preferred minimum throughput in tokens per second. A number applies to p50."})),preferred_max_latency:e.Optional(e.Union([e.Number(),m("Maximum latency in seconds")],{description:"Preferred maximum latency in seconds. A number applies to p50."}))},{description:"OpenRouter provider routing preferences. Controls which upstream providers OpenRouter routes requests to. Sent as the provider field in the OpenRouter API request body. See https://openrouter.ai/docs/guides/routing/provider-selection."}),v=e.Object({only:e.Optional(e.Array(e.String(),{description:'List of provider slugs to exclusively use for this request, for example ["bedrock", "anthropic"].'})),order:e.Optional(e.Array(e.String(),{description:'List of provider slugs to try in order, for example ["anthropic", "openai"].'}))},{description:"Vercel AI Gateway routing preferences. Controls which upstream providers the gateway routes requests to. See https://vercel.com/docs/ai-gateway/models-and-providers/provider-options."}),b=e.Object({provider:e.String({minLength:1}),model:e.String({minLength:1}),cost:d},{description:"An Anthropic server-side refusal fallback model with local pricing metadata."});function t(o){return e.Optional(e.Boolean(o))}s(t,"optionalCompatBoolean");function p(o){return e.Optional(c(o))}s(p,"optionalSessionAffinityFormat");const k=e.Object({supportsStore:e.Optional(e.Boolean({description:"Whether the provider supports the store field. Default: auto-detected from URL."})),supportsDeveloperRole:t({description:"Whether the provider supports the developer role instead of system. Default: auto-detected from URL."}),supportsReasoningEffort:e.Optional(e.Boolean({description:"Whether the provider supports reasoning_effort. Default: auto-detected from URL."})),supportsUsageInStreaming:e.Optional(e.Boolean({description:"Whether the provider supports stream_options.include_usage for token usage in streaming responses.",default:!0})),supportsFinishReason:e.Optional(e.Boolean({description:"Whether streamed responses include finish_reason. When false, pi infers stop or toolUse when the stream ends.",default:!0})),maxTokensField:e.Optional(e.Union([e.Literal("max_completion_tokens"),e.Literal("max_tokens")],{description:"Which field to use for max tokens. Default: auto-detected from URL."})),requiresToolResultName:e.Optional(e.Boolean({description:"Whether tool results require the name field. Default: auto-detected from URL."})),requiresAssistantAfterToolResult:e.Optional(e.Boolean({description:"Whether a user message after tool results requires an assistant message in between. Default: auto-detected from URL."})),requiresThinkingAsText:e.Optional(e.Boolean({description:"Whether thinking blocks must be converted to text blocks with <thinking> delimiters. Default: auto-detected from URL."})),requiresReasoningContentOnAssistantMessages:e.Optional(e.Boolean({description:"Whether all replayed assistant messages must include an empty reasoning_content field when reasoning is enabled. Default: auto-detected from URL."})),thinkingFormat:e.Optional(e.Union([e.Literal("openai"),e.Literal("openrouter"),e.Literal("deepseek"),e.Literal("together"),e.Literal("baseten"),e.Literal("zai"),e.Literal("qwen"),e.Literal("chat-template"),e.Literal("qwen-chat-template"),e.Literal("string-thinking"),e.Literal("ant-ling")],{description:'Format for reasoning or thinking parameters. When omitted, Pi auto-detects the format from the provider URL. "openai" uses reasoning_effort, "openrouter" uses reasoning.effort, "deepseek" uses thinking.type plus reasoning_effort when supported, "together" uses reasoning.enabled plus reasoning_effort when supported, "baseten" uses configurable chat_template_args plus reasoning_effort when supported, "zai" uses thinking.type, "qwen" uses top-level enable_thinking, "qwen-chat-template" uses chat_template_kwargs.enable_thinking and preserve_thinking, "chat-template" uses configurable chat_template_kwargs, "string-thinking" uses top-level thinking, and "ant-ling" uses reasoning.effort only when the mapped effort is non-null.'})),chatTemplateKwargs:e.Optional(e.Record(e.String(),u,{description:'Kwargs sent as chat_template_kwargs when thinkingFormat is "chat-template". Use $var with "thinking.enabled", "thinking.effort", or "thinking.budget" for pi-controlled values.'})),chatTemplateArgs:e.Optional(e.Record(e.String(),u,{description:'Arguments sent as chat_template_args when thinkingFormat is "baseten". Use $var with "thinking.enabled", "thinking.effort", or "thinking.budget" for pi-controlled values.'})),openRouterRouting:e.Optional(y),vercelGatewayRouting:e.Optional(v),zaiToolStream:e.Optional(e.Boolean({description:"Whether z.ai supports top-level tool_stream for streaming tool call deltas.",default:!1})),thinkingTokenBudgetField:e.Optional(h({description:'Top-level request field used to cap reasoning tokens from thinkingBudgets. Reasoning and the answer share max_tokens on these endpoints. "thinking_token_budget" is vLLM, "thinking_budget" is Qwen, DashScope, or SGLang, and "thinking_budget_tokens" is llama.cpp. Off by default and not set on the generated catalog.'})),supportsThinkingTokenBudget:e.Optional(e.Boolean({description:'Alias for thinkingTokenBudgetField: "thinking_token_budget" (vLLM). Prefer thinkingTokenBudgetField.',default:!1})),supportsOpenAIGrammarTools:t({description:"Whether the provider supports OpenAI custom tools with Lark or regex grammar formats. When false, grammar-constrained tools fall back to normal function tools. The generated catalog enables this for capable models.",default:!1}),supportsMidConvoSystemMessages:t({description:"Whether the exact model accepts system or developer messages after the conversation has started. When false, later system messages are folded into the leading system message. The generated catalog enables this for verified models.",default:!1}),supportsMidConvoToolAdditions:e.Optional(e.Boolean({description:"Whether system messages can introduce additional tools mid-conversation. Requires supportsMidConvoSystemMessages. The generated catalog enables this for capable models.",default:!1})),supportsStrictMode:t({description:"Whether the provider supports the strict field in tool definitions. Generated capable models enable it explicitly.",default:!1}),cacheControlFormat:e.Optional(e.Literal("anthropic",{description:"Cache control convention for prompt caching. Anthropic applies cache_control markers to the system prompt, last tool definition, and last user, assistant, or tool-result text content."})),sendSessionAffinityHeaders:t({description:"Whether to send session-affinity data from options.sessionId. Default: true for OpenRouter endpoints, false otherwise."}),sessionAffinityFormat:p({description:"Session-affinity header format. openai sends session_id, x-client-request-id, and x-session-affinity; openai-nosession sends x-client-request-id and x-session-affinity; openrouter sends x-session-id. Does not affect prompt_cache_key. Default: auto-detected."}),supportsLongCacheRetention:t({description:'Whether the provider supports long prompt cache retention (prompt_cache_retention: "24h" or Anthropic-style cache_control.ttl: "1h", depending on format). Default: auto-detected from provider and URL.'}),vllmPriority:e.Optional(e.Number({description:"vLLM scheduler priority sent as the top-level priority request field. Lower values are handled earlier and the server default is 0. Only meaningful with --scheduling-policy priority. Off by default and not set on the generated catalog."})),dsmlToolCallsInContent:t({description:"Whether DeepSeek's native tool-call markup (<\uFF5CDSML\uFF5Ctool_calls> ...) can arrive in content when the serving side fails to parse it into tool_calls. When true, complete DSML blocks in the text stream become tool calls and stray DSML tags are dropped. Default: true for DeepSeek models."}),responseModelCosts:e.Optional(e.Record(e.String(),d,{description:"Rates for the concrete models a routing endpoint may answer with, keyed by the id the response reports in its model field (e.g. a gateway's virtual auto model answered by a real one). When the response names one of these models, usage is costed at its rates instead of the requested model's. Not set on the generated catalog."}))},{description:"Compatibility settings for OpenAI-compatible completions APIs. Use this to override URL-based auto-detection for custom providers.",additionalProperties:!0}),O=e.Object({supportsDeveloperRole:t({description:"Whether the provider supports the developer role instead of system.",default:!0}),supportsMidConvoSystemMessages:t({description:"Whether the exact model accepts developer or system messages after the conversation has started. When false, later system messages are folded into the leading system message. The generated catalog enables this for verified models.",default:!1}),sessionAffinityFormat:p({description:"Session-affinity header format. openai sends session_id and x-client-request-id; openai-nosession sends x-client-request-id; openrouter sends x-session-id. Does not affect prompt_cache_key. Default: auto-detected."}),supportsLongCacheRetention:t({description:'Whether the provider supports long prompt cache retention. This uses prompt_cache_options.ttl: "30m" on GPT-5.6+ and prompt_cache_retention: "24h" on earlier models.',default:!0}),supportsStrictMode:t({description:"Whether the provider supports strict JSON-schema function tools. Defaults are API-specific; generated OpenAI models enable it explicitly."}),supportsOpenAIGrammarTools:t({description:"Whether to emit OpenAI custom tools with Lark or regex grammar formats. When false, grammar-constrained tools fall back to normal function tools. The generated catalog enables this for capable models.",default:!1}),supportsAdditionalTools:e.Optional(e.Boolean({description:"Whether the model supports message-anchored additional_tools input items.",default:!1})),supportsToolSearch:e.Optional(e.Boolean({description:"Whether the model supports client-executed tool search for transcript-anchored additions.",default:!1})),supportsExplicitPromptCacheMode:e.Optional(e.Boolean({description:"Whether the model accepts prompt_cache_options. Older OpenAI models reject the parameter.",default:!1})),supportsMidConvoEffort:e.Optional(e.Boolean({description:"Whether thinking level changes are sent as configuration_update input items instead of changing reasoning.effort, so a change keeps the prompt cache. Only used by the openai-responses API, and ignored with Sign in with ChatGPT on the openai provider.",default:!1})),supportsMaxOutputTokens:e.Optional(e.Boolean({description:"Whether the provider accepts max_output_tokens. Some Codex-protocol gateways reject it.",default:!0}))},{description:"Compatibility settings for OpenAI Responses APIs.",additionalProperties:!0}),_=e.Object({supportsEagerToolInputStreaming:e.Optional(e.Boolean({description:"Whether the provider accepts per-tool eager_input_streaming. When false, the Anthropic provider omits tools[].eager_input_streaming and sends the legacy fine-grained-tool-streaming-2025-05-14 beta header for tool-enabled requests.",default:!0})),supportsLongCacheRetention:t({description:"Whether the provider supports Anthropic long cache retention through cache_control.ttl.",default:!0}),sendSessionAffinityHeaders:t({description:"Whether to send x-session-affinity from options.sessionId when caching is enabled. Required for providers like Fireworks that use session affinity for prompt cache routing; requests to the same replica maximize cache hits. Default: true for OpenRouter endpoints, false otherwise."}),sessionAffinityFormat:e.Optional(e.Literal("openrouter",{description:"Session-affinity format. openrouter sends x-session-id; when unset, sends x-session-affinity."})),supportsCacheControlOnTools:e.Optional(e.Boolean({description:"Whether the provider supports Anthropic-style cache_control markers on tool definitions. When false, cache_control is omitted from tool parameters. Some Anthropic-compatible providers, such as Fireworks, do not support this field on tools and may reject or ignore it.",default:!0})),supportsTemperature:e.Optional(e.Boolean({description:"Whether the model accepts the Anthropic temperature request field. Claude Opus 4.7+ rejects non-default values.",default:!0})),forceAdaptiveThinking:e.Optional(e.Boolean({description:"Whether to force adaptive thinking (thinking.type: adaptive plus output_config.effort) regardless of model ID. Built-in models that require adaptive thinking set this in generated metadata. Custom Anthropic-compatible providers can set this to true for any model whose upstream requires the adaptive format. Set false to opt out on overridden built-in models.",default:!1})),allowEmptySignature:e.Optional(e.Boolean({description:"Whether to replay empty thinking signatures instead of converting thinking to text.",default:!1})),supportsStrictTools:e.Optional(e.Boolean({description:"Whether the provider supports Anthropic strict tool schemas. Generated Anthropic models enable it explicitly.",default:!1})),supportsMidConvoEffort:e.Optional(e.Boolean({description:"Whether the exact model transport supports effort-only system messages and thinking binding controls.",default:!1})),supportsMidConvoSystemMessages:t({description:"Whether the exact model accepts system-role messages inside the conversation. When false, later system messages are folded into the top-level system prompt.",default:!1}),supportsMidConvoToolChanges:e.Optional(e.Boolean({description:"Whether the exact model accepts mid-conversation tool_addition and tool_removal blocks. Requires supportsMidConvoSystemMessages.",default:!1})),allowedFallbackModels:e.Optional(e.Array(b,{maxItems:3,description:"Models Anthropic accepts for server-side refusal fallback, with local pricing metadata for returned fallback responses. When absent or empty, callers must omit fallbacks; Anthropic rejects the field for models with no permitted fallback targets."}))},{description:"Compatibility settings for Anthropic Messages-compatible APIs.",additionalProperties:!0}),S=e.Object({supportsStrictMode:t({description:"Whether the model supports Bedrock strict tool schemas.",default:!1})},{description:"Compatibility settings for Amazon Bedrock models.",additionalProperties:!0}),A=e.Object({supportsMidConvoSystemMessages:t({description:"Whether the exact model accepts system messages after the conversation has started. When false, later system messages are folded into the leading system message.",default:!1})},{description:"Compatibility settings for the Mistral chat API.",additionalProperties:!0}),w={supportsDeveloperRole:t({description:"Whether the provider supports the developer role instead of system. Defaults are API-specific."}),supportsMidConvoSystemMessages:t({description:"Whether the exact model accepts system or developer messages after the conversation has started. When false, later system messages are folded into the leading system message.",default:!1}),sessionAffinityFormat:p({description:"Session-affinity header format. Defaults are API-specific or auto-detected."}),supportsMidConvoEffort:t({description:"Whether thinking level changes are sent inside the conversation instead of changing the request's effort, so a change keeps the prompt cache. Used by the anthropic-messages and openai-responses APIs.",default:!1}),supportsLongCacheRetention:t({description:"Whether the provider supports long prompt cache retention. Defaults are API-specific or auto-detected."}),supportsStrictMode:t({description:"Whether the provider supports strict tool schemas. Defaults are API-specific."}),supportsOpenAIGrammarTools:t({description:"Whether the provider supports OpenAI custom tools with Lark or regex grammar formats. When false, grammar-constrained tools fall back to normal function tools.",default:!1}),sendSessionAffinityHeaders:t({description:"Whether to send session-affinity data from options.sessionId. Defaults are API-specific."})};function W(o,i){const a={},l=new Set;for(const n of o)for(const[r,f]of Object.entries(n)){if(a[r]!==void 0&&(l.add(r),!(r in i)))throw new Error(`Duplicate compatibility schema property requires an override: ${r}`);a[r]=f}for(const n of Object.keys(i))if(!l.has(n))throw new Error(`Compatibility schema override does not resolve a duplicate property: ${n}`);return{...a,...i}}s(W,"mergeCompatProperties");const x={"openai-completions":k,"openai-responses":O,"anthropic-messages":_,"bedrock-converse-stream":S,"mistral-conversations":A},L=W(Object.values(x).map(o=>o.properties),w),T=e.Object(L,{description:"Provider and model compatibility overrides.",additionalProperties:!0});export{b as AnthropicAllowedFallbackModelSchema,_ as AnthropicMessagesCompatSchema,S as BedrockCompatSchema,u as ChatTemplateKwargValueSchema,A as MistralConversationsCompatSchema,k as OpenAICompletionsCompatSchema,O as OpenAIResponsesCompatSchema,y as OpenRouterRoutingSchema,T as ProviderCompatSchema,B as SessionAffinityFormatSchema,q as ThinkingTokenBudgetFieldSchema,v as VercelGatewayRoutingSchema};
|
|
1
|
+
var v=Object.defineProperty;var s=(o,i)=>v(o,"name",{value:i,configurable:!0});import{Type as e}from"typebox";import{ModelCostSchema as c}from"./model-schema.js";function h(o){return e.Union([e.Literal("openai"),e.Literal("openai-nosession"),e.Literal("openrouter")],o)}s(h,"sessionAffinityFormat");const q=h({description:"Session-affinity header format used to route related requests consistently."});function u(o){return e.Union([e.Literal("thinking_token_budget"),e.Literal("thinking_budget"),e.Literal("thinking_budget_tokens")],o)}s(u,"thinkingTokenBudgetField");const I=u({description:'Top-level request field name used by OpenAI-compatible endpoints to cap reasoning tokens. "thinking_token_budget" is used by vLLM, "thinking_budget" by Qwen, DashScope, or SGLang, and "thinking_budget_tokens" by llama.cpp.'}),m=e.Union([e.String(),e.Number(),e.Boolean(),e.Null(),e.Object({$var:e.Union([e.Literal("thinking.enabled"),e.Literal("thinking.effort"),e.Literal("thinking.budget")]),omitWhenOff:e.Optional(e.Boolean())})]);function f(o){return e.Object({p50:e.Optional(e.Number({description:`${o} at the 50th percentile.`})),p75:e.Optional(e.Number({description:`${o} at the 75th percentile.`})),p90:e.Optional(e.Number({description:`${o} at the 90th percentile.`})),p99:e.Optional(e.Number({description:`${o} at the 99th percentile.`}))})}s(f,"percentileCutoffs");const b=e.Object({allow_fallbacks:e.Optional(e.Boolean({description:"Whether to allow backup providers to serve requests.",default:!0})),require_parameters:e.Optional(e.Boolean({description:"Whether to filter providers to only those that support all parameters in the request.",default:!1})),data_collection:e.Optional(e.Union([e.Literal("deny"),e.Literal("allow")],{description:'Data collection setting. "allow": allow providers that may store or train on data. "deny": only use providers that do not collect user data.',default:"allow"})),zdr:e.Optional(e.Boolean({description:"Whether to restrict routing to only ZDR (Zero Data Retention) endpoints."})),enforce_distillable_text:e.Optional(e.Boolean({description:"Whether to restrict routing to only models that allow text distillation."})),order:e.Optional(e.Array(e.String(),{description:"An ordered list of provider names or slugs to try in sequence, falling back to the next if unavailable."})),only:e.Optional(e.Array(e.String(),{description:"List of provider names or slugs to exclusively allow for this request."})),ignore:e.Optional(e.Array(e.String(),{description:"List of provider names or slugs to skip for this request."})),quantizations:e.Optional(e.Array(e.String(),{description:'A list of quantization levels to filter providers by, for example ["fp16", "bf16", "fp8", "fp6", "int8", "int4", "fp4", "fp32"].'})),sort:e.Optional(e.Union([e.String(),e.Object({by:e.Optional(e.String({description:'The sorting metric, such as "price", "throughput", or "latency".'})),partition:e.Optional(e.Union([e.String(),e.Null()],{description:'Partitioning strategy: "model" or "none".',default:"model"}))})],{description:'Sorting strategy. Can be a string such as "price", "throughput", or "latency", or an object.'})),max_price:e.Optional(e.Object({prompt:e.Optional(e.Union([e.Number(),e.String()],{description:"Price per million prompt tokens."})),completion:e.Optional(e.Union([e.Number(),e.String()],{description:"Price per million completion tokens."})),image:e.Optional(e.Union([e.Number(),e.String()],{description:"Price per image."})),audio:e.Optional(e.Union([e.Number(),e.String()],{description:"Price per audio unit."})),request:e.Optional(e.Union([e.Number(),e.String()],{description:"Price per request."}))},{description:"Maximum price per million tokens in USD."})),preferred_min_throughput:e.Optional(e.Union([e.Number(),f("Minimum tokens per second")],{description:"Preferred minimum throughput in tokens per second. A number applies to p50."})),preferred_max_latency:e.Optional(e.Union([e.Number(),f("Maximum latency in seconds")],{description:"Preferred maximum latency in seconds. A number applies to p50."}))},{description:"OpenRouter provider routing preferences. Controls which upstream providers OpenRouter routes requests to. Sent as the provider field in the OpenRouter API request body. See https://openrouter.ai/docs/guides/routing/provider-selection."}),k=e.Object({only:e.Optional(e.Array(e.String(),{description:'List of provider slugs to exclusively use for this request, for example ["bedrock", "anthropic"].'})),order:e.Optional(e.Array(e.String(),{description:'List of provider slugs to try in order, for example ["anthropic", "openai"].'}))},{description:"Vercel AI Gateway routing preferences. Controls which upstream providers the gateway routes requests to. See https://vercel.com/docs/ai-gateway/models-and-providers/provider-options."}),O=e.Object({provider:e.String({minLength:1}),model:e.String({minLength:1}),cost:c},{description:"An Anthropic server-side refusal fallback model with local pricing metadata."});function t(o){return e.Optional(e.Boolean(o))}s(t,"optionalCompatBoolean");function p(o){return e.Optional(h(o))}s(p,"optionalSessionAffinityFormat");const S=e.Object({supportsStore:e.Optional(e.Boolean({description:"Whether the provider supports the store field. Default: auto-detected from URL."})),supportsDeveloperRole:t({description:"Whether the provider supports the developer role instead of system. Default: auto-detected from URL."}),supportsReasoningEffort:e.Optional(e.Boolean({description:"Whether the provider supports reasoning_effort. Default: auto-detected from URL."})),supportsUsageInStreaming:e.Optional(e.Boolean({description:"Whether the provider supports stream_options.include_usage for token usage in streaming responses.",default:!0})),supportsFinishReason:e.Optional(e.Boolean({description:"Whether streamed responses include finish_reason. When false, pi infers stop or toolUse when the stream ends.",default:!0})),maxTokensField:e.Optional(e.Union([e.Literal("max_completion_tokens"),e.Literal("max_tokens")],{description:"Which field to use for max tokens. Default: auto-detected from URL."})),requiresToolResultName:e.Optional(e.Boolean({description:"Whether tool results require the name field. Default: auto-detected from URL."})),requiresAssistantAfterToolResult:e.Optional(e.Boolean({description:"Whether a user message after tool results requires an assistant message in between. Default: auto-detected from URL."})),requiresThinkingAsText:e.Optional(e.Boolean({description:"Whether thinking blocks must be converted to text blocks with <thinking> delimiters. Default: auto-detected from URL."})),requiresReasoningContentOnAssistantMessages:e.Optional(e.Boolean({description:"Whether all replayed assistant messages must include an empty reasoning_content field when reasoning is enabled. Default: auto-detected from URL."})),thinkingFormat:e.Optional(e.Union([e.Literal("openai"),e.Literal("openrouter"),e.Literal("deepseek"),e.Literal("together"),e.Literal("baseten"),e.Literal("zai"),e.Literal("qwen"),e.Literal("chat-template"),e.Literal("qwen-chat-template"),e.Literal("string-thinking"),e.Literal("ant-ling")],{description:'Format for reasoning or thinking parameters. When omitted, Pi auto-detects the format from the provider URL. "openai" uses reasoning_effort, "openrouter" uses reasoning.effort, "deepseek" uses thinking.type plus reasoning_effort when supported, "together" uses reasoning.enabled plus reasoning_effort when supported, "baseten" uses configurable chat_template_args plus reasoning_effort when supported, "zai" uses thinking.type, "qwen" uses top-level enable_thinking, "qwen-chat-template" uses chat_template_kwargs.enable_thinking and preserve_thinking, "chat-template" uses configurable chat_template_kwargs, "string-thinking" uses top-level thinking, and "ant-ling" uses reasoning.effort only when the mapped effort is non-null.'})),chatTemplateKwargs:e.Optional(e.Record(e.String(),m,{description:'Kwargs sent as chat_template_kwargs when thinkingFormat is "chat-template". Use $var with "thinking.enabled", "thinking.effort", or "thinking.budget" for pi-controlled values.'})),chatTemplateArgs:e.Optional(e.Record(e.String(),m,{description:'Arguments sent as chat_template_args when thinkingFormat is "baseten". Use $var with "thinking.enabled", "thinking.effort", or "thinking.budget" for pi-controlled values.'})),openRouterRouting:e.Optional(b),vercelGatewayRouting:e.Optional(k),zaiToolStream:e.Optional(e.Boolean({description:"Whether z.ai supports top-level tool_stream for streaming tool call deltas.",default:!1})),thinkingTokenBudgetField:e.Optional(u({description:'Top-level request field used to cap reasoning tokens from thinkingBudgets. Reasoning and the answer share max_tokens on these endpoints. "thinking_token_budget" is vLLM, "thinking_budget" is Qwen, DashScope, or SGLang, and "thinking_budget_tokens" is llama.cpp. Off by default and not set on the generated catalog.'})),supportsThinkingTokenBudget:e.Optional(e.Boolean({description:'Alias for thinkingTokenBudgetField: "thinking_token_budget" (vLLM). Prefer thinkingTokenBudgetField.',default:!1})),supportsOpenAIGrammarTools:t({description:"Whether the provider supports OpenAI custom tools with Lark or regex grammar formats. When false, grammar-constrained tools fall back to normal function tools. The generated catalog enables this for capable models.",default:!1}),supportsMidConvoSystemMessages:t({description:"Whether the exact model accepts system or developer messages after the conversation has started. When false, later system messages are folded into the leading system message. The generated catalog enables this for verified models.",default:!1}),supportsMidConvoToolAdditions:e.Optional(e.Boolean({description:"Whether system messages can introduce additional tools mid-conversation. Requires supportsMidConvoSystemMessages. The generated catalog enables this for capable models.",default:!1})),supportsStrictMode:t({description:"Whether the provider supports the strict field in tool definitions. Generated capable models enable it explicitly.",default:!1}),cacheControlFormat:e.Optional(e.Literal("anthropic",{description:"Cache control convention for prompt caching. Anthropic applies cache_control markers to the system prompt, last tool definition, and last user, assistant, or tool-result text content."})),sendSessionAffinityHeaders:t({description:"Whether to send session-affinity data from options.sessionId. Default: true for OpenRouter endpoints, false otherwise."}),sessionAffinityFormat:p({description:"Session-affinity header format. openai sends session_id, x-client-request-id, and x-session-affinity; openai-nosession sends x-client-request-id and x-session-affinity; openrouter sends x-session-id. Does not affect prompt_cache_key. Default: auto-detected."}),supportsLongCacheRetention:t({description:'Whether the provider supports long prompt cache retention (prompt_cache_retention: "24h" or Anthropic-style cache_control.ttl: "1h", depending on format). Default: auto-detected from provider and URL.'}),vllmPriority:e.Optional(e.Number({description:"vLLM scheduler priority sent as the top-level priority request field. Lower values are handled earlier and the server default is 0. Only meaningful with --scheduling-policy priority. Off by default and not set on the generated catalog."})),dsmlToolCallsInContent:t({description:"Whether DeepSeek's native tool-call markup (<\uFF5CDSML\uFF5Ctool_calls> ...) can arrive in content when the serving side fails to parse it into tool_calls. When true, complete DSML blocks in the text stream become tool calls and stray DSML tags are dropped. Default: true for DeepSeek models."}),responseModelCosts:e.Optional(e.Record(e.String(),c,{description:"Rates for the concrete models a routing endpoint may answer with, keyed by the id the response reports in its model field (e.g. a gateway's virtual auto model answered by a real one). When the response names one of these models, usage is costed at its rates instead of the requested model's. Not set on the generated catalog."}))},{description:"Compatibility settings for OpenAI-compatible completions APIs. Use this to override URL-based auto-detection for custom providers.",additionalProperties:!0}),l=e.Object({supportsDeveloperRole:t({description:"Whether the provider supports the developer role instead of system.",default:!0}),supportsMidConvoSystemMessages:t({description:"Whether the exact model accepts developer or system messages after the conversation has started. When false, later system messages are folded into the leading system message. The generated catalog enables this for verified models.",default:!1}),sessionAffinityFormat:p({description:"Session-affinity header format. openai sends session_id and x-client-request-id; openai-nosession sends x-client-request-id; openrouter sends x-session-id. Does not affect prompt_cache_key. Default: auto-detected."}),supportsLongCacheRetention:t({description:'Whether the provider supports long prompt cache retention. This uses prompt_cache_options.ttl: "30m" on GPT-5.6+ and prompt_cache_retention: "24h" on earlier models.',default:!0}),supportsStrictMode:t({description:"Whether the provider supports strict JSON-schema function tools. Defaults are API-specific; generated OpenAI models enable it explicitly."}),supportsOpenAIGrammarTools:t({description:"Whether to emit OpenAI custom tools with Lark or regex grammar formats. When false, grammar-constrained tools fall back to normal function tools. The generated catalog enables this for capable models.",default:!1}),supportsAdditionalTools:e.Optional(e.Boolean({description:"Whether the model supports message-anchored additional_tools input items.",default:!1})),supportsToolSearch:e.Optional(e.Boolean({description:"Whether the model supports client-executed tool search for transcript-anchored additions.",default:!1})),supportsExplicitPromptCacheMode:e.Optional(e.Boolean({description:"Whether the model accepts prompt_cache_options. Older OpenAI models reject the parameter.",default:!1})),supportsMidConvoEffort:e.Optional(e.Boolean({description:"Whether thinking level changes are sent as configuration_update input items instead of changing reasoning.effort, so a change keeps the prompt cache. Only used by the openai-responses API, and ignored with Sign in with ChatGPT on the openai provider.",default:!1})),supportsMaxOutputTokens:e.Optional(e.Boolean({description:"Whether the provider accepts max_output_tokens. Some Codex-protocol gateways reject it.",default:!0}))},{description:"Compatibility settings for OpenAI Responses APIs.",additionalProperties:!0}),_=e.Object({supportsEagerToolInputStreaming:e.Optional(e.Boolean({description:"Whether the provider accepts per-tool eager_input_streaming. When false, the Anthropic provider omits tools[].eager_input_streaming and sends the legacy fine-grained-tool-streaming-2025-05-14 beta header for tool-enabled requests.",default:!0})),supportsLongCacheRetention:t({description:"Whether the provider supports Anthropic long cache retention through cache_control.ttl.",default:!0}),sendSessionAffinityHeaders:t({description:"Whether to send x-session-affinity from options.sessionId when caching is enabled. Required for providers like Fireworks that use session affinity for prompt cache routing; requests to the same replica maximize cache hits. Default: true for OpenRouter endpoints, false otherwise."}),sessionAffinityFormat:e.Optional(e.Literal("openrouter",{description:"Session-affinity format. openrouter sends x-session-id; when unset, sends x-session-affinity."})),supportsCacheControlOnTools:e.Optional(e.Boolean({description:"Whether the provider supports Anthropic-style cache_control markers on tool definitions. When false, cache_control is omitted from tool parameters. Some Anthropic-compatible providers, such as Fireworks, do not support this field on tools and may reject or ignore it.",default:!0})),supportsTemperature:e.Optional(e.Boolean({description:"Whether the model accepts the Anthropic temperature request field. Claude Opus 4.7+ rejects non-default values.",default:!0})),forceAdaptiveThinking:e.Optional(e.Boolean({description:"Whether to force adaptive thinking (thinking.type: adaptive plus output_config.effort) regardless of model ID. Built-in models that require adaptive thinking set this in generated metadata. Custom Anthropic-compatible providers can set this to true for any model whose upstream requires the adaptive format. Set false to opt out on overridden built-in models.",default:!1})),allowEmptySignature:e.Optional(e.Boolean({description:"Whether to replay empty thinking signatures instead of converting thinking to text.",default:!1})),supportsStrictTools:e.Optional(e.Boolean({description:"Whether the provider supports Anthropic strict tool schemas. Generated Anthropic models enable it explicitly.",default:!1})),supportsMidConvoEffort:e.Optional(e.Boolean({description:"Whether the exact model transport supports effort-only system messages and thinking binding controls.",default:!1})),supportsMidConvoSystemMessages:t({description:"Whether the exact model accepts system-role messages inside the conversation. When false, later system messages are folded into the top-level system prompt.",default:!1}),supportsMidConvoToolChanges:e.Optional(e.Boolean({description:"Whether the exact model accepts mid-conversation tool_addition and tool_removal blocks. Requires supportsMidConvoSystemMessages.",default:!1})),allowedFallbackModels:e.Optional(e.Array(O,{maxItems:3,description:"Models Anthropic accepts for server-side refusal fallback, with local pricing metadata for returned fallback responses. When absent or empty, callers must omit fallbacks; Anthropic rejects the field for models with no permitted fallback targets."}))},{description:"Compatibility settings for Anthropic Messages-compatible APIs.",additionalProperties:!0}),A=e.Object({supportsStrictMode:t({description:"Whether the model supports Bedrock strict tool schemas.",default:!1})},{description:"Compatibility settings for Amazon Bedrock models.",additionalProperties:!0}),w=e.Object({supportsMidConvoSystemMessages:t({description:"Whether the exact model accepts system messages after the conversation has started. When false, later system messages are folded into the leading system message.",default:!1})},{description:"Compatibility settings for the Mistral chat API.",additionalProperties:!0}),g=e.Object({imageInput:e.Optional(e.Union([e.Literal("assets"),e.Literal("images"),e.Literal("state-image-urls")],{description:`How the service takes classifier images. "assets" sends TypeSafe's assets map (PNG and JPEG) and references the images from the state, as TypeSafe and Jev on Workers AI expect. "images" sends Clef's images list of data URLs (PNG, JPEG, and WebP, at most four), as Clef on Workers AI expects. "state-image-urls" places image_url parts before the state, as OpenRouter expects; OpenRouter drops assets without an error. Auto-detected from the provider, baseUrl, and model ID. Classifier models read it from the provider-level compat; models and modelOverrides entries apply to chat models only.`})),sendImageOptInHeader:t({description:"Whether requests with images send the TypeSafe-Danger-Zone-Images: true header, which TypeSafe's own API requires for its experimental image input. Defaults to true for the typesafe-system-one API unless the model is detected as OpenRouter."})},{description:"Compatibility settings for System One classifier APIs.",additionalProperties:!0}),x={supportsDeveloperRole:t({description:"Whether the provider supports the developer role instead of system. Defaults are API-specific."}),supportsMidConvoSystemMessages:t({description:"Whether the exact model accepts system or developer messages after the conversation has started. When false, later system messages are folded into the leading system message.",default:!1}),sessionAffinityFormat:p({description:"Session-affinity header format. Defaults are API-specific or auto-detected."}),supportsMidConvoEffort:t({description:"Whether thinking level changes are sent inside the conversation instead of changing the request's effort, so a change keeps the prompt cache. Used by the anthropic-messages and openai-responses APIs.",default:!1}),supportsLongCacheRetention:t({description:"Whether the provider supports long prompt cache retention. Defaults are API-specific or auto-detected."}),supportsStrictMode:t({description:"Whether the provider supports strict tool schemas. Defaults are API-specific."}),supportsOpenAIGrammarTools:t({description:"Whether the provider supports OpenAI custom tools with Lark or regex grammar formats. When false, grammar-constrained tools fall back to normal function tools.",default:!1}),sendSessionAffinityHeaders:t({description:"Whether to send session-affinity data from options.sessionId. Defaults are API-specific."})};function W(o,i){const a={},d=new Set;for(const n of o)for(const[r,y]of Object.entries(n)){if(a[r]!==void 0&&(d.add(r),!(r in i)))throw new Error(`Duplicate compatibility schema property requires an override: ${r}`);a[r]=y}for(const n of Object.keys(i))if(!d.has(n))throw new Error(`Compatibility schema override does not resolve a duplicate property: ${n}`);return{...a,...i}}s(W,"mergeCompatProperties");const L={"openai-completions":S,"openai-responses":l,"azure-openai-responses":l,"openai-codex-responses":l,"anthropic-messages":_,"bedrock-converse-stream":A,"mistral-conversations":w,"typesafe-system-one":g,"cloudflare-workers-ai-system-one":g},C=W([...new Set(Object.values(L))].map(o=>o.properties),x),M=e.Object(C,{description:"Provider and model compatibility overrides.",additionalProperties:!0});export{O as AnthropicAllowedFallbackModelSchema,_ as AnthropicMessagesCompatSchema,A as BedrockCompatSchema,m as ChatTemplateKwargValueSchema,L as CompatSchemasByApi,w as MistralConversationsCompatSchema,S as OpenAICompletionsCompatSchema,l as OpenAIResponsesCompatSchema,b as OpenRouterRoutingSchema,M as ProviderCompatSchema,q as SessionAffinityFormatSchema,g as SystemOneCompatSchema,I as ThinkingTokenBudgetFieldSchema,k as VercelGatewayRoutingSchema};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"schemaVersion":6,"generatedAt":"2026-10-
|
|
1
|
+
{"schemaVersion":6,"generatedAt":"2026-10-23T11:33:56.495Z","structureHash":"759f959f33cbe6d5be3c169513b77d897859b2fd6996fec734bc5942106c51ee","files":{"amazon-bedrock.json":"5c5a40b2ad4456a7f478aab32f10b2dad5a9dee93184eb38c98721c10fe49ba2","ant-ling.json":"628feab3ef6c7d80ce96f75999804e1d9f05fec3851e5302e30fff3b69db90f6","anthropic.json":"91f5da01452c7746645d3405bc91e09f849e4e4687c7c7ff22d8976eafe64b87","azure.json":"3b008f124eb5089ecf37b918545b5b4da1c842b982383d4b4b4b32383adcc6ca","baseten.json":"5bd3c98c61769388b3724368ef964d16b7a58e41a6edcf4ebceb9d4ac0a21d3b","cerebras.json":"2eb969b2956844f9a641d3de52c19f1791293c58f607282fb3b0ebfe85ff66f8","cloudflare-ai-gateway.json":"6c4f293c27f26a7b005fdd2ea3059668836a5c21097d7df1a03ec03ca540c091","cloudflare-workers-ai.json":"36c80c7d7606465001706d5b5d8612d825d8c501d20efb994599960693d37d43","deepseek.json":"10a296fb3e898f7715c80890c8af0af4f5fd58f22dbcd6612fdc5d762157ccdc","fireworks.json":"dae512231a827203db11907889cf235fda8ea4ee10447d6376d83ed712b372a2","github-copilot.json":"b6bf50b945113db1e6cd504b67a68670c4e29380c4e2bdf16ab091eb181be498","google-vertex.json":"564d692a4292ef12e98c8ec056a39948ea64e10851f5ddaaebcc37b585545231","google.json":"b61fb0e27da5be60e1112e46955c5923656cb4d62bb221f834a9463d764ef5de","groq.json":"087df37206e9eed8b10f1e558e4c496289bef60074b7e8afba4f20fb102b4ec2","huggingface.json":"2c78f762f4aa8d0e351f53d4c3fa971557175f315f1c6e3c63ddb45dd764151b","kimi-coding.json":"2b0567b9de6275aacf2fe125b16d6982f85f396d8293649f604bbebaec77188f","meta.json":"563f5ec07973f52ab8c3eb26ef91a36ad8a79e950b37174935666cdcb624bf35","minimax-cn.json":"fa15d1f67a07046d38e191af9bd97ed922ba45a99a11af4ad281151cc6b762aa","minimax.json":"1e0459dda3858ea24151182106fc4179b95f43a0a8dffc1c3d2e7db4c2d9206e","mistral.json":"8b6dbb21d6794d3ef606147ac7b05c355748a640224da9072f1081a908fe444f","moonshotai-cn.json":"0dbd6b063a0abdbe55d5dc59dd4dade566c2ea817ad6184bc8d20655ecba1daf","moonshotai.json":"1da2c4e34f22aef17a07c974d85bdee8e1b68b6dc712e3769c935b3f1e7dadca","nvidia.json":"6f66192c21788b4555f7e77bd7c14201172edf355be8d318f96ff8d0d6921054","openai-codex.json":"533e0ddd7d212fa8433b974b19613301b093f171541e4f4e1fea1962e68928ad","openai.json":"cf5e119eb05f47bbf1dbad179de6a07b904bf7673e96691be72ab0b1fe40a781","opencode-go.json":"4d3b6505c87e3959624430b789b534d6a36a22b1d475b4b5ca0d7a9f6845038c","opencode.json":"cbe65d07905d409ef4d81ec5d9258157e0f5b75a62c2dbf7d153133fdba3dc6d","openrouter.json":"036272c9a6620a588ae151b068830769a851dd383e4fd02e642e4afa201307f3","qwen-token-plan-cn.json":"64427a6adeb3e7dd1857d68bef9bb12097632b646ed151b740e209143e31341e","qwen-token-plan-individual.json":"0fb7cf64faf39d1a3b0a884210a86c87084b805eda15644f5f39293287b959dd","qwen-token-plan.json":"37b9a76c54090228d1026a8f0fcb4d304b00d64b1a3a94cb2ae6e677d2c52b13","radius.json":"49da11ea2e6881e72b3cc32b05f5326cf539332896b47751636f4c19a69911c4","together.json":"2a28fa1978c996ac0a7f0fc07f0c98a37dbf282afe77c0f141dab0c36791ef83","typesafe.json":"631b03f70597ad656e8f45a393ab46bd4137459b9b499708ac3d5d9d9decd3f2","vercel-ai-gateway.json":"f0eab6fb7164524258219bb6ea26f8746b3ebd7f2686c10c62558169cd6b4277","xai.json":"59f8a7bdf14e79ba1b0d0a37e56251bbf100420bdac7d6af5942508fdb990f11","xiaomi-token-plan-ams.json":"bfd33741da693bdb8e8ebd4e7b90c3e90820aa18432ad081a5a98db13c6bd296","xiaomi-token-plan-cn.json":"4b61d78feae3a926fda918c3fd3a9afaf2ca60c1bba0af8270a5398fb50a983e","xiaomi-token-plan-sgp.json":"b05a197ce24fd69fc9440f4ba929984ac7a0fefbe8083268734b422e721987ec","xiaomi.json":"495b5fddf3c3ec8904fecc15c4c19536f4961dce7b51512b6909d2df2e739824","zai-coding-cn.json":"cc9e0768e726ef55d2b7af853ac5f3585dc72575932cb38840a3877d18736b78","zai.json":"58e6642fdfb736f0b9a4a277c760c536a3cea66a030abbfb2615f7b2851d5c6f"}}
|
package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-workers-ai.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"cloudflare-workers-ai-system-one":{"classifier:@cf/cloudflare/clef":{"type":"classifier","id":"@cf/cloudflare/clef","name":"Clef","api":"cloudflare-workers-ai-system-one","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai","input":["text"],"cost":{"input":0.24,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":65536},"classifier:@cf/cloudflare/clef-flash":{"type":"classifier","id":"@cf/cloudflare/clef-flash","name":"Clef Flash","api":"cloudflare-workers-ai-system-one","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai","input":["text"],"cost":{"input":0.09,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":65536},"classifier:typesafe/jev":{"type":"classifier","id":"typesafe/jev","name":"Jev","api":"cloudflare-workers-ai-system-one","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai","input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":32000}},"openai-completions":{"chat:@cf/deepseek-ai/deepseek-v4-flash-0731":{"id":"@cf/deepseek-ai/deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731","api":"openai-completions","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1","reasoning":true,"input":["text"],"cost":{"input":0.44,"output":1.32,"cacheRead":0.014,"cacheWrite":0},"contextWindow":1048576,"maxTokens":1048576,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsStrictMode":true,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true,"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek"},"thinkingLevelMap":{"minimal":null,"low":null,"medium":null,"high":"high","max":"max"},"type":"chat"},"chat:@cf/deepseek-ai/deepseek-v4-pro-0813":{"id":"@cf/deepseek-ai/deepseek-v4-pro-0813","name":"DeepSeek V4 Pro 0813","api":"openai-completions","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1","reasoning":true,"input":["text"],"cost":{"input":1.32,"output":3.96,"cacheRead":0.044,"cacheWrite":0},"contextWindow":1048576,"maxTokens":1048576,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsStrictMode":true,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true,"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek"},"thinkingLevelMap":{"minimal":null,"low":null,"medium":null,"high":"high","max":"max"},"type":"chat"},"chat:@cf/deepseek-ai/deepseek-v4.1-flash-1017":{"id":"@cf/deepseek-ai/deepseek-v4.1-flash-1017","name":"Deepseek V4.1 Flash 1017","api":"openai-completions","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.3,"output":1.2,"cacheRead":0.006,"cacheWrite":0},"contextWindow":1048576,"maxTokens":1048576,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsStrictMode":true,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true,"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek"},"thinkingLevelMap":{"minimal":null,"low":null,"medium":null,"high":"high","max":"max"},"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:@cf/google/gemma-4-26b-a4b-it":{"id":"@cf/google/gemma-4-26b-a4b-it","name":"Gemma 4 26B A4B IT","api":"openai-completions","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.1,"output":0.3,"cacheRead":0.05,"cacheWrite":0},"contextWindow":256000,"maxTokens":16384,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsStrictMode":true,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true},"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:@cf/ibm-granite/granite-4.0-h-micro":{"id":"@cf/ibm-granite/granite-4.0-h-micro","name":"Granite 4.0 H Micro","api":"openai-completions","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1","reasoning":false,"input":["text"],"cost":{"input":0.017,"output":0.112,"cacheRead":0,"cacheWrite":0},"contextWindow":131000,"maxTokens":131000,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsStrictMode":true,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true},"type":"chat"},"chat:@cf/meta/llama-3.3-70b-instruct-fp8-fast":{"id":"@cf/meta/llama-3.3-70b-instruct-fp8-fast","name":"Llama 3.3 70B Instruct fp8 Fast","api":"openai-completions","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1","reasoning":false,"input":["text"],"cost":{"input":0.293,"output":2.253,"cacheRead":0,"cacheWrite":0},"contextWindow":24000,"maxTokens":24000,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsStrictMode":true,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true},"type":"chat"},"chat:@cf/meta/llama-4-scout-17b-16e-instruct":{"id":"@cf/meta/llama-4-scout-17b-16e-instruct","name":"Llama 4 Scout 17B 16E Instruct","api":"openai-completions","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1","reasoning":false,"input":["text","image"],"cost":{"input":0.27,"output":0.85,"cacheRead":0,"cacheWrite":0},"contextWindow":131000,"maxTokens":16384,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsStrictMode":true,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true},"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:@cf/mistralai/mistral-small-3.1-24b-instruct":{"id":"@cf/mistralai/mistral-small-3.1-24b-instruct","name":"Mistral Small 3.1 24B Instruct","api":"openai-completions","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1","reasoning":false,"input":["text","image"],"cost":{"input":0.351,"output":0.555,"cacheRead":0,"cacheWrite":0},"contextWindow":128000,"maxTokens":128000,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsStrictMode":true,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true},"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:@cf/moonshotai/kimi-k2.6":{"id":"@cf/moonshotai/kimi-k2.6","name":"Kimi K2.6","api":"openai-completions","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.95,"output":4,"cacheRead":0.16,"cacheWrite":0},"contextWindow":262144,"maxTokens":256000,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsStrictMode":true,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true},"thinkingLevelMap":{"off":"none","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:@cf/moonshotai/kimi-k2.7-code":{"id":"@cf/moonshotai/kimi-k2.7-code","name":"Kimi K2.7 Code","api":"openai-completions","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.95,"output":4,"cacheRead":0.19,"cacheWrite":0},"contextWindow":262144,"maxTokens":262144,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsStrictMode":true,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true},"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:@cf/nvidia/nemotron-3-120b-a12b":{"id":"@cf/nvidia/nemotron-3-120b-a12b","name":"Nemotron 3 Super 120B","api":"openai-completions","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1","reasoning":true,"input":["text"],"cost":{"input":0.5,"output":1.5,"cacheRead":0,"cacheWrite":0},"contextWindow":256000,"maxTokens":256000,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsStrictMode":true,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true},"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":null},"type":"chat"},"chat:@cf/openai/gpt-oss-120b":{"id":"@cf/openai/gpt-oss-120b","name":"GPT OSS 120B","api":"openai-completions","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1","reasoning":true,"input":["text"],"cost":{"input":0.35,"output":0.75,"cacheRead":0,"cacheWrite":0},"contextWindow":128000,"maxTokens":16384,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsStrictMode":true,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true},"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null},"type":"chat"},"chat:@cf/openai/gpt-oss-20b":{"id":"@cf/openai/gpt-oss-20b","name":"GPT OSS 20B","api":"openai-completions","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1","reasoning":true,"input":["text"],"cost":{"input":0.2,"output":0.3,"cacheRead":0,"cacheWrite":0},"contextWindow":128000,"maxTokens":16384,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsStrictMode":true,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true},"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null},"type":"chat"},"chat:@cf/qwen/qwen3-30b-a3b-fp8":{"id":"@cf/qwen/qwen3-30b-a3b-fp8","name":"Qwen3 30B A3b fp8","api":"openai-completions","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1","reasoning":true,"input":["text"],"cost":{"input":0.0509,"output":0.335,"cacheRead":0,"cacheWrite":0},"contextWindow":32768,"maxTokens":32768,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsStrictMode":true,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true},"type":"chat"},"chat:@cf/qwen/qwen3.8-27b":{"id":"@cf/qwen/qwen3.8-27b","name":"Qwen3.8 27B","api":"openai-completions","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.45,"output":3.2,"cacheRead":0.05,"cacheWrite":0},"contextWindow":262144,"maxTokens":262144,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsStrictMode":true,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true},"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":null,"xhigh":"xhigh","max":null},"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:@cf/zai-org/glm-4.7-flash":{"id":"@cf/zai-org/glm-4.7-flash","name":"GLM-4.7-Flash","api":"openai-completions","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1","reasoning":true,"input":["text"],"cost":{"input":0.0605,"output":0.4,"cacheRead":0,"cacheWrite":0},"contextWindow":131072,"maxTokens":131072,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsStrictMode":true,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true},"type":"chat"},"chat:@cf/zai-org/glm-5.2":{"id":"@cf/zai-org/glm-5.2","name":"Glm 5.2","api":"openai-completions","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1","reasoning":true,"input":["text"],"cost":{"input":1.4,"output":4.4,"cacheRead":0.26,"cacheWrite":0},"contextWindow":262144,"maxTokens":256000,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsStrictMode":true,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true},"thinkingLevelMap":{"off":"none","minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":"max"},"type":"chat"},"chat:@cf/zai-org/glm-5.3":{"id":"@cf/zai-org/glm-5.3","name":"Glm 5.3","api":"openai-completions","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1","reasoning":true,"input":["text"],"cost":{"input":1.4,"output":4.4,"cacheRead":0.26,"cacheWrite":0},"contextWindow":1048576,"maxTokens":1048576,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsStrictMode":true,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true},"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"type":"chat"},"chat:@cf/zai-org/glm-5.3-flash":{"id":"@cf/zai-org/glm-5.3-flash","name":"Glm 5.3 Flash","api":"openai-completions","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.15,"output":0.5,"cacheRead":0.03,"cacheWrite":0},"contextWindow":1048576,"maxTokens":1048576,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsStrictMode":true,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true},"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"}}}
|
|
1
|
+
{"cloudflare-workers-ai-system-one":{"classifier:@cf/cloudflare/clef":{"type":"classifier","id":"@cf/cloudflare/clef","name":"Clef","api":"cloudflare-workers-ai-system-one","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai","input":["text","image"],"cost":{"input":0.24,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":65536,"compat":{"imageInput":"images"}},"classifier:@cf/cloudflare/clef-flash":{"type":"classifier","id":"@cf/cloudflare/clef-flash","name":"Clef Flash","api":"cloudflare-workers-ai-system-one","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai","input":["text","image"],"cost":{"input":0.038,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":24576,"compat":{"imageInput":"images"}},"classifier:@cf/cloudflare/clef-omni":{"type":"classifier","id":"@cf/cloudflare/clef-omni","name":"Clef Omni","api":"cloudflare-workers-ai-system-one","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai","input":["text","image"],"cost":{"input":0.15,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":64000,"compat":{"imageInput":"images"}},"classifier:typesafe/jev":{"type":"classifier","id":"typesafe/jev","name":"Jev","api":"cloudflare-workers-ai-system-one","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai","input":["text","image"],"cost":{"input":0.042,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":32000,"compat":{"imageInput":"assets"}},"classifier:typesafe/jev-1.14.0":{"type":"classifier","id":"typesafe/jev-1.14.0","name":"Jev 1.14","api":"cloudflare-workers-ai-system-one","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai","input":["text","image"],"cost":{"input":0.042,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":32000,"compat":{"imageInput":"assets"}}},"openai-completions":{"chat:@cf/deepseek-ai/deepseek-v4-flash-0731":{"id":"@cf/deepseek-ai/deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731","api":"openai-completions","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1","reasoning":true,"input":["text"],"cost":{"input":0.44,"output":1.32,"cacheRead":0.014,"cacheWrite":0},"contextWindow":1048576,"maxTokens":1048576,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsStrictMode":true,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true,"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek"},"thinkingLevelMap":{"minimal":null,"low":null,"medium":null,"high":"high","max":"max"},"type":"chat"},"chat:@cf/deepseek-ai/deepseek-v4-pro-0813":{"id":"@cf/deepseek-ai/deepseek-v4-pro-0813","name":"DeepSeek V4 Pro 0813","api":"openai-completions","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1","reasoning":true,"input":["text"],"cost":{"input":1.32,"output":3.96,"cacheRead":0.044,"cacheWrite":0},"contextWindow":1048576,"maxTokens":1048576,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsStrictMode":true,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true,"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek"},"thinkingLevelMap":{"minimal":null,"low":null,"medium":null,"high":"high","max":"max"},"type":"chat"},"chat:@cf/deepseek-ai/deepseek-v4.1-flash-1017":{"id":"@cf/deepseek-ai/deepseek-v4.1-flash-1017","name":"Deepseek V4.1 Flash 1017","api":"openai-completions","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.3,"output":1.2,"cacheRead":0.006,"cacheWrite":0},"contextWindow":1048576,"maxTokens":1048576,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsStrictMode":true,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true,"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek"},"thinkingLevelMap":{"minimal":null,"low":null,"medium":null,"high":"high","max":"max"},"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:@cf/google/gemma-4-26b-a4b-it":{"id":"@cf/google/gemma-4-26b-a4b-it","name":"Gemma 4 26B A4B IT","api":"openai-completions","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.1,"output":0.3,"cacheRead":0.05,"cacheWrite":0},"contextWindow":256000,"maxTokens":16384,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsStrictMode":true,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true},"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:@cf/ibm-granite/granite-4.0-h-micro":{"id":"@cf/ibm-granite/granite-4.0-h-micro","name":"Granite 4.0 H Micro","api":"openai-completions","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1","reasoning":false,"input":["text"],"cost":{"input":0.017,"output":0.112,"cacheRead":0,"cacheWrite":0},"contextWindow":131000,"maxTokens":131000,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsStrictMode":true,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true},"type":"chat"},"chat:@cf/meta/llama-3.3-70b-instruct-fp8-fast":{"id":"@cf/meta/llama-3.3-70b-instruct-fp8-fast","name":"Llama 3.3 70B Instruct fp8 Fast","api":"openai-completions","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1","reasoning":false,"input":["text"],"cost":{"input":0.293,"output":2.253,"cacheRead":0,"cacheWrite":0},"contextWindow":24000,"maxTokens":24000,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsStrictMode":true,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true},"type":"chat"},"chat:@cf/meta/llama-4-scout-17b-16e-instruct":{"id":"@cf/meta/llama-4-scout-17b-16e-instruct","name":"Llama 4 Scout 17B 16E Instruct","api":"openai-completions","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1","reasoning":false,"input":["text","image"],"cost":{"input":0.27,"output":0.85,"cacheRead":0,"cacheWrite":0},"contextWindow":131000,"maxTokens":16384,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsStrictMode":true,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true},"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:@cf/mistralai/mistral-small-3.1-24b-instruct":{"id":"@cf/mistralai/mistral-small-3.1-24b-instruct","name":"Mistral Small 3.1 24B Instruct","api":"openai-completions","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1","reasoning":false,"input":["text","image"],"cost":{"input":0.351,"output":0.555,"cacheRead":0,"cacheWrite":0},"contextWindow":128000,"maxTokens":128000,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsStrictMode":true,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true},"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:@cf/moonshotai/kimi-k2.6":{"id":"@cf/moonshotai/kimi-k2.6","name":"Kimi K2.6","api":"openai-completions","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.95,"output":4,"cacheRead":0.16,"cacheWrite":0},"contextWindow":262144,"maxTokens":256000,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsStrictMode":true,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true},"thinkingLevelMap":{"off":"none","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:@cf/moonshotai/kimi-k2.7-code":{"id":"@cf/moonshotai/kimi-k2.7-code","name":"Kimi K2.7 Code","api":"openai-completions","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.95,"output":4,"cacheRead":0.19,"cacheWrite":0},"contextWindow":262144,"maxTokens":262144,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsStrictMode":true,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true},"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:@cf/nvidia/nemotron-3-120b-a12b":{"id":"@cf/nvidia/nemotron-3-120b-a12b","name":"Nemotron 3 Super 120B","api":"openai-completions","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1","reasoning":true,"input":["text"],"cost":{"input":0.5,"output":1.5,"cacheRead":0,"cacheWrite":0},"contextWindow":256000,"maxTokens":256000,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsStrictMode":true,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true},"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":null},"type":"chat"},"chat:@cf/openai/gpt-oss-120b":{"id":"@cf/openai/gpt-oss-120b","name":"GPT OSS 120B","api":"openai-completions","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1","reasoning":true,"input":["text"],"cost":{"input":0.35,"output":0.75,"cacheRead":0,"cacheWrite":0},"contextWindow":128000,"maxTokens":16384,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsStrictMode":true,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true},"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null},"type":"chat"},"chat:@cf/openai/gpt-oss-20b":{"id":"@cf/openai/gpt-oss-20b","name":"GPT OSS 20B","api":"openai-completions","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1","reasoning":true,"input":["text"],"cost":{"input":0.2,"output":0.3,"cacheRead":0,"cacheWrite":0},"contextWindow":128000,"maxTokens":16384,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsStrictMode":true,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true},"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null},"type":"chat"},"chat:@cf/qwen/qwen3-30b-a3b-fp8":{"id":"@cf/qwen/qwen3-30b-a3b-fp8","name":"Qwen3 30B A3b fp8","api":"openai-completions","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1","reasoning":true,"input":["text"],"cost":{"input":0.0509,"output":0.335,"cacheRead":0,"cacheWrite":0},"contextWindow":32768,"maxTokens":32768,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsStrictMode":true,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true},"type":"chat"},"chat:@cf/qwen/qwen3.8-27b":{"id":"@cf/qwen/qwen3.8-27b","name":"Qwen3.8 27B","api":"openai-completions","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.45,"output":3.2,"cacheRead":0.05,"cacheWrite":0},"contextWindow":262144,"maxTokens":262144,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsStrictMode":true,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true},"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":null,"xhigh":"xhigh","max":null},"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:@cf/zai-org/glm-4.7-flash":{"id":"@cf/zai-org/glm-4.7-flash","name":"GLM-4.7-Flash","api":"openai-completions","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1","reasoning":true,"input":["text"],"cost":{"input":0.0605,"output":0.4,"cacheRead":0,"cacheWrite":0},"contextWindow":131072,"maxTokens":131072,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsStrictMode":true,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true},"type":"chat"},"chat:@cf/zai-org/glm-5.2":{"id":"@cf/zai-org/glm-5.2","name":"Glm 5.2","api":"openai-completions","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1","reasoning":true,"input":["text"],"cost":{"input":1.4,"output":4.4,"cacheRead":0.26,"cacheWrite":0},"contextWindow":262144,"maxTokens":256000,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsStrictMode":true,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true},"thinkingLevelMap":{"off":"none","minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":"max"},"type":"chat"},"chat:@cf/zai-org/glm-5.3":{"id":"@cf/zai-org/glm-5.3","name":"Glm 5.3","api":"openai-completions","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1","reasoning":true,"input":["text"],"cost":{"input":1.4,"output":4.4,"cacheRead":0.26,"cacheWrite":0},"contextWindow":1048576,"maxTokens":1048576,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsStrictMode":true,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true},"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"type":"chat"},"chat:@cf/zai-org/glm-5.3-flash":{"id":"@cf/zai-org/glm-5.3-flash","name":"Glm 5.3 Flash","api":"openai-completions","provider":"cloudflare-workers-ai","baseUrl":"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.15,"output":0.5,"cacheRead":0.03,"cacheWrite":0},"contextWindow":1048576,"maxTokens":1048576,"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsStrictMode":true,"supportsLongCacheRetention":false,"sendSessionAffinityHeaders":true},"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"}}}
|