ai-sdk-provider-codex-cli 0.7.0 → 0.7.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/README.md +2 -2
- package/dist/index.cjs +9 -3
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +9 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
[](https://github.com/ben-vargas/ai-sdk-provider-codex-cli/issues)
|
|
11
11
|
[](https://github.com/ben-vargas/ai-sdk-provider-codex-cli/releases/latest)
|
|
12
12
|
|
|
13
|
-
A community provider for Vercel AI SDK v5 that uses OpenAI’s Codex CLI (non‑interactive `codex exec`) to talk to GPT‑5.1 class models (`gpt-5.1`, the Codex-specific `gpt-5.1-codex
|
|
13
|
+
A community provider for Vercel AI SDK v5 that uses OpenAI’s Codex CLI (non‑interactive `codex exec`) to talk to GPT‑5.1 / GPT‑5.2 class models (`gpt-5.1`, `gpt-5.2`, the Codex-specific `gpt-5.1-codex` / `gpt-5.2-codex`, the flagship `*-codex-max`, and the lightweight `*-codex-mini` slugs) with your ChatGPT Plus/Pro subscription. The provider spawns the Codex CLI process, parses its JSONL output, and adapts it to the AI SDK LanguageModelV2 interface. Legacy GPT-5 / GPT-5-codex slugs remain compatible for existing workflows.
|
|
14
14
|
|
|
15
15
|
- Works with `generateText`, `streamText`, and `generateObject` (native JSON Schema support via `--output-schema`)
|
|
16
16
|
- Uses ChatGPT OAuth from `codex login` (tokens in `~/.codex/auth.json`) or `OPENAI_API_KEY`
|
|
@@ -292,7 +292,7 @@ const model = codexCli('gpt-5.1-codex', {
|
|
|
292
292
|
addDirs: ['../shared'],
|
|
293
293
|
|
|
294
294
|
// Reasoning & verbosity
|
|
295
|
-
reasoningEffort: 'medium', // minimal | low | medium | high | xhigh (xhigh
|
|
295
|
+
reasoningEffort: 'medium', // none | minimal | low | medium | high | xhigh (xhigh on codex-max and newer models that expose it)
|
|
296
296
|
reasoningSummary: 'auto', // auto | detailed (Note: 'concise' and 'none' are rejected by API)
|
|
297
297
|
reasoningSummaryFormat: 'none', // none | experimental
|
|
298
298
|
modelVerbosity: 'high', // low | medium | high
|
package/dist/index.cjs
CHANGED
|
@@ -111,7 +111,7 @@ var settingsSchema = zod.z.object({
|
|
|
111
111
|
verbose: zod.z.boolean().optional(),
|
|
112
112
|
logger: zod.z.union([zod.z.literal(false), loggerFunctionSchema]).optional(),
|
|
113
113
|
// NEW: Reasoning & Verbosity
|
|
114
|
-
reasoningEffort: zod.z.enum(["minimal", "low", "medium", "high", "xhigh"]).optional(),
|
|
114
|
+
reasoningEffort: zod.z.enum(["none", "minimal", "low", "medium", "high", "xhigh"]).optional(),
|
|
115
115
|
// Note: API rejects 'concise' and 'none' despite error messages claiming they're valid
|
|
116
116
|
reasoningSummary: zod.z.enum(["auto", "detailed"]).optional(),
|
|
117
117
|
reasoningSummaryFormat: zod.z.enum(["none", "experimental"]).optional(),
|
|
@@ -357,7 +357,7 @@ function isAuthenticationError(err) {
|
|
|
357
357
|
|
|
358
358
|
// src/codex-cli-language-model.ts
|
|
359
359
|
var codexCliProviderOptionsSchema = zod.z.object({
|
|
360
|
-
reasoningEffort: zod.z.enum(["minimal", "low", "medium", "high", "xhigh"]).optional(),
|
|
360
|
+
reasoningEffort: zod.z.enum(["none", "minimal", "low", "medium", "high", "xhigh"]).optional(),
|
|
361
361
|
reasoningSummary: zod.z.enum(["auto", "detailed"]).optional(),
|
|
362
362
|
reasoningSummaryFormat: zod.z.enum(["none", "experimental"]).optional(),
|
|
363
363
|
textVerbosity: zod.z.enum(["low", "medium", "high"]).optional(),
|
|
@@ -376,7 +376,13 @@ var codexCliProviderOptionsSchema = zod.z.object({
|
|
|
376
376
|
rmcpClient: zod.z.boolean().optional()
|
|
377
377
|
}).strict();
|
|
378
378
|
function resolveCodexPath(explicitPath, allowNpx) {
|
|
379
|
-
if (explicitPath)
|
|
379
|
+
if (explicitPath) {
|
|
380
|
+
const lower = explicitPath.toLowerCase();
|
|
381
|
+
if (lower.endsWith(".js") || lower.endsWith(".mjs") || lower.endsWith(".cjs")) {
|
|
382
|
+
return { cmd: "node", args: [explicitPath] };
|
|
383
|
+
}
|
|
384
|
+
return { cmd: explicitPath, args: [] };
|
|
385
|
+
}
|
|
380
386
|
try {
|
|
381
387
|
const req = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)));
|
|
382
388
|
const pkgPath = req.resolve("@openai/codex/package.json");
|
package/dist/index.d.cts
CHANGED
|
@@ -37,7 +37,7 @@ interface Logger {
|
|
|
37
37
|
}
|
|
38
38
|
type ApprovalMode = 'untrusted' | 'on-failure' | 'on-request' | 'never';
|
|
39
39
|
type SandboxMode = 'read-only' | 'workspace-write' | 'danger-full-access';
|
|
40
|
-
type ReasoningEffort = 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
|
|
40
|
+
type ReasoningEffort = 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
|
|
41
41
|
/**
|
|
42
42
|
* Reasoning summary detail level.
|
|
43
43
|
* Note: The API error messages claim 'concise' and 'none' are valid, but they are
|
|
@@ -116,8 +116,8 @@ interface CodexCliSettings {
|
|
|
116
116
|
* and legacy GPT-5 slugs). Higher effort produces more thorough reasoning at the cost of latency.
|
|
117
117
|
*
|
|
118
118
|
* Codex CLI model presets currently expose `low`/`medium`/`high` for `gpt-5.1` and `gpt-5.1-codex`.
|
|
119
|
+
* Per OpenAI API docs, GPT‑5.1+ models support a `none` level (no extra reasoning); older GPT‑5 slugs used `minimal` instead.
|
|
119
120
|
* `gpt-5.1-codex-max` additionally supports `xhigh`. `gpt-5.1-codex-mini` only offers `medium`/`high`.
|
|
120
|
-
* The legacy `gpt-5` slug still allowed `minimal`, but GPT-5.1 rejects it.
|
|
121
121
|
*
|
|
122
122
|
* Maps to: `-c model_reasoning_effort=<value>`
|
|
123
123
|
* @see https://platform.openai.com/docs/guides/reasoning
|
package/dist/index.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ interface Logger {
|
|
|
37
37
|
}
|
|
38
38
|
type ApprovalMode = 'untrusted' | 'on-failure' | 'on-request' | 'never';
|
|
39
39
|
type SandboxMode = 'read-only' | 'workspace-write' | 'danger-full-access';
|
|
40
|
-
type ReasoningEffort = 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
|
|
40
|
+
type ReasoningEffort = 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
|
|
41
41
|
/**
|
|
42
42
|
* Reasoning summary detail level.
|
|
43
43
|
* Note: The API error messages claim 'concise' and 'none' are valid, but they are
|
|
@@ -116,8 +116,8 @@ interface CodexCliSettings {
|
|
|
116
116
|
* and legacy GPT-5 slugs). Higher effort produces more thorough reasoning at the cost of latency.
|
|
117
117
|
*
|
|
118
118
|
* Codex CLI model presets currently expose `low`/`medium`/`high` for `gpt-5.1` and `gpt-5.1-codex`.
|
|
119
|
+
* Per OpenAI API docs, GPT‑5.1+ models support a `none` level (no extra reasoning); older GPT‑5 slugs used `minimal` instead.
|
|
119
120
|
* `gpt-5.1-codex-max` additionally supports `xhigh`. `gpt-5.1-codex-mini` only offers `medium`/`high`.
|
|
120
|
-
* The legacy `gpt-5` slug still allowed `minimal`, but GPT-5.1 rejects it.
|
|
121
121
|
*
|
|
122
122
|
* Maps to: `-c model_reasoning_effort=<value>`
|
|
123
123
|
* @see https://platform.openai.com/docs/guides/reasoning
|
package/dist/index.js
CHANGED
|
@@ -108,7 +108,7 @@ var settingsSchema = z.object({
|
|
|
108
108
|
verbose: z.boolean().optional(),
|
|
109
109
|
logger: z.union([z.literal(false), loggerFunctionSchema]).optional(),
|
|
110
110
|
// NEW: Reasoning & Verbosity
|
|
111
|
-
reasoningEffort: z.enum(["minimal", "low", "medium", "high", "xhigh"]).optional(),
|
|
111
|
+
reasoningEffort: z.enum(["none", "minimal", "low", "medium", "high", "xhigh"]).optional(),
|
|
112
112
|
// Note: API rejects 'concise' and 'none' despite error messages claiming they're valid
|
|
113
113
|
reasoningSummary: z.enum(["auto", "detailed"]).optional(),
|
|
114
114
|
reasoningSummaryFormat: z.enum(["none", "experimental"]).optional(),
|
|
@@ -354,7 +354,7 @@ function isAuthenticationError(err) {
|
|
|
354
354
|
|
|
355
355
|
// src/codex-cli-language-model.ts
|
|
356
356
|
var codexCliProviderOptionsSchema = z.object({
|
|
357
|
-
reasoningEffort: z.enum(["minimal", "low", "medium", "high", "xhigh"]).optional(),
|
|
357
|
+
reasoningEffort: z.enum(["none", "minimal", "low", "medium", "high", "xhigh"]).optional(),
|
|
358
358
|
reasoningSummary: z.enum(["auto", "detailed"]).optional(),
|
|
359
359
|
reasoningSummaryFormat: z.enum(["none", "experimental"]).optional(),
|
|
360
360
|
textVerbosity: z.enum(["low", "medium", "high"]).optional(),
|
|
@@ -373,7 +373,13 @@ var codexCliProviderOptionsSchema = z.object({
|
|
|
373
373
|
rmcpClient: z.boolean().optional()
|
|
374
374
|
}).strict();
|
|
375
375
|
function resolveCodexPath(explicitPath, allowNpx) {
|
|
376
|
-
if (explicitPath)
|
|
376
|
+
if (explicitPath) {
|
|
377
|
+
const lower = explicitPath.toLowerCase();
|
|
378
|
+
if (lower.endsWith(".js") || lower.endsWith(".mjs") || lower.endsWith(".cjs")) {
|
|
379
|
+
return { cmd: "node", args: [explicitPath] };
|
|
380
|
+
}
|
|
381
|
+
return { cmd: explicitPath, args: [] };
|
|
382
|
+
}
|
|
377
383
|
try {
|
|
378
384
|
const req = createRequire(import.meta.url);
|
|
379
385
|
const pkgPath = req.resolve("@openai/codex/package.json");
|