@sayknow-cli/ai 0.3.11 → 0.3.13
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/package.json +24 -25
- package/src/model-cache.ts +1 -1
- package/src/model-manager.ts +14 -3
- package/src/model-retirements.ts +13 -0
- package/src/model-thinking.ts +34 -2
- package/src/models.ts +26 -5
- package/src/provider-models/google.ts +1 -0
- package/src/providers/amazon-bedrock.ts +37 -33
- package/src/providers/anthropic.ts +94 -65
- package/src/providers/aws-credential-config.ts +180 -0
- package/src/providers/aws-credentials.ts +20 -63
- package/src/providers/google-gemini-cli.ts +27 -3
- package/src/providers/google-gemini-headers.ts +6 -1
- package/src/providers/google-shared.ts +55 -3
- package/src/types.ts +2 -0
- package/src/utils/discovery/antigravity.ts +16 -2
- package/dist/types/api-registry.d.ts +0 -30
- package/dist/types/auth-broker/client.d.ts +0 -67
- package/dist/types/auth-broker/index.d.ts +0 -5
- package/dist/types/auth-broker/refresher.d.ts +0 -25
- package/dist/types/auth-broker/remote-store.d.ts +0 -99
- package/dist/types/auth-broker/server.d.ts +0 -32
- package/dist/types/auth-broker/types.d.ts +0 -110
- package/dist/types/auth-broker/wire-schemas.d.ts +0 -443
- package/dist/types/auth-gateway/http.d.ts +0 -40
- package/dist/types/auth-gateway/index.d.ts +0 -3
- package/dist/types/auth-gateway/server.d.ts +0 -17
- package/dist/types/auth-gateway/types.d.ts +0 -115
- package/dist/types/auth-storage.d.ts +0 -695
- package/dist/types/cli.d.ts +0 -2
- package/dist/types/index.d.ts +0 -51
- package/dist/types/model-cache.d.ts +0 -17
- package/dist/types/model-manager.d.ts +0 -62
- package/dist/types/model-thinking.d.ts +0 -74
- package/dist/types/models.d.ts +0 -12
- package/dist/types/provider-details.d.ts +0 -24
- package/dist/types/provider-models/bundled-references.d.ts +0 -4
- package/dist/types/provider-models/descriptors.d.ts +0 -48
- package/dist/types/provider-models/google.d.ts +0 -20
- 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 -256
- package/dist/types/provider-models/special.d.ts +0 -19
- package/dist/types/providers/amazon-bedrock.d.ts +0 -60
- package/dist/types/providers/anthropic-messages-server-schema.d.ts +0 -450
- package/dist/types/providers/anthropic-messages-server.d.ts +0 -17
- package/dist/types/providers/anthropic.d.ts +0 -208
- package/dist/types/providers/aws-credentials.d.ts +0 -43
- package/dist/types/providers/aws-eventstream.d.ts +0 -38
- package/dist/types/providers/aws-sigv4.d.ts +0 -55
- package/dist/types/providers/azure-openai-responses.d.ts +0 -15
- package/dist/types/providers/composer-discipline.d.ts +0 -26
- package/dist/types/providers/cursor/client-version.d.ts +0 -10
- package/dist/types/providers/cursor/gen/agent_pb.d.ts +0 -13022
- package/dist/types/providers/cursor.d.ts +0 -45
- package/dist/types/providers/error-message.d.ts +0 -27
- package/dist/types/providers/github-copilot-headers.d.ts +0 -40
- package/dist/types/providers/gitlab-duo.d.ts +0 -27
- package/dist/types/providers/google-auth.d.ts +0 -24
- package/dist/types/providers/google-gemini-cli.d.ts +0 -75
- package/dist/types/providers/google-gemini-headers.d.ts +0 -40
- package/dist/types/providers/google-shared.d.ts +0 -173
- package/dist/types/providers/google-types.d.ts +0 -138
- package/dist/types/providers/google-vertex.d.ts +0 -7
- package/dist/types/providers/google.d.ts +0 -4
- package/dist/types/providers/grammar.d.ts +0 -1
- package/dist/types/providers/kimi.d.ts +0 -27
- package/dist/types/providers/mock.d.ts +0 -177
- package/dist/types/providers/ollama.d.ts +0 -41
- package/dist/types/providers/openai-anthropic-shim.d.ts +0 -31
- package/dist/types/providers/openai-bounded-rate-limits.d.ts +0 -3
- package/dist/types/providers/openai-chat-server-schema.d.ts +0 -815
- package/dist/types/providers/openai-chat-server.d.ts +0 -16
- package/dist/types/providers/openai-codex/constants.d.ts +0 -26
- package/dist/types/providers/openai-codex/request-transformer.d.ts +0 -50
- package/dist/types/providers/openai-codex/response-handler.d.ts +0 -17
- package/dist/types/providers/openai-codex-responses.d.ts +0 -67
- package/dist/types/providers/openai-completions-compat.d.ts +0 -27
- package/dist/types/providers/openai-completions.d.ts +0 -33
- package/dist/types/providers/openai-request-transform.d.ts +0 -4
- package/dist/types/providers/openai-responses-server-schema.d.ts +0 -392
- package/dist/types/providers/openai-responses-server.d.ts +0 -17
- package/dist/types/providers/openai-responses-shared.d.ts +0 -104
- package/dist/types/providers/openai-responses.d.ts +0 -32
- package/dist/types/providers/pi-native-client.d.ts +0 -13
- package/dist/types/providers/pi-native-server.d.ts +0 -68
- package/dist/types/providers/register-builtins.d.ts +0 -31
- package/dist/types/providers/synthetic.d.ts +0 -26
- package/dist/types/providers/transform-messages.d.ts +0 -14
- package/dist/types/providers/vision-guard.d.ts +0 -8
- package/dist/types/rate-limit-utils.d.ts +0 -19
- package/dist/types/stream.d.ts +0 -43
- package/dist/types/types.d.ts +0 -829
- package/dist/types/usage/claude.d.ts +0 -3
- package/dist/types/usage/gemini.d.ts +0 -2
- package/dist/types/usage/github-copilot.d.ts +0 -7
- package/dist/types/usage/google-antigravity.d.ts +0 -2
- package/dist/types/usage/grok-cli.d.ts +0 -10
- package/dist/types/usage/kimi.d.ts +0 -2
- package/dist/types/usage/minimax-code.d.ts +0 -2
- package/dist/types/usage/openai-codex.d.ts +0 -3
- package/dist/types/usage/shared.d.ts +0 -1
- package/dist/types/usage/zai.d.ts +0 -2
- package/dist/types/usage.d.ts +0 -258
- package/dist/types/utils/abort.d.ts +0 -19
- package/dist/types/utils/anthropic-auth.d.ts +0 -31
- 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 -74
- package/dist/types/utils/event-stream.d.ts +0 -33
- package/dist/types/utils/fireworks-model-id.d.ts +0 -10
- package/dist/types/utils/foundry.d.ts +0 -1
- package/dist/types/utils/h2-fetch.d.ts +0 -22
- package/dist/types/utils/http-inspector.d.ts +0 -35
- package/dist/types/utils/idle-iterator.d.ts +0 -67
- package/dist/types/utils/json-parse.d.ts +0 -18
- package/dist/types/utils/oauth/alibaba-coding-plan.d.ts +0 -18
- package/dist/types/utils/oauth/anthropic.d.ts +0 -22
- package/dist/types/utils/oauth/api-key-login.d.ts +0 -35
- package/dist/types/utils/oauth/api-key-validation.d.ts +0 -27
- package/dist/types/utils/oauth/callback-server.d.ts +0 -60
- 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/cursor.d.ts +0 -15
- package/dist/types/utils/oauth/deepinfra.d.ts +0 -1
- 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/fugu.d.ts +0 -1
- package/dist/types/utils/oauth/github-copilot.d.ts +0 -38
- package/dist/types/utils/oauth/gitlab-duo.d.ts +0 -3
- package/dist/types/utils/oauth/glm-zcode.d.ts +0 -71
- package/dist/types/utils/oauth/google-antigravity.d.ts +0 -11
- package/dist/types/utils/oauth/google-gemini-cli.d.ts +0 -10
- package/dist/types/utils/oauth/google-oauth-shared.d.ts +0 -28
- package/dist/types/utils/oauth/huggingface.d.ts +0 -19
- package/dist/types/utils/oauth/index.d.ts +0 -39
- 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/kimi.d.ts +0 -21
- 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/minimax-code.d.ts +0 -28
- 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/openai-codex.d.ts +0 -21
- package/dist/types/utils/oauth/opencode.d.ts +0 -18
- package/dist/types/utils/oauth/parallel.d.ts +0 -17
- package/dist/types/utils/oauth/perplexity.d.ts +0 -9
- package/dist/types/utils/oauth/pkce.d.ts +0 -8
- 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/types.d.ts +0 -45
- 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/xai.d.ts +0 -30
- package/dist/types/utils/oauth/xiaomi.d.ts +0 -25
- package/dist/types/utils/oauth/zai.d.ts +0 -18
- package/dist/types/utils/oauth/zenmux.d.ts +0 -1
- package/dist/types/utils/overflow.d.ts +0 -64
- package/dist/types/utils/parse-bind.d.ts +0 -23
- package/dist/types/utils/provider-response.d.ts +0 -3
- package/dist/types/utils/retry-after.d.ts +0 -3
- package/dist/types/utils/retry-budget.d.ts +0 -1
- package/dist/types/utils/retry.d.ts +0 -26
- package/dist/types/utils/schema/adapt.d.ts +0 -24
- package/dist/types/utils/schema/compatibility.d.ts +0 -30
- package/dist/types/utils/schema/dereference.d.ts +0 -11
- package/dist/types/utils/schema/draft.d.ts +0 -10
- package/dist/types/utils/schema/equality.d.ts +0 -4
- package/dist/types/utils/schema/fields.d.ts +0 -49
- package/dist/types/utils/schema/index.d.ts +0 -14
- package/dist/types/utils/schema/json-schema-validator.d.ts +0 -12
- package/dist/types/utils/schema/meta-validator.d.ts +0 -2
- package/dist/types/utils/schema/normalize.d.ts +0 -93
- package/dist/types/utils/schema/root-combinator.d.ts +0 -12
- package/dist/types/utils/schema/spill.d.ts +0 -8
- package/dist/types/utils/schema/stamps.d.ts +0 -25
- package/dist/types/utils/schema/types.d.ts +0 -4
- package/dist/types/utils/schema/wire.d.ts +0 -54
- package/dist/types/utils/schema/zod-decontaminate.d.ts +0 -31
- package/dist/types/utils/sse-debug.d.ts +0 -10
- package/dist/types/utils/tool-call-healing.d.ts +0 -71
- package/dist/types/utils/tool-choice-capability.d.ts +0 -41
- package/dist/types/utils/tool-choice.d.ts +0 -50
- package/dist/types/utils/validation.d.ts +0 -17
- package/dist/types/utils.d.ts +0 -35
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* LM Studio login flow.
|
|
3
|
-
*
|
|
4
|
-
* LM Studio provides an OpenAI-compatible API at a local base URL.
|
|
5
|
-
* It usually runs unauthenticated but can be configured to require a bearer token.
|
|
6
|
-
*
|
|
7
|
-
* This flow stores an API-key-style credential used by `/login` and auth storage.
|
|
8
|
-
*/
|
|
9
|
-
import type { OAuthController } from "./types";
|
|
10
|
-
export declare const DEFAULT_LOCAL_TOKEN = "lm-studio-local";
|
|
11
|
-
/**
|
|
12
|
-
* Login to LM Studio.
|
|
13
|
-
*
|
|
14
|
-
* Opens LM Studio API docs, prompts for an optional token,
|
|
15
|
-
* and returns a stored key value.
|
|
16
|
-
*/
|
|
17
|
-
export declare function loginLmStudio(options: OAuthController): Promise<string>;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MiniMax Coding Plan login flow.
|
|
3
|
-
*
|
|
4
|
-
* MiniMax Coding Plan is a subscription service that provides access to
|
|
5
|
-
* MiniMax models (M2, M2.1) through an OpenAI-compatible API.
|
|
6
|
-
*
|
|
7
|
-
* This is not OAuth - it's a simple API key flow:
|
|
8
|
-
* 1. Open browser to https://platform.minimax.io/subscribe/coding-plan
|
|
9
|
-
* 2. User subscribes and copies their API key
|
|
10
|
-
* 3. User pastes the API key back into the CLI
|
|
11
|
-
*
|
|
12
|
-
* International: https://api.minimax.io/v1
|
|
13
|
-
* China: https://api.minimaxi.com/v1
|
|
14
|
-
*/
|
|
15
|
-
import type { OAuthController } from "./types";
|
|
16
|
-
/**
|
|
17
|
-
* Login to MiniMax Coding Plan (international).
|
|
18
|
-
*
|
|
19
|
-
* Opens browser to subscription page, prompts user to paste their API key.
|
|
20
|
-
* Returns the API key directly (not OAuthCredentials - this isn't OAuth).
|
|
21
|
-
*/
|
|
22
|
-
export declare function loginMiniMaxCode(options: OAuthController): Promise<string>;
|
|
23
|
-
/**
|
|
24
|
-
* Login to MiniMax Coding Plan (China).
|
|
25
|
-
*
|
|
26
|
-
* Same flow as international but uses China endpoint.
|
|
27
|
-
*/
|
|
28
|
-
export declare function loginMiniMaxCodeCn(options: OAuthController): Promise<string>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const loginMoonshot: (options: import("./types").OAuthController) => Promise<string>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const loginNanoGPT: (options: import("./types").OAuthController) => Promise<string>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* NVIDIA login flow.
|
|
3
|
-
*
|
|
4
|
-
* NVIDIA provides OpenAI-compatible models via https://integrate.api.nvidia.com/v1.
|
|
5
|
-
*
|
|
6
|
-
* This is not OAuth - it's a simple API key flow:
|
|
7
|
-
* 1. Open browser to NVIDIA NGC catalog
|
|
8
|
-
* 2. User copies their API key
|
|
9
|
-
* 3. User pastes the API key into the CLI
|
|
10
|
-
*/
|
|
11
|
-
import type { OAuthController } from "./types";
|
|
12
|
-
/**
|
|
13
|
-
* Login to NVIDIA.
|
|
14
|
-
*
|
|
15
|
-
* Opens browser to NVIDIA dashboard, prompts user to paste their API key.
|
|
16
|
-
* Returns the API key directly (not OAuthCredentials - this isn't OAuth).
|
|
17
|
-
*/
|
|
18
|
-
export declare function loginNvidia(options: OAuthController): Promise<string>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Ollama login flow.
|
|
3
|
-
*
|
|
4
|
-
* Ollama is typically used locally without authentication, but some hosted
|
|
5
|
-
* deployments require a bearer token/API key.
|
|
6
|
-
*
|
|
7
|
-
* This flow is API-key based (not OAuth):
|
|
8
|
-
* 1. Optionally open Ollama docs
|
|
9
|
-
* 2. Prompt user for API key/token (optional)
|
|
10
|
-
* 3. Persist key only when provided
|
|
11
|
-
*/
|
|
12
|
-
import type { OAuthController } from "./types";
|
|
13
|
-
/**
|
|
14
|
-
* Login to Ollama.
|
|
15
|
-
*
|
|
16
|
-
* Returns a trimmed API key/token string. Empty string means local no-auth mode.
|
|
17
|
-
*/
|
|
18
|
-
export declare function loginOllama(options: OAuthController): Promise<string>;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { OAuthController, OAuthCredentials } from "./types";
|
|
2
|
-
export declare function decodeJwt<T = Record<string, unknown>>(token: string): T | null;
|
|
3
|
-
/**
|
|
4
|
-
* Login with OpenAI code provider OAuth
|
|
5
|
-
*/
|
|
6
|
-
export type OpenAICodexLoginOptions = OAuthController & {
|
|
7
|
-
/** Optional originator value for OpenAI code provider OAuth. Default: "opencode". */
|
|
8
|
-
originator?: string;
|
|
9
|
-
};
|
|
10
|
-
export declare function loginOpenAICodex(options: OpenAICodexLoginOptions): Promise<OAuthCredentials>;
|
|
11
|
-
/**
|
|
12
|
-
* Login with OpenAI code provider using the device-code (headless) flow.
|
|
13
|
-
*
|
|
14
|
-
* Avoids a local callback server entirely — useful when port 1455 is unavailable
|
|
15
|
-
* or when the browser callback flow fails with 403 (e.g. network/proxy issues).
|
|
16
|
-
*/
|
|
17
|
-
export declare function loginOpenAICodexDevice(ctrl: OAuthController): Promise<OAuthCredentials>;
|
|
18
|
-
/**
|
|
19
|
-
* Refresh OpenAI code provider OAuth token
|
|
20
|
-
*/
|
|
21
|
-
export declare function refreshOpenAICodexToken(refreshToken: string): Promise<OAuthCredentials>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OpenCode Zen login flow.
|
|
3
|
-
*
|
|
4
|
-
* OpenCode Zen is a subscription service that provides access to various AI models
|
|
5
|
-
* (GPT-5.x, Anthropic model 4.x, Gemini 3, etc.) through a unified API at opencode.ai/zen.
|
|
6
|
-
* This is not OAuth - it's a simple API key flow:
|
|
7
|
-
* 1. Open browser to https://opencode.ai/auth
|
|
8
|
-
* 2. User logs in and copies their API key
|
|
9
|
-
* 3. User pastes the API key back into the CLI
|
|
10
|
-
*/
|
|
11
|
-
import type { OAuthController } from "./types";
|
|
12
|
-
/**
|
|
13
|
-
* Login to OpenCode Zen.
|
|
14
|
-
*
|
|
15
|
-
* Opens browser to auth page, prompts user to paste their API key.
|
|
16
|
-
* Returns the API key directly (not OAuthCredentials - this isn't OAuth).
|
|
17
|
-
*/
|
|
18
|
-
export declare function loginOpenCode(options: OAuthController): Promise<string>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Parallel login flow.
|
|
3
|
-
*
|
|
4
|
-
* Parallel uses an API key from the account settings page.
|
|
5
|
-
* This is an API key flow:
|
|
6
|
-
* 1. Open browser to Parallel API key settings
|
|
7
|
-
* 2. User copies API key
|
|
8
|
-
* 3. User pastes key into the CLI/TUI
|
|
9
|
-
*/
|
|
10
|
-
import type { OAuthController } from "./types";
|
|
11
|
-
/**
|
|
12
|
-
* Login to Parallel.
|
|
13
|
-
*
|
|
14
|
-
* Opens browser to the API keys page, prompts the user to paste their API key,
|
|
15
|
-
* and returns the API key directly.
|
|
16
|
-
*/
|
|
17
|
-
export declare function loginParallel(options: OAuthController): Promise<string>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { OAuthController, OAuthCredentials } from "./types";
|
|
2
|
-
/**
|
|
3
|
-
* Login to Perplexity.
|
|
4
|
-
*
|
|
5
|
-
* Tries auto-extraction from the desktop app, then runs HTTP email OTP login.
|
|
6
|
-
*
|
|
7
|
-
* No browser/manual token paste fallback is used.
|
|
8
|
-
*/
|
|
9
|
-
export declare function loginPerplexity(ctrl: OAuthController): Promise<OAuthCredentials>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Qianfan login flow.
|
|
3
|
-
*
|
|
4
|
-
* Qianfan provides an OpenAI-compatible API endpoint.
|
|
5
|
-
* Login is API-key based:
|
|
6
|
-
* 1. Open browser to Qianfan API key console
|
|
7
|
-
* 2. User copies API key
|
|
8
|
-
* 3. User pastes key into CLI prompt
|
|
9
|
-
*/
|
|
10
|
-
import type { OAuthController } from "./types";
|
|
11
|
-
/**
|
|
12
|
-
* Login to Qianfan.
|
|
13
|
-
*
|
|
14
|
-
* Opens browser to API key page, prompts user to paste their API key.
|
|
15
|
-
* Returns the API key directly (not OAuthCredentials - this isn't OAuth).
|
|
16
|
-
*/
|
|
17
|
-
export declare function loginQianfan(options: OAuthController): Promise<string>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Qwen Portal login flow.
|
|
3
|
-
*
|
|
4
|
-
* Qwen Portal exposes an OpenAI-compatible endpoint at https://portal.qwen.ai/v1
|
|
5
|
-
* and accepts OAuth bearer tokens or API keys.
|
|
6
|
-
*
|
|
7
|
-
* This is a token/API-key flow:
|
|
8
|
-
* 1. Open Qwen Portal
|
|
9
|
-
* 2. Copy either your OAuth token or API key
|
|
10
|
-
* 3. Paste it into the CLI
|
|
11
|
-
*/
|
|
12
|
-
import type { OAuthController } from "./types";
|
|
13
|
-
/**
|
|
14
|
-
* Login to Qwen Portal.
|
|
15
|
-
*
|
|
16
|
-
* Prompts for either `QWEN_OAUTH_TOKEN` or `QWEN_PORTAL_API_KEY` value.
|
|
17
|
-
* Returns the value directly (stored as api_key credential in auth storage).
|
|
18
|
-
*/
|
|
19
|
-
export declare function loginQwenPortal(options: OAuthController): Promise<string>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const loginSynthetic: (options: import("./types").OAuthController) => Promise<string>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tavily login flow.
|
|
3
|
-
*
|
|
4
|
-
* Tavily web search uses an API key from the account settings page.
|
|
5
|
-
* This is an API key flow:
|
|
6
|
-
* 1. Open browser to Tavily settings
|
|
7
|
-
* 2. User copies API key
|
|
8
|
-
* 3. User pastes key into CLI
|
|
9
|
-
*/
|
|
10
|
-
import type { OAuthController } from "./types";
|
|
11
|
-
/**
|
|
12
|
-
* Login to Tavily.
|
|
13
|
-
*
|
|
14
|
-
* Opens browser to API keys page and prompts user to paste their API key.
|
|
15
|
-
* Returns the API key directly (not OAuthCredentials - this isn't OAuth).
|
|
16
|
-
*/
|
|
17
|
-
export declare function loginTavily(options: OAuthController): Promise<string>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const loginTogether: (options: import("./types").OAuthController) => Promise<string>;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
export type OAuthCredentials = {
|
|
2
|
-
refresh: string;
|
|
3
|
-
access: string;
|
|
4
|
-
expires: number;
|
|
5
|
-
enterpriseUrl?: string;
|
|
6
|
-
projectId?: string;
|
|
7
|
-
email?: string;
|
|
8
|
-
accountId?: string;
|
|
9
|
-
};
|
|
10
|
-
export type OAuthProvider = "alibaba-coding-plan" | "anthropic" | "cerebras" | "cloudflare-ai-gateway" | "cursor" | "deepseek" | "deepinfra" | "fireworks" | "firepass" | "fugu" | "github-copilot" | "google-gemini-cli" | "google-antigravity" | "gitlab-duo" | "huggingface" | "kimi-code" | "kilo" | "kagi" | "litellm" | "lm-studio" | "minimax-code" | "minimax-code-cn" | "moonshot" | "nvidia" | "nanogpt" | "ollama" | "ollama-cloud" | "openai-codex" | "openai-codex-device" | "opencode-go" | "opencode-zen" | "parallel" | "perplexity" | "qianfan" | "qwen-portal" | "synthetic" | "tavily" | "together" | "venice" | "vercel-ai-gateway" | "vllm" | "xai" | "glm-zcode" | "xiaomi" | "xiaomi-token-plan-sgp" | "xiaomi-token-plan-ams" | "xiaomi-token-plan-cn" | "zenmux" | "zai";
|
|
11
|
-
export type OAuthProviderId = OAuthProvider | (string & {});
|
|
12
|
-
export type OAuthPrompt = {
|
|
13
|
-
message: string;
|
|
14
|
-
placeholder?: string;
|
|
15
|
-
allowEmpty?: boolean;
|
|
16
|
-
};
|
|
17
|
-
export type OAuthAuthInfo = {
|
|
18
|
-
url: string;
|
|
19
|
-
instructions?: string;
|
|
20
|
-
};
|
|
21
|
-
export interface OAuthProviderInfo {
|
|
22
|
-
id: OAuthProviderId;
|
|
23
|
-
name: string;
|
|
24
|
-
available: boolean;
|
|
25
|
-
}
|
|
26
|
-
export interface OAuthController {
|
|
27
|
-
onAuth?(info: OAuthAuthInfo): void;
|
|
28
|
-
onProgress?(message: string): void;
|
|
29
|
-
onManualCodeInput?(): Promise<string>;
|
|
30
|
-
onPrompt?(prompt: OAuthPrompt): Promise<string>;
|
|
31
|
-
signal?: AbortSignal;
|
|
32
|
-
fetch?: typeof globalThis.fetch;
|
|
33
|
-
}
|
|
34
|
-
export interface OAuthLoginCallbacks extends OAuthController {
|
|
35
|
-
onAuth: (info: OAuthAuthInfo) => void;
|
|
36
|
-
onPrompt: (prompt: OAuthPrompt) => Promise<string>;
|
|
37
|
-
}
|
|
38
|
-
export interface OAuthProviderInterface {
|
|
39
|
-
readonly id: OAuthProviderId;
|
|
40
|
-
readonly name: string;
|
|
41
|
-
readonly sourceId?: string;
|
|
42
|
-
login(callbacks: OAuthLoginCallbacks): Promise<OAuthCredentials | string>;
|
|
43
|
-
refreshToken?(credentials: OAuthCredentials): Promise<OAuthCredentials>;
|
|
44
|
-
getApiKey?(credentials: OAuthCredentials): string;
|
|
45
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Venice login flow.
|
|
3
|
-
*
|
|
4
|
-
* Venice provides OpenAI-compatible models via https://api.venice.ai/api/v1.
|
|
5
|
-
*
|
|
6
|
-
* This is not OAuth - it's a simple API key flow:
|
|
7
|
-
* 1. Open browser to Venice API key settings
|
|
8
|
-
* 2. User copies their API key
|
|
9
|
-
* 3. User pastes the API key into the CLI
|
|
10
|
-
*/
|
|
11
|
-
import type { OAuthController } from "./types";
|
|
12
|
-
/**
|
|
13
|
-
* Login to Venice.
|
|
14
|
-
*
|
|
15
|
-
* Opens browser to API keys page, prompts user to paste their API key.
|
|
16
|
-
* Returns the API key directly (not OAuthCredentials - this isn't OAuth).
|
|
17
|
-
*/
|
|
18
|
-
export declare function loginVenice(options: OAuthController): Promise<string>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Vercel AI Gateway login flow.
|
|
3
|
-
*
|
|
4
|
-
* Vercel AI Gateway proxies upstream model providers through a unified endpoint.
|
|
5
|
-
*
|
|
6
|
-
* This is not OAuth - it's a simple API key flow:
|
|
7
|
-
* 1. Open Vercel AI Gateway docs
|
|
8
|
-
* 2. User copies their API key
|
|
9
|
-
* 3. User pastes the API key into the CLI
|
|
10
|
-
*/
|
|
11
|
-
import type { OAuthController } from "./types";
|
|
12
|
-
/**
|
|
13
|
-
* Login to Vercel AI Gateway.
|
|
14
|
-
*
|
|
15
|
-
* Opens browser to Vercel AI Gateway docs and prompts for an API key.
|
|
16
|
-
* Returns the API key directly (not OAuthCredentials - this isn't OAuth).
|
|
17
|
-
*/
|
|
18
|
-
export declare function loginVercelAiGateway(options: OAuthController): Promise<string>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* vLLM login flow.
|
|
3
|
-
*
|
|
4
|
-
* vLLM is commonly self-hosted with an OpenAI-compatible API at a local base URL.
|
|
5
|
-
* Some deployments require a bearer token, others allow unauthenticated access.
|
|
6
|
-
*
|
|
7
|
-
* This flow stores an API-key-style credential used by `/login` and auth storage.
|
|
8
|
-
*/
|
|
9
|
-
import type { OAuthController } from "./types";
|
|
10
|
-
/**
|
|
11
|
-
* Login to vLLM.
|
|
12
|
-
*
|
|
13
|
-
* Opens vLLM OpenAI-compatible auth docs, prompts for an optional token,
|
|
14
|
-
* and returns a stored key value.
|
|
15
|
-
*/
|
|
16
|
-
export declare function loginVllm(options: OAuthController): Promise<string>;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/** xAI OAuth flow (Grok account login). */
|
|
2
|
-
import { OAuthCallbackFlow } from "./callback-server";
|
|
3
|
-
import type { OAuthController, OAuthCredentials } from "./types";
|
|
4
|
-
export declare const XAI_OAUTH_DISCOVERY_URL = "https://auth.x.ai/.well-known/openid-configuration";
|
|
5
|
-
export declare const XAI_OAUTH_CLIENT_ID = "b1a00492-073a-47ea-816f-4c329264a828";
|
|
6
|
-
export declare const XAI_OAUTH_SCOPE = "openid profile email offline_access grok-cli:access api:access";
|
|
7
|
-
interface XaiDiscovery {
|
|
8
|
-
authorizationEndpoint: string;
|
|
9
|
-
tokenEndpoint: string;
|
|
10
|
-
}
|
|
11
|
-
export interface XaiOAuthFlowOptions {
|
|
12
|
-
extraAuthorizeParams?: Readonly<Record<string, string>>;
|
|
13
|
-
}
|
|
14
|
-
export interface XaiOAuthRefreshOptions {
|
|
15
|
-
signal?: AbortSignal;
|
|
16
|
-
extraTokenParams?: Readonly<Record<string, string>>;
|
|
17
|
-
}
|
|
18
|
-
export declare function discoverXaiOAuthEndpoints(signal?: AbortSignal): Promise<XaiDiscovery>;
|
|
19
|
-
export declare class XaiOAuthFlow extends OAuthCallbackFlow {
|
|
20
|
-
#private;
|
|
21
|
-
constructor(ctrl: OAuthController, options?: XaiOAuthFlowOptions);
|
|
22
|
-
generateAuthUrl(state: string, redirectUri: string): Promise<{
|
|
23
|
-
url: string;
|
|
24
|
-
instructions?: string;
|
|
25
|
-
}>;
|
|
26
|
-
exchangeToken(code: string, _state: string, redirectUri: string): Promise<OAuthCredentials>;
|
|
27
|
-
}
|
|
28
|
-
export declare function loginXai(ctrl: OAuthController, options?: XaiOAuthFlowOptions): Promise<OAuthCredentials>;
|
|
29
|
-
export declare function refreshXaiToken(refreshToken: string, options?: AbortSignal | XaiOAuthRefreshOptions): Promise<OAuthCredentials>;
|
|
30
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Xiaomi MiMo login flow.
|
|
3
|
-
*
|
|
4
|
-
* Xiaomi MiMo provides OpenAI-compatible models via
|
|
5
|
-
* https://api.xiaomimimo.com/v1.
|
|
6
|
-
*
|
|
7
|
-
* Standard Xiaomi login opens the pay-as-you-go API key console. Token Plan
|
|
8
|
-
* login opens plan management so users copy the regional `tp-...` key.
|
|
9
|
-
*/
|
|
10
|
-
import type { OAuthController } from "./types";
|
|
11
|
-
/** Region codes accepted by the Xiaomi Token Plan login flow. */
|
|
12
|
-
export type XiaomiTokenPlanRegion = "sgp" | "ams" | "cn";
|
|
13
|
-
/**
|
|
14
|
-
* Login to Xiaomi MiMo.
|
|
15
|
-
*
|
|
16
|
-
* Opens browser to API keys page, prompts user to paste their API key.
|
|
17
|
-
* Returns the API key directly (not OAuthCredentials - this isn't OAuth).
|
|
18
|
-
*/
|
|
19
|
-
export declare function loginXiaomi(options: OAuthController): Promise<string>;
|
|
20
|
-
/**
|
|
21
|
-
* Login to a regional Xiaomi Token Plan endpoint.
|
|
22
|
-
*
|
|
23
|
-
* Prompts for a token-plan API key and validates it against the selected region.
|
|
24
|
-
*/
|
|
25
|
-
export declare function loginXiaomiTokenPlan(options: OAuthController, region: XiaomiTokenPlanRegion): Promise<string>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Z.AI login flow.
|
|
3
|
-
*
|
|
4
|
-
* Z.AI is a platform that provides access to GLM models through an OpenAI-compatible API.
|
|
5
|
-
* API docs: https://docs.z.ai/guides/overview/quick-start
|
|
6
|
-
*
|
|
7
|
-
* This is not OAuth - it's a simple API key flow:
|
|
8
|
-
* 1. User gets their API key from https://z.ai/settings/api-keys
|
|
9
|
-
* 2. User pastes the API key into the CLI
|
|
10
|
-
*/
|
|
11
|
-
import type { OAuthController } from "./types";
|
|
12
|
-
/**
|
|
13
|
-
* Login to Z.AI.
|
|
14
|
-
*
|
|
15
|
-
* Opens browser to API keys page, prompts user to paste their API key.
|
|
16
|
-
* Returns the API key directly (not OAuthCredentials - this isn't OAuth).
|
|
17
|
-
*/
|
|
18
|
-
export declare function loginZai(options: OAuthController): Promise<string>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const loginZenMux: (options: import("./types").OAuthController) => Promise<string>;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import type { AssistantMessage } from "../types";
|
|
2
|
-
/**
|
|
3
|
-
* Check if an assistant message represents a context overflow error.
|
|
4
|
-
*
|
|
5
|
-
* This handles three cases:
|
|
6
|
-
* 1. Error-based overflow: Most providers return stopReason "error" with a
|
|
7
|
-
* specific error message pattern.
|
|
8
|
-
* 2. Silent overflow: Some providers accept overflow requests and return
|
|
9
|
-
* successfully. For these, we check if usage.input exceeds the context window.
|
|
10
|
-
* 3. Proxy-level overflow: Some proxies (e.g. LiteLLM) return a "successful"
|
|
11
|
-
* response with empty content and a fabricated near-zero usage when the
|
|
12
|
-
* upstream model's context window is exceeded.
|
|
13
|
-
*
|
|
14
|
-
* ## Reliability by Provider
|
|
15
|
-
*
|
|
16
|
-
* **Reliable detection (returns error with detectable message):**
|
|
17
|
-
* - Anthropic: "prompt is too long: X tokens > Y maximum"
|
|
18
|
-
* - OpenAI (Completions & Responses): "exceeds the context window"
|
|
19
|
-
* - Google Gemini: "input token count exceeds the maximum"
|
|
20
|
-
* - xAI (Grok): "maximum prompt length is X but request contains Y"
|
|
21
|
-
* - Groq: "reduce the length of the messages"
|
|
22
|
-
* - Cerebras: 400/413 status code (no body)
|
|
23
|
-
* - Mistral: 400/413 status code (no body)
|
|
24
|
-
* - HTTP 413 payload/entity-too-large variants
|
|
25
|
-
* - OpenRouter (all backends): "maximum context length is X tokens"
|
|
26
|
-
* - llama.cpp: "exceeds the available context size"
|
|
27
|
-
* - LM Studio: "greater than the context length"
|
|
28
|
-
* - Kimi For Coding: "exceeded model token limit: X (requested: Y)"
|
|
29
|
-
* - Anthropic 413: "request_too_large" (request body exceeds size limit)
|
|
30
|
-
* - HTTP 413: "Payload Too Large" / "Request Entity Too Large"
|
|
31
|
-
*
|
|
32
|
-
* **Unreliable detection:**
|
|
33
|
-
* - z.ai: Sometimes accepts overflow silently (detectable via usage.input > contextWindow),
|
|
34
|
-
* sometimes returns rate limit errors. Pass contextWindow param to detect silent overflow.
|
|
35
|
-
* - Ollama: Silently truncates input without error. Cannot be detected via this function.
|
|
36
|
-
* - LiteLLM proxy: Returns a "successful" response with empty content and a
|
|
37
|
-
* fabricated near-zero usage (e.g. input: 1, output: 1) when the upstream
|
|
38
|
-
* model's context window is exceeded. Detected via Case 3 (empty content +
|
|
39
|
-
* anomalously low usage). Note: the LiteLLM proxy's context limit may differ
|
|
40
|
-
* from the underlying model's advertised contextWindow (e.g. configured via
|
|
41
|
-
* `model_info.max_tokens` in LiteLLM's config.yaml), so Case 2 (which compares
|
|
42
|
-
* usage.input against contextWindow) may not catch it.
|
|
43
|
-
* The response will have usage.input < expected, but we don't know the expected value.
|
|
44
|
-
*
|
|
45
|
-
* ## Custom Providers
|
|
46
|
-
*
|
|
47
|
-
* If you've added custom models via settings.json, this function may not detect
|
|
48
|
-
* overflow errors from those providers. To add support:
|
|
49
|
-
*
|
|
50
|
-
* 1. Send a request that exceeds the model's context window
|
|
51
|
-
* 2. Check the errorMessage in the response
|
|
52
|
-
* 3. Create a regex pattern that matches the error
|
|
53
|
-
* 4. The pattern should be added to OVERFLOW_PATTERNS in this file, or
|
|
54
|
-
* check the errorMessage yourself before calling this function
|
|
55
|
-
*
|
|
56
|
-
* @param message - The assistant message to check
|
|
57
|
-
* @param contextWindow - Optional context window size for detecting silent overflow (z.ai)
|
|
58
|
-
* @returns true if the message indicates a context overflow
|
|
59
|
-
*/
|
|
60
|
-
export declare function isContextOverflow(message: AssistantMessage, contextWindow?: number): boolean;
|
|
61
|
-
/**
|
|
62
|
-
* Get the overflow patterns for testing purposes.
|
|
63
|
-
*/
|
|
64
|
-
export declare function getOverflowPatterns(): RegExp[];
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared `host:port` parser used by the auth-broker and auth-gateway boot
|
|
3
|
-
* paths. Centralized so the two servers can't drift on what they accept (the
|
|
4
|
-
* gateway used to silently allow empty hostnames; this fixes it).
|
|
5
|
-
*/
|
|
6
|
-
export interface ParsedBind {
|
|
7
|
-
hostname: string;
|
|
8
|
-
port: number;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Parse a `host:port` (or bare `port`, which assumes loopback) string.
|
|
12
|
-
*
|
|
13
|
-
* Accepts:
|
|
14
|
-
* - `"4000"` → `127.0.0.1:4000`
|
|
15
|
-
* - `"0.0.0.0:4000"` → as written
|
|
16
|
-
* - `"[::1]:4000"` → as written (brackets retained, Bun handles them)
|
|
17
|
-
*
|
|
18
|
-
* Rejects:
|
|
19
|
-
* - empty input
|
|
20
|
-
* - empty hostname (`":4000"`)
|
|
21
|
-
* - non-integer / out-of-range port
|
|
22
|
-
*/
|
|
23
|
-
export declare function parseBind(raw: string): ParsedBind;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { Api, Model, ProviderResponseMetadata, StreamOptions } from "../types";
|
|
2
|
-
export declare function normalizeProviderResponse(response: Response, requestId?: string | null, metadata?: Record<string, unknown>): ProviderResponseMetadata;
|
|
3
|
-
export declare function notifyProviderResponse(options: Pick<StreamOptions, "onResponse"> | undefined, response: Response, model?: Model<Api>, requestId?: string | null, metadata?: Record<string, unknown>): Promise<void>;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export type HeadersLike = Headers | Record<string, string | undefined> | undefined | null;
|
|
2
|
-
export declare function formatErrorMessageWithRetryAfter(error: unknown, headers?: HeadersLike): string;
|
|
3
|
-
export declare function getRetryAfterMsFromHeaders(headers: HeadersLike): number | undefined;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function resolveRetryBudget(value: number | undefined, fallback: number): number;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GitHub Copilot intermittently rejects preview models (gpt-5.3-OpenAI code backend,
|
|
3
|
-
* gpt-5.4, gpt-5.4-mini, ...) with HTTP 400 `model_not_supported`, even
|
|
4
|
-
* though the model is listed as enabled on the user's account via `/models`.
|
|
5
|
-
*
|
|
6
|
-
* Root cause: Copilot's request-routing backend is rolled out per OAuth
|
|
7
|
-
* client. Our OAuth client id is shared with opencode; VS Code uses its own
|
|
8
|
-
* client and sees full availability, so the same account may succeed in VS
|
|
9
|
-
* Code and flap between 200/400 here. See opencode#13313 and copilot-cli#2597.
|
|
10
|
-
*
|
|
11
|
-
* Retrying the identical request 2-3 times almost always lands on a backend
|
|
12
|
-
* that has the model, so we wrap the initial request with a short retry loop.
|
|
13
|
-
*/
|
|
14
|
-
export declare function isCopilotTransientModelError(error: unknown): boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Wrap an initial Copilot request so transient `model_not_supported` 400s are
|
|
17
|
-
* retried a small number of times. No-op for non-Copilot providers.
|
|
18
|
-
*
|
|
19
|
-
* The callback **MUST** create a fresh in-flight request each invocation — a
|
|
20
|
-
* once-consumed AsyncIterable cannot be re-iterated.
|
|
21
|
-
*/
|
|
22
|
-
export declare function callWithCopilotModelRetry<T>(fn: () => Promise<T>, options: {
|
|
23
|
-
provider: string;
|
|
24
|
-
signal?: AbortSignal;
|
|
25
|
-
retryBaseDelayMs?: number;
|
|
26
|
-
}): Promise<T>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Set when callers want to globally bypass OpenAI strict-mode enforcement
|
|
3
|
-
* (e.g. for debugging a provider that misreports strict support, or when
|
|
4
|
-
* comparing strict vs non-strict outputs).
|
|
5
|
-
*
|
|
6
|
-
* Honored by every provider that emits `strict: true` on its function tools —
|
|
7
|
-
* see `openai-completions`, `openai-responses`, `OpenAI code provider-responses`, and
|
|
8
|
-
* the strict candidate selection in `anthropic`.
|
|
9
|
-
*/
|
|
10
|
-
export declare const NO_STRICT: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* Consolidated helper for OpenAI-style strict schema enforcement.
|
|
13
|
-
*
|
|
14
|
-
* Each provider computes its own `strict` boolean (logic differs), then calls
|
|
15
|
-
* this to handle the tryEnforceStrictSchema dance uniformly:
|
|
16
|
-
* - Draft-07-shaped inputs are upgraded to draft 2020-12 first.
|
|
17
|
-
* - If `strict` is false, passes the upgraded schema through unchanged.
|
|
18
|
-
* - If `strict` is true, attempts to enforce strict mode; falls back to
|
|
19
|
-
* non-strict if the schema isn't representable.
|
|
20
|
-
*/
|
|
21
|
-
export declare function adaptSchemaForStrict(schema: Record<string, unknown>, strict: boolean): {
|
|
22
|
-
schema: Record<string, unknown>;
|
|
23
|
-
strict: boolean;
|
|
24
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Schema compatibility audits.
|
|
3
|
-
*
|
|
4
|
-
* Each provider has a different idea of what JSON Schema features it accepts
|
|
5
|
-
* for tool definitions. The normalizers in `normalize.ts`, `strict-mode`,
|
|
6
|
-
* and `adapt.ts` rewrite incoming schemas to fit. This module is the
|
|
7
|
-
* *audit* counterpart: it walks a (presumably already-sanitized) schema and
|
|
8
|
-
* reports any feature the target provider would reject. Tests use it to lock
|
|
9
|
-
* down the contract; the runtime uses it to fail-open with diagnostic logs
|
|
10
|
-
* rather than silently shipping a broken tool definition.
|
|
11
|
-
*/
|
|
12
|
-
export type SchemaCompatibilityProvider = "openai-strict" | "google" | "cloud-code-assist-claude";
|
|
13
|
-
export interface SchemaCompatibilityViolation {
|
|
14
|
-
path: string;
|
|
15
|
-
rule: string;
|
|
16
|
-
message: string;
|
|
17
|
-
key?: string;
|
|
18
|
-
value?: unknown;
|
|
19
|
-
}
|
|
20
|
-
export interface SchemaCompatibilityResult {
|
|
21
|
-
provider: SchemaCompatibilityProvider;
|
|
22
|
-
compatible: boolean;
|
|
23
|
-
violations: SchemaCompatibilityViolation[];
|
|
24
|
-
}
|
|
25
|
-
export interface StrictSchemaEnforcementResult {
|
|
26
|
-
schema: Record<string, unknown>;
|
|
27
|
-
strict: boolean;
|
|
28
|
-
}
|
|
29
|
-
export declare function validateSchemaCompatibility(schema: unknown, provider: SchemaCompatibilityProvider): SchemaCompatibilityResult;
|
|
30
|
-
export declare function validateStrictSchemaEnforcement(originalSchema: Record<string, unknown>, result: StrictSchemaEnforcementResult): SchemaCompatibilityResult;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Dereference all local `$ref` pointers in a JSON Schema, inlining definitions
|
|
3
|
-
* from `$defs` / `definitions`. The `$defs` block is stripped from the output.
|
|
4
|
-
*
|
|
5
|
-
* Non-local refs (e.g. `http://...`) are left untouched.
|
|
6
|
-
* Circular references are broken with `{}`.
|
|
7
|
-
*
|
|
8
|
-
* @returns A new schema object with all local refs inlined, or the input unchanged
|
|
9
|
-
* if it's not an object or has no `$defs`/`definitions`.
|
|
10
|
-
*/
|
|
11
|
-
export declare function dereferenceJsonSchema(schema: unknown): unknown;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const JSON_SCHEMA_DRAFT_2020_12_URI = "https://json-schema.org/draft/2020-12/schema";
|
|
2
|
-
/** Pre-check entrypoint. Exposed so callers can decide whether to take the upgrade path at all. */
|
|
3
|
-
export declare function schemaNeedsDraft202012Upgrade(schema: unknown): boolean;
|
|
4
|
-
/**
|
|
5
|
-
* Upgrade legacy JSON Schema shapes to the draft 2020-12 form emitted by Zod.
|
|
6
|
-
*
|
|
7
|
-
* This keeps extension/MCP/TypeBox schemas compatible with providers whose tool
|
|
8
|
-
* validators reject draft-07 tuple and dependency keywords.
|
|
9
|
-
*/
|
|
10
|
-
export declare function upgradeJsonSchemaTo202012(schema: unknown): unknown;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { JsonObject } from "./types";
|
|
2
|
-
export declare function areJsonValuesEqual(left: unknown, right: unknown): boolean;
|
|
3
|
-
export declare function mergeCompatibleEnumSchemas(existing: unknown, incoming: unknown): JsonObject | null;
|
|
4
|
-
export declare function mergePropertySchemas(existing: unknown, incoming: unknown): unknown;
|