@askexenow/exe-os 0.9.13 → 0.9.14

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 (70) hide show
  1. package/dist/bin/backfill-conversations.js +31 -4
  2. package/dist/bin/backfill-responses.js +31 -4
  3. package/dist/bin/backfill-vectors.js +25 -4
  4. package/dist/bin/cleanup-stale-review-tasks.js +1 -1
  5. package/dist/bin/cli.js +55 -8
  6. package/dist/bin/exe-assign.js +31 -4
  7. package/dist/bin/exe-boot.js +25 -4
  8. package/dist/bin/exe-dispatch.js +1 -1
  9. package/dist/bin/exe-doctor.js +1 -1
  10. package/dist/bin/exe-export-behaviors.js +1 -1
  11. package/dist/bin/exe-forget.js +1 -1
  12. package/dist/bin/exe-gateway.js +447 -21
  13. package/dist/bin/exe-heartbeat.js +1 -1
  14. package/dist/bin/exe-kill.js +1 -1
  15. package/dist/bin/exe-launch-agent.js +1 -1
  16. package/dist/bin/exe-link.js +31 -4
  17. package/dist/bin/exe-pending-messages.js +1 -1
  18. package/dist/bin/exe-pending-notifications.js +1 -1
  19. package/dist/bin/exe-pending-reviews.js +1 -1
  20. package/dist/bin/exe-rename.js +31 -4
  21. package/dist/bin/exe-review.js +1 -1
  22. package/dist/bin/exe-search.js +31 -4
  23. package/dist/bin/exe-session-cleanup.js +25 -4
  24. package/dist/bin/exe-start-codex.js +1 -1
  25. package/dist/bin/exe-start-opencode.js +1 -1
  26. package/dist/bin/exe-status.js +1 -1
  27. package/dist/bin/exe-team.js +1 -1
  28. package/dist/bin/git-sweep.js +25 -4
  29. package/dist/bin/graph-backfill.js +1 -1
  30. package/dist/bin/graph-export.js +1 -1
  31. package/dist/bin/scan-tasks.js +25 -4
  32. package/dist/bin/setup.js +46 -8
  33. package/dist/bin/shard-migrate.js +1 -1
  34. package/dist/bin/wiki-sync.js +1 -1
  35. package/dist/gateway/index.js +128 -125
  36. package/dist/hooks/bug-report-worker.js +1 -1
  37. package/dist/hooks/codex-stop-task-finalizer.js +1 -1
  38. package/dist/hooks/commit-complete.js +25 -4
  39. package/dist/hooks/error-recall.js +31 -4
  40. package/dist/hooks/ingest-worker.js +25 -4
  41. package/dist/hooks/ingest.js +1 -1
  42. package/dist/hooks/instructions-loaded.js +31 -4
  43. package/dist/hooks/notification.js +31 -4
  44. package/dist/hooks/post-compact.js +31 -4
  45. package/dist/hooks/pre-compact.js +25 -4
  46. package/dist/hooks/pre-tool-use.js +31 -4
  47. package/dist/hooks/prompt-ingest-worker.js +25 -4
  48. package/dist/hooks/prompt-submit.js +25 -4
  49. package/dist/hooks/response-ingest-worker.js +25 -4
  50. package/dist/hooks/session-end.js +25 -4
  51. package/dist/hooks/session-start.js +31 -4
  52. package/dist/hooks/stop.js +25 -4
  53. package/dist/hooks/subagent-stop.js +31 -4
  54. package/dist/hooks/summary-worker.js +25 -4
  55. package/dist/index.js +128 -125
  56. package/dist/lib/cloud-sync.js +31 -4
  57. package/dist/lib/database.js +31 -4
  58. package/dist/lib/db-daemon-client.js +31 -3
  59. package/dist/lib/db.js +31 -4
  60. package/dist/lib/device-registry.js +31 -4
  61. package/dist/lib/embedder.js +30 -3
  62. package/dist/lib/exe-daemon-client.js +31 -3
  63. package/dist/lib/exe-daemon.js +1958 -153
  64. package/dist/lib/hybrid-search.js +31 -4
  65. package/dist/lib/schedules.js +1 -1
  66. package/dist/lib/store.js +1 -1
  67. package/dist/mcp/server.js +25 -4
  68. package/dist/runtime/index.js +25 -4
  69. package/dist/tui/App.js +34 -4
  70. package/package.json +1 -1
@@ -1,5 +1,11 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __getOwnPropNames = Object.getOwnPropertyNames;
3
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
4
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
5
+ }) : x)(function(x) {
6
+ if (typeof require !== "undefined") return require.apply(this, arguments);
7
+ throw Error('Dynamic require of "' + x + '" is not supported');
8
+ });
3
9
  var __esm = (fn, res) => function __init() {
4
10
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
5
11
  };
