@askexenow/exe-os 0.8.65 → 0.8.68

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 (54) hide show
  1. package/dist/bin/cleanup-stale-review-tasks.js +8 -7
  2. package/dist/bin/cli.js +204 -120
  3. package/dist/bin/exe-assign.js +11 -10
  4. package/dist/bin/exe-boot.js +83 -78
  5. package/dist/bin/exe-call.js +33 -1
  6. package/dist/bin/exe-cloud.js +3 -2
  7. package/dist/bin/exe-dispatch.js +31 -30
  8. package/dist/bin/exe-gateway.js +33 -32
  9. package/dist/bin/exe-heartbeat.js +21 -20
  10. package/dist/bin/exe-launch-agent.js +48 -16
  11. package/dist/bin/exe-link.js +16 -11
  12. package/dist/bin/exe-new-employee.js +20 -19
  13. package/dist/bin/exe-pending-messages.js +7 -6
  14. package/dist/bin/exe-pending-reviews.js +16 -15
  15. package/dist/bin/exe-rename.js +12 -11
  16. package/dist/bin/exe-review.js +4 -3
  17. package/dist/bin/exe-session-cleanup.js +20 -19
  18. package/dist/bin/exe-settings.js +3 -2
  19. package/dist/bin/exe-status.js +16 -15
  20. package/dist/bin/exe-team.js +4 -3
  21. package/dist/bin/git-sweep.js +31 -30
  22. package/dist/bin/install.js +284 -113
  23. package/dist/bin/scan-tasks.js +33 -32
  24. package/dist/bin/setup.js +114 -30
  25. package/dist/gateway/index.js +32 -31
  26. package/dist/hooks/bug-report-worker.js +58 -26
  27. package/dist/hooks/commit-complete.js +31 -30
  28. package/dist/hooks/ingest-worker.js +58 -57
  29. package/dist/hooks/post-compact.js +10 -9
  30. package/dist/hooks/pre-compact.js +31 -30
  31. package/dist/hooks/pre-tool-use.js +46 -14
  32. package/dist/hooks/prompt-ingest-worker.js +15 -14
  33. package/dist/hooks/prompt-submit.js +15 -14
  34. package/dist/hooks/response-ingest-worker.js +8 -7
  35. package/dist/hooks/session-end.js +14 -13
  36. package/dist/hooks/session-start.js +10 -9
  37. package/dist/hooks/stop.js +10 -9
  38. package/dist/hooks/subagent-stop.js +10 -9
  39. package/dist/hooks/summary-worker.js +41 -36
  40. package/dist/index.js +43 -42
  41. package/dist/lib/cloud-sync.js +16 -11
  42. package/dist/lib/employees.js +33 -1
  43. package/dist/lib/exe-daemon.js +56 -55
  44. package/dist/lib/messaging.js +9 -8
  45. package/dist/lib/tasks.js +27 -26
  46. package/dist/lib/tmux-routing.js +29 -28
  47. package/dist/mcp/server.js +94 -62
  48. package/dist/mcp/tools/create-task.js +60 -28
  49. package/dist/mcp/tools/list-tasks.js +10 -9
  50. package/dist/mcp/tools/send-message.js +11 -10
  51. package/dist/mcp/tools/update-task.js +21 -20
  52. package/dist/runtime/index.js +31 -30
  53. package/dist/tui/App.js +67 -35
  54. package/package.json +1 -1
