@askexenow/exe-os 0.8.61 → 0.8.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/bin/backfill-conversations.js +2 -3
  2. package/dist/bin/backfill-responses.js +3 -4
  3. package/dist/bin/backfill-vectors.js +0 -1
  4. package/dist/bin/cleanup-stale-review-tasks.js +0 -1
  5. package/dist/bin/cli.js +1654 -397
  6. package/dist/bin/exe-assign.js +0 -1
  7. package/dist/bin/exe-boot.js +61 -84
  8. package/dist/bin/exe-cloud.js +28 -60
  9. package/dist/bin/exe-dispatch.js +0 -1
  10. package/dist/bin/exe-doctor.js +0 -1
  11. package/dist/bin/exe-export-behaviors.js +1 -2
  12. package/dist/bin/exe-forget.js +0 -1
  13. package/dist/bin/exe-gateway.js +16 -17
  14. package/dist/bin/exe-heartbeat.js +1 -2
  15. package/dist/bin/exe-kill.js +2 -3
  16. package/dist/bin/exe-launch-agent.js +1 -2
  17. package/dist/bin/exe-link.js +49 -78
  18. package/dist/bin/exe-pending-messages.js +1 -2
  19. package/dist/bin/exe-pending-notifications.js +0 -1
  20. package/dist/bin/exe-pending-reviews.js +1 -2
  21. package/dist/bin/exe-review.js +0 -1
  22. package/dist/bin/exe-search.js +2 -3
  23. package/dist/bin/exe-session-cleanup.js +4 -5
  24. package/dist/bin/exe-status.js +0 -1
  25. package/dist/bin/exe-team.js +0 -1
  26. package/dist/bin/git-sweep.js +0 -1
  27. package/dist/bin/graph-backfill.js +5 -6
  28. package/dist/bin/graph-export.js +0 -1
  29. package/dist/bin/scan-tasks.js +0 -1
  30. package/dist/bin/setup.js +1460 -115
  31. package/dist/bin/shard-migrate.js +0 -1
  32. package/dist/bin/wiki-sync.js +0 -1
  33. package/dist/gateway/index.js +16 -17
  34. package/dist/hooks/bug-report-worker.js +11 -12
  35. package/dist/hooks/commit-complete.js +0 -1
  36. package/dist/hooks/error-recall.js +2 -3
  37. package/dist/hooks/ingest-worker.js +14 -15
  38. package/dist/hooks/instructions-loaded.js +0 -1
  39. package/dist/hooks/notification.js +0 -1
  40. package/dist/hooks/post-compact.js +0 -1
  41. package/dist/hooks/pre-compact.js +2 -3
  42. package/dist/hooks/pre-tool-use.js +0 -1
  43. package/dist/hooks/prompt-ingest-worker.js +2 -3
  44. package/dist/hooks/prompt-submit.js +6 -7
  45. package/dist/hooks/response-ingest-worker.js +2 -3
  46. package/dist/hooks/session-end.js +3 -4
  47. package/dist/hooks/session-start.js +2 -3
  48. package/dist/hooks/stop.js +2 -3
  49. package/dist/hooks/subagent-stop.js +0 -1
  50. package/dist/hooks/summary-worker.js +51 -74
  51. package/dist/index.js +7 -8
  52. package/dist/lib/cloud-sync.js +21 -12
  53. package/dist/lib/consolidation.js +0 -1
  54. package/dist/lib/exe-daemon.js +33 -65
  55. package/dist/lib/hybrid-search.js +2 -3
  56. package/dist/lib/keychain.js +19 -58
  57. package/dist/lib/schedules.js +2 -3
  58. package/dist/lib/store.js +0 -1
  59. package/dist/mcp/server.js +29 -30
  60. package/dist/runtime/index.js +2 -3
  61. package/dist/tui/App.js +24 -56
  62. package/package.json +1 -1
@@ -1546,7 +1546,6 @@ import { readFile, writeFile, unlink, mkdir, chmod } from "fs/promises";
1546
1546
  import { existsSync } from "fs";
1547
1547
  import path from "path";
1548
1548
  import os from "os";
1549
- import crypto from "crypto";
1550
1549
  var SERVICE = "exe-mem";
1551
1550
  var ACCOUNT = "master-key";
