@askexenow/exe-os 0.8.104 → 0.8.106

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 (77) hide show
  1. package/dist/bin/backfill-conversations.js +29 -16
  2. package/dist/bin/backfill-responses.js +29 -16
  3. package/dist/bin/backfill-vectors.js +29 -16
  4. package/dist/bin/cleanup-stale-review-tasks.js +68 -22
  5. package/dist/bin/cli.js +121 -57
  6. package/dist/bin/exe-assign.js +29 -16
  7. package/dist/bin/exe-boot.js +144 -39
  8. package/dist/bin/exe-call.js +143 -11
  9. package/dist/bin/exe-dispatch.js +88 -28
  10. package/dist/bin/exe-doctor.js +29 -16
  11. package/dist/bin/exe-export-behaviors.js +29 -16
  12. package/dist/bin/exe-forget.js +82 -18
  13. package/dist/bin/exe-gateway.js +88 -28
  14. package/dist/bin/exe-heartbeat.js +72 -26
  15. package/dist/bin/exe-kill.js +29 -16
  16. package/dist/bin/exe-launch-agent.js +80 -34
  17. package/dist/bin/exe-link.js +12 -1
  18. package/dist/bin/exe-pending-messages.js +29 -16
  19. package/dist/bin/exe-pending-notifications.js +29 -16
  20. package/dist/bin/exe-pending-reviews.js +56 -21
  21. package/dist/bin/exe-rename.js +12 -1
  22. package/dist/bin/exe-review.js +29 -16
  23. package/dist/bin/exe-search.js +82 -18
  24. package/dist/bin/exe-session-cleanup.js +107 -30
  25. package/dist/bin/exe-start-codex.js +77 -35
  26. package/dist/bin/exe-start-opencode.js +75 -33
  27. package/dist/bin/exe-status.js +68 -22
  28. package/dist/bin/exe-team.js +29 -16
  29. package/dist/bin/git-sweep.js +88 -28
  30. package/dist/bin/graph-backfill.js +29 -16
  31. package/dist/bin/graph-export.js +29 -16
  32. package/dist/bin/scan-tasks.js +157 -66
  33. package/dist/bin/setup.js +28 -9
  34. package/dist/bin/shard-migrate.js +29 -16
  35. package/dist/bin/wiki-sync.js +29 -16
  36. package/dist/gateway/index.js +88 -28
  37. package/dist/hooks/bug-report-worker.js +88 -28
  38. package/dist/hooks/commit-complete.js +88 -28
  39. package/dist/hooks/error-recall.js +122 -25
  40. package/dist/hooks/exe-heartbeat-hook.js +40 -7
  41. package/dist/hooks/ingest-worker.js +88 -28
  42. package/dist/hooks/ingest.js +40 -7
  43. package/dist/hooks/instructions-loaded.js +69 -23
  44. package/dist/hooks/notification.js +69 -23
  45. package/dist/hooks/post-compact.js +71 -29
  46. package/dist/hooks/pre-compact.js +91 -35
  47. package/dist/hooks/pre-tool-use.js +74 -29
  48. package/dist/hooks/prompt-ingest-worker.js +29 -16
  49. package/dist/hooks/prompt-submit.js +246 -43
  50. package/dist/hooks/response-ingest-worker.js +29 -16
  51. package/dist/hooks/session-end.js +91 -35
  52. package/dist/hooks/session-start.js +2678 -2088
  53. package/dist/hooks/stop.js +71 -29
  54. package/dist/hooks/subagent-stop.js +71 -29
  55. package/dist/hooks/summary-worker.js +68 -22
  56. package/dist/index.js +88 -28
  57. package/dist/lib/cloud-sync.js +12 -1
  58. package/dist/lib/database.js +11 -0
  59. package/dist/lib/device-registry.js +12 -1
  60. package/dist/lib/exe-daemon.js +169 -30
  61. package/dist/lib/hybrid-search.js +82 -18
  62. package/dist/lib/messaging.js +69 -8
  63. package/dist/lib/schedules.js +29 -16
  64. package/dist/lib/status-brief.js +24 -0
  65. package/dist/lib/store.js +29 -16
  66. package/dist/lib/tasks.js +59 -12
  67. package/dist/lib/tmux-routing.js +59 -12
  68. package/dist/mcp/server.js +158 -52
  69. package/dist/mcp/tools/create-task.js +62 -19
  70. package/dist/mcp/tools/deactivate-behavior.js +40 -7
  71. package/dist/mcp/tools/list-tasks.js +39 -6
  72. package/dist/mcp/tools/send-message.js +74 -17
  73. package/dist/mcp/tools/update-task.js +84 -27
  74. package/dist/runtime/index.js +88 -28
  75. package/dist/tui/App.js +90 -29
  76. package/package.json +4 -2
  77. package/src/commands/exe/call.md +2 -0
