@askexenow/exe-os 0.8.32 → 0.8.36

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 (87) hide show
  1. package/dist/bin/backfill-conversations.js +332 -348
  2. package/dist/bin/backfill-responses.js +72 -12
  3. package/dist/bin/backfill-vectors.js +72 -12
  4. package/dist/bin/cleanup-stale-review-tasks.js +63 -3
  5. package/dist/bin/cli.js +1518 -1122
  6. package/dist/bin/exe-agent.js +4 -4
  7. package/dist/bin/exe-assign.js +80 -18
  8. package/dist/bin/exe-boot.js +408 -89
  9. package/dist/bin/exe-call.js +83 -24
  10. package/dist/bin/exe-dispatch.js +18 -10
  11. package/dist/bin/exe-doctor.js +63 -3
  12. package/dist/bin/exe-export-behaviors.js +64 -3
  13. package/dist/bin/exe-forget.js +69 -4
  14. package/dist/bin/exe-gateway.js +121 -36
  15. package/dist/bin/exe-heartbeat.js +77 -13
  16. package/dist/bin/exe-kill.js +64 -3
  17. package/dist/bin/exe-launch-agent.js +162 -35
  18. package/dist/bin/exe-link.js +946 -0
  19. package/dist/bin/exe-new-employee.js +121 -36
  20. package/dist/bin/exe-pending-messages.js +72 -7
  21. package/dist/bin/exe-pending-notifications.js +63 -3
  22. package/dist/bin/exe-pending-reviews.js +75 -10
  23. package/dist/bin/exe-rename.js +1287 -0
  24. package/dist/bin/exe-review.js +64 -4
  25. package/dist/bin/exe-search.js +79 -13
  26. package/dist/bin/exe-session-cleanup.js +91 -26
  27. package/dist/bin/exe-status.js +64 -4
  28. package/dist/bin/exe-team.js +64 -4
  29. package/dist/bin/git-sweep.js +71 -4
  30. package/dist/bin/graph-backfill.js +64 -3
  31. package/dist/bin/graph-export.js +64 -3
  32. package/dist/bin/install.js +3 -3
  33. package/dist/bin/scan-tasks.js +71 -4
  34. package/dist/bin/setup.js +156 -38
  35. package/dist/bin/shard-migrate.js +64 -3
  36. package/dist/bin/wiki-sync.js +64 -3
  37. package/dist/gateway/index.js +122 -37
  38. package/dist/hooks/bug-report-worker.js +209 -23
  39. package/dist/hooks/commit-complete.js +71 -4
  40. package/dist/hooks/error-recall.js +79 -13
  41. package/dist/hooks/ingest-worker.js +129 -43
  42. package/dist/hooks/instructions-loaded.js +71 -4
  43. package/dist/hooks/notification.js +71 -4
  44. package/dist/hooks/post-compact.js +71 -4
  45. package/dist/hooks/pre-compact.js +71 -4
  46. package/dist/hooks/pre-tool-use.js +413 -194
  47. package/dist/hooks/prompt-ingest-worker.js +82 -22
  48. package/dist/hooks/prompt-submit.js +103 -37
  49. package/dist/hooks/response-ingest-worker.js +87 -22
  50. package/dist/hooks/session-end.js +71 -4
  51. package/dist/hooks/session-start.js +79 -13
  52. package/dist/hooks/stop.js +71 -4
  53. package/dist/hooks/subagent-stop.js +71 -4
  54. package/dist/hooks/summary-worker.js +303 -50
  55. package/dist/index.js +134 -46
  56. package/dist/lib/cloud-sync.js +209 -15
  57. package/dist/lib/consolidation.js +4 -4
  58. package/dist/lib/database.js +64 -2
  59. package/dist/lib/device-registry.js +70 -3
  60. package/dist/lib/employee-templates.js +48 -22
  61. package/dist/lib/employees.js +34 -1
  62. package/dist/lib/exe-daemon.js +136 -53
  63. package/dist/lib/hybrid-search.js +79 -13
  64. package/dist/lib/identity-templates.js +57 -6
  65. package/dist/lib/identity.js +3 -3
  66. package/dist/lib/messaging.js +22 -14
  67. package/dist/lib/reminders.js +3 -3
  68. package/dist/lib/schedules.js +63 -3
  69. package/dist/lib/skill-learning.js +3 -3
  70. package/dist/lib/status-brief.js +63 -5
  71. package/dist/lib/store.js +64 -3
  72. package/dist/lib/task-router.js +4 -2
  73. package/dist/lib/tasks.js +48 -21
  74. package/dist/lib/tmux-routing.js +47 -20
  75. package/dist/mcp/server.js +727 -58
  76. package/dist/mcp/tools/complete-reminder.js +3 -3
  77. package/dist/mcp/tools/create-reminder.js +3 -3
  78. package/dist/mcp/tools/create-task.js +151 -24
  79. package/dist/mcp/tools/deactivate-behavior.js +3 -3
  80. package/dist/mcp/tools/list-reminders.js +3 -3
  81. package/dist/mcp/tools/list-tasks.js +17 -8
  82. package/dist/mcp/tools/send-message.js +24 -16
  83. package/dist/mcp/tools/update-task.js +25 -16
  84. package/dist/runtime/index.js +112 -24
  85. package/dist/tui/App.js +139 -36
  86. package/package.json +6 -2
  87. package/src/commands/exe/rename.md +12 -0
