@codeworksh/aikit 0.9.1 → 0.9.2
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/cli.mjs +3 -3
- package/{copilot-CcD3g6H8.mjs → copilot-bFammM5T.mjs} +2 -2
- package/{copilot-CcD3g6H8.mjs.map → copilot-bFammM5T.mjs.map} +1 -1
- package/{copilot-headers-DceqXlpj.mjs → copilot-headers-01-kLz8g.mjs} +2 -2
- package/{copilot-headers-DceqXlpj.mjs.map → copilot-headers-01-kLz8g.mjs.map} +1 -1
- package/{github-copilot-SIUCJz1G.mjs → github-copilot-eDhLBMfL.mjs} +2 -2
- package/{github-copilot-SIUCJz1G.mjs.map → github-copilot-eDhLBMfL.mjs.map} +1 -1
- package/github-copilot-gMaBI_-X.mjs +3 -0
- package/index.d.mts +1 -1
- package/index.mjs +4 -4
- package/{model-CrVLp622.d.mts → model-BetbWJV7.d.mts} +14 -3
- package/{model-gCDbmGqT.mjs → model-Czo0SKj0.mjs} +42 -4
- package/model-Czo0SKj0.mjs.map +1 -0
- package/{modelgen-DvorXOjJ.mjs → modelgen-DR-uhl3l.mjs} +11 -14
- package/modelgen-DR-uhl3l.mjs.map +1 -0
- package/modelgen.d.mts +1 -1
- package/modelgen.mjs +1 -1
- package/oauth/github/copilot.mjs +1 -1
- package/{openai-codex-Bqzti6Mc.mjs → openai-codex-CpaJcE8Q.mjs} +2 -2
- package/{openai-codex-Bqzti6Mc.mjs.map → openai-codex-CpaJcE8Q.mjs.map} +1 -1
- package/openai-codex-Dm1GGNs0.mjs +2 -0
- package/package.json +1 -1
- package/{registry-ZxwIW0gX.mjs → registry-vtzL8QxA.mjs} +4 -4
- package/{registry-ZxwIW0gX.mjs.map → registry-vtzL8QxA.mjs.map} +1 -1
- package/github-copilot-BJIrxOzT.mjs +0 -3
- package/model-gCDbmGqT.mjs.map +0 -1
- package/modelgen-DvorXOjJ.mjs.map +0 -1
- package/openai-codex-DA1Q7mLN.mjs +0 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as
|
|
2
|
-
import { a as protocolForPackage, n as isAISDKPackage } from "./registry-
|
|
3
|
-
import { n as GITHUB_COPILOT_STATIC_HEADERS } from "./copilot-headers-
|
|
1
|
+
import { S as writeJsonAtomic, b as path, g as normalizeInput, i as KnownProviderEnum, p as isAnthropicAdaptiveThinkingModel, t as APIMethodEnum, x as readJson } from "./model-Czo0SKj0.mjs";
|
|
2
|
+
import { a as protocolForPackage, n as isAISDKPackage } from "./registry-vtzL8QxA.mjs";
|
|
3
|
+
import { n as GITHUB_COPILOT_STATIC_HEADERS } from "./copilot-headers-01-kLz8g.mjs";
|
|
4
4
|
import { resolve } from "node:path";
|
|
5
5
|
import { mapValues, pickBy, pipe } from "remeda";
|
|
6
6
|
//#region src/cli/modelgen.ts
|
|
@@ -16,23 +16,20 @@ function modelsDevURL() {
|
|
|
16
16
|
function modelsDevPath() {
|
|
17
17
|
return process.env.OPENCODE_MODELS_DEV_FILE;
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
async function pullModelsDevData() {
|
|
20
20
|
const path = modelsDevPath();
|
|
21
21
|
if (path) {
|
|
22
22
|
const result = await readJson(path).catch(() => void 0);
|
|
23
23
|
if (result) return result;
|
|
24
24
|
}
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
async function pullModelsDevData() {
|
|
29
|
-
return modelsDevData();
|
|
25
|
+
const response = await fetch(`${modelsDevURL()}/api.json`);
|
|
26
|
+
if (!response.ok) throw new Error(`models.dev responded ${response.status} ${response.statusText}`);
|
|
27
|
+
return await response.json();
|
|
30
28
|
}
|
|
31
29
|
function toModelValue(providerId, provider, model) {
|
|
32
30
|
return applyModification(providerId, provider, model);
|
|
33
31
|
}
|
|
34
|
-
|
|
35
|
-
const catalog = await pullModelsDevData();
|
|
32
|
+
function loadBuiltInFromModelsDev(catalog) {
|
|
36
33
|
return pipe(catalog, pickBy((provider) => Object.values(provider.models).some((model) => Boolean(model.tool_call) && isAISDKPackage(resolveModelNpm(provider, model)))), mapValues((provider, providerId) => pipe(provider.models, pickBy((model) => Boolean(model.tool_call) && isAISDKPackage(resolveModelNpm(provider, model))), mapValues((model) => toModelValue(providerId, provider, model)), pickBy((model) => model !== void 0))));
|
|
37
34
|
}
|
|
38
35
|
function resolveModelNpm(provider, model) {
|
|
@@ -442,7 +439,7 @@ function githubCopilotBuiltInModels(provider) {
|
|
|
442
439
|
async function generateModels(args = {}) {
|
|
443
440
|
const path$1 = resolve(args.path ?? path());
|
|
444
441
|
const catalog = await pullModelsDevData();
|
|
445
|
-
const modelsDev =
|
|
442
|
+
const modelsDev = loadBuiltInFromModelsDev(catalog);
|
|
446
443
|
const customCodexModels = openAICodexBuiltInModels();
|
|
447
444
|
const copilotProvider = catalog[GITHUB_COPILOT_PROVIDER_ID];
|
|
448
445
|
const allModels = {
|
|
@@ -450,7 +447,7 @@ async function generateModels(args = {}) {
|
|
|
450
447
|
[OPENAI_CODEX_PROVIDER_ID]: customCodexModels,
|
|
451
448
|
...copilotProvider ? { [GITHUB_COPILOT_PROVIDER_ID]: githubCopilotBuiltInModels(copilotProvider) } : {}
|
|
452
449
|
};
|
|
453
|
-
await
|
|
450
|
+
await writeJsonAtomic(path$1, allModels);
|
|
454
451
|
return path$1;
|
|
455
452
|
}
|
|
456
453
|
const ModelgenCommand = {
|
|
@@ -514,4 +511,4 @@ function applyModification(providerId, provider, model) {
|
|
|
514
511
|
//#endregion
|
|
515
512
|
export { generateModels as n, ModelgenCommand as t };
|
|
516
513
|
|
|
517
|
-
//# sourceMappingURL=modelgen-
|
|
514
|
+
//# sourceMappingURL=modelgen-DR-uhl3l.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modelgen-DR-uhl3l.mjs","names":["Filesystem.readJson","Model.isAnthropicAdaptiveThinkingModel","path","ModelCatalog.path","Filesystem.writeJsonAtomic","Model.normalizeInput"],"sources":["../../src/cli/modelgen.ts"],"sourcesContent":["import { resolve } from \"node:path\";\nimport { mapValues, pickBy, pipe } from \"remeda\";\nimport type { CommandModule } from \"yargs\";\nimport { DEFAULT_AI_SDK_FALLBACK, isAISDKPackage, protocolForPackage } from \"../llm/registry.ts\";\nimport * as ModelCatalog from \"../model/catalog.ts\";\nimport * as Model from \"../model/model.ts\";\nimport { GITHUB_COPILOT_STATIC_HEADERS } from \"../providers/github-copilot/copilot-headers.ts\";\nimport * as Filesystem from \"../utils/filesystem.ts\";\n\nconst DEFAULT_PROVIDER_BASE_URLS: Partial<Record<Model.KnownProviderEnum, string>> = {\n\t[Model.KnownProviderEnum.anthropic]: \"https://api.anthropic.com/v1\",\n\t[Model.KnownProviderEnum.openai]: \"https://api.openai.com/v1\",\n\t[Model.KnownProviderEnum.openrouter]: \"https://openrouter.ai/api/v1\",\n\t[Model.KnownProviderEnum.xai]: \"https://api.x.ai/v1\",\n};\n\ninterface ModelsDevModel {\n\tid: string;\n\tname: string;\n\tfamily: string;\n\tattachment: boolean;\n\treasoning?: boolean;\n\ttool_call?: boolean;\n\ttemperature?: boolean;\n\tknowledge?: string | boolean;\n\trelease_date: string;\n\tlast_updated: string;\n\tmodalities: {\n\t\tinput?: string[];\n\t\toutput: string[];\n\t};\n\topen_weights: boolean;\n\tbaseUrl?: string;\n\theaders?: Record<string, string>;\n\tcost?: {\n\t\tinput?: number;\n\t\toutput?: number;\n\t\tcache_read?: number;\n\t\tcache_write?: number;\n\t\ttiers?: Array<{\n\t\t\tinput?: number;\n\t\t\toutput?: number;\n\t\t\tcache_read?: number;\n\t\t\tcache_write?: number;\n\t\t\ttier?: { type?: string; size?: number };\n\t\t}>;\n\t};\n\treasoning_options?: Array<{\n\t\ttype?: string;\n\t\tvalues?: string[];\n\t\tmin?: number;\n\t\tmax?: number;\n\t}>;\n\tstatus?: string;\n\tlimit?: {\n\t\tcontext?: number;\n\t\toutput?: number;\n\t};\n\tstructured_output?: boolean;\n\tprovider?: {\n\t\tnpm?: string;\n\t\tapi?: string;\n\t\theaders?: Record<string, string>;\n\t};\n}\n\ninterface ModelsDevProvider {\n\tid: string;\n\tenv: string[];\n\tnpm?: string;\n\tapi?: string;\n\tname: string;\n\tdoc?: string; // reference documentation link\n\tkey?: string; // runtime placeholder for api/oauth key\n\theaders?: Record<string, string>; // custom overrides at provider level\n\tmodels: Record<string, ModelsDevModel>;\n}\n\nexport type BuiltInModels = Model.BuiltInModels;\n\n// Doesn't represent the full spec from models.dev.\n// Represents the provider entries on a best-effort basis.\ntype ModelsDevCatalog = Record<string, ModelsDevProvider>;\n\nfunction modelsDevURL(): string {\n\treturn process.env.OPENCODE_MODELS_URL || \"https://models.dev\";\n}\n\nfunction modelsDevPath(): string | undefined {\n\treturn process.env.OPENCODE_MODELS_DEV_FILE;\n}\n\nasync function pullModelsDevData(): Promise<ModelsDevCatalog> {\n\tconst path = modelsDevPath();\n\tif (path) {\n\t\tconst result = await Filesystem.readJson<ModelsDevCatalog>(path).catch(() => undefined);\n\t\tif (result) return result;\n\t}\n\n\tconst response = await fetch(`${modelsDevURL()}/api.json`);\n\tif (!response.ok) throw new Error(`models.dev responded ${response.status} ${response.statusText}`);\n\treturn (await response.json()) as ModelsDevCatalog;\n}\n\nfunction toModelValue(providerId: string, provider: ModelsDevProvider, model: ModelsDevModel): Model.Info | undefined {\n\treturn applyModification(providerId, provider, model);\n}\n\nfunction loadBuiltInFromModelsDev(catalog: ModelsDevCatalog) {\n\treturn pipe(\n\t\tcatalog,\n\t\tpickBy((provider) =>\n\t\t\tObject.values(provider.models).some(\n\t\t\t\t// If `resolveModelNpm` fallbacks to `@ai-sdk/openai-compatible`\n\t\t\t\t// isAISDKPakage will be truthy, modify resolveModelNpm for custom logic if needed.\n\t\t\t\t// Keep `isAISDKPackage` as readonly for supported implemenatations key check\n\t\t\t\t(model) => Boolean(model.tool_call) && isAISDKPackage(resolveModelNpm(provider, model)),\n\t\t\t),\n\t\t),\n\t\tmapValues((provider, providerId) =>\n\t\t\tpipe(\n\t\t\t\tprovider.models,\n\t\t\t\tpickBy((model) => Boolean(model.tool_call) && isAISDKPackage(resolveModelNpm(provider, model))),\n\t\t\t\tmapValues((model) => toModelValue(providerId, provider, model)),\n\t\t\t\tpickBy((model): model is Model.Info => model !== undefined),\n\t\t\t),\n\t\t),\n\t) as BuiltInModels;\n}\n\ntype ThinkingLevelMap = NonNullable<Model.Info[\"thinkingLevelMap\"]>;\n\nfunction resolveModelNpm(provider: ModelsDevProvider, model: ModelsDevModel): string {\n\treturn model.provider?.npm ?? provider.npm ?? DEFAULT_AI_SDK_FALLBACK;\n}\n\nfunction resolveModelBaseUrl(provider: ModelsDevProvider, model: ModelsDevModel): string {\n\tconst npm = resolveModelNpm(provider, model);\n\tconst protocol = protocolForPackage(npm);\n\treturn model.baseUrl ?? model.provider?.api ?? provider.api ?? DEFAULT_PROVIDER_BASE_URLS[protocol] ?? \"\";\n}\n\nfunction resolveModelAPIMethod(npm: string): Model.APIMethodEnum {\n\tconst protocol = protocolForPackage(npm);\n\t// `By default, xai(modelId) uses the Chat API.\n\t// To use the Responses API with server-side agentic tools, explicitly use xai.responses(modelId).`\n\t// References: https://ai-sdk.dev/providers/ai-sdk-providers/xai\n\tif (protocol === Model.KnownProviderEnum.openai || protocol === Model.KnownProviderEnum.xai) {\n\t\treturn Model.APIMethodEnum.responses;\n\t}\n\treturn Model.APIMethodEnum.languageModel;\n}\n\nfunction resolveProviderOptionsKey(protocol: Model.KnownProviderEnum): string {\n\tif (protocol === Model.KnownProviderEnum.openaiCompatible) return \"openai-compatible\";\n\tif (protocol === Model.KnownProviderEnum.googleVertex) return \"google-vertex\";\n\tif (protocol === Model.KnownProviderEnum.googleVertexAnthropic) return \"google-vertex-anthropic\";\n\treturn protocol;\n}\n\n//\n// adhoc helpers variations\nconst OPENAI_RESPONSES_NONE_REASONING_MODELS = new Set([\n\t\"gpt-5.1\",\n\t\"gpt-5.2\",\n\t\"gpt-5.3-codex\",\n\t\"gpt-5.4\",\n\t\"gpt-5.4-mini\",\n\t\"gpt-5.4-nano\",\n\t\"gpt-5.5\",\n]);\n\nfunction supportsOpenAiXhigh(model: Model.Info): boolean {\n\tconst modelId = model.id;\n\treturn (\n\t\tmodelId.includes(\"gpt-5.2\") ||\n\t\tmodelId.includes(\"gpt-5.3\") ||\n\t\tmodelId.includes(\"gpt-5.4\") ||\n\t\tmodelId.includes(\"gpt-5.5\") ||\n\t\t(model.protocol === Model.KnownProviderEnum.openaiCodex && modelId.includes(\"gpt-5.6\"))\n\t);\n}\n\nfunction supportsOpenAiCodexMax(model: Model.Info): boolean {\n\treturn model.protocol === Model.KnownProviderEnum.openaiCodex && model.id.includes(\"gpt-5.6\");\n}\n\nfunction mergeThinkingLevelMap(model: Model.Info, map: ThinkingLevelMap): void {\n\tmodel.thinkingLevelMap = { ...model.thinkingLevelMap, ...map };\n}\n\nfunction mergeCompat(model: Model.Info, compat: Model.Compatibility): void {\n\tmodel.compat = { ...model.compat, ...compat };\n}\n\nfunction applyGoogleThinkingMetadata(model: Model.Info): void {\n\tconst id = model.id.toLowerCase();\n\tconst supportsThinkingLevel =\n\t\t/gemini-3(?:\\.\\d+)?-(?:pro|flash)|gemma-?4/.test(id) ||\n\t\tid === \"gemini-flash-latest\" ||\n\t\tid === \"gemini-flash-lite-latest\";\n\tmergeCompat(model, { supportsThinkingLevel });\n\tif (supportsThinkingLevel) return;\n\n\t// Unknown budget-based families ask the provider to size thinking dynamically.\n\tconst defaults: Array<[string, Model.ThinkingBudgets]> = [\n\t\t[\"2.5-pro\", { minimal: 128, low: 2048, medium: 8192, high: 32768 }],\n\t\t[\"2.5-flash-lite\", { minimal: 512, low: 2048, medium: 8192, high: 24576 }],\n\t\t[\"2.5-flash\", { minimal: 128, low: 2048, medium: 8192, high: 24576 }],\n\t];\n\tmodel.thinkingBudgets = defaults.find(([family]) => id.includes(family))?.[1] ?? {\n\t\tminimal: -1,\n\t\tlow: -1,\n\t\tmedium: -1,\n\t\thigh: -1,\n\t};\n}\n\nfunction applyModelMetadata(model: Model.Info): void {\n\tif (model.protocol === Model.KnownProviderEnum.google || model.protocol === Model.KnownProviderEnum.googleVertex) {\n\t\tapplyGoogleThinkingMetadata(model);\n\t}\n\tif (model.protocol === Model.KnownProviderEnum.openai || model.protocol === Model.KnownProviderEnum.openaiCodex) {\n\t\tmodel.cost.serviceTierMultipliers = { flex: 0.5, priority: model.id === \"gpt-5.5\" ? 2.5 : 2 };\n\t}\n\tif (\n\t\t(model.protocol === Model.KnownProviderEnum.google || model.protocol === Model.KnownProviderEnum.googleVertex) &&\n\t\t/gemini-3(?:\\.\\d+)?-pro|gemini-3\\.[78]-flash/.test(model.id.toLowerCase())\n\t) {\n\t\t// These models cannot disable thinking or accept minimal. Expose supported\n\t\t// levels to callers and let the shared clamp promote minimal to low.\n\t\tmergeThinkingLevelMap(model, { off: \"low\", minimal: null });\n\t}\n\tif (\n\t\t(model.protocol === Model.KnownProviderEnum.anthropic ||\n\t\t\tmodel.protocol === Model.KnownProviderEnum.googleVertexAnthropic) &&\n\t\tModel.isAnthropicAdaptiveThinkingModel(model.id)\n\t) {\n\t\tmergeCompat(model, { forceAdaptiveThinking: true });\n\t}\n\tif (model.protocol === Model.KnownProviderEnum.openai && model.id.startsWith(\"gpt-5\")) {\n\t\tmergeThinkingLevelMap(model, { off: null });\n\t}\n\tif (\n\t\tmodel.protocol === Model.KnownProviderEnum.openai &&\n\t\tmodel.provider.id === \"openai\" &&\n\t\tOPENAI_RESPONSES_NONE_REASONING_MODELS.has(model.id)\n\t) {\n\t\tmergeThinkingLevelMap(model, { off: \"none\" });\n\t}\n\tif (supportsOpenAiXhigh(model)) {\n\t\tmergeThinkingLevelMap(model, { xhigh: \"xhigh\" });\n\t}\n\tif (supportsOpenAiCodexMax(model)) {\n\t\tmergeThinkingLevelMap(model, { max: \"max\" });\n\t}\n\tif (model.id.includes(\"opus-4-6\") || model.id.includes(\"opus-4.6\")) {\n\t\tmergeThinkingLevelMap(model, { xhigh: \"max\" });\n\t}\n\tif (model.id.includes(\"opus-4-7\") || model.id.includes(\"opus-4.7\")) {\n\t\tmergeThinkingLevelMap(model, { xhigh: \"xhigh\" });\n\t}\n}\n\n//\n// OpenAI Codex (ChatGPT OAuth) models.\n// NOTE: These are not fetched from models.dev; we keep a small, explicit list to avoid aliases.\n// Context window is based on observed server limits (400s above ~272k), not marketing numbers.\nconst OPENAI_CODEX_PROVIDER_ID = \"openai-codex\";\nconst OPENAI_CODEX_NPM = \"@codeworksh/ai-sdk-openai-codex\";\nconst OPENAI_CODEX_BASE_URL = \"https://chatgpt.com/backend-api\";\nconst OPENAI_CODEX_CONTEXT = 272_000;\nconst OPENAI_CODEX_GPT_56_CONTEXT = 272_000;\nconst OPENAI_CODEX_SPARK_CONTEXT = 128_000;\nconst OPENAI_CODEX_MAX_TOKENS = 128_000;\nconst OPENAI_LONG_CONTEXT_INPUT_THRESHOLD = 272_000;\nconst OPENAI_CODEX_TOOL_SEARCH_MODEL_IDS = new Set([\n\t\"gpt-5.4\",\n\t\"gpt-5.4-mini\",\n\t\"gpt-5.5\",\n\t\"gpt-5.6-luna\",\n\t\"gpt-5.6-sol\",\n\t\"gpt-5.6-terra\",\n]);\nconst OPENAI_CODEX_ADDITIONAL_TOOLS_MODEL_IDS = new Set([\"gpt-5.6-luna\", \"gpt-5.6-sol\", \"gpt-5.6-terra\"]);\n\ntype OpenAICodexModelSeed = Pick<Model.Info, \"id\" | \"name\" | \"input\" | \"cost\" | \"contextWindow\" | \"thinkingLevelMap\">;\n\nfunction roundCost(value: number): number {\n\treturn Number(value.toFixed(6));\n}\n\nfunction withOpenAiLongContextPricing(cost: Model.Info[\"cost\"]): Model.Info[\"cost\"] {\n\treturn {\n\t\t...cost,\n\t\ttiers: [\n\t\t\t{\n\t\t\t\tinputTokensAbove: OPENAI_LONG_CONTEXT_INPUT_THRESHOLD,\n\t\t\t\tinput: roundCost(cost.input * 2),\n\t\t\t\toutput: roundCost(cost.output * 1.5),\n\t\t\t\tcacheRead: roundCost(cost.cacheRead * 2),\n\t\t\t\tcacheWrite: roundCost(cost.cacheWrite * 2),\n\t\t\t},\n\t\t],\n\t};\n}\n\nconst OPENAI_CODEX_GPT_56_COSTS = {\n\t\"gpt-5.6-luna\": { input: 0.2, output: 1.2, cacheRead: 0.02, cacheWrite: 0.25 },\n\t\"gpt-5.6-terra\": { input: 2, output: 12, cacheRead: 0.2, cacheWrite: 2.5 },\n} satisfies Record<string, Model.Info[\"cost\"]>;\n\nconst OPENAI_CODEX_MODELS: OpenAICodexModelSeed[] = [\n\t{\n\t\tid: \"gpt-5.3-codex-spark\",\n\t\tname: \"GPT-5.3 Codex Spark\",\n\t\tinput: [\"text\"],\n\t\tcost: { input: 1.75, output: 14, cacheRead: 0.175, cacheWrite: 0 },\n\t\tcontextWindow: OPENAI_CODEX_SPARK_CONTEXT,\n\t},\n\t{\n\t\tid: \"gpt-5.4\",\n\t\tname: \"GPT-5.4\",\n\t\tinput: [\"text\", \"image\"],\n\t\tcost: withOpenAiLongContextPricing({ input: 2.5, output: 15, cacheRead: 0.25, cacheWrite: 0 }),\n\t\tcontextWindow: OPENAI_CODEX_CONTEXT,\n\t},\n\t{\n\t\tid: \"gpt-5.4-mini\",\n\t\tname: \"GPT-5.4 mini\",\n\t\tinput: [\"text\", \"image\"],\n\t\tcost: { input: 0.75, output: 4.5, cacheRead: 0.075, cacheWrite: 0 },\n\t\tcontextWindow: OPENAI_CODEX_CONTEXT,\n\t},\n\t{\n\t\tid: \"gpt-5.5\",\n\t\tname: \"GPT-5.5\",\n\t\tinput: [\"text\", \"image\"],\n\t\tcost: withOpenAiLongContextPricing({ input: 5, output: 30, cacheRead: 0.5, cacheWrite: 0 }),\n\t\tcontextWindow: OPENAI_CODEX_CONTEXT,\n\t},\n\t{\n\t\tid: \"gpt-5.6-luna\",\n\t\tname: \"GPT-5.6 Luna\",\n\t\tinput: [\"text\", \"image\"],\n\t\tcost: withOpenAiLongContextPricing(OPENAI_CODEX_GPT_56_COSTS[\"gpt-5.6-luna\"]),\n\t\tcontextWindow: OPENAI_CODEX_GPT_56_CONTEXT,\n\t\tthinkingLevelMap: { minimal: null },\n\t},\n\t{\n\t\tid: \"gpt-5.6-sol\",\n\t\tname: \"GPT-5.6 Sol\",\n\t\tinput: [\"text\", \"image\"],\n\t\tcost: withOpenAiLongContextPricing({ input: 5, output: 30, cacheRead: 0.5, cacheWrite: 6.25 }),\n\t\tcontextWindow: OPENAI_CODEX_GPT_56_CONTEXT,\n\t\tthinkingLevelMap: { minimal: null },\n\t},\n\t{\n\t\tid: \"gpt-5.6-terra\",\n\t\tname: \"GPT-5.6 Terra\",\n\t\tinput: [\"text\", \"image\"],\n\t\tcost: withOpenAiLongContextPricing(OPENAI_CODEX_GPT_56_COSTS[\"gpt-5.6-terra\"]),\n\t\tcontextWindow: OPENAI_CODEX_GPT_56_CONTEXT,\n\t\tthinkingLevelMap: { minimal: null },\n\t},\n];\n\nexport function openAICodexBuiltInModels(): Record<string, Model.Info> {\n\tconst models: Record<string, Model.Info> = {};\n\tfor (const seed of OPENAI_CODEX_MODELS) {\n\t\tconst supportsToolSearch = OPENAI_CODEX_TOOL_SEARCH_MODEL_IDS.has(seed.id);\n\t\tconst supportsAdditionalTools = OPENAI_CODEX_ADDITIONAL_TOOLS_MODEL_IDS.has(seed.id);\n\t\tconst info: Model.Info = {\n\t\t\t...seed,\n\t\t\tprovider: {\n\t\t\t\tid: OPENAI_CODEX_PROVIDER_ID,\n\t\t\t\tname: \"OpenAI Codex (ChatGPT)\",\n\t\t\t\tsource: \"custom\",\n\t\t\t\tenv: [\"OPENAI_CODEX_API_KEY\"],\n\t\t\t},\n\t\t\tbaseUrl: OPENAI_CODEX_BASE_URL,\n\t\t\treasoning: true,\n\t\t\t// Codex models always reason; the off level cannot be requested.\n\t\t\tthinkingLevelMap: { off: null, ...seed.thinkingLevelMap },\n\t\t\tmaxTokens: OPENAI_CODEX_MAX_TOKENS,\n\t\t\tnpm: OPENAI_CODEX_NPM,\n\t\t\tapi: {\n\t\t\t\tid: seed.id,\n\t\t\t\turl: OPENAI_CODEX_BASE_URL,\n\t\t\t\tmethod: Model.APIMethodEnum.responses,\n\t\t\t},\n\t\t\tproviderOptionsKey: OPENAI_CODEX_PROVIDER_ID,\n\t\t\tcompat: {\n\t\t\t\tsupportsOpenAIGrammarTools: true,\n\t\t\t\t...(supportsToolSearch ? { supportsToolSearch: true } : {}),\n\t\t\t\t...(supportsAdditionalTools ? { supportsAdditionalTools: true } : {}),\n\t\t\t},\n\t\t\tprotocol: Model.KnownProviderEnum.openaiCodex,\n\t\t};\n\t\tapplyModelMetadata(info);\n\t\tmodels[seed.id] = info;\n\t}\n\treturn models;\n}\n\n//\n// GitHub Copilot models.\n// Sourced from models.dev, then rewritten onto the bundled provider: one\n// `github-copilot` protocol whose `api.method` selects between Chat\n// Completions, Responses, and Anthropic Messages.\nconst GITHUB_COPILOT_PROVIDER_ID = \"github-copilot\";\nconst GITHUB_COPILOT_NPM = \"@codeworksh/ai-sdk-github-copilot\";\nconst GITHUB_COPILOT_BASE_URL = \"https://api.githubcopilot.com\";\nconst GITHUB_COPILOT_EXTENDED_CONTEXT = 1_000_000;\n\n// GitHub's \"Models with extended capabilities\" table lists these Copilot\n// models as supporting the extended 1 million token context window (pi).\nconst GITHUB_COPILOT_EXTENDED_CONTEXT_MODELS = new Set([\n\t\"claude-fable-5\",\n\t\"claude-opus-4.6\",\n\t\"claude-opus-4.7\",\n\t\"claude-opus-4.8\",\n\t\"claude-opus-5\",\n\t\"claude-sonnet-4.6\",\n\t\"claude-sonnet-5\",\n\t\"gpt-5.3-codex\",\n\t\"gpt-5.4\",\n\t\"gpt-5.5\",\n]);\n\n// Checked manually against the authenticated GitHub Copilot /models endpoint\n// (pi). Narrow corrections over models.dev metadata, not a catalog snapshot.\nconst GITHUB_COPILOT_THINKING_LEVEL_OVERRIDES: Record<string, ThinkingLevelMap> = {\n\t\"claude-opus-4.7\": { minimal: \"low\" },\n\t\"claude-opus-4.8\": { minimal: \"low\" },\n\t\"claude-opus-5\": { minimal: \"low\" },\n\t\"claude-sonnet-4.6\": { minimal: \"low\", max: \"max\" },\n};\n\n/**\n * The offline routing approximation (pi). The live `/models` response's\n * `supported_endpoints` is authoritative at runtime.\n *\n * - `claude-(haiku|sonnet|opus|fable)-[45]` → Anthropic Messages\n * - `gpt-*`, `grok-*`, `oswe*`, `mai-*` → OpenAI Responses\n * - everything else → OpenAI Chat Completions\n */\nexport function githubCopilotApiMethod(modelId: string): Model.APIMethodEnum {\n\tif (/^claude-(haiku|sonnet|opus|fable)-[45]([.-]|$)/.test(modelId)) {\n\t\treturn Model.APIMethodEnum.messages;\n\t}\n\tconst gpt = /^gpt-(\\d+)/.exec(modelId);\n\tif (\n\t\t(gpt !== null && Number(gpt[1]) >= 5) ||\n\t\tmodelId.startsWith(\"grok-\") ||\n\t\tmodelId.startsWith(\"oswe\") ||\n\t\tmodelId.startsWith(\"mai-\")\n\t) {\n\t\treturn Model.APIMethodEnum.responses;\n\t}\n\treturn Model.APIMethodEnum.chat;\n}\n\n/** Effort values models.dev advertises for a model, when it lists any. */\nfunction githubCopilotEffortValues(model: ModelsDevModel): Set<string> | undefined {\n\tfor (const option of model.reasoning_options ?? []) {\n\t\tif (option.type === \"effort\" && Array.isArray(option.values)) return new Set(option.values);\n\t}\n\treturn undefined;\n}\n\n/**\n * Derive the level map from models.dev `reasoning_options`: a level maps to\n * itself only when the endpoint actually advertises it. `minimal` degrades to\n * `low` — the lowest effort every reasoning model accepts.\n */\nfunction githubCopilotThinkingLevels(model: ModelsDevModel, method: Model.APIMethodEnum): ThinkingLevelMap | undefined {\n\tconst efforts = githubCopilotEffortValues(model);\n\tconst map: ThinkingLevelMap = {};\n\t// Copilot rejects `reasoningEffort: \"none\"` (pi), and the chat route has no\n\t// reasoning control, so only Messages models can disable thinking.\n\tif (method !== Model.APIMethodEnum.messages) map.off = null;\n\tif (!efforts) return Object.keys(map).length > 0 ? map : undefined;\n\n\tif (efforts.has(\"minimal\")) map.minimal = \"minimal\";\n\telse if (efforts.has(\"low\")) map.minimal = \"low\";\n\tfor (const level of [\"low\", \"medium\", \"high\", \"xhigh\", \"max\"] as const) {\n\t\tmap[level] = efforts.has(level) ? level : null;\n\t}\n\treturn map;\n}\n\nfunction githubCopilotCostTiers(model: ModelsDevModel): Model.Info[\"cost\"][\"tiers\"] | undefined {\n\tconst tiers = model.cost?.tiers?.flatMap((tier) => {\n\t\tconst context = tier.tier;\n\t\tif (context?.type !== \"context\" || context.size === undefined) return [];\n\t\treturn [\n\t\t\t{\n\t\t\t\tinputTokensAbove: context.size,\n\t\t\t\tinput: tier.input ?? 0,\n\t\t\t\toutput: tier.output ?? 0,\n\t\t\t\tcacheRead: tier.cache_read ?? 0,\n\t\t\t\tcacheWrite: tier.cache_write ?? 0,\n\t\t\t},\n\t\t];\n\t});\n\treturn tiers && tiers.length > 0 ? tiers : undefined;\n}\n\nexport function githubCopilotBuiltInModels(provider: ModelsDevProvider | undefined): Record<string, Model.Info> {\n\tconst models: Record<string, Model.Info> = {};\n\tif (!provider) return models;\n\tfor (const [id, source] of Object.entries(provider.models)) {\n\t\tif (source.tool_call !== true) continue;\n\t\tif (source.status === \"deprecated\") continue;\n\t\t// The chat-latest alias races the Responses route for gpt-5 models.\n\t\tif (id === \"gpt-5-chat-latest\") continue;\n\n\t\tconst base = applyModification(GITHUB_COPILOT_PROVIDER_ID, provider, source);\n\t\tif (!base) continue;\n\n\t\tconst method = githubCopilotApiMethod(id);\n\t\tconst tiers = githubCopilotCostTiers(source);\n\t\tconst info: Model.Info = {\n\t\t\t...base,\n\t\t\tprovider: {\n\t\t\t\tid: GITHUB_COPILOT_PROVIDER_ID,\n\t\t\t\tname: \"GitHub Copilot\",\n\t\t\t\tsource: \"custom\",\n\t\t\t\tenv: [\"COPILOT_GITHUB_TOKEN\"],\n\t\t\t},\n\t\t\tbaseUrl: GITHUB_COPILOT_BASE_URL,\n\t\t\theaders: { ...GITHUB_COPILOT_STATIC_HEADERS },\n\t\t\tcost: { ...base.cost, ...(tiers ? { tiers } : {}) },\n\t\t\tnpm: GITHUB_COPILOT_NPM,\n\t\t\tapi: { id, url: GITHUB_COPILOT_BASE_URL, method },\n\t\t\tproviderOptionsKey: GITHUB_COPILOT_PROVIDER_ID,\n\t\t\tprotocol: Model.KnownProviderEnum.githubCopilot,\n\t\t\t// Copilot's Responses route requires store=false + encrypted reasoning\n\t\t\t// content for thinking to round-trip.\n\t\t\t...(method === Model.APIMethodEnum.responses\n\t\t\t\t? {\n\t\t\t\t\t\tproviderOptions: {\n\t\t\t\t\t\t\t...base.providerOptions,\n\t\t\t\t\t\t\t[GITHUB_COPILOT_PROVIDER_ID]: {\n\t\t\t\t\t\t\t\tstore: false,\n\t\t\t\t\t\t\t\tinclude: [\"reasoning.encrypted_content\"],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t}\n\t\t\t\t: {}),\n\t\t};\n\n\t\tif (GITHUB_COPILOT_EXTENDED_CONTEXT_MODELS.has(id)) info.contextWindow = GITHUB_COPILOT_EXTENDED_CONTEXT;\n\t\tif (method === Model.APIMethodEnum.messages && Model.isAnthropicAdaptiveThinkingModel(id)) {\n\t\t\tmergeCompat(info, { forceAdaptiveThinking: true });\n\t\t}\n\t\t// Copilot's Responses endpoint passes OpenAI custom grammar tools through\n\t\t// for GPT-5+ (verified by pi).\n\t\tconst gpt = /^gpt-(\\d+)/.exec(id);\n\t\tif (method === Model.APIMethodEnum.responses && gpt !== null && Number(gpt[1]) >= 5) {\n\t\t\tmergeCompat(info, { supportsOpenAIGrammarTools: true });\n\t\t}\n\t\tif (id.startsWith(\"gpt-5\")) mergeThinkingLevelMap(info, { off: null, minimal: \"low\" });\n\t\tif (id.includes(\"fable-5\")) mergeThinkingLevelMap(info, { off: null, xhigh: \"xhigh\", max: \"max\" });\n\n\t\tconst levels = githubCopilotThinkingLevels(source, method);\n\t\tif (levels) mergeThinkingLevelMap(info, levels);\n\t\tconst override = GITHUB_COPILOT_THINKING_LEVEL_OVERRIDES[id];\n\t\tif (override) mergeThinkingLevelMap(info, override);\n\n\t\tmodels[id] = info;\n\t}\n\treturn models;\n}\n\nexport async function generateModels(args: { path?: string | undefined } = {}): Promise<string> {\n\tconst path = resolve(args.path ?? ModelCatalog.path());\n\tconst catalog = await pullModelsDevData();\n\tconst modelsDev = loadBuiltInFromModelsDev(catalog);\n\tconst customCodexModels = openAICodexBuiltInModels();\n\tconst copilotProvider = catalog[GITHUB_COPILOT_PROVIDER_ID];\n\n\tconst allModels = {\n\t\t...modelsDev,\n\t\t[OPENAI_CODEX_PROVIDER_ID]: customCodexModels,\n\t\t...(copilotProvider ? { [GITHUB_COPILOT_PROVIDER_ID]: githubCopilotBuiltInModels(copilotProvider) } : {}),\n\t};\n\tawait Filesystem.writeJsonAtomic(path, allModels);\n\treturn path;\n}\n\n//\n// CLI entry\nexport const ModelgenCommand: CommandModule<object, { path?: string | undefined }> = {\n\tcommand: \"modelgen [path]\",\n\tdescribe: \"generate models.gen.json\",\n\tbuilder: (yargs) =>\n\t\tyargs.positional(\"path\", {\n\t\t\ttype: \"string\",\n\t\t\tdescribe: \"output path (defaults to CODEWORK_MODELS_FILE or ./models.gen.json)\",\n\t\t}),\n\thandler: async (args) => {\n\t\tconst path = await generateModels(args);\n\t\tconsole.log(`Generated model catalog at ${path}`);\n\t},\n};\n\nexport function applyModification(\n\tproviderId: string,\n\tprovider: ModelsDevProvider,\n\tmodel: ModelsDevModel,\n): Model.Info | undefined {\n\tconst npm = resolveModelNpm(provider, model);\n\tif (!isAISDKPackage(npm)) return;\n\n\tconst protocol = protocolForPackage(npm);\n\tconst baseUrl = resolveModelBaseUrl(provider, model);\n\tconst providerInfo: Model.ProviderInfo = {\n\t\tid: providerId,\n\t\tname: provider.name,\n\t\tsource: \"api\",\n\t\tenv: provider.env,\n\t};\n\tif (provider.key) providerInfo.key = provider.key;\n\tconst api: Model.APIMetadata = {\n\t\tid: model.id,\n\t\tmethod: resolveModelAPIMethod(npm),\n\t};\n\tif (baseUrl) api.url = baseUrl;\n\n\tconst info: Model.Info = {\n\t\tid: model.id,\n\t\tname: model.name,\n\t\tprovider: providerInfo,\n\t\tbaseUrl,\n\t\treasoning: Boolean(model.reasoning),\n\t\tinput: Model.normalizeInput(model.modalities.input),\n\t\tcost: {\n\t\t\tinput: model.cost?.input ?? 0,\n\t\t\toutput: model.cost?.output ?? 0,\n\t\t\tcacheRead: model.cost?.cache_read ?? 0,\n\t\t\tcacheWrite: model.cost?.cache_write ?? 0,\n\t\t},\n\t\tcontextWindow: model.limit?.context ?? 4096,\n\t\tmaxTokens: model.limit?.output ?? 4096,\n\t\theaders: {\n\t\t\t...provider.headers,\n\t\t\t...model.provider?.headers,\n\t\t\t...model.headers,\n\t\t},\n\t\tnpm,\n\t\tapi,\n\t\tproviderOptionsKey: resolveProviderOptionsKey(protocol),\n\t\tprotocol,\n\t};\n\tif (Object.keys(info.headers ?? {}).length === 0) delete info.headers;\n\tapplyModelMetadata(info);\n\treturn info;\n}\n"],"mappings":";;;;;;AASA,MAAM,6BAA+E;EAC3D,kBAAA,YAAY;EACZ,kBAAA,SAAS;EACT,kBAAA,aAAa;EACb,kBAAA,MAAM;AAChC;AAsEA,SAAS,eAAuB;CAC/B,OAAO,QAAQ,IAAI,uBAAuB;AAC3C;AAEA,SAAS,gBAAoC;CAC5C,OAAO,QAAQ,IAAI;AACpB;AAEA,eAAe,oBAA+C;CAC7D,MAAM,OAAO,cAAc;CAC3B,IAAI,MAAM;EACT,MAAM,SAAS,MAAMA,SAAsC,IAAI,CAAC,CAAC,YAAY,KAAA,CAAS;EACtF,IAAI,QAAQ,OAAO;CACpB;CAEA,MAAM,WAAW,MAAM,MAAM,GAAG,aAAa,EAAE,UAAU;CACzD,IAAI,CAAC,SAAS,IAAI,MAAM,IAAI,MAAM,wBAAwB,SAAS,OAAO,GAAG,SAAS,YAAY;CAClG,OAAQ,MAAM,SAAS,KAAK;AAC7B;AAEA,SAAS,aAAa,YAAoB,UAA6B,OAA+C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eAAe,GAAG,GAAG;CAE1B,MAAM,WAAW,mBAAmB,GAAG;CACvC,MAAM,UAAU,oBAAoB,UAAU,KAAK;CACnD,MAAM,eAAmC;EACxC,IAAI;EACJ,MAAM,SAAS;EACf,QAAQ;EACR,KAAK,SAAS;CACf;CACA,IAAI,SAAS,KAAK,aAAa,MAAM,SAAS;CAC9C,MAAM,MAAyB;EAC9B,IAAI,MAAM;EACV,QAAQ,sBAAsB,GAAG;CAClC;CACA,IAAI,SAAS,IAAI,MAAM;CAEvB,MAAM,OAAmB;EACxB,IAAI,MAAM;EACV,MAAM,MAAM;EACZ,UAAU;EACV;EACA,WAAW,QAAQ,MAAM,SAAS;EAClC,OAAOG,eAAqB,MAAM,WAAW,KAAK;EAClD,MAAM;GACL,OAAO,MAAM,MAAM,SAAS;GAC5B,QAAQ,MAAM,MAAM,UAAU;GAC9B,WAAW,MAAM,MAAM,cAAc;GACrC,YAAY,MAAM,MAAM,eAAe;EACxC;EACA,eAAe,MAAM,OAAO,WAAW;EACvC,WAAW,MAAM,OAAO,UAAU;EAClC,SAAS;GACR,GAAG,SAAS;GACZ,GAAG,MAAM,UAAU;GACnB,GAAG,MAAM;EACV;EACA;EACA;EACA,oBAAoB,0BAA0B,QAAQ;EACtD;CACD;CACA,IAAI,OAAO,KAAK,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,GAAG,OAAO,KAAK;CAC9D,mBAAmB,IAAI;CACvB,OAAO;AACR"}
|
package/modelgen.d.mts
CHANGED
package/modelgen.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as generateModels } from "./modelgen-
|
|
1
|
+
import { n as generateModels } from "./modelgen-DR-uhl3l.mjs";
|
|
2
2
|
export { generateModels };
|
package/oauth/github/copilot.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as createGitHubCopilotDeviceFlow, c as fetchGitHubCopilotUser, d as gitHubCopilotBaseUrl, f as gitHubCopilotEntitlementError, h as pollGitHubCopilotDeviceToken, i as JsonGitHubCopilotAuthStorage, l as getGitHubCopilotApiKey, m as normalizeGitHubDomain, n as GITHUB_COPILOT_PROVIDER_ID, o as enableGitHubCopilotModels, p as gitHubCopilotHeaders, r as GitHubCopilotOAuthClient, s as fetchGitHubCopilotModels, t as GITHUB_COPILOT_API_KEY_ENV, u as gitHubApiDomain } from "../../copilot-
|
|
1
|
+
import { a as createGitHubCopilotDeviceFlow, c as fetchGitHubCopilotUser, d as gitHubCopilotBaseUrl, f as gitHubCopilotEntitlementError, h as pollGitHubCopilotDeviceToken, i as JsonGitHubCopilotAuthStorage, l as getGitHubCopilotApiKey, m as normalizeGitHubDomain, n as GITHUB_COPILOT_PROVIDER_ID, o as enableGitHubCopilotModels, p as gitHubCopilotHeaders, r as GitHubCopilotOAuthClient, s as fetchGitHubCopilotModels, t as GITHUB_COPILOT_API_KEY_ENV, u as gitHubApiDomain } from "../../copilot-bFammM5T.mjs";
|
|
2
2
|
export { GITHUB_COPILOT_API_KEY_ENV, GITHUB_COPILOT_PROVIDER_ID, GitHubCopilotOAuthClient, JsonGitHubCopilotAuthStorage, createGitHubCopilotDeviceFlow, enableGitHubCopilotModels, fetchGitHubCopilotModels, fetchGitHubCopilotUser, getGitHubCopilotApiKey, gitHubApiDomain, gitHubCopilotBaseUrl, gitHubCopilotEntitlementError, gitHubCopilotHeaders, normalizeGitHubDomain, pollGitHubCopilotDeviceToken };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
2
|
import { a as FailureSchema } from "./schema-rXSoWhic.mjs";
|
|
3
|
-
import { a as KnownProviderEnumSchema, o as ProviderInfo } from "./model-
|
|
3
|
+
import { a as KnownProviderEnumSchema, o as ProviderInfo } from "./model-Czo0SKj0.mjs";
|
|
4
4
|
import { s as getOpenAICodexAccountId } from "./codex-CLDBTrFm.mjs";
|
|
5
5
|
import Type$1 from "typebox";
|
|
6
6
|
import { uuidv7 } from "uuidv7";
|
|
@@ -1592,4 +1592,4 @@ const openaiCodex = createOpenAICodex();
|
|
|
1592
1592
|
//#endregion
|
|
1593
1593
|
export { ToolCallSchema as C, transformMessages as D, resolveJsonSchemaConstraint as E, AssistantMessageSchema as S, message_exports as T, appendOpenAICodexGrammarInputJsonDelta as _, OpenAICodexLanguageModel as a, resolveOpenAICodexDeferredToolsMode as b, convertOpenAICodexUsage as c, convertToOpenAICodexPrompt as d, joinToolCallId as f, shortHash as g, openAICodexErrorMessage as h, OPENAI_CODEX_DEFAULT_BASE_URL as i, mapOpenAICodexFinishReason as l, createOpenAICodexAPICallError as m, createOpenAICodex as n, clampOpenAICodexPromptCacheKey as o, splitToolCallId as p, openaiCodex as r, resolveOpenAICodexUrl as s, OPENAI_CODEX_API_KEY_ENV as t, collectOpenAICodexDeferredToolNames as u, openAICodexTools as v, createAssistantMessage as w, resolveOpenAICodexToolConstraint as x, prepareOpenAICodexTools as y };
|
|
1594
1594
|
|
|
1595
|
-
//# sourceMappingURL=openai-codex-
|
|
1595
|
+
//# sourceMappingURL=openai-codex-CpaJcE8Q.mjs.map
|