omnius 1.0.551 → 1.0.553

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
@@ -1875,12 +1875,12 @@ var init_model_broker = __esm({
1875
1875
  // packages/execution/dist/broker-mediated-backend.js
1876
1876
  function wrapWithBroker(backend, options2) {
1877
1877
  const broker = getModelBroker();
1878
- const clamp11 = options2.clampNumCtx !== false;
1878
+ const clamp12 = options2.clampNumCtx !== false;
1879
1879
  const wrapped = Object.create(backend);
1880
1880
  wrapped.chatCompletion = async (request) => {
1881
1881
  const model = backend.model || request.model || "unknown";
1882
1882
  let effectiveRequest = request;
1883
- if (clamp11) {
1883
+ if (clamp12) {
1884
1884
  const trainCtx = await broker.getNctxTrain(model).catch(() => null);
1885
1885
  const requestedNumCtx = request.numCtx;
1886
1886
  if (trainCtx && trainCtx > 0) {
@@ -1914,7 +1914,7 @@ function wrapWithBroker(backend, options2) {
1914
1914
  wrapped.chatCompletionStream = async function* (request) {
1915
1915
  const model = backend.model || request.model || "unknown";
1916
1916
  let effectiveRequest = request;
1917
- if (clamp11) {
1917
+ if (clamp12) {
1918
1918
  const trainCtx = await broker.getNctxTrain(model).catch(() => null);
1919
1919
  const requestedNumCtx = request.numCtx;
1920
1920
  if (trainCtx && trainCtx > 0) {
@@ -3043,9 +3043,9 @@ function isExecutableToolClass(value2) {
3043
3043
  }
3044
3044
  function probeToolClass(className, ToolClass, cwd4, now2, ttlMs) {
3045
3045
  const cacheKey = `${className}:${cwd4}`;
3046
- const cached = probeCache.get(cacheKey);
3047
- if (cached && cached.expiresAt > now2) {
3048
- return { result: cached.result, cached: true, checkedAt: cached.checkedAt };
3046
+ const cached2 = probeCache.get(cacheKey);
3047
+ if (cached2 && cached2.expiresAt > now2) {
3048
+ return { result: cached2.result, cached: true, checkedAt: cached2.checkedAt };
3049
3049
  }
3050
3050
  const checkedAt = new Date(now2).toISOString();
3051
3051
  const result = instantiateForMetadata(ToolClass, cwd4);
@@ -3770,9 +3770,9 @@ function runInstall(installCmd) {
3770
3770
  });
3771
3771
  }
3772
3772
  function ensureCommand(command) {
3773
- const cached = _cache.get(command);
3774
- if (cached)
3775
- return cached;
3773
+ const cached2 = _cache.get(command);
3774
+ if (cached2)
3775
+ return cached2;
3776
3776
  if (hasCommand(command)) {
3777
3777
  const result2 = { available: true, installed: false };
3778
3778
  _cache.set(command, result2);
@@ -5961,7 +5961,7 @@ function summarizeMessagesAsPrompt(messages2) {
5961
5961
  const HEAD_KEEP = 2;
5962
5962
  const TAIL_KEEP = 6;
5963
5963
  const HEAD_BYTES = 6e3;
5964
- const TAIL_BYTES = 2e3;
5964
+ const TAIL_BYTES2 = 2e3;
5965
5965
  const MIDDLE_BYTES = 150;
5966
5966
  const TOTAL_CAP = 16e3;
5967
5967
  const stringify2 = (content) => {
@@ -6005,7 +6005,7 @@ function summarizeMessagesAsPrompt(messages2) {
6005
6005
  } else if (isTail) {
6006
6006
  if (!append(tag))
6007
6007
  break;
6008
- if (!append(content.slice(0, TAIL_BYTES)))
6008
+ if (!append(content.slice(0, TAIL_BYTES2)))
6009
6009
  break;
6010
6010
  if (!append(""))
6011
6011
  break;
@@ -7528,11 +7528,11 @@ var init_web_fetch = __esm({
7528
7528
  const url = args["url"];
7529
7529
  const maxLength = args["max_length"] ?? DEFAULT_MAX_LENGTH;
7530
7530
  const start2 = performance.now();
7531
- const cached = this._fetchCache.get(url);
7532
- if (cached && Date.now() - cached.fetchedAt < CACHE_TTL_MS) {
7533
- const slicedCache = cached.text.length > maxLength ? `${cached.text.slice(0, maxLength)}
7531
+ const cached2 = this._fetchCache.get(url);
7532
+ if (cached2 && Date.now() - cached2.fetchedAt < CACHE_TTL_MS) {
7533
+ const slicedCache = cached2.text.length > maxLength ? `${cached2.text.slice(0, maxLength)}
7534
7534
 
7535
- [Content truncated to ${maxLength} characters]` : cached.text;
7535
+ [Content truncated to ${maxLength} characters]` : cached2.text;
7536
7536
  return {
7537
7537
  success: true,
7538
7538
  output: `[CACHED — already fetched this URL in this session; the content below is the full response. Do NOT re-fetch the same URL. If the content seems short, the page may just be short or require JavaScript — use browser_action with a headless browser instead.]
@@ -37748,11 +37748,11 @@ ${failures.join("\n")}`;
37748
37748
  nodePaths.push(globalDir2);
37749
37749
  } catch {
37750
37750
  }
37751
- const { openSync: openSync7, closeSync: closeSync7 } = await import("node:fs");
37751
+ const { openSync: openSync8, closeSync: closeSync8 } = await import("node:fs");
37752
37752
  const daemonLogPath = join33(this.nexusDir, "daemon.log");
37753
37753
  const daemonErrPath = join33(this.nexusDir, "daemon.err");
37754
- const outFd = openSync7(daemonLogPath, "w");
37755
- const errFd = openSync7(daemonErrPath, "w");
37754
+ const outFd = openSync8(daemonLogPath, "w");
37755
+ const errFd = openSync8(daemonErrPath, "w");
37756
37756
  const leaseId = newProcessLeaseId("nexus");
37757
37757
  const ownerId = `nexus:${agentName}`;
37758
37758
  const child = spawn5("node", [daemonPath, this.nexusDir, agentName, agentType], {
@@ -37785,11 +37785,11 @@ ${failures.join("\n")}`;
37785
37785
  }
37786
37786
  child.unref();
37787
37787
  try {
37788
- closeSync7(outFd);
37788
+ closeSync8(outFd);
37789
37789
  } catch {
37790
37790
  }
37791
37791
  try {
37792
- closeSync7(errFd);
37792
+ closeSync8(errFd);
37793
37793
  } catch {
37794
37794
  }
37795
37795
  const statusFile = join33(this.nexusDir, "status.json");
@@ -48344,12 +48344,12 @@ var init_cache = __esm({
48344
48344
  let foundAllAnswers = true;
48345
48345
  const answers = [];
48346
48346
  for (const type of types2) {
48347
- const cached = this.getAnswers(fqdn, type);
48348
- if (cached.length === 0) {
48347
+ const cached2 = this.getAnswers(fqdn, type);
48348
+ if (cached2.length === 0) {
48349
48349
  foundAllAnswers = false;
48350
48350
  break;
48351
48351
  }
48352
- answers.push(...cached);
48352
+ answers.push(...cached2);
48353
48353
  }
48354
48354
  if (foundAllAnswers) {
48355
48355
  return toDNSResponse({ answers });
@@ -48434,10 +48434,10 @@ var init_dns = __esm({
48434
48434
  */
48435
48435
  async query(domain, options2 = {}) {
48436
48436
  const types2 = getTypes(options2.types);
48437
- const cached = options2.cached !== false ? this.cache.get(domain, types2) : void 0;
48438
- if (cached != null) {
48439
- options2.onProgress?.(new CustomProgressEvent("dns:cache", cached));
48440
- return cached;
48437
+ const cached2 = options2.cached !== false ? this.cache.get(domain, types2) : void 0;
48438
+ if (cached2 != null) {
48439
+ options2.onProgress?.(new CustomProgressEvent("dns:cache", cached2));
48440
+ return cached2;
48441
48441
  }
48442
48442
  const tld = `${domain.split(".").pop()}.`;
48443
48443
  const resolvers3 = (this.resolvers[tld] ?? this.resolvers["."]).sort(() => {
@@ -84928,11 +84928,11 @@ var init_keychain = __esm({
84928
84928
  let pem;
84929
84929
  try {
84930
84930
  kid = await keyId(key);
84931
- const cached = privates.get(this);
84932
- if (cached == null) {
84931
+ const cached2 = privates.get(this);
84932
+ if (cached2 == null) {
84933
84933
  throw new InvalidParametersError("dek missing");
84934
84934
  }
84935
- const dek = cached.dek;
84935
+ const dek = cached2.dek;
84936
84936
  pem = await exportPrivateKey(key, dek, key.type === "RSA" ? "pkcs-8" : "libp2p-key");
84937
84937
  } catch (err) {
84938
84938
  await randomDelay();
@@ -84957,11 +84957,11 @@ var init_keychain = __esm({
84957
84957
  try {
84958
84958
  const res = await this.components.datastore.get(datastoreName);
84959
84959
  const pem = toString2(res);
84960
- const cached = privates.get(this);
84961
- if (cached == null) {
84960
+ const cached2 = privates.get(this);
84961
+ if (cached2 == null) {
84962
84962
  throw new InvalidParametersError("dek missing");
84963
84963
  }
84964
- const dek = cached.dek;
84964
+ const dek = cached2.dek;
84965
84965
  return await importPrivateKey(pem, dek);
84966
84966
  } catch (err) {
84967
84967
  await randomDelay();
@@ -85055,11 +85055,11 @@ var init_keychain = __esm({
85055
85055
  throw new InvalidParametersError(`Invalid pass length ${newPass.length}`);
85056
85056
  }
85057
85057
  this.log("recreating keychain");
85058
- const cached = privates.get(this);
85059
- if (cached == null) {
85058
+ const cached2 = privates.get(this);
85059
+ if (cached2 == null) {
85060
85060
  throw new InvalidParametersError("dek missing");
85061
85061
  }
85062
- const oldDek = cached.dek;
85062
+ const oldDek = cached2.dek;
85063
85063
  this.init.pass = newPass;
85064
85064
  const newDek = newPass != null && this.init.dek?.salt != null ? pbkdf22(newPass, this.init.dek.salt, this.init.dek?.iterationCount, this.init.dek?.keyLength, this.init.dek?.hash) : "";
85065
85065
  privates.set(this, { dek: newDek });
@@ -283941,9 +283941,9 @@ function getMediaCapability(opts = {}) {
283941
283941
  const file = cachePath();
283942
283942
  if (!opts.force && existsSync45(file)) {
283943
283943
  try {
283944
- const cached = JSON.parse(readFileSync34(file, "utf8"));
283945
- if (cached.probedAt && Date.now() - new Date(cached.probedAt).getTime() < CACHE_TTL_MS2) {
283946
- return cached;
283944
+ const cached2 = JSON.parse(readFileSync34(file, "utf8"));
283945
+ if (cached2.probedAt && Date.now() - new Date(cached2.probedAt).getTime() < CACHE_TTL_MS2) {
283946
+ return cached2;
283947
283947
  }
283948
283948
  } catch {
283949
283949
  }
@@ -356980,8 +356980,8 @@ ${lanes.join("\n")}
356980
356980
  return emptyArray;
356981
356981
  }
356982
356982
  const cache8 = (_a2 = host.getModuleSpecifierCache) == null ? void 0 : _a2.call(host);
356983
- const cached = cache8 == null ? void 0 : cache8.get(importingSourceFile.path, moduleSourceFile.path, userPreferences, options2);
356984
- return [cached == null ? void 0 : cached.kind, cached == null ? void 0 : cached.moduleSpecifiers, moduleSourceFile, cached == null ? void 0 : cached.modulePaths, cache8];
356983
+ const cached2 = cache8 == null ? void 0 : cache8.get(importingSourceFile.path, moduleSourceFile.path, userPreferences, options2);
356984
+ return [cached2 == null ? void 0 : cached2.kind, cached2 == null ? void 0 : cached2.moduleSpecifiers, moduleSourceFile, cached2 == null ? void 0 : cached2.modulePaths, cache8];
356985
356985
  }
356986
356986
  function getModuleSpecifiers(moduleSymbol, checker, compilerOptions, importingSourceFile, host, userPreferences, options2 = {}) {
356987
356987
  return getModuleSpecifiersWithCacheInfo(
@@ -357260,8 +357260,8 @@ ${lanes.join("\n")}
357260
357260
  const importedFilePath = toPath(importedFileName, host.getCurrentDirectory(), hostGetCanonicalFileName(host));
357261
357261
  const cache8 = (_a2 = host.getModuleSpecifierCache) == null ? void 0 : _a2.call(host);
357262
357262
  if (cache8) {
357263
- const cached = cache8.get(importingFilePath, importedFilePath, preferences, options2);
357264
- if (cached == null ? void 0 : cached.modulePaths) return cached.modulePaths;
357263
+ const cached2 = cache8.get(importingFilePath, importedFilePath, preferences, options2);
357264
+ if (cached2 == null ? void 0 : cached2.modulePaths) return cached2.modulePaths;
357265
357265
  }
357266
357266
  const modulePaths = getAllModulePathsWorker(info, importedFileName, host, compilerOptions, options2);
357267
357267
  if (cache8) {
@@ -365354,9 +365354,9 @@ ${lanes.join("\n")}
365354
365354
  function typeParameterToName(type, context2) {
365355
365355
  var _a2, _b, _c, _d;
365356
365356
  if (context2.flags & 4 && context2.typeParameterNames) {
365357
- const cached = context2.typeParameterNames.get(getTypeId(type));
365358
- if (cached) {
365359
- return cached;
365357
+ const cached2 = context2.typeParameterNames.get(getTypeId(type));
365358
+ if (cached2) {
365359
+ return cached2;
365360
365360
  }
365361
365361
  }
365362
365362
  let result = symbolToName(
@@ -373068,9 +373068,9 @@ ${lanes.join("\n")}
373068
373068
  }
373069
373069
  function getOrCreateSubstitutionType(baseType, constraint) {
373070
373070
  const id2 = `${getTypeId(baseType)}>${getTypeId(constraint)}`;
373071
- const cached = substitutionTypes.get(id2);
373072
- if (cached) {
373073
- return cached;
373071
+ const cached2 = substitutionTypes.get(id2);
373072
+ if (cached2) {
373073
+ return cached2;
373074
373074
  }
373075
373075
  const result = createType(
373076
373076
  16777216
@@ -376472,9 +376472,9 @@ ${lanes.join("\n")}
376472
376472
  }
376473
376473
  const key = type.id + getAliasId(aliasSymbol, aliasTypeArguments);
376474
376474
  const mapperCache = activeTypeMappersCaches[index !== -1 ? index : activeTypeMappersCount - 1];
376475
- const cached = mapperCache.get(key);
376476
- if (cached) {
376477
- return cached;
376475
+ const cached2 = mapperCache.get(key);
376476
+ if (cached2) {
376477
+ return cached2;
376478
376478
  }
376479
376479
  totalInstantiationCount++;
376480
376480
  instantiationCount++;
@@ -380989,9 +380989,9 @@ ${lanes.join("\n")}
380989
380989
  return widened === original ? prop : createSymbolWithType(prop, widened);
380990
380990
  }
380991
380991
  function getUndefinedProperty(prop) {
380992
- const cached = undefinedProperties.get(prop.escapedName);
380993
- if (cached) {
380994
- return cached;
380992
+ const cached2 = undefinedProperties.get(prop.escapedName);
380993
+ if (cached2) {
380994
+ return cached2;
380995
380995
  }
380996
380996
  const result = createSymbolWithType(prop, undefinedOrMissingType);
380997
380997
  result.flags |= 16777216;
@@ -383872,9 +383872,9 @@ ${lanes.join("\n")}
383872
383872
  if (!key2) {
383873
383873
  return declaredType;
383874
383874
  }
383875
- const cached = cache8.get(key2);
383876
- if (cached) {
383877
- return cached;
383875
+ const cached2 = cache8.get(key2);
383876
+ if (cached2) {
383877
+ return cached2;
383878
383878
  }
383879
383879
  for (let i2 = flowLoopStart; i2 < flowLoopCount; i2++) {
383880
383880
  if (flowLoopNodes[i2] === flow && flowLoopKeys[i2] === key2 && flowLoopTypes[i2].length) {
@@ -383906,9 +383906,9 @@ ${lanes.join("\n")}
383906
383906
  flowType = getTypeAtFlowNode(antecedent);
383907
383907
  flowTypeCache = saveFlowTypeCache;
383908
383908
  flowLoopCount--;
383909
- const cached2 = cache8.get(key2);
383910
- if (cached2) {
383911
- return cached2;
383909
+ const cached22 = cache8.get(key2);
383910
+ if (cached22) {
383911
+ return cached22;
383912
383912
  }
383913
383913
  }
383914
383914
  const type = getTypeFromFlowType(flowType);
@@ -386091,10 +386091,10 @@ ${lanes.join("\n")}
386091
386091
  );
386092
386092
  }
386093
386093
  const links2 = getNodeLinks(iife);
386094
- const cached = links2.resolvedSignature;
386094
+ const cached2 = links2.resolvedSignature;
386095
386095
  links2.resolvedSignature = anySignature;
386096
386096
  const type = indexOfParameter < args.length ? getWidenedLiteralType(checkExpression(args[indexOfParameter])) : parameter.initializer ? void 0 : undefinedWideningType;
386097
- links2.resolvedSignature = cached;
386097
+ links2.resolvedSignature = cached2;
386098
386098
  return type;
386099
386099
  }
386100
386100
  const contextualSignature = getContextualSignature(func);
@@ -386793,8 +386793,8 @@ ${lanes.join("\n")}
386793
386793
  }
386794
386794
  function discriminateContextualTypeByJSXAttributes(node, contextualType) {
386795
386795
  const key = `D${getNodeId(node)},${getTypeId(contextualType)}`;
386796
- const cached = getCachedType(key);
386797
- if (cached) return cached;
386796
+ const cached2 = getCachedType(key);
386797
+ if (cached2) return cached2;
386798
386798
  const jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(node));
386799
386799
  return setCachedType(
386800
386800
  key,
@@ -391262,12 +391262,12 @@ ${lanes.join("\n")}
391262
391262
  }
391263
391263
  function getResolvedSignature(node, candidatesOutArray, checkMode) {
391264
391264
  const links2 = getNodeLinks(node);
391265
- const cached = links2.resolvedSignature;
391266
- if (cached && cached !== resolvingSignature && !candidatesOutArray) {
391267
- return cached;
391265
+ const cached2 = links2.resolvedSignature;
391266
+ if (cached2 && cached2 !== resolvingSignature && !candidatesOutArray) {
391267
+ return cached2;
391268
391268
  }
391269
391269
  const saveResolutionStart = resolutionStart;
391270
- if (!cached) {
391270
+ if (!cached2) {
391271
391271
  resolutionStart = resolutionTargets.length;
391272
391272
  }
391273
391273
  links2.resolvedSignature = resolvingSignature;
@@ -391279,7 +391279,7 @@ ${lanes.join("\n")}
391279
391279
  );
391280
391280
  resolutionStart = saveResolutionStart;
391281
391281
  if (result !== resolvingSignature) {
391282
- links2.resolvedSignature = flowLoopStart === flowLoopCount ? result : cached;
391282
+ links2.resolvedSignature = flowLoopStart === flowLoopCount ? result : cached2;
391283
391283
  }
391284
391284
  return result;
391285
391285
  }
@@ -455282,9 +455282,9 @@ ${lanes.join("\n")}
455282
455282
  if (!ambientModuleCache) {
455283
455283
  ambientModuleCache = /* @__PURE__ */ new Map();
455284
455284
  } else {
455285
- const cached = ambientModuleCache.get(moduleSymbol);
455286
- if (cached !== void 0) {
455287
- return cached;
455285
+ const cached2 = ambientModuleCache.get(moduleSymbol);
455286
+ if (cached2 !== void 0) {
455287
+ return cached2;
455288
455288
  }
455289
455289
  }
455290
455290
  const declaredModuleSpecifier = stripQuotes(moduleSymbol.getName());
@@ -455309,9 +455309,9 @@ ${lanes.join("\n")}
455309
455309
  if (!sourceFileCache) {
455310
455310
  sourceFileCache = /* @__PURE__ */ new Map();
455311
455311
  } else {
455312
- const cached = sourceFileCache.get(sourceFile);
455313
- if (cached !== void 0) {
455314
- return cached;
455312
+ const cached2 = sourceFileCache.get(sourceFile);
455313
+ if (cached2 !== void 0) {
455314
+ return cached2;
455315
455315
  }
455316
455316
  }
455317
455317
  const packageName = getNodeModulesPackageNameFromFileName(sourceFile.fileName, moduleSpecifierResolutionHost);
@@ -488672,9 +488672,9 @@ ${newComment.split("\n").map((c9) => ` * ${c9}`).join("\n")}
488672
488672
  return true;
488673
488673
  }
488674
488674
  const key = getSymbolId(symbol3) + "," + getSymbolId(parent2);
488675
- const cached = cachedResults.get(key);
488676
- if (cached !== void 0) {
488677
- return cached;
488675
+ const cached2 = cachedResults.get(key);
488676
+ if (cached2 !== void 0) {
488677
+ return cached2;
488678
488678
  }
488679
488679
  cachedResults.set(key, false);
488680
488680
  const inherits = !!symbol3.declarations && symbol3.declarations.some(
@@ -545875,9 +545875,9 @@ function getCodeGraphDBIfReady(workingDir) {
545875
545875
  return null;
545876
545876
  return existing;
545877
545877
  }
545878
- const cached = cache4.get(workingDir);
545879
- if (cached)
545880
- return cached;
545878
+ const cached2 = cache4.get(workingDir);
545879
+ if (cached2)
545880
+ return cached2;
545881
545881
  const db = new CodeGraphDB(workingDir);
545882
545882
  if (db.getStats().fileCount === 0) {
545883
545883
  db.close();
@@ -570161,7 +570161,7 @@ var init_personality = __esm({
570161
570161
  // packages/orchestrator/dist/critic.js
570162
570162
  function buildCriticGuidanceMessage(call, hits, opts = {}) {
570163
570163
  const argPreview = JSON.stringify(call.args ?? {}).slice(0, 200);
570164
- const cached = opts.cachedResult ? `
570164
+ const cached2 = opts.cachedResult ? `
570165
570165
  Prior evidence preview:
570166
570166
  ${opts.cachedResult.slice(0, 700)}` : "";
570167
570167
  const source = opts.adversaryFlag ? "The runtime recognized this exact tool call as already observed earlier." : `This is exact repeat #${hits} for the same ${call.tool} arguments.`;
@@ -570170,7 +570170,7 @@ Observation: ${source}
570170
570170
  Call: ${call.tool}(${argPreview})
570171
570171
  State: exact prior evidence exists for these arguments in the current state version.
570172
570172
  Next action contract: let this result inform the next step once, then pivot to a concrete action.
570173
- Suggested next actions: edit/write the implicated file, run verification, read a different specific file, or complete with evidence. Prefer not to repeat this exact call again unless the filesystem, browser, or page state changed.${cached}`;
570173
+ Suggested next actions: edit/write the implicated file, run verification, read a different specific file, or complete with evidence. Prefer not to repeat this exact call again unless the filesystem, browser, or page state changed.${cached2}`;
570174
570174
  }
570175
570175
  function buildCachedResultEnvelope(result) {
570176
570176
  return `[PRIOR RESULT — already observed by a prior identical call]
@@ -570180,10 +570180,10 @@ function evaluate2(inputs) {
570180
570180
  const { proposedCall, fingerprint, recentToolResults, dedupHitCount, adversaryRedundantSignal } = inputs;
570181
570181
  const cacheEligible = proposedCall.tool === "memory_write" || NOOP_WRITE_CACHE_TOOLS.has(proposedCall.tool);
570182
570182
  if (adversaryRedundantSignal && cacheEligible) {
570183
- const cached = recentToolResults.get(fingerprint);
570184
- if (!cached)
570183
+ const cached2 = recentToolResults.get(fingerprint);
570184
+ if (!cached2)
570185
570185
  return { decision: "pass" };
570186
- const cachedResult = buildCachedResultEnvelope(cached.result);
570186
+ const cachedResult = buildCachedResultEnvelope(cached2.result);
570187
570187
  return {
570188
570188
  decision: "guidance",
570189
570189
  reason: "Adversary flagged this fingerprint as redundant",
@@ -570193,19 +570193,19 @@ function evaluate2(inputs) {
570193
570193
  adversaryFlag: true
570194
570194
  }),
570195
570195
  cachedResult,
570196
- compacted: cached?.compacted
570196
+ compacted: cached2?.compacted
570197
570197
  };
570198
570198
  }
570199
570199
  if (cacheEligible) {
570200
- const cached = recentToolResults.get(fingerprint);
570201
- if (cached !== void 0) {
570200
+ const cached2 = recentToolResults.get(fingerprint);
570201
+ if (cached2 !== void 0) {
570202
570202
  const hits = (dedupHitCount.get(fingerprint) ?? 0) + 1;
570203
- const cachedEnvelope = buildCachedResultEnvelope(cached.result);
570203
+ const cachedEnvelope = buildCachedResultEnvelope(cached2.result);
570204
570204
  return {
570205
570205
  decision: "guidance",
570206
- reason: cached.compacted ? "post-compaction duplicate evidence" : `duplicate call #${hits}`,
570206
+ reason: cached2.compacted ? "post-compaction duplicate evidence" : `duplicate call #${hits}`,
570207
570207
  cachedResult: cachedEnvelope,
570208
- compacted: cached.compacted,
570208
+ compacted: cached2.compacted,
570209
570209
  hitNumber: hits,
570210
570210
  guidanceMessage: buildCriticGuidanceMessage(proposedCall, hits, {
570211
570211
  cachedResult: cachedEnvelope
@@ -592814,7 +592814,7 @@ ${context2 ?? ""}`;
592814
592814
  }
592815
592815
  }
592816
592816
  _applyTaskAffectFromResult(result, events) {
592817
- const clamp11 = (n2) => Math.max(0, Math.min(1, n2));
592817
+ const clamp12 = (n2) => Math.max(0, Math.min(1, n2));
592818
592818
  let uncertainty = this._taskAffectState.uncertainty * 0.94;
592819
592819
  let frustration = this._taskAffectState.frustration * 0.94;
592820
592820
  let confidence2 = this._taskAffectState.confidence * 0.94;
@@ -592847,11 +592847,11 @@ ${context2 ?? ""}`;
592847
592847
  }
592848
592848
  const level = frustration >= 0.72 || uncertainty >= 0.78 ? 4 : frustration >= 0.52 || uncertainty >= 0.58 ? 3 : frustration >= 0.32 || uncertainty >= 0.38 ? 2 : frustration >= 0.18 || uncertainty >= 0.22 ? 1 : 0;
592849
592849
  this._taskAffectState = {
592850
- uncertainty: clamp11(uncertainty),
592851
- frustration: clamp11(frustration),
592852
- confidence: clamp11(confidence2),
592853
- novelty: clamp11(novelty),
592854
- momentum: clamp11(momentum),
592850
+ uncertainty: clamp12(uncertainty),
592851
+ frustration: clamp12(frustration),
592852
+ confidence: clamp12(confidence2),
592853
+ novelty: clamp12(novelty),
592854
+ momentum: clamp12(momentum),
592855
592855
  adversaryLevel: level,
592856
592856
  lastUpdatedIso: (/* @__PURE__ */ new Date()).toISOString()
592857
592857
  };
@@ -595192,6 +595192,30 @@ ${sections.join("\n")}` : sections.join("\n");
595192
595192
  _insertContextFrame(messages2, frame) {
595193
595193
  upsertContextFrame(messages2, frame, _AgenticRunner.CONTEXT_FRAME_MARKER);
595194
595194
  }
595195
+ /**
595196
+ * Retire historic imperative recovery prose before compiling model context.
595197
+ * Detector and tool evidence remains in ledgers/telemetry; only the old
595198
+ * prompt-injection transport is removed. User steering, safety, controller
595199
+ * state, and action ground truth are intentionally outside this classifier.
595200
+ */
595201
+ _retireLegacyImperativeSystemMessages(messages2) {
595202
+ const isLegacyImperative = (content) => /^\[(?:STAGNATION REPLAN|STUCK(?:-STATE META-ANALYZER| DETECTOR HALT)|WRITE-THRASH HALT|PROBLEM-FRAME VALIDATION|EDIT-FAIL-THRASH HALT|TODO COMPLETION REQUIRED|FORCED PROGRESS BLOCK|STOP — RETRY LOOP DETECTED|LOCAL ERROR-INFORMED NUDGE|PLANNING TOOL RECOVERY|FOCUS SUPERVISOR(?: BLOCK)?|REG-\d+)/.test(content.trim());
595203
+ let retired = 0;
595204
+ for (let index = messages2.length - 1; index >= 1; index--) {
595205
+ const message2 = messages2[index];
595206
+ if (message2?.role === "system" && typeof message2.content === "string" && isLegacyImperative(message2.content)) {
595207
+ messages2.splice(index, 1);
595208
+ retired++;
595209
+ }
595210
+ }
595211
+ if (retired > 0) {
595212
+ this.emit({
595213
+ type: "status",
595214
+ content: `Retired ${retired} legacy imperative system message(s); detector evidence remains in controller telemetry`,
595215
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
595216
+ });
595217
+ }
595218
+ }
595195
595219
  _activeContextItem(kind, id2, source, label, content, priority = 0, metadata) {
595196
595220
  const normalized = normalizeContextSnippet(content ?? "", 1200);
595197
595221
  if (!normalized)
@@ -595489,6 +595513,7 @@ ${chunk.content}`, {
595489
595513
  }
595490
595514
  }
595491
595515
  async _buildTurnContextFrame(turn, messages2, recentToolResults, environmentBlock) {
595516
+ this._retireLegacyImperativeSystemMessages(messages2);
595492
595517
  this._contextLedger.clearSources("turn.");
595493
595518
  this._contextLedger.prune(turn);
595494
595519
  const concreteGoal = this._taskState.originalGoal || this._taskState.goal || this._taskState.currentStep || this._taskState.nextAction || "";
@@ -597463,14 +597488,14 @@ ${notice}`;
597463
597488
  const contractFingerprint = _createHash("sha256").update(JSON.stringify(branchBrief.discoveryContract ?? branchBrief)).digest("hex").slice(0, 20);
597464
597489
  const canonicalPath = this._normalizeEvidencePath(rawPath);
597465
597490
  const cacheKey = `${canonicalPath}|${fullHash}|${offset ?? 0}:${limit ?? "EOF"}|${contractFingerprint}`;
597466
- const cached = this._branchEvidenceCache.get(cacheKey);
597467
- if (cached) {
597491
+ const cached2 = this._branchEvidenceCache.get(cacheKey);
597492
+ if (cached2) {
597468
597493
  const fingerprint = this._buildToolFingerprint(input.toolName, input.args);
597469
597494
  const rehydrated = this._rehydrateResolvedReadEvidence({
597470
597495
  fingerprint,
597471
597496
  canonicalPath,
597472
597497
  contentHash: fullHash,
597473
- payload: cached.output,
597498
+ payload: cached2.output,
597474
597499
  turn: input.turn
597475
597500
  });
597476
597501
  this.emit({
@@ -597488,7 +597513,7 @@ ${notice}`;
597488
597513
  runtimeAuthored: true,
597489
597514
  noop: true,
597490
597515
  completionEvidenceMetrics: {
597491
- branchSourceBytes: cached.sourceBytes,
597516
+ branchSourceBytes: cached2.sourceBytes,
597492
597517
  branchCacheHit: true,
597493
597518
  fingerprintState: "resolved_from_cache"
597494
597519
  }
@@ -602726,8 +602751,8 @@ ${cachedResult}`,
602726
602751
  this._evidenceLedger.markMutated(this._normalizeEvidencePath(p2), nextWriteCount, turn);
602727
602752
  const branchPath = this._normalizeEvidencePath(p2);
602728
602753
  this._branchEvidenceByPath.delete(branchPath);
602729
- for (const [cacheKey, cached] of this._branchEvidenceCache) {
602730
- if (cached.path === branchPath) {
602754
+ for (const [cacheKey, cached2] of this._branchEvidenceCache) {
602755
+ if (cached2.path === branchPath) {
602731
602756
  this._branchEvidenceCache.delete(cacheKey);
602732
602757
  }
602733
602758
  }
@@ -608155,7 +608180,8 @@ ${tail}`;
608155
608180
  createdTurn: turn,
608156
608181
  ttlTurns: 20
608157
608182
  });
608158
- void signal;
608183
+ if (signal)
608184
+ this._contextLedger.upsert(signal);
608159
608185
  }
608160
608186
  this.emit({
608161
608187
  type: "user_interrupt",
@@ -608183,8 +608209,7 @@ ${tail}`;
608183
608209
  createdTurn: turn,
608184
608210
  ttlTurns: 3
608185
608211
  });
608186
- if (signal)
608187
- this._contextLedger.upsert(signal);
608212
+ void signal;
608188
608213
  this.emit({
608189
608214
  type: "status",
608190
608215
  content: `Runtime guidance queued: ${guidance.replace(/\s+/g, " ").slice(0, 140)}`,
@@ -626798,6 +626823,173 @@ reason=${decision2.reason} confidence=${decision2.confidence.toFixed(2)} source=
626798
626823
  }
626799
626824
  });
626800
626825
 
626826
+ // packages/cli/src/tui/power-monitor.ts
626827
+ import { closeSync as closeSync2, fstatSync, openSync as openSync2, readSync as readSync2 } from "node:fs";
626828
+ import { homedir as homedir41 } from "node:os";
626829
+ function finiteNumber(value2) {
626830
+ if (typeof value2 === "number" && Number.isFinite(value2)) return value2;
626831
+ if (typeof value2 === "string") {
626832
+ const parsed = Number.parseFloat(value2);
626833
+ return Number.isFinite(parsed) ? parsed : null;
626834
+ }
626835
+ return null;
626836
+ }
626837
+ function finiteRecord(value2) {
626838
+ if (!value2 || typeof value2 !== "object" || Array.isArray(value2)) return {};
626839
+ const result = {};
626840
+ for (const [key, raw] of Object.entries(value2)) {
626841
+ const parsed = finiteNumber(raw);
626842
+ if (parsed !== null) result[key] = parsed;
626843
+ }
626844
+ return result;
626845
+ }
626846
+ function sampleTime(value2) {
626847
+ const numeric = finiteNumber(value2);
626848
+ if (numeric !== null) return numeric < 1e11 ? numeric * 1e3 : numeric;
626849
+ if (typeof value2 !== "string") return null;
626850
+ const parsed = Date.parse(value2);
626851
+ return Number.isFinite(parsed) ? parsed : null;
626852
+ }
626853
+ function configuredRate() {
626854
+ for (const [name10, raw] of [
626855
+ ["OMNIUS_POWER_RATE_USD_PER_KWH", process.env["OMNIUS_POWER_RATE_USD_PER_KWH"]],
626856
+ ["POWER_RATE", process.env["POWER_RATE"]]
626857
+ ]) {
626858
+ const rate = finiteNumber(raw);
626859
+ if (rate !== null && rate >= 0) return { rate, source: `env:${name10}` };
626860
+ }
626861
+ return { rate: null, source: null };
626862
+ }
626863
+ function monitorPaths() {
626864
+ return [
626865
+ process.env["OMNIUS_POWER_MONITOR_JSONL"],
626866
+ process.env["POWER_MONITOR_JSONL"],
626867
+ "/var/log/power-monitor/data.jsonl",
626868
+ `${homedir41()}/.local/share/power-monitor/data.jsonl`
626869
+ ].filter((path16) => Boolean(path16));
626870
+ }
626871
+ function readLastJsonRecord(path16) {
626872
+ let fd = null;
626873
+ try {
626874
+ fd = openSync2(path16, "r");
626875
+ const stat9 = fstatSync(fd);
626876
+ if (stat9.size <= 0) return null;
626877
+ const bytes = Math.min(stat9.size, TAIL_BYTES);
626878
+ const buffer2 = Buffer.allocUnsafe(bytes);
626879
+ readSync2(fd, buffer2, 0, bytes, stat9.size - bytes);
626880
+ const lines = buffer2.toString("utf8").split(/\r?\n/);
626881
+ for (let index = lines.length - 1; index >= 0; index -= 1) {
626882
+ const line = lines[index].trim();
626883
+ if (!line) continue;
626884
+ try {
626885
+ const parsed = JSON.parse(line);
626886
+ if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
626887
+ return parsed;
626888
+ }
626889
+ } catch {
626890
+ }
626891
+ }
626892
+ } catch {
626893
+ return null;
626894
+ } finally {
626895
+ if (fd !== null) closeSync2(fd);
626896
+ }
626897
+ return null;
626898
+ }
626899
+ function powerSnapshotFromRecord(record, sourcePath, options2 = {}) {
626900
+ const nowMs = options2.nowMs ?? Date.now();
626901
+ const sampledAtMs = sampleTime(record["ts"] ?? record["timestamp"]);
626902
+ if (sampledAtMs === null || sampledAtMs > nowMs + 6e4) return null;
626903
+ const deviceWatts = finiteRecord(record["power"] ?? record["power_watts"]);
626904
+ const temperaturesC = finiteRecord(record["temps"] ?? record["temperatures_c"]);
626905
+ const reportedTotal = finiteNumber(record["total"] ?? record["total_watts"]);
626906
+ const upsWatts = finiteNumber(record["ups_watts"]);
626907
+ const componentTotal = Object.values(deviceWatts).reduce((sum2, watts) => sum2 + watts, 0);
626908
+ const totalWatts = upsWatts ?? reportedTotal ?? componentTotal;
626909
+ if (!Number.isFinite(totalWatts) || totalWatts < 0) return null;
626910
+ const cumulative = finiteRecord(record["cum_kwh"] ?? record["cumulative_kwh"]);
626911
+ const energyKwh = cumulative["total"] ?? null;
626912
+ const configured = configuredRate();
626913
+ const sampleRate = finiteNumber(
626914
+ record["rate_usd_per_kwh"] ?? record["electricity_rate_usd_per_kwh"] ?? record["rate"]
626915
+ );
626916
+ const rateUsdPerKwh = options2.rateUsdPerKwh ?? configured.rate ?? (sampleRate !== null && sampleRate >= 0 ? sampleRate : null);
626917
+ const rateSource = options2.rateSource ?? configured.source ?? (rateUsdPerKwh !== null ? typeof record["rate_source"] === "string" ? record["rate_source"] : "power-monitor-record" : null);
626918
+ const accountingMode = upsWatts !== null ? "ups_input" : reportedTotal !== null ? "reported_total" : "component_sum";
626919
+ const ageMs = Math.max(0, nowMs - sampledAtMs);
626920
+ return {
626921
+ sampledAtMs,
626922
+ ageMs,
626923
+ sourcePath,
626924
+ accountingMode,
626925
+ totalWatts,
626926
+ totalIsEstimated: accountingMode === "component_sum",
626927
+ deviceWatts,
626928
+ temperaturesC,
626929
+ energyKwh,
626930
+ rateUsdPerKwh,
626931
+ rateSource,
626932
+ electricityCostUsd: energyKwh !== null && rateUsdPerKwh !== null ? energyKwh * rateUsdPerKwh : null,
626933
+ costRateUsdPerHour: rateUsdPerKwh !== null ? totalWatts / 1e3 * rateUsdPerKwh : null
626934
+ };
626935
+ }
626936
+ function readSystemPowerSnapshot(options2 = {}) {
626937
+ const nowMs = options2.nowMs ?? Date.now();
626938
+ const maxAgeMs = options2.maxAgeMs ?? DEFAULT_MAX_AGE_MS;
626939
+ if (!options2.paths && !options2.rateUsdPerKwh && cached && nowMs - cached.atMs < CACHE_MS) {
626940
+ return cached.snapshot && cached.snapshot.ageMs <= maxAgeMs ? cached.snapshot : null;
626941
+ }
626942
+ let snapshot = null;
626943
+ for (const path16 of options2.paths ?? monitorPaths()) {
626944
+ const record = readLastJsonRecord(path16);
626945
+ if (!record) continue;
626946
+ const candidate = powerSnapshotFromRecord(record, path16, { ...options2, nowMs });
626947
+ if (candidate && candidate.ageMs <= maxAgeMs) {
626948
+ snapshot = candidate;
626949
+ break;
626950
+ }
626951
+ }
626952
+ if (!options2.paths && !options2.rateUsdPerKwh) cached = { atMs: nowMs, snapshot };
626953
+ return snapshot;
626954
+ }
626955
+ function compactEntries(values, suffix, limit = 6) {
626956
+ const entries = Object.entries(values).sort(([left], [right]) => left.localeCompare(right)).slice(0, limit).map(([name10, value2]) => `${name10}=${value2.toFixed(1)}${suffix}`);
626957
+ const hidden = Math.max(0, Object.keys(values).length - entries.length);
626958
+ return hidden > 0 ? `${entries.join(", ")}, +${hidden} more` : entries.join(", ");
626959
+ }
626960
+ function formatPowerSnapshotForContext(snapshot) {
626961
+ if (!snapshot) return "";
626962
+ const lines = [
626963
+ `[SYSTEM POWER v1] age_ms=${Math.round(snapshot.ageMs)} source=${snapshot.sourcePath}`,
626964
+ `power total_w=${snapshot.totalWatts.toFixed(1)} accounting=${snapshot.accountingMode}${snapshot.totalIsEstimated ? " partial_component_sum" : ""}`
626965
+ ];
626966
+ const devicePower = compactEntries(snapshot.deviceWatts, "W");
626967
+ if (devicePower) lines.push(`device_power ${devicePower}`);
626968
+ const temperatures = compactEntries(snapshot.temperaturesC, "C");
626969
+ if (temperatures) lines.push(`temperatures ${temperatures}`);
626970
+ if (snapshot.energyKwh !== null) lines.push(`energy_kwh=${snapshot.energyKwh.toFixed(4)}`);
626971
+ if (snapshot.rateUsdPerKwh !== null) {
626972
+ lines.push(
626973
+ `electricity usd_per_kwh=${snapshot.rateUsdPerKwh.toFixed(4)} source=${snapshot.rateSource ?? "unknown"} cost_usd_per_hour=${snapshot.costRateUsdPerHour?.toFixed(4) ?? "unknown"}${snapshot.electricityCostUsd !== null ? ` cumulative_cost_usd=${snapshot.electricityCostUsd.toFixed(4)}` : ""}`
626974
+ );
626975
+ } else {
626976
+ lines.push("electricity rate=unavailable cost=unavailable");
626977
+ }
626978
+ return lines.join("\n");
626979
+ }
626980
+ function formatPowerMonitorContext() {
626981
+ return formatPowerSnapshotForContext(readSystemPowerSnapshot());
626982
+ }
626983
+ var TAIL_BYTES, CACHE_MS, DEFAULT_MAX_AGE_MS, cached;
626984
+ var init_power_monitor = __esm({
626985
+ "packages/cli/src/tui/power-monitor.ts"() {
626986
+ TAIL_BYTES = 256 * 1024;
626987
+ CACHE_MS = 3e3;
626988
+ DEFAULT_MAX_AGE_MS = 15e3;
626989
+ cached = null;
626990
+ }
626991
+ });
626992
+
626801
626993
  // packages/cli/src/tui/conversation-context.ts
626802
626994
  import { statfsSync as statfsSync7 } from "node:fs";
626803
626995
  function buildConversationRuntimeContext(now2 = /* @__PURE__ */ new Date(), repoRoot) {
@@ -642350,10 +642542,10 @@ ${activitySummary}
642350
642542
  // packages/cli/src/api/profiles.ts
642351
642543
  import { existsSync as existsSync124, readFileSync as readFileSync101, writeFileSync as writeFileSync63, mkdirSync as mkdirSync75, readdirSync as readdirSync40, unlinkSync as unlinkSync22 } from "node:fs";
642352
642544
  import { join as join135 } from "node:path";
642353
- import { homedir as homedir41 } from "node:os";
642545
+ import { homedir as homedir42 } from "node:os";
642354
642546
  import { createCipheriv as createCipheriv4, createDecipheriv as createDecipheriv4, randomBytes as randomBytes25, scryptSync as scryptSync3 } from "node:crypto";
642355
642547
  function globalProfileDir() {
642356
- return join135(homedir41(), ".omnius", "profiles");
642548
+ return join135(homedir42(), ".omnius", "profiles");
642357
642549
  }
642358
642550
  function projectProfileDir(projectDir2) {
642359
642551
  return join135(projectDir2 || process.cwd(), ".omnius", "profiles");
@@ -642734,9 +642926,9 @@ __export(omnius_directory_exports, {
642734
642926
  writeIndexMeta: () => writeIndexMeta,
642735
642927
  writeTaskHandoff: () => writeTaskHandoff2
642736
642928
  });
642737
- import { appendFileSync as appendFileSync14, cpSync as cpSync2, existsSync as existsSync125, mkdirSync as mkdirSync76, readFileSync as readFileSync102, writeFileSync as writeFileSync64, readdirSync as readdirSync41, statSync as statSync51, unlinkSync as unlinkSync23, openSync as openSync2, closeSync as closeSync2, renameSync as renameSync11, watch as fsWatch2 } from "node:fs";
642929
+ import { appendFileSync as appendFileSync14, cpSync as cpSync2, existsSync as existsSync125, mkdirSync as mkdirSync76, readFileSync as readFileSync102, writeFileSync as writeFileSync64, readdirSync as readdirSync41, statSync as statSync51, unlinkSync as unlinkSync23, openSync as openSync3, closeSync as closeSync3, renameSync as renameSync11, watch as fsWatch2 } from "node:fs";
642738
642930
  import { join as join136, relative as relative17, basename as basename27, dirname as dirname40, resolve as resolve62 } from "node:path";
642739
- import { homedir as homedir42 } from "node:os";
642931
+ import { homedir as homedir43 } from "node:os";
642740
642932
  import { createHash as createHash44 } from "node:crypto";
642741
642933
  function isGitRoot(dir) {
642742
642934
  const gitPath = join136(dir, ".git");
@@ -642940,7 +643132,7 @@ function saveProjectSettings(repoRoot, settings) {
642940
643132
  writeFileSync64(join136(omniusPath, "settings.json"), JSON.stringify(merged, null, 2) + "\n", { encoding: "utf-8", mode: 384 });
642941
643133
  }
642942
643134
  function loadGlobalSettings() {
642943
- const settingsPath = join136(homedir42(), ".omnius", "settings.json");
643135
+ const settingsPath = join136(homedir43(), ".omnius", "settings.json");
642944
643136
  try {
642945
643137
  if (existsSync125(settingsPath)) {
642946
643138
  return JSON.parse(readFileSync102(settingsPath, "utf-8"));
@@ -642950,7 +643142,7 @@ function loadGlobalSettings() {
642950
643142
  return {};
642951
643143
  }
642952
643144
  function saveGlobalSettings(settings) {
642953
- const dir = join136(homedir42(), ".omnius");
643145
+ const dir = join136(homedir43(), ".omnius");
642954
643146
  mkdirSync76(dir, { recursive: true });
642955
643147
  const existing = loadGlobalSettings();
642956
643148
  const merged = { ...existing, ...settings };
@@ -643247,10 +643439,10 @@ function acquireLock(lockPath) {
643247
643439
  const pid = process.pid;
643248
643440
  for (let attempt = 0; attempt < LOCK_RETRY_MAX; attempt++) {
643249
643441
  try {
643250
- const fd = openSync2(lockPath, "wx");
643442
+ const fd = openSync3(lockPath, "wx");
643251
643443
  const lockData = JSON.stringify({ pid, acquiredAt: Date.now() });
643252
643444
  writeFileSync64(fd, lockData);
643253
- closeSync2(fd);
643445
+ closeSync3(fd);
643254
643446
  return true;
643255
643447
  } catch (err) {
643256
643448
  if (existsSync125(lockPath)) {
@@ -644239,7 +644431,7 @@ function findKeyFiles(repoRoot) {
644239
644431
  function buildDirTree(root, maxDepth, prefix = "", depth = 0) {
644240
644432
  if (depth > maxDepth) return "";
644241
644433
  let result = "";
644242
- const isHomeRoot = depth === 0 && root === homedir42();
644434
+ const isHomeRoot = depth === 0 && root === homedir43();
644243
644435
  try {
644244
644436
  const entries = readdirSync41(root, { withFileTypes: true }).filter((e2) => !e2.name.startsWith(".") || e2.name === ".github").filter((e2) => !SKIP_DIRS3.has(e2.name)).filter((e2) => !(isHomeRoot && HOME_SKIP_DIRS.has(e2.name))).sort((a2, b) => {
644245
644437
  if (a2.isDirectory() && !b.isDirectory()) return -1;
@@ -644308,13 +644500,13 @@ function recordUsage(kind, value2, opts) {
644308
644500
  }
644309
644501
  saveUsageFile(filePath, data);
644310
644502
  };
644311
- update2(join136(homedir42(), ".omnius", USAGE_HISTORY_FILE));
644503
+ update2(join136(homedir43(), ".omnius", USAGE_HISTORY_FILE));
644312
644504
  if (opts?.repoRoot) {
644313
644505
  update2(join136(opts.repoRoot, OMNIUS_DIR, USAGE_HISTORY_FILE));
644314
644506
  }
644315
644507
  }
644316
644508
  function loadUsageHistory(kind, repoRoot) {
644317
- const globalPath = join136(homedir42(), ".omnius", USAGE_HISTORY_FILE);
644509
+ const globalPath = join136(homedir43(), ".omnius", USAGE_HISTORY_FILE);
644318
644510
  const globalData = loadUsageFile(globalPath);
644319
644511
  const localData = repoRoot ? loadUsageFile(join136(repoRoot, OMNIUS_DIR, USAGE_HISTORY_FILE)) : { records: [] };
644320
644512
  const map2 = /* @__PURE__ */ new Map();
@@ -644345,7 +644537,7 @@ function deleteUsageRecord(kind, value2, repoRoot) {
644345
644537
  saveUsageFile(filePath, data);
644346
644538
  }
644347
644539
  };
644348
- remove(join136(homedir42(), ".omnius", USAGE_HISTORY_FILE));
644540
+ remove(join136(homedir43(), ".omnius", USAGE_HISTORY_FILE));
644349
644541
  if (repoRoot) {
644350
644542
  remove(join136(repoRoot, OMNIUS_DIR, USAGE_HISTORY_FILE));
644351
644543
  }
@@ -645716,7 +645908,7 @@ __export(tui_tasks_renderer_exports, {
645716
645908
  });
645717
645909
  import { existsSync as existsSync129, readFileSync as readFileSync106, watch as fsWatch3 } from "node:fs";
645718
645910
  import { join as join140 } from "node:path";
645719
- import { homedir as homedir44 } from "node:os";
645911
+ import { homedir as homedir45 } from "node:os";
645720
645912
  function setTasksRendererWriter(writer) {
645721
645913
  chromeWrite = writer;
645722
645914
  }
@@ -645739,7 +645931,7 @@ function panelEffectivelyVisible() {
645739
645931
  return _enabled && !_scopeOverlayActive && !_scopeNeovimActive && !_scopePagerActive && _scopeMainViewActive;
645740
645932
  }
645741
645933
  function todoDir2() {
645742
- return join140(homedir44(), ".omnius", "todos");
645934
+ return join140(homedir45(), ".omnius", "todos");
645743
645935
  }
645744
645936
  function todoPath2(sessionId) {
645745
645937
  const safe = sessionId.replace(/[^a-zA-Z0-9_.-]/g, "_");
@@ -646610,7 +646802,7 @@ var init_braille_spinner = __esm({
646610
646802
  // packages/cli/src/tui/project-context.ts
646611
646803
  import { existsSync as existsSync130, readFileSync as readFileSync107, readdirSync as readdirSync42, mkdirSync as mkdirSync78, statSync as statSync53, writeFileSync as writeFileSync66 } from "node:fs";
646612
646804
  import { dirname as dirname43, join as join141, basename as basename29, resolve as resolve64 } from "node:path";
646613
- import { homedir as homedir45 } from "node:os";
646805
+ import { homedir as homedir46 } from "node:os";
646614
646806
  function projectContextUrlSpanAt(text2, index) {
646615
646807
  PROJECT_CONTEXT_URL_RE.lastIndex = 0;
646616
646808
  for (const match of text2.matchAll(PROJECT_CONTEXT_URL_RE)) {
@@ -646762,7 +646954,7 @@ function buildWorkspaceMemorySubstrateCensus(repoRoot) {
646762
646954
  const legacyMemoryDir = join141(repoRoot, ".omnius", "memory");
646763
646955
  const projectMemory = countJsonMemoryEntries(projectMemoryDir);
646764
646956
  const legacyMemory = legacyMemoryDir === projectMemoryDir ? { topics: 0, entries: 0 } : countJsonMemoryEntries(legacyMemoryDir);
646765
- const globalMemory = countJsonMemoryEntries(join141(homedir45(), ".omnius", "memory"));
646957
+ const globalMemory = countJsonMemoryEntries(join141(homedir46(), ".omnius", "memory"));
646766
646958
  const reflectionCount = countReflectionBuffer(repoRoot);
646767
646959
  const evidenceCount = countJsonlLines(join141(repoRoot, ".omnius", "evidence", "events.jsonl"));
646768
646960
  const unifiedPresent = existsSync130(join141(repoRoot, OMNIUS_DIR, "unified-memory.db"));
@@ -646820,7 +647012,7 @@ function loadMemoryContextBundle(repoRoot, task = "", taskEmbedding) {
646820
647012
  collect(omniusMemDir, "project");
646821
647013
  const legacyMemDir = join141(repoRoot, ".omnius", "memory");
646822
647014
  if (legacyMemDir !== omniusMemDir) collect(legacyMemDir, "project");
646823
- const globalMemDir = join141(homedir45(), ".omnius", "memory");
647015
+ const globalMemDir = join141(homedir46(), ".omnius", "memory");
646824
647016
  collect(globalMemDir, "global");
646825
647017
  const seen = /* @__PURE__ */ new Set();
646826
647018
  const deduped = [];
@@ -650337,9 +650529,9 @@ var init_status_bar = __esm({
650337
650529
  try {
650338
650530
  const metricsPath = nexusDir + "/remote-metrics.json";
650339
650531
  const raw = await readFileAsync(metricsPath, "utf8");
650340
- const cached = JSON.parse(raw);
650341
- if (cached && cached.ts && Date.now() - cached.ts < 6e4) {
650342
- const m2 = cached.data;
650532
+ const cached2 = JSON.parse(raw);
650533
+ if (cached2 && cached2.ts && Date.now() - cached2.ts < 6e4) {
650534
+ const m2 = cached2.data;
650343
650535
  this.setRemoteTokensPerSecond(m2?.gateway?.tokensPerSecond);
650344
650536
  if (m2?.cpu) {
650345
650537
  lastPeerMetricsDebug = `ok: cpu=${m2.cpu?.utilization}%`;
@@ -651969,10 +652161,10 @@ ${CONTENT_BG_SEQ}`);
651969
652161
  return base3.totalRows + (livePartialLine ? this.rowCountForSourceLine(livePartialLine, maxWidth) : 0);
651970
652162
  }
651971
652163
  getRowCountIndex(width) {
651972
- const cached = this._rowCountCache;
652164
+ const cached2 = this._rowCountCache;
651973
652165
  const collapseVersion = collapseStateVersion();
651974
- if (cached && cached.source === this._contentLines && cached.width === width && cached.lineCount === this._contentLines.length && cached.contentRevision === this._contentRevision && cached.dynamicBlockVersion === this._dynamicBlockVersion && cached.collapseVersion === collapseVersion) {
651975
- return cached;
652166
+ if (cached2 && cached2.source === this._contentLines && cached2.width === width && cached2.lineCount === this._contentLines.length && cached2.contentRevision === this._contentRevision && cached2.dynamicBlockVersion === this._dynamicBlockVersion && cached2.collapseVersion === collapseVersion) {
652167
+ return cached2;
651976
652168
  }
651977
652169
  const counts = new Array(this._contentLines.length);
651978
652170
  const prefix = new Array(this._contentLines.length + 1);
@@ -652067,8 +652259,8 @@ ${CONTENT_BG_SEQ}`);
652067
652259
  _reflowLineCache = /* @__PURE__ */ new Map();
652068
652260
  reflowContentLine(line, width) {
652069
652261
  const key = `${width}\0${line}`;
652070
- const cached = this._reflowLineCache.get(key);
652071
- if (cached) return cached;
652262
+ const cached2 = this._reflowLineCache.get(key);
652263
+ if (cached2) return cached2;
652072
652264
  const result = this._reflowContentLineUncached(line, width);
652073
652265
  if (this._reflowLineCache.size > 8e3) this._reflowLineCache.clear();
652074
652266
  this._reflowLineCache.set(key, result);
@@ -654650,7 +654842,7 @@ __export(personaplex_exports, {
654650
654842
  });
654651
654843
  import { existsSync as existsSync131, writeFileSync as writeFileSync67, readFileSync as readFileSync108, mkdirSync as mkdirSync79, copyFileSync as copyFileSync5, readdirSync as readdirSync43, statSync as statSync54 } from "node:fs";
654652
654844
  import { join as join142, dirname as dirname45 } from "node:path";
654653
- import { homedir as homedir46 } from "node:os";
654845
+ import { homedir as homedir47 } from "node:os";
654654
654846
  import { spawn as spawn33 } from "node:child_process";
654655
654847
  import { fileURLToPath as fileURLToPath19 } from "node:url";
654656
654848
  function personaplexPythonEnv(extra = {}) {
@@ -655246,7 +655438,7 @@ print('Converted')
655246
655438
  let ollamaModel = process.env["HYBRID_LLM_MODEL"] || "";
655247
655439
  if (!ollamaModel) {
655248
655440
  try {
655249
- const omniusConfig = JSON.parse(readFileSync108(join142(homedir46(), ".omnius", "config.json"), "utf8"));
655441
+ const omniusConfig = JSON.parse(readFileSync108(join142(homedir47(), ".omnius", "config.json"), "utf8"));
655250
655442
  if (omniusConfig.model) ollamaModel = omniusConfig.model;
655251
655443
  } catch {
655252
655444
  }
@@ -655512,7 +655704,7 @@ function provisionShippedVoices(onInfo) {
655512
655704
  return deployed;
655513
655705
  }
655514
655706
  function getHFVoicesDir() {
655515
- const hfBase = join142(homedir46(), ".cache", "huggingface", "hub", "models--nvidia--personaplex-7b-v1");
655707
+ const hfBase = join142(homedir47(), ".cache", "huggingface", "hub", "models--nvidia--personaplex-7b-v1");
655516
655708
  if (!existsSync131(hfBase)) return null;
655517
655709
  try {
655518
655710
  const snapshots = join142(hfBase, "snapshots");
@@ -655528,7 +655720,7 @@ function getHFVoicesDir() {
655528
655720
  function patchFrontendVoiceList(onInfo) {
655529
655721
  const log22 = onInfo ?? (() => {
655530
655722
  });
655531
- const hfBase = join142(homedir46(), ".cache", "huggingface", "hub", "models--nvidia--personaplex-7b-v1");
655723
+ const hfBase = join142(homedir47(), ".cache", "huggingface", "hub", "models--nvidia--personaplex-7b-v1");
655532
655724
  if (!existsSync131(hfBase)) return;
655533
655725
  try {
655534
655726
  const snapshots = join142(hfBase, "snapshots");
@@ -655606,7 +655798,7 @@ var init_personaplex = __esm({
655606
655798
  nf4: { repo: "cudabenchmarktest/personaplex-7b-nf4", file: "model-nf4.safetensors", sizeGB: 4.1, needsToken: false },
655607
655799
  "nf4-distilled": { repo: "cudabenchmarktest/personaplex-7b-nf4-distilled", file: "student_best.pt", sizeGB: 16.7, needsToken: false }
655608
655800
  };
655609
- PERSONAPLEX_DIR = join142(homedir46(), ".omnius", "voice", "personaplex");
655801
+ PERSONAPLEX_DIR = join142(homedir47(), ".omnius", "voice", "personaplex");
655610
655802
  PID_FILE = join142(PERSONAPLEX_DIR, "daemon.pid");
655611
655803
  PORT_FILE = join142(PERSONAPLEX_DIR, "daemon.port");
655612
655804
  LOG_FILE = join142(PERSONAPLEX_DIR, "daemon.log");
@@ -655658,7 +655850,7 @@ import { spawn as spawn34, exec as exec5 } from "node:child_process";
655658
655850
  import { promisify as promisify7 } from "node:util";
655659
655851
  import { existsSync as existsSync132, writeFileSync as writeFileSync68, readFileSync as readFileSync109, appendFileSync as appendFileSync15, mkdirSync as mkdirSync80, chmodSync as chmodSync3 } from "node:fs";
655660
655852
  import { delimiter as pathDelimiter, join as join143 } from "node:path";
655661
- import { freemem as freemem8, homedir as homedir47, platform as platform6, totalmem as totalmem9 } from "node:os";
655853
+ import { freemem as freemem8, homedir as homedir48, platform as platform6, totalmem as totalmem9 } from "node:os";
655662
655854
  function wrapText2(value2, width) {
655663
655855
  const words = value2.split(/\s+/).filter(Boolean);
655664
655856
  const lines = [];
@@ -656142,7 +656334,7 @@ function detectAskpassHelper() {
656142
656334
  return null;
656143
656335
  }
656144
656336
  function writeAskpassHelper() {
656145
- const tmpDir = join143(homedir47(), ".omnius");
656337
+ const tmpDir = join143(homedir48(), ".omnius");
656146
656338
  try {
656147
656339
  mkdirSync80(tmpDir, { recursive: true });
656148
656340
  } catch {
@@ -657380,7 +657572,7 @@ ${c3.cyan(OMNIUS_FIRST_RUN_BANNER)}
657380
657572
  if (createModelfile.toLowerCase() !== "n") {
657381
657573
  try {
657382
657574
  const modelfileCandidates = expandedVariantContentCandidates(selectedVariant.tag, ctx3.numCtx);
657383
- const modelDir2 = join143(homedir47(), ".omnius", "models");
657575
+ const modelDir2 = join143(homedir48(), ".omnius", "models");
657384
657576
  mkdirSync80(modelDir2, { recursive: true });
657385
657577
  const modelfilePath = join143(modelDir2, `Modelfile.${customName}`);
657386
657578
  process.stdout.write(` ${c3.dim("Creating model...")} `);
@@ -657441,7 +657633,7 @@ async function isModelAvailable(config) {
657441
657633
  }
657442
657634
  function isFirstRun() {
657443
657635
  try {
657444
- return !existsSync132(join143(homedir47(), ".omnius", "config.json"));
657636
+ return !existsSync132(join143(homedir48(), ".omnius", "config.json"));
657445
657637
  } catch {
657446
657638
  return true;
657447
657639
  }
@@ -657499,7 +657691,7 @@ async function detectPkgManager() {
657499
657691
  return null;
657500
657692
  }
657501
657693
  function getVenvDir2() {
657502
- return join143(homedir47(), ".omnius", "venv");
657694
+ return join143(homedir48(), ".omnius", "venv");
657503
657695
  }
657504
657696
  async function hasVenvModule() {
657505
657697
  try {
@@ -657546,7 +657738,7 @@ async function ensureVenv2(log22) {
657546
657738
  }
657547
657739
  log22("Creating Python venv for vision deps...");
657548
657740
  try {
657549
- mkdirSync80(join143(homedir47(), ".omnius"), { recursive: true });
657741
+ mkdirSync80(join143(homedir48(), ".omnius"), { recursive: true });
657550
657742
  const pyCmd = hasCmd(pythonCmd) ? pythonCmd : "python3";
657551
657743
  await runShellCommandAsync(`${pyCmd} -m venv --clear "${venvDir}"`, { timeoutMs: 3e4 });
657552
657744
  try {
@@ -657666,7 +657858,7 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
657666
657858
  ];
657667
657859
  {
657668
657860
  const pm2 = await detectPkgManager();
657669
- const _visionMarkerDir = join143(homedir47(), ".omnius");
657861
+ const _visionMarkerDir = join143(homedir48(), ".omnius");
657670
657862
  const _visionMarkerFile = join143(_visionMarkerDir, "vision-deps-installed.json");
657671
657863
  let _visionPreviouslyInstalled = /* @__PURE__ */ new Set();
657672
657864
  try {
@@ -657921,11 +658113,11 @@ function ensureCloudflaredBackground(onInfo) {
657921
658113
  const cfArch = archMap[arch4] ?? "amd64";
657922
658114
  try {
657923
658115
  await runShellCommandAsync(
657924
- `curl -fsSL "https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-${cfArch}" -o /tmp/cloudflared && chmod +x /tmp/cloudflared && mkdir -p "${homedir47()}/.local/bin" && mv /tmp/cloudflared "${homedir47()}/.local/bin/cloudflared"`,
658116
+ `curl -fsSL "https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-${cfArch}" -o /tmp/cloudflared && chmod +x /tmp/cloudflared && mkdir -p "${homedir48()}/.local/bin" && mv /tmp/cloudflared "${homedir48()}/.local/bin/cloudflared"`,
657925
658117
  { timeoutMs: 6e4 }
657926
658118
  );
657927
- if (!process.env.PATH?.includes(`${homedir47()}/.local/bin`)) {
657928
- process.env.PATH = `${homedir47()}/.local/bin:${process.env.PATH}`;
658119
+ if (!process.env.PATH?.includes(`${homedir48()}/.local/bin`)) {
658120
+ process.env.PATH = `${homedir48()}/.local/bin:${process.env.PATH}`;
657929
658121
  }
657930
658122
  if (hasCmd("cloudflared")) {
657931
658123
  log22("cloudflared installed.");
@@ -658152,7 +658344,7 @@ async function createExpandedVariantNamedAsync(targetModel, baseModel, specs, si
658152
658344
  const ctx3 = calculateExpandedVariantContextWindow(specs, sizeGB, kvBytesPerToken, archMax);
658153
658345
  const modelfileCandidates = expandedVariantContentCandidates(baseModel, ctx3.numCtx);
658154
658346
  try {
658155
- const modelDir2 = join143(homedir47(), ".omnius", "models");
658347
+ const modelDir2 = join143(homedir48(), ".omnius", "models");
658156
658348
  mkdirSync80(modelDir2, { recursive: true });
658157
658349
  const modelfilePath = join143(modelDir2, `Modelfile.${targetModel}`);
658158
658350
  for (let i2 = 0; i2 < modelfileCandidates.length; i2++) {
@@ -658421,7 +658613,7 @@ async function ensureNeovim() {
658421
658613
  const platform8 = process.platform;
658422
658614
  const arch4 = process.arch;
658423
658615
  if (platform8 === "linux") {
658424
- const binDir = join143(homedir47(), ".local", "bin");
658616
+ const binDir = join143(homedir48(), ".local", "bin");
658425
658617
  const nvimDest = join143(binDir, "nvim");
658426
658618
  try {
658427
658619
  mkdirSync80(binDir, { recursive: true });
@@ -658505,7 +658697,7 @@ async function ensureNeovim() {
658505
658697
  }
658506
658698
  function ensurePathInShellRc(binDir) {
658507
658699
  const shell = process.env.SHELL ?? "";
658508
- const rcFile = shell.includes("zsh") ? join143(homedir47(), ".zshrc") : join143(homedir47(), ".bashrc");
658700
+ const rcFile = shell.includes("zsh") ? join143(homedir48(), ".zshrc") : join143(homedir48(), ".bashrc");
658509
658701
  try {
658510
658702
  const rcContent = existsSync132(rcFile) ? readFileSync109(rcFile, "utf8") : "";
658511
658703
  if (rcContent.includes(binDir)) return;
@@ -658708,7 +658900,7 @@ var init_registry3 = __esm({
658708
658900
 
658709
658901
  // packages/cli/src/tui/media-routing.ts
658710
658902
  import { existsSync as existsSync133 } from "node:fs";
658711
- import { homedir as homedir48 } from "node:os";
658903
+ import { homedir as homedir49 } from "node:os";
658712
658904
  function extractMediaReferences(text2) {
658713
658905
  const masked = maskCode(text2);
658714
658906
  const media = [];
@@ -658843,7 +659035,7 @@ function looksLikeLocalMedia(value2) {
658843
659035
  return !!kind && (existsSync133(expanded) || value2.startsWith("~/") || value2.startsWith("/"));
658844
659036
  }
658845
659037
  function expandHome2(value2) {
658846
- return value2.startsWith("~/") ? `${homedir48()}${value2.slice(1)}` : value2;
659038
+ return value2.startsWith("~/") ? `${homedir49()}${value2.slice(1)}` : value2;
658847
659039
  }
658848
659040
  function decodeUri(value2) {
658849
659041
  try {
@@ -663048,11 +663240,11 @@ import {
663048
663240
  unlinkSync as unlinkSync26
663049
663241
  } from "node:fs";
663050
663242
  import { dirname as dirname46, join as join148 } from "node:path";
663051
- import { homedir as homedir49 } from "node:os";
663243
+ import { homedir as homedir50 } from "node:os";
663052
663244
  import { randomBytes as randomBytes26 } from "node:crypto";
663053
663245
  function configHome() {
663054
663246
  const fromEnv = process.env["OMNIUS_CONFIG_HOME"]?.trim();
663055
- return fromEnv || join148(homedir49(), ".omnius");
663247
+ return fromEnv || join148(homedir50(), ".omnius");
663056
663248
  }
663057
663249
  function runtimeKeysFile() {
663058
663250
  const fromEnv = process.env["OMNIUS_RUNTIME_KEYS_FILE"]?.trim();
@@ -663202,9 +663394,9 @@ __export(daemon_exports, {
663202
663394
  stopDaemon: () => stopDaemon
663203
663395
  });
663204
663396
  import { spawn as spawn35 } from "node:child_process";
663205
- import { existsSync as existsSync140, readFileSync as readFileSync114, writeFileSync as writeFileSync70, mkdirSync as mkdirSync82, unlinkSync as unlinkSync27, openSync as openSync3, closeSync as closeSync3 } from "node:fs";
663397
+ import { existsSync as existsSync140, readFileSync as readFileSync114, writeFileSync as writeFileSync70, mkdirSync as mkdirSync82, unlinkSync as unlinkSync27, openSync as openSync4, closeSync as closeSync4 } from "node:fs";
663206
663398
  import { join as join149 } from "node:path";
663207
- import { homedir as homedir50 } from "node:os";
663399
+ import { homedir as homedir51 } from "node:os";
663208
663400
  import { fileURLToPath as fileURLToPath20 } from "node:url";
663209
663401
  import { dirname as dirname47 } from "node:path";
663210
663402
  function getDaemonPort() {
@@ -663332,8 +663524,8 @@ async function startDaemon() {
663332
663524
  let outFd = null;
663333
663525
  let errFd = null;
663334
663526
  try {
663335
- outFd = openSync3(join149(OMNIUS_DIR2, "daemon.log"), "a");
663336
- errFd = openSync3(join149(OMNIUS_DIR2, "daemon.err.log"), "a");
663527
+ outFd = openSync4(join149(OMNIUS_DIR2, "daemon.log"), "a");
663528
+ errFd = openSync4(join149(OMNIUS_DIR2, "daemon.err.log"), "a");
663337
663529
  const leaseId = newProcessLeaseId("daemon");
663338
663530
  const ownerId = `daemon:${getDaemonPort()}`;
663339
663531
  const child = spawn35(daemonCommand.command, daemonCommand.args, {
@@ -663372,11 +663564,11 @@ async function startDaemon() {
663372
663564
  return null;
663373
663565
  } finally {
663374
663566
  if (outFd !== null) try {
663375
- closeSync3(outFd);
663567
+ closeSync4(outFd);
663376
663568
  } catch {
663377
663569
  }
663378
663570
  if (errFd !== null) try {
663379
- closeSync3(errFd);
663571
+ closeSync4(errFd);
663380
663572
  } catch {
663381
663573
  }
663382
663574
  }
@@ -663531,7 +663723,7 @@ var OMNIUS_DIR2, PID_FILE2, DEFAULT_PORT2;
663531
663723
  var init_daemon = __esm({
663532
663724
  "packages/cli/src/daemon.ts"() {
663533
663725
  init_dist5();
663534
- OMNIUS_DIR2 = join149(homedir50(), ".omnius");
663726
+ OMNIUS_DIR2 = join149(homedir51(), ".omnius");
663535
663727
  PID_FILE2 = join149(OMNIUS_DIR2, "daemon.pid");
663536
663728
  DEFAULT_PORT2 = 11435;
663537
663729
  }
@@ -663964,11 +664156,11 @@ import {
663964
664156
  readdirSync as readdirSync46
663965
664157
  } from "node:fs";
663966
664158
  import { join as join152 } from "node:path";
663967
- import { homedir as homedir51 } from "node:os";
664159
+ import { homedir as homedir52 } from "node:os";
663968
664160
  import { randomUUID as randomUUID17 } from "node:crypto";
663969
664161
  function cronDir() {
663970
664162
  const override = process.env["OMNIUS_HOME"]?.trim();
663971
- const base3 = override || join152(homedir51(), ".omnius");
664163
+ const base3 = override || join152(homedir52(), ".omnius");
663972
664164
  return join152(base3, CRON_DIR_NAME);
663973
664165
  }
663974
664166
  function jobsFilePath() {
@@ -664504,17 +664696,17 @@ var init_delivery2 = __esm({
664504
664696
  import {
664505
664697
  existsSync as existsSync144,
664506
664698
  mkdirSync as mkdirSync84,
664507
- openSync as openSync5,
664508
- closeSync as closeSync5,
664699
+ openSync as openSync6,
664700
+ closeSync as closeSync6,
664509
664701
  writeFileSync as writeFileSync72,
664510
664702
  unlinkSync as unlinkSync29,
664511
664703
  readFileSync as readFileSync116
664512
664704
  } from "node:fs";
664513
664705
  import { join as join153 } from "node:path";
664514
- import { homedir as homedir52 } from "node:os";
664706
+ import { homedir as homedir53 } from "node:os";
664515
664707
  function cronDir2() {
664516
664708
  const override = process.env["OMNIUS_HOME"]?.trim();
664517
- const base3 = override || join153(homedir52(), ".omnius");
664709
+ const base3 = override || join153(homedir53(), ".omnius");
664518
664710
  return join153(base3, CRON_DIR_NAME);
664519
664711
  }
664520
664712
  function lockFilePath() {
@@ -664536,12 +664728,12 @@ function acquireTickLock() {
664536
664728
  } catch {
664537
664729
  }
664538
664730
  }
664539
- const fd = openSync5(lockPath, "wx");
664731
+ const fd = openSync6(lockPath, "wx");
664540
664732
  writeFileSync72(
664541
664733
  fd,
664542
664734
  JSON.stringify({ pid: process.pid, acquiredAt: Date.now() })
664543
664735
  );
664544
- closeSync5(fd);
664736
+ closeSync6(fd);
664545
664737
  return true;
664546
664738
  } catch {
664547
664739
  return false;
@@ -666238,6 +666430,84 @@ var init_telegram_inference = __esm({
666238
666430
  }
666239
666431
  });
666240
666432
 
666433
+ // packages/cli/src/tui/voice-room-dsp.ts
666434
+ function finite(value2, fallback) {
666435
+ return typeof value2 === "number" && Number.isFinite(value2) ? value2 : fallback;
666436
+ }
666437
+ function clamp10(value2, min, max) {
666438
+ return Math.min(max, Math.max(min, value2));
666439
+ }
666440
+ function normalizeVoiceRoomSettings(value2) {
666441
+ return {
666442
+ eqLowDb: clamp10(finite(value2?.eqLowDb, DEFAULT_VOICE_ROOM_SETTINGS.eqLowDb), -12, 12),
666443
+ eqHighDb: clamp10(finite(value2?.eqHighDb, DEFAULT_VOICE_ROOM_SETTINGS.eqHighDb), -12, 12),
666444
+ leftDelayMs: clamp10(finite(value2?.leftDelayMs, DEFAULT_VOICE_ROOM_SETTINGS.leftDelayMs), 0, 250),
666445
+ rightDelayMs: clamp10(finite(value2?.rightDelayMs, DEFAULT_VOICE_ROOM_SETTINGS.rightDelayMs), 0, 250),
666446
+ roomMix: clamp10(finite(value2?.roomMix, DEFAULT_VOICE_ROOM_SETTINGS.roomMix), 0, 0.5)
666447
+ };
666448
+ }
666449
+ function lowPass(input, sampleRate, cutoffHz) {
666450
+ const output = new Float32Array(input.length);
666451
+ const alpha = Math.exp(-2 * Math.PI * cutoffHz / Math.max(sampleRate, 1));
666452
+ let state = 0;
666453
+ for (let index = 0; index < input.length; index += 1) {
666454
+ state = (1 - alpha) * input[index] + alpha * state;
666455
+ output[index] = state;
666456
+ }
666457
+ return output;
666458
+ }
666459
+ function applyVoiceEq(mono, sampleRate, settings) {
666460
+ const output = new Float32Array(mono);
666461
+ if (settings.eqLowDb !== 0) {
666462
+ const low = lowPass(output, sampleRate, 180);
666463
+ const gain2 = Math.pow(10, settings.eqLowDb / 20) - 1;
666464
+ for (let index = 0; index < output.length; index += 1) {
666465
+ output[index] = output[index] + gain2 * low[index];
666466
+ }
666467
+ }
666468
+ if (settings.eqHighDb !== 0) {
666469
+ const low = lowPass(output, sampleRate, 4800);
666470
+ const gain2 = Math.pow(10, settings.eqHighDb / 20) - 1;
666471
+ for (let index = 0; index < output.length; index += 1) {
666472
+ output[index] = output[index] + gain2 * (output[index] - low[index]);
666473
+ }
666474
+ }
666475
+ return output;
666476
+ }
666477
+ function renderVoiceRoomStereo(mono, sampleRate, settings, interauralDelayMs = 0) {
666478
+ const equalized = applyVoiceEq(mono, sampleRate, settings);
666479
+ const leftDelay = Math.round(settings.leftDelayMs / 1e3 * sampleRate);
666480
+ const rightDelay = Math.round(settings.rightDelayMs / 1e3 * sampleRate);
666481
+ const interauralDelay = Math.max(0, Math.round(interauralDelayMs / 1e3 * sampleRate));
666482
+ const length4 = equalized.length + Math.max(leftDelay, rightDelay + interauralDelay);
666483
+ const left = new Float32Array(length4);
666484
+ const right = new Float32Array(length4);
666485
+ const dryGain = 1 - settings.roomMix;
666486
+ const reflectionGain = settings.roomMix / 2;
666487
+ for (let index = 0; index < equalized.length; index += 1) {
666488
+ const sample = equalized[index];
666489
+ left[index] += sample * dryGain;
666490
+ right[index + interauralDelay] += sample * dryGain;
666491
+ if (settings.roomMix > 0) {
666492
+ left[index + leftDelay] += sample * reflectionGain;
666493
+ right[index + rightDelay + interauralDelay] += sample * reflectionGain;
666494
+ }
666495
+ }
666496
+ return { left, right };
666497
+ }
666498
+ var DEFAULT_VOICE_ROOM_SETTINGS;
666499
+ var init_voice_room_dsp = __esm({
666500
+ "packages/cli/src/tui/voice-room-dsp.ts"() {
666501
+ DEFAULT_VOICE_ROOM_SETTINGS = {
666502
+ eqLowDb: 0,
666503
+ eqHighDb: 0,
666504
+ leftDelayMs: 16,
666505
+ rightDelayMs: 24,
666506
+ roomMix: 0.22
666507
+ };
666508
+ }
666509
+ });
666510
+
666241
666511
  // packages/cli/src/tui/voice.ts
666242
666512
  var voice_exports = {};
666243
666513
  __export(voice_exports, {
@@ -666265,7 +666535,7 @@ import {
666265
666535
  rmSync as rmSync12
666266
666536
  } from "node:fs";
666267
666537
  import { join as join155, dirname as dirname48, resolve as resolve67 } from "node:path";
666268
- import { homedir as homedir53, tmpdir as tmpdir23, platform as platform7 } from "node:os";
666538
+ import { homedir as homedir54, tmpdir as tmpdir23, platform as platform7 } from "node:os";
666269
666539
  import {
666270
666540
  spawn as nodeSpawn
666271
666541
  } from "node:child_process";
@@ -666322,7 +666592,7 @@ function getSupertonicVoiceOptions() {
666322
666592
  };
666323
666593
  }
666324
666594
  function voiceDir2() {
666325
- return join155(homedir53(), ".omnius", "voice");
666595
+ return join155(homedir54(), ".omnius", "voice");
666326
666596
  }
666327
666597
  function modelsDir() {
666328
666598
  return join155(voiceDir2(), "models");
@@ -666406,7 +666676,7 @@ function consolidateVoiceDirs2() {
666406
666676
  const globalVoice = voiceDir2();
666407
666677
  let migrated = 0;
666408
666678
  let cleaned = 0;
666409
- const oldVoice = join155(homedir53(), ".open-agents", "voice");
666679
+ const oldVoice = join155(homedir54(), ".open-agents", "voice");
666410
666680
  if (existsSync146(oldVoice)) {
666411
666681
  mergeDir2(join155(oldVoice, "clone-refs"), join155(globalVoice, "clone-refs"));
666412
666682
  mergeDir2(join155(oldVoice, "models"), join155(globalVoice, "models"));
@@ -666427,7 +666697,7 @@ function consolidateVoiceDirs2() {
666427
666697
  dir = dirname48(dir);
666428
666698
  }
666429
666699
  for (const root of COMMON_PROJECT_ROOTS) {
666430
- const rootDir = join155(homedir53(), root);
666700
+ const rootDir = join155(homedir54(), root);
666431
666701
  if (!existsSync146(rootDir)) continue;
666432
666702
  try {
666433
666703
  for (const entry of readdirSync47(rootDir, { withFileTypes: true })) {
@@ -667289,6 +667559,7 @@ var init_voice = __esm({
667289
667559
  init_render();
667290
667560
  init_daemon_registry();
667291
667561
  init_dist5();
667562
+ init_voice_room_dsp();
667292
667563
  VOICE_MODELS = {
667293
667564
  glados: {
667294
667565
  id: "glados",
@@ -667503,6 +667774,8 @@ except Exception as exc:
667503
667774
  * - "voicechat": live mic + TTS conversation via sub agent (no tool narration)
667504
667775
  */
667505
667776
  voiceMode = "action";
667777
+ /** Persisted EQ and stereo room controls for spoken replies. */
667778
+ roomSettings = { ...DEFAULT_VOICE_ROOM_SETTINGS };
667506
667779
  /**
667507
667780
  * Callback fired with PCM Int16 data whenever TTS synthesizes audio.
667508
667781
  * Used by VoiceSession to stream TTS output to WebSocket clients.
@@ -667742,7 +668015,7 @@ except Exception as exc:
667742
668015
  }
667743
668016
  p2 = p2.replace(/\\ /g, " ");
667744
668017
  if (p2.startsWith("~/") || p2 === "~") {
667745
- p2 = join155(homedir53(), p2.slice(1));
668018
+ p2 = join155(homedir54(), p2.slice(1));
667746
668019
  }
667747
668020
  if (!existsSync146(p2)) {
667748
668021
  return `File not found: ${p2}
@@ -667997,22 +668270,22 @@ except Exception as exc:
667997
668270
  }
667998
668271
  }
667999
668272
  /**
668000
- * Synthesize text to a WAV buffer (PCM 16-bit mono) without playing.
668273
+ * Synthesize text to a WAV buffer with the configured stereo room without playing.
668001
668274
  * Returns null if voice engine is not ready.
668002
668275
  * Used for sending TTS audio to Telegram and WebSocket clients.
668003
668276
  */
668004
668277
  async synthesizeToBuffer(text2) {
668005
668278
  if (this.luxttsActive) {
668006
- return this.synthesizeLuxttsToBuffer(text2);
668279
+ return this.renderVoiceReplyWav(await this.synthesizeLuxttsToBuffer(text2));
668007
668280
  }
668008
668281
  if (this.misottsActive) {
668009
- return this.synthesizeMisottsToBuffer(text2);
668282
+ return this.renderVoiceReplyWav(await this.synthesizeMisottsToBuffer(text2));
668010
668283
  }
668011
668284
  if (this.supertonicActive) {
668012
- return this.synthesizeSupertonicToBuffer(text2);
668285
+ return this.renderVoiceReplyWav(await this.synthesizeSupertonicToBuffer(text2));
668013
668286
  }
668014
668287
  if (this.mlxActive) {
668015
- return this.synthesizeMlxToBuffer(text2);
668288
+ return this.renderVoiceReplyWav(await this.synthesizeMlxToBuffer(text2));
668016
668289
  }
668017
668290
  if (!this.session || !this.config || !this.ort) return null;
668018
668291
  const cleaned = text2.replace(/\*/g, "");
@@ -668051,7 +668324,9 @@ except Exception as exc:
668051
668324
  const result = await this.session.run(feeds);
668052
668325
  const audioData = result["output"].data;
668053
668326
  if (audioData.length === 0) return null;
668054
- return this.buildWavBuffer(audioData, this.config.audio.sample_rate);
668327
+ return this.renderVoiceReplyWav(
668328
+ this.buildWavBuffer(audioData, this.config.audio.sample_rate)
668329
+ );
668055
668330
  }
668056
668331
  /**
668057
668332
  * Synthesize text to raw PCM Int16 buffer (no WAV header).
@@ -668351,7 +668626,7 @@ except Exception as exc:
668351
668626
  if (pitchFactor !== 1) {
668352
668627
  audioData = this.resamplePitch(audioData, pitchFactor);
668353
668628
  }
668354
- const stereo = this.applyStereoDelay(audioData, sampleRate, stereoDelayMs);
668629
+ const stereo = this.applyStereoRoom(audioData, sampleRate, stereoDelayMs);
668355
668630
  if (this.onPCMOutput) {
668356
668631
  const int16 = new Int16Array(audioData.length);
668357
668632
  for (let i2 = 0; i2 < audioData.length; i2++) {
@@ -668447,14 +668722,35 @@ except Exception as exc:
668447
668722
  * 0.6ms — primary voice, wide stereo presence ("speaking to you")
668448
668723
  * 0.15ms — secondary voice, narrow/centered ("background, recessed")
668449
668724
  */
668450
- applyStereoDelay(mono, sampleRate, delayMs) {
668451
- const delaySamples = Math.round(delayMs / 1e3 * sampleRate);
668452
- const outLen = mono.length + delaySamples;
668453
- const left = new Float32Array(outLen);
668454
- const right = new Float32Array(outLen);
668455
- left.set(mono, 0);
668456
- right.set(mono, delaySamples);
668457
- return { left, right };
668725
+ applyStereoRoom(mono, sampleRate, delayMs) {
668726
+ return renderVoiceRoomStereo(mono, sampleRate, this.roomSettings, delayMs);
668727
+ }
668728
+ getRoomSettings() {
668729
+ return { ...this.roomSettings };
668730
+ }
668731
+ setRoomSettings(patch) {
668732
+ this.roomSettings = normalizeVoiceRoomSettings({ ...this.roomSettings, ...patch });
668733
+ return this.getRoomSettings();
668734
+ }
668735
+ /** EQ-only transform for mono browser/telephony PCM protocols. */
668736
+ applyRoomEqToPcm(pcm, sampleRate) {
668737
+ const sampleCount = Math.floor(pcm.length / 2);
668738
+ const mono = new Float32Array(sampleCount);
668739
+ for (let index = 0; index < sampleCount; index += 1) {
668740
+ mono[index] = pcm.readInt16LE(index * 2) / 32768;
668741
+ }
668742
+ const equalized = renderVoiceRoomStereo(
668743
+ mono,
668744
+ sampleRate,
668745
+ { ...this.roomSettings, roomMix: 0 }
668746
+ ).left;
668747
+ const output = Buffer.alloc(pcm.length);
668748
+ for (let index = 0; index < sampleCount; index += 1) {
668749
+ const sample = Math.max(-1, Math.min(1, equalized[index]));
668750
+ output.writeInt16LE(Math.round(sample * (sample < 0 ? 32768 : 32767)), index * 2);
668751
+ }
668752
+ if (pcm.length % 2 === 1) output[pcm.length - 1] = pcm[pcm.length - 1];
668753
+ return output;
668458
668754
  }
668459
668755
  /**
668460
668756
  * Write a stereo (2-channel interleaved) WAV file from left/right Float32 channels.
@@ -668498,6 +668794,43 @@ except Exception as exc:
668498
668794
  }
668499
668795
  writeFileSync74(path16, buffer2);
668500
668796
  }
668797
+ /** Convert a mono reply WAV into a valid stereo room WAV. */
668798
+ renderVoiceReplyWav(wav) {
668799
+ if (!wav || wav.length <= 44 || wav.readUInt16LE(22) !== 1 || wav.readUInt16LE(34) !== 16) {
668800
+ return wav;
668801
+ }
668802
+ const sampleRate = wav.readUInt32LE(24);
668803
+ const sampleCount = Math.floor((wav.length - 44) / 2);
668804
+ const mono = new Float32Array(sampleCount);
668805
+ for (let index = 0; index < sampleCount; index += 1) {
668806
+ mono[index] = wav.readInt16LE(44 + index * 2) / 32768;
668807
+ }
668808
+ const stereo = this.applyStereoRoom(mono, sampleRate, 0);
668809
+ const dataSize = stereo.left.length * 4;
668810
+ const output = Buffer.alloc(44 + dataSize);
668811
+ output.write("RIFF", 0);
668812
+ output.writeUInt32LE(36 + dataSize, 4);
668813
+ output.write("WAVE", 8);
668814
+ output.write("fmt ", 12);
668815
+ output.writeUInt32LE(16, 16);
668816
+ output.writeUInt16LE(1, 20);
668817
+ output.writeUInt16LE(2, 22);
668818
+ output.writeUInt32LE(sampleRate, 24);
668819
+ output.writeUInt32LE(sampleRate * 4, 28);
668820
+ output.writeUInt16LE(4, 32);
668821
+ output.writeUInt16LE(16, 34);
668822
+ output.write("data", 36);
668823
+ output.writeUInt32LE(dataSize, 40);
668824
+ let position = 44;
668825
+ for (let index = 0; index < stereo.left.length; index += 1) {
668826
+ const left = Math.max(-1, Math.min(1, stereo.left[index]));
668827
+ const right = Math.max(-1, Math.min(1, stereo.right[index]));
668828
+ output.writeInt16LE(Math.round(left * (left < 0 ? 32768 : 32767)), position);
668829
+ output.writeInt16LE(Math.round(right * (right < 0 ? 32768 : 32767)), position + 2);
668830
+ position += 4;
668831
+ }
668832
+ return output;
668833
+ }
668501
668834
  // -------------------------------------------------------------------------
668502
668835
  // Phonemization
668503
668836
  // -------------------------------------------------------------------------
@@ -670080,7 +670413,7 @@ if __name__ == '__main__':
670080
670413
  for (let i2 = 0; i2 < int16.length; i2++) {
670081
670414
  float32[i2] = int16[i2] / 32768;
670082
670415
  }
670083
- const stereo = this.applyStereoDelay(
670416
+ const stereo = this.applyStereoRoom(
670084
670417
  float32,
670085
670418
  sampleRate,
670086
670419
  stereoDelayMs
@@ -670447,7 +670780,7 @@ if __name__ == "__main__":
670447
670780
  for (let i2 = 0; i2 < int16.length; i2++) {
670448
670781
  float32[i2] = int16[i2] / 32768;
670449
670782
  }
670450
- const stereo = this.applyStereoDelay(
670783
+ const stereo = this.applyStereoRoom(
670451
670784
  float32,
670452
670785
  sampleRate,
670453
670786
  stereoDelayMs
@@ -671669,9 +672002,9 @@ async function handleSlashCommand(input, ctx3) {
671669
672002
  const trimmed2 = arg.trim();
671670
672003
  if (!trimmed2) {
671671
672004
  const disk = getModelStoreDiskInfo();
671672
- const cached = listCachedModels();
672005
+ const cached2 = listCachedModels();
671673
672006
  const legacyPaths = detectLegacyCaches(ctx3.repoRoot);
671674
- const totalCachedBytes = cached.reduce(
672007
+ const totalCachedBytes = cached2.reduce(
671675
672008
  (sum2, e2) => sum2 + e2.sizeBytes,
671676
672009
  0
671677
672010
  );
@@ -671680,22 +672013,22 @@ async function handleSlashCommand(input, ctx3) {
671680
672013
  `Disk: ${formatBytes(disk.freeBytes)} free of ${formatBytes(disk.totalBytes)} (${formatBytes(disk.usedBytes)} used)`
671681
672014
  );
671682
672015
  renderInfo(
671683
- `Cached models tracked: ${cached.length} (${formatBytes(totalCachedBytes)})`
672016
+ `Cached models tracked: ${cached2.length} (${formatBytes(totalCachedBytes)})`
671684
672017
  );
671685
- if (cached.length === 0) {
672018
+ if (cached2.length === 0) {
671686
672019
  renderInfo(
671687
672020
  " (none yet — first /image /video /sound /music run will populate)"
671688
672021
  );
671689
672022
  } else {
671690
- for (const entry of cached.slice(0, 20)) {
672023
+ for (const entry of cached2.slice(0, 20)) {
671691
672024
  const ageSec = Math.round((Date.now() - entry.lastUsedMs) / 1e3);
671692
672025
  const ageStr = ageSec < 60 ? `${ageSec}s ago` : ageSec < 3600 ? `${Math.round(ageSec / 60)}m ago` : ageSec < 86400 ? `${Math.round(ageSec / 3600)}h ago` : `${Math.round(ageSec / 86400)}d ago`;
671693
672026
  renderInfo(
671694
672027
  ` ${entry.repo} — ${formatBytes(entry.sizeBytes)} — used ${ageStr}${entry.kind ? ` [${entry.kind}]` : ""}`
671695
672028
  );
671696
672029
  }
671697
- if (cached.length > 20)
671698
- renderInfo(` ... +${cached.length - 20} more`);
672030
+ if (cached2.length > 20)
672031
+ renderInfo(` ... +${cached2.length - 20} more`);
671699
672032
  }
671700
672033
  if (legacyPaths.length > 0) {
671701
672034
  renderWarning(`Legacy per-repo caches detected (no longer used):`);
@@ -672543,10 +672876,10 @@ async function handleSlashCommand(input, ctx3) {
672543
672876
  "Use the Web UI ‘key’ button to paste this token, or set Authorization: Bearer <key> in your client."
672544
672877
  );
672545
672878
  try {
672546
- const { homedir: homedir67 } = await import("node:os");
672879
+ const { homedir: homedir68 } = await import("node:os");
672547
672880
  const { mkdirSync: mkdirSync115, writeFileSync: writeFileSync98 } = await import("node:fs");
672548
672881
  const { join: join191 } = await import("node:path");
672549
- const dir = join191(homedir67(), ".omnius");
672882
+ const dir = join191(homedir68(), ".omnius");
672550
672883
  mkdirSync115(dir, { recursive: true });
672551
672884
  writeFileSync98(join191(dir, "api.key"), apiKey + "\n", "utf8");
672552
672885
  } catch {
@@ -672559,10 +672892,10 @@ async function handleSlashCommand(input, ctx3) {
672559
672892
  }
672560
672893
  const port2 = parseInt(process.env["OMNIUS_PORT"] || "11435", 10);
672561
672894
  try {
672562
- const { homedir: homedir67 } = await import("node:os");
672895
+ const { homedir: homedir68 } = await import("node:os");
672563
672896
  const { mkdirSync: mkdirSync115, writeFileSync: writeFileSync98 } = await import("node:fs");
672564
672897
  const { join: join191 } = await import("node:path");
672565
- const dir = join191(homedir67(), ".omnius");
672898
+ const dir = join191(homedir68(), ".omnius");
672566
672899
  mkdirSync115(dir, { recursive: true });
672567
672900
  writeFileSync98(join191(dir, "access"), `${val2}
672568
672901
  `, "utf8");
@@ -672663,10 +672996,10 @@ async function handleSlashCommand(input, ctx3) {
672663
672996
  "Use the Web UI ‘key’ button to paste this token, or set Authorization: Bearer <key> in your client."
672664
672997
  );
672665
672998
  try {
672666
- const { homedir: homedir67 } = await import("node:os");
672999
+ const { homedir: homedir68 } = await import("node:os");
672667
673000
  const { mkdirSync: mkdirSync115, writeFileSync: writeFileSync98 } = await import("node:fs");
672668
673001
  const { join: join191 } = await import("node:path");
672669
- const dir = join191(homedir67(), ".omnius");
673002
+ const dir = join191(homedir68(), ".omnius");
672670
673003
  mkdirSync115(dir, { recursive: true });
672671
673004
  writeFileSync98(join191(dir, "api.key"), apiKey + "\n", "utf8");
672672
673005
  } catch {
@@ -672678,11 +673011,11 @@ async function handleSlashCommand(input, ctx3) {
672678
673011
  ctx3.saveSettings({ omniusAccess: val });
672679
673012
  }
672680
673013
  const port = parseInt(process.env["OMNIUS_PORT"] || "11435", 10);
672681
- const { homedir: homedir66 } = await import("node:os");
673014
+ const { homedir: homedir67 } = await import("node:os");
672682
673015
  const { mkdirSync: mkdirSync114, writeFileSync: writeFileSync97 } = await import("node:fs");
672683
673016
  const { join: join190 } = await import("node:path");
672684
673017
  try {
672685
- const dir = join190(homedir66(), ".omnius");
673018
+ const dir = join190(homedir67(), ".omnius");
672686
673019
  mkdirSync114(dir, { recursive: true });
672687
673020
  writeFileSync97(join190(dir, "access"), `${val}
672688
673021
  `, "utf8");
@@ -673189,7 +673522,7 @@ async function handleSlashCommand(input, ctx3) {
673189
673522
  );
673190
673523
  }
673191
673524
  } else if (sub2 === "name") {
673192
- const { homedir: homedir66 } = __require("node:os");
673525
+ const { homedir: homedir67 } = __require("node:os");
673193
673526
  const {
673194
673527
  existsSync: ex,
673195
673528
  readFileSync: rf,
@@ -673197,7 +673530,7 @@ async function handleSlashCommand(input, ctx3) {
673197
673530
  mkdirSync: mkd
673198
673531
  } = __require("node:fs");
673199
673532
  const namePath = __require("node:path").join(
673200
- homedir66(),
673533
+ homedir67(),
673201
673534
  ".omnius",
673202
673535
  "agent-name"
673203
673536
  );
@@ -676271,9 +676604,9 @@ sleep 1
676271
676604
  let sponsorName = (config.header.message || "").replace(/^\/+/, "").trim();
676272
676605
  if (!sponsorName || sponsorName.length < 2) {
676273
676606
  try {
676274
- const { homedir: homedir66 } = __require("os");
676607
+ const { homedir: homedir67 } = __require("os");
676275
676608
  const namePath = __require("path").join(
676276
- homedir66(),
676609
+ homedir67(),
676277
676610
  ".omnius",
676278
676611
  "agent-name"
676279
676612
  );
@@ -682332,6 +682665,83 @@ function formatFileSize(bytes) {
682332
682665
  if (bytes < 1024 ** 4) return `${(bytes / 1024 ** 3).toFixed(1)}GB`;
682333
682666
  return `${(bytes / 1024 ** 4).toFixed(1)}TB`;
682334
682667
  }
682668
+ async function handleVoiceRoomMenu(ctx3, save3) {
682669
+ const defaults3 = {
682670
+ eqLowDb: 0,
682671
+ eqHighDb: 0,
682672
+ leftDelayMs: 16,
682673
+ rightDelayMs: 24,
682674
+ roomMix: 0.22
682675
+ };
682676
+ const controls = [
682677
+ {
682678
+ key: "eqLowDb",
682679
+ label: "Low EQ",
682680
+ values: [-12, -6, -3, 0, 3, 6, 12],
682681
+ display: (value2) => `${value2 >= 0 ? "+" : ""}${value2.toFixed(0)} dB @ 180 Hz`
682682
+ },
682683
+ {
682684
+ key: "eqHighDb",
682685
+ label: "High EQ",
682686
+ values: [-12, -6, -3, 0, 3, 6, 12],
682687
+ display: (value2) => `${value2 >= 0 ? "+" : ""}${value2.toFixed(0)} dB @ 4.8 kHz`
682688
+ },
682689
+ {
682690
+ key: "leftDelayMs",
682691
+ label: "Left room delay",
682692
+ values: [0, 5, 10, 16, 24, 32, 45, 60, 90, 120],
682693
+ display: (value2) => `${value2.toFixed(0)} ms`
682694
+ },
682695
+ {
682696
+ key: "rightDelayMs",
682697
+ label: "Right room delay",
682698
+ values: [0, 5, 10, 16, 24, 32, 45, 60, 90, 120],
682699
+ display: (value2) => `${value2.toFixed(0)} ms`
682700
+ },
682701
+ {
682702
+ key: "roomMix",
682703
+ label: "Room reflection mix",
682704
+ values: [0, 0.1, 0.2, 0.3, 0.4, 0.5],
682705
+ display: (value2) => `${Math.round(value2 * 100)}%`
682706
+ }
682707
+ ];
682708
+ while (true) {
682709
+ const current = { ...defaults3, ...ctx3.voiceGetRoomSettings?.() ?? {} };
682710
+ const result = await tuiSelect({
682711
+ items: controls.map((control2) => ({
682712
+ key: control2.key,
682713
+ label: control2.label,
682714
+ detail: control2.display(current[control2.key])
682715
+ })),
682716
+ title: "Voice EQ and Room",
682717
+ breadcrumbs: ["Voice"],
682718
+ rl: ctx3.rl,
682719
+ availableRows: ctx3.availableContentRows?.()
682720
+ });
682721
+ if (!result.confirmed || !result.key) return;
682722
+ const control = controls.find((candidate) => candidate.key === result.key);
682723
+ if (!control) continue;
682724
+ const valueResult = await tuiSelect({
682725
+ items: control.values.map((value3) => ({
682726
+ key: String(value3),
682727
+ label: control.display(value3)
682728
+ })),
682729
+ activeKey: String(current[control.key]),
682730
+ title: control.label,
682731
+ breadcrumbs: ["Voice", "EQ and Room"],
682732
+ rl: ctx3.rl,
682733
+ availableRows: ctx3.availableContentRows?.()
682734
+ });
682735
+ if (!valueResult.confirmed || valueResult.key === void 0) continue;
682736
+ const value2 = Number(valueResult.key);
682737
+ if (!Number.isFinite(value2)) continue;
682738
+ const updated = ctx3.voiceSetRoomSettings?.({ [control.key]: value2 }) ?? {
682739
+ ...current,
682740
+ [control.key]: value2
682741
+ };
682742
+ save3({ voiceRoom: updated });
682743
+ }
682744
+ }
682335
682745
  async function handleVoiceMenu(ctx3, save3, hasLocal) {
682336
682746
  const modeLabels = {
682337
682747
  chat: "Chat — speaks model responses",
@@ -682343,6 +682753,13 @@ async function handleVoiceMenu(ctx3, save3, hasLocal) {
682343
682753
  const isEnabled = ctx3.voiceIsEnabled?.() ?? false;
682344
682754
  const currentMode = ctx3.voiceGetMode?.() ?? "action";
682345
682755
  const currentModel = ctx3.voiceGetModel?.() ?? "unknown";
682756
+ const room = ctx3.voiceGetRoomSettings?.() ?? {
682757
+ eqLowDb: 0,
682758
+ eqHighDb: 0,
682759
+ leftDelayMs: 16,
682760
+ rightDelayMs: 24,
682761
+ roomMix: 0.22
682762
+ };
682346
682763
  const enabledLabel = isEnabled ? selectColors.green("● Voice: Enabled") : selectColors.dim("○ Voice: Disabled");
682347
682764
  const clones = ctx3.voiceListClones?.() ?? [];
682348
682765
  const activeClone = clones.find((c9) => c9.isActive);
@@ -682383,6 +682800,11 @@ async function handleVoiceMenu(ctx3, save3, hasLocal) {
682383
682800
  key: "system",
682384
682801
  label: "Change TTS System",
682385
682802
  detail: "onnx / mlx / luxtts / misotts / supertonic3"
682803
+ },
682804
+ {
682805
+ key: "room",
682806
+ label: "EQ and Stereo Room",
682807
+ detail: `low ${room.eqLowDb >= 0 ? "+" : ""}${room.eqLowDb}dB high ${room.eqHighDb >= 0 ? "+" : ""}${room.eqHighDb}dB L ${room.leftDelayMs}ms R ${room.rightDelayMs}ms wet ${Math.round(room.roomMix * 100)}%`
682386
682808
  }
682387
682809
  ];
682388
682810
  if (isMisotts) {
@@ -682496,6 +682918,10 @@ async function handleVoiceMenu(ctx3, save3, hasLocal) {
682496
682918
  ctx3.voiceSpeak?.(phrase);
682497
682919
  continue;
682498
682920
  }
682921
+ case "room": {
682922
+ await handleVoiceRoomMenu(ctx3, save3);
682923
+ continue;
682924
+ }
682499
682925
  case "mode": {
682500
682926
  const modeItems = [
682501
682927
  {
@@ -682694,13 +683120,13 @@ async function handleVoiceMenu(ctx3, save3, hasLocal) {
682694
683120
  mkdirSync: mkdirSync114,
682695
683121
  existsSync: exists2
682696
683122
  } = await import("node:fs");
682697
- const { homedir: homedir66 } = await import("node:os");
683123
+ const { homedir: homedir67 } = await import("node:os");
682698
683124
  const modelName = basename46(onnxDrop.path, ".onnx").replace(
682699
683125
  /[^a-zA-Z0-9_-]/g,
682700
683126
  "-"
682701
683127
  );
682702
683128
  const destDir = pathJoin(
682703
- homedir66(),
683129
+ homedir67(),
682704
683130
  ".omnius",
682705
683131
  "voice",
682706
683132
  "models",
@@ -684487,11 +684913,11 @@ async function handleSponsoredEndpoint(ctx3, local) {
684487
684913
  try {
684488
684914
  const { mkdirSync: mkdirSync114, writeFileSync: writeFileSync97 } = __require("node:fs");
684489
684915
  mkdirSync114(sponsorDir2, { recursive: true });
684490
- const cached = verified.map((s2) => ({
684916
+ const cached2 = verified.map((s2) => ({
684491
684917
  ...s2,
684492
684918
  lastVerified: Date.now()
684493
684919
  }));
684494
- writeFileSync97(knownFile, JSON.stringify(cached, null, 2));
684920
+ writeFileSync97(knownFile, JSON.stringify(cached2, null, 2));
684495
684921
  } catch {
684496
684922
  }
684497
684923
  }
@@ -687469,12 +687895,12 @@ var init_commands = __esm({
687469
687895
  if (val === "any" && !process.env["OMNIUS_API_KEY"]) {
687470
687896
  try {
687471
687897
  const { randomBytes: randomBytes31 } = await import("node:crypto");
687472
- const { homedir: homedir66 } = await import("node:os");
687898
+ const { homedir: homedir67 } = await import("node:os");
687473
687899
  const { mkdirSync: mkdirSync114, writeFileSync: writeFileSync97 } = await import("node:fs");
687474
687900
  const { join: join190 } = await import("node:path");
687475
687901
  const apiKey = randomBytes31(16).toString("hex");
687476
687902
  process.env["OMNIUS_API_KEY"] = apiKey;
687477
- const dir = join190(homedir66(), ".omnius");
687903
+ const dir = join190(homedir67(), ".omnius");
687478
687904
  mkdirSync114(dir, { recursive: true });
687479
687905
  writeFileSync97(join190(dir, "api.key"), apiKey + "\n", "utf8");
687480
687906
  renderInfo(`Generated API key: ${c3.bold(c3.yellow(apiKey))}`);
@@ -687494,10 +687920,10 @@ var init_commands = __esm({
687494
687920
  }
687495
687921
  const port = parseInt(process.env["OMNIUS_PORT"] || "11435", 10);
687496
687922
  try {
687497
- const { homedir: homedir66 } = await import("node:os");
687923
+ const { homedir: homedir67 } = await import("node:os");
687498
687924
  const { mkdirSync: mkdirSync114, writeFileSync: writeFileSync97 } = await import("node:fs");
687499
687925
  const { join: join190 } = await import("node:path");
687500
- const dir = join190(homedir66(), ".omnius");
687926
+ const dir = join190(homedir67(), ".omnius");
687501
687927
  mkdirSync114(dir, { recursive: true });
687502
687928
  writeFileSync97(join190(dir, "access"), `${val}
687503
687929
  `, "utf8");
@@ -687944,9 +688370,9 @@ import {
687944
688370
  appendFileSync as appendFileSync17
687945
688371
  } from "node:fs";
687946
688372
  import { join as join158, resolve as resolve69 } from "node:path";
687947
- import { homedir as homedir55 } from "node:os";
688373
+ import { homedir as homedir56 } from "node:os";
687948
688374
  function sessionsDir() {
687949
- return join158(homedir55(), ".omnius", "chat-sessions");
688375
+ return join158(homedir56(), ".omnius", "chat-sessions");
687950
688376
  }
687951
688377
  function sessionPath(id2) {
687952
688378
  const safe = id2.replace(/[^a-zA-Z0-9_.-]/g, "_");
@@ -688424,8 +688850,8 @@ function deleteSession2(id2) {
688424
688850
  return removed;
688425
688851
  }
688426
688852
  function lookupSession(id2) {
688427
- const cached = sessions2.get(id2);
688428
- if (cached) return cached;
688853
+ const cached2 = sessions2.get(id2);
688854
+ if (cached2) return cached2;
688429
688855
  try {
688430
688856
  const fp = sessionPath(id2);
688431
688857
  if (existsSync149(fp)) {
@@ -688477,8 +688903,8 @@ function finishInFlightChat(sessionId, status, finalContent, error) {
688477
688903
  }, 3e4).unref?.();
688478
688904
  }
688479
688905
  function getInFlightChat(sessionId) {
688480
- const cached = inFlight.get(sessionId);
688481
- if (cached) return cached;
688906
+ const cached2 = inFlight.get(sessionId);
688907
+ if (cached2) return cached2;
688482
688908
  try {
688483
688909
  const p2 = inFlightPath(sessionId);
688484
688910
  if (existsSync149(p2)) {
@@ -690426,8 +690852,8 @@ function loadCachedDescriptors(repoRoot) {
690426
690852
  const filePath = join160(repoRoot, OMNIUS_DIR, "context", DESCRIPTOR_FILE);
690427
690853
  try {
690428
690854
  if (!existsSync152(filePath)) return null;
690429
- const cached = JSON.parse(readFileSync123(filePath, "utf-8"));
690430
- return cached.phrases.length > 0 ? cached.phrases : null;
690855
+ const cached2 = JSON.parse(readFileSync123(filePath, "utf-8"));
690856
+ return cached2.phrases.length > 0 ? cached2.phrases : null;
690431
690857
  } catch {
690432
690858
  return null;
690433
690859
  }
@@ -690435,12 +690861,12 @@ function loadCachedDescriptors(repoRoot) {
690435
690861
  function saveCachedDescriptors(repoRoot, phrases, sourceHash) {
690436
690862
  const contextDir = join160(repoRoot, OMNIUS_DIR, "context");
690437
690863
  mkdirSync90(contextDir, { recursive: true });
690438
- const cached = {
690864
+ const cached2 = {
690439
690865
  phrases,
690440
690866
  generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
690441
690867
  sourceHash
690442
690868
  };
690443
- writeFileSync78(join160(contextDir, DESCRIPTOR_FILE), JSON.stringify(cached, null, 2), "utf-8");
690869
+ writeFileSync78(join160(contextDir, DESCRIPTOR_FILE), JSON.stringify(cached2, null, 2), "utf-8");
690444
690870
  }
690445
690871
  function generateDescriptors(repoRoot) {
690446
690872
  const profile = loadToolProfile(repoRoot);
@@ -695625,7 +696051,7 @@ function appraiseEvent(event) {
695625
696051
  return null;
695626
696052
  }
695627
696053
  }
695628
- function clamp10(value2, min, max) {
696054
+ function clamp11(value2, min, max) {
695629
696055
  return Math.max(min, Math.min(max, value2));
695630
696056
  }
695631
696057
  var BASELINE_VALENCE, BASELINE_AROUSAL, DECAY_HALF_LIFE_MS, LABEL_UPDATE_INTERVAL_MS, DISTRESS_THRESHOLD, REFLECTION_COOLDOWN_MS, REFLECTION_MIN_EVENTS, LABEL_REGEN_THRESHOLD, EmotionEngine;
@@ -695763,8 +696189,8 @@ var init_emotion_engine = __esm({
695763
696189
  if (this.consecutiveFailures >= 2) {
695764
696190
  momentum = 1 + (this.consecutiveFailures - 1) * 0.25;
695765
696191
  }
695766
- this.state.valence = clamp10(this.state.valence + delta.valence * momentum, -1, 1);
695767
- this.state.arousal = clamp10(this.state.arousal + delta.arousal * momentum, 0, 1);
696192
+ this.state.valence = clamp11(this.state.valence + delta.valence * momentum, -1, 1);
696193
+ this.state.arousal = clamp11(this.state.arousal + delta.arousal * momentum, 0, 1);
695768
696194
  this.state.updatedAt = Date.now();
695769
696195
  const deterministicLabel = labelFromCoordinates(this.state.valence, this.state.arousal);
695770
696196
  this.state.label = deterministicLabel.label;
@@ -701471,7 +701897,7 @@ import {
701471
701897
  isAbsolute as isAbsolute17,
701472
701898
  extname as extname21
701473
701899
  } from "node:path";
701474
- import { homedir as homedir56 } from "node:os";
701900
+ import { homedir as homedir57 } from "node:os";
701475
701901
  import {
701476
701902
  appendFile as appendFileAsync,
701477
701903
  mkdir as mkdirAsync,
@@ -706205,11 +706631,11 @@ ${message2}`)
706205
706631
  }
706206
706632
  telegramModelMenuItems(generation) {
706207
706633
  return this.telegramGenerationModelDescriptors(generation).map((model) => {
706208
- const cached = model.cachedBytes > 0 ? `cached ${formatModelBytes(model.cachedBytes)}` : "not downloaded";
706634
+ const cached2 = model.cachedBytes > 0 ? `cached ${formatModelBytes(model.cachedBytes)}` : "not downloaded";
706209
706635
  const fit5 = model.recommendedVramGB ? `${model.recommendedVramGB}GB VRAM rec` : model.minVramGB ? `${model.minVramGB}GB VRAM min` : "VRAM n/a";
706210
706636
  return {
706211
706637
  label: model.label,
706212
- description: `${model.backend} - ${model.category} - ${fit5} - ${cached}`,
706638
+ description: `${model.backend} - ${model.category} - ${fit5} - ${cached2}`,
706213
706639
  action: {
706214
706640
  type: "model_detail",
706215
706641
  generation,
@@ -706219,14 +706645,14 @@ ${message2}`)
706219
706645
  });
706220
706646
  }
706221
706647
  telegramModelDetailBody(model) {
706222
- const cached = model.cachedBytes > 0 ? `${formatModelBytes(model.cachedBytes)} cached` : "not downloaded";
706648
+ const cached2 = model.cachedBytes > 0 ? `${formatModelBytes(model.cachedBytes)} cached` : "not downloaded";
706223
706649
  const deps = model.dependencies.length > 0 ? model.dependencies.join(", ") : model.id;
706224
706650
  return [
706225
706651
  `id: ${model.id}`,
706226
706652
  `backend: ${model.backend}`,
706227
706653
  `category: ${model.category}`,
706228
706654
  `size: ${model.sizeClass || "unknown"}`,
706229
- `download: ${model.approxDownloadGB ? `~${model.approxDownloadGB}GB` : "unknown"}; cache: ${cached}`,
706655
+ `download: ${model.approxDownloadGB ? `~${model.approxDownloadGB}GB` : "unknown"}; cache: ${cached2}`,
706230
706656
  `vram: min ${model.minVramGB ?? "?"}GB; recommended ${model.recommendedVramGB ?? "?"}GB`,
706231
706657
  `dependencies: ${deps}`,
706232
706658
  model.unavailableReason ? `runtime note: ${model.unavailableReason}` : "",
@@ -712404,7 +712830,7 @@ ${TELEGRAM_PUBLIC_ORCHESTRATOR_CONTRACT}`
712404
712830
  }
712405
712831
  if (me.result?.id) {
712406
712832
  const botUserId = Number(me.result.id);
712407
- const globalLockDir = process.env["OMNIUS_TELEGRAM_LOCK_DIR"] ? resolve73(process.env["OMNIUS_TELEGRAM_LOCK_DIR"]) : resolve73(homedir56(), ".omnius", "telegram-runner-state");
712833
+ const globalLockDir = process.env["OMNIUS_TELEGRAM_LOCK_DIR"] ? resolve73(process.env["OMNIUS_TELEGRAM_LOCK_DIR"]) : resolve73(homedir57(), ".omnius", "telegram-runner-state");
712408
712834
  const lockDirs = /* @__PURE__ */ new Set([globalLockDir]);
712409
712835
  if (this.repoRoot) {
712410
712836
  lockDirs.add(
@@ -717437,9 +717863,9 @@ Scoped workspace: ${scopedRoot}`,
717437
717863
  }
717438
717864
  async getBotChatRights(chatId, force = false) {
717439
717865
  const key = String(chatId);
717440
- const cached = this.telegramBotRightsCache.get(key);
717441
- if (!force && cached && Date.now() - cached.checkedAt < 6e4)
717442
- return cached;
717866
+ const cached2 = this.telegramBotRightsCache.get(key);
717867
+ if (!force && cached2 && Date.now() - cached2.checkedAt < 6e4)
717868
+ return cached2;
717443
717869
  const botId = await this.getTelegramBotUserId();
717444
717870
  const member = await this.getChatMember(chatId, botId);
717445
717871
  if (!member)
@@ -721468,6 +721894,7 @@ import { EventEmitter as EventEmitter13 } from "node:events";
721468
721894
  function getVoiceEngine() {
721469
721895
  if (!_voiceEngine) {
721470
721896
  _voiceEngine = new VoiceEngine();
721897
+ _voiceEngine.setRoomSettings(loadGlobalSettings().voiceRoom ?? {});
721471
721898
  }
721472
721899
  return _voiceEngine;
721473
721900
  }
@@ -721565,7 +721992,7 @@ async function synthesizeToWav(text2, format3 = "wav") {
721565
721992
  const result = await voice.synthesizeToPCM(text2);
721566
721993
  if (!result || !result.pcm || result.pcm.length === 0) return null;
721567
721994
  const sampleRate = result.sampleRate;
721568
- const pcm = result.pcm;
721995
+ const pcm = voice.applyRoomEqToPcm(result.pcm, sampleRate);
721569
721996
  if (format3 === "pcm") return { bytes: pcm, sampleRate, format: format3 };
721570
721997
  const header = Buffer.alloc(44);
721571
721998
  header.write("RIFF", 0);
@@ -721595,7 +722022,11 @@ async function synthesizeAndBroadcast(text2) {
721595
722022
  const result = await voice.synthesizeToPCM(text2);
721596
722023
  if (!result || !result.pcm || result.pcm.length === 0) return;
721597
722024
  getVoiceBus().emit("agent_text", { text: text2 });
721598
- getVoiceBus().emit("tts_pcm", result.pcm, result.sampleRate);
722025
+ getVoiceBus().emit(
722026
+ "tts_pcm",
722027
+ voice.applyRoomEqToPcm(result.pcm, result.sampleRate),
722028
+ result.sampleRate
722029
+ );
721599
722030
  } catch (err) {
721600
722031
  const m2 = err instanceof Error ? err.message : String(err);
721601
722032
  getVoiceBus().emit("error", `tts: ${m2}`);
@@ -721686,6 +722117,7 @@ var _voiceEngine, _listenEngine, _voiceChatSession, _bus, _state3, _loadedAt, _l
721686
722117
  var init_voice_runtime = __esm({
721687
722118
  "packages/cli/src/api/voice-runtime.ts"() {
721688
722119
  init_voice();
722120
+ init_omnius_directory();
721689
722121
  init_listen();
721690
722122
  init_voicechat();
721691
722123
  _voiceEngine = null;
@@ -721976,7 +722408,7 @@ __export(projects_exports, {
721976
722408
  unregisterProject: () => unregisterProject
721977
722409
  });
721978
722410
  import { readFileSync as readFileSync132, writeFileSync as writeFileSync86, mkdirSync as mkdirSync99, existsSync as existsSync161, statSync as statSync62, renameSync as renameSync15 } from "node:fs";
721979
- import { homedir as homedir57 } from "node:os";
722411
+ import { homedir as homedir58 } from "node:os";
721980
722412
  import { basename as basename43, join as join171, resolve as resolve74 } from "node:path";
721981
722413
  import { randomUUID as randomUUID19 } from "node:crypto";
721982
722414
  function readAll2() {
@@ -722088,7 +722520,7 @@ function _resetCurrentProject() {
722088
722520
  var OMNIUS_DIR3, PROJECTS_FILE, CURRENT_FILE, currentRoot;
722089
722521
  var init_projects = __esm({
722090
722522
  "packages/cli/src/api/projects.ts"() {
722091
- OMNIUS_DIR3 = join171(homedir57(), ".omnius");
722523
+ OMNIUS_DIR3 = join171(homedir58(), ".omnius");
722092
722524
  PROJECTS_FILE = join171(OMNIUS_DIR3, "projects.json");
722093
722525
  CURRENT_FILE = join171(OMNIUS_DIR3, "current-project");
722094
722526
  currentRoot = null;
@@ -722970,7 +723402,7 @@ var init_access_policy = __esm({
722970
723402
  // packages/cli/src/api/project-preferences.ts
722971
723403
  import { createHash as createHash50 } from "node:crypto";
722972
723404
  import { existsSync as existsSync162, mkdirSync as mkdirSync100, readFileSync as readFileSync133, renameSync as renameSync16, writeFileSync as writeFileSync87, unlinkSync as unlinkSync37 } from "node:fs";
722973
- import { homedir as homedir58 } from "node:os";
723405
+ import { homedir as homedir59 } from "node:os";
722974
723406
  import { join as join172, resolve as resolve75 } from "node:path";
722975
723407
  import { randomUUID as randomUUID20 } from "node:crypto";
722976
723408
  function projectKey(root) {
@@ -723050,7 +723482,7 @@ function deleteProjectPreferences(root) {
723050
723482
  var OMNIUS_DIR4, PROJECTS_DIR, SCHEMA_VERSION, DEFAULT_PREFS;
723051
723483
  var init_project_preferences = __esm({
723052
723484
  "packages/cli/src/api/project-preferences.ts"() {
723053
- OMNIUS_DIR4 = join172(homedir58(), ".omnius");
723485
+ OMNIUS_DIR4 = join172(homedir59(), ".omnius");
723054
723486
  PROJECTS_DIR = join172(OMNIUS_DIR4, "projects");
723055
723487
  SCHEMA_VERSION = 1;
723056
723488
  DEFAULT_PREFS = {
@@ -724420,7 +724852,7 @@ __export(aiwg_exports, {
724420
724852
  });
724421
724853
  import { existsSync as existsSync167, readFileSync as readFileSync136, readdirSync as readdirSync57, statSync as statSync65 } from "node:fs";
724422
724854
  import { join as join176 } from "node:path";
724423
- import { homedir as homedir59 } from "node:os";
724855
+ import { homedir as homedir60 } from "node:os";
724424
724856
  import { execSync as execSync38 } from "node:child_process";
724425
724857
  function resolveAiwgRoot() {
724426
724858
  if (_cachedAiwgRoot !== void 0) return _cachedAiwgRoot;
@@ -724429,7 +724861,7 @@ function resolveAiwgRoot() {
724429
724861
  _cachedAiwgRoot = envRoot;
724430
724862
  return envRoot;
724431
724863
  }
724432
- const shareDir = join176(homedir59(), ".local", "share", "ai-writing-guide");
724864
+ const shareDir = join176(homedir60(), ".local", "share", "ai-writing-guide");
724433
724865
  if (existsSync167(join176(shareDir, "agentic"))) {
724434
724866
  _cachedAiwgRoot = shareDir;
724435
724867
  return shareDir;
@@ -724458,8 +724890,8 @@ function resolveAiwgRoot() {
724458
724890
  }
724459
724891
  }
724460
724892
  const versionDirs = [
724461
- join176(homedir59(), ".nvm", "versions", "node"),
724462
- join176(homedir59(), ".local", "share", "fnm", "node-versions")
724893
+ join176(homedir60(), ".nvm", "versions", "node"),
724894
+ join176(homedir60(), ".local", "share", "fnm", "node-versions")
724463
724895
  ];
724464
724896
  for (const vdir of versionDirs) {
724465
724897
  if (!existsSync167(vdir)) continue;
@@ -725204,13 +725636,13 @@ __export(tor_fallback_exports, {
725204
725636
  tunnelViaTor: () => tunnelViaTor
725205
725637
  });
725206
725638
  import { existsSync as existsSync168, readFileSync as readFileSync137 } from "node:fs";
725207
- import { homedir as homedir60 } from "node:os";
725639
+ import { homedir as homedir61 } from "node:os";
725208
725640
  import { join as join177 } from "node:path";
725209
725641
  import { createConnection as createConnection3 } from "node:net";
725210
725642
  function getLocalOnion() {
725211
725643
  const candidates = [
725212
- join177(homedir60(), "hidden_service_hostname"),
725213
- join177(homedir60(), ".omnius", "tor", "hostname"),
725644
+ join177(homedir61(), "hidden_service_hostname"),
725645
+ join177(homedir61(), ".omnius", "tor", "hostname"),
725214
725646
  "/var/lib/tor/hidden_service/hostname"
725215
725647
  ];
725216
725648
  for (const p2 of candidates) {
@@ -725483,7 +725915,7 @@ import {
725483
725915
  statSync as statSync66
725484
725916
  } from "node:fs";
725485
725917
  import { join as join179, resolve as pathResolve3 } from "node:path";
725486
- import { homedir as homedir61 } from "node:os";
725918
+ import { homedir as homedir62 } from "node:os";
725487
725919
  function keyUsageHint(secret) {
725488
725920
  return {
725489
725921
  auth_header: secret ? `Authorization: Bearer ${secret}` : "Authorization: Bearer <token>",
@@ -725789,7 +726221,7 @@ async function handleGetSkill(ctx3, name10) {
725789
726221
  }
725790
726222
  async function fallbackDiscoverSkills() {
725791
726223
  return (_root) => {
725792
- const roots = [join179(homedir61(), ".local", "share", "ai-writing-guide")];
726224
+ const roots = [join179(homedir62(), ".local", "share", "ai-writing-guide")];
725793
726225
  const out = [];
725794
726226
  for (const root of roots) {
725795
726227
  if (!existsSync170(root)) continue;
@@ -727313,7 +727745,7 @@ async function handleNexusStatus(ctx3) {
727313
727745
  try {
727314
727746
  const statePaths = [
727315
727747
  join179(process.cwd(), ".omnius", "nexus-peer-state.json"),
727316
- join179(homedir61(), ".omnius", "nexus-peer-cache.json")
727748
+ join179(homedir62(), ".omnius", "nexus-peer-cache.json")
727317
727749
  ];
727318
727750
  const states2 = [];
727319
727751
  for (const p2 of statePaths) {
@@ -727349,7 +727781,7 @@ async function handleNexusStatus(ctx3) {
727349
727781
  }
727350
727782
  function loadAgentName() {
727351
727783
  try {
727352
- const p2 = join179(homedir61(), ".omnius", "agent-name");
727784
+ const p2 = join179(homedir62(), ".omnius", "agent-name");
727353
727785
  if (existsSync170(p2)) return readFileSync138(p2, "utf-8").trim();
727354
727786
  } catch {
727355
727787
  }
@@ -727359,8 +727791,8 @@ async function handleSponsors(ctx3) {
727359
727791
  const { req: req3, res, url, requestId } = ctx3;
727360
727792
  try {
727361
727793
  const candidates = [
727362
- join179(homedir61(), ".omnius", "sponsor-cache.json"),
727363
- join179(homedir61(), ".omnius", "sponsors.json")
727794
+ join179(homedir62(), ".omnius", "sponsor-cache.json"),
727795
+ join179(homedir62(), ".omnius", "sponsors.json")
727364
727796
  ];
727365
727797
  let sponsors = [];
727366
727798
  for (const p2 of candidates) {
@@ -727660,9 +728092,9 @@ function resolveLocalPeerId() {
727660
728092
  const projectScoped = scope === "project" || scope === "local" || projectScopeFlag === "1" || projectScopeFlag === "true" || projectScopeFlag === "yes";
727661
728093
  const candidates = projectScoped ? [
727662
728094
  join179(process.cwd(), ".omnius", "nexus", "status.json"),
727663
- join179(homedir61(), ".omnius", "nexus", "status.json")
728095
+ join179(homedir62(), ".omnius", "nexus", "status.json")
727664
728096
  ] : [
727665
- join179(homedir61(), ".omnius", "nexus", "status.json"),
728097
+ join179(homedir62(), ".omnius", "nexus", "status.json"),
727666
728098
  join179(process.cwd(), ".omnius", "nexus", "status.json")
727667
728099
  ];
727668
728100
  for (const p2 of candidates) {
@@ -727670,7 +728102,7 @@ function resolveLocalPeerId() {
727670
728102
  if (r2) return r2;
727671
728103
  }
727672
728104
  try {
727673
- const regPath = join179(homedir61(), ".omnius", "nexus-registry.json");
728105
+ const regPath = join179(homedir62(), ".omnius", "nexus-registry.json");
727674
728106
  if (existsSync170(regPath)) {
727675
728107
  const reg = JSON.parse(readFileSync138(regPath, "utf-8"));
727676
728108
  const entries = Array.isArray(reg?.dirs) ? reg.dirs : [];
@@ -727691,7 +728123,7 @@ function resolveLocalPeerId() {
727691
728123
  let scanResult = null;
727692
728124
  try {
727693
728125
  const { execSync: execSync41 } = __require("node:child_process");
727694
- const cmd = `find "${homedir61()}" -maxdepth 4 -path '*/.omnius/nexus/status.json' -type f 2>/dev/null | head -50`;
728126
+ const cmd = `find "${homedir62()}" -maxdepth 4 -path '*/.omnius/nexus/status.json' -type f 2>/dev/null | head -50`;
727695
728127
  const out = execSync41(cmd, { encoding: "utf-8", timeout: 2e3 }).trim();
727696
728128
  for (const line of out.split("\n")) {
727697
728129
  const f2 = line.trim();
@@ -728056,9 +728488,9 @@ async function handleRemoteProxy(ctx3) {
728056
728488
  );
728057
728489
  const nexusCandidates = tunnelProjectScope ? [
728058
728490
  join179(process.cwd(), ".omnius", "nexus"),
728059
- join179(homedir61(), ".omnius", "nexus")
728491
+ join179(homedir62(), ".omnius", "nexus")
728060
728492
  ] : [
728061
- join179(homedir61(), ".omnius", "nexus"),
728493
+ join179(homedir62(), ".omnius", "nexus"),
728062
728494
  join179(process.cwd(), ".omnius", "nexus")
728063
728495
  ];
728064
728496
  let nexusDirPath = null;
@@ -729394,7 +729826,7 @@ async function handleListAgentTypes(ctx3) {
729394
729826
  }
729395
729827
  async function handleListEngines(ctx3) {
729396
729828
  const { res } = ctx3;
729397
- const home = homedir61();
729829
+ const home = homedir62();
729398
729830
  sendJson2(res, 200, {
729399
729831
  engines: [
729400
729832
  {
@@ -729550,7 +729982,7 @@ async function tryAimsRoute(ctx3) {
729550
729982
  return false;
729551
729983
  }
729552
729984
  function aimsDir() {
729553
- return join179(homedir61(), ".omnius", "aims");
729985
+ return join179(homedir62(), ".omnius", "aims");
729554
729986
  }
729555
729987
  function readAimsFile(name10, fallback) {
729556
729988
  try {
@@ -730015,7 +730447,7 @@ async function handleAimsSuppliers(ctx3) {
730015
730447
  role: "LLM inference provider"
730016
730448
  }
730017
730449
  ];
730018
- const sponsorPaths = [join179(homedir61(), ".omnius", "sponsor-cache.json")];
730450
+ const sponsorPaths = [join179(homedir62(), ".omnius", "sponsor-cache.json")];
730019
730451
  for (const p2 of sponsorPaths) {
730020
730452
  if (!existsSync170(p2)) continue;
730021
730453
  try {
@@ -742246,7 +742678,7 @@ var init_chat_followup = __esm({
742246
742678
  import { execSync as execSync39, spawn as spawn37 } from "node:child_process";
742247
742679
  import { existsSync as existsSync172, mkdirSync as mkdirSync108, writeFileSync as writeFileSync91 } from "node:fs";
742248
742680
  import { join as join181, resolve as resolve76, dirname as dirname55 } from "node:path";
742249
- import { homedir as homedir62 } from "node:os";
742681
+ import { homedir as homedir63 } from "node:os";
742250
742682
  import { fileURLToPath as fileURLToPath22 } from "node:url";
742251
742683
  function getDockerDir() {
742252
742684
  try {
@@ -742394,7 +742826,7 @@ async function ensureOmniusImage(force = false) {
742394
742826
  if (existsSync172(join181(dockerDir, "Dockerfile"))) {
742395
742827
  buildContext = dockerDir;
742396
742828
  } else {
742397
- buildContext = join181(homedir62(), ".omnius", "docker-build");
742829
+ buildContext = join181(homedir63(), ".omnius", "docker-build");
742398
742830
  mkdirSync108(buildContext, { recursive: true });
742399
742831
  writeDockerfiles(buildContext);
742400
742832
  }
@@ -742722,7 +743154,7 @@ import * as https3 from "node:https";
742722
743154
  import { createRequire as createRequire8 } from "node:module";
742723
743155
  import { fileURLToPath as fileURLToPath23 } from "node:url";
742724
743156
  import { dirname as dirname56, join as join183, resolve as resolve77 } from "node:path";
742725
- import { homedir as homedir63 } from "node:os";
743157
+ import { homedir as homedir64 } from "node:os";
742726
743158
  import { spawn as spawn38, execSync as execSync40 } from "node:child_process";
742727
743159
  import {
742728
743160
  createReadStream as createReadStream2,
@@ -742735,9 +743167,9 @@ import {
742735
743167
  renameSync as renameSync18,
742736
743168
  unlinkSync as unlinkSync38,
742737
743169
  statSync as statSync67,
742738
- openSync as openSync6,
742739
- readSync as readSync2,
742740
- closeSync as closeSync6
743170
+ openSync as openSync7,
743171
+ readSync as readSync3,
743172
+ closeSync as closeSync7
742741
743173
  } from "node:fs";
742742
743174
  import { randomBytes as randomBytes29, randomUUID as randomUUID21, timingSafeEqual as timingSafeEqual2 } from "node:crypto";
742743
743175
  import { createHash as createHash52 } from "node:crypto";
@@ -743174,7 +743606,7 @@ function isOriginAllowed(origin) {
743174
743606
  if (!origin) return true;
743175
743607
  let accessMode = (process.env["OMNIUS_ACCESS"] || "").toLowerCase().trim();
743176
743608
  try {
743177
- const accessFile = join183(homedir63(), ".omnius", "access");
743609
+ const accessFile = join183(homedir64(), ".omnius", "access");
743178
743610
  if (existsSync173(accessFile)) {
743179
743611
  const persisted = readFileSync140(accessFile, "utf8").trim().toLowerCase();
743180
743612
  if (persisted === "any" || persisted === "lan" || persisted === "loopback") {
@@ -743656,8 +744088,8 @@ function isOllamaMissingModelError(body) {
743656
744088
  async function resolveRealtimeOllamaFallbackModel(ollamaUrl, timeoutMs, missingModel) {
743657
744089
  try {
743658
744090
  const cacheKey = realtimeFallbackCacheKey(ollamaUrl, missingModel);
743659
- const cached = realtimeOllamaFallbackCache.get(cacheKey);
743660
- if (cached) return cached;
744091
+ const cached2 = realtimeOllamaFallbackCache.get(cacheKey);
744092
+ if (cached2) return cached2;
743661
744093
  const result = await ollamaRequest(
743662
744094
  ollamaUrl,
743663
744095
  "/api/tags",
@@ -746149,10 +746581,10 @@ ${task}` : task;
746149
746581
  });
746150
746582
  }
746151
746583
  function updateStateFile() {
746152
- return join183(homedir63(), ".omnius", "update-state.json");
746584
+ return join183(homedir64(), ".omnius", "update-state.json");
746153
746585
  }
746154
746586
  function updateLogPath() {
746155
- return join183(homedir63(), ".omnius", "update.log");
746587
+ return join183(homedir64(), ".omnius", "update.log");
746156
746588
  }
746157
746589
  function readUpdateState() {
746158
746590
  try {
@@ -746165,7 +746597,7 @@ function readUpdateState() {
746165
746597
  }
746166
746598
  function writeUpdateState(state) {
746167
746599
  try {
746168
- const dir = join183(homedir63(), ".omnius");
746600
+ const dir = join183(homedir64(), ".omnius");
746169
746601
  mkdirSync109(dir, { recursive: true });
746170
746602
  const finalPath = updateStateFile();
746171
746603
  const tmpPath = `${finalPath}.tmp.${process.pid}`;
@@ -746225,7 +746657,7 @@ async function handleV1Update(req3, res, requestId) {
746225
746657
  }
746226
746658
  if (!npmBin) npmBin = isWin2 ? "npm.cmd" : "npm";
746227
746659
  const pkgSpec = `omnius@${targetVersion}`;
746228
- const dir = join183(homedir63(), ".omnius");
746660
+ const dir = join183(homedir64(), ".omnius");
746229
746661
  fs14.mkdirSync(dir, { recursive: true });
746230
746662
  const logFd = fs14.openSync(logPath3, "w");
746231
746663
  const npmPrefix = dirname56(nodeDir);
@@ -747015,11 +747447,11 @@ function handleV1RunsById(res, id2) {
747015
747447
  const size = statSync67(outputFile).size;
747016
747448
  const tailSize = Math.min(size, 4096);
747017
747449
  const buffer2 = Buffer.alloc(tailSize);
747018
- const fd = openSync6(outputFile, "r");
747450
+ const fd = openSync7(outputFile, "r");
747019
747451
  try {
747020
- readSync2(fd, buffer2, 0, tailSize, Math.max(0, size - tailSize));
747452
+ readSync3(fd, buffer2, 0, tailSize, Math.max(0, size - tailSize));
747021
747453
  } finally {
747022
- closeSync6(fd);
747454
+ closeSync7(fd);
747023
747455
  }
747024
747456
  const content = buffer2.toString("utf8");
747025
747457
  enriched.output_state = {
@@ -748197,7 +748629,7 @@ async function handleRequest(req3, res, ollamaUrl, verbose, runtimeDefaults = {}
748197
748629
  }
748198
748630
  if (pathname === "/v1/projects/scan" && method === "GET") {
748199
748631
  const scanRoot = urlObj.searchParams.get("root");
748200
- const base3 = scanRoot && scanRoot.trim() ? resolve77(scanRoot.trim()) : homedir63();
748632
+ const base3 = scanRoot && scanRoot.trim() ? resolve77(scanRoot.trim()) : homedir64();
748201
748633
  try {
748202
748634
  let walk2 = function(dir, depth) {
748203
748635
  if (depth > 6) return;
@@ -748255,7 +748687,7 @@ async function handleRequest(req3, res, ollamaUrl, verbose, runtimeDefaults = {}
748255
748687
  }
748256
748688
  if (pathname === "/v1/projects/scan" && method === "GET") {
748257
748689
  const scanRoot = urlObj.searchParams.get("root");
748258
- const base3 = scanRoot && scanRoot.trim() ? resolve77(scanRoot.trim()) : homedir63();
748690
+ const base3 = scanRoot && scanRoot.trim() ? resolve77(scanRoot.trim()) : homedir64();
748259
748691
  try {
748260
748692
  let walk2 = function(dir, depth) {
748261
748693
  if (depth > 6) return;
@@ -750864,7 +751296,7 @@ ${historyLines}
750864
751296
  function getScheduleRoots() {
750865
751297
  const rootsEnv = process.env["OMNIUS_SCHEDULE_ROOTS"] || "";
750866
751298
  const roots = rootsEnv.split(rootsEnv.includes(";") ? ";" : ":").filter(Boolean);
750867
- const defaults3 = [process.cwd(), join183(homedir63(), "Documents")];
751299
+ const defaults3 = [process.cwd(), join183(homedir64(), "Documents")];
750868
751300
  const set = /* @__PURE__ */ new Set([...defaults3, ...roots]);
750869
751301
  return [...set];
750870
751302
  }
@@ -751399,7 +751831,7 @@ function fixupOrMigrateScheduled(mode, dryRun) {
751399
751831
  try {
751400
751832
  if (!f2.workingDir || !f2.task) continue;
751401
751833
  const unitBase = `omnius-${f2.id}`;
751402
- const unitDir = join183(homedir63(), ".config", "systemd", "user");
751834
+ const unitDir = join183(homedir64(), ".config", "systemd", "user");
751403
751835
  const svc = join183(unitDir, `${unitBase}.service`);
751404
751836
  const tim = join183(unitDir, `${unitBase}.timer`);
751405
751837
  const omniusBin = findOmniusBinary4();
@@ -751748,7 +752180,7 @@ function startApiServer(options2 = {}) {
751748
752180
  }
751749
752181
  let runtimeAccessMode = resolveAccessMode(process.env["OMNIUS_ACCESS"], host);
751750
752182
  try {
751751
- const accessFile = join183(homedir63(), ".omnius", "access");
752183
+ const accessFile = join183(homedir64(), ".omnius", "access");
751752
752184
  if (existsSync173(accessFile)) {
751753
752185
  const persisted = readFileSync140(accessFile, "utf8").trim();
751754
752186
  const resolved = resolveAccessMode(persisted, host);
@@ -751820,7 +752252,7 @@ function startApiServer(options2 = {}) {
751820
752252
  const previous = runtimeAccessMode;
751821
752253
  runtimeAccessMode = requested;
751822
752254
  try {
751823
- const dir = join183(homedir63(), ".omnius");
752255
+ const dir = join183(homedir64(), ".omnius");
751824
752256
  mkdirSync109(dir, { recursive: true });
751825
752257
  writeFileSync92(
751826
752258
  join183(dir, "access"),
@@ -753287,7 +753719,7 @@ import {
753287
753719
  writeFile as writeFileAsync2,
753288
753720
  mkdir as mkdirAsync2
753289
753721
  } from "node:fs/promises";
753290
- import { homedir as homedir64 } from "node:os";
753722
+ import { homedir as homedir65 } from "node:os";
753291
753723
  function refreshLocalOllamaModelCache() {
753292
753724
  if (localOllamaProbeInFlight) return;
753293
753725
  localOllamaProbeInFlight = (async () => {
@@ -755376,7 +755808,7 @@ function extractGeneratedAudioPath(output, repoRoot) {
755376
755808
  const match = output.match(/(?:Sound|Music|TTS) generated:\s+([^\n\r]+)/i);
755377
755809
  const raw = match?.[1]?.trim().replace(/^["']|["']$/g, "");
755378
755810
  if (!raw) return null;
755379
- return raw.startsWith("/") || raw.startsWith("~") ? raw.replace(/^~(?=\/)/, homedir64()) : join185(repoRoot, raw);
755811
+ return raw.startsWith("/") || raw.startsWith("~") ? raw.replace(/^~(?=\/)/, homedir65()) : join185(repoRoot, raw);
755380
755812
  }
755381
755813
  async function playGeneratedAudioForToolResult(toolName, output, repoRoot, writer) {
755382
755814
  if (!toolName || !["generate_audio", "generate_tts", "audio_playback"].includes(toolName) || !output)
@@ -755534,6 +755966,12 @@ ${buildSoulContext({
755534
755966
  env2 += `
755535
755967
 
755536
755968
  ${liveContext}`;
755969
+ }
755970
+ const powerContext = formatPowerMonitorContext();
755971
+ if (powerContext) {
755972
+ env2 += `
755973
+
755974
+ ${powerContext}`;
755537
755975
  }
755538
755976
  return env2;
755539
755977
  } catch {
@@ -758584,6 +759022,9 @@ ${result.summary}`
758584
759022
  }, AUTO_UPDATE_INTERVAL_MS);
758585
759023
  autoUpdateTimer.unref();
758586
759024
  const voiceEngine = new VoiceEngine();
759025
+ if (savedSettings.voiceRoom) {
759026
+ voiceEngine.setRoomSettings(savedSettings.voiceRoom);
759027
+ }
758587
759028
  let voiceSession = null;
758588
759029
  let tunnelGateway = null;
758589
759030
  let p2pGateway = null;
@@ -759169,7 +759610,7 @@ This is an independent background session started from /background.`
759169
759610
  );
759170
759611
  return [hits, line];
759171
759612
  }
759172
- const HISTORY_DIR = join185(homedir64(), ".omnius");
759613
+ const HISTORY_DIR = join185(homedir65(), ".omnius");
759173
759614
  const HISTORY_FILE = join185(HISTORY_DIR, "repl-history");
759174
759615
  const MAX_HISTORY_LINES = 500;
759175
759616
  let savedHistory = [];
@@ -760565,6 +761006,12 @@ The user pasted a clipboard image saved at ${relPath}. Use the OCR, vision analy
760565
761006
  voiceSetMode(mode) {
760566
761007
  voiceEngine.voiceMode = mode;
760567
761008
  },
761009
+ voiceGetRoomSettings() {
761010
+ return voiceEngine.getRoomSettings();
761011
+ },
761012
+ voiceSetRoomSettings(patch) {
761013
+ return voiceEngine.setRoomSettings(patch);
761014
+ },
760568
761015
  voiceIsEnabled() {
760569
761016
  return voiceEngine.enabled;
760570
761017
  },
@@ -762440,7 +762887,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
762440
762887
  } catch {
762441
762888
  }
762442
762889
  try {
762443
- const voiceDir3 = join185(homedir64(), ".omnius", "voice");
762890
+ const voiceDir3 = join185(homedir65(), ".omnius", "voice");
762444
762891
  const voicePidFiles = ["luxtts-daemon.pid", "piper-daemon.pid"];
762445
762892
  for (const pf of voicePidFiles) {
762446
762893
  const pidPath = join185(voiceDir3, pf);
@@ -762586,14 +763033,14 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
762586
763033
  const { isPersonaPlexRunning: isPersonaPlexRunning2 } = await Promise.resolve().then(() => (init_personaplex(), personaplex_exports));
762587
763034
  if (await isPersonaPlexRunning2()) {
762588
763035
  const ppPidFile = join185(
762589
- homedir64(),
763036
+ homedir65(),
762590
763037
  ".omnius",
762591
763038
  "voice",
762592
763039
  "personaplex",
762593
763040
  "daemon.pid"
762594
763041
  );
762595
763042
  const ppPortFile = join185(
762596
- homedir64(),
763043
+ homedir65(),
762597
763044
  ".omnius",
762598
763045
  "voice",
762599
763046
  "personaplex",
@@ -764378,6 +764825,7 @@ var init_interactive = __esm({
764378
764825
  init_memory_paths();
764379
764826
  init_visual_sensor_guidance();
764380
764827
  init_live_sensors();
764828
+ init_power_monitor();
764381
764829
  init_conversation_context();
764382
764830
  init_prompt_enhance();
764383
764831
  init_dist8();
@@ -765011,7 +765459,7 @@ __export(config_exports2, {
765011
765459
  configCommand: () => configCommand
765012
765460
  });
765013
765461
  import { join as join187, resolve as resolve81 } from "node:path";
765014
- import { homedir as homedir65 } from "node:os";
765462
+ import { homedir as homedir66 } from "node:os";
765015
765463
  import { cwd as cwd3 } from "node:process";
765016
765464
  function redactIfSensitive(key, value2) {
765017
765465
  if (SENSITIVE_KEYS.has(key) && typeof value2 === "string" && value2.length > 0) {
@@ -765094,7 +765542,7 @@ function handleShow(opts, config) {
765094
765542
  }
765095
765543
  }
765096
765544
  printSection("Config File");
765097
- printInfo(`~/.omnius/config.json (${join187(homedir65(), ".omnius", "config.json")})`);
765545
+ printInfo(`~/.omnius/config.json (${join187(homedir66(), ".omnius", "config.json")})`);
765098
765546
  printSection("Priority Chain");
765099
765547
  printInfo(" 1. CLI flags (--model, --backend-url, etc.)");
765100
765548
  printInfo(" 2. Project .omnius/settings.json (--local)");
@@ -766153,8 +766601,8 @@ function crashLog(label, err) {
766153
766601
  try {
766154
766602
  const { appendFileSync: appendFileSync23, mkdirSync: mkdirSync114 } = __require("node:fs");
766155
766603
  const { join: join190 } = __require("node:path");
766156
- const { homedir: homedir66 } = __require("node:os");
766157
- const logDir = join190(homedir66(), ".omnius");
766604
+ const { homedir: homedir67 } = __require("node:os");
766605
+ const logDir = join190(homedir67(), ".omnius");
766158
766606
  mkdirSync114(logDir, { recursive: true });
766159
766607
  appendFileSync23(join190(logDir, "crash.log"), logLine);
766160
766608
  } catch {