omnius 1.0.867 → 1.0.868

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 (27) hide show
  1. package/dist/api/py-embed.js +13 -0
  2. package/dist/index.js +2 -2
  3. package/dist/library.js +220 -194
  4. package/dist/tui/native/worker.js +857 -143
  5. package/dist/update-worker.js +128 -77
  6. package/docs/DISCOVERY.json +1069 -139
  7. package/docs/DISCOVERY.md +26 -7
  8. package/docs/design/media-unification-TODO.md +26 -6
  9. package/docs/design/media-unification-design.md +89 -0
  10. package/docs/design/update-operation-cancellation.md +40 -0
  11. package/docs/design/update-session-restoration-TODO.md +30 -0
  12. package/docs/work-orders/evidence/instrument-media-live-20261016/media-audio-playing.png +0 -0
  13. package/docs/work-orders/evidence/instrument-media-live-20261016/media-image-100x30.png +0 -0
  14. package/docs/work-orders/evidence/instrument-media-live-20261016/media-image-120x36.png +0 -0
  15. package/docs/work-orders/evidence/instrument-media-live-20261016/media-image-160x48.png +0 -0
  16. package/docs/work-orders/evidence/instrument-media-live-20261016/media-image-60x20.png +0 -0
  17. package/docs/work-orders/evidence/instrument-media-live-20261016/media-image-80x24.png +0 -0
  18. package/docs/work-orders/evidence/instrument-media-live-20261016/media-progress-collapsed.png +0 -0
  19. package/docs/work-orders/evidence/instrument-media-live-20261016/media-video-frame-a.png +0 -0
  20. package/docs/work-orders/evidence/instrument-media-live-20261016/media-video-frame-b.png +0 -0
  21. package/docs/work-orders/evidence/instrument-media-live-20261016/media-voice-autocomplete-junction.png +0 -0
  22. package/docs/work-orders/evidence/instrument-media-live-20261016/report.json +813 -0
  23. package/docs/work-orders/evidence/instrument-media-verification-20261016.json +59 -0
  24. package/docs/work-orders/evidence/native-interface-state-verification-20261016.json +59 -0
  25. package/docs/work-orders/evidence/project-media-unification-20261016.json +108 -0
  26. package/npm-shrinkwrap.json +2 -2
  27. package/package.json +1 -1
