@rigelbuild/omp-catalog 18.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1204 -0
- package/LICENSE +22 -0
- package/README.md +43 -0
- package/THIRD-PARTY-NOTICES.txt +22909 -0
- package/dist/types/build.d.ts +19 -0
- package/dist/types/compat/anthropic.d.ts +18 -0
- package/dist/types/compat/apply.d.ts +7 -0
- package/dist/types/compat/bedrock.d.ts +3 -0
- package/dist/types/compat/devin.d.ts +9 -0
- package/dist/types/compat/openai.d.ts +28 -0
- package/dist/types/discovery/antigravity.d.ts +70 -0
- package/dist/types/discovery/codex.d.ts +36 -0
- package/dist/types/discovery/cursor-proto.d.ts +5368 -0
- package/dist/types/discovery/cursor.d.ts +23 -0
- package/dist/types/discovery/devin-proto.d.ts +1549 -0
- package/dist/types/discovery/devin.d.ts +24 -0
- package/dist/types/discovery/gemini-cli.d.ts +33 -0
- package/dist/types/discovery/gemini.d.ts +25 -0
- package/dist/types/discovery/gitlab-duo-workflow.d.ts +30 -0
- package/dist/types/discovery/index.d.ts +7 -0
- package/dist/types/discovery/openai-compatible.d.ts +89 -0
- package/dist/types/discovery/protobuf.d.ts +102 -0
- package/dist/types/effort.d.ts +10 -0
- package/dist/types/fireworks-model-id.d.ts +23 -0
- package/dist/types/hosts.d.ts +169 -0
- package/dist/types/identity/bundled.d.ts +3 -0
- package/dist/types/identity/classify.d.ts +69 -0
- package/dist/types/identity/dialect.d.ts +3 -0
- package/dist/types/identity/family.d.ts +239 -0
- package/dist/types/identity/id.d.ts +12 -0
- package/dist/types/identity/index.d.ts +8 -0
- package/dist/types/identity/markers.d.ts +4 -0
- package/dist/types/identity/priority.d.ts +1 -0
- package/dist/types/identity/reference.d.ts +29 -0
- package/dist/types/index.d.ts +19 -0
- package/dist/types/model-cache.d.ts +23 -0
- package/dist/types/model-manager.d.ts +77 -0
- package/dist/types/model-thinking.d.ts +70 -0
- package/dist/types/model-tokenizer.d.ts +8 -0
- package/dist/types/models.d.ts +14 -0
- package/dist/types/openai-pricing.d.ts +17 -0
- package/dist/types/provider-models/bundled-references.d.ts +13 -0
- package/dist/types/provider-models/cache-provider-id.d.ts +11 -0
- package/dist/types/provider-models/descriptor-types.d.ts +76 -0
- package/dist/types/provider-models/descriptors.d.ts +505 -0
- package/dist/types/provider-models/google.d.ts +29 -0
- package/dist/types/provider-models/index.d.ts +7 -0
- package/dist/types/provider-models/ollama.d.ts +22 -0
- package/dist/types/provider-models/openai-compat.d.ts +646 -0
- package/dist/types/provider-models/special.d.ts +53 -0
- package/dist/types/types.d.ts +876 -0
- package/dist/types/utils.d.ts +20 -0
- package/dist/types/variant-collapse.d.ts +137 -0
- package/dist/types/wire/alibaba-token-plan.d.ts +22 -0
- package/dist/types/wire/codex.d.ts +66 -0
- package/dist/types/wire/coreweave.d.ts +12 -0
- package/dist/types/wire/gemini-headers.d.ts +62 -0
- package/dist/types/wire/github-copilot.d.ts +47 -0
- package/dist/types/wire/image-fetchers.d.ts +76 -0
- package/package.json +102 -0
- package/src/build.ts +103 -0
- package/src/compat/anthropic.ts +179 -0
- package/src/compat/apply.ts +15 -0
- package/src/compat/bedrock.ts +153 -0
- package/src/compat/devin.ts +12 -0
- package/src/compat/openai.ts +864 -0
- package/src/discovery/antigravity.ts +257 -0
- package/src/discovery/codex.ts +456 -0
- package/src/discovery/cursor-proto.ts +8329 -0
- package/src/discovery/cursor.ts +409 -0
- package/src/discovery/devin-proto.ts +2037 -0
- package/src/discovery/devin.ts +152 -0
- package/src/discovery/gemini-cli.ts +198 -0
- package/src/discovery/gemini.ts +260 -0
- package/src/discovery/gitlab-duo-workflow.ts +859 -0
- package/src/discovery/index.ts +7 -0
- package/src/discovery/openai-compatible.ts +266 -0
- package/src/discovery/protobuf.ts +1073 -0
- package/src/effort.ts +18 -0
- package/src/fireworks-model-id.ts +50 -0
- package/src/hosts.ts +178 -0
- package/src/identity/bundled.ts +28 -0
- package/src/identity/classify.ts +242 -0
- package/src/identity/dialect.ts +42 -0
- package/src/identity/family.ts +477 -0
- package/src/identity/id.ts +81 -0
- package/src/identity/index.ts +8 -0
- package/src/identity/markers.ts +49 -0
- package/src/identity/priority.ts +59 -0
- package/src/identity/reference.ts +167 -0
- package/src/index.ts +19 -0
- package/src/model-cache.ts +346 -0
- package/src/model-manager.ts +683 -0
- package/src/model-thinking.ts +925 -0
- package/src/model-tokenizer.ts +75 -0
- package/src/models.json +304657 -0
- package/src/models.json.d.ts +9 -0
- package/src/models.ts +108 -0
- package/src/openai-pricing.ts +29 -0
- package/src/provider-models/bundled-references.ts +87 -0
- package/src/provider-models/cache-provider-id.ts +97 -0
- package/src/provider-models/descriptor-types.ts +85 -0
- package/src/provider-models/descriptors.ts +585 -0
- package/src/provider-models/google.ts +117 -0
- package/src/provider-models/index.ts +7 -0
- package/src/provider-models/ollama.ts +204 -0
- package/src/provider-models/openai-compat.ts +6405 -0
- package/src/provider-models/special.ts +213 -0
- package/src/types.ts +1032 -0
- package/src/utils.ts +69 -0
- package/src/variant-collapse.ts +1555 -0
- package/src/wire/alibaba-token-plan.ts +54 -0
- package/src/wire/codex.ts +117 -0
- package/src/wire/coreweave.ts +51 -0
- package/src/wire/gemini-headers.ts +135 -0
- package/src/wire/github-copilot.ts +147 -0
- package/src/wire/image-fetchers.ts +159 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The single Model constructor. Resolution order is a dependency chain, each
|
|
3
|
+
* step materialized exactly once per spec:
|
|
4
|
+
*
|
|
5
|
+
* 1. compat — URL/provider/id detection resolved into a complete record;
|
|
6
|
+
* 2. thinking — derived from identity + resolved compat (or trusted verbatim
|
|
7
|
+
* when the spec carries explicit metadata);
|
|
8
|
+
*
|
|
9
|
+
* Request handlers read fields — they never detect, parse ids, or allocate
|
|
10
|
+
* compat per request.
|
|
11
|
+
*/
|
|
12
|
+
import type { Api, CompatOf, Model, ModelSpec } from "./types.js";
|
|
13
|
+
/**
|
|
14
|
+
* Build one model from an authored spec. Bundled models.json rows are fully
|
|
15
|
+
* materialized by the generator and consumed directly (see `models.ts`), so
|
|
16
|
+
* this only runs for discovered/custom/override specs.
|
|
17
|
+
*/
|
|
18
|
+
export declare function buildModel<TApi extends Api>(spec: ModelSpec<TApi>): Model<TApi>;
|
|
19
|
+
export declare function buildCompat(spec: ModelSpec<Api>): CompatOf<Api>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ModelSpec, ResolvedAnthropicCompat } from "../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Official first-party Anthropic API. A missing baseUrl is official on purpose:
|
|
4
|
+
* request dispatch falls back to `https://api.anthropic.com`. This is the one
|
|
5
|
+
* auth-sensitive host check — OAuth credentials are attached based on it — so
|
|
6
|
+
* it requires the exact origin or a path boundary (`/`) after it; a bare
|
|
7
|
+
* prefix check would accept lookalikes like `https://api.anthropic.com.evil.com`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function isOfficialAnthropicApiUrl(baseUrl?: string): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Known non-official URLs that enforce Anthropic thinking signatures on replay.
|
|
12
|
+
*
|
|
13
|
+
* Runtime routing calls this with the effective URL because a model's resolved
|
|
14
|
+
* compat can be stale after Foundry or a provider base-URL override reroutes it.
|
|
15
|
+
*/
|
|
16
|
+
export declare function isAnthropicSigningProxyUrl(baseUrl?: string): boolean;
|
|
17
|
+
/** Build the resolved anthropic-messages compat record for a model spec. */
|
|
18
|
+
export declare function buildAnthropicCompat(spec: ModelSpec<"anthropic-messages">): ResolvedAnthropicCompat;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Assign defined override values onto a freshly-built resolved compat record,
|
|
3
|
+
* in place. Keys the record doesn't declare are ignored (loosely-typed config
|
|
4
|
+
* may carry junk). `buildModel` is the only intended caller — the record being
|
|
5
|
+
* mutated is the single per-model allocation; nothing here runs per request.
|
|
6
|
+
*/
|
|
7
|
+
export declare function applyCompatOverrides(compat: object, overrides: object | undefined): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ModelSpec, ResolvedDevinCompat } from "../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Resolve devin-agent (Codeium Cascade) compat. Cascade has no wire
|
|
4
|
+
* reasoning/effort field — effort is selected by routing to a sibling model id
|
|
5
|
+
* (the `thinking.effortRouting` baked by variant-collapse). So the thinking
|
|
6
|
+
* deriver must never fabricate an effort ladder from identity for these models;
|
|
7
|
+
* only explicit routed metadata counts.
|
|
8
|
+
*/
|
|
9
|
+
export declare function buildDevinCompat(_spec: ModelSpec<"devin-agent">): ResolvedDevinCompat;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ModelSpec, OpenAICompat, ResolvedOpenAICompat, ResolvedOpenAIResponsesCompat, ResolvedOpenRouterCompat } from "../types.js";
|
|
2
|
+
/** Wire effort remap for first-party xAI Responses. */
|
|
3
|
+
export declare function xaiResponsesReasoningEffortMap(modelId: string): NonNullable<OpenAICompat["reasoningEffortMap"]>;
|
|
4
|
+
/**
|
|
5
|
+
* Build the resolved chat-completions compat record for a model spec.
|
|
6
|
+
* Provider takes precedence over URL-based detection since it's explicitly configured.
|
|
7
|
+
*/
|
|
8
|
+
export declare function buildOpenAICompat(spec: ModelSpec<"openai-completions">): ResolvedOpenAICompat;
|
|
9
|
+
interface OpenAIResponsesSpecLike {
|
|
10
|
+
id?: string;
|
|
11
|
+
provider: string;
|
|
12
|
+
name: string;
|
|
13
|
+
baseUrl: string;
|
|
14
|
+
reasoning?: boolean;
|
|
15
|
+
compat?: OpenAICompat;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Build the resolved Responses-API compat record. Most shared OpenAI-compatible
|
|
19
|
+
* capability defaults intentionally mirror chat-completions, while Responses-
|
|
20
|
+
* only behavior (developer role, prompt cache, pairing strictness, image detail)
|
|
21
|
+
* keeps endpoint-specific detection. Azure is detected by provider id as well
|
|
22
|
+
* as URL — bundled `azure` models carry no baseUrl (the deployment host is per-
|
|
23
|
+
* resource, resolved at runtime) — while OpenAI/Copilot developer-role and
|
|
24
|
+
* prompt-cache detection stay URL-keyed, as the historical call sites were.
|
|
25
|
+
*/
|
|
26
|
+
export declare function buildOpenAIResponsesCompat(spec: OpenAIResponsesSpecLike): ResolvedOpenAIResponsesCompat;
|
|
27
|
+
export declare function buildOpenRouterCompat(spec: ModelSpec<"openrouter">): ResolvedOpenRouterCompat;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { ModelSpec } from "../types.js";
|
|
2
|
+
import { type VariantCollapseTable } from "../variant-collapse.js";
|
|
3
|
+
export declare const ANTIGRAVITY_PRIMARY_ENDPOINT = "https://daily-cloudcode-pa.googleapis.com";
|
|
4
|
+
export declare const ANTIGRAVITY_SANDBOX_ENDPOINT = "https://daily-cloudcode-pa.sandbox.googleapis.com";
|
|
5
|
+
/**
|
|
6
|
+
* Raw model metadata returned by Antigravity's `fetchAvailableModels` endpoint.
|
|
7
|
+
*/
|
|
8
|
+
export interface AntigravityDiscoveryApiModel {
|
|
9
|
+
displayName?: string;
|
|
10
|
+
supportsImages?: boolean;
|
|
11
|
+
supportsThinking?: boolean;
|
|
12
|
+
thinkingBudget?: number;
|
|
13
|
+
recommended?: boolean;
|
|
14
|
+
maxTokens?: number;
|
|
15
|
+
maxOutputTokens?: number;
|
|
16
|
+
model?: string;
|
|
17
|
+
apiProvider?: string;
|
|
18
|
+
modelProvider?: string;
|
|
19
|
+
isInternal?: boolean;
|
|
20
|
+
supportsVideo?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Grouping metadata used by Antigravity to surface recommended model ids.
|
|
24
|
+
*/
|
|
25
|
+
export interface AntigravityDiscoveryAgentModelGroup {
|
|
26
|
+
modelIds?: string[];
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Sort/group metadata used by Antigravity to surface recommended model ids.
|
|
30
|
+
*/
|
|
31
|
+
export interface AntigravityDiscoveryAgentModelSort {
|
|
32
|
+
groups?: AntigravityDiscoveryAgentModelGroup[];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Response payload returned by Antigravity's `fetchAvailableModels` endpoint.
|
|
36
|
+
*/
|
|
37
|
+
export interface AntigravityDiscoveryApiResponse {
|
|
38
|
+
models?: Record<string, AntigravityDiscoveryApiModel>;
|
|
39
|
+
agentModelSorts?: AntigravityDiscoveryAgentModelSort[];
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Options for fetching Antigravity discovery models.
|
|
43
|
+
*/
|
|
44
|
+
export interface FetchAntigravityDiscoveryModelsOptions {
|
|
45
|
+
/** OAuth access token used as `Authorization: Bearer <token>`. */
|
|
46
|
+
token: string;
|
|
47
|
+
/** Optional endpoint override. Defaults to Antigravity fallback endpoints. */
|
|
48
|
+
endpoint?: string;
|
|
49
|
+
/** Deprecated and ignored for antigravity discovery parity. */
|
|
50
|
+
project?: string;
|
|
51
|
+
/** Optional user agent override. */
|
|
52
|
+
userAgent?: string;
|
|
53
|
+
/** Optional abort signal for request cancellation. */
|
|
54
|
+
signal?: AbortSignal;
|
|
55
|
+
/** Optional fetch implementation override for tests. */
|
|
56
|
+
fetcher?: typeof fetch;
|
|
57
|
+
/**
|
|
58
|
+
* Hand collapse table to apply to the discovered list. Defaults to the
|
|
59
|
+
* Antigravity (budget-transport) table; `googleGeminiCli` passes the
|
|
60
|
+
* level-transport table so cloudcode-pa keeps `thinkingLevel`.
|
|
61
|
+
*/
|
|
62
|
+
collapseTable?: VariantCollapseTable;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Fetches discoverable Antigravity models and normalizes them into canonical model entries.
|
|
66
|
+
*
|
|
67
|
+
* Returns `null` on network/payload/auth failures.
|
|
68
|
+
* Returns `[]` only when the endpoint responds successfully with no usable models.
|
|
69
|
+
*/
|
|
70
|
+
export declare function fetchAntigravityDiscoveryModels(options: FetchAntigravityDiscoveryModelsOptions): Promise<ModelSpec<"google-gemini-cli">[] | null>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { FetchImpl, ModelSpec } from "../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Fetch options for OpenAI Codex model discovery.
|
|
4
|
+
*/
|
|
5
|
+
export interface CodexModelDiscoveryOptions {
|
|
6
|
+
/** OAuth access token used for `Authorization: Bearer ...`. */
|
|
7
|
+
accessToken: string;
|
|
8
|
+
/** ChatGPT account id value used for `chatgpt-account-id` header. */
|
|
9
|
+
accountId?: string;
|
|
10
|
+
/** Base URL for Codex backend. Defaults to `https://chatgpt.com/backend-api`. */
|
|
11
|
+
baseUrl?: string;
|
|
12
|
+
/** Optional client version attached as `client_version` query parameter. */
|
|
13
|
+
clientVersion?: string;
|
|
14
|
+
/** Optional endpoint path candidates. Defaults to `/codex/models`, then `/models`. */
|
|
15
|
+
paths?: readonly string[];
|
|
16
|
+
/** Additional headers merged on top of required Codex headers. */
|
|
17
|
+
headers?: Record<string, string>;
|
|
18
|
+
/** Abort signal for network request cancellation. */
|
|
19
|
+
signal?: AbortSignal;
|
|
20
|
+
/** Optional fetch implementation override for tests. */
|
|
21
|
+
fetchFn?: FetchImpl;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Normalized Codex discovery response.
|
|
25
|
+
*/
|
|
26
|
+
export interface CodexModelDiscoveryResult {
|
|
27
|
+
models: ModelSpec<"openai-codex-responses">[];
|
|
28
|
+
etag?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Fetches model metadata from Codex backend and normalizes it for pi model management.
|
|
32
|
+
*
|
|
33
|
+
* Returns `null` when no supported model-list route can be fetched/parsed.
|
|
34
|
+
* Returns `{ models: [] }` when a route succeeds but yields no usable models.
|
|
35
|
+
*/
|
|
36
|
+
export declare function fetchCodexModels(options: CodexModelDiscoveryOptions): Promise<CodexModelDiscoveryResult | null>;
|