@askexenow/exe-os 0.8.41 → 0.8.42

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 (74) hide show
  1. package/dist/bin/backfill-conversations.js +805 -642
  2. package/dist/bin/backfill-responses.js +804 -641
  3. package/dist/bin/backfill-vectors.js +791 -634
  4. package/dist/bin/cleanup-stale-review-tasks.js +788 -631
  5. package/dist/bin/cli.js +1326 -655
  6. package/dist/bin/exe-agent.js +20 -1
  7. package/dist/bin/exe-assign.js +1503 -1343
  8. package/dist/bin/exe-boot.js +2508 -1802
  9. package/dist/bin/exe-call.js +39 -1
  10. package/dist/bin/exe-dispatch.js +39 -2
  11. package/dist/bin/exe-doctor.js +790 -633
  12. package/dist/bin/exe-export-behaviors.js +792 -637
  13. package/dist/bin/exe-forget.js +145 -0
  14. package/dist/bin/exe-gateway.js +2487 -1878
  15. package/dist/bin/exe-heartbeat.js +147 -1
  16. package/dist/bin/exe-kill.js +795 -640
  17. package/dist/bin/exe-launch-agent.js +2168 -2008
  18. package/dist/bin/exe-link.js +9 -1
  19. package/dist/bin/exe-new-employee.js +6 -2
  20. package/dist/bin/exe-pending-messages.js +146 -1
  21. package/dist/bin/exe-pending-notifications.js +788 -631
  22. package/dist/bin/exe-pending-reviews.js +147 -1
  23. package/dist/bin/exe-rename.js +23 -0
  24. package/dist/bin/exe-review.js +490 -327
  25. package/dist/bin/exe-search.js +154 -3
  26. package/dist/bin/exe-session-cleanup.js +2466 -413
  27. package/dist/bin/exe-status.js +474 -317
  28. package/dist/bin/exe-team.js +474 -317
  29. package/dist/bin/git-sweep.js +2690 -150
  30. package/dist/bin/graph-backfill.js +794 -637
  31. package/dist/bin/graph-export.js +798 -641
  32. package/dist/bin/scan-tasks.js +2951 -44
  33. package/dist/bin/setup.js +47 -25
  34. package/dist/bin/shard-migrate.js +792 -637
  35. package/dist/bin/wiki-sync.js +794 -637
  36. package/dist/gateway/index.js +2504 -1895
  37. package/dist/hooks/bug-report-worker.js +2118 -576
  38. package/dist/hooks/commit-complete.js +2689 -149
  39. package/dist/hooks/error-recall.js +154 -3
  40. package/dist/hooks/ingest-worker.js +1420 -814
  41. package/dist/hooks/instructions-loaded.js +151 -0
  42. package/dist/hooks/notification.js +153 -2
  43. package/dist/hooks/post-compact.js +164 -0
  44. package/dist/hooks/pre-compact.js +3073 -101
  45. package/dist/hooks/pre-tool-use.js +151 -0
  46. package/dist/hooks/prompt-ingest-worker.js +1700 -1541
  47. package/dist/hooks/prompt-submit.js +2658 -1113
  48. package/dist/hooks/response-ingest-worker.js +151 -5
  49. package/dist/hooks/session-end.js +153 -2
  50. package/dist/hooks/session-start.js +154 -3
  51. package/dist/hooks/stop.js +151 -0
  52. package/dist/hooks/subagent-stop.js +151 -0
  53. package/dist/hooks/summary-worker.js +160 -6
  54. package/dist/index.js +278 -100
  55. package/dist/lib/cloud-sync.js +9 -1
  56. package/dist/lib/consolidation.js +69 -2
  57. package/dist/lib/database.js +19 -0
  58. package/dist/lib/device-registry.js +19 -0
  59. package/dist/lib/employee-templates.js +20 -1
  60. package/dist/lib/exe-daemon.js +236 -16
  61. package/dist/lib/hybrid-search.js +154 -3
  62. package/dist/lib/messaging.js +39 -2
  63. package/dist/lib/schedules.js +792 -637
  64. package/dist/lib/store.js +796 -636
  65. package/dist/lib/tasks.js +1614 -1091
  66. package/dist/lib/tmux-routing.js +149 -9
  67. package/dist/mcp/server.js +1810 -1137
  68. package/dist/mcp/tools/create-task.js +2280 -828
  69. package/dist/mcp/tools/list-tasks.js +2788 -159
  70. package/dist/mcp/tools/send-message.js +39 -2
  71. package/dist/mcp/tools/update-task.js +64 -0
  72. package/dist/runtime/index.js +235 -67
  73. package/dist/tui/App.js +1440 -646
  74. package/package.json +3 -2
