@earendil-works/pi-ai 1.2.0 → 1.4.0
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/README.md +83 -37
- package/dist/api/anthropic-messages.d.ts.map +1 -1
- package/dist/api/anthropic-messages.js +66 -64
- package/dist/api/anthropic-messages.js.map +1 -1
- package/dist/api/azure-openai-responses.d.ts.map +1 -1
- package/dist/api/azure-openai-responses.js +8 -4
- package/dist/api/azure-openai-responses.js.map +1 -1
- package/dist/api/bedrock-converse-stream.d.ts.map +1 -1
- package/dist/api/bedrock-converse-stream.js +28 -18
- package/dist/api/bedrock-converse-stream.js.map +1 -1
- package/dist/api/classifier-shared.d.ts.map +1 -1
- package/dist/api/classifier-shared.js +4 -3
- package/dist/api/classifier-shared.js.map +1 -1
- package/dist/api/cloudflare-workers-ai-system-one.d.ts.map +1 -1
- package/dist/api/cloudflare-workers-ai-system-one.js +8 -0
- package/dist/api/cloudflare-workers-ai-system-one.js.map +1 -1
- package/dist/api/google-generative-ai.js +4 -4
- package/dist/api/google-generative-ai.js.map +1 -1
- package/dist/api/google-shared.d.ts.map +1 -1
- package/dist/api/google-shared.js +3 -1
- package/dist/api/google-shared.js.map +1 -1
- package/dist/api/google-vertex.d.ts.map +1 -1
- package/dist/api/google-vertex.js +9 -9
- package/dist/api/google-vertex.js.map +1 -1
- package/dist/api/lazy.d.ts +7 -2
- package/dist/api/lazy.d.ts.map +1 -1
- package/dist/api/lazy.js +24 -5
- package/dist/api/lazy.js.map +1 -1
- package/dist/api/llama-cpp-classify.d.ts.map +1 -1
- package/dist/api/llama-cpp-classify.js +2 -1
- package/dist/api/llama-cpp-classify.js.map +1 -1
- package/dist/api/mistral-conversations.js +4 -4
- package/dist/api/mistral-conversations.js.map +1 -1
- package/dist/api/openai-codex-responses.d.ts.map +1 -1
- package/dist/api/openai-codex-responses.js +17 -11
- package/dist/api/openai-codex-responses.js.map +1 -1
- package/dist/api/openai-completions.d.ts.map +1 -1
- package/dist/api/openai-completions.js +43 -35
- package/dist/api/openai-completions.js.map +1 -1
- package/dist/api/openai-responses-shared.d.ts +26 -0
- package/dist/api/openai-responses-shared.d.ts.map +1 -1
- package/dist/api/openai-responses-shared.js +76 -11
- package/dist/api/openai-responses-shared.js.map +1 -1
- package/dist/api/openai-responses.d.ts.map +1 -1
- package/dist/api/openai-responses.js +38 -13
- package/dist/api/openai-responses.js.map +1 -1
- package/dist/api/openrouter-images.d.ts.map +1 -1
- package/dist/api/openrouter-images.js +4 -3
- package/dist/api/openrouter-images.js.map +1 -1
- package/dist/api/pi-messages.d.ts.map +1 -1
- package/dist/api/pi-messages.js +3 -3
- package/dist/api/pi-messages.js.map +1 -1
- package/dist/api/simple-options.d.ts.map +1 -1
- package/dist/api/simple-options.js +2 -1
- package/dist/api/simple-options.js.map +1 -1
- package/dist/api/system-one-shared.d.ts +29 -2
- package/dist/api/system-one-shared.d.ts.map +1 -1
- package/dist/api/system-one-shared.js +55 -3
- package/dist/api/system-one-shared.js.map +1 -1
- package/dist/api/transform-messages.d.ts +16 -1
- package/dist/api/transform-messages.d.ts.map +1 -1
- package/dist/api/transform-messages.js +28 -15
- package/dist/api/transform-messages.js.map +1 -1
- package/dist/api/typesafe-system-one.d.ts.map +1 -1
- package/dist/api/typesafe-system-one.js +10 -0
- package/dist/api/typesafe-system-one.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +4 -0
- package/dist/models.d.ts.map +1 -1
- package/dist/models.js +19 -6
- package/dist/models.js.map +1 -1
- package/dist/providers/compat-schema.d.ts +171 -0
- package/dist/providers/compat-schema.d.ts.map +1 -1
- package/dist/providers/compat-schema.js +23 -2
- package/dist/providers/compat-schema.js.map +1 -1
- package/dist/providers/data/.manifest.json +1 -1
- package/dist/providers/data/amazon-bedrock.json +1 -1
- package/dist/providers/data/anthropic.json +1 -1
- package/dist/providers/data/azure.json +1 -1
- package/dist/providers/data/baseten.json +1 -1
- package/dist/providers/data/cerebras.json +1 -1
- package/dist/providers/data/cloudflare-ai-gateway.json +1 -1
- package/dist/providers/data/cloudflare-workers-ai.json +1 -1
- package/dist/providers/data/fireworks.json +1 -1
- package/dist/providers/data/github-copilot.json +1 -1
- package/dist/providers/data/google-vertex.json +1 -1
- package/dist/providers/data/google.json +1 -1
- package/dist/providers/data/groq.json +1 -1
- package/dist/providers/data/huggingface.json +1 -1
- package/dist/providers/data/kimi-coding.json +1 -1
- package/dist/providers/data/meta.json +1 -1
- package/dist/providers/data/minimax-cn.json +1 -1
- package/dist/providers/data/minimax.json +1 -1
- package/dist/providers/data/mistral.json +1 -1
- package/dist/providers/data/moonshotai-cn.json +1 -1
- package/dist/providers/data/nvidia.json +1 -1
- package/dist/providers/data/openai-codex.json +1 -1
- package/dist/providers/data/openai.json +1 -1
- package/dist/providers/data/opencode-go.json +1 -1
- package/dist/providers/data/opencode.json +1 -1
- package/dist/providers/data/openrouter.json +1 -1
- package/dist/providers/data/qwen-token-plan-cn.json +1 -1
- package/dist/providers/data/qwen-token-plan.json +1 -1
- package/dist/providers/data/radius.json +1 -1
- package/dist/providers/data/together.json +1 -1
- package/dist/providers/data/typesafe.json +1 -1
- package/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/dist/providers/data/xai.json +1 -1
- package/dist/providers/data/xiaomi-token-plan-ams.json +1 -1
- package/dist/providers/data/xiaomi-token-plan-cn.json +1 -1
- package/dist/providers/data/xiaomi-token-plan-sgp.json +1 -1
- package/dist/providers/data/xiaomi.json +1 -1
- package/dist/providers/data/zai-coding-cn.json +1 -1
- package/dist/providers/kimi-coding.d.ts +1 -1
- package/dist/providers/kimi-coding.js +3 -3
- package/dist/providers/kimi-coding.js.map +1 -1
- package/dist/providers/model-schema.d.ts.map +1 -1
- package/dist/providers/model-schema.js +4 -2
- package/dist/providers/model-schema.js.map +1 -1
- package/dist/providers/opencode-go.d.ts +3 -1
- package/dist/providers/opencode-go.d.ts.map +1 -1
- package/dist/providers/opencode-go.js +2 -0
- package/dist/providers/opencode-go.js.map +1 -1
- package/dist/telemetry.d.ts +288 -0
- package/dist/telemetry.d.ts.map +1 -0
- package/dist/telemetry.js +191 -0
- package/dist/telemetry.js.map +1 -0
- package/dist/types.d.ts +18 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/identity.d.ts +65 -0
- package/dist/utils/identity.d.ts.map +1 -0
- package/dist/utils/identity.js +141 -0
- package/dist/utils/identity.js.map +1 -0
- package/dist/utils/json-parse.d.ts +10 -0
- package/dist/utils/json-parse.d.ts.map +1 -1
- package/dist/utils/json-parse.js +26 -1
- package/dist/utils/json-parse.js.map +1 -1
- package/dist/utils/overflow.d.ts +1 -0
- package/dist/utils/overflow.d.ts.map +1 -1
- package/dist/utils/overflow.js +6 -1
- package/dist/utils/overflow.js.map +1 -1
- package/dist/utils/retry.d.ts.map +1 -1
- package/dist/utils/retry.js +21 -8
- package/dist/utils/retry.js.map +1 -1
- package/dist/utils/transcript.d.ts +22 -8
- package/dist/utils/transcript.d.ts.map +1 -1
- package/dist/utils/transcript.js +29 -18
- package/dist/utils/transcript.js.map +1 -1
- package/dist/utils/validation.d.ts.map +1 -1
- package/dist/utils/validation.js +3 -0
- package/dist/utils/validation.js.map +1 -1
- package/dist/utils/version.d.ts +2 -0
- package/dist/utils/version.d.ts.map +1 -0
- package/dist/utils/version.js +3 -0
- package/dist/utils/version.js.map +1 -0
- package/package.json +2 -2
- package/dist/utils/assistant-message-frame.d.ts +0 -77
- package/dist/utils/assistant-message-frame.d.ts.map +0 -1
- package/dist/utils/assistant-message-frame.js +0 -425
- package/dist/utils/assistant-message-frame.js.map +0 -1
- package/dist/utils/pi-user-agent.d.ts +0 -2
- package/dist/utils/pi-user-agent.d.ts.map +0 -1
- package/dist/utils/pi-user-agent.js +0 -12
- package/dist/utils/pi-user-agent.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"openai-responses":{"chat:grok-4.3":{"id":"grok-4.3","name":"Grok 4.3","api":"openai-responses","provider":"xai","baseUrl":"https://api.x.ai/v1","compat":{"supportsLongCacheRetention":false},"reasoning":true,"input":["text","image"],"cost":{"input":1.25,"output":2.5,"cacheRead":0.2,"cacheWrite":0,"tiers":[{"inputTokensAbove":200000,"input":2.5,"output":5,"cacheRead":0.4,"cacheWrite":0}]},"contextWindow":1000000,"maxTokens":30000,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":
|
|
1
|
+
{"openai-responses":{"chat:grok-4.3":{"id":"grok-4.3","name":"Grok 4.3","api":"openai-responses","provider":"xai","baseUrl":"https://api.x.ai/v1","compat":{"supportsLongCacheRetention":false},"reasoning":true,"input":["text","image"],"cost":{"input":1.25,"output":2.5,"cacheRead":0.2,"cacheWrite":0,"tiers":[{"inputTokensAbove":200000,"input":2.5,"output":5,"cacheRead":0.4,"cacheWrite":0}]},"contextWindow":1000000,"maxTokens":30000,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":null},"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:grok-4.5":{"id":"grok-4.5","name":"Grok 4.5","api":"openai-responses","provider":"xai","baseUrl":"https://api.x.ai/v1","compat":{"supportsLongCacheRetention":false},"reasoning":true,"input":["text","image"],"cost":{"input":2,"output":6,"cacheRead":0.3,"cacheWrite":0,"tiers":[{"inputTokensAbove":200000,"input":4,"output":12,"cacheRead":0.6,"cacheWrite":0}]},"contextWindow":500000,"maxTokens":500000,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":null},"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:grok-4.6":{"id":"grok-4.6","name":"Grok 4.6","api":"openai-responses","provider":"xai","baseUrl":"https://api.x.ai/v1","compat":{"supportsLongCacheRetention":false},"reasoning":true,"input":["text","image"],"cost":{"input":2,"output":6,"cacheRead":0.5,"cacheWrite":0,"tiers":[{"inputTokensAbove":200000,"input":4,"output":12,"cacheRead":1,"cacheWrite":0}]},"contextWindow":500000,"maxTokens":500000,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":null},"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:grok-4.7":{"id":"grok-4.7","name":"Grok 4.7","api":"openai-responses","provider":"xai","baseUrl":"https://api.x.ai/v1","compat":{"supportsLongCacheRetention":false},"reasoning":true,"input":["text","image"],"cost":{"input":2,"output":6,"cacheRead":0.5,"cacheWrite":0,"tiers":[{"inputTokensAbove":200000,"input":4,"output":12,"cacheRead":1,"cacheWrite":0}]},"contextWindow":500000,"maxTokens":500000,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":null},"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"openai-completions":{"chat:mimo-v2.
|
|
1
|
+
{"openai-completions":{"chat:mimo-v2.6-flash":{"id":"mimo-v2.6-flash","name":"MiMo-V2.6-Flash","api":"openai-completions","provider":"xiaomi-token-plan-ams","baseUrl":"https://token-plan-ams.xiaomimimo.com/v1","compat":{"supportsStrictMode":true,"supportsReasoningEffort":false,"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek"},"reasoning":true,"thinkingLevelMap":{"off":"off","minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":null},"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072,"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:mimo-v2.6-pro":{"id":"mimo-v2.6-pro","name":"MiMo-V2.6-Pro","api":"openai-completions","provider":"xiaomi-token-plan-ams","baseUrl":"https://token-plan-ams.xiaomimimo.com/v1","compat":{"supportsStrictMode":true,"supportsReasoningEffort":false,"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek"},"reasoning":true,"thinkingLevelMap":{"off":"off","minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":null},"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072,"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"openai-completions":{"chat:mimo-v2.
|
|
1
|
+
{"openai-completions":{"chat:mimo-v2.6-flash":{"id":"mimo-v2.6-flash","name":"MiMo-V2.6-Flash","api":"openai-completions","provider":"xiaomi-token-plan-cn","baseUrl":"https://token-plan-cn.xiaomimimo.com/v1","compat":{"supportsStrictMode":true,"supportsReasoningEffort":false,"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek"},"reasoning":true,"thinkingLevelMap":{"off":"off","minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":null},"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072,"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:mimo-v2.6-pro":{"id":"mimo-v2.6-pro","name":"MiMo-V2.6-Pro","api":"openai-completions","provider":"xiaomi-token-plan-cn","baseUrl":"https://token-plan-cn.xiaomimimo.com/v1","compat":{"supportsStrictMode":true,"supportsReasoningEffort":false,"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek"},"reasoning":true,"thinkingLevelMap":{"off":"off","minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":null},"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072,"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"openai-completions":{"chat:mimo-v2.
|
|
1
|
+
{"openai-completions":{"chat:mimo-v2.6-flash":{"id":"mimo-v2.6-flash","name":"MiMo-V2.6-Flash","api":"openai-completions","provider":"xiaomi-token-plan-sgp","baseUrl":"https://token-plan-sgp.xiaomimimo.com/v1","compat":{"supportsStrictMode":true,"supportsReasoningEffort":false,"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek"},"reasoning":true,"thinkingLevelMap":{"off":"off","minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":null},"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072,"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:mimo-v2.6-pro":{"id":"mimo-v2.6-pro","name":"MiMo-V2.6-Pro","api":"openai-completions","provider":"xiaomi-token-plan-sgp","baseUrl":"https://token-plan-sgp.xiaomimimo.com/v1","compat":{"supportsStrictMode":true,"supportsReasoningEffort":false,"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek"},"reasoning":true,"thinkingLevelMap":{"off":"off","minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":null},"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072,"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"openai-completions":{"chat:mimo-v2.
|
|
1
|
+
{"openai-completions":{"chat:mimo-v2.6-flash":{"id":"mimo-v2.6-flash","name":"MiMo-V2.6-Flash","api":"openai-completions","provider":"xiaomi","baseUrl":"https://api.xiaomimimo.com/v1","compat":{"supportsStrictMode":true,"supportsReasoningEffort":false,"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek"},"reasoning":true,"thinkingLevelMap":{"off":"off","minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":null},"input":["text","image"],"cost":{"input":0.14,"output":0.28,"cacheRead":0.0028,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072,"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:mimo-v2.6-pro":{"id":"mimo-v2.6-pro","name":"MiMo-V2.6-Pro","api":"openai-completions","provider":"xiaomi","baseUrl":"https://api.xiaomimimo.com/v1","compat":{"supportsStrictMode":true,"supportsReasoningEffort":false,"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek"},"reasoning":true,"thinkingLevelMap":{"off":"off","minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":null},"input":["text","image"],"cost":{"input":0.435,"output":0.87,"cacheRead":0.0036,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072,"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:mimo-v2.6-pro-ultraspeed":{"id":"mimo-v2.6-pro-ultraspeed","name":"MiMo-V2.6-Pro-UltraSpeed","api":"openai-completions","provider":"xiaomi","baseUrl":"https://api.xiaomimimo.com/v1","compat":{"supportsStrictMode":true,"supportsReasoningEffort":false,"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek"},"reasoning":true,"thinkingLevelMap":{"off":"off","minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":null},"input":["text","image"],"cost":{"input":4.35,"output":8.7,"cacheRead":0.036,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072,"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"openai-completions":{"chat:glm-4.6v":{"id":"glm-4.6v","name":"GLM-4.6V","api":"openai-completions","provider":"zai-coding-cn","baseUrl":"https://open.bigmodel.cn/api/coding/paas/v4","reasoning":true,"input":["text","image"],"cost":{"input":0.3,"output":0.9,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","thinkingFormat":"zai","supportsStrictMode":true,"zaiToolStream":true},"contextWindow":128000,"maxTokens":32768,"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:glm-5.3":{"id":"glm-5.3","name":"GLM-5.3","api":"openai-completions","provider":"zai-coding-cn","baseUrl":"https://open.bigmodel.cn/api/coding/paas/v4","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"input":["text"],"cost":{"input":1.4,"output":4.4,"cacheRead":0.26,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"maxTokensField":"max_tokens","thinkingFormat":"zai","supportsStrictMode":true,"zaiToolStream":true},"contextWindow":1000000,"maxTokens":131072,"type":"chat"},"chat:glm-5.3-flash":{"id":"glm-5.3-flash","name":"GLM-5.3-Flash","api":"openai-completions","provider":"zai-coding-cn","baseUrl":"https://open.bigmodel.cn/api/coding/paas/v4","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"input":["text","image"],"cost":{"input":0.15,"output":0.5,"cacheRead":0.03,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"maxTokensField":"max_tokens","thinkingFormat":"zai","supportsStrictMode":true,"zaiToolStream":true},"contextWindow":1000000,"maxTokens":131072,"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:glm-5.3-highspeed":{"id":"glm-5.3-highspeed","name":"GLM-5.3 Highspeed","api":"openai-completions","provider":"zai-coding-cn","baseUrl":"https://open.bigmodel.cn/api/coding/paas/v4","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"maxTokensField":"max_tokens","thinkingFormat":"zai","supportsStrictMode":true,"zaiToolStream":true},"contextWindow":1000000,"maxTokens":131072,"type":"chat"}}}
|
|
1
|
+
{"openai-completions":{"chat:glm-4.6v":{"id":"glm-4.6v","name":"GLM-4.6V","api":"openai-completions","provider":"zai-coding-cn","baseUrl":"https://open.bigmodel.cn/api/coding/paas/v4","reasoning":true,"input":["text","image"],"cost":{"input":0.3,"output":0.9,"cacheRead":0.05,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","thinkingFormat":"zai","supportsStrictMode":true,"zaiToolStream":true},"contextWindow":128000,"maxTokens":32768,"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:glm-5.3":{"id":"glm-5.3","name":"GLM-5.3","api":"openai-completions","provider":"zai-coding-cn","baseUrl":"https://open.bigmodel.cn/api/coding/paas/v4","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"input":["text"],"cost":{"input":1.4,"output":4.4,"cacheRead":0.26,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"maxTokensField":"max_tokens","thinkingFormat":"zai","supportsStrictMode":true,"zaiToolStream":true},"contextWindow":1000000,"maxTokens":131072,"type":"chat"},"chat:glm-5.3-flash":{"id":"glm-5.3-flash","name":"GLM-5.3-Flash","api":"openai-completions","provider":"zai-coding-cn","baseUrl":"https://open.bigmodel.cn/api/coding/paas/v4","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"input":["text","image"],"cost":{"input":0.15,"output":0.5,"cacheRead":0.03,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"maxTokensField":"max_tokens","thinkingFormat":"zai","supportsStrictMode":true,"zaiToolStream":true},"contextWindow":1000000,"maxTokens":131072,"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:glm-5.3-highspeed":{"id":"glm-5.3-highspeed","name":"GLM-5.3 Highspeed","api":"openai-completions","provider":"zai-coding-cn","baseUrl":"https://open.bigmodel.cn/api/coding/paas/v4","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"maxTokensField":"max_tokens","thinkingFormat":"zai","supportsStrictMode":true,"zaiToolStream":true},"contextWindow":1000000,"maxTokens":131072,"type":"chat"}}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { openAICompletionsApi } from "../api/openai-completions.lazy.js";
|
|
2
2
|
import { envApiKeyAuth, lazyOAuth } from "../auth/helpers.js";
|
|
3
3
|
import { loadKimiCodingOAuth } from "../auth/oauth/load.js";
|
|
4
4
|
import { createProvider } from "../models.js";
|
|
@@ -7,7 +7,7 @@ export function kimiCodingProvider() {
|
|
|
7
7
|
return createProvider({
|
|
8
8
|
id: "kimi-coding",
|
|
9
9
|
name: "Kimi For Coding",
|
|
10
|
-
baseUrl: "https://api.kimi.com/coding",
|
|
10
|
+
baseUrl: "https://api.kimi.com/coding/v1",
|
|
11
11
|
auth: {
|
|
12
12
|
apiKey: envApiKeyAuth("Kimi API key", ["KIMI_API_KEY"]),
|
|
13
13
|
oauth: lazyOAuth({
|
|
@@ -18,7 +18,7 @@ export function kimiCodingProvider() {
|
|
|
18
18
|
}),
|
|
19
19
|
},
|
|
20
20
|
models: Object.values(KIMI_CODING_MODELS),
|
|
21
|
-
api:
|
|
21
|
+
api: openAICompletionsApi(),
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
//# sourceMappingURL=kimi-coding.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kimi-coding.js","sourceRoot":"","sources":["../../src/providers/kimi-coding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAiB,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,MAAM,UAAU,kBAAkB;IACjC,OAAO,cAAc,CAAC;QACrB,EAAE,EAAE,aAAa;QACjB,IAAI,EAAE,iBAAiB;QACvB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"kimi-coding.js","sourceRoot":"","sources":["../../src/providers/kimi-coding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAiB,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,MAAM,UAAU,kBAAkB;IACjC,OAAO,cAAc,CAAC;QACrB,EAAE,EAAE,aAAa;QACjB,IAAI,EAAE,iBAAiB;QACvB,OAAO,EAAE,gCAAgC;QACzC,IAAI,EAAE;YACL,MAAM,EAAE,aAAa,CAAC,cAAc,EAAE,CAAC,cAAc,CAAC,CAAC;YACvD,KAAK,EAAE,SAAS,CAAC;gBAChB,IAAI,EAAE,0BAA0B;gBAChC,cAAc,EAAE,IAAI;gBACpB,UAAU,EAAE,wBAAwB;gBACpC,IAAI,EAAE,mBAAmB;aACzB,CAAC;SACF;QACD,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC;QACzC,GAAG,EAAE,oBAAoB,EAAE;KAC3B,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { openAICompletionsApi } from \"../api/openai-completions.lazy.ts\";\nimport { envApiKeyAuth, lazyOAuth } from \"../auth/helpers.ts\";\nimport { loadKimiCodingOAuth } from \"../auth/oauth/load.ts\";\nimport { createProvider, type Provider } from \"../models.ts\";\nimport { KIMI_CODING_MODELS } from \"./kimi-coding.models.ts\";\n\nexport function kimiCodingProvider(): Provider<\"openai-completions\"> {\n\treturn createProvider({\n\t\tid: \"kimi-coding\",\n\t\tname: \"Kimi For Coding\",\n\t\tbaseUrl: \"https://api.kimi.com/coding/v1\",\n\t\tauth: {\n\t\t\tapiKey: envApiKeyAuth(\"Kimi API key\", [\"KIMI_API_KEY\"]),\n\t\t\toauth: lazyOAuth({\n\t\t\t\tname: \"Kimi Code (subscription)\",\n\t\t\t\tisSubscription: true,\n\t\t\t\tloginLabel: \"Sign in with Kimi Code\",\n\t\t\t\tload: loadKimiCodingOAuth,\n\t\t\t}),\n\t\t},\n\t\tmodels: Object.values(KIMI_CODING_MODELS),\n\t\tapi: openAICompletionsApi(),\n\t});\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-schema.d.ts","sourceRoot":"","sources":["../../src/providers/model-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAuB,IAAI,EAAE,MAAM,SAAS,CAAC;AAEjE,eAAO,MAAM,eAAe,YAAI,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAU,CAAC;AAC7F,eAAO,MAAM,qBAAqB,sEAAuC,CAAC;AAC1E,eAAO,MAAM,sBAAsB,YAAI,MAAM,EAAE,OAAO,CAAU,CAAC;AACjE,eAAO,MAAM,gBAAgB,YAAI,MAAM,EAAE,OAAO,EAAE,MAAM,CAAU,CAAC;AACnE,eAAO,MAAM,6BAA6B,YAAI,OAAO,EAAE,MAAM,CAAU,CAAC;AAExE,eAAO,MAAM,mBAAmB,kEAA6B,CAAC;AAC9D,eAAO,MAAM,wBAAwB,yEAAmC,CAAC;AACzE,eAAO,MAAM,wBAAwB,+BAAoC,CAAC;AAC1E,eAAO,MAAM,oBAAoB,uCAA8B,CAAC;AAGhE,eAAO,MAAM,sBAAsB;;;;;;;;
|
|
1
|
+
{"version":3,"file":"model-schema.d.ts","sourceRoot":"","sources":["../../src/providers/model-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAuB,IAAI,EAAE,MAAM,SAAS,CAAC;AAEjE,eAAO,MAAM,eAAe,YAAI,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAU,CAAC;AAC7F,eAAO,MAAM,qBAAqB,sEAAuC,CAAC;AAC1E,eAAO,MAAM,sBAAsB,YAAI,MAAM,EAAE,OAAO,CAAU,CAAC;AACjE,eAAO,MAAM,gBAAgB,YAAI,MAA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GAAG,MAAM,CAAC,OAAO,eAAe,CAAC,CAAC;AACvD,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,OAAO,6BAA6B,CAAC,CAAC;AACnF,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAC/E,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
|
@@ -9,9 +9,11 @@ export const ModelThinkingLevelSchema = Type.Enum(MODEL_THINKING_LEVELS);
|
|
|
9
9
|
export const ModelInputModalitySchema = Type.Enum(MODEL_INPUT_MODALITIES);
|
|
10
10
|
export const CacheRetentionSchema = Type.Enum(CACHE_RETENTIONS);
|
|
11
11
|
const ThinkingLevelMapValueSchema = Type.Union([Type.String(), Type.Null()]);
|
|
12
|
-
export const ThinkingLevelMapSchema = Type.Partial(Type.Record(ModelThinkingLevelSchema, ThinkingLevelMapValueSchema)
|
|
12
|
+
export const ThinkingLevelMapSchema = Type.Partial(Type.Record(ModelThinkingLevelSchema, ThinkingLevelMapValueSchema), {
|
|
13
|
+
description: "Provider value sent for each thinking level. null marks a level unsupported. Levels the model does not map use the provider's default value through high; xhigh and max are unsupported.",
|
|
14
|
+
});
|
|
13
15
|
export const ModelPromptCacheSchema = Type.Partial(Type.Record(Type.Enum(MODEL_PROMPT_CACHE_RETENTIONS), Type.Number({ exclusiveMinimum: 0 })), {
|
|
14
|
-
description: "Best-effort prompt cache lifetime in seconds for
|
|
16
|
+
description: "Best-effort prompt cache lifetime in seconds for the short and long retention tiers. Pi warms only tiers with a known lifetime.",
|
|
15
17
|
});
|
|
16
18
|
const ModelCostRatesProperties = {
|
|
17
19
|
input: Type.Number({ description: "Input cost in USD per million tokens." }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-schema.js","sourceRoot":"","sources":["../../src/providers/model-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoC,IAAI,EAAE,MAAM,SAAS,CA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O,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,+CAA+C,EAAE,CAAC,CAC1F;QACD,WAAW,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;KACtE,EACD,OAAO,CACP,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,6BAA6B,GAAG,uBAAuB,EAAE,CAAC;AAEvE,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI,CAAC,MAAM,CAAC;IACtD,MAAM,EAAE,IAAI,CAAC,QAAQ,CACpB,uBAAuB,CAAC;QACvB,WAAW,EAAE,mFAAmF;KAChG,CAAC,CACF;IACD,aAAa,EAAE,IAAI,CAAC,QAAQ,CAC3B,IAAI,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,kDAAkD,EAAE,CAAC,CAC7F;IACD,aAAa,EAAE,IAAI,CAAC,QAAQ,CAC3B,IAAI,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,sDAAsD,EAAE,CAAC,CACjG;CACD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC,MAAM,CAAC;IACjD,eAAe,EAAE,IAAI,CAAC,QAAQ,CAC7B,IAAI,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,oDAAoD,EAAE,CAAC,CAC/F;IACD,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,2BAA2B,CAAC;CAClD,CAAC,CAAC","sourcesContent":["import { type Static, type TSchemaOptions, Type } from \"typebox\";\n\nexport const THINKING_LEVELS = [\"minimal\", \"low\", \"medium\", \"high\", \"xhigh\", \"max\"] as const;\nexport const MODEL_THINKING_LEVELS = [\"off\", ...THINKING_LEVELS] as const;\nexport const MODEL_INPUT_MODALITIES = [\"text\", \"image\"] as const;\nexport const CACHE_RETENTIONS = [\"none\", \"short\", \"long\"] as const;\nexport const MODEL_PROMPT_CACHE_RETENTIONS = [\"short\", \"long\"] as const;\n\nexport const ThinkingLevelSchema = Type.Enum(THINKING_LEVELS);\nexport const ModelThinkingLevelSchema = Type.Enum(MODEL_THINKING_LEVELS);\nexport const ModelInputModalitySchema = Type.Enum(MODEL_INPUT_MODALITIES);\nexport const CacheRetentionSchema = Type.Enum(CACHE_RETENTIONS);\n\nconst ThinkingLevelMapValueSchema = Type.Union([Type.String(), Type.Null()]);\nexport const ThinkingLevelMapSchema = Type.Partial(Type.Record(ModelThinkingLevelSchema, ThinkingLevelMapValueSchema), {\n\tdescription:\n\t\t\"Provider value sent for each thinking level. null marks a level unsupported. Levels the model does not map use the provider's default value through high; xhigh and max are unsupported.\",\n});\n\nexport const ModelPromptCacheSchema = Type.Partial(\n\tType.Record(Type.Enum(MODEL_PROMPT_CACHE_RETENTIONS), Type.Number({ exclusiveMinimum: 0 })),\n\t{\n\t\tdescription:\n\t\t\t\"Best-effort prompt cache lifetime in seconds for the short and long retention tiers. Pi warms only tiers with a known lifetime.\",\n\t},\n);\n\nconst ModelCostRatesProperties = {\n\tinput: Type.Number({ description: \"Input cost in USD per million tokens.\" }),\n\toutput: Type.Number({ description: \"Output cost in USD per million tokens.\" }),\n\tcacheRead: Type.Number({ description: \"Cache-read cost in USD per million tokens.\" }),\n\tcacheWrite: Type.Number({ description: \"Cache-write cost in USD per million tokens.\" }),\n};\n\nexport const ModelCostRatesSchema = Type.Object(ModelCostRatesProperties);\nexport const ModelCostTierSchema = Type.Object({\n\tinputTokensAbove: Type.Number({\n\t\tdescription: \"Use this tier when total request input exceeds this token count.\",\n\t}),\n\t...ModelCostRatesProperties,\n});\nexport const ModelCostSchema = Type.Object({\n\t...ModelCostRatesProperties,\n\ttiers: Type.Optional(\n\t\tType.Array(ModelCostTierSchema, {\n\t\t\tdescription: \"Request-wide pricing tiers. The highest matching input threshold applies to the full request.\",\n\t\t}),\n\t),\n});\n\nfunction modelImageResizeOptions(options?: TSchemaOptions) {\n\treturn Type.Object(\n\t\t{\n\t\t\tmaxWidth: Type.Optional(Type.Integer({ minimum: 1 })),\n\t\t\tmaxHeight: Type.Optional(Type.Integer({ minimum: 1 })),\n\t\t\tmaxBytes: Type.Optional(\n\t\t\t\tType.Integer({ minimum: 1, description: \"Maximum base64-encoded payload size in bytes.\" }),\n\t\t\t),\n\t\t\tjpegQuality: Type.Optional(Type.Integer({ minimum: 1, maximum: 100 })),\n\t\t},\n\t\toptions,\n\t);\n}\n\nexport const ModelImageResizeOptionsSchema = modelImageResizeOptions();\n\nexport const ModelImageInputLimitsSchema = Type.Object({\n\tresize: Type.Optional(\n\t\tmodelImageResizeOptions({\n\t\t\tdescription: \"Cache-safe resize profile applied before a new image enters conversation history.\",\n\t\t}),\n\t),\n\tmaxPerMessage: Type.Optional(\n\t\tType.Integer({ minimum: 1, description: \"Maximum images accepted in one provider message.\" }),\n\t),\n\tmaxPerRequest: Type.Optional(\n\t\tType.Integer({ minimum: 1, description: \"Maximum images accepted across one provider request.\" }),\n\t),\n});\n\nexport const ModelInputLimitsSchema = Type.Object({\n\tmaxRequestBytes: Type.Optional(\n\t\tType.Integer({ minimum: 1, description: \"Maximum serialized provider request size in bytes.\" }),\n\t),\n\timages: Type.Optional(ModelImageInputLimitsSchema),\n});\n\nexport type ThinkingLevel = Static<typeof ThinkingLevelSchema>;\nexport type ModelThinkingLevel = Static<typeof ModelThinkingLevelSchema>;\nexport type ThinkingLevelMap = Static<typeof ThinkingLevelMapSchema>;\nexport type ModelInputModality = Static<typeof ModelInputModalitySchema>;\nexport type CacheRetention = Static<typeof CacheRetentionSchema>;\nexport type ModelPromptCache = Static<typeof ModelPromptCacheSchema>;\nexport type ModelCostRates = Static<typeof ModelCostRatesSchema>;\nexport type ModelCostTier = Static<typeof ModelCostTierSchema>;\nexport type ModelCost = Static<typeof ModelCostSchema>;\nexport type ModelImageResizeOptions = Static<typeof ModelImageResizeOptionsSchema>;\nexport type ModelImageInputLimits = Static<typeof ModelImageInputLimitsSchema>;\nexport type ModelInputLimits = Static<typeof ModelInputLimitsSchema>;\n"]}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { type Provider } from "../models.ts";
|
|
2
|
-
|
|
2
|
+
type OpenCodeGoApi = "anthropic-messages" | "google-generative-ai" | "openai-completions" | "openai-responses";
|
|
3
|
+
export declare function opencodeGoProvider(): Provider<OpenCodeGoApi>;
|
|
4
|
+
export {};
|
|
3
5
|
//# sourceMappingURL=opencode-go.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opencode-go.d.ts","sourceRoot":"","sources":["../../src/providers/opencode-go.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"opencode-go.d.ts","sourceRoot":"","sources":["../../src/providers/opencode-go.ts"],"names":[],"mappings":"AAKA,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAI7D,KAAK,aAAa,GAAG,oBAAoB,GAAG,sBAAsB,GAAG,oBAAoB,GAAG,kBAAkB,CAAC;AAE/G,wBAAgB,kBAAkB,IAAI,QAAQ,CAAC,aAAa,CAAC,CAa5D"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { anthropicMessagesApi } from "../api/anthropic-messages.lazy.js";
|
|
2
|
+
import { googleGenerativeAIApi } from "../api/google-generative-ai.lazy.js";
|
|
2
3
|
import { openAICompletionsApi } from "../api/openai-completions.lazy.js";
|
|
3
4
|
import { openAIResponsesApi } from "../api/openai-responses.lazy.js";
|
|
4
5
|
import { envApiKeyAuth } from "../auth/helpers.js";
|
|
@@ -13,6 +14,7 @@ export function opencodeGoProvider() {
|
|
|
13
14
|
models: Object.values(OPENCODE_GO_MODELS),
|
|
14
15
|
api: {
|
|
15
16
|
"anthropic-messages": withOpenCodeSessionHeader(anthropicMessagesApi()),
|
|
17
|
+
"google-generative-ai": withOpenCodeSessionHeader(googleGenerativeAIApi()),
|
|
16
18
|
"openai-completions": withOpenCodeSessionHeader(openAICompletionsApi()),
|
|
17
19
|
"openai-responses": withOpenCodeSessionHeader(openAIResponsesApi()),
|
|
18
20
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opencode-go.js","sourceRoot":"","sources":["../../src/providers/opencode-go.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAiB,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"opencode-go.js","sourceRoot":"","sources":["../../src/providers/opencode-go.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAiB,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAIlE,MAAM,UAAU,kBAAkB;IACjC,OAAO,cAAc,CAAgB;QACpC,EAAE,EAAE,aAAa;QACjB,IAAI,EAAE,aAAa;QACnB,IAAI,EAAE,EAAE,MAAM,EAAE,aAAa,CAAC,kBAAkB,EAAE,CAAC,kBAAkB,CAAC,CAAC,EAAE;QACzE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC;QACzC,GAAG,EAAE;YACJ,oBAAoB,EAAE,yBAAyB,CAAC,oBAAoB,EAAE,CAAC;YACvE,sBAAsB,EAAE,yBAAyB,CAAC,qBAAqB,EAAE,CAAC;YAC1E,oBAAoB,EAAE,yBAAyB,CAAC,oBAAoB,EAAE,CAAC;YACvE,kBAAkB,EAAE,yBAAyB,CAAC,kBAAkB,EAAE,CAAC;SACnE;KACD,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { anthropicMessagesApi } from \"../api/anthropic-messages.lazy.ts\";\nimport { googleGenerativeAIApi } from \"../api/google-generative-ai.lazy.ts\";\nimport { openAICompletionsApi } from \"../api/openai-completions.lazy.ts\";\nimport { openAIResponsesApi } from \"../api/openai-responses.lazy.ts\";\nimport { envApiKeyAuth } from \"../auth/helpers.ts\";\nimport { createProvider, type Provider } from \"../models.ts\";\nimport { OPENCODE_GO_MODELS } from \"./opencode-go.models.ts\";\nimport { withOpenCodeSessionHeader } from \"./opencode-headers.ts\";\n\ntype OpenCodeGoApi = \"anthropic-messages\" | \"google-generative-ai\" | \"openai-completions\" | \"openai-responses\";\n\nexport function opencodeGoProvider(): Provider<OpenCodeGoApi> {\n\treturn createProvider<OpenCodeGoApi>({\n\t\tid: \"opencode-go\",\n\t\tname: \"OpenCode Go\",\n\t\tauth: { apiKey: envApiKeyAuth(\"OpenCode API key\", [\"OPENCODE_API_KEY\"]) },\n\t\tmodels: Object.values(OPENCODE_GO_MODELS),\n\t\tapi: {\n\t\t\t\"anthropic-messages\": withOpenCodeSessionHeader(anthropicMessagesApi()),\n\t\t\t\"google-generative-ai\": withOpenCodeSessionHeader(googleGenerativeAIApi()),\n\t\t\t\"openai-completions\": withOpenCodeSessionHeader(openAICompletionsApi()),\n\t\t\t\"openai-responses\": withOpenCodeSessionHeader(openAIResponsesApi()),\n\t\t},\n\t});\n}\n"]}
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
import { type TelemetrySpan } from "@earendil-works/pi-telemetry";
|
|
2
|
+
import type { LazyStreamObserver } from "./api/lazy.ts";
|
|
3
|
+
import type { Api, Model } from "./types.ts";
|
|
4
|
+
/** Pi-owned request metadata, bounded error status, events, and low-cardinality metrics. */
|
|
5
|
+
export declare const AI_TELEMETRY_SCHEMA: {
|
|
6
|
+
readonly version: 1;
|
|
7
|
+
readonly spans: {
|
|
8
|
+
readonly "pi.ai.request": {
|
|
9
|
+
readonly description: "One logical model request, including authentication and provider setup.";
|
|
10
|
+
readonly parents: {
|
|
11
|
+
readonly kind: "any";
|
|
12
|
+
};
|
|
13
|
+
readonly startAttributes: {
|
|
14
|
+
readonly provider: {
|
|
15
|
+
readonly type: "string";
|
|
16
|
+
readonly description: "Provider identifier.";
|
|
17
|
+
readonly required: true;
|
|
18
|
+
};
|
|
19
|
+
readonly api: {
|
|
20
|
+
readonly type: "string";
|
|
21
|
+
readonly description: "API identifier.";
|
|
22
|
+
readonly required: true;
|
|
23
|
+
};
|
|
24
|
+
readonly model: {
|
|
25
|
+
readonly type: "string";
|
|
26
|
+
readonly description: "Requested model identifier.";
|
|
27
|
+
readonly required: true;
|
|
28
|
+
};
|
|
29
|
+
readonly reasoning: {
|
|
30
|
+
readonly type: "string";
|
|
31
|
+
readonly description: "Scalar requested reasoning level.";
|
|
32
|
+
readonly required: false;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
readonly endAttributes: {
|
|
36
|
+
readonly stop: {
|
|
37
|
+
readonly type: "string";
|
|
38
|
+
readonly description: "Normalized stop reason.";
|
|
39
|
+
readonly values: readonly ["pending", "stop", "length", "toolUse", "error", "aborted", "deferred"];
|
|
40
|
+
};
|
|
41
|
+
readonly "usage.input": {
|
|
42
|
+
readonly type: "number";
|
|
43
|
+
readonly description: "Uncached input tokens.";
|
|
44
|
+
};
|
|
45
|
+
readonly "usage.output": {
|
|
46
|
+
readonly type: "number";
|
|
47
|
+
readonly description: "Output tokens.";
|
|
48
|
+
};
|
|
49
|
+
readonly "usage.cache_read": {
|
|
50
|
+
readonly type: "number";
|
|
51
|
+
readonly description: "Cache-read tokens.";
|
|
52
|
+
};
|
|
53
|
+
readonly "usage.cache_write": {
|
|
54
|
+
readonly type: "number";
|
|
55
|
+
readonly description: "Cache-write tokens.";
|
|
56
|
+
};
|
|
57
|
+
readonly "cost.total": {
|
|
58
|
+
readonly type: "number";
|
|
59
|
+
readonly description: "Total request cost in USD.";
|
|
60
|
+
};
|
|
61
|
+
readonly "response.id": {
|
|
62
|
+
readonly type: "string";
|
|
63
|
+
readonly description: "Provider response identifier.";
|
|
64
|
+
readonly cardinality: "high";
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
readonly events: {
|
|
68
|
+
readonly "pi.ai.first_chunk": {
|
|
69
|
+
readonly description: "First normalized stream event delivered.";
|
|
70
|
+
readonly attributes: {};
|
|
71
|
+
};
|
|
72
|
+
readonly "pi.ai.block": {
|
|
73
|
+
readonly description: "A completed content block; content is never recorded.";
|
|
74
|
+
readonly attributes: {
|
|
75
|
+
readonly type: {
|
|
76
|
+
readonly type: "string";
|
|
77
|
+
readonly description: "Block kind.";
|
|
78
|
+
readonly values: readonly ["text", "thinking", "tool_call"];
|
|
79
|
+
readonly required: true;
|
|
80
|
+
};
|
|
81
|
+
readonly index: {
|
|
82
|
+
readonly type: "number";
|
|
83
|
+
readonly description: "Content block index.";
|
|
84
|
+
readonly required: true;
|
|
85
|
+
};
|
|
86
|
+
readonly chars: {
|
|
87
|
+
readonly type: "number";
|
|
88
|
+
readonly description: "UTF-16 character count.";
|
|
89
|
+
readonly required: true;
|
|
90
|
+
};
|
|
91
|
+
readonly tool: {
|
|
92
|
+
readonly type: "string";
|
|
93
|
+
readonly description: "Tool name, for tool-call blocks only.";
|
|
94
|
+
readonly required: false;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
readonly status: {
|
|
100
|
+
readonly default: "ok";
|
|
101
|
+
readonly errorWhen: "Stop reason is error: provider_error with at most 500 error-message characters. Aborted stays ok.";
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
readonly "pi.ai.poll": {
|
|
105
|
+
readonly parents: {
|
|
106
|
+
readonly kind: "any";
|
|
107
|
+
};
|
|
108
|
+
readonly startAttributes: {
|
|
109
|
+
readonly provider: {
|
|
110
|
+
readonly type: "string";
|
|
111
|
+
readonly description: "Provider identifier.";
|
|
112
|
+
readonly required: true;
|
|
113
|
+
};
|
|
114
|
+
readonly api: {
|
|
115
|
+
readonly type: "string";
|
|
116
|
+
readonly description: "API identifier.";
|
|
117
|
+
readonly required: true;
|
|
118
|
+
};
|
|
119
|
+
readonly model: {
|
|
120
|
+
readonly type: "string";
|
|
121
|
+
readonly description: "Requested model identifier.";
|
|
122
|
+
readonly required: true;
|
|
123
|
+
};
|
|
124
|
+
readonly reasoning: {
|
|
125
|
+
readonly type: "string";
|
|
126
|
+
readonly description: "Scalar requested reasoning level.";
|
|
127
|
+
readonly required: false;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
readonly endAttributes: {
|
|
131
|
+
readonly stop: {
|
|
132
|
+
readonly type: "string";
|
|
133
|
+
readonly description: "Normalized stop reason.";
|
|
134
|
+
readonly values: readonly ["pending", "stop", "length", "toolUse", "error", "aborted", "deferred"];
|
|
135
|
+
};
|
|
136
|
+
readonly "usage.input": {
|
|
137
|
+
readonly type: "number";
|
|
138
|
+
readonly description: "Uncached input tokens.";
|
|
139
|
+
};
|
|
140
|
+
readonly "usage.output": {
|
|
141
|
+
readonly type: "number";
|
|
142
|
+
readonly description: "Output tokens.";
|
|
143
|
+
};
|
|
144
|
+
readonly "usage.cache_read": {
|
|
145
|
+
readonly type: "number";
|
|
146
|
+
readonly description: "Cache-read tokens.";
|
|
147
|
+
};
|
|
148
|
+
readonly "usage.cache_write": {
|
|
149
|
+
readonly type: "number";
|
|
150
|
+
readonly description: "Cache-write tokens.";
|
|
151
|
+
};
|
|
152
|
+
readonly "cost.total": {
|
|
153
|
+
readonly type: "number";
|
|
154
|
+
readonly description: "Total request cost in USD.";
|
|
155
|
+
};
|
|
156
|
+
readonly "response.id": {
|
|
157
|
+
readonly type: "string";
|
|
158
|
+
readonly description: "Provider response identifier.";
|
|
159
|
+
readonly cardinality: "high";
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
readonly events: {
|
|
163
|
+
readonly "pi.ai.first_chunk": {
|
|
164
|
+
readonly description: "First normalized stream event delivered.";
|
|
165
|
+
readonly attributes: {};
|
|
166
|
+
};
|
|
167
|
+
readonly "pi.ai.block": {
|
|
168
|
+
readonly description: "A completed content block; content is never recorded.";
|
|
169
|
+
readonly attributes: {
|
|
170
|
+
readonly type: {
|
|
171
|
+
readonly type: "string";
|
|
172
|
+
readonly description: "Block kind.";
|
|
173
|
+
readonly values: readonly ["text", "thinking", "tool_call"];
|
|
174
|
+
readonly required: true;
|
|
175
|
+
};
|
|
176
|
+
readonly index: {
|
|
177
|
+
readonly type: "number";
|
|
178
|
+
readonly description: "Content block index.";
|
|
179
|
+
readonly required: true;
|
|
180
|
+
};
|
|
181
|
+
readonly chars: {
|
|
182
|
+
readonly type: "number";
|
|
183
|
+
readonly description: "UTF-16 character count.";
|
|
184
|
+
readonly required: true;
|
|
185
|
+
};
|
|
186
|
+
readonly tool: {
|
|
187
|
+
readonly type: "string";
|
|
188
|
+
readonly description: "Tool name, for tool-call blocks only.";
|
|
189
|
+
readonly required: false;
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
readonly status: {
|
|
195
|
+
readonly default: "ok";
|
|
196
|
+
readonly errorWhen: "Stop reason is error: provider_error with at most 500 error-message characters. Aborted stays ok.";
|
|
197
|
+
};
|
|
198
|
+
readonly description: "One deferred-response poll, not the deferred request's lifetime.";
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
readonly metrics: {
|
|
202
|
+
readonly "pi.ai.request.duration": {
|
|
203
|
+
readonly kind: "histogram";
|
|
204
|
+
readonly description: "Logical request or poll duration.";
|
|
205
|
+
readonly unit: "ms";
|
|
206
|
+
readonly attributes: {
|
|
207
|
+
readonly provider: {
|
|
208
|
+
readonly type: "string";
|
|
209
|
+
readonly description: "Provider identifier.";
|
|
210
|
+
readonly required: true;
|
|
211
|
+
};
|
|
212
|
+
readonly model: {
|
|
213
|
+
readonly type: "string";
|
|
214
|
+
readonly description: "Requested model identifier.";
|
|
215
|
+
readonly required: true;
|
|
216
|
+
};
|
|
217
|
+
readonly stop: {
|
|
218
|
+
readonly type: "string";
|
|
219
|
+
readonly description: "Normalized stop reason.";
|
|
220
|
+
readonly values: readonly ["pending", "stop", "length", "toolUse", "error", "aborted", "deferred"];
|
|
221
|
+
readonly required: true;
|
|
222
|
+
};
|
|
223
|
+
};
|
|
224
|
+
};
|
|
225
|
+
readonly "pi.ai.first_chunk.duration": {
|
|
226
|
+
readonly kind: "histogram";
|
|
227
|
+
readonly description: "Time to the first normalized stream event.";
|
|
228
|
+
readonly unit: "ms";
|
|
229
|
+
readonly attributes: {
|
|
230
|
+
readonly provider: {
|
|
231
|
+
readonly type: "string";
|
|
232
|
+
readonly description: "Provider identifier.";
|
|
233
|
+
readonly required: true;
|
|
234
|
+
};
|
|
235
|
+
readonly model: {
|
|
236
|
+
readonly type: "string";
|
|
237
|
+
readonly description: "Requested model identifier.";
|
|
238
|
+
readonly required: true;
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
readonly "pi.ai.tokens": {
|
|
243
|
+
readonly kind: "counter";
|
|
244
|
+
readonly description: "Reported model token usage; pending and deferred polls are excluded.";
|
|
245
|
+
readonly unit: "token";
|
|
246
|
+
readonly attributes: {
|
|
247
|
+
readonly provider: {
|
|
248
|
+
readonly type: "string";
|
|
249
|
+
readonly description: "Provider identifier.";
|
|
250
|
+
readonly required: true;
|
|
251
|
+
};
|
|
252
|
+
readonly model: {
|
|
253
|
+
readonly type: "string";
|
|
254
|
+
readonly description: "Requested model identifier.";
|
|
255
|
+
readonly required: true;
|
|
256
|
+
};
|
|
257
|
+
readonly kind: {
|
|
258
|
+
readonly type: "string";
|
|
259
|
+
readonly description: "Token usage category.";
|
|
260
|
+
readonly values: readonly ["input", "output", "cache_read", "cache_write"];
|
|
261
|
+
readonly required: true;
|
|
262
|
+
};
|
|
263
|
+
};
|
|
264
|
+
};
|
|
265
|
+
readonly "pi.ai.cost": {
|
|
266
|
+
readonly kind: "counter";
|
|
267
|
+
readonly description: "Reported model cost; pending and deferred polls are excluded.";
|
|
268
|
+
readonly unit: "USD";
|
|
269
|
+
readonly attributes: {
|
|
270
|
+
readonly provider: {
|
|
271
|
+
readonly type: "string";
|
|
272
|
+
readonly description: "Provider identifier.";
|
|
273
|
+
readonly required: true;
|
|
274
|
+
};
|
|
275
|
+
readonly model: {
|
|
276
|
+
readonly type: "string";
|
|
277
|
+
readonly description: "Requested model identifier.";
|
|
278
|
+
readonly required: true;
|
|
279
|
+
};
|
|
280
|
+
};
|
|
281
|
+
};
|
|
282
|
+
};
|
|
283
|
+
};
|
|
284
|
+
export declare function observeModelRequest(requestedModel: Model<Api>, options: {
|
|
285
|
+
telemetry?: TelemetrySpan;
|
|
286
|
+
reasoning?: unknown;
|
|
287
|
+
} | undefined, poll: boolean): LazyStreamObserver;
|
|
288
|
+
//# sourceMappingURL=telemetry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../src/telemetry.ts"],"names":[],"mappings":"AAAA,OAAO,EAQN,KAAK,aAAa,EAClB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAkD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