@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
@@ -118,8 +118,10 @@ import { z } from "zod";
118
118
  import crypto from "crypto";
119
119
 
120
120
  // src/lib/database.ts
121
- import { chmodSync as chmodSync2 } from "fs";
121
+ import { chmodSync as chmodSync2, existsSync as existsSync4, statSync, copyFileSync, unlinkSync as unlinkSync2, openSync, closeSync, mkdirSync as mkdirSync2 } from "fs";
122
122
  import { createClient } from "@libsql/client";
123
+ import { homedir } from "os";
124
+ import { join } from "path";
123
125
 
124
126
  // src/lib/employees.ts
125
127
  init_config();
@@ -147,9 +149,11 @@ var BOOLEAN_COLUMN_NAMES = new Set(
147
149
  );
148
150
 
149
151
  // src/lib/database.ts
152
+ var _debugDb = process.env.EXE_DEBUG === "1";
150
153
  var _resilientClient = null;
151
154
  var _daemonClient = null;
152
155
  var _adapterClient = null;
156
+ var DB_LOCK_PATH = join(homedir(), ".exe-os", "db.lock");
153
157
  function getClient() {
154
158
  if (!_adapterClient) {
155
159
  throw new Error("Database client not initialized. Call initDatabase() first.");
@@ -201,8 +201,10 @@ var init_memory = __esm({
201
201
  });
202
202
 
203
203
  // src/lib/database.ts
204
- import { chmodSync as chmodSync2 } from "fs";
204
+ import { chmodSync as chmodSync2, existsSync as existsSync4, statSync, copyFileSync, unlinkSync as unlinkSync2, openSync, closeSync, mkdirSync as mkdirSync2 } from "fs";
205
205
  import { createClient } from "@libsql/client";
206
+ import { homedir } from "os";
207
+ import { join } from "path";
206
208
  function getClient() {
207
209
  if (!_adapterClient) {
208
210
  throw new Error("Database client not initialized. Call initDatabase() first.");
@@ -221,7 +223,7 @@ function getClient() {
221
223
  }
222
224
  return _resilientClient;
223
225
  }
224
- var _resilientClient, _daemonClient, _adapterClient;
226
+ var _debugDb, _resilientClient, _daemonClient, _adapterClient, DB_LOCK_PATH;
225
227
  var init_database = __esm({
226
228
  "src/lib/database.ts"() {
227
229
  "use strict";
@@ -229,9 +231,11 @@ var init_database = __esm({
229
231
  init_employees();
230
232
  init_database_adapter();
231
233
  init_memory();
234
+ _debugDb = process.env.EXE_DEBUG === "1";
232
235
  _resilientClient = null;
233
236
  _daemonClient = null;
234
237
  _adapterClient = null;
238
+ DB_LOCK_PATH = join(homedir(), ".exe-os", "db.lock");
235
239
  }
236
240
  });
237
241
 
@@ -487,7 +491,7 @@ var init_runtime_table = __esm({
487
491
  });
488
492
 
489
493
  // src/lib/agent-config.ts
490
- import { readFileSync as readFileSync3, writeFileSync as writeFileSync2, existsSync as existsSync4 } from "fs";
494
+ import { readFileSync as readFileSync3, writeFileSync as writeFileSync2, existsSync as existsSync5 } from "fs";
491
495
  import path5 from "path";
492
496
  var AGENT_CONFIG_PATH, DEFAULT_MODELS;
493
497
  var init_agent_config = __esm({
@@ -506,7 +510,7 @@ var init_agent_config = __esm({
506
510
  });
507
511
 
508
512
  // src/lib/intercom-queue.ts
509
- import { readFileSync as readFileSync4, writeFileSync as writeFileSync3, renameSync as renameSync3, existsSync as existsSync5, mkdirSync as mkdirSync2 } from "fs";
513
+ import { readFileSync as readFileSync4, writeFileSync as writeFileSync3, renameSync as renameSync3, existsSync as existsSync6, mkdirSync as mkdirSync3 } from "fs";
510
514
  import path6 from "path";
511
515
  import os5 from "os";
512
516
  var QUEUE_PATH, TTL_MS, INTERCOM_LOG;
@@ -520,7 +524,7 @@ var init_intercom_queue = __esm({
520
524
  });
521
525
 
522
526
  // src/lib/license.ts
523
- import { readFileSync as readFileSync5, writeFileSync as writeFileSync4, existsSync as existsSync6, mkdirSync as mkdirSync3 } from "fs";
527
+ import { readFileSync as readFileSync5, writeFileSync as writeFileSync4, existsSync as existsSync7, mkdirSync as mkdirSync4 } from "fs";
524
528
  import { randomUUID } from "crypto";
525
529
  import { createRequire as createRequire2 } from "module";
526
530
  import { pathToFileURL as pathToFileURL2 } from "url";
@@ -540,7 +544,7 @@ var init_license = __esm({
540
544
  });
541
545
 
542
546
  // src/lib/plan-limits.ts
543
- import { readFileSync as readFileSync6, existsSync as existsSync7 } from "fs";
547
+ import { readFileSync as readFileSync6, existsSync as existsSync8 } from "fs";
544
548
  import path8 from "path";
545
549
  var CACHE_PATH2;
546
550
  var init_plan_limits = __esm({
@@ -558,9 +562,9 @@ var init_plan_limits = __esm({
558
562
  import os7 from "os";
559
563
  import path9 from "path";
560
564
  import {
561
- existsSync as existsSync8,
565
+ existsSync as existsSync9,
562
566
  lstatSync,
563
- mkdirSync as mkdirSync4,
567
+ mkdirSync as mkdirSync5,
564
568
  readlinkSync as readlinkSync2,
565
569
  symlinkSync as symlinkSync2
566
570
  } from "fs";
@@ -572,7 +576,7 @@ var init_agent_symlinks = __esm({
572
576
  });
573
577
 
574
578
  // src/lib/tmux-routing.ts
575
- import { readFileSync as readFileSync7, writeFileSync as writeFileSync5, mkdirSync as mkdirSync5, existsSync as existsSync9, appendFileSync, readdirSync } from "fs";
579
+ import { readFileSync as readFileSync7, writeFileSync as writeFileSync5, mkdirSync as mkdirSync6, existsSync as existsSync10, appendFileSync, readdirSync } from "fs";
576
580
  import path10 from "path";
577
581
  import os8 from "os";
578
582
  import { fileURLToPath } from "url";
@@ -597,11 +601,13 @@ function getParentExe(sessionKey) {
597
601
  }
598
602
  }
599
603
  function resolveExeSession() {
600
- if (process.env.EXE_SESSION_NAME) {
601
- return extractRootExe(process.env.EXE_SESSION_NAME) ?? process.env.EXE_SESSION_NAME;
602
- }
603
604
  const mySession = getMySession();
604
- if (!mySession) return null;
605
+ if (!mySession) {
606
+ if (process.env.EXE_SESSION_NAME) {
607
+ return extractRootExe(process.env.EXE_SESSION_NAME) ?? process.env.EXE_SESSION_NAME;
608
+ }
609
+ return null;
610
+ }
605
611
  const fromSessionName = extractRootExe(mySession);
606
612
  let candidate = null;
607
613
  try {
@@ -711,8 +717,8 @@ import os9 from "os";
711
717
  import {
712
718
  readFileSync as readFileSync8,
713
719
  readdirSync as readdirSync2,
714
- unlinkSync as unlinkSync2,
715
- existsSync as existsSync10,
720
+ unlinkSync as unlinkSync3,
721
+ existsSync as existsSync11,
716
722
  rmdirSync
717
723
  } from "fs";
718
724
  var init_notifications = __esm({
@@ -784,7 +790,7 @@ import path12 from "path";
784
790
  import os10 from "os";
785
791
  import { execSync as execSync4 } from "child_process";
786
792
  import { mkdir as mkdir3, writeFile as writeFile3, appendFile } from "fs/promises";
787
- import { existsSync as existsSync11, readFileSync as readFileSync9 } from "fs";
793
+ import { existsSync as existsSync12, readFileSync as readFileSync9 } from "fs";
788
794
  function buildKeywordIndex() {
789
795
  const idx = /* @__PURE__ */ new Map();
790
796
  for (const [role, keywords] of Object.entries(LANE_KEYWORDS)) {
@@ -869,7 +875,7 @@ var init_tasks_crud = __esm({
869
875
 
870
876
  // src/lib/tasks-review.ts
871
877
  import path13 from "path";
872
- import { existsSync as existsSync12, readdirSync as readdirSync3, unlinkSync as unlinkSync3 } from "fs";
878
+ import { existsSync as existsSync13, readdirSync as readdirSync3, unlinkSync as unlinkSync4 } from "fs";
873
879
  var init_tasks_review = __esm({
874
880
  "src/lib/tasks-review.ts"() {
875
881
  "use strict";
@@ -910,7 +916,7 @@ var init_tasks_notify = __esm({
910
916
 
911
917
  // src/lib/tasks.ts
912
918
  import path15 from "path";
913
- import { writeFileSync as writeFileSync6, mkdirSync as mkdirSync6, unlinkSync as unlinkSync4 } from "fs";
919
+ import { writeFileSync as writeFileSync6, mkdirSync as mkdirSync7, unlinkSync as unlinkSync5 } from "fs";
914
920
  var init_tasks = __esm({
915
921
  "src/lib/tasks.ts"() {
916
922
  "use strict";
@@ -978,7 +984,7 @@ import { z } from "zod";
978
984
  // src/lib/active-agent.ts
979
985
  init_config();
980
986
  init_session_key();
981
- import { readFileSync as readFileSync10, writeFileSync as writeFileSync7, mkdirSync as mkdirSync7, unlinkSync as unlinkSync5, readdirSync as readdirSync4 } from "fs";
987
+ import { readFileSync as readFileSync10, writeFileSync as writeFileSync7, mkdirSync as mkdirSync8, unlinkSync as unlinkSync6, readdirSync as readdirSync4 } from "fs";
982
988
  import { execSync as execSync6 } from "child_process";
983
989
  import path17 from "path";
984
990
 
@@ -1050,7 +1056,7 @@ function getActiveAgent() {
1050
1056
  const age = Date.now() - new Date(data.startedAt).getTime();
1051
1057
  if (age > STALE_MS) {
1052
1058
  try {
1053
- unlinkSync5(markerPath);
1059
+ unlinkSync6(markerPath);
1054
1060
  } catch {
1055
1061
  }
1056
1062
  } else {
@@ -1127,7 +1133,8 @@ function registerListTasks(server) {
1127
1133
  const pct = Math.round(t.tokensUsed / t.budgetTokens * 100);
1128
1134
  budgetNote = ` [${t.tokensUsed}/${t.budgetTokens} tokens, ${pct}%]`;
1129
1135
  }
1130
- return `- [${t.priority.toUpperCase()}] ${t.title} (${t.projectName}) \u2014 ${t.status}${cpIndicator}${budgetNote} \u2192 ${t.assignedTo}`;
1136
+ const shortId = t.id.slice(0, 8);
1137
+ return `- [${t.priority.toUpperCase()}] ${t.title} (${t.projectName}) \u2014 ${t.status}${cpIndicator}${budgetNote} \u2192 ${t.assignedTo} [id:${shortId}]`;
1131
1138
  });
1132
1139
  return {
1133
1140
  content: [
@@ -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
  );
@@ -1120,7 +1126,7 @@ async function markFailed(messageId, reason, sessionScope) {
1120
1126
  // src/lib/active-agent.ts
1121
1127
  init_config();
1122
1128
  init_session_key();
1123
- import { readFileSync as readFileSync8, writeFileSync as writeFileSync6, mkdirSync as mkdirSync6, unlinkSync as unlinkSync2, readdirSync as readdirSync2 } from "fs";
1129
+ import { readFileSync as readFileSync8, writeFileSync as writeFileSync6, mkdirSync as mkdirSync7, unlinkSync as unlinkSync3, readdirSync as readdirSync2 } from "fs";
1124
1130
  import { execSync as execSync4 } from "child_process";
1125
1131
  import path11 from "path";
1126
1132
 
@@ -1192,7 +1198,7 @@ function getActiveAgent() {
1192
1198
  const age = Date.now() - new Date(data.startedAt).getTime();
1193
1199
  if (age > STALE_MS) {
1194
1200
  try {
1195
- unlinkSync2(markerPath);
1201
+ unlinkSync3(markerPath);
1196
1202
  } catch {
1197
1203
  }
1198
1204
  } else {