@@ -243,6 +243,42 @@ var init_employees = __esm({
243
243
  }
244
244
  });
245
245
 
246
+ // src/lib/db-retry.ts
247
+ var init_db_retry = __esm({
248
+ "src/lib/db-retry.ts"() {
249
+ "use strict";
250
+ }
251
+ });
252
+
253
+ // src/lib/database.ts
254
+ import { createClient } from "@libsql/client";
255
+ var init_database = __esm({
256
+ "src/lib/database.ts"() {
257
+ "use strict";
258
+ init_db_retry();
259
+ }
260
+ });
261
+
262
+ // src/lib/global-procedures.ts
263
+ import { randomUUID } from "crypto";
264
+ function getGlobalProceduresBlock() {
265
+ if (!_cacheLoaded) return "";
266
+ if (!_cache) return "";
267
+ return `## Organization-Wide Procedures (MANDATORY \u2014 supersedes all other rules)
268
+
269
+ ${_cache}
270
+ `;
271
+ }
272
+ var _cache, _cacheLoaded;
273
+ var init_global_procedures = __esm({
274
+ "src/lib/global-procedures.ts"() {
275
+ "use strict";
276
+ init_database();
277
+ _cache = "";
278
+ _cacheLoaded = false;
279
+ }
280
+ });
281
+
246
282
  // src/lib/employee-templates.ts
247
283
  var employee_templates_exports = {};
