@askexenow/exe-os 0.9.102 → 0.9.104

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 (92) hide show
  1. package/dist/bin/agentic-ontology-backfill.js +334 -100
  2. package/dist/bin/agentic-reflection-backfill.js +328 -97
  3. package/dist/bin/agentic-semantic-label.js +328 -97
  4. package/dist/bin/backfill-conversations.js +332 -97
  5. package/dist/bin/backfill-responses.js +332 -97
  6. package/dist/bin/backfill-vectors.js +337 -106
  7. package/dist/bin/bulk-sync-postgres.js +335 -101
  8. package/dist/bin/cleanup-stale-review-tasks.js +356 -108
  9. package/dist/bin/cli.js +653 -405
  10. package/dist/bin/exe-agent.js +21 -3
  11. package/dist/bin/exe-assign.js +338 -94
  12. package/dist/bin/exe-boot.js +472 -239
  13. package/dist/bin/exe-call.js +22 -5
  14. package/dist/bin/exe-cloud.js +404 -158
  15. package/dist/bin/exe-dispatch.js +390 -142
  16. package/dist/bin/exe-doctor.js +349 -103
  17. package/dist/bin/exe-export-behaviors.js +351 -105
  18. package/dist/bin/exe-forget.js +352 -103
  19. package/dist/bin/exe-gateway.js +420 -172
  20. package/dist/bin/exe-heartbeat.js +361 -113
  21. package/dist/bin/exe-kill.js +344 -98
  22. package/dist/bin/exe-launch-agent.js +375 -129
  23. package/dist/bin/exe-new-employee.js +83 -67
  24. package/dist/bin/exe-pending-messages.js +356 -108
  25. package/dist/bin/exe-pending-notifications.js +358 -110
  26. package/dist/bin/exe-pending-reviews.js +359 -111
  27. package/dist/bin/exe-rename.js +354 -108
  28. package/dist/bin/exe-review.js +343 -97
  29. package/dist/bin/exe-search.js +363 -113
  30. package/dist/bin/exe-session-cleanup.js +403 -155
  31. package/dist/bin/exe-settings.js +14 -9
  32. package/dist/bin/exe-start-codex.js +365 -131
  33. package/dist/bin/exe-start-opencode.js +359 -125
  34. package/dist/bin/exe-status.js +356 -108
  35. package/dist/bin/exe-team.js +343 -97
  36. package/dist/bin/git-sweep.js +390 -142
  37. package/dist/bin/graph-backfill.js +334 -100
  38. package/dist/bin/graph-export.js +346 -100
  39. package/dist/bin/install.js +1 -0
  40. package/dist/bin/intercom-check.js +403 -155
  41. package/dist/bin/pre-publish.js +12 -0
  42. package/dist/bin/scan-tasks.js +393 -145
  43. package/dist/bin/setup.js +331 -159
  44. package/dist/bin/shard-migrate.js +328 -94
  45. package/dist/gateway/index.js +406 -158
  46. package/dist/hooks/bug-report-worker.js +396 -148
  47. package/dist/hooks/codex-stop-task-finalizer.js +374 -126
  48. package/dist/hooks/commit-complete.js +390 -142
  49. package/dist/hooks/error-recall.js +365 -115
  50. package/dist/hooks/ingest.js +357 -111
  51. package/dist/hooks/instructions-loaded.js +351 -105
  52. package/dist/hooks/notification.js +343 -97
  53. package/dist/hooks/post-compact.js +358 -110
  54. package/dist/hooks/post-tool-combined.js +384 -132
  55. package/dist/hooks/pre-compact.js +391 -143
  56. package/dist/hooks/pre-tool-use.js +362 -114
  57. package/dist/hooks/prompt-submit.js +422 -170
  58. package/dist/hooks/session-end.js +393 -145
  59. package/dist/hooks/session-start.js +390 -138
  60. package/dist/hooks/stop.js +361 -113
  61. package/dist/hooks/subagent-stop.js +354 -106
  62. package/dist/hooks/summary-worker.js +418 -185
  63. package/dist/index.js +400 -152
  64. package/dist/lib/cloud-sync.js +291 -131
  65. package/dist/lib/consolidation.js +8 -2
  66. package/dist/lib/database.js +233 -73
  67. package/dist/lib/db.js +233 -73
  68. package/dist/lib/device-registry.js +237 -77
  69. package/dist/lib/employee-templates.js +19 -1
  70. package/dist/lib/exe-daemon.js +705 -409
  71. package/dist/lib/hybrid-search.js +363 -113
  72. package/dist/lib/identity.js +9 -5
  73. package/dist/lib/messaging.js +26 -20
  74. package/dist/lib/reminders.js +5 -1
  75. package/dist/lib/schedules.js +320 -89
  76. package/dist/lib/skill-learning.js +28 -24
  77. package/dist/lib/store.js +342 -96
  78. package/dist/lib/tasks.js +82 -76
  79. package/dist/lib/tmux-routing.js +74 -68
  80. package/dist/lib/token-spend.js +5 -1
  81. package/dist/mcp/server.js +628 -355
  82. package/dist/mcp/tools/complete-reminder.js +5 -1
  83. package/dist/mcp/tools/create-reminder.js +5 -1
  84. package/dist/mcp/tools/create-task.js +89 -83
  85. package/dist/mcp/tools/deactivate-behavior.js +7 -3
  86. package/dist/mcp/tools/list-reminders.js +5 -1
  87. package/dist/mcp/tools/list-tasks.js +28 -21
  88. package/dist/mcp/tools/send-message.js +28 -22
  89. package/dist/mcp/tools/update-task.js +89 -83
  90. package/dist/runtime/index.js +390 -142
  91. package/dist/tui/App.js +437 -189
  92. package/package.json +1 -1
