omnius 1.0.443 → 1.0.444

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
@@ -118324,7 +118324,7 @@ var require_auto = __commonJS({
118324
118324
  // ../node_modules/acme-client/src/client.js
118325
118325
  var require_client = __commonJS({
118326
118326
  "../node_modules/acme-client/src/client.js"(exports, module) {
118327
- var { createHash: createHash47 } = __require("crypto");
118327
+ var { createHash: createHash48 } = __require("crypto");
118328
118328
  var { getPemBodyAsB64u } = require_crypto();
118329
118329
  var { log: log22 } = require_logger();
118330
118330
  var HttpClient = require_http();
@@ -118635,14 +118635,14 @@ var require_client = __commonJS({
118635
118635
  */
118636
118636
  async getChallengeKeyAuthorization(challenge) {
118637
118637
  const jwk = this.http.getJwk();
118638
- const keysum = createHash47("sha256").update(JSON.stringify(jwk));
118638
+ const keysum = createHash48("sha256").update(JSON.stringify(jwk));
118639
118639
  const thumbprint = keysum.digest("base64url");
118640
118640
  const result = `${challenge.token}.${thumbprint}`;
118641
118641
  if (challenge.type === "http-01") {
118642
118642
  return result;
118643
118643
  }
118644
118644
  if (challenge.type === "dns-01") {
118645
- return createHash47("sha256").update(result).digest("base64url");
118645
+ return createHash48("sha256").update(result).digest("base64url");
118646
118646
  }
118647
118647
  if (challenge.type === "tls-alpn-01") {
118648
118648
  return result;
@@ -261322,7 +261322,7 @@ var require_websocket2 = __commonJS({
261322
261322
  var http6 = __require("http");
261323
261323
  var net5 = __require("net");
261324
261324
  var tls2 = __require("tls");
261325
- var { randomBytes: randomBytes31, createHash: createHash47 } = __require("crypto");
261325
+ var { randomBytes: randomBytes31, createHash: createHash48 } = __require("crypto");
261326
261326
  var { Duplex: Duplex3, Readable } = __require("stream");
261327
261327
  var { URL: URL3 } = __require("url");
261328
261328
  var PerMessageDeflate3 = require_permessage_deflate2();
@@ -261982,7 +261982,7 @@ var require_websocket2 = __commonJS({
261982
261982
  abortHandshake(websocket, socket, "Invalid Upgrade header");
261983
261983
  return;
261984
261984
  }
261985
- const digest3 = createHash47("sha1").update(key + GUID).digest("base64");
261985
+ const digest3 = createHash48("sha1").update(key + GUID).digest("base64");
261986
261986
  if (res.headers["sec-websocket-accept"] !== digest3) {
261987
261987
  abortHandshake(websocket, socket, "Invalid Sec-WebSocket-Accept header");
261988
261988
  return;
@@ -262349,7 +262349,7 @@ var require_websocket_server = __commonJS({
262349
262349
  var EventEmitter15 = __require("events");
262350
262350
  var http6 = __require("http");
262351
262351
  var { Duplex: Duplex3 } = __require("stream");
262352
- var { createHash: createHash47 } = __require("crypto");
262352
+ var { createHash: createHash48 } = __require("crypto");
262353
262353
  var extension3 = require_extension2();
262354
262354
  var PerMessageDeflate3 = require_permessage_deflate2();
262355
262355
  var subprotocol3 = require_subprotocol();
@@ -262650,7 +262650,7 @@ var require_websocket_server = __commonJS({
262650
262650
  );
262651
262651
  }
262652
262652
  if (this._state > RUNNING) return abortHandshake(socket, 503);
262653
- const digest3 = createHash47("sha1").update(key + GUID).digest("base64");
262653
+ const digest3 = createHash48("sha1").update(key + GUID).digest("base64");
262654
262654
  const headers = [
262655
262655
  "HTTP/1.1 101 Switching Protocols",
262656
262656
  "Upgrade: websocket",
@@ -275457,13 +275457,13 @@ Justification: ${justification || "(none provided)"}`,
275457
275457
  }
275458
275458
  const snapshot = JSON.stringify(this.selfState, null, 2);
275459
275459
  try {
275460
- const { createHash: createHash47 } = await import("node:crypto");
275460
+ const { createHash: createHash48 } = await import("node:crypto");
275461
275461
  const snapshotDir = join44(this.cwd, ".omnius", "identity", "snapshots");
275462
275462
  await mkdir7(snapshotDir, { recursive: true });
275463
275463
  const version5 = this.selfState.version;
275464
275464
  const snapshotPath = join44(snapshotDir, `v${version5}.json`);
275465
275465
  await writeFile12(snapshotPath, snapshot, "utf8");
275466
- const hash = createHash47("sha256").update(snapshot).digest("hex");
275466
+ const hash = createHash48("sha256").update(snapshot).digest("hex");
275467
275467
  await writeFile12(join44(this.cwd, ".omnius", "identity", "latest-hash.txt"), hash, "utf8");
275468
275468
  let ipfsCid = "";
275469
275469
  try {
@@ -275596,8 +275596,8 @@ New: ${newNarrative.slice(0, 200)}...`,
275596
275596
  }
275597
275597
  // ── Helpers ──────────────────────────────────────────────────────────────
275598
275598
  createDefaultState() {
275599
- const { createHash: createHash47 } = __require("node:crypto");
275600
- const machineId = createHash47("sha256").update(this.cwd).digest("hex").slice(0, 12);
275599
+ const { createHash: createHash48 } = __require("node:crypto");
275600
+ const machineId = createHash48("sha256").update(this.cwd).digest("hex").slice(0, 12);
275601
275601
  return {
275602
275602
  self_id: `omnius-${machineId}`,
275603
275603
  version: 1,
@@ -275679,9 +275679,9 @@ New: ${newNarrative.slice(0, 200)}...`,
275679
275679
  let cid;
275680
275680
  if (this.selfState.version > prevVersion) {
275681
275681
  try {
275682
- const { createHash: createHash47 } = await import("node:crypto");
275682
+ const { createHash: createHash48 } = await import("node:crypto");
275683
275683
  const stateJson = JSON.stringify(this.selfState);
275684
- const hash = createHash47("sha256").update(stateJson).digest("hex").slice(0, 32);
275684
+ const hash = createHash48("sha256").update(stateJson).digest("hex").slice(0, 32);
275685
275685
  const cidsPath = join44(this.cwd, ".omnius", "identity", "cids.json");
275686
275686
  const cidsData = { latest: "", hash, version: this.selfState.version };
275687
275687
  try {
@@ -296247,7 +296247,7 @@ var init_working_notes = __esm({
296247
296247
  // packages/execution/dist/tools/workboard.js
296248
296248
  import { appendFileSync as appendFileSync4, existsSync as existsSync58, mkdirSync as mkdirSync32, readFileSync as readFileSync42, renameSync as renameSync6, unlinkSync as unlinkSync10, writeFileSync as writeFileSync27 } from "node:fs";
296249
296249
  import { join as join70 } from "node:path";
296250
- import { randomBytes as randomBytes16 } from "node:crypto";
296250
+ import { createHash as createHash21, randomBytes as randomBytes16 } from "node:crypto";
296251
296251
  function workboardRoot(workingDir = process.cwd()) {
296252
296252
  return join70(workingDir, ".omnius", "workboards");
296253
296253
  }
@@ -296408,7 +296408,7 @@ function replayWorkboardEvents(events) {
296408
296408
  }
296409
296409
  cards.set(card.id, {
296410
296410
  ...card,
296411
- evidence: [...card.evidence, ...event.payload.evidence.map(cloneEvidence)],
296411
+ evidence: appendUniqueEvidence(card.evidence, event.payload.evidence),
296412
296412
  updatedAt: event.createdAt
296413
296413
  });
296414
296414
  break;
@@ -296662,6 +296662,9 @@ function attachWorkboardEvidence(workingDir, input) {
296662
296662
  if (evidence.length === 0) {
296663
296663
  throw new WorkboardError("evidence_required", "at least one evidence item is required");
296664
296664
  }
296665
+ const uniqueEvidence = filterNewEvidence(card.evidence, evidence);
296666
+ if (uniqueEvidence.length === 0)
296667
+ return snapshot;
296665
296668
  const now2 = (/* @__PURE__ */ new Date()).toISOString();
296666
296669
  return appendWorkboardEvents(workingDir, runId, [{
296667
296670
  schemaVersion: WORKBOARD_SCHEMA_VERSION,
@@ -296670,7 +296673,7 @@ function attachWorkboardEvidence(workingDir, input) {
296670
296673
  type: "evidence.attached",
296671
296674
  createdAt: now2,
296672
296675
  actor: cleanString(input.actor),
296673
- payload: { cardId: card.id, evidence }
296676
+ payload: { cardId: card.id, evidence: uniqueEvidence }
296674
296677
  }]);
296675
296678
  }
296676
296679
  function completeWorkboardCard(workingDir, input) {
@@ -296696,8 +296699,9 @@ function completeWorkboardCard(workingDir, input) {
296696
296699
  const now2 = (/* @__PURE__ */ new Date()).toISOString();
296697
296700
  if (outcome === "request_changes") {
296698
296701
  const evidence2 = input.evidence === void 0 ? [] : normalizeEvidenceCollection(input.evidence, input.actor);
296702
+ const uniqueEvidence2 = evidence2.length > 0 ? filterNewEvidence(card.evidence, evidence2) : [];
296699
296703
  const events = [];
296700
- if (evidence2.length > 0) {
296704
+ if (uniqueEvidence2.length > 0) {
296701
296705
  events.push({
296702
296706
  schemaVersion: WORKBOARD_SCHEMA_VERSION,
296703
296707
  id: newEventId("evidence"),
@@ -296705,7 +296709,7 @@ function completeWorkboardCard(workingDir, input) {
296705
296709
  type: "evidence.attached",
296706
296710
  createdAt: now2,
296707
296711
  actor: cleanString(input.actor),
296708
- payload: { cardId: card.id, evidence: evidence2 }
296712
+ payload: { cardId: card.id, evidence: uniqueEvidence2 }
296709
296713
  });
296710
296714
  }
296711
296715
  const missingEvidence = normalizeStringArray(input.missingEvidence);
@@ -296770,7 +296774,8 @@ function completeWorkboardCard(workingDir, input) {
296770
296774
  }
296771
296775
  const evidence = input.evidence === void 0 ? [] : normalizeEvidenceCollection(input.evidence, input.actor);
296772
296776
  let evidenceSnapshot = snapshot;
296773
- if (evidence.length > 0) {
296777
+ const uniqueEvidence = evidence.length > 0 ? filterNewEvidence(card.evidence, evidence) : [];
296778
+ if (uniqueEvidence.length > 0) {
296774
296779
  evidenceSnapshot = appendWorkboardEvents(workingDir, runId, [{
296775
296780
  schemaVersion: WORKBOARD_SCHEMA_VERSION,
296776
296781
  id: newEventId("evidence"),
@@ -296778,7 +296783,7 @@ function completeWorkboardCard(workingDir, input) {
296778
296783
  type: "evidence.attached",
296779
296784
  createdAt: now2,
296780
296785
  actor: cleanString(input.actor),
296781
- payload: { cardId: card.id, evidence }
296786
+ payload: { cardId: card.id, evidence: uniqueEvidence }
296782
296787
  }]);
296783
296788
  }
296784
296789
  const currentCard = evidenceSnapshot.cards.find((existing) => existing.id === card.id) ?? card;
@@ -297281,6 +297286,46 @@ function cloneEvidence(evidence) {
297281
297286
  verifies: evidence.verifies ? [...evidence.verifies] : void 0
297282
297287
  };
297283
297288
  }
297289
+ function appendUniqueEvidence(existing, incoming) {
297290
+ const seen = new Set(existing.map(evidenceFingerprint));
297291
+ const next = existing.map(cloneEvidence);
297292
+ for (const item of incoming) {
297293
+ const fingerprint = evidenceFingerprint(item);
297294
+ if (seen.has(fingerprint))
297295
+ continue;
297296
+ seen.add(fingerprint);
297297
+ next.push(cloneEvidence(item));
297298
+ }
297299
+ return next;
297300
+ }
297301
+ function filterNewEvidence(existing, incoming) {
297302
+ const seen = new Set(existing.map(evidenceFingerprint));
297303
+ const next = [];
297304
+ for (const item of incoming) {
297305
+ const fingerprint = evidenceFingerprint(item);
297306
+ if (seen.has(fingerprint))
297307
+ continue;
297308
+ seen.add(fingerprint);
297309
+ next.push(cloneEvidence(item));
297310
+ }
297311
+ return next;
297312
+ }
297313
+ function evidenceFingerprint(evidence) {
297314
+ const contentDigest = createHash21("sha256").update(evidence.content ?? "").digest("hex");
297315
+ const key = {
297316
+ kind: evidence.kind,
297317
+ summary: evidence.summary,
297318
+ tool: evidence.tool,
297319
+ command: evidence.command,
297320
+ ref: evidence.ref,
297321
+ path: evidence.path,
297322
+ url: evidence.url,
297323
+ message: evidence.message,
297324
+ verifies: [...evidence.verifies ?? []].sort(),
297325
+ contentDigest
297326
+ };
297327
+ return createHash21("sha256").update(JSON.stringify(key)).digest("hex");
297328
+ }
297284
297329
  function cleanString(value2) {
297285
297330
  return typeof value2 === "string" && value2.trim() ? value2.trim() : void 0;
297286
297331
  }
@@ -299118,7 +299163,7 @@ var init_import_graph = __esm({
299118
299163
  import { createRequire as __createRequireGlob } from "node:module";
299119
299164
  import ignore from "ignore";
299120
299165
  import { readFile as readFile22, stat as stat8 } from "node:fs/promises";
299121
- import { createHash as createHash21 } from "node:crypto";
299166
+ import { createHash as createHash22 } from "node:crypto";
299122
299167
  import { join as join73, relative as relative6, extname as extname10, basename as basename14 } from "node:path";
299123
299168
  var __requireGlob, glob2, DEFAULT_EXCLUDE, LANGUAGE_MAP, CodebaseIndexer;
299124
299169
  var init_codebase_indexer = __esm({
@@ -299186,7 +299231,7 @@ var init_codebase_indexer = __esm({
299186
299231
  if (fileStat.size > this.config.maxFileSize)
299187
299232
  continue;
299188
299233
  const content = await readFile22(fullPath);
299189
- const hash = createHash21("sha256").update(content).digest("hex");
299234
+ const hash = createHash22("sha256").update(content).digest("hex");
299190
299235
  const ext = extname10(relativePath);
299191
299236
  indexed.push({
299192
299237
  path: fullPath,
@@ -543498,7 +543543,7 @@ var init_ts_morph_parser = __esm({
543498
543543
 
543499
543544
  // packages/indexer/dist/code-graph-db.js
543500
543545
  import { createRequire as createRequire4 } from "node:module";
543501
- import { createHash as createHash22 } from "node:crypto";
543546
+ import { createHash as createHash23 } from "node:crypto";
543502
543547
  import { mkdirSync as mkdirSync34, readFileSync as readFileSync45 } from "node:fs";
543503
543548
  import { join as join74, dirname as dirname20, extname as extname11 } from "node:path";
543504
543549
  function loadDatabaseCtor() {
@@ -543570,7 +543615,7 @@ function extractFileImports(content, filePath) {
543570
543615
  return imports.map((p2) => p2.replace(/\.(js|ts|jsx|tsx|mjs|cjs)$/, ""));
543571
543616
  }
543572
543617
  function hashContent2(content) {
543573
- return createHash22("sha1").update(content).digest("hex").slice(0, 16);
543618
+ return createHash23("sha1").update(content).digest("hex").slice(0, 16);
543574
543619
  }
543575
543620
  function detectLanguage(filePath) {
543576
543621
  return EXT_TO_LANG[extname11(filePath)] ?? "unknown";
@@ -553136,7 +553181,7 @@ var init_client3 = __esm({
553136
553181
  import { existsSync as existsSync72, readFileSync as readFileSync52, writeFileSync as writeFileSync35, mkdirSync as mkdirSync44, chmodSync, statSync as statSync28 } from "node:fs";
553137
553182
  import { join as join85, dirname as dirname23 } from "node:path";
553138
553183
  import { homedir as homedir23 } from "node:os";
553139
- import { randomBytes as randomBytes19, createHash as createHash23 } from "node:crypto";
553184
+ import { randomBytes as randomBytes19, createHash as createHash24 } from "node:crypto";
553140
553185
  function secretsPath(scope, repoRoot) {
553141
553186
  return scope === "global" ? join85(homedir23(), ".omnius", "secrets.json") : join85(repoRoot, ".omnius", "secrets.json");
553142
553187
  }
@@ -553177,7 +553222,7 @@ function sanitizeHint(hint) {
553177
553222
  return hint.toUpperCase().replace(/[^A-Z0-9]+/g, "_").replace(/^_+|_+$/g, "").slice(0, 32) || "GENERIC";
553178
553223
  }
553179
553224
  function shortDigest(value2) {
553180
- return createHash23("sha256").update(value2).digest("hex").slice(0, 6);
553225
+ return createHash24("sha256").update(value2).digest("hex").slice(0, 6);
553181
553226
  }
553182
553227
  function randomSuffix() {
553183
553228
  return randomBytes19(3).toString("hex");
@@ -554991,7 +555036,7 @@ var init_environment_snapshot = __esm({
554991
555036
  import { existsSync as existsSync76, mkdirSync as mkdirSync46, writeFileSync as writeFileSync38, readFileSync as readFileSync56, readdirSync as readdirSync26, unlinkSync as unlinkSync16, rmSync as rmSync9 } from "node:fs";
554992
555037
  import { join as join88, basename as basename17, isAbsolute as isAbsolute6, resolve as resolve44 } from "node:path";
554993
555038
  import { homedir as homedir26 } from "node:os";
554994
- import { createHash as createHash24 } from "node:crypto";
555039
+ import { createHash as createHash25 } from "node:crypto";
554995
555040
  function isYouTubeUrl2(url) {
554996
555041
  return /(?:youtube\.com\/(?:watch|shorts|live|embed|v\/)|youtu\.be\/)/i.test(url);
554997
555042
  }
@@ -555076,7 +555121,7 @@ async function extractAudioIfPresent(videoPath, audioPath, probe) {
555076
555121
  function imageHash(imagePath) {
555077
555122
  try {
555078
555123
  const data = readFileSync56(imagePath);
555079
- return createHash24("md5").update(data).digest("hex").slice(0, 12);
555124
+ return createHash25("md5").update(data).digest("hex").slice(0, 12);
555080
555125
  } catch {
555081
555126
  return "unknown";
555082
555127
  }
@@ -565440,7 +565485,10 @@ var init_ollama_pool = __esm({
565440
565485
  }
565441
565486
  /** Synchronous routing decision; returns the instance or null if every one is saturated. */
565442
565487
  pickInstance(opts) {
565443
- const candidates = this.instances.filter((inst) => !this.isEffectivelySaturated(inst) && !(this.activePlacementMode === "dedicated" && this.dedicatedGpuPoolActive && !inst.state.poolOwned && !opts.preferBaseInstance));
565488
+ const candidates = this.instances.filter((inst) => {
565489
+ const baseResidentDedicatedModel = this.activePlacementMode === "dedicated" && this.dedicatedGpuPoolActive && !inst.state.poolOwned && inst.state.knownModels.has(opts.model) && !this.allowDuplicateBaseModelResident();
565490
+ return !this.isEffectivelySaturated(inst) && !(this.activePlacementMode === "dedicated" && this.dedicatedGpuPoolActive && !inst.state.poolOwned && !opts.preferBaseInstance && !baseResidentDedicatedModel);
565491
+ });
565444
565492
  if (candidates.length === 0)
565445
565493
  return null;
565446
565494
  const affinityTargetId = opts.agentId ? this.affinityById.get(opts.agentId) : void 0;
@@ -565561,7 +565609,12 @@ var init_ollama_pool = __esm({
565561
565609
  await this.withSpawnGate(async () => {
565562
565610
  if (!this.canSpawnWithSharedModelStore(model))
565563
565611
  return;
565564
- const target = this.dedicatedTargetCount(gpus);
565612
+ const baseInstance = this.instances.find((i2) => !i2.state.poolOwned);
565613
+ const baseResidentModel = baseInstance !== void 0 && !this.allowDuplicateBaseModelResident() && await this.isModelLoadedOnInstance(baseInstance, model);
565614
+ if (baseResidentModel && baseInstance) {
565615
+ baseInstance.state.knownModels.add(model);
565616
+ }
565617
+ const target = Math.max(0, this.dedicatedTargetCount(gpus) - (baseResidentModel ? 1 : 0));
565565
565618
  const vramNeededMB = await this.estimateModelVramMB(model);
565566
565619
  while (this.instances.filter((i2) => i2.state.poolOwned).length < target) {
565567
565620
  const candidates = this.gpusWithCapacityForModel(gpus, vramNeededMB);
@@ -565625,6 +565678,10 @@ var init_ollama_pool = __esm({
565625
565678
  const cappedByGpuCount = Math.min(requested, gpus.length);
565626
565679
  return this.config.maxSpawnedInstances > 0 ? Math.min(cappedByGpuCount, this.config.maxSpawnedInstances) : cappedByGpuCount;
565627
565680
  }
565681
+ allowDuplicateBaseModelResident() {
565682
+ const raw = process.env["OMNIUS_OLLAMA_DUPLICATE_BASE_MODEL"] ?? process.env["OMNIUS_OLLAMA_ALLOW_BASE_DUPLICATE"] ?? "";
565683
+ return /^(1|true|yes|on)$/i.test(raw.trim());
565684
+ }
565628
565685
  elasticSpawnCap(gpus) {
565629
565686
  return this.config.maxSpawnedInstances > 0 ? this.config.maxSpawnedInstances : Math.max(0, gpus.length - 1);
565630
565687
  }
@@ -565898,6 +565955,38 @@ var init_ollama_pool = __esm({
565898
565955
  }
565899
565956
  this.instances = survivors;
565900
565957
  }
565958
+ /**
565959
+ * Probe `/api/ps` on an instance and return true when the requested model is
565960
+ * already resident there. This lets dedicated placement reuse an externally
565961
+ * managed base service instead of loading the same large model twice.
565962
+ */
565963
+ async isModelLoadedOnInstance(inst, model) {
565964
+ try {
565965
+ const url = `${inst.state.baseUrl.replace(/\/+$/, "")}/api/ps`;
565966
+ const resp = await fetch(url, { signal: AbortSignal.timeout(2e3) });
565967
+ if (!resp.ok)
565968
+ return false;
565969
+ const data = await resp.json();
565970
+ if (!Array.isArray(data.models))
565971
+ return false;
565972
+ return data.models.some((resident) => this.modelNamesMatch(model, resident.name ?? resident.model ?? ""));
565973
+ } catch {
565974
+ return false;
565975
+ }
565976
+ }
565977
+ modelNamesMatch(requested, resident) {
565978
+ const req3 = requested.trim();
565979
+ const res = resident.trim();
565980
+ if (!req3 || !res)
565981
+ return false;
565982
+ if (req3 === res)
565983
+ return true;
565984
+ if (!req3.includes(":") && res.startsWith(`${req3}:`))
565985
+ return true;
565986
+ if (!res.includes(":") && req3.startsWith(`${res}:`))
565987
+ return true;
565988
+ return false;
565989
+ }
565901
565990
  /**
565902
565991
  * Probe `/api/ps` on the instance and return true if any resident model has
565903
565992
  * less than 95% of its weights in VRAM — the unmistakable CPU-offload
@@ -566129,7 +566218,7 @@ function evaluate2(inputs) {
566129
566218
  compacted: cached?.compacted
566130
566219
  };
566131
566220
  }
566132
- const cacheEligible = isReadLike || proposedCall.tool === "shell" || proposedCall.tool === "memory_write";
566221
+ const cacheEligible = isReadLike || proposedCall.tool === "shell" || proposedCall.tool === "memory_write" || NOOP_WRITE_CACHE_TOOLS.has(proposedCall.tool);
566133
566222
  if (cacheEligible) {
566134
566223
  const cached = recentToolResults.get(fingerprint);
566135
566224
  if (cached !== void 0) {
@@ -566195,9 +566284,16 @@ function isStagnant(signals, opts) {
566195
566284
  return false;
566196
566285
  return signals.completedDelta <= 0 && signals.filesDelta < filesDeltaMin && signals.failureSum >= failureThreshold && signals.variantCount >= variantThreshold;
566197
566286
  }
566287
+ var NOOP_WRITE_CACHE_TOOLS;
566198
566288
  var init_critic = __esm({
566199
566289
  "packages/orchestrator/dist/critic.js"() {
566200
566290
  "use strict";
566291
+ NOOP_WRITE_CACHE_TOOLS = /* @__PURE__ */ new Set([
566292
+ "file_write",
566293
+ "file_edit",
566294
+ "batch_edit",
566295
+ "file_patch"
566296
+ ]);
566201
566297
  }
566202
566298
  });
566203
566299
 
@@ -566557,14 +566653,14 @@ var init_artifact_inspector = __esm({
566557
566653
  // packages/orchestrator/dist/lesson-bank.js
566558
566654
  import { existsSync as existsSync90, mkdirSync as mkdirSync52, appendFileSync as appendFileSync7, readFileSync as readFileSync69 } from "node:fs";
566559
566655
  import { join as join101, dirname as dirname30 } from "node:path";
566560
- import { createHash as createHash25 } from "node:crypto";
566656
+ import { createHash as createHash26 } from "node:crypto";
566561
566657
  function tokenize4(text2) {
566562
566658
  if (!text2)
566563
566659
  return [];
566564
566660
  return text2.toLowerCase().split(TOKENIZE_RE).filter((t2) => t2.length >= 3).slice(0, 80);
566565
566661
  }
566566
566662
  function shortHash(s2) {
566567
- return createHash25("sha256").update(s2).digest("hex").slice(0, 16);
566663
+ return createHash26("sha256").update(s2).digest("hex").slice(0, 16);
566568
566664
  }
566569
566665
  function solicit(args) {
566570
566666
  const { taskGoal, stem, reflections, successOutputPreview } = args;
@@ -566660,7 +566756,7 @@ var init_lesson_bank = __esm({
566660
566756
  // packages/orchestrator/dist/intervention-replay.js
566661
566757
  import { existsSync as existsSync91, mkdirSync as mkdirSync53, readFileSync as readFileSync70, writeFileSync as writeFileSync43, readdirSync as readdirSync29 } from "node:fs";
566662
566758
  import { join as join102, dirname as dirname31 } from "node:path";
566663
- import { createHash as createHash26 } from "node:crypto";
566759
+ import { createHash as createHash27 } from "node:crypto";
566664
566760
  function checkpointDir2(workingDir) {
566665
566761
  return workingDir ? join102(workingDir, ".omnius", "checkpoints") : join102(process.env["HOME"] || ".", ".omnius", "checkpoints");
566666
566762
  }
@@ -566694,7 +566790,7 @@ function sanitizeMessagesForCheckpoint(messages2) {
566694
566790
  deduped.push(m2);
566695
566791
  continue;
566696
566792
  }
566697
- const digest3 = createHash26("sha1").update(content).digest("hex");
566793
+ const digest3 = createHash27("sha1").update(content).digest("hex");
566698
566794
  if (seenSystemDigests.has(digest3))
566699
566795
  continue;
566700
566796
  seenSystemDigests.add(digest3);
@@ -573035,7 +573131,7 @@ var init_evidenceLedger = __esm({
573035
573131
  import { existsSync as existsSync100, mkdirSync as mkdirSync58, readdirSync as readdirSync32, readFileSync as readFileSync78, statSync as statSync36, unlinkSync as unlinkSync17, writeFileSync as writeFileSync48, appendFileSync as appendFileSync9 } from "node:fs";
573036
573132
  import { homedir as homedir35 } from "node:os";
573037
573133
  import { join as join111, resolve as resolve51 } from "node:path";
573038
- import { createHash as createHash27 } from "node:crypto";
573134
+ import { createHash as createHash28 } from "node:crypto";
573039
573135
  function contextWindowDumpDir(cwd4 = process.cwd()) {
573040
573136
  const envDir = process.env["OMNIUS_CONTEXT_WINDOW_DUMP_DIR"]?.trim();
573041
573137
  if (envDir)
@@ -573268,7 +573364,7 @@ function safeId(value2) {
573268
573364
  return String(value2 || "unknown").replace(/[^a-zA-Z0-9_.:-]/g, "_").slice(0, 160);
573269
573365
  }
573270
573366
  function shortHash2(value2) {
573271
- return createHash27("sha256").update(value2).digest("hex").slice(0, 10);
573367
+ return createHash28("sha256").update(value2).digest("hex").slice(0, 10);
573272
573368
  }
573273
573369
  function pruneOldDumpFiles(dir) {
573274
573370
  const raw = Number(process.env["OMNIUS_CONTEXT_WINDOW_DUMP_MAX_FILES"]);
@@ -573645,7 +573741,7 @@ var init_adversaryStream = __esm({
573645
573741
 
573646
573742
  // packages/orchestrator/dist/debugArtifactLibrary.js
573647
573743
  import { appendFileSync as appendFileSync10, existsSync as existsSync101, mkdirSync as mkdirSync59, readFileSync as readFileSync79, statSync as statSync37, writeFileSync as writeFileSync49 } from "node:fs";
573648
- import { createHash as createHash28 } from "node:crypto";
573744
+ import { createHash as createHash29 } from "node:crypto";
573649
573745
  import { basename as basename23, join as join112, relative as relative10, resolve as resolve52 } from "node:path";
573650
573746
  function debugArtifactRoot(cwd4 = process.cwd(), stateDir) {
573651
573747
  const envDir = process.env["OMNIUS_DEBUG_ARTIFACT_DIR"]?.trim();
@@ -574269,7 +574365,7 @@ function safeId2(value2) {
574269
574365
  return String(value2 || "unknown").replace(/[^a-zA-Z0-9_.:-]/g, "_").slice(0, 160);
574270
574366
  }
574271
574367
  function shortHash3(value2) {
574272
- return createHash28("sha256").update(value2).digest("hex").slice(0, 10);
574368
+ return createHash29("sha256").update(value2).digest("hex").slice(0, 10);
574273
574369
  }
574274
574370
  var DEBUG_LIBRARY_DIR, RUN_EVENTS_LIMIT, PREVIEW_LIMIT;
574275
574371
  var init_debugArtifactLibrary = __esm({
@@ -575754,7 +575850,7 @@ __export(preflightSnapshot_exports, {
575754
575850
  import { existsSync as existsSync102, readFileSync as readFileSync80, statSync as statSync38, statfsSync as statfsSync6 } from "node:fs";
575755
575851
  import { homedir as homedir36, platform as platform4, arch as arch2, totalmem as totalmem4, freemem as freemem3, hostname as hostname3 } from "node:os";
575756
575852
  import { join as join113 } from "node:path";
575757
- import { createHash as createHash29 } from "node:crypto";
575853
+ import { createHash as createHash30 } from "node:crypto";
575758
575854
  function capturePreflightSnapshot(workingDir) {
575759
575855
  const warnings = [];
575760
575856
  const configFingerprints = {};
@@ -575923,7 +576019,7 @@ function expandPath(p2) {
575923
576019
  return p2;
575924
576020
  }
575925
576021
  function sha2564(s2) {
575926
- return createHash29("sha256").update(s2).digest("hex").slice(0, 16);
576022
+ return createHash30("sha256").update(s2).digest("hex").slice(0, 16);
575927
576023
  }
575928
576024
  function freeDiskBytes(path12 = "/tmp") {
575929
576025
  try {
@@ -578213,16 +578309,20 @@ ${parts.join("\n")}
578213
578309
  * Matches by card assignee when the card is in progress.
578214
578310
  * Non-fatal: failures to attach evidence are silently caught.
578215
578311
  */
578216
- recordWorkboardToolCall(toolName, args, success, output) {
578312
+ recordWorkboardToolCall(toolName, args, success, output, result) {
578217
578313
  const board = this._workboard ?? this.getOrCreateWorkboard();
578218
578314
  if (!board)
578219
578315
  return;
578220
578316
  if (toolName === "task_complete" || toolName === "workboard_create")
578221
578317
  return;
578318
+ if (result?.success === true && this._isProjectEditTool(toolName) && !this._isRealProjectMutation(toolName, result)) {
578319
+ return;
578320
+ }
578222
578321
  const dir = this._workboardDir();
578223
578322
  try {
578224
578323
  const evidenceSummary = `${toolName} ${success ? "ok" : "fail"}`;
578225
- const evidenceContent = (success ? typeof output === "string" ? output : "" : "").slice(0, 1e3);
578324
+ const rawEvidenceOutput = typeof output === "string" && output.length > 0 ? output : result?.output || result?.error || "";
578325
+ const evidenceContent = rawEvidenceOutput.slice(0, 1e3);
578226
578326
  const evidence = {
578227
578327
  kind: "tool_result",
578228
578328
  summary: evidenceSummary,
@@ -578233,7 +578333,7 @@ ${parts.join("\n")}
578233
578333
  };
578234
578334
  const actor = this.options.subAgent ? "sub-agent" : "agent";
578235
578335
  for (const card of board.cards) {
578236
- if (card.status !== "in_progress" && card.status !== "open")
578336
+ if (card.status !== "in_progress")
578237
578337
  continue;
578238
578338
  if (card.assignee && card.assignee !== actor && card.assignee !== "any")
578239
578339
  continue;
@@ -579799,6 +579899,9 @@ ${modelVisible}` : modelVisible || result.error || displayOutput || "";
579799
579899
  const realFileMutation = input.realFileMutation ?? this._isRealProjectMutation(input.toolName, input.result);
579800
579900
  const attemptedTargetPaths = this._extractToolTargetPaths(input.toolName, input.args, input.result);
579801
579901
  const realMutationPaths = input.realMutationPaths ?? (realFileMutation ? attemptedTargetPaths : []);
579902
+ if (input.result.success === true && this._isProjectEditTool(input.toolName) && !realFileMutation) {
579903
+ return;
579904
+ }
579802
579905
  if (this._shouldSuppressCompletionDiscoveryEvidence(input.toolName, input.result, attemptedTargetPaths)) {
579803
579906
  return;
579804
579907
  }
@@ -584430,6 +584533,7 @@ TASK: ${scrubbedTask}` : scrubbedTask;
584430
584533
  const recentToolResults = /* @__PURE__ */ new Map();
584431
584534
  const dedupHitCount = /* @__PURE__ */ new Map();
584432
584535
  const noopedMemoryWriteFingerprints = /* @__PURE__ */ new Set();
584536
+ const noopedProjectWriteFingerprints = /* @__PURE__ */ new Set();
584433
584537
  const DEDUP_ESCALATION_THRESHOLD = 3;
584434
584538
  const toolCallBudget = /* @__PURE__ */ new Map();
584435
584539
  const loopTier = this.options.modelTier ?? "large";
@@ -586073,8 +586177,8 @@ If you're stuck, try a completely different approach. Do NOT repeat what failed
586073
586177
  if (process.env["OMNIUS_DISABLE_ADAPTIVE_RETRIEVAL"] !== "1") {
586074
586178
  const goalForSig = (this._taskState.goal || "").slice(0, 200);
586075
586179
  const recentTools = this._toolSequence.slice(-5).join("|");
586076
- const { createHash: createHash47 } = await import("node:crypto");
586077
- const sig = createHash47("sha256").update(`${goalForSig}::${recentTools}`).digest("hex").slice(0, 16);
586180
+ const { createHash: createHash48 } = await import("node:crypto");
586181
+ const sig = createHash48("sha256").update(`${goalForSig}::${recentTools}`).digest("hex").slice(0, 16);
586078
586182
  if (this._lastPprSig === sig && this._lastPprMemoryLines.length > 0) {
586079
586183
  compacted.push({
586080
586184
  role: "system",
@@ -587019,7 +587123,9 @@ Corrective action: try a different approach first: read relevant files, adjust a
587019
587123
  }
587020
587124
  const exactToolFingerprint = this._buildToolFingerprint(tc.name, tc.arguments ?? {});
587021
587125
  const toolFingerprint = this._resolveReadCoverageFingerprint(tc.name, tc.arguments ?? {}, exactToolFingerprint);
587022
- if (tc.name === "memory_write" && noopedMemoryWriteFingerprints.has(toolFingerprint)) {
587126
+ const repeatedMemoryWriteNoop = tc.name === "memory_write" && noopedMemoryWriteFingerprints.has(toolFingerprint);
587127
+ const repeatedProjectWriteNoop = this._isProjectEditTool(tc.name) && noopedProjectWriteFingerprints.has(toolFingerprint);
587128
+ if (repeatedMemoryWriteNoop || repeatedProjectWriteNoop) {
587023
587129
  this.emit({
587024
587130
  type: "tool_call",
587025
587131
  toolName: tc.name,
@@ -587027,9 +587133,11 @@ Corrective action: try a different approach first: read relevant files, adjust a
587027
587133
  turn,
587028
587134
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
587029
587135
  });
587030
- const repeatNoopMsg = `[MEMORY WRITE NO-OP REPEAT BLOCK] Exact repeat of memory_write(${JSON.stringify(tc.arguments ?? {}).slice(0, 200)}).
587136
+ const repeatNoopMsg = repeatedMemoryWriteNoop ? `[MEMORY WRITE NO-OP REPEAT BLOCK] Exact repeat of memory_write(${JSON.stringify(tc.arguments ?? {}).slice(0, 200)}).
587031
587137
  This same topic/key/value was already confirmed stored, so the call was not executed again.
587032
- Use the saved fact to continue the promised synthesis or next concrete step, or call task_complete if this bookkeeping was the final step.`;
587138
+ Use the saved fact to continue the promised synthesis or next concrete step, or call task_complete if this bookkeeping was the final step.` : `[PROJECT WRITE NO-OP REPEAT BLOCK] Exact repeat of ${tc.name}(${JSON.stringify(tc.arguments ?? {}).slice(0, 200)}).
587139
+ This edit was already confirmed to make no file change, so the call was not executed again.
587140
+ Read the current file if needed, make a different concrete edit, or move to verification/completion.`;
587033
587141
  this.emit({
587034
587142
  type: "tool_result",
587035
587143
  toolName: tc.name,
@@ -587040,7 +587148,7 @@ Use the saved fact to continue the promised synthesis or next concrete step, or
587040
587148
  });
587041
587149
  this._tagSyntheticFailure({
587042
587150
  mode: "step_repetition",
587043
- rationale: "memory_write retried after an exact no-op was observed"
587151
+ rationale: repeatedMemoryWriteNoop ? "memory_write retried after an exact no-op was observed" : `${tc.name} retried after an exact project-write no-op was observed`
587044
587152
  });
587045
587153
  return {
587046
587154
  tc,
@@ -588444,7 +588552,8 @@ Respond with EXACTLY this structure before your next tool call:
588444
588552
  }
588445
588553
  }
588446
588554
  const cacheableMemoryNoop = tc.name === "memory_write" && result.success && result.noop;
588447
- if (isReadLike && result.success || tc.name === "shell" || cacheableMemoryNoop) {
588555
+ const cacheableProjectWriteNoop = this._isProjectEditTool(tc.name) && result.success && !this._isRealProjectMutation(tc.name, result) && (result.noop === true || result.mutated === false);
588556
+ if (isReadLike && result.success || tc.name === "shell" || cacheableMemoryNoop || cacheableProjectWriteNoop) {
588448
588557
  recentToolResults.set(toolFingerprint, {
588449
588558
  result: tc.name === "shell" ? this._buildShellCacheResult(tc.arguments, result) : (
588450
588559
  // Read-like results are SERVED BACK to the model when the
@@ -588465,10 +588574,17 @@ Respond with EXACTLY this structure before your next tool call:
588465
588574
  if (firstKey !== void 0) {
588466
588575
  recentToolResults.delete(firstKey);
588467
588576
  dedupHitCount.delete(firstKey);
588577
+ noopedMemoryWriteFingerprints.delete(firstKey);
588578
+ noopedProjectWriteFingerprints.delete(firstKey);
588468
588579
  }
588469
588580
  }
588470
- if (cacheableMemoryNoop) {
588471
- noopedMemoryWriteFingerprints.add(toolFingerprint);
588581
+ if (cacheableMemoryNoop || cacheableProjectWriteNoop) {
588582
+ if (cacheableMemoryNoop) {
588583
+ noopedMemoryWriteFingerprints.add(toolFingerprint);
588584
+ }
588585
+ if (cacheableProjectWriteNoop) {
588586
+ noopedProjectWriteFingerprints.add(toolFingerprint);
588587
+ }
588472
588588
  const repeatGateSeed = Math.max(0, this._resolveRepeatGateMax() - 1);
588473
588589
  if (repeatGateSeed > 0) {
588474
588590
  dedupHitCount.set(toolFingerprint, Math.max(dedupHitCount.get(toolFingerprint) ?? 0, repeatGateSeed));
@@ -588489,6 +588605,10 @@ Respond with EXACTLY this structure before your next tool call:
588489
588605
  if (key.includes(mp))
588490
588606
  recentToolResults.delete(key);
588491
588607
  }
588608
+ for (const key of Array.from(noopedProjectWriteFingerprints)) {
588609
+ if (key.includes(mp))
588610
+ noopedProjectWriteFingerprints.delete(key);
588611
+ }
588492
588612
  for (const covKey of Array.from(this._readCoverage.keys())) {
588493
588613
  if (covKey.includes(mp))
588494
588614
  this._readCoverage.delete(covKey);
@@ -588496,15 +588616,18 @@ Respond with EXACTLY this structure before your next tool call:
588496
588616
  }
588497
588617
  } else if (dedupHitCount.size > 0) {
588498
588618
  dedupHitCount.clear();
588619
+ recentToolResults.clear();
588620
+ noopedProjectWriteFingerprints.clear();
588499
588621
  }
588500
588622
  }
588501
588623
  if (shellFilesystemMutation && recentToolResults.size > 0) {
588502
588624
  for (const key of Array.from(recentToolResults.keys())) {
588503
- if (key.startsWith("shell:") || key.startsWith("file_read:") || key.startsWith("list_directory:") || key.startsWith("grep_search:") || key.startsWith("find_files:")) {
588625
+ if (key.startsWith("shell:") || key.startsWith("file_read:") || key.startsWith("file_write:") || key.startsWith("file_edit:") || key.startsWith("batch_edit:") || key.startsWith("file_patch:") || key.startsWith("list_directory:") || key.startsWith("grep_search:") || key.startsWith("find_files:")) {
588504
588626
  recentToolResults.delete(key);
588505
588627
  dedupHitCount.delete(key);
588506
588628
  }
588507
588629
  }
588630
+ noopedProjectWriteFingerprints.clear();
588508
588631
  this._readCoverage.clear();
588509
588632
  this.emit({
588510
588633
  type: "status",
@@ -588790,12 +588913,12 @@ Evidence: ${evidencePreview}`.slice(0, 500);
588790
588913
  this.emit({
588791
588914
  type: "tool_result",
588792
588915
  toolName: tc.name,
588793
- content: this.toolResultEventContent(tc.name, output),
588916
+ content: this.toolResultEventContent(tc.name, output || result.output || result.error || ""),
588794
588917
  success: result.success,
588795
588918
  turn,
588796
588919
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
588797
588920
  });
588798
- this.recordWorkboardToolCall(tc.name, tc.arguments, result.success, result.output || output);
588921
+ this.recordWorkboardToolCall(tc.name, tc.arguments, result.success, result.output || result.error || output, result);
588799
588922
  this._taskState.toolCallCount++;
588800
588923
  if (realFileMutation) {
588801
588924
  this._lastFileWriteTurn = turn;
@@ -588953,7 +589076,7 @@ Evidence: ${evidencePreview}`.slice(0, 500);
588953
589076
  args: tc.arguments,
588954
589077
  success: result.success,
588955
589078
  durationMs: performance.now() - toolStart,
588956
- output: result.output || output,
589079
+ output: result.output || output || result.error || "",
588957
589080
  error: result.error ?? "",
588958
589081
  llmContent: result.llmContent,
588959
589082
  realFileMutation,
@@ -589028,12 +589151,13 @@ Do NOT retry ${tc.name} with similar arguments.`);
589028
589151
  }
589029
589152
  }
589030
589153
  if (filePath && (tc.name === "file_read" || tc.name === "file_write" || tc.name === "file_edit" || tc.name === "batch_edit" || tc.name === "file_patch")) {
589031
- const isModify = tc.name !== "file_read";
589154
+ const isRead = tc.name === "file_read";
589155
+ const isModify = realFileMutation;
589032
589156
  const existing = this._fileRegistry.get(filePath);
589033
589157
  this._fileRegistry.set(filePath, {
589034
589158
  lastSeenTurn: turn,
589035
589159
  modified: existing?.modified || isModify,
589036
- summary: isModify ? `Modified (${tc.name}) turn ${turn}` : `Read turn ${turn} (${result.output.split("\n").length} lines)`,
589160
+ summary: isModify ? `Modified (${tc.name}) turn ${turn}` : isRead ? `Read turn ${turn} (${result.output.split("\n").length} lines)` : `${tc.name} no file change turn ${turn}`,
589037
589161
  accessCount: (existing?.accessCount ?? 0) + 1
589038
589162
  });
589039
589163
  if (isModify) {
@@ -589054,7 +589178,9 @@ Do NOT retry ${tc.name} with similar arguments.`);
589054
589178
  }
589055
589179
  if (result.success) {
589056
589180
  if (tc.name === "file_write" || tc.name === "file_edit" || tc.name === "batch_edit") {
589057
- this._taskState.completedSteps.push(`${tc.name}: \`${filePath}\``);
589181
+ if (realFileMutation) {
589182
+ this._taskState.completedSteps.push(`${tc.name}: \`${filePath}\``);
589183
+ }
589058
589184
  } else if ((tc.name === "shell" || tc.name === "background_run") && /PASS|passed|success|✓/i.test(result.output)) {
589059
589185
  this._taskState.completedSteps.push(`Test passed: \`${String(tc.arguments?.command ?? "").slice(0, 80)}\``);
589060
589186
  } else if (tc.name === "memory_write" && !result.noop) {
@@ -590299,7 +590425,7 @@ Full content available via: repl_exec(code="data = retrieve('${handleId}')") or
590299
590425
  this.emit({
590300
590426
  type: "tool_result",
590301
590427
  toolName: tc.name,
590302
- content: this.toolResultEventContent(tc.name, output),
590428
+ content: this.toolResultEventContent(tc.name, output || result.output || result.error || ""),
590303
590429
  success: result.success,
590304
590430
  turn,
590305
590431
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
@@ -591722,7 +591848,7 @@ ${marker}` : marker);
591722
591848
  }
591723
591849
  return;
591724
591850
  }
591725
- if (toolName === "file_write" && path12 && result.success && result.mutated !== false) {
591851
+ if (toolName === "file_write" && path12 && this._isRealProjectMutation(toolName, result)) {
591726
591852
  for (const [key2, entry] of this._staleEditFamilies) {
591727
591853
  if (entry.pathKey === pathKey)
591728
591854
  this._staleEditFamilies.delete(key2);
@@ -591735,7 +591861,7 @@ ${marker}` : marker);
591735
591861
  if (!target)
591736
591862
  return;
591737
591863
  const targetPathKey = this.staleEditPathKey(target.path);
591738
- if (result.success && result.mutated !== false) {
591864
+ if (this._isRealProjectMutation(toolName, result)) {
591739
591865
  for (const [key2, entry] of this._staleEditFamilies) {
591740
591866
  if (entry.pathKey === targetPathKey)
591741
591867
  this._staleEditFamilies.delete(key2);
@@ -598101,7 +598227,7 @@ var init_composite_scorer = __esm({
598101
598227
  });
598102
598228
 
598103
598229
  // packages/orchestrator/dist/memory/materialization-policy.js
598104
- import { createHash as createHash30 } from "node:crypto";
598230
+ import { createHash as createHash31 } from "node:crypto";
598105
598231
  function materializeMemoryItems(items, options2 = {}) {
598106
598232
  const config = options2.config ?? DEFAULT_WEIGHTING_CONFIG;
598107
598233
  const sorted = [...items].sort((a2, b) => b.weight - a2.weight || a2.id.localeCompare(b.id));
@@ -598339,7 +598465,7 @@ function estimateTokens4(text2) {
598339
598465
  return Math.max(1, Math.ceil(text2.length / 4));
598340
598466
  }
598341
598467
  function hashText(text2) {
598342
- return createHash30("sha256").update(text2).digest("hex");
598468
+ return createHash31("sha256").update(text2).digest("hex");
598343
598469
  }
598344
598470
  var init_materialization_policy = __esm({
598345
598471
  "packages/orchestrator/dist/memory/materialization-policy.js"() {
@@ -598503,7 +598629,7 @@ var init_config_loader = __esm({
598503
598629
  });
598504
598630
 
598505
598631
  // packages/orchestrator/dist/memory/stability-tracker.js
598506
- import { createHash as createHash31 } from "node:crypto";
598632
+ import { createHash as createHash32 } from "node:crypto";
598507
598633
  import { existsSync as existsSync106, mkdirSync as mkdirSync60, readFileSync as readFileSync83, writeFileSync as writeFileSync51 } from "node:fs";
598508
598634
  import { dirname as dirname36, join as join117 } from "node:path";
598509
598635
  function stabilityFilePath(repoRoot) {
@@ -598567,7 +598693,7 @@ function computeStabilityHash(item) {
598567
598693
  item.scope.name,
598568
598694
  item.topicKey
598569
598695
  ].join("|");
598570
- return createHash31("sha256").update(normalized).digest("hex");
598696
+ return createHash32("sha256").update(normalized).digest("hex");
598571
598697
  }
598572
598698
  function normalizeContent2(content) {
598573
598699
  return content.replace(/\s+/g, " ").trim();
@@ -602539,10 +602665,10 @@ var init_project_arc = __esm({
602539
602665
  });
602540
602666
 
602541
602667
  // packages/orchestrator/dist/dedup-gate.js
602542
- import { createHash as createHash32 } from "node:crypto";
602668
+ import { createHash as createHash33 } from "node:crypto";
602543
602669
  function fingerprintCall(name10, args) {
602544
602670
  const canon = canonicalize(args);
602545
- return createHash32("sha1").update(`${name10}\0${canon}`).digest("hex").slice(0, 16);
602671
+ return createHash33("sha1").update(`${name10}\0${canon}`).digest("hex").slice(0, 16);
602546
602672
  }
602547
602673
  function canonicalize(value2) {
602548
602674
  if (value2 === null || typeof value2 !== "object")
@@ -612845,7 +612971,7 @@ var require_websocket3 = __commonJS({
612845
612971
  var http6 = __require("http");
612846
612972
  var net5 = __require("net");
612847
612973
  var tls2 = __require("tls");
612848
- var { randomBytes: randomBytes31, createHash: createHash47 } = __require("crypto");
612974
+ var { randomBytes: randomBytes31, createHash: createHash48 } = __require("crypto");
612849
612975
  var { Duplex: Duplex3, Readable } = __require("stream");
612850
612976
  var { URL: URL3 } = __require("url");
612851
612977
  var PerMessageDeflate3 = require_permessage_deflate3();
@@ -613505,7 +613631,7 @@ var require_websocket3 = __commonJS({
613505
613631
  abortHandshake(websocket, socket, "Invalid Upgrade header");
613506
613632
  return;
613507
613633
  }
613508
- const digest3 = createHash47("sha1").update(key + GUID).digest("base64");
613634
+ const digest3 = createHash48("sha1").update(key + GUID).digest("base64");
613509
613635
  if (res.headers["sec-websocket-accept"] !== digest3) {
613510
613636
  abortHandshake(websocket, socket, "Invalid Sec-WebSocket-Accept header");
613511
613637
  return;
@@ -613872,7 +613998,7 @@ var require_websocket_server2 = __commonJS({
613872
613998
  var EventEmitter15 = __require("events");
613873
613999
  var http6 = __require("http");
613874
614000
  var { Duplex: Duplex3 } = __require("stream");
613875
- var { createHash: createHash47 } = __require("crypto");
614001
+ var { createHash: createHash48 } = __require("crypto");
613876
614002
  var extension3 = require_extension3();
613877
614003
  var PerMessageDeflate3 = require_permessage_deflate3();
613878
614004
  var subprotocol3 = require_subprotocol2();
@@ -614173,7 +614299,7 @@ var require_websocket_server2 = __commonJS({
614173
614299
  );
614174
614300
  }
614175
614301
  if (this._state > RUNNING) return abortHandshake(socket, 503);
614176
- const digest3 = createHash47("sha1").update(key + GUID).digest("base64");
614302
+ const digest3 = createHash48("sha1").update(key + GUID).digest("base64");
614177
614303
  const headers = [
614178
614304
  "HTTP/1.1 101 Switching Protocols",
614179
614305
  "Upgrade: websocket",
@@ -620726,14 +620852,14 @@ var init_voice_session = __esm({
620726
620852
  });
620727
620853
 
620728
620854
  // packages/cli/src/tui/scoped-personality.ts
620729
- import { createHash as createHash33 } from "node:crypto";
620855
+ import { createHash as createHash34 } from "node:crypto";
620730
620856
  import { appendFileSync as appendFileSync13, existsSync as existsSync117, mkdirSync as mkdirSync72, readFileSync as readFileSync96, writeFileSync as writeFileSync60 } from "node:fs";
620731
620857
  import { join as join131, resolve as resolve56 } from "node:path";
620732
620858
  function safeName(input) {
620733
620859
  return input.replace(/[^A-Za-z0-9_.-]/g, "-").slice(0, 80) || "default";
620734
620860
  }
620735
620861
  function scopeHash(scope) {
620736
- return createHash33("sha1").update(`${scope.kind}:${scope.id}`).digest("hex").slice(0, 16);
620862
+ return createHash34("sha1").update(`${scope.kind}:${scope.id}`).digest("hex").slice(0, 16);
620737
620863
  }
620738
620864
  function scopedPersonalityDir(repoRoot, kind) {
620739
620865
  return resolve56(repoRoot, ".omnius", "scoped-personality", kind);
@@ -621105,7 +621231,7 @@ var init_scoped_personality = __esm({
621105
621231
  });
621106
621232
 
621107
621233
  // packages/cli/src/tui/voice-soul.ts
621108
- import { createHash as createHash34 } from "node:crypto";
621234
+ import { createHash as createHash35 } from "node:crypto";
621109
621235
  import { existsSync as existsSync118, readdirSync as readdirSync38, readFileSync as readFileSync97 } from "node:fs";
621110
621236
  import { basename as basename25, join as join132, resolve as resolve57 } from "node:path";
621111
621237
  function compactText(text2, limit) {
@@ -621120,7 +621246,7 @@ function blockText(text2, limit) {
621120
621246
  ... [truncated]`;
621121
621247
  }
621122
621248
  function scopeStateKey(scope, surface) {
621123
- return createHash34("sha1").update(`${surface}:${scope.kind}:${scope.id}`).digest("hex").slice(0, 16);
621249
+ return createHash35("sha1").update(`${surface}:${scope.kind}:${scope.id}`).digest("hex").slice(0, 16);
621124
621250
  }
621125
621251
  function safeName2(input) {
621126
621252
  return input.replace(/[^A-Za-z0-9_.-]/g, "-").slice(0, 80) || "default";
@@ -623764,7 +623890,7 @@ var init_types3 = __esm({
623764
623890
  });
623765
623891
 
623766
623892
  // packages/cli/src/tui/p2p/secret-vault.ts
623767
- import { createCipheriv as createCipheriv3, createDecipheriv as createDecipheriv3, randomBytes as randomBytes23, scryptSync as scryptSync2, createHash as createHash35 } from "node:crypto";
623893
+ import { createCipheriv as createCipheriv3, createDecipheriv as createDecipheriv3, randomBytes as randomBytes23, scryptSync as scryptSync2, createHash as createHash36 } from "node:crypto";
623768
623894
  import { readFileSync as readFileSync99, writeFileSync as writeFileSync62, existsSync as existsSync120, mkdirSync as mkdirSync74 } from "node:fs";
623769
623895
  import { dirname as dirname39 } from "node:path";
623770
623896
  var PLACEHOLDER_PREFIX, PLACEHOLDER_SUFFIX, CIPHER_ALGO, SALT_LEN, IV_LEN, KEY_LEN, SecretVault;
@@ -624009,7 +624135,7 @@ var init_secret_vault = __esm({
624009
624135
  /** Generate a deterministic fingerprint of vault contents (for sync verification) */
624010
624136
  fingerprint() {
624011
624137
  const names = Array.from(this.secrets.keys()).sort();
624012
- const hash = createHash35("sha256");
624138
+ const hash = createHash36("sha256");
624013
624139
  for (const name10 of names) {
624014
624140
  hash.update(name10 + ":");
624015
624141
  hash.update(this.secrets.get(name10).value);
@@ -624024,7 +624150,7 @@ var init_secret_vault = __esm({
624024
624150
  // packages/cli/src/tui/p2p/peer-mesh.ts
624025
624151
  import { EventEmitter as EventEmitter9 } from "node:events";
624026
624152
  import { createServer as createServer6 } from "node:http";
624027
- import { randomBytes as randomBytes24, createHash as createHash36, generateKeyPairSync } from "node:crypto";
624153
+ import { randomBytes as randomBytes24, createHash as createHash37, generateKeyPairSync } from "node:crypto";
624028
624154
  var PING_INTERVAL_MS, PEER_TIMEOUT_MS, GOSSIP_INTERVAL_MS, MAX_PEERS, PeerMesh;
624029
624155
  var init_peer_mesh = __esm({
624030
624156
  "packages/cli/src/tui/p2p/peer-mesh.ts"() {
@@ -624041,7 +624167,7 @@ var init_peer_mesh = __esm({
624041
624167
  const { publicKey: publicKey2, privateKey } = generateKeyPairSync("ed25519");
624042
624168
  this.publicKey = publicKey2.export({ type: "spki", format: "der" });
624043
624169
  this.privateKey = privateKey.export({ type: "pkcs8", format: "der" });
624044
- this.peerId = createHash36("sha256").update(this.publicKey).digest("base64url").slice(0, 22);
624170
+ this.peerId = createHash37("sha256").update(this.publicKey).digest("base64url").slice(0, 22);
624045
624171
  this.capabilities = options2.capabilities;
624046
624172
  this.displayName = options2.displayName;
624047
624173
  this._authKey = options2.authKey ?? randomBytes24(24).toString("base64url");
@@ -625406,7 +625532,7 @@ __export(omnius_directory_exports, {
625406
625532
  import { appendFileSync as appendFileSync14, cpSync as cpSync2, existsSync as existsSync122, mkdirSync as mkdirSync76, readFileSync as readFileSync101, writeFileSync as writeFileSync64, readdirSync as readdirSync41, statSync as statSync47, unlinkSync as unlinkSync23, openSync as openSync2, closeSync as closeSync2, renameSync as renameSync11, watch as fsWatch2 } from "node:fs";
625407
625533
  import { join as join136, relative as relative14, basename as basename26, dirname as dirname40, resolve as resolve58 } from "node:path";
625408
625534
  import { homedir as homedir42 } from "node:os";
625409
- import { createHash as createHash38 } from "node:crypto";
625535
+ import { createHash as createHash39 } from "node:crypto";
625410
625536
  function isGitRoot(dir) {
625411
625537
  const gitPath = join136(dir, ".git");
625412
625538
  if (!existsSync122(gitPath)) return false;
@@ -625888,7 +626014,7 @@ function buildHandoffPrompt(repoRoot) {
625888
626014
  return lines.join("\n");
625889
626015
  }
625890
626016
  function computeDedupeHash(task, savedAt) {
625891
- return createHash38("sha256").update(`${task}|${savedAt}`).digest("hex").slice(0, 16);
626017
+ return createHash39("sha256").update(`${task}|${savedAt}`).digest("hex").slice(0, 16);
625892
626018
  }
625893
626019
  function generateSessionId() {
625894
626020
  const timestamp = Date.now().toString(36);
@@ -650659,7 +650785,7 @@ __export(commands_exports, {
650659
650785
  });
650660
650786
  import * as nodeOs from "node:os";
650661
650787
  import { spawn as nodeSpawn2 } from "node:child_process";
650662
- import { createHash as createHash39 } from "node:crypto";
650788
+ import { createHash as createHash40 } from "node:crypto";
650663
650789
  import {
650664
650790
  existsSync as existsSync142,
650665
650791
  readFileSync as readFileSync116,
@@ -663936,7 +664062,7 @@ async function collectSponsorMediaStream(args) {
663936
664062
  };
663937
664063
  }
663938
664064
  if (artifact.sha256) {
663939
- const sha = createHash39("sha256").update(bytes).digest("hex");
664065
+ const sha = createHash40("sha256").update(bytes).digest("hex");
663940
664066
  if (sha !== artifact.sha256)
663941
664067
  return { ok: false, error: `Artifact hash mismatch for ${artifactId}` };
663942
664068
  }
@@ -672344,8 +672470,9 @@ function createEditHistoryLogger(repoRoot, sessionId) {
672344
672470
  mkdirSync90(historyDir, { recursive: true });
672345
672471
  } catch {
672346
672472
  }
672347
- function logToolCall(toolName, toolArgs, success) {
672473
+ function logToolCall(toolName, toolArgs, success, resultContent = "") {
672348
672474
  if (!EDIT_TOOLS.has(toolName)) return;
672475
+ if (success && /^\[NO-OP\b/i.test(resultContent.trim())) return;
672349
672476
  const entry = {
672350
672477
  ts: (/* @__PURE__ */ new Date()).toISOString(),
672351
672478
  tool: toolName,
@@ -679061,7 +679188,7 @@ import {
679061
679188
  unlinkSync as unlinkSync33
679062
679189
  } from "node:fs";
679063
679190
  import { join as join166 } from "node:path";
679064
- import { createHash as createHash40 } from "node:crypto";
679191
+ import { createHash as createHash41 } from "node:crypto";
679065
679192
  function safeFilePart(value2) {
679066
679193
  return value2.replace(/[^A-Za-z0-9_.-]+/g, "_").slice(0, 80) || "telegram";
679067
679194
  }
@@ -679069,7 +679196,7 @@ function daydreamRoot(repoRoot) {
679069
679196
  return join166(repoRoot, ".omnius", "telegram-daydreams");
679070
679197
  }
679071
679198
  function sessionDir(repoRoot, sessionKey) {
679072
- const hash = createHash40("sha1").update(sessionKey).digest("hex").slice(0, 20);
679199
+ const hash = createHash41("sha1").update(sessionKey).digest("hex").slice(0, 20);
679073
679200
  return join166(daydreamRoot(repoRoot), safeFilePart(hash));
679074
679201
  }
679075
679202
  function compactLine2(value2, max = 220) {
@@ -679180,7 +679307,7 @@ function buildReplyOpportunities(input, openQuestions) {
679180
679307
  return opportunities;
679181
679308
  }
679182
679309
  function daydreamOpportunityId(input, trigger) {
679183
- return createHash40("sha1").update(`${input.sessionKey}:${input.generatedAtMs}:${trigger}`).digest("hex").slice(0, 16);
679310
+ return createHash41("sha1").update(`${input.sessionKey}:${input.generatedAtMs}:${trigger}`).digest("hex").slice(0, 16);
679184
679311
  }
679185
679312
  function clamp0114(value2) {
679186
679313
  if (!Number.isFinite(value2)) return 0;
@@ -679585,7 +679712,7 @@ function buildTelegramChannelDaydream(input, corpus, extraction, extractionCommi
679585
679712
  const seed = `${input.sessionKey}:${input.generatedAtMs}:${input.history.length}`;
679586
679713
  return {
679587
679714
  version: 3,
679588
- id: createHash40("sha1").update(seed).digest("hex").slice(0, 16),
679715
+ id: createHash41("sha1").update(seed).digest("hex").slice(0, 16),
679589
679716
  sessionKey: input.sessionKey,
679590
679717
  chatId: input.chatId,
679591
679718
  chatTitle: input.chatTitle,
@@ -679898,12 +680025,12 @@ var init_telegram_channel_dmn = __esm({
679898
680025
  });
679899
680026
 
679900
680027
  // packages/cli/src/tui/telegram-reflection-corpus.ts
679901
- import { createHash as createHash41 } from "node:crypto";
680028
+ import { createHash as createHash42 } from "node:crypto";
679902
680029
  function telegramReflectionMemoryDbPaths(repoRoot) {
679903
680030
  return omniusMemoryDbPaths(repoRoot);
679904
680031
  }
679905
680032
  function stableHash2(value2, length4 = 16) {
679906
- return createHash41("sha1").update(value2).digest("hex").slice(0, length4);
680033
+ return createHash42("sha1").update(value2).digest("hex").slice(0, length4);
679907
680034
  }
679908
680035
  function clean3(value2) {
679909
680036
  return String(value2 ?? "").replace(/\s+/g, " ").trim();
@@ -680718,7 +680845,7 @@ var init_telegram_reflection_extraction = __esm({
680718
680845
  });
680719
680846
 
680720
680847
  // packages/cli/src/tui/telegram-social-state-types.ts
680721
- import { createHash as createHash42 } from "node:crypto";
680848
+ import { createHash as createHash43 } from "node:crypto";
680722
680849
  function telegramSocialActorKey(actor) {
680723
680850
  if (!actor) return "unknown";
680724
680851
  if (typeof actor.userId === "number") return `user:${actor.userId}`;
@@ -680751,7 +680878,7 @@ function appendUnique(items, value2, max) {
680751
680878
  return next.slice(-max);
680752
680879
  }
680753
680880
  function hashTelegramSocialId(parts) {
680754
- return createHash42("sha1").update(parts.map((part) => String(part ?? "")).join(":")).digest("hex").slice(0, 16);
680881
+ return createHash43("sha1").update(parts.map((part) => String(part ?? "")).join(":")).digest("hex").slice(0, 16);
680755
680882
  }
680756
680883
  function cleanUsername(value2) {
680757
680884
  if (typeof value2 !== "string") return void 0;
@@ -681817,7 +681944,7 @@ import {
681817
681944
  } from "node:path";
681818
681945
  import { homedir as homedir55 } from "node:os";
681819
681946
  import { writeFile as writeFileAsync } from "node:fs/promises";
681820
- import { createHash as createHash43, randomBytes as randomBytes27, randomInt } from "node:crypto";
681947
+ import { createHash as createHash44, randomBytes as randomBytes27, randomInt } from "node:crypto";
681821
681948
  function formatModelBytes(bytes) {
681822
681949
  if (!Number.isFinite(bytes) || bytes <= 0) return "0 B";
681823
681950
  const units = ["B", "KB", "MB", "GB", "TB"];
@@ -683062,7 +683189,7 @@ function buildTelegramRuntimeContext(now2 = /* @__PURE__ */ new Date(), repoRoot
683062
683189
  return buildConversationRuntimeContext(now2, repoRoot);
683063
683190
  }
683064
683191
  function telegramSessionIdFromKey(sessionKey) {
683065
- return `telegram-${createHash43("sha1").update(sessionKey).digest("hex").slice(0, 16)}`;
683192
+ return `telegram-${createHash44("sha1").update(sessionKey).digest("hex").slice(0, 16)}`;
683066
683193
  }
683067
683194
  function normalizeTelegramSubAgentLimit(value2) {
683068
683195
  const parsed = typeof value2 === "number" ? value2 : typeof value2 === "string" && value2.trim() ? Number(value2.trim()) : TELEGRAM_SUB_AGENT_DEFAULT_LIMIT;
@@ -685230,7 +685357,7 @@ Telegram link integrity contract:
685230
685357
  return !!this.adminAuthChallenge && this.adminAuthChallenge.expiresAtMs > Date.now();
685231
685358
  }
685232
685359
  hashAdminAuthCode(code8) {
685233
- return createHash43("sha256").update(`omnius-telegram-admin:${code8.trim()}`).digest("hex");
685360
+ return createHash44("sha256").update(`omnius-telegram-admin:${code8.trim()}`).digest("hex");
685234
685361
  }
685235
685362
  viewIdForMessage(msg) {
685236
685363
  return `telegram-${this.sessionKeyForMessage(msg).replace(/[^A-Za-z0-9_-]/g, "-")}`;
@@ -687294,11 +687421,11 @@ ${mediaContext}` : ""
687294
687421
  return payload;
687295
687422
  }
687296
687423
  telegramConversationPath(sessionKey) {
687297
- const safe = createHash43("sha1").update(sessionKey).digest("hex").slice(0, 20);
687424
+ const safe = createHash44("sha1").update(sessionKey).digest("hex").slice(0, 20);
687298
687425
  return join168(this.telegramConversationDir, `${safe}.json`);
687299
687426
  }
687300
687427
  telegramConversationLedgerPath(sessionKey) {
687301
- const safe = createHash43("sha1").update(sessionKey).digest("hex").slice(0, 20);
687428
+ const safe = createHash44("sha1").update(sessionKey).digest("hex").slice(0, 20);
687302
687429
  return join168(this.telegramConversationDir, `${safe}.events.jsonl`);
687303
687430
  }
687304
687431
  telegramDb() {
@@ -687531,7 +687658,7 @@ ${mediaContext}` : ""
687531
687658
  relationships: Array.isArray(raw.relationships) ? raw.relationships.slice(0, TELEGRAM_ASSOCIATIVE_RELATION_LIMIT).map((fact) => this.normalizeTelegramAssociativeFact(fact)) : [],
687532
687659
  actions: Array.isArray(raw.actions) ? raw.actions.slice(-TELEGRAM_ASSOCIATIVE_ACTION_LIMIT).map((action) => ({
687533
687660
  id: String(
687534
- action.id || createHash43("sha1").update(JSON.stringify(action)).digest("hex").slice(0, 12)
687661
+ action.id || createHash44("sha1").update(JSON.stringify(action)).digest("hex").slice(0, 12)
687535
687662
  ),
687536
687663
  ts: typeof action.ts === "number" ? action.ts : Date.now(),
687537
687664
  role: action.role === "assistant" ? "assistant" : "user",
@@ -687550,7 +687677,7 @@ ${mediaContext}` : ""
687550
687677
  const now2 = Date.now();
687551
687678
  return {
687552
687679
  id: String(
687553
- raw.id || createHash43("sha1").update(text2 || String(now2)).digest("hex").slice(0, 12)
687680
+ raw.id || createHash44("sha1").update(text2 || String(now2)).digest("hex").slice(0, 12)
687554
687681
  ),
687555
687682
  text: text2,
687556
687683
  tags: Array.isArray(raw.tags) ? raw.tags.map(String).slice(0, 16) : [],
@@ -688007,7 +688134,7 @@ ${mediaContext}` : ""
688007
688134
  telegramHistoryBackfillMessageId(sessionKey, entry, index) {
688008
688135
  if (typeof entry.messageId === "number" && Number.isFinite(entry.messageId))
688009
688136
  return entry.messageId;
688010
- const digest3 = createHash43("sha1").update(
688137
+ const digest3 = createHash44("sha1").update(
688011
688138
  `${sessionKey}:${index}:${entry.role}:${entry.ts ?? ""}:${entry.text}`
688012
688139
  ).digest("hex").slice(0, 8);
688013
688140
  return -Number.parseInt(digest3, 16);
@@ -689197,7 +689324,7 @@ ${mediaContext}` : ""
689197
689324
  const now2 = entry.ts ?? Date.now();
689198
689325
  memory.updatedAt = now2;
689199
689326
  const speaker = telegramHistorySpeaker(entry);
689200
- const actionId = createHash43("sha1").update(
689327
+ const actionId = createHash44("sha1").update(
689201
689328
  `${sessionKey}:${entry.role}:${entry.messageId ?? ""}:${now2}:${entry.text}`
689202
689329
  ).digest("hex").slice(0, 16);
689203
689330
  if (!memory.actions.some((action) => action.id === actionId)) {
@@ -689360,7 +689487,7 @@ ${mediaContext}` : ""
689360
689487
  let fact = facts.find((item) => item.text.toLowerCase() === key);
689361
689488
  if (!fact) {
689362
689489
  fact = {
689363
- id: createHash43("sha1").update(`${entry.chatId ?? ""}:${key}`).digest("hex").slice(0, 12),
689490
+ id: createHash44("sha1").update(`${entry.chatId ?? ""}:${key}`).digest("hex").slice(0, 12),
689364
689491
  text: clean5,
689365
689492
  tags: telegramMemoryTags(clean5, entry.mediaSummary),
689366
689493
  speakers: [],
@@ -689445,7 +689572,7 @@ ${mediaContext}` : ""
689445
689572
  const titleTags = tags.slice(0, 4);
689446
689573
  const title = titleTags.length > 0 ? `${speaker} / ${titleTags.join(" ")}` : `${speaker} / conversation`;
689447
689574
  const card = {
689448
- id: createHash43("sha1").update(`${sessionKey}:${now2}:${speaker}:${text2}`).digest("hex").slice(0, 12),
689575
+ id: createHash44("sha1").update(`${sessionKey}:${now2}:${speaker}:${text2}`).digest("hex").slice(0, 12),
689449
689576
  title,
689450
689577
  notes: [],
689451
689578
  tags: [],
@@ -692392,7 +692519,7 @@ ${list}` : "No shared group target is currently known for this sender. Ask in th
692392
692519
  }
692393
692520
  telegramRunnerStateDir(sessionKey) {
692394
692521
  if (!this.repoRoot) return void 0;
692395
- const safe = createHash43("sha1").update(sessionKey).digest("hex").slice(0, 20);
692522
+ const safe = createHash44("sha1").update(sessionKey).digest("hex").slice(0, 20);
692396
692523
  return join168(this.repoRoot, ".omnius", "telegram-runner-state", safe);
692397
692524
  }
692398
692525
  buildTelegramAdminOverviewContext(currentSessionKey) {
@@ -703077,14 +703204,14 @@ var init_access_policy = __esm({
703077
703204
  });
703078
703205
 
703079
703206
  // packages/cli/src/api/project-preferences.ts
703080
- import { createHash as createHash44 } from "node:crypto";
703207
+ import { createHash as createHash45 } from "node:crypto";
703081
703208
  import { existsSync as existsSync158, mkdirSync as mkdirSync98, readFileSync as readFileSync131, renameSync as renameSync15, writeFileSync as writeFileSync85, unlinkSync as unlinkSync36 } from "node:fs";
703082
703209
  import { homedir as homedir57 } from "node:os";
703083
703210
  import { join as join170, resolve as resolve70 } from "node:path";
703084
703211
  import { randomUUID as randomUUID20 } from "node:crypto";
703085
703212
  function projectKey(root) {
703086
703213
  const canonical = resolve70(root);
703087
- return createHash44("sha256").update(canonical).digest("hex").slice(0, 16);
703214
+ return createHash45("sha256").update(canonical).digest("hex").slice(0, 16);
703088
703215
  }
703089
703216
  function projectDir(root) {
703090
703217
  return join170(PROJECTS_DIR, projectKey(root));
@@ -703378,7 +703505,7 @@ var init_disk_task_output = __esm({
703378
703505
  });
703379
703506
 
703380
703507
  // packages/cli/src/api/http.ts
703381
- import { createHash as createHash45 } from "node:crypto";
703508
+ import { createHash as createHash46 } from "node:crypto";
703382
703509
  function problemDetails(opts) {
703383
703510
  const p2 = {
703384
703511
  type: opts.type ?? "about:blank",
@@ -703441,7 +703568,7 @@ function paginated(items, page2, total) {
703441
703568
  }
703442
703569
  function computeEtag(payload) {
703443
703570
  const json = typeof payload === "string" ? payload : JSON.stringify(payload);
703444
- const hash = createHash45("sha1").update(json).digest("hex").slice(0, 16);
703571
+ const hash = createHash46("sha1").update(json).digest("hex").slice(0, 16);
703445
703572
  return `W/"${hash}"`;
703446
703573
  }
703447
703574
  function checkNotModified(req3, res, etag) {
@@ -722108,7 +722235,7 @@ import {
722108
722235
  closeSync as closeSync6
722109
722236
  } from "node:fs";
722110
722237
  import { randomBytes as randomBytes29, randomUUID as randomUUID21, timingSafeEqual as timingSafeEqual2 } from "node:crypto";
722111
- import { createHash as createHash46 } from "node:crypto";
722238
+ import { createHash as createHash47 } from "node:crypto";
722112
722239
  function memoryDbPaths3(baseDir = process.cwd()) {
722113
722240
  const dir = join182(baseDir, ".omnius");
722114
722241
  return {
@@ -730376,7 +730503,7 @@ function listScheduledTasks() {
730376
730503
  );
730377
730504
  const enabled2 = typeof t2?.enabled === "boolean" ? t2.enabled : true;
730378
730505
  const realId = typeof t2?.id === "string" && t2.id ? t2.id : null;
730379
- const fallbackId = createHash46("sha1").update(`${file}#${i2}`).digest("hex").slice(0, 16);
730506
+ const fallbackId = createHash47("sha1").update(`${file}#${i2}`).digest("hex").slice(0, 16);
730380
730507
  const uid = realId || fallbackId;
730381
730508
  const key = `${uid}`;
730382
730509
  if (seen.has(key)) return;
@@ -730514,8 +730641,8 @@ function deleteScheduledById(id2) {
730514
730641
  if (typeof entry?.id === "string" && entry.id && !candidates.includes(entry.id))
730515
730642
  candidates.push(entry.id);
730516
730643
  try {
730517
- const { createHash: createHash47 } = require4("node:crypto");
730518
- const fallback = createHash47("sha1").update(`${target.file}#${target.index}`).digest("hex").slice(0, 16);
730644
+ const { createHash: createHash48 } = require4("node:crypto");
730645
+ const fallback = createHash48("sha1").update(`${target.file}#${target.index}`).digest("hex").slice(0, 16);
730519
730646
  if (!candidates.includes(fallback)) candidates.push(fallback);
730520
730647
  } catch {
730521
730648
  }
@@ -735713,6 +735840,35 @@ ${entry.fullContent}`
735713
735840
  statusBar.refreshDynamicBlocks();
735714
735841
  return true;
735715
735842
  };
735843
+ const EDIT_TOOL_NAMES = /* @__PURE__ */ new Set([
735844
+ "file_write",
735845
+ "file_edit",
735846
+ "file_patch",
735847
+ "batch_edit"
735848
+ ]);
735849
+ const extractEditToolPaths = (toolName, args) => {
735850
+ if (!EDIT_TOOL_NAMES.has(toolName)) return [];
735851
+ if (toolName === "batch_edit" && Array.isArray(args.edits)) {
735852
+ return [
735853
+ ...new Set(
735854
+ args.edits.map(
735855
+ (edit) => edit && typeof edit === "object" ? edit.path : void 0
735856
+ ).filter((path12) => typeof path12 === "string" && path12.length > 0)
735857
+ )
735858
+ ];
735859
+ }
735860
+ return typeof args.path === "string" && args.path.length > 0 ? [args.path] : [];
735861
+ };
735862
+ const recordEditToolPaths = (toolName, args) => {
735863
+ for (const filePath of extractEditToolPaths(toolName, args)) {
735864
+ filesTouched.add(filePath);
735865
+ sessionMetrics?.recordFileModified(filePath);
735866
+ if (isNeovimActive()) {
735867
+ notifyNeovimFileChange(filePath).catch(() => {
735868
+ });
735869
+ }
735870
+ }
735871
+ };
735716
735872
  runner.onEvent((event) => {
735717
735873
  emotionEngine?.appraise(event);
735718
735874
  switch (event.type) {
@@ -735739,19 +735895,6 @@ ${entry.fullContent}`
735739
735895
  });
735740
735896
  }
735741
735897
  }
735742
- if (event.toolArgs?.path && typeof event.toolArgs.path === "string") {
735743
- const name10 = event.toolName ?? "";
735744
- if (name10 === "file_write" || name10 === "file_edit" || name10 === "file_patch" || name10 === "batch_edit") {
735745
- filesTouched.add(event.toolArgs.path);
735746
- sessionMetrics?.recordFileModified(event.toolArgs.path);
735747
- if (isNeovimActive()) {
735748
- notifyNeovimFileChange(event.toolArgs.path).catch(
735749
- () => {
735750
- }
735751
- );
735752
- }
735753
- }
735754
- }
735755
735898
  getActivityFeed().push({
735756
735899
  ts: Date.now(),
735757
735900
  source: "main",
@@ -735841,10 +735984,15 @@ ${entry.fullContent}`
735841
735984
  );
735842
735985
  }
735843
735986
  if (lastToolCall) {
735987
+ const editNoop = (event.success ?? false) && /^\[NO-OP\b/i.test(rawContent2.trim());
735988
+ if ((event.success ?? false) && !editNoop) {
735989
+ recordEditToolPaths(lastToolCall.name, lastToolCall.args);
735990
+ }
735844
735991
  editHistory.logToolCall(
735845
735992
  lastToolCall.name,
735846
735993
  lastToolCall.args,
735847
- event.success ?? false
735994
+ event.success ?? false,
735995
+ rawContent2
735848
735996
  );
735849
735997
  lastToolCall = null;
735850
735998
  }
@@ -742447,13 +742595,13 @@ ${taskInput}`;
742447
742595
  writeContent(() => renderError(errMsg));
742448
742596
  if (failureStore) {
742449
742597
  try {
742450
- const { createHash: createHash47 } = await import("node:crypto");
742598
+ const { createHash: createHash48 } = await import("node:crypto");
742451
742599
  failureStore.insert({
742452
742600
  taskId: "",
742453
742601
  sessionId: `${Date.now()}`,
742454
742602
  repoRoot,
742455
742603
  failureType: "runtime-error",
742456
- fingerprint: createHash47("sha256").update(errMsg.slice(0, 200)).digest("hex").slice(0, 16),
742604
+ fingerprint: createHash48("sha256").update(errMsg.slice(0, 200)).digest("hex").slice(0, 16),
742457
742605
  filePath: null,
742458
742606
  errorMessage: errMsg.slice(0, 500),
742459
742607
  context: null,
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.443",
3
+ "version": "1.0.444",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "omnius",
9
- "version": "1.0.443",
9
+ "version": "1.0.444",
10
10
  "bundleDependencies": [
11
11
  "image-to-ascii"
12
12
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.443",
3
+ "version": "1.0.444",
4
4
  "description": "AI coding agent powered by open-source models (Ollama/vLLM) — interactive TUI with agentic tool-calling loop",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",