@algosuite/vo-mcp 0.2.0-beta.48 → 0.2.0-beta.49

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.
@@ -105756,15 +105756,35 @@ function quotedValues(line) {
105756
105756
  }
105757
105757
  return values;
105758
105758
  }
105759
+ function helperFromLauncher(launcherPath, fallbackCli, { readFile = readFileSync, pathExists = existsSync } = {}) {
105760
+ const rootDir = dirname(String(launcherPath));
105761
+ try {
105762
+ const cur = JSON.parse(readText(join(rootDir, "current.json"), readFile) || "null");
105763
+ const ids = cur && cur.schema_version === 1 ? [cur.active?.slot_id, cur.previous?.slot_id] : [];
105764
+ for (const id of ids) {
105765
+ if (typeof id !== "string" || !/^vo-mcp-[0-9A-Za-z._-]{1,96}$/u.test(id)) continue;
105766
+ const helper = join(rootDir, "slots", id, "node_modules", "@algosuite", "vo-mcp", "dist", "supervisor-credential-helper.js");
105767
+ if (pathExists(helper)) return helper;
105768
+ }
105769
+ } catch {
105770
+ }
105771
+ return typeof fallbackCli === "string" && /[\\/]cli\.js$/i.test(fallbackCli) ? join(dirname(fallbackCli), "supervisor-credential-helper.js") : "";
105772
+ }
105773
+ var LAUNCHER_RE = /[\\/]vo-mcp-launcher\.mjs$/i;
105759
105774
  function codexConfig(raw) {
105760
105775
  const section = String(raw).match(
105761
105776
  /\[mcp_servers\.algohq\]([\s\S]*?)(?=\n\s*\[(?!mcp_servers\.algohq\.env\])|$)/
105762
105777
  )?.[1] || "";
105763
- const cli = section.split(/\r?\n/).flatMap(quotedValues).find((value) => /[\\/]dist[\\/]cli\.js$/i.test(value));
105778
+ const values = String(section).split(/\r?\n/).flatMap(quotedValues);
105779
+ const cli = values.find((value) => /[\\/]dist[\\/]cli\.js$/i.test(value));
105780
+ const launcher = values.find((value) => LAUNCHER_RE.test(value));
105764
105781
  const envSection = String(raw).match(/\[mcp_servers\.algohq\.env\]([\s\S]*?)(?=\n\s*\[|$)/)?.[1] || "";
105765
105782
  const urlLine = envSection.split(/\r?\n/).find((line) => /^\s*VO_CONTROL_PLANE_URL\s*=/.test(line));
105783
+ const fallbackLine = envSection.split(/\r?\n/).find((line) => /^\s*VO_MCP_FALLBACK_CLI\s*=/.test(line));
105766
105784
  return {
105767
105785
  helper: cli ? join(dirname(cli), "supervisor-credential-helper.js") : "",
105786
+ launcher: launcher || "",
105787
+ fallbackCli: fallbackLine ? quotedValues(fallbackLine)[0] || "" : "",
105768
105788
  url: urlLine ? quotedValues(urlLine)[0] || "" : ""
105769
105789
  };
105770
105790
  }
@@ -105772,17 +105792,19 @@ function claudeConfig(raw) {
105772
105792
  try {
105773
105793
  const parsed = JSON.parse(raw);
105774
105794
  const servers = parsed?.mcpServers;
105775
- if (!servers || typeof servers !== "object") return { helper: "", url: "" };
105795
+ if (!servers || typeof servers !== "object") return { helper: "", launcher: "", fallbackCli: "", url: "" };
105776
105796
  const entry = servers.algohq || servers["vo-mcp"] || servers.vo;
105777
- const cli = Array.isArray(entry?.args) ? entry.args.find(
105778
- (value) => typeof value === "string" && /[\\/]dist[\\/]cli\.js$/i.test(value)
105779
- ) : "";
105797
+ const args = Array.isArray(entry?.args) ? entry.args.filter((value) => typeof value === "string") : [];
105798
+ const cli = args.find((value) => /[\\/]dist[\\/]cli\.js$/i.test(value)) || "";
105799
+ const launcher = args.find((value) => LAUNCHER_RE.test(value)) || "";
105780
105800
  return {
105781
105801
  helper: cli ? join(dirname(cli), "supervisor-credential-helper.js") : "",
105802
+ launcher,
105803
+ fallbackCli: typeof entry?.env?.VO_MCP_FALLBACK_CLI === "string" ? entry.env.VO_MCP_FALLBACK_CLI : "",
105782
105804
  url: typeof entry?.env?.VO_CONTROL_PLANE_URL === "string" ? entry.env.VO_CONTROL_PLANE_URL : ""
105783
105805
  };
105784
105806
  } catch {
105785
- return { helper: "", url: "" };
105807
+ return { helper: "", launcher: "", fallbackCli: "", url: "" };
105786
105808
  }
105787
105809
  }
105788
105810
  function resolveControlPlaneRuntime({
@@ -105796,7 +105818,8 @@ function resolveControlPlaneRuntime({
105796
105818
  const desktop = claudeConfig(
105797
105819
  readText(join(env.APPDATA || "", "Claude", "claude_desktop_config.json"), readFile)
105798
105820
  );
105799
- const candidates = [env.VO_MCP_AUTH_HELPER_PATH, codex.helper, claude.helper, desktop.helper];
105821
+ const launcherHelpers = [codex, claude, desktop].filter((cfg) => cfg.launcher).map((cfg) => helperFromLauncher(cfg.launcher, cfg.fallbackCli, { readFile, pathExists }));
105822
+ const candidates = [env.VO_MCP_AUTH_HELPER_PATH, codex.helper, claude.helper, desktop.helper, ...launcherHelpers];
105800
105823
  const helperPath = candidates.find(
105801
105824
  (value) => typeof value === "string" && value.trim() && pathExists(value.trim())
105802
105825
  );
@@ -6946,6 +6946,7 @@ var init_auto_merge = __esm({
6946
6946
  // ../../scripts/virtual-office/code-runner/pr-overlap-gate.mjs
6947
6947
  import { spawnSync as spawnSync8 } from "node:child_process";
6948
6948
  import { existsSync as existsSync11 } from "node:fs";
6949
+ import { dirname as dirname6, join as join9 } from "node:path";
6949
6950
  import { fileURLToPath as fileURLToPath3 } from "node:url";
6950
6951
  function stripCredentials(env2 = process.env) {
6951
6952
  const safe = { ...env2 };
@@ -8044,7 +8045,7 @@ var init_publish_async = __esm({
8044
8045
 
8045
8046
  // ../../scripts/virtual-office/code-runner/skill-catalog.mjs
8046
8047
  import { readdirSync as readdirSync3, readFileSync as readFileSync8, statSync as statSync4 } from "node:fs";
8047
- import { dirname as dirname6, join as join9 } from "node:path";
8048
+ import { dirname as dirname7, join as join10 } from "node:path";
8048
8049
  import { fileURLToPath as fileURLToPath4 } from "node:url";
8049
8050
  function parseFrontmatterNameDescription(raw) {
8050
8051
  const text = String(raw).replace(/\r\n/g, "\n");
@@ -8064,15 +8065,15 @@ function parseFrontmatterNameDescription(raw) {
8064
8065
  return name && description ? { name, description } : null;
8065
8066
  }
8066
8067
  function resolveDefaultRepoRoot() {
8067
- const starts = [dirname6(fileURLToPath4(import.meta.url)), process.cwd()];
8068
+ const starts = [dirname7(fileURLToPath4(import.meta.url)), process.cwd()];
8068
8069
  for (const start of starts) {
8069
8070
  let dir = start;
8070
8071
  for (let i = 0; i < 8; i += 1) {
8071
8072
  try {
8072
- if (statSync4(join9(dir, ".claude", "skills")).isDirectory()) return dir;
8073
+ if (statSync4(join10(dir, ".claude", "skills")).isDirectory()) return dir;
8073
8074
  } catch {
8074
8075
  }
8075
- const parent = dirname6(dir);
8076
+ const parent = dirname7(dir);
8076
8077
  if (parent === dir) break;
8077
8078
  dir = parent;
8078
8079
  }
@@ -8081,14 +8082,14 @@ function resolveDefaultRepoRoot() {
8081
8082
  }
8082
8083
  function loadSkillCatalog({ repoRoot: repoRoot2 = resolveDefaultRepoRoot() } = {}) {
8083
8084
  try {
8084
- const skillsDir = join9(repoRoot2, ".claude", "skills");
8085
+ const skillsDir = join10(repoRoot2, ".claude", "skills");
8085
8086
  const catalog = [];
8086
8087
  for (const entry of readdirSync3(skillsDir)) {
8087
- const dir = join9(skillsDir, entry);
8088
+ const dir = join10(skillsDir, entry);
8088
8089
  try {
8089
8090
  if (!statSync4(dir).isDirectory()) continue;
8090
8091
  const parsed = parseFrontmatterNameDescription(
8091
- readFileSync8(join9(dir, "SKILL.md"), "utf8")
8092
+ readFileSync8(join10(dir, "SKILL.md"), "utf8")
8092
8093
  );
8093
8094
  if (parsed) catalog.push(parsed);
8094
8095
  } catch {
@@ -8589,7 +8590,7 @@ var init_task_attachments = __esm({
8589
8590
 
8590
8591
  // ../../scripts/virtual-office/code-runner/session-spool-forwarder.mjs
8591
8592
  import { homedir as homedir7 } from "node:os";
8592
- import { join as join10 } from "node:path";
8593
+ import { join as join11 } from "node:path";
8593
8594
  import { readdir as readdir2, readFile as readFile2, unlink, writeFile as writeFile2 } from "node:fs/promises";
8594
8595
  import { createHash as createHash4 } from "node:crypto";
8595
8596
  function deriveUuid(seed) {
@@ -8621,9 +8622,9 @@ async function readSpool(spoolDir = SPOOL_DIR) {
8621
8622
  for (const f of files) {
8622
8623
  if (!f.endsWith(".json")) continue;
8623
8624
  try {
8624
- const record = JSON.parse(await readFile2(join10(spoolDir, f), "utf8"));
8625
+ const record = JSON.parse(await readFile2(join11(spoolDir, f), "utf8"));
8625
8626
  if (record && typeof record.session_key === "string") {
8626
- out.push({ full: join10(spoolDir, f), record });
8627
+ out.push({ full: join11(spoolDir, f), record });
8627
8628
  }
8628
8629
  } catch {
8629
8630
  }
@@ -8705,8 +8706,8 @@ var SPOOL_DIR, CLOUD_MAP_FILE, STALE_MS, ACTIVE_SILENCE_MS;
8705
8706
  var init_session_spool_forwarder = __esm({
8706
8707
  "../../scripts/virtual-office/code-runner/session-spool-forwarder.mjs"() {
8707
8708
  "use strict";
8708
- SPOOL_DIR = join10(homedir7(), ".vo", "session-spool");
8709
- CLOUD_MAP_FILE = join10(homedir7(), ".vo", "session-cloud-map.json");
8709
+ SPOOL_DIR = join11(homedir7(), ".vo", "session-spool");
8710
+ CLOUD_MAP_FILE = join11(homedir7(), ".vo", "session-cloud-map.json");
8710
8711
  STALE_MS = 60 * 60 * 1e3;
8711
8712
  ACTIVE_SILENCE_MS = 10 * 60 * 1e3;
8712
8713
  }
@@ -8777,7 +8778,7 @@ var init_rate_limit_resume_scheduler_core = __esm({
8777
8778
  });
8778
8779
 
8779
8780
  // ../../scripts/virtual-office/code-runner/rate-limit-resume-scheduler.mjs
8780
- import { dirname as dirname7, join as join11, resolve as resolve2 } from "node:path";
8781
+ import { dirname as dirname8, join as join12, resolve as resolve2 } from "node:path";
8781
8782
  function defaultLog(message) {
8782
8783
  console.log(`[rate-limit-scheduler ${(/* @__PURE__ */ new Date()).toISOString()}] ${message}`);
8783
8784
  }
@@ -8859,7 +8860,7 @@ async function runLockedScheduler({
8859
8860
  async function runScheduler({
8860
8861
  env: env2 = process.env,
8861
8862
  queuePath = resumeQueuePath(),
8862
- attemptsPath = join11(dirname7(queuePath), "resume-attempts.json"),
8863
+ attemptsPath = join12(dirname8(queuePath), "resume-attempts.json"),
8863
8864
  client,
8864
8865
  now,
8865
8866
  log: log2 = defaultLog
@@ -10089,7 +10090,7 @@ var init_watcher_coordination = __esm({
10089
10090
  // ../../scripts/virtual-office/code-runner/watcher-state.mjs
10090
10091
  import { randomUUID as randomUUID3 } from "node:crypto";
10091
10092
  import { mkdir as mkdir2, open, readFile as readFile3, rename, unlink as unlink2 } from "node:fs/promises";
10092
- import { dirname as dirname8 } from "node:path";
10093
+ import { dirname as dirname9 } from "node:path";
10093
10094
  async function readWatcherState(stateFile) {
10094
10095
  let raw;
10095
10096
  try {
@@ -10105,7 +10106,7 @@ async function readWatcherState(stateFile) {
10105
10106
  return parsed;
10106
10107
  }
10107
10108
  async function writeWatcherState(stateFile, state) {
10108
- const directory = dirname8(stateFile);
10109
+ const directory = dirname9(stateFile);
10109
10110
  await mkdir2(directory, { recursive: true });
10110
10111
  const temp = `${stateFile}.${process.pid}.${randomUUID3()}.tmp`;
10111
10112
  let handle;
@@ -10435,7 +10436,7 @@ var init_enqueue_autonomous_code_task = __esm({
10435
10436
 
10436
10437
  // ../../scripts/virtual-office/code-runner/pr-watcher.mjs
10437
10438
  import { homedir as homedir8 } from "node:os";
10438
- import { join as join12 } from "node:path";
10439
+ import { join as join13 } from "node:path";
10439
10440
  function parsePrCiStatus(view) {
10440
10441
  const state = (view && typeof view.state === "string" ? view.state : "UNKNOWN").toUpperCase();
10441
10442
  const rollup = view && Array.isArray(view.statusCheckRollup) ? view.statusCheckRollup : [];
@@ -10781,7 +10782,7 @@ var init_pr_watcher = __esm({
10781
10782
  init_watcher_state();
10782
10783
  init_superseded_pr_source();
10783
10784
  init_ci_fix_prompt();
10784
- DEFAULT_STATE_FILE = join12(homedir8(), ".vo", "dispatched-prs.json");
10785
+ DEFAULT_STATE_FILE = join13(homedir8(), ".vo", "dispatched-prs.json");
10785
10786
  FAIL_CONCLUSIONS = /* @__PURE__ */ new Set([
10786
10787
  "FAILURE",
10787
10788
  "TIMED_OUT",
@@ -12026,7 +12027,7 @@ var init_classify_task = __esm({
12026
12027
  // ../../scripts/virtual-office/code-runner/auto-router/effort-policy.mjs
12027
12028
  import { readFileSync as readFileSync9 } from "node:fs";
12028
12029
  import { homedir as homedir9 } from "node:os";
12029
- import { join as join13 } from "node:path";
12030
+ import { join as join14 } from "node:path";
12030
12031
  function difficultyToRung(difficulty, thresholds) {
12031
12032
  const b = thresholds.rungBounds;
12032
12033
  if (difficulty >= b.R5) return "R5";
@@ -12103,7 +12104,7 @@ var init_effort_policy = __esm({
12103
12104
  init_meta_model_catalog();
12104
12105
  RUNG_ORDER = ["R1", "R2", "R3", "R4", "R5"];
12105
12106
  rungIndex = (rung) => RUNG_ORDER.indexOf(rung);
12106
- DEFAULT_CODEX_MODELS_CACHE = join13(homedir9(), ".codex", "models_cache.json");
12107
+ DEFAULT_CODEX_MODELS_CACHE = join14(homedir9(), ".codex", "models_cache.json");
12107
12108
  }
12108
12109
  });
12109
12110
 
@@ -12235,7 +12236,7 @@ var init_role_cost_shadow = __esm({
12235
12236
  // ../../scripts/virtual-office/code-runner/auto-router/auto-router.mjs
12236
12237
  import { readFileSync as readFileSync10, appendFileSync, mkdirSync as mkdirSync8 } from "node:fs";
12237
12238
  import { homedir as homedir10 } from "node:os";
12238
- import { join as join14, dirname as dirname9 } from "node:path";
12239
+ import { join as join15, dirname as dirname10 } from "node:path";
12239
12240
  import { fileURLToPath as fileURLToPath7 } from "node:url";
12240
12241
  function getAutoRouterMode(env2 = process.env) {
12241
12242
  const raw = String(env2.VO_CODE_RUNNER_AUTO_ROUTER || "").trim().toLowerCase();
@@ -12243,8 +12244,8 @@ function getAutoRouterMode(env2 = process.env) {
12243
12244
  }
12244
12245
  function loadThresholds() {
12245
12246
  if (!cachedThresholds) {
12246
- const here = dirname9(fileURLToPath7(import.meta.url));
12247
- cachedThresholds = JSON.parse(readFileSync10(join14(here, "thresholds.json"), "utf8"));
12247
+ const here = dirname10(fileURLToPath7(import.meta.url));
12248
+ cachedThresholds = JSON.parse(readFileSync10(join15(here, "thresholds.json"), "utf8"));
12248
12249
  }
12249
12250
  return cachedThresholds;
12250
12251
  }
@@ -12312,7 +12313,7 @@ function formatDecisionReason(decision, maxLen = 480) {
12312
12313
  }
12313
12314
  function appendDecisionFallback(decision, { path: path22 = DECISION_FALLBACK_PATH, append = appendFileSync, mkdir: mkdir4 = mkdirSync8, task, thresholds, roleCostInputs } = {}) {
12314
12315
  try {
12315
- mkdir4(dirname9(path22), { recursive: true });
12316
+ mkdir4(dirname10(path22), { recursive: true });
12316
12317
  append(path22, `${JSON.stringify(decision)}
12317
12318
  `, "utf8");
12318
12319
  if (isRouterDecision(decision)) {
@@ -12336,7 +12337,7 @@ var init_auto_router = __esm({
12336
12337
  init_effort_policy();
12337
12338
  init_role_cost_shadow();
12338
12339
  ROUTER_VERSION = "0.1.0";
12339
- DECISION_FALLBACK_PATH = join14(homedir10(), ".claude", "vo-auto-router-decisions.jsonl");
12340
+ DECISION_FALLBACK_PATH = join15(homedir10(), ".claude", "vo-auto-router-decisions.jsonl");
12340
12341
  MODES = /* @__PURE__ */ new Set(["off", "shadow", "on"]);
12341
12342
  cachedThresholds = null;
12342
12343
  isRouterDecision = (d) => Boolean(d && typeof d === "object" && typeof d.taskClass === "string" && typeof d.confidence === "number");
@@ -14420,7 +14421,7 @@ var init_cancellation_probe = __esm({
14420
14421
 
14421
14422
  // ../../scripts/virtual-office/code-runner/detached-economics-spool.mjs
14422
14423
  import { homedir as homedir11 } from "node:os";
14423
- import { dirname as dirname10, join as join15 } from "node:path";
14424
+ import { dirname as dirname11, join as join16 } from "node:path";
14424
14425
  import { mkdir as mkdir3, readFile as readFile4, rename as rename2, writeFile as writeFile3 } from "node:fs/promises";
14425
14426
  function withLock(operation) {
14426
14427
  const result = serialized.then(operation, operation);
@@ -14438,7 +14439,7 @@ async function readEntries(file) {
14438
14439
  }
14439
14440
  }
14440
14441
  async function writeEntries(file, entries) {
14441
- await mkdir3(dirname10(file), { recursive: true });
14442
+ await mkdir3(dirname11(file), { recursive: true });
14442
14443
  const temp = `${file}.${process.pid}.tmp`;
14443
14444
  await writeFile3(temp, `${JSON.stringify(entries)}
14444
14445
  `, "utf8");
@@ -14484,7 +14485,7 @@ var DEFAULT_FILE, serialized;
14484
14485
  var init_detached_economics_spool = __esm({
14485
14486
  "../../scripts/virtual-office/code-runner/detached-economics-spool.mjs"() {
14486
14487
  "use strict";
14487
- DEFAULT_FILE = join15(homedir11(), ".vo", "detached-run-economics.json");
14488
+ DEFAULT_FILE = join16(homedir11(), ".vo", "detached-run-economics.json");
14488
14489
  serialized = Promise.resolve();
14489
14490
  }
14490
14491
  });