@@ -304,6 +304,16 @@ async function initDatabase(config) {
304
304
  }
305
305
  _client = createClient(opts);
306
306
  _resilientClient = wrapWithRetry(_client);
307
+ _client.execute("PRAGMA busy_timeout = 30000").catch(() => {
308
+ });
309
+ _client.execute("PRAGMA journal_mode = WAL").catch(() => {
310
+ });
311
+ if (_walCheckpointTimer) clearInterval(_walCheckpointTimer);
312
+ _walCheckpointTimer = setInterval(() => {
313
+ _client?.execute("PRAGMA wal_checkpoint(PASSIVE)").catch(() => {
314
+ });
315
+ }, 3e4);
316
+ _walCheckpointTimer.unref();
307
317
  }
308
318
  function getClient() {
309
319
  if (!_resilientClient) {
@@ -1248,7 +1258,7 @@ async function ensureSchema() {
1248
1258
  }
1249
1259
  }
1250
1260
  }
1251
- var _client, _resilientClient, _daemonClient, initTurso;
1261
+ var _client, _resilientClient, _walCheckpointTimer, _daemonClient, initTurso;
1252
1262
  var init_database = __esm({
1253
1263
  "src/lib/database.ts"() {
1254
1264
  "use strict";
@@ -1256,6 +1266,7 @@ var init_database = __esm({
1256
1266
  init_employees();
1257
1267
  _client = null;
1258
1268
  _resilientClient = null;
1269
+ _walCheckpointTimer = null;
1259
1270
  _daemonClient = null;
1260
1271
  initTurso = initDatabase;
1261
1272
  }
@@ -2211,21 +2222,23 @@ async function initStore(options) {
2211
2222
  encryptionKey: hexKey
2212
2223
  });
2213
2224
  await retryOnBusy2(() => ensureSchema(), "ensureSchema");
2214
- try {
2215
- const { initShardManager: initShardManager2 } = await Promise.resolve().then(() => (init_shard_manager(), shard_manager_exports));
2216
- initShardManager2(hexKey);
2217
- } catch {
2218
- }
2219
- const client = getClient();
2220
- const vResult = await retryOnBusy2(
2221
- () => client.execute("SELECT MAX(version) as max_v FROM memories"),
2222
- "version-query"
2223
- );
2224
- _nextVersion = (Number(vResult.rows[0]?.max_v) || 0) + 1;
2225
- try {
2226
- const { loadGlobalProcedures: loadGlobalProcedures2 } = await Promise.resolve().then(() => (init_global_procedures(), global_procedures_exports));
2227
- await loadGlobalProcedures2();
2228
- } catch {
2225
+ if (!options?.lightweight) {
2226
+ try {
2227
+ const { initShardManager: initShardManager2 } = await Promise.resolve().then(() => (init_shard_manager(), shard_manager_exports));
2228
+ initShardManager2(hexKey);
2229
+ } catch {
2230
+ }
2231
+ const client = getClient();
2232
+ const vResult = await retryOnBusy2(
2233
+ () => client.execute("SELECT MAX(version) as max_v FROM memories"),
2234
+ "version-query"
2235
+ );
2236
+ _nextVersion = (Number(vResult.rows[0]?.max_v) || 0) + 1;
2237
+ try {
2238
+ const { loadGlobalProcedures: loadGlobalProcedures2 } = await Promise.resolve().then(() => (init_global_procedures(), global_procedures_exports));
2239
+ await loadGlobalProcedures2();
2240
+ } catch {
2241
+ }
2229
2242
  }
2230
2243
  }
2231
2244
  function classifyTier(record) {
@@ -304,6 +304,16 @@ async function initDatabase(config) {
304
304
  }
305
305
  _client = createClient(opts);
306
306
  _resilientClient = wrapWithRetry(_client);
307
+ _client.execute("PRAGMA busy_timeout = 30000").catch(() => {
308
+ });
309
+ _client.execute("PRAGMA journal_mode = WAL").catch(() => {
310
+ });
311
+ if (_walCheckpointTimer) clearInterval(_walCheckpointTimer);
312
+ _walCheckpointTimer = setInterval(() => {
313
+ _client?.execute("PRAGMA wal_checkpoint(PASSIVE)").catch(() => {
314
+ });
315
+ }, 3e4);
316
+ _walCheckpointTimer.unref();
307
317
  }
308
318
  function getClient() {
309
319
  if (!_resilientClient) {
@@ -1248,7 +1258,7 @@ async function ensureSchema() {
1248
1258
  }
1249
1259
  }
1250
1260
  }
1251
- var _client, _resilientClient, _daemonClient, initTurso;
1261
+ var _client, _resilientClient, _walCheckpointTimer, _daemonClient, initTurso;
1252
1262
  var init_database = __esm({
1253
1263
  "src/lib/database.ts"() {
1254
1264
  "use strict";
@@ -1256,6 +1266,7 @@ var init_database = __esm({
1256
1266
  init_employees();
1257
1267
  _client = null;
1258
1268
  _resilientClient = null;
1269
+ _walCheckpointTimer = null;
1259
1270
  _daemonClient = null;
1260
1271
  initTurso = initDatabase;
1261
1272
  }
@@ -2210,21 +2221,23 @@ async function initStore(options) {
2210
2221
  encryptionKey: hexKey
2211
2222
  });
2212
2223
  await retryOnBusy2(() => ensureSchema(), "ensureSchema");
2213
- try {
2214
- const { initShardManager: initShardManager2 } = await Promise.resolve().then(() => (init_shard_manager(), shard_manager_exports));
2215
- initShardManager2(hexKey);
2216
- } catch {
2217
- }
2218
- const client = getClient();
2219
- const vResult = await retryOnBusy2(
2220
- () => client.execute("SELECT MAX(version) as max_v FROM memories"),
2221
- "version-query"
2222
- );
2223
- _nextVersion = (Number(vResult.rows[0]?.max_v) || 0) + 1;
2224
- try {
2225
- const { loadGlobalProcedures: loadGlobalProcedures2 } = await Promise.resolve().then(() => (init_global_procedures(), global_procedures_exports));
2226
- await loadGlobalProcedures2();
2227
- } catch {
2224
+ if (!options?.lightweight) {
2225
+ try {
2226
+ const { initShardManager: initShardManager2 } = await Promise.resolve().then(() => (init_shard_manager(), shard_manager_exports));
2227
+ initShardManager2(hexKey);
2228
+ } catch {
2229
+ }
2230
+ const client = getClient();
2231
+ const vResult = await retryOnBusy2(
2232
+ () => client.execute("SELECT MAX(version) as max_v FROM memories"),
2233
+ "version-query"
2234
+ );
2235
+ _nextVersion = (Number(vResult.rows[0]?.max_v) || 0) + 1;
2236
+ try {
2237
+ const { loadGlobalProcedures: loadGlobalProcedures2 } = await Promise.resolve().then(() => (init_global_procedures(), global_procedures_exports));
2238
+ await loadGlobalProcedures2();
2239
+ } catch {
2240
+ }
2228
2241
  }
2229
2242
  }
2230
2243
  function classifyTier(record) {
@@ -306,6 +306,16 @@ async function initDatabase(config) {
306
306
  }
307
307
  _client = createClient(opts);
308
308
  _resilientClient = wrapWithRetry(_client);
309
+ _client.execute("PRAGMA busy_timeout = 30000").catch(() => {
310
+ });
311
+ _client.execute("PRAGMA journal_mode = WAL").catch(() => {
312
+ });
313
+ if (_walCheckpointTimer) clearInterval(_walCheckpointTimer);
314
+ _walCheckpointTimer = setInterval(() => {
315
+ _client?.execute("PRAGMA wal_checkpoint(PASSIVE)").catch(() => {
316
+ });
317
+ }, 3e4);
318
+ _walCheckpointTimer.unref();
309
319
  }
310
320
  function getClient() {
311
321
  if (!_resilientClient) {
@@ -1250,7 +1260,7 @@ async function ensureSchema() {
1250
1260
  }
1251
1261
  }
1252
1262
  }
1253
- var _client, _resilientClient, _daemonClient, initTurso;
1263
+ var _client, _resilientClient, _walCheckpointTimer, _daemonClient, initTurso;
1254
1264
  var init_database = __esm({
1255
1265
  "src/lib/database.ts"() {
1256
1266
  "use strict";
@@ -1258,6 +1268,7 @@ var init_database = __esm({
1258
1268
  init_employees();
1259
1269
  _client = null;
1260
1270
  _resilientClient = null;
1271
+ _walCheckpointTimer = null;
1261
1272
  _daemonClient = null;
1262
1273
  initTurso = initDatabase;
1263
1274
  }
@@ -2199,21 +2210,23 @@ async function initStore(options) {
2199
2210
  encryptionKey: hexKey
2200
2211
  });
2201
2212
  await retryOnBusy2(() => ensureSchema(), "ensureSchema");
2202
- try {
2203
- const { initShardManager: initShardManager2 } = await Promise.resolve().then(() => (init_shard_manager(), shard_manager_exports));
2204
- initShardManager2(hexKey);
2205
- } catch {
2206
- }
2207
- const client = getClient();
2208
- const vResult = await retryOnBusy2(
2209
- () => client.execute("SELECT MAX(version) as max_v FROM memories"),
2210
- "version-query"
2211
- );
2212
- _nextVersion = (Number(vResult.rows[0]?.max_v) || 0) + 1;
2213
- try {
2214
- const { loadGlobalProcedures: loadGlobalProcedures2 } = await Promise.resolve().then(() => (init_global_procedures(), global_procedures_exports));
2215
- await loadGlobalProcedures2();
2216
- } catch {
2213
+ if (!options?.lightweight) {
2214
+ try {
2215
+ const { initShardManager: initShardManager2 } = await Promise.resolve().then(() => (init_shard_manager(), shard_manager_exports));
2216
+ initShardManager2(hexKey);
2217
+ } catch {
2218
+ }
2219
+ const client = getClient();
2220
+ const vResult = await retryOnBusy2(
2221
+ () => client.execute("SELECT MAX(version) as max_v FROM memories"),
2222
+ "version-query"
2223
+ );
2224
+ _nextVersion = (Number(vResult.rows[0]?.max_v) || 0) + 1;
2225
+ try {
2226
+ const { loadGlobalProcedures: loadGlobalProcedures2 } = await Promise.resolve().then(() => (init_global_procedures(), global_procedures_exports));
2227
+ await loadGlobalProcedures2();
2228
+ } catch {
2229
+ }
2217
2230
  }
2218
2231
  }
2219
2232
  function vectorToBlob(vector) {
@@ -311,6 +311,16 @@ async function initDatabase(config) {
311
311
  }
312
312
  _client = createClient(opts);
313
313
  _resilientClient = wrapWithRetry(_client);
314
+ _client.execute("PRAGMA busy_timeout = 30000").catch(() => {
315
+ });
316
+ _client.execute("PRAGMA journal_mode = WAL").catch(() => {
317
+ });
318
+ if (_walCheckpointTimer) clearInterval(_walCheckpointTimer);
319
+ _walCheckpointTimer = setInterval(() => {
320
+ _client?.execute("PRAGMA wal_checkpoint(PASSIVE)").catch(() => {
321
+ });
322
+ }, 3e4);
323
+ _walCheckpointTimer.unref();
314
324
  }
315
325
  function getClient() {
316
326
  if (!_resilientClient) {
@@ -1255,7 +1265,7 @@ async function ensureSchema() {
1255
1265
  }
1256
1266
  }
1257
1267
  }
1258
- var _client, _resilientClient, _daemonClient, initTurso;
1268
+ var _client, _resilientClient, _walCheckpointTimer, _daemonClient, initTurso;
1259
1269
  var init_database = __esm({
1260
1270
  "src/lib/database.ts"() {
1261
1271
  "use strict";
@@ -1263,6 +1273,7 @@ var init_database = __esm({
1263
1273
  init_employees();
1264
1274
  _client = null;
1265
1275
  _resilientClient = null;
1276
+ _walCheckpointTimer = null;
1266
1277
  _daemonClient = null;
1267
1278
  initTurso = initDatabase;
1268
1279
  }
@@ -1768,8 +1779,21 @@ var init_session_registry = __esm({
1768
1779
 
1769
1780
  // src/lib/session-key.ts
1770
1781
  import { execSync as execSync2 } from "child_process";
1771
- function getSessionKey() {
1772
- if (_cached) return _cached;
1782
+ function normalizeCommand(command) {
1783
+ const trimmed = command.trim().toLowerCase();
1784
+ const parts = trimmed.split(/[\\/]/);
1785
+ return parts[parts.length - 1] ?? trimmed;
1786
+ }
1787
+ function detectRuntimeFromCommand(command) {
1788
+ const normalized = normalizeCommand(command);
1789
+ for (const [runtime, commands] of Object.entries(RUNTIME_COMMANDS)) {
1790
+ if (commands.includes(normalized)) {
1791
+ return runtime;
1792
+ }
1793
+ }
1794
+ return null;
1795
+ }
1796
+ function resolveRuntimeProcess() {
1773
1797
  let pid = process.ppid;
1774
1798
  for (let i = 0; i < 10; i++) {
1775
1799
  try {
@@ -1780,9 +1804,9 @@ function getSessionKey() {
1780
1804
  const match = info.match(/^\s*(\d+)\s+(.+)$/);
1781
1805
  if (!match) break;
1782
1806
  const [, ppid, cmd] = match;
1783
- if (cmd === "claude" || cmd.endsWith("/claude")) {
1784
- _cached = String(pid);
1785
- return _cached;
1807
+ const runtime = detectRuntimeFromCommand(cmd ?? "");
1808
+ if (runtime) {
1809
+ return { pid: String(pid), runtime };
1786
1810
  }
1787
1811
  pid = parseInt(ppid, 10);
1788
1812
  if (pid <= 1) break;
@@ -1790,14 +1814,34 @@ function getSessionKey() {
1790
1814
  break;
1791
1815
  }
1792
1816
  }
1817
+ return null;
1818
+ }
1819
+ function getSessionKey() {
1820
+ if (_cached) return _cached;
1821
+ if (process.env.EXE_SESSION_KEY) {
1822
+ _cached = process.env.EXE_SESSION_KEY;
1823
+ return _cached;
1824
+ }
1825
+ const resolved = resolveRuntimeProcess();
1826
+ if (resolved) {
1827
+ _cachedRuntime = resolved.runtime;
1828
+ _cached = resolved.pid;
1829
+ return _cached;
1830
+ }
1793
1831
  _cached = process.env.CLAUDE_CODE_SSE_PORT ?? String(process.ppid);
1794
1832
  return _cached;
1795
1833
  }
1796
- var _cached;
1834
+ var _cached, _cachedRuntime, RUNTIME_COMMANDS;
1797
1835
  var init_session_key = __esm({
1798
1836
  "src/lib/session-key.ts"() {
1799
1837
  "use strict";
1800
1838
  _cached = null;
1839
+ _cachedRuntime = null;
1840
+ RUNTIME_COMMANDS = {
1841
+ claude: ["claude", "claude.exe", "claude-native"],
1842
+ codex: ["codex"],
1843
+ opencode: ["opencode"]
1844
+ };
1801
1845
  }
1802
1846
  });
1803
1847
 
@@ -2225,21 +2269,23 @@ async function initStore(options) {
2225
2269
  encryptionKey: hexKey
2226
2270
  });
2227
2271
  await retryOnBusy2(() => ensureSchema(), "ensureSchema");
2228
- try {
2229
- const { initShardManager: initShardManager2 } = await Promise.resolve().then(() => (init_shard_manager(), shard_manager_exports));
2230
- initShardManager2(hexKey);
2231
- } catch {
2232
- }
2233
- const client = getClient();
2234
- const vResult = await retryOnBusy2(
2235
- () => client.execute("SELECT MAX(version) as max_v FROM memories"),
2236
- "version-query"
2237
- );
2238
- _nextVersion = (Number(vResult.rows[0]?.max_v) || 0) + 1;
2239
- try {
2240
- const { loadGlobalProcedures: loadGlobalProcedures2 } = await Promise.resolve().then(() => (init_global_procedures(), global_procedures_exports));
2241
- await loadGlobalProcedures2();
2242
- } catch {
2272
+ if (!options?.lightweight) {
2273
+ try {
2274
+ const { initShardManager: initShardManager2 } = await Promise.resolve().then(() => (init_shard_manager(), shard_manager_exports));
2275
+ initShardManager2(hexKey);
2276
+ } catch {
2277
+ }
2278
+ const client = getClient();
2279
+ const vResult = await retryOnBusy2(
2280
+ () => client.execute("SELECT MAX(version) as max_v FROM memories"),
2281
+ "version-query"
2282
+ );
2283
+ _nextVersion = (Number(vResult.rows[0]?.max_v) || 0) + 1;
2284
+ try {
2285
+ const { loadGlobalProcedures: loadGlobalProcedures2 } = await Promise.resolve().then(() => (init_global_procedures(), global_procedures_exports));
2286
+ await loadGlobalProcedures2();
2287
+ } catch {
2288
+ }
2243
2289
  }
2244
2290
  }
2245
2291