@yhong91/cpac 0.2.9 → 0.2.10

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/agents.js +17 -4
  2. package/package.json +1 -1
package/dist/agents.js CHANGED
@@ -451,10 +451,20 @@ function syncTargetIds(config, requested, all) {
451
451
  }
452
452
  return selected.map((target) => target.id);
453
453
  }
454
+ const MODEL_CHANGE_FIELDS = [
455
+ "display_name",
456
+ "context_window",
457
+ "max_context_window",
458
+ "max_tokens",
459
+ "max_output_tokens",
460
+ "input_modalities",
461
+ "supported_reasoning_levels",
462
+ "default_reasoning_level",
463
+ ];
454
464
  function logModelChanges(previous, next) {
455
465
  const { added, removed } = diffModelSlugs(previous.map((model) => model.slug), next.map((model) => model.slug));
456
466
  const addedSet = new Set(added);
457
- const previousJson = new Map(previous.map((model) => [model.slug, JSON.stringify(model)]));
467
+ const previousBySlug = new Map(previous.map((model) => [model.slug, model]));
458
468
  for (const slug of added)
459
469
  console.log(`+ ${slug}`);
460
470
  for (const slug of removed)
@@ -462,9 +472,12 @@ function logModelChanges(previous, next) {
462
472
  for (const model of next) {
463
473
  if (addedSet.has(model.slug))
464
474
  continue;
465
- const before = previousJson.get(model.slug);
466
- if (before !== undefined && before !== JSON.stringify(model))
467
- console.log(`~ ${model.slug}`);
475
+ const before = previousBySlug.get(model.slug);
476
+ if (!before)
477
+ continue;
478
+ const fields = MODEL_CHANGE_FIELDS.filter((key) => JSON.stringify(before[key] ?? null) !== JSON.stringify(model[key] ?? null));
479
+ if (fields.length > 0)
480
+ console.log(`~ ${model.slug} ${fields.join(" ")}`);
468
481
  }
469
482
  }
470
483
  export async function runSync(config, requested, options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yhong91/cpac",
3
- "version": "0.2.9",
3
+ "version": "0.2.10",
4
4
  "description": "Connect Codex and Claude Code to a remote CLIProxyAPI gateway",
5
5
  "type": "module",
6
6
  "bin": {