248
284
  __export(employee_templates_exports, {
@@ -261,7 +297,8 @@ __export(employee_templates_exports, {
261
297
  function getSessionPrompt(storedPrompt) {
262
298
  const markerIndex = storedPrompt.indexOf(PROCEDURES_MARKER);
263
299
  const rolePrompt = markerIndex >= 0 ? storedPrompt.slice(0, markerIndex).trimEnd() : storedPrompt;
264
- return `${rolePrompt}
300
+ const globalBlock = getGlobalProceduresBlock();
301
+ return `${globalBlock}${rolePrompt}
265
302
  ${BASE_OPERATING_PROCEDURES}`;
266
303
  }
267
304
  function buildCustomEmployeePrompt(name, role) {
@@ -301,6 +338,7 @@ var BASE_OPERATING_PROCEDURES, DEFAULT_EXE, TEMPLATE_VERSION, PROCEDURES_MARKER,
301
338
  var init_employee_templates = __esm({
302
339
  "src/lib/employee-templates.ts"() {
303
340
  "use strict";
341
+ init_global_procedures();
304
342
  BASE_OPERATING_PROCEDURES = `
305
343
  EXE OS \u2014 VISION AND NON-NEGOTIABLE PRINCIPLES (above all work):
306
344
 
@@ -624,8 +624,28 @@ function getMySession() {
624
624
  return getTransport().getMySession();
625
625
  }
626
626
  function employeeSessionName(employee, exeSession2, instance) {
627
+ if (!/^exe\d+$/.test(exeSession2)) {
628
+ const root = extractRootExe(exeSession2);
629
+ if (root) {
630
+ process.stderr.write(
631
+ `[tmux-routing] WARN: exeSession="${exeSession2}" is not a root exe session, using "${root}" instead
632
+ `
633
+ );
634
+ exeSession2 = root;
635
+ } else {
636
+ throw new Error(
637
+ `Invalid exeSession "${exeSession2}" \u2014 must be a root exe session (e.g., "exe1"), not an agent session`
638
+ );
639
+ }
640
+ }
627
641
  const suffix = instance != null && instance > 0 ? String(instance) : "";
628
- return `${employee}${suffix}-${exeSession2}`;
642
+ const name = `${employee}${suffix}-${exeSession2}`;
643
+ if (!VALID_SESSION_NAME.test(name)) {
644
+ throw new Error(
645
+ `Invalid session name "${name}" \u2014 must match {agent}-exe{N} or {agent}{instance}-exe{N}`
646
+ );
647
+ }
648
+ return name;
629
649
  }
630
650
  function extractRootExe(name) {
631
651
  const match = name.match(/(exe\d+)$/);
@@ -784,6 +804,22 @@ function ensureEmployee(employeeName2, exeSession2, projectDir2, opts) {
784
804
  error: `Error: pass employee name ('${bare}'), not session name ('${employeeName2}')`
785
805
  };
786
806
  }
807
+ if (!/^exe\d+$/.test(exeSession2)) {
808
+ const root = extractRootExe(exeSession2);
809
+ if (root) {
810
+ process.stderr.write(
811
+ `[ensureEmployee] WARN: caller passed exeSession="${exeSession2}" (not a root exe). Auto-correcting to "${root}".
812
+ `
813
+ );
814
+ exeSession2 = root;
815
+ } else {
816
+ return {
817
+ status: "failed",
818
+ sessionName: "",
819
+ error: `Invalid exeSession "${exeSession2}" \u2014 must be a root exe session (e.g., "exe1")`
820
+ };
821
+ }
822
+ }
787
823
  let effectiveInstance = opts?.instance;
788
824
  if (effectiveInstance === void 0 && opts?.autoInstance) {
789
825
  const free = findFreeInstance(
@@ -1030,7 +1066,7 @@ function spawnEmployee(employeeName2, exeSession2, projectDir2, opts) {
1030
1066
  releaseSpawnLock(sessionName);
1031
1067
  return { sessionName };
1032
1068
  }
1033
- var SPAWN_LOCK_DIR, SESSION_CACHE, BEHAVIORS_EXPORT_TIMEOUT_MS, INTERCOM_DEBOUNCE_MS, INTERCOM_LOG2, DEBOUNCE_FILE, DEBOUNCE_CLEANUP_AGE_MS, BUSY_PATTERN;
1069
+ var SPAWN_LOCK_DIR, SESSION_CACHE, BEHAVIORS_EXPORT_TIMEOUT_MS, VALID_SESSION_NAME, INTERCOM_DEBOUNCE_MS, INTERCOM_LOG2, DEBOUNCE_FILE, DEBOUNCE_CLEANUP_AGE_MS, BUSY_PATTERN;
1034
1070
  var init_tmux_routing = __esm({
1035
1071
  "src/lib/tmux-routing.ts"() {
1036
1072
  "use strict";
@@ -1045,6 +1081,7 @@ var init_tmux_routing = __esm({
1045
1081
  SPAWN_LOCK_DIR = path7.join(os4.homedir(), ".exe-os", "spawn-locks");
1046
1082
  SESSION_CACHE = path7.join(os4.homedir(), ".exe-os", "session-cache");
1047
1083
  BEHAVIORS_EXPORT_TIMEOUT_MS = 1e4;
1084
+ VALID_SESSION_NAME = /^[a-z]+-exe\d+$|^[a-z]+\d+-exe\d+$/;
1048
1085
  INTERCOM_DEBOUNCE_MS = 3e4;
1049
1086
  INTERCOM_LOG2 = path7.join(os4.homedir(), ".exe-os", "intercom.log");
1050
1087
  DEBOUNCE_FILE = path7.join(SESSION_CACHE, "intercom-debounce.json");