@entelligentsia/forgecli 1.1.0 → 1.1.3
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 +26 -0
- package/README.md +4 -0
- package/dist/CHANGELOG-forge-plugin.md +114 -0
- package/dist/CHANGELOG-pi.md +56 -0
- package/dist/extensions/forgecli/forge-subagent.js +58 -0
- package/dist/extensions/forgecli/forge-subagent.js.map +1 -1
- package/dist/extensions/forgecli/mcp-bridge/grove.d.ts +38 -0
- package/dist/extensions/forgecli/mcp-bridge/grove.js +88 -2
- package/dist/extensions/forgecli/mcp-bridge/grove.js.map +1 -1
- package/dist/extensions/forgecli/mcp-bridge/json-rpc-stdio.d.ts +26 -2
- package/dist/extensions/forgecli/mcp-bridge/json-rpc-stdio.js +68 -13
- package/dist/extensions/forgecli/mcp-bridge/json-rpc-stdio.js.map +1 -1
- package/dist/extensions/forgecli/mcp-bridge/mcp-bridge.js +13 -2
- package/dist/extensions/forgecli/mcp-bridge/mcp-bridge.js.map +1 -1
- package/dist/extensions/forgecli/mcp-bridge/mcp-session.d.ts +3 -3
- package/dist/extensions/forgecli/mcp-bridge/mcp-session.js +3 -6
- package/dist/extensions/forgecli/mcp-bridge/mcp-session.js.map +1 -1
- package/dist/extensions/forgecli/orchestrators/init/init-phase-dispatch.d.ts +49 -40
- package/dist/extensions/forgecli/orchestrators/init/init-phase-dispatch.js +59 -188
- package/dist/extensions/forgecli/orchestrators/init/init-phase-dispatch.js.map +1 -1
- package/dist/extensions/forgecli/orchestrators/init/init-phases.d.ts +0 -43
- package/dist/extensions/forgecli/orchestrators/init/init-phases.js +11 -59
- package/dist/extensions/forgecli/orchestrators/init/init-phases.js.map +1 -1
- package/dist/extensions/forgecli/orchestrators/init/init-steps.d.ts +115 -0
- package/dist/extensions/forgecli/orchestrators/init/init-steps.js +125 -0
- package/dist/extensions/forgecli/orchestrators/init/init-steps.js.map +1 -0
- package/dist/extensions/forgecli/orchestrators/init/run-init-pipeline.js +400 -211
- package/dist/extensions/forgecli/orchestrators/init/run-init-pipeline.js.map +1 -1
- package/dist/extensions/forgecli/orchestrators/init/run-init-types.d.ts +8 -2
- package/dist/extensions/forgecli/orchestrators/init/run-init-types.js +15 -5
- package/dist/extensions/forgecli/orchestrators/init/run-init-types.js.map +1 -1
- package/dist/forge-payload/.base-pack/workflows-js/wfl-init.js +99 -38
- package/dist/forge-payload/.claude-plugin/plugin.json +1 -1
- package/dist/forge-payload/.init/generation/generate-kb-doc.md +24 -0
- package/dist/forge-payload/.schemas/migrations.json +77 -0
- package/dist/forge-payload/init/generation/generate-kb-doc.md +24 -0
- package/dist/forge-payload/init/phases/phase-2/context.md +23 -0
- package/dist/forge-payload/init/phases/phase-2/database.md +26 -0
- package/dist/forge-payload/init/phases/phase-2/deployment.md +26 -0
- package/dist/forge-payload/init/phases/phase-2/domain-concepts.md +26 -0
- package/dist/forge-payload/init/phases/phase-2/domain-model.md +26 -0
- package/dist/forge-payload/init/phases/phase-2/entity-model.md +26 -0
- package/dist/forge-payload/init/phases/phase-2/index.md +25 -0
- package/dist/forge-payload/init/phases/phase-2/processes.md +26 -0
- package/dist/forge-payload/init/phases/phase-2/routing.md +25 -0
- package/dist/forge-payload/init/phases/phase-2/stack-checklist.md +25 -0
- package/dist/forge-payload/init/phases/phase-2/stack.md +27 -0
- package/dist/forge-payload/init/phases/phase-2/testing.md +26 -0
- package/dist/forge-payload/init/phases/phase-2-discover.md +15 -9
- package/dist/forge-payload/payload-manifest.json +2 -2
- package/dist/forge-payload/tools/seed-store.cjs +14 -0
- package/dist/forge-payload/tools/verify-phase.cjs +61 -4
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts +3 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.js +10 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js +4 -6
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.js +20 -2
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js +2 -14
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js +16 -5
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +61 -41
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +8 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +2 -14
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openrouter-images.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openrouter-images.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openrouter-images.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.d.ts +15 -45
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js +15 -45
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts +461 -22
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.models.d.ts +140 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.models.js +141 -4
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.models.d.ts +20 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.models.js +18 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cerebras.models.d.ts +21 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cerebras.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cerebras.models.js +18 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cerebras.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.models.d.ts +21 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.models.js +18 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/fireworks.models.d.ts +10 -5
- package/node_modules/@earendil-works/pi-ai/dist/providers/fireworks.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/fireworks.models.js +4 -3
- package/node_modules/@earendil-works/pi-ai/dist/providers/fireworks.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot.models.d.ts +82 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot.models.js +57 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/groq.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/groq.models.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/groq.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.models.d.ts +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.models.js +4 -4
- package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/nvidia.models.d.ts +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/nvidia.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/nvidia.models.js +4 -4
- package/node_modules/@earendil-works/pi-ai/dist/providers/nvidia.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.models.js +5 -5
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.models.d.ts +88 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.models.js +75 -2
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.d.ts +33 -15
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.js +101 -84
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/together.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/together.models.js +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/providers/together.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.models.d.ts +44 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.models.js +41 -4
- package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-ams.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-ams.models.js +12 -12
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-ams.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-cn.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-cn.models.js +12 -12
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-cn.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-sgp.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-sgp.models.js +12 -12
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-sgp.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi.models.js +15 -15
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.d.ts +25 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.js +109 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/device-code.d.ts +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/device-code.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/device-code.js +15 -2
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/device-code.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.js +3 -2
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.d.ts +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/CHANGELOG.md +56 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.d.ts +6 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js +39 -15
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js +13 -5
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.js +5 -8
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/index.d.ts +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/loader.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/loader.js +6 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/loader.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.d.ts +2 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.js +33 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.d.ts +16 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/http-dispatcher.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/http-dispatcher.js +28 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/http-dispatcher.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.d.ts +10 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.js +14 -17
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-attribution.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-attribution.js +0 -10
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-attribution.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-manager.d.ts +20 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-manager.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-manager.js +87 -68
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-manager.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.d.ts +3 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.js +8 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.js +20 -5
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.js +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/index.d.ts +3 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/index.js +2 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/assistant-message.d.ts +3 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/assistant-message.js +15 -7
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-entry.d.ts +19 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-entry.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-entry.js +52 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-entry.js.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.js +13 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/status-indicator.d.ts +28 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/status-indicator.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/status-indicator.js +60 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/status-indicator.js.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/user-message.d.ts +6 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/user-message.js +18 -5
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/user-message.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +10 -10
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js +143 -130
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-client.d.ts +15 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-client.js +14 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-client.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.js +16 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-types.d.ts +26 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-types.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js +7 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/docs/extensions.md +55 -8
- package/node_modules/@earendil-works/pi-coding-agent/docs/rpc.md +58 -0
- package/node_modules/@earendil-works/pi-coding-agent/docs/sdk.md +28 -0
- package/node_modules/@earendil-works/pi-coding-agent/docs/session-format.md +18 -8
- package/node_modules/@earendil-works/pi-coding-agent/docs/settings.md +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/README.md +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/entry-renderer.ts +41 -0
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/gondolin/package-lock.json +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/gondolin/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/question.ts +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/sandbox/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/with-deps/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/npm-shrinkwrap.json +12 -12
- package/node_modules/@earendil-works/pi-coding-agent/package.json +4 -4
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/package.json +7 -7
package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-ams.models.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xiaomi-token-plan-ams.models.d.ts","sourceRoot":"","sources":["../../src/providers/xiaomi-token-plan-ams.models.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2F/B,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport type { Model } from \"../types.ts\";\n\nexport const XIAOMI_TOKEN_PLAN_AMS_MODELS = {\n\t\"mimo-v2-omni\": {\n\t\tid: \"mimo-v2-omni\",\n\t\tname: \"MiMo-V2-Omni\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi-token-plan-ams\",\n\t\tbaseUrl: \"https://token-plan-ams.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\", \"image\"],\n\t\tcost: {\n\t\t\tinput: 0.
|
|
1
|
+
{"version":3,"file":"xiaomi-token-plan-ams.models.d.ts","sourceRoot":"","sources":["../../src/providers/xiaomi-token-plan-ams.models.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2F/B,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport type { Model } from \"../types.ts\";\n\nexport const XIAOMI_TOKEN_PLAN_AMS_MODELS = {\n\t\"mimo-v2-omni\": {\n\t\tid: \"mimo-v2-omni\",\n\t\tname: \"MiMo-V2-Omni\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi-token-plan-ams\",\n\t\tbaseUrl: \"https://token-plan-ams.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\", \"image\"],\n\t\tcost: {\n\t\t\tinput: 0.14,\n\t\t\toutput: 0.28,\n\t\t\tcacheRead: 0.0028,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 262144,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n\t\"mimo-v2-pro\": {\n\t\tid: \"mimo-v2-pro\",\n\t\tname: \"MiMo-V2-Pro\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi-token-plan-ams\",\n\t\tbaseUrl: \"https://token-plan-ams.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\"],\n\t\tcost: {\n\t\t\tinput: 0.435,\n\t\t\toutput: 0.87,\n\t\t\tcacheRead: 0.0036,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 1048576,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n\t\"mimo-v2.5\": {\n\t\tid: \"mimo-v2.5\",\n\t\tname: \"MiMo-V2.5\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi-token-plan-ams\",\n\t\tbaseUrl: \"https://token-plan-ams.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\", \"image\"],\n\t\tcost: {\n\t\t\tinput: 0.14,\n\t\t\toutput: 0.28,\n\t\t\tcacheRead: 0.0028,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 1048576,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n\t\"mimo-v2.5-pro\": {\n\t\tid: \"mimo-v2.5-pro\",\n\t\tname: \"MiMo-V2.5-Pro\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi-token-plan-ams\",\n\t\tbaseUrl: \"https://token-plan-ams.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\"],\n\t\tcost: {\n\t\t\tinput: 0.435,\n\t\t\toutput: 0.87,\n\t\t\tcacheRead: 0.0036,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 1048576,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n\t\"mimo-v2.5-pro-ultraspeed\": {\n\t\tid: \"mimo-v2.5-pro-ultraspeed\",\n\t\tname: \"MiMo-V2.5-Pro-UltraSpeed\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi-token-plan-ams\",\n\t\tbaseUrl: \"https://token-plan-ams.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\"],\n\t\tcost: {\n\t\t\tinput: 1.305,\n\t\t\toutput: 2.61,\n\t\t\tcacheRead: 0.0108,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 1048576,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n} as const;\n"]}
|
|
@@ -11,9 +11,9 @@ export const XIAOMI_TOKEN_PLAN_AMS_MODELS = {
|
|
|
11
11
|
reasoning: true,
|
|
12
12
|
input: ["text", "image"],
|
|
13
13
|
cost: {
|
|
14
|
-
input: 0.
|
|
15
|
-
output:
|
|
16
|
-
cacheRead: 0.
|
|
14
|
+
input: 0.14,
|
|
15
|
+
output: 0.28,
|
|
16
|
+
cacheRead: 0.0028,
|
|
17
17
|
cacheWrite: 0,
|
|
18
18
|
},
|
|
19
19
|
contextWindow: 262144,
|
|
@@ -29,9 +29,9 @@ export const XIAOMI_TOKEN_PLAN_AMS_MODELS = {
|
|
|
29
29
|
reasoning: true,
|
|
30
30
|
input: ["text"],
|
|
31
31
|
cost: {
|
|
32
|
-
input:
|
|
33
|
-
output:
|
|
34
|
-
cacheRead: 0.
|
|
32
|
+
input: 0.435,
|
|
33
|
+
output: 0.87,
|
|
34
|
+
cacheRead: 0.0036,
|
|
35
35
|
cacheWrite: 0,
|
|
36
36
|
},
|
|
37
37
|
contextWindow: 1048576,
|
|
@@ -47,9 +47,9 @@ export const XIAOMI_TOKEN_PLAN_AMS_MODELS = {
|
|
|
47
47
|
reasoning: true,
|
|
48
48
|
input: ["text", "image"],
|
|
49
49
|
cost: {
|
|
50
|
-
input: 0.
|
|
51
|
-
output:
|
|
52
|
-
cacheRead: 0.
|
|
50
|
+
input: 0.14,
|
|
51
|
+
output: 0.28,
|
|
52
|
+
cacheRead: 0.0028,
|
|
53
53
|
cacheWrite: 0,
|
|
54
54
|
},
|
|
55
55
|
contextWindow: 1048576,
|
|
@@ -65,9 +65,9 @@ export const XIAOMI_TOKEN_PLAN_AMS_MODELS = {
|
|
|
65
65
|
reasoning: true,
|
|
66
66
|
input: ["text"],
|
|
67
67
|
cost: {
|
|
68
|
-
input:
|
|
69
|
-
output:
|
|
70
|
-
cacheRead: 0.
|
|
68
|
+
input: 0.435,
|
|
69
|
+
output: 0.87,
|
|
70
|
+
cacheRead: 0.0036,
|
|
71
71
|
cacheWrite: 0,
|
|
72
72
|
},
|
|
73
73
|
contextWindow: 1048576,
|
package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-ams.models.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xiaomi-token-plan-ams.models.js","sourceRoot":"","sources":["../../src/providers/xiaomi-token-plan-ams.models.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,iEAAiE;AAIjE,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC3C,cAAc,EAAE;QACf,EAAE,EAAE,cAAc;QAClB,IAAI,EAAE,cAAc;QACpB,GAAG,EAAE,oBAAoB;QACzB,QAAQ,EAAE,uBAAuB;QACjC,OAAO,EAAE,0CAA0C;QACnD,MAAM,EAAE,EAAC,6CAA6C,EAAC,IAAI,EAAC,gBAAgB,EAAC,UAAU,EAAC;QACxF,SAAS,EAAE,IAAI;QACf,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;QACxB,IAAI,EAAE;YACL,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"xiaomi-token-plan-ams.models.js","sourceRoot":"","sources":["../../src/providers/xiaomi-token-plan-ams.models.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,iEAAiE;AAIjE,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC3C,cAAc,EAAE;QACf,EAAE,EAAE,cAAc;QAClB,IAAI,EAAE,cAAc;QACpB,GAAG,EAAE,oBAAoB;QACzB,QAAQ,EAAE,uBAAuB;QACjC,OAAO,EAAE,0CAA0C;QACnD,MAAM,EAAE,EAAC,6CAA6C,EAAC,IAAI,EAAC,gBAAgB,EAAC,UAAU,EAAC;QACxF,SAAS,EAAE,IAAI;QACf,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;QACxB,IAAI,EAAE;YACL,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,IAAI;YACZ,SAAS,EAAE,MAAM;YACjB,UAAU,EAAE,CAAC;SACb;QACD,aAAa,EAAE,MAAM;QACrB,SAAS,EAAE,MAAM;KACqB;IACvC,aAAa,EAAE;QACd,EAAE,EAAE,aAAa;QACjB,IAAI,EAAE,aAAa;QACnB,GAAG,EAAE,oBAAoB;QACzB,QAAQ,EAAE,uBAAuB;QACjC,OAAO,EAAE,0CAA0C;QACnD,MAAM,EAAE,EAAC,6CAA6C,E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0B;QAC9B,IAAI,EAAE,0BAA0B;QAChC,GAAG,EAAE,oBAAoB;QACzB,QAAQ,EAAE,uBAAuB;QACjC,OAAO,EAAE,0CAA0C;QACnD,MAAM,EAAE,EAAC,6CAA6C,EAAC,IAAI,EAAC,gBAAgB,EAAC,UAAU,EAAC;QACxF,SAAS,EAAE,IAAI;QACf,KAAK,EAAE,CAAC,MAAM,CAAC;QACf,IAAI,EAAE;YACL,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,IAAI;YACZ,SAAS,EAAE,MAAM;YACjB,UAAU,EAAE,CAAC;SACb;QACD,aAAa,EAAE,OAAO;QACtB,SAAS,EAAE,MAAM;KACqB;CAC9B,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport type { Model } from \"../types.ts\";\n\nexport const XIAOMI_TOKEN_PLAN_AMS_MODELS = {\n\t\"mimo-v2-omni\": {\n\t\tid: \"mimo-v2-omni\",\n\t\tname: \"MiMo-V2-Omni\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi-token-plan-ams\",\n\t\tbaseUrl: \"https://token-plan-ams.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\", \"image\"],\n\t\tcost: {\n\t\t\tinput: 0.14,\n\t\t\toutput: 0.28,\n\t\t\tcacheRead: 0.0028,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 262144,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n\t\"mimo-v2-pro\": {\n\t\tid: \"mimo-v2-pro\",\n\t\tname: \"MiMo-V2-Pro\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi-token-plan-ams\",\n\t\tbaseUrl: \"https://token-plan-ams.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\"],\n\t\tcost: {\n\t\t\tinput: 0.435,\n\t\t\toutput: 0.87,\n\t\t\tcacheRead: 0.0036,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 1048576,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n\t\"mimo-v2.5\": {\n\t\tid: \"mimo-v2.5\",\n\t\tname: \"MiMo-V2.5\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi-token-plan-ams\",\n\t\tbaseUrl: \"https://token-plan-ams.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\", \"image\"],\n\t\tcost: {\n\t\t\tinput: 0.14,\n\t\t\toutput: 0.28,\n\t\t\tcacheRead: 0.0028,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 1048576,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n\t\"mimo-v2.5-pro\": {\n\t\tid: \"mimo-v2.5-pro\",\n\t\tname: \"MiMo-V2.5-Pro\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi-token-plan-ams\",\n\t\tbaseUrl: \"https://token-plan-ams.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\"],\n\t\tcost: {\n\t\t\tinput: 0.435,\n\t\t\toutput: 0.87,\n\t\t\tcacheRead: 0.0036,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 1048576,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n\t\"mimo-v2.5-pro-ultraspeed\": {\n\t\tid: \"mimo-v2.5-pro-ultraspeed\",\n\t\tname: \"MiMo-V2.5-Pro-UltraSpeed\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi-token-plan-ams\",\n\t\tbaseUrl: \"https://token-plan-ams.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\"],\n\t\tcost: {\n\t\t\tinput: 1.305,\n\t\t\toutput: 2.61,\n\t\t\tcacheRead: 0.0108,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 1048576,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n} as const;\n"]}
|
package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-cn.models.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xiaomi-token-plan-cn.models.d.ts","sourceRoot":"","sources":["../../src/providers/xiaomi-token-plan-cn.models.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2F9B,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport type { Model } from \"../types.ts\";\n\nexport const XIAOMI_TOKEN_PLAN_CN_MODELS = {\n\t\"mimo-v2-omni\": {\n\t\tid: \"mimo-v2-omni\",\n\t\tname: \"MiMo-V2-Omni\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi-token-plan-cn\",\n\t\tbaseUrl: \"https://token-plan-cn.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\", \"image\"],\n\t\tcost: {\n\t\t\tinput: 0.
|
|
1
|
+
{"version":3,"file":"xiaomi-token-plan-cn.models.d.ts","sourceRoot":"","sources":["../../src/providers/xiaomi-token-plan-cn.models.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2F9B,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport type { Model } from \"../types.ts\";\n\nexport const XIAOMI_TOKEN_PLAN_CN_MODELS = {\n\t\"mimo-v2-omni\": {\n\t\tid: \"mimo-v2-omni\",\n\t\tname: \"MiMo-V2-Omni\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi-token-plan-cn\",\n\t\tbaseUrl: \"https://token-plan-cn.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\", \"image\"],\n\t\tcost: {\n\t\t\tinput: 0.14,\n\t\t\toutput: 0.28,\n\t\t\tcacheRead: 0.0028,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 262144,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n\t\"mimo-v2-pro\": {\n\t\tid: \"mimo-v2-pro\",\n\t\tname: \"MiMo-V2-Pro\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi-token-plan-cn\",\n\t\tbaseUrl: \"https://token-plan-cn.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\"],\n\t\tcost: {\n\t\t\tinput: 0.435,\n\t\t\toutput: 0.87,\n\t\t\tcacheRead: 0.0036,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 1048576,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n\t\"mimo-v2.5\": {\n\t\tid: \"mimo-v2.5\",\n\t\tname: \"MiMo-V2.5\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi-token-plan-cn\",\n\t\tbaseUrl: \"https://token-plan-cn.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\", \"image\"],\n\t\tcost: {\n\t\t\tinput: 0.14,\n\t\t\toutput: 0.28,\n\t\t\tcacheRead: 0.0028,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 1048576,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n\t\"mimo-v2.5-pro\": {\n\t\tid: \"mimo-v2.5-pro\",\n\t\tname: \"MiMo-V2.5-Pro\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi-token-plan-cn\",\n\t\tbaseUrl: \"https://token-plan-cn.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\"],\n\t\tcost: {\n\t\t\tinput: 0.435,\n\t\t\toutput: 0.87,\n\t\t\tcacheRead: 0.0036,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 1048576,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n\t\"mimo-v2.5-pro-ultraspeed\": {\n\t\tid: \"mimo-v2.5-pro-ultraspeed\",\n\t\tname: \"MiMo-V2.5-Pro-UltraSpeed\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi-token-plan-cn\",\n\t\tbaseUrl: \"https://token-plan-cn.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\"],\n\t\tcost: {\n\t\t\tinput: 1.305,\n\t\t\toutput: 2.61,\n\t\t\tcacheRead: 0.0108,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 1048576,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n} as const;\n"]}
|
|
@@ -11,9 +11,9 @@ export const XIAOMI_TOKEN_PLAN_CN_MODELS = {
|
|
|
11
11
|
reasoning: true,
|
|
12
12
|
input: ["text", "image"],
|
|
13
13
|
cost: {
|
|
14
|
-
input: 0.
|
|
15
|
-
output:
|
|
16
|
-
cacheRead: 0.
|
|
14
|
+
input: 0.14,
|
|
15
|
+
output: 0.28,
|
|
16
|
+
cacheRead: 0.0028,
|
|
17
17
|
cacheWrite: 0,
|
|
18
18
|
},
|
|
19
19
|
contextWindow: 262144,
|
|
@@ -29,9 +29,9 @@ export const XIAOMI_TOKEN_PLAN_CN_MODELS = {
|
|
|
29
29
|
reasoning: true,
|
|
30
30
|
input: ["text"],
|
|
31
31
|
cost: {
|
|
32
|
-
input:
|
|
33
|
-
output:
|
|
34
|
-
cacheRead: 0.
|
|
32
|
+
input: 0.435,
|
|
33
|
+
output: 0.87,
|
|
34
|
+
cacheRead: 0.0036,
|
|
35
35
|
cacheWrite: 0,
|
|
36
36
|
},
|
|
37
37
|
contextWindow: 1048576,
|
|
@@ -47,9 +47,9 @@ export const XIAOMI_TOKEN_PLAN_CN_MODELS = {
|
|
|
47
47
|
reasoning: true,
|
|
48
48
|
input: ["text", "image"],
|
|
49
49
|
cost: {
|
|
50
|
-
input: 0.
|
|
51
|
-
output:
|
|
52
|
-
cacheRead: 0.
|
|
50
|
+
input: 0.14,
|
|
51
|
+
output: 0.28,
|
|
52
|
+
cacheRead: 0.0028,
|
|
53
53
|
cacheWrite: 0,
|
|
54
54
|
},
|
|
55
55
|
contextWindow: 1048576,
|
|
@@ -65,9 +65,9 @@ export const XIAOMI_TOKEN_PLAN_CN_MODELS = {
|
|
|
65
65
|
reasoning: true,
|
|
66
66
|
input: ["text"],
|
|
67
67
|
cost: {
|
|
68
|
-
input:
|
|
69
|
-
output:
|
|
70
|
-
cacheRead: 0.
|
|
68
|
+
input: 0.435,
|
|
69
|
+
output: 0.87,
|
|
70
|
+
cacheRead: 0.0036,
|
|
71
71
|
cacheWrite: 0,
|
|
72
72
|
},
|
|
73
73
|
contextWindow: 1048576,
|
package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-cn.models.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xiaomi-token-plan-cn.models.js","sourceRoot":"","sources":["../../src/providers/xiaomi-token-plan-cn.models.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,iEAAiE;AAIjE,MAAM,CAAC,MAAM,2BAA2B,GAAG;IAC1C,cAAc,EAAE;QACf,EAAE,EAAE,cAAc;QAClB,IAAI,EAAE,cAAc;QACpB,GAAG,EAAE,oBAAoB;QACzB,QAAQ,EAAE,sBAAsB;QAChC,OAAO,EAAE,yCAAyC;QAClD,MAAM,EAAE,EAAC,6CAA6C,EAAC,IAAI,EAAC,gBAAgB,EAAC,UAAU,EAAC;QACxF,SAAS,EAAE,IAAI;QACf,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;QACxB,IAAI,EAAE;YACL,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"xiaomi-token-plan-cn.models.js","sourceRoot":"","sources":["../../src/providers/xiaomi-token-plan-cn.models.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,iEAAiE;AAIjE,MAAM,CAAC,MAAM,2BAA2B,GAAG;IAC1C,cAAc,EAAE;QACf,EAAE,EAAE,cAAc;QAClB,IAAI,EAAE,cAAc;QACpB,GAAG,EAAE,oBAAoB;QACzB,QAAQ,EAAE,sBAAsB;QAChC,OAAO,EAAE,yCAAyC;QAClD,MAAM,EAAE,EAAC,6CAA6C,EAAC,IAA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QACnB,IAAI,EAAE,eAAe;QACrB,GAAG,EAAE,oBAAoB;QACzB,QAAQ,EAAE,sBAAsB;QAChC,OAAO,EAAE,yCAAyC;QAClD,MAAM,EAAE,EAAC,6CAA6C,EAAC,IAAI,EAAC,gBAAgB,EAAC,UAAU,EAAC;QACxF,SAAS,EAAE,IAAI;QACf,KAAK,EAAE,CAAC,MAAM,CAAC;QACf,IAAI,EAAE;YACL,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,IAAI;YACZ,SAAS,EAAE,MAAM;YACjB,UAAU,EAAE,CAAC;SACb;QACD,aAAa,EAAE,OAAO;QACtB,SAAS,EAAE,MAAM;KACqB;IACvC,0BAA0B,EAAE;QAC3B,EAAE,EAAE,0BAA0B;QAC9B,IAAI,EAAE,0BAA0B;QAChC,GAAG,EAAE,oBAAoB;QACzB,QAAQ,EAAE,sBAAsB;QAChC,OAAO,EAAE,yCAAyC;QAClD,MAAM,EAAE,EAAC,6CAA6C,EAAC,IAAI,EAAC,gBAAgB,EAAC,UAAU,EAAC;QACxF,SAAS,EAAE,IAAI;QACf,KAAK,EAAE,CAAC,MAAM,CAAC;QACf,IAAI,EAAE;YACL,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,IAAI;YACZ,SAAS,EAAE,MAAM;YACjB,UAAU,EAAE,CAAC;SACb;QACD,aAAa,EAAE,OAAO;QACtB,SAAS,EAAE,MAAM;KACqB;CAC9B,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport type { Model } from \"../types.ts\";\n\nexport const XIAOMI_TOKEN_PLAN_CN_MODELS = {\n\t\"mimo-v2-omni\": {\n\t\tid: \"mimo-v2-omni\",\n\t\tname: \"MiMo-V2-Omni\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi-token-plan-cn\",\n\t\tbaseUrl: \"https://token-plan-cn.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\", \"image\"],\n\t\tcost: {\n\t\t\tinput: 0.14,\n\t\t\toutput: 0.28,\n\t\t\tcacheRead: 0.0028,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 262144,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n\t\"mimo-v2-pro\": {\n\t\tid: \"mimo-v2-pro\",\n\t\tname: \"MiMo-V2-Pro\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi-token-plan-cn\",\n\t\tbaseUrl: \"https://token-plan-cn.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\"],\n\t\tcost: {\n\t\t\tinput: 0.435,\n\t\t\toutput: 0.87,\n\t\t\tcacheRead: 0.0036,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 1048576,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n\t\"mimo-v2.5\": {\n\t\tid: \"mimo-v2.5\",\n\t\tname: \"MiMo-V2.5\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi-token-plan-cn\",\n\t\tbaseUrl: \"https://token-plan-cn.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\", \"image\"],\n\t\tcost: {\n\t\t\tinput: 0.14,\n\t\t\toutput: 0.28,\n\t\t\tcacheRead: 0.0028,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 1048576,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n\t\"mimo-v2.5-pro\": {\n\t\tid: \"mimo-v2.5-pro\",\n\t\tname: \"MiMo-V2.5-Pro\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi-token-plan-cn\",\n\t\tbaseUrl: \"https://token-plan-cn.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\"],\n\t\tcost: {\n\t\t\tinput: 0.435,\n\t\t\toutput: 0.87,\n\t\t\tcacheRead: 0.0036,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 1048576,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n\t\"mimo-v2.5-pro-ultraspeed\": {\n\t\tid: \"mimo-v2.5-pro-ultraspeed\",\n\t\tname: \"MiMo-V2.5-Pro-UltraSpeed\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi-token-plan-cn\",\n\t\tbaseUrl: \"https://token-plan-cn.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\"],\n\t\tcost: {\n\t\t\tinput: 1.305,\n\t\t\toutput: 2.61,\n\t\t\tcacheRead: 0.0108,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 1048576,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n} as const;\n"]}
|
package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-sgp.models.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xiaomi-token-plan-sgp.models.d.ts","sourceRoot":"","sources":["../../src/providers/xiaomi-token-plan-sgp.models.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2F/B,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport type { Model } from \"../types.ts\";\n\nexport const XIAOMI_TOKEN_PLAN_SGP_MODELS = {\n\t\"mimo-v2-omni\": {\n\t\tid: \"mimo-v2-omni\",\n\t\tname: \"MiMo-V2-Omni\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi-token-plan-sgp\",\n\t\tbaseUrl: \"https://token-plan-sgp.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\", \"image\"],\n\t\tcost: {\n\t\t\tinput: 0.
|
|
1
|
+
{"version":3,"file":"xiaomi-token-plan-sgp.models.d.ts","sourceRoot":"","sources":["../../src/providers/xiaomi-token-plan-sgp.models.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2F/B,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport type { Model } from \"../types.ts\";\n\nexport const XIAOMI_TOKEN_PLAN_SGP_MODELS = {\n\t\"mimo-v2-omni\": {\n\t\tid: \"mimo-v2-omni\",\n\t\tname: \"MiMo-V2-Omni\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi-token-plan-sgp\",\n\t\tbaseUrl: \"https://token-plan-sgp.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\", \"image\"],\n\t\tcost: {\n\t\t\tinput: 0.14,\n\t\t\toutput: 0.28,\n\t\t\tcacheRead: 0.0028,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 262144,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n\t\"mimo-v2-pro\": {\n\t\tid: \"mimo-v2-pro\",\n\t\tname: \"MiMo-V2-Pro\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi-token-plan-sgp\",\n\t\tbaseUrl: \"https://token-plan-sgp.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\"],\n\t\tcost: {\n\t\t\tinput: 0.435,\n\t\t\toutput: 0.87,\n\t\t\tcacheRead: 0.0036,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 1048576,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n\t\"mimo-v2.5\": {\n\t\tid: \"mimo-v2.5\",\n\t\tname: \"MiMo-V2.5\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi-token-plan-sgp\",\n\t\tbaseUrl: \"https://token-plan-sgp.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\", \"image\"],\n\t\tcost: {\n\t\t\tinput: 0.14,\n\t\t\toutput: 0.28,\n\t\t\tcacheRead: 0.0028,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 1048576,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n\t\"mimo-v2.5-pro\": {\n\t\tid: \"mimo-v2.5-pro\",\n\t\tname: \"MiMo-V2.5-Pro\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi-token-plan-sgp\",\n\t\tbaseUrl: \"https://token-plan-sgp.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\"],\n\t\tcost: {\n\t\t\tinput: 0.435,\n\t\t\toutput: 0.87,\n\t\t\tcacheRead: 0.0036,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 1048576,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n\t\"mimo-v2.5-pro-ultraspeed\": {\n\t\tid: \"mimo-v2.5-pro-ultraspeed\",\n\t\tname: \"MiMo-V2.5-Pro-UltraSpeed\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi-token-plan-sgp\",\n\t\tbaseUrl: \"https://token-plan-sgp.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\"],\n\t\tcost: {\n\t\t\tinput: 1.305,\n\t\t\toutput: 2.61,\n\t\t\tcacheRead: 0.0108,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 1048576,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n} as const;\n"]}
|
|
@@ -11,9 +11,9 @@ export const XIAOMI_TOKEN_PLAN_SGP_MODELS = {
|
|
|
11
11
|
reasoning: true,
|
|
12
12
|
input: ["text", "image"],
|
|
13
13
|
cost: {
|
|
14
|
-
input: 0.
|
|
15
|
-
output:
|
|
16
|
-
cacheRead: 0.
|
|
14
|
+
input: 0.14,
|
|
15
|
+
output: 0.28,
|
|
16
|
+
cacheRead: 0.0028,
|
|
17
17
|
cacheWrite: 0,
|
|
18
18
|
},
|
|
19
19
|
contextWindow: 262144,
|
|
@@ -29,9 +29,9 @@ export const XIAOMI_TOKEN_PLAN_SGP_MODELS = {
|
|
|
29
29
|
reasoning: true,
|
|
30
30
|
input: ["text"],
|
|
31
31
|
cost: {
|
|
32
|
-
input:
|
|
33
|
-
output:
|
|
34
|
-
cacheRead: 0.
|
|
32
|
+
input: 0.435,
|
|
33
|
+
output: 0.87,
|
|
34
|
+
cacheRead: 0.0036,
|
|
35
35
|
cacheWrite: 0,
|
|
36
36
|
},
|
|
37
37
|
contextWindow: 1048576,
|
|
@@ -47,9 +47,9 @@ export const XIAOMI_TOKEN_PLAN_SGP_MODELS = {
|
|
|
47
47
|
reasoning: true,
|
|
48
48
|
input: ["text", "image"],
|
|
49
49
|
cost: {
|
|
50
|
-
input: 0.
|
|
51
|
-
output:
|
|
52
|
-
cacheRead: 0.
|
|
50
|
+
input: 0.14,
|
|
51
|
+
output: 0.28,
|
|
52
|
+
cacheRead: 0.0028,
|
|
53
53
|
cacheWrite: 0,
|
|
54
54
|
},
|
|
55
55
|
contextWindow: 1048576,
|
|
@@ -65,9 +65,9 @@ export const XIAOMI_TOKEN_PLAN_SGP_MODELS = {
|
|
|
65
65
|
reasoning: true,
|
|
66
66
|
input: ["text"],
|
|
67
67
|
cost: {
|
|
68
|
-
input:
|
|
69
|
-
output:
|
|
70
|
-
cacheRead: 0.
|
|
68
|
+
input: 0.435,
|
|
69
|
+
output: 0.87,
|
|
70
|
+
cacheRead: 0.0036,
|
|
71
71
|
cacheWrite: 0,
|
|
72
72
|
},
|
|
73
73
|
contextWindow: 1048576,
|
package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-sgp.models.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xiaomi-token-plan-sgp.models.js","sourceRoot":"","sources":["../../src/providers/xiaomi-token-plan-sgp.models.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,iEAAiE;AAIjE,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC3C,cAAc,EAAE;QACf,EAAE,EAAE,cAAc;QAClB,IAAI,EAAE,cAAc;QACpB,GAAG,EAAE,oBAAoB;QACzB,QAAQ,EAAE,uBAAuB;QACjC,OAAO,EAAE,0CAA0C;QACnD,MAAM,EAAE,EAAC,6CAA6C,EAAC,IAAI,EAAC,gBAAgB,EAAC,UAAU,EAAC;QACxF,SAAS,EAAE,IAAI;QACf,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;QACxB,IAAI,EAAE;YACL,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"xiaomi-token-plan-sgp.models.js","sourceRoot":"","sources":["../../src/providers/xiaomi-token-plan-sgp.models.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,iEAAiE;AAIjE,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC3C,cAAc,EAAE;QACf,EAAE,EAAE,cAAc;QAClB,IAAI,EAAE,cAAc;QACpB,GAAG,EAAE,oBAAoB;QACzB,QAAQ,EAAE,uBAAuB;QACjC,OAAO,EAAE,0CAA0C;QACnD,MAAM,EAAE,EAAC,6CAA6C,EAAC,IAAI,EAAC,gBAAgB,EAAC,UAAU,EAAC;QACxF,SAAS,EAAE,IAAI;QACf,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;QACxB,IAAI,EAAE;YACL,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,IAAI;YACZ,SAAS,EAAE,MAAM;YACjB,UAAU,EAAE,CAAC;SACb;QACD,aAAa,EAAE,MAAM;QACrB,SAAS,EAAE,MAAM;KACqB;IACvC,aAAa,EAAE;QACd,EAAE,EAAE,aAAa;QACjB,IAAI,EAAE,aAAa;QACnB,GAAG,EAAE,oBAAoB;QACzB,QAAQ,EAAE,uBAAuB;QACjC,OAAO,EAAE,0CAA0C;QACnD,MAAM,EAAE,EAAC,6CAA6C,EAAC,IAAI,EAAC,gBAAgB,EAAC,UAAU,EAAC;QACxF,SAAS,EAAE,IAAI;QACf,KAAK,EAAE,CAAC,MAAM,CAAC;QACf,IAAI,EAAE;YACL,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,IAAI;YACZ,SAAS,EAAE,MAAM;YACjB,UAAU,EAAE,CAAC;SACb;QACD,aAAa,EAAE,OAAO;QACtB,SAAS,EAAE,MAAM;KACqB;IACvC,WAAW,EAAE;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Z,MAAM,EAAE,IAAI;YACZ,SAAS,EAAE,MAAM;YACjB,UAAU,EAAE,CAAC;SACb;QACD,aAAa,EAAE,OAAO;QACtB,SAAS,EAAE,MAAM;KACqB;CAC9B,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport type { Model } from \"../types.ts\";\n\nexport const XIAOMI_TOKEN_PLAN_SGP_MODELS = {\n\t\"mimo-v2-omni\": {\n\t\tid: \"mimo-v2-omni\",\n\t\tname: \"MiMo-V2-Omni\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi-token-plan-sgp\",\n\t\tbaseUrl: \"https://token-plan-sgp.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\", \"image\"],\n\t\tcost: {\n\t\t\tinput: 0.14,\n\t\t\toutput: 0.28,\n\t\t\tcacheRead: 0.0028,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 262144,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n\t\"mimo-v2-pro\": {\n\t\tid: \"mimo-v2-pro\",\n\t\tname: \"MiMo-V2-Pro\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi-token-plan-sgp\",\n\t\tbaseUrl: \"https://token-plan-sgp.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\"],\n\t\tcost: {\n\t\t\tinput: 0.435,\n\t\t\toutput: 0.87,\n\t\t\tcacheRead: 0.0036,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 1048576,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n\t\"mimo-v2.5\": {\n\t\tid: \"mimo-v2.5\",\n\t\tname: \"MiMo-V2.5\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi-token-plan-sgp\",\n\t\tbaseUrl: \"https://token-plan-sgp.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\", \"image\"],\n\t\tcost: {\n\t\t\tinput: 0.14,\n\t\t\toutput: 0.28,\n\t\t\tcacheRead: 0.0028,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 1048576,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n\t\"mimo-v2.5-pro\": {\n\t\tid: \"mimo-v2.5-pro\",\n\t\tname: \"MiMo-V2.5-Pro\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi-token-plan-sgp\",\n\t\tbaseUrl: \"https://token-plan-sgp.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\"],\n\t\tcost: {\n\t\t\tinput: 0.435,\n\t\t\toutput: 0.87,\n\t\t\tcacheRead: 0.0036,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 1048576,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n\t\"mimo-v2.5-pro-ultraspeed\": {\n\t\tid: \"mimo-v2.5-pro-ultraspeed\",\n\t\tname: \"MiMo-V2.5-Pro-UltraSpeed\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi-token-plan-sgp\",\n\t\tbaseUrl: \"https://token-plan-sgp.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\"],\n\t\tcost: {\n\t\t\tinput: 1.305,\n\t\t\toutput: 2.61,\n\t\t\tcacheRead: 0.0108,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 1048576,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n} as const;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xiaomi.models.d.ts","sourceRoot":"","sources":["../../src/providers/xiaomi.models.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6GhB,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport type { Model } from \"../types.ts\";\n\nexport const XIAOMI_MODELS = {\n\t\"mimo-v2-flash\": {\n\t\tid: \"mimo-v2-flash\",\n\t\tname: \"MiMo-V2-Flash\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi\",\n\t\tbaseUrl: \"https://api.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\"],\n\t\tcost: {\n\t\t\tinput: 0.
|
|
1
|
+
{"version":3,"file":"xiaomi.models.d.ts","sourceRoot":"","sources":["../../src/providers/xiaomi.models.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6GhB,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport type { Model } from \"../types.ts\";\n\nexport const XIAOMI_MODELS = {\n\t\"mimo-v2-flash\": {\n\t\tid: \"mimo-v2-flash\",\n\t\tname: \"MiMo-V2-Flash\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi\",\n\t\tbaseUrl: \"https://api.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\"],\n\t\tcost: {\n\t\t\tinput: 0.14,\n\t\t\toutput: 0.28,\n\t\t\tcacheRead: 0.0028,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 262144,\n\t\tmaxTokens: 65536,\n\t} satisfies Model<\"openai-completions\">,\n\t\"mimo-v2-omni\": {\n\t\tid: \"mimo-v2-omni\",\n\t\tname: \"MiMo-V2-Omni\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi\",\n\t\tbaseUrl: \"https://api.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\", \"image\"],\n\t\tcost: {\n\t\t\tinput: 0.14,\n\t\t\toutput: 0.28,\n\t\t\tcacheRead: 0.0028,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 262144,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n\t\"mimo-v2-pro\": {\n\t\tid: \"mimo-v2-pro\",\n\t\tname: \"MiMo-V2-Pro\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi\",\n\t\tbaseUrl: \"https://api.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\"],\n\t\tcost: {\n\t\t\tinput: 0.435,\n\t\t\toutput: 0.87,\n\t\t\tcacheRead: 0.0036,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 1048576,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n\t\"mimo-v2.5\": {\n\t\tid: \"mimo-v2.5\",\n\t\tname: \"MiMo-V2.5\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi\",\n\t\tbaseUrl: \"https://api.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\", \"image\"],\n\t\tcost: {\n\t\t\tinput: 0.14,\n\t\t\toutput: 0.28,\n\t\t\tcacheRead: 0.0028,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 1048576,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n\t\"mimo-v2.5-pro\": {\n\t\tid: \"mimo-v2.5-pro\",\n\t\tname: \"MiMo-V2.5-Pro\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi\",\n\t\tbaseUrl: \"https://api.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\"],\n\t\tcost: {\n\t\t\tinput: 0.435,\n\t\t\toutput: 0.87,\n\t\t\tcacheRead: 0.0036,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 1048576,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n\t\"mimo-v2.5-pro-ultraspeed\": {\n\t\tid: \"mimo-v2.5-pro-ultraspeed\",\n\t\tname: \"MiMo-V2.5-Pro-UltraSpeed\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi\",\n\t\tbaseUrl: \"https://api.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\"],\n\t\tcost: {\n\t\t\tinput: 1.305,\n\t\t\toutput: 2.61,\n\t\t\tcacheRead: 0.0108,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 1048576,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n} as const;\n"]}
|
|
@@ -11,9 +11,9 @@ export const XIAOMI_MODELS = {
|
|
|
11
11
|
reasoning: true,
|
|
12
12
|
input: ["text"],
|
|
13
13
|
cost: {
|
|
14
|
-
input: 0.
|
|
15
|
-
output: 0.
|
|
16
|
-
cacheRead: 0.
|
|
14
|
+
input: 0.14,
|
|
15
|
+
output: 0.28,
|
|
16
|
+
cacheRead: 0.0028,
|
|
17
17
|
cacheWrite: 0,
|
|
18
18
|
},
|
|
19
19
|
contextWindow: 262144,
|
|
@@ -29,9 +29,9 @@ export const XIAOMI_MODELS = {
|
|
|
29
29
|
reasoning: true,
|
|
30
30
|
input: ["text", "image"],
|
|
31
31
|
cost: {
|
|
32
|
-
input: 0.
|
|
33
|
-
output:
|
|
34
|
-
cacheRead: 0.
|
|
32
|
+
input: 0.14,
|
|
33
|
+
output: 0.28,
|
|
34
|
+
cacheRead: 0.0028,
|
|
35
35
|
cacheWrite: 0,
|
|
36
36
|
},
|
|
37
37
|
contextWindow: 262144,
|
|
@@ -47,9 +47,9 @@ export const XIAOMI_MODELS = {
|
|
|
47
47
|
reasoning: true,
|
|
48
48
|
input: ["text"],
|
|
49
49
|
cost: {
|
|
50
|
-
input:
|
|
51
|
-
output:
|
|
52
|
-
cacheRead: 0.
|
|
50
|
+
input: 0.435,
|
|
51
|
+
output: 0.87,
|
|
52
|
+
cacheRead: 0.0036,
|
|
53
53
|
cacheWrite: 0,
|
|
54
54
|
},
|
|
55
55
|
contextWindow: 1048576,
|
|
@@ -65,9 +65,9 @@ export const XIAOMI_MODELS = {
|
|
|
65
65
|
reasoning: true,
|
|
66
66
|
input: ["text", "image"],
|
|
67
67
|
cost: {
|
|
68
|
-
input: 0.
|
|
69
|
-
output:
|
|
70
|
-
cacheRead: 0.
|
|
68
|
+
input: 0.14,
|
|
69
|
+
output: 0.28,
|
|
70
|
+
cacheRead: 0.0028,
|
|
71
71
|
cacheWrite: 0,
|
|
72
72
|
},
|
|
73
73
|
contextWindow: 1048576,
|
|
@@ -83,9 +83,9 @@ export const XIAOMI_MODELS = {
|
|
|
83
83
|
reasoning: true,
|
|
84
84
|
input: ["text"],
|
|
85
85
|
cost: {
|
|
86
|
-
input:
|
|
87
|
-
output:
|
|
88
|
-
cacheRead: 0.
|
|
86
|
+
input: 0.435,
|
|
87
|
+
output: 0.87,
|
|
88
|
+
cacheRead: 0.0036,
|
|
89
89
|
cacheWrite: 0,
|
|
90
90
|
},
|
|
91
91
|
contextWindow: 1048576,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xiaomi.models.js","sourceRoot":"","sources":["../../src/providers/xiaomi.models.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,iEAAiE;AAIjE,MAAM,CAAC,MAAM,aAAa,GAAG;IAC5B,eAAe,EAAE;QAChB,EAAE,EAAE,eAAe;QACnB,IAAI,EAAE,eAAe;QACrB,GAAG,EAAE,oBAAoB;QACzB,QAAQ,EAAE,QAAQ;QAClB,OAAO,EAAE,+BAA+B;QACxC,MAAM,EAAE,EAAC,6CAA6C,EAAC,IAAI,EAAC,gBAAgB,EAAC,UAAU,EAAC;QACxF,SAAS,EAAE,IAAI;QACf,KAAK,EAAE,CAAC,MAAM,CAAC;QACf,IAAI,EAAE;YACL,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"xiaomi.models.js","sourceRoot":"","sources":["../../src/providers/xiaomi.models.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,iEAAiE;AAIjE,MAAM,CAAC,MAAM,aAAa,GAAG;IAC5B,eAAe,EAAE;QAChB,EAAE,EAAE,eAAe;QACnB,IAAI,EAAE,eAAe;QACrB,GAAG,EAAE,oBAAoB;QACzB,QAAQ,EAAE,QAA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AE;YACL,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,IAAI;YACZ,SAAS,EAAE,MAAM;YACjB,UAAU,EAAE,CAAC;SACb;QACD,aAAa,EAAE,OAAO;QACtB,SAAS,EAAE,MAAM;KACqB;CAC9B,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport type { Model } from \"../types.ts\";\n\nexport const XIAOMI_MODELS = {\n\t\"mimo-v2-flash\": {\n\t\tid: \"mimo-v2-flash\",\n\t\tname: \"MiMo-V2-Flash\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi\",\n\t\tbaseUrl: \"https://api.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\"],\n\t\tcost: {\n\t\t\tinput: 0.14,\n\t\t\toutput: 0.28,\n\t\t\tcacheRead: 0.0028,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 262144,\n\t\tmaxTokens: 65536,\n\t} satisfies Model<\"openai-completions\">,\n\t\"mimo-v2-omni\": {\n\t\tid: \"mimo-v2-omni\",\n\t\tname: \"MiMo-V2-Omni\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi\",\n\t\tbaseUrl: \"https://api.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\", \"image\"],\n\t\tcost: {\n\t\t\tinput: 0.14,\n\t\t\toutput: 0.28,\n\t\t\tcacheRead: 0.0028,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 262144,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n\t\"mimo-v2-pro\": {\n\t\tid: \"mimo-v2-pro\",\n\t\tname: \"MiMo-V2-Pro\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi\",\n\t\tbaseUrl: \"https://api.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\"],\n\t\tcost: {\n\t\t\tinput: 0.435,\n\t\t\toutput: 0.87,\n\t\t\tcacheRead: 0.0036,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 1048576,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n\t\"mimo-v2.5\": {\n\t\tid: \"mimo-v2.5\",\n\t\tname: \"MiMo-V2.5\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi\",\n\t\tbaseUrl: \"https://api.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\", \"image\"],\n\t\tcost: {\n\t\t\tinput: 0.14,\n\t\t\toutput: 0.28,\n\t\t\tcacheRead: 0.0028,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 1048576,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n\t\"mimo-v2.5-pro\": {\n\t\tid: \"mimo-v2.5-pro\",\n\t\tname: \"MiMo-V2.5-Pro\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi\",\n\t\tbaseUrl: \"https://api.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\"],\n\t\tcost: {\n\t\t\tinput: 0.435,\n\t\t\toutput: 0.87,\n\t\t\tcacheRead: 0.0036,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 1048576,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n\t\"mimo-v2.5-pro-ultraspeed\": {\n\t\tid: \"mimo-v2.5-pro-ultraspeed\",\n\t\tname: \"MiMo-V2.5-Pro-UltraSpeed\",\n\t\tapi: \"openai-completions\",\n\t\tprovider: \"xiaomi\",\n\t\tbaseUrl: \"https://api.xiaomimimo.com/v1\",\n\t\tcompat: {\"requiresReasoningContentOnAssistantMessages\":true,\"thinkingFormat\":\"deepseek\"},\n\t\treasoning: true,\n\t\tinput: [\"text\"],\n\t\tcost: {\n\t\t\tinput: 1.305,\n\t\t\toutput: 2.61,\n\t\t\tcacheRead: 0.0108,\n\t\t\tcacheWrite: 0,\n\t\t},\n\t\tcontextWindow: 1048576,\n\t\tmaxTokens: 131072,\n\t} satisfies Model<\"openai-completions\">,\n} as const;\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const MAX_PROVIDER_ERROR_BODY_CHARS = 4000;
|
|
2
|
+
export interface NormalizedProviderError {
|
|
3
|
+
/** HTTP status code, when one could be extracted from the SDK error object. */
|
|
4
|
+
status?: number;
|
|
5
|
+
/** Raw HTTP body reason, already trimmed and truncated to the cap. */
|
|
6
|
+
body?: string;
|
|
7
|
+
/** `error.message`, or `safeJsonStringify(error)` for a non-`Error` throw. */
|
|
8
|
+
message: string;
|
|
9
|
+
/** True when `message` already contains the body (no separate body to add). */
|
|
10
|
+
messageCarriesBody: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function normalizeProviderError(error: unknown): NormalizedProviderError;
|
|
13
|
+
/**
|
|
14
|
+
* Compose a display string from a normalized error. When the message already
|
|
15
|
+
* carries the body (Anthropic / `@google/genai` happy path) or no body/status
|
|
16
|
+
* was extracted, the message is returned unchanged. Otherwise the status and
|
|
17
|
+
* body are surfaced, with an optional provider prefix.
|
|
18
|
+
*
|
|
19
|
+
* - no prefix: `"<status>: <body>"`
|
|
20
|
+
* - prefix: `"<prefix> (<status>): <body>"`
|
|
21
|
+
*/
|
|
22
|
+
export declare function formatProviderError(norm: NormalizedProviderError, prefix?: string): string;
|
|
23
|
+
export declare function truncateErrorText(text: string, maxChars: number): string;
|
|
24
|
+
export declare function safeJsonStringify(value: unknown): string;
|
|
25
|
+
//# sourceMappingURL=error-body.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-body.d.ts","sourceRoot":"","sources":["../../src/utils/error-body.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,6BAA6B,OAAO,CAAC;AAElD,MAAM,WAAW,uBAAuB;IACvC,+EAA+E;IAC/E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sEAAsE;IACtE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8EAA8E;IAC9E,OAAO,EAAE,MAAM,CAAC;IAChB,+EAA+E;IAC/E,kBAAkB,EAAE,OAAO,CAAC;CAC5B;AAWD,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,uBAAuB,CAgB9E;AA2CD;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,uBAAuB,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAO1F;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGxE;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAOxD","sourcesContent":["// Shared normalization for provider HTTP error objects.\n//\n// Endpoints behind a proxy / gateway may return a non-2xx response whose body\n// the provider SDK cannot fold into `error.message`. The SDK error object still\n// carries the HTTP status and the raw/parsed body, but under SDK-specific field\n// names. Provider catch blocks that read only `error.message` therefore drop\n// the body and surface opaque messages like `\"403 status code (no body)\"` or\n// collapse to `\"Unknown: UnknownError\"`.\n//\n// `normalizeProviderError` probes the known SDK field shapes (Mistral,\n// `openai`, `@google/genai`, AWS Bedrock) and returns a struct each provider\n// composes into its display string. The `messageCarriesBody` flag captures the\n// Anthropic / `@google/genai` happy path where the SDK already folded the body\n// into the message, so providers can preserve it without double-printing.\n\nexport const MAX_PROVIDER_ERROR_BODY_CHARS = 4000;\n\nexport interface NormalizedProviderError {\n\t/** HTTP status code, when one could be extracted from the SDK error object. */\n\tstatus?: number;\n\t/** Raw HTTP body reason, already trimmed and truncated to the cap. */\n\tbody?: string;\n\t/** `error.message`, or `safeJsonStringify(error)` for a non-`Error` throw. */\n\tmessage: string;\n\t/** True when `message` already contains the body (no separate body to add). */\n\tmessageCarriesBody: boolean;\n}\n\ntype SdkErrorShape = Error & {\n\tstatusCode?: unknown;\n\tstatus?: unknown;\n\tbody?: unknown;\n\terror?: unknown;\n\t$metadata?: { httpStatusCode?: unknown };\n\t$response?: { statusCode?: unknown; body?: unknown };\n};\n\nexport function normalizeProviderError(error: unknown): NormalizedProviderError {\n\tif (!(error instanceof Error)) {\n\t\treturn { message: safeJsonStringify(error), messageCarriesBody: false };\n\t}\n\n\tconst sdkError = error as SdkErrorShape;\n\tconst status = extractStatus(sdkError);\n\tconst body = extractBody(sdkError);\n\tconst messageCarriesBody = body === undefined || error.message.includes(body);\n\n\treturn {\n\t\tstatus,\n\t\tbody,\n\t\tmessage: error.message,\n\t\tmessageCarriesBody,\n\t} satisfies NormalizedProviderError;\n}\n\n/**\n * Probe the HTTP status, first numeric hit wins, in SDK-field order:\n * `statusCode` (Mistral) → `status` (`openai`, `@google/genai`) →\n * `$metadata.httpStatusCode` (Bedrock) → `$response.statusCode` (Bedrock).\n */\nfunction extractStatus(error: SdkErrorShape): number | undefined {\n\tif (typeof error.statusCode === \"number\") return error.statusCode;\n\tif (typeof error.status === \"number\") return error.status;\n\tif (typeof error.$metadata?.httpStatusCode === \"number\") return error.$metadata.httpStatusCode;\n\tif (typeof error.$response?.statusCode === \"number\") return error.$response.statusCode;\n\treturn undefined;\n}\n\n/**\n * Probe the raw body reason, first usable hit wins, in SDK-field order:\n * `body` string (Mistral) → `error` parsed JSON body object (`openai` SDK's\n * `this.error`) → `$response.body` (Bedrock). Empty objects are treated as no\n * body so an empty parsed body does not surface as `\"{}\"`. The chosen body is\n * truncated to the cap.\n */\nfunction extractBody(error: SdkErrorShape): string | undefined {\n\tconst bodyText = pickBodyText(error);\n\tif (bodyText === undefined) return undefined;\n\tconst trimmed = bodyText.trim();\n\tif (trimmed.length === 0) return undefined;\n\treturn truncateErrorText(trimmed, MAX_PROVIDER_ERROR_BODY_CHARS);\n}\n\nfunction pickBodyText(error: SdkErrorShape): string | undefined {\n\tif (typeof error.body === \"string\") return error.body;\n\tif (isNonEmptyObject(error.error)) return safeJsonStringify(error.error);\n\tconst responseBody = error.$response?.body;\n\tif (typeof responseBody === \"string\") return responseBody;\n\tif (isNonEmptyObject(responseBody)) return safeJsonStringify(responseBody);\n\treturn undefined;\n}\n\nfunction isNonEmptyObject(value: unknown): boolean {\n\treturn typeof value === \"object\" && value !== null && Object.keys(value).length > 0;\n}\n\n/**\n * Compose a display string from a normalized error. When the message already\n * carries the body (Anthropic / `@google/genai` happy path) or no body/status\n * was extracted, the message is returned unchanged. Otherwise the status and\n * body are surfaced, with an optional provider prefix.\n *\n * - no prefix: `\"<status>: <body>\"`\n * - prefix: `\"<prefix> (<status>): <body>\"`\n */\nexport function formatProviderError(norm: NormalizedProviderError, prefix?: string): string {\n\tif (norm.messageCarriesBody || norm.status === undefined || norm.body === undefined) {\n\t\treturn prefix !== undefined && norm.status !== undefined\n\t\t\t? `${prefix} (${norm.status}): ${norm.message}`\n\t\t\t: norm.message;\n\t}\n\treturn prefix !== undefined ? `${prefix} (${norm.status}): ${norm.body}` : `${norm.status}: ${norm.body}`;\n}\n\nexport function truncateErrorText(text: string, maxChars: number): string {\n\tif (text.length <= maxChars) return text;\n\treturn `${text.slice(0, maxChars)}... [truncated ${text.length - maxChars} chars]`;\n}\n\nexport function safeJsonStringify(value: unknown): string {\n\ttry {\n\t\tconst serialized = JSON.stringify(value);\n\t\treturn serialized === undefined ? String(value) : serialized;\n\t} catch {\n\t\treturn String(value);\n\t}\n}\n"]}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// Shared normalization for provider HTTP error objects.
|
|
2
|
+
//
|
|
3
|
+
// Endpoints behind a proxy / gateway may return a non-2xx response whose body
|
|
4
|
+
// the provider SDK cannot fold into `error.message`. The SDK error object still
|
|
5
|
+
// carries the HTTP status and the raw/parsed body, but under SDK-specific field
|
|
6
|
+
// names. Provider catch blocks that read only `error.message` therefore drop
|
|
7
|
+
// the body and surface opaque messages like `"403 status code (no body)"` or
|
|
8
|
+
// collapse to `"Unknown: UnknownError"`.
|
|
9
|
+
//
|
|
10
|
+
// `normalizeProviderError` probes the known SDK field shapes (Mistral,
|
|
11
|
+
// `openai`, `@google/genai`, AWS Bedrock) and returns a struct each provider
|
|
12
|
+
// composes into its display string. The `messageCarriesBody` flag captures the
|
|
13
|
+
// Anthropic / `@google/genai` happy path where the SDK already folded the body
|
|
14
|
+
// into the message, so providers can preserve it without double-printing.
|
|
15
|
+
export const MAX_PROVIDER_ERROR_BODY_CHARS = 4000;
|
|
16
|
+
export function normalizeProviderError(error) {
|
|
17
|
+
if (!(error instanceof Error)) {
|
|
18
|
+
return { message: safeJsonStringify(error), messageCarriesBody: false };
|
|
19
|
+
}
|
|
20
|
+
const sdkError = error;
|
|
21
|
+
const status = extractStatus(sdkError);
|
|
22
|
+
const body = extractBody(sdkError);
|
|
23
|
+
const messageCarriesBody = body === undefined || error.message.includes(body);
|
|
24
|
+
return {
|
|
25
|
+
status,
|
|
26
|
+
body,
|
|
27
|
+
message: error.message,
|
|
28
|
+
messageCarriesBody,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Probe the HTTP status, first numeric hit wins, in SDK-field order:
|
|
33
|
+
* `statusCode` (Mistral) → `status` (`openai`, `@google/genai`) →
|
|
34
|
+
* `$metadata.httpStatusCode` (Bedrock) → `$response.statusCode` (Bedrock).
|
|
35
|
+
*/
|
|
36
|
+
function extractStatus(error) {
|
|
37
|
+
if (typeof error.statusCode === "number")
|
|
38
|
+
return error.statusCode;
|
|
39
|
+
if (typeof error.status === "number")
|
|
40
|
+
return error.status;
|
|
41
|
+
if (typeof error.$metadata?.httpStatusCode === "number")
|
|
42
|
+
return error.$metadata.httpStatusCode;
|
|
43
|
+
if (typeof error.$response?.statusCode === "number")
|
|
44
|
+
return error.$response.statusCode;
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Probe the raw body reason, first usable hit wins, in SDK-field order:
|
|
49
|
+
* `body` string (Mistral) → `error` parsed JSON body object (`openai` SDK's
|
|
50
|
+
* `this.error`) → `$response.body` (Bedrock). Empty objects are treated as no
|
|
51
|
+
* body so an empty parsed body does not surface as `"{}"`. The chosen body is
|
|
52
|
+
* truncated to the cap.
|
|
53
|
+
*/
|
|
54
|
+
function extractBody(error) {
|
|
55
|
+
const bodyText = pickBodyText(error);
|
|
56
|
+
if (bodyText === undefined)
|
|
57
|
+
return undefined;
|
|
58
|
+
const trimmed = bodyText.trim();
|
|
59
|
+
if (trimmed.length === 0)
|
|
60
|
+
return undefined;
|
|
61
|
+
return truncateErrorText(trimmed, MAX_PROVIDER_ERROR_BODY_CHARS);
|
|
62
|
+
}
|
|
63
|
+
function pickBodyText(error) {
|
|
64
|
+
if (typeof error.body === "string")
|
|
65
|
+
return error.body;
|
|
66
|
+
if (isNonEmptyObject(error.error))
|
|
67
|
+
return safeJsonStringify(error.error);
|
|
68
|
+
const responseBody = error.$response?.body;
|
|
69
|
+
if (typeof responseBody === "string")
|
|
70
|
+
return responseBody;
|
|
71
|
+
if (isNonEmptyObject(responseBody))
|
|
72
|
+
return safeJsonStringify(responseBody);
|
|
73
|
+
return undefined;
|
|
74
|
+
}
|
|
75
|
+
function isNonEmptyObject(value) {
|
|
76
|
+
return typeof value === "object" && value !== null && Object.keys(value).length > 0;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Compose a display string from a normalized error. When the message already
|
|
80
|
+
* carries the body (Anthropic / `@google/genai` happy path) or no body/status
|
|
81
|
+
* was extracted, the message is returned unchanged. Otherwise the status and
|
|
82
|
+
* body are surfaced, with an optional provider prefix.
|
|
83
|
+
*
|
|
84
|
+
* - no prefix: `"<status>: <body>"`
|
|
85
|
+
* - prefix: `"<prefix> (<status>): <body>"`
|
|
86
|
+
*/
|
|
87
|
+
export function formatProviderError(norm, prefix) {
|
|
88
|
+
if (norm.messageCarriesBody || norm.status === undefined || norm.body === undefined) {
|
|
89
|
+
return prefix !== undefined && norm.status !== undefined
|
|
90
|
+
? `${prefix} (${norm.status}): ${norm.message}`
|
|
91
|
+
: norm.message;
|
|
92
|
+
}
|
|
93
|
+
return prefix !== undefined ? `${prefix} (${norm.status}): ${norm.body}` : `${norm.status}: ${norm.body}`;
|
|
94
|
+
}
|
|
95
|
+
export function truncateErrorText(text, maxChars) {
|
|
96
|
+
if (text.length <= maxChars)
|
|
97
|
+
return text;
|
|
98
|
+
return `${text.slice(0, maxChars)}... [truncated ${text.length - maxChars} chars]`;
|
|
99
|
+
}
|
|
100
|
+
export function safeJsonStringify(value) {
|
|
101
|
+
try {
|
|
102
|
+
const serialized = JSON.stringify(value);
|
|
103
|
+
return serialized === undefined ? String(value) : serialized;
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
return String(value);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=error-body.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-body.js","sourceRoot":"","sources":["../../src/utils/error-body.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,EAAE;AACF,8EAA8E;AAC9E,gFAAgF;AAChF,gFAAgF;AAChF,6EAA6E;AAC7E,6EAA6E;AAC7E,yCAAyC;AACzC,EAAE;AACF,uEAAuE;AACvE,6EAA6E;AAC7E,+EAA+E;AAC/E,+EAA+E;AAC/E,0EAA0E;AAE1E,MAAM,CAAC,MAAM,6BAA6B,GAAG,IAAI,CAAC;AAsBlD,MAAM,UAAU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,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,MAAM,KAAK,IAAI,CAAC,MAAM,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,IAAI,EAAE,CAAC;AAAA,CAC1G;AAED,MAAM,UAAU,iBAAiB,CAAC,IAAY,EAAE,QAAgB,EAAU;IACzE,IAAI,IAAI,CAAC,MAAM,IAAI,QAAQ;QAAE,OAAO,IAAI,CAAC;IACzC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,CAAC,kBAAkB,IAAI,CAAC,MAAM,GAAG,QAAQ,SAAS,CAAC;AAAA,CACnF;AAED,MAAM,UAAU,iBAAiB,CAAC,KAAc,EAAU;IACzD,IAAI,CAAC;QACJ,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACzC,OAAO,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;IAC9D,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;AAAA,CACD","sourcesContent":["// Shared normalization for provider HTTP error objects.\n//\n// Endpoints behind a proxy / gateway may return a non-2xx response whose body\n// the provider SDK cannot fold into `error.message`. The SDK error object still\n// carries the HTTP status and the raw/parsed body, but under SDK-specific field\n// names. Provider catch blocks that read only `error.message` therefore drop\n// the body and surface opaque messages like `\"403 status code (no body)\"` or\n// collapse to `\"Unknown: UnknownError\"`.\n//\n// `normalizeProviderError` probes the known SDK field shapes (Mistral,\n// `openai`, `@google/genai`, AWS Bedrock) and returns a struct each provider\n// composes into its display string. The `messageCarriesBody` flag captures the\n// Anthropic / `@google/genai` happy path where the SDK already folded the body\n// into the message, so providers can preserve it without double-printing.\n\nexport const MAX_PROVIDER_ERROR_BODY_CHARS = 4000;\n\nexport interface NormalizedProviderError {\n\t/** HTTP status code, when one could be extracted from the SDK error object. */\n\tstatus?: number;\n\t/** Raw HTTP body reason, already trimmed and truncated to the cap. */\n\tbody?: string;\n\t/** `error.message`, or `safeJsonStringify(error)` for a non-`Error` throw. */\n\tmessage: string;\n\t/** True when `message` already contains the body (no separate body to add). */\n\tmessageCarriesBody: boolean;\n}\n\ntype SdkErrorShape = Error & {\n\tstatusCode?: unknown;\n\tstatus?: unknown;\n\tbody?: unknown;\n\terror?: unknown;\n\t$metadata?: { httpStatusCode?: unknown };\n\t$response?: { statusCode?: unknown; body?: unknown };\n};\n\nexport function normalizeProviderError(error: unknown): NormalizedProviderError {\n\tif (!(error instanceof Error)) {\n\t\treturn { message: safeJsonStringify(error), messageCarriesBody: false };\n\t}\n\n\tconst sdkError = error as SdkErrorShape;\n\tconst status = extractStatus(sdkError);\n\tconst body = extractBody(sdkError);\n\tconst messageCarriesBody = body === undefined || error.message.includes(body);\n\n\treturn {\n\t\tstatus,\n\t\tbody,\n\t\tmessage: error.message,\n\t\tmessageCarriesBody,\n\t} satisfies NormalizedProviderError;\n}\n\n/**\n * Probe the HTTP status, first numeric hit wins, in SDK-field order:\n * `statusCode` (Mistral) → `status` (`openai`, `@google/genai`) →\n * `$metadata.httpStatusCode` (Bedrock) → `$response.statusCode` (Bedrock).\n */\nfunction extractStatus(error: SdkErrorShape): number | undefined {\n\tif (typeof error.statusCode === \"number\") return error.statusCode;\n\tif (typeof error.status === \"number\") return error.status;\n\tif (typeof error.$metadata?.httpStatusCode === \"number\") return error.$metadata.httpStatusCode;\n\tif (typeof error.$response?.statusCode === \"number\") return error.$response.statusCode;\n\treturn undefined;\n}\n\n/**\n * Probe the raw body reason, first usable hit wins, in SDK-field order:\n * `body` string (Mistral) → `error` parsed JSON body object (`openai` SDK's\n * `this.error`) → `$response.body` (Bedrock). Empty objects are treated as no\n * body so an empty parsed body does not surface as `\"{}\"`. The chosen body is\n * truncated to the cap.\n */\nfunction extractBody(error: SdkErrorShape): string | undefined {\n\tconst bodyText = pickBodyText(error);\n\tif (bodyText === undefined) return undefined;\n\tconst trimmed = bodyText.trim();\n\tif (trimmed.length === 0) return undefined;\n\treturn truncateErrorText(trimmed, MAX_PROVIDER_ERROR_BODY_CHARS);\n}\n\nfunction pickBodyText(error: SdkErrorShape): string | undefined {\n\tif (typeof error.body === \"string\") return error.body;\n\tif (isNonEmptyObject(error.error)) return safeJsonStringify(error.error);\n\tconst responseBody = error.$response?.body;\n\tif (typeof responseBody === \"string\") return responseBody;\n\tif (isNonEmptyObject(responseBody)) return safeJsonStringify(responseBody);\n\treturn undefined;\n}\n\nfunction isNonEmptyObject(value: unknown): boolean {\n\treturn typeof value === \"object\" && value !== null && Object.keys(value).length > 0;\n}\n\n/**\n * Compose a display string from a normalized error. When the message already\n * carries the body (Anthropic / `@google/genai` happy path) or no body/status\n * was extracted, the message is returned unchanged. Otherwise the status and\n * body are surfaced, with an optional provider prefix.\n *\n * - no prefix: `\"<status>: <body>\"`\n * - prefix: `\"<prefix> (<status>): <body>\"`\n */\nexport function formatProviderError(norm: NormalizedProviderError, prefix?: string): string {\n\tif (norm.messageCarriesBody || norm.status === undefined || norm.body === undefined) {\n\t\treturn prefix !== undefined && norm.status !== undefined\n\t\t\t? `${prefix} (${norm.status}): ${norm.message}`\n\t\t\t: norm.message;\n\t}\n\treturn prefix !== undefined ? `${prefix} (${norm.status}): ${norm.body}` : `${norm.status}: ${norm.body}`;\n}\n\nexport function truncateErrorText(text: string, maxChars: number): string {\n\tif (text.length <= maxChars) return text;\n\treturn `${text.slice(0, maxChars)}... [truncated ${text.length - maxChars} chars]`;\n}\n\nexport function safeJsonStringify(value: unknown): string {\n\ttry {\n\t\tconst serialized = JSON.stringify(value);\n\t\treturn serialized === undefined ? String(value) : serialized;\n\t} catch {\n\t\treturn String(value);\n\t}\n}\n"]}
|