@@ -720,7 +726,7 @@ async function ensureCompatibilityViews(prisma) {
720
726
  for (const mapping of VIEW_MAPPINGS) {
721
727
  const relation = mapping.source.replace(/"/g, "");
722
728
  const rows = await prisma.$queryRawUnsafe(
723
- "SELECT to_regclass($1) AS regclass",
729
+ "SELECT to_regclass($1)::text AS regclass",
724
730
  relation
725
731
  );
726
732
  if (!rows[0]?.regclass) {
@@ -3559,8 +3565,29 @@ function findPackageRoot() {
3559
3565
  }
3560
3566
  return null;
3561
3567
  }
3568
+ function getAvailableMemoryGB() {
3569
+ if (process.platform === "darwin") {
3570
+ try {
3571
+ const { execSync: execSync4 } = __require("child_process");
3572
+ const vmstat = execSync4("vm_stat", { encoding: "utf8" });
3573
+ const pageSize = 16384;
3574
+ const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
3575
+ const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
3576
+ const free = vmstat.match(/Pages free:\s+(\d+)/);
3577
+ const inactive = vmstat.match(/Pages inactive:\s+(\d+)/);
3578
+ const speculative = vmstat.match(/Pages speculative:\s+(\d+)/);
3579
+ const freePages = free ? parseInt(free[1], 10) : 0;
3580
+ const inactivePages = inactive ? parseInt(inactive[1], 10) : 0;
3581
+ const speculativePages = speculative ? parseInt(speculative[1], 10) : 0;
3582
+ return (freePages + inactivePages + speculativePages) * actualPageSize / (1024 * 1024 * 1024);
3583
+ } catch {
3584
+ return os5.freemem() / (1024 * 1024 * 1024);
3585
+ }
3586
+ }
3587
+ return os5.freemem() / (1024 * 1024 * 1024);
3588
+ }
3562
3589
  function spawnDaemon() {
3563
- const freeGB = os5.freemem() / (1024 * 1024 * 1024);
3590
+ const freeGB = getAvailableMemoryGB();
3564
3591
  const totalGB = os5.totalmem() / (1024 * 1024 * 1024);
3565
3592
  if (totalGB <= 8) {
3566
3593
  process.stderr.write(
@@ -3569,9 +3596,9 @@ function spawnDaemon() {
3569
3596
  );
3570
3597
  return;
3571
3598
  }
3572
- if (totalGB <= 16 && freeGB < 4) {
3599
+ if (totalGB <= 16 && freeGB < 2) {
3573
3600
  process.stderr.write(
3574
- `[exed-client] SKIP: low memory (${freeGB.toFixed(1)}GB free / ${totalGB.toFixed(0)}GB total). Embedding daemon not started \u2014 using keyword search only.
3601
+ `[exed-client] SKIP: low memory (${freeGB.toFixed(1)}GB available / ${totalGB.toFixed(0)}GB total). Embedding daemon not started \u2014 using keyword search only.
3575
3602
  `
3576
3603
  );
3577
3604
  return;
@@ -643,7 +643,7 @@ async function ensureCompatibilityViews(prisma) {
643
643
  for (const mapping of VIEW_MAPPINGS) {
644
644
  const relation = mapping.source.replace(/"/g, "");
645
645
  const rows = await prisma.$queryRawUnsafe(
646
- "SELECT to_regclass($1) AS regclass",
646
+ "SELECT to_regclass($1)::text AS regclass",
647
647
  relation
648
648
  );
649
649
  if (!rows[0]?.regclass) {
package/dist/lib/store.js CHANGED
@@ -643,7 +643,7 @@ async function ensureCompatibilityViews(prisma) {
643
643
  for (const mapping of VIEW_MAPPINGS) {
644
644
  const relation = mapping.source.replace(/"/g, "");
645
645
  const rows = await prisma.$queryRawUnsafe(
646
- "SELECT to_regclass($1) AS regclass",
646
+ "SELECT to_regclass($1)::text AS regclass",
647
647
  relation
648
648
  );
649
649
  if (!rows[0]?.regclass) {
@@ -425,8 +425,29 @@ function findPackageRoot() {
425
425
  }
426
426
  return null;
427
427
  }
428
+ function getAvailableMemoryGB() {
429
+ if (process.platform === "darwin") {
430
+ try {
431
+ const { execSync: execSync11 } = __require("child_process");
432
+ const vmstat = execSync11("vm_stat", { encoding: "utf8" });
433
+ const pageSize = 16384;
434
+ const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
435
+ const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
436
+ const free = vmstat.match(/Pages free:\s+(\d+)/);
437
+ const inactive = vmstat.match(/Pages inactive:\s+(\d+)/);
438
+ const speculative = vmstat.match(/Pages speculative:\s+(\d+)/);
439
+ const freePages = free ? parseInt(free[1], 10) : 0;
440
+ const inactivePages = inactive ? parseInt(inactive[1], 10) : 0;
441
+ const speculativePages = speculative ? parseInt(speculative[1], 10) : 0;
442
+ return (freePages + inactivePages + speculativePages) * actualPageSize / (1024 * 1024 * 1024);
443
+ } catch {
444
+ return os2.freemem() / (1024 * 1024 * 1024);
445
+ }
446
+ }
447
+ return os2.freemem() / (1024 * 1024 * 1024);
448
+ }
428
449
  function spawnDaemon() {
429
- const freeGB = os2.freemem() / (1024 * 1024 * 1024);
450
+ const freeGB = getAvailableMemoryGB();
430
451
  const totalGB = os2.totalmem() / (1024 * 1024 * 1024);
431
452
  if (totalGB <= 8) {
432
453
  process.stderr.write(
@@ -435,9 +456,9 @@ function spawnDaemon() {
435
456
  );
436
457
  return;
437
458
  }
438
- if (totalGB <= 16 && freeGB < 4) {
459
+ if (totalGB <= 16 && freeGB < 2) {
439
460
  process.stderr.write(
440
- `[exed-client] SKIP: low memory (${freeGB.toFixed(1)}GB free / ${totalGB.toFixed(0)}GB total). Embedding daemon not started \u2014 using keyword search only.
461
+ `[exed-client] SKIP: low memory (${freeGB.toFixed(1)}GB available / ${totalGB.toFixed(0)}GB total). Embedding daemon not started \u2014 using keyword search only.
441
462
  `
442
463
  );
443
464
  return;
@@ -1616,7 +1637,7 @@ async function ensureCompatibilityViews(prisma) {
1616
1637
  for (const mapping of VIEW_MAPPINGS) {
1617
1638
  const relation = mapping.source.replace(/"/g, "");
1618
1639
  const rows = await prisma.$queryRawUnsafe(
1619
- "SELECT to_regclass($1) AS regclass",
1640
+ "SELECT to_regclass($1)::text AS regclass",
1620
1641
  relation
1621
1642
  );
1622
1643
  if (!rows[0]?.regclass) {
@@ -1212,7 +1212,7 @@ async function ensureCompatibilityViews(prisma) {
1212
1212
  for (const mapping of VIEW_MAPPINGS) {
1213
1213
  const relation = mapping.source.replace(/"/g, "");
1214
1214
  const rows = await prisma.$queryRawUnsafe(
1215
- "SELECT to_regclass($1) AS regclass",
1215
+ "SELECT to_regclass($1)::text AS regclass",
1216
1216
  relation
1217
1217
  );
1218
1218
  if (!rows[0]?.regclass) {
@@ -1566,8 +1566,29 @@ function findPackageRoot() {
1566
1566
  }
1567
1567
  return null;
1568
1568
  }
1569
+ function getAvailableMemoryGB() {
1570
+ if (process.platform === "darwin") {
1571
+ try {
1572
+ const { execSync: execSync8 } = __require("child_process");
1573
+ const vmstat = execSync8("vm_stat", { encoding: "utf8" });
1574
+ const pageSize = 16384;
1575
+ const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
1576
+ const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
1577
+ const free = vmstat.match(/Pages free:\s+(\d+)/);
1578
+ const inactive = vmstat.match(/Pages inactive:\s+(\d+)/);
1579
+ const speculative = vmstat.match(/Pages speculative:\s+(\d+)/);
1580
+ const freePages = free ? parseInt(free[1], 10) : 0;
1581
+ const inactivePages = inactive ? parseInt(inactive[1], 10) : 0;
1582
+ const speculativePages = speculative ? parseInt(speculative[1], 10) : 0;
1583
+ return (freePages + inactivePages + speculativePages) * actualPageSize / (1024 * 1024 * 1024);
1584
+ } catch {
1585
+ return os7.freemem() / (1024 * 1024 * 1024);
1586
+ }
1587
+ }
1588
+ return os7.freemem() / (1024 * 1024 * 1024);
1589
+ }
1569
1590
  function spawnDaemon() {
1570
- const freeGB = os7.freemem() / (1024 * 1024 * 1024);
1591
+ const freeGB = getAvailableMemoryGB();
1571
1592
  const totalGB = os7.totalmem() / (1024 * 1024 * 1024);
1572
1593
  if (totalGB <= 8) {
1573
1594
  process.stderr.write(
@@ -1576,9 +1597,9 @@ function spawnDaemon() {
1576
1597
  );
1577
1598
  return;
1578
1599
  }
1579
- if (totalGB <= 16 && freeGB < 4) {
1600
+ if (totalGB <= 16 && freeGB < 2) {
1580
1601
  process.stderr.write(
1581
- `[exed-client] SKIP: low memory (${freeGB.toFixed(1)}GB free / ${totalGB.toFixed(0)}GB total). Embedding daemon not started \u2014 using keyword search only.
1602
+ `[exed-client] SKIP: low memory (${freeGB.toFixed(1)}GB available / ${totalGB.toFixed(0)}GB total). Embedding daemon not started \u2014 using keyword search only.
1582
1603
  `
1583
1604
  );
1584
1605
  return;
package/dist/tui/App.js CHANGED
@@ -1516,7 +1516,7 @@ async function ensureCompatibilityViews(prisma) {
1516
1516
  for (const mapping of VIEW_MAPPINGS) {
1517
1517
  const relation = mapping.source.replace(/"/g, "");
1518
1518
  const rows = await prisma.$queryRawUnsafe(
1519
- "SELECT to_regclass($1) AS regclass",
1519
+ "SELECT to_regclass($1)::text AS regclass",
1520
1520
  relation
1521
1521
  );
1522
1522
  if (!rows[0]?.regclass) {
@@ -1870,8 +1870,29 @@ function findPackageRoot() {
1870
1870
  }
1871
1871
  return null;
1872
1872
  }
1873
+ function getAvailableMemoryGB() {
1874
+ if (process.platform === "darwin") {
1875
+ try {
1876
+ const { execSync: execSync10 } = __require("child_process");
1877
+ const vmstat = execSync10("vm_stat", { encoding: "utf8" });
1878
+ const pageSize = 16384;
1879
+ const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
1880
+ const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
1881
+ const free = vmstat.match(/Pages free:\s+(\d+)/);
1882
+ const inactive = vmstat.match(/Pages inactive:\s+(\d+)/);
1883
+ const speculative = vmstat.match(/Pages speculative:\s+(\d+)/);
1884
+ const freePages = free ? parseInt(free[1], 10) : 0;
1885
+ const inactivePages = inactive ? parseInt(inactive[1], 10) : 0;
1886
+ const speculativePages = speculative ? parseInt(speculative[1], 10) : 0;
1887
+ return (freePages + inactivePages + speculativePages) * actualPageSize / (1024 * 1024 * 1024);
1888
+ } catch {
1889
+ return os6.freemem() / (1024 * 1024 * 1024);
1890
+ }
1891
+ }
1892
+ return os6.freemem() / (1024 * 1024 * 1024);
1893
+ }
1873
1894
  function spawnDaemon() {
1874
- const freeGB = os6.freemem() / (1024 * 1024 * 1024);
1895
+ const freeGB = getAvailableMemoryGB();
1875
1896
  const totalGB = os6.totalmem() / (1024 * 1024 * 1024);
1876
1897
  if (totalGB <= 8) {
1877
1898
  process.stderr.write(
@@ -1880,9 +1901,9 @@ function spawnDaemon() {
1880
1901
  );
1881
1902
  return;
1882
1903
  }
1883
- if (totalGB <= 16 && freeGB < 4) {
1904
+ if (totalGB <= 16 && freeGB < 2) {
1884
1905
  process.stderr.write(
1885
- `[exed-client] SKIP: low memory (${freeGB.toFixed(1)}GB free / ${totalGB.toFixed(0)}GB total). Embedding daemon not started \u2014 using keyword search only.
1906
+ `[exed-client] SKIP: low memory (${freeGB.toFixed(1)}GB available / ${totalGB.toFixed(0)}GB total). Embedding daemon not started \u2014 using keyword search only.
1886
1907
  `
1887
1908
  );
1888
1909
  return;
@@ -8592,6 +8613,15 @@ __export(factory_exports, {
8592
8613
  function createProvider(opts) {
8593
8614
  const { providerId, model, apiKey } = opts;
8594
8615
  if (providerId === "anthropic") {
8616
+ const routerUrl = process.env.API_ROUTER_URL;
8617
+ const routerKey = process.env.API_ROUTER_KEY;
8618
+ const byok = process.env.BYOK_ENABLED === "true";
8619
+ if (routerUrl && routerKey && !byok) {
8620
+ return new AnthropicProvider("anthropic", {
8621
+ apiKey: routerKey,
8622
+ baseUrl: routerUrl
8623
+ });
8624
+ }
8595
8625
  return new AnthropicProvider("anthropic", { apiKey });
8596
8626
  }
8597
8627
  if (providerId === "openai") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@askexenow/exe-os",
3
- "version": "0.9.13",
3
+ "version": "0.9.14",
4
4
  "description": "AI employee operating system — persistent memory, task management, and multi-agent coordination for Claude Code.",
5
5
  "license": "CC-BY-NC-4.0",
6
6
  "type": "module",