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.js CHANGED
@@ -32,7 +32,12 @@ function loadPricing(path12) {
32
32
  function modelPricing(pricing, provider, model) {
33
33
  const block = pricing[provider];
34
34
  if (!block || typeof block !== "object" || Array.isArray(block)) return null;
35
- const entry = block[model];
35
+ const table = block;
36
+ let entry = table[model];
37
+ if (!entry || typeof entry !== "object" || Array.isArray(entry)) {
38
+ const best = Object.keys(table).filter((k) => model.startsWith(k)).sort((a, b) => b.length - a.length)[0];
39
+ entry = best !== void 0 ? table[best] : void 0;
40
+ }
36
41
  if (!entry || typeof entry !== "object" || Array.isArray(entry)) return null;
37
42
  const e = entry;
38
43
  return {
@@ -389,6 +394,14 @@ async function acquireRateLimit(provider, deps) {
389
394
  // src/providers/anthropic.ts
390
395
  var ANTHROPIC_API_URL = "https://api.anthropic.com/v1/messages";
391
396
  var ANTHROPIC_VERSION_HEADER = "2023-06-01";
397
+ var ADAPTIVE_THINKING_PREFIXES = [
398
+ "claude-fable-5",
399
+ "claude-opus-5-5"
400
+ ];
401
+ function rejectsDisabledThinking(model) {
402
+ const m = model.toLowerCase();
403
+ return ADAPTIVE_THINKING_PREFIXES.some((p) => m.startsWith(p));
404
+ }
392
405
  var ANTHROPIC_STRUCTURED_TOOL_NAME = "structured_output";
393
406
  function applyPromptCaching(body, env = process.env) {
394
407
  const flag = (env["CROSSCHECK_ANTHROPIC_PROMPT_CACHE"] ?? "").trim();
@@ -433,7 +446,7 @@ function buildAnthropicRequest(opts) {
433
446
  }
434
447
  applyPromptCaching(body);
435
448
  if (isReasoningModel("anthropic", opts.model)) {
436
- if (opts.model.toLowerCase().startsWith("claude-fable-5")) {
449
+ if (rejectsDisabledThinking(opts.model)) {
437
450
  body.thinking = { type: "adaptive" };
438
451
  body.output_config = { effort: "low" };
439
452
  } else {
@@ -953,8 +966,8 @@ async function sendOpenAICompatible(args) {
953
966
 
954
967
  // src/providers/registry.ts
955
968
  var DEFAULT_MODELS = {
956
- anthropic: "claude-opus-5",
957
- openai: "gpt-5.6-sol",
969
+ anthropic: "claude-opus-5-5",
970
+ openai: "gpt-6-sol",
958
971
  xai: "grok-4-latest",
959
972
  mistral: "mistral-large-latest",
960
973
  groq: "llama-3.3-70b-versatile",
@@ -970,7 +983,12 @@ var DEFAULT_FALLBACKS = {
970
983
  // about.
971
984
  openai: ["gpt-5"],
972
985
  // 3.8 Flash is recent enough that some projects won't have it yet.
973
- gemini: ["gemini-3.1-pro-preview"]
986
+ gemini: ["gemini-3.1-pro-preview"],
987
+ // Opus 5.5 is new enough that an account could still be waiting on it.
988
+ // Opus 5 is the same family one step back — and this chain is consulted
989
+ // ONLY for a model-access failure, never for a bad key or a rate limit,
990
+ // so it can't quietly downgrade anyone who simply hit a 429.
991
+ anthropic: ["claude-opus-5"]
974
992
  };
975
993
  var MODEL_ENV_VARS = {
976
994
  anthropic: "ANTHROPIC_MODEL",
@@ -1095,7 +1113,7 @@ import { z } from "zod";
1095
1113
 
1096
1114
  // src/server-meta.ts
1097
1115
  var SERVER_NAME = "crosscheck-agent";
1098
- var SERVER_VERSION = true ? "0.2.25" : "0.0.0-dev";
1116
+ var SERVER_VERSION = true ? "0.2.27" : "0.0.0-dev";
1099
1117
 
1100
1118
  // src/tools/audit.ts
1101
1119
  import { readdirSync, readFileSync as readFileSync3, statSync } from "fs";
@@ -2669,13 +2687,25 @@ function numberOrNull(v) {
2669
2687
  import { performance as performance2 } from "perf_hooks";
2670
2688
 
2671
2689
  // src/core/co-reason.ts
2672
- var CO_REASON_MODEL = "gpt-5.6-sol";
2690
+ var CO_REASON_MODEL = "gpt-6-sol";
2691
+ var CO_REASON_ALTERNATE = "gpt-6-astra";
2692
+ var LABELS = {
2693
+ "gpt-6-sol": "GPT-6 Sol",
2694
+ "gpt-6-astra": "GPT-6 Astra",
2695
+ "gpt-5.6-sol": "GPT-5.6 Sol"
2696
+ };
2697
+ function coReasonLabel(model) {
2698
+ return LABELS[model] ?? model;
2699
+ }
2700
+ var CO_REASON_LABEL = coReasonLabel(CO_REASON_MODEL);
2673
2701
  var CO_REASON_PROVIDER = "openai";
2674
- var CO_REASON_LABEL = "GPT-5.6";
2675
- function pickCoReasoner(providers, upgradeRequested) {
2702
+ function pickCoReasoner(providers, upgradeRequested, openAiSeatModel) {
2676
2703
  if (!upgradeRequested) return null;
2677
2704
  const base = providers[CO_REASON_PROVIDER];
2678
- return base ? retargetProvider(base, CO_REASON_MODEL) : null;
2705
+ if (!base) return null;
2706
+ const seat = openAiSeatModel ?? base.model;
2707
+ const model = seat === CO_REASON_MODEL ? CO_REASON_ALTERNATE : CO_REASON_MODEL;
2708
+ return retargetProvider(base, model);
2679
2709
  }
2680
2710
  async function coReasonThenInject(opts) {
2681
2711
  const { provider, messages, maxTokens } = opts;
@@ -2901,7 +2931,7 @@ function buildSuggestedUpgrade(toolName, assessment) {
2901
2931
  model: UPGRADE_MODEL,
2902
2932
  label: UPGRADE_LABEL,
2903
2933
  reason: assessment.reason,
2904
- 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.`
2934
+ 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.`
2905
2935
  };
2906
2936
  }
2907
2937
 
@@ -3204,8 +3234,9 @@ ${rubricText}`;
3204
3234
  const upgradeRequested = isUpgradeRequested(args);
3205
3235
  const upgraded = upgradeRequested && opts.providers["anthropic"] !== void 0;
3206
3236
  const auditorForCall = upgraded ? retargetProvider(opts.providers["anthropic"], UPGRADE_MODEL) : auditor;
3237
+ const coProvider = pickCoReasoner(opts.providers, upgradeRequested);
3207
3238
  const coReason = await coReasonThenInject({
3208
- provider: pickCoReasoner(opts.providers, upgradeRequested),
3239
+ provider: coProvider,
3209
3240
  messages: msgs,
3210
3241
  maxTokens: 2048,
3211
3242
  purpose: "audit-coreason"
@@ -3289,7 +3320,7 @@ ${rubricText}`;
3289
3320
  model: UPGRADE_MODEL,
3290
3321
  label: UPGRADE_LABEL,
3291
3322
  seat: "auditor",
3292
- ...coReasoned ? { co_reasoner: { model: CO_REASON_MODEL, label: CO_REASON_LABEL } } : {}
3323
+ ...coReasoned ? { co_reasoner: { model: coProvider.model, label: coReasonLabel(coProvider.model) } } : {}
3293
3324
  };
3294
3325
  } else if (upgradeRequested) {
3295
3326
  result["reasoning_upgrade"] = {
@@ -4020,8 +4051,12 @@ var SUPER_MODELS = {
4020
4051
  // Fable 5.1 verified present on the account; 5 as the fallback for accounts
4021
4052
  // that haven't been granted 5.1 yet.
4022
4053
  anthropic: ["claude-fable-5-1", UPGRADE_MODEL],
4023
- // Astra when it exists; gpt-5.6 until then. See the note above.
4024
- openai: ["gpt-6-astra", CO_REASON_MODEL],
4054
+ // Astra is live (verified against the account's model list 2026-09-23).
4055
+ // The fallback is named explicitly rather than reusing CO_REASON_MODEL:
4056
+ // that constant means "OpenAI's top reasoning model" for the max-reasoning
4057
+ // co-reasoner, which is a different question from "what should super fall
4058
+ // back to". Sharing the symbol silently coupled two unrelated decisions.
4059
+ openai: ["gpt-6-astra", "gpt-6-sol"],
4025
4060
  // Explicitly left as-is per product decision. Note grok-4-latest is not in
4026
4061
  // xAI's published model list, but it resolves in practice — real panel calls
4027
4062
  // on it succeeded as recently as 2026-08-30 — so it is an unlisted alias
@@ -7002,8 +7037,9 @@ ${recombineSys}` : recombineSys },
7002
7037
  provider: synthProvider.name
7003
7038
  } }
7004
7039
  );
7040
+ const coProvider = pickCoReasoner(opts.providers, upgradeRequested);
7005
7041
  const coReason = await coReasonThenInject({
7006
- provider: pickCoReasoner(opts.providers, upgradeRequested),
7042
+ provider: coProvider,
7007
7043
  messages: recMsgs,
7008
7044
  maxTokens,
7009
7045
  purpose: "orchestrate-coreason"
@@ -7062,7 +7098,7 @@ ${recombineSys}` : recombineSys },
7062
7098
  model: UPGRADE_MODEL,
7063
7099
  label: UPGRADE_LABEL,
7064
7100
  seat: "recombine/synthesis",
7065
- ...coReasoned ? { co_reasoner: { model: CO_REASON_MODEL, label: CO_REASON_LABEL } } : {}
7101
+ ...coReasoned ? { co_reasoner: { model: coProvider.model, label: coReasonLabel(coProvider.model) } } : {}
7066
7102
  };
7067
7103
  } else if (upgradeRequested) {
7068
7104
  result["reasoning_upgrade"] = {
@@ -8408,8 +8444,9 @@ CRITIQUES:
8408
8444
  ${critiqueBlock}`
8409
8445
  }
8410
8446
  ];
8447
+ const coProvider = pickCoReasoner(opts.providers, upgradeRequested);
8411
8448
  const coReason = await coReasonThenInject({
8412
- provider: pickCoReasoner(opts.providers, upgradeRequested),
8449
+ provider: coProvider,
8413
8450
  messages: synthMessages,
8414
8451
  maxTokens,
8415
8452
  purpose: "coordinate-coreason"
@@ -8473,7 +8510,7 @@ ${critiqueBlock}`
8473
8510
  model: superRequested ? superPrimary("anthropic") ?? UPGRADE_MODEL : UPGRADE_MODEL,
8474
8511
  label: UPGRADE_LABEL,
8475
8512
  seat: "synthesizer",
8476
- ...coReasonAns ? { co_reasoner: { model: CO_REASON_MODEL, label: CO_REASON_LABEL } } : {}
8513
+ ...coReasonAns ? { co_reasoner: { model: coProvider.model, label: coReasonLabel(coProvider.model) } } : {}
8477
8514
  };
8478
8515
  } else if (upgradeRequested) {
8479
8516
  result["reasoning_upgrade"] = {
@@ -9195,6 +9232,7 @@ ${prior.body}` });
9195
9232
  let synthesisErrors = [];
9196
9233
  let personaMeta = null;
9197
9234
  let coReasoned = false;
9235
+ let coReasonerModel = null;
9198
9236
  if (moderator) {
9199
9237
  const synthProvider = superRequested && opts.providers["anthropic"] ? retargetForSuper(opts.providers["anthropic"]) : upgraded ? retargetProvider(opts.providers["anthropic"], UPGRADE_MODEL) : moderator;
9200
9238
  const condensed = buildModeratorTranscript(transcript);
@@ -9222,13 +9260,16 @@ TRANSCRIPT:
9222
9260
  ${condensed}`
9223
9261
  }
9224
9262
  ];
9263
+ const openAiSeat = selected.find((p) => p.name === "openai")?.model;
9264
+ const coProvider = pickCoReasoner(opts.providers, upgradeRequested, openAiSeat);
9225
9265
  const coReason = await coReasonThenInject({
9226
- provider: pickCoReasoner(opts.providers, upgradeRequested),
9266
+ provider: coProvider,
9227
9267
  messages: synthMessages,
9228
9268
  maxTokens,
9229
9269
  purpose: "debate-coreason"
9230
9270
  });
9231
9271
  synthMessages = coReason.messages;
9272
+ coReasonerModel = coProvider?.model ?? null;
9232
9273
  if (coReason.answer) extraAnswers.push(coReason.answer);
9233
9274
  coReasoned = coReason.answer !== null;
9234
9275
  if (structuredOpt) {
@@ -9287,7 +9328,7 @@ ${condensed}`
9287
9328
  model: superRequested ? superPrimary("anthropic") ?? UPGRADE_MODEL : UPGRADE_MODEL,
9288
9329
  label: UPGRADE_LABEL,
9289
9330
  seat: "moderator synthesis",
9290
- ...coReasoned ? { co_reasoner: { model: CO_REASON_MODEL, label: CO_REASON_LABEL } } : {}
9331
+ ...coReasoned && coReasonerModel ? { co_reasoner: { model: coReasonerModel, label: coReasonLabel(coReasonerModel) } } : {}
9291
9332
  };
9292
9333
  } else if (upgradeRequested) {
9293
9334
  result["reasoning_upgrade"] = {
@@ -11311,7 +11352,7 @@ Re-emit the FULL solution. No commentary.`
11311
11352
  model: UPGRADE_MODEL,
11312
11353
  label: UPGRADE_LABEL,
11313
11354
  seat: "solver",
11314
- ...coReasoned ? { co_reasoner: { model: CO_REASON_MODEL, label: CO_REASON_LABEL } } : {}
11355
+ ...coReasoned ? { co_reasoner: { model: coProvider.model, label: coReasonLabel(coProvider.model) } } : {}
11315
11356
  };
11316
11357
  } else if (upgradeRequested) {
11317
11358
  result["reasoning_upgrade"] = {
@@ -11600,7 +11641,7 @@ var CHECK_INTERVAL_SECONDS = 3 * 24 * 60 * 60;
11600
11641
  var DEFAULT_PACKAGE = "crosscheck-cli";
11601
11642
  var FETCH_TIMEOUT_MS = 3e3;
11602
11643
  function engineVersion() {
11603
- return true ? "0.2.25" : "0.0.0-dev";
11644
+ return true ? "0.2.27" : "0.0.0-dev";
11604
11645
  }
11605
11646
  function defaultUpdateCachePath() {
11606
11647
  const base = process.env["CROSSCHECK_DATA_DIR"] || path9.join(os.homedir() || os.tmpdir(), ".crosscheck");
@@ -13374,11 +13415,12 @@ function usageOf(answer) {
13374
13415
  const total = num("total_tokens") || prompt + completion;
13375
13416
  if (prompt === 0 && completion === 0 && total === 0) return null;
13376
13417
  const rawCost = rec["cost_usd"];
13418
+ const unpriced = rec["estimated"] === true;
13377
13419
  return {
13378
13420
  promptTokens: prompt,
13379
13421
  completionTokens: completion,
13380
13422
  totalTokens: total,
13381
- costUsd: typeof rawCost === "number" && Number.isFinite(rawCost) ? rawCost : null
13423
+ costUsd: !unpriced && typeof rawCost === "number" && Number.isFinite(rawCost) ? rawCost : null
13382
13424
  };
13383
13425
  }
13384
13426
  function textOf(answer) {