@codeworksh/aikit 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -1
- package/cli.mjs +75 -83
- package/cli.mjs.map +1 -1
- package/{codex-MtP1574D.mjs → codex-CLDBTrFm.mjs} +132 -134
- package/codex-CLDBTrFm.mjs.map +1 -0
- package/copilot-CcD3g6H8.mjs +425 -0
- package/copilot-CcD3g6H8.mjs.map +1 -0
- package/copilot-headers-DceqXlpj.mjs +104 -0
- package/copilot-headers-DceqXlpj.mjs.map +1 -0
- package/github-copilot-BJIrxOzT.mjs +3 -0
- package/github-copilot-SIUCJz1G.mjs +126 -0
- package/github-copilot-SIUCJz1G.mjs.map +1 -0
- package/index.d.mts +980 -932
- package/index.mjs +63 -11
- package/index.mjs.map +1 -1
- package/interactive-eoNnscGB.mjs +57 -0
- package/interactive-eoNnscGB.mjs.map +1 -0
- package/{model-CpX11Oob.d.mts → model-CrVLp622.d.mts} +159 -130
- package/{model-CBnredXj.mjs → model-gCDbmGqT.mjs} +31 -2
- package/model-gCDbmGqT.mjs.map +1 -0
- package/{modelgen-BjSsusLQ.mjs → modelgen-DvorXOjJ.mjs} +148 -29
- package/modelgen-DvorXOjJ.mjs.map +1 -0
- package/modelgen.d.mts +2 -3
- package/modelgen.mjs +1 -1
- package/oauth/github/copilot.d.mts +169 -0
- package/oauth/github/copilot.mjs +2 -0
- package/oauth/interactive.d.mts +21 -0
- package/oauth/interactive.mjs +2 -0
- package/oauth/openai/codex.d.mts +46 -28
- package/oauth/openai/codex.mjs +2 -2
- package/oauth/summary.d.mts +67 -0
- package/oauth/summary.mjs +2 -0
- package/{openai-codex-t4B7g-gv.mjs → openai-codex-Bqzti6Mc.mjs} +3 -3
- package/{openai-codex-t4B7g-gv.mjs.map → openai-codex-Bqzti6Mc.mjs.map} +1 -1
- package/openai-codex-DA1Q7mLN.mjs +2 -0
- package/package.json +34 -22
- package/{registry-DYdYTwFt.mjs → registry-ZxwIW0gX.mjs} +5 -3
- package/registry-ZxwIW0gX.mjs.map +1 -0
- package/storage-v6qjTQ0v.mjs +178 -0
- package/storage-v6qjTQ0v.mjs.map +1 -0
- package/summary-C_QyCVWa.mjs +68 -0
- package/summary-C_QyCVWa.mjs.map +1 -0
- package/codex-MtP1574D.mjs.map +0 -1
- package/model-CBnredXj.mjs.map +0 -1
- package/modelgen-BjSsusLQ.mjs.map +0 -1
- package/openai-codex-BRH4Qa7l.mjs +0 -2
- package/registry-DYdYTwFt.mjs.map +0 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
//#region src/oauth/interactive.ts
|
|
2
|
+
/**
|
|
3
|
+
* Terminal affordances an interactive OAuth login needs: open the
|
|
4
|
+
* authorization URL, and read a pasted code back.
|
|
5
|
+
*
|
|
6
|
+
* Shared so the aikit CLI and anything built on these flows behave the same —
|
|
7
|
+
* they previously kept private copies, and the copies drifted.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Open a URL in the platform browser.
|
|
11
|
+
*
|
|
12
|
+
* `spawn` reports a missing launcher asynchronously, as an `error` event rather
|
|
13
|
+
* than a throw or a rejected promise, so an unhandled one takes the process
|
|
14
|
+
* down — on a box without `xdg-open`, printing a URL would become a crash.
|
|
15
|
+
* `onError` receives that instead.
|
|
16
|
+
*/
|
|
17
|
+
async function openBrowser(url, onError) {
|
|
18
|
+
const { spawn } = await import("node:child_process");
|
|
19
|
+
const command = process.platform === "darwin" ? {
|
|
20
|
+
file: "open",
|
|
21
|
+
args: [url]
|
|
22
|
+
} : process.platform === "win32" ? {
|
|
23
|
+
file: "cmd",
|
|
24
|
+
args: [
|
|
25
|
+
"/c",
|
|
26
|
+
"start",
|
|
27
|
+
"",
|
|
28
|
+
url
|
|
29
|
+
]
|
|
30
|
+
} : {
|
|
31
|
+
file: "xdg-open",
|
|
32
|
+
args: [url]
|
|
33
|
+
};
|
|
34
|
+
const child = spawn(command.file, command.args, {
|
|
35
|
+
detached: true,
|
|
36
|
+
stdio: "ignore"
|
|
37
|
+
});
|
|
38
|
+
child.on("error", (error) => onError?.(error));
|
|
39
|
+
child.unref();
|
|
40
|
+
}
|
|
41
|
+
/** Read one line from stdin, prompting on stdout. */
|
|
42
|
+
async function promptLine(message) {
|
|
43
|
+
const { createInterface } = await import("node:readline/promises");
|
|
44
|
+
const readline = createInterface({
|
|
45
|
+
input: process.stdin,
|
|
46
|
+
output: process.stdout
|
|
47
|
+
});
|
|
48
|
+
try {
|
|
49
|
+
return await readline.question(`${message} `);
|
|
50
|
+
} finally {
|
|
51
|
+
readline.close();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
export { promptLine as n, openBrowser as t };
|
|
56
|
+
|
|
57
|
+
//# sourceMappingURL=interactive-eoNnscGB.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interactive-eoNnscGB.mjs","names":[],"sources":["../../src/oauth/interactive.ts"],"sourcesContent":["/**\n * Terminal affordances an interactive OAuth login needs: open the\n * authorization URL, and read a pasted code back.\n *\n * Shared so the aikit CLI and anything built on these flows behave the same —\n * they previously kept private copies, and the copies drifted.\n */\n\n/**\n * Open a URL in the platform browser.\n *\n * `spawn` reports a missing launcher asynchronously, as an `error` event rather\n * than a throw or a rejected promise, so an unhandled one takes the process\n * down — on a box without `xdg-open`, printing a URL would become a crash.\n * `onError` receives that instead.\n */\nexport async function openBrowser(url: string, onError?: (error: Error) => void): Promise<void> {\n\tconst { spawn } = await import(\"node:child_process\");\n\tconst command =\n\t\tprocess.platform === \"darwin\"\n\t\t\t? { file: \"open\", args: [url] }\n\t\t\t: process.platform === \"win32\"\n\t\t\t\t? { file: \"cmd\", args: [\"/c\", \"start\", \"\", url] }\n\t\t\t\t: { file: \"xdg-open\", args: [url] };\n\n\tconst child = spawn(command.file, command.args, { detached: true, stdio: \"ignore\" });\n\tchild.on(\"error\", (error) => onError?.(error));\n\tchild.unref();\n}\n\n/** Read one line from stdin, prompting on stdout. */\nexport async function promptLine(message: string): Promise<string> {\n\tconst { createInterface } = await import(\"node:readline/promises\");\n\tconst readline = createInterface({ input: process.stdin, output: process.stdout });\n\ttry {\n\t\treturn await readline.question(`${message} `);\n\t} finally {\n\t\treadline.close();\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAgBA,eAAsB,YAAY,KAAa,SAAiD;CAC/F,MAAM,EAAE,UAAU,MAAM,OAAO;CAC/B,MAAM,UACL,QAAQ,aAAa,WAClB;EAAE,MAAM;EAAQ,MAAM,CAAC,GAAG;CAAE,IAC5B,QAAQ,aAAa,UACpB;EAAE,MAAM;EAAO,MAAM;GAAC;GAAM;GAAS;GAAI;EAAG;CAAE,IAC9C;EAAE,MAAM;EAAY,MAAM,CAAC,GAAG;CAAE;CAErC,MAAM,QAAQ,MAAM,QAAQ,MAAM,QAAQ,MAAM;EAAE,UAAU;EAAM,OAAO;CAAS,CAAC;CACnF,MAAM,GAAG,UAAU,UAAU,UAAU,KAAK,CAAC;CAC7C,MAAM,MAAM;AACb;;AAGA,eAAsB,WAAW,SAAkC;CAClE,MAAM,EAAE,oBAAoB,MAAM,OAAO;CACzC,MAAM,WAAW,gBAAgB;EAAE,OAAO,QAAQ;EAAO,QAAQ,QAAQ;CAAO,CAAC;CACjF,IAAI;EACH,OAAO,MAAM,SAAS,SAAS,GAAG,QAAQ,EAAE;CAC7C,UAAU;EACT,SAAS,MAAM;CAChB;AACD"}
|
|
@@ -1,18 +1,28 @@
|
|
|
1
1
|
import Type$1, { Static } from "typebox";
|
|
2
|
-
//#region src/
|
|
2
|
+
//#region src/utils/lazy.d.ts
|
|
3
|
+
declare function lazy<T>(fn: () => T): {
|
|
4
|
+
(): T;
|
|
5
|
+
reset: () => void;
|
|
6
|
+
};
|
|
7
|
+
declare namespace catalog_d_exports {
|
|
8
|
+
export { GeneratedCatalog, KnownProviderEnum$1 as KnownProviderEnum, KnownProviderEnumSchema$1 as KnownProviderEnumSchema, ModelCatalogLoadError$1 as ModelCatalogLoadError, data, filename, get, load, path, projectRoot };
|
|
9
|
+
}
|
|
3
10
|
declare const KnownProviderEnum$1: {
|
|
4
11
|
readonly anthropic: "anthropic";
|
|
5
12
|
readonly google: "google";
|
|
6
13
|
readonly googleVertex: "google-vertex";
|
|
7
14
|
readonly googleVertexAnthropic: "google-vertex-anthropic";
|
|
15
|
+
readonly githubCopilot: "github-copilot";
|
|
8
16
|
readonly openai: "openai";
|
|
9
17
|
readonly openaiCompatible: "openai-compatible";
|
|
10
18
|
readonly openaiCodex: "openai-codex";
|
|
11
19
|
readonly openrouter: "openrouter";
|
|
12
20
|
readonly xai: "xai";
|
|
13
21
|
};
|
|
14
|
-
declare const KnownProviderEnumSchema$1: Type$1.TUnion<[Type$1.TLiteral<"anthropic">, Type$1.TLiteral<"google">, Type$1.TLiteral<"google-vertex">, Type$1.TLiteral<"google-vertex-anthropic">, Type$1.TLiteral<"openai">, Type$1.TLiteral<"openai-compatible">, Type$1.TLiteral<"openai-codex">, Type$1.TLiteral<"openrouter">, Type$1.TLiteral<"xai">]>;
|
|
22
|
+
declare const KnownProviderEnumSchema$1: Type$1.TUnion<[Type$1.TLiteral<"anthropic">, Type$1.TLiteral<"google">, Type$1.TLiteral<"google-vertex">, Type$1.TLiteral<"google-vertex-anthropic">, Type$1.TLiteral<"github-copilot">, Type$1.TLiteral<"openai">, Type$1.TLiteral<"openai-compatible">, Type$1.TLiteral<"openai-codex">, Type$1.TLiteral<"openrouter">, Type$1.TLiteral<"xai">]>;
|
|
15
23
|
type KnownProviderEnum$1 = Static<typeof KnownProviderEnumSchema$1>;
|
|
24
|
+
type GeneratedCatalog = Partial<Record<string, Record<string, unknown>>>;
|
|
25
|
+
type LazyGeneratedCatalog = ReturnType<typeof lazy<Promise<GeneratedCatalog>>>;
|
|
16
26
|
declare const ModelCatalogLoadError$1: {
|
|
17
27
|
new (data: {
|
|
18
28
|
path: string;
|
|
@@ -418,21 +428,28 @@ declare const ModelCatalogLoadError$1: {
|
|
|
418
428
|
stackTraceLimit: number;
|
|
419
429
|
};
|
|
420
430
|
type ModelCatalogLoadError$1 = InstanceType<typeof ModelCatalogLoadError$1>;
|
|
431
|
+
declare function projectRoot(): string;
|
|
432
|
+
declare const filename = "models.gen.json";
|
|
433
|
+
declare function path(): string;
|
|
434
|
+
declare function load(catalogPath?: string): Promise<GeneratedCatalog>;
|
|
435
|
+
declare const data: LazyGeneratedCatalog;
|
|
436
|
+
declare function get(): Promise<GeneratedCatalog>;
|
|
421
437
|
declare namespace model_d_exports {
|
|
422
|
-
export { APIMetadata, APIMetadataSchema, APIMethodEnum, APIMethodEnumSchema, ActiveThinkingLevel, BuiltInModels, Compatibility, CompatibilitySchema, ExtrasSchema, Info, KnownProviderEnum, KnownProviderEnumSchema, ModelCatalogLoadError, ProviderInfo, ProviderToProtocol, Schema, TModel, ThinkingBudgets, ThinkingLevel, ThinkingLevelEnum, ThinkingLevelMap, ThinkingLevelMapSchema, calculateCost, clampThinkingLevel, getBuiltInModels, getModel, getModels, getProviders, getSupportedThinkingLevels, modelsAreEqual, normalizeInput, optionsKey, registry, supportsProtocol, thinkingTokenBudgetField };
|
|
438
|
+
export { APIMetadata, APIMetadataSchema, APIMethodEnum, APIMethodEnumSchema, ActiveThinkingLevel, BuiltInModels, Compatibility, CompatibilitySchema, ExtrasSchema, Info, KnownProviderEnum, KnownProviderEnumSchema, ModelCatalogLoadError, ProviderInfo, ProviderToProtocol, Schema, TModel, ThinkingBudgets, ThinkingLevel, ThinkingLevelEnum, ThinkingLevelMap, ThinkingLevelMapSchema, calculateCost, clampThinkingLevel, getBuiltInModels, getModel, getModels, getProviders, getSupportedThinkingLevels, isAnthropicAdaptiveThinkingModel, modelsAreEqual, normalizeInput, optionsKey, registry, supportsProtocol, thinkingTokenBudgetField };
|
|
423
439
|
}
|
|
424
440
|
declare const KnownProviderEnum: {
|
|
425
441
|
readonly anthropic: "anthropic";
|
|
426
442
|
readonly google: "google";
|
|
427
443
|
readonly googleVertex: "google-vertex";
|
|
428
444
|
readonly googleVertexAnthropic: "google-vertex-anthropic";
|
|
445
|
+
readonly githubCopilot: "github-copilot";
|
|
429
446
|
readonly openai: "openai";
|
|
430
447
|
readonly openaiCompatible: "openai-compatible";
|
|
431
448
|
readonly openaiCodex: "openai-codex";
|
|
432
449
|
readonly openrouter: "openrouter";
|
|
433
450
|
readonly xai: "xai";
|
|
434
451
|
};
|
|
435
|
-
declare const KnownProviderEnumSchema: Type$1.TUnion<[Type$1.TLiteral<"anthropic">, Type$1.TLiteral<"google">, Type$1.TLiteral<"google-vertex">, Type$1.TLiteral<"google-vertex-anthropic">, Type$1.TLiteral<"openai">, Type$1.TLiteral<"openai-compatible">, Type$1.TLiteral<"openai-codex">, Type$1.TLiteral<"openrouter">, Type$1.TLiteral<"xai">]>;
|
|
452
|
+
declare const KnownProviderEnumSchema: Type$1.TUnion<[Type$1.TLiteral<"anthropic">, Type$1.TLiteral<"google">, Type$1.TLiteral<"google-vertex">, Type$1.TLiteral<"google-vertex-anthropic">, Type$1.TLiteral<"github-copilot">, Type$1.TLiteral<"openai">, Type$1.TLiteral<"openai-compatible">, Type$1.TLiteral<"openai-codex">, Type$1.TLiteral<"openrouter">, Type$1.TLiteral<"xai">]>;
|
|
436
453
|
type KnownProviderEnum = KnownProviderEnum$1;
|
|
437
454
|
declare const ModelCatalogLoadError: {
|
|
438
455
|
new (data: {
|
|
@@ -911,6 +928,15 @@ declare const CompatibilitySchema: Type$1.TObject<{
|
|
|
911
928
|
thinkingTokenBudgetField: Type$1.TOptional<Type$1.TString>;
|
|
912
929
|
}>;
|
|
913
930
|
type Compatibility = Static<typeof CompatibilitySchema>;
|
|
931
|
+
/**
|
|
932
|
+
* Claude models that decide their own thinking depth.
|
|
933
|
+
*
|
|
934
|
+
* These take an `effort` level and let the model size each turn's reasoning; the
|
|
935
|
+
* older models take a fixed `budget_tokens` instead. Sending a budget to an
|
|
936
|
+
* adaptive model pins it to one depth for every turn, which is the thing adaptive
|
|
937
|
+
* thinking exists to avoid.
|
|
938
|
+
*/
|
|
939
|
+
declare function isAnthropicAdaptiveThinkingModel(modelId: string): boolean;
|
|
914
940
|
declare const Schema: Type$1.TObject<{
|
|
915
941
|
id: Type$1.TString;
|
|
916
942
|
name: Type$1.TString;
|
|
@@ -983,51 +1009,43 @@ declare const Schema: Type$1.TObject<{
|
|
|
983
1009
|
/** Name of that field, when it is not the conventional `thinking_token_budget`. */
|
|
984
1010
|
thinkingTokenBudgetField: Type$1.TOptional<Type$1.TString>;
|
|
985
1011
|
}>>;
|
|
986
|
-
protocol: Type$1.TUnion<[Type$1.TLiteral<"anthropic">, Type$1.TLiteral<"google">, Type$1.TLiteral<"google-vertex">, Type$1.TLiteral<"google-vertex-anthropic">, Type$1.TLiteral<"openai">, Type$1.TLiteral<"openai-compatible">, Type$1.TLiteral<"openai-codex">, Type$1.TLiteral<"openrouter">, Type$1.TLiteral<"xai">]>;
|
|
1012
|
+
protocol: Type$1.TUnion<[Type$1.TLiteral<"anthropic">, Type$1.TLiteral<"google">, Type$1.TLiteral<"google-vertex">, Type$1.TLiteral<"google-vertex-anthropic">, Type$1.TLiteral<"github-copilot">, Type$1.TLiteral<"openai">, Type$1.TLiteral<"openai-compatible">, Type$1.TLiteral<"openai-codex">, Type$1.TLiteral<"openrouter">, Type$1.TLiteral<"xai">]>;
|
|
987
1013
|
supportedProtocols: Type$1.TOptional<Type$1.TObject<{
|
|
988
|
-
anthropic: Type$1.TOptional<Type$1.TUnion<[Type$1.TLiteral<"anthropic">, Type$1.TLiteral<"google">, Type$1.TLiteral<"google-vertex">, Type$1.TLiteral<"google-vertex-anthropic">, Type$1.TLiteral<"openai">, Type$1.TLiteral<"openai-compatible">, Type$1.TLiteral<"openai-codex">, Type$1.TLiteral<"openrouter">, Type$1.TLiteral<"xai">]>>;
|
|
989
|
-
google: Type$1.TOptional<Type$1.TUnion<[Type$1.TLiteral<"anthropic">, Type$1.TLiteral<"google">, Type$1.TLiteral<"google-vertex">, Type$1.TLiteral<"google-vertex-anthropic">, Type$1.TLiteral<"openai">, Type$1.TLiteral<"openai-compatible">, Type$1.TLiteral<"openai-codex">, Type$1.TLiteral<"openrouter">, Type$1.TLiteral<"xai">]>>;
|
|
990
|
-
googleVertex: Type$1.TOptional<Type$1.TUnion<[Type$1.TLiteral<"anthropic">, Type$1.TLiteral<"google">, Type$1.TLiteral<"google-vertex">, Type$1.TLiteral<"google-vertex-anthropic">, Type$1.TLiteral<"openai">, Type$1.TLiteral<"openai-compatible">, Type$1.TLiteral<"openai-codex">, Type$1.TLiteral<"openrouter">, Type$1.TLiteral<"xai">]>>;
|
|
991
|
-
googleVertexAnthropic: Type$1.TOptional<Type$1.TUnion<[Type$1.TLiteral<"anthropic">, Type$1.TLiteral<"google">, Type$1.TLiteral<"google-vertex">, Type$1.TLiteral<"google-vertex-anthropic">, Type$1.TLiteral<"openai">, Type$1.TLiteral<"openai-compatible">, Type$1.TLiteral<"openai-codex">, Type$1.TLiteral<"openrouter">, Type$1.TLiteral<"xai">]>>;
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
1014
|
+
anthropic: Type$1.TOptional<Type$1.TUnion<[Type$1.TLiteral<"anthropic">, Type$1.TLiteral<"google">, Type$1.TLiteral<"google-vertex">, Type$1.TLiteral<"google-vertex-anthropic">, Type$1.TLiteral<"github-copilot">, Type$1.TLiteral<"openai">, Type$1.TLiteral<"openai-compatible">, Type$1.TLiteral<"openai-codex">, Type$1.TLiteral<"openrouter">, Type$1.TLiteral<"xai">]>>;
|
|
1015
|
+
google: Type$1.TOptional<Type$1.TUnion<[Type$1.TLiteral<"anthropic">, Type$1.TLiteral<"google">, Type$1.TLiteral<"google-vertex">, Type$1.TLiteral<"google-vertex-anthropic">, Type$1.TLiteral<"github-copilot">, Type$1.TLiteral<"openai">, Type$1.TLiteral<"openai-compatible">, Type$1.TLiteral<"openai-codex">, Type$1.TLiteral<"openrouter">, Type$1.TLiteral<"xai">]>>;
|
|
1016
|
+
googleVertex: Type$1.TOptional<Type$1.TUnion<[Type$1.TLiteral<"anthropic">, Type$1.TLiteral<"google">, Type$1.TLiteral<"google-vertex">, Type$1.TLiteral<"google-vertex-anthropic">, Type$1.TLiteral<"github-copilot">, Type$1.TLiteral<"openai">, Type$1.TLiteral<"openai-compatible">, Type$1.TLiteral<"openai-codex">, Type$1.TLiteral<"openrouter">, Type$1.TLiteral<"xai">]>>;
|
|
1017
|
+
googleVertexAnthropic: Type$1.TOptional<Type$1.TUnion<[Type$1.TLiteral<"anthropic">, Type$1.TLiteral<"google">, Type$1.TLiteral<"google-vertex">, Type$1.TLiteral<"google-vertex-anthropic">, Type$1.TLiteral<"github-copilot">, Type$1.TLiteral<"openai">, Type$1.TLiteral<"openai-compatible">, Type$1.TLiteral<"openai-codex">, Type$1.TLiteral<"openrouter">, Type$1.TLiteral<"xai">]>>;
|
|
1018
|
+
githubCopilot: Type$1.TOptional<Type$1.TUnion<[Type$1.TLiteral<"anthropic">, Type$1.TLiteral<"google">, Type$1.TLiteral<"google-vertex">, Type$1.TLiteral<"google-vertex-anthropic">, Type$1.TLiteral<"github-copilot">, Type$1.TLiteral<"openai">, Type$1.TLiteral<"openai-compatible">, Type$1.TLiteral<"openai-codex">, Type$1.TLiteral<"openrouter">, Type$1.TLiteral<"xai">]>>;
|
|
1019
|
+
openai: Type$1.TOptional<Type$1.TUnion<[Type$1.TLiteral<"anthropic">, Type$1.TLiteral<"google">, Type$1.TLiteral<"google-vertex">, Type$1.TLiteral<"google-vertex-anthropic">, Type$1.TLiteral<"github-copilot">, Type$1.TLiteral<"openai">, Type$1.TLiteral<"openai-compatible">, Type$1.TLiteral<"openai-codex">, Type$1.TLiteral<"openrouter">, Type$1.TLiteral<"xai">]>>;
|
|
1020
|
+
openaiCompatible: Type$1.TOptional<Type$1.TUnion<[Type$1.TLiteral<"anthropic">, Type$1.TLiteral<"google">, Type$1.TLiteral<"google-vertex">, Type$1.TLiteral<"google-vertex-anthropic">, Type$1.TLiteral<"github-copilot">, Type$1.TLiteral<"openai">, Type$1.TLiteral<"openai-compatible">, Type$1.TLiteral<"openai-codex">, Type$1.TLiteral<"openrouter">, Type$1.TLiteral<"xai">]>>;
|
|
1021
|
+
openaiCodex: Type$1.TOptional<Type$1.TUnion<[Type$1.TLiteral<"anthropic">, Type$1.TLiteral<"google">, Type$1.TLiteral<"google-vertex">, Type$1.TLiteral<"google-vertex-anthropic">, Type$1.TLiteral<"github-copilot">, Type$1.TLiteral<"openai">, Type$1.TLiteral<"openai-compatible">, Type$1.TLiteral<"openai-codex">, Type$1.TLiteral<"openrouter">, Type$1.TLiteral<"xai">]>>;
|
|
1022
|
+
openrouter: Type$1.TOptional<Type$1.TUnion<[Type$1.TLiteral<"anthropic">, Type$1.TLiteral<"google">, Type$1.TLiteral<"google-vertex">, Type$1.TLiteral<"google-vertex-anthropic">, Type$1.TLiteral<"github-copilot">, Type$1.TLiteral<"openai">, Type$1.TLiteral<"openai-compatible">, Type$1.TLiteral<"openai-codex">, Type$1.TLiteral<"openrouter">, Type$1.TLiteral<"xai">]>>;
|
|
1023
|
+
xai: Type$1.TOptional<Type$1.TUnion<[Type$1.TLiteral<"anthropic">, Type$1.TLiteral<"google">, Type$1.TLiteral<"google-vertex">, Type$1.TLiteral<"google-vertex-anthropic">, Type$1.TLiteral<"github-copilot">, Type$1.TLiteral<"openai">, Type$1.TLiteral<"openai-compatible">, Type$1.TLiteral<"openai-codex">, Type$1.TLiteral<"openrouter">, Type$1.TLiteral<"xai">]>>;
|
|
997
1024
|
}>>;
|
|
998
1025
|
}>;
|
|
999
1026
|
declare const ExtrasSchema: Type$1.TObject<{}>;
|
|
1000
1027
|
declare const Info: Type$1.TObject<{
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
name: Type$1.TString;
|
|
1006
|
-
source: Type$1.TEnum<["env", "config", "custom", "api", "unknown"]>;
|
|
1007
|
-
env: Type$1.TArray<Type$1.TString>;
|
|
1008
|
-
key: Type$1.TOptional<Type$1.TString>;
|
|
1009
|
-
options: Type$1.TOptional<Type$1.TRecord<"^.*$", Type$1.TAny>>;
|
|
1010
|
-
}>;
|
|
1011
|
-
baseUrl: Type$1.TString;
|
|
1012
|
-
reasoning: Type$1.TBoolean;
|
|
1013
|
-
thinkingLevelMap: Type$1.TOptional<Type$1.TObject<{
|
|
1014
|
-
high: Type$1.TOptional<Type$1.TUnion<[Type$1.TString, Type$1.TNull]>>;
|
|
1015
|
-
low: Type$1.TOptional<Type$1.TUnion<[Type$1.TString, Type$1.TNull]>>;
|
|
1016
|
-
max: Type$1.TOptional<Type$1.TUnion<[Type$1.TString, Type$1.TNull]>>;
|
|
1017
|
-
medium: Type$1.TOptional<Type$1.TUnion<[Type$1.TString, Type$1.TNull]>>;
|
|
1018
|
-
minimal: Type$1.TOptional<Type$1.TUnion<[Type$1.TString, Type$1.TNull]>>;
|
|
1019
|
-
off: Type$1.TOptional<Type$1.TUnion<[Type$1.TString, Type$1.TNull]>>;
|
|
1020
|
-
xhigh: Type$1.TOptional<Type$1.TUnion<[Type$1.TString, Type$1.TNull]>>;
|
|
1028
|
+
api: Type$1.TOptional<Type$1.TObject<{
|
|
1029
|
+
id: Type$1.TOptional<Type$1.TString>;
|
|
1030
|
+
url: Type$1.TOptional<Type$1.TString>;
|
|
1031
|
+
method: Type$1.TOptional<Type$1.TUnion<[Type$1.TLiteral<"languageModel">, Type$1.TLiteral<"chat">, Type$1.TLiteral<"completion">, Type$1.TLiteral<"completionModel">, Type$1.TLiteral<"messages">, Type$1.TLiteral<"responses">]>>;
|
|
1021
1032
|
}>>;
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1033
|
+
baseUrl: Type$1.TString;
|
|
1034
|
+
compat: Type$1.TOptional<Type$1.TObject<{
|
|
1035
|
+
/** The Google protocol accepts thinking levels rather than a token budget. */
|
|
1036
|
+
supportsThinkingLevel: Type$1.TOptional<Type$1.TBoolean>;
|
|
1037
|
+
supportsToolSearch: Type$1.TOptional<Type$1.TBoolean>;
|
|
1038
|
+
supportsAdditionalTools: Type$1.TOptional<Type$1.TBoolean>;
|
|
1039
|
+
supportsStrictMode: Type$1.TOptional<Type$1.TBoolean>;
|
|
1040
|
+
supportsOpenAIGrammarTools: Type$1.TOptional<Type$1.TBoolean>;
|
|
1041
|
+
/** The model takes a thinking-token budget as a top-level request field. */
|
|
1042
|
+
supportsThinkingTokenBudget: Type$1.TOptional<Type$1.TBoolean>;
|
|
1043
|
+
/** Claude model that sizes its own thinking, driven by `effort` instead of a token budget. */
|
|
1044
|
+
forceAdaptiveThinking: Type$1.TOptional<Type$1.TBoolean>;
|
|
1045
|
+
/** Name of that field, when it is not the conventional `thinking_token_budget`. */
|
|
1046
|
+
thinkingTokenBudgetField: Type$1.TOptional<Type$1.TString>;
|
|
1029
1047
|
}>>;
|
|
1030
|
-
|
|
1048
|
+
contextWindow: Type$1.TNumber;
|
|
1031
1049
|
cost: Type$1.TObject<{
|
|
1032
1050
|
input: Type$1.TNumber;
|
|
1033
1051
|
output: Type$1.TNumber;
|
|
@@ -1042,43 +1060,53 @@ declare const Info: Type$1.TObject<{
|
|
|
1042
1060
|
}>>>;
|
|
1043
1061
|
serviceTierMultipliers: Type$1.TOptional<Type$1.TRecord<"^.*$", Type$1.TNumber>>;
|
|
1044
1062
|
}>;
|
|
1045
|
-
contextWindow: Type$1.TNumber;
|
|
1046
|
-
maxTokens: Type$1.TNumber;
|
|
1047
1063
|
headers: Type$1.TOptional<Type$1.TRecord<"^.*$", Type$1.TString>>;
|
|
1064
|
+
id: Type$1.TString;
|
|
1065
|
+
input: Type$1.TArray<Type$1.TUnion<[Type$1.TLiteral<"text">, Type$1.TLiteral<"image">]>>;
|
|
1066
|
+
maxTokens: Type$1.TNumber;
|
|
1067
|
+
name: Type$1.TString;
|
|
1048
1068
|
npm: Type$1.TOptional<Type$1.TString>;
|
|
1049
|
-
api: Type$1.TOptional<Type$1.TObject<{
|
|
1050
|
-
id: Type$1.TOptional<Type$1.TString>;
|
|
1051
|
-
url: Type$1.TOptional<Type$1.TString>;
|
|
1052
|
-
method: Type$1.TOptional<Type$1.TUnion<[Type$1.TLiteral<"languageModel">, Type$1.TLiteral<"chat">, Type$1.TLiteral<"completion">, Type$1.TLiteral<"completionModel">, Type$1.TLiteral<"messages">, Type$1.TLiteral<"responses">]>>;
|
|
1053
|
-
}>>;
|
|
1054
|
-
providerOptionsKey: Type$1.TOptional<Type$1.TString>;
|
|
1055
1069
|
options: Type$1.TOptional<Type$1.TRecord<"^.*$", Type$1.TUnknown>>;
|
|
1070
|
+
protocol: Type$1.TUnion<[Type$1.TLiteral<"anthropic">, Type$1.TLiteral<"google">, Type$1.TLiteral<"google-vertex">, Type$1.TLiteral<"google-vertex-anthropic">, Type$1.TLiteral<"github-copilot">, Type$1.TLiteral<"openai">, Type$1.TLiteral<"openai-compatible">, Type$1.TLiteral<"openai-codex">, Type$1.TLiteral<"openrouter">, Type$1.TLiteral<"xai">]>;
|
|
1071
|
+
provider: Type$1.TObject<{
|
|
1072
|
+
id: Type$1.TString;
|
|
1073
|
+
name: Type$1.TString;
|
|
1074
|
+
source: Type$1.TEnum<["env", "config", "custom", "api", "unknown"]>;
|
|
1075
|
+
env: Type$1.TArray<Type$1.TString>;
|
|
1076
|
+
key: Type$1.TOptional<Type$1.TString>;
|
|
1077
|
+
options: Type$1.TOptional<Type$1.TRecord<"^.*$", Type$1.TAny>>;
|
|
1078
|
+
}>;
|
|
1056
1079
|
providerOptions: Type$1.TOptional<Type$1.TRecord<"^.*$", Type$1.TUnknown>>;
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
supportsThinkingLevel: Type$1.TOptional<Type$1.TBoolean>;
|
|
1060
|
-
supportsToolSearch: Type$1.TOptional<Type$1.TBoolean>;
|
|
1061
|
-
supportsAdditionalTools: Type$1.TOptional<Type$1.TBoolean>;
|
|
1062
|
-
supportsStrictMode: Type$1.TOptional<Type$1.TBoolean>;
|
|
1063
|
-
supportsOpenAIGrammarTools: Type$1.TOptional<Type$1.TBoolean>;
|
|
1064
|
-
/** The model takes a thinking-token budget as a top-level request field. */
|
|
1065
|
-
supportsThinkingTokenBudget: Type$1.TOptional<Type$1.TBoolean>;
|
|
1066
|
-
/** Claude model that sizes its own thinking, driven by `effort` instead of a token budget. */
|
|
1067
|
-
forceAdaptiveThinking: Type$1.TOptional<Type$1.TBoolean>;
|
|
1068
|
-
/** Name of that field, when it is not the conventional `thinking_token_budget`. */
|
|
1069
|
-
thinkingTokenBudgetField: Type$1.TOptional<Type$1.TString>;
|
|
1070
|
-
}>>;
|
|
1071
|
-
protocol: Type$1.TUnion<[Type$1.TLiteral<"anthropic">, Type$1.TLiteral<"google">, Type$1.TLiteral<"google-vertex">, Type$1.TLiteral<"google-vertex-anthropic">, Type$1.TLiteral<"openai">, Type$1.TLiteral<"openai-compatible">, Type$1.TLiteral<"openai-codex">, Type$1.TLiteral<"openrouter">, Type$1.TLiteral<"xai">]>;
|
|
1080
|
+
providerOptionsKey: Type$1.TOptional<Type$1.TString>;
|
|
1081
|
+
reasoning: Type$1.TBoolean;
|
|
1072
1082
|
supportedProtocols: Type$1.TOptional<Type$1.TObject<{
|
|
1073
|
-
anthropic: Type$1.TOptional<Type$1.TUnion<[Type$1.TLiteral<"anthropic">, Type$1.TLiteral<"google">, Type$1.TLiteral<"google-vertex">, Type$1.TLiteral<"google-vertex-anthropic">, Type$1.TLiteral<"openai">, Type$1.TLiteral<"openai-compatible">, Type$1.TLiteral<"openai-codex">, Type$1.TLiteral<"openrouter">, Type$1.TLiteral<"xai">]>>;
|
|
1074
|
-
google: Type$1.TOptional<Type$1.TUnion<[Type$1.TLiteral<"anthropic">, Type$1.TLiteral<"google">, Type$1.TLiteral<"google-vertex">, Type$1.TLiteral<"google-vertex-anthropic">, Type$1.TLiteral<"openai">, Type$1.TLiteral<"openai-compatible">, Type$1.TLiteral<"openai-codex">, Type$1.TLiteral<"openrouter">, Type$1.TLiteral<"xai">]>>;
|
|
1075
|
-
googleVertex: Type$1.TOptional<Type$1.TUnion<[Type$1.TLiteral<"anthropic">, Type$1.TLiteral<"google">, Type$1.TLiteral<"google-vertex">, Type$1.TLiteral<"google-vertex-anthropic">, Type$1.TLiteral<"openai">, Type$1.TLiteral<"openai-compatible">, Type$1.TLiteral<"openai-codex">, Type$1.TLiteral<"openrouter">, Type$1.TLiteral<"xai">]>>;
|
|
1076
|
-
googleVertexAnthropic: Type$1.TOptional<Type$1.TUnion<[Type$1.TLiteral<"anthropic">, Type$1.TLiteral<"google">, Type$1.TLiteral<"google-vertex">, Type$1.TLiteral<"google-vertex-anthropic">, Type$1.TLiteral<"openai">, Type$1.TLiteral<"openai-compatible">, Type$1.TLiteral<"openai-codex">, Type$1.TLiteral<"openrouter">, Type$1.TLiteral<"xai">]>>;
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1083
|
+
anthropic: Type$1.TOptional<Type$1.TUnion<[Type$1.TLiteral<"anthropic">, Type$1.TLiteral<"google">, Type$1.TLiteral<"google-vertex">, Type$1.TLiteral<"google-vertex-anthropic">, Type$1.TLiteral<"github-copilot">, Type$1.TLiteral<"openai">, Type$1.TLiteral<"openai-compatible">, Type$1.TLiteral<"openai-codex">, Type$1.TLiteral<"openrouter">, Type$1.TLiteral<"xai">]>>;
|
|
1084
|
+
google: Type$1.TOptional<Type$1.TUnion<[Type$1.TLiteral<"anthropic">, Type$1.TLiteral<"google">, Type$1.TLiteral<"google-vertex">, Type$1.TLiteral<"google-vertex-anthropic">, Type$1.TLiteral<"github-copilot">, Type$1.TLiteral<"openai">, Type$1.TLiteral<"openai-compatible">, Type$1.TLiteral<"openai-codex">, Type$1.TLiteral<"openrouter">, Type$1.TLiteral<"xai">]>>;
|
|
1085
|
+
googleVertex: Type$1.TOptional<Type$1.TUnion<[Type$1.TLiteral<"anthropic">, Type$1.TLiteral<"google">, Type$1.TLiteral<"google-vertex">, Type$1.TLiteral<"google-vertex-anthropic">, Type$1.TLiteral<"github-copilot">, Type$1.TLiteral<"openai">, Type$1.TLiteral<"openai-compatible">, Type$1.TLiteral<"openai-codex">, Type$1.TLiteral<"openrouter">, Type$1.TLiteral<"xai">]>>;
|
|
1086
|
+
googleVertexAnthropic: Type$1.TOptional<Type$1.TUnion<[Type$1.TLiteral<"anthropic">, Type$1.TLiteral<"google">, Type$1.TLiteral<"google-vertex">, Type$1.TLiteral<"google-vertex-anthropic">, Type$1.TLiteral<"github-copilot">, Type$1.TLiteral<"openai">, Type$1.TLiteral<"openai-compatible">, Type$1.TLiteral<"openai-codex">, Type$1.TLiteral<"openrouter">, Type$1.TLiteral<"xai">]>>;
|
|
1087
|
+
githubCopilot: Type$1.TOptional<Type$1.TUnion<[Type$1.TLiteral<"anthropic">, Type$1.TLiteral<"google">, Type$1.TLiteral<"google-vertex">, Type$1.TLiteral<"google-vertex-anthropic">, Type$1.TLiteral<"github-copilot">, Type$1.TLiteral<"openai">, Type$1.TLiteral<"openai-compatible">, Type$1.TLiteral<"openai-codex">, Type$1.TLiteral<"openrouter">, Type$1.TLiteral<"xai">]>>;
|
|
1088
|
+
openai: Type$1.TOptional<Type$1.TUnion<[Type$1.TLiteral<"anthropic">, Type$1.TLiteral<"google">, Type$1.TLiteral<"google-vertex">, Type$1.TLiteral<"google-vertex-anthropic">, Type$1.TLiteral<"github-copilot">, Type$1.TLiteral<"openai">, Type$1.TLiteral<"openai-compatible">, Type$1.TLiteral<"openai-codex">, Type$1.TLiteral<"openrouter">, Type$1.TLiteral<"xai">]>>;
|
|
1089
|
+
openaiCompatible: Type$1.TOptional<Type$1.TUnion<[Type$1.TLiteral<"anthropic">, Type$1.TLiteral<"google">, Type$1.TLiteral<"google-vertex">, Type$1.TLiteral<"google-vertex-anthropic">, Type$1.TLiteral<"github-copilot">, Type$1.TLiteral<"openai">, Type$1.TLiteral<"openai-compatible">, Type$1.TLiteral<"openai-codex">, Type$1.TLiteral<"openrouter">, Type$1.TLiteral<"xai">]>>;
|
|
1090
|
+
openaiCodex: Type$1.TOptional<Type$1.TUnion<[Type$1.TLiteral<"anthropic">, Type$1.TLiteral<"google">, Type$1.TLiteral<"google-vertex">, Type$1.TLiteral<"google-vertex-anthropic">, Type$1.TLiteral<"github-copilot">, Type$1.TLiteral<"openai">, Type$1.TLiteral<"openai-compatible">, Type$1.TLiteral<"openai-codex">, Type$1.TLiteral<"openrouter">, Type$1.TLiteral<"xai">]>>;
|
|
1091
|
+
openrouter: Type$1.TOptional<Type$1.TUnion<[Type$1.TLiteral<"anthropic">, Type$1.TLiteral<"google">, Type$1.TLiteral<"google-vertex">, Type$1.TLiteral<"google-vertex-anthropic">, Type$1.TLiteral<"github-copilot">, Type$1.TLiteral<"openai">, Type$1.TLiteral<"openai-compatible">, Type$1.TLiteral<"openai-codex">, Type$1.TLiteral<"openrouter">, Type$1.TLiteral<"xai">]>>;
|
|
1092
|
+
xai: Type$1.TOptional<Type$1.TUnion<[Type$1.TLiteral<"anthropic">, Type$1.TLiteral<"google">, Type$1.TLiteral<"google-vertex">, Type$1.TLiteral<"google-vertex-anthropic">, Type$1.TLiteral<"github-copilot">, Type$1.TLiteral<"openai">, Type$1.TLiteral<"openai-compatible">, Type$1.TLiteral<"openai-codex">, Type$1.TLiteral<"openrouter">, Type$1.TLiteral<"xai">]>>;
|
|
1093
|
+
}>>;
|
|
1094
|
+
thinkingBudgets: Type$1.TOptional<Type$1.TObject<{
|
|
1095
|
+
high: Type$1.TOptional<Type$1.TNumber>;
|
|
1096
|
+
low: Type$1.TOptional<Type$1.TNumber>;
|
|
1097
|
+
max: Type$1.TOptional<Type$1.TNumber>;
|
|
1098
|
+
medium: Type$1.TOptional<Type$1.TNumber>;
|
|
1099
|
+
minimal: Type$1.TOptional<Type$1.TNumber>;
|
|
1100
|
+
xhigh: Type$1.TOptional<Type$1.TNumber>;
|
|
1101
|
+
}>>;
|
|
1102
|
+
thinkingLevelMap: Type$1.TOptional<Type$1.TObject<{
|
|
1103
|
+
high: Type$1.TOptional<Type$1.TUnion<[Type$1.TString, Type$1.TNull]>>;
|
|
1104
|
+
low: Type$1.TOptional<Type$1.TUnion<[Type$1.TString, Type$1.TNull]>>;
|
|
1105
|
+
max: Type$1.TOptional<Type$1.TUnion<[Type$1.TString, Type$1.TNull]>>;
|
|
1106
|
+
medium: Type$1.TOptional<Type$1.TUnion<[Type$1.TString, Type$1.TNull]>>;
|
|
1107
|
+
minimal: Type$1.TOptional<Type$1.TUnion<[Type$1.TString, Type$1.TNull]>>;
|
|
1108
|
+
off: Type$1.TOptional<Type$1.TUnion<[Type$1.TString, Type$1.TNull]>>;
|
|
1109
|
+
xhigh: Type$1.TOptional<Type$1.TUnion<[Type$1.TString, Type$1.TNull]>>;
|
|
1082
1110
|
}>>;
|
|
1083
1111
|
}>;
|
|
1084
1112
|
type Info = Static<typeof Info>;
|
|
@@ -1104,36 +1132,23 @@ declare function normalizeInput(input?: string[]): Array<"text" | "image">;
|
|
|
1104
1132
|
declare function getBuiltInModels(): Promise<BuiltInModels>;
|
|
1105
1133
|
declare const registry: {
|
|
1106
1134
|
(): Promise<Map<string, Map<string, {
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
name: string;
|
|
1112
|
-
source: "api" | "config" | "custom" | "env" | "unknown";
|
|
1113
|
-
env: string[];
|
|
1114
|
-
key?: string;
|
|
1115
|
-
options?: Record<string, any>;
|
|
1135
|
+
api?: {
|
|
1136
|
+
id?: string;
|
|
1137
|
+
url?: string;
|
|
1138
|
+
method?: "chat" | "completion" | "completionModel" | "languageModel" | "messages" | "responses";
|
|
1116
1139
|
};
|
|
1117
1140
|
baseUrl: string;
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
};
|
|
1128
|
-
thinkingBudgets?: {
|
|
1129
|
-
high?: number;
|
|
1130
|
-
low?: number;
|
|
1131
|
-
max?: number;
|
|
1132
|
-
medium?: number;
|
|
1133
|
-
minimal?: number;
|
|
1134
|
-
xhigh?: number;
|
|
1141
|
+
compat?: {
|
|
1142
|
+
supportsThinkingLevel?: boolean;
|
|
1143
|
+
supportsToolSearch?: boolean;
|
|
1144
|
+
supportsAdditionalTools?: boolean;
|
|
1145
|
+
supportsStrictMode?: boolean;
|
|
1146
|
+
supportsOpenAIGrammarTools?: boolean;
|
|
1147
|
+
supportsThinkingTokenBudget?: boolean;
|
|
1148
|
+
forceAdaptiveThinking?: boolean;
|
|
1149
|
+
thinkingTokenBudgetField?: string;
|
|
1135
1150
|
};
|
|
1136
|
-
|
|
1151
|
+
contextWindow: number;
|
|
1137
1152
|
cost: {
|
|
1138
1153
|
input: number;
|
|
1139
1154
|
output: number;
|
|
@@ -1148,39 +1163,53 @@ declare const registry: {
|
|
|
1148
1163
|
}[];
|
|
1149
1164
|
serviceTierMultipliers?: Record<string, number>;
|
|
1150
1165
|
};
|
|
1151
|
-
contextWindow: number;
|
|
1152
|
-
maxTokens: number;
|
|
1153
1166
|
headers?: Record<string, string>;
|
|
1167
|
+
id: string;
|
|
1168
|
+
input: ("image" | "text")[];
|
|
1169
|
+
maxTokens: number;
|
|
1170
|
+
name: string;
|
|
1154
1171
|
npm?: string;
|
|
1155
|
-
api?: {
|
|
1156
|
-
id?: string;
|
|
1157
|
-
url?: string;
|
|
1158
|
-
method?: "chat" | "completion" | "completionModel" | "languageModel" | "messages" | "responses";
|
|
1159
|
-
};
|
|
1160
|
-
providerOptionsKey?: string;
|
|
1161
1172
|
options?: Record<string, unknown>;
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
forceAdaptiveThinking?: boolean;
|
|
1171
|
-
thinkingTokenBudgetField?: string;
|
|
1173
|
+
protocol: "anthropic" | "github-copilot" | "google" | "google-vertex" | "google-vertex-anthropic" | "openai" | "openai-codex" | "openai-compatible" | "openrouter" | "xai";
|
|
1174
|
+
provider: {
|
|
1175
|
+
id: string;
|
|
1176
|
+
name: string;
|
|
1177
|
+
source: "api" | "config" | "custom" | "env" | "unknown";
|
|
1178
|
+
env: string[];
|
|
1179
|
+
key?: string;
|
|
1180
|
+
options?: Record<string, any>;
|
|
1172
1181
|
};
|
|
1173
|
-
|
|
1182
|
+
providerOptions?: Record<string, unknown>;
|
|
1183
|
+
providerOptionsKey?: string;
|
|
1184
|
+
reasoning: boolean;
|
|
1174
1185
|
supportedProtocols?: {
|
|
1175
|
-
anthropic?: "anthropic" | "google" | "google-vertex" | "google-vertex-anthropic" | "openai" | "openai-codex" | "openai-compatible" | "openrouter" | "xai";
|
|
1176
|
-
google?: "anthropic" | "google" | "google-vertex" | "google-vertex-anthropic" | "openai" | "openai-codex" | "openai-compatible" | "openrouter" | "xai";
|
|
1177
|
-
googleVertex?: "anthropic" | "google" | "google-vertex" | "google-vertex-anthropic" | "openai" | "openai-codex" | "openai-compatible" | "openrouter" | "xai";
|
|
1178
|
-
googleVertexAnthropic?: "anthropic" | "google" | "google-vertex" | "google-vertex-anthropic" | "openai" | "openai-codex" | "openai-compatible" | "openrouter" | "xai";
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1186
|
+
anthropic?: "anthropic" | "github-copilot" | "google" | "google-vertex" | "google-vertex-anthropic" | "openai" | "openai-codex" | "openai-compatible" | "openrouter" | "xai";
|
|
1187
|
+
google?: "anthropic" | "github-copilot" | "google" | "google-vertex" | "google-vertex-anthropic" | "openai" | "openai-codex" | "openai-compatible" | "openrouter" | "xai";
|
|
1188
|
+
googleVertex?: "anthropic" | "github-copilot" | "google" | "google-vertex" | "google-vertex-anthropic" | "openai" | "openai-codex" | "openai-compatible" | "openrouter" | "xai";
|
|
1189
|
+
googleVertexAnthropic?: "anthropic" | "github-copilot" | "google" | "google-vertex" | "google-vertex-anthropic" | "openai" | "openai-codex" | "openai-compatible" | "openrouter" | "xai";
|
|
1190
|
+
githubCopilot?: "anthropic" | "github-copilot" | "google" | "google-vertex" | "google-vertex-anthropic" | "openai" | "openai-codex" | "openai-compatible" | "openrouter" | "xai";
|
|
1191
|
+
openai?: "anthropic" | "github-copilot" | "google" | "google-vertex" | "google-vertex-anthropic" | "openai" | "openai-codex" | "openai-compatible" | "openrouter" | "xai";
|
|
1192
|
+
openaiCompatible?: "anthropic" | "github-copilot" | "google" | "google-vertex" | "google-vertex-anthropic" | "openai" | "openai-codex" | "openai-compatible" | "openrouter" | "xai";
|
|
1193
|
+
openaiCodex?: "anthropic" | "github-copilot" | "google" | "google-vertex" | "google-vertex-anthropic" | "openai" | "openai-codex" | "openai-compatible" | "openrouter" | "xai";
|
|
1194
|
+
openrouter?: "anthropic" | "github-copilot" | "google" | "google-vertex" | "google-vertex-anthropic" | "openai" | "openai-codex" | "openai-compatible" | "openrouter" | "xai";
|
|
1195
|
+
xai?: "anthropic" | "github-copilot" | "google" | "google-vertex" | "google-vertex-anthropic" | "openai" | "openai-codex" | "openai-compatible" | "openrouter" | "xai";
|
|
1196
|
+
};
|
|
1197
|
+
thinkingBudgets?: {
|
|
1198
|
+
high?: number;
|
|
1199
|
+
low?: number;
|
|
1200
|
+
max?: number;
|
|
1201
|
+
medium?: number;
|
|
1202
|
+
minimal?: number;
|
|
1203
|
+
xhigh?: number;
|
|
1204
|
+
};
|
|
1205
|
+
thinkingLevelMap?: {
|
|
1206
|
+
high?: string | null;
|
|
1207
|
+
low?: string | null;
|
|
1208
|
+
max?: string | null;
|
|
1209
|
+
medium?: string | null;
|
|
1210
|
+
minimal?: string | null;
|
|
1211
|
+
off?: string | null;
|
|
1212
|
+
xhigh?: string | null;
|
|
1184
1213
|
};
|
|
1185
1214
|
}>>>;
|
|
1186
1215
|
reset: () => void;
|
|
@@ -1215,4 +1244,4 @@ declare function getSupportedThinkingLevels<TProtocol extends KnownProviderEnum>
|
|
|
1215
1244
|
declare function clampThinkingLevel<TProtocol extends KnownProviderEnum>(model: TModel<TProtocol>, level: ThinkingLevel): ThinkingLevel;
|
|
1216
1245
|
//#endregion
|
|
1217
1246
|
export { KnownProviderEnum as a, ThinkingBudgets as c, getProviders as d, model_d_exports as f, Info as i, getModel as l, registry as m, ActiveThinkingLevel as n, ProviderToProtocol as o, modelsAreEqual as p, Compatibility as r, TModel as s, APIMethodEnum as t, getModels as u };
|
|
1218
|
-
//# sourceMappingURL=model-
|
|
1247
|
+
//# sourceMappingURL=model-CrVLp622.d.mts.map
|
|
@@ -98,6 +98,7 @@ const KnownProviderEnum$1 = {
|
|
|
98
98
|
google: "google",
|
|
99
99
|
googleVertex: "google-vertex",
|
|
100
100
|
googleVertexAnthropic: "google-vertex-anthropic",
|
|
101
|
+
githubCopilot: "github-copilot",
|
|
101
102
|
openai: "openai",
|
|
102
103
|
openaiCompatible: "openai-compatible",
|
|
103
104
|
openaiCodex: "openai-codex",
|
|
@@ -109,6 +110,7 @@ const KnownProviderEnumSchema$1 = Type$1.Union([
|
|
|
109
110
|
Type$1.Literal(KnownProviderEnum$1.google),
|
|
110
111
|
Type$1.Literal(KnownProviderEnum$1.googleVertex),
|
|
111
112
|
Type$1.Literal(KnownProviderEnum$1.googleVertexAnthropic),
|
|
113
|
+
Type$1.Literal(KnownProviderEnum$1.githubCopilot),
|
|
112
114
|
Type$1.Literal(KnownProviderEnum$1.openai),
|
|
113
115
|
Type$1.Literal(KnownProviderEnum$1.openaiCompatible),
|
|
114
116
|
Type$1.Literal(KnownProviderEnum$1.openaiCodex),
|
|
@@ -190,6 +192,7 @@ var model_exports = /* @__PURE__ */ __exportAll({
|
|
|
190
192
|
getModels: () => getModels,
|
|
191
193
|
getProviders: () => getProviders,
|
|
192
194
|
getSupportedThinkingLevels: () => getSupportedThinkingLevels,
|
|
195
|
+
isAnthropicAdaptiveThinkingModel: () => isAnthropicAdaptiveThinkingModel,
|
|
193
196
|
modelsAreEqual: () => modelsAreEqual,
|
|
194
197
|
normalizeInput: () => normalizeInput,
|
|
195
198
|
optionsKey: () => optionsKey,
|
|
@@ -271,6 +274,7 @@ const SupportedProtocolsSchema = Type$1.Partial(Type$1.Object({
|
|
|
271
274
|
google: KnownProviderEnumSchema,
|
|
272
275
|
googleVertex: KnownProviderEnumSchema,
|
|
273
276
|
googleVertexAnthropic: KnownProviderEnumSchema,
|
|
277
|
+
githubCopilot: KnownProviderEnumSchema,
|
|
274
278
|
openai: KnownProviderEnumSchema,
|
|
275
279
|
openaiCompatible: KnownProviderEnumSchema,
|
|
276
280
|
openaiCodex: KnownProviderEnumSchema,
|
|
@@ -313,6 +317,31 @@ const CompatibilitySchema = Type$1.Object({
|
|
|
313
317
|
/** Name of that field, when it is not the conventional `thinking_token_budget`. */
|
|
314
318
|
thinkingTokenBudgetField: Type$1.Optional(Type$1.String())
|
|
315
319
|
});
|
|
320
|
+
/**
|
|
321
|
+
* Claude models that decide their own thinking depth.
|
|
322
|
+
*
|
|
323
|
+
* These take an `effort` level and let the model size each turn's reasoning; the
|
|
324
|
+
* older models take a fixed `budget_tokens` instead. Sending a budget to an
|
|
325
|
+
* adaptive model pins it to one depth for every turn, which is the thing adaptive
|
|
326
|
+
* thinking exists to avoid.
|
|
327
|
+
*/
|
|
328
|
+
function isAnthropicAdaptiveThinkingModel(modelId) {
|
|
329
|
+
return [
|
|
330
|
+
"opus-4-6",
|
|
331
|
+
"opus-4.6",
|
|
332
|
+
"opus-4-7",
|
|
333
|
+
"opus-4.7",
|
|
334
|
+
"opus-4-8",
|
|
335
|
+
"opus-4.8",
|
|
336
|
+
"opus-5",
|
|
337
|
+
"opus.5",
|
|
338
|
+
"sonnet-4-6",
|
|
339
|
+
"sonnet-4.6",
|
|
340
|
+
"sonnet-5",
|
|
341
|
+
"sonnet.5",
|
|
342
|
+
"fable-5"
|
|
343
|
+
].some((needle) => modelId.includes(needle));
|
|
344
|
+
}
|
|
316
345
|
const Schema = Type$1.Object({
|
|
317
346
|
id: Type$1.String(),
|
|
318
347
|
name: Type$1.String(),
|
|
@@ -448,6 +477,6 @@ function clampThinkingLevel(model, level) {
|
|
|
448
477
|
return availableLevels[0] ?? "off";
|
|
449
478
|
}
|
|
450
479
|
//#endregion
|
|
451
|
-
export {
|
|
480
|
+
export { NamedError as C, writeJson as S, optionsKey as _, KnownProviderEnumSchema as a, path as b, calculateCost as c, getModels as d, getProviders as f, normalizeInput as g, modelsAreEqual as h, KnownProviderEnum as i, clampThinkingLevel as l, model_exports as m, APIMethodEnumSchema as n, ProviderInfo as o, isAnthropicAdaptiveThinkingModel as p, ActiveThinkingLevel as r, ThinkingBudgets as s, APIMethodEnum as t, getModel as u, registry as v, lazy as w, readJson as x, thinkingTokenBudgetField as y };
|
|
452
481
|
|
|
453
|
-
//# sourceMappingURL=model-
|
|
482
|
+
//# sourceMappingURL=model-gCDbmGqT.mjs.map
|