crosscheck-mcp 0.2.25 → 0.2.27

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/embed.cjs CHANGED
@@ -71,7 +71,12 @@ function loadPricing(path12) {
71
71
  function modelPricing(pricing, provider, model) {
72
72
  const block = pricing[provider];
73
73
  if (!block || typeof block !== "object" || Array.isArray(block)) return null;
74
- const entry = block[model];
74
+ const table = block;
75
+ let entry = table[model];
76
+ if (!entry || typeof entry !== "object" || Array.isArray(entry)) {
77
+ const best = Object.keys(table).filter((k) => model.startsWith(k)).sort((a, b) => b.length - a.length)[0];
78
+ entry = best !== void 0 ? table[best] : void 0;
79
+ }
75
80
  if (!entry || typeof entry !== "object" || Array.isArray(entry)) return null;
76
81
  const e = entry;
77
82
  return {
@@ -428,6 +433,14 @@ async function acquireRateLimit(provider, deps) {
428
433
  // src/providers/anthropic.ts
429
434
  var ANTHROPIC_API_URL = "https://api.anthropic.com/v1/messages";
430
435
  var ANTHROPIC_VERSION_HEADER = "2023-06-01";
436
+ var ADAPTIVE_THINKING_PREFIXES = [
437
+ "claude-fable-5",
438
+ "claude-opus-5-5"
439
+ ];
440
+ function rejectsDisabledThinking(model) {
441
+ const m = model.toLowerCase();
442
+ return ADAPTIVE_THINKING_PREFIXES.some((p) => m.startsWith(p));
443
+ }
431
444
  var ANTHROPIC_STRUCTURED_TOOL_NAME = "structured_output";
432
445
  function applyPromptCaching(body, env = process.env) {
433
446
  const flag = (env["CROSSCHECK_ANTHROPIC_PROMPT_CACHE"] ?? "").trim();
@@ -472,7 +485,7 @@ function buildAnthropicRequest(opts) {
472
485
  }
473
486
  applyPromptCaching(body);
474
487
  if (isReasoningModel("anthropic", opts.model)) {
475
- if (opts.model.toLowerCase().startsWith("claude-fable-5")) {
488
+ if (rejectsDisabledThinking(opts.model)) {
476
489
  body.thinking = { type: "adaptive" };
477
490
  body.output_config = { effort: "low" };
478
491
  } else {
@@ -992,8 +1005,8 @@ async function sendOpenAICompatible(args) {
992
1005
 
993
1006
  // src/providers/registry.ts
994
1007
  var DEFAULT_MODELS = {
995
- anthropic: "claude-opus-5",
996
- openai: "gpt-5.6-sol",
1008
+ anthropic: "claude-opus-5-5",
1009
+ openai: "gpt-6-sol",
997
1010
  xai: "grok-4-latest",
998
1011
  mistral: "mistral-large-latest",
999
1012
  groq: "llama-3.3-70b-versatile",
@@ -1009,7 +1022,12 @@ var DEFAULT_FALLBACKS = {
1009
1022
  // about.
1010
1023
  openai: ["gpt-5"],
1011
1024
  // 3.8 Flash is recent enough that some projects won't have it yet.
1012
- gemini: ["gemini-3.1-pro-preview"]
1025
+ gemini: ["gemini-3.1-pro-preview"],
1026
+ // Opus 5.5 is new enough that an account could still be waiting on it.
1027
+ // Opus 5 is the same family one step back — and this chain is consulted
1028
+ // ONLY for a model-access failure, never for a bad key or a rate limit,
1029
+ // so it can't quietly downgrade anyone who simply hit a 429.
1030
+ anthropic: ["claude-opus-5"]
1013
1031
  };
1014
1032
  var MODEL_ENV_VARS = {
1015
1033
  anthropic: "ANTHROPIC_MODEL",
@@ -1134,7 +1152,7 @@ var import_zod = require("zod");
1134
1152
 
1135
1153
  // src/server-meta.ts
1136
1154
  var SERVER_NAME = "crosscheck-agent";
1137
- var SERVER_VERSION = true ? "0.2.25" : "0.0.0-dev";
1155
+ var SERVER_VERSION = true ? "0.2.27" : "0.0.0-dev";
1138
1156
 
1139
1157
  // src/tools/audit.ts
1140
1158
  var import_node_fs4 = require("fs");
@@ -2708,13 +2726,25 @@ function numberOrNull(v) {
2708
2726
  var import_node_perf_hooks = require("perf_hooks");
2709
2727
 
2710
2728
  // src/core/co-reason.ts
2711
- var CO_REASON_MODEL = "gpt-5.6-sol";
2729
+ var CO_REASON_MODEL = "gpt-6-sol";
2730
+ var CO_REASON_ALTERNATE = "gpt-6-astra";
2731
+ var LABELS = {
2732
+ "gpt-6-sol": "GPT-6 Sol",
2733
+ "gpt-6-astra": "GPT-6 Astra",
2734
+ "gpt-5.6-sol": "GPT-5.6 Sol"
2735
+ };
2736
+ function coReasonLabel(model) {
2737
+ return LABELS[model] ?? model;
2738
+ }
2739
+ var CO_REASON_LABEL = coReasonLabel(CO_REASON_MODEL);
2712
2740
  var CO_REASON_PROVIDER = "openai";
2713
- var CO_REASON_LABEL = "GPT-5.6";
2714
- function pickCoReasoner(providers, upgradeRequested) {
2741
+ function pickCoReasoner(providers, upgradeRequested, openAiSeatModel) {
2715
2742
  if (!upgradeRequested) return null;
2716
2743
  const base = providers[CO_REASON_PROVIDER];
2717
- return base ? retargetProvider(base, CO_REASON_MODEL) : null;
2744
+ if (!base) return null;
2745
+ const seat = openAiSeatModel ?? base.model;
2746
+ const model = seat === CO_REASON_MODEL ? CO_REASON_ALTERNATE : CO_REASON_MODEL;
2747
+ return retargetProvider(base, model);
2718
2748
  }
2719
2749
  async function coReasonThenInject(opts) {
2720
2750
  const { provider, messages, maxTokens } = opts;
@@ -2940,7 +2970,7 @@ function buildSuggestedUpgrade(toolName, assessment) {
2940
2970
  model: UPGRADE_MODEL,
2941
2971
  label: UPGRADE_LABEL,
2942
2972
  reason: assessment.reason,
2943
- how: `re-run \`${toolName}\` with reasoning:"max" (or upgrade:true) to route the lead reasoning seat to ${UPGRADE_LABEL}, and \u2014 when an OpenAI key is configured \u2014 add a GPT-5.6 second-opinion pass that ${UPGRADE_LABEL} weighs before finalizing. Other panel seats stay on their normal models.`
2973
+ how: `re-run \`${toolName}\` with reasoning:"max" (or upgrade:true) to route the lead reasoning seat to ${UPGRADE_LABEL}, and \u2014 when an OpenAI key is configured \u2014 add an OpenAI second-opinion pass that ${UPGRADE_LABEL} weighs before finalizing (the result names which model ran). Other panel seats stay on their normal models.`
2944
2974
  };
2945
2975
  }
2946
2976
 
@@ -3243,8 +3273,9 @@ ${rubricText}`;
3243
3273
  const upgradeRequested = isUpgradeRequested(args);
3244
3274
  const upgraded = upgradeRequested && opts.providers["anthropic"] !== void 0;
3245
3275
  const auditorForCall = upgraded ? retargetProvider(opts.providers["anthropic"], UPGRADE_MODEL) : auditor;
3276
+ const coProvider = pickCoReasoner(opts.providers, upgradeRequested);
3246
3277
  const coReason = await coReasonThenInject({
3247
- provider: pickCoReasoner(opts.providers, upgradeRequested),
3278
+ provider: coProvider,
3248
3279
  messages: msgs,
3249
3280
  maxTokens: 2048,
3250
3281
  purpose: "audit-coreason"
@@ -3328,7 +3359,7 @@ ${rubricText}`;
3328
3359
  model: UPGRADE_MODEL,
3329
3360
  label: UPGRADE_LABEL,
3330
3361
  seat: "auditor",
3331
- ...coReasoned ? { co_reasoner: { model: CO_REASON_MODEL, label: CO_REASON_LABEL } } : {}
3362
+ ...coReasoned ? { co_reasoner: { model: coProvider.model, label: coReasonLabel(coProvider.model) } } : {}
3332
3363
  };
3333
3364
  } else if (upgradeRequested) {
3334
3365
  result["reasoning_upgrade"] = {
@@ -4059,8 +4090,12 @@ var SUPER_MODELS = {
4059
4090
  // Fable 5.1 verified present on the account; 5 as the fallback for accounts
4060
4091
  // that haven't been granted 5.1 yet.
4061
4092
  anthropic: ["claude-fable-5-1", UPGRADE_MODEL],
4062
- // Astra when it exists; gpt-5.6 until then. See the note above.
4063
- openai: ["gpt-6-astra", CO_REASON_MODEL],
4093
+ // Astra is live (verified against the account's model list 2026-09-23).
4094
+ // The fallback is named explicitly rather than reusing CO_REASON_MODEL:
4095
+ // that constant means "OpenAI's top reasoning model" for the max-reasoning
4096
+ // co-reasoner, which is a different question from "what should super fall
4097
+ // back to". Sharing the symbol silently coupled two unrelated decisions.
4098
+ openai: ["gpt-6-astra", "gpt-6-sol"],
4064
4099
  // Explicitly left as-is per product decision. Note grok-4-latest is not in
4065
4100
  // xAI's published model list, but it resolves in practice — real panel calls
4066
4101
  // on it succeeded as recently as 2026-08-30 — so it is an unlisted alias
@@ -7024,8 +7059,9 @@ ${recombineSys}` : recombineSys },
7024
7059
  provider: synthProvider.name
7025
7060
  } }
7026
7061
  );
7062
+ const coProvider = pickCoReasoner(opts.providers, upgradeRequested);
7027
7063
  const coReason = await coReasonThenInject({
7028
- provider: pickCoReasoner(opts.providers, upgradeRequested),
7064
+ provider: coProvider,
7029
7065
  messages: recMsgs,
7030
7066
  maxTokens,
7031
7067
  purpose: "orchestrate-coreason"
@@ -7084,7 +7120,7 @@ ${recombineSys}` : recombineSys },
7084
7120
  model: UPGRADE_MODEL,
7085
7121
  label: UPGRADE_LABEL,
7086
7122
  seat: "recombine/synthesis",
7087
- ...coReasoned ? { co_reasoner: { model: CO_REASON_MODEL, label: CO_REASON_LABEL } } : {}
7123
+ ...coReasoned ? { co_reasoner: { model: coProvider.model, label: coReasonLabel(coProvider.model) } } : {}
7088
7124
  };
7089
7125
  } else if (upgradeRequested) {
7090
7126
  result["reasoning_upgrade"] = {
@@ -8430,8 +8466,9 @@ CRITIQUES:
8430
8466
  ${critiqueBlock}`
8431
8467
  }
8432
8468
  ];
8469
+ const coProvider = pickCoReasoner(opts.providers, upgradeRequested);
8433
8470
  const coReason = await coReasonThenInject({
8434
- provider: pickCoReasoner(opts.providers, upgradeRequested),
8471
+ provider: coProvider,
8435
8472
  messages: synthMessages,
8436
8473
  maxTokens,
8437
8474
  purpose: "coordinate-coreason"
@@ -8495,7 +8532,7 @@ ${critiqueBlock}`
8495
8532
  model: superRequested ? superPrimary("anthropic") ?? UPGRADE_MODEL : UPGRADE_MODEL,
8496
8533
  label: UPGRADE_LABEL,
8497
8534
  seat: "synthesizer",
8498
- ...coReasonAns ? { co_reasoner: { model: CO_REASON_MODEL, label: CO_REASON_LABEL } } : {}
8535
+ ...coReasonAns ? { co_reasoner: { model: coProvider.model, label: coReasonLabel(coProvider.model) } } : {}
8499
8536
  };
8500
8537
  } else if (upgradeRequested) {
8501
8538
  result["reasoning_upgrade"] = {
@@ -9217,6 +9254,7 @@ ${prior.body}` });
9217
9254
  let synthesisErrors = [];
9218
9255
  let personaMeta = null;
9219
9256
  let coReasoned = false;
9257
+ let coReasonerModel = null;
9220
9258
  if (moderator) {
9221
9259
  const synthProvider = superRequested && opts.providers["anthropic"] ? retargetForSuper(opts.providers["anthropic"]) : upgraded ? retargetProvider(opts.providers["anthropic"], UPGRADE_MODEL) : moderator;
9222
9260
  const condensed = buildModeratorTranscript(transcript);
@@ -9244,13 +9282,16 @@ TRANSCRIPT:
9244
9282
  ${condensed}`
9245
9283
  }
9246
9284
  ];
9285
+ const openAiSeat = selected.find((p) => p.name === "openai")?.model;
9286
+ const coProvider = pickCoReasoner(opts.providers, upgradeRequested, openAiSeat);
9247
9287
  const coReason = await coReasonThenInject({
9248
- provider: pickCoReasoner(opts.providers, upgradeRequested),
9288
+ provider: coProvider,
9249
9289
  messages: synthMessages,
9250
9290
  maxTokens,
9251
9291
  purpose: "debate-coreason"
9252
9292
  });
9253
9293
  synthMessages = coReason.messages;
9294
+ coReasonerModel = coProvider?.model ?? null;
9254
9295
  if (coReason.answer) extraAnswers.push(coReason.answer);
9255
9296
  coReasoned = coReason.answer !== null;
9256
9297
  if (structuredOpt) {
@@ -9309,7 +9350,7 @@ ${condensed}`
9309
9350
  model: superRequested ? superPrimary("anthropic") ?? UPGRADE_MODEL : UPGRADE_MODEL,
9310
9351
  label: UPGRADE_LABEL,
9311
9352
  seat: "moderator synthesis",
9312
- ...coReasoned ? { co_reasoner: { model: CO_REASON_MODEL, label: CO_REASON_LABEL } } : {}
9353
+ ...coReasoned && coReasonerModel ? { co_reasoner: { model: coReasonerModel, label: coReasonLabel(coReasonerModel) } } : {}
9313
9354
  };
9314
9355
  } else if (upgradeRequested) {
9315
9356
  result["reasoning_upgrade"] = {
@@ -11333,7 +11374,7 @@ Re-emit the FULL solution. No commentary.`
11333
11374
  model: UPGRADE_MODEL,
11334
11375
  label: UPGRADE_LABEL,
11335
11376
  seat: "solver",
11336
- ...coReasoned ? { co_reasoner: { model: CO_REASON_MODEL, label: CO_REASON_LABEL } } : {}
11377
+ ...coReasoned ? { co_reasoner: { model: coProvider.model, label: coReasonLabel(coProvider.model) } } : {}
11337
11378
  };
11338
11379
  } else if (upgradeRequested) {
11339
11380
  result["reasoning_upgrade"] = {
@@ -11622,7 +11663,7 @@ var CHECK_INTERVAL_SECONDS = 3 * 24 * 60 * 60;
11622
11663
  var DEFAULT_PACKAGE = "crosscheck-cli";
11623
11664
  var FETCH_TIMEOUT_MS = 3e3;
11624
11665
  function engineVersion() {
11625
- return true ? "0.2.25" : "0.0.0-dev";
11666
+ return true ? "0.2.27" : "0.0.0-dev";
11626
11667
  }
11627
11668
  function defaultUpdateCachePath() {
11628
11669
  const base = process.env["CROSSCHECK_DATA_DIR"] || import_node_path12.default.join(import_node_os2.default.homedir() || import_node_os2.default.tmpdir(), ".crosscheck");
@@ -13396,11 +13437,12 @@ function usageOf(answer) {
13396
13437
  const total = num("total_tokens") || prompt + completion;
13397
13438
  if (prompt === 0 && completion === 0 && total === 0) return null;
13398
13439
  const rawCost = rec["cost_usd"];
13440
+ const unpriced = rec["estimated"] === true;
13399
13441
  return {
13400
13442
  promptTokens: prompt,
13401
13443
  completionTokens: completion,
13402
13444
  totalTokens: total,
13403
- costUsd: typeof rawCost === "number" && Number.isFinite(rawCost) ? rawCost : null
13445
+ costUsd: !unpriced && typeof rawCost === "number" && Number.isFinite(rawCost) ? rawCost : null
13404
13446
  };
13405
13447
  }
13406
13448
  function textOf(answer) {