@@ -19,19 +19,27 @@ var __copyProps = (to, from, except, desc) => {
19
19
  };
20
20
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
21
 
22
+ // src/lib/db-retry.ts
23
+ var init_db_retry = __esm({
24
+ "src/lib/db-retry.ts"() {
25
+ "use strict";
26
+ }
27
+ });
28
+
22
29
  // src/lib/database.ts
23
30
  import { createClient } from "@libsql/client";
24
31
  function getClient() {
25
- if (!_client) {
32
+ if (!_resilientClient) {
26
33
  throw new Error("Database client not initialized. Call initDatabase() first.");
27
34
  }
28
- return _client;
35
+ return _resilientClient;
29
36
  }
30
- var _client;
37
+ var _resilientClient;
31
38
  var init_database = __esm({
32
39
  "src/lib/database.ts"() {
33
40
  "use strict";
34
- _client = null;
41
+ init_db_retry();
42
+ _resilientClient = null;
35
43
  }
36
44
  });
37
45
 
@@ -468,7 +476,7 @@ var init_tasks_crud = __esm({
468
476
 
469
477
  // src/lib/employees.ts
470
478
  import { readFile as readFile2, writeFile as writeFile3, mkdir as mkdir3 } from "fs/promises";
471
- import { existsSync as existsSync4, symlinkSync, readlinkSync } from "fs";
479
+ import { existsSync as existsSync4, symlinkSync, readlinkSync, readFileSync as readFileSync4 } from "fs";
472
480
  import { execSync as execSync2 } from "child_process";
473
481
  import path4 from "path";
474
482
  var EMPLOYEES_PATH;
@@ -663,7 +671,7 @@ var init_provider_table = __esm({
663
671
  });
664
672
 
665
673
  // src/lib/intercom-queue.ts
666
- import { readFileSync as readFileSync4, writeFileSync, renameSync as renameSync2, existsSync as existsSync5, mkdirSync } from "fs";
674
+ import { readFileSync as readFileSync5, writeFileSync, renameSync as renameSync2, existsSync as existsSync5, mkdirSync } from "fs";
667
675
  import path6 from "path";
668
676
  import os4 from "os";
669
677
  function ensureDir() {
@@ -673,7 +681,7 @@ function ensureDir() {
673
681
  function readQueue() {
674
682
  try {
675
683
  if (!existsSync5(QUEUE_PATH)) return [];
676
- return JSON.parse(readFileSync4(QUEUE_PATH, "utf8"));
684
+ return JSON.parse(readFileSync5(QUEUE_PATH, "utf8"));
677
685
  } catch {
678
686
  return [];
679
687
  }
@@ -712,7 +720,7 @@ var init_intercom_queue = __esm({
712
720
  });
713
721
 
714
722
  // src/lib/license.ts
715
- import { readFileSync as readFileSync5, writeFileSync as writeFileSync2, existsSync as existsSync6, mkdirSync as mkdirSync2 } from "fs";
723
+ import { readFileSync as readFileSync6, writeFileSync as writeFileSync2, existsSync as existsSync6, mkdirSync as mkdirSync2 } from "fs";
716
724
  import { randomUUID } from "crypto";
717
725
  import path7 from "path";
718
726
  import { jwtVerify, importSPKI } from "jose";
@@ -728,7 +736,7 @@ var init_license = __esm({
728
736
  });
729
737
 
730
738
  // src/lib/plan-limits.ts
731
- import { readFileSync as readFileSync6, existsSync as existsSync7 } from "fs";
739
+ import { readFileSync as readFileSync7, existsSync as existsSync7 } from "fs";
732
740
  import path8 from "path";
733
741
  var CACHE_PATH2;
734
742
  var init_plan_limits = __esm({
@@ -743,7 +751,7 @@ var init_plan_limits = __esm({
743
751
  });
744
752
 
745
753
  // src/lib/tmux-routing.ts
746
- import { readFileSync as readFileSync7, writeFileSync as writeFileSync3, mkdirSync as mkdirSync3, existsSync as existsSync8, appendFileSync } from "fs";
754
+ import { readFileSync as readFileSync8, writeFileSync as writeFileSync3, mkdirSync as mkdirSync3, existsSync as existsSync8, appendFileSync } from "fs";
747
755
  import path9 from "path";
748
756
  import os5 from "os";
749
757
  import { fileURLToPath } from "url";
@@ -756,7 +764,7 @@ function extractRootExe(name) {
756
764
  }
757
765
  function getParentExe(sessionKey) {
758
766
  try {
759
- const data = JSON.parse(readFileSync7(path9.join(SESSION_CACHE, `parent-exe-${sessionKey}.json`), "utf8"));
767
+ const data = JSON.parse(readFileSync8(path9.join(SESSION_CACHE, `parent-exe-${sessionKey}.json`), "utf8"));
760
768
  return data.parentExe || null;
761
769
  } catch {
762
770
  return null;
@@ -764,7 +772,7 @@ function getParentExe(sessionKey) {
764
772
  }
765
773
  function getDispatchedBy(sessionKey) {
766
774
  try {
767
- const data = JSON.parse(readFileSync7(
775
+ const data = JSON.parse(readFileSync8(
768
776
  path9.join(SESSION_CACHE, `parent-exe-${sessionKey}.json`),
769
777
  "utf8"
770
778
  ));
@@ -789,7 +797,7 @@ function resolveExeSession() {
789
797
  function readDebounceState() {
790
798
  try {
791
799
  if (!existsSync8(DEBOUNCE_FILE)) return {};
792
- return JSON.parse(readFileSync7(DEBOUNCE_FILE, "utf8"));
800
+ return JSON.parse(readFileSync8(DEBOUNCE_FILE, "utf8"));
793
801
  } catch {
794
802
  return {};
795
803
  }
@@ -1103,6 +1111,7 @@ var init_tasks_notify = __esm({
1103
1111
  init_session_key();
1104
1112
  init_notifications();
1105
1113
  init_transport();
1114
+ init_employees();
1106
1115
  }
1107
1116
  });
1108
1117
 
@@ -1544,7 +1553,7 @@ __export(active_agent_exports, {
1544
1553
  getAllActiveAgents: () => getAllActiveAgents,
1545
1554
  writeActiveAgent: () => writeActiveAgent
1546
1555
  });
1547
- import { readFileSync as readFileSync8, writeFileSync as writeFileSync5, mkdirSync as mkdirSync5, unlinkSync as unlinkSync4, readdirSync as readdirSync3 } from "fs";
1556
+ import { readFileSync as readFileSync9, writeFileSync as writeFileSync5, mkdirSync as mkdirSync5, unlinkSync as unlinkSync4, readdirSync as readdirSync3 } from "fs";
1548
1557
  import { execSync as execSync5 } from "child_process";
1549
1558
  import path13 from "path";
1550
1559
  function getMarkerPath() {
@@ -1569,7 +1578,7 @@ function clearActiveAgent() {
1569
1578
  function getActiveAgent() {
1570
1579
  try {
1571
1580
  const markerPath = getMarkerPath();
1572
- const raw = readFileSync8(markerPath, "utf8");
1581
+ const raw = readFileSync9(markerPath, "utf8");
1573
1582
  const data = JSON.parse(raw);
1574
1583
  if (data.agentId) {
1575
1584
  if (data.startedAt) {
@@ -1622,7 +1631,7 @@ function getAllActiveAgents() {
1622
1631
  const key = file.slice("active-agent-".length, -".json".length);
1623
1632
  if (key === "undefined") continue;
1624
1633
  try {
1625
- const raw = readFileSync8(path13.join(CACHE_DIR, file), "utf8");
1634
+ const raw = readFileSync9(path13.join(CACHE_DIR, file), "utf8");
1626
1635
  const data = JSON.parse(raw);
1627
1636
  if (!data.agentId) continue;
1628
1637
  if (data.startedAt) {
@@ -359,6 +359,61 @@ var init_intercom_queue = __esm({
359
359
  }
360
360
  });
361
361
 
362
+ // src/lib/db-retry.ts
363
+ function isBusyError(err) {
364
+ if (err instanceof Error) {
365
+ const msg = err.message.toLowerCase();
366
+ return msg.includes("sqlite_busy") || msg.includes("database is locked");
367
+ }
368
+ return false;
369
+ }
370
+ function delay(ms) {
371
+ return new Promise((resolve) => setTimeout(resolve, ms));
372
+ }
373
+ async function retryOnBusy(fn, label) {
374
+ let lastError;
375
+ for (let attempt = 0; attempt <= MAX_RETRIES; attempt++) {
376
+ try {
377
+ return await fn();
378
+ } catch (err) {
379
+ lastError = err;
380
+ if (!isBusyError(err) || attempt === MAX_RETRIES) {
381
+ throw err;
382
+ }
383
+ const backoff = BASE_DELAY_MS * Math.pow(2, attempt);
384
+ const jitter = Math.floor(Math.random() * MAX_JITTER_MS);
385
+ process.stderr.write(
386
+ `[exe-os] SQLITE_BUSY ${label} retry ${attempt + 1}/${MAX_RETRIES} \u2014 waiting ${backoff + jitter}ms
387
+ `
388
+ );
389
+ await delay(backoff + jitter);
390
+ }
391
+ }
392
+ throw lastError;
393
+ }
394
+ function wrapWithRetry(client) {
395
+ return new Proxy(client, {
396
+ get(target, prop, receiver) {
397
+ if (prop === "execute") {
398
+ return (sql) => retryOnBusy(() => target.execute(sql), "execute");
399
+ }
400
+ if (prop === "batch") {
401
+ return (stmts) => retryOnBusy(() => target.batch(stmts), "batch");
402
+ }
403
+ return Reflect.get(target, prop, receiver);
404
+ }
405
+ });
406
+ }
407
+ var MAX_RETRIES, BASE_DELAY_MS, MAX_JITTER_MS;
408
+ var init_db_retry = __esm({
409
+ "src/lib/db-retry.ts"() {
410
+ "use strict";
411
+ MAX_RETRIES = 3;
412
+ BASE_DELAY_MS = 200;
413
+ MAX_JITTER_MS = 300;
414
+ }
415
+ });
416
+
362
417
  // src/lib/database.ts
363
418
  var database_exports = {};
364
419
  __export(database_exports, {
@@ -366,6 +421,7 @@ __export(database_exports, {
366
421
  disposeTurso: () => disposeTurso,
367
422
  ensureSchema: () => ensureSchema,
368
423
  getClient: () => getClient,
424
+ getRawClient: () => getRawClient,
369
425
  initDatabase: () => initDatabase,
370
426
  initTurso: () => initTurso,
371
427
  isInitialized: () => isInitialized
@@ -375,6 +431,7 @@ async function initDatabase(config) {
375
431
  if (_client) {
376
432
  _client.close();
377
433
  _client = null;
434
+ _resilientClient = null;
378
435
  }
379
436
  const opts = {
380
437
  url: `file:${config.dbPath}`
@@ -383,20 +440,27 @@ async function initDatabase(config) {
383
440
  opts.encryptionKey = config.encryptionKey;
384
441
  }
385
442
  _client = createClient(opts);
443
+ _resilientClient = wrapWithRetry(_client);
386
444
  }
387
445
  function isInitialized() {
388
446
  return _client !== null;
389
447
  }
390
448
  function getClient() {
449
+ if (!_resilientClient) {
450
+ throw new Error("Database client not initialized. Call initDatabase() first.");
451
+ }
452
+ return _resilientClient;
453
+ }
454
+ function getRawClient() {
391
455
  if (!_client) {
392
456
  throw new Error("Database client not initialized. Call initDatabase() first.");
393
457
  }
394
458
  return _client;
395
459
  }
396
460
  async function ensureSchema() {
397
- const client = getClient();
461
+ const client = getRawClient();
398
462
  await client.execute("PRAGMA journal_mode = WAL");
399
- await client.execute("PRAGMA busy_timeout = 5000");
463
+ await client.execute("PRAGMA busy_timeout = 30000");
400
464
  try {
401
465
  await client.execute("PRAGMA libsql_vector_search_ef = 128");
402
466
  } catch {
@@ -1189,13 +1253,16 @@ async function disposeDatabase() {
1189
1253
  if (_client) {
1190
1254
  _client.close();
1191
1255
  _client = null;
1256
+ _resilientClient = null;
1192
1257
  }
1193
1258
  }
1194
- var _client, initTurso, disposeTurso;
1259
+ var _client, _resilientClient, initTurso, disposeTurso;
1195
1260
  var init_database = __esm({
1196
1261
  "src/lib/database.ts"() {
1197
1262
  "use strict";
1263
+ init_db_retry();
1198
1264
  _client = null;
1265
+ _resilientClient = null;
1199
1266
  initTurso = initDatabase;
1200
1267
  disposeTurso = disposeDatabase;
1201
1268
  }
@@ -1392,20 +1459,38 @@ var init_config = __esm({
1392
1459
 
1393
1460
  // src/lib/employees.ts
1394
1461
  import { readFile as readFile2, writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
1395
- import { existsSync as existsSync4, symlinkSync, readlinkSync } from "fs";
1462
+ import { existsSync as existsSync4, symlinkSync, readlinkSync, readFileSync as readFileSync4 } from "fs";
1396
1463
  import { execSync as execSync4 } from "child_process";
1397
1464
  import path5 from "path";
1398
- var EMPLOYEES_PATH;
1465
+ function loadEmployeesSync(employeesPath = EMPLOYEES_PATH) {
1466
+ if (!existsSync4(employeesPath)) return [];
1467
+ try {
1468
+ return JSON.parse(readFileSync4(employeesPath, "utf-8"));
1469
+ } catch {
1470
+ return [];
1471
+ }
1472
+ }
1473
+ function getEmployee(employees, name) {
1474
+ return employees.find((e) => e.name.toLowerCase() === name.toLowerCase());
1475
+ }
1476
+ function isMultiInstance(agentName, employees) {
1477
+ const roster = employees ?? loadEmployeesSync();
1478
+ const emp = getEmployee(roster, agentName);
1479
+ if (!emp) return false;
1480
+ return MULTI_INSTANCE_ROLES.has(emp.role.toLowerCase());
1481
+ }
1482
+ var EMPLOYEES_PATH, MULTI_INSTANCE_ROLES;
1399
1483
  var init_employees = __esm({
1400
1484
  "src/lib/employees.ts"() {
1401
1485
  "use strict";
1402
1486
  init_config();
1403
1487
  EMPLOYEES_PATH = path5.join(EXE_AI_DIR, "exe-employees.json");
1488
+ MULTI_INSTANCE_ROLES = /* @__PURE__ */ new Set(["principal engineer", "content production specialist", "staff code reviewer"]);
1404
1489
  }
1405
1490
  });
1406
1491
 
1407
1492
  // src/lib/license.ts
1408
- import { readFileSync as readFileSync4, writeFileSync as writeFileSync3, existsSync as existsSync5, mkdirSync as mkdirSync3 } from "fs";
1493
+ import { readFileSync as readFileSync5, writeFileSync as writeFileSync3, existsSync as existsSync5, mkdirSync as mkdirSync3 } from "fs";
1409
1494
  import { randomUUID as randomUUID2 } from "crypto";
1410
1495
  import path6 from "path";
1411
1496
  import { jwtVerify, importSPKI } from "jose";
@@ -1428,12 +1513,12 @@ var init_license = __esm({
1428
1513
  });
1429
1514
 
1430
1515
  // src/lib/plan-limits.ts
1431
- import { readFileSync as readFileSync5, existsSync as existsSync6 } from "fs";
1516
+ import { readFileSync as readFileSync6, existsSync as existsSync6 } from "fs";
1432
1517
  import path7 from "path";
1433
1518
  function getLicenseSync() {
1434
1519
  try {
1435
1520
  if (!existsSync6(CACHE_PATH2)) return freeLicense();
1436
- const raw = JSON.parse(readFileSync5(CACHE_PATH2, "utf8"));
1521
+ const raw = JSON.parse(readFileSync6(CACHE_PATH2, "utf8"));
1437
1522
  if (!raw.token || typeof raw.token !== "string") return freeLicense();
1438
1523
  const parts = raw.token.split(".");
1439
1524
  if (parts.length !== 3) return freeLicense();
@@ -1472,7 +1557,7 @@ function assertEmployeeLimitSync(rosterPath) {
1472
1557
  let count = 0;
1473
1558
  try {
1474
1559
  if (existsSync6(filePath)) {
1475
- const raw = readFileSync5(filePath, "utf8");
1560
+ const raw = readFileSync6(filePath, "utf8");
1476
1561
  const employees = JSON.parse(raw);
1477
1562
  count = Array.isArray(employees) ? employees.length : 0;
1478
1563
  }
@@ -1510,7 +1595,7 @@ import crypto from "crypto";
1510
1595
  import path8 from "path";
1511
1596
  import os5 from "os";
1512
1597
  import {
1513
- readFileSync as readFileSync6,
1598
+ readFileSync as readFileSync7,
1514
1599
  readdirSync,
1515
1600
  unlinkSync,
1516
1601
  existsSync as existsSync7,
@@ -1596,7 +1681,7 @@ import crypto3 from "crypto";
1596
1681
  import path9 from "path";
1597
1682
  import { execSync as execSync5 } from "child_process";
1598
1683
  import { mkdir as mkdir3, writeFile as writeFile3, appendFile } from "fs/promises";
1599
- import { existsSync as existsSync8, readFileSync as readFileSync7 } from "fs";
1684
+ import { existsSync as existsSync8, readFileSync as readFileSync8 } from "fs";
1600
1685
  async function writeCheckpoint(input) {
1601
1686
  const client = getClient();
1602
1687
  const row = await resolveTask(client, input.taskId);
@@ -1973,7 +2058,7 @@ async function ensureGitignoreExe(baseDir) {
1973
2058
  const gitignorePath = path9.join(baseDir, ".gitignore");
1974
2059
  try {
1975
2060
  if (existsSync8(gitignorePath)) {
1976
- const content = readFileSync7(gitignorePath, "utf-8");
2061
+ const content = readFileSync8(gitignorePath, "utf-8");
1977
2062
  if (/^\/?exe\/?$/m.test(content)) return;
1978
2063
  await appendFile(gitignorePath, "\n# Employee task assignments (private)\n/exe/\n");
1979
2064
  } else {
@@ -2349,7 +2434,7 @@ async function dispatchTaskToEmployee(input) {
2349
2434
  } else {
2350
2435
  const projectDir = input.projectDir ?? process.cwd();
2351
2436
  const result = ensureEmployee(input.assignedTo, exeSession, projectDir, {
2352
- autoInstance: input.assignedTo === "tom" || input.assignedTo === "sasha"
2437
+ autoInstance: isMultiInstance(input.assignedTo)
2353
2438
  });
2354
2439
  if (result.status === "failed") {
2355
2440
  process.stderr.write(
@@ -2384,6 +2469,7 @@ var init_tasks_notify = __esm({
2384
2469
  init_session_key();
2385
2470
  init_notifications();
2386
2471
  init_transport();
2472
+ init_employees();
2387
2473
  }
2388
2474
  });
2389
2475
 
@@ -3219,7 +3305,7 @@ __export(tmux_routing_exports, {
3219
3305
  verifyPaneAtCapacity: () => verifyPaneAtCapacity
3220
3306
  });
3221
3307
  import { execFileSync as execFileSync2, execSync as execSync7 } from "child_process";
3222
- import { readFileSync as readFileSync8, writeFileSync as writeFileSync5, mkdirSync as mkdirSync5, existsSync as existsSync10, appendFileSync } from "fs";
3308
+ import { readFileSync as readFileSync9, writeFileSync as writeFileSync5, mkdirSync as mkdirSync5, existsSync as existsSync10, appendFileSync } from "fs";
3223
3309
  import path14 from "path";
3224
3310
  import os6 from "os";
3225
3311
  import { fileURLToPath } from "url";
@@ -3286,7 +3372,7 @@ function registerParentExe(sessionKey, parentExe, dispatchedBy) {
3286
3372
  }
3287
3373
  function getParentExe(sessionKey) {
3288
3374
  try {
3289
- const data = JSON.parse(readFileSync8(path14.join(SESSION_CACHE, `parent-exe-${sessionKey}.json`), "utf8"));
3375
+ const data = JSON.parse(readFileSync9(path14.join(SESSION_CACHE, `parent-exe-${sessionKey}.json`), "utf8"));
3290
3376
  return data.parentExe || null;
3291
3377
  } catch {
3292
3378
  return null;
@@ -3294,7 +3380,7 @@ function getParentExe(sessionKey) {
3294
3380
  }
3295
3381
  function getDispatchedBy(sessionKey) {
3296
3382
  try {
3297
- const data = JSON.parse(readFileSync8(
3383
+ const data = JSON.parse(readFileSync9(
3298
3384
  path14.join(SESSION_CACHE, `parent-exe-${sessionKey}.json`),
3299
3385
  "utf8"
3300
3386
  ));
@@ -3357,7 +3443,7 @@ async function verifyPaneAtCapacity(sessionName) {
3357
3443
  function readDebounceState() {
3358
3444
  try {
3359
3445
  if (!existsSync10(DEBOUNCE_FILE)) return {};
3360
- return JSON.parse(readFileSync8(DEBOUNCE_FILE, "utf8"));
3446
+ return JSON.parse(readFileSync9(DEBOUNCE_FILE, "utf8"));
3361
3447
  } catch {
3362
3448
  return {};
3363
3449
  }
@@ -3557,7 +3643,7 @@ function spawnEmployee(employeeName, exeSession, projectDir, opts) {
3557
3643
  const claudeJsonPath = path14.join(os6.homedir(), ".claude.json");
3558
3644
  let claudeJson = {};
3559
3645
  try {
3560
- claudeJson = JSON.parse(readFileSync8(claudeJsonPath, "utf8"));
3646
+ claudeJson = JSON.parse(readFileSync9(claudeJsonPath, "utf8"));
3561
3647
  } catch {
3562
3648
  }
3563
3649
  if (!claudeJson.projects) claudeJson.projects = {};
@@ -3575,7 +3661,7 @@ function spawnEmployee(employeeName, exeSession, projectDir, opts) {
3575
3661
  const settingsPath = path14.join(projSettingsDir, "settings.json");
3576
3662
  let settings = {};
3577
3663
  try {
3578
- settings = JSON.parse(readFileSync8(settingsPath, "utf8"));
3664
+ settings = JSON.parse(readFileSync9(settingsPath, "utf8"));
3579
3665
  } catch {
3580
3666
  }
3581
3667
  const perms = settings.permissions ?? {};
@@ -3882,7 +3968,7 @@ function listShards() {
3882
3968
  }
3883
3969
  async function ensureShardSchema(client) {
3884
3970
  await client.execute("PRAGMA journal_mode = WAL");
3885
- await client.execute("PRAGMA busy_timeout = 5000");
3971
+ await client.execute("PRAGMA busy_timeout = 30000");
3886
3972
  try {
3887
3973
  await client.execute("PRAGMA libsql_vector_search_ef = 128");
3888
3974
  } catch {
@@ -4534,8 +4620,8 @@ function findContainingChunk(filePath, snippet) {
4534
4620
  try {
4535
4621
  const ext = filePath.split(".").pop()?.toLowerCase();
4536
4622
  if (ext !== "ts" && ext !== "tsx" && ext !== "js" && ext !== "jsx") return "";
4537
- const { readFileSync: readFileSync9 } = __require("fs");
4538
- const source = readFileSync9(filePath, "utf8");
4623
+ const { readFileSync: readFileSync10 } = __require("fs");
4624
+ const source = readFileSync10(filePath, "utf8");
4539
4625
  const lines = source.split("\n");
4540
4626
  const lowerSnippet = snippet.toLowerCase().slice(0, 80);
4541
4627
  let matchLine = -1;
@@ -6040,12 +6126,14 @@ var DEFAULT_BLOOM_CONFIG = {
6040
6126
  },
6041
6127
  tierRules: {
6042
6128
  junior: {
6043
- eligible: ["tom"],
6129
+ eligible: [],
6130
+ // resolved dynamically from roster (Principal Engineer role)
6044
6131
  reviewRequired: false,
6045
6132
  manualOnly: false
6046
6133
  },
6047
6134
  standard: {
6048
- eligible: ["tom"],
6135
+ eligible: [],
6136
+ // resolved dynamically from roster (Principal Engineer role)
6049
6137
  reviewRequired: false,
6050
6138
  manualOnly: false
6051
6139
  },