@askexenow/exe-os 0.9.87 → 0.9.89

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 (102) hide show
  1. package/deploy/compose/docker-compose.yml +3 -3
  2. package/dist/bin/age-ontology-load.js +8 -2
  3. package/dist/bin/agentic-ontology-backfill.js +11 -0
  4. package/dist/bin/agentic-reflection-backfill.js +11 -0
  5. package/dist/bin/agentic-semantic-label.js +11 -0
  6. package/dist/bin/backfill-conversations.js +12 -0
  7. package/dist/bin/backfill-responses.js +12 -0
  8. package/dist/bin/backfill-vectors.js +12 -0
  9. package/dist/bin/bulk-sync-postgres.js +29 -1
  10. package/dist/bin/cc-doctor.js +3 -2
  11. package/dist/bin/cleanup-stale-review-tasks.js +12 -0
  12. package/dist/bin/cli.js +170 -15
  13. package/dist/bin/exe-agent.js +1 -0
  14. package/dist/bin/exe-assign.js +12 -0
  15. package/dist/bin/exe-boot.js +139 -4
  16. package/dist/bin/exe-call.js +2 -0
  17. package/dist/bin/exe-cloud.js +138 -3
  18. package/dist/bin/exe-dispatch.js +12 -1
  19. package/dist/bin/exe-doctor.js +12 -0
  20. package/dist/bin/exe-export-behaviors.js +11 -0
  21. package/dist/bin/exe-forget.js +12 -0
  22. package/dist/bin/exe-gateway.js +132 -35
  23. package/dist/bin/exe-healthcheck.js +2 -1
  24. package/dist/bin/exe-heartbeat.js +12 -0
  25. package/dist/bin/exe-kill.js +11 -0
  26. package/dist/bin/exe-launch-agent.js +11 -0
  27. package/dist/bin/exe-new-employee.js +4 -2
  28. package/dist/bin/exe-pending-messages.js +11 -0
  29. package/dist/bin/exe-pending-notifications.js +12 -0
  30. package/dist/bin/exe-pending-reviews.js +12 -0
  31. package/dist/bin/exe-rename.js +12 -0
  32. package/dist/bin/exe-review.js +12 -0
  33. package/dist/bin/exe-search.js +12 -0
  34. package/dist/bin/exe-session-cleanup.js +12 -1
  35. package/dist/bin/exe-settings.js +3 -0
  36. package/dist/bin/exe-start-codex.js +13 -2
  37. package/dist/bin/exe-start-opencode.js +13 -2
  38. package/dist/bin/exe-status.js +12 -0
  39. package/dist/bin/exe-team.js +12 -0
  40. package/dist/bin/git-sweep.js +12 -1
  41. package/dist/bin/graph-backfill.js +11 -0
  42. package/dist/bin/graph-export.js +11 -0
  43. package/dist/bin/graph-layer-benchmark.js +9 -1
  44. package/dist/bin/intercom-check.js +13 -1
  45. package/dist/bin/list-providers.js +1 -0
  46. package/dist/bin/postgres-agentic-reflection-backfill.js +7 -1
  47. package/dist/bin/postgres-agentic-semantic-backfill.js +7 -1
  48. package/dist/bin/registry-proxy.js +1 -0
  49. package/dist/bin/scan-tasks.js +13 -1
  50. package/dist/bin/setup.js +141 -7
  51. package/dist/bin/shard-migrate.js +11 -0
  52. package/dist/bin/stack-update.js +24 -7
  53. package/dist/bin/update.js +5 -0
  54. package/dist/gateway/index.js +12 -1
  55. package/dist/hooks/bug-report-worker.js +12 -1
  56. package/dist/hooks/codex-stop-task-finalizer.js +12 -1
  57. package/dist/hooks/commit-complete.js +12 -1
  58. package/dist/hooks/error-recall.js +11 -0
  59. package/dist/hooks/ingest.js +11 -0
  60. package/dist/hooks/instructions-loaded.js +11 -0
  61. package/dist/hooks/notification.js +11 -0
  62. package/dist/hooks/post-compact.js +11 -0
  63. package/dist/hooks/post-tool-combined.js +11 -0
  64. package/dist/hooks/pre-compact.js +12 -1
  65. package/dist/hooks/pre-tool-use.js +11 -0
  66. package/dist/hooks/prompt-submit.js +12 -1
  67. package/dist/hooks/session-end.js +12 -1
  68. package/dist/hooks/session-start.js +11 -0
  69. package/dist/hooks/stop.js +11 -0
  70. package/dist/hooks/subagent-stop.js +11 -0
  71. package/dist/hooks/summary-worker.js +137 -3
  72. package/dist/index.js +12 -1
  73. package/dist/lib/cloud-sync.js +136 -2
  74. package/dist/lib/consolidation.js +1 -0
  75. package/dist/lib/database.js +11 -0
  76. package/dist/lib/db.js +11 -0
  77. package/dist/lib/device-registry.js +11 -0
  78. package/dist/lib/employee-templates.js +1 -0
  79. package/dist/lib/exe-daemon.js +771 -49
  80. package/dist/lib/hybrid-search.js +11 -0
  81. package/dist/lib/identity.js +1 -0
  82. package/dist/lib/messaging.js +2 -1
  83. package/dist/lib/reminders.js +1 -0
  84. package/dist/lib/schedules.js +11 -0
  85. package/dist/lib/skill-learning.js +1 -0
  86. package/dist/lib/store.js +11 -0
  87. package/dist/lib/tasks.js +2 -1
  88. package/dist/lib/tmux-routing.js +2 -1
  89. package/dist/lib/token-spend.js +1 -0
  90. package/dist/lib/ws-client.js +8 -0
  91. package/dist/mcp/server.js +613 -27
  92. package/dist/mcp/tools/complete-reminder.js +1 -0
  93. package/dist/mcp/tools/create-reminder.js +1 -0
  94. package/dist/mcp/tools/create-task.js +2 -1
  95. package/dist/mcp/tools/deactivate-behavior.js +1 -0
  96. package/dist/mcp/tools/list-reminders.js +1 -0
  97. package/dist/mcp/tools/list-tasks.js +1 -0
  98. package/dist/mcp/tools/send-message.js +2 -1
  99. package/dist/mcp/tools/update-task.js +2 -1
  100. package/dist/runtime/index.js +12 -1
  101. package/dist/tui/App.js +12 -1
  102. package/package.json +2 -2
