omnius 1.0.429 → 1.0.430

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.
package/dist/index.js CHANGED
@@ -1129,10 +1129,10 @@ var init_model_broker = __esm({
1129
1129
  return null;
1130
1130
  const data = await res.json();
1131
1131
  const info = data.model_info ?? {};
1132
- const arch3 = info["general.architecture"];
1132
+ const arch4 = info["general.architecture"];
1133
1133
  let trainCtx;
1134
- if (arch3 && typeof info[`${arch3}.context_length`] === "number") {
1135
- trainCtx = info[`${arch3}.context_length`];
1134
+ if (arch4 && typeof info[`${arch4}.context_length`] === "number") {
1135
+ trainCtx = info[`${arch4}.context_length`];
1136
1136
  } else {
1137
1137
  for (const [k, v] of Object.entries(info)) {
1138
1138
  if (k.endsWith(".context_length") && typeof v === "number") {
@@ -274861,9 +274861,9 @@ print("__SESSION__" + json.dumps(_session) + "__SESSION__")
274861
274861
  * what was previously computed. */
274862
274862
  async loadSessionInfo() {
274863
274863
  try {
274864
- const { readFileSync: readFileSync140, existsSync: existsSync171 } = await import("node:fs");
274864
+ const { readFileSync: readFileSync140, existsSync: existsSync172 } = await import("node:fs");
274865
274865
  const sessionPath2 = join44(this.cwd, ".omnius", "rlm", "session.json");
274866
- if (!existsSync171(sessionPath2))
274866
+ if (!existsSync172(sessionPath2))
274867
274867
  return null;
274868
274868
  return JSON.parse(readFileSync140(sessionPath2, "utf8"));
274869
274869
  } catch {
@@ -275439,10 +275439,10 @@ ${issues.map((i2) => ` - ${i2}`).join("\n")}` : " No issues found."),
275439
275439
  * Optionally filter by task type for phase-aware context (FSM paper insight).
275440
275440
  */
275441
275441
  getTopMemoriesSync(k = 5, taskType) {
275442
- const { readFileSync: readFileSync140, existsSync: existsSync171 } = __require("node:fs");
275442
+ const { readFileSync: readFileSync140, existsSync: existsSync172 } = __require("node:fs");
275443
275443
  const metaDir = join45(this.cwd, ".omnius", "memory", "metabolism");
275444
275444
  const storeFile = join45(metaDir, "store.json");
275445
- if (!existsSync171(storeFile))
275445
+ if (!existsSync172(storeFile))
275446
275446
  return "";
275447
275447
  let store2 = [];
275448
275448
  try {
@@ -275468,10 +275468,10 @@ ${issues.map((i2) => ` - ${i2}`).join("\n")}` : " No issues found."),
275468
275468
  /** Update memory scores based on task outcome. Called after task completion.
275469
275469
  * Memories used in successful tasks get boosted. Memories present during failures get decayed. */
275470
275470
  updateFromOutcomeSync(surfacedMemoryText, succeeded) {
275471
- const { readFileSync: readFileSync140, writeFileSync: writeFileSync95, existsSync: existsSync171, mkdirSync: mkdirSync112 } = __require("node:fs");
275471
+ const { readFileSync: readFileSync140, writeFileSync: writeFileSync95, existsSync: existsSync172, mkdirSync: mkdirSync112 } = __require("node:fs");
275472
275472
  const metaDir = join45(this.cwd, ".omnius", "memory", "metabolism");
275473
275473
  const storeFile = join45(metaDir, "store.json");
275474
- if (!existsSync171(storeFile))
275474
+ if (!existsSync172(storeFile))
275475
275475
  return;
275476
275476
  let store2 = [];
275477
275477
  try {
@@ -275922,9 +275922,9 @@ Recommendation: Strategy ${scored[0].index + 1} scores highest.`;
275922
275922
  // Per EvoSkill (arXiv:2603.02766): retrieve relevant strategies from archive.
275923
275923
  /** Retrieve top-K strategies for context injection. Returns "" if none. */
275924
275924
  getRelevantStrategiesSync(k = 3, taskType) {
275925
- const { readFileSync: readFileSync140, existsSync: existsSync171 } = __require("node:fs");
275925
+ const { readFileSync: readFileSync140, existsSync: existsSync172 } = __require("node:fs");
275926
275926
  const archiveFile = join47(this.cwd, ".omnius", "arche", "variants.json");
275927
- if (!existsSync171(archiveFile))
275927
+ if (!existsSync172(archiveFile))
275928
275928
  return "";
275929
275929
  let variants = [];
275930
275930
  try {
@@ -275946,12 +275946,12 @@ Recommendation: Strategy ${scored[0].index + 1} scores highest.`;
275946
275946
  }
275947
275947
  /** Archive a strategy variant synchronously (for task completion path) */
275948
275948
  archiveVariantSync(strategy, outcome, tags = []) {
275949
- const { readFileSync: readFileSync140, writeFileSync: writeFileSync95, existsSync: existsSync171, mkdirSync: mkdirSync112 } = __require("node:fs");
275949
+ const { readFileSync: readFileSync140, writeFileSync: writeFileSync95, existsSync: existsSync172, mkdirSync: mkdirSync112 } = __require("node:fs");
275950
275950
  const dir = join47(this.cwd, ".omnius", "arche");
275951
275951
  const archiveFile = join47(dir, "variants.json");
275952
275952
  let variants = [];
275953
275953
  try {
275954
- if (existsSync171(archiveFile))
275954
+ if (existsSync172(archiveFile))
275955
275955
  variants = JSON.parse(readFileSync140(archiveFile, "utf8"));
275956
275956
  } catch {
275957
275957
  }
@@ -564504,7 +564504,7 @@ function recommendMaxParallelFromVram(minFreeMB) {
564504
564504
  return 1;
564505
564505
  }
564506
564506
  async function getHardwareSnapshot() {
564507
- const { totalmem: totalmem10, freemem: freemem8, cpus: cpus6 } = await import("node:os");
564507
+ const { totalmem: totalmem10, freemem: freemem9, cpus: cpus6 } = await import("node:os");
564508
564508
  const gpus = await detectGpus();
564509
564509
  const diskPath = discoverSystemOllamaModelStore() ?? homedir33();
564510
564510
  const disk = snapshotDisk(diskPath);
@@ -564513,7 +564513,7 @@ async function getHardwareSnapshot() {
564513
564513
  gpus,
564514
564514
  cpuCores: cpus6().length,
564515
564515
  ramTotalMB: Math.round(totalmem10() / (1024 * 1024)),
564516
- ramFreeMB: Math.round(freemem8() / (1024 * 1024)),
564516
+ ramFreeMB: Math.round(freemem9() / (1024 * 1024)),
564517
564517
  disk,
564518
564518
  network,
564519
564519
  takenAtMs: Date.now()
@@ -568950,8 +568950,8 @@ var init_reflectionBuffer = __esm({
568950
568950
  this.persistPath = persistPath ?? null;
568951
568951
  if (this.persistPath) {
568952
568952
  try {
568953
- const { readFileSync: readFileSync140, existsSync: existsSync171 } = __require("node:fs");
568954
- if (existsSync171(this.persistPath)) {
568953
+ const { readFileSync: readFileSync140, existsSync: existsSync172 } = __require("node:fs");
568954
+ if (existsSync172(this.persistPath)) {
568955
568955
  this.state = JSON.parse(readFileSync140(this.persistPath, "utf-8"));
568956
568956
  return;
568957
568957
  }
@@ -569246,10 +569246,10 @@ var init_reflectionBuffer = __esm({
569246
569246
  if (!this.persistPath)
569247
569247
  return;
569248
569248
  try {
569249
- const { writeFileSync: writeFileSync95, mkdirSync: mkdirSync112, existsSync: existsSync171 } = __require("node:fs");
569249
+ const { writeFileSync: writeFileSync95, mkdirSync: mkdirSync112, existsSync: existsSync172 } = __require("node:fs");
569250
569250
  const { join: join188 } = __require("node:path");
569251
569251
  const dir = join188(this.persistPath, "..");
569252
- if (!existsSync171(dir))
569252
+ if (!existsSync172(dir))
569253
569253
  mkdirSync112(dir, { recursive: true });
569254
569254
  writeFileSync95(this.persistPath, JSON.stringify(this.state, null, 2));
569255
569255
  } catch {
@@ -573202,8 +573202,8 @@ var init_adversaryStream = __esm({
573202
573202
  if (!this.persistPath)
573203
573203
  return;
573204
573204
  try {
573205
- const { readFileSync: readFileSync140, existsSync: existsSync171 } = __require("node:fs");
573206
- if (existsSync171(this.persistPath)) {
573205
+ const { readFileSync: readFileSync140, existsSync: existsSync172 } = __require("node:fs");
573206
+ if (existsSync172(this.persistPath)) {
573207
573207
  const data = JSON.parse(readFileSync140(this.persistPath, "utf-8"));
573208
573208
  if (Array.isArray(data?.ledger))
573209
573209
  this.ledger = data.ledger.slice(-100);
@@ -573215,10 +573215,10 @@ var init_adversaryStream = __esm({
573215
573215
  if (!this.persistPath)
573216
573216
  return;
573217
573217
  try {
573218
- const { writeFileSync: writeFileSync95, mkdirSync: mkdirSync112, existsSync: existsSync171 } = __require("node:fs");
573218
+ const { writeFileSync: writeFileSync95, mkdirSync: mkdirSync112, existsSync: existsSync172 } = __require("node:fs");
573219
573219
  const { dirname: dirname56 } = __require("node:path");
573220
573220
  const dir = dirname56(this.persistPath);
573221
- if (!existsSync171(dir))
573221
+ if (!existsSync172(dir))
573222
573222
  mkdirSync112(dir, { recursive: true });
573223
573223
  writeFileSync95(this.persistPath, JSON.stringify({ ledger: this.ledger }, null, 2));
573224
573224
  } catch {
@@ -604541,6 +604541,28 @@ var init_live_vlm = __esm({
604541
604541
  if (this.config.apiKey) headers["Authorization"] = `Bearer ${this.config.apiKey}`;
604542
604542
  return headers;
604543
604543
  }
604544
+ async unloadModel() {
604545
+ if (!this.config.backendUrl || !this.model) return false;
604546
+ try {
604547
+ const res = await fetch(`${this.baseUrl()}/api/generate`, {
604548
+ method: "POST",
604549
+ headers: this.headers(),
604550
+ signal: AbortSignal.timeout(1e4),
604551
+ body: JSON.stringify({
604552
+ model: this.model,
604553
+ prompt: "",
604554
+ stream: false,
604555
+ keep_alive: 0,
604556
+ options: { num_predict: 0 }
604557
+ })
604558
+ });
604559
+ this.modelReady = null;
604560
+ return res.ok;
604561
+ } catch {
604562
+ this.modelReady = null;
604563
+ return false;
604564
+ }
604565
+ }
604544
604566
  /**
604545
604567
  * Ensure the VLM is present on the ollama backend, pulling it when missing
604546
604568
  * (auto-pull). Single-flight; the pull can take minutes on first run.
@@ -604619,6 +604641,7 @@ var init_live_vlm = __esm({
604619
604641
  model: this.model,
604620
604642
  stream: false,
604621
604643
  format: "json",
604644
+ keep_alive: String(process.env["OMNIUS_LIVE_VLM_KEEP_ALIVE"] ?? "30s"),
604622
604645
  options: { temperature: 0.1, num_predict: 260 },
604623
604646
  messages: [
604624
604647
  { role: "system", content: VLM_SYSTEM_PROMPT },
@@ -604681,7 +604704,8 @@ var init_live_vlm = __esm({
604681
604704
  });
604682
604705
 
604683
604706
  // packages/cli/src/tui/live-sensors.ts
604684
- import { mkdirSync as mkdirSync70, readFileSync as readFileSync91, writeFileSync as writeFileSync58 } from "node:fs";
604707
+ import { existsSync as existsSync113, mkdirSync as mkdirSync70, readFileSync as readFileSync91, writeFileSync as writeFileSync58 } from "node:fs";
604708
+ import { arch as arch3, freemem as freemem4 } from "node:os";
604685
604709
  import { basename as basename23, join as join128, relative as relative11 } from "node:path";
604686
604710
  function liveDir(repoRoot) {
604687
604711
  return join128(repoRoot, ".omnius", "live");
@@ -606375,6 +606399,17 @@ function rankLiveAudioInputDevices(devices, configured) {
606375
606399
  }
606376
606400
  return ranked.sort((a2, b) => liveAudioDeviceRank(a2, configured) - liveAudioDeviceRank(b, configured));
606377
606401
  }
606402
+ function isJetsonUnifiedMemoryHost() {
606403
+ if (process.platform !== "linux") return false;
606404
+ if (!["arm64", "aarch64"].includes(arch3())) return false;
606405
+ if (existsSync113("/etc/nv_tegra_release")) return true;
606406
+ try {
606407
+ const model = readFileSync91("/proc/device-tree/model", "utf8");
606408
+ return /nvidia|jetson|orin|tegra/i.test(model);
606409
+ } catch {
606410
+ return false;
606411
+ }
606412
+ }
606378
606413
  function getLiveSensorManager(repoRoot) {
606379
606414
  const key = repoRoot;
606380
606415
  let manager = managers.get(key);
@@ -606476,6 +606511,7 @@ var init_live_sensors = __esm({
606476
606511
  lastStreamFrameMtime = /* @__PURE__ */ new Map();
606477
606512
  lastStreamPersistAt = 0;
606478
606513
  videoGeneration = 0;
606514
+ liveGpuYieldUntil = 0;
606479
606515
  videoInFlight = false;
606480
606516
  audioInFlight = false;
606481
606517
  audioActivityInFlight = false;
@@ -606532,6 +606568,12 @@ var init_live_sensors = __esm({
606532
606568
  */
606533
606569
  setLiveVlmConfig(config) {
606534
606570
  this.liveVlm.configure(config);
606571
+ if (config?.backendUrl) {
606572
+ try {
606573
+ getModelBroker().setOllamaBaseUrl(config.backendUrl.replace(/\/v1\/?$/, ""));
606574
+ } catch {
606575
+ }
606576
+ }
606535
606577
  if (this.config.videoEnabled && this.liveVlm.enabled) {
606536
606578
  void this.liveVlm.ensureModel((message2) => {
606537
606579
  this.emitFeedbackThrottled("live-vlm-status", {
@@ -606558,6 +606600,7 @@ var init_live_sensors = __esm({
606558
606600
  */
606559
606601
  async runLiveVlm(source, framePath) {
606560
606602
  if (!framePath || !this.liveVlm.enabled) return;
606603
+ if (await this.yieldLiveGpuVideoIfNeeded("vlm")) return;
606561
606604
  const intervalMs = Math.max(1500, Number(process.env["OMNIUS_LIVE_VLM_INTERVAL_MS"] ?? 4e3));
606562
606605
  const last2 = this.lastVlmAt.get(source) ?? 0;
606563
606606
  const now2 = Date.now();
@@ -606681,9 +606724,63 @@ var init_live_sensors = __esm({
606681
606724
  isVideoWorkCurrent(generation) {
606682
606725
  return this.config.videoEnabled && generation === this.videoGeneration;
606683
606726
  }
606727
+ liveVideoGpuPolicy() {
606728
+ const raw = String(process.env["OMNIUS_LIVE_VIDEO_GPU_POLICY"] ?? "").trim().toLowerCase();
606729
+ if (raw === "aggressive" || raw === "force" || raw === "on") return "aggressive";
606730
+ if (raw === "balanced" || raw === "auto") return "balanced";
606731
+ if (raw === "yield" || raw === "off" || raw === "cpu" || raw === "passive") return "yield";
606732
+ return isJetsonUnifiedMemoryHost() ? "yield" : "balanced";
606733
+ }
606734
+ async shouldYieldLiveGpuVideo(kind) {
606735
+ const policy = this.liveVideoGpuPolicy();
606736
+ if (policy === "aggressive") return { yield: false, reason: "" };
606737
+ if (policy === "yield") {
606738
+ return {
606739
+ yield: true,
606740
+ reason: `live video ${kind} yields to Ollama GPU allocation on unified-memory ARM`
606741
+ };
606742
+ }
606743
+ try {
606744
+ const broker = getModelBroker();
606745
+ const snap = await broker.pollOnce().catch(() => broker.snapshot());
606746
+ const liveVlmModel = this.liveVlm.model;
606747
+ const nonLiveOllama = snap.loaded.filter((model) => model.host === "ollama" && model.name !== liveVlmModel);
606748
+ const activeSlots = snap.slots.inUse + snap.slots.queueDepth;
606749
+ const vramLow = snap.vramPerDevice.some((gpu) => gpu.free < Math.max(1024, broker.vramHeadroomMB));
606750
+ const ramLow = snap.ramMB.free < Math.max(4096, broker.ramHeadroomMB);
606751
+ if (nonLiveOllama.length > 0 || activeSlots > 0 || vramLow || ramLow) {
606752
+ return {
606753
+ yield: true,
606754
+ reason: `live video ${kind} yielded: ollama=${nonLiveOllama.length}, slots=${activeSlots}, ramFree=${snap.ramMB.free}MB`
606755
+ };
606756
+ }
606757
+ } catch {
606758
+ if (isJetsonUnifiedMemoryHost() || freemem4() < 6 * 1024 * 1024 * 1024) {
606759
+ return { yield: true, reason: `live video ${kind} yielded: memory pressure unknown` };
606760
+ }
606761
+ }
606762
+ return { yield: false, reason: "" };
606763
+ }
606764
+ async yieldLiveGpuVideoIfNeeded(kind) {
606765
+ const decision2 = await this.shouldYieldLiveGpuVideo(kind);
606766
+ if (!decision2.yield) return false;
606767
+ const now2 = Date.now();
606768
+ if (now2 >= this.liveGpuYieldUntil) {
606769
+ this.liveGpuYieldUntil = now2 + 15e3;
606770
+ void this.liveVlm.unloadModel().catch(() => false);
606771
+ this.emitFeedbackThrottled(`live-video-gpu-yield:${kind}`, {
606772
+ kind: "status",
606773
+ title: "Live video GPU yield",
606774
+ observedAt: now2,
606775
+ message: `${decision2.reason}. Camera capture/ASCII preview stays active; GPU video inference is skipped. Set OMNIUS_LIVE_VIDEO_GPU_POLICY=aggressive to override.`
606776
+ }, 3e4);
606777
+ }
606778
+ return true;
606779
+ }
606684
606780
  async autoOrientCamera(device = this.config.selectedCamera, options2 = {}) {
606685
606781
  const generation = this.videoGeneration;
606686
606782
  if (!this.isVideoWorkCurrent(generation)) return "Video context is disabled.";
606783
+ if (await this.yieldLiveGpuVideoIfNeeded("orientation")) return "Camera orientation skipped while yielding GPU to Ollama.";
606687
606784
  const target = device || this.config.selectedCamera || firstDeviceId(this.devices.video);
606688
606785
  if (!target) return "No camera selected. Use /live camera <device> or select a camera in /live.";
606689
606786
  if (options2.onlyIfUnset && this.getCameraOrientation(target)) {
@@ -606796,6 +606893,7 @@ var init_live_sensors = __esm({
606796
606893
  this.videoGeneration++;
606797
606894
  this.lastStreamFrameMtime.clear();
606798
606895
  this.cameraStreamers?.stopAll();
606896
+ void this.liveVlm.unloadModel().catch(() => false);
606799
606897
  }
606800
606898
  this.persist();
606801
606899
  this.clearLoopTimers();
@@ -606829,6 +606927,7 @@ var init_live_sensors = __esm({
606829
606927
  videoIntervalMs: options2.lowLatency === false ? this.config.videoIntervalMs : Math.min(this.config.videoIntervalMs, LOW_LATENCY_VIDEO_INTERVAL_MS),
606830
606928
  audioIntervalMs: options2.lowLatency === false ? this.config.audioIntervalMs : Math.min(this.config.audioIntervalMs, LOW_LATENCY_AUDIO_INTERVAL_MS)
606831
606929
  });
606930
+ void this.yieldLiveGpuVideoIfNeeded("startup").catch(() => false);
606832
606931
  for (const source of this.activeVideoSources()) {
606833
606932
  const current = this.getCameraOrientation(source);
606834
606933
  if (current?.source === "manual") continue;
@@ -607096,7 +607195,7 @@ var init_live_sensors = __esm({
607096
607195
  const inferenceThrottleMs = Math.max(0, Number(options2.inferThrottleMs ?? 2500));
607097
607196
  const lastInferenceAt = this.lastInferenceAt.get(source) ?? 0;
607098
607197
  const shouldInfer = Boolean(forceInfer && source && (options2.forceInferenceNow || sampledAt - lastInferenceAt >= inferenceThrottleMs));
607099
- if (shouldInfer) {
607198
+ if (shouldInfer && !await this.yieldLiveGpuVideoIfNeeded("inference")) {
607100
607199
  this.lastInferenceAt.set(source, sampledAt);
607101
607200
  const loop = new LiveMediaLoopTool(this.repoRoot);
607102
607201
  const inferFromCapturedFrame = preview.ok && Boolean(preview.framePath);
@@ -607191,7 +607290,7 @@ var init_live_sensors = __esm({
607191
607290
  }
607192
607291
  }
607193
607292
  const lastClip = this.lastClipAt.get(source) ?? 0;
607194
- if (this.config.clipEnabled && preview.ok && preview.framePath && source && sampledAt - lastClip >= 5e3) {
607293
+ if (this.config.clipEnabled && preview.ok && preview.framePath && source && sampledAt - lastClip >= 5e3 && !await this.yieldLiveGpuVideoIfNeeded("clip")) {
607195
607294
  this.lastClipAt.set(source, sampledAt);
607196
607295
  clipSummary = await this.recognizeFrameObjects(preview.framePath, source, sampledAt, { emit: false });
607197
607296
  if (!this.isVideoWorkCurrent(generation)) return "Video context is disabled.";
@@ -607920,7 +608019,7 @@ var init_tool_adapter = __esm({
607920
608019
  });
607921
608020
 
607922
608021
  // packages/cli/src/tui/runtime-verification.ts
607923
- import { existsSync as existsSync113, readFileSync as readFileSync92, readdirSync as readdirSync36 } from "node:fs";
608022
+ import { existsSync as existsSync114, readFileSync as readFileSync92, readdirSync as readdirSync36 } from "node:fs";
607924
608023
  import { dirname as dirname38, extname as extname14, join as join129, relative as relative12, resolve as resolve54 } from "node:path";
607925
608024
  function safeRelative(root, file) {
607926
608025
  const rel = relative12(root, file);
@@ -607969,7 +608068,7 @@ function resolveScriptSource(root, htmlFile, src2) {
607969
608068
  const abs = clean5.startsWith("/") ? resolve54(root, `.${clean5}`) : resolve54(dirname38(htmlFile), clean5);
607970
608069
  const rel = relative12(root, abs);
607971
608070
  if (rel.startsWith("..") || rel === "") return null;
607972
- return existsSync113(abs) ? abs : null;
608071
+ return existsSync114(abs) ? abs : null;
607973
608072
  }
607974
608073
  function referencedScriptAssets(root, htmlFile) {
607975
608074
  let html = "";
@@ -608004,7 +608103,7 @@ async function syntaxCheckJavaScriptModule(source) {
608004
608103
  }
608005
608104
  async function runStaticRuntimeAssetSyntaxCheck(projectRoot, options2 = {}) {
608006
608105
  const root = resolve54(projectRoot);
608007
- if (!existsSync113(root)) {
608106
+ if (!existsSync114(root)) {
608008
608107
  return { ok: true, checkedAssets: 0, htmlFiles: 0, issues: [], skippedReason: "project root missing" };
608009
608108
  }
608010
608109
  const htmlFiles = collectHtmlFiles(root, options2.maxHtmlFiles ?? 80);
@@ -614274,15 +614373,15 @@ async function fetchOllamaModels(baseUrl2) {
614274
614373
  }
614275
614374
  if (show.model_info) {
614276
614375
  const info = show.model_info;
614277
- const arch3 = info["general.architecture"];
614376
+ const arch4 = info["general.architecture"];
614278
614377
  const paramCount = info["general.parameter_count"];
614279
614378
  const fileSizeGB = result[i2].sizeBytes > 0 ? result[i2].sizeBytes / 1024 ** 3 : paramCount ? paramCount * 0.6 / 1024 ** 3 : 4;
614280
- if (arch3) {
614281
- const archMax = info[`${arch3}.context_length`];
614282
- const nLayers = info[`${arch3}.block_count`];
614283
- const nKVHeads = info[`${arch3}.attention.head_count_kv`] ?? info[`${arch3}.attention.head_count`];
614284
- const keyDim = info[`${arch3}.attention.key_length`];
614285
- const valDim = info[`${arch3}.attention.value_length`] ?? keyDim;
614379
+ if (arch4) {
614380
+ const archMax = info[`${arch4}.context_length`];
614381
+ const nLayers = info[`${arch4}.block_count`];
614382
+ const nKVHeads = info[`${arch4}.attention.head_count_kv`] ?? info[`${arch4}.attention.head_count`];
614383
+ const keyDim = info[`${arch4}.attention.key_length`];
614384
+ const valDim = info[`${arch4}.attention.value_length`] ?? keyDim;
614286
614385
  if (archMax && nLayers && nKVHeads && keyDim && valDim) {
614287
614386
  const kvBytesPerToken = nLayers * nKVHeads * (keyDim + valDim) * 2;
614288
614387
  result[i2].contextLength = estimateRealisticContext(kvBytesPerToken, archMax, fileSizeGB);
@@ -614354,7 +614453,7 @@ async function fetchOpenAIModels(baseUrl2, apiKey) {
614354
614453
  async function fetchPeerModels(peerId, authKey) {
614355
614454
  try {
614356
614455
  const { NexusTool: NexusTool2 } = await Promise.resolve().then(() => (init_dist5(), dist_exports2));
614357
- const { existsSync: existsSync171, readFileSync: readFileSync140 } = await import("node:fs");
614456
+ const { existsSync: existsSync172, readFileSync: readFileSync140 } = await import("node:fs");
614358
614457
  const { join: join188 } = await import("node:path");
614359
614458
  const cwd4 = process.cwd();
614360
614459
  const nexusTool = new NexusTool2(cwd4);
@@ -614362,7 +614461,7 @@ async function fetchPeerModels(peerId, authKey) {
614362
614461
  let isLocalPeer = false;
614363
614462
  try {
614364
614463
  const statusPath = join188(nexusDir, "status.json");
614365
- if (existsSync171(statusPath)) {
614464
+ if (existsSync172(statusPath)) {
614366
614465
  const status = JSON.parse(readFileSync140(statusPath, "utf8"));
614367
614466
  if (status.peerId === peerId) isLocalPeer = true;
614368
614467
  }
@@ -614370,7 +614469,7 @@ async function fetchPeerModels(peerId, authKey) {
614370
614469
  }
614371
614470
  if (isLocalPeer) {
614372
614471
  const pricingPath = join188(nexusDir, "pricing.json");
614373
- if (existsSync171(pricingPath)) {
614472
+ if (existsSync172(pricingPath)) {
614374
614473
  try {
614375
614474
  const pricing = JSON.parse(readFileSync140(pricingPath, "utf8"));
614376
614475
  const localModels = (pricing.models || []).map((m2) => ({
@@ -614386,7 +614485,7 @@ async function fetchPeerModels(peerId, authKey) {
614386
614485
  }
614387
614486
  }
614388
614487
  const cachePath2 = join188(nexusDir, "peer-models-cache.json");
614389
- if (existsSync171(cachePath2)) {
614488
+ if (existsSync172(cachePath2)) {
614390
614489
  try {
614391
614490
  const cache8 = JSON.parse(readFileSync140(cachePath2, "utf8"));
614392
614491
  if (cache8.peerId === peerId && cache8.models?.length > 0) {
@@ -614501,7 +614600,7 @@ async function fetchPeerModels(peerId, authKey) {
614501
614600
  }
614502
614601
  if (isLocalPeer) {
614503
614602
  const pricingPath = join188(nexusDir, "pricing.json");
614504
- if (existsSync171(pricingPath)) {
614603
+ if (existsSync172(pricingPath)) {
614505
614604
  try {
614506
614605
  const pricing = JSON.parse(readFileSync140(pricingPath, "utf8"));
614507
614606
  return (pricing.models || []).map((m2) => ({
@@ -614579,15 +614678,15 @@ async function queryModelContextSize(baseUrl2, modelName) {
614579
614678
  if (explicitNumCtx) return explicitNumCtx;
614580
614679
  if (data.model_info) {
614581
614680
  const info = data.model_info;
614582
- const arch3 = info["general.architecture"];
614681
+ const arch4 = info["general.architecture"];
614583
614682
  const paramCount = info["general.parameter_count"];
614584
614683
  const modelSizeGB2 = paramCount ? paramCount * 0.6 / 1024 ** 3 : 4;
614585
- if (arch3) {
614586
- const archMax = info[`${arch3}.context_length`];
614587
- const nLayers = info[`${arch3}.block_count`];
614588
- const nKVHeads = info[`${arch3}.attention.head_count_kv`] ?? info[`${arch3}.attention.head_count`];
614589
- const keyDim = info[`${arch3}.attention.key_length`];
614590
- const valDim = info[`${arch3}.attention.value_length`] ?? keyDim;
614684
+ if (arch4) {
614685
+ const archMax = info[`${arch4}.context_length`];
614686
+ const nLayers = info[`${arch4}.block_count`];
614687
+ const nKVHeads = info[`${arch4}.attention.head_count_kv`] ?? info[`${arch4}.attention.head_count`];
614688
+ const keyDim = info[`${arch4}.attention.key_length`];
614689
+ const valDim = info[`${arch4}.attention.value_length`] ?? keyDim;
614591
614690
  if (archMax && nLayers && nKVHeads && keyDim && valDim) {
614592
614691
  const kvBytesPerToken = nLayers * nKVHeads * (keyDim + valDim) * 2;
614593
614692
  return estimateRealisticContext(kvBytesPerToken, archMax, modelSizeGB2);
@@ -618152,7 +618251,7 @@ var init_voice_session = __esm({
618152
618251
 
618153
618252
  // packages/cli/src/tui/scoped-personality.ts
618154
618253
  import { createHash as createHash32 } from "node:crypto";
618155
- import { appendFileSync as appendFileSync12, existsSync as existsSync114, mkdirSync as mkdirSync71, readFileSync as readFileSync93, writeFileSync as writeFileSync59 } from "node:fs";
618254
+ import { appendFileSync as appendFileSync12, existsSync as existsSync115, mkdirSync as mkdirSync71, readFileSync as readFileSync93, writeFileSync as writeFileSync59 } from "node:fs";
618156
618255
  import { join as join130, resolve as resolve55 } from "node:path";
618157
618256
  function safeName(input) {
618158
618257
  return input.replace(/[^A-Za-z0-9_.-]/g, "-").slice(0, 80) || "default";
@@ -618305,7 +618404,7 @@ function updateScopedPersonalityReplyPreference(scope, preference) {
618305
618404
  }
618306
618405
  function loadScopedPersonality(scope) {
618307
618406
  const paths = scopedPersonalityPaths(scope);
618308
- if (!existsSync114(paths.json)) return newDocument(scope);
618407
+ if (!existsSync115(paths.json)) return newDocument(scope);
618309
618408
  try {
618310
618409
  const parsed = JSON.parse(readFileSync93(paths.json, "utf8"));
618311
618410
  if (parsed.version !== PROFILE_VERSION) return newDocument(scope);
@@ -618531,7 +618630,7 @@ var init_scoped_personality = __esm({
618531
618630
 
618532
618631
  // packages/cli/src/tui/voice-soul.ts
618533
618632
  import { createHash as createHash33 } from "node:crypto";
618534
- import { existsSync as existsSync115, readdirSync as readdirSync37, readFileSync as readFileSync94 } from "node:fs";
618633
+ import { existsSync as existsSync116, readdirSync as readdirSync37, readFileSync as readFileSync94 } from "node:fs";
618535
618634
  import { basename as basename24, join as join131, resolve as resolve56 } from "node:path";
618536
618635
  function compactText(text2, limit) {
618537
618636
  const compact4 = text2.replace(/\s+/g, " ").trim();
@@ -618556,7 +618655,7 @@ function soulRuntimeStatePath(input) {
618556
618655
  }
618557
618656
  function loadSoulRuntimeState(input) {
618558
618657
  const path12 = soulRuntimeStatePath(input);
618559
- if (!existsSync115(path12)) return { version: 1 };
618658
+ if (!existsSync116(path12)) return { version: 1 };
618560
618659
  try {
618561
618660
  const parsed = JSON.parse(readFileSync94(path12, "utf8"));
618562
618661
  if (!parsed || parsed.version !== 1) return { version: 1 };
@@ -618674,7 +618773,7 @@ function findProjectSoul(scope) {
618674
618773
  resolve56(scope.repoRoot, "SOUL.md"),
618675
618774
  resolve56(scope.repoRoot, ".aiwg", "SOUL.md")
618676
618775
  ]) {
618677
- if (!existsSync115(candidate)) continue;
618776
+ if (!existsSync116(candidate)) continue;
618678
618777
  try {
618679
618778
  return { path: candidate, content: readFileSync94(candidate, "utf8") };
618680
618779
  } catch {
@@ -618685,7 +618784,7 @@ function findProjectSoul(scope) {
618685
618784
  }
618686
618785
  function findProjectVoice(scope) {
618687
618786
  const voiceDir3 = resolve56(scope.repoRoot, ".aiwg", "voices");
618688
- if (!existsSync115(voiceDir3)) return null;
618787
+ if (!existsSync116(voiceDir3)) return null;
618689
618788
  try {
618690
618789
  const files = readdirSync37(voiceDir3).filter((name10) => /\.ya?ml$/i.test(name10)).sort((a2, b) => {
618691
618790
  const ap = /^(default|omnius|project)\.ya?ml$/i.test(a2) ? 0 : 1;
@@ -618959,8 +619058,8 @@ import { spawn as spawn32, exec as exec3 } from "node:child_process";
618959
619058
  import { EventEmitter as EventEmitter8 } from "node:events";
618960
619059
  import { randomBytes as randomBytes22, timingSafeEqual } from "node:crypto";
618961
619060
  import { URL as URL2 } from "node:url";
618962
- import { loadavg, cpus as cpus3, totalmem as totalmem6, freemem as freemem4 } from "node:os";
618963
- import { existsSync as existsSync116, readFileSync as readFileSync95, writeFileSync as writeFileSync60, unlinkSync as unlinkSync20, mkdirSync as mkdirSync72, readdirSync as readdirSync38, statSync as statSync45, statfsSync as statfsSync7 } from "node:fs";
619061
+ import { loadavg, cpus as cpus3, totalmem as totalmem6, freemem as freemem5 } from "node:os";
619062
+ import { existsSync as existsSync117, readFileSync as readFileSync95, writeFileSync as writeFileSync60, unlinkSync as unlinkSync20, mkdirSync as mkdirSync72, readdirSync as readdirSync38, statSync as statSync45, statfsSync as statfsSync7 } from "node:fs";
618964
619063
  import { join as join132 } from "node:path";
618965
619064
  function cleanForwardHeaders(raw, targetHost) {
618966
619065
  const out = {};
@@ -619130,7 +619229,7 @@ function nextSponsorDailyReset(now2 = Date.now()) {
619130
619229
  function readSponsorUsageState(stateDir) {
619131
619230
  try {
619132
619231
  const path12 = join132(stateDir, "sponsor", SPONSOR_USAGE_FILE_NAME);
619133
- if (!existsSync116(path12)) return null;
619232
+ if (!existsSync117(path12)) return null;
619134
619233
  const parsed = JSON.parse(readFileSync95(path12, "utf8"));
619135
619234
  const dailyTokensUsed = safeNonNegativeInt(parsed.dailyTokensUsed);
619136
619235
  const dailyTokensResetAt = safeNonNegativeInt(parsed.dailyTokensResetAt);
@@ -619155,7 +619254,7 @@ function writeSponsorUsageState(stateDir, state) {
619155
619254
  function readExposeState(stateDir) {
619156
619255
  try {
619157
619256
  const path12 = join132(stateDir, STATE_FILE_NAME);
619158
- if (!existsSync116(path12)) return null;
619257
+ if (!existsSync117(path12)) return null;
619159
619258
  const raw = readFileSync95(path12, "utf8");
619160
619259
  const data = JSON.parse(raw);
619161
619260
  if (!data.pid || !data.tunnelUrl || !data.authKey || !data.proxyPort) return null;
@@ -619220,7 +619319,7 @@ async function collectSystemMetricsAsync() {
619220
619319
  const [l1, l5, l15] = loadavg();
619221
619320
  const cores = cpus3().length;
619222
619321
  const totalMem = totalmem6();
619223
- const freeMem = freemem4();
619322
+ const freeMem = freemem5();
619224
619323
  const usedMem = totalMem - freeMem;
619225
619324
  let disk = {
619226
619325
  path: process.cwd(),
@@ -619293,7 +619392,7 @@ async function collectSystemMetricsAsync() {
619293
619392
  function readP2PExposeState(stateDir) {
619294
619393
  try {
619295
619394
  const path12 = join132(stateDir, P2P_STATE_FILE_NAME);
619296
- if (!existsSync116(path12)) return null;
619395
+ if (!existsSync117(path12)) return null;
619297
619396
  const raw = readFileSync95(path12, "utf8");
619298
619397
  const data = JSON.parse(raw);
619299
619398
  if (!data.peerId || !data.authKey) return null;
@@ -620730,7 +620829,7 @@ ${this.formatConnectionInfo()}`);
620730
620829
  }
620731
620830
  try {
620732
620831
  const invocDir = join132(nexusDir, "invocations");
620733
- if (existsSync116(invocDir)) {
620832
+ if (existsSync117(invocDir)) {
620734
620833
  this._prevInvocCount = readdirSync38(invocDir).filter((f2) => f2.endsWith(".json")).length;
620735
620834
  this._stats.totalRequests = this._prevInvocCount;
620736
620835
  }
@@ -620759,7 +620858,7 @@ ${this.formatConnectionInfo()}`);
620759
620858
  const nexusDir = nexusTool.getNexusDir();
620760
620859
  const statusPath = join132(nexusDir, "status.json");
620761
620860
  try {
620762
- if (!existsSync116(statusPath)) {
620861
+ if (!existsSync117(statusPath)) {
620763
620862
  removeP2PExposeState(stateDir);
620764
620863
  return null;
620765
620864
  }
@@ -620817,7 +620916,7 @@ ${this.formatConnectionInfo()}`);
620817
620916
  this._activityPollTimer = setInterval(() => {
620818
620917
  try {
620819
620918
  const invocDir = join132(nexusDir, "invocations");
620820
- if (!existsSync116(invocDir)) return;
620919
+ if (!existsSync117(invocDir)) return;
620821
620920
  const files = readdirSync38(invocDir).filter((f2) => f2.endsWith(".json"));
620822
620921
  const invocCount = files.length;
620823
620922
  const newRequests = invocCount - this._prevInvocCount;
@@ -620840,7 +620939,7 @@ ${this.formatConnectionInfo()}`);
620840
620939
  const meteringFile = join132(nexusDir, "metering.jsonl");
620841
620940
  let meteringLines = lastMeteringLineCount;
620842
620941
  try {
620843
- if (existsSync116(meteringFile)) {
620942
+ if (existsSync117(meteringFile)) {
620844
620943
  const content = readFileSync95(meteringFile, "utf8");
620845
620944
  meteringLines = content.split("\n").filter((l2) => l2.trim()).length;
620846
620945
  }
@@ -620869,7 +620968,7 @@ ${this.formatConnectionInfo()}`);
620869
620968
  this._pollTimer = setInterval(() => {
620870
620969
  try {
620871
620970
  const statusPath = join132(nexusDir, "status.json");
620872
- if (existsSync116(statusPath)) {
620971
+ if (existsSync117(statusPath)) {
620873
620972
  const status = JSON.parse(readFileSync95(statusPath, "utf8"));
620874
620973
  if (status.peerId && !this._peerId) {
620875
620974
  this._peerId = status.peerId;
@@ -620880,7 +620979,7 @@ ${this.formatConnectionInfo()}`);
620880
620979
  }
620881
620980
  try {
620882
620981
  const invocDir = join132(nexusDir, "invocations");
620883
- if (existsSync116(invocDir)) {
620982
+ if (existsSync117(invocDir)) {
620884
620983
  const files = readdirSync38(invocDir);
620885
620984
  const invocCount = files.filter((f2) => f2.endsWith(".json")).length;
620886
620985
  if (invocCount > this._stats.totalRequests) {
@@ -620892,7 +620991,7 @@ ${this.formatConnectionInfo()}`);
620892
620991
  }
620893
620992
  try {
620894
620993
  const meteringFile = join132(nexusDir, "metering.jsonl");
620895
- if (existsSync116(meteringFile)) {
620994
+ if (existsSync117(meteringFile)) {
620896
620995
  const content = readFileSync95(meteringFile, "utf8");
620897
620996
  if (content.length > lastMeteringSize) {
620898
620997
  const newContent = content.slice(lastMeteringSize);
@@ -621190,7 +621289,7 @@ var init_types3 = __esm({
621190
621289
 
621191
621290
  // packages/cli/src/tui/p2p/secret-vault.ts
621192
621291
  import { createCipheriv as createCipheriv3, createDecipheriv as createDecipheriv3, randomBytes as randomBytes23, scryptSync as scryptSync2, createHash as createHash34 } from "node:crypto";
621193
- import { readFileSync as readFileSync96, writeFileSync as writeFileSync61, existsSync as existsSync117, mkdirSync as mkdirSync73 } from "node:fs";
621292
+ import { readFileSync as readFileSync96, writeFileSync as writeFileSync61, existsSync as existsSync118, mkdirSync as mkdirSync73 } from "node:fs";
621194
621293
  import { dirname as dirname39 } from "node:path";
621195
621294
  var PLACEHOLDER_PREFIX, PLACEHOLDER_SUFFIX, CIPHER_ALGO, SALT_LEN, IV_LEN, KEY_LEN, SecretVault;
621196
621295
  var init_secret_vault = __esm({
@@ -621399,7 +621498,7 @@ var init_secret_vault = __esm({
621399
621498
  const tag = cipher.getAuthTag();
621400
621499
  const blob = Buffer.concat([salt, iv, tag, encrypted]);
621401
621500
  const dir = dirname39(this.storePath);
621402
- if (!existsSync117(dir)) mkdirSync73(dir, { recursive: true });
621501
+ if (!existsSync118(dir)) mkdirSync73(dir, { recursive: true });
621403
621502
  writeFileSync61(this.storePath, blob, { mode: 384 });
621404
621503
  }
621405
621504
  /**
@@ -621407,7 +621506,7 @@ var init_secret_vault = __esm({
621407
621506
  * Returns the number of secrets loaded.
621408
621507
  */
621409
621508
  load(passphrase) {
621410
- if (!this.storePath || !existsSync117(this.storePath)) return 0;
621509
+ if (!this.storePath || !existsSync118(this.storePath)) return 0;
621411
621510
  const blob = readFileSync96(this.storePath);
621412
621511
  if (blob.length < SALT_LEN + IV_LEN + 16) {
621413
621512
  throw new Error("Vault file is corrupted (too small)");
@@ -622446,7 +622545,7 @@ ${activitySummary}
622446
622545
  });
622447
622546
 
622448
622547
  // packages/cli/src/api/profiles.ts
622449
- import { existsSync as existsSync118, readFileSync as readFileSync97, writeFileSync as writeFileSync62, mkdirSync as mkdirSync74, readdirSync as readdirSync39, unlinkSync as unlinkSync21 } from "node:fs";
622548
+ import { existsSync as existsSync119, readFileSync as readFileSync97, writeFileSync as writeFileSync62, mkdirSync as mkdirSync74, readdirSync as readdirSync39, unlinkSync as unlinkSync21 } from "node:fs";
622450
622549
  import { join as join134 } from "node:path";
622451
622550
  import { homedir as homedir41 } from "node:os";
622452
622551
  import { createCipheriv as createCipheriv4, createDecipheriv as createDecipheriv4, randomBytes as randomBytes25, scryptSync as scryptSync3 } from "node:crypto";
@@ -622463,7 +622562,7 @@ function listProfiles(projectDir2) {
622463
622562
  const result = [];
622464
622563
  const seen = /* @__PURE__ */ new Set();
622465
622564
  const projDir = projectProfileDir(projectDir2);
622466
- if (existsSync118(projDir)) {
622565
+ if (existsSync119(projDir)) {
622467
622566
  for (const f2 of readdirSync39(projDir).filter((f3) => f3.endsWith(".json"))) {
622468
622567
  try {
622469
622568
  const raw = JSON.parse(readFileSync97(join134(projDir, f2), "utf8"));
@@ -622480,7 +622579,7 @@ function listProfiles(projectDir2) {
622480
622579
  }
622481
622580
  }
622482
622581
  const globDir = globalProfileDir();
622483
- if (existsSync118(globDir)) {
622582
+ if (existsSync119(globDir)) {
622484
622583
  for (const f2 of readdirSync39(globDir).filter((f3) => f3.endsWith(".json"))) {
622485
622584
  const name10 = f2.replace(".json", "");
622486
622585
  if (seen.has(name10)) continue;
@@ -622520,7 +622619,7 @@ function loadProfileWithMeta(name10, password, projectDir2) {
622520
622619
  { source: "global", path: globPath }
622521
622620
  ];
622522
622621
  for (const candidate of candidates) {
622523
- if (!existsSync118(candidate.path)) continue;
622622
+ if (!existsSync119(candidate.path)) continue;
622524
622623
  const raw = JSON.parse(readFileSync97(candidate.path, "utf8"));
622525
622624
  if (raw.encrypted === true) {
622526
622625
  if (!password) return null;
@@ -622549,7 +622648,7 @@ function deleteProfile(name10, scope = "global", projectDir2) {
622549
622648
  const sanitized = name10.replace(/[^a-zA-Z0-9_-]/g, "");
622550
622649
  const dir = scope === "project" ? projectProfileDir(projectDir2) : globalProfileDir();
622551
622650
  const filePath = join134(dir, `${sanitized}.json`);
622552
- if (existsSync118(filePath)) {
622651
+ if (existsSync119(filePath)) {
622553
622652
  unlinkSync21(filePath);
622554
622653
  return true;
622555
622654
  }
@@ -622828,20 +622927,20 @@ __export(omnius_directory_exports, {
622828
622927
  writeIndexMeta: () => writeIndexMeta,
622829
622928
  writeTaskHandoff: () => writeTaskHandoff2
622830
622929
  });
622831
- import { appendFileSync as appendFileSync13, cpSync as cpSync2, existsSync as existsSync119, mkdirSync as mkdirSync75, readFileSync as readFileSync98, writeFileSync as writeFileSync63, readdirSync as readdirSync40, statSync as statSync46, unlinkSync as unlinkSync22, openSync as openSync2, closeSync as closeSync2, renameSync as renameSync11, watch as fsWatch2 } from "node:fs";
622930
+ import { appendFileSync as appendFileSync13, cpSync as cpSync2, existsSync as existsSync120, mkdirSync as mkdirSync75, readFileSync as readFileSync98, writeFileSync as writeFileSync63, readdirSync as readdirSync40, statSync as statSync46, unlinkSync as unlinkSync22, openSync as openSync2, closeSync as closeSync2, renameSync as renameSync11, watch as fsWatch2 } from "node:fs";
622832
622931
  import { join as join135, relative as relative13, basename as basename25, dirname as dirname40, resolve as resolve57 } from "node:path";
622833
622932
  import { homedir as homedir42 } from "node:os";
622834
622933
  import { createHash as createHash37 } from "node:crypto";
622835
622934
  function isGitRoot(dir) {
622836
622935
  const gitPath = join135(dir, ".git");
622837
- if (!existsSync119(gitPath)) return false;
622936
+ if (!existsSync120(gitPath)) return false;
622838
622937
  try {
622839
622938
  const stat9 = statSync46(gitPath);
622840
622939
  if (stat9.isFile()) {
622841
622940
  return readFileSync98(gitPath, "utf-8").trim().startsWith("gitdir:");
622842
622941
  }
622843
622942
  if (!stat9.isDirectory()) return false;
622844
- return existsSync119(join135(gitPath, "HEAD")) || existsSync119(join135(gitPath, "config")) || existsSync119(join135(gitPath, "commondir"));
622943
+ return existsSync120(join135(gitPath, "HEAD")) || existsSync120(join135(gitPath, "config")) || existsSync120(join135(gitPath, "commondir"));
622845
622944
  } catch {
622846
622945
  return false;
622847
622946
  }
@@ -622864,7 +622963,7 @@ function findNearestExistingGitignore(startDir, gitRoot) {
622864
622963
  while (dir && !visited.has(dir)) {
622865
622964
  visited.add(dir);
622866
622965
  const candidate = join135(dir, ".gitignore");
622867
- if (existsSync119(candidate)) return candidate;
622966
+ if (existsSync120(candidate)) return candidate;
622868
622967
  if (dir === gitRoot) break;
622869
622968
  const parent = join135(dir, "..");
622870
622969
  if (parent === dir) break;
@@ -622981,7 +623080,7 @@ function stopOmniusGitignoreWatcher(repoRoot) {
622981
623080
  function migrateLegacyDirectories(repoRoot, omniusPath) {
622982
623081
  for (const legacyDir of LEGACY_DIRS) {
622983
623082
  const legacyPath = join135(repoRoot, legacyDir);
622984
- if (!existsSync119(legacyPath) || legacyPath === omniusPath) continue;
623083
+ if (!existsSync120(legacyPath) || legacyPath === omniusPath) continue;
622985
623084
  try {
622986
623085
  cpSync2(legacyPath, omniusPath, {
622987
623086
  recursive: true,
@@ -623014,12 +623113,12 @@ function initOmniusDirectory(repoRoot) {
623014
623113
  return omniusPath;
623015
623114
  }
623016
623115
  function hasOmniusDirectory(repoRoot) {
623017
- return existsSync119(join135(repoRoot, OMNIUS_DIR, "index"));
623116
+ return existsSync120(join135(repoRoot, OMNIUS_DIR, "index"));
623018
623117
  }
623019
623118
  function loadProjectSettings(repoRoot) {
623020
623119
  const settingsPath = join135(repoRoot, OMNIUS_DIR, "settings.json");
623021
623120
  try {
623022
- if (existsSync119(settingsPath)) {
623121
+ if (existsSync120(settingsPath)) {
623023
623122
  return JSON.parse(readFileSync98(settingsPath, "utf-8"));
623024
623123
  }
623025
623124
  } catch {
@@ -623036,7 +623135,7 @@ function saveProjectSettings(repoRoot, settings) {
623036
623135
  function loadGlobalSettings() {
623037
623136
  const settingsPath = join135(homedir42(), ".omnius", "settings.json");
623038
623137
  try {
623039
- if (existsSync119(settingsPath)) {
623138
+ if (existsSync120(settingsPath)) {
623040
623139
  return JSON.parse(readFileSync98(settingsPath, "utf-8"));
623041
623140
  }
623042
623141
  } catch {
@@ -623065,7 +623164,7 @@ function discoverContextFiles(repoRoot, maxContentLen = 8e3) {
623065
623164
  for (const name10 of CONTEXT_FILES) {
623066
623165
  const filePath = join135(dir, name10);
623067
623166
  const normalizedName = name10.toLowerCase();
623068
- if (existsSync119(filePath) && !seen.has(filePath)) {
623167
+ if (existsSync120(filePath) && !seen.has(filePath)) {
623069
623168
  seen.add(filePath);
623070
623169
  try {
623071
623170
  let content = readFileSync98(filePath, "utf-8");
@@ -623185,7 +623284,7 @@ function saveSession(repoRoot, session) {
623185
623284
  }
623186
623285
  function loadRecentSessions(repoRoot, limit = 5) {
623187
623286
  const historyDir = join135(repoRoot, OMNIUS_DIR, "history");
623188
- if (!existsSync119(historyDir)) return [];
623287
+ if (!existsSync120(historyDir)) return [];
623189
623288
  try {
623190
623289
  const files = readdirSync40(historyDir).filter((f2) => f2.endsWith(".json") && f2 !== "pending-task.json").map((f2) => {
623191
623290
  const stat9 = statSync46(join135(historyDir, f2));
@@ -623216,7 +623315,7 @@ function savePendingTask(repoRoot, task) {
623216
623315
  function loadPendingTask(repoRoot) {
623217
623316
  const filePath = join135(repoRoot, OMNIUS_DIR, "history", PENDING_TASK_FILE);
623218
623317
  try {
623219
- if (!existsSync119(filePath)) return null;
623318
+ if (!existsSync120(filePath)) return null;
623220
623319
  const data = JSON.parse(readFileSync98(filePath, "utf-8"));
623221
623320
  try {
623222
623321
  unlinkSync22(filePath);
@@ -623246,7 +623345,7 @@ function writeTaskHandoff2(repoRoot, handoff) {
623246
623345
  function readTaskHandoff2(repoRoot) {
623247
623346
  const filePath = join135(repoRoot, OMNIUS_DIR, "context", HANDOFF_FILE);
623248
623347
  try {
623249
- if (!existsSync119(filePath)) return null;
623348
+ if (!existsSync120(filePath)) return null;
623250
623349
  const data = JSON.parse(readFileSync98(filePath, "utf-8"));
623251
623350
  const handoffTime = new Date(data.handoffAt).getTime();
623252
623351
  const now2 = Date.now();
@@ -623263,7 +623362,7 @@ function readTaskHandoff2(repoRoot) {
623263
623362
  function clearTaskHandoff(repoRoot) {
623264
623363
  const filePath = join135(repoRoot, OMNIUS_DIR, "context", HANDOFF_FILE);
623265
623364
  try {
623266
- if (existsSync119(filePath)) {
623365
+ if (existsSync120(filePath)) {
623267
623366
  unlinkSync22(filePath);
623268
623367
  }
623269
623368
  } catch {
@@ -623331,7 +623430,7 @@ function acquireLock(lockPath) {
623331
623430
  closeSync2(fd);
623332
623431
  return true;
623333
623432
  } catch (err) {
623334
- if (existsSync119(lockPath)) {
623433
+ if (existsSync120(lockPath)) {
623335
623434
  try {
623336
623435
  const lockContent = readFileSync98(lockPath, "utf-8");
623337
623436
  const lock = JSON.parse(lockContent);
@@ -623358,7 +623457,7 @@ function acquireLock(lockPath) {
623358
623457
  }
623359
623458
  function releaseLock(lockPath) {
623360
623459
  try {
623361
- if (existsSync119(lockPath)) {
623460
+ if (existsSync120(lockPath)) {
623362
623461
  const lockContent = readFileSync98(lockPath, "utf-8");
623363
623462
  const lock = JSON.parse(lockContent);
623364
623463
  if (lock.pid === process.pid) {
@@ -623448,7 +623547,7 @@ function mergeSessionContextEntry(previous, incoming) {
623448
623547
  }
623449
623548
  function pruneContextLedger(ledgerPath) {
623450
623549
  try {
623451
- if (!existsSync119(ledgerPath)) return;
623550
+ if (!existsSync120(ledgerPath)) return;
623452
623551
  const st = statSync46(ledgerPath);
623453
623552
  if (st.size <= MAX_CONTEXT_LEDGER_BYTES) return;
623454
623553
  const lines = readFileSync98(ledgerPath, "utf-8").split(/\r?\n/).filter((line) => line.trim().length > 0);
@@ -623478,7 +623577,7 @@ function saveSessionContext(repoRoot, entry) {
623478
623577
  try {
623479
623578
  let ctx3;
623480
623579
  try {
623481
- if (existsSync119(filePath)) {
623580
+ if (existsSync120(filePath)) {
623482
623581
  ctx3 = JSON.parse(readFileSync98(filePath, "utf-8"));
623483
623582
  } else {
623484
623583
  ctx3 = { entries: [], maxEntries: MAX_CONTEXT_ENTRIES, updatedAt: "" };
@@ -623640,7 +623739,7 @@ function renderSessionDiary(entries) {
623640
623739
  function loadSessionContext(repoRoot) {
623641
623740
  const filePath = join135(repoRoot, OMNIUS_DIR, "context", CONTEXT_SAVE_FILE);
623642
623741
  try {
623643
- if (!existsSync119(filePath)) return null;
623742
+ if (!existsSync120(filePath)) return null;
623644
623743
  return JSON.parse(readFileSync98(filePath, "utf-8"));
623645
623744
  } catch {
623646
623745
  return null;
@@ -623648,7 +623747,7 @@ function loadSessionContext(repoRoot) {
623648
623747
  }
623649
623748
  function readJsonOrNull(filePath) {
623650
623749
  try {
623651
- if (!existsSync119(filePath)) return null;
623750
+ if (!existsSync120(filePath)) return null;
623652
623751
  return JSON.parse(readFileSync98(filePath, "utf-8"));
623653
623752
  } catch {
623654
623753
  return null;
@@ -623715,7 +623814,7 @@ function scoreRestoreLedger(ledger, workboard) {
623715
623814
  function selectActiveTaskAnchor(repoRoot) {
623716
623815
  const ledgerDir = join135(repoRoot, OMNIUS_DIR, "completion-ledgers");
623717
623816
  try {
623718
- if (!existsSync119(ledgerDir)) return null;
623817
+ if (!existsSync120(ledgerDir)) return null;
623719
623818
  const candidates = readdirSync40(ledgerDir).filter((name10) => name10.endsWith(".json")).map((name10) => {
623720
623819
  const filePath = join135(ledgerDir, name10);
623721
623820
  const ledger = readJsonOrNull(filePath);
@@ -623859,7 +623958,7 @@ function getLastTaskSummary(repoRoot) {
623859
623958
  function updateSessionEntry(repoRoot, sessionId, patch) {
623860
623959
  const indexPath = join135(repoRoot, OMNIUS_DIR, SESSIONS_DIR, SESSIONS_INDEX);
623861
623960
  try {
623862
- if (!existsSync119(indexPath)) return false;
623961
+ if (!existsSync120(indexPath)) return false;
623863
623962
  const index = JSON.parse(readFileSync98(indexPath, "utf-8"));
623864
623963
  const idx = index.findIndex((e2) => e2.id === sessionId);
623865
623964
  if (idx < 0) return false;
@@ -623908,7 +624007,7 @@ function saveSessionHistory(repoRoot, sessionId, contentLines, meta) {
623908
624007
  const indexPath = join135(sessDir, SESSIONS_INDEX);
623909
624008
  let index = [];
623910
624009
  try {
623911
- if (existsSync119(indexPath)) {
624010
+ if (existsSync120(indexPath)) {
623912
624011
  index = JSON.parse(readFileSync98(indexPath, "utf-8"));
623913
624012
  }
623914
624013
  } catch {
@@ -623940,7 +624039,7 @@ function saveSessionHistory(repoRoot, sessionId, contentLines, meta) {
623940
624039
  function listSessions(repoRoot) {
623941
624040
  const indexPath = join135(repoRoot, OMNIUS_DIR, SESSIONS_DIR, SESSIONS_INDEX);
623942
624041
  try {
623943
- if (!existsSync119(indexPath)) return [];
624042
+ if (!existsSync120(indexPath)) return [];
623944
624043
  const index = JSON.parse(readFileSync98(indexPath, "utf-8"));
623945
624044
  return index.map((entry) => sanitizeSessionHistoryEntry(repoRoot, entry)).sort((a2, b) => b.updatedAt.localeCompare(a2.updatedAt));
623946
624045
  } catch {
@@ -623950,7 +624049,7 @@ function listSessions(repoRoot) {
623950
624049
  function loadSessionHistory(repoRoot, sessionId) {
623951
624050
  const contentPath = join135(repoRoot, OMNIUS_DIR, SESSIONS_DIR, `${sessionId}.jsonl`);
623952
624051
  try {
623953
- if (!existsSync119(contentPath)) return null;
624052
+ if (!existsSync120(contentPath)) return null;
623954
624053
  return readFileSync98(contentPath, "utf-8").split("\n");
623955
624054
  } catch {
623956
624055
  return null;
@@ -623961,8 +624060,8 @@ function deleteSession(repoRoot, sessionId) {
623961
624060
  const indexPath = join135(sessDir, SESSIONS_INDEX);
623962
624061
  try {
623963
624062
  const contentPath = join135(sessDir, `${sessionId}.jsonl`);
623964
- if (existsSync119(contentPath)) unlinkSync22(contentPath);
623965
- if (existsSync119(indexPath)) {
624063
+ if (existsSync120(contentPath)) unlinkSync22(contentPath);
624064
+ if (existsSync120(indexPath)) {
623966
624065
  let index = JSON.parse(readFileSync98(indexPath, "utf-8"));
623967
624066
  index = index.filter((s2) => s2.id !== sessionId);
623968
624067
  writeFileSync63(indexPath, JSON.stringify(index, null, 2), "utf-8");
@@ -624016,7 +624115,7 @@ function detectManifests(repoRoot) {
624016
624115
  ];
624017
624116
  for (const check of checks) {
624018
624117
  const filePath = join135(repoRoot, check.file);
624019
- if (existsSync119(filePath)) {
624118
+ if (existsSync120(filePath)) {
624020
624119
  let name10;
624021
624120
  if (check.nameField) {
624022
624121
  try {
@@ -624049,7 +624148,7 @@ function findKeyFiles(repoRoot) {
624049
624148
  { pattern: "CLAUDE.md", description: "Claude Code context" }
624050
624149
  ];
624051
624150
  for (const check of checks) {
624052
- if (existsSync119(join135(repoRoot, check.pattern))) {
624151
+ if (existsSync120(join135(repoRoot, check.pattern))) {
624053
624152
  keyFiles.push({ path: check.pattern, description: check.description });
624054
624153
  }
624055
624154
  }
@@ -624090,7 +624189,7 @@ function buildDirTree(root, maxDepth, prefix = "", depth = 0) {
624090
624189
  }
624091
624190
  function loadUsageFile(filePath) {
624092
624191
  try {
624093
- if (existsSync119(filePath)) {
624192
+ if (existsSync120(filePath)) {
624094
624193
  return JSON.parse(readFileSync98(filePath, "utf-8"));
624095
624194
  }
624096
624195
  } catch {
@@ -624418,14 +624517,14 @@ var init_session_summary = __esm({
624418
624517
 
624419
624518
  // packages/cli/src/tui/cad-model-viewer.ts
624420
624519
  import { createServer as createServer7 } from "node:http";
624421
- import { existsSync as existsSync120, readFileSync as readFileSync99, statSync as statSync47 } from "node:fs";
624520
+ import { existsSync as existsSync121, readFileSync as readFileSync99, statSync as statSync47 } from "node:fs";
624422
624521
  import { basename as basename26, extname as extname16, resolve as resolve58 } from "node:path";
624423
624522
  function getCurrentCadModelViewer() {
624424
624523
  return currentViewer;
624425
624524
  }
624426
624525
  async function startCadModelViewer(filePath) {
624427
624526
  const resolved = filePath ? resolve58(filePath) : void 0;
624428
- if (resolved && (!existsSync120(resolved) || !statSync47(resolved).isFile())) {
624527
+ if (resolved && (!existsSync121(resolved) || !statSync47(resolved).isFile())) {
624429
624528
  throw new Error(`3D model file not found: ${resolved}`);
624430
624529
  }
624431
624530
  if (currentViewer) {
@@ -624882,14 +624981,14 @@ var init_render2 = __esm({
624882
624981
  });
624883
624982
 
624884
624983
  // packages/prompts/dist/promptLoader.js
624885
- import { readFileSync as readFileSync101, existsSync as existsSync122 } from "node:fs";
624984
+ import { readFileSync as readFileSync101, existsSync as existsSync123 } from "node:fs";
624886
624985
  import { join as join137, dirname as dirname41 } from "node:path";
624887
624986
  import { fileURLToPath as fileURLToPath17 } from "node:url";
624888
624987
  function loadPrompt2(promptPath, vars) {
624889
624988
  let content = cache6.get(promptPath);
624890
624989
  if (content === void 0) {
624891
624990
  const fullPath = join137(PROMPTS_DIR2, promptPath);
624892
- if (!existsSync122(fullPath)) {
624991
+ if (!existsSync123(fullPath)) {
624893
624992
  throw new Error(`Prompt file not found: ${fullPath}`);
624894
624993
  }
624895
624994
  content = readFileSync101(fullPath, "utf-8");
@@ -624907,7 +625006,7 @@ var init_promptLoader2 = __esm({
624907
625006
  __dirname5 = dirname41(__filename4);
624908
625007
  devPath = join137(__dirname5, "..", "templates");
624909
625008
  publishedPath = join137(__dirname5, "..", "prompts", "templates");
624910
- PROMPTS_DIR2 = existsSync122(devPath) ? devPath : publishedPath;
625009
+ PROMPTS_DIR2 = existsSync123(devPath) ? devPath : publishedPath;
624911
625010
  cache6 = /* @__PURE__ */ new Map();
624912
625011
  }
624913
625012
  });
@@ -625391,7 +625490,7 @@ __export(system_metrics_exports, {
625391
625490
  getInstantSnapshot: () => getInstantSnapshot,
625392
625491
  instantaneousCpuPct: () => instantaneousCpuPct
625393
625492
  });
625394
- import { loadavg as loadavg2, cpus as cpus4, totalmem as totalmem7, freemem as freemem5, platform as platform4 } from "node:os";
625493
+ import { loadavg as loadavg2, cpus as cpus4, totalmem as totalmem7, freemem as freemem6, platform as platform4 } from "node:os";
625395
625494
  import { exec as exec4 } from "node:child_process";
625396
625495
  import { readFile as readFile24 } from "node:fs/promises";
625397
625496
  function formatRate(bytesPerSec) {
@@ -625582,7 +625681,7 @@ function collectCpuRam() {
625582
625681
  const cores = cpus4().length;
625583
625682
  const cpuModel = cpus4()[0]?.model ?? "";
625584
625683
  const totalMem = totalmem7();
625585
- const usedMem = totalMem - freemem5();
625684
+ const usedMem = totalMem - freemem6();
625586
625685
  let cpuUtil = instantaneousCpuPct();
625587
625686
  if (cpuUtil < 0) {
625588
625687
  const [l1] = loadavg2();
@@ -625989,7 +626088,7 @@ __export(tui_tasks_renderer_exports, {
625989
626088
  setTuiTasksSession: () => setTuiTasksSession,
625990
626089
  teardownTuiTasks: () => teardownTuiTasks
625991
626090
  });
625992
- import { existsSync as existsSync123, readFileSync as readFileSync102, watch as fsWatch3 } from "node:fs";
626091
+ import { existsSync as existsSync124, readFileSync as readFileSync102, watch as fsWatch3 } from "node:fs";
625993
626092
  import { join as join139 } from "node:path";
625994
626093
  import { homedir as homedir44 } from "node:os";
625995
626094
  function setTasksRendererWriter(writer) {
@@ -626112,7 +626211,7 @@ function loadTodos() {
626112
626211
  }
626113
626212
  try {
626114
626213
  const fp = todoPath2(_activeSessionId);
626115
- if (!existsSync123(fp)) {
626214
+ if (!existsSync124(fp)) {
626116
626215
  _lastTodos = [];
626117
626216
  return;
626118
626217
  }
@@ -627255,6 +627354,9 @@ var init_status_bar = __esm({
627255
627354
  const identity3 = this.buildHeaderIdentityRender();
627256
627355
  const modelLabel = this.summarizeHeaderModelName() || "model";
627257
627356
  const endpointLabel = this.summarizeHeaderTransport() || "endpoint";
627357
+ const headerLiveMediaActive = this._liveMediaStatus.audio || this._liveMediaStatus.video;
627358
+ const headerLiveDot = headerLiveMediaActive ? Math.floor(Date.now() / 500) % 2 === 0 ? "●" : "○" : "";
627359
+ const headerLiveLabel = headerLiveMediaActive ? `${headerLiveDot}live` : "live";
627258
627360
  const menuBtns = [
627259
627361
  { cmd: "help", label: "help", w: "help".length + 2 },
627260
627362
  // +2 for spaces
@@ -627264,7 +627366,7 @@ var init_status_bar = __esm({
627264
627366
  w: (this._voiceActive ? this._voiceModelId || "voice" : "voice").length + 2
627265
627367
  },
627266
627368
  // +2 for spaces
627267
- { cmd: "livechat", label: "live", w: "live".length + 2 },
627369
+ { cmd: "live", label: headerLiveLabel, w: headerLiveLabel.length + 2 },
627268
627370
  // +2 for spaces
627269
627371
  { cmd: "model", label: modelLabel, w: modelLabel.length + 2 },
627270
627372
  // +2 for spaces
@@ -627367,7 +627469,7 @@ var init_status_bar = __esm({
627367
627469
  w: telegramLabel.length + 2
627368
627470
  });
627369
627471
  const liveMediaActive = this._liveMediaStatus.audio || this._liveMediaStatus.video;
627370
- const liveMediaDot = liveMediaActive ? "●" : "○";
627472
+ const liveMediaDot = liveMediaActive ? Math.floor(Date.now() / 500) % 2 === 0 ? "●" : "○" : "○";
627371
627473
  const liveMediaLabel = liveMediaActive ? ` ${this._liveMediaStatus.audio ? "aud" : ""}${this._liveMediaStatus.audio && this._liveMediaStatus.video ? "+" : ""}${this._liveMediaStatus.video ? "vid" : ""} ` : " av ";
627372
627474
  sysItems.push({
627373
627475
  render: () => renderBtn("live", `${liveMediaDot}${liveMediaLabel}`) + " ",
@@ -631986,7 +632088,7 @@ __export(personaplex_exports, {
631986
632088
  startPersonaPlexDaemon: () => startPersonaPlexDaemon,
631987
632089
  stopPersonaPlex: () => stopPersonaPlex
631988
632090
  });
631989
- import { existsSync as existsSync124, writeFileSync as writeFileSync65, readFileSync as readFileSync103, mkdirSync as mkdirSync77, copyFileSync as copyFileSync5, readdirSync as readdirSync41, statSync as statSync48 } from "node:fs";
632091
+ import { existsSync as existsSync125, writeFileSync as writeFileSync65, readFileSync as readFileSync103, mkdirSync as mkdirSync77, copyFileSync as copyFileSync5, readdirSync as readdirSync41, statSync as statSync48 } from "node:fs";
631990
632092
  import { join as join140, dirname as dirname43 } from "node:path";
631991
632093
  import { homedir as homedir45 } from "node:os";
631992
632094
  import { spawn as spawn33 } from "node:child_process";
@@ -632101,7 +632203,7 @@ function fileLink2(filePath, label) {
632101
632203
  return `\x1B]8;;${url}\x1B\\${text2}\x1B]8;;\x1B\\`;
632102
632204
  }
632103
632205
  async function isPersonaPlexRunning() {
632104
- if (!existsSync124(PID_FILE)) return false;
632206
+ if (!existsSync125(PID_FILE)) return false;
632105
632207
  const pid = parseInt(readFileSync103(PID_FILE, "utf8").trim(), 10);
632106
632208
  if (isNaN(pid) || pid <= 0) return false;
632107
632209
  try {
@@ -632113,17 +632215,17 @@ async function isPersonaPlexRunning() {
632113
632215
  }
632114
632216
  async function getPersonaPlexWSUrl() {
632115
632217
  if (!await isPersonaPlexRunning()) return null;
632116
- if (!existsSync124(PORT_FILE)) return null;
632218
+ if (!existsSync125(PORT_FILE)) return null;
632117
632219
  const port = parseInt(readFileSync103(PORT_FILE, "utf8").trim(), 10);
632118
632220
  return isNaN(port) ? null : `wss://127.0.0.1:${port}`;
632119
632221
  }
632120
632222
  function isPersonaPlexInstalled() {
632121
- return existsSync124(join140(PERSONAPLEX_DIR, "model_ready"));
632223
+ return existsSync125(join140(PERSONAPLEX_DIR, "model_ready"));
632122
632224
  }
632123
632225
  async function getWeightTier() {
632124
632226
  const detected = await detectPersonaPlexCapability();
632125
632227
  const tierFile = join140(PERSONAPLEX_DIR, "weight_tier");
632126
- if (existsSync124(tierFile)) {
632228
+ if (existsSync125(tierFile)) {
632127
632229
  const saved = readFileSync103(tierFile, "utf8").trim();
632128
632230
  if (saved in WEIGHT_REPOS) {
632129
632231
  const vram = detected.vramGB;
@@ -632143,15 +632245,15 @@ async function installPersonaPlex(onInfo, weightTier) {
632143
632245
  const log22 = onInfo ?? (() => {
632144
632246
  });
632145
632247
  mkdirSync77(PERSONAPLEX_DIR, { recursive: true });
632146
- let arch3 = "";
632248
+ let arch4 = "";
632147
632249
  try {
632148
- arch3 = (await execAsync("uname -m", { timeout: 3e3 })).trim();
632250
+ arch4 = (await execAsync("uname -m", { timeout: 3e3 })).trim();
632149
632251
  } catch {
632150
632252
  }
632151
- const isAarch64 = arch3 === "aarch64" || arch3 === "arm64";
632152
- if (isAarch64) log22(`Detected ARM64 platform (${arch3}) — Jetson/ARM install path`);
632253
+ const isAarch64 = arch4 === "aarch64" || arch4 === "arm64";
632254
+ if (isAarch64) log22(`Detected ARM64 platform (${arch4}) — Jetson/ARM install path`);
632153
632255
  const venvDir = join140(PERSONAPLEX_DIR, "venv");
632154
- if (!existsSync124(venvDir)) {
632256
+ if (!existsSync125(venvDir)) {
632155
632257
  log22("Creating Python virtual environment...");
632156
632258
  try {
632157
632259
  const ssp = isAarch64 ? " --system-site-packages" : "";
@@ -632194,7 +632296,7 @@ async function installPersonaPlex(onInfo, weightTier) {
632194
632296
  log22("Installing PersonaPlex (moshi package)...");
632195
632297
  const repoDir = join140(PERSONAPLEX_DIR, "personaplex-repo");
632196
632298
  try {
632197
- if (!existsSync124(repoDir)) {
632299
+ if (!existsSync125(repoDir)) {
632198
632300
  await execAsync(
632199
632301
  `git clone https://github.com/NVIDIA/personaplex.git "${repoDir}"`,
632200
632302
  { timeout: 12e4 }
@@ -632253,7 +632355,7 @@ async function installPersonaPlex(onInfo, weightTier) {
632253
632355
  env: personaplexPythonEnv()
632254
632356
  })).trim();
632255
632357
  const serverFile = join140(sitePackages, "server.py");
632256
- if (existsSync124(serverFile)) {
632358
+ if (existsSync125(serverFile)) {
632257
632359
  let src2 = readFileSync103(serverFile, "utf8");
632258
632360
  if (src2.includes('int(request["seed"])')) {
632259
632361
  src2 = src2.replace('int(request["seed"])', 'int(request.query["seed"])');
@@ -632269,7 +632371,7 @@ async function installPersonaPlex(onInfo, weightTier) {
632269
632371
  env: personaplexPythonEnv()
632270
632372
  })).trim();
632271
632373
  const loadersFile = join140(sitePackages, "models", "loaders.py");
632272
- if (existsSync124(loadersFile)) {
632374
+ if (existsSync125(loadersFile)) {
632273
632375
  let src2 = readFileSync103(loadersFile, "utf8");
632274
632376
  if (!src2.includes("_dequantize_2bit_state_dict")) {
632275
632377
  const dequantPatch = `
@@ -632373,14 +632475,14 @@ $2if filename.endswith(".safetensors"):`
632373
632475
  })).trim();
632374
632476
  const hybridDest = join140(sitePackages2, "hybrid_agent.py");
632375
632477
  const serverDest = join140(sitePackages2, "server.py");
632376
- if (!existsSync124(hybridDest) || !readFileSync103(hybridDest, "utf8").includes("OMNIUS_API_BASE")) {
632478
+ if (!existsSync125(hybridDest) || !readFileSync103(hybridDest, "utf8").includes("OMNIUS_API_BASE")) {
632377
632479
  log22("Deploying hybrid_agent.py (Omnius API integration)...");
632378
632480
  try {
632379
632481
  await execAsync(
632380
632482
  `curl -sL "https://raw.githubusercontent.com/robit-man/personaplex/main/personaplex-setup/moshi/moshi/hybrid_agent.py" -o "${hybridDest}"`,
632381
632483
  { timeout: 3e4 }
632382
632484
  );
632383
- if (existsSync124(hybridDest) && readFileSync103(hybridDest, "utf8").includes("OMNIUS_API_BASE")) {
632485
+ if (existsSync125(hybridDest) && readFileSync103(hybridDest, "utf8").includes("OMNIUS_API_BASE")) {
632384
632486
  log22("hybrid_agent.py deployed (Omnius API + Ollama fallback).");
632385
632487
  }
632386
632488
  } catch {
@@ -632505,8 +632607,8 @@ async function startPersonaPlexDaemon(onInfo) {
632505
632607
  `"${venvPython2}" -c "from huggingface_hub import hf_hub_download; print(hf_hub_download('${repoInfo.repo}', '${repoInfo.file}', token=False))"`,
632506
632608
  { timeout: 6e4, env: personaplexPythonEnv() }
632507
632609
  )).trim();
632508
- if (existsSync124(weightPath)) {
632509
- if (!existsSync124(cachedBf16)) {
632610
+ if (existsSync125(weightPath)) {
632611
+ if (!existsSync125(cachedBf16)) {
632510
632612
  log22("Converting .pt checkpoint to safetensors (one-time)...");
632511
632613
  await execAsync(
632512
632614
  `"${venvPython2}" -c "
@@ -632519,7 +632621,7 @@ print('Converted')
632519
632621
  { timeout: 18e4, env: personaplexPythonEnv() }
632520
632622
  );
632521
632623
  }
632522
- if (existsSync124(cachedBf16)) {
632624
+ if (existsSync125(cachedBf16)) {
632523
632625
  extraArgs.push("--moshi-weight", cachedBf16);
632524
632626
  log22(`Using distilled weights: ${(statSync48(cachedBf16).size / 1024 ** 3).toFixed(1)}GB`);
632525
632627
  } else {
@@ -632532,11 +632634,11 @@ print('Converted')
632532
632634
  } else {
632533
632635
  log22(`Weight tier: ${tier} (${repoInfo.sizeGB}GB) — dequantizing to bf16 cache...`);
632534
632636
  const dequantScript = join140(PERSONAPLEX_DIR, "dequant-loader.py");
632535
- if (!existsSync124(dequantScript)) {
632637
+ if (!existsSync125(dequantScript)) {
632536
632638
  const shipped = getShippedVoicesDir();
632537
632639
  if (shipped) {
632538
632640
  const src2 = join140(shipped, "dequant-loader.py");
632539
- if (existsSync124(src2)) copyFileSync5(src2, dequantScript);
632641
+ if (existsSync125(src2)) copyFileSync5(src2, dequantScript);
632540
632642
  }
632541
632643
  }
632542
632644
  try {
@@ -632544,13 +632646,13 @@ print('Converted')
632544
632646
  `"${venvPython2}" -c "from huggingface_hub import hf_hub_download; print(hf_hub_download('${repoInfo.repo}', '${repoInfo.file}'${repoInfo.needsToken ? "" : ", token=False"}))"`,
632545
632647
  { timeout: 3e4, env: personaplexPythonEnv() }
632546
632648
  )).trim();
632547
- if (existsSync124(dequantScript) && existsSync124(weightPath)) {
632649
+ if (existsSync125(dequantScript) && existsSync125(weightPath)) {
632548
632650
  try {
632549
632651
  await execAsync(
632550
632652
  `"${venvPython2}" "${dequantScript}" --input "${weightPath}" --output "${cachedBf16}"`,
632551
632653
  { timeout: 3e5, env: personaplexPythonEnv() }
632552
632654
  );
632553
- if (existsSync124(cachedBf16)) {
632655
+ if (existsSync125(cachedBf16)) {
632554
632656
  extraArgs.push("--moshi-weight", cachedBf16);
632555
632657
  log22(`Using dequantized cache: ${(statSync48(cachedBf16).size / 1024 ** 3).toFixed(1)}GB`);
632556
632658
  }
@@ -632563,7 +632665,7 @@ print('Converted')
632563
632665
  `"${venvPython2}" -c "from huggingface_hub import hf_hub_download; print(hf_hub_download('${repoInfo.repo}', 'tokenizer-e351c8d8-checkpoint125.safetensors', token=False))"`,
632564
632666
  { timeout: 3e4, env: personaplexPythonEnv() }
632565
632667
  )).trim();
632566
- if (existsSync124(mimiPath)) extraArgs.push("--mimi-weight", mimiPath);
632668
+ if (existsSync125(mimiPath)) extraArgs.push("--mimi-weight", mimiPath);
632567
632669
  } catch {
632568
632670
  }
632569
632671
  try {
@@ -632571,7 +632673,7 @@ print('Converted')
632571
632673
  `"${venvPython2}" -c "from huggingface_hub import hf_hub_download; print(hf_hub_download('${repoInfo.repo}', 'tokenizer_spm_32k_3.model', token=False))"`,
632572
632674
  { timeout: 3e4, env: personaplexPythonEnv() }
632573
632675
  )).trim();
632574
- if (existsSync124(tokPath)) extraArgs.push("--tokenizer", tokPath);
632676
+ if (existsSync125(tokPath)) extraArgs.push("--tokenizer", tokPath);
632575
632677
  } catch {
632576
632678
  }
632577
632679
  } catch {
@@ -632678,7 +632780,7 @@ print('Converted')
632678
632780
  return null;
632679
632781
  }
632680
632782
  async function stopPersonaPlex() {
632681
- if (!existsSync124(PID_FILE)) return;
632783
+ if (!existsSync125(PID_FILE)) return;
632682
632784
  const pid = parseInt(readFileSync103(PID_FILE, "utf8").trim(), 10);
632683
632785
  if (isNaN(pid) || pid <= 0) return;
632684
632786
  try {
@@ -632715,7 +632817,7 @@ function listPersonaPlexVoices() {
632715
632817
  for (const name10 of builtins) {
632716
632818
  voices.push({ name: name10, type: "builtin", path: `${name10}.pt` });
632717
632819
  }
632718
- if (existsSync124(CUSTOM_VOICES_DIR)) {
632820
+ if (existsSync125(CUSTOM_VOICES_DIR)) {
632719
632821
  try {
632720
632822
  for (const f2 of readdirSync41(CUSTOM_VOICES_DIR)) {
632721
632823
  if (f2.endsWith(".pt")) {
@@ -632735,19 +632837,19 @@ async function clonePersonaPlexVoice(inputWav, voiceName, onInfo) {
632735
632837
  log22("PersonaPlex not installed. Run /voice personaplex first.");
632736
632838
  return null;
632737
632839
  }
632738
- if (!existsSync124(inputWav)) {
632840
+ if (!existsSync125(inputWav)) {
632739
632841
  log22(`Input WAV not found: ${inputWav}`);
632740
632842
  return null;
632741
632843
  }
632742
632844
  mkdirSync77(CUSTOM_VOICES_DIR, { recursive: true });
632743
632845
  const outputPt = join140(CUSTOM_VOICES_DIR, `${voiceName}.pt`);
632744
- if (existsSync124(outputPt)) {
632846
+ if (existsSync125(outputPt)) {
632745
632847
  log22(`Voice "${voiceName}" already exists. Delete ${outputPt} to re-clone.`);
632746
632848
  return outputPt;
632747
632849
  }
632748
632850
  const venvPython2 = process.platform === "win32" ? join140(PERSONAPLEX_DIR, "venv", "Scripts", "python.exe") : join140(PERSONAPLEX_DIR, "venv", "bin", "python3");
632749
632851
  const cloneScript = join140(PERSONAPLEX_DIR, "clone-voice.py");
632750
- if (!existsSync124(cloneScript)) {
632852
+ if (!existsSync125(cloneScript)) {
632751
632853
  log22("clone-voice.py not found. Reinstall PersonaPlex.");
632752
632854
  return null;
632753
632855
  }
@@ -632779,7 +632881,7 @@ async function clonePersonaPlexVoice(inputWav, voiceName, onInfo) {
632779
632881
  output += d2.toString();
632780
632882
  });
632781
632883
  onChildClose(child, (code8) => {
632782
- if (code8 === 0 && existsSync124(outputPt)) {
632884
+ if (code8 === 0 && existsSync125(outputPt)) {
632783
632885
  log22(`Voice "${voiceName}" cloned successfully.`);
632784
632886
  resolve76(outputPt);
632785
632887
  } else {
@@ -632803,7 +632905,7 @@ function getShippedVoicesDir() {
632803
632905
  } catch {
632804
632906
  }
632805
632907
  for (const dir of candidates) {
632806
- if (existsSync124(dir)) {
632908
+ if (existsSync125(dir)) {
632807
632909
  try {
632808
632910
  const files = readdirSync41(dir);
632809
632911
  if (files.some((f2) => f2.endsWith(".pt"))) return dir;
@@ -632825,12 +632927,12 @@ function provisionShippedVoices(onInfo) {
632825
632927
  for (const f2 of readdirSync41(shippedDir)) {
632826
632928
  if (!f2.endsWith(".pt")) continue;
632827
632929
  const customDst = join140(CUSTOM_VOICES_DIR, f2);
632828
- if (!existsSync124(customDst)) {
632930
+ if (!existsSync125(customDst)) {
632829
632931
  copyFileSync5(join140(shippedDir, f2), customDst);
632830
632932
  }
632831
632933
  if (hfVoicesDir) {
632832
632934
  const hfDst = join140(hfVoicesDir, f2);
632833
- if (!existsSync124(hfDst)) {
632935
+ if (!existsSync125(hfDst)) {
632834
632936
  copyFileSync5(join140(shippedDir, f2), hfDst);
632835
632937
  log22(`Deployed voice: ${f2.replace(".pt", "")}`);
632836
632938
  deployed++;
@@ -632841,7 +632943,7 @@ function provisionShippedVoices(onInfo) {
632841
632943
  }
632842
632944
  const shippedScript = join140(shippedDir, "clone-voice.py");
632843
632945
  const targetScript = join140(PERSONAPLEX_DIR, "clone-voice.py");
632844
- if (existsSync124(shippedScript) && !existsSync124(targetScript)) {
632946
+ if (existsSync125(shippedScript) && !existsSync125(targetScript)) {
632845
632947
  try {
632846
632948
  copyFileSync5(shippedScript, targetScript);
632847
632949
  } catch {
@@ -632851,13 +632953,13 @@ function provisionShippedVoices(onInfo) {
632851
632953
  }
632852
632954
  function getHFVoicesDir() {
632853
632955
  const hfBase = join140(homedir45(), ".cache", "huggingface", "hub", "models--nvidia--personaplex-7b-v1");
632854
- if (!existsSync124(hfBase)) return null;
632956
+ if (!existsSync125(hfBase)) return null;
632855
632957
  try {
632856
632958
  const snapshots = join140(hfBase, "snapshots");
632857
- if (!existsSync124(snapshots)) return null;
632959
+ if (!existsSync125(snapshots)) return null;
632858
632960
  for (const snap of readdirSync41(snapshots)) {
632859
632961
  const voicesDir = join140(snapshots, snap, "voices");
632860
- if (existsSync124(voicesDir)) return voicesDir;
632962
+ if (existsSync125(voicesDir)) return voicesDir;
632861
632963
  }
632862
632964
  } catch {
632863
632965
  }
@@ -632867,18 +632969,18 @@ function patchFrontendVoiceList(onInfo) {
632867
632969
  const log22 = onInfo ?? (() => {
632868
632970
  });
632869
632971
  const hfBase = join140(homedir45(), ".cache", "huggingface", "hub", "models--nvidia--personaplex-7b-v1");
632870
- if (!existsSync124(hfBase)) return;
632972
+ if (!existsSync125(hfBase)) return;
632871
632973
  try {
632872
632974
  const snapshots = join140(hfBase, "snapshots");
632873
632975
  for (const snap of readdirSync41(snapshots)) {
632874
632976
  const distDir = join140(snapshots, snap, "dist", "assets");
632875
- if (!existsSync124(distDir)) continue;
632977
+ if (!existsSync125(distDir)) continue;
632876
632978
  for (const f2 of readdirSync41(distDir)) {
632877
632979
  if (!f2.startsWith("index-") || !f2.endsWith(".js")) continue;
632878
632980
  const jsPath = join140(distDir, f2);
632879
632981
  let js = readFileSync103(jsPath, "utf8");
632880
632982
  const customVoices = [];
632881
- if (existsSync124(CUSTOM_VOICES_DIR)) {
632983
+ if (existsSync125(CUSTOM_VOICES_DIR)) {
632882
632984
  for (const vf of readdirSync41(CUSTOM_VOICES_DIR)) {
632883
632985
  if (vf.endsWith(".pt")) {
632884
632986
  const name10 = vf.replace(".pt", "");
@@ -632996,9 +633098,9 @@ __export(setup_exports, {
632996
633098
  import * as readline from "node:readline";
632997
633099
  import { spawn as spawn34, exec as exec5 } from "node:child_process";
632998
633100
  import { promisify as promisify7 } from "node:util";
632999
- import { existsSync as existsSync125, writeFileSync as writeFileSync66, readFileSync as readFileSync104, appendFileSync as appendFileSync14, mkdirSync as mkdirSync78, chmodSync as chmodSync3 } from "node:fs";
633101
+ import { existsSync as existsSync126, writeFileSync as writeFileSync66, readFileSync as readFileSync104, appendFileSync as appendFileSync14, mkdirSync as mkdirSync78, chmodSync as chmodSync3 } from "node:fs";
633000
633102
  import { delimiter as pathDelimiter, join as join141 } from "node:path";
633001
- import { freemem as freemem6, homedir as homedir46, platform as platform5, totalmem as totalmem8 } from "node:os";
633103
+ import { freemem as freemem7, homedir as homedir46, platform as platform5, totalmem as totalmem8 } from "node:os";
633002
633104
  function wrapText2(value2, width) {
633003
633105
  const words = value2.split(/\s+/).filter(Boolean);
633004
633106
  const lines = [];
@@ -633047,18 +633149,18 @@ function detectUnifiedMemory(hasDiscreteGpu = false) {
633047
633149
  if (process.platform === "darwin" && process.arch === "arm64") return true;
633048
633150
  if (process.platform === "linux") {
633049
633151
  try {
633050
- if (existsSync125("/etc/nv_tegra_release")) return true;
633152
+ if (existsSync126("/etc/nv_tegra_release")) return true;
633051
633153
  } catch {
633052
633154
  }
633053
633155
  try {
633054
- if (existsSync125("/sys/devices/soc0/family")) {
633156
+ if (existsSync126("/sys/devices/soc0/family")) {
633055
633157
  const family = readFileSync104("/sys/devices/soc0/family", "utf8").trim().toLowerCase();
633056
633158
  if (family.includes("tegra")) return true;
633057
633159
  }
633058
633160
  } catch {
633059
633161
  }
633060
633162
  try {
633061
- if (existsSync125("/proc/device-tree/model")) {
633163
+ if (existsSync126("/proc/device-tree/model")) {
633062
633164
  const model = readFileSync104("/proc/device-tree/model", "utf8").replace(/\0+$/, "").toLowerCase();
633063
633165
  if (/jetson|tegra|orin|xavier|nano|raspberry|rockchip|rk\d{4}|mt\d{4}/.test(model)) {
633064
633166
  return true;
@@ -633112,7 +633214,7 @@ function parseRocmSmi(stdout) {
633112
633214
  }
633113
633215
  function detectSystemSpecs() {
633114
633216
  let totalRamGB = totalmem8() / 1024 ** 3;
633115
- let availableRamGB = freemem6() / 1024 ** 3;
633217
+ let availableRamGB = freemem7() / 1024 ** 3;
633116
633218
  let gpuVramGB = 0;
633117
633219
  let availableVramGB = 0;
633118
633220
  const gpuName = "";
@@ -633470,7 +633572,7 @@ function detectAskpassHelper() {
633470
633572
  if (process.platform === "linux") {
633471
633573
  for (const path12 of linuxHelpers) {
633472
633574
  try {
633473
- if (existsSync125(path12)) return path12;
633575
+ if (existsSync126(path12)) return path12;
633474
633576
  } catch {
633475
633577
  }
633476
633578
  }
@@ -633749,7 +633851,7 @@ async function installOllamaMac(_rl) {
633749
633851
  );
633750
633852
  if (!hasCmd("brew")) {
633751
633853
  try {
633752
- const brewPrefix = existsSync125("/opt/homebrew/bin/brew") ? "/opt/homebrew" : "/usr/local";
633854
+ const brewPrefix = existsSync126("/opt/homebrew/bin/brew") ? "/opt/homebrew" : "/usr/local";
633753
633855
  process.env["PATH"] = `${brewPrefix}/bin:${process.env["PATH"]}`;
633754
633856
  } catch {
633755
633857
  }
@@ -634783,7 +634885,7 @@ async function isModelAvailable(config) {
634783
634885
  }
634784
634886
  function isFirstRun() {
634785
634887
  try {
634786
- return !existsSync125(join141(homedir46(), ".omnius", "config.json"));
634888
+ return !existsSync126(join141(homedir46(), ".omnius", "config.json"));
634787
634889
  } catch {
634788
634890
  return true;
634789
634891
  }
@@ -634794,7 +634896,7 @@ function hasCmd(cmd) {
634794
634896
  function findCommandPath(cmd) {
634795
634897
  if (!cmd) return null;
634796
634898
  if (cmd.includes("/") || cmd.includes("\\")) {
634797
- return existsSync125(cmd) ? cmd : null;
634899
+ return existsSync126(cmd) ? cmd : null;
634798
634900
  }
634799
634901
  const pathValue = process.env.PATH || "";
634800
634902
  const dirs = pathValue.split(pathDelimiter).filter(Boolean);
@@ -634802,7 +634904,7 @@ function findCommandPath(cmd) {
634802
634904
  for (const dir of dirs) {
634803
634905
  for (const ext of extensions) {
634804
634906
  const candidate = join141(dir, process.platform === "win32" ? cmd + ext : cmd);
634805
- if (existsSync125(candidate)) return candidate;
634907
+ if (existsSync126(candidate)) return candidate;
634806
634908
  }
634807
634909
  }
634808
634910
  return null;
@@ -634857,7 +634959,7 @@ async function ensureVenv2(log22) {
634857
634959
  const pipPath = isWin2 ? join141(venvDir, "Scripts", "pip.exe") : join141(venvDir, "bin", "pip");
634858
634960
  const venvPyPath = isWin2 ? join141(venvDir, "Scripts", "python.exe") : join141(venvDir, "bin", "python3");
634859
634961
  const pythonCmd = isWin2 ? "python" : "python3";
634860
- if (existsSync125(pipPath)) {
634962
+ if (existsSync126(pipPath)) {
634861
634963
  try {
634862
634964
  await runShellCommandAsync(`"${venvPyPath}" -m pip --version`, { timeoutMs: 1e4 });
634863
634965
  return venvDir;
@@ -635012,7 +635114,7 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
635012
635114
  const _visionMarkerFile = join141(_visionMarkerDir, "vision-deps-installed.json");
635013
635115
  let _visionPreviouslyInstalled = /* @__PURE__ */ new Set();
635014
635116
  try {
635015
- if (existsSync125(_visionMarkerFile)) {
635117
+ if (existsSync126(_visionMarkerFile)) {
635016
635118
  const _vm = JSON.parse(readFileSync104(_visionMarkerFile, "utf8"));
635017
635119
  _visionPreviouslyInstalled = new Set(_vm.installed || []);
635018
635120
  }
@@ -635184,12 +635286,12 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
635184
635286
  const venvBin = join141(venvDir, isWin2 ? "Scripts" : "bin");
635185
635287
  const venvMoondream = join141(venvBin, isWin2 ? "moondream-station.exe" : "moondream-station");
635186
635288
  const venv = await ensureVenv2(log22);
635187
- if (venv && !hasCmd("moondream-station") && !existsSync125(venvMoondream)) {
635289
+ if (venv && !hasCmd("moondream-station") && !existsSync126(venvMoondream)) {
635188
635290
  const venvPip2 = join141(venvBin, "pip");
635189
635291
  log22("Installing moondream-station in ~/.omnius/venv...");
635190
635292
  try {
635191
635293
  await runShellCommandAsync(`"${venvPip2}" install moondream-station`, { timeoutMs: 3e5 });
635192
- if (existsSync125(venvMoondream)) {
635294
+ if (existsSync126(venvMoondream)) {
635193
635295
  log22("moondream-station installed successfully.");
635194
635296
  } else {
635195
635297
  try {
@@ -635252,7 +635354,7 @@ function ensureCloudflaredBackground(onInfo) {
635252
635354
  });
635253
635355
  log22("Installing cloudflared for live voice sessions...");
635254
635356
  _cloudflaredInstallPromise = (async () => {
635255
- const arch3 = process.arch;
635357
+ const arch4 = process.arch;
635256
635358
  const os9 = platform5();
635257
635359
  if (os9 !== "win32" && !await ensureCurl()) {
635258
635360
  log22("curl not available — cannot install cloudflared.");
@@ -635260,7 +635362,7 @@ function ensureCloudflaredBackground(onInfo) {
635260
635362
  }
635261
635363
  if (os9 === "linux") {
635262
635364
  const archMap = { x64: "amd64", arm64: "arm64", arm: "arm" };
635263
- const cfArch = archMap[arch3] ?? "amd64";
635365
+ const cfArch = archMap[arch4] ?? "amd64";
635264
635366
  try {
635265
635367
  await runShellCommandAsync(
635266
635368
  `curl -fsSL "https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-${cfArch}" -o /tmp/cloudflared && chmod +x /tmp/cloudflared && mkdir -p "${homedir46()}/.local/bin" && mv /tmp/cloudflared "${homedir46()}/.local/bin/cloudflared"`,
@@ -635371,8 +635473,8 @@ function modelSizeGB(models, modelName) {
635371
635473
  const known = QWEN_VARIANTS.find((v) => modelName.includes(v.tag.split(":")[1] ?? ""));
635372
635474
  return known?.sizeGB ?? 4;
635373
635475
  }
635374
- function defaultLayersForArch(arch3) {
635375
- const a2 = arch3.toLowerCase();
635476
+ function defaultLayersForArch(arch4) {
635477
+ const a2 = arch4.toLowerCase();
635376
635478
  if (a2.includes("qwen")) return 36;
635377
635479
  if (a2.includes("llama")) return 32;
635378
635480
  if (a2.includes("mistral")) return 32;
@@ -635395,17 +635497,17 @@ async function queryModelKVInfo(backendUrl2, modelName) {
635395
635497
  const data = await res.json();
635396
635498
  if (!data.model_info) return null;
635397
635499
  const info = data.model_info;
635398
- const arch3 = info["general.architecture"];
635399
- if (!arch3) return null;
635400
- const nLayersRaw = info[`${arch3}.block_count`];
635401
- const nKVHeadsRaw = info[`${arch3}.attention.head_count_kv`];
635402
- const keyDimRaw = info[`${arch3}.attention.key_length`];
635403
- const valDimRaw = info[`${arch3}.attention.value_length`] ?? keyDimRaw;
635404
- const archMax = info[`${arch3}.context_length`];
635500
+ const arch4 = info["general.architecture"];
635501
+ if (!arch4) return null;
635502
+ const nLayersRaw = info[`${arch4}.block_count`];
635503
+ const nKVHeadsRaw = info[`${arch4}.attention.head_count_kv`];
635504
+ const keyDimRaw = info[`${arch4}.attention.key_length`];
635505
+ const valDimRaw = info[`${arch4}.attention.value_length`] ?? keyDimRaw;
635506
+ const archMax = info[`${arch4}.context_length`];
635405
635507
  if (!archMax) return null;
635406
635508
  const keyDim = keyDimRaw ?? 128;
635407
635509
  const valDim = valDimRaw ?? 128;
635408
- const nLayers = nLayersRaw ?? defaultLayersForArch(arch3);
635510
+ const nLayers = nLayersRaw ?? defaultLayersForArch(arch4);
635409
635511
  const nKVHeads = nKVHeadsRaw ?? 8;
635410
635512
  if (!nLayers) return { archMax };
635411
635513
  const kvBytesPerToken = nLayers * nKVHeads * (keyDim + valDim) * 2;
@@ -635757,7 +635859,7 @@ async function ensureNeovim() {
635757
635859
  const existingNvim = findCommandPath("nvim");
635758
635860
  if (existingNvim) return existingNvim;
635759
635861
  const platform7 = process.platform;
635760
- const arch3 = process.arch;
635862
+ const arch4 = process.arch;
635761
635863
  if (platform7 === "linux") {
635762
635864
  const binDir = join141(homedir46(), ".local", "bin");
635763
635865
  const nvimDest = join141(binDir, "nvim");
@@ -635765,7 +635867,7 @@ async function ensureNeovim() {
635765
635867
  mkdirSync78(binDir, { recursive: true });
635766
635868
  } catch {
635767
635869
  }
635768
- const appImageName = arch3 === "arm64" ? "nvim-linux-arm64.appimage" : "nvim-linux-x86_64.appimage";
635870
+ const appImageName = arch4 === "arm64" ? "nvim-linux-arm64.appimage" : "nvim-linux-x86_64.appimage";
635769
635871
  const url = `https://github.com/neovim/neovim/releases/latest/download/${appImageName}`;
635770
635872
  console.log(` Downloading Neovim (${appImageName})...`);
635771
635873
  try {
@@ -635845,7 +635947,7 @@ function ensurePathInShellRc(binDir) {
635845
635947
  const shell = process.env.SHELL ?? "";
635846
635948
  const rcFile = shell.includes("zsh") ? join141(homedir46(), ".zshrc") : join141(homedir46(), ".bashrc");
635847
635949
  try {
635848
- const rcContent = existsSync125(rcFile) ? readFileSync104(rcFile, "utf8") : "";
635950
+ const rcContent = existsSync126(rcFile) ? readFileSync104(rcFile, "utf8") : "";
635849
635951
  if (rcContent.includes(binDir)) return;
635850
635952
  const exportLine = `
635851
635953
  export PATH="${binDir}:$PATH" # Added by omnius for nvim
@@ -636057,7 +636159,7 @@ var init_registry3 = __esm({
636057
636159
  });
636058
636160
 
636059
636161
  // packages/cli/src/tui/media-routing.ts
636060
- import { existsSync as existsSync126 } from "node:fs";
636162
+ import { existsSync as existsSync127 } from "node:fs";
636061
636163
  import { homedir as homedir47 } from "node:os";
636062
636164
  function extractMediaReferences(text2) {
636063
636165
  const masked = maskCode(text2);
@@ -636190,7 +636292,7 @@ function looksLikeLocalMedia(value2) {
636190
636292
  if (!value2.startsWith("/") && !value2.startsWith("~/")) return false;
636191
636293
  const expanded = expandHome2(value2);
636192
636294
  const kind = classifyMedia(expanded);
636193
- return !!kind && (existsSync126(expanded) || value2.startsWith("~/") || value2.startsWith("/"));
636295
+ return !!kind && (existsSync127(expanded) || value2.startsWith("~/") || value2.startsWith("/"));
636194
636296
  }
636195
636297
  function expandHome2(value2) {
636196
636298
  return value2.startsWith("~/") ? `${homedir47()}${value2.slice(1)}` : value2;
@@ -636625,7 +636727,7 @@ var init_platforms = __esm({
636625
636727
  });
636626
636728
 
636627
636729
  // packages/cli/src/tui/workspace-explorer.ts
636628
- import { existsSync as existsSync127, readdirSync as readdirSync42, readFileSync as readFileSync105, statSync as statSync49 } from "node:fs";
636730
+ import { existsSync as existsSync128, readdirSync as readdirSync42, readFileSync as readFileSync105, statSync as statSync49 } from "node:fs";
636629
636731
  import { basename as basename27, extname as extname17, join as join142, relative as relative14, resolve as resolve59 } from "node:path";
636630
636732
  function exploreWorkspace(root, options2 = {}) {
636631
636733
  const query = (options2.query ?? "").trim().toLowerCase();
@@ -636713,7 +636815,7 @@ function previewWorkspaceFile(root, relPath, options2 = {}) {
636713
636815
  if (!full.startsWith(rootResolved + "/") && full !== rootResolved) {
636714
636816
  throw new Error("File path escapes workspace root");
636715
636817
  }
636716
- if (!existsSync127(full)) throw new Error(`File not found: ${relPath}`);
636818
+ if (!existsSync128(full)) throw new Error(`File not found: ${relPath}`);
636717
636819
  const st = statSync49(full);
636718
636820
  if (!st.isFile()) throw new Error(`Not a file: ${relPath}`);
636719
636821
  if (st.size > maxBytes) {
@@ -636900,7 +637002,7 @@ var init_pricing = __esm({
636900
637002
  });
636901
637003
 
636902
637004
  // packages/cli/src/insights/engine.ts
636903
- import { readdirSync as readdirSync43, readFileSync as readFileSync106, existsSync as existsSync128 } from "node:fs";
637005
+ import { readdirSync as readdirSync43, readFileSync as readFileSync106, existsSync as existsSync129 } from "node:fs";
636904
637006
  import { join as join143 } from "node:path";
636905
637007
  function formatDuration5(seconds) {
636906
637008
  if (seconds < 60) return `${Math.round(seconds)}s`;
@@ -636970,7 +637072,7 @@ var init_engine = __esm({
636970
637072
  };
636971
637073
  }
636972
637074
  loadSessions(cutoff) {
636973
- if (!existsSync128(this.historyDir)) return [];
637075
+ if (!existsSync129(this.historyDir)) return [];
636974
637076
  try {
636975
637077
  return readdirSync43(this.historyDir).filter((f2) => f2.endsWith(".json") && f2 !== "pending-task.json").map((f2) => {
636976
637078
  try {
@@ -636992,7 +637094,7 @@ var init_engine = __esm({
636992
637094
  }
636993
637095
  loadUsageStore() {
636994
637096
  try {
636995
- if (existsSync128(this.usageFile)) {
637097
+ if (existsSync129(this.usageFile)) {
636996
637098
  return JSON.parse(readFileSync106(this.usageFile, "utf-8"));
636997
637099
  }
636998
637100
  } catch {
@@ -637419,7 +637521,7 @@ var init_format = __esm({
637419
637521
  });
637420
637522
 
637421
637523
  // packages/cli/src/tui/drop-panel.ts
637422
- import { existsSync as existsSync129 } from "node:fs";
637524
+ import { existsSync as existsSync130 } from "node:fs";
637423
637525
  import { extname as extname18, resolve as resolve60 } from "node:path";
637424
637526
  function ansi4(code8, text2) {
637425
637527
  return isTTY4 ? `\x1B[${code8}m${text2}\x1B[0m` : text2;
@@ -637540,7 +637642,7 @@ function showDropPanel(opts) {
637540
637642
  filePath = decodeURIComponent(filePath.slice(7));
637541
637643
  }
637542
637644
  filePath = resolve60(filePath);
637543
- if (!existsSync129(filePath)) {
637645
+ if (!existsSync130(filePath)) {
637544
637646
  errorMsg = `File not found: ${filePath}`;
637545
637647
  render2();
637546
637648
  return;
@@ -639893,7 +639995,7 @@ var init_audio_waveform = __esm({
639893
639995
  });
639894
639996
 
639895
639997
  // packages/cli/src/tui/neovim-mode.ts
639896
- import { existsSync as existsSync131, unlinkSync as unlinkSync24 } from "node:fs";
639998
+ import { existsSync as existsSync132, unlinkSync as unlinkSync24 } from "node:fs";
639897
639999
  import { tmpdir as tmpdir22 } from "node:os";
639898
640000
  import { join as join145 } from "node:path";
639899
640001
  function isNeovimActive() {
@@ -639942,7 +640044,7 @@ async function startNeovimMode(opts) {
639942
640044
  }
639943
640045
  const socketPath = join145(tmpdir22(), `omnius-nvim-${process.pid}-${Date.now()}.sock`);
639944
640046
  try {
639945
- if (existsSync131(socketPath)) unlinkSync24(socketPath);
640047
+ if (existsSync132(socketPath)) unlinkSync24(socketPath);
639946
640048
  } catch {
639947
640049
  }
639948
640050
  const ptyCols = opts.cols;
@@ -640189,12 +640291,12 @@ function resizeNeovim(cols, contentRows) {
640189
640291
  }
640190
640292
  async function connectRPC(state, neovimPkg, cols) {
640191
640293
  let attempts = 0;
640192
- while (!existsSync131(state.socketPath) && attempts < 30) {
640294
+ while (!existsSync132(state.socketPath) && attempts < 30) {
640193
640295
  await new Promise((r2) => setTimeout(r2, 200));
640194
640296
  attempts++;
640195
640297
  if (state.cleanedUp) return;
640196
640298
  }
640197
- if (!existsSync131(state.socketPath)) return;
640299
+ if (!existsSync132(state.socketPath)) return;
640198
640300
  const nvim = neovimPkg.attach({ socket: state.socketPath });
640199
640301
  state.nvim = nvim;
640200
640302
  await new Promise((r2) => setTimeout(r2, 300));
@@ -640331,7 +640433,7 @@ function doCleanup(state) {
640331
640433
  state.pty = null;
640332
640434
  }
640333
640435
  try {
640334
- if (existsSync131(state.socketPath)) unlinkSync24(state.socketPath);
640436
+ if (existsSync132(state.socketPath)) unlinkSync24(state.socketPath);
640335
640437
  } catch {
640336
640438
  }
640337
640439
  if (state.stdinHandler) {
@@ -640406,7 +640508,7 @@ __export(daemon_exports, {
640406
640508
  stopDaemon: () => stopDaemon
640407
640509
  });
640408
640510
  import { spawn as spawn35 } from "node:child_process";
640409
- import { existsSync as existsSync132, readFileSync as readFileSync108, writeFileSync as writeFileSync67, mkdirSync as mkdirSync79, unlinkSync as unlinkSync25, openSync as openSync3, closeSync as closeSync3 } from "node:fs";
640511
+ import { existsSync as existsSync133, readFileSync as readFileSync108, writeFileSync as writeFileSync67, mkdirSync as mkdirSync79, unlinkSync as unlinkSync25, openSync as openSync3, closeSync as closeSync3 } from "node:fs";
640410
640512
  import { join as join146 } from "node:path";
640411
640513
  import { homedir as homedir48 } from "node:os";
640412
640514
  import { fileURLToPath as fileURLToPath20 } from "node:url";
@@ -640436,7 +640538,7 @@ function getLocalCliVersion() {
640436
640538
  const here = dirname44(fileURLToPath20(import.meta.url));
640437
640539
  for (const rel of ["../package.json", "../../package.json", "./package.json", "../../../package.json"]) {
640438
640540
  const p2 = join146(here, rel);
640439
- if (existsSync132(p2)) {
640541
+ if (existsSync133(p2)) {
640440
640542
  const v = JSON.parse(readFileSync108(p2, "utf8"))?.version;
640441
640543
  if (v) return String(v);
640442
640544
  }
@@ -640474,7 +640576,7 @@ async function restartDaemon(port) {
640474
640576
  await startDaemon();
640475
640577
  }
640476
640578
  function getDaemonPid() {
640477
- if (!existsSync132(PID_FILE2)) return null;
640579
+ if (!existsSync133(PID_FILE2)) return null;
640478
640580
  try {
640479
640581
  const pid = parseInt(readFileSync108(PID_FILE2, "utf8").trim(), 10);
640480
640582
  if (!pid || pid <= 0) return null;
@@ -640523,7 +640625,7 @@ async function resolveDaemonCommand(nodeExe) {
640523
640625
  for (const candidate of candidates) {
640524
640626
  if (!candidate || seen.has(candidate)) continue;
640525
640627
  seen.add(candidate);
640526
- if (!existsSync132(candidate)) continue;
640628
+ if (!existsSync133(candidate)) continue;
640527
640629
  return commandForEntrypoint(candidate, nodeExe);
640528
640630
  }
640529
640631
  return null;
@@ -640747,7 +640849,7 @@ var mem_metabolize_exports = {};
640747
640849
  __export(mem_metabolize_exports, {
640748
640850
  handleMetabolize: () => handleMetabolize
640749
640851
  });
640750
- import { existsSync as existsSync133 } from "node:fs";
640852
+ import { existsSync as existsSync134 } from "node:fs";
640751
640853
  import { join as join147 } from "node:path";
640752
640854
  function getStateDir() {
640753
640855
  const omniusDir = join147(process.cwd(), ".omnius");
@@ -640761,7 +640863,7 @@ async function handleMetabolize(options2 = {}) {
640761
640863
  vacuum: options2.vacuum ?? true
640762
640864
  };
640763
640865
  const stateDir = getStateDir();
640764
- if (!existsSync133(stateDir)) {
640866
+ if (!existsSync134(stateDir)) {
640765
640867
  return `No .omnius state directory found at ${stateDir}. Run the agent first to create session data.`;
640766
640868
  }
640767
640869
  const result = runMemoryMaintenance({
@@ -640898,7 +641000,7 @@ __export(kg_prune_exports, {
640898
641000
  pruneKnowledgeGraph: () => pruneKnowledgeGraph,
640899
641001
  pruneKnowledgeGraphWithInference: () => pruneKnowledgeGraphWithInference
640900
641002
  });
640901
- import { existsSync as existsSync134, statSync as statSync51 } from "node:fs";
641003
+ import { existsSync as existsSync135, statSync as statSync51 } from "node:fs";
640902
641004
  import { join as join148 } from "node:path";
640903
641005
  function stateDirFor(workingDir) {
640904
641006
  return join148(workingDir, ".omnius");
@@ -640909,7 +641011,7 @@ function knowledgeGraphStats(workingDir) {
640909
641011
  const archivePath = join148(stateDir, "knowledge.archive.db");
640910
641012
  const stats = {
640911
641013
  dbPath,
640912
- exists: existsSync134(dbPath),
641014
+ exists: existsSync135(dbPath),
640913
641015
  sizeBytes: 0,
640914
641016
  archiveSizeBytes: 0,
640915
641017
  nodes: 0,
@@ -640922,7 +641024,7 @@ function knowledgeGraphStats(workingDir) {
640922
641024
  } catch {
640923
641025
  }
640924
641026
  }
640925
- if (existsSync134(archivePath)) {
641027
+ if (existsSync135(archivePath)) {
640926
641028
  try {
640927
641029
  stats.archiveSizeBytes = statSync51(archivePath).size;
640928
641030
  } catch {
@@ -640950,7 +641052,7 @@ function knowledgeGraphStats(workingDir) {
640950
641052
  }
640951
641053
  function pruneKnowledgeGraph(opts) {
640952
641054
  const stateDir = stateDirFor(opts.workingDir);
640953
- if (!existsSync134(join148(stateDir, "knowledge.db"))) {
641055
+ if (!existsSync135(join148(stateDir, "knowledge.db"))) {
640954
641056
  return {
640955
641057
  report: `No knowledge.db found at ${stateDir}. Nothing to prune.`,
640956
641058
  result: null
@@ -640989,7 +641091,7 @@ function pruneKnowledgeGraph(opts) {
640989
641091
  async function pruneKnowledgeGraphWithInference(opts) {
640990
641092
  const stateDir = stateDirFor(opts.workingDir);
640991
641093
  const knowledgePath = join148(stateDir, "knowledge.db");
640992
- if (!existsSync134(knowledgePath)) {
641094
+ if (!existsSync135(knowledgePath)) {
640993
641095
  return {
640994
641096
  report: `No knowledge.db found at ${stateDir}. Nothing to prune.`,
640995
641097
  result: null
@@ -641169,7 +641271,7 @@ import {
641169
641271
  writeFileSync as writeFileSync68,
641170
641272
  mkdirSync as mkdirSync80,
641171
641273
  chmodSync as chmodSync4,
641172
- existsSync as existsSync135,
641274
+ existsSync as existsSync136,
641173
641275
  unlinkSync as unlinkSync26,
641174
641276
  readdirSync as readdirSync44
641175
641277
  } from "node:fs";
@@ -641196,7 +641298,7 @@ function secureDir(path12) {
641196
641298
  }
641197
641299
  function secureFile(path12) {
641198
641300
  try {
641199
- if (existsSync135(path12)) chmodSync4(path12, 384);
641301
+ if (existsSync136(path12)) chmodSync4(path12, 384);
641200
641302
  } catch {
641201
641303
  }
641202
641304
  }
@@ -641350,7 +641452,7 @@ function normalizeSkills(skill, skills) {
641350
641452
  function loadJobs() {
641351
641453
  ensureDirs();
641352
641454
  const path12 = jobsFilePath();
641353
- if (!existsSync135(path12)) return [];
641455
+ if (!existsSync136(path12)) return [];
641354
641456
  try {
641355
641457
  const data = JSON.parse(readFileSync109(path12, "utf-8"));
641356
641458
  return data.jobs || [];
@@ -641563,7 +641665,7 @@ function saveJobOutput(jobId, output) {
641563
641665
  }
641564
641666
  function listJobOutputs(jobId) {
641565
641667
  const jobOutDir = join149(outputDir(), jobId);
641566
- if (!existsSync135(jobOutDir)) return [];
641668
+ if (!existsSync136(jobOutDir)) return [];
641567
641669
  try {
641568
641670
  return readdirSync44(jobOutDir).filter((f2) => f2.endsWith(".md")).sort().map((f2) => join149(jobOutDir, f2));
641569
641671
  } catch {
@@ -641714,7 +641816,7 @@ var init_delivery2 = __esm({
641714
641816
 
641715
641817
  // packages/cli/src/cron/scheduler.ts
641716
641818
  import {
641717
- existsSync as existsSync136,
641819
+ existsSync as existsSync137,
641718
641820
  mkdirSync as mkdirSync81,
641719
641821
  openSync as openSync5,
641720
641822
  closeSync as closeSync5,
@@ -641736,7 +641838,7 @@ function acquireTickLock() {
641736
641838
  const lockPath = lockFilePath();
641737
641839
  mkdirSync81(cronDir2(), { recursive: true });
641738
641840
  try {
641739
- if (existsSync136(lockPath)) {
641841
+ if (existsSync137(lockPath)) {
641740
641842
  const content = readFileSync110(lockPath, "utf-8").trim();
641741
641843
  if (content) {
641742
641844
  const lock = JSON.parse(content);
@@ -642105,7 +642207,7 @@ __export(sponsor_wizard_exports, {
642105
642207
  selectedModelsForEndpoint: () => selectedModelsForEndpoint,
642106
642208
  showSponsorDashboard: () => showSponsorDashboard
642107
642209
  });
642108
- import { existsSync as existsSync137, readFileSync as readFileSync111, writeFileSync as writeFileSync70, mkdirSync as mkdirSync82 } from "node:fs";
642210
+ import { existsSync as existsSync138, readFileSync as readFileSync111, writeFileSync as writeFileSync70, mkdirSync as mkdirSync82 } from "node:fs";
642109
642211
  import { join as join151 } from "node:path";
642110
642212
  function fmtTokens2(n2) {
642111
642213
  if (n2 < 1e3) return String(Math.max(0, Math.floor(n2)));
@@ -642124,7 +642226,7 @@ function configPath(projectDir2) {
642124
642226
  }
642125
642227
  function loadSponsorConfig(projectDir2) {
642126
642228
  const p2 = configPath(projectDir2);
642127
- if (!existsSync137(p2)) return null;
642229
+ if (!existsSync138(p2)) return null;
642128
642230
  try {
642129
642231
  return JSON.parse(readFileSync111(p2, "utf8"));
642130
642232
  } catch {
@@ -643470,7 +643572,7 @@ __export(voice_exports, {
643470
643572
  resetNarrationContext: () => resetNarrationContext
643471
643573
  });
643472
643574
  import {
643473
- existsSync as existsSync138,
643575
+ existsSync as existsSync139,
643474
643576
  mkdirSync as mkdirSync83,
643475
643577
  writeFileSync as writeFileSync71,
643476
643578
  readFileSync as readFileSync112,
@@ -643601,7 +643703,7 @@ function misottsInferScript2() {
643601
643703
  return join152(voiceDir2(), "misotts-infer.py");
643602
643704
  }
643603
643705
  function mergeDir2(src2, dst) {
643604
- if (!existsSync138(src2)) return;
643706
+ if (!existsSync139(src2)) return;
643605
643707
  mkdirSync83(dst, { recursive: true });
643606
643708
  for (const entry of readdirSync45(src2, { withFileTypes: true })) {
643607
643709
  const s2 = join152(src2, entry.name);
@@ -643610,7 +643712,7 @@ function mergeDir2(src2, dst) {
643610
643712
  if (entry.isDirectory()) {
643611
643713
  mergeDir2(s2, d2);
643612
643714
  } else if (entry.isFile()) {
643613
- if (!existsSync138(d2) || statSync52(s2).mtimeMs > statSync52(d2).mtimeMs) {
643715
+ if (!existsSync139(d2) || statSync52(s2).mtimeMs > statSync52(d2).mtimeMs) {
643614
643716
  copyFileSync6(s2, d2);
643615
643717
  }
643616
643718
  }
@@ -643623,7 +643725,7 @@ function consolidateVoiceDirs2() {
643623
643725
  let migrated = 0;
643624
643726
  let cleaned = 0;
643625
643727
  const oldVoice = join152(homedir51(), ".open-agents", "voice");
643626
- if (existsSync138(oldVoice)) {
643728
+ if (existsSync139(oldVoice)) {
643627
643729
  mergeDir2(join152(oldVoice, "clone-refs"), join152(globalVoice, "clone-refs"));
643628
643730
  mergeDir2(join152(oldVoice, "models"), join152(globalVoice, "models"));
643629
643731
  try {
@@ -643638,18 +643740,18 @@ function consolidateVoiceDirs2() {
643638
643740
  let prev = "";
643639
643741
  while (dir !== prev) {
643640
643742
  const c9 = join152(dir, ".omnius", "voice");
643641
- if (existsSync138(c9) && c9 !== globalVoice) candidates.add(c9);
643743
+ if (existsSync139(c9) && c9 !== globalVoice) candidates.add(c9);
643642
643744
  prev = dir;
643643
643745
  dir = dirname45(dir);
643644
643746
  }
643645
643747
  for (const root of COMMON_PROJECT_ROOTS) {
643646
643748
  const rootDir = join152(homedir51(), root);
643647
- if (!existsSync138(rootDir)) continue;
643749
+ if (!existsSync139(rootDir)) continue;
643648
643750
  try {
643649
643751
  for (const entry of readdirSync45(rootDir, { withFileTypes: true })) {
643650
643752
  if (!entry.isDirectory()) continue;
643651
643753
  const c9 = join152(rootDir, entry.name, ".omnius", "voice");
643652
- if (existsSync138(c9) && c9 !== globalVoice) candidates.add(c9);
643754
+ if (existsSync139(c9) && c9 !== globalVoice) candidates.add(c9);
643653
643755
  }
643654
643756
  } catch {
643655
643757
  }
@@ -643833,7 +643935,7 @@ function insertTagAfterOpeningClause(text2, tag) {
643833
643935
  return `<${tag}> ${text2}`;
643834
643936
  }
643835
643937
  function writeDetectTorchScript(targetPath) {
643836
- if (existsSync138(targetPath)) return;
643938
+ if (existsSync139(targetPath)) return;
643837
643939
  try {
643838
643940
  mkdirSync83(dirname45(targetPath), { recursive: true });
643839
643941
  } catch {
@@ -644841,7 +644943,7 @@ except Exception as exc:
644841
644943
  const targets = ["glados", "overwatch"];
644842
644944
  for (const modelId of targets) {
644843
644945
  const refFile = join152(refsDir, `${modelId}-ref.wav`);
644844
- if (existsSync138(refFile)) continue;
644946
+ if (existsSync139(refFile)) continue;
644845
644947
  try {
644846
644948
  await this.generateCloneRef(modelId);
644847
644949
  const meta = this.loadCloneMeta();
@@ -644961,13 +645063,13 @@ except Exception as exc:
644961
645063
  if (p2.startsWith("~/") || p2 === "~") {
644962
645064
  p2 = join152(homedir51(), p2.slice(1));
644963
645065
  }
644964
- if (!existsSync138(p2)) {
645066
+ if (!existsSync139(p2)) {
644965
645067
  return `File not found: ${p2}
644966
645068
  (original input: ${audioPath})`;
644967
645069
  }
644968
645070
  audioPath = p2;
644969
645071
  const refsDir = luxttsCloneRefsDir();
644970
- if (!existsSync138(refsDir)) mkdirSync83(refsDir, { recursive: true });
645072
+ if (!existsSync139(refsDir)) mkdirSync83(refsDir, { recursive: true });
644971
645073
  const ext = audioPath.split(".").pop() || "wav";
644972
645074
  const srcName = (audioPath.split("/").pop() ?? "clone").replace(/\.[^.]+$/, "").replace(/[^a-zA-Z0-9_-]/g, "-");
644973
645075
  const ts = Date.now().toString(36);
@@ -645026,7 +645128,7 @@ except Exception as exc:
645026
645128
  return `Failed to synthesize reference audio from ${source.label}.`;
645027
645129
  }
645028
645130
  const refsDir = luxttsCloneRefsDir();
645029
- if (!existsSync138(refsDir)) mkdirSync83(refsDir, { recursive: true });
645131
+ if (!existsSync139(refsDir)) mkdirSync83(refsDir, { recursive: true });
645030
645132
  const destPath = join152(refsDir, `${sourceModelId}-ref.wav`);
645031
645133
  const sampleRate = this.config?.audio?.sample_rate ?? 22050;
645032
645134
  this.writeWav(audioData, sampleRate, destPath);
@@ -645047,7 +645149,7 @@ except Exception as exc:
645047
645149
  }
645048
645150
  loadCloneMeta() {
645049
645151
  const p2 = _VoiceEngine.cloneMetaFile();
645050
- if (!existsSync138(p2)) return {};
645152
+ if (!existsSync139(p2)) return {};
645051
645153
  try {
645052
645154
  const raw = JSON.parse(readFileSync112(p2, "utf8"));
645053
645155
  if (typeof Object.values(raw)[0] === "string") {
@@ -645064,7 +645166,7 @@ except Exception as exc:
645064
645166
  }
645065
645167
  saveCloneMeta(meta) {
645066
645168
  const dir = luxttsCloneRefsDir();
645067
- if (!existsSync138(dir)) mkdirSync83(dir, { recursive: true });
645169
+ if (!existsSync139(dir)) mkdirSync83(dir, { recursive: true });
645068
645170
  writeFileSync71(_VoiceEngine.cloneMetaFile(), JSON.stringify(meta, null, 2));
645069
645171
  }
645070
645172
  /** Audio file extensions recognized as clone references */
@@ -645083,7 +645185,7 @@ except Exception as exc:
645083
645185
  */
645084
645186
  listCloneRefs() {
645085
645187
  const dir = luxttsCloneRefsDir();
645086
- if (!existsSync138(dir)) return [];
645188
+ if (!existsSync139(dir)) return [];
645087
645189
  const meta = this.loadCloneMeta();
645088
645190
  const files = readdirSync45(dir).filter((f2) => {
645089
645191
  const ext = f2.split(".").pop()?.toLowerCase() ?? "";
@@ -645110,7 +645212,7 @@ except Exception as exc:
645110
645212
  /** Delete a clone reference file by filename. Returns true if deleted. */
645111
645213
  deleteCloneRef(filename) {
645112
645214
  const p2 = join152(luxttsCloneRefsDir(), filename);
645113
- if (!existsSync138(p2)) return false;
645215
+ if (!existsSync139(p2)) return false;
645114
645216
  try {
645115
645217
  unlinkSync28(p2);
645116
645218
  const meta = this.loadCloneMeta();
@@ -645138,7 +645240,7 @@ except Exception as exc:
645138
645240
  /** Set the active clone reference by filename. */
645139
645241
  setActiveCloneRef(filename) {
645140
645242
  const p2 = join152(luxttsCloneRefsDir(), filename);
645141
- if (!existsSync138(p2)) return `File not found: ${filename}`;
645243
+ if (!existsSync139(p2)) return `File not found: ${filename}`;
645142
645244
  this.luxttsCloneRef = p2;
645143
645245
  this.misottsCloneRef = p2;
645144
645246
  return `Active clone voice set to: ${filename}`;
@@ -645990,7 +646092,7 @@ except Exception as exc:
645990
646092
  }
645991
646093
  const venvDir = supertonicVenvDir();
645992
646094
  const venvPy = supertonicVenvPy2();
645993
- if (!existsSync138(venvPy)) {
646095
+ if (!existsSync139(venvPy)) {
645994
646096
  renderInfo("Creating Supertonic3 Python virtual environment...");
645995
646097
  await this.asyncShell(`${py} -m venv ${JSON.stringify(venvDir)}`, 6e4);
645996
646098
  }
@@ -646011,7 +646113,7 @@ except Exception as exc:
646011
646113
  async checkSupertonicInstalled() {
646012
646114
  if (this.supertonicInstalled !== null) return this.supertonicInstalled;
646013
646115
  const venvPy = supertonicVenvPy2();
646014
- if (!existsSync138(venvPy)) {
646116
+ if (!existsSync139(venvPy)) {
646015
646117
  this.supertonicInstalled = false;
646016
646118
  return false;
646017
646119
  }
@@ -646102,7 +646204,7 @@ except Exception as exc:
646102
646204
  speed: settings.speed * speedFactor,
646103
646205
  total_step: settings.totalStep
646104
646206
  });
646105
- return existsSync138(wavPath) ? wavPath : null;
646207
+ return existsSync139(wavPath) ? wavPath : null;
646106
646208
  } catch {
646107
646209
  return null;
646108
646210
  }
@@ -646189,7 +646291,7 @@ except Exception as exc:
646189
646291
  async checkMlxInstalled() {
646190
646292
  if (this.mlxInstalled !== null) return this.mlxInstalled;
646191
646293
  const py = mlxVenvPy2();
646192
- if (!existsSync138(py)) {
646294
+ if (!existsSync139(py)) {
646193
646295
  this.mlxInstalled = false;
646194
646296
  return false;
646195
646297
  }
@@ -646271,7 +646373,7 @@ Error: ${err instanceof Error ? err.message : String(err)}`
646271
646373
  return;
646272
646374
  }
646273
646375
  }
646274
- if (!existsSync138(wavPath)) return;
646376
+ if (!existsSync139(wavPath)) return;
646275
646377
  if (volume !== 1) {
646276
646378
  try {
646277
646379
  const wavData = readFileSync112(wavPath);
@@ -646352,7 +646454,7 @@ Error: ${err instanceof Error ? err.message : String(err)}`
646352
646454
  return null;
646353
646455
  }
646354
646456
  }
646355
- if (!existsSync138(wavPath)) return null;
646457
+ if (!existsSync139(wavPath)) return null;
646356
646458
  try {
646357
646459
  const data = readFileSync112(wavPath);
646358
646460
  unlinkSync28(wavPath);
@@ -646379,7 +646481,7 @@ Error: ${err instanceof Error ? err.message : String(err)}`
646379
646481
  }
646380
646482
  const venvDir = luxttsVenvDir2();
646381
646483
  const venvPy = luxttsVenvPy2();
646382
- if (existsSync138(venvPy)) {
646484
+ if (existsSync139(venvPy)) {
646383
646485
  try {
646384
646486
  const quotedPy = `"${venvPy}"`;
646385
646487
  const repoPath2 = luxttsRepoDir2().replace(/\\/g, "/");
@@ -646435,7 +646537,7 @@ Error: ${err instanceof Error ? err.message : String(err)}`
646435
646537
  renderInfo(
646436
646538
  "Setting up LuxTTS voice cloning (first-time setup, this takes several minutes)..."
646437
646539
  );
646438
- if (!existsSync138(venvDir)) {
646540
+ if (!existsSync139(venvDir)) {
646439
646541
  renderInfo(" Creating Python virtual environment...");
646440
646542
  try {
646441
646543
  await this.asyncShell(
@@ -646467,8 +646569,8 @@ Error: ${err instanceof Error ? err.message : String(err)}`
646467
646569
  pipArgsStr = "torch torchaudio --index-url https://download.pytorch.org/whl/cu124";
646468
646570
  torchDesc = "CUDA (fallback)";
646469
646571
  } catch {
646470
- const arch3 = process.arch;
646471
- if (arch3 === "arm64" || arch3 === "arm") {
646572
+ const arch4 = process.arch;
646573
+ if (arch4 === "arm64" || arch4 === "arm") {
646472
646574
  pipArgsStr = "torch torchaudio";
646473
646575
  torchDesc = "ARM CPU (generic PyPI)";
646474
646576
  } else {
@@ -646497,10 +646599,10 @@ Error: ${err instanceof Error ? err.message : String(err)}`
646497
646599
  }
646498
646600
  }
646499
646601
  const repoDir = luxttsRepoDir2();
646500
- if (!existsSync138(join152(repoDir, "zipvoice", "luxvoice.py"))) {
646602
+ if (!existsSync139(join152(repoDir, "zipvoice", "luxvoice.py"))) {
646501
646603
  renderInfo(" Cloning LuxTTS repository...");
646502
646604
  try {
646503
- if (existsSync138(repoDir)) {
646605
+ if (existsSync139(repoDir)) {
646504
646606
  const rmCmd = process.platform === "win32" ? `rmdir /s /q ${JSON.stringify(repoDir)}` : `rm -rf ${JSON.stringify(repoDir)}`;
646505
646607
  await this.asyncShell(rmCmd, 3e4);
646506
646608
  }
@@ -646591,7 +646693,7 @@ Error: ${err instanceof Error ? err.message : String(err)}`
646591
646693
  );
646592
646694
  }
646593
646695
  }
646594
- const isJetson = isArm && (existsSync138("/etc/nv_tegra_release") || existsSync138("/usr/local/cuda/targets/aarch64-linux") || (process.env.JETSON_L4T_VERSION ?? "") !== "");
646696
+ const isJetson = isArm && (existsSync139("/etc/nv_tegra_release") || existsSync139("/usr/local/cuda/targets/aarch64-linux") || (process.env.JETSON_L4T_VERSION ?? "") !== "");
646595
646697
  const installSteps = isArm ? [
646596
646698
  // ARM: install individually so we get clear error messages per package.
646597
646699
  // ALL are fatal because LuxTTS hard-imports them (no lazy/optional imports).
@@ -646608,7 +646710,7 @@ Error: ${err instanceof Error ? err.message : String(err)}`
646608
646710
  ...isJetson ? (() => {
646609
646711
  let jpVer = "v60";
646610
646712
  try {
646611
- const tegra = existsSync138("/etc/nv_tegra_release") ? readFileSync112("/etc/nv_tegra_release", "utf8").trim() : "";
646713
+ const tegra = existsSync139("/etc/nv_tegra_release") ? readFileSync112("/etc/nv_tegra_release", "utf8").trim() : "";
646612
646714
  const ver = process.env.JETSON_L4T_VERSION || "";
646613
646715
  if (ver.startsWith("5.") || tegra.includes("R35") || tegra.includes("R34"))
646614
646716
  jpVer = "v51";
@@ -646788,7 +646890,7 @@ Error: ${err instanceof Error ? err.message : String(err)}`
646788
646890
  const venvDir = misottsVenvDir2();
646789
646891
  const venvPy = misottsVenvPy2();
646790
646892
  const repoDir = misottsRepoDir2();
646791
- if (existsSync138(venvPy)) {
646893
+ if (existsSync139(venvPy)) {
646792
646894
  try {
646793
646895
  const repoPath2 = repoDir.replace(/\\/g, "/");
646794
646896
  await this.asyncShell(
@@ -646818,7 +646920,7 @@ Error: ${err instanceof Error ? err.message : String(err)}`
646818
646920
  renderInfo(
646819
646921
  "Setting up MisoTTS 8B voice cloning (first-time setup, ~30-40GB download, takes several minutes)..."
646820
646922
  );
646821
- if (!existsSync138(venvDir)) {
646923
+ if (!existsSync139(venvDir)) {
646822
646924
  renderInfo(" Creating Python virtual environment...");
646823
646925
  try {
646824
646926
  await this.asyncShell(
@@ -646875,10 +646977,10 @@ Error: ${err instanceof Error ? err.message : String(err)}`
646875
646977
  }
646876
646978
  }
646877
646979
  }
646878
- if (!existsSync138(join152(repoDir, "generator.py"))) {
646980
+ if (!existsSync139(join152(repoDir, "generator.py"))) {
646879
646981
  renderInfo(" Cloning MisoTTS repository...");
646880
646982
  try {
646881
- if (existsSync138(repoDir)) {
646983
+ if (existsSync139(repoDir)) {
646882
646984
  await this.asyncShell(`rm -rf ${JSON.stringify(repoDir)}`, 3e4);
646883
646985
  }
646884
646986
  await this.asyncShell(
@@ -646965,13 +647067,13 @@ Error: ${err instanceof Error ? err.message : String(err)}`
646965
647067
  }
646966
647068
  /** Auto-detect an existing clone reference for MisoTTS */
646967
647069
  autoDetectMisottsCloneRef() {
646968
- if (this.misottsCloneRef && existsSync138(this.misottsCloneRef)) return;
647070
+ if (this.misottsCloneRef && existsSync139(this.misottsCloneRef)) return;
646969
647071
  const refsDir = luxttsCloneRefsDir();
646970
- if (!existsSync138(refsDir)) return;
647072
+ if (!existsSync139(refsDir)) return;
646971
647073
  const files = readdirSync45(refsDir).filter((f2) => /\.(wav|mp3|flac|ogg|m4a)$/i.test(f2)).sort();
646972
647074
  for (const f2 of files) {
646973
647075
  const p2 = join152(refsDir, f2);
646974
- if (existsSync138(p2)) {
647076
+ if (existsSync139(p2)) {
646975
647077
  this.misottsCloneRef = p2;
646976
647078
  return;
646977
647079
  }
@@ -646979,9 +647081,9 @@ Error: ${err instanceof Error ? err.message : String(err)}`
646979
647081
  }
646980
647082
  /** Auto-detect an existing clone reference in the refs directory */
646981
647083
  autoDetectCloneRef() {
646982
- if (this.luxttsCloneRef && existsSync138(this.luxttsCloneRef)) return;
647084
+ if (this.luxttsCloneRef && existsSync139(this.luxttsCloneRef)) return;
646983
647085
  const refsDir = luxttsCloneRefsDir();
646984
- if (!existsSync138(refsDir)) return;
647086
+ if (!existsSync139(refsDir)) return;
646985
647087
  for (const name10 of [
646986
647088
  "custom-clone.wav",
646987
647089
  "custom-clone.mp3",
@@ -646989,7 +647091,7 @@ Error: ${err instanceof Error ? err.message : String(err)}`
646989
647091
  "overwatch-ref.wav"
646990
647092
  ]) {
646991
647093
  const p2 = join152(refsDir, name10);
646992
- if (existsSync138(p2)) {
647094
+ if (existsSync139(p2)) {
646993
647095
  this.luxttsCloneRef = p2;
646994
647096
  return;
646995
647097
  }
@@ -647100,7 +647202,7 @@ if __name__ == '__main__':
647100
647202
  async ensureLuxttsDaemon() {
647101
647203
  if (this._luxttsDaemon && !this._luxttsDaemon.killed) return true;
647102
647204
  const venvPy = luxttsVenvPy2();
647103
- if (!existsSync138(venvPy)) return false;
647205
+ if (!existsSync139(venvPy)) return false;
647104
647206
  return new Promise((resolve76) => {
647105
647207
  const env2 = voicePythonEnv({ LUXTTS_REPO_PATH: luxttsRepoDir2() });
647106
647208
  const daemon = nodeSpawn(venvPy, [luxttsInferScript2()], {
@@ -647189,7 +647291,7 @@ if __name__ == '__main__':
647189
647291
  * Used by drainQueue's pre-fetch pipeline for gapless back-to-back playback.
647190
647292
  */
647191
647293
  async synthesizeLuxttsWav(text2, speedFactor = 1) {
647192
- if (!this.luxttsCloneRef || !existsSync138(this.luxttsCloneRef)) return null;
647294
+ if (!this.luxttsCloneRef || !existsSync139(this.luxttsCloneRef)) return null;
647193
647295
  const cleaned = text2.replace(/\*/g, "").trim();
647194
647296
  if (!cleaned) return null;
647195
647297
  const ready = await this.ensureLuxttsDaemon();
@@ -647209,14 +647311,14 @@ if __name__ == '__main__':
647209
647311
  } catch {
647210
647312
  return null;
647211
647313
  }
647212
- return existsSync138(wavPath) ? wavPath : null;
647314
+ return existsSync139(wavPath) ? wavPath : null;
647213
647315
  }
647214
647316
  /**
647215
647317
  * Post-process (fade-in, volume, pitch, stereo) and play a LuxTTS WAV file.
647216
647318
  * Cleans up the WAV file after playback.
647217
647319
  */
647218
647320
  async postProcessAndPlayLuxtts(wavPath, volume = 1, pitchFactor = 1, stereoDelayMs = 0.6) {
647219
- if (!existsSync138(wavPath)) return;
647321
+ if (!existsSync139(wavPath)) return;
647220
647322
  try {
647221
647323
  const wavData = readFileSync112(wavPath);
647222
647324
  if (wavData.length > 44) {
@@ -647331,7 +647433,7 @@ if __name__ == '__main__':
647331
647433
  * Used for Telegram voice messages and WebSocket streaming.
647332
647434
  */
647333
647435
  async synthesizeLuxttsToBuffer(text2) {
647334
- if (!this.luxttsCloneRef || !existsSync138(this.luxttsCloneRef)) return null;
647436
+ if (!this.luxttsCloneRef || !existsSync139(this.luxttsCloneRef)) return null;
647335
647437
  const cleaned = text2.replace(/\*/g, "").trim();
647336
647438
  if (!cleaned) return null;
647337
647439
  const ready = await this.ensureLuxttsDaemon();
@@ -647348,7 +647450,7 @@ if __name__ == '__main__':
647348
647450
  } catch {
647349
647451
  return null;
647350
647452
  }
647351
- if (!existsSync138(wavPath)) return null;
647453
+ if (!existsSync139(wavPath)) return null;
647352
647454
  try {
647353
647455
  const data = readFileSync112(wavPath);
647354
647456
  unlinkSync28(wavPath);
@@ -647462,7 +647564,7 @@ if __name__ == "__main__":
647462
647564
  async ensureMisottsDaemon() {
647463
647565
  if (this._misottsDaemon && !this._misottsDaemon.killed) return true;
647464
647566
  const venvPy = misottsVenvPy2();
647465
- if (!existsSync138(venvPy)) return false;
647567
+ if (!existsSync139(venvPy)) return false;
647466
647568
  return new Promise((resolve76) => {
647467
647569
  const env2 = voicePythonEnv({
647468
647570
  MISO_TTS_REPO_PATH: misottsRepoDir2(),
@@ -647548,7 +647650,7 @@ if __name__ == "__main__":
647548
647650
  * Returns the WAV file path or null on failure.
647549
647651
  */
647550
647652
  async synthesizeMisottsWav(text2, maxAudioLengthMs) {
647551
- if (!this.misottsCloneRef || !existsSync138(this.misottsCloneRef)) return null;
647653
+ if (!this.misottsCloneRef || !existsSync139(this.misottsCloneRef)) return null;
647552
647654
  const cleaned = text2.replace(/\*/g, "").trim();
647553
647655
  if (!cleaned) return null;
647554
647656
  const ready = await this.ensureMisottsDaemon();
@@ -647576,14 +647678,14 @@ if __name__ == "__main__":
647576
647678
  } catch {
647577
647679
  return null;
647578
647680
  }
647579
- return existsSync138(wavPath) ? wavPath : null;
647681
+ return existsSync139(wavPath) ? wavPath : null;
647580
647682
  }
647581
647683
  /**
647582
647684
  * Post-process (fade-in, volume, pitch, stereo) and play a MisoTTS WAV file.
647583
647685
  * MisoTTS outputs 24kHz mono via Mimi codec.
647584
647686
  */
647585
647687
  async postProcessAndPlayMisotts(wavPath, volume = 1, pitchFactor = 1, stereoDelayMs = 0.6) {
647586
- if (!existsSync138(wavPath)) return;
647688
+ if (!existsSync139(wavPath)) return;
647587
647689
  try {
647588
647690
  const wavData = readFileSync112(wavPath);
647589
647691
  if (wavData.length > 44) {
@@ -647699,7 +647801,7 @@ if __name__ == "__main__":
647699
647801
  * Used for Telegram voice messages and WebSocket streaming.
647700
647802
  */
647701
647803
  async synthesizeMisottsToBuffer(text2) {
647702
- if (!this.misottsCloneRef || !existsSync138(this.misottsCloneRef)) return null;
647804
+ if (!this.misottsCloneRef || !existsSync139(this.misottsCloneRef)) return null;
647703
647805
  const cleaned = text2.replace(/\*/g, "").trim();
647704
647806
  if (!cleaned) return null;
647705
647807
  const ready = await this.ensureMisottsDaemon();
@@ -647724,7 +647826,7 @@ if __name__ == "__main__":
647724
647826
  } catch {
647725
647827
  return null;
647726
647828
  }
647727
- if (!existsSync138(wavPath)) return null;
647829
+ if (!existsSync139(wavPath)) return null;
647728
647830
  try {
647729
647831
  const data = readFileSync112(wavPath);
647730
647832
  unlinkSync28(wavPath);
@@ -647738,14 +647840,14 @@ if __name__ == "__main__":
647738
647840
  // -------------------------------------------------------------------------
647739
647841
  async ensureRuntime() {
647740
647842
  if (this.ort) return;
647741
- const arch3 = process.arch;
647843
+ const arch4 = process.arch;
647742
647844
  mkdirSync83(voiceDir2(), { recursive: true });
647743
647845
  const pkgPath = join152(voiceDir2(), "package.json");
647744
647846
  const expectedDeps = {
647745
647847
  "onnxruntime-node": "^1.21.0",
647746
647848
  phonemizer: "^1.2.1"
647747
647849
  };
647748
- if (existsSync138(pkgPath)) {
647850
+ if (existsSync139(pkgPath)) {
647749
647851
  try {
647750
647852
  const existing = JSON.parse(readFileSync112(pkgPath, "utf8"));
647751
647853
  if (!existing.dependencies?.["phonemizer"]) {
@@ -647755,7 +647857,7 @@ if __name__ == "__main__":
647755
647857
  } catch {
647756
647858
  }
647757
647859
  }
647758
- if (!existsSync138(pkgPath)) {
647860
+ if (!existsSync139(pkgPath)) {
647759
647861
  writeFileSync71(
647760
647862
  pkgPath,
647761
647863
  JSON.stringify(
@@ -647786,10 +647888,10 @@ if __name__ == "__main__":
647786
647888
  "node_modules",
647787
647889
  "onnxruntime-node"
647788
647890
  );
647789
- const onnxInstalled = existsSync138(onnxNodeModules);
647891
+ const onnxInstalled = existsSync139(onnxNodeModules);
647790
647892
  if (onnxInstalled && !await probeOnnx()) {
647791
647893
  throw new Error(
647792
- `Voice synthesis unavailable: ONNX runtime crashes on this CPU (${process.platform}-${arch3}). This is a known issue with some ARM SoCs where the CPU vendor is not recognized. Voice feedback will be disabled but all other features work normally.`
647894
+ `Voice synthesis unavailable: ONNX runtime crashes on this CPU (${process.platform}-${arch4}). This is a known issue with some ARM SoCs where the CPU vendor is not recognized. Voice feedback will be disabled but all other features work normally.`
647793
647895
  );
647794
647896
  }
647795
647897
  try {
@@ -647802,7 +647904,7 @@ if __name__ == "__main__":
647802
647904
  12e4
647803
647905
  );
647804
647906
  } catch (err) {
647805
- const archHint = arch3 !== "x64" ? ` onnxruntime-node may not have prebuilt binaries for ${process.platform}-${arch3}.` : "";
647907
+ const archHint = arch4 !== "x64" ? ` onnxruntime-node may not have prebuilt binaries for ${process.platform}-${arch4}.` : "";
647806
647908
  throw new Error(
647807
647909
  `Failed to install voice dependencies.${archHint} Try manually: cd ${voiceDir2()} && npm install
647808
647910
  Error: ${err instanceof Error ? err.message : String(err)}`
@@ -647810,7 +647912,7 @@ Error: ${err instanceof Error ? err.message : String(err)}`
647810
647912
  }
647811
647913
  if (!await probeOnnx()) {
647812
647914
  throw new Error(
647813
- `Voice synthesis unavailable: ONNX runtime crashes on this CPU (${process.platform}-${arch3}). This is a known issue with some ARM SoCs where the CPU vendor is not recognized. Voice feedback will be disabled but all other features work normally.`
647915
+ `Voice synthesis unavailable: ONNX runtime crashes on this CPU (${process.platform}-${arch4}). This is a known issue with some ARM SoCs where the CPU vendor is not recognized. Voice feedback will be disabled but all other features work normally.`
647814
647916
  );
647815
647917
  }
647816
647918
  try {
@@ -647834,7 +647936,7 @@ Error: ${err instanceof Error ? err.message : String(err)}`
647834
647936
  const phonemizerMod = voiceRequire("phonemizer");
647835
647937
  this.phonemizeFn = phonemizerMod.phonemize ?? phonemizerMod.default?.phonemize ?? phonemizerMod;
647836
647938
  } catch (err) {
647837
- const archHint = arch3 !== "x64" ? ` phonemizer WASM may not support ${process.platform}-${arch3}.` : "";
647939
+ const archHint = arch4 !== "x64" ? ` phonemizer WASM may not support ${process.platform}-${arch4}.` : "";
647838
647940
  throw new Error(
647839
647941
  `Failed to install phonemizer.${archHint} Try manually: cd ${voiceDir2()} && npm install
647840
647942
  Error: ${err instanceof Error ? err.message : String(err)}`
@@ -647851,9 +647953,9 @@ Error: ${err instanceof Error ? err.message : String(err)}`
647851
647953
  const dir = modelDir(id2);
647852
647954
  const onnxPath = modelOnnxPath(id2);
647853
647955
  const configPath2 = modelConfigPath(id2);
647854
- if (existsSync138(onnxPath) && existsSync138(configPath2)) return;
647956
+ if (existsSync139(onnxPath) && existsSync139(configPath2)) return;
647855
647957
  mkdirSync83(dir, { recursive: true });
647856
- if (!existsSync138(configPath2)) {
647958
+ if (!existsSync139(configPath2)) {
647857
647959
  renderInfo(`Downloading ${model.label} voice config...`);
647858
647960
  const configResp = await fetch(model.configUrl);
647859
647961
  if (!configResp.ok)
@@ -647861,7 +647963,7 @@ Error: ${err instanceof Error ? err.message : String(err)}`
647861
647963
  const configText = await configResp.text();
647862
647964
  writeFileSync71(configPath2, configText);
647863
647965
  }
647864
- if (!existsSync138(onnxPath)) {
647966
+ if (!existsSync139(onnxPath)) {
647865
647967
  renderInfo(
647866
647968
  `Downloading ${model.label} voice model (this may take a minute)...`
647867
647969
  );
@@ -647904,7 +648006,7 @@ Error: ${err instanceof Error ? err.message : String(err)}`
647904
648006
  if (!this.ort) throw new Error("ONNX runtime not loaded");
647905
648007
  const onnxPath = modelOnnxPath(this.modelId);
647906
648008
  const configPath2 = modelConfigPath(this.modelId);
647907
- if (!existsSync138(onnxPath) || !existsSync138(configPath2)) {
648009
+ if (!existsSync139(onnxPath) || !existsSync139(configPath2)) {
647908
648010
  throw new Error(`Model files not found for ${this.modelId}`);
647909
648011
  }
647910
648012
  this.config = JSON.parse(readFileSync112(configPath2, "utf8"));
@@ -648066,7 +648168,7 @@ import * as nodeOs from "node:os";
648066
648168
  import { spawn as nodeSpawn2 } from "node:child_process";
648067
648169
  import { createHash as createHash38 } from "node:crypto";
648068
648170
  import {
648069
- existsSync as existsSync139,
648171
+ existsSync as existsSync140,
648070
648172
  readFileSync as readFileSync113,
648071
648173
  writeFileSync as writeFileSync72,
648072
648174
  mkdirSync as mkdirSync84,
@@ -648507,9 +648609,9 @@ async function ensureVoiceDeps(ctx3) {
648507
648609
  }
648508
648610
  if (typeof mod3.getVenvPython === "function") {
648509
648611
  const { dirname: dirname56 } = await import("node:path");
648510
- const { existsSync: existsSync171 } = await import("node:fs");
648612
+ const { existsSync: existsSync172 } = await import("node:fs");
648511
648613
  const venvPy = mod3.getVenvPython();
648512
- if (existsSync171(venvPy)) {
648614
+ if (existsSync172(venvPy)) {
648513
648615
  process.env.TRANSCRIBE_PYTHON = venvPy;
648514
648616
  const venvBin = dirname56(venvPy);
648515
648617
  const sep6 = process.platform === "win32" ? ";" : ":";
@@ -649388,10 +649490,10 @@ async function handleSlashCommand(input, ctx3) {
649388
649490
  if (!key) {
649389
649491
  try {
649390
649492
  const { homedir: homedir66 } = await import("node:os");
649391
- const { readFileSync: readFileSync140, existsSync: existsSync171 } = await import("node:fs");
649493
+ const { readFileSync: readFileSync140, existsSync: existsSync172 } = await import("node:fs");
649392
649494
  const { join: join188 } = await import("node:path");
649393
649495
  const p2 = join188(homedir66(), ".omnius", "api.key");
649394
- if (existsSync171(p2)) key = readFileSync140(p2, "utf8").trim();
649496
+ if (existsSync172(p2)) key = readFileSync140(p2, "utf8").trim();
649395
649497
  } catch {
649396
649498
  }
649397
649499
  }
@@ -650294,7 +650396,7 @@ async function handleSlashCommand(input, ctx3) {
650294
650396
  renderInfo(out.split("\n").slice(0, 4).join("\n"));
650295
650397
  try {
650296
650398
  const pidFile = join153(nexus.getNexusDir(), "daemon.pid");
650297
- if (existsSync139(pidFile)) {
650399
+ if (existsSync140(pidFile)) {
650298
650400
  const pid = parseInt(readFileSync113(pidFile, "utf8").trim(), 10);
650299
650401
  if (pid > 0 && !registry2.daemons.has("Nexus")) {
650300
650402
  registry2.register({
@@ -650714,7 +650816,7 @@ async function handleSlashCommand(input, ctx3) {
650714
650816
  toolDir,
650715
650817
  shareName.endsWith(".json") ? shareName : `${shareName}.json`
650716
650818
  );
650717
- if (!existsSync139(toolFile)) {
650819
+ if (!existsSync140(toolFile)) {
650718
650820
  renderWarning(`Tool not found: ${toolFile}`);
650719
650821
  return "handled";
650720
650822
  }
@@ -650723,7 +650825,7 @@ async function handleSlashCommand(input, ctx3) {
650723
650825
  } else if (shareType === "skill") {
650724
650826
  const skillDir = join153(ctx3.repoRoot, ".omnius", "skills", shareName);
650725
650827
  const skillFile = join153(skillDir, "SKILL.md");
650726
- if (!existsSync139(skillFile)) {
650828
+ if (!existsSync140(skillFile)) {
650727
650829
  renderWarning(`Skill not found: ${skillFile}`);
650728
650830
  return "handled";
650729
650831
  }
@@ -650799,7 +650901,7 @@ async function handleSlashCommand(input, ctx3) {
650799
650901
  "cid-registry",
650800
650902
  "learning-cids.json"
650801
650903
  );
650802
- if (existsSync139(regFile)) {
650904
+ if (existsSync140(regFile)) {
650803
650905
  const reg2 = JSON.parse(readFileSync113(regFile, "utf8"));
650804
650906
  const pinned = Object.values(reg2).some(
650805
650907
  (e2) => e2.cid === importCid && e2.pinned
@@ -650871,7 +650973,7 @@ async function handleSlashCommand(input, ctx3) {
650871
650973
  let heliaBlocks = 0;
650872
650974
  let heliaBytes = 0;
650873
650975
  try {
650874
- if (existsSync139(ipfsLocalDir)) {
650976
+ if (existsSync140(ipfsLocalDir)) {
650875
650977
  const files = readdirSync46(ipfsLocalDir).filter(
650876
650978
  (f2) => f2.endsWith(".json")
650877
650979
  );
@@ -650884,7 +650986,7 @@ async function handleSlashCommand(input, ctx3) {
650884
650986
  }
650885
650987
  }
650886
650988
  const heliaBlockDir = join153(ipfsDir, "blocks");
650887
- if (existsSync139(heliaBlockDir)) {
650989
+ if (existsSync140(heliaBlockDir)) {
650888
650990
  const walkDir = (dir) => {
650889
650991
  for (const entry of readdirSync46(dir, { withFileTypes: true })) {
650890
650992
  if (entry.isDirectory()) walkDir(join153(dir, entry.name));
@@ -650917,7 +651019,7 @@ async function handleSlashCommand(input, ctx3) {
650917
651019
  ctx3.repoRoot ?? process.cwd()
650918
651020
  ).getNexusDir();
650919
651021
  const statusFile = join153(nexusDir, "status.json");
650920
- if (existsSync139(statusFile)) {
651022
+ if (existsSync140(statusFile)) {
650921
651023
  const status = JSON.parse(readFileSync113(statusFile, "utf8"));
650922
651024
  if (status.peerId) {
650923
651025
  lines.push(`
@@ -650942,7 +651044,7 @@ async function handleSlashCommand(input, ctx3) {
650942
651044
  const idDir = join153(ctx3.repoRoot, ".omnius", "identity");
650943
651045
  try {
650944
651046
  const stateFile = join153(idDir, "self-state.json");
650945
- if (existsSync139(stateFile)) {
651047
+ if (existsSync140(stateFile)) {
650946
651048
  const state = JSON.parse(readFileSync113(stateFile, "utf8"));
650947
651049
  lines.push(
650948
651050
  ` Version: ${c3.bold("v" + (state.version ?? "?"))} Sessions: ${c3.bold(String(state.session_count ?? 0))}`
@@ -650957,7 +651059,7 @@ async function handleSlashCommand(input, ctx3) {
650957
651059
  lines.push(` Traits: ${c3.dim(traits.slice(0, 60))}`);
650958
651060
  }
650959
651061
  const cidFile = join153(idDir, "cids.json");
650960
- if (existsSync139(cidFile)) {
651062
+ if (existsSync140(cidFile)) {
650961
651063
  const cids = JSON.parse(readFileSync113(cidFile, "utf8"));
650962
651064
  const lastCid = Array.isArray(cids) ? cids[cids.length - 1] : cids.latest;
650963
651065
  if (lastCid)
@@ -650982,7 +651084,7 @@ async function handleSlashCommand(input, ctx3) {
650982
651084
  "metabolism",
650983
651085
  "store.json"
650984
651086
  );
650985
- if (existsSync139(metaFile2)) {
651087
+ if (existsSync140(metaFile2)) {
650986
651088
  const store2 = JSON.parse(readFileSync113(metaFile2, "utf8"));
650987
651089
  const active = store2.filter((m2) => m2.type !== "quarantine");
650988
651090
  const recoveries = active.filter(
@@ -651022,7 +651124,7 @@ async function handleSlashCommand(input, ctx3) {
651022
651124
  }
651023
651125
  try {
651024
651126
  const dbPath = join153(ctx3.repoRoot, ".omnius", "memory", "structured.db");
651025
- if (existsSync139(dbPath)) {
651127
+ if (existsSync140(dbPath)) {
651026
651128
  const {
651027
651129
  initDb: initDb2,
651028
651130
  closeDb: cDb,
@@ -651050,7 +651152,7 @@ async function handleSlashCommand(input, ctx3) {
651050
651152
  ${c3.bold("Storage Overview")}
651051
651153
  `);
651052
651154
  const omniusDir = join153(ctx3.repoRoot, ".omnius");
651053
- if (!existsSync139(omniusDir)) {
651155
+ if (!existsSync140(omniusDir)) {
651054
651156
  lines.push(` ${c3.dim("No .omnius/ directory found.")}`);
651055
651157
  safeLog(lines.join("\n") + "\n");
651056
651158
  return "handled";
@@ -651149,7 +651251,7 @@ async function handleSlashCommand(input, ctx3) {
651149
651251
  return "handled";
651150
651252
  }
651151
651253
  const resolvedPath = join153(ctx3.repoRoot, filePath);
651152
- if (!existsSync139(resolvedPath)) {
651254
+ if (!existsSync140(resolvedPath)) {
651153
651255
  renderWarning(`File not found: ${resolvedPath}`);
651154
651256
  return "handled";
651155
651257
  }
@@ -651261,7 +651363,7 @@ async function handleSlashCommand(input, ctx3) {
651261
651363
  const fortemiSubCmd = (arg || "").trim().toLowerCase();
651262
651364
  const fortemiDir = join153(ctx3.repoRoot, "..", "fortemi-react");
651263
651365
  const altFortemiDir = join153(nodeOs.homedir(), "fortemi-react");
651264
- const fDir = existsSync139(fortemiDir) ? fortemiDir : existsSync139(altFortemiDir) ? altFortemiDir : null;
651366
+ const fDir = existsSync140(fortemiDir) ? fortemiDir : existsSync140(altFortemiDir) ? altFortemiDir : null;
651265
651367
  if (fortemiSubCmd === "start" || fortemiSubCmd === "") {
651266
651368
  if (!fDir) {
651267
651369
  renderWarning(
@@ -651325,7 +651427,7 @@ async function handleSlashCommand(input, ctx3) {
651325
651427
  }
651326
651428
  if (fortemiSubCmd === "status") {
651327
651429
  const bridgeFile = join153(ctx3.repoRoot, ".omnius", "fortemi-bridge.json");
651328
- if (!existsSync139(bridgeFile)) {
651430
+ if (!existsSync140(bridgeFile)) {
651329
651431
  renderInfo("Fortemi bridge: not connected. Run /fortemi start");
651330
651432
  return "handled";
651331
651433
  }
@@ -651356,7 +651458,7 @@ async function handleSlashCommand(input, ctx3) {
651356
651458
  );
651357
651459
  lines.push(` Started: ${bridge.startedAt}`);
651358
651460
  lines.push(
651359
- ` JWT: ${existsSync139(bridge.jwtFile) ? c3.green("valid") : c3.yellow("missing")}`
651461
+ ` JWT: ${existsSync140(bridge.jwtFile) ? c3.green("valid") : c3.yellow("missing")}`
651360
651462
  );
651361
651463
  lines.push("");
651362
651464
  safeLog(lines.join("\n"));
@@ -651364,7 +651466,7 @@ async function handleSlashCommand(input, ctx3) {
651364
651466
  }
651365
651467
  if (fortemiSubCmd === "stop") {
651366
651468
  const bridgeFile = join153(ctx3.repoRoot, ".omnius", "fortemi-bridge.json");
651367
- if (existsSync139(bridgeFile)) {
651469
+ if (existsSync140(bridgeFile)) {
651368
651470
  const bridge = JSON.parse(readFileSync113(bridgeFile, "utf8"));
651369
651471
  try {
651370
651472
  process.kill(bridge.pid, "SIGTERM");
@@ -653391,10 +653493,10 @@ sleep 1
653391
653493
  const checkedNexusDir = new NexusTool(projectDir2).getNexusDir();
653392
653494
  _spLog(`nexusDir checked: ${checkedNexusDir}`);
653393
653495
  _spLog(
653394
- `status.json exists: ${existsSync139(join153(checkedNexusDir, "status.json"))}`
653496
+ `status.json exists: ${existsSync140(join153(checkedNexusDir, "status.json"))}`
653395
653497
  );
653396
653498
  _spLog(
653397
- `daemon.pid exists: ${existsSync139(join153(checkedNexusDir, "daemon.pid"))}`
653499
+ `daemon.pid exists: ${existsSync140(join153(checkedNexusDir, "daemon.pid"))}`
653398
653500
  );
653399
653501
  try {
653400
653502
  const _statusRaw = readFileSync113(
@@ -653440,7 +653542,7 @@ sleep 1
653440
653542
  ".omnius",
653441
653543
  "agent-name"
653442
653544
  );
653443
- if (existsSync139(namePath))
653545
+ if (existsSync140(namePath))
653444
653546
  sponsorName = readFileSync113(namePath, "utf8").trim();
653445
653547
  } catch {
653446
653548
  }
@@ -653543,7 +653645,7 @@ sleep 1
653543
653645
  new NexusTool(projectDir2).getNexusDir(),
653544
653646
  "daemon.pid"
653545
653647
  );
653546
- if (existsSync139(nexusPidFile)) {
653648
+ if (existsSync140(nexusPidFile)) {
653547
653649
  const nPid = parseInt(
653548
653650
  readFileSync113(nexusPidFile, "utf8").trim(),
653549
653651
  10
@@ -654228,7 +654330,7 @@ sleep 1
654228
654330
  if (parts[0] === "disable" || parts[0] === "disabled") {
654229
654331
  const hasGlobalFlagDisable = parts.includes("--global");
654230
654332
  const projectRootDisable = ctx3.repoRoot || process.cwd();
654231
- const projectHasOmniusDisable = existsSync139(
654333
+ const projectHasOmniusDisable = existsSync140(
654232
654334
  join153(projectRootDisable, ".omnius")
654233
654335
  );
654234
654336
  const wantsLocalDisable = hasGlobalFlagDisable ? false : isLocal || projectHasOmniusDisable;
@@ -654246,7 +654348,7 @@ sleep 1
654246
654348
  if (parts[0] === "enable" || parts[0] === "enabled") {
654247
654349
  const hasGlobalFlagEnable = parts.includes("--global");
654248
654350
  const projectRootEnable = ctx3.repoRoot || process.cwd();
654249
- const projectHasOmniusEnable = existsSync139(
654351
+ const projectHasOmniusEnable = existsSync140(
654250
654352
  join153(projectRootEnable, ".omnius")
654251
654353
  );
654252
654354
  const wantsLocalEnable = hasGlobalFlagEnable ? false : isLocal || projectHasOmniusEnable;
@@ -654296,7 +654398,7 @@ sleep 1
654296
654398
  }
654297
654399
  const hasGlobalFlagMode = parts.includes("--global");
654298
654400
  const projectRootMode = ctx3.repoRoot || process.cwd();
654299
- const projectHasOmniusMode = existsSync139(
654401
+ const projectHasOmniusMode = existsSync140(
654300
654402
  join153(projectRootMode, ".omnius")
654301
654403
  );
654302
654404
  const wantsLocalMode = hasGlobalFlagMode ? false : isLocal || projectHasOmniusMode;
@@ -654327,7 +654429,7 @@ sleep 1
654327
654429
  const limit = Math.max(1, Math.min(5, Math.floor(parsed)));
654328
654430
  const hasGlobalFlagSubAgents = parts.includes("--global");
654329
654431
  const projectRootSubAgents = ctx3.repoRoot || process.cwd();
654330
- const projectHasOmniusSubAgents = existsSync139(
654432
+ const projectHasOmniusSubAgents = existsSync140(
654331
654433
  join153(projectRootSubAgents, ".omnius")
654332
654434
  );
654333
654435
  const wantsLocalSubAgents = hasGlobalFlagSubAgents ? false : isLocal || projectHasOmniusSubAgents;
@@ -654344,7 +654446,7 @@ sleep 1
654344
654446
  if (parts[0] === "model" || parts[0] === "models") {
654345
654447
  const hasGlobalFlagModel = parts.includes("--global");
654346
654448
  const projectRootTgModel = ctx3.repoRoot || process.cwd();
654347
- const projectHasOmniusTgModel = existsSync139(
654449
+ const projectHasOmniusTgModel = existsSync140(
654348
654450
  join153(projectRootTgModel, ".omnius")
654349
654451
  );
654350
654452
  const wantsLocalTgModel = hasGlobalFlagModel ? false : isLocal || projectHasOmniusTgModel;
@@ -654356,7 +654458,7 @@ sleep 1
654356
654458
  if (parts[0] === "endpoint" || parts[0] === "ep") {
654357
654459
  const hasGlobalFlagEp = parts.includes("--global");
654358
654460
  const projectRootTgEp = ctx3.repoRoot || process.cwd();
654359
- const projectHasOmniusTgEp = existsSync139(
654461
+ const projectHasOmniusTgEp = existsSync140(
654360
654462
  join153(projectRootTgEp, ".omnius")
654361
654463
  );
654362
654464
  const wantsLocalTgEp = hasGlobalFlagEp ? false : isLocal || projectHasOmniusTgEp;
@@ -654720,7 +654822,7 @@ sleep 1
654720
654822
  const adminIdx = parts.indexOf("--admin");
654721
654823
  const hasGlobalFlag = parts.includes("--global");
654722
654824
  const projectRoot = ctx3.repoRoot || process.cwd();
654723
- const projectHasOmnius = existsSync139(join153(projectRoot, ".omnius"));
654825
+ const projectHasOmnius = existsSync140(join153(projectRoot, ".omnius"));
654724
654826
  const wantsLocal = hasGlobalFlag ? false : isLocal || projectHasOmnius;
654725
654827
  if (keyIdx !== -1 || adminIdx !== -1) {
654726
654828
  const settings = {
@@ -654834,14 +654936,14 @@ sleep 1
654834
654936
  }
654835
654937
  try {
654836
654938
  const startProjectRoot = ctx3.repoRoot || process.cwd();
654837
- if (existsSync139(join153(startProjectRoot, ".omnius"))) {
654939
+ if (existsSync140(join153(startProjectRoot, ".omnius"))) {
654838
654940
  const projectSettingsPath = join153(
654839
654941
  startProjectRoot,
654840
654942
  ".omnius",
654841
654943
  "settings.json"
654842
654944
  );
654843
654945
  let projectHasKey = false;
654844
- if (existsSync139(projectSettingsPath)) {
654946
+ if (existsSync140(projectSettingsPath)) {
654845
654947
  try {
654846
654948
  const projectJson = JSON.parse(
654847
654949
  readFileSync113(projectSettingsPath, "utf8")
@@ -656628,7 +656730,7 @@ function directorySizeBytes2(path12, seen = /* @__PURE__ */ new Set()) {
656628
656730
  }
656629
656731
  function cachedModelDiskStats(root, model) {
656630
656732
  const paths = cacheCandidatePaths(root, model).filter(
656631
- (path12) => existsSync139(path12)
656733
+ (path12) => existsSync140(path12)
656632
656734
  );
656633
656735
  const bytes = paths.reduce((sum, path12) => sum + directorySizeBytes2(path12), 0);
656634
656736
  return { downloaded: paths.length > 0, bytes, paths };
@@ -656639,7 +656741,7 @@ function downloadedModelSuffix(stats) {
656639
656741
  function removeCachedModelPaths(root, model) {
656640
656742
  const removed = [];
656641
656743
  for (const path12 of cacheCandidatePaths(root, model)) {
656642
- if (!existsSync139(path12)) continue;
656744
+ if (!existsSync140(path12)) continue;
656643
656745
  rmSync12(path12, { recursive: true, force: true });
656644
656746
  removed.push(path12);
656645
656747
  }
@@ -657390,7 +657492,7 @@ async function handleVideoCommand(ctx3, arg, hasLocal) {
657390
657492
  const { buildImageAsciiPreview: buildImageAsciiPreview2 } = await Promise.resolve().then(() => (init_image_ascii_preview(), image_ascii_preview_exports));
657391
657493
  const { video, thumbnail } = extractSavedVideoPath(result.output);
657392
657494
  const thumbAbs = thumbnail ? thumbnail.startsWith("/") ? thumbnail : join153(ctx3.repoRoot, thumbnail) : video ? `${video.startsWith("/") ? video : join153(ctx3.repoRoot, video)}.png` : null;
657393
- if (thumbAbs && existsSync139(thumbAbs)) {
657495
+ if (thumbAbs && existsSync140(thumbAbs)) {
657394
657496
  const preview = await buildImageAsciiPreview2(thumbAbs);
657395
657497
  const displayPath = video ?? thumbAbs;
657396
657498
  if (preview) {
@@ -658217,7 +658319,7 @@ async function showCohereDashboard(ctx3) {
658217
658319
  "identity",
658218
658320
  "snapshots"
658219
658321
  );
658220
- if (existsSync139(snapDir)) {
658322
+ if (existsSync140(snapDir)) {
658221
658323
  const snaps = readdirSync46(snapDir).filter((f2) => f2.endsWith(".json")).sort().reverse();
658222
658324
  const snapItems = snaps.slice(0, 20).map((f2) => ({
658223
658325
  key: f2,
@@ -658596,6 +658698,12 @@ async function handleLiveCommand(ctx3, arg) {
658596
658698
  if (sub2 === "stop" || sub2 === "off" || sub2 === "disable") {
658597
658699
  manager.stopAll();
658598
658700
  manager.setAgentActionSink(void 0);
658701
+ if (ctx3.isVoiceChatActive?.()) {
658702
+ try {
658703
+ await ctx3.voiceChatStop?.();
658704
+ } catch {
658705
+ }
658706
+ }
658599
658707
  renderInfo("Live sensor streams disabled.");
658600
658708
  return;
658601
658709
  }
@@ -658956,6 +659064,13 @@ Previewing microphone activity...`);
658956
659064
  continue;
658957
659065
  case "stop":
658958
659066
  manager.stopAll();
659067
+ manager.setAgentActionSink(void 0);
659068
+ if (ctx3.isVoiceChatActive?.()) {
659069
+ try {
659070
+ await ctx3.voiceChatStop?.();
659071
+ } catch {
659072
+ }
659073
+ }
658959
659074
  renderInfo("Live sensor streams disabled.");
658960
659075
  continue;
658961
659076
  default:
@@ -660584,7 +660699,7 @@ async function discoverSponsorMediaCandidates(ctx3, modality) {
660584
660699
  "sponsor",
660585
660700
  "known-sponsors.json"
660586
660701
  );
660587
- if (existsSync139(knownFile)) {
660702
+ if (existsSync140(knownFile)) {
660588
660703
  const saved = JSON.parse(readFileSync113(knownFile, "utf8"));
660589
660704
  if (Array.isArray(saved)) rawSponsors.push(...saved);
660590
660705
  }
@@ -660734,7 +660849,7 @@ async function collectSponsorMediaStream(args) {
660734
660849
  const deadline = Date.now() + 30 * 60 * 1e3;
660735
660850
  while (!done && Date.now() < deadline) {
660736
660851
  await new Promise((resolve76) => setTimeout(resolve76, 250));
660737
- if (!existsSync139(args.streamFile)) continue;
660852
+ if (!existsSync140(args.streamFile)) continue;
660738
660853
  const raw = readFileSync113(args.streamFile, "utf8");
660739
660854
  if (raw.length <= offset) continue;
660740
660855
  pending2 += raw.slice(offset);
@@ -661057,7 +661172,7 @@ async function handleSponsoredEndpoint(ctx3, local) {
661057
661172
  const sponsorDir2 = join153(ctx3.repoRoot ?? process.cwd(), ".omnius", "sponsor");
661058
661173
  const knownFile = join153(sponsorDir2, "known-sponsors.json");
661059
661174
  try {
661060
- if (existsSync139(knownFile)) {
661175
+ if (existsSync140(knownFile)) {
661061
661176
  const saved = JSON.parse(
661062
661177
  readFileSync113(knownFile, "utf8")
661063
661178
  );
@@ -661235,7 +661350,7 @@ async function handleSponsoredEndpoint(ctx3, local) {
661235
661350
  const saveKey = selected.url || selected.peerId || selected.name;
661236
661351
  try {
661237
661352
  mkdirSync84(sponsorDir2, { recursive: true });
661238
- const existing = existsSync139(knownFile) ? JSON.parse(readFileSync113(knownFile, "utf8")) : [];
661353
+ const existing = existsSync140(knownFile) ? JSON.parse(readFileSync113(knownFile, "utf8")) : [];
661239
661354
  const updated = existing.filter(
661240
661355
  (s2) => (s2.url || s2.peerId || s2.name) !== saveKey
661241
661356
  );
@@ -662441,7 +662556,7 @@ async function handleUpdate(subcommand, ctx3) {
662441
662556
  const { createRequire: createRequire11 } = await import("node:module");
662442
662557
  const { fileURLToPath: fileURLToPath26 } = await import("node:url");
662443
662558
  const { dirname: dirname56, join: join188 } = await import("node:path");
662444
- const { existsSync: existsSync171 } = await import("node:fs");
662559
+ const { existsSync: existsSync172 } = await import("node:fs");
662445
662560
  const req3 = createRequire11(import.meta.url);
662446
662561
  const thisDir = dirname56(fileURLToPath26(import.meta.url));
662447
662562
  const candidates = [
@@ -662450,7 +662565,7 @@ async function handleUpdate(subcommand, ctx3) {
662450
662565
  join188(thisDir, "..", "..", "..", "package.json")
662451
662566
  ];
662452
662567
  for (const pkgPath of candidates) {
662453
- if (existsSync171(pkgPath)) {
662568
+ if (existsSync172(pkgPath)) {
662454
662569
  const pkg = req3(pkgPath);
662455
662570
  if (pkg.name === "omnius" || pkg.name === "@omnius/cli") {
662456
662571
  currentVersion = pkg.version ?? "0.0.0";
@@ -664341,7 +664456,7 @@ var init_commands = __esm({
664341
664456
  });
664342
664457
 
664343
664458
  // packages/cli/src/tui/project-context.ts
664344
- import { existsSync as existsSync140, readFileSync as readFileSync114, readdirSync as readdirSync47, mkdirSync as mkdirSync85, statSync as statSync54, writeFileSync as writeFileSync73 } from "node:fs";
664459
+ import { existsSync as existsSync141, readFileSync as readFileSync114, readdirSync as readdirSync47, mkdirSync as mkdirSync85, statSync as statSync54, writeFileSync as writeFileSync73 } from "node:fs";
664345
664460
  import { dirname as dirname47, join as join154, basename as basename29, resolve as resolve62 } from "node:path";
664346
664461
  import { homedir as homedir53 } from "node:os";
664347
664462
  function projectContextUrlSpanAt(text2, index) {
@@ -664390,7 +664505,7 @@ function loadProjectMap(repoRoot) {
664390
664505
  initOmniusDirectory(repoRoot);
664391
664506
  }
664392
664507
  const mapPath2 = join154(repoRoot, OMNIUS_DIR, "context", "project-map.md");
664393
- if (existsSync140(mapPath2)) {
664508
+ if (existsSync141(mapPath2)) {
664394
664509
  try {
664395
664510
  const content = readFileSync114(mapPath2, "utf-8");
664396
664511
  return content;
@@ -664403,7 +664518,7 @@ function findGitDir(repoRoot) {
664403
664518
  let dir = resolve62(repoRoot);
664404
664519
  for (; ; ) {
664405
664520
  const gitPath = join154(dir, ".git");
664406
- if (existsSync140(gitPath)) {
664521
+ if (existsSync141(gitPath)) {
664407
664522
  try {
664408
664523
  const raw = readFileSync114(gitPath, "utf8").trim();
664409
664524
  const match = raw.match(/^gitdir:\s*(.+)$/i);
@@ -664441,7 +664556,7 @@ function getGitInfo(repoRoot) {
664441
664556
  }
664442
664557
  try {
664443
664558
  const indexPath = join154(gitDir, "index");
664444
- if (existsSync140(indexPath)) lines.push("Working tree: status not probed during prompt assembly");
664559
+ if (existsSync141(indexPath)) lines.push("Working tree: status not probed during prompt assembly");
664445
664560
  } catch {
664446
664561
  }
664447
664562
  return lines.join("\n");
@@ -664450,7 +664565,7 @@ function emptyMemoryContextBundle() {
664450
664565
  return { text: "", memoryPrefix: "", prefixHash: "" };
664451
664566
  }
664452
664567
  function countJsonMemoryEntries(dir) {
664453
- if (!existsSync140(dir)) return { topics: 0, entries: 0 };
664568
+ if (!existsSync141(dir)) return { topics: 0, entries: 0 };
664454
664569
  let topics = 0;
664455
664570
  let entries = 0;
664456
664571
  try {
@@ -664472,7 +664587,7 @@ function countJsonMemoryEntries(dir) {
664472
664587
  }
664473
664588
  function countReflectionBuffer(repoRoot) {
664474
664589
  const path12 = join154(repoRoot, OMNIUS_DIR, "memory", "reflections.json");
664475
- if (!existsSync140(path12)) return 0;
664590
+ if (!existsSync141(path12)) return 0;
664476
664591
  try {
664477
664592
  const parsed = JSON.parse(readFileSync114(path12, "utf8"));
664478
664593
  return Array.isArray(parsed.reflections) ? parsed.reflections.length : 0;
@@ -664481,7 +664596,7 @@ function countReflectionBuffer(repoRoot) {
664481
664596
  }
664482
664597
  }
664483
664598
  function countJsonlLines(path12, maxBytes = 1e6) {
664484
- if (!existsSync140(path12)) return 0;
664599
+ if (!existsSync141(path12)) return 0;
664485
664600
  try {
664486
664601
  const text2 = readFileSync114(path12, "utf8").slice(-maxBytes);
664487
664602
  return text2.split(/\r?\n/).filter((line) => line.trim()).length;
@@ -664497,9 +664612,9 @@ function buildWorkspaceMemorySubstrateCensus(repoRoot) {
664497
664612
  const globalMemory = countJsonMemoryEntries(join154(homedir53(), ".omnius", "memory"));
664498
664613
  const reflectionCount = countReflectionBuffer(repoRoot);
664499
664614
  const evidenceCount = countJsonlLines(join154(repoRoot, ".omnius", "evidence", "events.jsonl"));
664500
- const unifiedPresent = existsSync140(join154(repoRoot, OMNIUS_DIR, "unified-memory.db"));
664501
- const episodesPresent = existsSync140(join154(repoRoot, OMNIUS_DIR, "episodes.db"));
664502
- const knowledgePresent = existsSync140(join154(repoRoot, OMNIUS_DIR, "knowledge.db"));
664615
+ const unifiedPresent = existsSync141(join154(repoRoot, OMNIUS_DIR, "unified-memory.db"));
664616
+ const episodesPresent = existsSync141(join154(repoRoot, OMNIUS_DIR, "episodes.db"));
664617
+ const knowledgePresent = existsSync141(join154(repoRoot, OMNIUS_DIR, "knowledge.db"));
664503
664618
  const topicCount = projectMemory.topics + legacyMemory.topics + globalMemory.topics;
664504
664619
  const entryCount = projectMemory.entries + legacyMemory.entries + globalMemory.entries;
664505
664620
  const hasMemory = topicCount + entryCount + reflectionCount + evidenceCount > 0 || unifiedPresent || episodesPresent || knowledgePresent;
@@ -664522,7 +664637,7 @@ function loadMemoryContextBundle(repoRoot, task = "", taskEmbedding) {
664522
664637
  if (unified.text) return unified;
664523
664638
  const all2 = [];
664524
664639
  const collect = (dir, scope) => {
664525
- if (!existsSync140(dir)) return;
664640
+ if (!existsSync141(dir)) return;
664526
664641
  try {
664527
664642
  const files = readdirSync47(dir).filter((f2) => f2.endsWith(".json"));
664528
664643
  for (const file of files.slice(0, 10)) {
@@ -664634,7 +664749,7 @@ function loadMemoryContextBundle(repoRoot, task = "", taskEmbedding) {
664634
664749
  }
664635
664750
  function loadUnifiedMemoryContextBundle(repoRoot, task = "", taskEmbedding) {
664636
664751
  const dbPath = join154(repoRoot, OMNIUS_DIR, "unified-memory.db");
664637
- if (!existsSync140(dbPath)) return emptyMemoryContextBundle();
664752
+ if (!existsSync141(dbPath)) return emptyMemoryContextBundle();
664638
664753
  let db = null;
664639
664754
  try {
664640
664755
  db = initDb(dbPath);
@@ -664953,9 +665068,9 @@ function inspectPythonBootstrap(repoRoot, task = "") {
664953
665068
  const rootEntries = safeReadDir(repoRoot);
664954
665069
  const scriptsEntries = safeReadDir(join154(repoRoot, "scripts"));
664955
665070
  const binEntries = safeReadDir(join154(repoRoot, "bin"));
664956
- const relExists = (rel) => existsSync140(join154(repoRoot, rel));
665071
+ const relExists = (rel) => existsSync141(join154(repoRoot, rel));
664957
665072
  const venvs = [".venv", "venv", "env"].filter((rel) => isDirectory2(join154(repoRoot, rel))).filter(
664958
- (rel) => existsSync140(join154(repoRoot, rel, process.platform === "win32" ? "Scripts" : "bin")) || existsSync140(join154(repoRoot, rel, "pyvenv.cfg"))
665073
+ (rel) => existsSync141(join154(repoRoot, rel, process.platform === "win32" ? "Scripts" : "bin")) || existsSync141(join154(repoRoot, rel, "pyvenv.cfg"))
664959
665074
  );
664960
665075
  const requirements = rootEntries.filter((name10) => /^requirements(?:[-_.][A-Za-z0-9_-]+)?\.txt$/.test(name10)).sort();
664961
665076
  const managers2 = [
@@ -665014,7 +665129,7 @@ function findBootstrapEntries(entries, prefix) {
665014
665129
  ).map((name10) => prefix ? `${prefix}/${name10}` : name10).sort();
665015
665130
  }
665016
665131
  function extractMakeBootstrapTargets(repoRoot) {
665017
- const makefile = ["Makefile", "makefile"].find((name10) => existsSync140(join154(repoRoot, name10)));
665132
+ const makefile = ["Makefile", "makefile"].find((name10) => existsSync141(join154(repoRoot, name10)));
665018
665133
  if (!makefile) return [];
665019
665134
  try {
665020
665135
  const text2 = readFileSync114(join154(repoRoot, makefile), "utf8");
@@ -665160,7 +665275,7 @@ function loadCustomToolsContext(repoRoot) {
665160
665275
  try {
665161
665276
  const registryPath = join154(repoRoot, ".omnius", "tools", "registry.json");
665162
665277
  const indexPath = join154(repoRoot, ".omnius", "tools", "README.md");
665163
- if (!existsSync140(registryPath)) return "";
665278
+ if (!existsSync141(registryPath)) return "";
665164
665279
  const registry4 = JSON.parse(readFileSync114(registryPath, "utf-8"));
665165
665280
  const tools = (registry4.tools ?? []).filter((tool) => tool.qualityGate?.lastTest?.status === "passed").sort((a2, b) => {
665166
665281
  const byRate = (b.analytics?.successRate ?? 0) - (a2.analytics?.successRate ?? 0);
@@ -665176,7 +665291,7 @@ function loadCustomToolsContext(repoRoot) {
665176
665291
  const bits = [
665177
665292
  `- ${tool.name} v${tool.version ?? 1}: ${truncateProjectContextText(String(tool.description ?? ""), 140, "")}`,
665178
665293
  `docs=${tool.docsPath ?? "missing"}`,
665179
- existsSync140(indexPath) ? `index=${indexPath}` : "",
665294
+ existsSync141(indexPath) ? `index=${indexPath}` : "",
665180
665295
  `test=${tested}${schema ? `, schema=${schema}` : ""}`,
665181
665296
  `success=${successRate}`,
665182
665297
  example?.args ? `example=${tool.name}(${JSON.stringify(example.args)})` : "",
@@ -665337,7 +665452,7 @@ var init_project_context = __esm({
665337
665452
  });
665338
665453
 
665339
665454
  // packages/cli/src/realtime.ts
665340
- import { existsSync as existsSync141, readFileSync as readFileSync115, readdirSync as readdirSync48 } from "node:fs";
665455
+ import { existsSync as existsSync142, readFileSync as readFileSync115, readdirSync as readdirSync48 } from "node:fs";
665341
665456
  import { basename as basename30, join as join155, resolve as resolve63 } from "node:path";
665342
665457
  function clampInt2(value2, fallback, min, max) {
665343
665458
  const n2 = typeof value2 === "number" ? value2 : Number.parseInt(String(value2 ?? ""), 10);
@@ -665357,7 +665472,7 @@ function blockText2(text2, limit) {
665357
665472
  }
665358
665473
  function firstReadable(candidates) {
665359
665474
  for (const path12 of candidates) {
665360
- if (!existsSync141(path12)) continue;
665475
+ if (!existsSync142(path12)) continue;
665361
665476
  try {
665362
665477
  return { path: path12, content: readFileSync115(path12, "utf8") };
665363
665478
  } catch {
@@ -665374,7 +665489,7 @@ function projectSoul(repoRoot) {
665374
665489
  }
665375
665490
  function projectVoice(repoRoot) {
665376
665491
  const voiceDir3 = resolve63(repoRoot, ".aiwg", "voices");
665377
- if (!existsSync141(voiceDir3)) return null;
665492
+ if (!existsSync142(voiceDir3)) return null;
665378
665493
  try {
665379
665494
  const files = readdirSync48(voiceDir3).filter((name10) => name10.endsWith(".yaml") || name10.endsWith(".yml")).sort((a2, b) => {
665380
665495
  const ap = a2 === "default.yaml" || a2 === "default.yml" || a2 === "omnius.yaml" || a2 === "omnius.yml" ? 0 : 1;
@@ -665569,7 +665684,7 @@ __export(chat_session_exports, {
665569
665684
  });
665570
665685
  import { randomUUID as randomUUID18 } from "node:crypto";
665571
665686
  import {
665572
- existsSync as existsSync142,
665687
+ existsSync as existsSync143,
665573
665688
  readFileSync as readFileSync116,
665574
665689
  readdirSync as readdirSync49,
665575
665690
  writeFileSync as writeFileSync74,
@@ -665614,7 +665729,7 @@ function persistInFlight(j) {
665614
665729
  function deleteInFlightFile(id2) {
665615
665730
  try {
665616
665731
  const p2 = inFlightPath(id2);
665617
- if (existsSync142(p2)) unlinkSync29(p2);
665732
+ if (existsSync143(p2)) unlinkSync29(p2);
665618
665733
  } catch {
665619
665734
  }
665620
665735
  }
@@ -665691,7 +665806,7 @@ function allKnownSessions() {
665691
665806
  for (const s2 of sessions2.values()) merged.set(s2.id, normalizeLoadedSession(s2));
665692
665807
  try {
665693
665808
  const dir = sessionsDir();
665694
- if (existsSync142(dir)) {
665809
+ if (existsSync143(dir)) {
665695
665810
  for (const f2 of readdirSync49(dir)) {
665696
665811
  if (!f2.endsWith(".json") || f2.endsWith(".inflight.json") || f2.includes(".tmp.")) continue;
665697
665812
  const loaded = readSessionFile(join156(dir, f2));
@@ -665706,7 +665821,7 @@ function loadPersistedSessions() {
665706
665821
  const report2 = { restored: 0, staleInFlight: 0 };
665707
665822
  try {
665708
665823
  const dir = sessionsDir();
665709
- if (!existsSync142(dir)) return report2;
665824
+ if (!existsSync143(dir)) return report2;
665710
665825
  const cutoff = Date.now() - SESSION_TTL_MS;
665711
665826
  for (const f2 of readdirSync49(dir)) {
665712
665827
  if (!f2.endsWith(".json") || f2.includes(".tmp.")) continue;
@@ -665752,7 +665867,7 @@ function buildSystemPrompt(cwd4) {
665752
665867
  `\\nEnvironment: ${process.platform}, Node ${process.version}, CWD: ${cwd4}`
665753
665868
  );
665754
665869
  const diaryPath = join156(cwd4, ".omnius", "context", "session-diary.md");
665755
- if (existsSync142(diaryPath)) {
665870
+ if (existsSync143(diaryPath)) {
665756
665871
  try {
665757
665872
  const diary = readFileSync116(diaryPath, "utf-8").slice(0, 1e3);
665758
665873
  parts.push(`\\nPrevious session history:\\n${diary}`);
@@ -665760,7 +665875,7 @@ function buildSystemPrompt(cwd4) {
665760
665875
  }
665761
665876
  }
665762
665877
  const memDir = join156(cwd4, ".omnius", "memory");
665763
- if (existsSync142(memDir)) {
665878
+ if (existsSync143(memDir)) {
665764
665879
  try {
665765
665880
  const files = readdirSync49(memDir).filter((f2) => f2.endsWith(".json")).slice(0, 5);
665766
665881
  if (files.length > 0) {
@@ -665787,7 +665902,7 @@ function buildSystemPrompt(cwd4) {
665787
665902
  }
665788
665903
  for (const name10 of ["AGENTS.md", "Omnius.md", ".omnius.md"]) {
665789
665904
  const p2 = join156(cwd4, name10);
665790
- if (existsSync142(p2)) {
665905
+ if (existsSync143(p2)) {
665791
665906
  try {
665792
665907
  const content = readFileSync116(p2, "utf-8").slice(0, 500);
665793
665908
  parts.push(`\\nProject instructions (${name10}):\\n${content}`);
@@ -665810,7 +665925,7 @@ function getSession2(sessionId, model, cwd4) {
665810
665925
  if (sessionId) {
665811
665926
  try {
665812
665927
  const fp = sessionPath(sessionId);
665813
- if (existsSync142(fp)) {
665928
+ if (existsSync143(fp)) {
665814
665929
  const parsed = normalizeLoadedSession(JSON.parse(readFileSync116(fp, "utf-8")));
665815
665930
  if (parsed && parsed.id === sessionId) {
665816
665931
  parsed.lastActivity = Date.now();
@@ -665996,7 +666111,7 @@ function appendCheckin(sessionId, steering) {
665996
666111
  }
665997
666112
  function drainCheckins(sessionId) {
665998
666113
  const fp = checkinPath(sessionId);
665999
- if (!existsSync142(fp)) return [];
666114
+ if (!existsSync143(fp)) return [];
666000
666115
  try {
666001
666116
  const raw = readFileSync116(fp, "utf-8");
666002
666117
  try {
@@ -666047,7 +666162,7 @@ function deleteSession2(id2) {
666047
666162
  let removed = false;
666048
666163
  try {
666049
666164
  const p2 = sessionPath(id2);
666050
- if (existsSync142(p2)) {
666165
+ if (existsSync143(p2)) {
666051
666166
  unlinkSync29(p2);
666052
666167
  removed = true;
666053
666168
  }
@@ -666063,7 +666178,7 @@ function lookupSession(id2) {
666063
666178
  if (cached) return cached;
666064
666179
  try {
666065
666180
  const fp = sessionPath(id2);
666066
- if (existsSync142(fp)) {
666181
+ if (existsSync143(fp)) {
666067
666182
  const parsed = normalizeLoadedSession(JSON.parse(readFileSync116(fp, "utf-8")));
666068
666183
  if (parsed && parsed.id === id2) {
666069
666184
  sessions2.set(id2, parsed);
@@ -666116,7 +666231,7 @@ function getInFlightChat(sessionId) {
666116
666231
  if (cached) return cached;
666117
666232
  try {
666118
666233
  const p2 = inFlightPath(sessionId);
666119
- if (existsSync142(p2)) {
666234
+ if (existsSync143(p2)) {
666120
666235
  const parsed = JSON.parse(readFileSync116(p2, "utf-8"));
666121
666236
  if (parsed && parsed.sessionId === sessionId) {
666122
666237
  return parsed;
@@ -666688,7 +666803,7 @@ var init_visual_identity_association = __esm({
666688
666803
  });
666689
666804
 
666690
666805
  // packages/cli/src/tui/identity-memory-tool.ts
666691
- import { existsSync as existsSync143 } from "node:fs";
666806
+ import { existsSync as existsSync144 } from "node:fs";
666692
666807
  import { basename as basename32, extname as extname19, resolve as resolve65 } from "node:path";
666693
666808
  function personKey2(name10) {
666694
666809
  return `person:${name10.trim().toLowerCase().replace(/\s+/g, " ")}`;
@@ -666751,7 +666866,7 @@ async function resolveMediaFromArgs(args, opts) {
666751
666866
  return null;
666752
666867
  }
666753
666868
  const path12 = resolve65(ref);
666754
- if (!existsSync143(path12)) return null;
666869
+ if (!existsSync144(path12)) return null;
666755
666870
  const mediaType = inferMediaTypeFromPath(path12);
666756
666871
  const media = { path: path12, mediaType };
666757
666872
  return {
@@ -667522,7 +667637,7 @@ __export(banner_exports, {
667522
667637
  setBannerWriter: () => setBannerWriter,
667523
667638
  setGridText: () => setGridText
667524
667639
  });
667525
- import { existsSync as existsSync144, readFileSync as readFileSync117, writeFileSync as writeFileSync75, mkdirSync as mkdirSync87 } from "node:fs";
667640
+ import { existsSync as existsSync145, readFileSync as readFileSync117, writeFileSync as writeFileSync75, mkdirSync as mkdirSync87 } from "node:fs";
667526
667641
  import { join as join157 } from "node:path";
667527
667642
  function setBannerWriter(writer) {
667528
667643
  chromeWrite3 = writer;
@@ -667662,7 +667777,7 @@ function saveBannerDesign(workDir, design) {
667662
667777
  }
667663
667778
  function loadBannerDesign(workDir, id2) {
667664
667779
  const file = join157(workDir, ".omnius", "banners", `${id2}.json`);
667665
- if (!existsSync144(file)) return null;
667780
+ if (!existsSync145(file)) return null;
667666
667781
  try {
667667
667782
  return JSON.parse(readFileSync117(file, "utf8"));
667668
667783
  } catch {
@@ -667671,7 +667786,7 @@ function loadBannerDesign(workDir, id2) {
667671
667786
  }
667672
667787
  function listBannerDesigns(workDir) {
667673
667788
  const dir = join157(workDir, ".omnius", "banners");
667674
- if (!existsSync144(dir)) return [];
667789
+ if (!existsSync145(dir)) return [];
667675
667790
  try {
667676
667791
  const { readdirSync: readdirSync61 } = __require("node:fs");
667677
667792
  return readdirSync61(dir).filter((f2) => f2.endsWith(".json")).map((f2) => f2.replace(".json", ""));
@@ -667994,12 +668109,12 @@ var init_banner = __esm({
667994
668109
  });
667995
668110
 
667996
668111
  // packages/cli/src/tui/carousel-descriptors.ts
667997
- import { existsSync as existsSync145, readFileSync as readFileSync118, writeFileSync as writeFileSync76, mkdirSync as mkdirSync88, readdirSync as readdirSync50 } from "node:fs";
668112
+ import { existsSync as existsSync146, readFileSync as readFileSync118, writeFileSync as writeFileSync76, mkdirSync as mkdirSync88, readdirSync as readdirSync50 } from "node:fs";
667998
668113
  import { join as join158, basename as basename33 } from "node:path";
667999
668114
  function loadToolProfile(repoRoot) {
668000
668115
  const filePath = join158(repoRoot, OMNIUS_DIR, "context", TOOL_PROFILE_FILE);
668001
668116
  try {
668002
- if (!existsSync145(filePath)) return null;
668117
+ if (!existsSync146(filePath)) return null;
668003
668118
  return JSON.parse(readFileSync118(filePath, "utf-8"));
668004
668119
  } catch {
668005
668120
  return null;
@@ -668065,7 +668180,7 @@ function weightedColor(profile) {
668065
668180
  function loadCachedDescriptors(repoRoot) {
668066
668181
  const filePath = join158(repoRoot, OMNIUS_DIR, "context", DESCRIPTOR_FILE);
668067
668182
  try {
668068
- if (!existsSync145(filePath)) return null;
668183
+ if (!existsSync146(filePath)) return null;
668069
668184
  const cached = JSON.parse(readFileSync118(filePath, "utf-8"));
668070
668185
  return cached.phrases.length > 0 ? cached.phrases : null;
668071
668186
  } catch {
@@ -668129,7 +668244,7 @@ function generateDescriptors(repoRoot) {
668129
668244
  function extractFromPackageJson(repoRoot, tags) {
668130
668245
  const pkgPath = join158(repoRoot, "package.json");
668131
668246
  try {
668132
- if (!existsSync145(pkgPath)) return;
668247
+ if (!existsSync146(pkgPath)) return;
668133
668248
  const pkg = JSON.parse(readFileSync118(pkgPath, "utf-8"));
668134
668249
  if (pkg.name && typeof pkg.name === "string") {
668135
668250
  const parts = pkg.name.replace(/^@/, "").split("/");
@@ -668171,7 +668286,7 @@ function extractFromManifests(repoRoot, tags) {
668171
668286
  { file: ".github/workflows", tag: "ci/cd" }
668172
668287
  ];
668173
668288
  for (const check of manifestChecks) {
668174
- if (existsSync145(join158(repoRoot, check.file))) {
668289
+ if (existsSync146(join158(repoRoot, check.file))) {
668175
668290
  tags.push(check.tag);
668176
668291
  }
668177
668292
  }
@@ -668195,7 +668310,7 @@ function extractFromSessions(repoRoot, tags) {
668195
668310
  function extractFromMemory(repoRoot, tags) {
668196
668311
  const memoryDir = join158(repoRoot, OMNIUS_DIR, "memory");
668197
668312
  try {
668198
- if (!existsSync145(memoryDir)) return;
668313
+ if (!existsSync146(memoryDir)) return;
668199
668314
  const files = readdirSync50(memoryDir).filter((f2) => f2.endsWith(".json"));
668200
668315
  for (const file of files) {
668201
668316
  const topic = file.replace(/\.json$/, "").replace(/[-_]/g, " ");
@@ -669244,7 +669359,7 @@ var init_edit_history = __esm({
669244
669359
  });
669245
669360
 
669246
669361
  // packages/cli/src/tui/snr-engine.ts
669247
- import { existsSync as existsSync146, readdirSync as readdirSync51, readFileSync as readFileSync119, writeFileSync as writeFileSync77, mkdirSync as mkdirSync90, rmSync as rmSync13 } from "node:fs";
669362
+ import { existsSync as existsSync147, readdirSync as readdirSync51, readFileSync as readFileSync119, writeFileSync as writeFileSync77, mkdirSync as mkdirSync90, rmSync as rmSync13 } from "node:fs";
669248
669363
  import { join as join160, basename as basename34 } from "node:path";
669249
669364
  function computeDPrime(signalScores, noiseScores) {
669250
669365
  if (signalScores.length === 0 || noiseScores.length === 0) return 0;
@@ -669544,7 +669659,7 @@ Call task_complete with the JSON array when done.`,
669544
669659
  join160(this.repoRoot, ".omnius", "memory")
669545
669660
  ])];
669546
669661
  for (const dir of dirs) {
669547
- if (!existsSync146(dir)) continue;
669662
+ if (!existsSync147(dir)) continue;
669548
669663
  try {
669549
669664
  const files = readdirSync51(dir).filter((f2) => f2.endsWith(".json"));
669550
669665
  for (const f2 of files) {
@@ -669651,7 +669766,7 @@ Call task_complete with the JSON array when done.`,
669651
669766
  const touchedTopics = [];
669652
669767
  for (const [topic, keys] of byTopic) {
669653
669768
  const file = join160(memDir, `${topic}.json`);
669654
- if (!existsSync146(file)) continue;
669769
+ if (!existsSync147(file)) continue;
669655
669770
  try {
669656
669771
  const data = JSON.parse(readFileSync119(file, "utf-8"));
669657
669772
  const moved = {};
@@ -669666,7 +669781,7 @@ Call task_complete with the JSON array when done.`,
669666
669781
  mkdirSync90(archiveDir, { recursive: true });
669667
669782
  const archiveFile = join160(archiveDir, `${topic}.json`);
669668
669783
  let archiveData = {};
669669
- if (existsSync146(archiveFile)) {
669784
+ if (existsSync147(archiveFile)) {
669670
669785
  try {
669671
669786
  archiveData = JSON.parse(readFileSync119(archiveFile, "utf-8"));
669672
669787
  } catch {
@@ -669707,14 +669822,14 @@ Call task_complete with the JSON array when done.`,
669707
669822
  });
669708
669823
 
669709
669824
  // packages/cli/src/tui/promptLoader.ts
669710
- import { readFileSync as readFileSync120, existsSync as existsSync147 } from "node:fs";
669825
+ import { readFileSync as readFileSync120, existsSync as existsSync148 } from "node:fs";
669711
669826
  import { join as join161, dirname as dirname49 } from "node:path";
669712
669827
  import { fileURLToPath as fileURLToPath21 } from "node:url";
669713
669828
  function loadPrompt3(promptPath, vars) {
669714
669829
  let content = cache7.get(promptPath);
669715
669830
  if (content === void 0) {
669716
669831
  const fullPath = join161(PROMPTS_DIR3, promptPath);
669717
- if (!existsSync147(fullPath)) {
669832
+ if (!existsSync148(fullPath)) {
669718
669833
  throw new Error(`Prompt file not found: ${fullPath}`);
669719
669834
  }
669720
669835
  content = readFileSync120(fullPath, "utf-8");
@@ -669731,13 +669846,13 @@ var init_promptLoader3 = __esm({
669731
669846
  __dirname6 = dirname49(__filename5);
669732
669847
  devPath2 = join161(__dirname6, "..", "..", "prompts");
669733
669848
  publishedPath2 = join161(__dirname6, "..", "prompts");
669734
- PROMPTS_DIR3 = existsSync147(devPath2) ? devPath2 : publishedPath2;
669849
+ PROMPTS_DIR3 = existsSync148(devPath2) ? devPath2 : publishedPath2;
669735
669850
  cache7 = /* @__PURE__ */ new Map();
669736
669851
  }
669737
669852
  });
669738
669853
 
669739
669854
  // packages/cli/src/tui/dream-engine.ts
669740
- import { mkdirSync as mkdirSync91, writeFileSync as writeFileSync78, readFileSync as readFileSync121, existsSync as existsSync148, readdirSync as readdirSync52 } from "node:fs";
669855
+ import { mkdirSync as mkdirSync91, writeFileSync as writeFileSync78, readFileSync as readFileSync121, existsSync as existsSync149, readdirSync as readdirSync52 } from "node:fs";
669741
669856
  import { join as join162, basename as basename35 } from "node:path";
669742
669857
  function setDreamWriteContent(fn) {
669743
669858
  _dreamWriteContent = fn;
@@ -669751,7 +669866,7 @@ function dreamWrite(fn) {
669751
669866
  }
669752
669867
  function loadAutoresearchMemory(repoRoot) {
669753
669868
  const memoryPath = join162(repoRoot, ".omnius", "memory", "autoresearch.json");
669754
- if (!existsSync148(memoryPath)) return "";
669869
+ if (!existsSync149(memoryPath)) return "";
669755
669870
  try {
669756
669871
  const raw = readFileSync121(memoryPath, "utf-8");
669757
669872
  const data = JSON.parse(raw);
@@ -669985,7 +670100,7 @@ var init_dream_engine = __esm({
669985
670100
  return { success: false, output: "", error: "Autoresearch mode: edits are confined to .omnius/autoresearch/", durationMs: Date.now() - start2 };
669986
670101
  }
669987
670102
  try {
669988
- if (!existsSync148(targetPath)) {
670103
+ if (!existsSync149(targetPath)) {
669989
670104
  return { success: false, output: "", error: `File not found: ${rawPath}`, durationMs: Date.now() - start2 };
669990
670105
  }
669991
670106
  let content = readFileSync121(targetPath, "utf-8");
@@ -670073,7 +670188,7 @@ var init_dream_engine = __esm({
670073
670188
  return { success: false, output: "", error: "Dream mode: edits are confined to .omnius/dreams/", durationMs: Date.now() - start2 };
670074
670189
  }
670075
670190
  try {
670076
- if (!existsSync148(targetPath)) {
670191
+ if (!existsSync149(targetPath)) {
670077
670192
  return { success: false, output: "", error: `File not found: ${rawPath}`, durationMs: Date.now() - start2 };
670078
670193
  }
670079
670194
  let content = readFileSync121(targetPath, "utf-8");
@@ -671039,7 +671154,7 @@ ${summary}` };
671039
671154
  const action = args["action"] || "list";
671040
671155
  try {
671041
671156
  let notes = [];
671042
- if (existsSync148(notesPath)) {
671157
+ if (existsSync149(notesPath)) {
671043
671158
  notes = JSON.parse(readFileSync121(notesPath, "utf-8"));
671044
671159
  }
671045
671160
  if (action === "add") {
@@ -671680,7 +671795,7 @@ var init_bless_engine = __esm({
671680
671795
  });
671681
671796
 
671682
671797
  // packages/cli/src/tui/dmn-engine.ts
671683
- import { existsSync as existsSync149, readFileSync as readFileSync122, writeFileSync as writeFileSync79, mkdirSync as mkdirSync92, readdirSync as readdirSync53, unlinkSync as unlinkSync30 } from "node:fs";
671798
+ import { existsSync as existsSync150, readFileSync as readFileSync122, writeFileSync as writeFileSync79, mkdirSync as mkdirSync92, readdirSync as readdirSync53, unlinkSync as unlinkSync30 } from "node:fs";
671684
671799
  import { join as join163, basename as basename36 } from "node:path";
671685
671800
  import { exec as exec6 } from "node:child_process";
671686
671801
  import { promisify as promisify8 } from "node:util";
@@ -672500,7 +672615,7 @@ If decision is GO, selectedTask MUST be a fully-populated object (NEVER null)
672500
672615
  const root = this.repoRoot;
672501
672616
  try {
672502
672617
  const plansDir = join163(root, ".aiwg", "plans");
672503
- if (existsSync149(plansDir)) {
672618
+ if (existsSync150(plansDir)) {
672504
672619
  for (const f2 of readdirSync53(plansDir).filter((p2) => p2.endsWith(".md")).slice(0, 8)) {
672505
672620
  out.push(`Plan backlog: implement .aiwg/plans/${f2}`);
672506
672621
  }
@@ -672548,7 +672663,7 @@ If decision is GO, selectedTask MUST be a fully-populated object (NEVER null)
672548
672663
  join163(this.repoRoot, ".omnius", "memory")
672549
672664
  ];
672550
672665
  for (const dir of dirs) {
672551
- if (!existsSync149(dir)) continue;
672666
+ if (!existsSync150(dir)) continue;
672552
672667
  try {
672553
672668
  const files = readdirSync53(dir).filter((f2) => f2.endsWith(".json"));
672554
672669
  for (const f2 of files) {
@@ -672563,7 +672678,7 @@ If decision is GO, selectedTask MUST be a fully-populated object (NEVER null)
672563
672678
  // ── State persistence ─────────────────────────────────────────────────
672564
672679
  loadState() {
672565
672680
  const path12 = join163(this.stateDir, "state.json");
672566
- if (existsSync149(path12)) {
672681
+ if (existsSync150(path12)) {
672567
672682
  try {
672568
672683
  this.state = JSON.parse(readFileSync122(path12, "utf-8"));
672569
672684
  } catch {
@@ -674275,7 +674390,7 @@ var init_telegram_command_menu = __esm({
674275
674390
  // packages/cli/src/tui/telegram-creative-tools.ts
674276
674391
  import { createCipheriv as createCipheriv5, createDecipheriv as createDecipheriv5, randomBytes as randomBytes26 } from "node:crypto";
674277
674392
  import {
674278
- existsSync as existsSync150,
674393
+ existsSync as existsSync151,
674279
674394
  mkdirSync as mkdirSync93,
674280
674395
  readFileSync as readFileSync123,
674281
674396
  statSync as statSync55,
@@ -674333,7 +674448,7 @@ function collectGeneratedArtifactPathsFromText(text2, root) {
674333
674448
  const value2 = match[1];
674334
674449
  if (!value2) continue;
674335
674450
  const guarded = guardPath(rootAbs, value2);
674336
- if (guarded.ok && (isManifestArtifact(rootAbs, guarded.path.rel) || existsSync150(guarded.path.abs) && safeStatFile(guarded.path.abs))) {
674451
+ if (guarded.ok && (isManifestArtifact(rootAbs, guarded.path.rel) || existsSync151(guarded.path.abs) && safeStatFile(guarded.path.abs))) {
674337
674452
  paths.add(guarded.path.abs);
674338
674453
  }
674339
674454
  }
@@ -674344,7 +674459,7 @@ function collectGeneratedArtifactPathsFromText(text2, root) {
674344
674459
  const value2 = marker?.[1]?.trim().replace(/^["']|["']$/g, "");
674345
674460
  if (!value2) continue;
674346
674461
  const guarded = guardPath(rootAbs, value2);
674347
- if (guarded.ok && (isManifestArtifact(rootAbs, guarded.path.rel) || existsSync150(guarded.path.abs) && safeStatFile(guarded.path.abs))) {
674462
+ if (guarded.ok && (isManifestArtifact(rootAbs, guarded.path.rel) || existsSync151(guarded.path.abs) && safeStatFile(guarded.path.abs))) {
674348
674463
  paths.add(guarded.path.abs);
674349
674464
  }
674350
674465
  }
@@ -674418,7 +674533,7 @@ function scopedTool(base3, root, mode) {
674418
674533
  if (output) {
674419
674534
  const guardedOutput = guardPath(rootAbs, output);
674420
674535
  if (!guardedOutput.ok) return denied(guardedOutput.error);
674421
- if (existsSync150(guardedOutput.path.abs) && !manifestHas(rootAbs, guardedOutput.path.rel)) {
674536
+ if (existsSync151(guardedOutput.path.abs) && !manifestHas(rootAbs, guardedOutput.path.rel)) {
674422
674537
  return denied(
674423
674538
  `Refusing to overwrite a file that is not owned by this chat workspace manifest: ${guardedOutput.path.rel}`
674424
674539
  );
@@ -674453,7 +674568,7 @@ function scopedTool(base3, root, mode) {
674453
674568
  const rawOutput = typeof next["output"] === "string" && String(next["output"]).trim() ? String(next["output"]) : typeof next["output_path"] === "string" && String(next["output_path"]).trim() ? String(next["output_path"]) : `tts-${Date.now()}.wav`;
674454
674569
  const guardedOutput = guardPath(rootAbs, rawOutput);
674455
674570
  if (!guardedOutput.ok) return denied(guardedOutput.error);
674456
- if (existsSync150(guardedOutput.path.abs) && !manifestHas(rootAbs, guardedOutput.path.rel)) {
674571
+ if (existsSync151(guardedOutput.path.abs) && !manifestHas(rootAbs, guardedOutput.path.rel)) {
674457
674572
  return denied(
674458
674573
  `Refusing to overwrite a file that is not owned by this chat workspace manifest: ${guardedOutput.path.rel}`
674459
674574
  );
@@ -674500,7 +674615,7 @@ function scopedTool(base3, root, mode) {
674500
674615
  `Public Telegram creative tools can only edit files created in this chat workspace: ${guarded.path.rel}`
674501
674616
  );
674502
674617
  }
674503
- if (mode === "edit" && !existsSync150(guarded.path.abs)) {
674618
+ if (mode === "edit" && !existsSync151(guarded.path.abs)) {
674504
674619
  const materialized = materializeTelegramCreativeArtifactForSend(
674505
674620
  rootAbs,
674506
674621
  guarded.path.rel
@@ -674511,7 +674626,7 @@ function scopedTool(base3, root, mode) {
674511
674626
  materialized.cleanup?.();
674512
674627
  restoredEditPath = guarded.path.abs;
674513
674628
  }
674514
- if (mode === "create" && existsSync150(guarded.path.abs) && !manifestHas(rootAbs, guarded.path.rel)) {
674629
+ if (mode === "create" && existsSync151(guarded.path.abs) && !manifestHas(rootAbs, guarded.path.rel)) {
674515
674630
  return denied(
674516
674631
  `Refusing to overwrite a file that is not owned by this chat workspace manifest: ${guarded.path.rel}`
674517
674632
  );
@@ -674615,7 +674730,7 @@ function manifestPath(root) {
674615
674730
  function ensureManifest(root) {
674616
674731
  mkdirSync93(root, { recursive: true });
674617
674732
  const path12 = manifestPath(root);
674618
- if (!existsSync150(path12)) {
674733
+ if (!existsSync151(path12)) {
674619
674734
  writeFileSync80(
674620
674735
  path12,
674621
674736
  JSON.stringify(
@@ -674671,11 +674786,11 @@ function rememberCreated(root, absPath) {
674671
674786
  const manifest = readManifest(root);
674672
674787
  const rel = guarded.path.rel.replace(/\\/g, "/");
674673
674788
  if (publicCreativeArtifactPolicyError(guarded.path.abs)) return;
674674
- if (existsSync150(guarded.path.abs) && safeStatFile(guarded.path.abs)) {
674789
+ if (existsSync151(guarded.path.abs) && safeStatFile(guarded.path.abs)) {
674675
674790
  const previous = manifest.objects?.[rel];
674676
674791
  if (previous) {
674677
674792
  const previousPath = resolve66(root, previous.storedRel);
674678
- if (isInside(resolve66(root), previousPath) && existsSync150(previousPath)) {
674793
+ if (isInside(resolve66(root), previousPath) && existsSync151(previousPath)) {
674679
674794
  try {
674680
674795
  unlinkSync31(previousPath);
674681
674796
  } catch {
@@ -674733,7 +674848,7 @@ function materializeTelegramCreativeArtifactForSend(root, rawPath) {
674733
674848
  const object = manifest.objects?.[rel];
674734
674849
  if (object) {
674735
674850
  const storedAbs = resolve66(rootAbs, object.storedRel);
674736
- if (!isInside(rootAbs, storedAbs) || !existsSync150(storedAbs) || !safeStatFile(storedAbs)) {
674851
+ if (!isInside(rootAbs, storedAbs) || !existsSync151(storedAbs) || !safeStatFile(storedAbs)) {
674737
674852
  return {
674738
674853
  ok: false,
674739
674854
  error: `Scoped artifact storage is missing for ${rel}.`
@@ -674781,7 +674896,7 @@ function materializeTelegramCreativeArtifactForSend(root, rawPath) {
674781
674896
  }
674782
674897
  };
674783
674898
  }
674784
- if (existsSync150(guarded.path.abs) && safeStatFile(guarded.path.abs)) {
674899
+ if (existsSync151(guarded.path.abs) && safeStatFile(guarded.path.abs)) {
674785
674900
  return { ok: true, path: guarded.path.abs };
674786
674901
  }
674787
674902
  return {
@@ -674985,7 +675100,7 @@ var init_telegram_creative_tools = __esm({
674985
675100
  const rawPath = typeof args["path"] === "string" && args["path"].trim() ? String(args["path"]) : `speech-${Date.now()}.wav`;
674986
675101
  const guarded = guardPath(this.root, rawPath);
674987
675102
  if (!guarded.ok) return denied(guarded.error);
674988
- if (existsSync150(guarded.path.abs) && !manifestHas(this.root, guarded.path.rel)) {
675103
+ if (existsSync151(guarded.path.abs) && !manifestHas(this.root, guarded.path.rel)) {
674989
675104
  return denied(
674990
675105
  `Refusing to overwrite a file that is not owned by this chat workspace manifest: ${guarded.path.rel}`
674991
675106
  );
@@ -675050,7 +675165,7 @@ var init_telegram_creative_tools = __esm({
675050
675165
  model: args["model"],
675051
675166
  speed: args["speed"]
675052
675167
  });
675053
- if (!result.success || !existsSync150(guarded.path.abs)) {
675168
+ if (!result.success || !existsSync151(guarded.path.abs)) {
675054
675169
  return {
675055
675170
  success: false,
675056
675171
  output: "",
@@ -675707,7 +675822,7 @@ var init_visual_object_association = __esm({
675707
675822
 
675708
675823
  // packages/cli/src/tui/telegram-channel-dmn.ts
675709
675824
  import {
675710
- existsSync as existsSync151,
675825
+ existsSync as existsSync152,
675711
675826
  mkdirSync as mkdirSync94,
675712
675827
  readdirSync as readdirSync54,
675713
675828
  readFileSync as readFileSync124,
@@ -676443,7 +676558,7 @@ function formatTelegramChannelDaydreamMetadataMarkdown(artifact) {
676443
676558
  }
676444
676559
  function pruneTelegramChannelDaydreams(repoRoot, sessionKey, keep = DAYDREAM_ARTIFACT_RETENTION_LIMIT) {
676445
676560
  const dir = sessionDir(repoRoot, sessionKey);
676446
- if (!existsSync151(dir)) return 0;
676561
+ if (!existsSync152(dir)) return 0;
676447
676562
  const files = readdirSync54(dir).filter((f2) => f2.endsWith(".json") || f2.endsWith(".md")).sort();
676448
676563
  if (files.length <= keep * 2) return 0;
676449
676564
  const toRemove = files.slice(0, files.length - keep * 2);
@@ -676474,7 +676589,7 @@ function writeTelegramChannelDaydream(repoRoot, artifact) {
676474
676589
  }
676475
676590
  function latestTelegramChannelDaydream(repoRoot, sessionKey) {
676476
676591
  const dir = sessionDir(repoRoot, sessionKey);
676477
- if (!existsSync151(dir)) return null;
676592
+ if (!existsSync152(dir)) return null;
676478
676593
  const files = readdirSync54(dir).filter((file) => file.endsWith(".json")).sort();
676479
676594
  for (const file of files.reverse()) {
676480
676595
  try {
@@ -678217,7 +678332,7 @@ __export(vision_ingress_exports, {
678217
678332
  resolveVisionModel: () => resolveVisionModel,
678218
678333
  runVisionIngress: () => runVisionIngress
678219
678334
  });
678220
- import { existsSync as existsSync152, readFileSync as readFileSync125, unlinkSync as unlinkSync33 } from "node:fs";
678335
+ import { existsSync as existsSync153, readFileSync as readFileSync125, unlinkSync as unlinkSync33 } from "node:fs";
678221
678336
  import { join as join166 } from "node:path";
678222
678337
  async function isTesseractAvailable() {
678223
678338
  try {
@@ -678252,7 +678367,7 @@ function isVisionModel(modelName) {
678252
678367
  }
678253
678368
  async function advancedOcr(imagePath) {
678254
678369
  if (!await isTesseractAvailable()) return "";
678255
- if (!existsSync152(imagePath)) return "";
678370
+ if (!existsSync153(imagePath)) return "";
678256
678371
  const tmpBase = join166(
678257
678372
  imagePath.replace(/\.[^.]+$/, ""),
678258
678373
  `_ocr_${Date.now()}`
@@ -678271,7 +678386,7 @@ async function advancedOcr(imagePath) {
678271
678386
  "eng"
678272
678387
  ], { timeout: 15e3 });
678273
678388
  const txtFile = `${outFile}.txt`;
678274
- if (existsSync152(txtFile)) {
678389
+ if (existsSync153(txtFile)) {
678275
678390
  const text2 = readFileSync125(txtFile, "utf-8").trim();
678276
678391
  if (text2.length > 0) results.push(text2);
678277
678392
  try {
@@ -678288,7 +678403,7 @@ async function advancedOcr(imagePath) {
678288
678403
  }
678289
678404
  async function queryVisionModel(modelName, imagePath, prompt = "Describe what you see in this image in detail. Include any text, UI elements, code, diagrams, or visual content.") {
678290
678405
  if (!isVisionModel(modelName)) return "";
678291
- if (!existsSync152(imagePath)) return "";
678406
+ if (!existsSync153(imagePath)) return "";
678292
678407
  try {
678293
678408
  const tool = new VisionTool(process.cwd());
678294
678409
  const result = await tool.execute({
@@ -678341,7 +678456,7 @@ function formatVisualFamiliarityContext(result) {
678341
678456
  return lines.join("\n");
678342
678457
  }
678343
678458
  async function queryVisualFamiliarity(imagePath, options2 = {}) {
678344
- if (!existsSync152(imagePath)) {
678459
+ if (!existsSync153(imagePath)) {
678345
678460
  return {
678346
678461
  attempted: false,
678347
678462
  recognizedObjects: [],
@@ -678453,7 +678568,7 @@ var init_vision_ingress = __esm({
678453
678568
  // packages/cli/src/tui/telegram-bridge.ts
678454
678569
  import {
678455
678570
  mkdirSync as mkdirSync95,
678456
- existsSync as existsSync153,
678571
+ existsSync as existsSync154,
678457
678572
  unlinkSync as unlinkSync34,
678458
678573
  readdirSync as readdirSync55,
678459
678574
  statSync as statSync56,
@@ -683445,7 +683560,7 @@ Model: <code>${escapeTelegramHTML(model.id)}</code>`
683445
683560
  }
683446
683561
  let sent = 0;
683447
683562
  for (const path12 of paths) {
683448
- if (!existsSync153(path12) || !statSync56(path12).isFile()) continue;
683563
+ if (!existsSync154(path12) || !statSync56(path12).isFile()) continue;
683449
683564
  const kind = classifyMedia(path12) ?? "document";
683450
683565
  const messageId = await this.sendMediaReference(
683451
683566
  msg.chatId,
@@ -684602,7 +684717,7 @@ ${mediaContext}` : ""
684602
684717
  if (this.loadedConversationState.has(sessionKey)) return;
684603
684718
  this.loadedConversationState.add(sessionKey);
684604
684719
  const path12 = this.telegramConversationPath(sessionKey);
684605
- if (!existsSync153(path12)) return;
684720
+ if (!existsSync154(path12)) return;
684606
684721
  try {
684607
684722
  const parsed = JSON.parse(readFileSync126(path12, "utf8"));
684608
684723
  const loadedHistory = Array.isArray(parsed.history) ? parsed.history : [];
@@ -684812,7 +684927,7 @@ ${mediaContext}` : ""
684812
684927
  ensureAllTelegramConversationsLoaded() {
684813
684928
  if (this.loadedAllConversationState) return;
684814
684929
  this.loadedAllConversationState = true;
684815
- if (!existsSync153(this.telegramConversationDir)) return;
684930
+ if (!existsSync154(this.telegramConversationDir)) return;
684816
684931
  const sessionsNeedingFlush = [];
684817
684932
  try {
684818
684933
  for (const file of readdirSync55(this.telegramConversationDir)) {
@@ -685716,7 +685831,7 @@ ${mediaContext}` : ""
685716
685831
  });
685717
685832
  if (matchingEntry) return { ok: true, path: matchingEntry.localPath };
685718
685833
  const creativeCandidate = isAbsolute14(raw) ? resolve67(raw) : resolve67(creativeRoot, raw);
685719
- if (isPathInside(creativeRoot, creativeCandidate) && existsSync153(creativeCandidate)) {
685834
+ if (isPathInside(creativeRoot, creativeCandidate) && existsSync154(creativeCandidate)) {
685720
685835
  return { ok: true, path: creativeCandidate };
685721
685836
  }
685722
685837
  return {
@@ -686381,7 +686496,7 @@ ${lines.join("\n")}`;
686381
686496
  if (!this.repoRoot) return "";
686382
686497
  if (interactiveInlineProjectMemoryBlocked()) return "";
686383
686498
  const paths = omniusMemoryDbPaths(this.repoRoot);
686384
- if (!existsSync153(paths.episodes)) return "";
686499
+ if (!existsSync154(paths.episodes)) return "";
686385
686500
  let episodes = [];
686386
686501
  const graph = new TemporalGraph(paths.knowledge);
686387
686502
  const store2 = new EpisodeStore(paths.episodes, graph);
@@ -686760,7 +686875,7 @@ ${lines.join("\n")}`;
686760
686875
  if (!this.repoRoot || !query.trim()) return [];
686761
686876
  if (interactiveInlineProjectMemoryBlocked()) return [];
686762
686877
  const paths = omniusMemoryDbPaths(this.repoRoot);
686763
- if (!existsSync153(paths.episodes)) return [];
686878
+ if (!existsSync154(paths.episodes)) return [];
686764
686879
  const graph = new TemporalGraph(paths.knowledge);
686765
686880
  const store2 = new EpisodeStore(paths.episodes, graph);
686766
686881
  try {
@@ -686821,7 +686936,7 @@ ${lines.join("\n")}`;
686821
686936
  if (this.repoRoot && chatId !== void 0) {
686822
686937
  try {
686823
686938
  const memDir = resolve67(this.repoRoot, ".omnius", "memory");
686824
- if (existsSync153(memDir)) {
686939
+ if (existsSync154(memDir)) {
686825
686940
  const prefix = this.telegramScopedMemoryPrefix(chatId);
686826
686941
  for (const file of readdirSync55(memDir)) {
686827
686942
  if (file.endsWith(".json") && file.startsWith(prefix)) topicCount++;
@@ -689503,7 +689618,7 @@ ${TELEGRAM_PUBLIC_ORCHESTRATOR_CONTRACT}`
689503
689618
  claimTelegramOwnerLock(lockDir, botUserId, botUsername) {
689504
689619
  mkdirSync95(lockDir, { recursive: true });
689505
689620
  const lockFile = join167(lockDir, `bot-${botUserId}.owner.lock`);
689506
- if (existsSync153(lockFile)) {
689621
+ if (existsSync154(lockFile)) {
689507
689622
  try {
689508
689623
  const prior = JSON.parse(readFileSync126(lockFile, "utf8"));
689509
689624
  const priorAlive = typeof prior.pid === "number" && prior.pid !== process.pid ? this.processIsAlive(prior.pid) : false;
@@ -689536,7 +689651,7 @@ ${TELEGRAM_PUBLIC_ORCHESTRATOR_CONTRACT}`
689536
689651
  }
689537
689652
  releaseTelegramOwnerLock(lockFile) {
689538
689653
  try {
689539
- if (!existsSync153(lockFile)) return;
689654
+ if (!existsSync154(lockFile)) return;
689540
689655
  try {
689541
689656
  const prior = JSON.parse(readFileSync126(lockFile, "utf8"));
689542
689657
  if (prior.pid !== process.pid) return;
@@ -695772,7 +695887,7 @@ ${knownList}` : "Private-user telegram_send_file target must be this DM or a kno
695772
695887
  return { ...materialized, logicalPath };
695773
695888
  }
695774
695889
  const abs = isAbsolute14(trimmed) ? resolve67(trimmed) : resolve67(base3, trimmed);
695775
- if (!existsSync153(abs))
695890
+ if (!existsSync154(abs))
695776
695891
  return { ok: false, error: `File does not exist: ${trimmed}` };
695777
695892
  if (!statSync56(abs).isFile())
695778
695893
  return { ok: false, error: `Path is not a file: ${trimmed}` };
@@ -695871,7 +695986,7 @@ ${knownList}` : "Private-user telegram_send_file target must be this DM or a kno
695871
695986
  const safeCaption = caption ? ` — caption: ${telegramContextJsonString(caption, 220)}` : "";
695872
695987
  const cacheKey = `${String(msg.chatId)}:${String(sourceMessageId ?? 0)}:${fileUniqueId}`;
695873
695988
  const existingEntry = this.mediaCache.get(cacheKey);
695874
- let cacheEntry = existingEntry && existsSync153(existingEntry.localPath) ? existingEntry : void 0;
695989
+ let cacheEntry = existingEntry && existsSync154(existingEntry.localPath) ? existingEntry : void 0;
695875
695990
  let localPath = cacheEntry?.localPath;
695876
695991
  if (cacheEntry) {
695877
695992
  cacheEntry.cachedAt = Date.now();
@@ -696288,7 +696403,7 @@ ${text2}`.trim()
696288
696403
  }
696289
696404
  async sendTelegramFileToChat(chatId, path12, options2) {
696290
696405
  const abs = resolve67(path12);
696291
- if (!existsSync153(abs) || !statSync56(abs).isFile()) {
696406
+ if (!existsSync154(abs) || !statSync56(abs).isFile()) {
696292
696407
  throw new Error(`File does not exist or is not a regular file: ${path12}`);
696293
696408
  }
696294
696409
  return this.sendMediaReferenceStrict(
@@ -696328,7 +696443,7 @@ ${text2}`.trim()
696328
696443
  this.state.messagesSent++;
696329
696444
  return result2.result?.message_id ?? null;
696330
696445
  }
696331
- if (!existsSync153(media.value))
696446
+ if (!existsSync154(media.value))
696332
696447
  throw new Error(`File does not exist: ${media.value}`);
696333
696448
  const buffer2 = readFileSync126(media.value);
696334
696449
  const boundary = `----omnius-media-${Date.now()}-${Math.random().toString(36).slice(2)}`;
@@ -696442,7 +696557,7 @@ Content-Type: ${contentType}\r
696442
696557
  }
696443
696558
  readGeneratedImagePromptInfo(imagePath) {
696444
696559
  const sidecarPath2 = `${imagePath}.json`;
696445
- if (!existsSync153(sidecarPath2)) return null;
696560
+ if (!existsSync154(sidecarPath2)) return null;
696446
696561
  try {
696447
696562
  const raw = readFileSync126(sidecarPath2, "utf8");
696448
696563
  const parsed = JSON.parse(raw);
@@ -696502,7 +696617,7 @@ Content-Type: ${contentType}\r
696502
696617
  }
696503
696618
  readGeneratedVideoPromptInfo(videoPath) {
696504
696619
  const sidecarPath2 = `${videoPath}.json`;
696505
- if (!existsSync153(sidecarPath2)) return null;
696620
+ if (!existsSync154(sidecarPath2)) return null;
696506
696621
  try {
696507
696622
  const raw = readFileSync126(sidecarPath2, "utf8");
696508
696623
  const parsed = JSON.parse(raw);
@@ -696558,7 +696673,7 @@ Content-Type: ${contentType}\r
696558
696673
  for (const path12 of paths) {
696559
696674
  const abs = resolve67(path12);
696560
696675
  if (subAgent.deliveredArtifacts.includes(abs)) continue;
696561
- if (!existsSync153(abs) || !statSync56(abs).isFile()) continue;
696676
+ if (!existsSync154(abs) || !statSync56(abs).isFile()) continue;
696562
696677
  subAgent.deliveredArtifacts.push(abs);
696563
696678
  await this.sendMediaReference(
696564
696679
  msg.chatId,
@@ -696600,7 +696715,7 @@ Content-Type: ${contentType}\r
696600
696715
  abs
696601
696716
  );
696602
696717
  if (!materialized.ok) continue;
696603
- if (!existsSync153(materialized.path) || !statSync56(materialized.path).isFile()) {
696718
+ if (!existsSync154(materialized.path) || !statSync56(materialized.path).isFile()) {
696604
696719
  materialized.cleanup?.();
696605
696720
  continue;
696606
696721
  }
@@ -696645,7 +696760,7 @@ Content-Type: ${contentType}\r
696645
696760
  addField(name10, value2);
696646
696761
  }
696647
696762
  for (const [field, pathOrFileId] of Object.entries(files)) {
696648
- if (!existsSync153(pathOrFileId)) {
696763
+ if (!existsSync154(pathOrFileId)) {
696649
696764
  addField(field, pathOrFileId);
696650
696765
  continue;
696651
696766
  }
@@ -696837,7 +696952,7 @@ Content-Type: ${mimeForPath(pathOrFileId, field === "photo" ? "image" : "video")
696837
696952
  return result.result?.message_id ?? null;
696838
696953
  }
696839
696954
  async sendLivePhoto(chatId, livePhoto, photo, options2 = {}) {
696840
- if (!existsSync153(livePhoto) && !existsSync153(photo)) {
696955
+ if (!existsSync154(livePhoto) && !existsSync154(photo)) {
696841
696956
  const result2 = await this.apiCall("sendLivePhoto", {
696842
696957
  chat_id: chatId,
696843
696958
  live_photo: livePhoto,
@@ -698721,13 +698836,13 @@ __export(projects_exports, {
698721
698836
  setCurrentProject: () => setCurrentProject,
698722
698837
  unregisterProject: () => unregisterProject
698723
698838
  });
698724
- import { readFileSync as readFileSync127, writeFileSync as writeFileSync83, mkdirSync as mkdirSync96, existsSync as existsSync154, statSync as statSync57, renameSync as renameSync14 } from "node:fs";
698839
+ import { readFileSync as readFileSync127, writeFileSync as writeFileSync83, mkdirSync as mkdirSync96, existsSync as existsSync155, statSync as statSync57, renameSync as renameSync14 } from "node:fs";
698725
698840
  import { homedir as homedir56 } from "node:os";
698726
698841
  import { basename as basename40, join as join168, resolve as resolve68 } from "node:path";
698727
698842
  import { randomUUID as randomUUID19 } from "node:crypto";
698728
698843
  function readAll2() {
698729
698844
  try {
698730
- if (!existsSync154(PROJECTS_FILE)) return { projects: [], schemaVersion: 1 };
698845
+ if (!existsSync155(PROJECTS_FILE)) return { projects: [], schemaVersion: 1 };
698731
698846
  const raw = readFileSync127(PROJECTS_FILE, "utf8");
698732
698847
  const parsed = JSON.parse(raw);
698733
698848
  if (!parsed || !Array.isArray(parsed.projects)) return { projects: [], schemaVersion: 1 };
@@ -698804,7 +698919,7 @@ function renameProject(root, name10) {
698804
698919
  function getCurrentProject() {
698805
698920
  if (!currentRoot) {
698806
698921
  try {
698807
- if (existsSync154(CURRENT_FILE)) {
698922
+ if (existsSync155(CURRENT_FILE)) {
698808
698923
  const persisted = readFileSync127(CURRENT_FILE, "utf8").trim();
698809
698924
  if (persisted) currentRoot = persisted;
698810
698925
  }
@@ -699719,7 +699834,7 @@ var init_access_policy = __esm({
699719
699834
 
699720
699835
  // packages/cli/src/api/project-preferences.ts
699721
699836
  import { createHash as createHash43 } from "node:crypto";
699722
- import { existsSync as existsSync155, mkdirSync as mkdirSync97, readFileSync as readFileSync128, renameSync as renameSync15, writeFileSync as writeFileSync84, unlinkSync as unlinkSync35 } from "node:fs";
699837
+ import { existsSync as existsSync156, mkdirSync as mkdirSync97, readFileSync as readFileSync128, renameSync as renameSync15, writeFileSync as writeFileSync84, unlinkSync as unlinkSync35 } from "node:fs";
699723
699838
  import { homedir as homedir57 } from "node:os";
699724
699839
  import { join as join169, resolve as resolve69 } from "node:path";
699725
699840
  import { randomUUID as randomUUID20 } from "node:crypto";
@@ -699741,7 +699856,7 @@ function ensureDir(root) {
699741
699856
  mkdirSync97(dir, { recursive: true });
699742
699857
  const sentinel = rootSentinelPath(root);
699743
699858
  try {
699744
- if (!existsSync155(sentinel)) {
699859
+ if (!existsSync156(sentinel)) {
699745
699860
  writeFileSync84(sentinel, `${resolve69(root)}
699746
699861
  `, "utf8");
699747
699862
  }
@@ -699751,7 +699866,7 @@ function ensureDir(root) {
699751
699866
  function readProjectPreferences(root) {
699752
699867
  try {
699753
699868
  const file = prefsPath(root);
699754
- if (!existsSync155(file)) return { ...DEFAULT_PREFS };
699869
+ if (!existsSync156(file)) return { ...DEFAULT_PREFS };
699755
699870
  const raw = readFileSync128(file, "utf8");
699756
699871
  const parsed = JSON.parse(raw);
699757
699872
  if (!parsed || parsed.v !== SCHEMA_VERSION) return { ...DEFAULT_PREFS };
@@ -699790,7 +699905,7 @@ function writeProjectPreferences(root, partial) {
699790
699905
  function deleteProjectPreferences(root) {
699791
699906
  try {
699792
699907
  const file = prefsPath(root);
699793
- if (!existsSync155(file)) return false;
699908
+ if (!existsSync156(file)) return false;
699794
699909
  unlinkSync35(file);
699795
699910
  return true;
699796
699911
  } catch {
@@ -699819,7 +699934,7 @@ __export(audit_log_exports, {
699819
699934
  recordAudit: () => recordAudit,
699820
699935
  sanitizeBody: () => sanitizeBody
699821
699936
  });
699822
- import { mkdirSync as mkdirSync98, appendFileSync as appendFileSync19, readFileSync as readFileSync129, existsSync as existsSync156 } from "node:fs";
699937
+ import { mkdirSync as mkdirSync98, appendFileSync as appendFileSync19, readFileSync as readFileSync129, existsSync as existsSync157 } from "node:fs";
699823
699938
  import { join as join170 } from "node:path";
699824
699939
  function initAuditLog(omniusDir) {
699825
699940
  auditDir = join170(omniusDir, "audit");
@@ -699854,7 +699969,7 @@ function sanitizeBody(body, maxLen = 200) {
699854
699969
  return safe.length > maxLen ? safe.slice(0, maxLen) + "..." : safe;
699855
699970
  }
699856
699971
  function queryAudit(opts) {
699857
- if (!initialized || !existsSync156(auditFile)) return [];
699972
+ if (!initialized || !existsSync157(auditFile)) return [];
699858
699973
  try {
699859
699974
  const raw = readFileSync129(auditFile, "utf-8");
699860
699975
  const lines = raw.split("\n").filter(Boolean);
@@ -699893,7 +700008,7 @@ var init_audit_log = __esm({
699893
700008
 
699894
700009
  // packages/cli/src/api/disk-task-output.ts
699895
700010
  import { open } from "node:fs/promises";
699896
- import { existsSync as existsSync157, mkdirSync as mkdirSync99, statSync as statSync58 } from "node:fs";
700011
+ import { existsSync as existsSync158, mkdirSync as mkdirSync99, statSync as statSync58 } from "node:fs";
699897
700012
  import { dirname as dirname51 } from "node:path";
699898
700013
  import * as fsConstants from "node:constants";
699899
700014
  var O_NOFOLLOW2, O_APPEND2, O_CREAT2, O_WRONLY2, OPEN_FLAGS_WRITE, OPEN_MODE, DiskTaskOutput;
@@ -699989,7 +700104,7 @@ var init_disk_task_output = __esm({
699989
700104
  async readFrom(offset, limit = 65536) {
699990
700105
  let handle2 = null;
699991
700106
  try {
699992
- if (!existsSync157(this.path)) {
700107
+ if (!existsSync158(this.path)) {
699993
700108
  return { content: "", nextOffset: offset, eof: true, size: 0 };
699994
700109
  }
699995
700110
  const st = statSync58(this.path);
@@ -700180,7 +700295,7 @@ data: ${JSON.stringify(ev)}
700180
700295
  });
700181
700296
 
700182
700297
  // packages/cli/src/api/routes-media.ts
700183
- import { existsSync as existsSync158, mkdirSync as mkdirSync100, statSync as statSync59, copyFileSync as copyFileSync7, createReadStream } from "node:fs";
700298
+ import { existsSync as existsSync159, mkdirSync as mkdirSync100, statSync as statSync59, copyFileSync as copyFileSync7, createReadStream } from "node:fs";
700184
700299
  import { basename as basename41, join as join171, resolve as pathResolve2 } from "node:path";
700185
700300
  function mediaWorkDir() {
700186
700301
  return join171(omniusHomeDir(), "media", "_work");
@@ -700209,7 +700324,7 @@ function publishToGallery(srcPath, kind) {
700209
700324
  if (pathResolve2(srcPath) !== pathResolve2(dest)) {
700210
700325
  copyFileSync7(srcPath, dest);
700211
700326
  try {
700212
- if (existsSync158(`${srcPath}.json`)) copyFileSync7(`${srcPath}.json`, `${dest}.json`);
700327
+ if (existsSync159(`${srcPath}.json`)) copyFileSync7(`${srcPath}.json`, `${dest}.json`);
700213
700328
  } catch {
700214
700329
  }
700215
700330
  }
@@ -700391,7 +700506,7 @@ async function handleAvAnalyze(ctx3) {
700391
700506
  return true;
700392
700507
  }
700393
700508
  const filePath = raw.startsWith("file://") ? raw.slice(7) : raw;
700394
- if (!existsSync158(filePath)) {
700509
+ if (!existsSync159(filePath)) {
700395
700510
  sendProblem(ctx3.res, problemDetails({ type: P.notFound, status: 404, title: "Media not found", detail: filePath, instance: ctx3.requestId }));
700396
700511
  return true;
700397
700512
  }
@@ -700468,7 +700583,7 @@ async function runGeneration(ctx3, kind, buildTool, buildArgs) {
700468
700583
  return true;
700469
700584
  }
700470
700585
  const srcPath = extractGeneratedPath(result.output);
700471
- if (!srcPath || !existsSync158(srcPath)) {
700586
+ if (!srcPath || !existsSync159(srcPath)) {
700472
700587
  sendProblem(ctx3.res, problemDetails({
700473
700588
  type: P.upstreamFailure,
700474
700589
  status: 502,
@@ -700575,7 +700690,7 @@ function handleFile(ctx3) {
700575
700690
  }
700576
700691
  const dir = globalMediaDir(kind);
700577
700692
  const full = pathResolve2(dir, basename41(name10));
700578
- if (!full.startsWith(pathResolve2(dir)) || !existsSync158(full)) {
700693
+ if (!full.startsWith(pathResolve2(dir)) || !existsSync159(full)) {
700579
700694
  sendProblem(ctx3.res, problemDetails({
700580
700695
  type: P.notFound,
700581
700696
  status: 404,
@@ -700829,14 +700944,14 @@ var init_direct_tool_registry = __esm({
700829
700944
  });
700830
700945
 
700831
700946
  // packages/cli/src/api/external-tool-registry.ts
700832
- import { existsSync as existsSync159, mkdirSync as mkdirSync101, readFileSync as readFileSync130, writeFileSync as writeFileSync85, renameSync as renameSync16 } from "node:fs";
700947
+ import { existsSync as existsSync160, mkdirSync as mkdirSync101, readFileSync as readFileSync130, writeFileSync as writeFileSync85, renameSync as renameSync16 } from "node:fs";
700833
700948
  import { join as join172 } from "node:path";
700834
700949
  function externalToolStorePath(workingDir) {
700835
700950
  return join172(workingDir, ".omnius", "external-tools.json");
700836
700951
  }
700837
700952
  function loadExternalTools(workingDir) {
700838
700953
  const path12 = externalToolStorePath(workingDir);
700839
- if (!existsSync159(path12)) return [];
700954
+ if (!existsSync160(path12)) return [];
700840
700955
  try {
700841
700956
  const parsed = JSON.parse(readFileSync130(path12, "utf-8"));
700842
700957
  if (!parsed || !Array.isArray(parsed.tools)) return [];
@@ -701177,19 +701292,19 @@ __export(aiwg_exports, {
701177
701292
  resolveAiwgRoot: () => resolveAiwgRoot,
701178
701293
  tryRouteAiwg: () => tryRouteAiwg
701179
701294
  });
701180
- import { existsSync as existsSync160, readFileSync as readFileSync131, readdirSync as readdirSync56, statSync as statSync60 } from "node:fs";
701295
+ import { existsSync as existsSync161, readFileSync as readFileSync131, readdirSync as readdirSync56, statSync as statSync60 } from "node:fs";
701181
701296
  import { join as join173 } from "node:path";
701182
701297
  import { homedir as homedir58 } from "node:os";
701183
701298
  import { execSync as execSync38 } from "node:child_process";
701184
701299
  function resolveAiwgRoot() {
701185
701300
  if (_cachedAiwgRoot !== void 0) return _cachedAiwgRoot;
701186
701301
  const envRoot = process.env["OMNIUS_AIWG_ROOT"];
701187
- if (envRoot && existsSync160(join173(envRoot, "package.json"))) {
701302
+ if (envRoot && existsSync161(join173(envRoot, "package.json"))) {
701188
701303
  _cachedAiwgRoot = envRoot;
701189
701304
  return envRoot;
701190
701305
  }
701191
701306
  const shareDir = join173(homedir58(), ".local", "share", "ai-writing-guide");
701192
- if (existsSync160(join173(shareDir, "agentic"))) {
701307
+ if (existsSync161(join173(shareDir, "agentic"))) {
701193
701308
  _cachedAiwgRoot = shareDir;
701194
701309
  return shareDir;
701195
701310
  }
@@ -701200,7 +701315,7 @@ function resolveAiwgRoot() {
701200
701315
  stdio: ["pipe", "pipe", "pipe"]
701201
701316
  }).trim();
701202
701317
  const candidate = join173(globalRoot, "aiwg");
701203
- if (existsSync160(join173(candidate, "package.json"))) {
701318
+ if (existsSync161(join173(candidate, "package.json"))) {
701204
701319
  _cachedAiwgRoot = candidate;
701205
701320
  return candidate;
701206
701321
  }
@@ -701211,7 +701326,7 @@ function resolveAiwgRoot() {
701211
701326
  "/usr/lib/node_modules/aiwg",
701212
701327
  "/opt/homebrew/lib/node_modules/aiwg"
701213
701328
  ]) {
701214
- if (existsSync160(join173(p2, "package.json"))) {
701329
+ if (existsSync161(join173(p2, "package.json"))) {
701215
701330
  _cachedAiwgRoot = p2;
701216
701331
  return p2;
701217
701332
  }
@@ -701221,12 +701336,12 @@ function resolveAiwgRoot() {
701221
701336
  join173(homedir58(), ".local", "share", "fnm", "node-versions")
701222
701337
  ];
701223
701338
  for (const vdir of versionDirs) {
701224
- if (!existsSync160(vdir)) continue;
701339
+ if (!existsSync161(vdir)) continue;
701225
701340
  try {
701226
701341
  for (const ver of readdirSync56(vdir)) {
701227
701342
  for (const prefix of ["lib/node_modules/aiwg", "installation/lib/node_modules/aiwg"]) {
701228
701343
  const cand = join173(vdir, ver, prefix);
701229
- if (existsSync160(join173(cand, "package.json"))) {
701344
+ if (existsSync161(join173(cand, "package.json"))) {
701230
701345
  _cachedAiwgRoot = cand;
701231
701346
  return cand;
701232
701347
  }
@@ -701246,7 +701361,7 @@ function resolveAiwgRoot() {
701246
701361
  for (let i2 = 0; i2 < 8; i2++) {
701247
701362
  cur = join173(cur, "..");
701248
701363
  const pj = join173(cur, "package.json");
701249
- if (existsSync160(pj)) {
701364
+ if (existsSync161(pj)) {
701250
701365
  try {
701251
701366
  const pkg = JSON.parse(readFileSync131(pj, "utf-8"));
701252
701367
  if (pkg.name === "aiwg") {
@@ -701271,7 +701386,7 @@ function listAiwgFrameworks() {
701271
701386
  return _cachedFrameworks;
701272
701387
  }
701273
701388
  const frameworksDir = join173(root, "agentic", "code", "frameworks");
701274
- if (!existsSync160(frameworksDir)) {
701389
+ if (!existsSync161(frameworksDir)) {
701275
701390
  _cachedFrameworks = [];
701276
701391
  return _cachedFrameworks;
701277
701392
  }
@@ -701336,7 +701451,7 @@ function aggregateDir(dir, depth = 0) {
701336
701451
  function readFirstLineDescription(dir) {
701337
701452
  for (const candidate of ["README.md", "SKILL.md", "INDEX.md"]) {
701338
701453
  const p2 = join173(dir, candidate);
701339
- if (!existsSync160(p2)) continue;
701454
+ if (!existsSync161(p2)) continue;
701340
701455
  try {
701341
701456
  const txt = readFileSync131(p2, "utf-8");
701342
701457
  const descMatch = txt.match(/^description:\s*(.+)$/m);
@@ -701365,7 +701480,7 @@ function listAiwgItems() {
701365
701480
  join173(root, "plugins")
701366
701481
  ];
701367
701482
  for (const wr of walkRoots) {
701368
- if (!existsSync160(wr)) continue;
701483
+ if (!existsSync161(wr)) continue;
701369
701484
  walkForItems(wr, out, 0);
701370
701485
  }
701371
701486
  _cachedItems = out;
@@ -701427,7 +701542,7 @@ function deriveSource(p2) {
701427
701542
  }
701428
701543
  function loadAiwgItemContent(path12, maxBytes = 2e4) {
701429
701544
  try {
701430
- if (!existsSync160(path12)) return null;
701545
+ if (!existsSync161(path12)) return null;
701431
701546
  const raw = readFileSync131(path12, "utf-8");
701432
701547
  return raw.length > maxBytes ? raw.slice(0, maxBytes) + "\n\n...(truncated for context budget)" : raw;
701433
701548
  } catch {
@@ -701442,7 +701557,7 @@ function listAiwgAddons() {
701442
701557
  return _cachedAddons;
701443
701558
  }
701444
701559
  const addonsDir = join173(root, "agentic", "code", "addons");
701445
- if (!existsSync160(addonsDir)) {
701560
+ if (!existsSync161(addonsDir)) {
701446
701561
  _cachedAddons = [];
701447
701562
  return _cachedAddons;
701448
701563
  }
@@ -701964,16 +702079,16 @@ __export(runtime_keys_exports, {
701964
702079
  mintKey: () => mintKey,
701965
702080
  revokeByPrefix: () => revokeByPrefix
701966
702081
  });
701967
- import { existsSync as existsSync161, readFileSync as readFileSync132, writeFileSync as writeFileSync86, mkdirSync as mkdirSync102, chmodSync as chmodSync5 } from "node:fs";
702082
+ import { existsSync as existsSync162, readFileSync as readFileSync132, writeFileSync as writeFileSync86, mkdirSync as mkdirSync102, chmodSync as chmodSync5 } from "node:fs";
701968
702083
  import { join as join174 } from "node:path";
701969
702084
  import { homedir as homedir59 } from "node:os";
701970
702085
  import { randomBytes as randomBytes28 } from "node:crypto";
701971
702086
  function ensureDir2() {
701972
702087
  const dir = join174(homedir59(), ".omnius");
701973
- if (!existsSync161(dir)) mkdirSync102(dir, { recursive: true });
702088
+ if (!existsSync162(dir)) mkdirSync102(dir, { recursive: true });
701974
702089
  }
701975
702090
  function loadAll() {
701976
- if (!existsSync161(KEYS_FILE)) return [];
702091
+ if (!existsSync162(KEYS_FILE)) return [];
701977
702092
  try {
701978
702093
  const raw = readFileSync132(KEYS_FILE, "utf-8");
701979
702094
  const parsed = JSON.parse(raw);
@@ -702061,7 +702176,7 @@ __export(tor_fallback_exports, {
702061
702176
  torIsReachable: () => torIsReachable,
702062
702177
  tunnelViaTor: () => tunnelViaTor
702063
702178
  });
702064
- import { existsSync as existsSync162, readFileSync as readFileSync133 } from "node:fs";
702179
+ import { existsSync as existsSync163, readFileSync as readFileSync133 } from "node:fs";
702065
702180
  import { homedir as homedir60 } from "node:os";
702066
702181
  import { join as join175 } from "node:path";
702067
702182
  import { createConnection as createConnection3 } from "node:net";
@@ -702073,7 +702188,7 @@ function getLocalOnion() {
702073
702188
  ];
702074
702189
  for (const p2 of candidates) {
702075
702190
  try {
702076
- if (existsSync162(p2)) {
702191
+ if (existsSync163(p2)) {
702077
702192
  const v = readFileSync133(p2, "utf-8").trim();
702078
702193
  if (v && v.endsWith(".onion")) return v;
702079
702194
  }
@@ -702219,7 +702334,7 @@ __export(graphical_sudo_exports, {
702219
702334
  runGraphicalSudo: () => runGraphicalSudo
702220
702335
  });
702221
702336
  import { spawn as spawn36 } from "node:child_process";
702222
- import { existsSync as existsSync163, mkdirSync as mkdirSync103, writeFileSync as writeFileSync87, chmodSync as chmodSync6 } from "node:fs";
702337
+ import { existsSync as existsSync164, mkdirSync as mkdirSync103, writeFileSync as writeFileSync87, chmodSync as chmodSync6 } from "node:fs";
702223
702338
  import { join as join176 } from "node:path";
702224
702339
  import { tmpdir as tmpdir24 } from "node:os";
702225
702340
  function detectSudoHelper() {
@@ -702237,7 +702352,7 @@ function which2(cmd) {
702237
702352
  for (const dir of path12.split(":")) {
702238
702353
  if (!dir) continue;
702239
702354
  const full = join176(dir, cmd);
702240
- if (existsSync163(full)) return full;
702355
+ if (existsSync164(full)) return full;
702241
702356
  }
702242
702357
  return null;
702243
702358
  }
@@ -702335,7 +702450,7 @@ var init_graphical_sudo = __esm({
702335
702450
  });
702336
702451
 
702337
702452
  // packages/cli/src/api/routes-v1.ts
702338
- import { existsSync as existsSync164, mkdirSync as mkdirSync104, readFileSync as readFileSync134, readdirSync as readdirSync57, statSync as statSync61 } from "node:fs";
702453
+ import { existsSync as existsSync165, mkdirSync as mkdirSync104, readFileSync as readFileSync134, readdirSync as readdirSync57, statSync as statSync61 } from "node:fs";
702339
702454
  import { join as join177, resolve as pathResolve3 } from "node:path";
702340
702455
  import { homedir as homedir61 } from "node:os";
702341
702456
  async function tryRouteV1(ctx3) {
@@ -702603,7 +702718,7 @@ async function fallbackDiscoverSkills() {
702603
702718
  ];
702604
702719
  const out = [];
702605
702720
  for (const root of roots) {
702606
- if (!existsSync164(root)) continue;
702721
+ if (!existsSync165(root)) continue;
702607
702722
  walkForSkills(root, out, 0);
702608
702723
  }
702609
702724
  return out;
@@ -703543,7 +703658,7 @@ async function handleFilesRead(ctx3) {
703543
703658
  }));
703544
703659
  return true;
703545
703660
  }
703546
- if (!existsSync164(resolved)) {
703661
+ if (!existsSync165(resolved)) {
703547
703662
  sendProblem(res, problemDetails({
703548
703663
  type: P2.notFound,
703549
703664
  status: 404,
@@ -703875,7 +703990,7 @@ async function handleNexusStatus(ctx3) {
703875
703990
  ];
703876
703991
  const states2 = [];
703877
703992
  for (const p2 of statePaths) {
703878
- if (!existsSync164(p2)) continue;
703993
+ if (!existsSync165(p2)) continue;
703879
703994
  try {
703880
703995
  const raw = readFileSync134(p2, "utf-8");
703881
703996
  states2.push({ source: p2, data: JSON.parse(raw) });
@@ -703905,7 +704020,7 @@ async function handleNexusStatus(ctx3) {
703905
704020
  function loadAgentName() {
703906
704021
  try {
703907
704022
  const p2 = join177(homedir61(), ".omnius", "agent-name");
703908
- if (existsSync164(p2)) return readFileSync134(p2, "utf-8").trim();
704023
+ if (existsSync165(p2)) return readFileSync134(p2, "utf-8").trim();
703909
704024
  } catch {
703910
704025
  }
703911
704026
  return null;
@@ -703919,7 +704034,7 @@ async function handleSponsors(ctx3) {
703919
704034
  ];
703920
704035
  let sponsors = [];
703921
704036
  for (const p2 of candidates) {
703922
- if (!existsSync164(p2)) continue;
704037
+ if (!existsSync165(p2)) continue;
703923
704038
  try {
703924
704039
  const raw = JSON.parse(readFileSync134(p2, "utf-8"));
703925
704040
  if (Array.isArray(raw)) {
@@ -703991,7 +704106,7 @@ async function handleEvaluate(ctx3) {
703991
704106
  return true;
703992
704107
  }
703993
704108
  const jobPath = join177(process.cwd(), ".omnius", "jobs", `${runId}.json`);
703994
- if (!existsSync164(jobPath)) {
704109
+ if (!existsSync165(jobPath)) {
703995
704110
  sendProblem(res, problemDetails({
703996
704111
  type: P2.notFound,
703997
704112
  status: 404,
@@ -704139,7 +704254,7 @@ async function handleMintKey(ctx3) {
704139
704254
  return true;
704140
704255
  }
704141
704256
  function _readStatusFile(p2) {
704142
- if (!existsSync164(p2)) return null;
704257
+ if (!existsSync165(p2)) return null;
704143
704258
  try {
704144
704259
  const data = JSON.parse(readFileSync134(p2, "utf-8"));
704145
704260
  if (data?.connected && typeof data.peerId === "string" && data.peerId.length > 10) {
@@ -704183,7 +704298,7 @@ function resolveLocalPeerId() {
704183
704298
  }
704184
704299
  try {
704185
704300
  const regPath = join177(homedir61(), ".omnius", "nexus-registry.json");
704186
- if (existsSync164(regPath)) {
704301
+ if (existsSync165(regPath)) {
704187
704302
  const reg = JSON.parse(readFileSync134(regPath, "utf-8"));
704188
704303
  const entries = Array.isArray(reg?.dirs) ? reg.dirs : [];
704189
704304
  for (const entry of entries) {
@@ -704231,13 +704346,13 @@ function locateTorScript(filename) {
704231
704346
  join177(process.cwd(), "scripts", "tor", filename)
704232
704347
  ];
704233
704348
  for (const p2 of candidates) {
704234
- if (existsSync164(p2)) return p2;
704349
+ if (existsSync165(p2)) return p2;
704235
704350
  }
704236
704351
  try {
704237
704352
  const { execSync: execSync41 } = __require("node:child_process");
704238
704353
  const root = execSync41("npm root -g", { encoding: "utf-8", timeout: 5e3 }).trim();
704239
704354
  const p2 = join177(root, "omnius", "dist", "scripts", "tor", filename);
704240
- if (existsSync164(p2)) return p2;
704355
+ if (existsSync165(p2)) return p2;
704241
704356
  } catch {
704242
704357
  }
704243
704358
  return null;
@@ -704517,7 +704632,7 @@ async function handleRemoteProxy(ctx3) {
704517
704632
  ];
704518
704633
  let nexusDirPath = null;
704519
704634
  for (const p2 of nexusCandidates) {
704520
- if (existsSync164(join177(p2, "status.json"))) {
704635
+ if (existsSync165(join177(p2, "status.json"))) {
704521
704636
  nexusDirPath = p2;
704522
704637
  break;
704523
704638
  }
@@ -705697,7 +705812,7 @@ function aimsDir() {
705697
705812
  function readAimsFile(name10, fallback) {
705698
705813
  try {
705699
705814
  const p2 = join177(aimsDir(), name10);
705700
- if (existsSync164(p2)) return JSON.parse(readFileSync134(p2, "utf-8"));
705815
+ if (existsSync165(p2)) return JSON.parse(readFileSync134(p2, "utf-8"));
705701
705816
  } catch {
705702
705817
  }
705703
705818
  return fallback;
@@ -706072,7 +706187,7 @@ async function handleAimsSuppliers(ctx3) {
706072
706187
  join177(homedir61(), ".omnius", "sponsor-cache.json")
706073
706188
  ];
706074
706189
  for (const p2 of sponsorPaths) {
706075
- if (!existsSync164(p2)) continue;
706190
+ if (!existsSync165(p2)) continue;
706076
706191
  try {
706077
706192
  const raw = JSON.parse(readFileSync134(p2, "utf-8"));
706078
706193
  const list = Array.isArray(raw) ? raw : raw?.sponsors ?? [];
@@ -718030,14 +718145,14 @@ var init_auth_oidc = __esm({
718030
718145
  });
718031
718146
 
718032
718147
  // packages/cli/src/api/usage-tracker.ts
718033
- import { mkdirSync as mkdirSync105, readFileSync as readFileSync135, writeFileSync as writeFileSync88, existsSync as existsSync165 } from "node:fs";
718148
+ import { mkdirSync as mkdirSync105, readFileSync as readFileSync135, writeFileSync as writeFileSync88, existsSync as existsSync166 } from "node:fs";
718034
718149
  import { join as join178 } from "node:path";
718035
718150
  function initUsageTracker(omniusDir) {
718036
718151
  const dir = join178(omniusDir, "usage");
718037
718152
  mkdirSync105(dir, { recursive: true });
718038
718153
  usageFile = join178(dir, "token-usage.json");
718039
718154
  try {
718040
- if (existsSync165(usageFile)) {
718155
+ if (existsSync166(usageFile)) {
718041
718156
  store = JSON.parse(readFileSync135(usageFile, "utf-8"));
718042
718157
  }
718043
718158
  } catch {
@@ -718249,7 +718364,7 @@ var init_chat_followup = __esm({
718249
718364
 
718250
718365
  // packages/cli/src/docker.ts
718251
718366
  import { execSync as execSync39, spawn as spawn37 } from "node:child_process";
718252
- import { existsSync as existsSync166, mkdirSync as mkdirSync106, writeFileSync as writeFileSync89 } from "node:fs";
718367
+ import { existsSync as existsSync167, mkdirSync as mkdirSync106, writeFileSync as writeFileSync89 } from "node:fs";
718253
718368
  import { join as join179, resolve as resolve70, dirname as dirname52 } from "node:path";
718254
718369
  import { homedir as homedir62 } from "node:os";
718255
718370
  import { fileURLToPath as fileURLToPath22 } from "node:url";
@@ -718396,7 +718511,7 @@ async function ensureOmniusImage(force = false) {
718396
718511
  }
718397
718512
  let buildContext;
718398
718513
  const dockerDir = getDockerDir();
718399
- if (existsSync166(join179(dockerDir, "Dockerfile"))) {
718514
+ if (existsSync167(join179(dockerDir, "Dockerfile"))) {
718400
718515
  buildContext = dockerDir;
718401
718516
  } else {
718402
718517
  buildContext = join179(homedir62(), ".omnius", "docker-build");
@@ -718739,7 +718854,7 @@ import {
718739
718854
  writeFileSync as writeFileSync90,
718740
718855
  readFileSync as readFileSync136,
718741
718856
  readdirSync as readdirSync58,
718742
- existsSync as existsSync167,
718857
+ existsSync as existsSync168,
718743
718858
  watch as fsWatch4,
718744
718859
  renameSync as renameSync17,
718745
718860
  unlinkSync as unlinkSync36,
@@ -718768,7 +718883,7 @@ function getVersion3() {
718768
718883
  ];
718769
718884
  for (const pkgPath of candidates) {
718770
718885
  try {
718771
- if (!existsSync167(pkgPath)) continue;
718886
+ if (!existsSync168(pkgPath)) continue;
718772
718887
  const pkg = JSON.parse(readFileSync136(pkgPath, "utf8"));
718773
718888
  if (pkg.name === "omnius" || pkg.name === "@omnius/cli" || pkg.name === "@omnius/monorepo") {
718774
718889
  return pkg.version ?? "0.0.0";
@@ -719184,7 +719299,7 @@ function isOriginAllowed(origin) {
719184
719299
  let accessMode = (process.env["OMNIUS_ACCESS"] || "").toLowerCase().trim();
719185
719300
  try {
719186
719301
  const accessFile = join181(homedir63(), ".omnius", "access");
719187
- if (existsSync167(accessFile)) {
719302
+ if (existsSync168(accessFile)) {
719188
719303
  const persisted = readFileSync136(accessFile, "utf8").trim().toLowerCase();
719189
719304
  if (persisted === "any" || persisted === "lan" || persisted === "loopback") {
719190
719305
  accessMode = persisted;
@@ -720035,7 +720150,7 @@ function jobsDir() {
720035
720150
  }
720036
720151
  function loadJob(id2) {
720037
720152
  const file = join181(jobsDir(), `${id2}.json`);
720038
- if (!existsSync167(file)) return null;
720153
+ if (!existsSync168(file)) return null;
720039
720154
  try {
720040
720155
  return JSON.parse(readFileSync136(file, "utf-8"));
720041
720156
  } catch {
@@ -720044,7 +720159,7 @@ function loadJob(id2) {
720044
720159
  }
720045
720160
  function listJobs2() {
720046
720161
  const dir = jobsDir();
720047
- if (!existsSync167(dir)) return [];
720162
+ if (!existsSync168(dir)) return [];
720048
720163
  const files = readdirSync58(dir).filter((f2) => f2.endsWith(".json")).sort();
720049
720164
  const jobs = [];
720050
720165
  for (const file of files) {
@@ -720061,7 +720176,7 @@ function pruneOldJobs() {
720061
720176
  const retentionH = parseFloat(process.env["OMNIUS_RUN_RETENTION_H"] || "24");
720062
720177
  const cutoffMs = Date.now() - (Number.isFinite(retentionH) && retentionH > 0 ? retentionH : 24) * 36e5;
720063
720178
  const dir = jobsDir();
720064
- if (!existsSync167(dir)) return { pruned: 0, kept: 0 };
720179
+ if (!existsSync168(dir)) return { pruned: 0, kept: 0 };
720065
720180
  let pruned = 0;
720066
720181
  let kept = 0;
720067
720182
  for (const file of readdirSync58(dir)) {
@@ -720081,7 +720196,7 @@ function pruneOldJobs() {
720081
720196
  } catch {
720082
720197
  }
720083
720198
  const outFile = path12.replace(/\.json$/, ".output");
720084
- if (existsSync167(outFile)) {
720199
+ if (existsSync168(outFile)) {
720085
720200
  try {
720086
720201
  unlinkSync36(outFile);
720087
720202
  } catch {
@@ -722223,7 +722338,7 @@ function updateLogPath() {
722223
722338
  function readUpdateState() {
722224
722339
  try {
722225
722340
  const p2 = updateStateFile();
722226
- if (!existsSync167(p2)) return null;
722341
+ if (!existsSync168(p2)) return null;
722227
722342
  return JSON.parse(readFileSync136(p2, "utf-8"));
722228
722343
  } catch {
722229
722344
  return null;
@@ -722284,7 +722399,7 @@ async function handleV1Update(req3, res, requestId) {
722284
722399
  const isWin2 = process.platform === "win32";
722285
722400
  let npmBin = "";
722286
722401
  for (const candidate of isWin2 ? [join181(nodeDir, "npm.cmd"), join181(nodeDir, "npm")] : [join181(nodeDir, "npm"), "/usr/local/bin/npm", "/usr/bin/npm"]) {
722287
- if (existsSync167(candidate)) {
722402
+ if (existsSync168(candidate)) {
722288
722403
  npmBin = candidate;
722289
722404
  break;
722290
722405
  }
@@ -722328,7 +722443,7 @@ async function handleV1Update(req3, res, requestId) {
722328
722443
  let npmCli = "";
722329
722444
  for (const c9 of npmCliCandidates) {
722330
722445
  try {
722331
- if (existsSync167(c9)) {
722446
+ if (existsSync168(c9)) {
722332
722447
  npmCli = c9;
722333
722448
  break;
722334
722449
  }
@@ -722388,7 +722503,7 @@ async function handleV1Update(req3, res, requestId) {
722388
722503
  let npmCli = "";
722389
722504
  for (const c9 of npmCliCandidates) {
722390
722505
  try {
722391
- if (existsSync167(c9)) {
722506
+ if (existsSync168(c9)) {
722392
722507
  npmCli = c9;
722393
722508
  break;
722394
722509
  }
@@ -722528,7 +722643,7 @@ function handleV1UpdateStatus(res) {
722528
722643
  let logTail = "";
722529
722644
  let exitCode = null;
722530
722645
  try {
722531
- if (existsSync167(logPath3)) {
722646
+ if (existsSync168(logPath3)) {
722532
722647
  const raw = readFileSync136(logPath3, "utf-8");
722533
722648
  const m2 = raw.match(/__EXIT_CODE=(\d+)/);
722534
722649
  if (m2) exitCode = parseInt(m2[1], 10);
@@ -723115,7 +723230,7 @@ function handleV1RunsById(res, id2) {
723115
723230
  }
723116
723231
  const outputFile = job.outputFile;
723117
723232
  const enriched = { ...job };
723118
- if (outputFile && existsSync167(outputFile)) {
723233
+ if (outputFile && existsSync168(outputFile)) {
723119
723234
  try {
723120
723235
  const size = statSync62(outputFile).size;
723121
723236
  const tailSize = Math.min(size, 4096);
@@ -724087,7 +724202,7 @@ async function handleRequest(req3, res, ollamaUrl, verbose, runtimeDefaults = {}
724087
724202
  }
724088
724203
  try {
724089
724204
  const target = resolve71(rawPath);
724090
- if (!existsSync167(target)) {
724205
+ if (!existsSync168(target)) {
724091
724206
  jsonResponse(res, 404, { error: "File not found", path: target });
724092
724207
  return;
724093
724208
  }
@@ -727762,7 +727877,7 @@ function startApiServer(options2 = {}) {
727762
727877
  const fp = join181(dir, fname);
727763
727878
  let next = [];
727764
727879
  try {
727765
- if (!existsSync167(fp)) {
727880
+ if (!existsSync168(fp)) {
727766
727881
  const old = cache8.get(sid);
727767
727882
  if (old) {
727768
727883
  for (const t2 of old.values()) {
@@ -727836,7 +727951,7 @@ function startApiServer(options2 = {}) {
727836
727951
  if (!apiTestMode && retentionDays > 0) {
727837
727952
  try {
727838
727953
  const jobsDir3 = join181(cwd4, ".omnius", "jobs");
727839
- if (existsSync167(jobsDir3)) {
727954
+ if (existsSync168(jobsDir3)) {
727840
727955
  const cutoff = Date.now() - retentionDays * 864e5;
727841
727956
  for (const f2 of readdirSync58(jobsDir3)) {
727842
727957
  if (!f2.endsWith(".json")) continue;
@@ -727877,7 +727992,7 @@ function startApiServer(options2 = {}) {
727877
727992
  let runtimeAccessMode = resolveAccessMode(process.env["OMNIUS_ACCESS"], host);
727878
727993
  try {
727879
727994
  const accessFile = join181(homedir63(), ".omnius", "access");
727880
- if (existsSync167(accessFile)) {
727995
+ if (existsSync168(accessFile)) {
727881
727996
  const persisted = readFileSync136(accessFile, "utf8").trim();
727882
727997
  const resolved = resolveAccessMode(persisted, host);
727883
727998
  if (resolved) runtimeAccessMode = resolved;
@@ -728308,7 +728423,7 @@ function startApiServer(options2 = {}) {
728308
728423
  const here = dirname53(fileURLToPath23(import.meta.url));
728309
728424
  for (const rel of ["../package.json", "../../package.json", "../../../package.json", "../../../../package.json"]) {
728310
728425
  const p2 = join181(here, rel);
728311
- if (existsSync167(p2)) {
728426
+ if (existsSync168(p2)) {
728312
728427
  const pkg = JSON.parse(readFileSync136(p2, "utf8"));
728313
728428
  if (pkg.name === "omnius" || pkg.name === "@omnius/cli" || pkg.name === "@omnius/monorepo") {
728314
728429
  return pkg.version ?? null;
@@ -729410,7 +729525,7 @@ import {
729410
729525
  statSync as statSync63,
729411
729526
  mkdirSync as mkdirSync109
729412
729527
  } from "node:fs";
729413
- import { existsSync as existsSync168 } from "node:fs";
729528
+ import { existsSync as existsSync169 } from "node:fs";
729414
729529
  import {
729415
729530
  readFile as readFileAsync2,
729416
729531
  writeFile as writeFileAsync2,
@@ -729465,7 +729580,7 @@ function getVersion4() {
729465
729580
  join183(thisDir, "..", "..", "..", "package.json")
729466
729581
  ];
729467
729582
  for (const pkgPath of candidates) {
729468
- if (existsSync168(pkgPath)) {
729583
+ if (existsSync169(pkgPath)) {
729469
729584
  const pkg = require5(pkgPath);
729470
729585
  if (pkg.name === "omnius" || pkg.name === "@omnius/cli" || pkg.name === "@omnius/monorepo") {
729471
729586
  return pkg.version ?? "0.0.0";
@@ -730880,7 +730995,7 @@ function gatherMemorySnippets(root) {
730880
730995
  join183(root, ".omnius", "memory")
730881
730996
  ];
730882
730997
  for (const dir of dirs) {
730883
- if (!existsSync168(dir)) continue;
730998
+ if (!existsSync169(dir)) continue;
730884
730999
  try {
730885
731000
  for (const f2 of readdirSync59(dir).filter((f3) => f3.endsWith(".json"))) {
730886
731001
  const data = JSON.parse(readFileSync138(join183(dir, f2), "utf-8"));
@@ -731354,7 +731469,7 @@ ${metabolismMemories}
731354
731469
  if (!realtimeEnabled)
731355
731470
  try {
731356
731471
  const archeFile = join183(repoRoot, ".omnius", "arche", "variants.json");
731357
- if (existsSync168(archeFile)) {
731472
+ if (existsSync169(archeFile)) {
731358
731473
  const variants = JSON.parse(readFileSync138(archeFile, "utf8"));
731359
731474
  if (variants.length > 0) {
731360
731475
  let filtered = variants;
@@ -731545,7 +731660,7 @@ ${skillPack}`;
731545
731660
  "identity",
731546
731661
  "self-state.json"
731547
731662
  );
731548
- if (existsSync168(ikStateFile)) {
731663
+ if (existsSync169(ikStateFile)) {
731549
731664
  const selfState = JSON.parse(readFileSync138(ikStateFile, "utf8"));
731550
731665
  const lines = [
731551
731666
  `[Identity State v${selfState.version}]`,
@@ -731885,10 +732000,10 @@ Review its full output via sub_agent(action='output', id='${id2}')`
731885
732000
  }
731886
732001
  }
731887
732002
  try {
731888
- const { readdirSync: readdirSync61, readFileSync: readFileSync140, existsSync: existsSync171 } = await import("node:fs");
732003
+ const { readdirSync: readdirSync61, readFileSync: readFileSync140, existsSync: existsSync172 } = await import("node:fs");
731889
732004
  const { join: pathJoin } = await import("node:path");
731890
732005
  const chunksDir = pathJoin(cwd(), ".omnius", "todo-chunks");
731891
- if (existsSync171(chunksDir)) {
732006
+ if (existsSync172(chunksDir)) {
731892
732007
  const files = readdirSync61(chunksDir).filter(
731893
732008
  (f2) => f2.endsWith(".json")
731894
732009
  );
@@ -731961,11 +732076,11 @@ ${lines.join("\n")}`
731961
732076
  const expand2 = args.expand === true;
731962
732077
  if (expand2 && id2.startsWith("todo-ctx-")) {
731963
732078
  try {
731964
- const { readFileSync: readFileSync140, existsSync: existsSync171 } = await import("node:fs");
732079
+ const { readFileSync: readFileSync140, existsSync: existsSync172 } = await import("node:fs");
731965
732080
  const { join: pathJoin } = await import("node:path");
731966
732081
  const chunksDir = pathJoin(cwd(), ".omnius", "todo-chunks");
731967
732082
  const todoIdSuffix = id2.replace("todo-ctx-", "");
731968
- const files = existsSync171(chunksDir) ? (await import("node:fs")).readdirSync(chunksDir).filter((f2) => f2.endsWith(".json")) : [];
732083
+ const files = existsSync172(chunksDir) ? (await import("node:fs")).readdirSync(chunksDir).filter((f2) => f2.endsWith(".json")) : [];
731969
732084
  let chunkData = null;
731970
732085
  for (const f2 of files) {
731971
732086
  try {
@@ -732988,7 +733103,7 @@ When done, either call task_complete with your answer, or use FINAL_VAR(variable
732988
733103
  const ikDir = join183(repoRoot, ".omnius", "identity");
732989
733104
  const ikFile = join183(ikDir, "self-state.json");
732990
733105
  let ikState;
732991
- if (existsSync168(ikFile)) {
733106
+ if (existsSync169(ikFile)) {
732992
733107
  ikState = JSON.parse(await readFileAsync2(ikFile, "utf8"));
732993
733108
  } else {
732994
733109
  await mkdirAsync(ikDir, { recursive: true });
@@ -733148,7 +733263,7 @@ When done, either call task_complete with your answer, or use FINAL_VAR(variable
733148
733263
  "identity",
733149
733264
  "self-state.json"
733150
733265
  );
733151
- if (existsSync168(ikFile)) {
733266
+ if (existsSync169(ikFile)) {
733152
733267
  const ikState = JSON.parse(await readFileAsync2(ikFile, "utf8"));
733153
733268
  if (!ikState.stats) ikState.stats = { queries_served: 0 };
733154
733269
  ikState.stats.queries_served = (ikState.stats.queries_served || 0) + 1;
@@ -733475,7 +733590,7 @@ async function startInteractive(config, repoPath2) {
733475
733590
  try {
733476
733591
  const omniusDir = join183(repoRoot, ".omnius");
733477
733592
  const nexusPidFile = join183(omniusDir, "nexus", "daemon.pid");
733478
- if (existsSync168(nexusPidFile)) {
733593
+ if (existsSync169(nexusPidFile)) {
733479
733594
  const pid = parseInt(readFileSync138(nexusPidFile, "utf8").trim(), 10);
733480
733595
  if (pid > 0) {
733481
733596
  try {
@@ -734562,7 +734677,7 @@ Respond to the scoped Telegram target when complete.`
734562
734677
  const out = [];
734563
734678
  const pushJsonFiles = (dir, prefix) => {
734564
734679
  try {
734565
- if (!existsSync168(dir)) return;
734680
+ if (!existsSync169(dir)) return;
734566
734681
  for (const file of readdirSync59(dir)) {
734567
734682
  if (!file.endsWith(".json")) continue;
734568
734683
  const id2 = file.replace(/\.json$/, "");
@@ -734574,10 +734689,10 @@ Respond to the scoped Telegram target when complete.`
734574
734689
  pushJsonFiles(join183(repoRoot, ".omnius", "checkpoints"), "turn");
734575
734690
  try {
734576
734691
  const sessionDir2 = join183(repoRoot, ".omnius", "session");
734577
- if (existsSync168(sessionDir2)) {
734692
+ if (existsSync169(sessionDir2)) {
734578
734693
  for (const entry of readdirSync59(sessionDir2)) {
734579
734694
  const cp2 = join183(sessionDir2, entry, "checkpoint.json");
734580
- if (existsSync168(cp2))
734695
+ if (existsSync169(cp2))
734581
734696
  out.push({ id: `session:${entry}`, label: entry, path: cp2 });
734582
734697
  }
734583
734698
  }
@@ -734669,7 +734784,7 @@ This is an independent background session started from /background.`
734669
734784
  };
734670
734785
  try {
734671
734786
  const titleFile = join183(repoRoot, ".omnius", "session-title");
734672
- if (existsSync168(titleFile))
734787
+ if (existsSync169(titleFile))
734673
734788
  sessionTitle = readFileSync138(titleFile, "utf8").trim() || null;
734674
734789
  } catch {
734675
734790
  }
@@ -734784,7 +734899,7 @@ This is an independent background session started from /background.`
734784
734899
  const MAX_HISTORY_LINES = 500;
734785
734900
  let savedHistory = [];
734786
734901
  try {
734787
- if (existsSync168(HISTORY_FILE)) {
734902
+ if (existsSync169(HISTORY_FILE)) {
734788
734903
  const raw = readFileSync138(HISTORY_FILE, "utf8").trim();
734789
734904
  if (raw) savedHistory = raw.split("\n").reverse();
734790
734905
  }
@@ -734903,16 +735018,20 @@ This is an independent background session started from /background.`
734903
735018
  headerBtnQueue = command;
734904
735019
  return;
734905
735020
  }
735021
+ const commandToRun = command === "live" ? isLiveSensorActiveForRepo(repoRoot) ? "live stop" : "live run" : command;
734906
735022
  if (headerBtnActive && headerBtnActive !== command) {
734907
735023
  headerBtnQueue = command;
734908
735024
  return;
734909
735025
  }
734910
- if (headerBtnActive === command) return;
735026
+ if (headerBtnActive === command) {
735027
+ if (command === "live") headerBtnQueue = command;
735028
+ return;
735029
+ }
734911
735030
  headerBtnActive = command;
734912
735031
  (async () => {
734913
735032
  try {
734914
735033
  await writeContentAsync(
734915
- () => handleSlashCommand(command, commandCtxRef)
735034
+ () => handleSlashCommand(commandToRun, commandCtxRef)
734916
735035
  );
734917
735036
  } catch {
734918
735037
  }
@@ -735154,7 +735273,7 @@ This is an independent background session started from /background.`
735154
735273
  join183(repoRoot, ".omnius", "nexus", "nexus-daemon.mjs"),
735155
735274
  join183(_hdir(), ".omnius", "nexus", "nexus-daemon.mjs")
735156
735275
  ]) {
735157
- if (existsSync168(dp))
735276
+ if (existsSync169(dp))
735158
735277
  try {
735159
735278
  _rmStale(dp);
735160
735279
  } catch {
@@ -735167,7 +735286,7 @@ This is an independent background session started from /background.`
735167
735286
  const _registerNexusDaemon = () => {
735168
735287
  try {
735169
735288
  const nexusPidFile = join183(autoNexus.getNexusDir(), "daemon.pid");
735170
- if (existsSync168(nexusPidFile)) {
735289
+ if (existsSync169(nexusPidFile)) {
735171
735290
  const nPid = parseInt(
735172
735291
  readFileSync138(nexusPidFile, "utf8").trim(),
735173
735292
  10
@@ -735350,7 +735469,7 @@ Log: ${nexusLogPath}`
735350
735469
  const globalNamePath = join183(_hd(), ".omnius", "agent-name");
735351
735470
  let agName = "";
735352
735471
  try {
735353
- if (existsSync168(globalNamePath))
735472
+ if (existsSync169(globalNamePath))
735354
735473
  agName = readFileSync138(globalNamePath, "utf8").trim();
735355
735474
  } catch {
735356
735475
  }
@@ -735390,7 +735509,7 @@ Log: ${nexusLogPath}`
735390
735509
  );
735391
735510
  let savedSponsors = [];
735392
735511
  try {
735393
- if (existsSync168(savedSponsorsPath)) {
735512
+ if (existsSync169(savedSponsorsPath)) {
735394
735513
  savedSponsors = JSON.parse(
735395
735514
  readFileSync138(savedSponsorsPath, "utf8")
735396
735515
  );
@@ -737571,7 +737690,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
737571
737690
  if (!result.success) throw new Error(result.error || "Connect failed");
737572
737691
  try {
737573
737692
  const nexusPidFile = join183(nexusTool.getNexusDir(), "daemon.pid");
737574
- if (existsSync168(nexusPidFile)) {
737693
+ if (existsSync169(nexusPidFile)) {
737575
737694
  const pid = parseInt(readFileSync138(nexusPidFile, "utf8").trim(), 10);
737576
737695
  if (pid > 0) {
737577
737696
  registry2.register({
@@ -737784,7 +737903,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
737784
737903
  try {
737785
737904
  const nexusDir = join183(repoRoot, OMNIUS_DIR, "nexus");
737786
737905
  const pidFile = join183(nexusDir, "daemon.pid");
737787
- if (existsSync168(pidFile)) {
737906
+ if (existsSync169(pidFile)) {
737788
737907
  const pid = parseInt(readFileSync138(pidFile, "utf8").trim(), 10);
737789
737908
  if (pid > 0) {
737790
737909
  try {
@@ -737813,7 +737932,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
737813
737932
  const voicePidFiles = ["luxtts-daemon.pid", "piper-daemon.pid"];
737814
737933
  for (const pf of voicePidFiles) {
737815
737934
  const pidPath = join183(voiceDir3, pf);
737816
- if (existsSync168(pidPath)) {
737935
+ if (existsSync169(pidPath)) {
737817
737936
  try {
737818
737937
  const pid = parseInt(readFileSync138(pidPath, "utf8").trim(), 10);
737819
737938
  if (pid > 0) {
@@ -737837,7 +737956,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
737837
737956
  }
737838
737957
  await delay3(process.platform === "win32" ? 1e3 : 500);
737839
737958
  const omniusPath = join183(repoRoot, OMNIUS_DIR);
737840
- if (existsSync168(omniusPath)) {
737959
+ if (existsSync169(omniusPath)) {
737841
737960
  let deleted = false;
737842
737961
  for (let attempt = 0; attempt < 3; attempt++) {
737843
737962
  try {
@@ -737955,9 +738074,9 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
737955
738074
  "personaplex",
737956
738075
  "daemon.port"
737957
738076
  );
737958
- if (existsSync168(ppPidFile)) {
738077
+ if (existsSync169(ppPidFile)) {
737959
738078
  const ppPid = parseInt(readFileSync138(ppPidFile, "utf8").trim(), 10);
737960
- const ppPort = existsSync168(ppPortFile) ? parseInt(readFileSync138(ppPortFile, "utf8").trim(), 10) : void 0;
738079
+ const ppPort = existsSync169(ppPortFile) ? parseInt(readFileSync138(ppPortFile, "utf8").trim(), 10) : void 0;
737961
738080
  if (ppPid > 0 && !registry2.daemons.has("PersonaPlex")) {
737962
738081
  registry2.register({
737963
738082
  name: "PersonaPlex",
@@ -737973,7 +738092,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
737973
738092
  new NexusTool(repoRoot).getNexusDir(),
737974
738093
  "daemon.pid"
737975
738094
  );
737976
- if (existsSync168(nexusPidFile)) {
738095
+ if (existsSync169(nexusPidFile)) {
737977
738096
  const nPid = parseInt(readFileSync138(nexusPidFile, "utf8").trim(), 10);
737978
738097
  if (nPid > 0 && !registry2.daemons.has("Nexus")) {
737979
738098
  try {
@@ -738407,9 +738526,9 @@ Execute this skill now. Follow the behavioral guidance above.`;
738407
738526
  }
738408
738527
  }
738409
738528
  const cleanPath = input.replace(/^['"]|['"]$/g, "").trim();
738410
- const isImage = isImagePath(cleanPath) && existsSync168(resolve72(repoRoot, cleanPath));
738411
- const isMedia = !isImage && isTranscribablePath(cleanPath) && existsSync168(resolve72(repoRoot, cleanPath));
738412
- const isMarkdown = !isImage && !isMedia && /\.(md|markdown)$/i.test(cleanPath) && existsSync168(resolve72(repoRoot, cleanPath));
738529
+ const isImage = isImagePath(cleanPath) && existsSync169(resolve72(repoRoot, cleanPath));
738530
+ const isMedia = !isImage && isTranscribablePath(cleanPath) && existsSync169(resolve72(repoRoot, cleanPath));
738531
+ const isMarkdown = !isImage && !isMedia && /\.(md|markdown)$/i.test(cleanPath) && existsSync169(resolve72(repoRoot, cleanPath));
738413
738532
  if (activeTask) {
738414
738533
  if ((isImage || isMedia) && activeTask.runner.isPaused) {
738415
738534
  activeTask.runner.resume();
@@ -739348,7 +739467,7 @@ async function runWithTUI(task, config, repoPath2, callbacks) {
739348
739467
  const ikDir = join183(repoRoot, ".omnius", "identity");
739349
739468
  const ikFile = join183(ikDir, "self-state.json");
739350
739469
  let ikState;
739351
- if (existsSync168(ikFile)) {
739470
+ if (existsSync169(ikFile)) {
739352
739471
  ikState = JSON.parse(readFileSync138(ikFile, "utf8"));
739353
739472
  } else {
739354
739473
  mkdirSync109(ikDir, { recursive: true });
@@ -739421,7 +739540,7 @@ async function runWithTUI(task, config, repoPath2, callbacks) {
739421
739540
  const archeFile = join183(archeDir, "variants.json");
739422
739541
  let variants = [];
739423
739542
  try {
739424
- if (existsSync168(archeFile))
739543
+ if (existsSync169(archeFile))
739425
739544
  variants = JSON.parse(readFileSync138(archeFile, "utf8"));
739426
739545
  } catch {
739427
739546
  }
@@ -739449,7 +739568,7 @@ async function runWithTUI(task, config, repoPath2, callbacks) {
739449
739568
  "metabolism",
739450
739569
  "store.json"
739451
739570
  );
739452
- if (existsSync168(metaFile2)) {
739571
+ if (existsSync169(metaFile2)) {
739453
739572
  const store2 = JSON.parse(readFileSync138(metaFile2, "utf8"));
739454
739573
  const surfaced = store2.filter(
739455
739574
  (m2) => m2.type !== "quarantine" && m2.scores?.confidence > 0.15
@@ -739552,7 +739671,7 @@ Rules:
739552
739671
  const storeFile = join183(metaDir, "store.json");
739553
739672
  let store2 = [];
739554
739673
  try {
739555
- if (existsSync168(storeFile))
739674
+ if (existsSync169(storeFile))
739556
739675
  store2 = JSON.parse(readFileSync138(storeFile, "utf8"));
739557
739676
  } catch {
739558
739677
  }
@@ -739586,7 +739705,7 @@ Rules:
739586
739705
  const cohereSettingsFile = join183(repoRoot, ".omnius", "settings.json");
739587
739706
  let cohereActive = false;
739588
739707
  try {
739589
- if (existsSync168(cohereSettingsFile)) {
739708
+ if (existsSync169(cohereSettingsFile)) {
739590
739709
  const settings = JSON.parse(readFileSync138(cohereSettingsFile, "utf8"));
739591
739710
  cohereActive = settings.cohere === true;
739592
739711
  }
@@ -739600,7 +739719,7 @@ Rules:
739600
739719
  "metabolism",
739601
739720
  "store.json"
739602
739721
  );
739603
- if (existsSync168(metaFile2)) {
739722
+ if (existsSync169(metaFile2)) {
739604
739723
  const store2 = JSON.parse(readFileSync138(metaFile2, "utf8"));
739605
739724
  const latest = store2.filter(
739606
739725
  (m2) => m2.sourceTrace === "trajectory-extraction" || m2.sourceTrace === "llm-trajectory-extraction"
@@ -739633,7 +739752,7 @@ Rules:
739633
739752
  }
739634
739753
  try {
739635
739754
  const ikFile = join183(repoRoot, ".omnius", "identity", "self-state.json");
739636
- if (existsSync168(ikFile)) {
739755
+ if (existsSync169(ikFile)) {
739637
739756
  const ikState = JSON.parse(readFileSync138(ikFile, "utf8"));
739638
739757
  ikState.homeostasis.uncertainty = Math.min(
739639
739758
  1,
@@ -739654,7 +739773,7 @@ Rules:
739654
739773
  "metabolism",
739655
739774
  "store.json"
739656
739775
  );
739657
- if (existsSync168(metaFile2)) {
739776
+ if (existsSync169(metaFile2)) {
739658
739777
  const store2 = JSON.parse(readFileSync138(metaFile2, "utf8"));
739659
739778
  const surfaced = store2.filter(
739660
739779
  (m2) => m2.type !== "quarantine" && m2.scores?.confidence > 0.15
@@ -739680,7 +739799,7 @@ Rules:
739680
739799
  const archeFile = join183(archeDir, "variants.json");
739681
739800
  let variants = [];
739682
739801
  try {
739683
- if (existsSync168(archeFile))
739802
+ if (existsSync169(archeFile))
739684
739803
  variants = JSON.parse(readFileSync138(archeFile, "utf8"));
739685
739804
  } catch {
739686
739805
  }
@@ -739822,7 +739941,7 @@ import {
739822
739941
  writeFileSync as writeFileSync93,
739823
739942
  readFileSync as readFileSync139,
739824
739943
  readdirSync as readdirSync60,
739825
- existsSync as existsSync169
739944
+ existsSync as existsSync170
739826
739945
  } from "node:fs";
739827
739946
  import { randomBytes as randomBytes30 } from "node:crypto";
739828
739947
  import { join as join184 } from "node:path";
@@ -740023,7 +740142,7 @@ async function runBackground(task, config, opts) {
740023
740142
  function statusCommand(jobId, repoPath2) {
740024
740143
  const dir = jobsDir2(repoPath2);
740025
740144
  const file = join184(dir, `${jobId}.json`);
740026
- if (!existsSync169(file)) {
740145
+ if (!existsSync170(file)) {
740027
740146
  console.error(`Job not found: ${jobId}`);
740028
740147
  console.log(`Available jobs: omnius jobs`);
740029
740148
  process.exit(1);
@@ -740077,13 +740196,13 @@ __export(index_repo_exports, {
740077
740196
  indexRepoCommand: () => indexRepoCommand
740078
740197
  });
740079
740198
  import { resolve as resolve74 } from "node:path";
740080
- import { existsSync as existsSync170, statSync as statSync64 } from "node:fs";
740199
+ import { existsSync as existsSync171, statSync as statSync64 } from "node:fs";
740081
740200
  import { cwd as cwd2 } from "node:process";
740082
740201
  async function indexRepoCommand(opts, _config3) {
740083
740202
  const repoRoot = resolve74(opts.repoPath ?? cwd2());
740084
740203
  printHeader("Index Repository");
740085
740204
  printInfo(`Indexing: ${repoRoot}`);
740086
- if (!existsSync170(repoRoot)) {
740205
+ if (!existsSync171(repoRoot)) {
740087
740206
  printError(`Path does not exist: ${repoRoot}`);
740088
740207
  process.exit(1);
740089
740208
  }