@byokkit/cmd-provider-openai 0.1.4 → 0.1.5
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/dist/{chunk-NSTLHK7M.js → chunk-6H7RQMZ6.js} +2 -2
- package/dist/{chunk-4JWBBAVG.js → chunk-AMBJSC4L.js} +14 -2
- package/dist/chunk-AMBJSC4L.js.map +1 -0
- package/dist/{chunk-34MJFIMS.js → chunk-JPKXDYJT.js} +1 -1
- package/dist/chunk-JPKXDYJT.js.map +1 -0
- package/dist/codex.js +1 -1
- package/dist/index.js +3 -3
- package/dist/models.d.ts +13 -1
- package/dist/models.js +1 -1
- package/dist/server/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-34MJFIMS.js.map +0 -1
- package/dist/chunk-4JWBBAVG.js.map +0 -1
- /package/dist/{chunk-NSTLHK7M.js.map → chunk-6H7RQMZ6.js.map} +0 -0
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
CODEX_BASE_URL,
|
|
3
3
|
CODEX_HEADERS,
|
|
4
4
|
extractCodexAccountId
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-JPKXDYJT.js";
|
|
6
6
|
|
|
7
7
|
// src/server/index.ts
|
|
8
8
|
import { createOpenAI } from "@ai-sdk/openai";
|
|
@@ -31,4 +31,4 @@ export {
|
|
|
31
31
|
getCodexLanguageModel,
|
|
32
32
|
getOpenAIApiKeyLanguageModel
|
|
33
33
|
};
|
|
34
|
-
//# sourceMappingURL=chunk-
|
|
34
|
+
//# sourceMappingURL=chunk-6H7RQMZ6.js.map
|
|
@@ -42,6 +42,18 @@ var OPENAI_MODEL_OPTIONS = {
|
|
|
42
42
|
reasoningEfforts: EFFORT_LOW_TO_MAX,
|
|
43
43
|
contextWindow: 105e4
|
|
44
44
|
},
|
|
45
|
+
GPT_6_1_TERRA: {
|
|
46
|
+
id: "gpt-6.1-terra",
|
|
47
|
+
inputModalities: ["text", "image"],
|
|
48
|
+
provider: "openai",
|
|
49
|
+
spec: "responses",
|
|
50
|
+
label: "GPT-6.1 Terra",
|
|
51
|
+
name: "GPT-6.1 Terra",
|
|
52
|
+
description: "fast, efficient model for visual reasoning, computer use & writing",
|
|
53
|
+
reasoning: true,
|
|
54
|
+
reasoningEfforts: EFFORT_LOW_TO_MAX,
|
|
55
|
+
contextWindow: 105e4
|
|
56
|
+
},
|
|
45
57
|
GPT_6_SOL: {
|
|
46
58
|
id: "gpt-6-sol",
|
|
47
59
|
inputModalities: ["text", "image"],
|
|
@@ -112,7 +124,7 @@ var OPENAI_MODEL_OPTIONS = {
|
|
|
112
124
|
description: "latest frontier model for general complex work",
|
|
113
125
|
reasoning: true,
|
|
114
126
|
reasoningEfforts: EFFORT_LOW_TO_XHIGH,
|
|
115
|
-
// 400k like the rest of the 5.x line
|
|
127
|
+
// 400k like the rest of the 5.x line.
|
|
116
128
|
contextWindow: 4e5
|
|
117
129
|
},
|
|
118
130
|
GPT_5_4: {
|
|
@@ -172,4 +184,4 @@ export {
|
|
|
172
184
|
OPENAI_SUPPORTED_MODEL_PROVIDERS,
|
|
173
185
|
OPENAI_MODEL_SPECS
|
|
174
186
|
};
|
|
175
|
-
//# sourceMappingURL=chunk-
|
|
187
|
+
//# sourceMappingURL=chunk-AMBJSC4L.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/models.ts"],"sourcesContent":["// @byokkit/cmd-provider-openai/models — the COMPLETE OpenAI model catalog: /model picker\n// metadata, Responses-vs-ChatComplete spec kinds, context windows, and reasoning efforts.\n// Dependency-free plain data (structural types) so the CLI (via shared/constants), the API\n// worker, and Studio can all consume it, and so this package can move to its own repo without\n// dragging monorepo internals along. Values are a verbatim port from shared/constants.ts +\n// harness/config/known-models.ts — those sites now import from HERE.\n\nexport type OpenAIReasoningEffort = 'low' | 'medium' | 'high' | 'xhigh' | 'max';\n\n// Structural copy of shared's ModelOption (shared `satisfies`-checks on import).\nexport interface OpenAIModelOption {\n\treadonly id: string;\n\treadonly provider: 'openai';\n\treadonly spec: 'responses' | 'chatComplete';\n\treadonly label: string;\n\treadonly name: string;\n\treadonly description: string;\n\treadonly reasoning?: boolean;\n\treadonly reasoningEfforts?: readonly OpenAIReasoningEffort[];\n\treadonly contextWindow?: number;\n\treadonly inputModalities?: readonly ('text' | 'image')[];\n}\n\nconst EFFORT_LOW_TO_MAX: readonly OpenAIReasoningEffort[] = [\n\t'low',\n\t'medium',\n\t'high',\n\t'xhigh',\n\t'max',\n];\n\nconst EFFORT_LOW_TO_XHIGH: readonly OpenAIReasoningEffort[] = [\n\t'low',\n\t'medium',\n\t'high',\n\t'xhigh',\n];\n\nconst EFFORT_LOW_TO_HIGH: readonly OpenAIReasoningEffort[] = [\n\t'low',\n\t'medium',\n\t'high',\n];\n\n// The /model catalog entries (verbatim from shared MODEL_OPTIONS; key names preserved so\n// shared's spread keeps identical keys).\nexport const OPENAI_MODEL_OPTIONS = {\n\tGPT_6_ASTRA: {\n\t\tid: 'gpt-6-astra',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'openai',\n\t\tspec: 'responses',\n\t\tlabel: 'GPT-6 Astra',\n\t\tname: 'GPT-6 Astra',\n\t\tdescription:\n\t\t\t'most capable OpenAI model for demanding reasoning & agents',\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_MAX,\n\t\tcontextWindow: 1_050_000,\n\t},\n\tGPT_6_1_SOL: {\n\t\tid: 'gpt-6.1-sol',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'openai',\n\t\tspec: 'responses',\n\t\tlabel: 'GPT-6.1 Sol',\n\t\tname: 'GPT-6.1 Sol',\n\t\tdescription: 'near-Astra performance for complex work at a lower cost',\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_MAX,\n\t\tcontextWindow: 1_050_000,\n\t},\n\tGPT_6_1_TERRA: {\n\t\tid: 'gpt-6.1-terra',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'openai',\n\t\tspec: 'responses',\n\t\tlabel: 'GPT-6.1 Terra',\n\t\tname: 'GPT-6.1 Terra',\n\t\tdescription:\n\t\t\t'fast, efficient model for visual reasoning, computer use & writing',\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_MAX,\n\t\tcontextWindow: 1_050_000,\n\t},\n\tGPT_6_SOL: {\n\t\tid: 'gpt-6-sol',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'openai',\n\t\tspec: 'responses',\n\t\tlabel: 'GPT-6 Sol',\n\t\tname: 'GPT-6 Sol',\n\t\tdescription: 'built for complex coding & agentic workflows',\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_MAX,\n\t\tcontextWindow: 1_050_000,\n\t},\n\tGPT_6_LUNA: {\n\t\tid: 'gpt-6-luna',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'openai',\n\t\tspec: 'responses',\n\t\tlabel: 'GPT-6 Luna',\n\t\tname: 'GPT-6 Luna',\n\t\tdescription:\n\t\t\t'most efficient OpenAI model for focused, high-volume tasks',\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_MAX,\n\t\tcontextWindow: 1_050_000,\n\t},\n\tGPT_5_6_SOL: {\n\t\tid: 'gpt-5.6-sol',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'openai',\n\t\tspec: 'responses',\n\t\tlabel: 'GPT-5.6 Sol',\n\t\tname: 'GPT-5.6 Sol',\n\t\tdescription: 'frontier model for complex professional work',\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_MAX,\n\t\tcontextWindow: 1_050_000,\n\t},\n\tGPT_5_6_TERRA: {\n\t\tid: 'gpt-5.6-terra',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'openai',\n\t\tspec: 'responses',\n\t\tlabel: 'GPT-5.6 Terra',\n\t\tname: 'GPT-5.6 Terra',\n\t\tdescription: 'balances intelligence and cost',\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_MAX,\n\t\tcontextWindow: 1_050_000,\n\t},\n\tGPT_5_6_LUNA: {\n\t\tid: 'gpt-5.6-luna',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'openai',\n\t\tspec: 'responses',\n\t\tlabel: 'GPT-5.6 Luna',\n\t\tname: 'GPT-5.6 Luna',\n\t\tdescription: 'optimized for cost-sensitive workloads',\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_MAX,\n\t\tcontextWindow: 1_050_000,\n\t},\n\tGPT_5_5: {\n\t\tid: 'gpt-5.5',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'openai',\n\t\tspec: 'responses',\n\t\tlabel: 'GPT-5.5',\n\t\tname: 'GPT-5.5',\n\t\tdescription: 'latest frontier model for general complex work',\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_XHIGH,\n\t\t// 400k like the rest of the 5.x line.\n\t\tcontextWindow: 400_000,\n\t},\n\tGPT_5_4: {\n\t\tid: 'gpt-5.4',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'openai',\n\t\tspec: 'responses',\n\t\tlabel: 'GPT-5.4',\n\t\tname: 'GPT-5.4',\n\t\tdescription: 'frontier model for general complex work',\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_XHIGH,\n\t\tcontextWindow: 400_000,\n\t},\n\tGPT_5_3_CODEX: {\n\t\tid: 'gpt-5.3-codex',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'openai',\n\t\tspec: 'responses',\n\t\tlabel: 'GPT-5.3 Codex',\n\t\tname: 'GPT-5.3 Codex',\n\t\tdescription: 'frontier coding model',\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_XHIGH,\n\t\tcontextWindow: 400_000,\n\t},\n\tGPT_5_4_MINI: {\n\t\tid: 'gpt-5.4-mini',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'openai',\n\t\tspec: 'responses',\n\t\tlabel: 'GPT-5.4 Mini',\n\t\tname: 'GPT-5.4 Mini',\n\t\tdescription: 'fast, cost-effective model for everyday tasks',\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_HIGH,\n\t\tcontextWindow: 400_000,\n\t},\n} as const satisfies Record<string, OpenAIModelOption>;\n\n/** Canonical OpenAI model ids, in catalog order. */\nexport const OPENAI_MODEL_IDS: readonly string[] = Object.values(\n\tOPENAI_MODEL_OPTIONS,\n).map(option => option.id);\n\n// The upstream vendors OpenAI serves — the Codex gateway routes a request only when the model's\n// provider is in this set (port of CMD_PROVIDER_REGISTRY['codex'].supportedModelProviders).\nexport const OPENAI_SUPPORTED_MODEL_PROVIDERS: readonly string[] = ['openai'];\n\n/**\n * Harness ModelSpec-shaped catalog (structural — validated on registration by the harness).\n */\nexport const OPENAI_MODEL_SPECS = Object.values(OPENAI_MODEL_OPTIONS).map(\n\toption => ({\n\t\tid: option.id,\n\t\tprovider: 'openai' as const,\n\t\tcontextWindow:\n\t\t\t'contextWindow' in option ? option.contextWindow : undefined,\n\t\treasoningEfforts: option.reasoningEfforts,\n\t\tinputModalities: option.inputModalities,\n\t}),\n);\n"],"mappings":";AAuBA,IAAM,oBAAsD;AAAA,EAC3D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAEA,IAAM,sBAAwD;AAAA,EAC7D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAEA,IAAM,qBAAuD;AAAA,EAC5D;AAAA,EACA;AAAA,EACA;AACD;AAIO,IAAM,uBAAuB;AAAA,EACnC,aAAa;AAAA,IACZ,IAAI;AAAA,IACJ,iBAAiB,CAAC,QAAQ,OAAO;AAAA,IACjC,UAAU;AAAA,IACV,MAAM;AAAA,IACN,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aACC;AAAA,IACD,WAAW;AAAA,IACX,kBAAkB;AAAA,IAClB,eAAe;AAAA,EAChB;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AAe;AAAA,EAChB;AACD;AAGO,IAAM,mBAAsC,OAAO;AAAA,EACzD;AACD,EAAE,IAAI,YAAU,OAAO,EAAE;AAIlB,IAAM,mCAAsD,CAAC,QAAQ;AAKrE,IAAM,qBAAqB,OAAO,OAAO,oBAAoB,EAAE;AAAA,EACrE,aAAW;AAAA,IACV,IAAI,OAAO;AAAA,IACX,UAAU;AAAA,IACV,eACC,mBAAmB,SAAS,OAAO,gBAAgB;AAAA,IACpD,kBAAkB,OAAO;AAAA,IACzB,iBAAiB,OAAO;AAAA,EACzB;AACD;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/constants.ts","../src/codex.ts"],"sourcesContent":["// OpenAI (Codex / ChatGPT) OAuth constants — a faithful port of the values Command Code's\n// `packages/command/src/auth/codex.ts` registers with OpenAI's authorization server. These are NOT\n// free parameters: OpenAI registered the OAuth client `app_EMoamEEZ73f0CkXaXp7hrann` for the Codex\n// CLI flow with the loopback redirect `http://localhost:1455/auth/callback`, so the client id, port,\n// path and redirect URI MUST match byte-for-byte or OpenAI rejects the `redirect_uri`.\n\n// The OAuth client OpenAI registered for the Codex CLI flow.\nexport const CLIENT_ID = 'app_EMoamEEZ73f0CkXaXp7hrann';\n\n// OpenAI's auth issuer + its derived endpoints.\nexport const ISSUER = 'https://auth.openai.com';\nexport const AUTHORIZE_ENDPOINT = `${ISSUER}/oauth/authorize`;\nexport const TOKEN_ENDPOINT = `${ISSUER}/oauth/token`;\n\n// The scopes Codex requests (`offline_access` is what mints the refresh token).\nexport const SCOPE = 'openid profile email offline_access';\n\n// Loopback redirect — a FIXED port (NOT an ephemeral one): OpenAI only accepts this exact,\n// pre-registered URI. The server binds 127.0.0.1 (like codex.ts) but ADVERTISES `localhost`, which\n// is the host OpenAI registered, so the two hosts intentionally differ.\nexport const OAUTH_PORT = 1455;\nexport const CALLBACK_PATH = '/auth/callback';\nexport const ADVERTISED_HOST = 'localhost'; // host in the registered redirect_uri\nexport const BIND_HOST = '127.0.0.1'; // where the loopback server actually listens (matches codex.ts)\nexport const REDIRECT_URI = `http://${ADVERTISED_HOST}:${OAUTH_PORT}${CALLBACK_PATH}`;\n\n// Wait at most this long for the browser to redirect back (mirrors codex.ts CALLBACK_TIMEOUT_MS).\nexport const CALLBACK_TIMEOUT_MS = 5 * 60 * 1000;\n\n// Refresh this long before the access token actually expires (mirrors codex.ts' 5-minute buffer).\nexport const EXPIRY_SKEW_MS = 5 * 60 * 1000;\n\n// The gateway auth headers Command Code sends (mirrors `packages/shared/src/private/constants.ts` HEADERS).\n// Hardcoded so this plugin stays a standalone external package that never imports command internals.\nexport const HEADER_OAUTH_TOKEN = 'x-oauth-token';\nexport const HEADER_OAUTH_PROVIDER = 'x-oauth-provider';\n\n// CRITICAL parity value. command's `getOAuthCredentials` sends `oauthProvider = PROVIDER.CODEX =\n// 'codex'` for this flow — NOT 'openai'. The `/alpha/generate` gateway keys OpenAI/Codex routing off\n// `'codex'`, so this header value MUST stay `'codex'` even though this module's id is `'openai'`.\nexport const OAUTH_PROVIDER_VALUE = 'codex';\n\n// This module's provider id — the credential-store key + registry lookup key. Deliberately distinct\n// from OAUTH_PROVIDER_VALUE above (store/registry use 'openai'; the gateway header uses 'codex').\nexport const PROVIDER_ID = 'openai';\nexport const DISPLAY_NAME = 'OpenAI';\n\n// Default gateway route (server-routed transport — Command Code routes the real model server-side).\nexport const GATEWAY_ROUTE = '/alpha/generate';\n","// Codex wire constants + pure helpers — DEPENDENCY-FREE on purpose. shared/constants and the\n// API worker both consume these; the AI-SDK-backed factories live in ./server (which imports\n// from here) so browser/Studio consumers never pull '@ai-sdk/openai'.\n//\n// Verified against the open-source `openai/codex` CLI (codex-rs), which is the sanctioned\n// integration path for ChatGPT-subscription tokens: same base URL, originator, beta header, and\n// account-id claim chain. opencode and pi use these exact values too.\n\n// Routes through the chatgpt.com backend. AI SDK's createOpenAI().responses(model) appends\n// \"/responses\" to baseURL, yielding https://chatgpt.com/backend-api/codex/responses.\nexport const CODEX_BASE_URL = 'https://chatgpt.com/backend-api/codex';\nexport const CODEX_API_ENDPOINT = `${CODEX_BASE_URL}/responses`;\n\nexport const CODEX_HEADERS: Record<string, string> = {\n\toriginator: 'codex_cli_rs',\n\t'OpenAI-Beta': 'responses=experimental',\n};\n\nexport const CODEX_UNSUPPORTED_TOOL_TYPES: readonly string[] = [\n\t'web_fetch_20250910',\n\t'web_search_20250305',\n];\n\n// The wire `oauthProvider` value the /alpha/generate gateway + the API worker key Codex routing\n// off (distinct from the module id 'openai'). Re-exported from constants.ts — the CLI sends that\n// constant in the OAUTH_PROVIDER header and the server registry matches on this one, so they must\n// be the SAME string, not two literals that can drift.\nexport {OAUTH_PROVIDER_VALUE as CODEX_OAUTH_PROVIDER_VALUE} from './constants.js';\n\n/**\n * Parse JWT claims to extract the ChatGPT account ID for Codex OAuth.\n * The access_token is a JWT issued by auth.openai.com; claims live in the\n * payload. We only read, never verify — it was just issued to us over TLS.\n */\nexport function extractCodexAccountId(token: string): string | undefined {\n\tconst parts = token.split('.');\n\tconst payload = parts[1];\n\tif (parts.length !== 3 || !payload) return undefined;\n\ttry {\n\t\tconst claims = JSON.parse(\n\t\t\tBuffer.from(payload, 'base64url').toString('utf8'),\n\t\t) as {\n\t\t\tchatgpt_account_id?: string;\n\t\t\torganizations?: Array<{id: string}>;\n\t\t\t'https://api.openai.com/auth'?: {chatgpt_account_id?: string};\n\t\t};\n\t\treturn (\n\t\t\tclaims.chatgpt_account_id ||\n\t\t\tclaims['https://api.openai.com/auth']?.chatgpt_account_id ||\n\t\t\tclaims.organizations?.[0]?.id\n\t\t);\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\n/**\n * Codex (OpenAI Responses API) message scrub: strips item IDs the endpoint rejects. Applied\n * after the api's generic content normalization.\n */\nexport function stripCodexItemIds(messages: readonly unknown[]): unknown[] {\n\treturn messages.map((msg: unknown) => {\n\t\tif (!msg || typeof msg !== 'object' || !('id' in msg)) return msg;\n\t\tconst {id: _id, ...rest} = msg as Record<string, unknown>;\n\t\treturn rest;\n\t});\n}\n\n/**\n * providerOptions.openai for a Codex request. The Responses endpoint takes the system prompt via\n * `instructions` (NOT the `system` param) and rejects `store: true`.\n *\n * `include: reasoning.encrypted_content` mirrors codex-rs/opencode/pi: without it the backend\n * omits the encrypted reasoning items that MUST be replayed on the next turn of a reasoning\n * model, so multi-turn/tool-loop requests fail — the primary suspect for \"OpenAI provider\n * doesn't work\" reports. `promptCacheKey` (session id) opts into prompt caching keyed the same\n * way codex-rs keys it.\n */\nexport function buildCodexProviderOptions(params: {\n\treadonly system: string;\n\treadonly sessionId?: string;\n}): Record<string, Record<string, unknown>> {\n\treturn {\n\t\topenai: {\n\t\t\tinstructions: params.system,\n\t\t\tstore: false,\n\t\t\tinclude: ['reasoning.encrypted_content'],\n\t\t\t...(params.sessionId ? {promptCacheKey: params.sessionId} : {}),\n\t\t},\n\t};\n}\n"],"mappings":";AAOO,IAAM,YAAY;AAGlB,IAAM,SAAS;AACf,IAAM,qBAAqB,GAAG,MAAM;AACpC,IAAM,iBAAiB,GAAG,MAAM;AAGhC,IAAM,QAAQ;AAKd,IAAM,aAAa;AACnB,IAAM,gBAAgB;AACtB,IAAM,kBAAkB;AACxB,IAAM,YAAY;AAClB,IAAM,eAAe,UAAU,eAAe,IAAI,UAAU,GAAG,aAAa;AAG5E,IAAM,sBAAsB,IAAI,KAAK;AAGrC,IAAM,iBAAiB,IAAI,KAAK;AAIhC,IAAM,qBAAqB;AAC3B,IAAM,wBAAwB;AAK9B,IAAM,uBAAuB;AAI7B,IAAM,cAAc;AACpB,IAAM,eAAe;AAGrB,IAAM,gBAAgB;;;ACtCtB,IAAM,iBAAiB;AACvB,IAAM,qBAAqB,GAAG,cAAc;AAE5C,IAAM,gBAAwC;AAAA,EACpD,YAAY;AAAA,EACZ,eAAe;AAChB;AAEO,IAAM,+BAAkD;AAAA,EAC9D;AAAA,EACA;AACD;AAaO,SAAS,sBAAsB,OAAmC;AACxE,QAAM,QAAQ,MAAM,MAAM,GAAG;AAC7B,QAAM,UAAU,MAAM,CAAC;AACvB,MAAI,MAAM,WAAW,KAAK,CAAC,QAAS,QAAO;AAC3C,MAAI;AACH,UAAM,SAAS,KAAK;AAAA,MACnB,OAAO,KAAK,SAAS,WAAW,EAAE,SAAS,MAAM;AAAA,IAClD;AAKA,WACC,OAAO,sBACP,OAAO,6BAA6B,GAAG,sBACvC,OAAO,gBAAgB,CAAC,GAAG;AAAA,EAE7B,QAAQ;AACP,WAAO;AAAA,EACR;AACD;AAMO,SAAS,kBAAkB,UAAyC;AAC1E,SAAO,SAAS,IAAI,CAAC,QAAiB;AACrC,QAAI,CAAC,OAAO,OAAO,QAAQ,YAAY,EAAE,QAAQ,KAAM,QAAO;AAC9D,UAAM,EAAC,IAAI,KAAK,GAAG,KAAI,IAAI;AAC3B,WAAO;AAAA,EACR,CAAC;AACF;AAYO,SAAS,0BAA0B,QAGE;AAC3C,SAAO;AAAA,IACN,QAAQ;AAAA,MACP,cAAc,OAAO;AAAA,MACrB,OAAO;AAAA,MACP,SAAS,CAAC,6BAA6B;AAAA,MACvC,GAAI,OAAO,YAAY,EAAC,gBAAgB,OAAO,UAAS,IAAI,CAAC;AAAA,IAC9D;AAAA,EACD;AACD;","names":[]}
|
package/dist/codex.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
OPENAI_MODEL_SPECS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-AMBJSC4L.js";
|
|
4
4
|
import {
|
|
5
5
|
getCodexLanguageModel
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-6H7RQMZ6.js";
|
|
7
7
|
import {
|
|
8
8
|
ADVERTISED_HOST,
|
|
9
9
|
AUTHORIZE_ENDPOINT,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
TOKEN_ENDPOINT,
|
|
27
27
|
buildCodexProviderOptions,
|
|
28
28
|
extractCodexAccountId
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-JPKXDYJT.js";
|
|
30
30
|
|
|
31
31
|
// ../harness/dist/chunk-HJFDNIAC.js
|
|
32
32
|
import { createHash, randomBytes } from "crypto";
|
package/dist/models.d.ts
CHANGED
|
@@ -36,6 +36,18 @@ declare const OPENAI_MODEL_OPTIONS: {
|
|
|
36
36
|
readonly reasoningEfforts: readonly OpenAIReasoningEffort[];
|
|
37
37
|
readonly contextWindow: 1050000;
|
|
38
38
|
};
|
|
39
|
+
readonly GPT_6_1_TERRA: {
|
|
40
|
+
readonly id: "gpt-6.1-terra";
|
|
41
|
+
readonly inputModalities: readonly ["text", "image"];
|
|
42
|
+
readonly provider: "openai";
|
|
43
|
+
readonly spec: "responses";
|
|
44
|
+
readonly label: "GPT-6.1 Terra";
|
|
45
|
+
readonly name: "GPT-6.1 Terra";
|
|
46
|
+
readonly description: "fast, efficient model for visual reasoning, computer use & writing";
|
|
47
|
+
readonly reasoning: true;
|
|
48
|
+
readonly reasoningEfforts: readonly OpenAIReasoningEffort[];
|
|
49
|
+
readonly contextWindow: 1050000;
|
|
50
|
+
};
|
|
39
51
|
readonly GPT_6_SOL: {
|
|
40
52
|
readonly id: "gpt-6-sol";
|
|
41
53
|
readonly inputModalities: readonly ["text", "image"];
|
|
@@ -152,7 +164,7 @@ declare const OPENAI_SUPPORTED_MODEL_PROVIDERS: readonly string[];
|
|
|
152
164
|
* Harness ModelSpec-shaped catalog (structural — validated on registration by the harness).
|
|
153
165
|
*/
|
|
154
166
|
declare const OPENAI_MODEL_SPECS: {
|
|
155
|
-
id: "gpt-
|
|
167
|
+
id: "gpt-6-astra" | "gpt-6.1-sol" | "gpt-6.1-terra" | "gpt-6-sol" | "gpt-6-luna" | "gpt-5.6-sol" | "gpt-5.6-terra" | "gpt-5.6-luna" | "gpt-5.5" | "gpt-5.4" | "gpt-5.3-codex" | "gpt-5.4-mini";
|
|
156
168
|
provider: "openai";
|
|
157
169
|
contextWindow: 1050000 | 400000 | undefined;
|
|
158
170
|
reasoningEfforts: readonly OpenAIReasoningEffort[];
|
package/dist/models.js
CHANGED
package/dist/server/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getCodexLanguageModel,
|
|
3
3
|
getOpenAIApiKeyLanguageModel
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-6H7RQMZ6.js";
|
|
5
5
|
import {
|
|
6
6
|
CODEX_API_ENDPOINT,
|
|
7
7
|
CODEX_BASE_URL,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
buildCodexProviderOptions,
|
|
11
11
|
extractCodexAccountId,
|
|
12
12
|
stripCodexItemIds
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-JPKXDYJT.js";
|
|
14
14
|
export {
|
|
15
15
|
CODEX_API_ENDPOINT,
|
|
16
16
|
CODEX_BASE_URL,
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/constants.ts","../src/codex.ts"],"sourcesContent":["// OpenAI (Codex / ChatGPT) OAuth constants — a faithful port of the values Command Code's\n// `packages/command/src/auth/codex.ts` registers with OpenAI's authorization server. These are NOT\n// free parameters: OpenAI registered the OAuth client `app_EMoamEEZ73f0CkXaXp7hrann` for the Codex\n// CLI flow with the loopback redirect `http://localhost:1455/auth/callback`, so the client id, port,\n// path and redirect URI MUST match byte-for-byte or OpenAI rejects the `redirect_uri`.\n\n// The OAuth client OpenAI registered for the Codex CLI flow.\nexport const CLIENT_ID = 'app_EMoamEEZ73f0CkXaXp7hrann';\n\n// OpenAI's auth issuer + its derived endpoints.\nexport const ISSUER = 'https://auth.openai.com';\nexport const AUTHORIZE_ENDPOINT = `${ISSUER}/oauth/authorize`;\nexport const TOKEN_ENDPOINT = `${ISSUER}/oauth/token`;\n\n// The scopes Codex requests (`offline_access` is what mints the refresh token).\nexport const SCOPE = 'openid profile email offline_access';\n\n// Loopback redirect — a FIXED port (NOT an ephemeral one): OpenAI only accepts this exact,\n// pre-registered URI. The server binds 127.0.0.1 (like codex.ts) but ADVERTISES `localhost`, which\n// is the host OpenAI registered, so the two hosts intentionally differ.\nexport const OAUTH_PORT = 1455;\nexport const CALLBACK_PATH = '/auth/callback';\nexport const ADVERTISED_HOST = 'localhost'; // host in the registered redirect_uri\nexport const BIND_HOST = '127.0.0.1'; // where the loopback server actually listens (matches codex.ts)\nexport const REDIRECT_URI = `http://${ADVERTISED_HOST}:${OAUTH_PORT}${CALLBACK_PATH}`;\n\n// Wait at most this long for the browser to redirect back (mirrors codex.ts CALLBACK_TIMEOUT_MS).\nexport const CALLBACK_TIMEOUT_MS = 5 * 60 * 1000;\n\n// Refresh this long before the access token actually expires (mirrors codex.ts' 5-minute buffer).\nexport const EXPIRY_SKEW_MS = 5 * 60 * 1000;\n\n// The gateway auth headers Command Code sends (mirrors `packages/shared/src/constants.ts` HEADERS).\n// Hardcoded so this plugin stays a standalone external package that never imports command internals.\nexport const HEADER_OAUTH_TOKEN = 'x-oauth-token';\nexport const HEADER_OAUTH_PROVIDER = 'x-oauth-provider';\n\n// CRITICAL parity value. command's `getOAuthCredentials` sends `oauthProvider = PROVIDER.CODEX =\n// 'codex'` for this flow — NOT 'openai'. The `/alpha/generate` gateway keys OpenAI/Codex routing off\n// `'codex'`, so this header value MUST stay `'codex'` even though this module's id is `'openai'`.\nexport const OAUTH_PROVIDER_VALUE = 'codex';\n\n// This module's provider id — the credential-store key + registry lookup key. Deliberately distinct\n// from OAUTH_PROVIDER_VALUE above (store/registry use 'openai'; the gateway header uses 'codex').\nexport const PROVIDER_ID = 'openai';\nexport const DISPLAY_NAME = 'OpenAI';\n\n// Default gateway route (server-routed transport — Command Code routes the real model server-side).\nexport const GATEWAY_ROUTE = '/alpha/generate';\n","// Codex wire constants + pure helpers — DEPENDENCY-FREE on purpose. shared/constants and the\n// API worker both consume these; the AI-SDK-backed factories live in ./server (which imports\n// from here) so browser/Studio consumers never pull '@ai-sdk/openai'.\n//\n// Verified against the open-source `openai/codex` CLI (codex-rs), which is the sanctioned\n// integration path for ChatGPT-subscription tokens: same base URL, originator, beta header, and\n// account-id claim chain. opencode and pi use these exact values too.\n\n// Routes through the chatgpt.com backend. AI SDK's createOpenAI().responses(model) appends\n// \"/responses\" to baseURL, yielding https://chatgpt.com/backend-api/codex/responses.\nexport const CODEX_BASE_URL = 'https://chatgpt.com/backend-api/codex';\nexport const CODEX_API_ENDPOINT = `${CODEX_BASE_URL}/responses`;\n\nexport const CODEX_HEADERS: Record<string, string> = {\n\toriginator: 'codex_cli_rs',\n\t'OpenAI-Beta': 'responses=experimental',\n};\n\nexport const CODEX_UNSUPPORTED_TOOL_TYPES: readonly string[] = [\n\t'web_fetch_20250910',\n\t'web_search_20250305',\n];\n\n// The wire `oauthProvider` value the /alpha/generate gateway + the API worker key Codex routing\n// off (distinct from the module id 'openai'). Re-exported from constants.ts — the CLI sends that\n// constant in the OAUTH_PROVIDER header and the server registry matches on this one, so they must\n// be the SAME string, not two literals that can drift.\nexport {OAUTH_PROVIDER_VALUE as CODEX_OAUTH_PROVIDER_VALUE} from './constants.js';\n\n/**\n * Parse JWT claims to extract the ChatGPT account ID for Codex OAuth.\n * The access_token is a JWT issued by auth.openai.com; claims live in the\n * payload. We only read, never verify — it was just issued to us over TLS.\n */\nexport function extractCodexAccountId(token: string): string | undefined {\n\tconst parts = token.split('.');\n\tconst payload = parts[1];\n\tif (parts.length !== 3 || !payload) return undefined;\n\ttry {\n\t\tconst claims = JSON.parse(\n\t\t\tBuffer.from(payload, 'base64url').toString('utf8'),\n\t\t) as {\n\t\t\tchatgpt_account_id?: string;\n\t\t\torganizations?: Array<{id: string}>;\n\t\t\t'https://api.openai.com/auth'?: {chatgpt_account_id?: string};\n\t\t};\n\t\treturn (\n\t\t\tclaims.chatgpt_account_id ||\n\t\t\tclaims['https://api.openai.com/auth']?.chatgpt_account_id ||\n\t\t\tclaims.organizations?.[0]?.id\n\t\t);\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\n/**\n * Codex (OpenAI Responses API) message scrub: strips item IDs the endpoint rejects. Applied\n * after the api's generic content normalization.\n */\nexport function stripCodexItemIds(messages: readonly unknown[]): unknown[] {\n\treturn messages.map((msg: unknown) => {\n\t\tif (!msg || typeof msg !== 'object' || !('id' in msg)) return msg;\n\t\tconst {id: _id, ...rest} = msg as Record<string, unknown>;\n\t\treturn rest;\n\t});\n}\n\n/**\n * providerOptions.openai for a Codex request. The Responses endpoint takes the system prompt via\n * `instructions` (NOT the `system` param) and rejects `store: true`.\n *\n * `include: reasoning.encrypted_content` mirrors codex-rs/opencode/pi: without it the backend\n * omits the encrypted reasoning items that MUST be replayed on the next turn of a reasoning\n * model, so multi-turn/tool-loop requests fail — the primary suspect for \"OpenAI provider\n * doesn't work\" reports. `promptCacheKey` (session id) opts into prompt caching keyed the same\n * way codex-rs keys it.\n */\nexport function buildCodexProviderOptions(params: {\n\treadonly system: string;\n\treadonly sessionId?: string;\n}): Record<string, Record<string, unknown>> {\n\treturn {\n\t\topenai: {\n\t\t\tinstructions: params.system,\n\t\t\tstore: false,\n\t\t\tinclude: ['reasoning.encrypted_content'],\n\t\t\t...(params.sessionId ? {promptCacheKey: params.sessionId} : {}),\n\t\t},\n\t};\n}\n"],"mappings":";AAOO,IAAM,YAAY;AAGlB,IAAM,SAAS;AACf,IAAM,qBAAqB,GAAG,MAAM;AACpC,IAAM,iBAAiB,GAAG,MAAM;AAGhC,IAAM,QAAQ;AAKd,IAAM,aAAa;AACnB,IAAM,gBAAgB;AACtB,IAAM,kBAAkB;AACxB,IAAM,YAAY;AAClB,IAAM,eAAe,UAAU,eAAe,IAAI,UAAU,GAAG,aAAa;AAG5E,IAAM,sBAAsB,IAAI,KAAK;AAGrC,IAAM,iBAAiB,IAAI,KAAK;AAIhC,IAAM,qBAAqB;AAC3B,IAAM,wBAAwB;AAK9B,IAAM,uBAAuB;AAI7B,IAAM,cAAc;AACpB,IAAM,eAAe;AAGrB,IAAM,gBAAgB;;;ACtCtB,IAAM,iBAAiB;AACvB,IAAM,qBAAqB,GAAG,cAAc;AAE5C,IAAM,gBAAwC;AAAA,EACpD,YAAY;AAAA,EACZ,eAAe;AAChB;AAEO,IAAM,+BAAkD;AAAA,EAC9D;AAAA,EACA;AACD;AAaO,SAAS,sBAAsB,OAAmC;AACxE,QAAM,QAAQ,MAAM,MAAM,GAAG;AAC7B,QAAM,UAAU,MAAM,CAAC;AACvB,MAAI,MAAM,WAAW,KAAK,CAAC,QAAS,QAAO;AAC3C,MAAI;AACH,UAAM,SAAS,KAAK;AAAA,MACnB,OAAO,KAAK,SAAS,WAAW,EAAE,SAAS,MAAM;AAAA,IAClD;AAKA,WACC,OAAO,sBACP,OAAO,6BAA6B,GAAG,sBACvC,OAAO,gBAAgB,CAAC,GAAG;AAAA,EAE7B,QAAQ;AACP,WAAO;AAAA,EACR;AACD;AAMO,SAAS,kBAAkB,UAAyC;AAC1E,SAAO,SAAS,IAAI,CAAC,QAAiB;AACrC,QAAI,CAAC,OAAO,OAAO,QAAQ,YAAY,EAAE,QAAQ,KAAM,QAAO;AAC9D,UAAM,EAAC,IAAI,KAAK,GAAG,KAAI,IAAI;AAC3B,WAAO;AAAA,EACR,CAAC;AACF;AAYO,SAAS,0BAA0B,QAGE;AAC3C,SAAO;AAAA,IACN,QAAQ;AAAA,MACP,cAAc,OAAO;AAAA,MACrB,OAAO;AAAA,MACP,SAAS,CAAC,6BAA6B;AAAA,MACvC,GAAI,OAAO,YAAY,EAAC,gBAAgB,OAAO,UAAS,IAAI,CAAC;AAAA,IAC9D;AAAA,EACD;AACD;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/models.ts"],"sourcesContent":["// @byokkit/cmd-provider-openai/models — the COMPLETE OpenAI model catalog: /model picker\n// metadata, Responses-vs-ChatComplete spec kinds, context windows, and reasoning efforts.\n// Dependency-free plain data (structural types) so the CLI (via shared/constants), the API\n// worker, and Studio can all consume it, and so this package can move to its own repo without\n// dragging monorepo internals along. Values are a verbatim port from shared/constants.ts +\n// harness/config/known-models.ts — those sites now import from HERE.\n\nexport type OpenAIReasoningEffort = 'low' | 'medium' | 'high' | 'xhigh' | 'max';\n\n// Structural copy of shared's ModelOption (shared `satisfies`-checks on import).\nexport interface OpenAIModelOption {\n\treadonly id: string;\n\treadonly provider: 'openai';\n\treadonly spec: 'responses' | 'chatComplete';\n\treadonly label: string;\n\treadonly name: string;\n\treadonly description: string;\n\treadonly reasoning?: boolean;\n\treadonly reasoningEfforts?: readonly OpenAIReasoningEffort[];\n\treadonly contextWindow?: number;\n\treadonly inputModalities?: readonly ('text' | 'image')[];\n}\n\nconst EFFORT_LOW_TO_MAX: readonly OpenAIReasoningEffort[] = [\n\t'low',\n\t'medium',\n\t'high',\n\t'xhigh',\n\t'max',\n];\n\nconst EFFORT_LOW_TO_XHIGH: readonly OpenAIReasoningEffort[] = [\n\t'low',\n\t'medium',\n\t'high',\n\t'xhigh',\n];\n\nconst EFFORT_LOW_TO_HIGH: readonly OpenAIReasoningEffort[] = [\n\t'low',\n\t'medium',\n\t'high',\n];\n\n// The /model catalog entries (verbatim from shared MODEL_OPTIONS; key names preserved so\n// shared's spread keeps identical keys).\nexport const OPENAI_MODEL_OPTIONS = {\n\tGPT_6_ASTRA: {\n\t\tid: 'gpt-6-astra',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'openai',\n\t\tspec: 'responses',\n\t\tlabel: 'GPT-6 Astra',\n\t\tname: 'GPT-6 Astra',\n\t\tdescription:\n\t\t\t'most capable OpenAI model for demanding reasoning & agents',\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_MAX,\n\t\tcontextWindow: 1_050_000,\n\t},\n\tGPT_6_1_SOL: {\n\t\tid: 'gpt-6.1-sol',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'openai',\n\t\tspec: 'responses',\n\t\tlabel: 'GPT-6.1 Sol',\n\t\tname: 'GPT-6.1 Sol',\n\t\tdescription: 'near-Astra performance for complex work at a lower cost',\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_MAX,\n\t\tcontextWindow: 1_050_000,\n\t},\n\tGPT_6_SOL: {\n\t\tid: 'gpt-6-sol',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'openai',\n\t\tspec: 'responses',\n\t\tlabel: 'GPT-6 Sol',\n\t\tname: 'GPT-6 Sol',\n\t\tdescription: 'built for complex coding & agentic workflows',\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_MAX,\n\t\tcontextWindow: 1_050_000,\n\t},\n\tGPT_6_LUNA: {\n\t\tid: 'gpt-6-luna',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'openai',\n\t\tspec: 'responses',\n\t\tlabel: 'GPT-6 Luna',\n\t\tname: 'GPT-6 Luna',\n\t\tdescription:\n\t\t\t'most efficient OpenAI model for focused, high-volume tasks',\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_MAX,\n\t\tcontextWindow: 1_050_000,\n\t},\n\tGPT_5_6_SOL: {\n\t\tid: 'gpt-5.6-sol',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'openai',\n\t\tspec: 'responses',\n\t\tlabel: 'GPT-5.6 Sol',\n\t\tname: 'GPT-5.6 Sol',\n\t\tdescription: 'frontier model for complex professional work',\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_MAX,\n\t\tcontextWindow: 1_050_000,\n\t},\n\tGPT_5_6_TERRA: {\n\t\tid: 'gpt-5.6-terra',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'openai',\n\t\tspec: 'responses',\n\t\tlabel: 'GPT-5.6 Terra',\n\t\tname: 'GPT-5.6 Terra',\n\t\tdescription: 'balances intelligence and cost',\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_MAX,\n\t\tcontextWindow: 1_050_000,\n\t},\n\tGPT_5_6_LUNA: {\n\t\tid: 'gpt-5.6-luna',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'openai',\n\t\tspec: 'responses',\n\t\tlabel: 'GPT-5.6 Luna',\n\t\tname: 'GPT-5.6 Luna',\n\t\tdescription: 'optimized for cost-sensitive workloads',\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_MAX,\n\t\tcontextWindow: 1_050_000,\n\t},\n\tGPT_5_5: {\n\t\tid: 'gpt-5.5',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'openai',\n\t\tspec: 'responses',\n\t\tlabel: 'GPT-5.5',\n\t\tname: 'GPT-5.5',\n\t\tdescription: 'latest frontier model for general complex work',\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_XHIGH,\n\t\t// 400k like the rest of the 5.x line (harness known-models mirrors this value).\n\t\tcontextWindow: 400_000,\n\t},\n\tGPT_5_4: {\n\t\tid: 'gpt-5.4',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'openai',\n\t\tspec: 'responses',\n\t\tlabel: 'GPT-5.4',\n\t\tname: 'GPT-5.4',\n\t\tdescription: 'frontier model for general complex work',\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_XHIGH,\n\t\tcontextWindow: 400_000,\n\t},\n\tGPT_5_3_CODEX: {\n\t\tid: 'gpt-5.3-codex',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'openai',\n\t\tspec: 'responses',\n\t\tlabel: 'GPT-5.3 Codex',\n\t\tname: 'GPT-5.3 Codex',\n\t\tdescription: 'frontier coding model',\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_XHIGH,\n\t\tcontextWindow: 400_000,\n\t},\n\tGPT_5_4_MINI: {\n\t\tid: 'gpt-5.4-mini',\n\t\tinputModalities: ['text', 'image'],\n\t\tprovider: 'openai',\n\t\tspec: 'responses',\n\t\tlabel: 'GPT-5.4 Mini',\n\t\tname: 'GPT-5.4 Mini',\n\t\tdescription: 'fast, cost-effective model for everyday tasks',\n\t\treasoning: true,\n\t\treasoningEfforts: EFFORT_LOW_TO_HIGH,\n\t\tcontextWindow: 400_000,\n\t},\n} as const satisfies Record<string, OpenAIModelOption>;\n\n/** Canonical OpenAI model ids, in catalog order. */\nexport const OPENAI_MODEL_IDS: readonly string[] = Object.values(\n\tOPENAI_MODEL_OPTIONS,\n).map(option => option.id);\n\n// The upstream vendors OpenAI serves — the Codex gateway routes a request only when the model's\n// provider is in this set (port of CMD_PROVIDER_REGISTRY['codex'].supportedModelProviders).\nexport const OPENAI_SUPPORTED_MODEL_PROVIDERS: readonly string[] = ['openai'];\n\n/**\n * Harness ModelSpec-shaped catalog (structural — validated on registration by the harness).\n */\nexport const OPENAI_MODEL_SPECS = Object.values(OPENAI_MODEL_OPTIONS).map(\n\toption => ({\n\t\tid: option.id,\n\t\tprovider: 'openai' as const,\n\t\tcontextWindow:\n\t\t\t'contextWindow' in option ? option.contextWindow : undefined,\n\t\treasoningEfforts: option.reasoningEfforts,\n\t\tinputModalities: option.inputModalities,\n\t}),\n);\n"],"mappings":";AAuBA,IAAM,oBAAsD;AAAA,EAC3D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAEA,IAAM,sBAAwD;AAAA,EAC7D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAEA,IAAM,qBAAuD;AAAA,EAC5D;AAAA,EACA;AAAA,EACA;AACD;AAIO,IAAM,uBAAuB;AAAA,EACnC,aAAa;AAAA,IACZ,IAAI;AAAA,IACJ,iBAAiB,CAAC,QAAQ,OAAO;AAAA,IACjC,UAAU;AAAA,IACV,MAAM;AAAA,IACN,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aACC;AAAA,IACD,WAAW;AAAA,IACX,kBAAkB;AAAA,IAClB,eAAe;AAAA,EAChB;AAAA,EACA,aAAa;AAAA,IACZ,IAAI;AAAA,IACJ,iBAAiB,CAAC,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