package/dist/library.js CHANGED
@@ -7118,8 +7118,21 @@ var init_python_cuda_runtime = __esm({
7118
7118
  // packages/execution/dist/tools/media-store-lease.js
7119
7119
  import { AsyncLocalStorage } from "node:async_hooks";
7120
7120
  import { randomUUID as randomUUID9 } from "node:crypto";
7121
- import { closeSync, lstatSync, mkdirSync as mkdirSync2, openSync, readFileSync as readFileSync4, unlinkSync as unlinkSync2, writeFileSync as writeFileSync2 } from "node:fs";
7122
- import { join as join5, resolve as resolve3 } from "node:path";
7121
+ import { closeSync, lstatSync, mkdirSync as mkdirSync2, openSync, readFileSync as readFileSync4, realpathSync, unlinkSync as unlinkSync2, writeFileSync as writeFileSync2 } from "node:fs";
7122
+ import { dirname as dirname3, join as join5, relative, resolve as resolve3 } from "node:path";
7123
+ function configuredRoot(value) {
7124
+ const absolute = resolve3(value);
7125
+ let ancestor = absolute;
7126
+ while (true) {
7127
+ try {
7128
+ return resolve3(realpathSync(ancestor), relative(ancestor, absolute));
7129
+ } catch (error) {
7130
+ if (error.code !== "ENOENT" || dirname3(ancestor) === ancestor)
7131
+ throw error;
7132
+ ancestor = dirname3(ancestor);
7133
+ }
7134
+ }
7135
+ }
7123
7136
  function alive(pid) {
7124
7137
  if (!Number.isInteger(pid) || pid <= 0)
7125
7138
  return false;
@@ -7145,7 +7158,7 @@ function readLease(path7) {
7145
7158
  }
7146
7159
  }
7147
7160
  function acquire(rootValue, operation, parentToken) {
7148
- const root = resolve3(rootValue);
7161
+ const root = configuredRoot(rootValue);
7149
7162
  const path7 = join5(root, ".omnius-media-operation.json");
7150
7163
  const prior = readLease(path7);
7151
7164
  const current2 = ownedLease.getStore();
@@ -7668,7 +7681,7 @@ var init_process_kill = __esm({
7668
7681
  import { randomUUID as randomUUID10, createHash as createHash10 } from "node:crypto";
7669
7682
  import { appendFileSync, closeSync as closeSync2, existsSync as existsSync6, mkdirSync as mkdirSync4, openSync as openSync2, readFileSync as readFileSync6, readSync, readlinkSync, renameSync as renameSync2, rmSync as rmSync2, statSync as statSync3, writeFileSync as writeFileSync4 } from "node:fs";
7670
7683
  import { homedir as homedir2 } from "node:os";
7671
- import { dirname as dirname3, isAbsolute as isAbsolute2, join as join7, relative, resolve as resolve4 } from "node:path";
7684
+ import { dirname as dirname4, isAbsolute as isAbsolute2, join as join7, relative as relative2, resolve as resolve4 } from "node:path";
7672
7685
  function nowFrom(system) {
7673
7686
  return system?.now?.() ?? Date.now();
7674
7687
  }
@@ -7806,7 +7819,7 @@ function writeActiveStore(store, options) {
7806
7819
  };
7807
7820
  const tmp = `${target2}.${process.pid}.${randomUUID10()}.tmp`;
7808
7821
  try {
7809
- mkdirSync4(dirname3(target2), { recursive: true });
7822
+ mkdirSync4(dirname4(target2), { recursive: true });
7810
7823
  writeFileSync4(tmp, JSON.stringify(pruned));
7811
7824
  renameSync2(tmp, target2);
7812
7825
  } catch {
@@ -7840,7 +7853,7 @@ function listProcessLeases(options) {
7840
7853
  function sameOrNestedPath(candidate, root) {
7841
7854
  const resolvedCandidate = resolve4(candidate);
7842
7855
  const resolvedRoot = resolve4(root);
7843
- const rel = relative(resolvedRoot, resolvedCandidate);
7856
+ const rel = relative2(resolvedRoot, resolvedCandidate);
7844
7857
  return rel === "" || !!rel && !rel.startsWith("..") && !isAbsolute2(rel);
7845
7858
  }
7846
7859
  function inspectCurrentProcessIdentity(pid) {
@@ -7913,7 +7926,7 @@ var init_process_lifecycle = __esm({
7913
7926
  });
7914
7927
 
7915
7928
  // packages/execution/dist/background-process-receipt.js
7916
- import { realpathSync } from "node:fs";
7929
+ import { realpathSync as realpathSync2 } from "node:fs";
7917
7930
  function normalize(value) {
7918
7931
  if (!value || typeof value !== "object")
7919
7932
  return null;
@@ -7948,14 +7961,14 @@ function normalize(value) {
7948
7961
  function reopenBackgroundProcessStartReceipt(value, options) {
7949
7962
  try {
7950
7963
  const row2 = normalize(value);
7951
- if (!row2 || realpathSync(options.workspaceRoot) !== row2.workspaceRoot || realpathSync(row2.requestedCwd) !== row2.requestedCwd || options.command !== void 0 && (hashProcessCommand(options.command) !== row2.requestedCommandSha256 || hashProcessCommand(`bash -c ${options.command}`) !== row2.leaseCommandSha256) || options.taskId !== void 0 && options.taskId !== row2.taskId)
7964
+ if (!row2 || realpathSync2(options.workspaceRoot) !== row2.workspaceRoot || realpathSync2(row2.requestedCwd) !== row2.requestedCwd || options.command !== void 0 && (hashProcessCommand(options.command) !== row2.requestedCommandSha256 || hashProcessCommand(`bash -c ${options.command}`) !== row2.leaseCommandSha256) || options.taskId !== void 0 && options.taskId !== row2.taskId)
7952
7965
  return null;
7953
7966
  const leases = listProcessLeases({ includeInactive: true }).filter((lease2) => lease2.leaseId === row2.leaseId);
7954
7967
  if (leases.length !== 1)
7955
7968
  return null;
7956
7969
  const lease = leases[0];
7957
7970
  const now2 = Date.now();
7958
- if (lease.status !== "active" || lease.ownerKind !== "background_task" || lease.ownerId !== row2.taskId || lease.pid !== row2.pid || lease.lifecycle !== "task" || lease.persistent || lease.ownerCompletedAt !== void 0 || realpathSync(lease.projectRoot) !== row2.workspaceRoot || !lease.cwd || realpathSync(lease.cwd) !== row2.requestedCwd || lease.identity?.startSignature !== row2.processStartSignature || lease.commandHash !== row2.leaseCommandSha256 || lease.identity?.commandHash !== row2.processCommandSha256 || now2 - lease.lastHeartbeatAt > PROCESS_LEASE_STALE_MS || lease.expiresAt !== void 0 && lease.expiresAt <= now2 || lease.hardDeadlineAt !== void 0 && lease.hardDeadlineAt <= now2)
7971
+ if (lease.status !== "active" || lease.ownerKind !== "background_task" || lease.ownerId !== row2.taskId || lease.pid !== row2.pid || lease.lifecycle !== "task" || lease.persistent || lease.ownerCompletedAt !== void 0 || realpathSync2(lease.projectRoot) !== row2.workspaceRoot || !lease.cwd || realpathSync2(lease.cwd) !== row2.requestedCwd || lease.identity?.startSignature !== row2.processStartSignature || lease.commandHash !== row2.leaseCommandSha256 || lease.identity?.commandHash !== row2.processCommandSha256 || now2 - lease.lastHeartbeatAt > PROCESS_LEASE_STALE_MS || lease.expiresAt !== void 0 && lease.expiresAt <= now2 || lease.hardDeadlineAt !== void 0 && lease.hardDeadlineAt <= now2)
7959
7972
  return null;
7960
7973
  for (let check2 = 0; check2 < 2; check2++) {
7961
7974
  const identity4 = inspectCurrentProcessIdentity(row2.pid);
@@ -58260,7 +58273,7 @@ var init_dom_summary = __esm({
58260
58273
  import { createHash as createHash14, randomUUID as randomUUID13 } from "node:crypto";
58261
58274
  import { createReadStream, createWriteStream } from "node:fs";
58262
58275
  import { link, mkdir as mkdir3, rm as rm2, stat as stat2 } from "node:fs/promises";
58263
- import { basename as basename2, dirname as dirname4, join as join9, resolve as resolve5 } from "node:path";
58276
+ import { basename as basename2, dirname as dirname5, join as join9, resolve as resolve5 } from "node:path";
58264
58277
  import { Transform } from "node:stream";
58265
58278
  import { pipeline } from "node:stream/promises";
58266
58279
  function safeBrowserDownloadFilename(value) {
@@ -58290,7 +58303,7 @@ async function persistBrowserDownload(source, input) {
58290
58303
  }, input.timeoutMs);
58291
58304
  const workingDir = input.workingDir ?? process.cwd();
58292
58305
  const destination = input.outputPath ? resolve5(workingDir, input.outputPath) : resolve5(workingDir, ".omnius", "browser-downloads", input.sessionId, `${randomUUID13()}-${safeBrowserDownloadFilename(input.suggestedFilename)}`);
58293
- const temporary = join9(dirname4(destination), `.download-${randomUUID13()}.part`);
58306
+ const temporary = join9(dirname5(destination), `.download-${randomUUID13()}.part`);
58294
58307
  let published = false;
58295
58308
  let success = false;
58296
58309
  let receipt;
@@ -58298,7 +58311,7 @@ async function persistBrowserDownload(source, input) {
58298
58311
  if (input.signal?.aborted)
58299
58312
  cancel();
58300
58313
  controller.signal.throwIfAborted();
58301
- await mkdir3(dirname4(destination), { recursive: true });
58314
+ await mkdir3(dirname5(destination), { recursive: true });
58302
58315
  const streamPromise = Promise.resolve(source.createReadStream());
58303
58316
  void streamPromise.then((stream2) => {
58304
58317
  if (controller.signal.aborted)
@@ -59616,7 +59629,7 @@ Saved to: ${outputPath}`;
59616
59629
  // packages/execution/dist/tools/vision.js
59617
59630
  import { mkdirSync as mkdirSync6, readFileSync as readFileSync9, existsSync as existsSync9, statSync as statSync4, unlinkSync as unlinkSync4, writeFileSync as writeFileSync7, readdirSync as readdirSync4 } from "node:fs";
59618
59631
  import { execSync, spawn as spawn3, spawnSync } from "node:child_process";
59619
- import { resolve as resolve6, extname, basename as basename3, dirname as dirname5, join as join11 } from "node:path";
59632
+ import { resolve as resolve6, extname, basename as basename3, dirname as dirname6, join as join11 } from "node:path";
59620
59633
  import { fileURLToPath as fileURLToPath2 } from "node:url";
59621
59634
  function visionPythonEnv(extra = {}) {
59622
59635
  const env = { ...process.env, ...unifiedPythonEnv(), ...extra };
@@ -59700,7 +59713,7 @@ function findStationBinary() {
59700
59713
  const omniusVenvBin = isWin2 ? join11(venvBase, "Scripts", "moondream-station.exe") : join11(venvBase, "bin", "moondream-station");
59701
59714
  if (existsSync9(omniusVenvBin))
59702
59715
  return omniusVenvBin;
59703
- const thisDir = dirname5(fileURLToPath2(import.meta.url));
59716
+ const thisDir = dirname6(fileURLToPath2(import.meta.url));
59704
59717
  const pyBin = isWin2 ? "Scripts/python.exe" : "bin/python";
59705
59718
  const localVenvPaths = [
59706
59719
  resolve6(thisDir, `../../../../.moondream-venv/${pyBin}`),
@@ -59737,7 +59750,7 @@ async function autoLaunchStation(port = 2020) {
59737
59750
  const pythonBin = findStationBinary();
59738
59751
  if (!pythonBin)
59739
59752
  return false;
59740
- const thisDir = dirname5(fileURLToPath2(import.meta.url));
59753
+ const thisDir = dirname6(fileURLToPath2(import.meta.url));
59741
59754
  const launcherScript = resolve6(thisDir, "../../scripts/start-moondream.py");
59742
59755
  if (!existsSync9(launcherScript))
59743
59756
  return false;
@@ -60475,7 +60488,7 @@ async function ensureHuggingFaceVisionPython(modelId, signal) {
60475
60488
  const venvDir = unifiedRuntimeDir("vision", MANAGED_HF_VISION_BACKEND);
60476
60489
  const python = venvPython(venvDir);
60477
60490
  if (!existsSync9(python)) {
60478
- mkdirSync6(dirname5(venvDir), { recursive: true });
60491
+ mkdirSync6(dirname6(venvDir), { recursive: true });
60479
60492
  const created = await runVisionProcess("python3", ["-m", "venv", "--system-site-packages", venvDir], {
60480
60493
  timeout: 18e4,
60481
60494
  env: visionPythonEnv(),
@@ -61307,7 +61320,7 @@ import { randomUUID as randomUUID14 } from "node:crypto";
61307
61320
  import { isDeepStrictEqual as isDeepStrictEqual5 } from "node:util";
61308
61321
  import { execFileSync } from "node:child_process";
61309
61322
  import { existsSync as existsSync10, mkdirSync as mkdirSync7, readFileSync as readFileSync10, writeFileSync as writeFileSync8 } from "node:fs";
61310
- import { dirname as dirname6, isAbsolute as isAbsolute3, join as join12, resolve as resolve7 } from "node:path";
61323
+ import { dirname as dirname7, isAbsolute as isAbsolute3, join as join12, resolve as resolve7 } from "node:path";
61311
61324
  import { pathToFileURL } from "node:url";
61312
61325
  import { homedir as homedir3 } from "node:os";
61313
61326
  function browserState() {
@@ -62248,7 +62261,7 @@ function defaultArtifactPath(kind, suffix) {
62248
62261
  }
62249
62262
  function saveBuffer(filePath, buffer) {
62250
62263
  const resolved = resolve7(process.cwd(), filePath);
62251
- mkdirSync7(dirname6(resolved), { recursive: true });
62264
+ mkdirSync7(dirname7(resolved), { recursive: true });
62252
62265
  writeFileSync8(resolved, buffer);
62253
62266
  return resolved;
62254
62267
  }
@@ -80507,7 +80520,7 @@ var init_metabolism = __esm({
80507
80520
 
80508
80521
  // packages/memory/dist/maintenance.js
80509
80522
  import { appendFileSync as appendFileSync2, closeSync as closeSync3, existsSync as existsSync16, mkdirSync as mkdirSync13, openSync as openSync3, readFileSync as readFileSync14, readSync as readSync2, readdirSync as readdirSync6, renameSync as renameSync4, statSync as statSync5, unlinkSync as unlinkSync5, writeFileSync as writeFileSync12 } from "node:fs";
80510
- import { dirname as dirname7, join as join19 } from "node:path";
80523
+ import { dirname as dirname8, join as join19 } from "node:path";
80511
80524
  function envInt(name, fallback) {
80512
80525
  const raw = Number.parseInt(process.env[name] ?? "", 10);
80513
80526
  return Number.isFinite(raw) && raw >= 0 ? raw : fallback;
@@ -80605,7 +80618,7 @@ function emptyResult(options, started) {
80605
80618
  function storeStats(path7) {
80606
80619
  const walPath = `${path7}-wal`;
80607
80620
  const shmPath = `${path7}-shm`;
80608
- const archivePath = path7.endsWith("knowledge.db") ? join19(dirname7(path7), "knowledge.archive.db") : "";
80621
+ const archivePath = path7.endsWith("knowledge.db") ? join19(dirname8(path7), "knowledge.archive.db") : "";
80609
80622
  const sizeBeforeBytes = fileSize(path7);
80610
80623
  const walBeforeBytes = fileSize(walPath);
80611
80624
  const shmBeforeBytes = fileSize(shmPath);
@@ -80628,7 +80641,7 @@ function storeStats(path7) {
80628
80641
  function refreshStoreStatsAfter(stats) {
80629
80642
  const walPath = `${stats.path}-wal`;
80630
80643
  const shmPath = `${stats.path}-shm`;
80631
- const archivePath = stats.path.endsWith("knowledge.db") ? join19(dirname7(stats.path), "knowledge.archive.db") : "";
80644
+ const archivePath = stats.path.endsWith("knowledge.db") ? join19(dirname8(stats.path), "knowledge.archive.db") : "";
80632
80645
  stats.sizeAfterBytes = fileSize(stats.path);
80633
80646
  stats.walAfterBytes = fileSize(walPath);
80634
80647
  stats.shmAfterBytes = fileSize(shmPath);
@@ -82760,7 +82773,7 @@ var init_hf_media_models = __esm({
82760
82773
 
82761
82774
  // packages/execution/dist/tools/skill-tools.js
82762
82775
  import { existsSync as existsSync17, readdirSync as readdirSync7, readFileSync as readFileSync15 } from "node:fs";
82763
- import { join as join20, basename as basename4, dirname as dirname8 } from "node:path";
82776
+ import { join as join20, basename as basename4, dirname as dirname9 } from "node:path";
82764
82777
  import { homedir as homedir5 } from "node:os";
82765
82778
  import { execSync as execSync2 } from "node:child_process";
82766
82779
  import { fileURLToPath as fileURLToPath3 } from "node:url";
@@ -82825,11 +82838,11 @@ function findBundledOmniusDocsRoot() {
82825
82838
  const envRoot = process.env["OMNIUS_DOCS_ROOT"];
82826
82839
  if (envRoot && hasBundledOmniusDocs(envRoot))
82827
82840
  return envRoot;
82828
- let current2 = dirname8(fileURLToPath3(import.meta.url));
82841
+ let current2 = dirname9(fileURLToPath3(import.meta.url));
82829
82842
  for (let depth = 0; depth < 8; depth++) {
82830
82843
  if (hasBundledOmniusDocs(current2))
82831
82844
  return current2;
82832
- const parent = dirname8(current2);
82845
+ const parent = dirname9(current2);
82833
82846
  if (parent === current2)
82834
82847
  break;
82835
82848
  current2 = parent;
@@ -82850,7 +82863,7 @@ function findBundledSkillsRoot(repoRoot) {
82850
82863
  if (hasBundledFlaviocopesSkills(candidate))
82851
82864
  return candidate;
82852
82865
  }
82853
- let current2 = dirname8(fileURLToPath3(import.meta.url));
82866
+ let current2 = dirname9(fileURLToPath3(import.meta.url));
82854
82867
  for (let depth = 0; depth < 10; depth++) {
82855
82868
  for (const candidate of [
82856
82869
  join20(current2, "skills"),
@@ -82859,7 +82872,7 @@ function findBundledSkillsRoot(repoRoot) {
82859
82872
  if (hasBundledFlaviocopesSkills(candidate))
82860
82873
  return candidate;
82861
82874
  }
82862
- const parent = dirname8(current2);
82875
+ const parent = dirname9(current2);
82863
82876
  if (parent === current2)
82864
82877
  break;
82865
82878
  current2 = parent;
@@ -83112,7 +83125,7 @@ function loadCommandsFromDir(dir, source, out) {
83112
83125
  }
83113
83126
  }
83114
83127
  function loadSkillProvenance(skillPath) {
83115
- const provenance2 = readProvenanceFile(join20(dirname8(skillPath), "PROVENANCE.json"));
83128
+ const provenance2 = readProvenanceFile(join20(dirname9(skillPath), "PROVENANCE.json"));
83116
83129
  return provenance2 ? summarizeProvenance(provenance2) : void 0;
83117
83130
  }
83118
83131
  function parseCommandDescription(filePath) {
@@ -83345,7 +83358,7 @@ var init_pcm16_silence_gate = __esm({
83345
83358
  });
83346
83359
 
83347
83360
  // packages/execution/dist/tools/transcribe-tool.js
83348
- import { join as join21, basename as basename5, dirname as dirname9, extname as extname2, resolve as resolve8 } from "node:path";
83361
+ import { join as join21, basename as basename5, dirname as dirname10, extname as extname2, resolve as resolve8 } from "node:path";
83349
83362
  import { homedir as homedir6, tmpdir as tmpdir2 } from "node:os";
83350
83363
  var MAX_TRANSCRIBE_URL_BYTES, MANAGED_ASR_VENV, MANAGED_TRANSCRIBE_CLI_DIR, YT_DLP_VENV;
83351
83364
  var init_transcribe_tool = __esm({
@@ -83497,14 +83510,24 @@ var init_embedding_store = __esm({
83497
83510
  }
83498
83511
  });
83499
83512
 
83513
+ // packages/execution/dist/tools/media-progress.js
83514
+ var init_media_progress = __esm({
83515
+ "packages/execution/dist/tools/media-progress.js"() {
83516
+ "use strict";
83517
+ }
83518
+ });
83519
+
83500
83520
  // packages/execution/dist/tools/image-generate.js
83521
+ import { AsyncLocalStorage as AsyncLocalStorage4 } from "node:async_hooks";
83501
83522
  function officialBflModel(model) {
83502
83523
  return `${OFFICIAL_BFL_ORG}/${model}`;
83503
83524
  }
83504
- var LEGACY_SDXL_TURBO_MODEL, SANA_1_5_1_6B_MODEL, SANA_1_5_4_8B_MODEL, SANA_1_6B_MULTILING_MODEL, SANA_1_6B_2K_MODEL, SANA_1_6B_4K_MODEL, SANA_SPRINT_0_6B_MODEL, SECONDARY_FLUX_DEV_MODEL, SECONDARY_FLUX_DEV_MIRROR_MODEL, SECONDARY_FLUX_DEV_COMFY_MODEL, SECONDARY_FLUX_FILL_MODEL, SECONDARY_FLUX_FILL_FP8_MODEL, SECONDARY_FLUX2_MODEL, OFFICIAL_FLUX1_DEV_MODEL, OFFICIAL_FLUX2_KLEIN_9B_MODEL, PONPOKE_FLUX2_UNCENSORED_TEXT_ENCODER_MODEL, LUSTLY_FLUX_UNCENSORED_LORA_MODEL, KENERATE_FLUX_UNCENSORED_LORA_MODEL, OFFICIAL_BFL_ORG, IMAGE_GENERATION_MODEL_REPLACEMENTS, IMAGE_GENERATION_MODEL_PRESETS, OLLAMA_IMAGE_MODELS, DIFFUSERS_RUNNER, SDCPP_RUNNER;
83525
+ var LEGACY_SDXL_TURBO_MODEL, SANA_1_5_1_6B_MODEL, SANA_1_5_4_8B_MODEL, SANA_1_6B_MULTILING_MODEL, SANA_1_6B_2K_MODEL, SANA_1_6B_4K_MODEL, SANA_SPRINT_0_6B_MODEL, SECONDARY_FLUX_DEV_MODEL, SECONDARY_FLUX_DEV_MIRROR_MODEL, SECONDARY_FLUX_DEV_COMFY_MODEL, SECONDARY_FLUX_FILL_MODEL, SECONDARY_FLUX_FILL_FP8_MODEL, SECONDARY_FLUX2_MODEL, OFFICIAL_FLUX1_DEV_MODEL, OFFICIAL_FLUX2_KLEIN_9B_MODEL, PONPOKE_FLUX2_UNCENSORED_TEXT_ENCODER_MODEL, LUSTLY_FLUX_UNCENSORED_LORA_MODEL, KENERATE_FLUX_UNCENSORED_LORA_MODEL, OFFICIAL_BFL_ORG, IMAGE_GENERATION_MODEL_REPLACEMENTS, IMAGE_GENERATION_MODEL_PRESETS, OLLAMA_IMAGE_MODELS, DIFFUSERS_RUNNER, SDCPP_RUNNER, imageInvocationSignal;
83505
83526
  var init_image_generate = __esm({
83506
83527
  "packages/execution/dist/tools/image-generate.js"() {
83507
83528
  "use strict";
83529
+ init_process_async();
83530
+ init_media_progress();
83508
83531
  init_media_store_lease();
83509
83532
  init_model_broker();
83510
83533
  init_venv_paths();
@@ -84322,6 +84345,7 @@ def main():
84322
84345
  if __name__ == "__main__":
84323
84346
  main()
84324
84347
  `;
84348
+ imageInvocationSignal = new AsyncLocalStorage4();
84325
84349
  }
84326
84350
  });
84327
84351
 
@@ -84331,6 +84355,7 @@ var init_audio_generate = __esm({
84331
84355
  "packages/execution/dist/tools/audio-generate.js"() {
84332
84356
  "use strict";
84333
84357
  init_process_async();
84358
+ init_media_progress();
84334
84359
  init_media_store_lease();
84335
84360
  init_model_broker();
84336
84361
  init_venv_paths();
@@ -85020,6 +85045,7 @@ var init_video_generate = __esm({
85020
85045
  init_owned_service_process();
85021
85046
  init_process_async();
85022
85047
  init_network_egress_policy();
85048
+ init_media_progress();
85023
85049
  init_media_store_lease();
85024
85050
  init_model_broker();
85025
85051
  init_venv_paths();
@@ -86330,7 +86356,7 @@ var init_ocr_image_advanced = __esm({
86330
86356
 
86331
86357
  // packages/execution/dist/tools/browser-action.js
86332
86358
  import { copyFileSync, existsSync as existsSync19, mkdirSync as mkdirSync15, readFileSync as readFileSync17 } from "node:fs";
86333
- import { basename as basename6, dirname as dirname10, join as join23, resolve as resolve9 } from "node:path";
86359
+ import { basename as basename6, dirname as dirname11, join as join23, resolve as resolve9 } from "node:path";
86334
86360
  import { fileURLToPath as fileURLToPath4 } from "node:url";
86335
86361
  function findScrapeScript() {
86336
86362
  const candidates = [
@@ -86356,7 +86382,7 @@ var init_browser_action = __esm({
86356
86382
  init_dom_summary();
86357
86383
  init_model_store();
86358
86384
  init_network_egress_policy();
86359
- __dirname2 = dirname10(fileURLToPath4(import.meta.url));
86385
+ __dirname2 = dirname11(fileURLToPath4(import.meta.url));
86360
86386
  DEFAULT_PORT = 8130;
86361
86387
  SCRAPE_SCRIPT = findScrapeScript();
86362
86388
  BASE_URL = `http://localhost:${DEFAULT_PORT}`;
@@ -86432,13 +86458,13 @@ var init_cron_agent = __esm({
86432
86458
 
86433
86459
  // packages/execution/dist/tools/file-explore.js
86434
86460
  import { resolve as resolve10 } from "node:path";
86435
- import { realpathSync as realpathSync2 } from "node:fs";
86461
+ import { realpathSync as realpathSync3 } from "node:fs";
86436
86462
  function notesKey(scope) {
86437
86463
  if (!scope.sessionId || scope.taskEpoch !== void 0 && (!Number.isSafeInteger(scope.taskEpoch) || scope.taskEpoch < 0))
86438
86464
  throw new Error("Invalid exploration scope");
86439
86465
  let cwd = resolve10(scope.workingDir);
86440
86466
  try {
86441
- cwd = realpathSync2(cwd);
86467
+ cwd = realpathSync3(cwd);
86442
86468
  } catch {
86443
86469
  }
86444
86470
  return JSON.stringify([cwd, scope.sessionId, scope.taskEpoch ?? null, scope.ownerId ?? null]);
@@ -89202,7 +89228,7 @@ var require_util = __commonJS({
89202
89228
  exports.isAbsolute = function(aPath) {
89203
89229
  return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
89204
89230
  };
89205
- function relative17(aRoot, aPath) {
89231
+ function relative18(aRoot, aPath) {
89206
89232
  if (aRoot === "") {
89207
89233
  aRoot = ".";
89208
89234
  }
@@ -89221,7 +89247,7 @@ var require_util = __commonJS({
89221
89247
  }
89222
89248
  return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
89223
89249
  }
89224
- exports.relative = relative17;
89250
+ exports.relative = relative18;
89225
89251
  var supportsNullProto = (function() {
89226
89252
  var obj = /* @__PURE__ */ Object.create(null);
89227
89253
  return !("__proto__" in obj);
@@ -100652,11 +100678,11 @@ ${lanes.join("\n")}
100652
100678
  return toComponents;
100653
100679
  }
100654
100680
  const components = toComponents.slice(start);
100655
- const relative17 = [];
100681
+ const relative18 = [];
100656
100682
  for (; start < fromComponents.length; start++) {
100657
- relative17.push("..");
100683
+ relative18.push("..");
100658
100684
  }
100659
- return ["", ...relative17, ...components];
100685
+ return ["", ...relative18, ...components];
100660
100686
  }
100661
100687
  function getRelativePathFromDirectory(fromDirectory, to, getCanonicalFileNameOrIgnoreCase) {
100662
100688
  Debug.assert(getRootLength(fromDirectory) > 0 === getRootLength(to) > 0, "Paths must either both be absolute or both be relative");
@@ -145199,9 +145225,9 @@ ${lanes.join("\n")}
145199
145225
  if (!startsWithDirectory(target2, realPathDirectory, getCanonicalFileName)) {
145200
145226
  return;
145201
145227
  }
145202
- const relative17 = getRelativePathFromDirectory(realPathDirectory, target2, getCanonicalFileName);
145228
+ const relative18 = getRelativePathFromDirectory(realPathDirectory, target2, getCanonicalFileName);
145203
145229
  for (const symlinkDirectory of symlinkDirectories) {
145204
- const option = resolvePath(symlinkDirectory, relative17);
145230
+ const option = resolvePath(symlinkDirectory, relative18);
145205
145231
  const result2 = cb(option, target2 === referenceRedirect);
145206
145232
  shouldFilterIgnoredPaths = true;
145207
145233
  if (result2) return result2;
@@ -304802,7 +304828,7 @@ var require_path_browserify = __commonJS({
304802
304828
  return ".";
304803
304829
  return posix.normalize(joined);
304804
304830
  },
304805
- relative: function relative17(from, to) {
304831
+ relative: function relative18(from, to) {
304806
304832
  assertPath(from);
304807
304833
  assertPath(to);
304808
304834
  if (from === to) return "";
@@ -304871,7 +304897,7 @@ var require_path_browserify = __commonJS({
304871
304897
  _makeLong: function _makeLong(path7) {
304872
304898
  return path7;
304873
304899
  },
304874
- dirname: function dirname36(path7) {
304900
+ dirname: function dirname37(path7) {
304875
304901
  assertPath(path7);
304876
304902
  if (path7.length === 0) return ".";
304877
304903
  var code2 = path7.charCodeAt(0);
@@ -307632,12 +307658,12 @@ var require_dist2 = __commonJS({
307632
307658
  return patterns.length > 0 ? buildCrawler(options, patterns) : [];
307633
307659
  }
307634
307660
  async function glob2(globInput, options) {
307635
- const [crawler, relative17] = getCrawler(globInput, options);
307636
- return crawler ? formatPaths(await crawler.withPromise(), relative17) : [];
307661
+ const [crawler, relative18] = getCrawler(globInput, options);
307662
+ return crawler ? formatPaths(await crawler.withPromise(), relative18) : [];
307637
307663
  }
307638
307664
  function globSync(globInput, options) {
307639
- const [crawler, relative17] = getCrawler(globInput, options);
307640
- return crawler ? formatPaths(crawler.sync(), relative17) : [];
307665
+ const [crawler, relative18] = getCrawler(globInput, options);
307666
+ return crawler ? formatPaths(crawler.sync(), relative18) : [];
307641
307667
  }
307642
307668
  exports.convertPathToPattern = convertPathToPattern;
307643
307669
  exports.escapePath = escapePath;
@@ -333186,7 +333212,7 @@ var init_ts_morph_parser = __esm({
333186
333212
  import { createRequire as createRequire2 } from "node:module";
333187
333213
  import { createHash as createHash34 } from "node:crypto";
333188
333214
  import { mkdirSync as mkdirSync18, readFileSync as readFileSync20 } from "node:fs";
333189
- import { join as join26, dirname as dirname11, extname as extname3 } from "node:path";
333215
+ import { join as join26, dirname as dirname12, extname as extname3 } from "node:path";
333190
333216
  function loadDatabaseCtor() {
333191
333217
  if (_DatabaseCtor)
333192
333218
  return _DatabaseCtor;
@@ -333236,7 +333262,7 @@ function extractFileSymbols(content, filePath) {
333236
333262
  }
333237
333263
  function extractFileImports(content, filePath) {
333238
333264
  const imports = [];
333239
- const dir = dirname11(filePath);
333265
+ const dir = dirname12(filePath);
333240
333266
  const esRe = /(?:import|export)\s+(?:[\s\S]*?)\s+from\s+['"]([^'"]+)['"]/g;
333241
333267
  let m;
333242
333268
  while ((m = esRe.exec(content)) !== null) {
@@ -333306,7 +333332,7 @@ var init_code_graph_db = __esm({
333306
333332
  constructor(rootDir, dbPath) {
333307
333333
  this.rootDir = rootDir;
333308
333334
  const resolvedPath = dbPath ?? join26(rootDir, ".omnius", "index", "code-graph.db");
333309
- mkdirSync18(dirname11(resolvedPath), { recursive: true });
333335
+ mkdirSync18(dirname12(resolvedPath), { recursive: true });
333310
333336
  const Database = loadDatabaseCtor();
333311
333337
  this.db = new Database(resolvedPath);
333312
333338
  this.db.pragma("journal_mode = WAL");
@@ -333406,7 +333432,7 @@ var init_code_graph_db = __esm({
333406
333432
  for (const sym of astGraph.symbols) {
333407
333433
  this.stmts.insertSymbol.run(relPath, sym.name, sym.kind, sym.startLine, sym.endLine, sym.signature, sym.docstring, sym.exported ? 1 : 0);
333408
333434
  }
333409
- const dir = dirname11(relPath);
333435
+ const dir = dirname12(relPath);
333410
333436
  for (const edge of astGraph.edges) {
333411
333437
  if (edge.kind === "imports") {
333412
333438
  let target2 = edge.target;
@@ -333747,7 +333773,7 @@ var init_code_graph_events = __esm({
333747
333773
 
333748
333774
  // packages/execution/dist/tools/code-graph-client.js
333749
333775
  import { existsSync as existsSync22, statSync as statSync7, readdirSync as readdirSync9 } from "node:fs";
333750
- import { join as join27, relative as relative2, sep as sep3 } from "node:path";
333776
+ import { join as join27, relative as relative3, sep as sep3 } from "node:path";
333751
333777
  function codeGraphDBExists(workingDir) {
333752
333778
  const path7 = join27(workingDir, ".omnius", "index", "code-graph.db");
333753
333779
  try {
@@ -334663,7 +334689,7 @@ var init_full_sub_agent = __esm({
334663
334689
 
334664
334690
  // packages/execution/dist/mutation-contract.js
334665
334691
  import { existsSync as existsSync23, statSync as statSync8 } from "node:fs";
334666
- import { basename as basename8, isAbsolute as isAbsolute5, relative as relative3, resolve as resolve12, sep as sep4 } from "node:path";
334692
+ import { basename as basename8, isAbsolute as isAbsolute5, relative as relative4, resolve as resolve12, sep as sep4 } from "node:path";
334667
334693
  function observeShellMutation(extraction, before, after) {
334668
334694
  const attemptedPaths = [...new Set(extraction.paths)].sort();
334669
334695
  const effectivePaths = [];
@@ -334718,7 +334744,7 @@ function normalizeMutationPath(root, pathValue) {
334718
334744
  if (!trimmed)
334719
334745
  return "";
334720
334746
  const absolute = isAbsolute5(trimmed) ? resolve12(trimmed) : resolve12(root, trimmed);
334721
- const rel = relative3(resolve12(root), absolute).split(sep4).join("/");
334747
+ const rel = relative4(resolve12(root), absolute).split(sep4).join("/");
334722
334748
  return rel === "" ? "." : rel;
334723
334749
  }
334724
334750
  function normalizeMany(root, values) {
@@ -335051,7 +335077,7 @@ function extractValidatedDelegationPaths(args, root) {
335051
335077
  if (!hasDelegationPathShape(cleaned))
335052
335078
  continue;
335053
335079
  const abs = isAbsolute5(cleaned) ? resolve12(cleaned) : resolve12(rootAbs, cleaned);
335054
- const rel = relative3(rootAbs, abs);
335080
+ const rel = relative4(rootAbs, abs);
335055
335081
  if (rel.startsWith("..") || isAbsolute5(rel))
335056
335082
  continue;
335057
335083
  if (!existsSync23(abs))
@@ -335113,9 +335139,9 @@ function detectWorkspaceDestructiveCommand(command, workspaceRoot = process.cwd(
335113
335139
  return null;
335114
335140
  }
335115
335141
  function extractShellMutationPaths(command, options = {}) {
335116
- const configuredRoot = options.workingDir ?? process.cwd();
335142
+ const configuredRoot2 = options.workingDir ?? process.cwd();
335117
335143
  const leadingCd = command.match(/^\s*cd\s+((?:"[^"]+")|(?:'[^']+')|(?:[^\s;&|]+))\s*&&/);
335118
- const root = leadingCd ? resolve12(configuredRoot, cleanShellPathToken(leadingCd[1]) || ".") : configuredRoot;
335144
+ const root = leadingCd ? resolve12(configuredRoot2, cleanShellPathToken(leadingCd[1]) || ".") : configuredRoot2;
335119
335145
  const paths2 = [];
335120
335146
  let mutates2 = false;
335121
335147
  let unknownMutation = false;
@@ -335124,7 +335150,7 @@ function extractShellMutationPaths(command, options = {}) {
335124
335150
  if (!candidate || !isProjectPathCandidate(candidate))
335125
335151
  return;
335126
335152
  const absolute = isAbsolute5(candidate) ? resolve12(candidate) : resolve12(root, candidate);
335127
- paths2.push(normalizeMutationPath(configuredRoot, absolute));
335153
+ paths2.push(normalizeMutationPath(configuredRoot2, absolute));
335128
335154
  };
335129
335155
  for (const match2 of command.matchAll(/\bopen\(\s*(['"])([^'"]+)\1\s*,\s*(['"])([^'"]*[wax+][^'"]*)\3/g)) {
335130
335156
  const mode = match2[4] ?? "";
@@ -335404,7 +335430,7 @@ var init_client = __esm({
335404
335430
 
335405
335431
  // packages/execution/dist/mcp/secret-store.js
335406
335432
  import { existsSync as existsSync24, readFileSync as readFileSync21, writeFileSync as writeFileSync16, mkdirSync as mkdirSync19, chmodSync, statSync as statSync9 } from "node:fs";
335407
- import { join as join31, dirname as dirname12 } from "node:path";
335433
+ import { join as join31, dirname as dirname13 } from "node:path";
335408
335434
  import { homedir as homedir11 } from "node:os";
335409
335435
  import { randomBytes as randomBytes5, createHash as createHash35 } from "node:crypto";
335410
335436
  function secretsPath(scope, repoRoot) {
@@ -335423,7 +335449,7 @@ function readStore(path7) {
335423
335449
  return { version: 1, secrets: {} };
335424
335450
  }
335425
335451
  function writeStore(path7, store) {
335426
- mkdirSync19(dirname12(path7), { recursive: true });
335452
+ mkdirSync19(dirname13(path7), { recursive: true });
335427
335453
  writeFileSync16(path7, JSON.stringify(store, null, 2) + "\n", { mode: 384 });
335428
335454
  try {
335429
335455
  chmodSync(path7, 384);
@@ -335734,7 +335760,7 @@ var init_video_understand = __esm({
335734
335760
  });
335735
335761
 
335736
335762
  // packages/execution/dist/tools/video-scan.js
335737
- import { resolve as resolve14, dirname as dirname13, join as join33, basename as basename10 } from "node:path";
335763
+ import { resolve as resolve14, dirname as dirname14, join as join33, basename as basename10 } from "node:path";
335738
335764
  import { homedir as homedir13 } from "node:os";
335739
335765
  var CONFIG_PATH;
335740
335766
  var init_video_scan = __esm({
@@ -335817,7 +335843,7 @@ var init_live_media_loop = __esm({
335817
335843
  });
335818
335844
 
335819
335845
  // packages/execution/dist/tools/lance.js
335820
- import { resolve as resolve16, dirname as dirname14, join as join35, basename as basename12 } from "node:path";
335846
+ import { resolve as resolve16, dirname as dirname15, join as join35, basename as basename12 } from "node:path";
335821
335847
  import { homedir as homedir15 } from "node:os";
335822
335848
  var CONFIG_PATH2, RUN_TIMEOUT_MS;
335823
335849
  var init_lance = __esm({
@@ -344850,7 +344876,7 @@ function lowerProviderResponseFormat(format, unsupportedKeywords) {
344850
344876
  // packages/orchestrator/dist/remote-inference-policy.js
344851
344877
  import { closeSync as closeSync4, fsyncSync, mkdirSync as mkdirSync20, openSync as openSync4, readFileSync as readFileSync23, renameSync as renameSync7, statSync as statSync10, unlinkSync as unlinkSync8, writeFileSync as writeFileSync17 } from "node:fs";
344852
344878
  import { homedir as homedir16 } from "node:os";
344853
- import { dirname as dirname15, join as join36 } from "node:path";
344879
+ import { dirname as dirname16, join as join36 } from "node:path";
344854
344880
  var DEFAULTS = Object.freeze({
344855
344881
  enabled: true,
344856
344882
  mode: "auto",
@@ -347275,8 +347301,8 @@ function withManagedLocalAdmissionBudget(backend, request, sessionTimeoutMs) {
347275
347301
 
347276
347302
  // packages/orchestrator/dist/semanticVerification.js
347277
347303
  import { createHash as createHash48 } from "node:crypto";
347278
- import { constants as constants4, closeSync as closeSync5, fstatSync, openSync as openSync5, readFileSync as readFileSync24, realpathSync as realpathSync3, statSync as statSync11 } from "node:fs";
347279
- import { dirname as dirname16, isAbsolute as isAbsolute8, relative as relative4, resolve as resolve17 } from "node:path";
347304
+ import { constants as constants4, closeSync as closeSync5, fstatSync, openSync as openSync5, readFileSync as readFileSync24, realpathSync as realpathSync4, statSync as statSync11 } from "node:fs";
347305
+ import { dirname as dirname17, isAbsolute as isAbsolute8, relative as relative5, resolve as resolve17 } from "node:path";
347280
347306
  var SEMANTIC_VERIFICATION_METHOD = "source_review";
347281
347307
  var SEMANTIC_VERIFICATION_OBLIGATION_SCHEMA = "omnius.semantic-verification-obligation.v1";
347282
347308
  var SEMANTIC_VERIFICATION_BINDING_SCHEMA = "omnius.semantic-verification-binding.v1";
@@ -347410,10 +347436,10 @@ function reopenSourceReviewStateEvidence(input) {
347410
347436
  throw new TypeError("Invalid source review owner");
347411
347437
  let root = null;
347412
347438
  try {
347413
- root = realpathSync3(input.workspaceRoot);
347439
+ root = realpathSync4(input.workspaceRoot);
347414
347440
  } catch {
347415
347441
  }
347416
- const confined = (path7) => !!root && !isAbsolute8(relative4(root, path7)) && relative4(root, path7) !== ".." && !relative4(root, path7).startsWith("../");
347442
+ const confined = (path7) => !!root && !isAbsolute8(relative5(root, path7)) && relative5(root, path7) !== ".." && !relative5(root, path7).startsWith("../");
347417
347443
  const reads = [];
347418
347444
  for (const entry of input.evidence) {
347419
347445
  const observed = ownedObservation(input, entry);
@@ -347432,10 +347458,10 @@ function reopenSourceReviewStateEvidence(input) {
347432
347458
  }
347433
347459
  let actual;
347434
347460
  try {
347435
- actual = realpathSync3(path7);
347461
+ actual = realpathSync4(path7);
347436
347462
  } catch (error) {
347437
347463
  if (error.code === "ENOENT")
347438
- read.status = confined(realpathSync3(dirname16(path7))) ? "missing" : "outside_owner";
347464
+ read.status = confined(realpathSync4(dirname17(path7))) ? "missing" : "outside_owner";
347439
347465
  reads.push(read);
347440
347466
  continue;
347441
347467
  }
@@ -347451,7 +347477,7 @@ function reopenSourceReviewStateEvidence(input) {
347451
347477
  continue;
347452
347478
  }
347453
347479
  const bytes3 = readFileSync24(fd), after = fstatSync(fd), current2 = statSync11(path7);
347454
- if (realpathSync3(path7) !== actual || before.dev !== after.dev || before.ino !== after.ino || before.size !== after.size || before.mtimeMs !== after.mtimeMs || before.ctimeMs !== after.ctimeMs || after.dev !== current2.dev || after.ino !== current2.ino || after.size !== current2.size || after.mtimeMs !== current2.mtimeMs || after.ctimeMs !== current2.ctimeMs)
347480
+ if (realpathSync4(path7) !== actual || before.dev !== after.dev || before.ino !== after.ino || before.size !== after.size || before.mtimeMs !== after.mtimeMs || before.ctimeMs !== after.ctimeMs || after.dev !== current2.dev || after.ino !== current2.ino || after.size !== current2.size || after.mtimeMs !== current2.mtimeMs || after.ctimeMs !== current2.ctimeMs)
347455
347481
  read.status = "changed_during_read";
347456
347482
  else {
347457
347483
  read.currentSourceHash = textHash(bytes3);
@@ -347653,8 +347679,8 @@ function projectSemanticVerificationCriterionState(input) {
347653
347679
 
347654
347680
  // packages/orchestrator/dist/taskObjectiveContinuation.js
347655
347681
  import { createHash as createHash54 } from "node:crypto";
347656
- import { readFileSync as readFileSync27, realpathSync as realpathSync4, statSync as statSync12, existsSync as existsSync27, openSync as openSync8, writeFileSync as writeFileSync20, fsyncSync as fsyncSync4, closeSync as closeSync8, renameSync as renameSync10, linkSync, unlinkSync as unlinkSync10 } from "node:fs";
347657
- import { basename as basename13, dirname as dirname19, isAbsolute as isAbsolute9, relative as relative5 } from "node:path";
347682
+ import { readFileSync as readFileSync27, realpathSync as realpathSync5, statSync as statSync12, existsSync as existsSync27, openSync as openSync8, writeFileSync as writeFileSync20, fsyncSync as fsyncSync4, closeSync as closeSync8, renameSync as renameSync10, linkSync, unlinkSync as unlinkSync10 } from "node:fs";
347683
+ import { basename as basename13, dirname as dirname20, isAbsolute as isAbsolute9, relative as relative6 } from "node:path";
347658
347684
 
347659
347685
  // packages/orchestrator/dist/expectedOutcomeContract.js
347660
347686
  var OUTCOMES = /* @__PURE__ */ new Set([
@@ -347794,7 +347820,7 @@ function normalizeCompletionDeliveryReceipt(value) {
347794
347820
  // packages/orchestrator/dist/completionLedger.js
347795
347821
  import { createHash as createHash53, randomUUID as randomUUID36 } from "node:crypto";
347796
347822
  import { closeSync as closeSync7, fsyncSync as fsyncSync3, mkdirSync as mkdirSync22, openSync as openSync7, readFileSync as readFileSync26, renameSync as renameSync9, writeFileSync as writeFileSync19 } from "node:fs";
347797
- import { dirname as dirname18 } from "node:path";
347823
+ import { dirname as dirname19 } from "node:path";
347798
347824
 
347799
347825
  // packages/orchestrator/dist/nativeRequirementAmendment.js
347800
347826
  import { createHash as createHash52 } from "node:crypto";
@@ -348880,7 +348906,7 @@ function resumeNeedsInputContractV1(input) {
348880
348906
  // packages/orchestrator/dist/reviewedInterpretation.js
348881
348907
  import { createHash as createHash51, randomUUID as randomUUID35 } from "node:crypto";
348882
348908
  import { closeSync as closeSync6, existsSync as existsSync26, fsyncSync as fsyncSync2, mkdirSync as mkdirSync21, openSync as openSync6, readFileSync as readFileSync25, renameSync as renameSync8, unlinkSync as unlinkSync9, writeFileSync as writeFileSync18 } from "node:fs";
348883
- import { dirname as dirname17 } from "node:path";
348909
+ import { dirname as dirname18 } from "node:path";
348884
348910
  var sha7 = (s) => createHash51("sha256").update(s).digest("hex");
348885
348911
  var validHash = (s) => typeof s === "string" && /^[a-f0-9]{64}$/.test(s);
348886
348912
  function validateTaskNativeExecutionScopeV1(scope) {
@@ -349024,7 +349050,7 @@ function clearDeadOwnerLock(path7, ledgerPath) {
349024
349050
  }
349025
349051
  function commitReviewedObjectiveInterpretationRevisionV1(input) {
349026
349052
  const lock = `${input.ledgerPath}.interpretation.lock`, recordPath = `${input.ledgerPath}.interpretation.json`;
349027
- mkdirSync21(dirname17(lock), { recursive: true });
349053
+ mkdirSync21(dirname18(lock), { recursive: true });
349028
349054
  clearDeadOwnerLock(lock, input.ledgerPath);
349029
349055
  const fd = openSync6(lock, "wx", 384);
349030
349056
  let prepared;
@@ -349071,7 +349097,7 @@ function writeAtomic(path7, raw) {
349071
349097
  closeSync6(fd);
349072
349098
  }
349073
349099
  renameSync8(temp, path7);
349074
- const directory = openSync6(dirname17(path7), "r");
349100
+ const directory = openSync6(dirname18(path7), "r");
349075
349101
  try {
349076
349102
  fsyncSync2(directory);
349077
349103
  } finally {
@@ -350378,7 +350404,7 @@ function finalizeCompletionLedgerTruth(ledger) {
350378
350404
  };
350379
350405
  }
350380
350406
  function saveCompletionLedger(filePath, ledger) {
350381
- mkdirSync22(dirname18(filePath), { recursive: true });
350407
+ mkdirSync22(dirname19(filePath), { recursive: true });
350382
350408
  const temporary = `${filePath}.${process.pid}.${randomUUID36()}.tmp`;
350383
350409
  const fd = openSync7(temporary, "wx", 384);
350384
350410
  try {
@@ -350389,7 +350415,7 @@ function saveCompletionLedger(filePath, ledger) {
350389
350415
  closeSync7(fd);
350390
350416
  }
350391
350417
  renameSync9(temporary, filePath);
350392
- const directory = openSync7(dirname18(filePath), "r");
350418
+ const directory = openSync7(dirname19(filePath), "r");
350393
350419
  try {
350394
350420
  fsyncSync3(directory);
350395
350421
  } finally {
@@ -350724,7 +350750,7 @@ function writeClaim(record9, claim, exclusive = false) {
350724
350750
  unlinkSync10(temporary);
350725
350751
  } else
350726
350752
  renameSync10(temporary, path7);
350727
- const directory = openSync8(dirname19(path7), "r");
350753
+ const directory = openSync8(dirname20(path7), "r");
350728
350754
  try {
350729
350755
  fsyncSync4(directory);
350730
350756
  } finally {
@@ -350812,8 +350838,8 @@ function admitTaskObjectiveContinuation(input) {
350812
350838
  const p = seed.predecessor;
350813
350839
  if (!p || !text7(p.runId) || !hash12(p.ledgerSha256) || !Number.isSafeInteger(p.taskEpoch) || p.taskEpoch < 1 || !isAbsolute9(p.ledgerPath))
350814
350840
  throw new Error("Invalid task objective predecessor");
350815
- const path7 = realpathSync4(p.ledgerPath);
350816
- const rel = relative5(realpathSync4(input.stateDir), path7);
350841
+ const path7 = realpathSync5(p.ledgerPath);
350842
+ const rel = relative6(realpathSync5(input.stateDir), path7);
350817
350843
  if (p.ledgerPath !== path7 || !rel || rel === ".." || rel.startsWith("../") || isAbsolute9(rel) || basename13(path7) !== `${p.runId}.json` || !statSync12(path7).isFile())
350818
350844
  throw new Error("Task objective predecessor is outside its storage owner");
350819
350845
  const bytes3 = readFileSync27(path7);
@@ -350942,10 +350968,10 @@ init_dist();
350942
350968
 
350943
350969
  // packages/orchestrator/dist/promptLoader.js
350944
350970
  import { readFileSync as readFileSync28, existsSync as existsSync28 } from "node:fs";
350945
- import { join as join37, dirname as dirname20, resolve as resolve18, sep as sep5 } from "node:path";
350971
+ import { join as join37, dirname as dirname21, resolve as resolve18, sep as sep5 } from "node:path";
350946
350972
  import { fileURLToPath as fileURLToPath5 } from "node:url";
350947
350973
  var __filename2 = fileURLToPath5(import.meta.url);
350948
- var __dirname3 = dirname20(__filename2);
350974
+ var __dirname3 = dirname21(__filename2);
350949
350975
  var PROMPTS_DIR = join37(__dirname3, "..", "prompts");
350950
350976
  var REFERENCE_CONTRACTS_DIR = resolve18(__dirname3, "..", "..", "..", "reference_contracts");
350951
350977
  var cache2 = /* @__PURE__ */ new Map();
@@ -352303,7 +352329,7 @@ async function extractStructuredMemoriesWithInference(input) {
352303
352329
  // packages/orchestrator/dist/structured-memory-extraction-worker.js
352304
352330
  init_dist3();
352305
352331
  import { createHash as createHash59, randomUUID as randomUUID37 } from "node:crypto";
352306
- import { lstatSync as lstatSync2, readFileSync as readFileSync29, realpathSync as realpathSync5 } from "node:fs";
352332
+ import { lstatSync as lstatSync2, readFileSync as readFileSync29, realpathSync as realpathSync6 } from "node:fs";
352307
352333
  import { isAbsolute as isAbsolute10, resolve as resolve19 } from "node:path";
352308
352334
 
352309
352335
  // packages/orchestrator/dist/inference-pressure.js
@@ -352471,7 +352497,7 @@ var anchorBody = (payload2) => json3({
352471
352497
  });
352472
352498
  var releaseId = (input) => `structured-extraction-release:${sha11(json3([input.owner, input.profile, input.sourceScopeId, input.runId, input.taskEpoch]))}`;
352473
352499
  function reopen(file) {
352474
- if (!isAbsolute10(file.path) || realpathSync5(file.path) !== resolve19(file.path) || !lstatSync2(file.path).isFile() || !/^[a-f0-9]{64}$/.test(file.sha256))
352500
+ if (!isAbsolute10(file.path) || realpathSync6(file.path) !== resolve19(file.path) || !lstatSync2(file.path).isFile() || !/^[a-f0-9]{64}$/.test(file.sha256))
352475
352501
  throw new InvalidExtraction("Structured extraction release file is invalid");
352476
352502
  const bytes3 = readFileSync29(file.path);
352477
352503
  if (createHash59("sha256").update(bytes3).digest("hex") !== file.sha256)
@@ -352933,7 +352959,7 @@ var NativeOllamaToolCalls = class {
352933
352959
  import { constants as constants5 } from "node:fs";
352934
352960
  import { open as open3, realpath as realpath2, stat as stat3 } from "node:fs/promises";
352935
352961
  import { createHash as createHash60, randomUUID as randomUUID38 } from "node:crypto";
352936
- import { isAbsolute as isAbsolute11, relative as relative6, resolve as resolve20 } from "node:path";
352962
+ import { isAbsolute as isAbsolute11, relative as relative7, resolve as resolve20 } from "node:path";
352937
352963
 
352938
352964
  // packages/orchestrator/dist/taskWorkDelegation.js
352939
352965
  var hash14 = (value) => typeof value === "string" && /^[a-f0-9]{64}$/.test(value);
@@ -353080,7 +353106,7 @@ async function reopenSource(root, source, signal, current2) {
353080
353106
  current2();
353081
353107
  signal.throwIfAborted();
353082
353108
  const realRoot = await realpath2(root), path7 = resolve20(source.path), actual = await realpath2(path7);
353083
- const rel = relative6(realRoot, actual);
353109
+ const rel = relative7(realRoot, actual);
353084
353110
  if (actual !== path7 || !rel || rel === ".." || rel.startsWith("../") || isAbsolute11(rel))
353085
353111
  throw new Error("Document worker source is outside its exact workspace grant");
353086
353112
  const handle = await open3(path7, constants5.O_RDONLY | (constants5.O_NOFOLLOW ?? 0));
@@ -353306,18 +353332,18 @@ var DurableDocumentWorkerCoordinator = class {
353306
353332
  };
353307
353333
 
353308
353334
  // packages/orchestrator/dist/document-worker-persistence.js
353309
- import { constants as constants6, closeSync as closeSync9, fstatSync as fstatSync2, openSync as openSync9, readFileSync as readFileSync30, realpathSync as realpathSync6, statSync as statSync13 } from "node:fs";
353310
- import { isAbsolute as isAbsolute12, relative as relative7, resolve as resolve21 } from "node:path";
353335
+ import { constants as constants6, closeSync as closeSync9, fstatSync as fstatSync2, openSync as openSync9, readFileSync as readFileSync30, realpathSync as realpathSync7, statSync as statSync13 } from "node:fs";
353336
+ import { isAbsolute as isAbsolute12, relative as relative8, resolve as resolve21 } from "node:path";
353311
353337
  import { createHash as createHash61 } from "node:crypto";
353312
353338
  var sha12 = (value) => createHash61("sha256").update(value).digest("hex");
353313
353339
  function reopenBytes(root, path7, expected) {
353314
- const actualRoot = realpathSync6(root), actual = realpathSync6(path7), rel = relative7(actualRoot, actual);
353340
+ const actualRoot = realpathSync7(root), actual = realpathSync7(path7), rel = relative8(actualRoot, actual);
353315
353341
  if (actual !== resolve21(path7) || !rel || rel === ".." || rel.startsWith("../") || isAbsolute12(rel))
353316
353342
  throw new Error("Document persistence source is outside its exact workspace");
353317
353343
  const fd = openSync9(actual, constants6.O_RDONLY | constants6.O_NOFOLLOW);
353318
353344
  try {
353319
353345
  const before = fstatSync2(fd), bytes3 = readFileSync30(fd), after = fstatSync2(fd), current2 = statSync13(path7);
353320
- if (!before.isFile() || before.dev !== after.dev || before.ino !== after.ino || before.size !== after.size || before.mtimeMs !== after.mtimeMs || before.ctimeMs !== after.ctimeMs || !current2.isFile() || current2.dev !== after.dev || current2.ino !== after.ino || current2.size !== after.size || current2.mtimeMs !== after.mtimeMs || current2.ctimeMs !== after.ctimeMs || realpathSync6(path7) !== actual || sha12(bytes3) !== expected)
353346
+ if (!before.isFile() || before.dev !== after.dev || before.ino !== after.ino || before.size !== after.size || before.mtimeMs !== after.mtimeMs || before.ctimeMs !== after.ctimeMs || !current2.isFile() || current2.dev !== after.dev || current2.ino !== after.ino || current2.size !== after.size || current2.mtimeMs !== after.mtimeMs || current2.ctimeMs !== after.ctimeMs || realpathSync7(path7) !== actual || sha12(bytes3) !== expected)
353321
353347
  throw new Error("Document persistence source bytes changed");
353322
353348
  } finally {
353323
353349
  closeSync9(fd);
@@ -353399,7 +353425,7 @@ function documentWorkerPersistenceEvidenceIsCurrent(context, evidence) {
353399
353425
 
353400
353426
  // packages/orchestrator/dist/source-review-artifact-state.js
353401
353427
  import { createHash as createHash64 } from "node:crypto";
353402
- import { constants as constants7, closeSync as closeSync10, fstatSync as fstatSync3, openSync as openSync10, readFileSync as readFileSync31, realpathSync as realpathSync7, statSync as statSync14 } from "node:fs";
353428
+ import { constants as constants7, closeSync as closeSync10, fstatSync as fstatSync3, openSync as openSync10, readFileSync as readFileSync31, realpathSync as realpathSync8, statSync as statSync14 } from "node:fs";
353403
353429
  import { resolve as resolve22 } from "node:path";
353404
353430
 
353405
353431
  // packages/orchestrator/dist/durable-document-context.js
@@ -354565,13 +354591,13 @@ ${input.goal}`];
354565
354591
  // packages/orchestrator/dist/source-review-artifact-state.js
354566
354592
  var sha14 = (value) => createHash64("sha256").update(value).digest("hex");
354567
354593
  function reopenRawSource(path7, expected) {
354568
- const actual = realpathSync7(path7);
354594
+ const actual = realpathSync8(path7);
354569
354595
  if (actual !== resolve22(path7))
354570
354596
  throw new Error("Source-review artifact path changed");
354571
354597
  const fd = openSync10(actual, constants7.O_RDONLY | constants7.O_NOFOLLOW);
354572
354598
  try {
354573
354599
  const before = fstatSync3(fd), bytes3 = readFileSync31(fd), after = fstatSync3(fd), current2 = statSync14(path7);
354574
- if (!before.isFile() || !current2.isFile() || before.dev !== after.dev || before.ino !== after.ino || before.size !== after.size || before.mtimeMs !== after.mtimeMs || before.ctimeMs !== after.ctimeMs || after.dev !== current2.dev || after.ino !== current2.ino || after.size !== current2.size || after.mtimeMs !== current2.mtimeMs || after.ctimeMs !== current2.ctimeMs || realpathSync7(path7) !== actual || sha14(bytes3) !== expected)
354600
+ if (!before.isFile() || !current2.isFile() || before.dev !== after.dev || before.ino !== after.ino || before.size !== after.size || before.mtimeMs !== after.mtimeMs || before.ctimeMs !== after.ctimeMs || after.dev !== current2.dev || after.ino !== current2.ino || after.size !== current2.size || after.mtimeMs !== current2.mtimeMs || after.ctimeMs !== current2.ctimeMs || realpathSync8(path7) !== actual || sha14(bytes3) !== expected)
354575
354601
  throw new Error("Source-review raw artifact changed");
354576
354602
  } finally {
354577
354603
  closeSync10(fd);
@@ -355071,7 +355097,7 @@ import { homedir as _osHomedir } from "node:os";
355071
355097
  // packages/orchestrator/dist/selfImprovement.js
355072
355098
  import { appendFile, mkdir as mkdir4, open as open4, readFile, stat as stat4, unlink as unlink2, writeFile } from "node:fs/promises";
355073
355099
  import { createHash as createHash67, randomUUID as randomUUID39 } from "node:crypto";
355074
- import { dirname as dirname21, join as join38, resolve as resolve23 } from "node:path";
355100
+ import { dirname as dirname22, join as join38, resolve as resolve23 } from "node:path";
355075
355101
  var SELF_IMPROVEMENT_SCHEMA = "omnius.self-improvement.event.v1";
355076
355102
  function canonical5(value) {
355077
355103
  if (Array.isArray(value))
@@ -355240,7 +355266,7 @@ var SelfImprovementArchive = class {
355240
355266
  }
355241
355267
  async append(kind, sessionId, payload2) {
355242
355268
  validatePayload(kind, payload2);
355243
- await mkdir4(dirname21(this.path), { recursive: true });
355269
+ await mkdir4(dirname22(this.path), { recursive: true });
355244
355270
  const lockPath = `${this.path}.lock`;
355245
355271
  const deadline = Date.now() + 1e4;
355246
355272
  let lockHandle;
@@ -355307,7 +355333,7 @@ var SelfImprovementArchive = class {
355307
355333
  // packages/orchestrator/dist/conversationReportEvidence.js
355308
355334
  import { createHash as createHash68, randomUUID as randomUUID40 } from "node:crypto";
355309
355335
  import { closeSync as closeSync11, existsSync as existsSync29, fsyncSync as fsyncSync5, mkdirSync as mkdirSync23, openSync as openSync11, readFileSync as readFileSync32, renameSync as renameSync11, unlinkSync as unlinkSync11, writeFileSync as writeFileSync21 } from "node:fs";
355310
- import { dirname as dirname22, join as join39 } from "node:path";
355336
+ import { dirname as dirname23, join as join39 } from "node:path";
355311
355337
  import { z as z19 } from "zod";
355312
355338
 
355313
355339
  // packages/orchestrator/dist/commandEvidenceReceipt.js
@@ -355571,7 +355597,7 @@ var ConversationReportEvidence = class {
355571
355597
  chunkCount: chunks
355572
355598
  });
355573
355599
  unlinkSync11(this.pendingPath);
355574
- this.sync(dirname22(this.path));
355600
+ this.sync(dirname23(this.path));
355575
355601
  this.reference = head;
355576
355602
  this.persistedEntryCount = count2;
355577
355603
  this.persistedChunkCount = chunks;
@@ -355659,14 +355685,14 @@ var ConversationReportEvidence = class {
355659
355685
  return !!identity4 && identity4.sessionId === this.options.identity.sessionId && identity4.runId === this.options.identity.runId && identity4.taskEpoch === this.options.identity.taskEpoch;
355660
355686
  }
355661
355687
  publish(path7, value) {
355662
- mkdirSync23(dirname22(path7), { recursive: true });
355688
+ mkdirSync23(dirname23(path7), { recursive: true });
355663
355689
  const temporary = `${path7}.${randomUUID40()}.tmp`;
355664
355690
  try {
355665
355691
  writeFileSync21(temporary, JSON.stringify(value), { encoding: "utf8", flag: "wx", mode: 384 });
355666
355692
  this.sync(temporary);
355667
355693
  renameSync11(temporary, path7);
355668
- this.sync(dirname22(path7));
355669
- this.sync(dirname22(dirname22(path7)));
355694
+ this.sync(dirname23(path7));
355695
+ this.sync(dirname23(dirname23(path7)));
355670
355696
  this.sync(this.options.stateDir);
355671
355697
  } finally {
355672
355698
  if (existsSync29(temporary))
@@ -355776,15 +355802,15 @@ function renderFeatureWorkflowStatus(plan, status2, maxChars = 2200) {
355776
355802
  // packages/orchestrator/dist/featureWorkflowRunnerBoundary.js
355777
355803
  init_dist();
355778
355804
  import { createHash as createHash71 } from "node:crypto";
355779
- import { readFileSync as readFileSync35, realpathSync as realpathSync9, statSync as statSync17 } from "node:fs";
355780
- import { isAbsolute as isAbsolute14, relative as relative9, resolve as resolve26 } from "node:path";
355805
+ import { readFileSync as readFileSync35, realpathSync as realpathSync10, statSync as statSync17 } from "node:fs";
355806
+ import { isAbsolute as isAbsolute14, relative as relative10, resolve as resolve26 } from "node:path";
355781
355807
 
355782
355808
  // packages/orchestrator/dist/featureWorkflow.js
355783
355809
  init_dist();
355784
355810
  init_dist5();
355785
355811
  import { createHash as createHash70 } from "node:crypto";
355786
- import { closeSync as closeSync13, existsSync as existsSync31, fsyncSync as fsyncSync7, lstatSync as lstatSync3, mkdirSync as mkdirSync25, openSync as openSync13, readFileSync as readFileSync34, readdirSync as readdirSync11, realpathSync as realpathSync8, renameSync as renameSync13, statSync as statSync16, unlinkSync as unlinkSync13, writeFileSync as writeFileSync23 } from "node:fs";
355787
- import { dirname as dirname23, isAbsolute as isAbsolute13, join as join41, relative as relative8, resolve as resolve25 } from "node:path";
355812
+ import { closeSync as closeSync13, existsSync as existsSync31, fsyncSync as fsyncSync7, lstatSync as lstatSync3, mkdirSync as mkdirSync25, openSync as openSync13, readFileSync as readFileSync34, readdirSync as readdirSync11, realpathSync as realpathSync9, renameSync as renameSync13, statSync as statSync16, unlinkSync as unlinkSync13, writeFileSync as writeFileSync23 } from "node:fs";
355813
+ import { dirname as dirname24, isAbsolute as isAbsolute13, join as join41, relative as relative9, resolve as resolve25 } from "node:path";
355788
355814
  import { z as z20 } from "zod";
355789
355815
 
355790
355816
  // packages/orchestrator/dist/contentAddressedArtifactStore.js
@@ -356856,7 +356882,7 @@ function compileFeatureWorkflow(input) {
356856
356882
  return { plan, cards, todos };
356857
356883
  }
356858
356884
  function isWithinDirectory(root, path7) {
356859
- const rel = relative8(root, path7);
356885
+ const rel = relative9(root, path7);
356860
356886
  return rel !== ".." && !rel.startsWith("../") && !isAbsolute13(rel);
356861
356887
  }
356862
356888
  function canonicalFuturePath(path7) {
@@ -356865,7 +356891,7 @@ function canonicalFuturePath(path7) {
356865
356891
  while (true) {
356866
356892
  try {
356867
356893
  lstatSync3(ancestor);
356868
- return resolve25(realpathSync8(ancestor), ...missing);
356894
+ return resolve25(realpathSync9(ancestor), ...missing);
356869
356895
  } catch (error) {
356870
356896
  if (error.code !== "ENOENT")
356871
356897
  throw error;
@@ -356876,16 +356902,16 @@ function canonicalFuturePath(path7) {
356876
356902
  if (probe.code !== "ENOENT")
356877
356903
  throw probe;
356878
356904
  }
356879
- const parent = dirname23(ancestor);
356905
+ const parent = dirname24(ancestor);
356880
356906
  if (parent === ancestor)
356881
356907
  throw error;
356882
- missing.unshift(relative8(parent, ancestor));
356908
+ missing.unshift(relative9(parent, ancestor));
356883
356909
  ancestor = parent;
356884
356910
  }
356885
356911
  }
356886
356912
  }
356887
356913
  function canonicalWorkspaceTarget(workingDir, path7) {
356888
- const root = realpathSync8(workingDir);
356914
+ const root = realpathSync9(workingDir);
356889
356915
  const file = resolve25(root, path7);
356890
356916
  if (!isWithinDirectory(root, file))
356891
356917
  fail3("target_outside_workspace");
@@ -356895,7 +356921,7 @@ function canonicalWorkspaceTarget(workingDir, path7) {
356895
356921
  return actual;
356896
356922
  }
356897
356923
  function featureWorkflowWorkspaceRevision(workingDir, plan) {
356898
- const root = realpathSync8(workingDir);
356924
+ const root = realpathSync9(workingDir);
356899
356925
  const paths2 = [
356900
356926
  ...new Set(plan.cards.flatMap((c) => [
356901
356927
  ...c.ownedFiles,
@@ -356905,7 +356931,7 @@ function featureWorkflowWorkspaceRevision(workingDir, plan) {
356905
356931
  let total = 0;
356906
356932
  return hash15(paths2.map((path7) => {
356907
356933
  const file = canonicalWorkspaceTarget(root, path7);
356908
- const rel = relative8(root, resolve25(root, path7));
356934
+ const rel = relative9(root, resolve25(root, path7));
356909
356935
  if (!existsSync31(file))
356910
356936
  return { path: rel, sha256: null };
356911
356937
  const real = file;
@@ -356988,7 +357014,7 @@ var FeatureWorkflowController = class {
356988
357014
  return this.diagnostic;
356989
357015
  }
356990
357016
  selectorCandidates() {
356991
- const directory = dirname23(this.selectorPath);
357017
+ const directory = dirname24(this.selectorPath);
356992
357018
  if (!existsSync31(directory))
356993
357019
  return [];
356994
357020
  const prefix = `${hash15(this.options.identity.sessionId).slice(0, 32)}-`;
@@ -357003,10 +357029,10 @@ var FeatureWorkflowController = class {
357003
357029
  }
357004
357030
  assertOwnedTargets(plan) {
357005
357031
  const protectedRoots = [
357006
- dirname23(this.selectorPath),
357032
+ dirname24(this.selectorPath),
357007
357033
  this.store.rootDir,
357008
- dirname23(workboardPaths(this.boardDir, this.options.identity.runId).dir),
357009
- dirname23(workboardPaths(this.options.workingDir, this.options.identity.runId).dir)
357034
+ dirname24(workboardPaths(this.boardDir, this.options.identity.runId).dir),
357035
+ dirname24(workboardPaths(this.options.workingDir, this.options.identity.runId).dir)
357010
357036
  ].map(canonicalFuturePath);
357011
357037
  for (const path7 of plan.cards.flatMap((card) => card.ownedFiles)) {
357012
357038
  const target2 = canonicalWorkspaceTarget(this.options.workingDir, path7);
@@ -357082,7 +357108,7 @@ var FeatureWorkflowController = class {
357082
357108
  this.syncFile(file);
357083
357109
  const checkpointReference = this.writeBody(JSON.stringify(state), `feature-workflow/${state.identity.sessionId}/${state.identity.taskEpoch}/checkpoint`);
357084
357110
  this.options.persistenceFaultForTest?.("artifacts_flushed");
357085
- mkdirSync25(dirname23(this.selectorPath), { recursive: true });
357111
+ mkdirSync25(dirname24(this.selectorPath), { recursive: true });
357086
357112
  temp = `${this.selectorPath}.${process.pid}.tmp`;
357087
357113
  writeFileSync23(temp, JSON.stringify({ schema: SELECTOR_SCHEMA, checkpointReference }), "utf8");
357088
357114
  this.syncFile(temp);
@@ -357091,7 +357117,7 @@ var FeatureWorkflowController = class {
357091
357117
  temp = void 0;
357092
357118
  this.selectorReference = checkpointReference;
357093
357119
  this.options.persistenceFaultForTest?.("selector_renamed");
357094
- this.syncFile(dirname23(this.selectorPath));
357120
+ this.syncFile(dirname24(this.selectorPath));
357095
357121
  this.syncFile(this.options.stateDir);
357096
357122
  } catch (error) {
357097
357123
  this.failedDurability = true;
@@ -357142,7 +357168,7 @@ var FeatureWorkflowController = class {
357142
357168
  operations: {},
357143
357169
  results: {},
357144
357170
  recentSettlements: [],
357145
- workingDir: realpathSync8(this.options.workingDir),
357171
+ workingDir: realpathSync9(this.options.workingDir),
357146
357172
  adoptions: []
357147
357173
  };
357148
357174
  this.state.planReference = planReference;
@@ -357175,15 +357201,15 @@ var FeatureWorkflowController = class {
357175
357201
  const selector2 = z20.object({
357176
357202
  schema: z20.literal(SELECTOR_SCHEMA),
357177
357203
  checkpointReference: ref7
357178
- }).strict().parse(JSON.parse(readFileSync34(join41(dirname23(this.selectorPath), file), "utf8")));
357204
+ }).strict().parse(JSON.parse(readFileSync34(join41(dirname24(this.selectorPath), file), "utf8")));
357179
357205
  const state2 = checkpointSchema.parse(JSON.parse(this.store.read(selector2.checkpointReference).content));
357180
- return state2.identity.runId === this.options.identity.runId && state2.identity.taskEpoch === this.options.identity.taskEpoch && state2.identity.sessionId === this.options.identity.sessionId && state2.workingDir === realpathSync8(this.options.workingDir);
357206
+ return state2.identity.runId === this.options.identity.runId && state2.identity.taskEpoch === this.options.identity.taskEpoch && state2.identity.sessionId === this.options.identity.sessionId && state2.workingDir === realpathSync9(this.options.workingDir);
357181
357207
  });
357182
357208
  if (matches.length === 0)
357183
357209
  return null;
357184
357210
  if (matches.length !== 1)
357185
357211
  fail3("same_run_checkpoint_not_unique");
357186
- this.selectorPath = join41(dirname23(this.selectorPath), matches[0]);
357212
+ this.selectorPath = join41(dirname24(this.selectorPath), matches[0]);
357187
357213
  }
357188
357214
  const selector = z20.object({
357189
357215
  schema: z20.literal(SELECTOR_SCHEMA),
@@ -357193,7 +357219,7 @@ var FeatureWorkflowController = class {
357193
357219
  if (state.retired)
357194
357220
  fail3("retired_scope");
357195
357221
  const expected = this.options.identity;
357196
- if (state.identity.sessionId !== expected.sessionId || state.workingDir !== realpathSync8(this.options.workingDir))
357222
+ if (state.identity.sessionId !== expected.sessionId || state.workingDir !== realpathSync9(this.options.workingDir))
357197
357223
  fail3("checkpoint_identity_mismatch");
357198
357224
  const adopting = state.identity.runId !== expected.runId || state.identity.taskEpoch !== expected.taskEpoch;
357199
357225
  if (adopting && (authorization.continuedFromRunId !== state.identity.runId || authorization.planReference !== state.planReference))
@@ -357235,7 +357261,7 @@ var FeatureWorkflowController = class {
357235
357261
  }
357236
357262
  }
357237
357263
  discover() {
357238
- const directory = dirname23(this.selectorPath);
357264
+ const directory = dirname24(this.selectorPath);
357239
357265
  if (!existsSync31(directory))
357240
357266
  return [];
357241
357267
  const results = [];
@@ -357245,7 +357271,7 @@ var FeatureWorkflowController = class {
357245
357271
  checkpointReference: ref7
357246
357272
  }).strict().parse(JSON.parse(readFileSync34(join41(directory, file), "utf8")));
357247
357273
  const state = checkpointSchema.parse(JSON.parse(this.store.read(selector.checkpointReference).content));
357248
- if (state.identity.sessionId !== this.options.identity.sessionId || state.workingDir !== realpathSync8(this.options.workingDir))
357274
+ if (state.identity.sessionId !== this.options.identity.sessionId || state.workingDir !== realpathSync9(this.options.workingDir))
357249
357275
  continue;
357250
357276
  const plan = FeatureWorkflowPlanSchema.parse(JSON.parse(this.store.read(state.planReference).content));
357251
357277
  results.push({
@@ -357263,7 +357289,7 @@ var FeatureWorkflowController = class {
357263
357289
  this.assertHealthy();
357264
357290
  if (this.state)
357265
357291
  fail3("resume_requires_inactive_controller");
357266
- const directory = dirname23(this.selectorPath);
357292
+ const directory = dirname24(this.selectorPath);
357267
357293
  if (!existsSync31(directory))
357268
357294
  fail3("continuation_not_found");
357269
357295
  const matches = [];
@@ -357273,7 +357299,7 @@ var FeatureWorkflowController = class {
357273
357299
  checkpointReference: ref7
357274
357300
  }).strict().parse(JSON.parse(readFileSync34(join41(directory, file), "utf8")));
357275
357301
  const state = checkpointSchema.parse(JSON.parse(this.store.read(selector.checkpointReference).content));
357276
- if (state.identity.sessionId === this.options.identity.sessionId && state.workingDir === realpathSync8(this.options.workingDir) && state.identity.runId === input.runId && state.planReference === input.planReference)
357302
+ if (state.identity.sessionId === this.options.identity.sessionId && state.workingDir === realpathSync9(this.options.workingDir) && state.identity.runId === input.runId && state.planReference === input.planReference)
357277
357303
  matches.push(join41(directory, file));
357278
357304
  }
357279
357305
  if (matches.length !== 1)
@@ -358110,9 +358136,9 @@ Inspect feature_workflow status and reconcile the persisted operation before con
358110
358136
  const slot = this.controller.plan?.slots.find((slot2) => slot2.id === args.slotId && slot2.cardId === card?.id);
358111
358137
  if (!card || !slot || card.role === "reviewer" || card.role === "verifier")
358112
358138
  throw new Error("feature_workflow_invalid_artifact_owner");
358113
- const root = realpathSync9(this.options.workingDir);
358114
- const path7 = realpathSync9(resolve26(root, args.path));
358115
- const local = relative9(root, path7);
358139
+ const root = realpathSync10(this.options.workingDir);
358140
+ const path7 = realpathSync10(resolve26(root, args.path));
358141
+ const local = relative10(root, path7);
358116
358142
  if (local.startsWith("..") || isAbsolute14(local))
358117
358143
  throw new Error("feature_workflow_artifact_outside_workspace");
358118
358144
  const stat7 = statSync17(path7);
@@ -358234,7 +358260,7 @@ function featureWorkflowToolParameters(parameters) {
358234
358260
  // packages/orchestrator/dist/interruption-lifecycle.js
358235
358261
  import { closeSync as closeSync14, existsSync as existsSync32, fsyncSync as fsyncSync8, mkdirSync as mkdirSync26, openSync as openSync14, readFileSync as readFileSync36, renameSync as renameSync14, rmSync as rmSync4, writeFileSync as writeFileSync24 } from "node:fs";
358236
358262
  import { randomUUID as randomUUID42 } from "node:crypto";
358237
- import { dirname as dirname24, join as join42, resolve as resolve27 } from "node:path";
358263
+ import { dirname as dirname25, join as join42, resolve as resolve27 } from "node:path";
358238
358264
  var INTERRUPTION_LIFECYCLE_SCHEMA = "omnius.interruption-lifecycle.v1";
358239
358265
  var TERMINAL_PHASES = /* @__PURE__ */ new Set([
358240
358266
  "stopped",
@@ -358853,7 +358879,7 @@ var InterruptionLifecycle = class {
358853
358879
  if (this.durabilityUncertain) {
358854
358880
  throw new InterruptionPersistenceError("interruption_state_durability_uncertain:restart_required", true);
358855
358881
  }
358856
- const parent = dirname24(this.statePath);
358882
+ const parent = dirname25(this.statePath);
358857
358883
  mkdirSync26(parent, { recursive: true, mode: 448 });
358858
358884
  const tmp = `${this.statePath}.tmp.${process.pid}.${this.state.sequence}.${randomUUID42()}`;
358859
358885
  let descriptor2;
@@ -361112,7 +361138,7 @@ function applyWorldPatch(world, patch) {
361112
361138
  // packages/orchestrator/dist/operational-world/persistence.js
361113
361139
  init_dist();
361114
361140
  import { existsSync as existsSync34, mkdirSync as mkdirSync28, readFileSync as readFileSync38, renameSync as renameSync15, unlinkSync as unlinkSync14, writeFileSync as writeFileSync25 } from "node:fs";
361115
- import { dirname as dirname25, join as join44 } from "node:path";
361141
+ import { dirname as dirname26, join as join44 } from "node:path";
361116
361142
  function operationalWorldStatePath(stateDir, runId) {
361117
361143
  const safeRunId = runId.replace(/[^a-zA-Z0-9_.-]/g, "_").slice(0, 180) || "run";
361118
361144
  return join44(stateDir, "operational-worlds", `${safeRunId}.json`);
@@ -361179,7 +361205,7 @@ function neverReceipt() {
361179
361205
  }
361180
361206
  function saveOperationalWorldState(stateDir, runId, state) {
361181
361207
  const file = operationalWorldStatePath(stateDir, runId);
361182
- mkdirSync28(dirname25(file), { recursive: true });
361208
+ mkdirSync28(dirname26(file), { recursive: true });
361183
361209
  const temp = `${file}.tmp.${process.pid}.${Date.now()}`;
361184
361210
  try {
361185
361211
  writeFileSync25(temp, `${JSON.stringify(state, null, 2)}
@@ -363848,7 +363874,7 @@ function taskValidationAfterVerificationAttempt(evidence, input) {
363848
363874
 
363849
363875
  // packages/orchestrator/dist/completionFinalization.js
363850
363876
  import { existsSync as existsSync35, mkdirSync as mkdirSync29, readFileSync as readFileSync39, renameSync as renameSync16, unlinkSync as unlinkSync15, writeFileSync as writeFileSync26 } from "node:fs";
363851
- import { dirname as dirname26, join as join45 } from "node:path";
363877
+ import { dirname as dirname27, join as join45 } from "node:path";
363852
363878
  import { createHash as createHash79 } from "node:crypto";
363853
363879
  import { fileURLToPath as fileURLToPath6 } from "node:url";
363854
363880
  function clean4(value, max) {
@@ -363862,7 +363888,7 @@ function sha256File(path7) {
363862
363888
  }
363863
363889
  }
363864
363890
  function readOwningPackageManifest(modulePath) {
363865
- let current2 = dirname26(modulePath);
363891
+ let current2 = dirname27(modulePath);
363866
363892
  for (let depth = 0; depth < 3; depth++) {
363867
363893
  const manifestPath = join45(current2, "package.json");
363868
363894
  if (existsSync35(manifestPath)) {
@@ -363883,7 +363909,7 @@ function readOwningPackageManifest(modulePath) {
363883
363909
  };
363884
363910
  }
363885
363911
  }
363886
- current2 = dirname26(current2);
363912
+ current2 = dirname27(current2);
363887
363913
  }
363888
363914
  return {
363889
363915
  manifestPath: null,
@@ -364123,7 +364149,7 @@ function commitTerminalTrajectoryProjection(stateDir, record9, payload2) {
364123
364149
  // packages/orchestrator/dist/completionReadiness.js
364124
364150
  import { createHash as createHash80, randomBytes as randomBytes8 } from "node:crypto";
364125
364151
  import { closeSync as closeSync15, existsSync as existsSync36, fsyncSync as fsyncSync9, mkdirSync as mkdirSync30, openSync as openSync15, readFileSync as readFileSync40, renameSync as renameSync17, unlinkSync as unlinkSync16, writeFileSync as writeFileSync27 } from "node:fs";
364126
- import { dirname as dirname27, join as join46 } from "node:path";
364152
+ import { dirname as dirname28, join as join46 } from "node:path";
364127
364153
  var COMPLETION_READINESS_SCHEMA = "omnius.completion-readiness.v1";
364128
364154
  var COMPLETION_OVERRIDE_SCHEMA = "omnius.completion-readiness-override.v1";
364129
364155
  function completionReadinessAllowsExpectedEffectReply(snapshot) {
@@ -364782,7 +364808,7 @@ function persistCompletionReadinessOverride(stateDir, input) {
364782
364808
  reason,
364783
364809
  persistedAtIso
364784
364810
  };
364785
- mkdirSync30(dirname27(path7), { recursive: true });
364811
+ mkdirSync30(dirname28(path7), { recursive: true });
364786
364812
  const temporary = `${path7}.${process.pid}.${randomBytes8(6).toString("hex")}.tmp`;
364787
364813
  try {
364788
364814
  writeFileSync27(temporary, `${JSON.stringify(receipt, null, 2)}
@@ -364797,7 +364823,7 @@ function persistCompletionReadinessOverride(stateDir, input) {
364797
364823
  closeSync15(fd);
364798
364824
  }
364799
364825
  renameSync17(temporary, path7);
364800
- fsyncDirectory(dirname27(path7));
364826
+ fsyncDirectory(dirname28(path7));
364801
364827
  } finally {
364802
364828
  if (existsSync36(temporary))
364803
364829
  unlinkSync16(temporary);
@@ -366642,7 +366668,7 @@ function summarizeMAST(tags) {
366642
366668
 
366643
366669
  // packages/orchestrator/dist/artifact-inspector.js
366644
366670
  import { existsSync as existsSync39, statSync as statSync19 } from "node:fs";
366645
- import { isAbsolute as isAbsolute15, relative as relative10, resolve as resolve28, sep as sep7 } from "node:path";
366671
+ import { isAbsolute as isAbsolute15, relative as relative11, resolve as resolve28, sep as sep7 } from "node:path";
366646
366672
  import { tmpdir as tmpdir7 } from "node:os";
366647
366673
  function extractCandidatePaths(content) {
366648
366674
  const out = /* @__PURE__ */ new Set();
@@ -366661,7 +366687,7 @@ function resolveAgainstWorkingDir(workingDir, p) {
366661
366687
  return isAbsolute15(p) ? p : resolve28(workingDir, p);
366662
366688
  }
366663
366689
  function isPathInside(path7, parent) {
366664
- const rel = relative10(parent, path7);
366690
+ const rel = relative11(parent, path7);
366665
366691
  return rel === "" || !rel.startsWith(`..${sep7}`) && rel !== ".." && !isAbsolute15(rel);
366666
366692
  }
366667
366693
  function isExternalSystemTempArtifact(workingDir, candidate) {
@@ -366745,7 +366771,7 @@ function inspectClaimedArtifacts(input) {
366745
366771
 
366746
366772
  // packages/orchestrator/dist/lesson-bank.js
366747
366773
  import { existsSync as existsSync40, mkdirSync as mkdirSync31, appendFileSync as appendFileSync5, readFileSync as readFileSync44 } from "node:fs";
366748
- import { join as join50, dirname as dirname28 } from "node:path";
366774
+ import { join as join50, dirname as dirname29 } from "node:path";
366749
366775
  import { createHash as createHash87 } from "node:crypto";
366750
366776
  var TOKENIZE_RE = /[^a-z0-9]+/i;
366751
366777
  function tokenize3(text12) {
@@ -366783,7 +366809,7 @@ function lessonBankPath(workingDir) {
366783
366809
  }
366784
366810
  function bank(lesson, workingDir) {
366785
366811
  const path7 = lessonBankPath(workingDir);
366786
- mkdirSync31(dirname28(path7), { recursive: true });
366812
+ mkdirSync31(dirname29(path7), { recursive: true });
366787
366813
  appendFileSync5(path7, JSON.stringify(lesson) + "\n", "utf-8");
366788
366814
  }
366789
366815
  function readAll(workingDir) {
@@ -366842,7 +366868,7 @@ function renderLessonsAsContext(lessons) {
366842
366868
 
366843
366869
  // packages/orchestrator/dist/intervention-replay.js
366844
366870
  import { existsSync as existsSync41, mkdirSync as mkdirSync32, readFileSync as readFileSync45, writeFileSync as writeFileSync28, readdirSync as readdirSync13 } from "node:fs";
366845
- import { join as join51, dirname as dirname29 } from "node:path";
366871
+ import { join as join51, dirname as dirname30 } from "node:path";
366846
366872
  import { createHash as createHash88 } from "node:crypto";
366847
366873
  function checkpointDir(workingDir) {
366848
366874
  return workingDir ? join51(workingDir, ".omnius", "checkpoints") : join51(process.env["HOME"] || ".", ".omnius", "checkpoints");
@@ -366913,7 +366939,7 @@ function writeCheckpoint(args) {
366913
366939
  notes: args.notes
366914
366940
  };
366915
366941
  const path7 = checkpointPath(args.workingDir, args.turn);
366916
- mkdirSync32(dirname29(path7), { recursive: true });
366942
+ mkdirSync32(dirname30(path7), { recursive: true });
366917
366943
  writeFileSync28(path7, JSON.stringify(snap), "utf-8");
366918
366944
  } catch {
366919
366945
  }
@@ -366950,7 +366976,7 @@ function pruneOldCheckpoints(args) {
366950
366976
 
366951
366977
  // packages/orchestrator/dist/world-state-disk-scan.js
366952
366978
  import { existsSync as existsSync42, readFileSync as readFileSync46, readdirSync as readdirSync14, statSync as statSync20 } from "node:fs";
366953
- import { join as join52, relative as relative11, basename as basename15 } from "node:path";
366979
+ import { join as join52, relative as relative12, basename as basename15 } from "node:path";
366954
366980
  var UNIVERSAL_DEFAULTS = [
366955
366981
  // VCS / IDE
366956
366982
  ".git",
@@ -367112,7 +367138,7 @@ function scanWorkspace(opts) {
367112
367138
  const st = statSync20(dir);
367113
367139
  dirs.push({
367114
367140
  abs: dir,
367115
- rel: relative11(root, dir) || ".",
367141
+ rel: relative12(root, dir) || ".",
367116
367142
  mtimeMs: st.mtimeMs
367117
367143
  });
367118
367144
  } catch {
@@ -367128,7 +367154,7 @@ function scanWorkspace(opts) {
367128
367154
  const dirsToVisit = [];
367129
367155
  for (const entry of entries) {
367130
367156
  const abs = join52(dir, entry);
367131
- const rel = relative11(root, abs);
367157
+ const rel = relative12(root, abs);
367132
367158
  const base = basename15(abs);
367133
367159
  if (shouldIgnore(rel, base, abs, patterns))
367134
367160
  continue;
@@ -367449,7 +367475,7 @@ function reconcilePlan(todos, files, opts) {
367449
367475
 
367450
367476
  // packages/orchestrator/dist/world-state-drift-detector.js
367451
367477
  import { existsSync as existsSync44, readFileSync as readFileSync47, statSync as statSync22 } from "node:fs";
367452
- import { dirname as dirname30, isAbsolute as isAbsolute17, join as join54, resolve as pathResolve } from "node:path";
367478
+ import { dirname as dirname31, isAbsolute as isAbsolute17, join as join54, resolve as pathResolve } from "node:path";
367453
367479
  var IMPORT_REGEX_NAMED = /^\s*import\s+(?:type\s+)?\{([^}]+)\}\s+from\s+['"]([^'"]+)['"]/;
367454
367480
  var IMPORT_REGEX_DEFAULT = /^\s*import\s+(?:type\s+)?(\w+)\s+from\s+['"]([^'"]+)['"]/;
367455
367481
  var IMPORT_REGEX_NAMESPACE = /^\s*import\s+(?:type\s+)?\*\s+as\s+(\w+)\s+from\s+['"]([^'"]+)['"]/;
@@ -367657,7 +367683,7 @@ function resolveImportPath(importingFile, source, workingDir, aliases) {
367657
367683
  }
367658
367684
  if (bestAlias)
367659
367685
  resolvedSpec = aliases[bestAlias] + source.slice(bestAlias.length);
367660
- const importerDir = dirname30(importingFile);
367686
+ const importerDir = dirname31(importingFile);
367661
367687
  const base = resolvedSpec.startsWith(".") ? pathResolve(importerDir, resolvedSpec) : resolvedSpec.startsWith("/") ? resolvedSpec : pathResolve(workingDir, resolvedSpec);
367662
367688
  const candidates = [];
367663
367689
  for (const ext2 of FILE_EXTENSIONS)
@@ -371349,7 +371375,7 @@ function fanoutDirective(taskText) {
371349
371375
  // packages/orchestrator/dist/consolidation-runtime.js
371350
371376
  import { existsSync as existsSync48, mkdirSync as mkdirSync35, readFileSync as readFileSync51, writeFileSync as writeFileSync31, renameSync as renameSync18 } from "node:fs";
371351
371377
  import { homedir as homedir19 } from "node:os";
371352
- import { join as join57, dirname as dirname33 } from "node:path";
371378
+ import { join as join57, dirname as dirname34 } from "node:path";
371353
371379
 
371354
371380
  // packages/orchestrator/dist/memory-consolidation.js
371355
371381
  var noteIdentity = (value) => typeof value === "string" && value.length > 0 && value.length <= 4096 && value === value.trim();
@@ -371551,7 +371577,7 @@ function load() {
371551
371577
  function save(s) {
371552
371578
  try {
371553
371579
  const p = storePath();
371554
- mkdirSync35(dirname33(p), { recursive: true });
371580
+ mkdirSync35(dirname34(p), { recursive: true });
371555
371581
  const tmp = `${p}.tmp`;
371556
371582
  writeFileSync31(tmp, JSON.stringify(s), "utf8");
371557
371583
  renameSync18(tmp, p);
@@ -371680,7 +371706,7 @@ function recallNotesBlock(k = 5, opts = {}) {
371680
371706
  // packages/orchestrator/dist/successful-procedure-memory.js
371681
371707
  init_dist3();
371682
371708
  import { createHash as createHash91 } from "node:crypto";
371683
- import { lstatSync as lstatSync4, mkdirSync as mkdirSync36, readFileSync as readFileSync52, realpathSync as realpathSync10 } from "node:fs";
371709
+ import { lstatSync as lstatSync4, mkdirSync as mkdirSync36, readFileSync as readFileSync52, realpathSync as realpathSync11 } from "node:fs";
371684
371710
  import { isAbsolute as isAbsolute19, join as join58, resolve as resolve30 } from "node:path";
371685
371711
  var PROCEDURE_EMBEDDING_JOB = "successful_procedure_embedding";
371686
371712
  var ProcedureEmbeddingPermanentError = class extends Error {
@@ -371707,7 +371733,7 @@ function scopeName(scope) {
371707
371733
  return `successful-procedures:${sha17(json4(scope))}`;
371708
371734
  }
371709
371735
  function fileJson(file) {
371710
- if (!isAbsolute19(file.path) || !hex.test(file.sha256) || realpathSync10(file.path) !== resolve30(file.path) || !lstatSync4(file.path).isFile())
371736
+ if (!isAbsolute19(file.path) || !hex.test(file.sha256) || realpathSync11(file.path) !== resolve30(file.path) || !lstatSync4(file.path).isFile())
371711
371737
  throw new Error("Invalid successful-procedure source file");
371712
371738
  const bytes3 = readFileSync52(file.path);
371713
371739
  if (sha17(bytes3) !== file.sha256)
@@ -378279,8 +378305,8 @@ var AdversaryStream = class {
378279
378305
  return;
378280
378306
  try {
378281
378307
  const { writeFileSync: writeFileSync37, mkdirSync: mkdirSync42, existsSync: existsSync57 } = __require("node:fs");
378282
- const { dirname: dirname36 } = __require("node:path");
378283
- const dir = dirname36(this.persistPath);
378308
+ const { dirname: dirname37 } = __require("node:path");
378309
+ const dir = dirname37(this.persistPath);
378284
378310
  if (!existsSync57(dir))
378285
378311
  mkdirSync42(dir, { recursive: true });
378286
378312
  writeFileSync37(this.persistPath, JSON.stringify({ ledger: this.ledger }, null, 2));
@@ -379372,7 +379398,7 @@ function validateMemoryCompilationPlan(input) {
379372
379398
  // packages/orchestrator/dist/debugArtifactLibrary.js
379373
379399
  import { appendFileSync as appendFileSync8, existsSync as existsSync53, mkdirSync as mkdirSync41, readFileSync as readFileSync57, statSync as statSync26, writeFileSync as writeFileSync36 } from "node:fs";
379374
379400
  import { createHash as createHash96 } from "node:crypto";
379375
- import { basename as basename16, join as join63, relative as relative12, resolve as resolve33 } from "node:path";
379401
+ import { basename as basename16, join as join63, relative as relative13, resolve as resolve33 } from "node:path";
379376
379402
  var DEBUG_LIBRARY_DIR = "debug-library";
379377
379403
  var RUN_EVENTS_LIMIT = 40;
379378
379404
  var PREVIEW_LIMIT = 4e3;
@@ -379859,7 +379885,7 @@ function buildAnchors(cwd, runId, paths2, extra = []) {
379859
379885
  return {
379860
379886
  ...item,
379861
379887
  path: absolute,
379862
- relativePath: relative12(cwd, absolute) || basename16(absolute),
379888
+ relativePath: relative13(cwd, absolute) || basename16(absolute),
379863
379889
  exists: item.kind === "event" && item.label === "event_json" ? true : pathExists(absolute)
379864
379890
  };
379865
379891
  });
@@ -380189,7 +380215,7 @@ function writeGlobalReadme(paths2, latestRun) {
380189
380215
  "This directory indexes run-level debugging artifacts and links back to raw Omnius state.",
380190
380216
  "",
380191
380217
  `Latest run: ${latestRun.runId}`,
380192
- `Contract: ${relative12(paths2.root, paths2.contractPath)}`,
380218
+ `Contract: ${relative13(paths2.root, paths2.contractPath)}`,
380193
380219
  "",
380194
380220
  "## Recent Runs",
380195
380221
  "",
@@ -384036,7 +384062,7 @@ init_dist3();
384036
384062
  import { createHash as createHash101 } from "node:crypto";
384037
384063
  import { lstat as lstat3, realpath as realpath4 } from "node:fs/promises";
384038
384064
  import { isDeepStrictEqual as isDeepStrictEqual7 } from "node:util";
384039
- import { isAbsolute as isAbsolute20, join as join64, relative as relative13, sep as sep8 } from "node:path";
384065
+ import { isAbsolute as isAbsolute20, join as join64, relative as relative14, sep as sep8 } from "node:path";
384040
384066
  var sha18 = (text12) => createHash101("sha256").update(text12).digest("hex");
384041
384067
  function finite3(value) {
384042
384068
  if (typeof value === "number" && !Number.isFinite(value))
@@ -384059,7 +384085,7 @@ function text10(value) {
384059
384085
  throw new Error("Missing native source identity");
384060
384086
  }
384061
384087
  function contains2(root, path7) {
384062
- const rel = relative13(root, path7);
384088
+ const rel = relative14(root, path7);
384063
384089
  return rel !== ".." && !rel.startsWith(`..${sep8}`) && !isAbsolute20(rel);
384064
384090
  }
384065
384091
  function stable6(value) {
@@ -384565,8 +384591,8 @@ async function planChunks(input, facets2, deadline) {
384565
384591
  if (selected <= start)
384566
384592
  return { chunks: null, reason: "request_exceeds_context" };
384567
384593
  if (selected < length) {
384568
- const relative17 = content.lastIndexOf("\n", selected - windowStart - 1);
384569
- const newline = relative17 < 0 ? -1 : windowStart + relative17;
384594
+ const relative18 = content.lastIndexOf("\n", selected - windowStart - 1);
384595
+ const newline = relative18 < 0 ? -1 : windowStart + relative18;
384570
384596
  if (newline >= start + (selected - start) * 0.8)
384571
384597
  selected = newline + 1;
384572
384598
  }
@@ -384614,12 +384640,12 @@ function validateWorkerResult(value, chunk, source, facets2, sourceStart = 0) {
384614
384640
  return { code: "quote_offset_mismatch" };
384615
384641
  start = finding["charStart"];
384616
384642
  } else {
384617
- const relative17 = content.indexOf(quote);
384618
- if (relative17 < 0)
384643
+ const relative18 = content.indexOf(quote);
384644
+ if (relative18 < 0)
384619
384645
  return { code: "quote_not_found" };
384620
- if (content.indexOf(quote, relative17 + 1) !== -1)
384646
+ if (content.indexOf(quote, relative18 + 1) !== -1)
384621
384647
  return { code: "quote_ambiguous" };
384622
- start = chunk.presentedCharStart + relative17;
384648
+ start = chunk.presentedCharStart + relative18;
384623
384649
  }
384624
384650
  const end = start + quote.length;
384625
384651
  if (start < chunk.presentedCharStart || end > chunk.presentedCharEndExclusive || source.slice(start - sourceStart, end - sourceStart) !== quote || boundary(source, start - sourceStart) !== start - sourceStart || boundary(source, end - sourceStart) !== end - sourceStart)
@@ -385746,9 +385772,9 @@ function applySystemCacheControl(system, cacheTtl = "5m") {
385746
385772
  }
385747
385773
 
385748
385774
  // packages/orchestrator/dist/git-progress.js
385749
- import { existsSync as existsSync54, readFileSync as readFileSync58, realpathSync as realpathSync11, statSync as statSync27 } from "node:fs";
385775
+ import { existsSync as existsSync54, readFileSync as readFileSync58, realpathSync as realpathSync12, statSync as statSync27 } from "node:fs";
385750
385776
  import { createHash as createHash105 } from "node:crypto";
385751
- import { dirname as dirname34, isAbsolute as isAbsolute21, relative as relative14, resolve as resolve34 } from "node:path";
385777
+ import { dirname as dirname35, isAbsolute as isAbsolute21, relative as relative15, resolve as resolve34 } from "node:path";
385752
385778
  var RUNNER_OWNED_PREFIXES = [".omnius/"];
385753
385779
  var GENERATED_ARTIFACT_PATH_RE = /(^|\/)(?:\.pio\/build|node_modules|\.pnpm-store|\.cache|coverage|\.next|\.nuxt|target\/debug|target\/release)(\/|$)/i;
385754
385780
  function isRunnerOwnedGitPath(path7) {
@@ -385851,7 +385877,7 @@ function pathsFromStatus(entries) {
385851
385877
  return normalizePathList(entries.map((entry) => entry.path));
385852
385878
  }
385853
385879
  function pathWithin(root, candidate) {
385854
- const rel = relative14(resolve34(root), resolve34(candidate));
385880
+ const rel = relative15(resolve34(root), resolve34(candidate));
385855
385881
  return rel === "" || rel !== ".." && !rel.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`) && !isAbsolute21(rel);
385856
385882
  }
385857
385883
  function normalizeMutatedPath(repoRoot, path7) {
@@ -385861,12 +385887,12 @@ function normalizeMutatedPath(repoRoot, path7) {
385861
385887
  const absolute = isAbsolute21(raw) ? resolve34(raw) : resolve34(repoRoot, raw);
385862
385888
  if (!pathWithin(repoRoot, absolute))
385863
385889
  return "";
385864
- return normalizeGitPath(relative14(repoRoot, absolute));
385890
+ return normalizeGitPath(relative15(repoRoot, absolute));
385865
385891
  }
385866
385892
  function nearestExistingPath(path7) {
385867
385893
  let current2 = resolve34(path7);
385868
385894
  while (!existsSync54(current2)) {
385869
- const parent = dirname34(current2);
385895
+ const parent = dirname35(current2);
385870
385896
  if (parent === current2)
385871
385897
  return null;
385872
385898
  current2 = parent;
@@ -385997,7 +386023,7 @@ async function detectGitProgressBaselineFromPaths(input) {
385997
386023
  const workspaceRoot = resolve34(input.cwd || process.cwd());
385998
386024
  let canonicalWorkspaceRoot = workspaceRoot;
385999
386025
  try {
386000
- canonicalWorkspaceRoot = realpathSync11(workspaceRoot);
386026
+ canonicalWorkspaceRoot = realpathSync12(workspaceRoot);
386001
386027
  } catch {
386002
386028
  return null;
386003
386029
  }
@@ -386014,13 +386040,13 @@ async function detectGitProgressBaselineFromPaths(input) {
386014
386040
  return null;
386015
386041
  let canonicalExistingPath;
386016
386042
  try {
386017
- canonicalExistingPath = realpathSync11(existingPath);
386043
+ canonicalExistingPath = realpathSync12(existingPath);
386018
386044
  } catch {
386019
386045
  return null;
386020
386046
  }
386021
386047
  if (!pathWithin(canonicalWorkspaceRoot, canonicalExistingPath))
386022
386048
  return null;
386023
- const canonicalDirectory = statSync27(canonicalExistingPath).isDirectory() ? canonicalExistingPath : dirname34(canonicalExistingPath);
386049
+ const canonicalDirectory = statSync27(canonicalExistingPath).isDirectory() ? canonicalExistingPath : dirname35(canonicalExistingPath);
386024
386050
  try {
386025
386051
  const repoRoot = resolve34((await execFileText3("git", ["rev-parse", "--show-toplevel"], {
386026
386052
  cwd: canonicalDirectory,
@@ -386028,7 +386054,7 @@ async function detectGitProgressBaselineFromPaths(input) {
386028
386054
  })).trim());
386029
386055
  let canonicalRepoRoot;
386030
386056
  try {
386031
- canonicalRepoRoot = realpathSync11(repoRoot);
386057
+ canonicalRepoRoot = realpathSync12(repoRoot);
386032
386058
  } catch {
386033
386059
  return null;
386034
386060
  }
@@ -386311,8 +386337,8 @@ function renderObjectivePhaseSteering(frontier, convergence, authority = "adviso
386311
386337
  }
386312
386338
 
386313
386339
  // packages/orchestrator/dist/taskEffectEvidence.js
386314
- import { constants as constants9, closeSync as closeSync18, fstatSync as fstatSync4, openSync as openSync18, readFileSync as readFileSync59, realpathSync as realpathSync12, statSync as statSync28 } from "node:fs";
386315
- import { dirname as dirname35, isAbsolute as isAbsolute22, relative as relative15, resolve as resolve35 } from "node:path";
386340
+ import { constants as constants9, closeSync as closeSync18, fstatSync as fstatSync4, openSync as openSync18, readFileSync as readFileSync59, realpathSync as realpathSync13, statSync as statSync28 } from "node:fs";
386341
+ import { dirname as dirname36, isAbsolute as isAbsolute22, relative as relative16, resolve as resolve35 } from "node:path";
386316
386342
  import { createHash as createHash106 } from "node:crypto";
386317
386343
 
386318
386344
  // packages/orchestrator/dist/background-process-effect.js
@@ -386416,10 +386442,10 @@ function reopenTaskEffectStateEvidence(input) {
386416
386442
  }
386417
386443
  let root = null;
386418
386444
  try {
386419
- root = realpathSync12(input.workspaceRoot);
386445
+ root = realpathSync13(input.workspaceRoot);
386420
386446
  } catch {
386421
386447
  }
386422
- const confined = (path7) => !!root && !isAbsolute22(relative15(root, path7)) && relative15(root, path7) !== ".." && !relative15(root, path7).startsWith("../");
386448
+ const confined = (path7) => !!root && !isAbsolute22(relative16(root, path7)) && relative16(root, path7) !== ".." && !relative16(root, path7).startsWith("../");
386423
386449
  const artifacts = [];
386424
386450
  for (const [path7, sourceEvidenceIds] of [...targets].sort(([a], [b]) => a.localeCompare(b))) {
386425
386451
  const artifact2 = { path: path7, sourceEvidenceIds, status: "unavailable" };
@@ -386457,10 +386483,10 @@ function reopenTaskEffectStateEvidence(input) {
386457
386483
  }
386458
386484
  let actual;
386459
386485
  try {
386460
- actual = realpathSync12(candidate);
386486
+ actual = realpathSync13(candidate);
386461
386487
  } catch (error) {
386462
386488
  if (error.code === "ENOENT") {
386463
- artifact2.status = confined(realpathSync12(dirname35(candidate))) ? "missing" : "outside_owner";
386489
+ artifact2.status = confined(realpathSync13(dirname36(candidate))) ? "missing" : "outside_owner";
386464
386490
  }
386465
386491
  artifacts.push(artifact2);
386466
386492
  continue;
@@ -386479,7 +386505,7 @@ function reopenTaskEffectStateEvidence(input) {
386479
386505
  }
386480
386506
  const bytes3 = readFileSync59(fd), after = fstatSync4(fd);
386481
386507
  const current2 = statSync28(candidate);
386482
- if (realpathSync12(candidate) !== actual || before.dev !== after.dev || before.ino !== after.ino || before.size !== after.size || before.mtimeMs !== after.mtimeMs || before.ctimeMs !== after.ctimeMs || after.dev !== current2.dev || after.ino !== current2.ino || after.size !== current2.size || after.mtimeMs !== current2.mtimeMs || after.ctimeMs !== current2.ctimeMs) {
386508
+ if (realpathSync13(candidate) !== actual || before.dev !== after.dev || before.ino !== after.ino || before.size !== after.size || before.mtimeMs !== after.mtimeMs || before.ctimeMs !== after.ctimeMs || after.dev !== current2.dev || after.ino !== current2.ino || after.size !== current2.size || after.mtimeMs !== current2.mtimeMs || after.ctimeMs !== current2.ctimeMs) {
386483
386509
  artifact2.status = "changed_during_read";
386484
386510
  } else {
386485
386511
  artifact2.sha256 = createHash106("sha256").update(bytes3).digest("hex");
@@ -390031,8 +390057,8 @@ ${renderTaskExecutionSnapshot(snapshot)}` } : projected;
390031
390057
  try {
390032
390058
  const root = _fsRealpathSync(this.authoritativeWorkingDirectory());
390033
390059
  const path7 = _fsRealpathSync(_pathResolve(root, args["path"]));
390034
- const relative17 = _pathRelative(root, path7);
390035
- if (!relative17 || relative17 === ".." || relative17.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`) || _pathResolve(root, relative17) !== path7)
390060
+ const relative18 = _pathRelative(root, path7);
390061
+ if (!relative18 || relative18 === ".." || relative18.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`) || _pathResolve(root, relative18) !== path7)
390036
390062
  return;
390037
390063
  const stat7 = _fsStatSync(path7);
390038
390064
  if (!stat7.isFile() || stat7.size > 128 * 1024 * 1024)
@@ -392391,8 +392417,8 @@ ${read.content}`;
392391
392417
  for (const span of transactionSpans.values()) {
392392
392418
  if (index <= span.start || index >= span.end)
392393
392419
  continue;
392394
- const relative17 = (index - span.start) / (span.end - span.start + 1);
392395
- return span.end + Math.max(0.01, Math.min(0.49, relative17 * 0.49));
392420
+ const relative18 = (index - span.start) / (span.end - span.start + 1);
392421
+ return span.end + Math.max(0.01, Math.min(0.49, relative18 * 0.49));
392396
392422
  }
392397
392423
  return index;
392398
392424
  };
@@ -401575,9 +401601,9 @@ ${latest.output || ""}`.trim();
401575
401601
  const root = this.authoritativeWorkingDirectory();
401576
401602
  const stateRoot = this.omniusStateDir();
401577
401603
  const local = (path7) => {
401578
- const relative17 = _pathRelative(root, path7);
401604
+ const relative18 = _pathRelative(root, path7);
401579
401605
  const stateRelative = _pathRelative(stateRoot, path7);
401580
- return (relative17 === "" || !relative17.startsWith("..") && !_pathIsAbsolute(relative17)) && !(stateRelative === "" || !stateRelative.startsWith("..") && !_pathIsAbsolute(stateRelative));
401606
+ return (relative18 === "" || !relative18.startsWith("..") && !_pathIsAbsolute(relative18)) && !(stateRelative === "" || !stateRelative.startsWith("..") && !_pathIsAbsolute(stateRelative));
401581
401607
  };
401582
401608
  const paths2 = [
401583
401609
  ...this._fileRegistry.keys(),
@@ -401737,8 +401763,8 @@ ${recentActionLines.join("\n")}` : "recent_actions=none",
401737
401763
  ...scan.files.map((file) => _pathResolve(root, file.rel)),
401738
401764
  ...scan.dirs.map((dir) => _pathResolve(root, dir.rel))
401739
401765
  ])].filter((path7) => {
401740
- const relative17 = _pathRelative(stateRoot, path7);
401741
- return relative17 !== "" && (relative17.startsWith("..") || _pathIsAbsolute(relative17));
401766
+ const relative18 = _pathRelative(stateRoot, path7);
401767
+ return relative18 !== "" && (relative18.startsWith("..") || _pathIsAbsolute(relative18));
401742
401768
  }).sort();
401743
401769
  this._workspaceTreeSnapshot = { scope, watchedPaths, content, stamp: this._workspaceContextStamp(watchedPaths) };
401744
401770
  return content;
@@ -430339,7 +430365,7 @@ var INFRA_WORKER_SKILL = {
430339
430365
  };
430340
430366
 
430341
430367
  // packages/orchestrator/dist/context-references.js
430342
- import { join as join67, resolve as resolve37, relative as relative16, sep as sep9, extname as extname4 } from "node:path";
430368
+ import { join as join67, resolve as resolve37, relative as relative17, sep as sep9, extname as extname4 } from "node:path";
430343
430369
  var SENSITIVE_HOME_FILES = [
430344
430370
  join67(".ssh", "authorized_keys"),
430345
430371
  join67(".ssh", "id_rsa"),
@@ -432230,7 +432256,7 @@ function adaptExecutionTool(tool, options = {}) {
432230
432256
  getDesktopVerificationScope: tool.getDesktopVerificationScope?.bind(tool),
432231
432257
  async execute(args, context) {
432232
432258
  const invoke = () => context === void 0 ? tool.execute(args) : tool.execute(args, context);
432233
- const result = options.execute ? await options.execute(tool, args, invoke) : await invoke();
432259
+ const result = options.execute ? await options.execute(tool, args, invoke, context) : await invoke();
432234
432260
  return mapResult(result, args);
432235
432261
  }
432236
432262
  };
@@ -432297,7 +432323,7 @@ function adaptExecutionTool(tool, options = {}) {
432297
432323
  invocationSettled = true;
432298
432324
  }
432299
432325
  };
432300
- const execution = Promise.resolve().then(() => options.execute(tool, args, invoke)).then((value) => {
432326
+ const execution = Promise.resolve().then(() => options.execute(tool, args, invoke, context)).then((value) => {
432301
432327
  final = value;
432302
432328
  }, (error) => {
432303
432329
  failed = true;