@linxiraos/pi-catalog 1.1.26 → 1.2.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/CHANGELOG.md +4 -6
- package/dist/types/compat/auth-ids.d.ts +2 -2
- package/dist/types/compat/collapse.d.ts +7 -0
- package/dist/types/compat/image-tokenization.d.ts +52 -0
- package/dist/types/compat/judgment-questions.d.ts +7 -0
- package/dist/types/compat/prompt-cache-lookback.d.ts +7 -0
- package/dist/types/compat/provider-ids.d.ts +1 -1
- package/dist/types/compat/reasoning-carry.d.ts +21 -0
- package/dist/types/compat/request-size.d.ts +7 -0
- package/dist/types/compat/taxonomy.d.ts +0 -10
- package/dist/types/compat/types.d.ts +4 -0
- package/dist/types/discovery/antigravity.d.ts +13 -3
- package/dist/types/hosts.d.ts +4 -0
- package/dist/types/model-cache.d.ts +6 -0
- package/dist/types/model-manager.d.ts +16 -0
- package/dist/types/provider-models/account-access.d.ts +11 -0
- package/dist/types/provider-models/google.d.ts +23 -1
- package/dist/types/provider-models/openai-compat.d.ts +19 -1
- package/dist/types/provider-models/special.d.ts +8 -0
- package/dist/types/types.d.ts +134 -23
- package/dist/types/wire/cloudflare-ai-gateway.d.ts +0 -10
- package/dist/types/wire/cloudflare.d.ts +10 -0
- package/dist/types/wire/factory-droid.d.ts +1 -1
- package/dist/types/wire/gemini-headers.d.ts +6 -3
- package/package.json +4 -4
- package/src/build.ts +39 -35
- package/src/compat/auth-ids.ts +6 -0
- package/src/compat/axes.ts +43 -5
- package/src/compat/cascade.ts +6 -1
- package/src/compat/collapse.d.ts +7 -0
- package/src/compat/collapse.ts +11 -0
- package/src/compat/image-tokenization.ts +166 -0
- package/src/compat/judgment-questions.ts +12 -0
- package/src/compat/prompt-cache-lookback.ts +23 -0
- package/src/compat/provider-ids.d.ts +1 -1
- package/src/compat/provider-ids.ts +3 -0
- package/src/compat/reasoning-carry.ts +64 -0
- package/src/compat/request-size.ts +25 -0
- package/src/compat/resolve.ts +36 -25
- package/src/compat/rules/README.md +13 -3
- package/src/compat/rules/auth/_order.kdl +2 -2
- package/src/compat/rules/auth/cloudflare-workers-ai.kdl +9 -0
- package/src/compat/rules/auth/coralbricks.kdl +13 -0
- package/src/compat/rules/auth/minimax-code-cn.kdl +1 -1
- package/src/compat/rules/auth/minimax-code.kdl +1 -1
- package/src/compat/rules/auth/openai-codex.kdl +1 -1
- package/src/compat/rules/auth/snowflake.kdl +11 -0
- package/src/compat/rules/auth/stencil.kdl +1 -1
- package/src/compat/rules/classes/anthropic.kdl +188 -7
- package/src/compat/rules/classes/deepseek.kdl +11 -3
- package/src/compat/rules/classes/gemini.kdl +12 -0
- package/src/compat/rules/classes/glm.kdl +17 -8
- package/src/compat/rules/classes/kimi.kdl +15 -0
- package/src/compat/rules/classes/meta.kdl +4 -4
- package/src/compat/rules/classes/minimax.kdl +31 -1
- package/src/compat/rules/classes/openai.kdl +114 -4
- package/src/compat/rules/classes/qwen.kdl +2 -1
- package/src/compat/rules/providers/abliteration.kdl +7 -0
- package/src/compat/rules/providers/amazon-bedrock.kdl +0 -7
- package/src/compat/rules/providers/anthropic.kdl +13 -0
- package/src/compat/rules/providers/apple.kdl +1 -0
- package/src/compat/rules/providers/cloudflare-workers-ai.kdl +34 -0
- package/src/compat/rules/providers/coralbricks.kdl +62 -0
- package/src/compat/rules/providers/cursor.kdl +28 -8
- package/src/compat/rules/providers/devin.kdl +2 -2
- package/src/compat/rules/providers/factory-droid.kdl +77 -13
- package/src/compat/rules/providers/github-copilot.kdl +29 -0
- package/src/compat/rules/providers/google-antigravity.kdl +8 -1
- package/src/compat/rules/providers/groq.kdl +21 -0
- package/src/compat/rules/providers/image-tokenization.kdl +42 -0
- package/src/compat/rules/providers/judgment-questions.kdl +53 -0
- package/src/compat/rules/providers/litellm.kdl +4 -1
- package/src/compat/rules/providers/meta.kdl +3 -3
- package/src/compat/rules/providers/minimax-code-cn.kdl +10 -5
- package/src/compat/rules/providers/minimax-code.kdl +10 -5
- package/src/compat/rules/providers/mistral.kdl +25 -1
- package/src/compat/rules/providers/moonshot.kdl +11 -0
- package/src/compat/rules/providers/muse-code.kdl +7 -0
- package/src/compat/rules/providers/ollama.kdl +3 -0
- package/src/compat/rules/providers/openai-codex.kdl +18 -13
- package/src/compat/rules/providers/openai.kdl +22 -0
- package/src/compat/rules/providers/opencode-go.kdl +11 -0
- package/src/compat/rules/providers/opencode-zen.kdl +20 -0
- package/src/compat/rules/providers/openrouter.kdl +6 -0
- package/src/compat/rules/providers/snowflake.kdl +135 -0
- package/src/compat/rules/providers/tool-result-images.kdl +16 -0
- package/src/compat/rules/providers/zhipu-coding-plan.kdl +10 -0
- package/src/compat/rules/runtime/behavior.kdl +8 -5
- package/src/compat/rules/taxonomy/_collapse.kdl +52 -2
- package/src/compat/rules/taxonomy/deepseek.kdl +4 -0
- package/src/compat/rules/taxonomy/kimi.kdl +5 -0
- package/src/compat/rules.json +1 -1
- package/src/compat/taxonomy.d.ts +0 -10
- package/src/compat/taxonomy.ts +3 -3
- package/src/compat/types.d.ts +4 -0
- package/src/compat/types.ts +4 -0
- package/src/discovery/antigravity.d.ts +13 -3
- package/src/discovery/antigravity.ts +33 -17
- package/src/discovery/cursor.ts +28 -4
- package/src/discovery/devin.ts +20 -2
- package/src/hosts.d.ts +4 -0
- package/src/hosts.ts +2 -0
- package/src/model-cache.d.ts +6 -0
- package/src/model-cache.ts +123 -47
- package/src/model-manager.d.ts +16 -0
- package/src/model-manager.ts +107 -41
- package/src/model-tokenizer.ts +3 -0
- package/src/models.json +1 -1
- package/src/provider-models/account-access.d.ts +11 -0
- package/src/provider-models/account-access.ts +30 -0
- package/src/provider-models/cache-provider-id.ts +13 -6
- package/src/provider-models/cline-pass.ts +33 -0
- package/src/provider-models/descriptors.ts +4 -0
- package/src/provider-models/google.d.ts +23 -1
- package/src/provider-models/google.ts +72 -14
- package/src/provider-models/openai-compat.d.ts +19 -1
- package/src/provider-models/openai-compat.ts +281 -42
- package/src/provider-models/special.d.ts +8 -0
- package/src/provider-models/special.ts +26 -22
- package/src/types.d.ts +134 -23
- package/src/types.ts +183 -20
- package/src/wire/cloudflare-ai-gateway.d.ts +0 -10
- package/src/wire/cloudflare-ai-gateway.ts +0 -36
- package/src/wire/cloudflare.ts +40 -0
- package/src/wire/factory-droid.d.ts +1 -1
- package/src/wire/factory-droid.ts +1 -1
- package/src/wire/gemini-headers.d.ts +6 -3
- package/src/wire/gemini-headers.ts +39 -21
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Api, ModelSpec } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Merge per-account discovery catalogs into one list, deduped by model id.
|
|
4
|
+
*
|
|
5
|
+
* The first catalog to list an id supplies its spec; {@link ModelSpec.accountAccess}
|
|
6
|
+
* is merged from every catalog listing that id, so credential selection can
|
|
7
|
+
* route account-gated models to the accounts that serve them. Used by
|
|
8
|
+
* multi-account discovery for Codex and Antigravity, whose rosters differ per
|
|
9
|
+
* account.
|
|
10
|
+
*/
|
|
11
|
+
export declare function unionAccountCatalogs<TApi extends Api>(catalogs: readonly (readonly ModelSpec<TApi>[])[]): ModelSpec<TApi>[];
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Api, ModelSpec } from "../types";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Merge per-account discovery catalogs into one list, deduped by model id.
|
|
5
|
+
*
|
|
6
|
+
* The first catalog to list an id supplies its spec; {@link ModelSpec.accountAccess}
|
|
7
|
+
* is merged from every catalog listing that id, so credential selection can
|
|
8
|
+
* route account-gated models to the accounts that serve them. Used by
|
|
9
|
+
* multi-account discovery for Codex and Antigravity, whose rosters differ per
|
|
10
|
+
* account.
|
|
11
|
+
*/
|
|
12
|
+
export function unionAccountCatalogs<TApi extends Api>(
|
|
13
|
+
catalogs: readonly (readonly ModelSpec<TApi>[])[],
|
|
14
|
+
): ModelSpec<TApi>[] {
|
|
15
|
+
const byId = new Map<string, ModelSpec<TApi>>();
|
|
16
|
+
for (const catalog of catalogs) {
|
|
17
|
+
for (const model of catalog) {
|
|
18
|
+
const existing = byId.get(model.id);
|
|
19
|
+
if (!existing) {
|
|
20
|
+
byId.set(model.id, model);
|
|
21
|
+
} else if (model.accountAccess) {
|
|
22
|
+
byId.set(model.id, {
|
|
23
|
+
...existing,
|
|
24
|
+
accountAccess: { ...existing.accountAccess, ...model.accountAccess },
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return [...byId.values()];
|
|
30
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CHARM_HYPER_API_BASE_URL, normalizeCharmHyperBaseUrl } from "../wire/charm-hyper";
|
|
2
|
-
import { CODEX_CLIENT_VERSION } from "../wire/codex";
|
|
2
|
+
import { CODEX_BASE_URL, CODEX_CLIENT_VERSION } from "../wire/codex";
|
|
3
3
|
import { CURSOR_DEFAULT_BASE_URL } from "../wire/cursor";
|
|
4
4
|
import { type AccountScope, factoryDroidModelCacheProviderId } from "../wire/factory-droid";
|
|
5
5
|
import { PERSONAL_GITHUB_COPILOT_BASE_URL } from "../wire/github-copilot";
|
|
@@ -91,9 +91,15 @@ function cursorCredentialSubject(apiKey: string): string | undefined {
|
|
|
91
91
|
/** Resolve the cache namespace used by a provider's model-manager options without constructing those options. */
|
|
92
92
|
export function resolveModelCacheProviderId(providerId: string, options: ModelCacheProviderIdOptions = {}): string {
|
|
93
93
|
switch (providerId) {
|
|
94
|
-
case "openai-codex":
|
|
95
|
-
// The backend filters the roster by client version.
|
|
96
|
-
|
|
94
|
+
case "openai-codex": {
|
|
95
|
+
// The backend filters the roster by client version. A Codex-compatible
|
|
96
|
+
// gateway publishes its own roster; discovery is authoritative, so the
|
|
97
|
+
// namespace must follow the endpoint. The official backend keeps the
|
|
98
|
+
// unhashed namespace so existing caches stay valid.
|
|
99
|
+
const baseUrl = options.baseUrl?.trim().replace(/\/+$/, "");
|
|
100
|
+
if (!baseUrl || baseUrl === CODEX_BASE_URL) return `${providerId}:${CODEX_CLIENT_VERSION}`;
|
|
101
|
+
return `${providerId}:${CODEX_CLIENT_VERSION}:${Bun.hash(baseUrl).toString(36)}`;
|
|
102
|
+
}
|
|
97
103
|
case "ollama":
|
|
98
104
|
return resolveOllamaModelCacheProviderId(providerId, options.baseUrl);
|
|
99
105
|
case "cursor": {
|
|
@@ -102,11 +108,12 @@ export function resolveModelCacheProviderId(providerId: string, options: ModelCa
|
|
|
102
108
|
// authoritative model rows.
|
|
103
109
|
// v3 invalidates zero-price rows written before rich lanes were priced
|
|
104
110
|
// from the KDL rate card; v4 keys the scope on the token's stable
|
|
105
|
-
// account subject instead of the rotating JWT
|
|
111
|
+
// account subject instead of the rotating JWT; v5 drops rows that still
|
|
112
|
+
// mark the account default `isProviderDefault`, which startup now honors.
|
|
106
113
|
const baseUrl = (options.baseUrl ?? CURSOR_DEFAULT_BASE_URL).replace(/\/+$/, "");
|
|
107
114
|
const apiKey = options.apiKey ?? "";
|
|
108
115
|
const scope = `${cursorCredentialSubject(apiKey) ?? apiKey}\u0000${baseUrl}`;
|
|
109
|
-
return `cursor:rich-models-
|
|
116
|
+
return `cursor:rich-models-v5:${Bun.hash(scope).toString(36)}`;
|
|
110
117
|
}
|
|
111
118
|
case "charm-hyper": {
|
|
112
119
|
// Discovery is authoritative for this gateway, so a warm cache is served
|
|
@@ -34,6 +34,35 @@ const LOW_TO_MAX: ThinkingConfig = {
|
|
|
34
34
|
requiresEffort: false,
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
+
const MINIMAL_TO_XHIGH: ThinkingConfig = {
|
|
38
|
+
mode: "effort",
|
|
39
|
+
efforts: [Effort.Minimal, Effort.Low, Effort.Medium, Effort.High, Effort.XHigh],
|
|
40
|
+
defaultLevel: Effort.Medium,
|
|
41
|
+
requiresEffort: false,
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const DEEPSEEK_V41_FLASH_FREE: ClinePassModelMetadata = {
|
|
45
|
+
name: "DeepSeek V4.1 Flash (free)",
|
|
46
|
+
contextWindow: 1_048_576,
|
|
47
|
+
maxTokens: 384_000,
|
|
48
|
+
input: ["text", "image"],
|
|
49
|
+
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
|
50
|
+
reasoning: true,
|
|
51
|
+
thinking: LOW_HIGH_MAX,
|
|
52
|
+
tier: "free",
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const MUSE_SPARK_13_CONTRIBUTOR_FREE: ClinePassModelMetadata = {
|
|
56
|
+
name: "Muse Spark 1.3 (C) (free)",
|
|
57
|
+
contextWindow: 1_048_576,
|
|
58
|
+
maxTokens: 131_072,
|
|
59
|
+
input: ["text", "image"],
|
|
60
|
+
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
|
61
|
+
reasoning: true,
|
|
62
|
+
thinking: MINIMAL_TO_XHIGH,
|
|
63
|
+
tier: "free",
|
|
64
|
+
};
|
|
65
|
+
|
|
37
66
|
const QWEN_38_EFFORTS: ThinkingConfig = {
|
|
38
67
|
mode: "effort",
|
|
39
68
|
efforts: [Effort.Minimal, Effort.Low, Effort.Medium, Effort.High, Effort.XHigh],
|
|
@@ -219,6 +248,10 @@ export const CLINE_PASS_MODEL_METADATA: Readonly<Record<string, ClinePassModelMe
|
|
|
219
248
|
reasoning: true,
|
|
220
249
|
tier: "free",
|
|
221
250
|
},
|
|
251
|
+
"cline-free/deepseek-v4.1-flash": DEEPSEEK_V41_FLASH_FREE,
|
|
252
|
+
"deepseek/deepseek-v4.1-flash": DEEPSEEK_V41_FLASH_FREE,
|
|
253
|
+
"cline-free/muse-spark-1.3-contributor": MUSE_SPARK_13_CONTRIBUTOR_FREE,
|
|
254
|
+
"meta/muse-spark-1.3-contributor": MUSE_SPARK_13_CONTRIBUTOR_FREE,
|
|
222
255
|
};
|
|
223
256
|
|
|
224
257
|
export function getClinePassModelMetadata(id: string): ClinePassModelMetadata | undefined {
|
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
clinePassModelManagerOptions,
|
|
30
30
|
cloudflareAiGatewayModelManagerOptions,
|
|
31
31
|
commandCodeModelManagerOptions,
|
|
32
|
+
coralbricksModelManagerOptions,
|
|
32
33
|
coreWeaveModelManagerOptions,
|
|
33
34
|
deepinfraModelManagerOptions,
|
|
34
35
|
deepseekModelManagerOptions,
|
|
@@ -78,6 +79,7 @@ import {
|
|
|
78
79
|
zhipuCodingPlanModelManagerOptions,
|
|
79
80
|
} from "./openai-compat";
|
|
80
81
|
import {
|
|
82
|
+
cloudflareWorkersAiModelManagerOptions,
|
|
81
83
|
cursorModelManagerOptions,
|
|
82
84
|
devinModelManagerOptions,
|
|
83
85
|
factoryDroidModelManagerOptions,
|
|
@@ -104,7 +106,9 @@ const MODEL_MANAGER_FACTORIES: Readonly<Partial<Record<KnownProvider, ModelManag
|
|
|
104
106
|
cerebras: config => cerebrasModelManagerOptions(config),
|
|
105
107
|
"charm-hyper": config => charmHyperModelManagerOptions(config),
|
|
106
108
|
"cloudflare-ai-gateway": config => cloudflareAiGatewayModelManagerOptions(config),
|
|
109
|
+
"cloudflare-workers-ai": () => cloudflareWorkersAiModelManagerOptions(),
|
|
107
110
|
commandcode: config => commandCodeModelManagerOptions(config),
|
|
111
|
+
coralbricks: config => coralbricksModelManagerOptions(config),
|
|
108
112
|
cursor: config => cursorModelManagerOptions(config),
|
|
109
113
|
deepinfra: config => deepinfraModelManagerOptions(config),
|
|
110
114
|
deepseek: config => deepseekModelManagerOptions(config),
|
|
@@ -11,8 +11,30 @@ export interface GoogleVertexModelManagerConfig {
|
|
|
11
11
|
signal?: AbortSignal;
|
|
12
12
|
fetch?: FetchImpl;
|
|
13
13
|
}
|
|
14
|
+
/** One Antigravity OAuth account whose `fetchAvailableModels` roster discovery reads. */
|
|
15
|
+
export interface GoogleAntigravityAccount {
|
|
16
|
+
/** OAuth access token used for `Authorization: Bearer ...`. */
|
|
17
|
+
accessToken: string;
|
|
18
|
+
/**
|
|
19
|
+
* Credential identity recorded in {@link ModelSpec.accountAccess} for every
|
|
20
|
+
* model this account serves (see `oauthAccountKey` in `@linxiraos/pi-ai`).
|
|
21
|
+
* When any account lacks one, no model records per-account access.
|
|
22
|
+
*/
|
|
23
|
+
accountKey?: string;
|
|
24
|
+
}
|
|
14
25
|
export interface GoogleAntigravityModelManagerConfig {
|
|
15
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Resolves every configured Antigravity account at discovery time. Rosters
|
|
28
|
+
* are plan-scoped (Claude 5.5 is served to some accounts only) and
|
|
29
|
+
* authoritative, so each account's roster is fetched and the results are
|
|
30
|
+
* unioned; reading one account's roster would prune models only its
|
|
31
|
+
* siblings serve (#14924).
|
|
32
|
+
*
|
|
33
|
+
* Returns `null` to abort discovery (e.g. an account's credential failed to
|
|
34
|
+
* refresh), keeping the previous/bundled catalog instead of caching a
|
|
35
|
+
* partial one.
|
|
36
|
+
*/
|
|
37
|
+
resolveAccounts?: () => Promise<readonly GoogleAntigravityAccount[] | null>;
|
|
16
38
|
endpoint?: string;
|
|
17
39
|
fetch?: FetchImpl;
|
|
18
40
|
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import { logger } from "@linxiraos/pi-utils";
|
|
1
2
|
import { reviewedCollapseTable } from "../compat/collapse";
|
|
2
3
|
import { classifyModel } from "../compat/taxonomy";
|
|
4
|
+
import { providerEntry } from "../compat/providers";
|
|
3
5
|
import { fetchAntigravityDiscoveryModels } from "../discovery/antigravity";
|
|
4
6
|
import { fetchGeminiModels } from "../discovery/gemini";
|
|
5
7
|
import { fetchGeminiCliQuotaModels } from "../discovery/gemini-cli";
|
|
6
8
|
import type { ModelManagerOptions } from "../model-manager";
|
|
7
|
-
import type { FetchImpl } from "../types";
|
|
9
|
+
import type { FetchImpl, ModelSpec } from "../types";
|
|
10
|
+
import { unionAccountCatalogs } from "./account-access";
|
|
8
11
|
|
|
9
12
|
export interface GoogleModelManagerConfig {
|
|
10
13
|
apiKey?: string;
|
|
@@ -19,8 +22,31 @@ export interface GoogleVertexModelManagerConfig {
|
|
|
19
22
|
fetch?: FetchImpl;
|
|
20
23
|
}
|
|
21
24
|
|
|
25
|
+
/** One Antigravity OAuth account whose `fetchAvailableModels` roster discovery reads. */
|
|
26
|
+
export interface GoogleAntigravityAccount {
|
|
27
|
+
/** OAuth access token used for `Authorization: Bearer ...`. */
|
|
28
|
+
accessToken: string;
|
|
29
|
+
/**
|
|
30
|
+
* Credential identity recorded in {@link ModelSpec.accountAccess} for every
|
|
31
|
+
* model this account serves (see `oauthAccountKey` in `@linxiraos/pi-ai`).
|
|
32
|
+
* When any account lacks one, no model records per-account access.
|
|
33
|
+
*/
|
|
34
|
+
accountKey?: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
22
37
|
export interface GoogleAntigravityModelManagerConfig {
|
|
23
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Resolves every configured Antigravity account at discovery time. Rosters
|
|
40
|
+
* are plan-scoped (Claude 5.5 is served to some accounts only) and
|
|
41
|
+
* authoritative, so each account's roster is fetched and the results are
|
|
42
|
+
* unioned; reading one account's roster would prune models only its
|
|
43
|
+
* siblings serve (#14924).
|
|
44
|
+
*
|
|
45
|
+
* Returns `null` to abort discovery (e.g. an account's credential failed to
|
|
46
|
+
* refresh), keeping the previous/bundled catalog instead of caching a
|
|
47
|
+
* partial one.
|
|
48
|
+
*/
|
|
49
|
+
resolveAccounts?: () => Promise<readonly GoogleAntigravityAccount[] | null>;
|
|
24
50
|
endpoint?: string;
|
|
25
51
|
fetch?: FetchImpl;
|
|
26
52
|
}
|
|
@@ -70,17 +96,49 @@ export function googleVertexModelManagerOptions(_config?: GoogleVertexModelManag
|
|
|
70
96
|
export function googleAntigravityModelManagerOptions(
|
|
71
97
|
config?: GoogleAntigravityModelManagerConfig,
|
|
72
98
|
): ModelManagerOptions<"google-gemini-cli"> {
|
|
73
|
-
const
|
|
99
|
+
const resolveAccounts = config?.resolveAccounts;
|
|
74
100
|
return {
|
|
75
101
|
providerId: "google-antigravity",
|
|
76
|
-
|
|
102
|
+
dynamicModelsAuthoritative: providerEntry("google-antigravity")?.dynamicModelsAuthoritative === true,
|
|
103
|
+
...(resolveAccounts
|
|
77
104
|
? {
|
|
78
|
-
fetchDynamicModels: () =>
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
105
|
+
fetchDynamicModels: async () => {
|
|
106
|
+
const accounts = await resolveAccounts();
|
|
107
|
+
if (!accounts || accounts.length === 0) return null;
|
|
108
|
+
const fetcher = toDiscoveryFetch(config?.fetch);
|
|
109
|
+
const rosters = await Promise.all(
|
|
110
|
+
accounts.map(async account => ({
|
|
111
|
+
accountKey: account.accountKey,
|
|
112
|
+
result: await fetchAntigravityDiscoveryModels({
|
|
113
|
+
token: account.accessToken,
|
|
114
|
+
endpoint: config?.endpoint,
|
|
115
|
+
fetcher,
|
|
116
|
+
}),
|
|
117
|
+
})),
|
|
118
|
+
);
|
|
119
|
+
const catalogs: { accountKey: string | undefined; models: ModelSpec<"google-gemini-cli">[] }[] = [];
|
|
120
|
+
for (const { accountKey, result } of rosters) {
|
|
121
|
+
// A transient failure would leave the union partial; keep the previous catalog.
|
|
122
|
+
if (!result) return null;
|
|
123
|
+
if (result.rejectedStatus !== undefined) {
|
|
124
|
+
logger.warn("Antigravity model discovery skipped an account whose credential was rejected", {
|
|
125
|
+
accountKey,
|
|
126
|
+
status: result.rejectedStatus,
|
|
127
|
+
});
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
catalogs.push({ accountKey, models: result.models });
|
|
131
|
+
}
|
|
132
|
+
if (catalogs.length === 0) return null;
|
|
133
|
+
const tagAccess = catalogs.every(catalog => catalog.accountKey !== undefined);
|
|
134
|
+
return unionAccountCatalogs(
|
|
135
|
+
catalogs.map(({ accountKey, models }) =>
|
|
136
|
+
tagAccess && accountKey !== undefined
|
|
137
|
+
? models.map(model => ({ ...model, accountAccess: { [accountKey]: {} } }))
|
|
138
|
+
: models,
|
|
139
|
+
),
|
|
140
|
+
);
|
|
141
|
+
},
|
|
84
142
|
}
|
|
85
143
|
: undefined),
|
|
86
144
|
};
|
|
@@ -101,19 +159,19 @@ export function googleGeminiCliModelManagerOptions(
|
|
|
101
159
|
if (collapseTable === undefined) {
|
|
102
160
|
throw new Error("missing reviewed collapse table for google-gemini-cli");
|
|
103
161
|
}
|
|
104
|
-
const
|
|
162
|
+
const result = await fetchAntigravityDiscoveryModels({
|
|
105
163
|
token,
|
|
106
164
|
fetcher,
|
|
107
|
-
collapseTable
|
|
165
|
+
collapseTable,
|
|
108
166
|
});
|
|
109
167
|
// Antigravity's fetchAvailableModels is unreachable for
|
|
110
168
|
// credentials without Antigravity entitlement (Code Assist
|
|
111
169
|
// Standard returns HTTP 403). Fall back to the account's own
|
|
112
170
|
// retrieveUserQuota list on Cloud Code Assist.
|
|
113
|
-
if (
|
|
171
|
+
if (result === null || result.rejectedStatus !== undefined) {
|
|
114
172
|
return fetchGeminiCliQuotaModels({ token, projectId: config?.projectId, endpoint, fetcher });
|
|
115
173
|
}
|
|
116
|
-
return models
|
|
174
|
+
return result.models
|
|
117
175
|
.filter(m => classifyModel("google-gemini-cli", m.id, { lenient: true }).class === "gemini")
|
|
118
176
|
.map(m => ({
|
|
119
177
|
...m,
|
|
@@ -69,7 +69,7 @@ export interface OpenAIModelManagerConfig {
|
|
|
69
69
|
baseUrl?: string;
|
|
70
70
|
fetch?: FetchImpl;
|
|
71
71
|
}
|
|
72
|
-
export declare function openaiModelManagerOptions(config?: OpenAIModelManagerConfig): ModelManagerOptions<
|
|
72
|
+
export declare function openaiModelManagerOptions(config?: OpenAIModelManagerConfig): ModelManagerOptions<Api>;
|
|
73
73
|
/**
|
|
74
74
|
* Re-derive the generated pro-reasoning aliases (`gpt-5.6-*-pro`) for the
|
|
75
75
|
* first-party `openai` gpt-5.6 rows. Each alias inherits the base row's
|
|
@@ -154,6 +154,19 @@ export interface DeepinfraModelManagerConfig {
|
|
|
154
154
|
* model availability at runtime is still gated on credentials by the registry.
|
|
155
155
|
*/
|
|
156
156
|
export declare function deepinfraModelManagerOptions(config?: DeepinfraModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
157
|
+
export declare const CORALBRICKS_BASE_URL = "https://inference.coralbricks.ai/v1";
|
|
158
|
+
/** CoralBricks OpenAI-compatible discovery configuration. */
|
|
159
|
+
export interface CoralbricksModelManagerConfig {
|
|
160
|
+
apiKey?: string;
|
|
161
|
+
baseUrl?: string;
|
|
162
|
+
fetch?: FetchImpl;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Builds CoralBricks' model-discovery manager. `/v1/models` is key-protected
|
|
166
|
+
* (401 without a bearer key), so a keyless config serves only the bundled
|
|
167
|
+
* reviewed seed rows; with a key, live rows are authoritative over the bundle.
|
|
168
|
+
*/
|
|
169
|
+
export declare function coralbricksModelManagerOptions(config?: CoralbricksModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
157
170
|
export interface XaiModelManagerConfig {
|
|
158
171
|
apiKey?: string;
|
|
159
172
|
baseUrl?: string;
|
|
@@ -339,6 +352,11 @@ export interface OpenRouterModelManagerConfig {
|
|
|
339
352
|
baseUrl?: string;
|
|
340
353
|
fetch?: FetchImpl;
|
|
341
354
|
}
|
|
355
|
+
/**
|
|
356
|
+
* OpenRouter's Decisions API lives at `/api/alpha`, a sibling of the `/api/v1`
|
|
357
|
+
* chat root; derive it so a custom gateway base URL keeps both aligned.
|
|
358
|
+
*/
|
|
359
|
+
export declare function openrouterDecisionsBaseUrl(chatBaseUrl: string): string;
|
|
342
360
|
export declare function openrouterModelManagerOptions(config?: OpenRouterModelManagerConfig): ModelManagerOptions<Api>;
|
|
343
361
|
export interface ZenMuxModelManagerConfig {
|
|
344
362
|
apiKey?: string;
|