@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
@@ -113,14 +113,16 @@ var init_config = __esm({
113
113
 
114
114
  // src/lib/identity.ts
115
115
  init_config();
116
- import { existsSync as existsSync4, mkdirSync as mkdirSync2, readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "fs";
116
+ import { existsSync as existsSync5, mkdirSync as mkdirSync3, readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "fs";
117
117
  import { readdirSync } from "fs";
118
118
  import path4 from "path";
119
119
  import { createHash } from "crypto";
120
120
 
121
121
  // src/lib/database.ts
122
- import { chmodSync as chmodSync2 } from "fs";
122
+ import { chmodSync as chmodSync2, existsSync as existsSync4, statSync, copyFileSync, unlinkSync as unlinkSync2, openSync, closeSync, mkdirSync as mkdirSync2 } from "fs";
123
123
  import { createClient } from "@libsql/client";
124
+ import { homedir } from "os";
125
+ import { join } from "path";
124
126
 
125
127
  // src/lib/employees.ts
126
128
  init_config();
@@ -148,9 +150,11 @@ var BOOLEAN_COLUMN_NAMES = new Set(
148
150
  );
149
151
 
150
152
  // src/lib/database.ts
153
+ var _debugDb = process.env.EXE_DEBUG === "1";
151
154
  var _resilientClient = null;
152
155
  var _daemonClient = null;
153
156
  var _adapterClient = null;
157
+ var DB_LOCK_PATH = join(homedir(), ".exe-os", "db.lock");
154
158
  function getClient() {
155
159
  if (!_adapterClient) {
156
160
  throw new Error("Database client not initialized. Call initDatabase() first.");
@@ -173,8 +177,8 @@ function getClient() {
173
177
  // src/lib/identity.ts
174
178
  var IDENTITY_DIR2 = path4.join(EXE_AI_DIR, "identity");
175
179
  function ensureDir() {
176
- if (!existsSync4(IDENTITY_DIR2)) {
177
- mkdirSync2(IDENTITY_DIR2, { recursive: true });
180
+ if (!existsSync5(IDENTITY_DIR2)) {
181
+ mkdirSync3(IDENTITY_DIR2, { recursive: true });
178
182
  }
179
183
  }
180
184
  function identityPath(agentId) {
@@ -222,7 +226,7 @@ function contentHash(content) {
222
226
  }
223
227
  function getIdentity(agentId) {
224
228
  const filePath = identityPath(agentId);
225
- if (!existsSync4(filePath)) return null;
229
+ if (!existsSync5(filePath)) return null;
226
230
  const raw = readFileSync3(filePath, "utf-8");
227
231
  const { frontmatter, body } = parseFrontmatter(raw);
228
232
  return {
@@ -212,8 +212,10 @@ var init_memory = __esm({
212
212
  });
213
213
 
214
214
  // src/lib/database.ts
215
- import { chmodSync as chmodSync2 } from "fs";
215
+ import { chmodSync as chmodSync2, existsSync as existsSync4, statSync, copyFileSync, unlinkSync as unlinkSync2, openSync, closeSync, mkdirSync as mkdirSync2 } from "fs";
216
216
  import { createClient } from "@libsql/client";
217
+ import { homedir } from "os";
218
+ import { join } from "path";
217
219
  function getClient() {
218
220
  if (!_adapterClient) {
219
221
  throw new Error("Database client not initialized. Call initDatabase() first.");
@@ -232,7 +234,7 @@ function getClient() {
232
234
  }
233
235
  return _resilientClient;
234
236
  }
235
- var _resilientClient, _daemonClient, _adapterClient;
237
+ var _debugDb, _resilientClient, _daemonClient, _adapterClient, DB_LOCK_PATH;
236
238
  var init_database = __esm({
237
239
  "src/lib/database.ts"() {
238
240
  "use strict";
@@ -240,9 +242,11 @@ var init_database = __esm({
240
242
  init_employees();
241
243
  init_database_adapter();
242
244
  init_memory();
245
+ _debugDb = process.env.EXE_DEBUG === "1";
243
246
  _resilientClient = null;
244
247
  _daemonClient = null;
245
248
  _adapterClient = null;
249
+ DB_LOCK_PATH = join(homedir(), ".exe-os", "db.lock");
246
250
  }
247
251
  });
248
252
 
@@ -499,10 +503,10 @@ var init_runtime_table = __esm({
499
503
  });
500
504
 
501
505
  // src/lib/agent-config.ts
502
- import { readFileSync as readFileSync3, writeFileSync as writeFileSync2, existsSync as existsSync4 } from "fs";
506
+ import { readFileSync as readFileSync3, writeFileSync as writeFileSync2, existsSync as existsSync5 } from "fs";
503
507
  import path5 from "path";
504
508
  function loadAgentConfig() {
505
- if (!existsSync4(AGENT_CONFIG_PATH)) return {};
509
+ if (!existsSync5(AGENT_CONFIG_PATH)) return {};
506
510
  try {
507
511
  return JSON.parse(readFileSync3(AGENT_CONFIG_PATH, "utf-8"));
508
512
  } catch {
@@ -534,16 +538,16 @@ var init_agent_config = __esm({
534
538
  });
535
539
 
536
540
  // src/lib/intercom-queue.ts
537
- import { readFileSync as readFileSync4, writeFileSync as writeFileSync3, renameSync as renameSync3, existsSync as existsSync5, mkdirSync as mkdirSync2 } from "fs";
541
+ import { readFileSync as readFileSync4, writeFileSync as writeFileSync3, renameSync as renameSync3, existsSync as existsSync6, mkdirSync as mkdirSync3 } from "fs";
538
542
  import path6 from "path";
539
543
  import os5 from "os";
540
544
  function ensureDir() {
541
545
  const dir = path6.dirname(QUEUE_PATH);
542
- if (!existsSync5(dir)) mkdirSync2(dir, { recursive: true });
546
+ if (!existsSync6(dir)) mkdirSync3(dir, { recursive: true });
543
547
  }
544
548
  function readQueue() {
545
549
  try {
546
- if (!existsSync5(QUEUE_PATH)) return [];
550
+ if (!existsSync6(QUEUE_PATH)) return [];
547
551
  return JSON.parse(readFileSync4(QUEUE_PATH, "utf8"));
548
552
  } catch {
549
553
  return [];
@@ -583,7 +587,7 @@ var init_intercom_queue = __esm({
583
587
  });
584
588
 
585
589
  // src/lib/license.ts
586
- import { readFileSync as readFileSync5, writeFileSync as writeFileSync4, existsSync as existsSync6, mkdirSync as mkdirSync3 } from "fs";
590
+ import { readFileSync as readFileSync5, writeFileSync as writeFileSync4, existsSync as existsSync7, mkdirSync as mkdirSync4 } from "fs";
587
591
  import { randomUUID } from "crypto";
588
592
  import { createRequire as createRequire2 } from "module";
589
593
  import { pathToFileURL as pathToFileURL2 } from "url";
@@ -603,7 +607,7 @@ var init_license = __esm({
603
607
  });
604
608
 
605
609
  // src/lib/plan-limits.ts
606
- import { readFileSync as readFileSync6, existsSync as existsSync7 } from "fs";
610
+ import { readFileSync as readFileSync6, existsSync as existsSync8 } from "fs";
607
611
  import path8 from "path";
608
612
  var CACHE_PATH2;
609
613
  var init_plan_limits = __esm({
@@ -621,9 +625,9 @@ var init_plan_limits = __esm({
621
625
  import os7 from "os";
622
626
  import path9 from "path";
623
627
  import {
624
- existsSync as existsSync8,
628
+ existsSync as existsSync9,
625
629
  lstatSync,
626
- mkdirSync as mkdirSync4,
630
+ mkdirSync as mkdirSync5,
627
631
  readlinkSync as readlinkSync2,
628
632
  symlinkSync as symlinkSync2
629
633
  } from "fs";
@@ -635,7 +639,7 @@ var init_agent_symlinks = __esm({
635
639
  });
636
640
 
637
641
  // src/lib/tmux-routing.ts
638
- import { readFileSync as readFileSync7, writeFileSync as writeFileSync5, mkdirSync as mkdirSync5, existsSync as existsSync9, appendFileSync, readdirSync } from "fs";
642
+ import { readFileSync as readFileSync7, writeFileSync as writeFileSync5, mkdirSync as mkdirSync6, existsSync as existsSync10, appendFileSync, readdirSync } from "fs";
639
643
  import path10 from "path";
640
644
  import os8 from "os";
641
645
  import { fileURLToPath } from "url";
@@ -684,11 +688,13 @@ function getParentExe(sessionKey) {
684
688
  }
685
689
  }
686
690
  function resolveExeSession() {
687
- if (process.env.EXE_SESSION_NAME) {
688
- return extractRootExe(process.env.EXE_SESSION_NAME) ?? process.env.EXE_SESSION_NAME;
689
- }
690
691
  const mySession = getMySession();
691
- if (!mySession) return null;
692
+ if (!mySession) {
693
+ if (process.env.EXE_SESSION_NAME) {
694
+ return extractRootExe(process.env.EXE_SESSION_NAME) ?? process.env.EXE_SESSION_NAME;
695
+ }
696
+ return null;
697
+ }
692
698
  const fromSessionName = extractRootExe(mySession);
693
699
  let candidate = null;
694
700
  try {
@@ -748,7 +754,7 @@ function isEmployeeAlive(sessionName) {
748
754
  }
749
755
  function readDebounceState() {
750
756
  try {
751
- if (!existsSync9(DEBOUNCE_FILE)) return {};
757
+ if (!existsSync10(DEBOUNCE_FILE)) return {};
752
758
  const raw = JSON.parse(readFileSync7(DEBOUNCE_FILE, "utf8"));
753
759
  const state = {};
754
760
  for (const [key, val] of Object.entries(raw)) {
@@ -765,7 +771,7 @@ function readDebounceState() {
765
771
  }
766
772
  function writeDebounceState(state) {
767
773
  try {
768
- if (!existsSync9(SESSION_CACHE)) mkdirSync5(SESSION_CACHE, { recursive: true });
774
+ if (!existsSync10(SESSION_CACHE)) mkdirSync6(SESSION_CACHE, { recursive: true });
769
775
  writeFileSync5(DEBOUNCE_FILE, JSON.stringify(state));
770
776
  } catch {
771
777
  }
@@ -862,7 +868,7 @@ function sendIntercom(targetSession) {
862
868
  const rawAgent = targetSession.split("-")[0] ?? targetSession;
863
869
  const agent = baseAgentName(rawAgent);
864
870
  const markerPath = path10.join(SESSION_CACHE, `current-task-${agent}.json`);
865
- if (existsSync9(markerPath)) {
871
+ if (existsSync10(markerPath)) {
866
872
  logIntercom(`SKIP \u2192 ${targetSession} (has in_progress task marker + not idle \u2014 will auto-chain)`);
867
873
  return "debounced";
868
874
  }
@@ -873,7 +879,7 @@ function sendIntercom(targetSession) {
873
879
  const rawAgent = targetSession.split("-")[0] ?? targetSession;
874
880
  const agent = baseAgentName(rawAgent);
875
881
  const taskDir = path10.join(process.cwd(), "exe", agent);
876
- if (existsSync9(taskDir)) {
882
+ if (existsSync10(taskDir)) {
877
883
  const files = readdirSync(taskDir).filter(
878
884
  (f) => f.endsWith(".md") && f !== "DONE.txt"
879
885
  );
@@ -115,8 +115,10 @@ var init_config = __esm({
115
115
  import crypto from "crypto";
116
116
 
117
117
  // src/lib/database.ts
118
- import { chmodSync as chmodSync2 } from "fs";
118
+ import { chmodSync as chmodSync2, existsSync as existsSync4, statSync, copyFileSync, unlinkSync as unlinkSync2, openSync, closeSync, mkdirSync as mkdirSync2 } from "fs";
119
119
  import { createClient } from "@libsql/client";
120
+ import { homedir } from "os";
121
+ import { join } from "path";
120
122
 
121
123
  // src/lib/employees.ts
122
124
  init_config();
@@ -144,9 +146,11 @@ var BOOLEAN_COLUMN_NAMES = new Set(
144
146
  );
145
147
 
146
148
  // src/lib/database.ts
149
+ var _debugDb = process.env.EXE_DEBUG === "1";
147
150
  var _resilientClient = null;
148
151
  var _daemonClient = null;
149
152
  var _adapterClient = null;
153
+ var DB_LOCK_PATH = join(homedir(), ".exe-os", "db.lock");
150
154
  function getClient() {
151
155
  if (!_adapterClient) {
152
156
  throw new Error("Database client not initialized. Call initDatabase() first.");