@askexenow/exe-os 0.9.4 → 0.9.6

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.
@@ -2071,7 +2071,7 @@ var init_plan_limits = __esm({
2071
2071
  });
2072
2072
 
2073
2073
  // src/lib/tmux-routing.ts
2074
- import { readFileSync as readFileSync7, writeFileSync as writeFileSync5, mkdirSync as mkdirSync5, existsSync as existsSync9, appendFileSync } from "fs";
2074
+ import { readFileSync as readFileSync7, writeFileSync as writeFileSync5, mkdirSync as mkdirSync5, existsSync as existsSync9, appendFileSync, readdirSync as readdirSync2 } from "fs";
2075
2075
  import path10 from "path";
2076
2076
  import os6 from "os";
2077
2077
  import { fileURLToPath } from "url";
package/dist/bin/cli.js CHANGED
@@ -10423,7 +10423,7 @@ __export(tmux_routing_exports, {
10423
10423
  verifyPaneAtCapacity: () => verifyPaneAtCapacity
10424
10424
  });
10425
10425
  import { execFileSync as execFileSync2, execSync as execSync8 } from "child_process";
10426
- import { readFileSync as readFileSync18, writeFileSync as writeFileSync14, mkdirSync as mkdirSync15, existsSync as existsSync21, appendFileSync as appendFileSync2 } from "fs";
10426
+ import { readFileSync as readFileSync18, writeFileSync as writeFileSync14, mkdirSync as mkdirSync15, existsSync as existsSync21, appendFileSync as appendFileSync2, readdirSync as readdirSync6 } from "fs";
10427
10427
  import path26 from "path";
10428
10428
  import os13 from "os";
10429
10429
  import { fileURLToPath as fileURLToPath4 } from "url";
@@ -10744,6 +10744,24 @@ function sendIntercom(targetSession) {
10744
10744
  }
10745
10745
  } catch {
10746
10746
  }
