@prometheus-ai/ai 0.5.4 → 0.5.8
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/dist/types/auth-broker/remote-store.d.ts +2 -1
- package/dist/types/auth-broker/wire-schemas.d.ts +4 -1
- package/dist/types/auth-gateway/server.d.ts +19 -0
- package/dist/types/auth-gateway/types.d.ts +9 -3
- package/dist/types/auth-retry.d.ts +119 -0
- package/dist/types/auth-storage.d.ts +217 -8
- package/dist/types/errors.d.ts +24 -0
- package/dist/types/index.d.ts +5 -9
- package/dist/types/provider-details.d.ts +1 -1
- package/dist/types/providers/amazon-bedrock.d.ts +12 -6
- package/dist/types/providers/anthropic-client.d.ts +10 -3
- package/dist/types/providers/anthropic-messages-server-schema.d.ts +2 -2
- package/dist/types/providers/anthropic-messages-server.d.ts +3 -3
- package/dist/types/providers/anthropic-wire.d.ts +3 -3
- package/dist/types/providers/anthropic.d.ts +41 -34
- package/dist/types/providers/aws-credentials.d.ts +8 -0
- package/dist/types/providers/azure-openai-responses.d.ts +1 -0
- package/dist/types/providers/google-gemini-cli.d.ts +22 -1
- package/dist/types/providers/google-shared.d.ts +22 -0
- package/dist/types/providers/google-types.d.ts +13 -1
- package/dist/types/providers/mock.d.ts +8 -3
- package/dist/types/providers/ollama.d.ts +6 -0
- package/dist/types/providers/openai-chat-server-schema.d.ts +6 -3
- package/dist/types/providers/openai-chat-server.d.ts +3 -3
- package/dist/types/providers/openai-chat-wire.d.ts +644 -0
- package/dist/types/providers/openai-codex/request-transformer.d.ts +8 -0
- package/dist/types/providers/openai-codex/response-handler.d.ts +9 -0
- package/dist/types/providers/openai-codex-responses.d.ts +31 -2
- package/dist/types/providers/openai-completions-compat.d.ts +2 -25
- package/dist/types/providers/openai-completions.d.ts +2 -10
- package/dist/types/providers/openai-responses-server-schema.d.ts +4 -4
- package/dist/types/providers/openai-responses-server.d.ts +2 -2
- package/dist/types/providers/openai-responses-shared.d.ts +49 -9
- package/dist/types/providers/openai-responses-wire.d.ts +6065 -0
- package/dist/types/providers/openai-responses.d.ts +13 -4
- package/dist/types/providers/prometheus-native-client.d.ts +9 -0
- package/dist/types/providers/prometheus-native-server.d.ts +4 -3
- package/dist/types/providers/transform-messages.d.ts +1 -2
- package/dist/types/rate-limit-utils.d.ts +3 -2
- package/dist/types/registry/aimlapi.d.ts +4 -0
- package/dist/types/registry/alibaba-coding-plan.d.ts +7 -0
- package/dist/types/registry/amazon-bedrock.d.ts +5 -0
- package/dist/types/registry/anthropic.d.ts +10 -0
- package/dist/types/{utils/oauth → registry}/api-key-login.d.ts +8 -2
- package/dist/types/{utils/oauth → registry}/api-key-validation.d.ts +15 -0
- package/dist/types/registry/cerebras.d.ts +7 -0
- package/dist/types/registry/cloudflare-ai-gateway.d.ts +13 -0
- package/dist/types/registry/cursor.d.ts +7 -0
- package/dist/types/registry/deepseek.d.ts +8 -0
- package/dist/types/registry/derived.d.ts +5 -0
- package/dist/types/registry/firepass.d.ts +16 -0
- package/dist/types/registry/fireworks.d.ts +7 -0
- package/dist/types/registry/github-copilot.d.ts +7 -0
- package/dist/types/registry/gitlab-duo.d.ts +9 -0
- package/dist/types/registry/google-antigravity.d.ts +9 -0
- package/dist/types/registry/google-gemini-cli.d.ts +9 -0
- package/dist/types/registry/google-vertex.d.ts +5 -0
- package/dist/types/registry/google.d.ts +4 -0
- package/dist/types/registry/groq.d.ts +4 -0
- package/dist/types/registry/huggingface.d.ts +7 -0
- package/dist/types/registry/index.d.ts +4 -0
- package/dist/types/registry/kagi.d.ts +14 -0
- package/dist/types/registry/kilo.d.ts +7 -0
- package/dist/types/registry/kimi-code.d.ts +7 -0
- package/dist/types/registry/litellm.d.ts +13 -0
- package/dist/types/registry/lm-studio.d.ts +8 -0
- package/dist/types/registry/minimax-code-cn.d.ts +6 -0
- package/dist/types/registry/minimax-code.d.ts +6 -0
- package/dist/types/registry/minimax.d.ts +4 -0
- package/dist/types/registry/mistral.d.ts +4 -0
- package/dist/types/registry/moonshot.d.ts +7 -0
- package/dist/types/registry/nanogpt.d.ts +7 -0
- package/dist/types/registry/nvidia.d.ts +7 -0
- package/dist/types/registry/oauth/__tests__/xai-oauth.test.d.ts +1 -0
- package/dist/types/{utils → registry}/oauth/anthropic.d.ts +2 -1
- package/dist/types/{utils → registry}/oauth/github-copilot.d.ts +15 -23
- package/dist/types/{utils → registry}/oauth/index.d.ts +1 -0
- package/dist/types/{utils → registry}/oauth/minimax-code.d.ts +5 -5
- package/dist/types/{utils → registry}/oauth/types.d.ts +6 -1
- package/dist/types/{utils → registry}/oauth/xai-oauth.d.ts +2 -1
- package/dist/types/registry/ollama-cloud.d.ts +7 -0
- package/dist/types/registry/ollama.d.ts +12 -0
- package/dist/types/registry/openai-codex-device.d.ts +8 -0
- package/dist/types/registry/openai-codex.d.ts +9 -0
- package/dist/types/registry/openai.d.ts +4 -0
- package/dist/types/registry/opencode-go.d.ts +6 -0
- package/dist/types/registry/opencode-zen.d.ts +6 -0
- package/dist/types/registry/openrouter.d.ts +13 -0
- package/dist/types/registry/parallel.d.ts +14 -0
- package/dist/types/registry/perplexity.d.ts +7 -0
- package/dist/types/registry/qianfan.d.ts +7 -0
- package/dist/types/registry/qwen-portal.d.ts +7 -0
- package/dist/types/registry/registry.d.ts +272 -0
- package/dist/types/registry/synthetic.d.ts +6 -0
- package/dist/types/registry/tavily.d.ts +14 -0
- package/dist/types/registry/together.d.ts +6 -0
- package/dist/types/registry/types.d.ts +51 -0
- package/dist/types/registry/venice.d.ts +13 -0
- package/dist/types/registry/vercel-ai-gateway.d.ts +7 -0
- package/dist/types/registry/vllm.d.ts +7 -0
- package/dist/types/registry/wafer-pass.d.ts +6 -0
- package/dist/types/registry/wafer-serverless.d.ts +6 -0
- package/dist/types/registry/xai-oauth.d.ts +7 -0
- package/dist/types/registry/xai.d.ts +4 -0
- package/dist/types/registry/xiaomi-token-plan-ams.d.ts +6 -0
- package/dist/types/registry/xiaomi-token-plan-cn.d.ts +6 -0
- package/dist/types/registry/xiaomi-token-plan-sgp.d.ts +6 -0
- package/dist/types/registry/xiaomi.d.ts +6 -0
- package/dist/types/registry/zai.d.ts +7 -0
- package/dist/types/registry/zenmux.d.ts +7 -0
- package/dist/types/registry/zhipu-coding-plan.d.ts +7 -0
- package/dist/types/stream.d.ts +9 -1
- package/dist/types/types.d.ts +56 -295
- package/dist/types/usage/google-antigravity.d.ts +15 -1
- package/dist/types/usage/openai-codex-reset.d.ts +79 -0
- package/dist/types/usage/openai-codex.d.ts +1 -0
- package/dist/types/usage.d.ts +77 -4
- package/dist/types/utils/abort.d.ts +6 -0
- package/dist/types/utils/event-stream.d.ts +2 -0
- package/dist/types/utils/http-inspector.d.ts +0 -1
- package/dist/types/utils/idle-iterator.d.ts +35 -0
- package/dist/types/utils/openai-http.d.ts +58 -0
- package/dist/types/utils/request-debug.d.ts +3 -0
- package/dist/types/utils/retry-after.d.ts +1 -0
- package/dist/types/utils/schema/fields.d.ts +5 -0
- package/dist/types/utils/schema/json-schema-validator.d.ts +8 -0
- package/dist/types/utils/schema/stamps.d.ts +7 -15
- package/dist/types/utils/sse-debug.d.ts +0 -5
- package/dist/types/utils/stream-markup-healing.d.ts +2 -0
- package/dist/types/utils.d.ts +1 -5
- package/package.json +17 -29
- package/src/auth-broker/remote-store.ts +10 -1
- package/src/auth-broker/snapshot-cache.ts +1 -1
- package/src/auth-broker/wire-schemas.ts +1 -1
- package/src/auth-gateway/http.ts +1 -1
- package/src/auth-gateway/server.ts +95 -30
- package/src/auth-gateway/types.ts +10 -2
- package/src/auth-retry.ts +238 -0
- package/src/auth-storage.ts +935 -430
- package/src/errors.ts +32 -0
- package/src/index.ts +9 -14
- package/src/provider-details.ts +1 -1
- package/src/providers/__tests__/google-auth.test.ts +144 -0
- package/src/providers/amazon-bedrock.ts +70 -40
- package/src/providers/anthropic-client.ts +15 -13
- package/src/providers/anthropic-messages-server-schema.ts +17 -7
- package/src/providers/anthropic-messages-server.ts +88 -20
- package/src/providers/anthropic-wire.ts +4 -3
- package/src/providers/anthropic.ts +1234 -621
- package/src/providers/aws-credentials.ts +47 -5
- package/src/providers/aws-eventstream.ts +5 -0
- package/src/providers/azure-openai-responses.ts +117 -67
- package/src/providers/cursor.ts +30 -30
- package/src/providers/github-copilot-headers.ts +1 -1
- package/src/providers/gitlab-duo.ts +36 -29
- package/src/providers/google-auth.ts +71 -8
- package/src/providers/google-gemini-cli.ts +118 -22
- package/src/providers/google-shared.ts +163 -43
- package/src/providers/google-types.ts +10 -1
- package/src/providers/kimi.ts +1 -1
- package/src/providers/mock.ts +11 -3
- package/src/providers/ollama.ts +64 -7
- package/src/providers/openai-anthropic-shim.ts +17 -8
- package/src/providers/openai-chat-server-schema.ts +9 -3
- package/src/providers/openai-chat-server.ts +82 -16
- package/src/providers/openai-chat-wire.ts +847 -0
- package/src/providers/openai-codex/request-transformer.ts +129 -34
- package/src/providers/openai-codex/response-handler.ts +22 -1
- package/src/providers/openai-codex-responses.ts +699 -247
- package/src/providers/openai-completions-compat.ts +8 -308
- package/src/providers/openai-completions.ts +416 -267
- package/src/providers/openai-responses-server-schema.ts +15 -9
- package/src/providers/openai-responses-server.ts +162 -114
- package/src/providers/openai-responses-shared.ts +320 -82
- package/src/providers/openai-responses-wire.ts +6391 -0
- package/src/providers/openai-responses.ts +382 -176
- package/src/providers/prometheus-native-client.ts +27 -11
- package/src/providers/prometheus-native-server.ts +44 -17
- package/src/providers/transform-messages.ts +311 -120
- package/src/providers/vision-guard.ts +5 -3
- package/src/rate-limit-utils.ts +13 -3
- package/src/registry/aimlapi.ts +6 -0
- package/src/{utils/oauth → registry}/alibaba-coding-plan.ts +8 -18
- package/src/registry/amazon-bedrock.ts +22 -0
- package/src/registry/anthropic.ts +26 -0
- package/src/{utils/oauth → registry}/api-key-login.ts +25 -3
- package/src/{utils/oauth → registry}/api-key-validation.ts +62 -2
- package/src/{utils/oauth → registry}/cerebras.ts +8 -1
- package/src/{utils/oauth → registry}/cloudflare-ai-gateway.ts +8 -12
- package/src/registry/cursor.ts +20 -0
- package/src/{utils/oauth → registry}/deepseek.ts +9 -17
- package/src/registry/derived.ts +9 -0
- package/src/{utils/oauth → registry}/firepass.ts +10 -2
- package/src/{utils/oauth → registry}/fireworks.ts +8 -1
- package/src/registry/github-copilot.ts +22 -0
- package/src/registry/gitlab-duo.ts +19 -0
- package/src/registry/google-antigravity.ts +21 -0
- package/src/registry/google-gemini-cli.ts +21 -0
- package/src/registry/google-vertex.ts +38 -0
- package/src/registry/google.ts +6 -0
- package/src/registry/groq.ts +6 -0
- package/src/{utils/oauth → registry}/huggingface.ts +8 -19
- package/src/registry/index.ts +4 -0
- package/src/{utils/oauth → registry}/kagi.ts +9 -11
- package/src/{utils/oauth → registry}/kilo.ts +11 -6
- package/src/registry/kimi-code.ts +17 -0
- package/src/{utils/oauth → registry}/litellm.ts +8 -12
- package/src/{utils/oauth → registry}/lm-studio.ts +9 -17
- package/src/registry/minimax-code-cn.ts +12 -0
- package/src/registry/minimax-code.ts +12 -0
- package/src/registry/minimax.ts +6 -0
- package/src/registry/mistral.ts +6 -0
- package/src/{utils/oauth → registry}/moonshot.ts +8 -9
- package/src/{utils/oauth → registry}/nanogpt.ts +8 -1
- package/src/{utils/oauth → registry}/nvidia.ts +8 -18
- package/src/{utils → registry}/oauth/__tests__/xai-oauth.test.ts +4 -7
- package/src/{utils → registry}/oauth/anthropic.ts +38 -17
- package/src/{utils → registry}/oauth/github-copilot.ts +79 -115
- package/src/registry/oauth/gitlab-duo.ts +198 -0
- package/src/{utils → registry}/oauth/google-antigravity.ts +1 -4
- package/src/{utils → registry}/oauth/google-gemini-cli.ts +1 -4
- package/src/registry/oauth/index.ts +164 -0
- package/src/{utils → registry}/oauth/minimax-code.ts +16 -14
- package/src/{utils → registry}/oauth/types.ts +7 -51
- package/src/{utils → registry}/oauth/wafer.ts +1 -1
- package/src/{utils → registry}/oauth/xai-oauth.ts +16 -8
- package/src/{utils → registry}/oauth/xiaomi.ts +9 -4
- package/src/{utils/oauth → registry}/ollama-cloud.ts +8 -1
- package/src/{utils/oauth → registry}/ollama.ts +8 -13
- package/src/registry/openai-codex-device.ts +18 -0
- package/src/registry/openai-codex.ts +19 -0
- package/src/registry/openai.ts +6 -0
- package/src/registry/opencode-go.ts +12 -0
- package/src/registry/opencode-zen.ts +12 -0
- package/src/{utils/oauth → registry}/openrouter.ts +10 -2
- package/src/{utils/oauth → registry}/parallel.ts +9 -11
- package/src/registry/perplexity.ts +13 -0
- package/src/{utils/oauth → registry}/qianfan.ts +8 -17
- package/src/{utils/oauth → registry}/qwen-portal.ts +8 -19
- package/src/registry/registry.ts +149 -0
- package/src/{utils/oauth → registry}/synthetic.ts +7 -1
- package/src/{utils/oauth → registry}/tavily.ts +10 -12
- package/src/{utils/oauth → registry}/together.ts +7 -1
- package/src/registry/types.ts +56 -0
- package/src/{utils/oauth → registry}/venice.ts +8 -12
- package/src/{utils/oauth → registry}/vercel-ai-gateway.ts +8 -18
- package/src/{utils/oauth → registry}/vllm.ts +9 -16
- package/src/registry/wafer-pass.ts +12 -0
- package/src/registry/wafer-serverless.ts +12 -0
- package/src/registry/xai-oauth.ts +17 -0
- package/src/registry/xai.ts +6 -0
- package/src/registry/xiaomi-token-plan-ams.ts +12 -0
- package/src/registry/xiaomi-token-plan-cn.ts +12 -0
- package/src/registry/xiaomi-token-plan-sgp.ts +12 -0
- package/src/registry/xiaomi.ts +12 -0
- package/src/{utils/oauth → registry}/zai.ts +10 -22
- package/src/{utils/oauth → registry}/zenmux.ts +8 -1
- package/src/{utils/oauth/zhipu.ts → registry/zhipu-coding-plan.ts} +9 -21
- package/src/stream.ts +229 -199
- package/src/types.ts +63 -384
- package/src/usage/claude.ts +4 -2
- package/src/usage/github-copilot.ts +4 -2
- package/src/usage/google-antigravity.ts +196 -28
- package/src/usage/kimi.ts +1 -1
- package/src/usage/minimax-code.ts +5 -6
- package/src/usage/openai-codex-reset.ts +174 -0
- package/src/usage/openai-codex.ts +19 -2
- package/src/usage/zai.ts +2 -1
- package/src/usage.ts +93 -4
- package/src/utils/abort.ts +14 -0
- package/src/utils/event-stream.ts +17 -0
- package/src/utils/http-inspector.ts +4 -12
- package/src/utils/idle-iterator.ts +250 -79
- package/src/utils/openai-http.ts +157 -0
- package/src/utils/request-debug.ts +67 -19
- package/src/utils/retry-after.ts +1 -1
- package/src/utils/retry.ts +23 -2
- package/src/utils/schema/CONSTRAINTS.md +4 -2
- package/src/utils/schema/fields.ts +16 -0
- package/src/utils/schema/json-schema-validator.ts +19 -1
- package/src/utils/schema/normalize.ts +80 -8
- package/src/utils/schema/stamps.ts +22 -10
- package/src/utils/schema/wire.ts +2 -2
- package/src/utils/sse-debug.ts +0 -271
- package/src/utils/stream-markup-healing.ts +50 -8
- package/src/utils/validation.ts +49 -13
- package/src/utils.ts +2 -26
- package/dist/types/model-cache.d.ts +0 -17
- package/dist/types/model-manager.d.ts +0 -64
- package/dist/types/model-thinking.d.ts +0 -100
- package/dist/types/models.d.ts +0 -12
- package/dist/types/provider-models/bundled-references.d.ts +0 -4
- package/dist/types/provider-models/descriptors.d.ts +0 -50
- package/dist/types/provider-models/google.d.ts +0 -24
- package/dist/types/provider-models/index.d.ts +0 -5
- package/dist/types/provider-models/ollama.d.ts +0 -7
- package/dist/types/provider-models/openai-compat.d.ts +0 -323
- package/dist/types/provider-models/special.d.ts +0 -16
- package/dist/types/utils/discovery/antigravity.d.ts +0 -61
- package/dist/types/utils/discovery/codex.d.ts +0 -38
- package/dist/types/utils/discovery/cursor.d.ts +0 -23
- package/dist/types/utils/discovery/gemini.d.ts +0 -25
- package/dist/types/utils/discovery/index.d.ts +0 -4
- package/dist/types/utils/discovery/openai-compatible.d.ts +0 -72
- package/dist/types/utils/oauth/alibaba-coding-plan.d.ts +0 -18
- package/dist/types/utils/oauth/cerebras.d.ts +0 -1
- package/dist/types/utils/oauth/cloudflare-ai-gateway.d.ts +0 -18
- package/dist/types/utils/oauth/deepseek.d.ts +0 -10
- package/dist/types/utils/oauth/firepass.d.ts +0 -1
- package/dist/types/utils/oauth/fireworks.d.ts +0 -1
- package/dist/types/utils/oauth/huggingface.d.ts +0 -19
- package/dist/types/utils/oauth/kagi.d.ts +0 -17
- package/dist/types/utils/oauth/kilo.d.ts +0 -5
- package/dist/types/utils/oauth/litellm.d.ts +0 -18
- package/dist/types/utils/oauth/lm-studio.d.ts +0 -17
- package/dist/types/utils/oauth/moonshot.d.ts +0 -1
- package/dist/types/utils/oauth/nanogpt.d.ts +0 -1
- package/dist/types/utils/oauth/nvidia.d.ts +0 -18
- package/dist/types/utils/oauth/ollama-cloud.d.ts +0 -2
- package/dist/types/utils/oauth/ollama.d.ts +0 -18
- package/dist/types/utils/oauth/openrouter.d.ts +0 -1
- package/dist/types/utils/oauth/parallel.d.ts +0 -17
- package/dist/types/utils/oauth/qianfan.d.ts +0 -17
- package/dist/types/utils/oauth/qwen-portal.d.ts +0 -19
- package/dist/types/utils/oauth/synthetic.d.ts +0 -1
- package/dist/types/utils/oauth/tavily.d.ts +0 -17
- package/dist/types/utils/oauth/together.d.ts +0 -1
- package/dist/types/utils/oauth/venice.d.ts +0 -18
- package/dist/types/utils/oauth/vercel-ai-gateway.d.ts +0 -18
- package/dist/types/utils/oauth/vllm.d.ts +0 -16
- package/dist/types/utils/oauth/zai.d.ts +0 -18
- package/dist/types/utils/oauth/zenmux.d.ts +0 -1
- package/dist/types/utils/oauth/zhipu.d.ts +0 -18
- package/src/model-cache.ts +0 -129
- package/src/model-manager.ts +0 -469
- package/src/model-thinking.ts +0 -756
- package/src/models.json +0 -60287
- package/src/models.json.d.ts +0 -9
- package/src/models.ts +0 -56
- package/src/provider-models/bundled-references.ts +0 -38
- package/src/provider-models/descriptors.ts +0 -364
- package/src/provider-models/google.ts +0 -88
- package/src/provider-models/index.ts +0 -5
- package/src/provider-models/ollama.ts +0 -153
- package/src/provider-models/openai-compat.ts +0 -2904
- package/src/provider-models/special.ts +0 -67
- package/src/utils/discovery/antigravity.ts +0 -261
- package/src/utils/discovery/codex.ts +0 -371
- package/src/utils/discovery/cursor.ts +0 -306
- package/src/utils/discovery/gemini.ts +0 -248
- package/src/utils/discovery/index.ts +0 -4
- package/src/utils/discovery/openai-compatible.ts +0 -224
- package/src/utils/oauth/gitlab-duo.ts +0 -123
- package/src/utils/oauth/index.ts +0 -502
- /package/dist/types/{utils/oauth/__tests__/xai-oauth.test.d.ts → providers/__tests__/google-auth.test.d.ts} +0 -0
- /package/dist/types/{utils → registry}/oauth/callback-server.d.ts +0 -0
- /package/dist/types/{utils → registry}/oauth/cursor.d.ts +0 -0
- /package/dist/types/{utils → registry}/oauth/gitlab-duo.d.ts +0 -0
- /package/dist/types/{utils → registry}/oauth/google-antigravity.d.ts +0 -0
- /package/dist/types/{utils → registry}/oauth/google-gemini-cli.d.ts +0 -0
- /package/dist/types/{utils → registry}/oauth/google-oauth-shared.d.ts +0 -0
- /package/dist/types/{utils → registry}/oauth/kimi.d.ts +0 -0
- /package/dist/types/{utils → registry}/oauth/openai-codex.d.ts +0 -0
- /package/dist/types/{utils → registry}/oauth/opencode.d.ts +0 -0
- /package/dist/types/{utils → registry}/oauth/perplexity.d.ts +0 -0
- /package/dist/types/{utils → registry}/oauth/pkce.d.ts +0 -0
- /package/dist/types/{utils → registry}/oauth/wafer.d.ts +0 -0
- /package/dist/types/{utils → registry}/oauth/xiaomi.d.ts +0 -0
- /package/src/{utils → registry}/oauth/callback-server.ts +0 -0
- /package/src/{utils → registry}/oauth/cursor.ts +0 -0
- /package/src/{utils → registry}/oauth/google-oauth-shared.ts +0 -0
- /package/src/{utils → registry}/oauth/kimi.ts +0 -0
- /package/src/{utils → registry}/oauth/oauth.html +0 -0
- /package/src/{utils → registry}/oauth/openai-codex.ts +0 -0
- /package/src/{utils → registry}/oauth/opencode.ts +0 -0
- /package/src/{utils → registry}/oauth/perplexity.ts +0 -0
- /package/src/{utils → registry}/oauth/pkce.ts +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { OAuthController, OAuthLoginCallbacks } from "./oauth/types";
|
|
2
|
+
export declare function loginOllamaCloud(options: OAuthController): Promise<string>;
|
|
3
|
+
export declare const ollamaCloudProvider: {
|
|
4
|
+
readonly id: "ollama-cloud";
|
|
5
|
+
readonly name: "Ollama Cloud";
|
|
6
|
+
readonly login: (cb: OAuthLoginCallbacks) => Promise<string>;
|
|
7
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { OAuthController } from "./oauth/types";
|
|
2
|
+
/**
|
|
3
|
+
* Login to Ollama.
|
|
4
|
+
*
|
|
5
|
+
* Returns a trimmed API key/token string. Empty string means local no-auth mode.
|
|
6
|
+
*/
|
|
7
|
+
export declare function loginOllama(options: OAuthController): Promise<string>;
|
|
8
|
+
export declare const ollamaProvider: {
|
|
9
|
+
readonly id: "ollama";
|
|
10
|
+
readonly name: "Ollama (Local OpenAI-compatible)";
|
|
11
|
+
readonly login: typeof loginOllama;
|
|
12
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { OAuthCredentials, OAuthLoginCallbacks } from "./oauth/types";
|
|
2
|
+
export declare const openaiCodexDeviceProvider: {
|
|
3
|
+
readonly id: "openai-codex-device";
|
|
4
|
+
readonly name: "ChatGPT Plus/Pro (Codex, headless/device)";
|
|
5
|
+
readonly login: (cb: OAuthLoginCallbacks) => Promise<OAuthCredentials>;
|
|
6
|
+
readonly refreshToken: (credentials: OAuthCredentials) => Promise<OAuthCredentials>;
|
|
7
|
+
readonly storeCredentialsAs: "openai-codex";
|
|
8
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { OAuthCredentials, OAuthLoginCallbacks } from "./oauth/types";
|
|
2
|
+
export declare const openaiCodexProvider: {
|
|
3
|
+
readonly id: "openai-codex";
|
|
4
|
+
readonly name: "ChatGPT Plus/Pro (Codex Subscription)";
|
|
5
|
+
readonly login: (cb: OAuthLoginCallbacks) => Promise<OAuthCredentials>;
|
|
6
|
+
readonly refreshToken: (credentials: OAuthCredentials) => Promise<OAuthCredentials>;
|
|
7
|
+
readonly callbackPort: 1455;
|
|
8
|
+
readonly pasteCodeFlow: true;
|
|
9
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { OAuthLoginCallbacks } from "./oauth/types";
|
|
2
|
+
/** OpenRouter login flow (API key paste, validated via /auth/key).
|
|
3
|
+
*
|
|
4
|
+
* `/api/v1/models` is public and returns 200 for any bearer (including bogus),
|
|
5
|
+
* so it cannot validate auth. `/api/v1/auth/key` is the canonical "who am I"
|
|
6
|
+
* endpoint — 200 for valid keys, 401 otherwise.
|
|
7
|
+
*/
|
|
8
|
+
export declare const loginOpenRouter: (options: import("./oauth").OAuthController) => Promise<string>;
|
|
9
|
+
export declare const openrouterProvider: {
|
|
10
|
+
readonly id: "openrouter";
|
|
11
|
+
readonly name: "OpenRouter";
|
|
12
|
+
readonly login: (cb: OAuthLoginCallbacks) => Promise<string>;
|
|
13
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { OAuthController, OAuthLoginCallbacks } from "./oauth/types";
|
|
2
|
+
/**
|
|
3
|
+
* Login to Parallel.
|
|
4
|
+
*
|
|
5
|
+
* Opens browser to the API keys page, prompts the user to paste their API key,
|
|
6
|
+
* and returns the API key directly.
|
|
7
|
+
*/
|
|
8
|
+
export declare function loginParallel(options: OAuthController): Promise<string>;
|
|
9
|
+
export declare const parallelProvider: {
|
|
10
|
+
readonly id: "parallel";
|
|
11
|
+
readonly name: "Parallel";
|
|
12
|
+
readonly envKeys: "PARALLEL_API_KEY";
|
|
13
|
+
readonly login: (cb: OAuthLoginCallbacks) => Promise<string>;
|
|
14
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { OAuthLoginCallbacks } from "./oauth/types";
|
|
2
|
+
export declare const perplexityProvider: {
|
|
3
|
+
readonly id: "perplexity";
|
|
4
|
+
readonly name: "Perplexity (Pro/Max)";
|
|
5
|
+
readonly envKeys: "PERPLEXITY_API_KEY";
|
|
6
|
+
readonly login: (cb: OAuthLoginCallbacks) => Promise<import("./oauth").OAuthCredentials>;
|
|
7
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { OAuthController, OAuthLoginCallbacks } from "./oauth/types";
|
|
2
|
+
export declare function loginQianfan(options: OAuthController): Promise<string>;
|
|
3
|
+
export declare const qianfanProvider: {
|
|
4
|
+
readonly id: "qianfan";
|
|
5
|
+
readonly name: "Qianfan";
|
|
6
|
+
readonly login: (cb: OAuthLoginCallbacks) => Promise<string>;
|
|
7
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { OAuthController, OAuthLoginCallbacks } from "./oauth/types";
|
|
2
|
+
export declare function loginQwenPortal(options: OAuthController): Promise<string>;
|
|
3
|
+
export declare const qwenPortalProvider: {
|
|
4
|
+
readonly id: "qwen-portal";
|
|
5
|
+
readonly name: "Qwen Portal";
|
|
6
|
+
readonly login: (cb: OAuthLoginCallbacks) => Promise<string>;
|
|
7
|
+
};
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import type { ProviderDefinition } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* The single per-provider list. Adding a provider = create `./providers/<id>.ts`
|
|
4
|
+
* and add its export here. Every legacy structure (`KnownProvider`/`OAuthProvider`
|
|
5
|
+
* unions, descriptors, env map, login list, refresh/login dispatch, CLI callback
|
|
6
|
+
* maps) is derived from this registry. Order matches the interactive `/login`
|
|
7
|
+
* list for the loginable providers; non-login model providers are appended.
|
|
8
|
+
*/
|
|
9
|
+
declare const ALL: ({
|
|
10
|
+
readonly id: "aimlapi";
|
|
11
|
+
readonly name: "AIML API";
|
|
12
|
+
} | {
|
|
13
|
+
readonly id: "alibaba-coding-plan";
|
|
14
|
+
readonly name: "Alibaba Coding Plan";
|
|
15
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<string>;
|
|
16
|
+
} | {
|
|
17
|
+
readonly id: "amazon-bedrock";
|
|
18
|
+
readonly name: "Amazon Bedrock";
|
|
19
|
+
readonly envKeys: () => "<authenticated>" | undefined;
|
|
20
|
+
} | {
|
|
21
|
+
readonly id: "anthropic";
|
|
22
|
+
readonly name: "Anthropic (Claude Pro/Max)";
|
|
23
|
+
readonly envKeys: () => string | undefined;
|
|
24
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<import("./oauth").OAuthCredentials>;
|
|
25
|
+
readonly refreshToken: (credentials: import("./oauth").OAuthCredentials) => Promise<import("./oauth").OAuthCredentials>;
|
|
26
|
+
readonly callbackPort: 54545;
|
|
27
|
+
readonly pasteCodeFlow: true;
|
|
28
|
+
} | {
|
|
29
|
+
readonly id: "cerebras";
|
|
30
|
+
readonly name: "Cerebras";
|
|
31
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<string>;
|
|
32
|
+
} | {
|
|
33
|
+
readonly id: "cloudflare-ai-gateway";
|
|
34
|
+
readonly name: "Cloudflare AI Gateway";
|
|
35
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<string>;
|
|
36
|
+
} | {
|
|
37
|
+
readonly id: "cursor";
|
|
38
|
+
readonly name: "Cursor (Claude, GPT, etc.)";
|
|
39
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<import("./oauth").OAuthCredentials>;
|
|
40
|
+
readonly refreshToken: (credentials: import("./oauth").OAuthCredentials) => Promise<import("./oauth").OAuthCredentials>;
|
|
41
|
+
} | {
|
|
42
|
+
readonly id: "deepseek";
|
|
43
|
+
readonly name: "DeepSeek";
|
|
44
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<string>;
|
|
45
|
+
} | {
|
|
46
|
+
readonly id: "firepass";
|
|
47
|
+
readonly name: "Fire Pass (Fireworks Kimi K2.6 Turbo subscription)";
|
|
48
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<string>;
|
|
49
|
+
} | {
|
|
50
|
+
readonly id: "fireworks";
|
|
51
|
+
readonly name: "Fireworks";
|
|
52
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<string>;
|
|
53
|
+
} | {
|
|
54
|
+
readonly id: "github-copilot";
|
|
55
|
+
readonly name: "GitHub Copilot";
|
|
56
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<import("./oauth").OAuthCredentials>;
|
|
57
|
+
readonly refreshToken: (credentials: import("./oauth").OAuthCredentials) => Promise<import("./oauth").OAuthCredentials>;
|
|
58
|
+
} | {
|
|
59
|
+
readonly id: "gitlab-duo";
|
|
60
|
+
readonly name: "GitLab Duo";
|
|
61
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<import("./oauth").OAuthCredentials>;
|
|
62
|
+
readonly refreshToken: (credentials: import("./oauth").OAuthCredentials) => Promise<import("./oauth").OAuthCredentials>;
|
|
63
|
+
readonly callbackPort: 8080;
|
|
64
|
+
readonly pasteCodeFlow: true;
|
|
65
|
+
} | {
|
|
66
|
+
readonly id: "google";
|
|
67
|
+
readonly name: "Google Gemini";
|
|
68
|
+
} | {
|
|
69
|
+
readonly id: "google-antigravity";
|
|
70
|
+
readonly name: "Antigravity (Gemini 3, Claude, GPT-OSS)";
|
|
71
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<import("./oauth").OAuthCredentials>;
|
|
72
|
+
readonly refreshToken: (credentials: import("./oauth").OAuthCredentials) => Promise<import("./oauth").OAuthCredentials>;
|
|
73
|
+
readonly callbackPort: 51121;
|
|
74
|
+
readonly pasteCodeFlow: true;
|
|
75
|
+
} | {
|
|
76
|
+
readonly id: "google-gemini-cli";
|
|
77
|
+
readonly name: "Google Cloud Code Assist (Gemini CLI)";
|
|
78
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<import("./oauth").OAuthCredentials>;
|
|
79
|
+
readonly refreshToken: (credentials: import("./oauth").OAuthCredentials) => Promise<import("./oauth").OAuthCredentials>;
|
|
80
|
+
readonly callbackPort: 8085;
|
|
81
|
+
readonly pasteCodeFlow: true;
|
|
82
|
+
} | {
|
|
83
|
+
readonly id: "google-vertex";
|
|
84
|
+
readonly name: "Google Vertex AI";
|
|
85
|
+
readonly envKeys: () => string | undefined;
|
|
86
|
+
} | {
|
|
87
|
+
readonly id: "groq";
|
|
88
|
+
readonly name: "Groq";
|
|
89
|
+
} | {
|
|
90
|
+
readonly id: "huggingface";
|
|
91
|
+
readonly name: "Hugging Face Inference";
|
|
92
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<string>;
|
|
93
|
+
} | {
|
|
94
|
+
readonly id: "kagi";
|
|
95
|
+
readonly name: "Kagi";
|
|
96
|
+
readonly envKeys: "KAGI_API_KEY";
|
|
97
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<string>;
|
|
98
|
+
} | {
|
|
99
|
+
readonly id: "kilo";
|
|
100
|
+
readonly name: "Kilo Gateway";
|
|
101
|
+
readonly login: typeof import("./kilo").loginKilo;
|
|
102
|
+
} | {
|
|
103
|
+
readonly id: "kimi-code";
|
|
104
|
+
readonly name: "Kimi Code";
|
|
105
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<import("./oauth").OAuthCredentials>;
|
|
106
|
+
readonly refreshToken: (credentials: import("./oauth").OAuthCredentials) => Promise<import("./oauth").OAuthCredentials>;
|
|
107
|
+
} | {
|
|
108
|
+
readonly id: "litellm";
|
|
109
|
+
readonly name: "LiteLLM";
|
|
110
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<string>;
|
|
111
|
+
} | {
|
|
112
|
+
readonly id: "lm-studio";
|
|
113
|
+
readonly name: "LM Studio (Local OpenAI-compatible)";
|
|
114
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<string>;
|
|
115
|
+
} | {
|
|
116
|
+
readonly id: "minimax";
|
|
117
|
+
readonly name: "MiniMax";
|
|
118
|
+
} | {
|
|
119
|
+
readonly id: "minimax-code";
|
|
120
|
+
readonly name: "MiniMax Token Plan (International)";
|
|
121
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<string>;
|
|
122
|
+
} | {
|
|
123
|
+
readonly id: "minimax-code-cn";
|
|
124
|
+
readonly name: "MiniMax Token Plan (China)";
|
|
125
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<string>;
|
|
126
|
+
} | {
|
|
127
|
+
readonly id: "mistral";
|
|
128
|
+
readonly name: "Mistral";
|
|
129
|
+
} | {
|
|
130
|
+
readonly id: "moonshot";
|
|
131
|
+
readonly name: "Moonshot (Kimi API)";
|
|
132
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<string>;
|
|
133
|
+
} | {
|
|
134
|
+
readonly id: "nanogpt";
|
|
135
|
+
readonly name: "NanoGPT";
|
|
136
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<string>;
|
|
137
|
+
} | {
|
|
138
|
+
readonly id: "nvidia";
|
|
139
|
+
readonly name: "NVIDIA";
|
|
140
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<string>;
|
|
141
|
+
} | {
|
|
142
|
+
readonly id: "ollama";
|
|
143
|
+
readonly name: "Ollama (Local OpenAI-compatible)";
|
|
144
|
+
readonly login: typeof import("./ollama").loginOllama;
|
|
145
|
+
} | {
|
|
146
|
+
readonly id: "ollama-cloud";
|
|
147
|
+
readonly name: "Ollama Cloud";
|
|
148
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<string>;
|
|
149
|
+
} | {
|
|
150
|
+
readonly id: "openai";
|
|
151
|
+
readonly name: "OpenAI";
|
|
152
|
+
} | {
|
|
153
|
+
readonly id: "openai-codex";
|
|
154
|
+
readonly name: "ChatGPT Plus/Pro (Codex Subscription)";
|
|
155
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<import("./oauth").OAuthCredentials>;
|
|
156
|
+
readonly refreshToken: (credentials: import("./oauth").OAuthCredentials) => Promise<import("./oauth").OAuthCredentials>;
|
|
157
|
+
readonly callbackPort: 1455;
|
|
158
|
+
readonly pasteCodeFlow: true;
|
|
159
|
+
} | {
|
|
160
|
+
readonly id: "openai-codex-device";
|
|
161
|
+
readonly name: "ChatGPT Plus/Pro (Codex, headless/device)";
|
|
162
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<import("./oauth").OAuthCredentials>;
|
|
163
|
+
readonly refreshToken: (credentials: import("./oauth").OAuthCredentials) => Promise<import("./oauth").OAuthCredentials>;
|
|
164
|
+
readonly storeCredentialsAs: "openai-codex";
|
|
165
|
+
} | {
|
|
166
|
+
readonly id: "opencode-go";
|
|
167
|
+
readonly name: "OpenCode Go";
|
|
168
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<string>;
|
|
169
|
+
} | {
|
|
170
|
+
readonly id: "opencode-zen";
|
|
171
|
+
readonly name: "OpenCode Zen";
|
|
172
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<string>;
|
|
173
|
+
} | {
|
|
174
|
+
readonly id: "openrouter";
|
|
175
|
+
readonly name: "OpenRouter";
|
|
176
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<string>;
|
|
177
|
+
} | {
|
|
178
|
+
readonly id: "parallel";
|
|
179
|
+
readonly name: "Parallel";
|
|
180
|
+
readonly envKeys: "PARALLEL_API_KEY";
|
|
181
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<string>;
|
|
182
|
+
} | {
|
|
183
|
+
readonly id: "perplexity";
|
|
184
|
+
readonly name: "Perplexity (Pro/Max)";
|
|
185
|
+
readonly envKeys: "PERPLEXITY_API_KEY";
|
|
186
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<import("./oauth").OAuthCredentials>;
|
|
187
|
+
} | {
|
|
188
|
+
readonly id: "qianfan";
|
|
189
|
+
readonly name: "Qianfan";
|
|
190
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<string>;
|
|
191
|
+
} | {
|
|
192
|
+
readonly id: "qwen-portal";
|
|
193
|
+
readonly name: "Qwen Portal";
|
|
194
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<string>;
|
|
195
|
+
} | {
|
|
196
|
+
readonly id: "synthetic";
|
|
197
|
+
readonly name: "Synthetic";
|
|
198
|
+
readonly login: (options: import("./oauth").OAuthController) => Promise<string>;
|
|
199
|
+
} | {
|
|
200
|
+
readonly id: "tavily";
|
|
201
|
+
readonly name: "Tavily";
|
|
202
|
+
readonly envKeys: "TAVILY_API_KEY";
|
|
203
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<string>;
|
|
204
|
+
} | {
|
|
205
|
+
readonly id: "together";
|
|
206
|
+
readonly name: "Together";
|
|
207
|
+
readonly login: (cb: Parameters<typeof import("./together").loginTogether>[0]) => Promise<string>;
|
|
208
|
+
} | {
|
|
209
|
+
readonly id: "venice";
|
|
210
|
+
readonly name: "Venice";
|
|
211
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<string>;
|
|
212
|
+
} | {
|
|
213
|
+
readonly id: "vercel-ai-gateway";
|
|
214
|
+
readonly name: "Vercel AI Gateway";
|
|
215
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<string>;
|
|
216
|
+
} | {
|
|
217
|
+
readonly id: "vllm";
|
|
218
|
+
readonly name: "vLLM (Local OpenAI-compatible)";
|
|
219
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<string>;
|
|
220
|
+
} | {
|
|
221
|
+
readonly id: "wafer-pass";
|
|
222
|
+
readonly name: "Wafer Pass (flat-rate subscription)";
|
|
223
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<string>;
|
|
224
|
+
} | {
|
|
225
|
+
readonly id: "wafer-serverless";
|
|
226
|
+
readonly name: "Wafer Serverless (pay-as-you-go)";
|
|
227
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<string>;
|
|
228
|
+
} | {
|
|
229
|
+
readonly id: "xai";
|
|
230
|
+
readonly name: "xAI";
|
|
231
|
+
} | {
|
|
232
|
+
readonly id: "xai-oauth";
|
|
233
|
+
readonly name: "xAI Grok OAuth (SuperGrok Subscription)";
|
|
234
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<import("./oauth").OAuthCredentials>;
|
|
235
|
+
readonly refreshToken: (credentials: import("./oauth").OAuthCredentials) => Promise<import("./oauth").OAuthCredentials>;
|
|
236
|
+
} | {
|
|
237
|
+
readonly id: "xiaomi";
|
|
238
|
+
readonly name: "Xiaomi MiMo";
|
|
239
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<string>;
|
|
240
|
+
} | {
|
|
241
|
+
readonly id: "xiaomi-token-plan-ams";
|
|
242
|
+
readonly name: "Xiaomi Token Plan (Europe)";
|
|
243
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<string>;
|
|
244
|
+
} | {
|
|
245
|
+
readonly id: "xiaomi-token-plan-cn";
|
|
246
|
+
readonly name: "Xiaomi Token Plan (China)";
|
|
247
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<string>;
|
|
248
|
+
} | {
|
|
249
|
+
readonly id: "xiaomi-token-plan-sgp";
|
|
250
|
+
readonly name: "Xiaomi Token Plan (Singapore)";
|
|
251
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<string>;
|
|
252
|
+
} | {
|
|
253
|
+
readonly id: "zai";
|
|
254
|
+
readonly name: "Z.AI (GLM Coding Plan)";
|
|
255
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<string>;
|
|
256
|
+
} | {
|
|
257
|
+
readonly id: "zenmux";
|
|
258
|
+
readonly name: "ZenMux";
|
|
259
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<string>;
|
|
260
|
+
} | {
|
|
261
|
+
readonly id: "zhipu-coding-plan";
|
|
262
|
+
readonly name: "Zhipu Coding Plan (智谱)";
|
|
263
|
+
readonly login: (cb: import("./oauth").OAuthLoginCallbacks) => Promise<string>;
|
|
264
|
+
})[];
|
|
265
|
+
export type RegistryDef = (typeof ALL)[number];
|
|
266
|
+
export declare const PROVIDER_REGISTRY: readonly ProviderDefinition[];
|
|
267
|
+
export declare function getProviderDefinition(id: string): ProviderDefinition | undefined;
|
|
268
|
+
/** Loginable providers (those carrying a `login` flow). */
|
|
269
|
+
export type OAuthProviderUnion = Extract<RegistryDef, {
|
|
270
|
+
login: object;
|
|
271
|
+
}>["id"];
|
|
272
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const loginSynthetic: (options: import("./oauth").OAuthController) => Promise<string>;
|
|
2
|
+
export declare const syntheticProvider: {
|
|
3
|
+
readonly id: "synthetic";
|
|
4
|
+
readonly name: "Synthetic";
|
|
5
|
+
readonly login: (options: import("./oauth").OAuthController) => Promise<string>;
|
|
6
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { OAuthLoginCallbacks } from "./oauth/types";
|
|
2
|
+
/**
|
|
3
|
+
* Login to Tavily.
|
|
4
|
+
*
|
|
5
|
+
* Opens browser to API keys page and prompts user to paste their API key.
|
|
6
|
+
* Returns the API key directly (not OAuthCredentials - this isn't OAuth).
|
|
7
|
+
*/
|
|
8
|
+
export declare function loginTavily(options: OAuthLoginCallbacks): Promise<string>;
|
|
9
|
+
export declare const tavilyProvider: {
|
|
10
|
+
readonly id: "tavily";
|
|
11
|
+
readonly name: "Tavily";
|
|
12
|
+
readonly envKeys: "TAVILY_API_KEY";
|
|
13
|
+
readonly login: (cb: OAuthLoginCallbacks) => Promise<string>;
|
|
14
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const loginTogether: (options: import("./oauth").OAuthController) => Promise<string>;
|
|
2
|
+
export declare const togetherProvider: {
|
|
3
|
+
readonly id: "together";
|
|
4
|
+
readonly name: "Together";
|
|
5
|
+
readonly login: (cb: Parameters<typeof loginTogether>[0]) => Promise<string>;
|
|
6
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single-source provider auth model. Every provider — model providers,
|
|
3
|
+
* gateways, search/tool credentials, and login-only flows — is described by
|
|
4
|
+
* one {@link ProviderDefinition}. The legacy scattered structures (the
|
|
5
|
+
* `OAuthProvider` union, `serviceProviderMap`, `builtInOAuthProviders`, the
|
|
6
|
+
* refresh/login switches, and the CLI callback maps) are all *derived* from
|
|
7
|
+
* the registry of these definitions. Adding a provider is one new file in
|
|
8
|
+
* `./providers/` plus one line in `./registry.ts`. Model-catalog metadata
|
|
9
|
+
* (default model, model-manager factory, catalog discovery) lives in
|
|
10
|
+
* `@prometheus-ai/catalog`'s descriptor table.
|
|
11
|
+
*/
|
|
12
|
+
import type { OAuthCredentials, OAuthLoginCallbacks } from "./oauth/types";
|
|
13
|
+
/**
|
|
14
|
+
* API-key environment fallback: either a single env var name (e.g.
|
|
15
|
+
* `"OPENAI_API_KEY"`) or a resolver that inspects several env vars / probes
|
|
16
|
+
* the host (Vertex ADC, Bedrock credential chains, …).
|
|
17
|
+
*/
|
|
18
|
+
export type KeyResolver = string | (() => string | undefined);
|
|
19
|
+
/**
|
|
20
|
+
* Declarative description of a single provider's auth/login wiring. All
|
|
21
|
+
* fields are optional except `id`/`name`; presence of a field opts the
|
|
22
|
+
* provider into a derived structure:
|
|
23
|
+
*
|
|
24
|
+
* - `envKeys` present ⇒ env-var fallback in `getEnvApiKey`, overriding the
|
|
25
|
+
* catalog table's `envVars` for that provider.
|
|
26
|
+
* - `login` present ⇒ member of `OAuthProvider`, shown in the `/login` list
|
|
27
|
+
* (unless `showInLoginList === false`) and dispatchable via `AuthStorage.login`.
|
|
28
|
+
* - `callbackPort` present ⇒ entry in the auth-broker `CALLBACK_PORTS` map.
|
|
29
|
+
* - `pasteCodeFlow` ⇒ member of `PASTE_CODE_LOGIN_PROVIDERS`.
|
|
30
|
+
*
|
|
31
|
+
* Heavy OAuth flow modules MUST be reached through dynamic-import thunks in
|
|
32
|
+
* `login`/`refreshToken` so they stay out of the eager startup graph.
|
|
33
|
+
*/
|
|
34
|
+
export interface ProviderDefinition {
|
|
35
|
+
readonly id: string;
|
|
36
|
+
readonly name: string;
|
|
37
|
+
/** Login-list availability flag. Defaults to true when shown. */
|
|
38
|
+
readonly available?: boolean;
|
|
39
|
+
/** Whether to surface in the interactive login list. Defaults to true when `login` is present. */
|
|
40
|
+
readonly showInLoginList?: boolean;
|
|
41
|
+
readonly envKeys?: KeyResolver;
|
|
42
|
+
readonly login?: (callbacks: OAuthLoginCallbacks) => Promise<OAuthCredentials | string>;
|
|
43
|
+
readonly refreshToken?: (credentials: OAuthCredentials) => Promise<OAuthCredentials>;
|
|
44
|
+
readonly getApiKey?: (credentials: OAuthCredentials) => string;
|
|
45
|
+
/** Store OAuth credentials under a different provider id (e.g. `openai-codex-device` ⇒ `openai-codex`). */
|
|
46
|
+
readonly storeCredentialsAs?: string;
|
|
47
|
+
/** Auth-broker local callback-server port. Presence ⇒ entry in `CALLBACK_PORTS`. */
|
|
48
|
+
readonly callbackPort?: number;
|
|
49
|
+
/** OAuth flow needs a pasted code/redirect URL rather than a callback server. */
|
|
50
|
+
readonly pasteCodeFlow?: boolean;
|
|
51
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { OAuthController, OAuthLoginCallbacks } from "./oauth/types";
|
|
2
|
+
/**
|
|
3
|
+
* Login to Venice.
|
|
4
|
+
*
|
|
5
|
+
* Opens browser to API keys page, prompts user to paste their API key.
|
|
6
|
+
* Returns the API key directly (not OAuthCredentials - this isn't OAuth).
|
|
7
|
+
*/
|
|
8
|
+
export declare function loginVenice(options: OAuthController): Promise<string>;
|
|
9
|
+
export declare const veniceProvider: {
|
|
10
|
+
readonly id: "venice";
|
|
11
|
+
readonly name: "Venice";
|
|
12
|
+
readonly login: (cb: OAuthLoginCallbacks) => Promise<string>;
|
|
13
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { OAuthController, OAuthLoginCallbacks } from "./oauth/types";
|
|
2
|
+
export declare function loginVercelAiGateway(options: OAuthController): Promise<string>;
|
|
3
|
+
export declare const vercelAiGatewayProvider: {
|
|
4
|
+
readonly id: "vercel-ai-gateway";
|
|
5
|
+
readonly name: "Vercel AI Gateway";
|
|
6
|
+
readonly login: (cb: OAuthLoginCallbacks) => Promise<string>;
|
|
7
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { OAuthController, OAuthLoginCallbacks } from "./oauth/types";
|
|
2
|
+
export declare function loginVllm(options: OAuthController): Promise<string>;
|
|
3
|
+
export declare const vllmProvider: {
|
|
4
|
+
readonly id: "vllm";
|
|
5
|
+
readonly name: "vLLM (Local OpenAI-compatible)";
|
|
6
|
+
readonly login: (cb: OAuthLoginCallbacks) => Promise<string>;
|
|
7
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { OAuthCredentials, OAuthLoginCallbacks } from "./oauth/types";
|
|
2
|
+
export declare const xaiOauthProvider: {
|
|
3
|
+
readonly id: "xai-oauth";
|
|
4
|
+
readonly name: "xAI Grok OAuth (SuperGrok Subscription)";
|
|
5
|
+
readonly login: (cb: OAuthLoginCallbacks) => Promise<OAuthCredentials>;
|
|
6
|
+
readonly refreshToken: (credentials: OAuthCredentials) => Promise<OAuthCredentials>;
|
|
7
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { OAuthController, OAuthLoginCallbacks } from "./oauth/types";
|
|
2
|
+
export declare function loginZai(options: OAuthController): Promise<string>;
|
|
3
|
+
export declare const zaiProvider: {
|
|
4
|
+
readonly id: "zai";
|
|
5
|
+
readonly name: "Z.AI (GLM Coding Plan)";
|
|
6
|
+
readonly login: (cb: OAuthLoginCallbacks) => Promise<string>;
|
|
7
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { OAuthLoginCallbacks } from "./oauth/types";
|
|
2
|
+
export declare const loginZenMux: (options: import("./oauth").OAuthController) => Promise<string>;
|
|
3
|
+
export declare const zenmuxProvider: {
|
|
4
|
+
readonly id: "zenmux";
|
|
5
|
+
readonly name: "ZenMux";
|
|
6
|
+
readonly login: (cb: OAuthLoginCallbacks) => Promise<string>;
|
|
7
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { OAuthController, OAuthLoginCallbacks } from "./oauth/types";
|
|
2
|
+
export declare function loginZhipuCodingPlan(options: OAuthController): Promise<string>;
|
|
3
|
+
export declare const zhipuCodingPlanProvider: {
|
|
4
|
+
readonly id: "zhipu-coding-plan";
|
|
5
|
+
readonly name: "Zhipu Coding Plan (智谱)";
|
|
6
|
+
readonly login: (cb: OAuthLoginCallbacks) => Promise<string>;
|
|
7
|
+
};
|
package/dist/types/stream.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Effort } from "
|
|
1
|
+
import type { Effort } from "@prometheus-ai/catalog/effort";
|
|
2
2
|
import type { AnthropicOptions } from "./providers/anthropic";
|
|
3
3
|
import type { GoogleOptions } from "./providers/google";
|
|
4
4
|
import type { GoogleGeminiCliOptions } from "./providers/google-gemini-cli";
|
|
@@ -12,6 +12,14 @@ import { AssistantMessageEventStream } from "./utils/event-stream";
|
|
|
12
12
|
* Checks Bun.env, then cwd/.env, then ~/.env.
|
|
13
13
|
*/
|
|
14
14
|
export declare function getEnvApiKey(provider: string): string | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Name of the environment variable that backs `getEnvApiKey` for a provider,
|
|
17
|
+
* when that provider maps to a single named variable (e.g. `github-copilot` →
|
|
18
|
+
* `COPILOT_GITHUB_TOKEN`). Returns undefined for providers whose env fallback
|
|
19
|
+
* is computed (multi-var pickers, Vertex ADC / Bedrock probes, …) since no
|
|
20
|
+
* single variable name describes the source.
|
|
21
|
+
*/
|
|
22
|
+
export declare function getEnvApiKeyName(provider: string): string | undefined;
|
|
15
23
|
/**
|
|
16
24
|
* Enumerate every provider that has an env-var fallback for `getEnvApiKey`.
|
|
17
25
|
* Used by `prometheus auth-broker migrate --include-env` to discover env-sourced keys
|