@oxagen/cli 2.1.4-489 → 2.1.4-494

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.
Files changed (2) hide show
  1. package/oxagen.mjs +116 -30
  2. package/package.json +1 -1
package/oxagen.mjs CHANGED
@@ -5615,7 +5615,7 @@ function bundleSkillChars(skill) {
5615
5615
  for (const file of skill.files) chars += file.path.length + file.content.length;
5616
5616
  return chars;
5617
5617
  }
5618
- var TACHO_BATCH_SCHEMA, TACHO_BUNDLE_SCHEMA, TACHO_COMMANDS_SCHEMA, TACHO_ENROLLMENT_CLAIMS_SCHEMA, TACHO_ENFORCEMENT_TIER_ATTR, TACHO_GATEWAY_TIER, TACHO_GATEWAY_SESSION_HEADER, TACHO_GATEWAY_GENESIS_HEADER, TACHO_METERING_ATTR, TACHO_METERING_OBSERVED, TACHO_MODEL_SESSION_HEADER, TACHO_CREDENTIAL_BASIS_ATTR, TACHO_CREDENTIAL_GATEWAY_BROKERED, TACHO_CREDENTIAL_HARNESS_HELD, TACHO_CREDENTIAL_BASES, TACHO_RUN_TOKEN_ATTR, BUNDLE_FEATURE_GATEWAY_TOOLS, BUNDLE_FEATURE_MODEL_PRICES, BUNDLE_FEATURE_MODEL_ALLOWLIST, BUNDLE_FEATURE_INDEPENDENT_MODELS, BUNDLE_FEATURE_HOOK_FAIL_OPEN, BUNDLE_FEATURE_STEERING_MANIFEST, BUNDLE_FEATURE_CONTAINMENT, BUNDLE_FEATURE_DAILY_BUDGET, BUNDLE_FEATURE_STEER_NEXT_STEP, BUNDLE_FEATURE_UNBOUND_REPO, BUNDLE_FEATURE_CEDAR, BUNDLE_FEATURE_SKILLS, BUNDLE_FEATURE_CACHE_KEEP_ALIVE, BUNDLE_FEATURE_WORK_ORDERS, TACHO_BUNDLE_FEATURES, bundleFeaturesSchema, hostEnrollmentIdSchema, tachoPlatformSchema, tachoHarnessSchema, TACHO_HARNESS_LABELS, TACHO_HARNESS_TIERS, WRAPPED_HARNESSES, CONNECTED_HARNESSES, HARNESS_BINARY, MODEL_HARNESS_ROUTES, MODEL_ROUTED_HARNESSES, BROKERABLE_HARNESSES, BROKERABLE_HARNESS_PROVIDER, TACHO_TIER_SUMMARY, CUSTOM_AGENT_NAME_PATTERN, RESERVED_AGENT_NAMES, customAgentNameSchema, tachoHostStatusSchema, tachoBundleModeSchema, tachoCommandSchema, tachoCommandStatusSchema, tachoCommandAckStatusSchema, tachoDeliveryModeSchema, denyGenerationSchema, deliveredCommandSchema, deliveredCommandResponseSchema, WORK_ORDER_ID_PATTERN, WORK_ITEM_ID_PATTERN, workOrderCommandPayloadSchema, WORK_ORDER_CLAIM_PATH, WORK_ORDER_REJECT_PATH, workOrderClaimResponseSchema, workOrderRejectResponseSchema, WORK_ORDER_ENV, WORK_ORDER_ATTR, steeringForceSchema, steeringItemKindSchema, steeringCutReasonSchema, steeringManifestItemSchema, STEERING_MANIFEST_SCHEMA, steeringManifestSchema, steeringManifestFrameSchema, cedarIdSchema, cedarPrincipalSchema, cedarToolSchema, cedarBundleSchema, BUNDLE_SKILLS_MAX, BUNDLE_SKILL_FILES_MAX, BUNDLE_SKILLS_CHARS_MAX, BASE64_PATTERN, bundleSkillFileSchema, bundleSkillSchema, policyBundleSchema, enrollmentClaimsSchema, tachoEventWireSchema, daemonHealthSchema, TACHO_MAX_BATCH, TACHO_MAX_BODY_BYTES, TACHO_MAX_REQUEST_BYTES, TACHO_REQUEST_ENVELOPE_BYTES, tachoBodySchema, tachoBatchSchema, agentDaySpendSchema, controlEnvelopeSchema, ingestResponseSchema, bundleResponseSchema, commandAcknowledgementSchema, commandsResponseSchema, enrollmentResponseSchema, tokenEnrollmentResponseSchema;
5618
+ var TACHO_BATCH_SCHEMA, TACHO_BUNDLE_SCHEMA, TACHO_COMMANDS_SCHEMA, TACHO_ENROLLMENT_CLAIMS_SCHEMA, TACHO_ENFORCEMENT_TIER_ATTR, TACHO_GATEWAY_TIER, TACHO_GATEWAY_SESSION_HEADER, TACHO_GATEWAY_GENESIS_HEADER, MCP_STREAMABLE_HTTP_ACCEPT, TACHO_METERING_ATTR, TACHO_METERING_OBSERVED, TACHO_MODEL_SESSION_HEADER, TACHO_CREDENTIAL_BASIS_ATTR, TACHO_CREDENTIAL_GATEWAY_BROKERED, TACHO_CREDENTIAL_HARNESS_HELD, TACHO_CREDENTIAL_BASES, TACHO_RUN_TOKEN_ATTR, BUNDLE_FEATURE_GATEWAY_TOOLS, BUNDLE_FEATURE_MODEL_PRICES, BUNDLE_FEATURE_MODEL_ALLOWLIST, BUNDLE_FEATURE_INDEPENDENT_MODELS, BUNDLE_FEATURE_HOOK_FAIL_OPEN, BUNDLE_FEATURE_STEERING_MANIFEST, BUNDLE_FEATURE_CONTAINMENT, BUNDLE_FEATURE_DAILY_BUDGET, BUNDLE_FEATURE_STEER_NEXT_STEP, BUNDLE_FEATURE_UNBOUND_REPO, BUNDLE_FEATURE_CEDAR, BUNDLE_FEATURE_SKILLS, BUNDLE_FEATURE_CACHE_KEEP_ALIVE, BUNDLE_FEATURE_WORK_ORDERS, TACHO_BUNDLE_FEATURES, bundleFeaturesSchema, hostEnrollmentIdSchema, tachoPlatformSchema, tachoHarnessSchema, TACHO_HARNESS_LABELS, TACHO_HARNESS_TIERS, WRAPPED_HARNESSES, CONNECTED_HARNESSES, HARNESS_BINARY, MODEL_HARNESS_ROUTES, MODEL_ROUTED_HARNESSES, BROKERABLE_HARNESSES, BROKERABLE_HARNESS_PROVIDER, TACHO_TIER_SUMMARY, CUSTOM_AGENT_NAME_PATTERN, RESERVED_AGENT_NAMES, customAgentNameSchema, tachoHostStatusSchema, tachoBundleModeSchema, tachoCommandSchema, tachoCommandStatusSchema, tachoCommandAckStatusSchema, tachoDeliveryModeSchema, denyGenerationSchema, deliveredCommandSchema, deliveredCommandResponseSchema, WORK_ORDER_ID_PATTERN, WORK_ITEM_ID_PATTERN, workOrderCommandPayloadSchema, WORK_ORDER_CLAIM_PATH, WORK_ORDER_REJECT_PATH, workOrderClaimResponseSchema, workOrderRejectResponseSchema, WORK_ORDER_ENV, WORK_ORDER_ATTR, steeringForceSchema, steeringItemKindSchema, steeringCutReasonSchema, steeringManifestItemSchema, STEERING_MANIFEST_SCHEMA, steeringManifestSchema, steeringManifestFrameSchema, cedarIdSchema, cedarPrincipalSchema, cedarToolSchema, cedarBundleSchema, BUNDLE_SKILLS_MAX, BUNDLE_SKILL_FILES_MAX, BUNDLE_SKILLS_CHARS_MAX, BASE64_PATTERN, bundleSkillFileSchema, bundleSkillSchema, policyBundleSchema, enrollmentClaimsSchema, tachoEventWireSchema, daemonHealthSchema, TACHO_MAX_BATCH, TACHO_MAX_BODY_BYTES, TACHO_MAX_REQUEST_BYTES, TACHO_REQUEST_ENVELOPE_BYTES, tachoBodySchema, tachoBatchSchema, agentDaySpendSchema, controlEnvelopeSchema, ingestResponseSchema, bundleResponseSchema, commandAcknowledgementSchema, commandsResponseSchema, enrollmentResponseSchema, tokenEnrollmentResponseSchema;
5619
5619
  var init_wire = __esm({
5620
5620
  "../../packages/tacho/src/wire.ts"() {
5621
5621
  "use strict";
@@ -5631,6 +5631,7 @@ var init_wire = __esm({
5631
5631
  TACHO_GATEWAY_TIER = "gateway";
5632
5632
  TACHO_GATEWAY_SESSION_HEADER = "x-tacho-gateway-session";
5633
5633
  TACHO_GATEWAY_GENESIS_HEADER = "x-tacho-gateway-genesis";
5634
+ MCP_STREAMABLE_HTTP_ACCEPT = "application/json, text/event-stream";
5634
5635
  TACHO_METERING_ATTR = "oxagen.metering";
5635
5636
  TACHO_METERING_OBSERVED = "observed";
5636
5637
  TACHO_MODEL_SESSION_HEADER = "x-oxagen-session";
@@ -23363,7 +23364,7 @@ import { readFileSync as readFileSync11 } from "node:fs";
23363
23364
  import { dirname as dirname8, resolve as resolve2 } from "node:path";
23364
23365
  import { fileURLToPath } from "node:url";
23365
23366
  function readVersion() {
23366
- if (true) return "2.1.4-489";
23367
+ if (true) return "2.1.4-494";
23367
23368
  try {
23368
23369
  const here = dirname8(fileURLToPath(import.meta.url));
23369
23370
  const pkg = JSON.parse(
@@ -28339,16 +28340,20 @@ function requestedMcpEndpoint(deps, warnings) {
28339
28340
  }
28340
28341
  return request3.pinned;
28341
28342
  }
28342
- function repointCommands(host, runtime) {
28343
- const same = host.hook_command === runtime.hookCommand && sameArgv(host.daemon_command, runtime.daemonCommand) && sameArgv(host.mcp_stdio_command ?? [], runtime.mcpStdioCommand);
28344
- if (same) return void 0;
28343
+ function repointCommands(host, runtime, wrapperVersion) {
28344
+ if (sameCommands(host, runtime) && host.wrapper_version === wrapperVersion)
28345
+ return void 0;
28345
28346
  return {
28346
28347
  ...host,
28347
28348
  hook_command: runtime.hookCommand,
28348
28349
  daemon_command: runtime.daemonCommand,
28349
- mcp_stdio_command: runtime.mcpStdioCommand
28350
+ mcp_stdio_command: runtime.mcpStdioCommand,
28351
+ wrapper_version: wrapperVersion
28350
28352
  };
28351
28353
  }
28354
+ function sameCommands(host, runtime) {
28355
+ return host.hook_command === runtime.hookCommand && sameArgv(host.daemon_command, runtime.daemonCommand) && sameArgv(host.mcp_stdio_command ?? [], runtime.mcpStdioCommand);
28356
+ }
28352
28357
  function sameArgv(a, b5) {
28353
28358
  return a.length === b5.length && a.every((part2, i2) => part2 === b5[i2]);
28354
28359
  }
@@ -28557,7 +28562,7 @@ ${problems.map((problem) => ` ${problem}`).join("\n")}`
28557
28562
  writeHostFile(deps.paths.hostFile, host);
28558
28563
  deps.out(` MCP endpoint pinned to ${pinned} (TACHO_MCP_ENDPOINT)`);
28559
28564
  }
28560
- const repointed = repointCommands(host, deps.runtime);
28565
+ const repointed = repointCommands(host, deps.runtime, deps.wrapperVersion);
28561
28566
  if (repointed !== void 0) {
28562
28567
  if (deps.runtime.transient !== void 0) {
28563
28568
  warnings.push(
@@ -28570,9 +28575,14 @@ ${problems.map((problem) => ` ${problem}`).join("\n")}`
28570
28575
  } else {
28571
28576
  host = { ...repointed, harness_files: harnessFilesRecord(deps.paths) };
28572
28577
  writeHostFile(deps.paths.hostFile, host);
28573
- deps.out(
28574
- ` service and hooks now run from ${deps.runtime.binDir} (was ${existing.hook_command})`
28575
- );
28578
+ if (!sameCommands(existing, deps.runtime))
28579
+ deps.out(
28580
+ ` service and hooks now run from ${deps.runtime.binDir} (was ${existing.hook_command})`
28581
+ );
28582
+ if (existing.wrapper_version !== deps.wrapperVersion)
28583
+ deps.out(
28584
+ ` host.json now records version ${deps.wrapperVersion} (was ${existing.wrapper_version})`
28585
+ );
28576
28586
  }
28577
28587
  }
28578
28588
  } else {
@@ -29906,6 +29916,11 @@ function shimError(id, message) {
29906
29916
  error: { code: -32002, message }
29907
29917
  };
29908
29918
  }
29919
+ function answersNoRequest(message) {
29920
+ if (Array.isArray(message) || !("error" in message)) return false;
29921
+ const id = message.id;
29922
+ return id === null || id === void 0;
29923
+ }
29909
29924
  function resolveTarget(options, deps) {
29910
29925
  const paths = agentPathsForEnrollment(
29911
29926
  tachoHome(deps.env, deps.home),
@@ -29937,8 +29952,9 @@ async function runMcpStdio(options, deps) {
29937
29952
  const text4 = line.trim();
29938
29953
  if (text4.length === 0) continue;
29939
29954
  let id;
29955
+ let method;
29940
29956
  try {
29941
- id = JSON.parse(text4).id;
29957
+ ({ id, method } = JSON.parse(text4));
29942
29958
  } catch {
29943
29959
  deps.stdout.write(
29944
29960
  `${JSON.stringify(shimError(null, "the shim received a line that is not JSON"))}
@@ -29946,7 +29962,7 @@ async function runMcpStdio(options, deps) {
29946
29962
  );
29947
29963
  continue;
29948
29964
  }
29949
- const expectsReply = id !== void 0;
29965
+ const expectsReply = id !== void 0 && typeof method === "string";
29950
29966
  const reply2 = (document) => {
29951
29967
  if (expectsReply) deps.stdout.write(`${JSON.stringify(document)}
29952
29968
  `);
@@ -29961,7 +29977,9 @@ async function runMcpStdio(options, deps) {
29961
29977
  headers: {
29962
29978
  Authorization: `Bearer ${target2.token}`,
29963
29979
  "Content-Type": "application/json",
29964
- Accept: "application/json",
29980
+ // The two media types the MCP transport requires of a client. The
29981
+ // local gateway always answers with JSON, which this accepts.
29982
+ Accept: MCP_STREAMABLE_HTTP_ACCEPT,
29965
29983
  // Loopback, so this is not a real origin check — it is here so the
29966
29984
  // gateway's guard sees a Host it recognises even behind a proxy
29967
29985
  // that rewrites one.
@@ -29983,8 +30001,12 @@ async function runMcpStdio(options, deps) {
29983
30001
  parsed = void 0;
29984
30002
  }
29985
30003
  if (typeof parsed === "object" && parsed !== null) {
29986
- if (expectsReply || response.ok) deps.stdout.write(`${body2}
30004
+ if (expectsReply && answersNoRequest(parsed)) {
30005
+ reply2({ ...parsed, id });
30006
+ } else if (expectsReply) {
30007
+ deps.stdout.write(`${body2}
29987
30008
  `);
30009
+ }
29988
30010
  } else if (!response.ok || expectsReply && body2.length > 0) {
29989
30011
  deps.stderr.write(
29990
30012
  `oxagen mcp-stdio: the gateway answered ${response.status}: ${body2.slice(0, 200)}
@@ -30018,6 +30040,7 @@ var init_mcp_stdio = __esm({
30018
30040
  init_agents();
30019
30041
  init_host_file();
30020
30042
  init_paths();
30043
+ init_wire();
30021
30044
  GATEWAY_TIMEOUT_MS = 5 * 6e4;
30022
30045
  }
30023
30046
  });
@@ -34674,12 +34697,45 @@ function readRpcBody(text4) {
34674
34697
  return JSON.parse(trimmed);
34675
34698
  }
34676
34699
  let last;
34677
- for (const line of trimmed.split(/\r?\n/)) {
34678
- if (line.startsWith("data:")) last = line.slice(5).trim();
34700
+ for (const event of trimmed.split(/\r?\n\r?\n/)) {
34701
+ const data = event.split(/\r?\n/).filter((line) => line.startsWith("data:")).map((line) => line.slice(line.startsWith("data: ") ? 6 : 5));
34702
+ const payload = data.join("\n");
34703
+ if (payload.trim().length > 0) last = payload;
34679
34704
  }
34680
34705
  if (last === void 0) return void 0;
34681
34706
  return JSON.parse(last);
34682
34707
  }
34708
+ function isRpcErrorObject(value) {
34709
+ if (value === null || typeof value !== "object") return false;
34710
+ const error = value;
34711
+ return typeof error["code"] === "number" && typeof error["message"] === "string";
34712
+ }
34713
+ function answerFor(id, upstream) {
34714
+ const { status: status2, body: body2 } = upstream;
34715
+ const ok = status2 >= 200 && status2 < 300;
34716
+ const message = body2 !== null && typeof body2 === "object" && !Array.isArray(body2) ? body2 : void 0;
34717
+ const error = message?.["error"];
34718
+ if (isRpcErrorObject(error)) {
34719
+ if (message?.["id"] === id) return { status: status2, body: body2 };
34720
+ return {
34721
+ status: status2,
34722
+ body: { jsonrpc: "2.0", id, error }
34723
+ };
34724
+ }
34725
+ if (ok && message !== void 0 && "result" in message) {
34726
+ if (message["id"] === id) return { status: status2, body: body2 };
34727
+ }
34728
+ const flat = upstream.text.replace(/\s+/g, " ").trim();
34729
+ const what = flat.length === 0 ? "with no body" : `with a body that is not a JSON-RPC answer to this request: ${flat.slice(0, UPSTREAM_EXCERPT_MAX)}`;
34730
+ return {
34731
+ status: ok ? 502 : status2,
34732
+ body: rpcError(
34733
+ id,
34734
+ RPC_INTERNAL_ERROR,
34735
+ `the Oxagen control plane answered HTTP ${status2} ${what}`
34736
+ )
34737
+ };
34738
+ }
34683
34739
  function outcomeOf(status2, rpc) {
34684
34740
  if (rpc?.error !== void 0)
34685
34741
  return rpc.error.code === RPC_REFUSED ? "rejected" : "error";
@@ -34733,10 +34789,11 @@ function createMcpGateway(deps) {
34733
34789
  headers: {
34734
34790
  Authorization: `Bearer ${attribution2.apiKey}`,
34735
34791
  "Content-Type": "application/json",
34736
- // JSON only: the gateway answers one request at a time and has no
34737
- // stream to hand a client. A server that streams anyway is handled
34738
- // by `readRpcBody`.
34739
- Accept: "application/json",
34792
+ // Both media types, as the MCP transport requires. The hosted
34793
+ // server refuses any other Accept with a 406 (#5356). It answers
34794
+ // with an event stream, and `readRpcBody` reads the response out of
34795
+ // it, so the client still gets one JSON answer.
34796
+ Accept: MCP_STREAMABLE_HTTP_ACCEPT,
34740
34797
  "User-Agent": "oxagen-local-gateway",
34741
34798
  "X-Tacho-Host": attribution2.hostEnrollmentId,
34742
34799
  // Which chain this call belongs to. The control plane takes the
@@ -34756,7 +34813,13 @@ function createMcpGateway(deps) {
34756
34813
  signal: controller.signal
34757
34814
  });
34758
34815
  const text4 = await response.text();
34759
- return { status: response.status, body: readRpcBody(text4) };
34816
+ let body2;
34817
+ try {
34818
+ body2 = readRpcBody(text4);
34819
+ } catch {
34820
+ body2 = void 0;
34821
+ }
34822
+ return { status: response.status, body: body2, text: text4 };
34760
34823
  } finally {
34761
34824
  clearTimeout(timer);
34762
34825
  }
@@ -34809,9 +34872,9 @@ function createMcpGateway(deps) {
34809
34872
  if (name !== void 0) clients.set(context.sessionId, name);
34810
34873
  }
34811
34874
  const startedAt = now();
34812
- let response;
34875
+ let upstream;
34813
34876
  try {
34814
- response = await forward(request3, attribution2);
34877
+ upstream = await forward(request3, attribution2);
34815
34878
  } catch (error) {
34816
34879
  const message = error instanceof Error ? error.message : String(error);
34817
34880
  log(`mcp gateway forward failed: ${message}`);
@@ -34825,6 +34888,17 @@ function createMcpGateway(deps) {
34825
34888
  )
34826
34889
  };
34827
34890
  }
34891
+ let response = typeof request3.id === "string" || typeof request3.id === "number" ? answerFor(request3.id, upstream) : { status: upstream.status, body: upstream.body };
34892
+ if (response.body !== upstream.body) {
34893
+ const said = response.body.error?.message;
34894
+ log(
34895
+ `mcp gateway gave ${request3.method} an error with the request's id after HTTP ${upstream.status}: ${said ?? "no message"}`
34896
+ );
34897
+ } else if (upstream.status < 200 || upstream.status >= 300) {
34898
+ log(
34899
+ `mcp gateway: the control plane answered ${request3.method} with HTTP ${upstream.status}`
34900
+ );
34901
+ }
34828
34902
  const rpc = response.body;
34829
34903
  if (request3.method === "tools/list" && rpc?.result !== void 0) {
34830
34904
  const bundle2 = deps.bundle?.();
@@ -34944,7 +35018,7 @@ function toolNameOf(params) {
34944
35018
  const name = params?.["name"];
34945
35019
  return typeof name === "string" && name.length > 0 ? name : "unknown";
34946
35020
  }
34947
- var RPC_INVALID_REQUEST, RPC_INTERNAL_ERROR, RPC_REFUSED, CLAUDE_CODE_TOOL_USE_ID_META, MAX_TOOL_USE_ID_LENGTH, DEFAULT_TIMEOUT_MS3, REFUSAL_RULES_MAX, REFUSAL_RULE_MAX;
35021
+ var RPC_INVALID_REQUEST, RPC_INTERNAL_ERROR, RPC_REFUSED, CLAUDE_CODE_TOOL_USE_ID_META, MAX_TOOL_USE_ID_LENGTH, DEFAULT_TIMEOUT_MS3, UPSTREAM_EXCERPT_MAX, REFUSAL_RULES_MAX, REFUSAL_RULE_MAX;
34948
35022
  var init_mcp_gateway = __esm({
34949
35023
  "../../packages/tacho/src/collector/mcp-gateway.ts"() {
34950
35024
  "use strict";
@@ -34958,6 +35032,7 @@ var init_mcp_gateway = __esm({
34958
35032
  CLAUDE_CODE_TOOL_USE_ID_META = "claudecode/toolUseId";
34959
35033
  MAX_TOOL_USE_ID_LENGTH = 512;
34960
35034
  DEFAULT_TIMEOUT_MS3 = 3e4;
35035
+ UPSTREAM_EXCERPT_MAX = 200;
34961
35036
  REFUSAL_RULES_MAX = 64;
34962
35037
  REFUSAL_RULE_MAX = 512;
34963
35038
  }
@@ -47228,7 +47303,17 @@ async function initializeDaemon(options, server, port, ready) {
47228
47303
  `no enrollment at ${paths.hostFile}; run \`oxagen agent enroll\` first`
47229
47304
  );
47230
47305
  }
47231
- let host = loaded;
47306
+ let host = loaded.wrapper_version === TACHO_VERSION ? loaded : { ...loaded, wrapper_version: TACHO_VERSION };
47307
+ const onDisk = readHostFileLenient(paths.hostFile).host;
47308
+ if (onDisk !== void 0 && onDisk.host_enrollment_id === host.host_enrollment_id && onDisk.wrapper_version !== TACHO_VERSION) {
47309
+ log(
47310
+ `host.json now records version ${TACHO_VERSION} (was ${onDisk.wrapper_version})`
47311
+ );
47312
+ writeHostFile(paths.hostFile, {
47313
+ ...onDisk,
47314
+ wrapper_version: TACHO_VERSION
47315
+ });
47316
+ }
47232
47317
  for (const dir of [paths.dir, paths.wal, paths.spool, paths.quarantine])
47233
47318
  ensureDir(dir);
47234
47319
  const recallMemories = options.memoryRecall ?? options.listen ?? true ? createMemoryRecall({
@@ -47517,10 +47602,10 @@ async function initializeDaemon(options, server, port, ready) {
47517
47602
  const marked = new Set(marks.map(({ session }) => session));
47518
47603
  const unmarked = registry2.list().filter((session) => within4(session) && !marked.has(session));
47519
47604
  if (unmarked.length > 0) {
47520
- const onDisk = new Set(wal.sessions());
47605
+ const onDisk2 = new Set(wal.sessions());
47521
47606
  for (const session of unmarked) {
47522
47607
  const recorder = session.recorder;
47523
- if (!onDisk.has(recorder.sessionUuid)) {
47608
+ if (!onDisk2.has(recorder.sessionUuid)) {
47524
47609
  recorder.rollbackToBirth();
47525
47610
  continue;
47526
47611
  }
@@ -47612,8 +47697,8 @@ async function initializeDaemon(options, server, port, ready) {
47612
47697
  bundle_etag: host.bundle.etag,
47613
47698
  // What this daemon's `policyBundleSchema` names, so the control plane
47614
47699
  // can send a gated bundle field without breaking hosts that predate it.
47615
- // Reported from the running code rather than from `host.json`, which
47616
- // `enroll` writes once and no upgrade rewrites.
47700
+ // Reported from the running code rather than read off `version`, which
47701
+ // a daemon older than #5365 took from the enrollment, not the upgrade.
47617
47702
  bundle_features: [...TACHO_BUNDLE_FEATURES],
47618
47703
  // Omitted until a read succeeds: absent means nothing was said, and a
47619
47704
  // daemon that could not read the files has nothing to say.
@@ -49811,6 +49896,7 @@ var init_daemon = __esm({
49811
49896
  init_work_orders();
49812
49897
  init_ids();
49813
49898
  init_timestamp();
49899
+ init_version();
49814
49900
  init_wire();
49815
49901
  init_backfill2();
49816
49902
  init_detector();
@@ -52035,7 +52121,7 @@ var init_package = __esm({
52035
52121
  "package.json"() {
52036
52122
  package_default = {
52037
52123
  name: "@oxagen/cli",
52038
- version: "2.1.4-489",
52124
+ version: "2.1.4-494",
52039
52125
  description: "Oxagen governance CLI \u2014 spend, lineage, grounding, credentials, and audit (agentic coding lives in the stella CLI)",
52040
52126
  type: "module",
52041
52127
  main: "./dist/index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxagen/cli",
3
- "version": "2.1.4-489",
3
+ "version": "2.1.4-494",
4
4
  "description": "Oxagen governance CLI — spend, lineage, grounding, credentials, and audit (agentic coding lives in the stella CLI)",
5
5
  "type": "module",
6
6
  "bin": {