agent-valley 2.2.0 → 2.2.1

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
3
3
  "name": "av",
4
- "version": "2.2.0",
4
+ "version": "2.2.1",
5
5
  "description": "Delegate repository goals to Agent Valley and inspect mission progress and verification evidence.",
6
6
  "author": {
7
7
  "name": "Agent Valley"
package/dist/index.js CHANGED
@@ -19037,7 +19037,7 @@ var init_sandbox = __esm(() => {
19037
19037
  });
19038
19038
 
19039
19039
  // ../../packages/core/src/sessions/codex-session.ts
19040
- import { spawn as spawn7 } from "node:child_process";
19040
+ import { spawn as spawn8 } from "node:child_process";
19041
19041
  var CodexSession;
19042
19042
  var init_codex_session = __esm(() => {
19043
19043
  init_base_session();
@@ -19066,7 +19066,7 @@ var init_codex_session = __esm(() => {
19066
19066
  args,
19067
19067
  workspacePath: config.workspacePath
19068
19068
  });
19069
- this.process = spawn7(plan.command, plan.args, {
19069
+ this.process = spawn8(plan.command, plan.args, {
19070
19070
  detached: process.platform !== "win32",
19071
19071
  cwd: config.workspacePath,
19072
19072
  env: buildAgentEnv("codex", config.env),
@@ -19344,7 +19344,7 @@ var init_codex_session = __esm(() => {
19344
19344
  });
19345
19345
 
19346
19346
  // ../../packages/core/src/sessions/claude-session.ts
19347
- import { spawn as spawn8 } from "node:child_process";
19347
+ import { spawn as spawn9 } from "node:child_process";
19348
19348
  var ClaudeSession;
19349
19349
  var init_claude_session = __esm(() => {
19350
19350
  init_base_session();
@@ -19400,7 +19400,7 @@ var init_claude_session = __esm(() => {
19400
19400
  this.emitError("CRASH", `${err}`, false);
19401
19401
  return;
19402
19402
  }
19403
- this.process = spawn8(plan.command, plan.args, {
19403
+ this.process = spawn9(plan.command, plan.args, {
19404
19404
  detached: process.platform !== "win32",
19405
19405
  cwd: this.config.workspacePath,
19406
19406
  env: buildAgentEnv(this.vendor, this.config.env),
@@ -19614,7 +19614,7 @@ var init_qwen_session = __esm(() => {
19614
19614
  });
19615
19615
 
19616
19616
  // ../../packages/core/src/sessions/agy-session.ts
19617
- import { spawn as spawn9 } from "node:child_process";
19617
+ import { spawn as spawn10 } from "node:child_process";
19618
19618
  function formatAgyTimeout(seconds) {
19619
19619
  return `${Math.max(1, Math.round(seconds))}s`;
19620
19620
  }
@@ -19660,7 +19660,7 @@ var init_agy_session = __esm(() => {
19660
19660
  this.emitError("CRASH", `${err}`, false);
19661
19661
  return;
19662
19662
  }
19663
- this.process = spawn9(plan.command, plan.args, {
19663
+ this.process = spawn10(plan.command, plan.args, {
19664
19664
  detached: process.platform !== "win32",
19665
19665
  cwd: config.workspacePath,
19666
19666
  env: buildAgentEnv("antigravity", config.env),
@@ -19731,7 +19731,7 @@ var init_agy_session = __esm(() => {
19731
19731
  });
19732
19732
 
19733
19733
  // ../../packages/core/src/sessions/cursor-session.ts
19734
- import { spawn as spawn10 } from "node:child_process";
19734
+ import { spawn as spawn11 } from "node:child_process";
19735
19735
  var CURSOR_COMMAND = "cursor-agent", MAX_PROMPT_ARG_LENGTH = 1e5, CursorSession;
19736
19736
  var init_cursor_session = __esm(() => {
19737
19737
  init_base_session();
@@ -19779,7 +19779,7 @@ var init_cursor_session = __esm(() => {
19779
19779
  const apiKey = process.env.CURSOR_API_KEY;
19780
19780
  if (apiKey)
19781
19781
  extraEnv.CURSOR_API_KEY = apiKey;
19782
- this.process = spawn10(plan.command, plan.args, {
19782
+ this.process = spawn11(plan.command, plan.args, {
19783
19783
  detached: process.platform !== "win32",
19784
19784
  cwd: this.config.workspacePath,
19785
19785
  env: buildAgentEnv("cursor", extraEnv),
@@ -19915,7 +19915,7 @@ var init_cursor_session = __esm(() => {
19915
19915
  });
19916
19916
 
19917
19917
  // ../../packages/core/src/sessions/grok-session.ts
19918
- import { spawn as spawn11 } from "node:child_process";
19918
+ import { spawn as spawn12 } from "node:child_process";
19919
19919
  function isToolUseType(type) {
19920
19920
  return type === "tool_use" || type === "tool_call" || type === "function_call";
19921
19921
  }
@@ -19933,11 +19933,11 @@ function normalizeToolInput(raw) {
19933
19933
  }
19934
19934
  return;
19935
19935
  }
19936
- var GROK_COMMAND = "grok", MAX_OUTPUT_BYTES2, WRITE_TOOL_HINTS, EDIT_TOOL_HINTS, GrokSession;
19936
+ var GROK_COMMAND = "grok", MAX_OUTPUT_BYTES3, WRITE_TOOL_HINTS, EDIT_TOOL_HINTS, GrokSession;
19937
19937
  var init_grok_session = __esm(() => {
19938
19938
  init_base_session();
19939
19939
  init_sandbox();
19940
- MAX_OUTPUT_BYTES2 = 10 * 1024;
19940
+ MAX_OUTPUT_BYTES3 = 10 * 1024;
19941
19941
  WRITE_TOOL_HINTS = ["write"];
19942
19942
  EDIT_TOOL_HINTS = ["edit", "str_replace", "patch"];
19943
19943
  GrokSession = class GrokSession extends BaseSession {
@@ -19969,7 +19969,7 @@ var init_grok_session = __esm(() => {
19969
19969
  this.emitError("CRASH", `${err}`, false);
19970
19970
  return;
19971
19971
  }
19972
- this.process = spawn11(plan.command, plan.args, {
19972
+ this.process = spawn12(plan.command, plan.args, {
19973
19973
  detached: process.platform !== "win32",
19974
19974
  cwd: this.config.workspacePath,
19975
19975
  env: buildAgentEnv("grok", this.config.env),
@@ -20022,8 +20022,8 @@ var init_grok_session = __esm(() => {
20022
20022
  }
20023
20023
  appendOutputTail(chunk) {
20024
20024
  this.outputTail += chunk;
20025
- if (this.outputTail.length > MAX_OUTPUT_BYTES2) {
20026
- this.outputTail = this.outputTail.slice(-MAX_OUTPUT_BYTES2);
20025
+ if (this.outputTail.length > MAX_OUTPUT_BYTES3) {
20026
+ this.outputTail = this.outputTail.slice(-MAX_OUTPUT_BYTES3);
20027
20027
  }
20028
20028
  }
20029
20029
  handleToolUse(e) {
@@ -20084,7 +20084,7 @@ var init_grok_session = __esm(() => {
20084
20084
  });
20085
20085
 
20086
20086
  // ../../packages/core/src/sessions/kimi-session.ts
20087
- import { spawn as spawn12 } from "node:child_process";
20087
+ import { spawn as spawn13 } from "node:child_process";
20088
20088
  var KIMI_COMMAND = "kimi", MAX_RAW_TAIL_BYTES, KimiSession;
20089
20089
  var init_kimi_session = __esm(() => {
20090
20090
  init_base_session();
@@ -20122,7 +20122,7 @@ var init_kimi_session = __esm(() => {
20122
20122
  this.emitError("CRASH", `${err}`, false);
20123
20123
  return;
20124
20124
  }
20125
- this.process = spawn12(plan.command, plan.args, {
20125
+ this.process = spawn13(plan.command, plan.args, {
20126
20126
  detached: process.platform !== "win32",
20127
20127
  cwd: this.config.workspacePath,
20128
20128
  env: buildAgentEnv("kimi", this.config.env),
@@ -20261,7 +20261,7 @@ var init_kimi_session = __esm(() => {
20261
20261
  });
20262
20262
 
20263
20263
  // ../../packages/core/src/sessions/opencode-session.ts
20264
- import { spawn as spawn13 } from "node:child_process";
20264
+ import { spawn as spawn14 } from "node:child_process";
20265
20265
  function normalizeToolInput2(raw) {
20266
20266
  if (raw == null)
20267
20267
  return;
@@ -20276,11 +20276,11 @@ function normalizeToolInput2(raw) {
20276
20276
  }
20277
20277
  return;
20278
20278
  }
20279
- var OPENCODE_COMMAND = "opencode", MAX_PROMPT_ARG_LENGTH2 = 1e5, MAX_OUTPUT_BYTES3, MAX_RAW_TAIL_BYTES2, WRITE_TOOL_HINTS2, EDIT_TOOL_HINTS2, AUTH_FAILURE_PATTERN, OpencodeSession, TERMINAL_TYPE_HINTS;
20279
+ var OPENCODE_COMMAND = "opencode", MAX_PROMPT_ARG_LENGTH2 = 1e5, MAX_OUTPUT_BYTES4, MAX_RAW_TAIL_BYTES2, WRITE_TOOL_HINTS2, EDIT_TOOL_HINTS2, AUTH_FAILURE_PATTERN, OpencodeSession, TERMINAL_TYPE_HINTS;
20280
20280
  var init_opencode_session = __esm(() => {
20281
20281
  init_base_session();
20282
20282
  init_sandbox();
20283
- MAX_OUTPUT_BYTES3 = 10 * 1024;
20283
+ MAX_OUTPUT_BYTES4 = 10 * 1024;
20284
20284
  MAX_RAW_TAIL_BYTES2 = 4 * 1024;
20285
20285
  WRITE_TOOL_HINTS2 = ["write"];
20286
20286
  EDIT_TOOL_HINTS2 = ["edit", "str_replace", "patch"];
@@ -20328,7 +20328,7 @@ var init_opencode_session = __esm(() => {
20328
20328
  this.emitError("CRASH", `${err}`, false);
20329
20329
  return;
20330
20330
  }
20331
- this.process = spawn13(plan.command, plan.args, {
20331
+ this.process = spawn14(plan.command, plan.args, {
20332
20332
  detached: process.platform !== "win32",
20333
20333
  cwd: this.config.workspacePath,
20334
20334
  env: buildAgentEnv("opencode", this.config.env),
@@ -20381,8 +20381,8 @@ var init_opencode_session = __esm(() => {
20381
20381
  }
20382
20382
  appendOutputTail(chunk) {
20383
20383
  this.outputTail += chunk;
20384
- if (this.outputTail.length > MAX_OUTPUT_BYTES3) {
20385
- this.outputTail = this.outputTail.slice(-MAX_OUTPUT_BYTES3);
20384
+ if (this.outputTail.length > MAX_OUTPUT_BYTES4) {
20385
+ this.outputTail = this.outputTail.slice(-MAX_OUTPUT_BYTES4);
20386
20386
  }
20387
20387
  }
20388
20388
  handleEvent(event) {
@@ -20455,7 +20455,7 @@ var init_opencode_session = __esm(() => {
20455
20455
  return;
20456
20456
  const text = e.result ?? e.text ?? e.output;
20457
20457
  if (typeof text === "string" && text.length > 0) {
20458
- this.explicitResult = text.length > MAX_OUTPUT_BYTES3 ? text.slice(-MAX_OUTPUT_BYTES3) : text;
20458
+ this.explicitResult = text.length > MAX_OUTPUT_BYTES4 ? text.slice(-MAX_OUTPUT_BYTES4) : text;
20459
20459
  }
20460
20460
  const usage = e.usage ?? e.tokens ?? e.cost;
20461
20461
  if (!usage)
@@ -22446,11 +22446,11 @@ function canonicalConfig(config) {
22446
22446
  }
22447
22447
 
22448
22448
  // src/agent-provisioning.ts
22449
- import { spawn as spawn16 } from "node:child_process";
22449
+ import { spawn as spawn17 } from "node:child_process";
22450
22450
  import { mkdtempSync, rmSync as rmSync2 } from "node:fs";
22451
22451
  import { homedir as homedir7, tmpdir as tmpdir4 } from "node:os";
22452
22452
  import { delimiter as delimiter3, join as join46 } from "node:path";
22453
- function runTerminalCommand(request, spawnCommand = spawn16) {
22453
+ function runTerminalCommand(request, spawnCommand = spawn17) {
22454
22454
  return new Promise((resolve) => {
22455
22455
  let child;
22456
22456
  let timeout;
@@ -22727,7 +22727,7 @@ async function present(path) {
22727
22727
  return false;
22728
22728
  }
22729
22729
  }
22730
- async function installedVersion(skills) {
22730
+ async function installedVersion2(skills) {
22731
22731
  try {
22732
22732
  const marker = JSON.parse(await readFile16(join47(skills, "_version.json"), "utf8"));
22733
22733
  return marker.schemaVersion === 2 && marker.mode === "project" && typeof marker.version === "string" && /^\d+\.\d+\.\d+(?:-[a-zA-Z0-9.-]+)?$/.test(marker.version) ? marker.version : null;
@@ -22792,7 +22792,7 @@ async function inspectOma(workspaceRoot, _overrides = {}) {
22792
22792
  if (!root)
22793
22793
  return { success: false, message: "Choose an existing absolute workspace with project-local OMA files." };
22794
22794
  const skills = join47(root, ".agents", "skills");
22795
- const version = await installedVersion(skills);
22795
+ const version = await installedVersion2(skills);
22796
22796
  if (!version)
22797
22797
  throw new Error("Invalid installed metadata");
22798
22798
  const entries = (await readdir12(skills, { withFileTypes: true })).filter((entry) => /^oma-[a-z0-9-]+$/.test(entry.name));
@@ -22813,7 +22813,7 @@ async function inspectOma(workspaceRoot, _overrides = {}) {
22813
22813
  };
22814
22814
  }
22815
22815
  }
22816
- function failure2(action, result) {
22816
+ function failure3(action, result) {
22817
22817
  return {
22818
22818
  success: false,
22819
22819
  message: `${action} ${result?.failure === "timed_out" ? "timed out" : "did not complete"}. Retry OMA preparation or follow ${DOCUMENTATION_URL}.`
@@ -22835,7 +22835,7 @@ async function prepareOma(workspaceRoot, overrides = {}) {
22835
22835
  env: { ...deps.env, OMA_INSTALL_NO_RUN: "1" }
22836
22836
  });
22837
22837
  if (!bootstrap.success)
22838
- return bootstrap.stage === "prerequisites" ? { success: false, message: `Install curl and bash, then retry OMA preparation. ${DOCUMENTATION_URL}` } : failure2("OMA prerequisite preparation", bootstrap);
22838
+ return bootstrap.stage === "prerequisites" ? { success: false, message: `Install curl and bash, then retry OMA preparation. ${DOCUMENTATION_URL}` } : failure3("OMA prerequisite preparation", bootstrap);
22839
22839
  const bun = deps.resolveBinary("bun");
22840
22840
  if (!bun)
22841
22841
  return {
@@ -22854,9 +22854,9 @@ async function prepareOma(workspaceRoot, overrides = {}) {
22854
22854
  const request = { command: bun, env: environment, cwd: root, timeoutMs: 300000 };
22855
22855
  const latest = await deps.runCommand({ ...request, args: ["install", "--global", LATEST_PACKAGE] });
22856
22856
  if (!latest.success)
22857
- return failure2("OMA CLI update", latest);
22857
+ return failure3("OMA CLI update", latest);
22858
22858
  const agents = join47(root, ".agents");
22859
- const existing = await installedVersion(join47(agents, "skills")) !== null || await directory2(join47(agents, "skills")) && (await present(join47(agents, "oma-config.yaml")) || await present(join47(agents, "mcp.json")) || await directory2(join47(agents, "workflows")));
22859
+ const existing = await installedVersion2(join47(agents, "skills")) !== null || await directory2(join47(agents, "skills")) && (await present(join47(agents, "oma-config.yaml")) || await present(join47(agents, "mcp.json")) || await directory2(join47(agents, "workflows")));
22860
22860
  const custom = await snapshotConfig(agents);
22861
22861
  const args = existing ? ["update", "--yes", "--with-new-skills", "--all"] : ["install"];
22862
22862
  let installed;
@@ -22867,7 +22867,7 @@ async function prepareOma(workspaceRoot, overrides = {}) {
22867
22867
  await restoreConfig(agents, custom);
22868
22868
  }
22869
22869
  if (!installed.success)
22870
- return failure2(existing ? "OMA skill update" : "OMA skill installation", installed);
22870
+ return failure3(existing ? "OMA skill update" : "OMA skill installation", installed);
22871
22871
  const inspection = await inspectOma(root, deps);
22872
22872
  if (!inspection.success)
22873
22873
  return {
@@ -22880,7 +22880,7 @@ async function prepareOma(workspaceRoot, overrides = {}) {
22880
22880
  message: `Latest official OMA preparation completed. ${inspection.message.split(" Prepare ")[0]}`
22881
22881
  };
22882
22882
  } catch {
22883
- return failure2("OMA preparation");
22883
+ return failure3("OMA preparation");
22884
22884
  }
22885
22885
  }
22886
22886
  var INSTALLER_URL = "https://raw.githubusercontent.com/first-fluke/oh-my-agent/main/cli/install.sh", DOCUMENTATION_URL = "https://github.com/first-fluke/oh-my-agent", LATEST_PACKAGE = "oh-my-agent@latest", CUSTOM_CONFIG_NAMES;
@@ -22898,7 +22898,7 @@ var init_oma_provisioning = __esm(() => {
22898
22898
  });
22899
22899
 
22900
22900
  // src/setup/noninteractive-runtime.ts
22901
- import { spawn as spawn17 } from "node:child_process";
22901
+ import { spawn as spawn18 } from "node:child_process";
22902
22902
  function noninteractiveSetupDefaults() {
22903
22903
  const env = { ...process.env, CI: "true" };
22904
22904
  const runCommand = (request) => runTerminalCommand(request, quietSpawn);
@@ -22925,7 +22925,7 @@ function currentRuntimeIdentity(env) {
22925
22925
  throw new Error("Current runtime identity is ambiguous. Rerun av setup --yes --actor <current-vendor> --model <current-model-or-empty>; do not use OMA defaults to identify the caller.");
22926
22926
  return identities[0];
22927
22927
  }
22928
- var quietSpawn = (command, args, options) => spawn17(command, args, { ...options, stdio: "ignore" });
22928
+ var quietSpawn = (command, args, options) => spawn18(command, args, { ...options, stdio: "ignore" });
22929
22929
  var init_noninteractive_runtime = __esm(() => {
22930
22930
  init_yaml_loader();
22931
22931
  init_agent_discovery();
@@ -24668,7 +24668,7 @@ var init_noninteractive = __esm(() => {
24668
24668
  });
24669
24669
 
24670
24670
  // src/invite.ts
24671
- import { spawn as spawn18 } from "node:child_process";
24671
+ import { spawn as spawn19 } from "node:child_process";
24672
24672
  function encodeInvite(data) {
24673
24673
  const json = JSON.stringify(data);
24674
24674
  const b64 = Buffer.from(json).toString("base64url");
@@ -24694,7 +24694,7 @@ async function readClipboard() {
24694
24694
  try {
24695
24695
  const cmd = process.platform === "darwin" ? "pbpaste" : "xclip -selection clipboard -o";
24696
24696
  const parts = cmd.split(" ");
24697
- const proc = spawn18(parts[0], parts.slice(1), { stdio: ["pipe", "pipe", "pipe"] });
24697
+ const proc = spawn19(parts[0], parts.slice(1), { stdio: ["pipe", "pipe", "pipe"] });
24698
24698
  const { text, exitCode } = await new Promise((resolve, reject) => {
24699
24699
  const chunks = [];
24700
24700
  proc.stdout.on("data", (chunk) => chunks.push(chunk));
@@ -24711,7 +24711,7 @@ async function writeClipboard(text) {
24711
24711
  try {
24712
24712
  const cmd = process.platform === "darwin" ? "pbcopy" : "xclip -selection clipboard";
24713
24713
  const parts = cmd.split(" ");
24714
- const proc = spawn18(parts[0], parts.slice(1), { stdio: ["pipe", "pipe", "pipe"] });
24714
+ const proc = spawn19(parts[0], parts.slice(1), { stdio: ["pipe", "pipe", "pipe"] });
24715
24715
  proc.stdin.write(text);
24716
24716
  proc.stdin.end();
24717
24717
  const exitCode = await new Promise((resolve, reject) => {
@@ -27130,7 +27130,7 @@ var init_breakdown_publish = __esm(() => {
27130
27130
  });
27131
27131
 
27132
27132
  // src/breakdown.ts
27133
- import { spawn as spawn21 } from "node:child_process";
27133
+ import { spawn as spawn22 } from "node:child_process";
27134
27134
  function parseBreakdownOutput(output) {
27135
27135
  const parentTitleMatch = output.match(/^PARENT_TITLE:\s*(.+)$/m);
27136
27136
  const parentDescStart = output.match(/^PARENT_DESCRIPTION:\s*\n/m);
@@ -27184,7 +27184,7 @@ function renderDagPreview(result) {
27184
27184
  }
27185
27185
  async function expandBreakdownWithClaude(rawInput) {
27186
27186
  const output = await new Promise((resolve, reject) => {
27187
- const proc = spawn21("claude", ["--print", "--no-session-persistence", "-p", `${BREAKDOWN_PROMPT}
27187
+ const proc = spawn22("claude", ["--print", "--no-session-persistence", "-p", `${BREAKDOWN_PROMPT}
27188
27188
 
27189
27189
  Input: ${rawInput}`], { stdio: ["ignore", "pipe", "pipe"] });
27190
27190
  const chunks = [];
@@ -27322,7 +27322,7 @@ async function createGithubIssue(config, input, fetchImpl = fetch) {
27322
27322
  }
27323
27323
 
27324
27324
  // src/issue.ts
27325
- import { spawn as spawn22 } from "node:child_process";
27325
+ import { spawn as spawn23 } from "node:child_process";
27326
27326
  function parseIssueInput(raw) {
27327
27327
  const newlineIdx = raw.indexOf(`
27328
27328
  `);
@@ -27362,7 +27362,7 @@ async function expandWithClaude(rawInput) {
27362
27362
  const args = ["--print", "--no-session-persistence", "-p", `${EXPAND_PROMPT}
27363
27363
 
27364
27364
  Input: ${rawInput}`];
27365
- const proc = spawn22("claude", args, { stdio: ["pipe", "pipe", "pipe"] });
27365
+ const proc = spawn23("claude", args, { stdio: ["pipe", "pipe", "pipe"] });
27366
27366
  const { output, exitCode } = await new Promise((resolve, reject) => {
27367
27367
  const chunks = [];
27368
27368
  proc.stdout.on("data", (chunk) => chunks.push(chunk));
@@ -27760,7 +27760,7 @@ var init_login = __esm(() => {
27760
27760
  // src/index.ts
27761
27761
  init_project_config_path();
27762
27762
  init_yaml_loader();
27763
- import { spawn as spawn23, spawnSync as spawnSync5 } from "node:child_process";
27763
+ import { spawn as spawn24, spawnSync as spawnSync5 } from "node:child_process";
27764
27764
  import { existsSync as existsSync10, unlinkSync as unlinkSync2 } from "node:fs";
27765
27765
  import { resolve as resolve30 } from "node:path";
27766
27766
 
@@ -67963,11 +67963,141 @@ function getCachedTriggerTable(rootDir = process.cwd()) {
67963
67963
  return table;
67964
67964
  }
67965
67965
 
67966
+ // ../../packages/core/src/oma/latest-cli.ts
67967
+ import { spawn as spawn7 } from "node:child_process";
67968
+ var VERSION_TIMEOUT_MS = 1e4;
67969
+ var REGISTRY_TIMEOUT_MS = 60000;
67970
+ var INSTALL_TIMEOUT_MS = 300000;
67971
+ var MAX_OUTPUT_BYTES2 = 1048576;
67972
+ var INSTALL_HINT = "Run npm install --global --ignore-scripts oh-my-agent@latest, confirm oma --version, then retry.";
67973
+ var VERSION = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(?:\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$/;
67974
+ function parseOmaCliVersion(value) {
67975
+ const trimmed = value.trim();
67976
+ if (trimmed.length > 128)
67977
+ return null;
67978
+ const version = trimmed.startsWith("v") ? trimmed.slice(1) : trimmed;
67979
+ return VERSION.test(version) ? version : null;
67980
+ }
67981
+
67982
+ class CommandFailure extends Error {
67983
+ kind;
67984
+ constructor(kind) {
67985
+ super(kind);
67986
+ this.kind = kind;
67987
+ }
67988
+ }
67989
+ var defaultIO = {
67990
+ run: (command, args, { timeoutMs, maxOutputBytes }) => new Promise((resolve, reject) => {
67991
+ let settled = false;
67992
+ let stdout = "";
67993
+ let stderr = "";
67994
+ let outputBytes = 0;
67995
+ let timer;
67996
+ const finish = (error, exitCode = null) => {
67997
+ if (settled)
67998
+ return;
67999
+ settled = true;
68000
+ clearTimeout(timer);
68001
+ if (error)
68002
+ reject(error);
68003
+ else
68004
+ resolve({ exitCode, stdout, stderr });
68005
+ };
68006
+ try {
68007
+ const child = spawn7(command, args, { stdio: ["ignore", "pipe", "pipe"], windowsHide: true });
68008
+ const append = (chunk, destination) => {
68009
+ if (settled)
68010
+ return;
68011
+ outputBytes += Buffer.byteLength(chunk);
68012
+ if (outputBytes > maxOutputBytes) {
68013
+ child.kill("SIGKILL");
68014
+ finish(new CommandFailure("output"));
68015
+ } else if (destination === "stdout")
68016
+ stdout += chunk.toString();
68017
+ else
68018
+ stderr += chunk.toString();
68019
+ };
68020
+ child.stdout?.on("data", (chunk) => append(chunk, "stdout"));
68021
+ child.stderr?.on("data", (chunk) => append(chunk, "stderr"));
68022
+ child.once("error", () => finish(new CommandFailure("spawn")));
68023
+ child.once("close", (code) => finish(undefined, code));
68024
+ timer = setTimeout(() => {
68025
+ child.kill("SIGKILL");
68026
+ finish(new CommandFailure("timeout"));
68027
+ }, timeoutMs);
68028
+ } catch {
68029
+ finish(new CommandFailure("spawn"));
68030
+ }
68031
+ })
68032
+ };
68033
+ function failure2(stage, error) {
68034
+ const detail = error instanceof CommandFailure ? error.kind === "timeout" ? "request timed out" : error.kind === "output" ? "command output exceeded the limit" : "command could not start" : "command failed";
68035
+ return new Error(`Latest OMA CLI ${stage}: ${detail}. ${INSTALL_HINT}`);
68036
+ }
68037
+ async function installedVersion(io) {
68038
+ try {
68039
+ const result = await io.run("oma", ["--version"], {
68040
+ timeoutMs: VERSION_TIMEOUT_MS,
68041
+ maxOutputBytes: MAX_OUTPUT_BYTES2
68042
+ });
68043
+ return result.exitCode === 0 ? parseOmaCliVersion(result.stdout) : null;
68044
+ } catch {
68045
+ return null;
68046
+ }
68047
+ }
68048
+ async function prepare(io) {
68049
+ const installed = await installedVersion(io);
68050
+ let latest;
68051
+ try {
68052
+ const result = await io.run("npm", ["view", "oh-my-agent@latest", "version", "--json", "--prefer-online"], {
68053
+ timeoutMs: REGISTRY_TIMEOUT_MS,
68054
+ maxOutputBytes: MAX_OUTPUT_BYTES2
68055
+ });
68056
+ if (result.exitCode !== 0)
68057
+ throw failure2("registry lookup");
68058
+ const value = JSON.parse(result.stdout);
68059
+ latest = typeof value === "string" ? parseOmaCliVersion(value) : null;
68060
+ } catch (error) {
68061
+ throw failure2("registry lookup", error);
68062
+ }
68063
+ if (!latest)
68064
+ throw new Error(`Latest OMA CLI registry returned invalid version metadata. ${INSTALL_HINT}`);
68065
+ if (installed === latest)
68066
+ return { version: latest, installed: false };
68067
+ try {
68068
+ const result = await io.run("npm", ["install", "--global", "--ignore-scripts", "oh-my-agent@latest"], {
68069
+ timeoutMs: INSTALL_TIMEOUT_MS,
68070
+ maxOutputBytes: MAX_OUTPUT_BYTES2
68071
+ });
68072
+ if (result.exitCode !== 0)
68073
+ throw failure2("installation");
68074
+ } catch (error) {
68075
+ throw failure2("installation", error);
68076
+ }
68077
+ const confirmed = await installedVersion(io);
68078
+ if (confirmed !== latest)
68079
+ throw new Error(`Latest OMA CLI verification expected ${latest}, but oma --version reported ${confirmed ?? "unavailable"}. Check PATH for another OMA executable. ${INSTALL_HINT}`);
68080
+ return { version: latest, installed: true };
68081
+ }
68082
+ var preparing = new WeakMap;
68083
+ function ensureLatestOmaCli(options = {}) {
68084
+ const io = options.io ?? defaultIO;
68085
+ const current = preparing.get(io);
68086
+ if (current)
68087
+ return current;
68088
+ const pending = prepare(io).finally(() => {
68089
+ if (preparing.get(io) === pending)
68090
+ preparing.delete(io);
68091
+ });
68092
+ preparing.set(io, pending);
68093
+ return pending;
68094
+ }
68095
+
67966
68096
  // ../../packages/core/src/oma/receipt-adapter.ts
67967
- var SUPPORTED_OMA_VERSION = "15.0.15";
68097
+ var OMA_RECEIPT_SCHEMA_VERSION = 1;
67968
68098
  var RUN_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
67969
68099
  var HASH = /^[a-f0-9]{64}$/;
67970
- var defaultIO = {
68100
+ var defaultIO2 = {
67971
68101
  listRunFiles: (workspacePath) => {
67972
68102
  const dir = join25(workspacePath, ".agents", "state", "agent-runs");
67973
68103
  return readdirSync(dir).filter((name) => RUN_ID.test(name.slice(0, -5)) && name.endsWith(".json"));
@@ -67996,7 +68126,7 @@ function stringArray(value) {
67996
68126
  function shellQuote(value) {
67997
68127
  return `'${value.replaceAll("'", "'\\''")}'`;
67998
68128
  }
67999
- async function prepareOmaAttempt(request) {
68129
+ async function prepareOmaAttempt(request, dependencies = {}) {
68000
68130
  if (!request.verifyCommand.trim()) {
68001
68131
  throw new Error("oma.mode: strict requires verify.command in av.yaml or a routing verify_command");
68002
68132
  }
@@ -68011,6 +68141,7 @@ ${request.issue.description ?? ""}`, table);
68011
68141
  if (!existsSync4(file))
68012
68142
  throw new Error(`OMA workflow file missing in target worktree: ${file}`);
68013
68143
  }
68144
+ await ensureLatestOmaCli({ io: dependencies.latestCliIO });
68014
68145
  const path = join25(request.workspace.path, ".agents", "results", `plan-${request.attempt.id}.json`);
68015
68146
  const plan = {
68016
68147
  session_id: request.attempt.id,
@@ -68064,14 +68195,16 @@ function buildOmaGuidance(request) {
68064
68195
  ].join(`
68065
68196
  `);
68066
68197
  }
68067
- function validateOmaEvidence(request, io = defaultIO) {
68198
+ function validateOmaEvidence(request, io = defaultIO2) {
68068
68199
  const root = resolve14(request.workspace.path);
68069
68200
  if (!request.verifyCommand.trim())
68070
68201
  return fail("Strict OMA mode has no configured verify command");
68202
+ let cliVersion;
68071
68203
  try {
68072
68204
  const version = io.runCli(["--version"], root);
68073
- if (version.exitCode !== 0 || version.stdout.trim() !== SUPPORTED_OMA_VERSION) {
68074
- return fail(`OMA CLI ${SUPPORTED_OMA_VERSION} is required. Run npm install -g oh-my-agent@${SUPPORTED_OMA_VERSION}, then confirm oma --version.`);
68205
+ cliVersion = parseOmaCliVersion(version.stdout);
68206
+ if (version.exitCode !== 0 || !cliVersion) {
68207
+ return fail("OMA CLI is unavailable or returned a malformed version. Run npm install -g oh-my-agent@latest, then confirm oma --version and rerun the receipt verification.");
68075
68208
  }
68076
68209
  } catch (err) {
68077
68210
  return fail(`OMA CLI unavailable: ${String(err)}`);
@@ -68093,8 +68226,11 @@ function validateOmaEvidence(request, io = defaultIO) {
68093
68226
  const run = forAttempt.at(-1);
68094
68227
  if (!run)
68095
68228
  return fail("No OMA receipt is bound to this Valley attempt");
68096
- if (run.schemaVersion !== 1 || run.taskId !== request.attempt.id || !RUN_ID.test(String(run.runId))) {
68097
- return fail("OMA receipt schema or task identity is incompatible");
68229
+ if (run.schemaVersion !== OMA_RECEIPT_SCHEMA_VERSION) {
68230
+ return fail(`OMA CLI ${cliVersion} returned an unsupported receipt schema. AV requires agent-run schema v${OMA_RECEIPT_SCHEMA_VERSION}; update AV and OMA (npm install -g oh-my-agent@latest), then generate and verify a compatible receipt.`);
68231
+ }
68232
+ if (run.taskId !== request.attempt.id || !RUN_ID.test(String(run.runId))) {
68233
+ return fail("OMA receipt task identity is incompatible");
68098
68234
  }
68099
68235
  if (run.workspace !== root || run.artifactRoot !== root || run.status !== "completed" || run.exitCode !== 0) {
68100
68236
  return fail("OMA receipt has the wrong workspace or did not complete");
@@ -68161,6 +68297,8 @@ function validateOmaEvidence(request, io = defaultIO) {
68161
68297
  try {
68162
68298
  const status = io.runCli(["agent", "status", request.attempt.id, request.agentId, "--project-root", root], root);
68163
68299
  if (status.exitCode !== 0 || status.stdout.trim() !== `${request.agentId}:completed`) {
68300
+ if (status.stdout.trim() !== `${request.agentId}:stale`)
68301
+ return fail(`OMA CLI ${cliVersion} did not provide the required native <agent>:completed status proof. Update AV and OMA (npm install -g oh-my-agent@latest), then rerun verification; unknown status output cannot establish completion.`);
68164
68302
  return fail("OMA CLI did not confirm current completed evidence");
68165
68303
  }
68166
68304
  } catch (err) {
@@ -68510,7 +68648,7 @@ class AgentRunnerService {
68510
68648
  // ../../packages/core/src/orchestrator/verification-gate.ts
68511
68649
  init_logger();
68512
68650
  init_process_tree();
68513
- import { spawn as spawn14 } from "node:child_process";
68651
+ import { spawn as spawn15 } from "node:child_process";
68514
68652
  var MAX_OUTPUT_LENGTH = 10240;
68515
68653
  var DEFAULT_TIMEOUT_SEC = 600;
68516
68654
  var defaultVerifyExec = (command, cwd, timeoutMs, signal, onSpawned) => new Promise((resolve) => {
@@ -68518,7 +68656,7 @@ var defaultVerifyExec = (command, cwd, timeoutMs, signal, onSpawned) => new Prom
68518
68656
  resolve({ exitCode: -1, output: "Verification cancelled.", timedOut: false, aborted: true });
68519
68657
  return;
68520
68658
  }
68521
- const proc = spawn14(command, {
68659
+ const proc = spawn15(command, {
68522
68660
  cwd,
68523
68661
  shell: true,
68524
68662
  detached: process.platform !== "win32",
@@ -69321,7 +69459,7 @@ function continuousDirectorAdvice(mission) {
69321
69459
  init_execution();
69322
69460
 
69323
69461
  // src/chief-supervisor.ts
69324
- import { spawn as spawn15 } from "node:child_process";
69462
+ import { spawn as spawn16 } from "node:child_process";
69325
69463
  import { randomUUID as randomUUID13 } from "node:crypto";
69326
69464
  import { join as join31 } from "node:path";
69327
69465
  init_execution();
@@ -70162,7 +70300,7 @@ function runWorker(args, root, signal) {
70162
70300
  reject(new Error("CLI entry point is unavailable. Run av order from the installed CLI."));
70163
70301
  return;
70164
70302
  }
70165
- const child = spawn15(process.execPath, [entry, ...args], { cwd: root, stdio: "inherit" });
70303
+ const child = spawn16(process.execPath, [entry, ...args], { cwd: root, stdio: "inherit" });
70166
70304
  const interrupt = () => child.kill("SIGTERM");
70167
70305
  signal.addEventListener("abort", interrupt, { once: true });
70168
70306
  if (signal.aborted)
@@ -74418,21 +74556,21 @@ function checkOma(project, deps) {
74418
74556
  let version = null;
74419
74557
  if (omaPath) {
74420
74558
  try {
74421
- version = deps.getOmaVersion?.() ?? null;
74559
+ version = parseOmaCliVersion(deps.getOmaVersion?.() ?? "") ?? null;
74422
74560
  } catch {}
74423
74561
  }
74424
- results.push(version === SUPPORTED_OMA_VERSION ? {
74562
+ results.push(version !== null ? {
74425
74563
  id: "oma.cli",
74426
- name: "OMA CLI compatibility",
74564
+ name: "OMA CLI availability",
74427
74565
  status: "pass",
74428
- message: `${omaPath} (${version})`,
74566
+ message: `${omaPath} (${version}); receipt schema v${OMA_RECEIPT_SCHEMA_VERSION} and current evidence are checked for each task`,
74429
74567
  critical: false
74430
74568
  } : {
74431
74569
  id: "oma.cli",
74432
- name: "OMA CLI compatibility",
74570
+ name: "OMA CLI availability",
74433
74571
  status: "fail",
74434
- message: omaPath ? `OMA CLI version ${version ?? "unknown"}; expected ${SUPPORTED_OMA_VERSION}` : "oma not found on PATH",
74435
- fix: `Run npm install -g oh-my-agent@${SUPPORTED_OMA_VERSION}, verify with oma --version, then rerun av doctor.`,
74572
+ message: omaPath ? "OMA CLI did not return a valid version" : "oma not found on PATH",
74573
+ fix: "Run npm install -g oh-my-agent@latest, verify with oma --version, then rerun av doctor.",
74436
74574
  critical: true
74437
74575
  });
74438
74576
  const command = project?.verify?.command?.trim();
@@ -75012,7 +75150,7 @@ async function readStatus(port) {
75012
75150
  }
75013
75151
 
75014
75152
  // src/tunnel/cloudflare.ts
75015
- import { spawn as spawn19, spawnSync as spawnSync3 } from "node:child_process";
75153
+ import { spawn as spawn20, spawnSync as spawnSync3 } from "node:child_process";
75016
75154
 
75017
75155
  // src/tunnel/types.ts
75018
75156
  function nullTunnelHandle() {
@@ -75038,7 +75176,7 @@ function spawnCloudflare(cfg, input) {
75038
75176
  return spawnQuick(port, logger);
75039
75177
  }
75040
75178
  function spawnQuick(port, logger) {
75041
- const proc = spawn19("cloudflared", ["tunnel", "--url", `http://localhost:${port}`, "--logformat", "json", "--no-autoupdate"], {
75179
+ const proc = spawn20("cloudflared", ["tunnel", "--url", `http://localhost:${port}`, "--logformat", "json", "--no-autoupdate"], {
75042
75180
  stdio: ["ignore", "pipe", "pipe"],
75043
75181
  detached: true
75044
75182
  });
@@ -75055,7 +75193,7 @@ function spawnNamed(cfg, logger) {
75055
75193
  logger.dim(" Fix: add tunnel.cloudflare.name: <tunnel-name> or switch mode to 'quick'.");
75056
75194
  return nullTunnelHandle();
75057
75195
  }
75058
- const proc = spawn19("cloudflared", ["tunnel", "run", cfg.name, "--no-autoupdate"], {
75196
+ const proc = spawn20("cloudflared", ["tunnel", "run", cfg.name, "--no-autoupdate"], {
75059
75197
  stdio: ["ignore", "pipe", "pipe"],
75060
75198
  detached: true
75061
75199
  });
@@ -75124,7 +75262,7 @@ function emitMissingBinaryWarning(logger) {
75124
75262
  }
75125
75263
 
75126
75264
  // src/tunnel/ngrok.ts
75127
- import { spawn as spawn20, spawnSync as spawnSync4 } from "node:child_process";
75265
+ import { spawn as spawn21, spawnSync as spawnSync4 } from "node:child_process";
75128
75266
  function spawnNgrok(input) {
75129
75267
  const { port, logger } = input;
75130
75268
  const which = spawnSync4("which", ["ngrok"]);
@@ -75132,7 +75270,7 @@ function spawnNgrok(input) {
75132
75270
  emitMissingBinaryWarning2(logger);
75133
75271
  return nullTunnelHandle();
75134
75272
  }
75135
- const proc = spawn20("ngrok", ["http", port, "--log", "stdout", "--log-format", "json"], {
75273
+ const proc = spawn21("ngrok", ["http", port, "--log", "stdout", "--log-format", "json"], {
75136
75274
  stdio: ["ignore", "pipe", "pipe"],
75137
75275
  detached: true
75138
75276
  });
@@ -75263,7 +75401,7 @@ program.command("up").description("Start dashboard + orchestrator + configured t
75263
75401
  else
75264
75402
  mode = "start";
75265
75403
  }
75266
- const dashProc = spawn23("bun", [supervisorScript, dashboardCwd, port, mode], {
75404
+ const dashProc = spawn24("bun", [supervisorScript, dashboardCwd, port, mode], {
75267
75405
  cwd: ROOT,
75268
75406
  stdio: "ignore",
75269
75407
  detached: true
@@ -75344,7 +75482,7 @@ program.command("dev").description("Start in foreground (with file watching + au
75344
75482
  const startDashboard = () => {
75345
75483
  if (shuttingDown)
75346
75484
  return;
75347
- const child = spawn23("bun", ["next", "dev", "--turbopack", "-p", port, "-H", listenHost], {
75485
+ const child = spawn24("bun", ["next", "dev", "--turbopack", "-p", port, "-H", listenHost], {
75348
75486
  cwd: dashboardCwd,
75349
75487
  stdio: "inherit",
75350
75488
  env: { ...process.env, HOSTNAME: listenHost }
@@ -75433,7 +75571,7 @@ program.command("logs").description("Tail dashboard + orchestrator logs").option
75433
75571
  console.log(import_picocolors15.default.yellow("No logs found. Start with: av up"));
75434
75572
  return;
75435
75573
  }
75436
- const tail = spawn23("tail", ["-n", opts.lines, "-f", LOG_FILE], { stdio: "inherit" });
75574
+ const tail = spawn24("tail", ["-n", opts.lines, "-f", LOG_FILE], { stdio: "inherit" });
75437
75575
  process.on("SIGINT", () => {
75438
75576
  tail.kill();
75439
75577
  process.exit(0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-valley",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=26.10.0",