crosscheck-mcp 0.2.23 → 0.2.25

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.
@@ -1306,7 +1306,7 @@ init_cjs_shims();
1306
1306
  var CREDIT_RE = /insufficient|no\s+credit|credits?|billing|quota|payment\s*required|exceeded your current quota|not\s+enough|fund|no active subscription|spend limit/i;
1307
1307
  function isCreditsFailure(status, bodyText) {
1308
1308
  if (status === 402) return true;
1309
- if (status === 401 || status === 403 || status === 429 || status === 400) {
1309
+ if (status === 401 || status === 403 || status === 400) {
1310
1310
  return CREDIT_RE.test(bodyText);
1311
1311
  }
1312
1312
  return false;
@@ -1343,7 +1343,7 @@ function httpFailureToProviderError(provider, status, bodyText, retryAfterS, mod
1343
1343
  if (status === 429) {
1344
1344
  return new ProviderError(
1345
1345
  "rate_limit",
1346
- `${provider}: rate limited (HTTP 429). Detail: ${detail}`,
1346
+ `${provider}: rate limited (HTTP 429) \u2014 retrying with backoff. Note that some providers word a rate limit as a balance problem; check your balance before topping up. Detail: ${detail}`,
1347
1347
  { status, ...retryAfterS !== void 0 ? { retryAfterS } : {} }
1348
1348
  );
1349
1349
  }
@@ -2133,10 +2133,20 @@ function fallbackModelsFor(env, provider) {
2133
2133
  if (pinned && pinned !== DEFAULT_MODELS[provider]) return [];
2134
2134
  return DEFAULT_FALLBACKS[provider] ?? [];
2135
2135
  }
2136
+ var DEFAULT_EXCLUDED_PROVIDERS = ["mistral", "groq"];
2137
+ function excludedProviders(env) {
2138
+ const parse = (v) => (v ?? "").split(",").map((x) => x.trim().toLowerCase()).filter((x) => x !== "");
2139
+ const excluded = new Set(
2140
+ parse(env["CROSSCHECK_EXCLUDE_PROVIDERS"]).length > 0 ? parse(env["CROSSCHECK_EXCLUDE_PROVIDERS"]) : DEFAULT_EXCLUDED_PROVIDERS
2141
+ );
2142
+ for (const name of parse(env["CROSSCHECK_ENABLE_PROVIDERS"])) excluded.delete(name);
2143
+ return excluded;
2144
+ }
2136
2145
  function buildProviders(opts) {
2137
2146
  const out = {};
2147
+ const excluded = excludedProviders(opts.env);
2138
2148
  const anthropicKey = opts.env["ANTHROPIC_API_KEY"];
2139
- if (anthropicKey) {
2149
+ if (anthropicKey && !excluded.has("anthropic")) {
2140
2150
  const model = opts.env["ANTHROPIC_MODEL"] ?? DEFAULT_MODELS.anthropic;
2141
2151
  out["anthropic"] = makeAnthropicProvider(model, anthropicKey, opts, fallbackModelsFor(opts.env, "anthropic"));
2142
2152
  }
@@ -2152,11 +2162,12 @@ function buildProviders(opts) {
2152
2162
  for (const s of openAiCompatSpec) {
2153
2163
  const apiKey = opts.env[s.keyEnv];
2154
2164
  if (!apiKey) continue;
2165
+ if (excluded.has(s.name)) continue;
2155
2166
  const model = opts.env[s.modelEnv] ?? s.defaultModel;
2156
2167
  out[s.name] = makeOpenAICompatibleProvider(s.name, model, apiKey, opts, fallbackModelsFor(opts.env, s.name));
2157
2168
  }
2158
2169
  const geminiKey = opts.env["GEMINI_API_KEY"];
2159
- if (geminiKey) {
2170
+ if (geminiKey && !excluded.has("gemini")) {
2160
2171
  const model = opts.env["GEMINI_MODEL"] ?? DEFAULT_MODELS.gemini;
2161
2172
  out["gemini"] = makeGeminiProvider(model, geminiKey, opts, fallbackModelsFor(opts.env, "gemini"));
2162
2173
  }
@@ -2352,7 +2363,7 @@ var import_zod = require("zod");
2352
2363
  // src/server-meta.ts
2353
2364
  init_cjs_shims();
2354
2365
  var SERVER_NAME = "crosscheck-agent";
2355
- var SERVER_VERSION = true ? "0.2.23" : "0.0.0-dev";
2366
+ var SERVER_VERSION = true ? "0.2.25" : "0.0.0-dev";
2356
2367
 
2357
2368
  // src/tools/audit.ts
2358
2369
  init_cjs_shims();
@@ -6135,11 +6146,20 @@ ${ctxBody}` });
6135
6146
  });
6136
6147
  };
6137
6148
  const onAnswer = opts.onAnswer;
6138
- const workerCall = onAnswer ? async (p) => {
6149
+ const onPanelistStart = opts.onPanelistStart;
6150
+ const workerCall = onAnswer || onPanelistStart ? async (p) => {
6151
+ if (onPanelistStart) {
6152
+ try {
6153
+ onPanelistStart(p.name, p.model);
6154
+ } catch {
6155
+ }
6156
+ }
6139
6157
  const answer = await dispatchOne(p);
6140
- try {
6141
- onAnswer(answer, p.name);
6142
- } catch {
6158
+ if (onAnswer) {
6159
+ try {
6160
+ onAnswer(answer, p.name);
6161
+ } catch {
6162
+ }
6143
6163
  }
6144
6164
  return answer;
6145
6165
  } : dispatchOne;
@@ -10451,6 +10471,12 @@ ${prior.body}` });
10451
10471
  content: `This is round ${rnd} of ${maxRounds}. Reply for this round.`
10452
10472
  });
10453
10473
  for (const p of selected) {
10474
+ if (opts.onPanelistStart) {
10475
+ try {
10476
+ opts.onPanelistStart(p.name, p.model, rnd);
10477
+ } catch {
10478
+ }
10479
+ }
10454
10480
  const entry = await callPanelist(p, roundMessages);
10455
10481
  const withRound = { ...entry, round: rnd };
10456
10482
  transcript.push(withRound);
@@ -12914,7 +12940,7 @@ var CHECK_INTERVAL_SECONDS = 3 * 24 * 60 * 60;
12914
12940
  var DEFAULT_PACKAGE = "crosscheck-cli";
12915
12941
  var FETCH_TIMEOUT_MS = 3e3;
12916
12942
  function engineVersion() {
12917
- return true ? "0.2.23" : "0.0.0-dev";
12943
+ return true ? "0.2.25" : "0.0.0-dev";
12918
12944
  }
12919
12945
  function defaultUpdateCachePath() {
12920
12946
  const base = process.env["CROSSCHECK_DATA_DIR"] || import_node_path13.default.join(import_node_os2.default.homedir() || import_node_os2.default.tmpdir(), ".crosscheck");