1552
1551
  function getKeyDir() {
@@ -1864,7 +1863,7 @@ function vectorToBlob(vector) {
1864
1863
 
1865
1864
  // src/lib/session-kill-telemetry.ts
1866
1865
  init_database();
1867
- import crypto2 from "crypto";
1866
+ import crypto from "crypto";
1868
1867
  async function recordSessionKill(input) {
1869
1868
  try {
1870
1869
  const client = getClient();
@@ -1874,7 +1873,7 @@ async function recordSessionKill(input) {
1874
1873
  ticks_idle, estimated_tokens_saved)
1875
1874
  VALUES (?, ?, ?, ?, ?, ?, ?)`,
1876
1875
  args: [
1877
- crypto2.randomUUID(),
1876
+ crypto.randomUUID(),
1878
1877
  input.sessionName,
1879
1878
  input.agentId,
1880
1879
  (/* @__PURE__ */ new Date()).toISOString(),
@@ -2488,7 +2488,6 @@ import { readFile, writeFile, unlink, mkdir, chmod } from "fs/promises";
2488
2488
  import { existsSync } from "fs";
2489
2489
  import path from "path";
2490
2490
  import os from "os";
2491
- import crypto from "crypto";
2492
2491
  var SERVICE = "exe-mem";
2493
2492
  var ACCOUNT = "master-key";
2494
2493
  function getKeyDir() {
@@ -2818,7 +2817,7 @@ import {
2818
2817
 
2819
2818
  // src/lib/behaviors.ts
2820
2819
  init_database();
2821
- import crypto2 from "crypto";
2820
+ import crypto from "crypto";
2822
2821
  async function listBehaviors(agentId, projectName, limit = 30) {
2823
2822
  const client = getClient();
2824
2823
  const result = await client.execute({
@@ -1,12 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
5
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
6
- }) : x)(function(x) {
7
- if (typeof require !== "undefined") return require.apply(this, arguments);
8
- throw Error('Dynamic require of "' + x + '" is not supported');
9
- });
10
4
  var __esm = (fn, res) => function __init() {
11
5
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
12
6
  };
@@ -271,13 +265,13 @@ __export(crypto_exports, {
271
265
  initSyncCrypto: () => initSyncCrypto,
272
266
  isSyncCryptoInitialized: () => isSyncCryptoInitialized
273
267
  });
274
- import crypto2 from "crypto";
268
+ import crypto from "crypto";
275
269
  function initSyncCrypto(masterKey) {
276
270
  if (masterKey.length !== 32) {
277
271
  throw new Error(`Master key must be 32 bytes, got ${masterKey.length}`);
278
272
  }
279
273
  _syncKey = Buffer.from(
280
- crypto2.hkdfSync("sha256", masterKey, "", SYNC_HKDF_INFO, 32)
274
+ crypto.hkdfSync("sha256", masterKey, "", SYNC_HKDF_INFO, 32)
281
275
  );
282
276
  }
283
277
  function isSyncCryptoInitialized() {
@@ -291,8 +285,8 @@ function requireSyncKey() {
291
285
  }
292
286
  function encryptSyncBlob(data) {
293
287
  const key = requireSyncKey();
294
- const iv = crypto2.randomBytes(IV_LENGTH);
295
- const cipher = crypto2.createCipheriv(ALGORITHM, key, iv);
288
+ const iv = crypto.randomBytes(IV_LENGTH);
289
+ const cipher = crypto.createCipheriv(ALGORITHM, key, iv);
296
290
  const encrypted = Buffer.concat([cipher.update(data), cipher.final()]);
297
291
  const tag = cipher.getAuthTag();
298
292
  return Buffer.concat([iv, encrypted, tag]).toString("base64");
@@ -306,7 +300,7 @@ function decryptSyncBlob(ciphertext) {
306
300
  const iv = combined.subarray(0, IV_LENGTH);
307
301
  const tag = combined.subarray(combined.length - TAG_LENGTH);
308
302
  const encrypted = combined.subarray(IV_LENGTH, combined.length - TAG_LENGTH);
309
- const decipher = crypto2.createDecipheriv(ALGORITHM, key, iv);
303
+ const decipher = crypto.createDecipheriv(ALGORITHM, key, iv);
310
304
  decipher.setAuthTag(tag);
311
305
  return Buffer.concat([decipher.update(encrypted), decipher.final()]);
312
306
  }
@@ -501,7 +495,7 @@ __export(cloud_sync_exports, {
501
495
  recordRosterDeletion: () => recordRosterDeletion
502
496
  });
503
497
  import { readFileSync as readFileSync4, writeFileSync as writeFileSync2, existsSync as existsSync5, readdirSync, mkdirSync as mkdirSync2, appendFileSync, unlinkSync, openSync, closeSync } from "fs";
504
- import crypto3 from "crypto";
498
+ import crypto2 from "crypto";
505
499
  import path5 from "path";
506
500
  import { homedir } from "os";
507
501
  function sqlSafe(v) {
@@ -884,7 +878,7 @@ function buildRosterBlob(paths) {
884
878
  }
885
879
  const deletedNames = consumeRosterDeletions();
886
880
  const content = JSON.stringify({ roster, identities, config, deletedNames });
887
- const hash = crypto3.createHash("sha256").update(content).digest("hex").slice(0, 16);
881
+ const hash = crypto2.createHash("sha256").update(content).digest("hex").slice(0, 16);
888
882
  return { roster, identities, config, deletedNames, version: hash };
889
883
  }
890
884
  async function cloudPushRoster(config) {
@@ -974,21 +968,30 @@ async function mergeRosterFromRemote(remote, paths) {
974
968
  const localEmployees = await loadEmployees(rosterPath);
975
969
  const localNames = new Set(localEmployees.map((e) => e.name));
976
970
  let added = 0;
971
+ let identitiesUpdated = 0;
977
972
  for (const remoteEmp of remote.roster) {
978
- if (localNames.has(remoteEmp.name)) continue;
979
- localEmployees.push(remoteEmp);
980
- localNames.add(remoteEmp.name);
981
- added++;
982
- if (remote.identities[`${remoteEmp.name}.md`]) {
973
+ if (!localNames.has(remoteEmp.name)) {
974
+ localEmployees.push(remoteEmp);
975
+ localNames.add(remoteEmp.name);
976
+ added++;
977
+ try {
978
+ registerBinSymlinks(remoteEmp.name);
979
+ } catch {
980
+ }
981
+ }
982
+ const remoteIdentity = remote.identities[`${remoteEmp.name}.md`];
983
+ if (remoteIdentity) {
983
984
  if (!existsSync5(identityDir)) mkdirSync2(identityDir, { recursive: true });
984
985
  const idPath = path5.join(identityDir, `${remoteEmp.name}.md`);
985
- if (!existsSync5(idPath)) {
986
- writeFileSync2(idPath, remote.identities[`${remoteEmp.name}.md`], "utf-8");
986
+ let localIdentity = null;
987
+ try {
988
+ localIdentity = existsSync5(idPath) ? readFileSync4(idPath, "utf-8") : null;
989
+ } catch {
990
+ }
991
+ if (localIdentity !== remoteIdentity) {
992
+ writeFileSync2(idPath, remoteIdentity, "utf-8");
993
+ identitiesUpdated++;
987
994
  }
988
- }
989
- try {
990
- registerBinSymlinks(remoteEmp.name);
991
- } catch {
992
995
  }
993
996
  }
994
997
  let removed = 0;
@@ -1010,7 +1013,7 @@ async function mergeRosterFromRemote(remote, paths) {
1010
1013
  } catch {
1011
1014
  }
1012
1015
  }
1013
- return { added };
1016
+ return { added, identitiesUpdated };
1014
1017
  });
1015
1018
  }
1016
1019
  async function cloudPushBlob(route, data, metaKey, config) {
@@ -1457,7 +1460,6 @@ import { readFile, writeFile, unlink, mkdir, chmod } from "fs/promises";
1457
1460
  import { existsSync } from "fs";
1458
1461
  import path from "path";
1459
1462
  import os from "os";
1460
- import crypto from "crypto";
1461
1463
  var SERVICE = "exe-mem";
1462
1464
  var ACCOUNT = "master-key";
1463
1465
  function getKeyDir() {
@@ -1511,65 +1513,34 @@ async function setMasterKey(key) {
1511
1513
  await writeFile(keyPath, b64 + "\n", "utf-8");
1512
1514
  await chmod(keyPath, 384);
1513
1515
  }
1514
- function exportMnemonic(key) {
1515
- if (key.length !== 32) {
1516
- throw new Error(`Key must be 32 bytes, got ${key.length}`);
1517
- }
1518
- const hash = crypto.createHash("sha256").update(key).digest();
1519
- const checksumByte = hash[0];
1520
- let bits = "";
1521
- for (const byte of key) {
1522
- bits += byte.toString(2).padStart(8, "0");
1523
- }
1524
- bits += checksumByte.toString(2).padStart(8, "0");
1525
- const words = [];
1526
- let wordlist;
1516
+ async function loadBip39() {
1527
1517
  try {
1528
- const bip39 = __require("bip39");
1529
- wordlist = bip39.wordlists?.english ?? bip39.default?.wordlists?.english;
1530
- if (!wordlist) throw new Error("no wordlist");
1518
+ return await import("bip39");
1531
1519
  } catch {
1532
- throw new Error("bip39 package required. Install with: npm install bip39");
1520
+ throw new Error(
1521
+ "bip39 package not found. Run: npm install -g bip39\nOr reinstall exe-os: npm install -g @askexenow/exe-os"
1522
+ );
1533
1523
  }
1534
- for (let i = 0; i < 264; i += 11) {
1535
- const index = parseInt(bits.slice(i, i + 11), 2);
1536
- words.push(wordlist[index]);
1524
+ }
1525
+ async function exportMnemonic(key) {
1526
+ if (key.length !== 32) {
1527
+ throw new Error(`Key must be 32 bytes, got ${key.length}`);
1537
1528
  }
1538
- return words.join(" ");
1529
+ const { entropyToMnemonic } = await loadBip39();
1530
+ return entropyToMnemonic(key.toString("hex"));
1539
1531
  }
1540
- function importMnemonic(mnemonic) {
1541
- const words = mnemonic.trim().split(/\s+/);
1532
+ async function importMnemonic(mnemonic) {
1533
+ const trimmed = mnemonic.trim();
1534
+ const words = trimmed.split(/\s+/);
1542
1535
  if (words.length !== 24) {
1543
1536
  throw new Error(`Expected 24 words, got ${words.length}`);
1544
1537
  }
1545
- let wordlist;
1546
- try {
1547
- const bip39 = __require("bip39");
1548
- wordlist = bip39.wordlists?.english ?? bip39.default?.wordlists?.english;
1549
- if (!wordlist) throw new Error("no wordlist");
1550
- } catch {
1551
- throw new Error("bip39 package required. Install with: npm install bip39");
1552
- }
1553
- let bits = "";
1554
- for (const word of words) {
1555
- const index = wordlist.indexOf(word.toLowerCase());
1556
- if (index === -1) {
1557
- throw new Error(`Invalid BIP39 word: "${word}"`);
1558
- }
1559
- bits += index.toString(2).padStart(11, "0");
1560
- }
1561
- const entropyBits = bits.slice(0, 256);
1562
- const checksumBits = bits.slice(256, 264);
1563
- const key = Buffer.alloc(32);
1564
- for (let i = 0; i < 32; i++) {
1565
- key[i] = parseInt(entropyBits.slice(i * 8, (i + 1) * 8), 2);
1566
- }
1567
- const hash = crypto.createHash("sha256").update(key).digest();
1568
- const expectedChecksum = hash[0].toString(2).padStart(8, "0");
1569
- if (checksumBits !== expectedChecksum) {
1570
- throw new Error("Invalid mnemonic checksum");
1538
+ const { validateMnemonic, mnemonicToEntropy } = await loadBip39();
1539
+ if (!validateMnemonic(trimmed)) {
1540
+ throw new Error("Invalid mnemonic \u2014 check for typos or missing words");
1571
1541
  }
1572
- return key;
1542
+ const entropy = mnemonicToEntropy(trimmed);
1543
+ return Buffer.from(entropy, "hex");
1573
1544
  }
1574
1545
 
1575
1546
  // src/lib/is-main.ts
@@ -1595,7 +1566,7 @@ async function main() {
1595
1566
  console.error("No master key found. Run /exe-setup first.");
1596
1567
  process.exit(1);
1597
1568
  }
1598
- const mnemonic = exportMnemonic(key);
1569
+ const mnemonic = await exportMnemonic(key);
1599
1570
  console.log("Your 24-word recovery phrase:\n");
1600
1571
  const showFull = process.argv.includes("--show-full");
1601
1572
  if (showFull) {
@@ -1620,7 +1591,7 @@ async function main() {
1620
1591
  });
1621
1592
  });
1622
1593
  try {
1623
- const key = importMnemonic(mnemonic);
1594
+ const key = await importMnemonic(mnemonic);
1624
1595
  await setMasterKey(key);
1625
1596
  console.log("Master key imported and stored securely.");
1626
1597
  try {
@@ -1727,7 +1727,6 @@ import { readFile, writeFile, unlink, mkdir, chmod } from "fs/promises";
1727
1727
  import { existsSync } from "fs";
1728
1728
  import path from "path";
1729
1729
  import os from "os";
1730
- import crypto from "crypto";
1731
1730
  var SERVICE = "exe-mem";
1732
1731
  var ACCOUNT = "master-key";
1733
1732
  function getKeyDir() {
@@ -1849,7 +1848,7 @@ async function initStore(options) {
1849
1848
  // src/lib/messaging.ts
1850
1849
  init_database();
1851
1850
  init_tmux_routing();
1852
- import crypto2 from "crypto";
1851
+ import crypto from "crypto";
1853
1852
  function rowToMessage(row) {
1854
1853
  return {
1855
1854
  id: row.id,
@@ -1535,7 +1535,6 @@ import { readFile, writeFile, unlink, mkdir, chmod } from "fs/promises";
1535
1535
  import { existsSync } from "fs";
1536
1536
  import path from "path";
1537
1537
  import os from "os";
1538
- import crypto from "crypto";
1539
1538
  var SERVICE = "exe-mem";
1540
1539
  var ACCOUNT = "master-key";
1541
1540
  function getKeyDir() {
@@ -1597,7 +1597,7 @@ var init_employees = __esm({
1597
1597
  });
1598
1598
 
1599
1599
  // src/lib/notifications.ts
1600
- import crypto2 from "crypto";
1600
+ import crypto from "crypto";
1601
1601
  import path5 from "path";
1602
1602
  import os3 from "os";
1603
1603
  import {
@@ -1817,7 +1817,6 @@ import { readFile, writeFile, unlink, mkdir, chmod } from "fs/promises";
1817
1817
  import { existsSync } from "fs";
1818
1818
  import path from "path";
1819
1819
  import os from "os";
1820
- import crypto from "crypto";
1821
1820
  var SERVICE = "exe-mem";
1822
1821
  var ACCOUNT = "master-key";
1823
1822
  function getKeyDir() {
@@ -1563,7 +1563,6 @@ import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3
1563
1563
  import { existsSync as existsSync3 } from "fs";
1564
1564
  import path3 from "path";
1565
1565
  import os2 from "os";
1566
- import crypto from "crypto";
1567
1566
  var SERVICE = "exe-mem";
1568
1567
  var ACCOUNT = "master-key";
1569
1568
  function getKeyDir() {
@@ -938,7 +938,6 @@ import { readFile, writeFile, unlink, mkdir, chmod } from "fs/promises";
938
938
  import { existsSync } from "fs";
939
939
  import path from "path";
940
940
  import os from "os";
941
- import crypto from "crypto";
942
941
  function getKeyDir() {
943
942
  return process.env.EXE_OS_DIR ?? process.env.EXE_MEM_DIR ?? path.join(os.homedir(), ".exe-os");
944
943
  }
@@ -2753,7 +2752,7 @@ __export(file_grep_exports, {
2753
2752
  import { execSync as execSync2 } from "child_process";
2754
2753
  import { readFileSync as readFileSync3, readdirSync as readdirSync2, statSync as statSync2, existsSync as existsSync5 } from "fs";
2755
2754
  import path6 from "path";
2756
- import crypto2 from "crypto";
2755
+ import crypto from "crypto";
2757
2756
  function hasRipgrep() {
2758
2757
  if (_hasRg === null) {
2759
2758
  try {
@@ -2786,7 +2785,7 @@ async function grepProjectFiles(query, projectRoot, options) {
2786
2785
  const chunkCtx = getChunkContext(hit.filePath, hit.lineNumber);
2787
2786
  const prefix = chunkCtx ? `[file: ${hit.filePath}:${hit.lineNumber} in ${chunkCtx}]` : `[file: ${hit.filePath}:${hit.lineNumber}]`;
2788
2787
  return {
2789
- id: crypto2.createHash("sha256").update(`${hit.filePath}:${hit.lineNumber}`).digest("hex").slice(0, 36),
2788
+ id: crypto.createHash("sha256").update(`${hit.filePath}:${hit.lineNumber}`).digest("hex").slice(0, 36),
2790
2789
  agent_id: "project",
2791
2790
  agent_role: "file",
2792
2791
  session_id: "file-grep",
@@ -2583,7 +2583,7 @@ var init_embedder = __esm({
2583
2583
  });
2584
2584
 
2585
2585
  // src/lib/notifications.ts
2586
- import crypto2 from "crypto";
2586
+ import crypto from "crypto";
2587
2587
  import path12 from "path";
2588
2588
  import os6 from "os";
2589
2589
  import {
@@ -2596,7 +2596,7 @@ import {
2596
2596
  async function writeNotification(notification) {
2597
2597
  try {
2598
2598
  const client = getClient();
2599
- const id = crypto2.randomUUID();
2599
+ const id = crypto.randomUUID();
2600
2600
  const now = (/* @__PURE__ */ new Date()).toISOString();
2601
2601
  await client.execute({
2602
2602
  sql: `INSERT INTO notifications (id, agent_id, agent_role, event, project, summary, task_file, read, created_at)
@@ -3140,7 +3140,7 @@ var init_worktree = __esm({
3140
3140
  });
3141
3141
 
3142
3142
  // src/bin/exe-session-cleanup.ts
3143
- import crypto3 from "crypto";
3143
+ import crypto2 from "crypto";
3144
3144
  import { execSync as execSync6 } from "child_process";
3145
3145
 
3146
3146
  // src/lib/store.ts
@@ -3152,7 +3152,6 @@ import { readFile, writeFile, unlink, mkdir, chmod } from "fs/promises";
3152
3152
  import { existsSync } from "fs";
3153
3153
  import path from "path";
3154
3154
  import os from "os";
3155
- import crypto from "crypto";
3156
3155
  var SERVICE = "exe-mem";
3157
3156
  var ACCOUNT = "master-key";
3158
3157
  function getKeyDir() {
@@ -3526,7 +3525,7 @@ try {
3526
3525
  } catch {
3527
3526
  }
3528
3527
  await writeMemory({
3529
- id: crypto3.randomUUID(),
3528
+ id: crypto2.randomUUID(),
3530
3529
  agent_id: agentName,
3531
3530
  agent_role: "employee",
3532
3531
  session_id: `cleanup-${Date.now()}`,
@@ -1933,7 +1933,6 @@ import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3
1933
1933
  import { existsSync as existsSync3 } from "fs";
1934
1934
  import path3 from "path";
1935
1935
  import os2 from "os";
1936
- import crypto from "crypto";
1937
1936
  var SERVICE = "exe-mem";
1938
1937
  var ACCOUNT = "master-key";
1939
1938
  function getKeyDir() {
@@ -1554,7 +1554,6 @@ import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3
1554
1554
  import { existsSync as existsSync3 } from "fs";
1555
1555
  import path3 from "path";
1556
1556
  import os2 from "os";
1557
- import crypto from "crypto";
1558
1557
  var SERVICE = "exe-mem";
1559
1558
  var ACCOUNT = "master-key";
1560
1559
  function getKeyDir() {
@@ -4067,7 +4067,6 @@ import { readFile as readFile4, writeFile as writeFile5, unlink, mkdir as mkdir4
4067
4067
  import { existsSync as existsSync11 } from "fs";
4068
4068
  import path14 from "path";
4069
4069
  import os6 from "os";
4070
- import crypto6 from "crypto";
4071
4070
  function getKeyDir() {
4072
4071
  return process.env.EXE_OS_DIR ?? process.env.EXE_MEM_DIR ?? path14.join(os6.homedir(), ".exe-os");
4073
4072
  }
@@ -1543,7 +1543,6 @@ import { readFile, writeFile, unlink, mkdir, chmod } from "fs/promises";
1543
1543
  import { existsSync } from "fs";
1544
1544
  import path from "path";
1545
1545
  import os from "os";
1546
- import crypto from "crypto";
1547
1546
  var SERVICE = "exe-mem";
1548
1547
  var ACCOUNT = "master-key";
1549
1548
  function getKeyDir() {
@@ -1863,7 +1862,7 @@ function vectorToBlob(vector) {
1863
1862
  init_database();
1864
1863
 
1865
1864
  // src/lib/graph-rag.ts
1866
- import crypto2 from "crypto";
1865
+ import crypto from "crypto";
1867
1866
 
1868
1867
  // src/lib/code-chunker.ts
1869
1868
  import ts from "typescript";
@@ -2046,7 +2045,7 @@ function normalizeEntityName(name) {
2046
2045
  }
2047
2046
  function entityId(name, type) {
2048
2047
  const normalized = normalizeEntityName(name);
2049
- return crypto2.createHash("sha256").update(`${normalized}::${type.toLowerCase()}`).digest("hex").slice(0, 16);
2048
+ return crypto.createHash("sha256").update(`${normalized}::${type.toLowerCase()}`).digest("hex").slice(0, 16);
2050
2049
  }
2051
2050
  async function resolveAlias(client, name) {
2052
2051
  const normalized = normalizeEntityName(name);
@@ -2301,7 +2300,7 @@ async function storeExtraction(client, extraction, memoryId, timestamp) {
2301
2300
  const targetAlias = await resolveAlias(client, r.target);
2302
2301
  const sourceId = sourceAlias ?? entityId(r.source, r.sourceType);
2303
2302
  const targetId = targetAlias ?? entityId(r.target, r.targetType);
2304
- const relId = crypto2.randomUUID().slice(0, 16);
2303
+ const relId = crypto.randomUUID().slice(0, 16);
2305
2304
  try {
2306
2305
  await client.execute({
2307
2306
  sql: `INSERT OR IGNORE INTO entities (id, name, type, first_seen, last_seen)
@@ -2347,7 +2346,7 @@ async function storeExtraction(client, extraction, memoryId, timestamp) {
2347
2346
  }
2348
2347
  }
2349
2348
  for (const h of extraction.hyperedges) {
2350
- const hId = crypto2.randomUUID().slice(0, 16);
2349
+ const hId = crypto.randomUUID().slice(0, 16);
2351
2350
  try {
2352
2351
  await client.execute({
2353
2352
  sql: `INSERT OR IGNORE INTO hyperedges (id, label, relation, confidence, timestamp)
@@ -2411,7 +2410,7 @@ async function extractBatch(client, batchSize = 50, model = "claude-haiku-4-5-20
2411
2410
  totalEntities += stored.entitiesStored;
2412
2411
  totalRelationships += stored.relationshipsStored;
2413
2412
  }
2414
- const contentHash = crypto2.createHash("sha256").update(rawContent).digest("hex").slice(0, 32);
2413
+ const contentHash = crypto.createHash("sha256").update(rawContent).digest("hex").slice(0, 32);
2415
2414
  await client.execute({
2416
2415
  sql: "UPDATE memories SET graph_extracted = 1, content_hash = ?, graph_extracted_hash = ? WHERE id = ?",
2417
2416
  args: [contentHash, contentHash, memoryId]
@@ -1547,7 +1547,6 @@ import { readFile, writeFile, unlink, mkdir, chmod } from "fs/promises";
1547
1547
  import { existsSync } from "fs";
1548
1548
  import path from "path";
1549
1549
  import os from "os";
1550
- import crypto from "crypto";
1551
1550
  var SERVICE = "exe-mem";
1552
1551
  var ACCOUNT = "master-key";
1553
1552
  function getKeyDir() {
@@ -4061,7 +4061,6 @@ import { readFile as readFile4, writeFile as writeFile5, unlink, mkdir as mkdir4
4061
4061
  import { existsSync as existsSync11 } from "fs";
4062
4062
  import path14 from "path";
4063
4063
  import os6 from "os";
4064
- import crypto6 from "crypto";
4065
4064
  function getKeyDir() {
4066
4065
  return process.env.EXE_OS_DIR ?? process.env.EXE_MEM_DIR ?? path14.join(os6.homedir(), ".exe-os");
4067
4066
  }