10747
+ try {
10748
+ const rawAgent = targetSession.split("-")[0] ?? targetSession;
10749
+ const agent = baseAgentName(rawAgent);
10750
+ const taskDir = path26.join(process.cwd(), "exe", agent);
10751
+ if (existsSync21(taskDir)) {
10752
+ const files = readdirSync6(taskDir).filter(
10753
+ (f) => f.endsWith(".md") && f !== "DONE.txt"
10754
+ );
10755
+ if (files.length === 0) {
10756
+ logIntercom(`SKIP \u2192 ${targetSession} (no task files in exe/${agent}/ \u2014 nothing to do)`);
10757
+ return "debounced";
10758
+ }
10759
+ } else {
10760
+ logIntercom(`SKIP \u2192 ${targetSession} (no task folder exe/${agent}/ \u2014 nothing to do)`);
10761
+ return "debounced";
10762
+ }
10763
+ } catch {
10764
+ }
10747
10765
  if (transport.isPaneInCopyMode(targetSession)) {
10748
10766
  logIntercom(`COPY_MODE \u2192 ${targetSession} (exiting copy mode first)`);
10749
10767
  transport.sendKeys(targetSession, "q");
@@ -11411,7 +11429,7 @@ __export(active_agent_exports, {
11411
11429
  resolveActiveAgentFromTmuxSession: () => resolveActiveAgentFromTmuxSession,
11412
11430
  writeActiveAgent: () => writeActiveAgent
11413
11431
  });
11414
- import { readFileSync as readFileSync19, writeFileSync as writeFileSync15, mkdirSync as mkdirSync16, unlinkSync as unlinkSync9, readdirSync as readdirSync6 } from "fs";
11432
+ import { readFileSync as readFileSync19, writeFileSync as writeFileSync15, mkdirSync as mkdirSync16, unlinkSync as unlinkSync9, readdirSync as readdirSync7 } from "fs";
11415
11433
  import { execSync as execSync9 } from "child_process";
11416
11434
  import path27 from "path";
11417
11435
  function isNameWithOptionalInstance(candidate, baseName) {
@@ -11519,7 +11537,7 @@ function getActiveAgent() {
11519
11537
  }
11520
11538
  function getAllActiveAgents() {
11521
11539
  try {
11522
- const files = readdirSync6(CACHE_DIR);
11540
+ const files = readdirSync7(CACHE_DIR);
11523
11541
  const sessions = [];
11524
11542
  for (const file of files) {
11525
11543
  if (!file.startsWith("active-agent-") || !file.endsWith(".json")) continue;
@@ -13106,7 +13124,7 @@ import {
13106
13124
  writeFileSync as writeFileSync17,
13107
13125
  mkdirSync as mkdirSync17,
13108
13126
  chmodSync,
13109
- readdirSync as readdirSync7,
13127
+ readdirSync as readdirSync8,
13110
13128
  unlinkSync as unlinkSync12
13111
13129
  } from "fs";
13112
13130
  import path30 from "path";
@@ -13138,7 +13156,7 @@ function generateSessionWrappers(packageRoot, homeDir) {
13138
13156
  return { created: 0, pathConfigured: false };
13139
13157
  }
13140
13158
  try {
13141
- for (const f of readdirSync7(binDir)) {
13159
+ for (const f of readdirSync8(binDir)) {
13142
13160
  if (f === "exe-start") continue;
13143
13161
  const fPath = path30.join(binDir, f);
13144
13162
  try {
@@ -28613,7 +28631,7 @@ var init_installer3 = __esm({
28613
28631
  });
28614
28632
 
28615
28633
  // src/bin/cli.ts
28616
- import { existsSync as existsSync29, readFileSync as readFileSync26, writeFileSync as writeFileSync19, readdirSync as readdirSync8, rmSync } from "fs";
28634
+ import { existsSync as existsSync29, readFileSync as readFileSync26, writeFileSync as writeFileSync19, readdirSync as readdirSync9, rmSync } from "fs";
28617
28635
  import path43 from "path";
28618
28636
  import os18 from "os";
28619
28637
  var args = process.argv.slice(2);
@@ -29025,7 +29043,7 @@ async function runClaudeUninstall(flags = []) {
29025
29043
  if (existsSync29(skillsDir)) {
29026
29044
  let skillCount = 0;
29027
29045
  try {
29028
- const entries = readdirSync8(skillsDir);
29046
+ const entries = readdirSync9(skillsDir);
29029
29047
  for (const entry of entries) {
29030
29048
  if (entry.startsWith("exe")) {
29031
29049
  const fullPath = path43.join(skillsDir, entry);
@@ -29058,7 +29076,7 @@ async function runClaudeUninstall(flags = []) {
29058
29076
  if (existsSync29(agentsDir)) {
29059
29077
  let agentCount = 0;
29060
29078
  try {
29061
- const entries = readdirSync8(agentsDir).filter((f) => f.endsWith(".md"));
29079
+ const entries = readdirSync9(agentsDir).filter((f) => f.endsWith(".md"));
29062
29080
  let knownNames = /* @__PURE__ */ new Set();
29063
29081
  const rosterPath = path43.join(exeOsDir, "exe-employees.json");
29064
29082
  if (existsSync29(rosterPath)) {
@@ -29086,7 +29104,7 @@ async function runClaudeUninstall(flags = []) {
29086
29104
  if (existsSync29(projectsDir)) {
29087
29105
  let projectCount = 0;
29088
29106
  try {
29089
- const projects = readdirSync8(projectsDir);
29107
+ const projects = readdirSync9(projectsDir);
29090
29108
  for (const proj of projects) {
29091
29109
  const projSettings = path43.join(projectsDir, proj, "settings.json");
29092
29110
  if (!existsSync29(projSettings)) continue;
@@ -5743,7 +5743,7 @@ __export(tmux_routing_exports, {
5743
5743
  verifyPaneAtCapacity: () => verifyPaneAtCapacity
5744
5744
  });
5745
5745
  import { execFileSync as execFileSync2, execSync as execSync7 } from "child_process";
5746
- import { readFileSync as readFileSync11, writeFileSync as writeFileSync7, mkdirSync as mkdirSync7, existsSync as existsSync14, appendFileSync } from "fs";
5746
+ import { readFileSync as readFileSync11, writeFileSync as writeFileSync7, mkdirSync as mkdirSync7, existsSync as existsSync14, appendFileSync, readdirSync as readdirSync4 } from "fs";
5747
5747
  import path17 from "path";
5748
5748
  import os9 from "os";
5749
5749
  import { fileURLToPath as fileURLToPath2 } from "url";
@@ -6064,6 +6064,24 @@ function sendIntercom(targetSession) {
6064
6064
  }
6065
6065
  } catch {
6066
6066
  }
6067
+ try {
6068
+ const rawAgent = targetSession.split("-")[0] ?? targetSession;
6069
+ const agent = baseAgentName(rawAgent);
6070
+ const taskDir = path17.join(process.cwd(), "exe", agent);
6071
+ if (existsSync14(taskDir)) {
6072
+ const files = readdirSync4(taskDir).filter(
6073
+ (f) => f.endsWith(".md") && f !== "DONE.txt"
6074
+ );
6075
+ if (files.length === 0) {
6076
+ logIntercom(`SKIP \u2192 ${targetSession} (no task files in exe/${agent}/ \u2014 nothing to do)`);
6077
+ return "debounced";
6078
+ }
6079
+ } else {
6080
+ logIntercom(`SKIP \u2192 ${targetSession} (no task folder exe/${agent}/ \u2014 nothing to do)`);
6081
+ return "debounced";
6082
+ }
6083
+ } catch {
6084
+ }
6067
6085
  if (transport.isPaneInCopyMode(targetSession)) {
6068
6086
  logIntercom(`COPY_MODE \u2192 ${targetSession} (exiting copy mode first)`);
6069
6087
  transport.sendKeys(targetSession, "q");
@@ -6521,7 +6539,7 @@ __export(worker_gate_exports, {
6521
6539
  tryAcquireBackfillLock: () => tryAcquireBackfillLock,
6522
6540
  tryAcquireWorkerSlot: () => tryAcquireWorkerSlot
6523
6541
  });
6524
- import { readdirSync as readdirSync5, writeFileSync as writeFileSync9, unlinkSync as unlinkSync8, mkdirSync as mkdirSync9, existsSync as existsSync15 } from "fs";
6542
+ import { readdirSync as readdirSync6, writeFileSync as writeFileSync9, unlinkSync as unlinkSync8, mkdirSync as mkdirSync9, existsSync as existsSync15 } from "fs";
6525
6543
  import path19 from "path";
6526
6544
  function tryAcquireWorkerSlot() {
6527
6545
  try {
@@ -6529,7 +6547,7 @@ function tryAcquireWorkerSlot() {
6529
6547
  const reservationId = `res-${process.pid}-${Date.now()}`;
6530
6548
  const reservationPath = path19.join(WORKER_PID_DIR, `${reservationId}.pid`);
6531
6549
  writeFileSync9(reservationPath, String(process.pid));
6532
- const files = readdirSync5(WORKER_PID_DIR);
6550
+ const files = readdirSync6(WORKER_PID_DIR);
6533
6551
  let alive = 0;
6534
6552
  for (const f of files) {
6535
6553
  if (!f.endsWith(".pid")) continue;
@@ -6954,7 +6972,7 @@ __export(cloud_sync_exports, {
6954
6972
  mergeRosterFromRemote: () => mergeRosterFromRemote,
6955
6973
  recordRosterDeletion: () => recordRosterDeletion
6956
6974
  });
6957
- import { readFileSync as readFileSync14, writeFileSync as writeFileSync11, existsSync as existsSync17, readdirSync as readdirSync6, mkdirSync as mkdirSync11, appendFileSync as appendFileSync2, unlinkSync as unlinkSync10, openSync as openSync2, closeSync as closeSync2 } from "fs";
6975
+ import { readFileSync as readFileSync14, writeFileSync as writeFileSync11, existsSync as existsSync17, readdirSync as readdirSync7, mkdirSync as mkdirSync11, appendFileSync as appendFileSync2, unlinkSync as unlinkSync10, openSync as openSync2, closeSync as closeSync2 } from "fs";
6958
6976
  import crypto7 from "crypto";
6959
6977
  import path21 from "path";
6960
6978
  import { homedir as homedir2 } from "os";
@@ -7360,7 +7378,7 @@ async function cloudSync(config) {
7360
7378
  rosterResult.employees = employees.length;
7361
7379
  const idDir = path21.join(EXE_AI_DIR, "identity");
7362
7380
  if (existsSync17(idDir)) {
7363
- rosterResult.identities = readdirSync6(idDir).filter((f) => f.endsWith(".md")).length;
7381
+ rosterResult.identities = readdirSync7(idDir).filter((f) => f.endsWith(".md")).length;
7364
7382
  }
7365
7383
  } catch {
7366
7384
  }
@@ -7411,7 +7429,7 @@ function buildRosterBlob(paths) {
7411
7429
  }
7412
7430
  const identities = {};
7413
7431
  if (existsSync17(identityDir)) {
7414
- for (const file of readdirSync6(identityDir).filter((f) => f.endsWith(".md"))) {
7432
+ for (const file of readdirSync7(identityDir).filter((f) => f.endsWith(".md"))) {
7415
7433
  try {
7416
7434
  identities[file] = readFileSync14(path21.join(identityDir, file), "utf-8");
7417
7435
  } catch {
@@ -8209,7 +8227,7 @@ var init_schedules = __esm({
8209
8227
  init_employees();
8210
8228
  import path22 from "path";
8211
8229
  import { mkdir as mkdir5, writeFile as writeFile6 } from "fs/promises";
8212
- import { existsSync as existsSync18, readFileSync as readFileSync15, readdirSync as readdirSync7, unlinkSync as unlinkSync11 } from "fs";
8230
+ import { existsSync as existsSync18, readFileSync as readFileSync15, readdirSync as readdirSync8, unlinkSync as unlinkSync11 } from "fs";
8213
8231
  import os10 from "os";
8214
8232
 
8215
8233
  // src/lib/employee-templates.ts
@@ -8712,7 +8730,7 @@ init_notifications();
8712
8730
  init_config();
8713
8731
  init_session_key();
8714
8732
  init_employees();
8715
- import { readFileSync as readFileSync12, writeFileSync as writeFileSync8, mkdirSync as mkdirSync8, unlinkSync as unlinkSync7, readdirSync as readdirSync4 } from "fs";
8733
+ import { readFileSync as readFileSync12, writeFileSync as writeFileSync8, mkdirSync as mkdirSync8, unlinkSync as unlinkSync7, readdirSync as readdirSync5 } from "fs";
8716
8734
  import { execSync as execSync8 } from "child_process";
8717
8735
  import path18 from "path";
8718
8736
  var CACHE_DIR = path18.join(EXE_AI_DIR, "session-cache");
@@ -8819,18 +8837,18 @@ async function boot(options) {
8819
8837
  } catch {
8820
8838
  }
8821
8839
  try {
8822
- const { readdirSync: readdirSync8, readFileSync: readFs } = await import("fs");
8840
+ const { readdirSync: readdirSync9, readFileSync: readFs } = await import("fs");
8823
8841
  const { STATUS_RE: STATUS_RE2, PRIORITY_RE: PRIORITY_RE2, TITLE_RE: TITLE_RE2 } = await Promise.resolve().then(() => (init_task_scanner(), task_scanner_exports));
8824
8842
  const { getProjectName: getProjectName2 } = await Promise.resolve().then(() => (init_project_name(), project_name_exports));
8825
8843
  const exeDir = "exe";
8826
- const entries = readdirSync8(exeDir, { withFileTypes: true });
8844
+ const entries = readdirSync9(exeDir, { withFileTypes: true });
8827
8845
  const employeeDirs = entries.filter((e) => e.isDirectory() && !["output", "research"].includes(e.name));
8828
8846
  for (const dir of employeeDirs) {
8829
8847
  const employee = dir.name;
8830
8848
  const taskDir = path22.join(exeDir, employee);
8831
8849
  let files;
8832
8850
  try {
8833
- files = readdirSync8(taskDir).filter((f) => f.endsWith(".md"));
8851
+ files = readdirSync9(taskDir).filter((f) => f.endsWith(".md"));
8834
8852
  } catch {
8835
8853
  continue;
8836
8854
  }
@@ -8926,7 +8944,7 @@ async function boot(options) {
8926
8944
  for (const reviewDirName of /* @__PURE__ */ new Set(["exe", coordinatorName])) {
8927
8945
  const reviewDir = path22.join(process.cwd(), "exe", reviewDirName);
8928
8946
  if (existsSync18(reviewDir)) {
8929
- for (const f of readdirSync7(reviewDir)) {
8947
+ for (const f of readdirSync8(reviewDir)) {
8930
8948
  if (f.startsWith("review-") && f.endsWith(".md")) {
8931
8949
  try {
8932
8950
  unlinkSync11(path22.join(reviewDir, f));
@@ -3915,7 +3915,7 @@ __export(tmux_routing_exports, {
3915
3915
  verifyPaneAtCapacity: () => verifyPaneAtCapacity
3916
3916
  });
3917
3917
  import { execFileSync as execFileSync2, execSync as execSync6 } from "child_process";
3918
- import { readFileSync as readFileSync10, writeFileSync as writeFileSync7, mkdirSync as mkdirSync6, existsSync as existsSync11, appendFileSync } from "fs";
3918
+ import { readFileSync as readFileSync10, writeFileSync as writeFileSync7, mkdirSync as mkdirSync6, existsSync as existsSync11, appendFileSync, readdirSync as readdirSync3 } from "fs";
3919
3919
  import path14 from "path";
3920
3920
  import os7 from "os";
3921
3921
  import { fileURLToPath } from "url";
@@ -4236,6 +4236,24 @@ function sendIntercom(targetSession) {
4236
4236
  }
4237
4237
  } catch {
4238
4238
  }
4239
+ try {
4240
+ const rawAgent = targetSession.split("-")[0] ?? targetSession;
4241
+ const agent = baseAgentName(rawAgent);
4242
+ const taskDir = path14.join(process.cwd(), "exe", agent);
4243
+ if (existsSync11(taskDir)) {
4244
+ const files = readdirSync3(taskDir).filter(
4245
+ (f) => f.endsWith(".md") && f !== "DONE.txt"
4246
+ );
4247
+ if (files.length === 0) {
4248
+ logIntercom(`SKIP \u2192 ${targetSession} (no task files in exe/${agent}/ \u2014 nothing to do)`);
4249
+ return "debounced";
4250
+ }
4251
+ } else {
4252
+ logIntercom(`SKIP \u2192 ${targetSession} (no task folder exe/${agent}/ \u2014 nothing to do)`);
4253
+ return "debounced";
4254
+ }
4255
+ } catch {
4256
+ }
4239
4257
  if (transport.isPaneInCopyMode(targetSession)) {
4240
4258
  logIntercom(`COPY_MODE \u2192 ${targetSession} (exiting copy mode first)`);
4241
4259
  transport.sendKeys(targetSession, "q");
@@ -4656,7 +4674,7 @@ __export(shard_manager_exports, {
4656
4674
  shardExists: () => shardExists
4657
4675
  });
4658
4676
  import path16 from "path";
4659
- import { existsSync as existsSync13, mkdirSync as mkdirSync7, readdirSync as readdirSync3 } from "fs";
4677
+ import { existsSync as existsSync13, mkdirSync as mkdirSync7, readdirSync as readdirSync4 } from "fs";
4660
4678
  import { createClient as createClient2 } from "@libsql/client";
4661
4679
  function initShardManager(encryptionKey) {
4662
4680
  _encryptionKey = encryptionKey;
@@ -4695,7 +4713,7 @@ function shardExists(projectName) {
4695
4713
  }
4696
4714
  function listShards() {
4697
4715
  if (!existsSync13(SHARDS_DIR)) return [];
4698
- return readdirSync3(SHARDS_DIR).filter((f) => f.endsWith(".db")).map((f) => f.replace(".db", ""));
4716
+ return readdirSync4(SHARDS_DIR).filter((f) => f.endsWith(".db")).map((f) => f.replace(".db", ""));
4699
4717
  }
4700
4718
  async function ensureShardSchema(client) {
4701
4719
  await client.execute("PRAGMA journal_mode = WAL");
@@ -8634,7 +8634,7 @@ __export(tmux_routing_exports, {
8634
8634
  verifyPaneAtCapacity: () => verifyPaneAtCapacity
8635
8635
  });
8636
8636
  import { execFileSync as execFileSync2, execSync as execSync6 } from "child_process";
8637
- import { readFileSync as readFileSync12, writeFileSync as writeFileSync7, mkdirSync as mkdirSync8, existsSync as existsSync14, appendFileSync } from "fs";
8637
+ import { readFileSync as readFileSync12, writeFileSync as writeFileSync7, mkdirSync as mkdirSync8, existsSync as existsSync14, appendFileSync, readdirSync as readdirSync4 } from "fs";
8638
8638
  import path18 from "path";
8639
8639
  import os10 from "os";
8640
8640
  import { fileURLToPath as fileURLToPath2 } from "url";
@@ -8955,6 +8955,24 @@ function sendIntercom(targetSession) {
8955
8955
  }
8956
8956
  } catch {
8957
8957
  }
8958
+ try {
8959
+ const rawAgent = targetSession.split("-")[0] ?? targetSession;
8960
+ const agent = baseAgentName(rawAgent);
8961
+ const taskDir = path18.join(process.cwd(), "exe", agent);
8962
+ if (existsSync14(taskDir)) {
8963
+ const files = readdirSync4(taskDir).filter(
8964
+ (f) => f.endsWith(".md") && f !== "DONE.txt"
8965
+ );
8966
+ if (files.length === 0) {
8967
+ logIntercom(`SKIP \u2192 ${targetSession} (no task files in exe/${agent}/ \u2014 nothing to do)`);
8968
+ return "debounced";
8969
+ }
8970
+ } else {
8971
+ logIntercom(`SKIP \u2192 ${targetSession} (no task folder exe/${agent}/ \u2014 nothing to do)`);
8972
+ return "debounced";
8973
+ }
8974
+ } catch {
8975
+ }
8958
8976
  if (transport.isPaneInCopyMode(targetSession)) {
8959
8977
  logIntercom(`COPY_MODE \u2192 ${targetSession} (exiting copy mode first)`);
8960
8978
  transport.sendKeys(targetSession, "q");
@@ -2108,7 +2108,7 @@ var init_plan_limits = __esm({
2108
2108
  });
2109
2109
 
2110
2110
  // src/lib/tmux-routing.ts
2111
- import { readFileSync as readFileSync8, writeFileSync as writeFileSync5, mkdirSync as mkdirSync5, existsSync as existsSync10, appendFileSync } from "fs";
2111
+ import { readFileSync as readFileSync8, writeFileSync as writeFileSync5, mkdirSync as mkdirSync5, existsSync as existsSync10, appendFileSync, readdirSync as readdirSync3 } from "fs";
2112
2112
  import path11 from "path";
2113
2113
  import os7 from "os";
2114
2114
  import { fileURLToPath as fileURLToPath2 } from "url";
@@ -2172,7 +2172,7 @@ var init_tmux_routing = __esm({
2172
2172
 
2173
2173
  // src/lib/tasks-review.ts
2174
2174
  import path12 from "path";
2175
- import { existsSync as existsSync11, readdirSync as readdirSync3, unlinkSync as unlinkSync3 } from "fs";
2175
+ import { existsSync as existsSync11, readdirSync as readdirSync4, unlinkSync as unlinkSync3 } from "fs";
2176
2176
  async function listPendingReviews(limit, sessionScope) {
2177
2177
  const client = getClient();
2178
2178
  if (sessionScope) {
@@ -5751,7 +5751,7 @@ __export(tmux_routing_exports, {
5751
5751
  verifyPaneAtCapacity: () => verifyPaneAtCapacity
5752
5752
  });
5753
5753
  import { execFileSync as execFileSync2, execSync as execSync6 } from "child_process";
5754
- import { readFileSync as readFileSync11, writeFileSync as writeFileSync7, mkdirSync as mkdirSync7, existsSync as existsSync14, appendFileSync } from "fs";
5754
+ import { readFileSync as readFileSync11, writeFileSync as writeFileSync7, mkdirSync as mkdirSync7, existsSync as existsSync14, appendFileSync, readdirSync as readdirSync4 } from "fs";
5755
5755
  import path17 from "path";
5756
5756
  import os9 from "os";
5757
5757
  import { fileURLToPath as fileURLToPath2 } from "url";
@@ -6072,6 +6072,24 @@ function sendIntercom(targetSession) {
6072
6072
  }
6073
6073
  } catch {
6074
6074
  }
6075
+ try {
6076
+ const rawAgent = targetSession.split("-")[0] ?? targetSession;
6077
+ const agent = baseAgentName(rawAgent);
6078
+ const taskDir = path17.join(process.cwd(), "exe", agent);
6079
+ if (existsSync14(taskDir)) {
6080
+ const files = readdirSync4(taskDir).filter(
6081
+ (f) => f.endsWith(".md") && f !== "DONE.txt"
6082
+ );
6083
+ if (files.length === 0) {
6084
+ logIntercom(`SKIP \u2192 ${targetSession} (no task files in exe/${agent}/ \u2014 nothing to do)`);
6085
+ return "debounced";
6086
+ }
6087
+ } else {
6088
+ logIntercom(`SKIP \u2192 ${targetSession} (no task folder exe/${agent}/ \u2014 nothing to do)`);
6089
+ return "debounced";
6090
+ }
6091
+ } catch {
6092
+ }
6075
6093
  if (transport.isPaneInCopyMode(targetSession)) {
6076
6094
  logIntercom(`COPY_MODE \u2192 ${targetSession} (exiting copy mode first)`);
6077
6095
  transport.sendKeys(targetSession, "q");
@@ -2082,7 +2082,7 @@ var init_plan_limits = __esm({
2082
2082
  });
2083
2083
 
2084
2084
  // src/lib/tmux-routing.ts
2085
- import { readFileSync as readFileSync7, writeFileSync as writeFileSync5, mkdirSync as mkdirSync5, existsSync as existsSync9, appendFileSync } from "fs";
2085
+ import { readFileSync as readFileSync7, writeFileSync as writeFileSync5, mkdirSync as mkdirSync5, existsSync as existsSync9, appendFileSync, readdirSync as readdirSync2 } from "fs";
2086
2086
  import path10 from "path";
2087
2087
  import os6 from "os";
2088
2088
  import { fileURLToPath as fileURLToPath2 } from "url";
@@ -4403,7 +4403,7 @@ __export(tmux_routing_exports, {
4403
4403
  verifyPaneAtCapacity: () => verifyPaneAtCapacity
4404
4404
  });
4405
4405
  import { execFileSync as execFileSync2, execSync as execSync6 } from "child_process";
4406
- import { readFileSync as readFileSync11, writeFileSync as writeFileSync7, mkdirSync as mkdirSync6, existsSync as existsSync12, appendFileSync } from "fs";
4406
+ import { readFileSync as readFileSync11, writeFileSync as writeFileSync7, mkdirSync as mkdirSync6, existsSync as existsSync12, appendFileSync, readdirSync as readdirSync3 } from "fs";
4407
4407
  import path15 from "path";
4408
4408
  import os8 from "os";
4409
4409
  import { fileURLToPath as fileURLToPath2 } from "url";
@@ -4724,6 +4724,24 @@ function sendIntercom(targetSession) {
4724
4724
  }
4725
4725
  } catch {
4726
4726
  }
4727
+ try {
4728
+ const rawAgent = targetSession.split("-")[0] ?? targetSession;
4729
+ const agent = baseAgentName(rawAgent);
4730
+ const taskDir = path15.join(process.cwd(), "exe", agent);
4731
+ if (existsSync12(taskDir)) {
4732
+ const files = readdirSync3(taskDir).filter(
4733
+ (f) => f.endsWith(".md") && f !== "DONE.txt"
4734
+ );
4735
+ if (files.length === 0) {
4736
+ logIntercom(`SKIP \u2192 ${targetSession} (no task files in exe/${agent}/ \u2014 nothing to do)`);
4737
+ return "debounced";
4738
+ }
4739
+ } else {
4740
+ logIntercom(`SKIP \u2192 ${targetSession} (no task folder exe/${agent}/ \u2014 nothing to do)`);
4741
+ return "debounced";
4742
+ }
4743
+ } catch {
4744
+ }
4727
4745
  if (transport.isPaneInCopyMode(targetSession)) {
4728
4746
  logIntercom(`COPY_MODE \u2192 ${targetSession} (exiting copy mode first)`);
4729
4747
  transport.sendKeys(targetSession, "q");
@@ -5234,7 +5252,7 @@ __export(shard_manager_exports, {
5234
5252
  shardExists: () => shardExists
5235
5253
  });
5236
5254
  import path17 from "path";
5237
- import { existsSync as existsSync14, mkdirSync as mkdirSync7, readdirSync as readdirSync3 } from "fs";
5255
+ import { existsSync as existsSync14, mkdirSync as mkdirSync7, readdirSync as readdirSync4 } from "fs";
5238
5256
  import { createClient as createClient2 } from "@libsql/client";
5239
5257
  function initShardManager(encryptionKey) {
5240
5258
  _encryptionKey = encryptionKey;
@@ -5273,7 +5291,7 @@ function shardExists(projectName2) {
5273
5291
  }
5274
5292
  function listShards() {
5275
5293
  if (!existsSync14(SHARDS_DIR)) return [];
5276
- return readdirSync3(SHARDS_DIR).filter((f) => f.endsWith(".db")).map((f) => f.replace(".db", ""));
5294
+ return readdirSync4(SHARDS_DIR).filter((f) => f.endsWith(".db")).map((f) => f.replace(".db", ""));
5277
5295
  }
5278
5296
  async function ensureShardSchema(client) {
5279
5297
  await client.execute("PRAGMA journal_mode = WAL");
@@ -4408,7 +4408,7 @@ __export(tmux_routing_exports, {
4408
4408
  verifyPaneAtCapacity: () => verifyPaneAtCapacity
4409
4409
  });
4410
4410
  import { execFileSync as execFileSync2, execSync as execSync6 } from "child_process";
4411
- import { readFileSync as readFileSync11, writeFileSync as writeFileSync7, mkdirSync as mkdirSync6, existsSync as existsSync12, appendFileSync } from "fs";
4411
+ import { readFileSync as readFileSync11, writeFileSync as writeFileSync7, mkdirSync as mkdirSync6, existsSync as existsSync12, appendFileSync, readdirSync as readdirSync3 } from "fs";
4412
4412
  import path15 from "path";
4413
4413
  import os8 from "os";
4414
4414
  import { fileURLToPath as fileURLToPath3 } from "url";
@@ -4729,6 +4729,24 @@ function sendIntercom(targetSession) {
4729
4729
  }
4730
4730
  } catch {
4731
4731
  }
4732
+ try {
4733
+ const rawAgent = targetSession.split("-")[0] ?? targetSession;
4734
+ const agent = baseAgentName(rawAgent);
4735
+ const taskDir = path15.join(process.cwd(), "exe", agent);
4736
+ if (existsSync12(taskDir)) {
4737
+ const files = readdirSync3(taskDir).filter(
4738
+ (f) => f.endsWith(".md") && f !== "DONE.txt"
4739
+ );
4740
+ if (files.length === 0) {
4741
+ logIntercom(`SKIP \u2192 ${targetSession} (no task files in exe/${agent}/ \u2014 nothing to do)`);
4742
+ return "debounced";
4743
+ }
4744
+ } else {
4745
+ logIntercom(`SKIP \u2192 ${targetSession} (no task folder exe/${agent}/ \u2014 nothing to do)`);
4746
+ return "debounced";
4747
+ }
4748
+ } catch {
4749
+ }
4732
4750
  if (transport.isPaneInCopyMode(targetSession)) {
4733
4751
  logIntercom(`COPY_MODE \u2192 ${targetSession} (exiting copy mode first)`);
4734
4752
  transport.sendKeys(targetSession, "q");
@@ -5239,7 +5257,7 @@ __export(shard_manager_exports, {
5239
5257
  shardExists: () => shardExists
5240
5258
  });
5241
5259
  import path17 from "path";
5242
- import { existsSync as existsSync14, mkdirSync as mkdirSync7, readdirSync as readdirSync3 } from "fs";
5260
+ import { existsSync as existsSync14, mkdirSync as mkdirSync7, readdirSync as readdirSync4 } from "fs";
5243
5261
  import { createClient as createClient2 } from "@libsql/client";
5244
5262
  function initShardManager(encryptionKey) {
5245
5263
  _encryptionKey = encryptionKey;
@@ -5278,7 +5296,7 @@ function shardExists(projectName) {
5278
5296
  }
5279
5297
  function listShards() {
5280
5298
  if (!existsSync14(SHARDS_DIR)) return [];
5281
- return readdirSync3(SHARDS_DIR).filter((f) => f.endsWith(".db")).map((f) => f.replace(".db", ""));
5299
+ return readdirSync4(SHARDS_DIR).filter((f) => f.endsWith(".db")).map((f) => f.replace(".db", ""));
5282
5300
  }
5283
5301
  async function ensureShardSchema(client) {
5284
5302
  await client.execute("PRAGMA journal_mode = WAL");
@@ -6982,7 +6982,7 @@ __export(tmux_routing_exports, {
6982
6982
  verifyPaneAtCapacity: () => verifyPaneAtCapacity
6983
6983
  });
6984
6984
  import { execFileSync as execFileSync2, execSync as execSync6 } from "child_process";
6985
- import { readFileSync as readFileSync12, writeFileSync as writeFileSync7, mkdirSync as mkdirSync8, existsSync as existsSync14, appendFileSync } from "fs";
6985
+ import { readFileSync as readFileSync12, writeFileSync as writeFileSync7, mkdirSync as mkdirSync8, existsSync as existsSync14, appendFileSync, readdirSync as readdirSync4 } from "fs";
6986
6986
  import path18 from "path";
6987
6987
  import os10 from "os";
6988
6988
  import { fileURLToPath as fileURLToPath2 } from "url";
@@ -7303,6 +7303,24 @@ function sendIntercom(targetSession) {
7303
7303
  }
7304
7304
  } catch {
7305
7305
  }
7306
+ try {
7307
+ const rawAgent = targetSession.split("-")[0] ?? targetSession;
7308
+ const agent = baseAgentName(rawAgent);
7309
+ const taskDir = path18.join(process.cwd(), "exe", agent);
7310
+ if (existsSync14(taskDir)) {
7311
+ const files = readdirSync4(taskDir).filter(
7312
+ (f) => f.endsWith(".md") && f !== "DONE.txt"
7313
+ );
7314
+ if (files.length === 0) {
7315
+ logIntercom(`SKIP \u2192 ${targetSession} (no task files in exe/${agent}/ \u2014 nothing to do)`);
7316
+ return "debounced";
7317
+ }
7318
+ } else {
7319
+ logIntercom(`SKIP \u2192 ${targetSession} (no task folder exe/${agent}/ \u2014 nothing to do)`);
7320
+ return "debounced";
7321
+ }
7322
+ } catch {
7323
+ }
7306
7324
  if (transport.isPaneInCopyMode(targetSession)) {
7307
7325
  logIntercom(`COPY_MODE \u2192 ${targetSession} (exiting copy mode first)`);
7308
7326
  transport.sendKeys(targetSession, "q");
@@ -2907,7 +2907,7 @@ __export(tmux_routing_exports, {
2907
2907
  verifyPaneAtCapacity: () => verifyPaneAtCapacity
2908
2908
  });
2909
2909
  import { execFileSync as execFileSync2, execSync as execSync4 } from "child_process";
2910
- import { readFileSync as readFileSync9, writeFileSync as writeFileSync6, mkdirSync as mkdirSync6, existsSync as existsSync11, appendFileSync } from "fs";
2910
+ import { readFileSync as readFileSync9, writeFileSync as writeFileSync6, mkdirSync as mkdirSync6, existsSync as existsSync11, appendFileSync, readdirSync as readdirSync3 } from "fs";
2911
2911
  import path11 from "path";
2912
2912
  import os7 from "os";
2913
2913
  import { fileURLToPath } from "url";
@@ -3228,6 +3228,24 @@ function sendIntercom(targetSession) {
3228
3228
  }
3229
3229
  } catch {
3230
3230
  }
3231
+ try {
3232
+ const rawAgent = targetSession.split("-")[0] ?? targetSession;
3233
+ const agent = baseAgentName(rawAgent);
3234
+ const taskDir = path11.join(process.cwd(), "exe", agent);
3235
+ if (existsSync11(taskDir)) {
3236
+ const files = readdirSync3(taskDir).filter(
3237
+ (f) => f.endsWith(".md") && f !== "DONE.txt"
3238
+ );
3239
+ if (files.length === 0) {
3240
+ logIntercom(`SKIP \u2192 ${targetSession} (no task files in exe/${agent}/ \u2014 nothing to do)`);
3241
+ return "debounced";
3242
+ }
3243
+ } else {
3244
+ logIntercom(`SKIP \u2192 ${targetSession} (no task folder exe/${agent}/ \u2014 nothing to do)`);
3245
+ return "debounced";
3246
+ }
3247
+ } catch {
3248
+ }
3231
3249
  if (transport.isPaneInCopyMode(targetSession)) {
3232
3250
  logIntercom(`COPY_MODE \u2192 ${targetSession} (exiting copy mode first)`);
3233
3251
  transport.sendKeys(targetSession, "q");
@@ -4249,7 +4267,7 @@ var init_tasks_crud = __esm({
4249
4267
 
4250
4268
  // src/lib/tasks-review.ts
4251
4269
  import path13 from "path";
4252
- import { existsSync as existsSync13, readdirSync as readdirSync3, unlinkSync as unlinkSync4 } from "fs";
4270
+ import { existsSync as existsSync13, readdirSync as readdirSync4, unlinkSync as unlinkSync4 } from "fs";
4253
4271
  async function countPendingReviews(sessionScope) {
4254
4272
  const client = getClient();
4255
4273
  if (sessionScope) {
@@ -4432,7 +4450,7 @@ async function cleanupReviewFile(row, taskFile, _baseDir) {
4432
4450
  try {
4433
4451
  const cacheDir = path13.join(EXE_AI_DIR, "session-cache");
4434
4452
  if (existsSync13(cacheDir)) {
4435
- for (const f of readdirSync3(cacheDir)) {
4453
+ for (const f of readdirSync4(cacheDir)) {
4436
4454
  if (f.startsWith("review-notified-")) {
4437
4455
  unlinkSync4(path13.join(cacheDir, f));
4438
4456
  }
@@ -4402,7 +4402,7 @@ __export(tmux_routing_exports, {
4402
4402
  verifyPaneAtCapacity: () => verifyPaneAtCapacity
4403
4403
  });
4404
4404
  import { execFileSync as execFileSync2, execSync as execSync6 } from "child_process";
4405
- import { readFileSync as readFileSync11, writeFileSync as writeFileSync7, mkdirSync as mkdirSync6, existsSync as existsSync12, appendFileSync } from "fs";
4405
+ import { readFileSync as readFileSync11, writeFileSync as writeFileSync7, mkdirSync as mkdirSync6, existsSync as existsSync12, appendFileSync, readdirSync as readdirSync3 } from "fs";
4406
4406
  import path15 from "path";
4407
4407
  import os8 from "os";
4408
4408
  import { fileURLToPath as fileURLToPath2 } from "url";
@@ -4723,6 +4723,24 @@ function sendIntercom(targetSession) {
4723
4723
  }
4724
4724
  } catch {
4725
4725
  }
4726
+ try {
4727
+ const rawAgent = targetSession.split("-")[0] ?? targetSession;
4728
+ const agent = baseAgentName(rawAgent);
4729
+ const taskDir = path15.join(process.cwd(), "exe", agent);
4730
+ if (existsSync12(taskDir)) {
4731
+ const files = readdirSync3(taskDir).filter(
4732
+ (f) => f.endsWith(".md") && f !== "DONE.txt"
4733
+ );
4734
+ if (files.length === 0) {
4735
+ logIntercom(`SKIP \u2192 ${targetSession} (no task files in exe/${agent}/ \u2014 nothing to do)`);
4736
+ return "debounced";
4737
+ }
4738
+ } else {
4739
+ logIntercom(`SKIP \u2192 ${targetSession} (no task folder exe/${agent}/ \u2014 nothing to do)`);
4740
+ return "debounced";
4741
+ }
4742
+ } catch {
4743
+ }
4726
4744
  if (transport.isPaneInCopyMode(targetSession)) {
4727
4745
  logIntercom(`COPY_MODE \u2192 ${targetSession} (exiting copy mode first)`);
4728
4746
  transport.sendKeys(targetSession, "q");
@@ -5233,7 +5251,7 @@ __export(shard_manager_exports, {
5233
5251
  shardExists: () => shardExists
5234
5252
  });
5235
5253
  import path17 from "path";
5236
- import { existsSync as existsSync14, mkdirSync as mkdirSync7, readdirSync as readdirSync3 } from "fs";
5254
+ import { existsSync as existsSync14, mkdirSync as mkdirSync7, readdirSync as readdirSync4 } from "fs";
5237
5255
  import { createClient as createClient2 } from "@libsql/client";
5238
5256
  function initShardManager(encryptionKey) {
5239
5257
  _encryptionKey = encryptionKey;
@@ -5272,7 +5290,7 @@ function shardExists(projectName) {
5272
5290
  }
5273
5291
  function listShards() {
5274
5292
  if (!existsSync14(SHARDS_DIR)) return [];
5275
- return readdirSync3(SHARDS_DIR).filter((f) => f.endsWith(".db")).map((f) => f.replace(".db", ""));
5293
+ return readdirSync4(SHARDS_DIR).filter((f) => f.endsWith(".db")).map((f) => f.replace(".db", ""));
5276
5294
  }
5277
5295
  async function ensureShardSchema(client) {
5278
5296
  await client.execute("PRAGMA journal_mode = WAL");