@@ -1716,6 +1716,7 @@ __export(database_exports, {
1716
1716
  isInitialized: () => isInitialized,
1717
1717
  setExternalClient: () => setExternalClient
1718
1718
  });
1719
+ import { chmodSync as chmodSync2 } from "fs";
1719
1720
  import { createClient } from "@libsql/client";
1720
1721
  async function initDatabase(config) {
1721
1722
  if (_walCheckpointTimer) {
@@ -1757,6 +1758,16 @@ async function initDatabase(config) {
1757
1758
  if (process.env.DATABASE_URL && process.env.EXE_USE_POSTGRES === "1") {
1758
1759
  _adapterClient = await createPrismaDbAdapter(_resilientClient);
1759
1760
  }
1761
+ try {
1762
+ chmodSync2(config.dbPath, 384);
1763
+ for (const suffix of ["-wal", "-shm"]) {
1764
+ try {
1765
+ chmodSync2(config.dbPath + suffix, 384);
1766
+ } catch {
1767
+ }
1768
+ }
1769
+ } catch {
1770
+ }
1760
1771
  }
1761
1772
  function isInitialized() {
1762
1773
  return _adapterClient !== null || _client !== null;
@@ -5502,6 +5513,7 @@ import { fileURLToPath as fileURLToPath2 } from "url";
5502
5513
  function isMainModule(importMetaUrl) {
5503
5514
  if (process.argv[1] == null) return false;
5504
5515
  if (process.argv[1].includes("mcp/server")) return false;
5516
+ if (process.argv[1].includes("exe-daemon")) return false;
5505
5517
  try {
5506
5518
  const scriptPath = realpathSync(process.argv[1]);
5507
5519
  const modulePath = realpathSync(fileURLToPath2(importMetaUrl));
@@ -1701,6 +1701,7 @@ __export(database_exports, {
1701
1701
  isInitialized: () => isInitialized,
1702
1702
  setExternalClient: () => setExternalClient
1703
1703
  });
1704
+ import { chmodSync as chmodSync2 } from "fs";
1704
1705
  import { createClient } from "@libsql/client";
1705
1706
  async function initDatabase(config) {
1706
1707
  if (_walCheckpointTimer) {
@@ -1742,6 +1743,16 @@ async function initDatabase(config) {
1742
1743
  if (process.env.DATABASE_URL && process.env.EXE_USE_POSTGRES === "1") {
1743
1744
  _adapterClient = await createPrismaDbAdapter(_resilientClient);
1744
1745
  }
1746
+ try {
1747
+ chmodSync2(config.dbPath, 384);
1748
+ for (const suffix of ["-wal", "-shm"]) {
1749
+ try {
1750
+ chmodSync2(config.dbPath + suffix, 384);
1751
+ } catch {
1752
+ }
1753
+ }
1754
+ } catch {
1755
+ }
1745
1756
  }
1746
1757
  function isInitialized() {
1747
1758
  return _adapterClient !== null || _client !== null;
@@ -7189,6 +7200,7 @@ import { fileURLToPath as fileURLToPath2 } from "url";
7189
7200
  function isMainModule(importMetaUrl) {
7190
7201
  if (process.argv[1] == null) return false;
7191
7202
  if (process.argv[1].includes("mcp/server")) return false;
7203
+ if (process.argv[1].includes("exe-daemon")) return false;
7192
7204
  try {
7193
7205
  const scriptPath = realpathSync(process.argv[1]);
7194
7206
  const modulePath = realpathSync(fileURLToPath2(importMetaUrl));
@@ -1745,6 +1745,7 @@ __export(database_exports, {
1745
1745
  isInitialized: () => isInitialized,
1746
1746
  setExternalClient: () => setExternalClient
1747
1747
  });
1748
+ import { chmodSync as chmodSync2 } from "fs";
1748
1749
  import { createClient } from "@libsql/client";
1749
1750
  async function initDatabase(config) {
1750
1751
  if (_walCheckpointTimer) {
@@ -1786,6 +1787,16 @@ async function initDatabase(config) {
1786
1787
  if (process.env.DATABASE_URL && process.env.EXE_USE_POSTGRES === "1") {
1787
1788
  _adapterClient = await createPrismaDbAdapter(_resilientClient);
1788
1789
  }
1790
+ try {
1791
+ chmodSync2(config.dbPath, 384);
1792
+ for (const suffix of ["-wal", "-shm"]) {
1793
+ try {
1794
+ chmodSync2(config.dbPath + suffix, 384);
1795
+ } catch {
1796
+ }
1797
+ }
1798
+ } catch {
1799
+ }
1789
1800
  }
1790
1801
  function isInitialized() {
1791
1802
  return _adapterClient !== null || _client !== null;
@@ -5835,7 +5846,7 @@ function readQueue() {
5835
5846
  function writeQueue(queue) {
5836
5847
  ensureDir();
5837
5848
  const tmp = `${QUEUE_PATH}.tmp`;
5838
- writeFileSync5(tmp, JSON.stringify(queue, null, 2));
5849
+ writeFileSync5(tmp, JSON.stringify(queue, null, 2), { mode: 384 });
5839
5850
  renameSync4(tmp, QUEUE_PATH);
5840
5851
  }
5841
5852
  function queueIntercom(targetSession, reason) {
@@ -310,6 +310,7 @@ var init_memory = __esm({
310
310
  });
311
311
 
312
312
  // src/lib/database.ts
313
+ import { chmodSync as chmodSync2 } from "fs";
313
314
  import { createClient } from "@libsql/client";
314
315
  var init_database = __esm({
315
316
  "src/lib/database.ts"() {
@@ -440,6 +441,7 @@ import { fileURLToPath } from "url";
440
441
  function isMainModule(importMetaUrl) {
441
442
  if (process.argv[1] == null) return false;
442
443
  if (process.argv[1].includes("mcp/server")) return false;
444
+ if (process.argv[1].includes("exe-daemon")) return false;
443
445
  try {
444
446
  const scriptPath = realpathSync(process.argv[1]);
445
447
  const modulePath = realpathSync(fileURLToPath(importMetaUrl));
@@ -497,6 +499,7 @@ function assertSecureEndpoint(endpoint) {
497
499
  }
498
500
  }
499
501
  var ROSTER_DELETIONS_PATH = path6.join(EXE_AI_DIR, "roster-deletions.json");
502
+ var CODE_CONTEXT_DIR = path6.join(EXE_AI_DIR, "code-context");
500
503
 
501
504
  // src/bin/exe-settings.ts
502
505
  init_agent_config();
@@ -1574,6 +1574,7 @@ __export(database_exports, {
1574
1574
  isInitialized: () => isInitialized,
1575
1575
  setExternalClient: () => setExternalClient
1576
1576
  });
1577
+ import { chmodSync as chmodSync2 } from "fs";
1577
1578
  import { createClient } from "@libsql/client";
1578
1579
  async function initDatabase(config) {
1579
1580
  if (_walCheckpointTimer) {
@@ -1615,6 +1616,16 @@ async function initDatabase(config) {
1615
1616
  if (process.env.DATABASE_URL && process.env.EXE_USE_POSTGRES === "1") {
1616
1617
  _adapterClient = await createPrismaDbAdapter(_resilientClient);
1617
1618
  }
1619
+ try {
1620
+ chmodSync2(config.dbPath, 384);
1621
+ for (const suffix of ["-wal", "-shm"]) {
1622
+ try {
1623
+ chmodSync2(config.dbPath + suffix, 384);
1624
+ } catch {
1625
+ }
1626
+ }
1627
+ } catch {
1628
+ }
1618
1629
  }
1619
1630
  function isInitialized() {
1620
1631
  return _adapterClient !== null || _client !== null;
@@ -4442,7 +4453,7 @@ var init_preferences = __esm({
4442
4453
  });
4443
4454
 
4444
4455
  // src/adapters/mcp-http-config.ts
4445
- import { chmodSync as chmodSync2, existsSync as existsSync11, mkdirSync as mkdirSync6, readFileSync as readFileSync7, writeFileSync as writeFileSync6 } from "fs";
4456
+ import { chmodSync as chmodSync3, existsSync as existsSync11, mkdirSync as mkdirSync6, readFileSync as readFileSync7, writeFileSync as writeFileSync6 } from "fs";
4446
4457
  import { randomBytes } from "crypto";
4447
4458
  import path12 from "path";
4448
4459
  import os9 from "os";
@@ -4467,7 +4478,7 @@ function readOrCreateDaemonToken(homeDir = os9.homedir()) {
4467
4478
  writeFileSync6(tokenPath, `${token}
4468
4479
  `, "utf-8");
4469
4480
  try {
4470
- chmodSync2(tokenPath, 384);
4481
+ chmodSync3(tokenPath, 384);
4471
4482
  } catch {
4472
4483
  }
4473
4484
  return token;
@@ -1574,6 +1574,7 @@ __export(database_exports, {
1574
1574
  isInitialized: () => isInitialized,
1575
1575
  setExternalClient: () => setExternalClient
1576
1576
  });
1577
+ import { chmodSync as chmodSync2 } from "fs";
1577
1578
  import { createClient } from "@libsql/client";
1578
1579
  async function initDatabase(config) {
1579
1580
  if (_walCheckpointTimer) {
@@ -1615,6 +1616,16 @@ async function initDatabase(config) {
1615
1616
  if (process.env.DATABASE_URL && process.env.EXE_USE_POSTGRES === "1") {
1616
1617
  _adapterClient = await createPrismaDbAdapter(_resilientClient);
1617
1618
  }
1619
+ try {
1620
+ chmodSync2(config.dbPath, 384);
1621
+ for (const suffix of ["-wal", "-shm"]) {
1622
+ try {
1623
+ chmodSync2(config.dbPath + suffix, 384);
1624
+ } catch {
1625
+ }
1626
+ }
1627
+ } catch {
1628
+ }
1618
1629
  }
1619
1630
  function isInitialized() {
1620
1631
  return _adapterClient !== null || _client !== null;
@@ -4431,7 +4442,7 @@ var init_preferences = __esm({
4431
4442
  });
4432
4443
 
4433
4444
  // src/adapters/mcp-http-config.ts
4434
- import { chmodSync as chmodSync2, existsSync as existsSync11, mkdirSync as mkdirSync6, readFileSync as readFileSync7, writeFileSync as writeFileSync6 } from "fs";
4445
+ import { chmodSync as chmodSync3, existsSync as existsSync11, mkdirSync as mkdirSync6, readFileSync as readFileSync7, writeFileSync as writeFileSync6 } from "fs";
4435
4446
  import { randomBytes } from "crypto";
4436
4447
  import path12 from "path";
4437
4448
  import os9 from "os";
@@ -4456,7 +4467,7 @@ function readOrCreateDaemonToken(homeDir = os9.homedir()) {
4456
4467
  writeFileSync6(tokenPath, `${token}
4457
4468
  `, "utf-8");
4458
4469
  try {
4459
- chmodSync2(tokenPath, 384);
4470
+ chmodSync3(tokenPath, 384);
4460
4471
  } catch {
4461
4472
  }
4462
4473
  return token;
@@ -1724,6 +1724,7 @@ __export(database_exports, {
1724
1724
  isInitialized: () => isInitialized,
1725
1725
  setExternalClient: () => setExternalClient
1726
1726
  });
1727
+ import { chmodSync as chmodSync2 } from "fs";
1727
1728
  import { createClient } from "@libsql/client";
1728
1729
  async function initDatabase(config) {
1729
1730
  if (_walCheckpointTimer) {
@@ -1765,6 +1766,16 @@ async function initDatabase(config) {
1765
1766
  if (process.env.DATABASE_URL && process.env.EXE_USE_POSTGRES === "1") {
1766
1767
  _adapterClient = await createPrismaDbAdapter(_resilientClient);
1767
1768
  }
1769
+ try {
1770
+ chmodSync2(config.dbPath, 384);
1771
+ for (const suffix of ["-wal", "-shm"]) {
1772
+ try {
1773
+ chmodSync2(config.dbPath + suffix, 384);
1774
+ } catch {
1775
+ }
1776
+ }
1777
+ } catch {
1778
+ }
1768
1779
  }
1769
1780
  function isInitialized() {
1770
1781
  return _adapterClient !== null || _client !== null;
@@ -6156,6 +6167,7 @@ import { fileURLToPath as fileURLToPath2 } from "url";
6156
6167
  function isMainModule(importMetaUrl) {
6157
6168
  if (process.argv[1] == null) return false;
6158
6169
  if (process.argv[1].includes("mcp/server")) return false;
6170
+ if (process.argv[1].includes("exe-daemon")) return false;
6159
6171
  try {
6160
6172
  const scriptPath = realpathSync(process.argv[1]);
6161
6173
  const modulePath = realpathSync(fileURLToPath2(importMetaUrl));
@@ -1713,6 +1713,7 @@ __export(database_exports, {
1713
1713
  isInitialized: () => isInitialized,
1714
1714
  setExternalClient: () => setExternalClient
1715
1715
  });
1716
+ import { chmodSync as chmodSync2 } from "fs";
1716
1717
  import { createClient } from "@libsql/client";
1717
1718
  async function initDatabase(config) {
1718
1719
  if (_walCheckpointTimer) {
@@ -1754,6 +1755,16 @@ async function initDatabase(config) {
1754
1755
  if (process.env.DATABASE_URL && process.env.EXE_USE_POSTGRES === "1") {
1755
1756
  _adapterClient = await createPrismaDbAdapter(_resilientClient);
1756
1757
  }
1758
+ try {
1759
+ chmodSync2(config.dbPath, 384);
1760
+ for (const suffix of ["-wal", "-shm"]) {
1761
+ try {
1762
+ chmodSync2(config.dbPath + suffix, 384);
1763
+ } catch {
1764
+ }
1765
+ }
1766
+ } catch {
1767
+ }
1757
1768
  }
1758
1769
  function isInitialized() {
1759
1770
  return _adapterClient !== null || _client !== null;
@@ -5497,6 +5508,7 @@ import { fileURLToPath as fileURLToPath2 } from "url";
5497
5508
  function isMainModule(importMetaUrl) {
5498
5509
  if (process.argv[1] == null) return false;
5499
5510
  if (process.argv[1].includes("mcp/server")) return false;
5511
+ if (process.argv[1].includes("exe-daemon")) return false;
5500
5512
  try {
5501
5513
  const scriptPath = realpathSync(process.argv[1]);
5502
5514
  const modulePath = realpathSync(fileURLToPath2(importMetaUrl));
@@ -712,7 +712,7 @@ function readQueue() {
712
712
  function writeQueue(queue) {
713
713
  ensureDir();
714
714
  const tmp = `${QUEUE_PATH}.tmp`;
715
- writeFileSync3(tmp, JSON.stringify(queue, null, 2));
715
+ writeFileSync3(tmp, JSON.stringify(queue, null, 2), { mode: 384 });
716
716
  renameSync2(tmp, QUEUE_PATH);
717
717
  }
718
718
  function queueIntercom(targetSession, reason) {
@@ -2225,6 +2225,7 @@ __export(database_exports, {
2225
2225
  isInitialized: () => isInitialized,
2226
2226
  setExternalClient: () => setExternalClient
2227
2227
  });
2228
+ import { chmodSync as chmodSync2 } from "fs";
2228
2229
  import { createClient } from "@libsql/client";
2229
2230
  async function initDatabase(config) {
2230
2231
  if (_walCheckpointTimer) {
@@ -2266,6 +2267,16 @@ async function initDatabase(config) {
2266
2267
  if (process.env.DATABASE_URL && process.env.EXE_USE_POSTGRES === "1") {
2267
2268
  _adapterClient = await createPrismaDbAdapter(_resilientClient);
2268
2269
  }
2270
+ try {
2271
+ chmodSync2(config.dbPath, 384);
2272
+ for (const suffix of ["-wal", "-shm"]) {
2273
+ try {
2274
+ chmodSync2(config.dbPath + suffix, 384);
2275
+ } catch {
2276
+ }
2277
+ }
2278
+ } catch {
2279
+ }
2269
2280
  }
2270
2281
  function isInitialized() {
2271
2282
  return _adapterClient !== null || _client !== null;
@@ -1487,6 +1487,7 @@ __export(database_exports, {
1487
1487
  isInitialized: () => isInitialized,
1488
1488
  setExternalClient: () => setExternalClient
1489
1489
  });
1490
+ import { chmodSync as chmodSync2 } from "fs";
1490
1491
  import { createClient } from "@libsql/client";
1491
1492
  async function initDatabase(config) {
1492
1493
  if (_walCheckpointTimer) {
@@ -1528,6 +1529,16 @@ async function initDatabase(config) {
1528
1529
  if (process.env.DATABASE_URL && process.env.EXE_USE_POSTGRES === "1") {
1529
1530
  _adapterClient = await createPrismaDbAdapter(_resilientClient);
1530
1531
  }
1532
+ try {
1533
+ chmodSync2(config.dbPath, 384);
1534
+ for (const suffix of ["-wal", "-shm"]) {
1535
+ try {
1536
+ chmodSync2(config.dbPath + suffix, 384);
1537
+ } catch {
1538
+ }
1539
+ }
1540
+ } catch {
1541
+ }
1531
1542
  }
1532
1543
  function isInitialized() {
1533
1544
  return _adapterClient !== null || _client !== null;
@@ -1702,6 +1702,7 @@ __export(database_exports, {
1702
1702
  isInitialized: () => isInitialized,
1703
1703
  setExternalClient: () => setExternalClient
1704
1704
  });
1705
+ import { chmodSync as chmodSync2 } from "fs";
1705
1706
  import { createClient } from "@libsql/client";
1706
1707
  async function initDatabase(config) {
1707
1708
  if (_walCheckpointTimer) {
@@ -1743,6 +1744,16 @@ async function initDatabase(config) {
1743
1744
  if (process.env.DATABASE_URL && process.env.EXE_USE_POSTGRES === "1") {
1744
1745
  _adapterClient = await createPrismaDbAdapter(_resilientClient);
1745
1746
  }
1747
+ try {
1748
+ chmodSync2(config.dbPath, 384);
1749
+ for (const suffix of ["-wal", "-shm"]) {
1750
+ try {
1751
+ chmodSync2(config.dbPath + suffix, 384);
1752
+ } catch {
1753
+ }
1754
+ }
1755
+ } catch {
1756
+ }
1746
1757
  }
1747
1758
  function isInitialized() {
1748
1759
  return _adapterClient !== null || _client !== null;
@@ -2,6 +2,14 @@
2
2
 
3
3
  // src/bin/graph-layer-benchmark.ts
4
4
  import { Client } from "pg";
5
+
6
+ // src/lib/pg-ssl.ts
7
+ function pgSslConfig() {
8
+ if (process.env.EXE_DB_SSL_DISABLED === "true") return {};
9
+ return { ssl: { rejectUnauthorized: process.env.EXE_DB_SSL_ALLOW_SELFSIGNED !== "true" } };
10
+ }
11
+
12
+ // src/bin/graph-layer-benchmark.ts
5
13
  function now() {
6
14
  return Date.now();
7
15
  }
@@ -18,7 +26,7 @@ async function timed(layer, check, fn) {
18
26
  }
19
27
  }
20
28
  async function withPg(url, fn) {
21
- const client = new Client({ connectionString: url });
29
+ const client = new Client({ connectionString: url, ...pgSslConfig() });
22
30
  await client.connect();
23
31
  try {
24
32
  return await fn(client);
@@ -1811,6 +1811,7 @@ __export(database_exports, {
1811
1811
  isInitialized: () => isInitialized,
1812
1812
  setExternalClient: () => setExternalClient
1813
1813
  });
1814
+ import { chmodSync as chmodSync2 } from "fs";
1814
1815
  import { createClient } from "@libsql/client";
1815
1816
  async function initDatabase(config) {
1816
1817
  if (_walCheckpointTimer) {
@@ -1852,6 +1853,16 @@ async function initDatabase(config) {
1852
1853
  if (process.env.DATABASE_URL && process.env.EXE_USE_POSTGRES === "1") {
1853
1854
  _adapterClient = await createPrismaDbAdapter(_resilientClient);
1854
1855
  }
1856
+ try {
1857
+ chmodSync2(config.dbPath, 384);
1858
+ for (const suffix of ["-wal", "-shm"]) {
1859
+ try {
1860
+ chmodSync2(config.dbPath + suffix, 384);
1861
+ } catch {
1862
+ }
1863
+ }
1864
+ } catch {
1865
+ }
1855
1866
  }
1856
1867
  function isInitialized() {
1857
1868
  return _adapterClient !== null || _client !== null;
@@ -5985,7 +5996,7 @@ function readQueue() {
5985
5996
  function writeQueue(queue) {
5986
5997
  ensureDir();
5987
5998
  const tmp = `${QUEUE_PATH}.tmp`;
5988
- writeFileSync5(tmp, JSON.stringify(queue, null, 2));
5999
+ writeFileSync5(tmp, JSON.stringify(queue, null, 2), { mode: 384 });
5989
6000
  renameSync4(tmp, QUEUE_PATH);
5990
6001
  }
5991
6002
  function queueIntercom(targetSession, reason) {
@@ -9466,6 +9477,7 @@ import { fileURLToPath as fileURLToPath3 } from "url";
9466
9477
  function isMainModule(importMetaUrl) {
9467
9478
  if (process.argv[1] == null) return false;
9468
9479
  if (process.argv[1].includes("mcp/server")) return false;
9480
+ if (process.argv[1].includes("exe-daemon")) return false;
9469
9481
  try {
9470
9482
  const scriptPath = realpathSync(process.argv[1]);
9471
9483
  const modulePath = realpathSync(fileURLToPath3(importMetaUrl));
@@ -11,6 +11,7 @@ import { fileURLToPath } from "url";
11
11
  function isMainModule(importMetaUrl) {
12
12
  if (process.argv[1] == null) return false;
13
13
  if (process.argv[1].includes("mcp/server")) return false;
14
+ if (process.argv[1].includes("exe-daemon")) return false;
14
15
  try {
15
16
  const scriptPath = realpathSync(process.argv[1]);
16
17
  const modulePath = realpathSync(fileURLToPath(importMetaUrl));
@@ -115,6 +115,12 @@ var init_config = __esm({
115
115
  // src/bin/postgres-agentic-reflection-backfill.ts
116
116
  import { Client } from "pg";
117
117
 
118
+ // src/lib/pg-ssl.ts
119
+ function pgSslConfig() {
120
+ if (process.env.EXE_DB_SSL_DISABLED === "true") return {};
121
+ return { ssl: { rejectUnauthorized: process.env.EXE_DB_SSL_ALLOW_SELFSIGNED !== "true" } };
122
+ }
123
+
118
124
  // src/lib/agentic-ontology.ts
119
125
  import { createHash } from "crypto";
120
126
  function stableId(...parts) {
@@ -391,7 +397,7 @@ async function main() {
391
397
  const windowSize = Number(arg("--window") ?? "100");
392
398
  const minEvents = Number(arg("--min-events") ?? "20");
393
399
  const project = arg("--project");
394
- const client = new Client({ connectionString: url });
400
+ const client = new Client({ connectionString: url, ...pgSslConfig() });
395
401
  await client.connect();
396
402
  try {
397
403
  await ensureSchema(client);
@@ -115,6 +115,12 @@ var init_config = __esm({
115
115
  // src/bin/postgres-agentic-semantic-backfill.ts
116
116
  import { Client } from "pg";
117
117
 
118
+ // src/lib/pg-ssl.ts
119
+ function pgSslConfig() {
120
+ if (process.env.EXE_DB_SSL_DISABLED === "true") return {};
121
+ return { ssl: { rejectUnauthorized: process.env.EXE_DB_SSL_ALLOW_SELFSIGNED !== "true" } };
122
+ }
123
+
118
124
  // src/lib/agentic-ontology.ts
119
125
  import { createHash } from "crypto";
120
126
  function stableId(...parts) {
@@ -432,7 +438,7 @@ async function main() {
432
438
  if (!url) throw new Error("DATABASE_URL or EXED_DATABASE_URL is required");
433
439
  const limit = Number(arg("--limit") ?? "20000");
434
440
  const project = arg("--project");
435
- const client = new Client({ connectionString: url });
441
+ const client = new Client({ connectionString: url, ...pgSslConfig() });
436
442
  await client.connect();
437
443
  try {
438
444
  await ensureSchema(client);
@@ -6,6 +6,7 @@ import { fileURLToPath } from "url";
6
6
  function isMainModule(importMetaUrl) {
7
7
  if (process.argv[1] == null) return false;
8
8
  if (process.argv[1].includes("mcp/server")) return false;
9
+ if (process.argv[1].includes("exe-daemon")) return false;
9
10
  try {
10
11
  const scriptPath = realpathSync(process.argv[1]);
11
12
  const modulePath = realpathSync(fileURLToPath(importMetaUrl));
@@ -724,7 +724,7 @@ function readQueue() {
724
724
  function writeQueue(queue) {
725
725
  ensureDir();
726
726
  const tmp = `${QUEUE_PATH}.tmp`;
727
- writeFileSync3(tmp, JSON.stringify(queue, null, 2));
727
+ writeFileSync3(tmp, JSON.stringify(queue, null, 2), { mode: 384 });
728
728
  renameSync2(tmp, QUEUE_PATH);
729
729
  }
730
730
  function queueIntercom(targetSession, reason) {
@@ -2303,6 +2303,7 @@ __export(database_exports, {
2303
2303
  isInitialized: () => isInitialized,
2304
2304
  setExternalClient: () => setExternalClient
2305
2305
  });
2306
+ import { chmodSync as chmodSync2 } from "fs";
2306
2307
  import { createClient } from "@libsql/client";
2307
2308
  async function initDatabase(config) {
2308
2309
  if (_walCheckpointTimer) {
@@ -2344,6 +2345,16 @@ async function initDatabase(config) {
2344
2345
  if (process.env.DATABASE_URL && process.env.EXE_USE_POSTGRES === "1") {
2345
2346
  _adapterClient = await createPrismaDbAdapter(_resilientClient);
2346
2347
  }
2348
+ try {
2349
+ chmodSync2(config.dbPath, 384);
2350
+ for (const suffix of ["-wal", "-shm"]) {
2351
+ try {
2352
+ chmodSync2(config.dbPath + suffix, 384);
2353
+ } catch {
2354
+ }
2355
+ }
2356
+ } catch {
2357
+ }
2347
2358
  }
2348
2359
  function isInitialized() {
2349
2360
  return _adapterClient !== null || _client !== null;
@@ -9281,6 +9292,7 @@ import { fileURLToPath } from "url";
9281
9292
  function isMainModule(importMetaUrl) {
9282
9293
  if (process.argv[1] == null) return false;
9283
9294
  if (process.argv[1].includes("mcp/server")) return false;
9295
+ if (process.argv[1].includes("exe-daemon")) return false;
9284
9296
  try {
9285
9297
  const scriptPath = realpathSync(process.argv[1]);
9286
9298
  const modulePath = realpathSync(fileURLToPath(importMetaUrl));