@codeworksh/aikit 0.11.0-dev.20261013131320 → 0.11.0-dev.20261019181702
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-JLgwmznn.mjs → copilot-DvUXC6Kx.mjs} +2 -2
- package/{copilot-JLgwmznn.mjs.map → copilot-DvUXC6Kx.mjs.map} +1 -1
- package/{copilot-headers-BvQ3FFn-.mjs → copilot-headers-BLnBaJyp.mjs} +2 -2
- package/{copilot-headers-BvQ3FFn-.mjs.map → copilot-headers-BLnBaJyp.mjs.map} +1 -1
- package/{github-copilot-C7oJ2Tfp.mjs → github-copilot-BcmOr0jd.mjs} +2 -2
- package/{github-copilot-C7oJ2Tfp.mjs.map → github-copilot-BcmOr0jd.mjs.map} +1 -1
- package/github-copilot-llyP2NK4.mjs +3 -0
- package/index.d.mts +3 -3
- package/index.mjs +5 -5
- package/index.mjs.map +1 -1
- package/model-Cjp-Dr8V.mjs +13955 -0
- package/model-Cjp-Dr8V.mjs.map +1 -0
- package/{model-DCfjY0fS.d.mts → model-D3wc9-u4.d.mts} +42 -19
- package/modelgen-DDO_NHoQ.mjs +731 -0
- package/modelgen-DDO_NHoQ.mjs.map +1 -0
- package/modelgen.d.mts +20 -3
- package/modelgen.mjs +61 -2
- package/modelgen.mjs.map +1 -0
- package/oauth/github/copilot.mjs +1 -1
- package/{openai-codex-Dj0oh0UV.mjs → openai-codex-C1Yb02kM.mjs} +2 -2
- package/{openai-codex-Dj0oh0UV.mjs.map → openai-codex-C1Yb02kM.mjs.map} +1 -1
- package/openai-codex-CHxShIN3.mjs +2 -0
- package/package.json +10 -10
- package/{registry-CfGgGfSs.mjs → registry-u49t0S4S.mjs} +4 -4
- package/{registry-CfGgGfSs.mjs.map → registry-u49t0S4S.mjs.map} +1 -1
- package/github-copilot-CLJx-bcP.mjs +0 -3
- package/model-D-FoGzVN.mjs +0 -522
- package/model-D-FoGzVN.mjs.map +0 -1
- package/modelgen-D6UBM1fq.mjs +0 -561
- package/modelgen-D6UBM1fq.mjs.map +0 -1
- package/openai-codex-CIBVNhQx.mjs +0 -2
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"modelgen-D6UBM1fq.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\t\"gpt-5.6-luna\",\n\t\"gpt-5.6-sol\",\n\t\"gpt-5.6-terra\",\n\t\"gpt-6-luna\",\n\t\"gpt-6-sol\",\n]);\n\n// Checked live against the Responses and Codex APIs: these families reject\n// reasoning.effort \"minimal\".\nconst OPENAI_NO_MINIMAL_REASONING = /gpt-5\\.[456]|gpt-6/;\n\nfunction isOpenAiResponses(model: Model.Info): boolean {\n\treturn model.protocol === Model.KnownProviderEnum.openai || model.protocol === Model.KnownProviderEnum.openaiCodex;\n}\n\nfunction supportsOpenAiXhigh(model: Model.Info): boolean {\n\treturn /gpt-5\\.[2-5]/.test(model.id) || supportsOpenAiMax(model);\n}\n\nfunction supportsOpenAiMax(model: Model.Info): boolean {\n\treturn isOpenAiResponses(model) && /gpt-5\\.6|gpt-6/.test(model.id);\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 (isOpenAiResponses(model) && OPENAI_NO_MINIMAL_REASONING.test(model.id)) {\n\t\tmergeThinkingLevelMap(model, { minimal: null });\n\t}\n\tif (supportsOpenAiMax(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\tif (isAnthropicMessages(model)) applyAnthropicMetadata(model);\n}\n\nfunction isAnthropicMessages(model: Model.Info): boolean {\n\treturn (\n\t\tmodel.protocol === Model.KnownProviderEnum.anthropic ||\n\t\tmodel.protocol === Model.KnownProviderEnum.googleVertexAnthropic\n\t);\n}\n\n// Checked live against the Messages API: effort levels each adaptive family\n// accepts, the 5.5 and Fable models that reject `thinking: {type: \"disabled\"}`, and\n// Sonnet 4.5's window, which is 1M only behind a beta header.\nfunction applyAnthropicMetadata(model: Model.Info): void {\n\tconst id = model.id;\n\tif (/sonnet-4[-.]5/.test(id)) model.contextWindow = 200_000;\n\tif (/(opus|sonnet)-4[-.]6/.test(id)) {\n\t\tmergeThinkingLevelMap(model, { max: \"max\" });\n\t}\n\tif (/opus-4[-.][78]|(opus|sonnet|fable|haiku)-5/.test(id)) {\n\t\tmergeThinkingLevelMap(model, { xhigh: \"xhigh\", max: \"max\" });\n\t}\n\tif (/(opus|sonnet)-5[-.]5/.test(id)) {\n\t\tmergeThinkingLevelMap(model, { off: null, minimal: null });\n\t}\n\tif (/fable-5/.test(id)) {\n\t\tmergeThinkingLevelMap(model, { off: null });\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\t\"gpt-6-luna\",\n]);\nconst OPENAI_CODEX_ADDITIONAL_TOOLS_MODEL_IDS = new Set([\"gpt-5.6-luna\", \"gpt-5.6-sol\", \"gpt-5.6-terra\", \"gpt-6-luna\"]);\n// Checked live: the Codex backend accepts reasoning.effort \"none\" for these.\nconst OPENAI_CODEX_NONE_REASONING_MODEL_IDS = new Set([\"gpt-5.5\", \"gpt-5.6-luna\", \"gpt-6-luna\"]);\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_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\t\"gpt-6-luna\": { input: 0.1, output: 0.5, cacheRead: 0.01, cacheWrite: 0.125 },\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_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_COSTS[\"gpt-5.6-terra\"]),\n\t\tcontextWindow: OPENAI_CODEX_GPT_56_CONTEXT,\n\t\tthinkingLevelMap: { minimal: null },\n\t},\n\t{\n\t\tid: \"gpt-6-luna\",\n\t\tname: \"GPT-6 Luna\",\n\t\tinput: [\"text\", \"image\"],\n\t\tcost: withOpenAiLongContextPricing(OPENAI_CODEX_COSTS[\"gpt-6-luna\"]),\n\t\tcontextWindow: OPENAI_CODEX_GPT_56_CONTEXT,\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 reason unless verified to accept \"none\".\n\t\t\tthinkingLevelMap: {\n\t\t\t\toff: OPENAI_CODEX_NONE_REASONING_MODEL_IDS.has(seed.id) ? \"none\" : null,\n\t\t\t\t...seed.thinkingLevelMap,\n\t\t\t},\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,eAAu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