@yhong91/cpac 0.1.44 → 0.1.45

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.
Files changed (2) hide show
  1. package/dist/config.js +11 -9
  2. package/package.json +1 -1
package/dist/config.js CHANGED
@@ -315,16 +315,18 @@ function catalogDocument(bytes) {
315
315
  throw new CPACError("invalid CPA catalog");
316
316
  }
317
317
  }
318
- // Codex parses input_modalities as a closed enum. One extra value (e.g. "video")
319
- // rejects the entire catalog. Keep unknown fields, but coerce this one.
318
+ // Codex rejects the catalog on extra input_modalities values or a missing
319
+ // supported_reasoning_levels field. Keep unknown fields; coerce these two.
320
320
  function sanitizeModelModalities(model) {
321
- if (!("input_modalities" in model))
322
- return;
323
- const raw = model.input_modalities;
324
- const accepted = Array.isArray(raw)
325
- ? raw.filter((value) => value === "text" || value === "image" || value === "audio")
326
- : [];
327
- model.input_modalities = accepted.length > 0 ? accepted : ["text"];
321
+ if ("input_modalities" in model) {
322
+ const raw = model.input_modalities;
323
+ const accepted = Array.isArray(raw)
324
+ ? raw.filter((value) => value === "text" || value === "image" || value === "audio")
325
+ : [];
326
+ model.input_modalities = accepted.length > 0 ? accepted : ["text"];
327
+ }
328
+ if (!Array.isArray(model.supported_reasoning_levels))
329
+ model.supported_reasoning_levels = [];
328
330
  }
329
331
  export function sanitizeCatalogModalities(bytes) {
330
332
  const document = catalogDocument(bytes);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yhong91/cpac",
3
- "version": "0.1.44",
3
+ "version": "0.1.45",
4
4
  "description": "Connect Codex and Claude Code to a remote CLIProxyAPI gateway",
5
5
  "type": "module",
6
6
  "bin": {