@@ -325,7 +325,7 @@ var init_memory = __esm({
325
325
  // src/lib/daemon-auth.ts
326
326
  import crypto from "crypto";
327
327
  import path4 from "path";
328
- import { existsSync as existsSync4, readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "fs";
328
+ import { existsSync as existsSync5, readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "fs";
329
329
  function normalizeToken(token) {
330
330
  if (!token) return null;
331
331
  const trimmed = token.trim();
@@ -333,7 +333,7 @@ function normalizeToken(token) {
333
333
  }
334
334
  function readDaemonToken() {
335
335
  try {
336
- if (!existsSync4(DAEMON_TOKEN_PATH)) return null;
336
+ if (!existsSync5(DAEMON_TOKEN_PATH)) return null;
337
337
  return normalizeToken(readFileSync3(DAEMON_TOKEN_PATH, "utf8"));
338
338
  } catch {
339
339
  return null;
@@ -364,7 +364,7 @@ import net from "net";
364
364
  import os4 from "os";
365
365
  import { spawn, execSync as execSync2 } from "child_process";
366
366
  import { randomUUID } from "crypto";
367
- import { existsSync as existsSync5, unlinkSync as unlinkSync2, readFileSync as readFileSync4, openSync, closeSync, statSync } from "fs";
367
+ import { existsSync as existsSync6, unlinkSync as unlinkSync3, readFileSync as readFileSync4, openSync as openSync2, closeSync as closeSync2, statSync as statSync2 } from "fs";
368
368
  import path5 from "path";
369
369
  import { fileURLToPath } from "url";
370
370
  function handleData(chunk) {
@@ -401,7 +401,7 @@ function isZombie(pid) {
401
401
  }
402
402
  }
403
403
  function cleanupStaleFiles() {
404
- if (existsSync5(PID_PATH)) {
404
+ if (existsSync6(PID_PATH)) {
405
405
  try {
406
406
  const pid = parseInt(readFileSync4(PID_PATH, "utf8").trim(), 10);
407
407
  if (pid > 0) {
@@ -418,11 +418,11 @@ function cleanupStaleFiles() {
418
418
  } catch {
419
419
  }
420
420
  try {
421
- unlinkSync2(PID_PATH);
421
+ unlinkSync3(PID_PATH);
422
422
  } catch {
423
423
  }
424
424
  try {
425
- unlinkSync2(SOCKET_PATH);
425
+ unlinkSync3(SOCKET_PATH);
426
426
  } catch {
427
427
  }
428
428
  }
@@ -431,7 +431,7 @@ function findPackageRoot() {
431
431
  let dir = path5.dirname(fileURLToPath(import.meta.url));
432
432
  const { root } = path5.parse(dir);
433
433
  while (dir !== root) {
434
- if (existsSync5(path5.join(dir, "package.json"))) return dir;
434
+ if (existsSync6(path5.join(dir, "package.json"))) return dir;
435
435
  dir = path5.dirname(dir);
436
436
  }
437
437
  return null;
@@ -451,7 +451,7 @@ function spawnDaemon() {
451
451
  return;
452
452
  }
453
453
  const daemonPath = path5.join(pkgRoot, "dist", "lib", "exe-daemon.js");
454
- if (!existsSync5(daemonPath)) {
454
+ if (!existsSync6(daemonPath)) {
455
455
  process.stderr.write(`[exed-client] WARN: daemon script not found at ${daemonPath}
456
456
  `);
457
457
  return;
@@ -463,7 +463,7 @@ function spawnDaemon() {
463
463
  const logPath = path5.join(path5.dirname(SOCKET_PATH), "exed.log");
464
464
  let stderrFd = "ignore";
465
465
  try {
466
- stderrFd = openSync(logPath, "a");
466
+ stderrFd = openSync2(logPath, "a");
467
467
  } catch {
468
468
  }
469
469
  const heapCapMB = totalGB <= 8 ? 256 : 512;
@@ -485,27 +485,27 @@ function spawnDaemon() {
485
485
  child.unref();
486
486
  if (typeof stderrFd === "number") {
487
487
  try {
488
- closeSync(stderrFd);
488
+ closeSync2(stderrFd);
489
489
  } catch {
490
490
  }
491
491
  }
492
492
  }
493
493
  function acquireSpawnLock() {
494
494
  try {
495
- const fd = openSync(SPAWN_LOCK_PATH, "wx");
496
- closeSync(fd);
495
+ const fd = openSync2(SPAWN_LOCK_PATH, "wx");
496
+ closeSync2(fd);
497
497
  return true;
498
498
  } catch {
499
499
  try {
500
- const stat = statSync(SPAWN_LOCK_PATH);
500
+ const stat = statSync2(SPAWN_LOCK_PATH);
501
501
  if (Date.now() - stat.mtimeMs > SPAWN_LOCK_STALE_MS) {
502
502
  try {
503
- unlinkSync2(SPAWN_LOCK_PATH);
503
+ unlinkSync3(SPAWN_LOCK_PATH);
504
504
  } catch {
505
505
  }
506
506
  try {
507
- const fd = openSync(SPAWN_LOCK_PATH, "wx");
508
- closeSync(fd);
507
+ const fd = openSync2(SPAWN_LOCK_PATH, "wx");
508
+ closeSync2(fd);
509
509
  return true;
510
510
  } catch {
511
511
  }
@@ -517,7 +517,7 @@ function acquireSpawnLock() {
517
517
  }
518
518
  function releaseSpawnLock() {
519
519
  try {
520
- unlinkSync2(SPAWN_LOCK_PATH);
520
+ unlinkSync3(SPAWN_LOCK_PATH);
521
521
  } catch {
522
522
  }
523
523
  }
@@ -625,7 +625,7 @@ function killAndRespawnDaemon() {
625
625
  }
626
626
  try {
627
627
  process.stderr.write("[exed-client] Killing daemon for restart...\n");
628
- if (existsSync5(PID_PATH)) {
628
+ if (existsSync6(PID_PATH)) {
629
629
  try {
630
630
  const pid = parseInt(readFileSync4(PID_PATH, "utf8").trim(), 10);
631
631
  if (pid > 0) {
@@ -644,11 +644,11 @@ function killAndRespawnDaemon() {
644
644
  _connected = false;
645
645
  _buffer = "";
646
646
  try {
647
- unlinkSync2(PID_PATH);
647
+ unlinkSync3(PID_PATH);
648
648
  } catch {
649
649
  }
650
650
  try {
651
- unlinkSync2(SOCKET_PATH);
651
+ unlinkSync3(SOCKET_PATH);
652
652
  } catch {
653
653
  }
654
654
  spawnDaemon();
@@ -658,7 +658,7 @@ function killAndRespawnDaemon() {
658
658
  }
659
659
  function isDaemonTooYoung() {
660
660
  try {
661
- const stat = statSync(PID_PATH);
661
+ const stat = statSync2(PID_PATH);
662
662
  return Date.now() - stat.mtimeMs < MIN_DAEMON_AGE_MS;
663
663
  } catch {
664
664
  return false;
@@ -808,10 +808,10 @@ async function disposeEmbedder() {
808
808
  async function embedDirect(text) {
809
809
  const llamaCpp = await import("node-llama-cpp");
810
810
  const { MODELS_DIR: MODELS_DIR2 } = await Promise.resolve().then(() => (init_config(), config_exports));
811
- const { existsSync: existsSync6 } = await import("fs");
811
+ const { existsSync: existsSync7 } = await import("fs");
812
812
  const path6 = await import("path");
813
813
  const modelPath = path6.join(MODELS_DIR2, "jina-embeddings-v5-small-q4_k_m.gguf");
814
- if (!existsSync6(modelPath)) {
814
+ if (!existsSync7(modelPath)) {
815
815
  throw new Error(`Embedding model not found at ${modelPath}. Run '/exe-setup' to download it.`);
816
816
  }
817
817
  const llama = await llamaCpp.getLlama();
@@ -843,8 +843,10 @@ var init_embedder = __esm({
843
843
  import crypto3 from "crypto";
844
844
 
845
845
  // src/lib/database.ts
846
- import { chmodSync as chmodSync2 } from "fs";
846
+ import { chmodSync as chmodSync2, existsSync as existsSync4, statSync, copyFileSync, unlinkSync as unlinkSync2, openSync, closeSync, mkdirSync as mkdirSync2 } from "fs";
847
847
  import { createClient } from "@libsql/client";
848
+ import { homedir } from "os";
849
+ import { join } from "path";
848
850
 
849
851
  // src/lib/employees.ts
850
852
  init_config();
@@ -873,9 +875,11 @@ var BOOLEAN_COLUMN_NAMES = new Set(
873
875
 
874
876
  // src/lib/database.ts
875
877
  init_memory();
878
+ var _debugDb = process.env.EXE_DEBUG === "1";
876
879
  var _resilientClient = null;
877
880
  var _daemonClient = null;
878
881
  var _adapterClient = null;
882
+ var DB_LOCK_PATH = join(homedir(), ".exe-os", "db.lock");
879
883
  function getClient() {
880
884
  if (!_adapterClient) {
881
885
  throw new Error("Database client not initialized. Call initDatabase() first.");