crosscheck-mcp 0.2.29 → 0.2.30

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.
@@ -578,6 +578,11 @@ function reasoningSharesOutputBudget(provider) {
578
578
  }
579
579
 
580
580
  // src/providers/types.ts
581
+ var IMAGE_MEDIA_TYPES = ["image/png", "image/jpeg", "image/webp", "image/gif"];
582
+ function imagesOf(m) {
583
+ if (m.role !== "user" || !Array.isArray(m.images)) return [];
584
+ return m.images.filter((i) => Boolean(i) && typeof i.data === "string" && i.data.length > 0 && IMAGE_MEDIA_TYPES.includes(i.mediaType));
585
+ }
581
586
  var ProviderError = class extends Error {
582
587
  name = "ProviderError";
583
588
  kind;
@@ -966,7 +971,12 @@ function buildAnthropicRequest(opts) {
966
971
  }
967
972
  continue;
968
973
  }
969
- convo.push({ role: m.role, content: typeof m.content === "string" ? m.content : "" });
974
+ const text = typeof m.content === "string" ? m.content : "";
975
+ const images = imagesOf(m);
976
+ convo.push(images.length ? { role: m.role, content: [
977
+ ...images.map((i) => ({ type: "image", source: { type: "base64", media_type: i.mediaType, data: i.data } })),
978
+ { type: "text", text }
979
+ ] } : { role: m.role, content: text });
970
980
  }
971
981
  const body = {
972
982
  model: opts.model,
@@ -1206,7 +1216,10 @@ function buildGeminiRequest(opts) {
1206
1216
  const role = m.role === "user" ? "user" : "model";
1207
1217
  contents.push({
1208
1218
  role,
1209
- parts: [{ text: typeof m.content === "string" ? m.content : "" }]
1219
+ parts: [
1220
+ ...imagesOf(m).map((i) => ({ inline_data: { mime_type: i.mediaType, data: i.data } })),
1221
+ { text: typeof m.content === "string" ? m.content : "" }
1222
+ ]
1210
1223
  });
1211
1224
  }
1212
1225
  const body = {
@@ -1374,10 +1387,11 @@ function supportsNativeJsonSchema(provider, model) {
1374
1387
  return true;
1375
1388
  }
1376
1389
  function buildOpenAICompatibleRequest(opts) {
1377
- const msgs = opts.messages.map((m) => ({
1378
- role: m.role,
1379
- content: typeof m.content === "string" ? m.content : ""
1380
- }));
1390
+ const msgs = opts.messages.map((m) => {
1391
+ const text = typeof m.content === "string" ? m.content : "";
1392
+ const images = imagesOf(m);
1393
+ return images.length ? { role: m.role, content: [{ type: "text", text }, ...images.map((i) => ({ type: "image_url", image_url: { url: `data:${i.mediaType};base64,${i.data}` } }))] } : { role: m.role, content: text };
1394
+ });
1381
1395
  const body = {
1382
1396
  model: opts.model,
1383
1397
  messages: msgs
@@ -1690,7 +1704,7 @@ import { z } from "zod";
1690
1704
 
1691
1705
  // src/server-meta.ts
1692
1706
  var SERVER_NAME = "crosscheck-agent";
1693
- var SERVER_VERSION = true ? "0.2.29" : "0.0.0-dev";
1707
+ var SERVER_VERSION = true ? "0.2.30" : "0.0.0-dev";
1694
1708
 
1695
1709
  // src/tools/audit.ts
1696
1710
  import { readdirSync, readFileSync as readFileSync3, statSync } from "fs";
@@ -4654,6 +4668,7 @@ async function pickAutoPanel(storage, purpose, n, providers, allowlist) {
4654
4668
  }
4655
4669
 
4656
4670
  // src/core/super-mode.ts
4671
+ import { AsyncLocalStorage } from "async_hooks";
4657
4672
  var SUPER_MODELS = {
4658
4673
  // Fable 5.1 verified present on the account; 5 as the fallback for accounts
4659
4674
  // that haven't been granted 5.1 yet.
@@ -4696,7 +4711,9 @@ function parseChain(v) {
4696
4711
  }
4697
4712
  return out;
4698
4713
  }
4699
- function superChainFor(provider, env = process.env) {
4714
+ var superEnvStore = new AsyncLocalStorage();
4715
+ var currentEnv = () => superEnvStore.getStore() ?? process.env;
4716
+ function superChainFor(provider, env = currentEnv()) {
4700
4717
  const varName = SUPER_ENV_VARS[provider];
4701
4718
  const user = varName ? parseChain(env[varName]) : [];
4702
4719
  if (user.length > 0) {
@@ -4705,14 +4722,14 @@ function superChainFor(provider, env = process.env) {
4705
4722
  }
4706
4723
  return SUPER_MODELS[provider] ?? [];
4707
4724
  }
4708
- function superPrimary(provider, env = process.env) {
4725
+ function superPrimary(provider, env = currentEnv()) {
4709
4726
  return superChainFor(provider, env)[0];
4710
4727
  }
4711
4728
  var SUPER_PROVIDER_NAMES = Object.keys(SUPER_MODELS);
4712
4729
  function isSuperRequested(args) {
4713
4730
  return args["super"] === true;
4714
4731
  }
4715
- function retargetForSuper(p, env = process.env) {
4732
+ function retargetForSuper(p, env = currentEnv()) {
4716
4733
  const chain = superChainFor(p.name, env);
4717
4734
  if (chain.length === 0) return p;
4718
4735
  const [primary, ...fallbacks] = chain;
@@ -6790,9 +6807,9 @@ import path6 from "path";
6790
6807
  import { performance as performance7 } from "perf_hooks";
6791
6808
 
6792
6809
  // src/core/progress.ts
6793
- import { AsyncLocalStorage } from "async_hooks";
6810
+ import { AsyncLocalStorage as AsyncLocalStorage2 } from "async_hooks";
6794
6811
  import { performance as performance6 } from "perf_hooks";
6795
- var progressStorage = new AsyncLocalStorage();
6812
+ var progressStorage = new AsyncLocalStorage2();
6796
6813
  async function emitProgress(message, opts) {
6797
6814
  const ctx = progressStorage.getStore();
6798
6815
  const wallStart = ctx ? ctx.wallStart : performance6.now();
@@ -12060,7 +12077,7 @@ var CHECK_INTERVAL_SECONDS = 3 * 24 * 60 * 60;
12060
12077
  var DEFAULT_PACKAGE = "crosscheck-cli";
12061
12078
  var FETCH_TIMEOUT_MS = 3e3;
12062
12079
  function engineVersion() {
12063
- return true ? "0.2.29" : "0.0.0-dev";
12080
+ return true ? "0.2.30" : "0.0.0-dev";
12064
12081
  }
12065
12082
  function defaultUpdateCachePath() {
12066
12083
  const base = process.env["CROSSCHECK_DATA_DIR"] || path9.join(os.homedir() || os.tmpdir(), ".crosscheck");