@@ -2014,9 +2014,10 @@ var init_embedder = __esm({
2014
2014
 
2015
2015
  // src/lib/employees.ts
2016
2016
  import { readFile as readFile3, writeFile as writeFile3, mkdir as mkdir3 } from "fs/promises";
2017
- import { existsSync as existsSync5, symlinkSync, readlinkSync, readFileSync as readFileSync3 } from "fs";
2017
+ import { existsSync as existsSync5, symlinkSync, readlinkSync, readFileSync as readFileSync3, renameSync as renameSync2, unlinkSync as unlinkSync2, writeFileSync } from "fs";
2018
2018
  import { execSync as execSync2 } from "child_process";
2019
2019
  import path6 from "path";
2020
+ import os3 from "os";
2020
2021
  async function loadEmployees(employeesPath = EMPLOYEES_PATH) {
2021
2022
  if (!existsSync5(employeesPath)) {
2022
2023
  return [];
@@ -2038,7 +2039,7 @@ var init_employees = __esm({
2038
2039
  });
2039
2040
 
2040
2041
  // src/lib/license.ts
2041
- import { readFileSync as readFileSync4, writeFileSync, existsSync as existsSync6, mkdirSync as mkdirSync2 } from "fs";
2042
+ import { readFileSync as readFileSync4, writeFileSync as writeFileSync2, existsSync as existsSync6, mkdirSync as mkdirSync2 } from "fs";
2042
2043
  import { randomUUID as randomUUID3 } from "crypto";
2043
2044
  import path7 from "path";
2044
2045
  import { jwtVerify, importSPKI } from "jose";
@@ -2068,7 +2069,7 @@ function loadDeviceId() {
2068
2069
  }
2069
2070
  const id = randomUUID3();
2070
2071
  mkdirSync2(EXE_AI_DIR, { recursive: true });
2071
- writeFileSync(DEVICE_ID_PATH, id, "utf8");
2072
+ writeFileSync2(DEVICE_ID_PATH, id, "utf8");
2072
2073
  return id;
2073
2074
  }
2074
2075
  function loadLicense() {
@@ -2081,7 +2082,7 @@ function loadLicense() {
2081
2082
  }
2082
2083
  function saveLicense(apiKey) {
2083
2084
  mkdirSync2(EXE_AI_DIR, { recursive: true });
2084
- writeFileSync(LICENSE_PATH, apiKey.trim(), { encoding: "utf8", mode: 384 });
2085
+ writeFileSync2(LICENSE_PATH, apiKey.trim(), { encoding: "utf8", mode: 384 });
2085
2086
  }
2086
2087
  async function verifyLicenseJwt(token) {
2087
2088
  try {
@@ -2152,7 +2153,7 @@ function getRawCachedPlan() {
2152
2153
  }
2153
2154
  function cacheResponse(token) {
2154
2155
  try {
2155
- writeFileSync(CACHE_PATH, JSON.stringify({ token }), "utf8");
2156
+ writeFileSync2(CACHE_PATH, JSON.stringify({ token }), "utf8");
2156
2157
  } catch {
2157
2158
  }
2158
2159
  }
@@ -2406,7 +2407,7 @@ var init_plan_limits = __esm({
2406
2407
 
2407
2408
  // src/adapters/claude/hooks/response-ingest-worker.ts
2408
2409
  import crypto from "crypto";
2409
- import { writeFileSync as writeFileSync2 } from "fs";
2410
+ import { writeFileSync as writeFileSync3 } from "fs";
2410
2411
  import path9 from "path";
2411
2412
 
2412
2413
  // src/lib/project-name.ts
@@ -2874,7 +2875,7 @@ async function main() {
2874
2875
  try {
2875
2876
  const { EXE_AI_DIR: exeDir } = await Promise.resolve().then(() => (init_config(), config_exports));
2876
2877
  const flagPath = path9.join(exeDir, "session-cache", "needs-backfill");
2877
- writeFileSync2(flagPath, "1");
2878
+ writeFileSync3(flagPath, "1");
2878
2879
  } catch (err) {
2879
2880
  process.stderr.write(`[response-ingest-worker] backfill flag write failed: ${err instanceof Error ? err.message : String(err)}
2880
2881
  `);
@@ -1335,9 +1335,10 @@ var init_database = __esm({
1335
1335
 
1336
1336
  // src/lib/employees.ts
1337
1337
  import { readFile as readFile2, writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
1338
- import { existsSync as existsSync3, symlinkSync, readlinkSync, readFileSync as readFileSync4 } from "fs";
1338
+ import { existsSync as existsSync3, symlinkSync, readlinkSync, readFileSync as readFileSync4, renameSync as renameSync3, unlinkSync as unlinkSync2, writeFileSync as writeFileSync3 } from "fs";
1339
1339
  import { execSync as execSync4 } from "child_process";
1340
1340
  import path5 from "path";
1341
+ import os4 from "os";
1341
1342
  var EMPLOYEES_PATH;
1342
1343
  var init_employees = __esm({
1343
1344
  "src/lib/employees.ts"() {
@@ -1348,7 +1349,7 @@ var init_employees = __esm({
1348
1349
  });
1349
1350
 
1350
1351
  // src/lib/license.ts
1351
- import { readFileSync as readFileSync5, writeFileSync as writeFileSync3, existsSync as existsSync4, mkdirSync as mkdirSync3 } from "fs";
1352
+ import { readFileSync as readFileSync5, writeFileSync as writeFileSync4, existsSync as existsSync4, mkdirSync as mkdirSync3 } from "fs";
1352
1353
  import { randomUUID } from "crypto";
1353
1354
  import path6 from "path";
1354
1355
  import { jwtVerify, importSPKI } from "jose";
@@ -1379,9 +1380,9 @@ var init_plan_limits = __esm({
1379
1380
  });
1380
1381
 
1381
1382
  // src/lib/tmux-routing.ts
1382
- import { readFileSync as readFileSync7, writeFileSync as writeFileSync4, mkdirSync as mkdirSync4, existsSync as existsSync6, appendFileSync } from "fs";
1383
+ import { readFileSync as readFileSync7, writeFileSync as writeFileSync5, mkdirSync as mkdirSync4, existsSync as existsSync6, appendFileSync } from "fs";
1383
1384
  import path8 from "path";
1384
- import os4 from "os";
1385
+ import os5 from "os";
1385
1386
  import { fileURLToPath } from "url";
1386
1387
  function getMySession() {
1387
1388
  return getTransport().getMySession();
@@ -1423,9 +1424,9 @@ var init_tmux_routing = __esm({
1423
1424
  init_provider_table();
1424
1425
  init_intercom_queue();
1425
1426
  init_plan_limits();
1426
- SPAWN_LOCK_DIR = path8.join(os4.homedir(), ".exe-os", "spawn-locks");
1427
- SESSION_CACHE = path8.join(os4.homedir(), ".exe-os", "session-cache");
1428
- INTERCOM_LOG2 = path8.join(os4.homedir(), ".exe-os", "intercom.log");
1427
+ SPAWN_LOCK_DIR = path8.join(os5.homedir(), ".exe-os", "spawn-locks");
1428
+ SESSION_CACHE = path8.join(os5.homedir(), ".exe-os", "session-cache");
1429
+ INTERCOM_LOG2 = path8.join(os5.homedir(), ".exe-os", "intercom.log");
1429
1430
  DEBOUNCE_FILE = path8.join(SESSION_CACHE, "intercom-debounce.json");
1430
1431
  DEBOUNCE_CLEANUP_AGE_MS = 5 * 60 * 1e3;
1431
1432
  }
@@ -1468,9 +1469,9 @@ var init_memory = __esm({
1468
1469
  import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3, chmod as chmod2 } from "fs/promises";
1469
1470
  import { existsSync as existsSync7 } from "fs";
1470
1471
  import path9 from "path";
1471
- import os5 from "os";
1472
+ import os6 from "os";
1472
1473
  function getKeyDir() {
1473
- return process.env.EXE_OS_DIR ?? process.env.EXE_MEM_DIR ?? path9.join(os5.homedir(), ".exe-os");
1474
+ return process.env.EXE_OS_DIR ?? process.env.EXE_MEM_DIR ?? path9.join(os6.homedir(), ".exe-os");
1474
1475
  }
1475
1476
  function getKeyPath() {
1476
1477
  return path9.join(getKeyDir(), "master.key");
@@ -2492,11 +2493,11 @@ __export(notifications_exports, {
2492
2493
  });
2493
2494
  import crypto from "crypto";
2494
2495
  import path11 from "path";
2495
- import os6 from "os";
2496
+ import os7 from "os";
2496
2497
  import {
2497
2498
  readFileSync as readFileSync8,
2498
2499
  readdirSync as readdirSync3,
2499
- unlinkSync as unlinkSync2,
2500
+ unlinkSync as unlinkSync3,
2500
2501
  existsSync as existsSync9,
2501
2502
  rmdirSync
2502
2503
  } from "fs";
@@ -2633,7 +2634,7 @@ function formatNotifications(notifications) {
2633
2634
  return lines.join("\n");
2634
2635
  }
2635
2636
  async function migrateJsonNotifications() {
2636
- const base = process.env.EXE_OS_DIR || process.env.EXE_MEM_DIR || path11.join(os6.homedir(), ".exe-os");
2637
+ const base = process.env.EXE_OS_DIR || process.env.EXE_MEM_DIR || path11.join(os7.homedir(), ".exe-os");
2637
2638
  const notifDir = path11.join(base, "notifications");
2638
2639
  if (!existsSync9(notifDir)) return 0;
2639
2640
  let migrated = 0;
@@ -2660,7 +2661,7 @@ async function migrateJsonNotifications() {
2660
2661
  data.timestamp ?? (/* @__PURE__ */ new Date()).toISOString()
2661
2662
  ]
2662
2663
  });
2663
- unlinkSync2(filePath);
2664
+ unlinkSync3(filePath);
2664
2665
  migrated++;
2665
2666
  } catch {
2666
2667
  }
@@ -3283,9 +3283,10 @@ var init_intercom_queue = __esm({
3283
3283
 
3284
3284
  // src/lib/employees.ts
3285
3285
  import { readFile as readFile3, writeFile as writeFile3, mkdir as mkdir3 } from "fs/promises";
3286
- import { existsSync as existsSync8, symlinkSync, readlinkSync, readFileSync as readFileSync6 } from "fs";
3286
+ import { existsSync as existsSync8, symlinkSync, readlinkSync, readFileSync as readFileSync6, renameSync as renameSync3, unlinkSync as unlinkSync3, writeFileSync as writeFileSync3 } from "fs";
3287
3287
  import { execSync as execSync6 } from "child_process";
3288
3288
  import path11 from "path";
3289
+ import os5 from "os";
3289
3290
  var EMPLOYEES_PATH;
3290
3291
  var init_employees = __esm({
3291
3292
  "src/lib/employees.ts"() {
@@ -3296,7 +3297,7 @@ var init_employees = __esm({
3296
3297
  });
3297
3298
 
3298
3299
  // src/lib/license.ts
3299
- import { readFileSync as readFileSync7, writeFileSync as writeFileSync3, existsSync as existsSync9, mkdirSync as mkdirSync4 } from "fs";
3300
+ import { readFileSync as readFileSync7, writeFileSync as writeFileSync4, existsSync as existsSync9, mkdirSync as mkdirSync4 } from "fs";
3300
3301
  import { randomUUID as randomUUID3 } from "crypto";
3301
3302
  import path12 from "path";
3302
3303
  import { jwtVerify, importSPKI } from "jose";
@@ -3327,9 +3328,9 @@ var init_plan_limits = __esm({
3327
3328
  });
3328
3329
 
3329
3330
  // src/lib/tmux-routing.ts
3330
- import { readFileSync as readFileSync9, writeFileSync as writeFileSync4, mkdirSync as mkdirSync5, existsSync as existsSync11, appendFileSync } from "fs";
3331
+ import { readFileSync as readFileSync9, writeFileSync as writeFileSync5, mkdirSync as mkdirSync5, existsSync as existsSync11, appendFileSync } from "fs";
3331
3332
  import path14 from "path";
3332
- import os5 from "os";
3333
+ import os6 from "os";
3333
3334
  import { fileURLToPath as fileURLToPath2 } from "url";
3334
3335
  function getMySession() {
3335
3336
  return getTransport().getMySession();
@@ -3371,9 +3372,9 @@ var init_tmux_routing = __esm({
3371
3372
  init_provider_table();
3372
3373
  init_intercom_queue();
3373
3374
  init_plan_limits();
3374
- SPAWN_LOCK_DIR = path14.join(os5.homedir(), ".exe-os", "spawn-locks");
3375
- SESSION_CACHE = path14.join(os5.homedir(), ".exe-os", "session-cache");
3376
- INTERCOM_LOG2 = path14.join(os5.homedir(), ".exe-os", "intercom.log");
3375
+ SPAWN_LOCK_DIR = path14.join(os6.homedir(), ".exe-os", "spawn-locks");
3376
+ SESSION_CACHE = path14.join(os6.homedir(), ".exe-os", "session-cache");
3377
+ INTERCOM_LOG2 = path14.join(os6.homedir(), ".exe-os", "intercom.log");
3377
3378
  DEBOUNCE_FILE = path14.join(SESSION_CACHE, "intercom-debounce.json");
3378
3379
  DEBOUNCE_CLEANUP_AGE_MS = 5 * 60 * 1e3;
3379
3380
  }
@@ -3409,7 +3410,7 @@ init_config();
3409
3410
  init_store();
3410
3411
  init_database();
3411
3412
  import path15 from "path";
3412
- import { unlinkSync as unlinkSync3 } from "fs";
3413
+ import { unlinkSync as unlinkSync4 } from "fs";
3413
3414
 
3414
3415
  // src/lib/hybrid-search.ts
3415
3416
  init_store();
@@ -3863,7 +3864,7 @@ process.stdin.on("end", async () => {
3863
3864
  "session-cache",
3864
3865
  "active-agent-undefined.json"
3865
3866
  );
3866
- unlinkSync3(undefinedPath);
3867
+ unlinkSync4(undefinedPath);
3867
3868
  } catch {
3868
3869
  }
3869
3870
  }
@@ -1354,9 +1354,10 @@ var init_database = __esm({
1354
1354
 
1355
1355
  // src/lib/employees.ts
1356
1356
  import { readFile as readFile2, writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
1357
- import { existsSync as existsSync3, symlinkSync, readlinkSync, readFileSync as readFileSync4 } from "fs";
1357
+ import { existsSync as existsSync3, symlinkSync, readlinkSync, readFileSync as readFileSync4, renameSync as renameSync3, unlinkSync as unlinkSync2, writeFileSync as writeFileSync3 } from "fs";
1358
1358
  import { execSync as execSync4 } from "child_process";
1359
1359
  import path5 from "path";
1360
+ import os4 from "os";
1360
1361
  var EMPLOYEES_PATH;
1361
1362
  var init_employees = __esm({
1362
1363
  "src/lib/employees.ts"() {
@@ -1367,7 +1368,7 @@ var init_employees = __esm({
1367
1368
  });
1368
1369
 
1369
1370
  // src/lib/license.ts
1370
- import { readFileSync as readFileSync5, writeFileSync as writeFileSync3, existsSync as existsSync4, mkdirSync as mkdirSync3 } from "fs";
1371
+ import { readFileSync as readFileSync5, writeFileSync as writeFileSync4, existsSync as existsSync4, mkdirSync as mkdirSync3 } from "fs";
1371
1372
  import { randomUUID } from "crypto";
1372
1373
  import path6 from "path";
1373
1374
  import { jwtVerify, importSPKI } from "jose";
@@ -1398,9 +1399,9 @@ var init_plan_limits = __esm({
1398
1399
  });
1399
1400
 
1400
1401
  // src/lib/tmux-routing.ts
1401
- import { readFileSync as readFileSync7, writeFileSync as writeFileSync4, mkdirSync as mkdirSync4, existsSync as existsSync6, appendFileSync } from "fs";
1402
+ import { readFileSync as readFileSync7, writeFileSync as writeFileSync5, mkdirSync as mkdirSync4, existsSync as existsSync6, appendFileSync } from "fs";
1402
1403
  import path8 from "path";
1403
- import os4 from "os";
1404
+ import os5 from "os";
1404
1405
  import { fileURLToPath } from "url";
1405
1406
  function getMySession() {
1406
1407
  return getTransport().getMySession();
@@ -1442,9 +1443,9 @@ var init_tmux_routing = __esm({
1442
1443
  init_provider_table();
1443
1444
  init_intercom_queue();
1444
1445
  init_plan_limits();
1445
- SPAWN_LOCK_DIR = path8.join(os4.homedir(), ".exe-os", "spawn-locks");
1446
- SESSION_CACHE = path8.join(os4.homedir(), ".exe-os", "session-cache");
1447
- INTERCOM_LOG2 = path8.join(os4.homedir(), ".exe-os", "intercom.log");
1446
+ SPAWN_LOCK_DIR = path8.join(os5.homedir(), ".exe-os", "spawn-locks");
1447
+ SESSION_CACHE = path8.join(os5.homedir(), ".exe-os", "session-cache");
1448
+ INTERCOM_LOG2 = path8.join(os5.homedir(), ".exe-os", "intercom.log");
1448
1449
  DEBOUNCE_FILE = path8.join(SESSION_CACHE, "intercom-debounce.json");
1449
1450
  DEBOUNCE_CLEANUP_AGE_MS = 5 * 60 * 1e3;
1450
1451
  }
@@ -1487,9 +1488,9 @@ var init_memory = __esm({
1487
1488
  import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3, chmod as chmod2 } from "fs/promises";
1488
1489
  import { existsSync as existsSync7 } from "fs";
1489
1490
  import path9 from "path";
1490
- import os5 from "os";
1491
+ import os6 from "os";
1491
1492
  function getKeyDir() {
1492
- return process.env.EXE_OS_DIR ?? process.env.EXE_MEM_DIR ?? path9.join(os5.homedir(), ".exe-os");
1493
+ return process.env.EXE_OS_DIR ?? process.env.EXE_MEM_DIR ?? path9.join(os6.homedir(), ".exe-os");
1493
1494
  }
1494
1495
  function getKeyPath() {
1495
1496
  return path9.join(getKeyDir(), "master.key");
@@ -1336,9 +1336,10 @@ var init_database = __esm({
1336
1336
 
1337
1337
  // src/lib/employees.ts
1338
1338
  import { readFile as readFile2, writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
1339
- import { existsSync as existsSync3, symlinkSync, readlinkSync, readFileSync as readFileSync4 } from "fs";
1339
+ import { existsSync as existsSync3, symlinkSync, readlinkSync, readFileSync as readFileSync4, renameSync as renameSync3, unlinkSync as unlinkSync2, writeFileSync as writeFileSync3 } from "fs";
1340
1340
  import { execSync as execSync4 } from "child_process";
1341
1341
  import path5 from "path";
1342
+ import os4 from "os";
1342
1343
  var EMPLOYEES_PATH;
1343
1344
  var init_employees = __esm({
1344
1345
  "src/lib/employees.ts"() {
@@ -1349,7 +1350,7 @@ var init_employees = __esm({
1349
1350
  });
1350
1351
 
1351
1352
  // src/lib/license.ts
1352
- import { readFileSync as readFileSync5, writeFileSync as writeFileSync3, existsSync as existsSync4, mkdirSync as mkdirSync3 } from "fs";
1353
+ import { readFileSync as readFileSync5, writeFileSync as writeFileSync4, existsSync as existsSync4, mkdirSync as mkdirSync3 } from "fs";
1353
1354
  import { randomUUID } from "crypto";
1354
1355
  import path6 from "path";
1355
1356
  import { jwtVerify, importSPKI } from "jose";
@@ -1380,9 +1381,9 @@ var init_plan_limits = __esm({
1380
1381
  });
1381
1382
 
1382
1383
  // src/lib/tmux-routing.ts
1383
- import { readFileSync as readFileSync7, writeFileSync as writeFileSync4, mkdirSync as mkdirSync4, existsSync as existsSync6, appendFileSync } from "fs";
1384
+ import { readFileSync as readFileSync7, writeFileSync as writeFileSync5, mkdirSync as mkdirSync4, existsSync as existsSync6, appendFileSync } from "fs";
1384
1385
  import path8 from "path";
1385
- import os4 from "os";
1386
+ import os5 from "os";
1386
1387
  import { fileURLToPath } from "url";
1387
1388
  function getMySession() {
1388
1389
  return getTransport().getMySession();
@@ -1424,9 +1425,9 @@ var init_tmux_routing = __esm({
1424
1425
  init_provider_table();
1425
1426
  init_intercom_queue();
1426
1427
  init_plan_limits();
1427
- SPAWN_LOCK_DIR = path8.join(os4.homedir(), ".exe-os", "spawn-locks");
1428
- SESSION_CACHE = path8.join(os4.homedir(), ".exe-os", "session-cache");
1429
- INTERCOM_LOG2 = path8.join(os4.homedir(), ".exe-os", "intercom.log");
1428
+ SPAWN_LOCK_DIR = path8.join(os5.homedir(), ".exe-os", "spawn-locks");
1429
+ SESSION_CACHE = path8.join(os5.homedir(), ".exe-os", "session-cache");
1430
+ INTERCOM_LOG2 = path8.join(os5.homedir(), ".exe-os", "intercom.log");
1430
1431
  DEBOUNCE_FILE = path8.join(SESSION_CACHE, "intercom-debounce.json");
1431
1432
  DEBOUNCE_CLEANUP_AGE_MS = 5 * 60 * 1e3;
1432
1433
  }
@@ -1469,9 +1470,9 @@ var init_memory = __esm({
1469
1470
  import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3, chmod as chmod2 } from "fs/promises";
1470
1471
  import { existsSync as existsSync7 } from "fs";
1471
1472
  import path9 from "path";
1472
- import os5 from "os";
1473
+ import os6 from "os";
1473
1474
  function getKeyDir() {
1474
- return process.env.EXE_OS_DIR ?? process.env.EXE_MEM_DIR ?? path9.join(os5.homedir(), ".exe-os");
1475
+ return process.env.EXE_OS_DIR ?? process.env.EXE_MEM_DIR ?? path9.join(os6.homedir(), ".exe-os");
1475
1476
  }
1476
1477
  function getKeyPath() {
1477
1478
  return path9.join(getKeyDir(), "master.key");
@@ -2043,9 +2043,10 @@ var init_intercom_queue = __esm({
2043
2043
 
2044
2044
  // src/lib/employees.ts
2045
2045
  import { readFile as readFile3, writeFile as writeFile3, mkdir as mkdir3 } from "fs/promises";
2046
- import { existsSync as existsSync6, symlinkSync, readlinkSync, readFileSync as readFileSync4 } from "fs";
2046
+ import { existsSync as existsSync6, symlinkSync, readlinkSync, readFileSync as readFileSync4, renameSync as renameSync3, unlinkSync as unlinkSync2, writeFileSync as writeFileSync2 } from "fs";
2047
2047
  import { execSync as execSync3 } from "child_process";
2048
2048
  import path7 from "path";
2049
+ import os6 from "os";
2049
2050
  async function loadEmployees(employeesPath = EMPLOYEES_PATH) {
2050
2051
  if (!existsSync6(employeesPath)) {
2051
2052
  return [];
@@ -2127,7 +2128,7 @@ __export(license_exports, {
2127
2128
  stopLicenseRevalidation: () => stopLicenseRevalidation,
2128
2129
  validateLicense: () => validateLicense
2129
2130
  });
2130
- import { readFileSync as readFileSync5, writeFileSync as writeFileSync2, existsSync as existsSync7, mkdirSync as mkdirSync3 } from "fs";
2131
+ import { readFileSync as readFileSync5, writeFileSync as writeFileSync3, existsSync as existsSync7, mkdirSync as mkdirSync3 } from "fs";
2131
2132
  import { randomUUID as randomUUID2 } from "crypto";
2132
2133
  import path8 from "path";
2133
2134
  import { jwtVerify, importSPKI } from "jose";
@@ -2157,7 +2158,7 @@ function loadDeviceId() {
2157
2158
  }
2158
2159
  const id = randomUUID2();
2159
2160
  mkdirSync3(EXE_AI_DIR, { recursive: true });
2160
- writeFileSync2(DEVICE_ID_PATH, id, "utf8");
2161
+ writeFileSync3(DEVICE_ID_PATH, id, "utf8");
2161
2162
  return id;
2162
2163
  }
2163
2164
  function loadLicense() {
@@ -2170,7 +2171,7 @@ function loadLicense() {
2170
2171
  }
2171
2172
  function saveLicense(apiKey) {
2172
2173
  mkdirSync3(EXE_AI_DIR, { recursive: true });
2173
- writeFileSync2(LICENSE_PATH, apiKey.trim(), { encoding: "utf8", mode: 384 });
2174
+ writeFileSync3(LICENSE_PATH, apiKey.trim(), { encoding: "utf8", mode: 384 });
2174
2175
  }
2175
2176
  async function verifyLicenseJwt(token) {
2176
2177
  try {
@@ -2241,7 +2242,7 @@ function getRawCachedPlan() {
2241
2242
  }
2242
2243
  function cacheResponse(token) {
2243
2244
  try {
2244
- writeFileSync2(CACHE_PATH, JSON.stringify({ token }), "utf8");
2245
+ writeFileSync3(CACHE_PATH, JSON.stringify({ token }), "utf8");
2245
2246
  } catch {
2246
2247
  }
2247
2248
  }
@@ -2623,9 +2624,9 @@ var init_plan_limits = __esm({
2623
2624
  });
2624
2625
 
2625
2626
  // src/lib/tmux-routing.ts
2626
- import { readFileSync as readFileSync7, writeFileSync as writeFileSync3, mkdirSync as mkdirSync4, existsSync as existsSync9, appendFileSync } from "fs";
2627
+ import { readFileSync as readFileSync7, writeFileSync as writeFileSync4, mkdirSync as mkdirSync4, existsSync as existsSync9, appendFileSync } from "fs";
2627
2628
  import path10 from "path";
2628
- import os6 from "os";
2629
+ import os7 from "os";
2629
2630
  import { fileURLToPath } from "url";
2630
2631
  function getMySession() {
2631
2632
  return getTransport().getMySession();
@@ -2667,9 +2668,9 @@ var init_tmux_routing = __esm({
2667
2668
  init_provider_table();
2668
2669
  init_intercom_queue();
2669
2670
  init_plan_limits();
2670
- SPAWN_LOCK_DIR = path10.join(os6.homedir(), ".exe-os", "spawn-locks");
2671
- SESSION_CACHE = path10.join(os6.homedir(), ".exe-os", "session-cache");
2672
- INTERCOM_LOG2 = path10.join(os6.homedir(), ".exe-os", "intercom.log");
2671
+ SPAWN_LOCK_DIR = path10.join(os7.homedir(), ".exe-os", "spawn-locks");
2672
+ SESSION_CACHE = path10.join(os7.homedir(), ".exe-os", "session-cache");
2673
+ INTERCOM_LOG2 = path10.join(os7.homedir(), ".exe-os", "intercom.log");
2673
2674
  DEBOUNCE_FILE = path10.join(SESSION_CACHE, "intercom-debounce.json");
2674
2675
  DEBOUNCE_CLEANUP_AGE_MS = 5 * 60 * 1e3;
2675
2676
  }
@@ -2703,7 +2704,7 @@ var init_task_scope = __esm({
2703
2704
  import net from "net";
2704
2705
  import { spawn } from "child_process";
2705
2706
  import { randomUUID as randomUUID3 } from "crypto";
2706
- import { existsSync as existsSync10, unlinkSync as unlinkSync2, readFileSync as readFileSync8, openSync, closeSync, statSync } from "fs";
2707
+ import { existsSync as existsSync10, unlinkSync as unlinkSync3, readFileSync as readFileSync8, openSync, closeSync, statSync } from "fs";
2707
2708
  import path11 from "path";
2708
2709
  import { fileURLToPath as fileURLToPath2 } from "url";
2709
2710
  function handleData(chunk) {
@@ -2743,11 +2744,11 @@ function cleanupStaleFiles() {
2743
2744
  } catch {
2744
2745
  }
2745
2746
  try {
2746
- unlinkSync2(PID_PATH);
2747
+ unlinkSync3(PID_PATH);
2747
2748
  } catch {
2748
2749
  }
2749
2750
  try {
2750
- unlinkSync2(SOCKET_PATH);
2751
+ unlinkSync3(SOCKET_PATH);
2751
2752
  } catch {
2752
2753
  }
2753
2754
  }
@@ -2809,7 +2810,7 @@ function acquireSpawnLock() {
2809
2810
  const stat = statSync(SPAWN_LOCK_PATH);
2810
2811
  if (Date.now() - stat.mtimeMs > SPAWN_LOCK_STALE_MS) {
2811
2812
  try {
2812
- unlinkSync2(SPAWN_LOCK_PATH);
2813
+ unlinkSync3(SPAWN_LOCK_PATH);
2813
2814
  } catch {
2814
2815
  }
2815
2816
  try {
@@ -2826,7 +2827,7 @@ function acquireSpawnLock() {
2826
2827
  }
2827
2828
  function releaseSpawnLock() {
2828
2829
  try {
2829
- unlinkSync2(SPAWN_LOCK_PATH);
2830
+ unlinkSync3(SPAWN_LOCK_PATH);
2830
2831
  } catch {
2831
2832
  }
2832
2833
  }
@@ -2957,11 +2958,11 @@ function killAndRespawnDaemon() {
2957
2958
  _connected = false;
2958
2959
  _buffer = "";
2959
2960
  try {
2960
- unlinkSync2(PID_PATH);
2961
+ unlinkSync3(PID_PATH);
2961
2962
  } catch {
2962
2963
  }
2963
2964
  try {
2964
- unlinkSync2(SOCKET_PATH);
2965
+ unlinkSync3(SOCKET_PATH);
2965
2966
  } catch {
2966
2967
  }
2967
2968
  spawnDaemon();
@@ -3118,14 +3119,14 @@ __export(worker_gate_exports, {
3118
3119
  tryAcquireBackfillLock: () => tryAcquireBackfillLock,
3119
3120
  tryAcquireWorkerSlot: () => tryAcquireWorkerSlot
3120
3121
  });
3121
- import { readdirSync as readdirSync3, writeFileSync as writeFileSync4, unlinkSync as unlinkSync3, mkdirSync as mkdirSync5, existsSync as existsSync11 } from "fs";
3122
+ import { readdirSync as readdirSync3, writeFileSync as writeFileSync5, unlinkSync as unlinkSync4, mkdirSync as mkdirSync5, existsSync as existsSync11 } from "fs";
3122
3123
  import path12 from "path";
3123
3124
  function tryAcquireWorkerSlot() {
3124
3125
  try {
3125
3126
  mkdirSync5(WORKER_PID_DIR, { recursive: true });
3126
3127
  const reservationId = `res-${process.pid}-${Date.now()}`;
3127
3128
  const reservationPath = path12.join(WORKER_PID_DIR, `${reservationId}.pid`);
3128
- writeFileSync4(reservationPath, String(process.pid));
3129
+ writeFileSync5(reservationPath, String(process.pid));
3129
3130
  const files = readdirSync3(WORKER_PID_DIR);
3130
3131
  let alive = 0;
3131
3132
  for (const f of files) {
@@ -3142,20 +3143,20 @@ function tryAcquireWorkerSlot() {
3142
3143
  alive++;
3143
3144
  } catch {
3144
3145
  try {
3145
- unlinkSync3(path12.join(WORKER_PID_DIR, f));
3146
+ unlinkSync4(path12.join(WORKER_PID_DIR, f));
3146
3147
  } catch {
3147
3148
  }
3148
3149
  }
3149
3150
  }
3150
3151
  if (alive > MAX_CONCURRENT_WORKERS) {
3151
3152
  try {
3152
- unlinkSync3(reservationPath);
3153
+ unlinkSync4(reservationPath);
3153
3154
  } catch {
3154
3155
  }
3155
3156
  return false;
3156
3157
  }
3157
3158
  try {
3158
- unlinkSync3(reservationPath);
3159
+ unlinkSync4(reservationPath);
3159
3160
  } catch {
3160
3161
  }
3161
3162
  return true;
@@ -3166,13 +3167,13 @@ function tryAcquireWorkerSlot() {
3166
3167
  function registerWorkerPid(pid) {
3167
3168
  try {
3168
3169
  mkdirSync5(WORKER_PID_DIR, { recursive: true });
3169
- writeFileSync4(path12.join(WORKER_PID_DIR, `worker-${pid}.pid`), String(pid));
3170
+ writeFileSync5(path12.join(WORKER_PID_DIR, `worker-${pid}.pid`), String(pid));
3170
3171
  } catch {
3171
3172
  }
3172
3173
  }
3173
3174
  function cleanupWorkerPid() {
3174
3175
  try {
3175
- unlinkSync3(path12.join(WORKER_PID_DIR, `worker-${process.pid}.pid`));
3176
+ unlinkSync4(path12.join(WORKER_PID_DIR, `worker-${process.pid}.pid`));
3176
3177
  } catch {
3177
3178
  }
3178
3179
  }
@@ -3195,7 +3196,7 @@ function tryAcquireBackfillLock() {
3195
3196
  } catch {
3196
3197
  }
3197
3198
  }
3198
- writeFileSync4(BACKFILL_LOCK, String(process.pid));
3199
+ writeFileSync5(BACKFILL_LOCK, String(process.pid));
3199
3200
  return true;
3200
3201
  } catch {
3201
3202
  return true;
@@ -3203,7 +3204,7 @@ function tryAcquireBackfillLock() {
3203
3204
  }
3204
3205
  function releaseBackfillLock() {
3205
3206
  try {
3206
- unlinkSync3(BACKFILL_LOCK);
3207
+ unlinkSync4(BACKFILL_LOCK);
3207
3208
  } catch {
3208
3209
  }
3209
3210
  }
@@ -3325,7 +3326,7 @@ __export(cloud_sync_exports, {
3325
3326
  mergeRosterFromRemote: () => mergeRosterFromRemote,
3326
3327
  recordRosterDeletion: () => recordRosterDeletion
3327
3328
  });
3328
- import { readFileSync as readFileSync9, writeFileSync as writeFileSync5, existsSync as existsSync12, readdirSync as readdirSync4, mkdirSync as mkdirSync6, appendFileSync as appendFileSync2, unlinkSync as unlinkSync4, openSync as openSync2, closeSync as closeSync2 } from "fs";
3329
+ import { readFileSync as readFileSync9, writeFileSync as writeFileSync6, existsSync as existsSync12, readdirSync as readdirSync4, mkdirSync as mkdirSync6, appendFileSync as appendFileSync2, unlinkSync as unlinkSync5, openSync as openSync2, closeSync as closeSync2 } from "fs";
3329
3330
  import crypto3 from "crypto";
3330
3331
  import path13 from "path";
3331
3332
  import { homedir } from "os";
@@ -3344,7 +3345,7 @@ async function withRosterLock(fn) {
3344
3345
  try {
3345
3346
  const fd = openSync2(ROSTER_LOCK_PATH, "wx");
3346
3347
  closeSync2(fd);
3347
- writeFileSync5(ROSTER_LOCK_PATH, String(Date.now()));
3348
+ writeFileSync6(ROSTER_LOCK_PATH, String(Date.now()));
3348
3349
  } catch (err) {
3349
3350
  if (err.code === "EEXIST") {
3350
3351
  try {
@@ -3352,10 +3353,10 @@ async function withRosterLock(fn) {
3352
3353
  if (Date.now() - ts < LOCK_STALE_MS) {
3353
3354
  throw new Error("Roster merge already in progress \u2014 another sync is running");
3354
3355
  }
3355
- unlinkSync4(ROSTER_LOCK_PATH);
3356
+ unlinkSync5(ROSTER_LOCK_PATH);
3356
3357
  const fd = openSync2(ROSTER_LOCK_PATH, "wx");
3357
3358
  closeSync2(fd);
3358
- writeFileSync5(ROSTER_LOCK_PATH, String(Date.now()));
3359
+ writeFileSync6(ROSTER_LOCK_PATH, String(Date.now()));
3359
3360
  } catch (retryErr) {
3360
3361
  if (retryErr instanceof Error && retryErr.message.includes("already in progress")) throw retryErr;
3361
3362
  throw new Error("Roster merge already in progress \u2014 another sync is running");
@@ -3368,7 +3369,7 @@ async function withRosterLock(fn) {
3368
3369
  return await fn();
3369
3370
  } finally {
3370
3371
  try {
3371
- unlinkSync4(ROSTER_LOCK_PATH);
3372
+ unlinkSync5(ROSTER_LOCK_PATH);
3372
3373
  } catch {
3373
3374
  }
3374
3375
  }
@@ -3668,13 +3669,13 @@ function recordRosterDeletion(name) {
3668
3669
  } catch {
3669
3670
  }
3670
3671
  if (!deletions.includes(name)) deletions.push(name);
3671
- writeFileSync5(ROSTER_DELETIONS_PATH, JSON.stringify(deletions));
3672
+ writeFileSync6(ROSTER_DELETIONS_PATH, JSON.stringify(deletions));
3672
3673
  }
3673
3674
  function consumeRosterDeletions() {
3674
3675
  try {
3675
3676
  if (!existsSync12(ROSTER_DELETIONS_PATH)) return [];
3676
3677
  const deletions = JSON.parse(readFileSync9(ROSTER_DELETIONS_PATH, "utf-8"));
3677
- writeFileSync5(ROSTER_DELETIONS_PATH, "[]");
3678
+ writeFileSync6(ROSTER_DELETIONS_PATH, "[]");
3678
3679
  return deletions;
3679
3680
  } catch {
3680
3681
  return [];
@@ -3790,7 +3791,7 @@ function mergeConfig(remoteConfig, configPath) {
3790
3791
  const merged = { ...remoteConfig, ...local };
3791
3792
  const dir = path13.dirname(cfgPath);
3792
3793
  if (!existsSync12(dir)) mkdirSync6(dir, { recursive: true });
3793
- writeFileSync5(cfgPath, JSON.stringify(merged, null, 2), "utf-8");
3794
+ writeFileSync6(cfgPath, JSON.stringify(merged, null, 2), "utf-8");
3794
3795
  }
3795
3796
  async function mergeRosterFromRemote(remote, paths) {
3796
3797
  return withRosterLock(async () => {
@@ -3810,7 +3811,11 @@ async function mergeRosterFromRemote(remote, paths) {
3810
3811
  } catch {
3811
3812
  }
3812
3813
  }
3813
- const remoteIdentity = remote.identities[`${remoteEmp.name}.md`];
3814
+ const lookupKey = `${remoteEmp.name}.md`;
3815
+ const matchedKey = Object.keys(remote.identities).find(
3816
+ (k) => k.toLowerCase() === lookupKey.toLowerCase()
3817
+ ) ?? lookupKey;
3818
+ const remoteIdentity = remote.identities[matchedKey];
3814
3819
  if (remoteIdentity) {
3815
3820
  if (!existsSync12(identityDir)) mkdirSync6(identityDir, { recursive: true });
3816
3821
  const idPath = path13.join(identityDir, `${remoteEmp.name}.md`);
@@ -3820,7 +3825,7 @@ async function mergeRosterFromRemote(remote, paths) {
3820
3825
  } catch {
3821
3826
  }
3822
3827
  if (localIdentity !== remoteIdentity) {
3823
- writeFileSync5(idPath, remoteIdentity, "utf-8");
3828
+ writeFileSync6(idPath, remoteIdentity, "utf-8");
3824
3829
  identitiesUpdated++;
3825
3830
  }
3826
3831
  }