@askexenow/exe-os 0.9.30 → 0.9.32

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 (64) hide show
  1. package/dist/bin/backfill-conversations.js +135 -7
  2. package/dist/bin/backfill-responses.js +135 -7
  3. package/dist/bin/backfill-vectors.js +135 -7
  4. package/dist/bin/cleanup-stale-review-tasks.js +139 -11
  5. package/dist/bin/cli.js +812 -486
  6. package/dist/bin/exe-assign.js +135 -7
  7. package/dist/bin/exe-boot.js +422 -113
  8. package/dist/bin/exe-cloud.js +160 -9
  9. package/dist/bin/exe-dispatch.js +136 -8
  10. package/dist/bin/exe-doctor.js +255 -13
  11. package/dist/bin/exe-export-behaviors.js +136 -8
  12. package/dist/bin/exe-forget.js +136 -8
  13. package/dist/bin/exe-gateway.js +171 -24
  14. package/dist/bin/exe-heartbeat.js +141 -13
  15. package/dist/bin/exe-kill.js +140 -12
  16. package/dist/bin/exe-launch-agent.js +143 -15
  17. package/dist/bin/exe-link.js +357 -48
  18. package/dist/bin/exe-pending-messages.js +136 -8
  19. package/dist/bin/exe-pending-notifications.js +136 -8
  20. package/dist/bin/exe-pending-reviews.js +138 -10
  21. package/dist/bin/exe-review.js +136 -8
  22. package/dist/bin/exe-search.js +155 -20
  23. package/dist/bin/exe-session-cleanup.js +166 -38
  24. package/dist/bin/exe-start-codex.js +142 -14
  25. package/dist/bin/exe-start-opencode.js +140 -12
  26. package/dist/bin/exe-status.js +148 -20
  27. package/dist/bin/exe-team.js +136 -8
  28. package/dist/bin/git-sweep.js +138 -10
  29. package/dist/bin/graph-backfill.js +135 -7
  30. package/dist/bin/graph-export.js +136 -8
  31. package/dist/bin/intercom-check.js +153 -25
  32. package/dist/bin/scan-tasks.js +138 -10
  33. package/dist/bin/setup.js +447 -121
  34. package/dist/bin/shard-migrate.js +135 -7
  35. package/dist/gateway/index.js +151 -23
  36. package/dist/hooks/bug-report-worker.js +151 -23
  37. package/dist/hooks/codex-stop-task-finalizer.js +145 -17
  38. package/dist/hooks/commit-complete.js +138 -10
  39. package/dist/hooks/error-recall.js +159 -24
  40. package/dist/hooks/ingest.js +142 -14
  41. package/dist/hooks/instructions-loaded.js +136 -8
  42. package/dist/hooks/notification.js +136 -8
  43. package/dist/hooks/post-compact.js +136 -8
  44. package/dist/hooks/post-tool-combined.js +159 -24
  45. package/dist/hooks/pre-compact.js +136 -8
  46. package/dist/hooks/pre-tool-use.js +144 -16
  47. package/dist/hooks/prompt-submit.js +195 -55
  48. package/dist/hooks/session-end.js +141 -13
  49. package/dist/hooks/session-start.js +165 -30
  50. package/dist/hooks/stop.js +136 -8
  51. package/dist/hooks/subagent-stop.js +136 -8
  52. package/dist/hooks/summary-worker.js +374 -65
  53. package/dist/index.js +136 -8
  54. package/dist/lib/cloud-sync.js +355 -46
  55. package/dist/lib/consolidation.js +1 -0
  56. package/dist/lib/exe-daemon.js +469 -127
  57. package/dist/lib/hybrid-search.js +155 -20
  58. package/dist/lib/keychain.js +191 -7
  59. package/dist/lib/schedules.js +138 -10
  60. package/dist/lib/store.js +135 -7
  61. package/dist/mcp/server.js +706 -213
  62. package/dist/runtime/index.js +136 -8
  63. package/dist/tui/App.js +208 -31
  64. package/package.json +1 -1
@@ -1040,8 +1040,8 @@ function findPackageRoot() {
1040
1040
  function getAvailableMemoryGB() {
1041
1041
  if (process.platform === "darwin") {
1042
1042
  try {
1043
- const { execSync: execSync2 } = __require("child_process");
1044
- const vmstat = execSync2("vm_stat", { encoding: "utf8" });
1043
+ const { execSync: execSync3 } = __require("child_process");
1044
+ const vmstat = execSync3("vm_stat", { encoding: "utf8" });
1045
1045
  const pageSize = 16384;
1046
1046
  const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
1047
1047
  const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
@@ -2780,6 +2780,7 @@ var init_database = __esm({
2780
2780
  // src/lib/keychain.ts
2781
2781
  import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3, chmod as chmod2 } from "fs/promises";
2782
2782
  import { existsSync as existsSync6 } from "fs";
2783
+ import { execSync as execSync2 } from "child_process";
2783
2784
  import path6 from "path";
2784
2785
  import os5 from "os";
2785
2786
  function getKeyDir() {
@@ -2788,6 +2789,59 @@ function getKeyDir() {
2788
2789
  function getKeyPath() {
2789
2790
  return path6.join(getKeyDir(), "master.key");
2790
2791
  }
2792
+ function macKeychainGet() {
2793
+ if (process.platform !== "darwin") return null;
2794
+ try {
2795
+ return execSync2(
2796
+ `security find-generic-password -s "${SERVICE}" -a "${ACCOUNT}" -w 2>/dev/null`,
2797
+ { encoding: "utf-8", timeout: 5e3 }
2798
+ ).trim();
2799
+ } catch {
2800
+ return null;
2801
+ }
2802
+ }
2803
+ function macKeychainSet(value) {
2804
+ if (process.platform !== "darwin") return false;
2805
+ try {
2806
+ try {
2807
+ execSync2(
2808
+ `security delete-generic-password -s "${SERVICE}" -a "${ACCOUNT}" 2>/dev/null`,
2809
+ { timeout: 5e3 }
2810
+ );
2811
+ } catch {
2812
+ }
2813
+ execSync2(
2814
+ `security add-generic-password -s "${SERVICE}" -a "${ACCOUNT}" -w "${value}"`,
2815
+ { timeout: 5e3 }
2816
+ );
2817
+ return true;
2818
+ } catch {
2819
+ return false;
2820
+ }
2821
+ }
2822
+ function linuxSecretGet() {
2823
+ if (process.platform !== "linux") return null;
2824
+ try {
2825
+ return execSync2(
2826
+ `secret-tool lookup service "${SERVICE}" account "${ACCOUNT}" 2>/dev/null`,
2827
+ { encoding: "utf-8", timeout: 5e3 }
2828
+ ).trim();
2829
+ } catch {
2830
+ return null;
2831
+ }
2832
+ }
2833
+ function linuxSecretSet(value) {
2834
+ if (process.platform !== "linux") return false;
2835
+ try {
2836
+ execSync2(
2837
+ `echo -n "${value}" | secret-tool store --label="exe-os master key" service "${SERVICE}" account "${ACCOUNT}"`,
2838
+ { timeout: 5e3 }
2839
+ );
2840
+ return true;
2841
+ } catch {
2842
+ return false;
2843
+ }
2844
+ }
2791
2845
  async function tryKeytar() {
2792
2846
  try {
2793
2847
  return await import("keytar");
@@ -2795,13 +2849,63 @@ async function tryKeytar() {
2795
2849
  return null;
2796
2850
  }
2797
2851
  }
2852
+ function deriveMachineKey() {
2853
+ try {
2854
+ const crypto2 = __require("crypto");
2855
+ const material = [
2856
+ os5.hostname(),
2857
+ os5.userInfo().username,
2858
+ os5.arch(),
2859
+ os5.platform(),
2860
+ // Machine ID on Linux (stable across reboots)
2861
+ process.platform === "linux" ? readMachineId() : ""
2862
+ ].join("|");
2863
+ return crypto2.createHash("sha256").update(material).digest();
2864
+ } catch {
2865
+ return null;
2866
+ }
2867
+ }
2868
+ function readMachineId() {
2869
+ try {
2870
+ const { readFileSync: readFileSync5 } = __require("fs");
2871
+ return readFileSync5("/etc/machine-id", "utf-8").trim();
2872
+ } catch {
2873
+ return "";
2874
+ }
2875
+ }
2876
+ function decryptWithMachineKey(encrypted, machineKey) {
2877
+ if (!encrypted.startsWith(ENCRYPTED_PREFIX)) return null;
2878
+ try {
2879
+ const crypto2 = __require("crypto");
2880
+ const parts = encrypted.slice(ENCRYPTED_PREFIX.length).split(":");
2881
+ if (parts.length !== 3) return null;
2882
+ const [ivB64, tagB64, cipherB64] = parts;
2883
+ const iv = Buffer.from(ivB64, "base64");
2884
+ const authTag = Buffer.from(tagB64, "base64");
2885
+ const decipher = crypto2.createDecipheriv("aes-256-gcm", machineKey, iv);
2886
+ decipher.setAuthTag(authTag);
2887
+ let decrypted = decipher.update(cipherB64, "base64", "utf-8");
2888
+ decrypted += decipher.final("utf-8");
2889
+ return decrypted;
2890
+ } catch {
2891
+ return null;
2892
+ }
2893
+ }
2798
2894
  async function getMasterKey() {
2895
+ const nativeValue = macKeychainGet() ?? linuxSecretGet();
2896
+ if (nativeValue) {
2897
+ return Buffer.from(nativeValue, "base64");
2898
+ }
2799
2899
  const keytar = await tryKeytar();
2800
2900
  if (keytar) {
2801
2901
  try {
2802
- const stored = await keytar.getPassword(SERVICE, ACCOUNT);
2803
- if (stored) {
2804
- return Buffer.from(stored, "base64");
2902
+ const keytarValue = await keytar.getPassword(SERVICE, ACCOUNT);
2903
+ if (keytarValue) {
2904
+ const migrated = macKeychainSet(keytarValue) || linuxSecretSet(keytarValue);
2905
+ if (migrated) {
2906
+ process.stderr.write("[keychain] Migrated key from keytar to native keychain.\n");
2907
+ }
2908
+ return Buffer.from(keytarValue, "base64");
2805
2909
  }
2806
2910
  } catch {
2807
2911
  }
@@ -2815,8 +2919,31 @@ async function getMasterKey() {
2815
2919
  return null;
2816
2920
  }
2817
2921
  try {
2818
- const content = await readFile3(keyPath, "utf-8");
2819
- return Buffer.from(content.trim(), "base64");
2922
+ const content = (await readFile3(keyPath, "utf-8")).trim();
2923
+ let b64Value;
2924
+ if (content.startsWith(ENCRYPTED_PREFIX)) {
2925
+ const machineKey = deriveMachineKey();
2926
+ if (!machineKey) {
2927
+ process.stderr.write("[keychain] Cannot derive machine key to decrypt stored key.\n");
2928
+ return null;
2929
+ }
2930
+ const decrypted = decryptWithMachineKey(content, machineKey);
2931
+ if (!decrypted) {
2932
+ process.stderr.write(
2933
+ "[keychain] Key decryption failed \u2014 machine may have changed.\n Use your 24-word recovery phrase: exe-os link import\n"
2934
+ );
2935
+ return null;
2936
+ }
2937
+ b64Value = decrypted;
2938
+ } else {
2939
+ b64Value = content;
2940
+ }
2941
+ const key = Buffer.from(b64Value, "base64");
2942
+ const migrated = macKeychainSet(b64Value) || linuxSecretSet(b64Value);
2943
+ if (migrated) {
2944
+ process.stderr.write("[keychain] Migrated key from file to native keychain.\n");
2945
+ }
2946
+ return key;
2820
2947
  } catch (err) {
2821
2948
  process.stderr.write(
2822
2949
  `[keychain] Key read failed at ${keyPath}: ${err instanceof Error ? err.message : String(err)}
@@ -2825,12 +2952,13 @@ async function getMasterKey() {
2825
2952
  return null;
2826
2953
  }
2827
2954
  }
2828
- var SERVICE, ACCOUNT;
2955
+ var SERVICE, ACCOUNT, ENCRYPTED_PREFIX;
2829
2956
  var init_keychain = __esm({
2830
2957
  "src/lib/keychain.ts"() {
2831
2958
  "use strict";
2832
2959
  SERVICE = "exe-mem";
2833
2960
  ACCOUNT = "master-key";
2961
+ ENCRYPTED_PREFIX = "enc:";
2834
2962
  }
2835
2963
  });
2836
2964
 
@@ -1139,8 +1139,8 @@ function findPackageRoot() {
1139
1139
  function getAvailableMemoryGB() {
1140
1140
  if (process.platform === "darwin") {
1141
1141
  try {
1142
- const { execSync: execSync7 } = __require("child_process");
1143
- const vmstat = execSync7("vm_stat", { encoding: "utf8" });
1142
+ const { execSync: execSync8 } = __require("child_process");
1143
+ const vmstat = execSync8("vm_stat", { encoding: "utf8" });
1144
1144
  const pageSize = 16384;
1145
1145
  const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
1146
1146
  const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
@@ -2879,6 +2879,7 @@ var init_database = __esm({
2879
2879
  // src/lib/keychain.ts
2880
2880
  import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3, chmod as chmod2 } from "fs/promises";
2881
2881
  import { existsSync as existsSync6 } from "fs";
2882
+ import { execSync as execSync2 } from "child_process";
2882
2883
  import path6 from "path";
2883
2884
  import os5 from "os";
2884
2885
  function getKeyDir() {
@@ -2887,6 +2888,59 @@ function getKeyDir() {
2887
2888
  function getKeyPath() {
2888
2889
  return path6.join(getKeyDir(), "master.key");
2889
2890
  }
2891
+ function macKeychainGet() {
2892
+ if (process.platform !== "darwin") return null;
2893
+ try {
2894
+ return execSync2(
2895
+ `security find-generic-password -s "${SERVICE}" -a "${ACCOUNT}" -w 2>/dev/null`,
2896
+ { encoding: "utf-8", timeout: 5e3 }
2897
+ ).trim();
2898
+ } catch {
2899
+ return null;
2900
+ }
2901
+ }
2902
+ function macKeychainSet(value) {
2903
+ if (process.platform !== "darwin") return false;
2904
+ try {
2905
+ try {
2906
+ execSync2(
2907
+ `security delete-generic-password -s "${SERVICE}" -a "${ACCOUNT}" 2>/dev/null`,
2908
+ { timeout: 5e3 }
2909
+ );
2910
+ } catch {
2911
+ }
2912
+ execSync2(
2913
+ `security add-generic-password -s "${SERVICE}" -a "${ACCOUNT}" -w "${value}"`,
2914
+ { timeout: 5e3 }
2915
+ );
2916
+ return true;
2917
+ } catch {
2918
+ return false;
2919
+ }
2920
+ }
2921
+ function linuxSecretGet() {
2922
+ if (process.platform !== "linux") return null;
2923
+ try {
2924
+ return execSync2(
2925
+ `secret-tool lookup service "${SERVICE}" account "${ACCOUNT}" 2>/dev/null`,
2926
+ { encoding: "utf-8", timeout: 5e3 }
2927
+ ).trim();
2928
+ } catch {
2929
+ return null;
2930
+ }
2931
+ }
2932
+ function linuxSecretSet(value) {
2933
+ if (process.platform !== "linux") return false;
2934
+ try {
2935
+ execSync2(
2936
+ `echo -n "${value}" | secret-tool store --label="exe-os master key" service "${SERVICE}" account "${ACCOUNT}"`,
2937
+ { timeout: 5e3 }
2938
+ );
2939
+ return true;
2940
+ } catch {
2941
+ return false;
2942
+ }
2943
+ }
2890
2944
  async function tryKeytar() {
2891
2945
  try {
2892
2946
  return await import("keytar");
@@ -2894,13 +2948,63 @@ async function tryKeytar() {
2894
2948
  return null;
2895
2949
  }
2896
2950
  }
2951
+ function deriveMachineKey() {
2952
+ try {
2953
+ const crypto8 = __require("crypto");
2954
+ const material = [
2955
+ os5.hostname(),
2956
+ os5.userInfo().username,
2957
+ os5.arch(),
2958
+ os5.platform(),
2959
+ // Machine ID on Linux (stable across reboots)
2960
+ process.platform === "linux" ? readMachineId() : ""
2961
+ ].join("|");
2962
+ return crypto8.createHash("sha256").update(material).digest();
2963
+ } catch {
2964
+ return null;
2965
+ }
2966
+ }
2967
+ function readMachineId() {
2968
+ try {
2969
+ const { readFileSync: readFileSync14 } = __require("fs");
2970
+ return readFileSync14("/etc/machine-id", "utf-8").trim();
2971
+ } catch {
2972
+ return "";
2973
+ }
2974
+ }
2975
+ function decryptWithMachineKey(encrypted, machineKey) {
2976
+ if (!encrypted.startsWith(ENCRYPTED_PREFIX)) return null;
2977
+ try {
2978
+ const crypto8 = __require("crypto");
2979
+ const parts = encrypted.slice(ENCRYPTED_PREFIX.length).split(":");
2980
+ if (parts.length !== 3) return null;
2981
+ const [ivB64, tagB64, cipherB64] = parts;
2982
+ const iv = Buffer.from(ivB64, "base64");
2983
+ const authTag = Buffer.from(tagB64, "base64");
2984
+ const decipher = crypto8.createDecipheriv("aes-256-gcm", machineKey, iv);
2985
+ decipher.setAuthTag(authTag);
2986
+ let decrypted = decipher.update(cipherB64, "base64", "utf-8");
2987
+ decrypted += decipher.final("utf-8");
2988
+ return decrypted;
2989
+ } catch {
2990
+ return null;
2991
+ }
2992
+ }
2897
2993
  async function getMasterKey() {
2994
+ const nativeValue = macKeychainGet() ?? linuxSecretGet();
2995
+ if (nativeValue) {
2996
+ return Buffer.from(nativeValue, "base64");
2997
+ }
2898
2998
  const keytar = await tryKeytar();
2899
2999
  if (keytar) {
2900
3000
  try {
2901
- const stored = await keytar.getPassword(SERVICE, ACCOUNT);
2902
- if (stored) {
2903
- return Buffer.from(stored, "base64");
3001
+ const keytarValue = await keytar.getPassword(SERVICE, ACCOUNT);
3002
+ if (keytarValue) {
3003
+ const migrated = macKeychainSet(keytarValue) || linuxSecretSet(keytarValue);
3004
+ if (migrated) {
3005
+ process.stderr.write("[keychain] Migrated key from keytar to native keychain.\n");
3006
+ }
3007
+ return Buffer.from(keytarValue, "base64");
2904
3008
  }
2905
3009
  } catch {
2906
3010
  }
@@ -2914,8 +3018,31 @@ async function getMasterKey() {
2914
3018
  return null;
2915
3019
  }
2916
3020
  try {
2917
- const content = await readFile3(keyPath, "utf-8");
2918
- return Buffer.from(content.trim(), "base64");
3021
+ const content = (await readFile3(keyPath, "utf-8")).trim();
3022
+ let b64Value;
3023
+ if (content.startsWith(ENCRYPTED_PREFIX)) {
3024
+ const machineKey = deriveMachineKey();
3025
+ if (!machineKey) {
3026
+ process.stderr.write("[keychain] Cannot derive machine key to decrypt stored key.\n");
3027
+ return null;
3028
+ }
3029
+ const decrypted = decryptWithMachineKey(content, machineKey);
3030
+ if (!decrypted) {
3031
+ process.stderr.write(
3032
+ "[keychain] Key decryption failed \u2014 machine may have changed.\n Use your 24-word recovery phrase: exe-os link import\n"
3033
+ );
3034
+ return null;
3035
+ }
3036
+ b64Value = decrypted;
3037
+ } else {
3038
+ b64Value = content;
3039
+ }
3040
+ const key = Buffer.from(b64Value, "base64");
3041
+ const migrated = macKeychainSet(b64Value) || linuxSecretSet(b64Value);
3042
+ if (migrated) {
3043
+ process.stderr.write("[keychain] Migrated key from file to native keychain.\n");
3044
+ }
3045
+ return key;
2919
3046
  } catch (err) {
2920
3047
  process.stderr.write(
2921
3048
  `[keychain] Key read failed at ${keyPath}: ${err instanceof Error ? err.message : String(err)}
@@ -2924,12 +3051,13 @@ async function getMasterKey() {
2924
3051
  return null;
2925
3052
  }
2926
3053
  }
2927
- var SERVICE, ACCOUNT;
3054
+ var SERVICE, ACCOUNT, ENCRYPTED_PREFIX;
2928
3055
  var init_keychain = __esm({
2929
3056
  "src/lib/keychain.ts"() {
2930
3057
  "use strict";
2931
3058
  SERVICE = "exe-mem";
2932
3059
  ACCOUNT = "master-key";
3060
+ ENCRYPTED_PREFIX = "enc:";
2933
3061
  }
2934
3062
  });
2935
3063
 
@@ -4267,7 +4395,7 @@ var init_session_registry = __esm({
4267
4395
  });
4268
4396
 
4269
4397
  // src/lib/session-key.ts
4270
- import { execSync as execSync2 } from "child_process";
4398
+ import { execSync as execSync3 } from "child_process";
4271
4399
  function normalizeCommand(command) {
4272
4400
  const trimmed = command.trim().toLowerCase();
4273
4401
  const parts = trimmed.split(/[\\/]/);
@@ -4286,7 +4414,7 @@ function resolveRuntimeProcess() {
4286
4414
  let pid = process.ppid;
4287
4415
  for (let i = 0; i < 10; i++) {
4288
4416
  try {
4289
- const info = execSync2(`ps -p ${pid} -o ppid=,comm=`, {
4417
+ const info = execSync3(`ps -p ${pid} -o ppid=,comm=`, {
4290
4418
  encoding: "utf8",
4291
4419
  timeout: 2e3
4292
4420
  }).trim();
@@ -4464,14 +4592,14 @@ var init_transport = __esm({
4464
4592
  });
4465
4593
 
4466
4594
  // src/lib/cc-agent-support.ts
4467
- import { execSync as execSync3 } from "child_process";
4595
+ import { execSync as execSync4 } from "child_process";
4468
4596
  function _resetCcAgentSupportCache() {
4469
4597
  _cachedSupport = null;
4470
4598
  }
4471
4599
  function claudeSupportsAgentFlag() {
4472
4600
  if (_cachedSupport !== null) return _cachedSupport;
4473
4601
  try {
4474
- const helpOutput = execSync3("claude --help 2>&1", {
4602
+ const helpOutput = execSync4("claude --help 2>&1", {
4475
4603
  encoding: "utf-8",
4476
4604
  timeout: 5e3
4477
4605
  });
@@ -4868,7 +4996,7 @@ __export(project_name_exports, {
4868
4996
  _resetCache: () => _resetCache,
4869
4997
  getProjectName: () => getProjectName
4870
4998
  });
4871
- import { execSync as execSync4 } from "child_process";
4999
+ import { execSync as execSync5 } from "child_process";
4872
5000
  import path13 from "path";
4873
5001
  function getProjectName(cwd) {
4874
5002
  const dir = cwd ?? process.cwd();
@@ -4876,7 +5004,7 @@ function getProjectName(cwd) {
4876
5004
  try {
4877
5005
  let repoRoot;
4878
5006
  try {
4879
- const gitCommonDir = execSync4("git rev-parse --path-format=absolute --git-common-dir", {
5007
+ const gitCommonDir = execSync5("git rev-parse --path-format=absolute --git-common-dir", {
4880
5008
  cwd: dir,
4881
5009
  encoding: "utf8",
4882
5010
  timeout: 2e3,
@@ -4884,7 +5012,7 @@ function getProjectName(cwd) {
4884
5012
  }).trim();
4885
5013
  repoRoot = path13.dirname(gitCommonDir);
4886
5014
  } catch {
4887
- repoRoot = execSync4("git rev-parse --show-toplevel", {
5015
+ repoRoot = execSync5("git rev-parse --show-toplevel", {
4888
5016
  cwd: dir,
4889
5017
  encoding: "utf8",
4890
5018
  timeout: 2e3,
@@ -4979,7 +5107,7 @@ var init_session_scope = __esm({
4979
5107
  import crypto3 from "crypto";
4980
5108
  import path14 from "path";
4981
5109
  import os9 from "os";
4982
- import { execSync as execSync5 } from "child_process";
5110
+ import { execSync as execSync6 } from "child_process";
4983
5111
  import { mkdir as mkdir4, writeFile as writeFile4, appendFile } from "fs/promises";
4984
5112
  import { existsSync as existsSync13, readFileSync as readFileSync10 } from "fs";
4985
5113
  async function writeCheckpoint(input) {
@@ -5324,14 +5452,14 @@ function isTmuxSessionAlive(identifier) {
5324
5452
  if (!identifier || identifier === "unknown") return true;
5325
5453
  try {
5326
5454
  if (identifier.startsWith("%")) {
5327
- const output = execSync5("tmux list-panes -a -F '#{pane_id}'", {
5455
+ const output = execSync6("tmux list-panes -a -F '#{pane_id}'", {
5328
5456
  timeout: 2e3,
5329
5457
  encoding: "utf8",
5330
5458
  stdio: ["pipe", "pipe", "pipe"]
5331
5459
  });
5332
5460
  return output.split("\n").some((l) => l.trim() === identifier);
5333
5461
  } else {
5334
- execSync5(`tmux has-session -t ${JSON.stringify(identifier)}`, {
5462
+ execSync6(`tmux has-session -t ${JSON.stringify(identifier)}`, {
5335
5463
  timeout: 2e3,
5336
5464
  stdio: ["pipe", "pipe", "pipe"]
5337
5465
  });
@@ -5340,7 +5468,7 @@ function isTmuxSessionAlive(identifier) {
5340
5468
  } catch {
5341
5469
  if (identifier.startsWith("%")) return true;
5342
5470
  try {
5343
- execSync5("tmux list-sessions", {
5471
+ execSync6("tmux list-sessions", {
5344
5472
  timeout: 2e3,
5345
5473
  stdio: ["pipe", "pipe", "pipe"]
5346
5474
  });
@@ -5355,12 +5483,12 @@ function checkStaleCompletion(taskContext, taskCreatedAt) {
5355
5483
  if (!DELEGATION_KEYWORDS.test(taskContext)) return null;
5356
5484
  try {
5357
5485
  const since = new Date(taskCreatedAt).toISOString();
5358
- const branch = execSync5(
5486
+ const branch = execSync6(
5359
5487
  "git rev-parse --abbrev-ref HEAD 2>/dev/null",
5360
5488
  { encoding: "utf8", timeout: 3e3 }
5361
5489
  ).trim();
5362
5490
  const branchArg = branch && branch !== "HEAD" ? branch : "";
5363
- const commitCount = execSync5(
5491
+ const commitCount = execSync6(
5364
5492
  `git log --oneline --since="${since}" ${branchArg} 2>/dev/null | wc -l`,
5365
5493
  { encoding: "utf8", timeout: 5e3 }
5366
5494
  ).trim();
@@ -6650,7 +6778,7 @@ __export(tmux_routing_exports, {
6650
6778
  spawnEmployee: () => spawnEmployee,
6651
6779
  verifyPaneAtCapacity: () => verifyPaneAtCapacity
6652
6780
  });
6653
- import { execFileSync as execFileSync2, execSync as execSync6 } from "child_process";
6781
+ import { execFileSync as execFileSync2, execSync as execSync7 } from "child_process";
6654
6782
  import { readFileSync as readFileSync11, writeFileSync as writeFileSync8, mkdirSync as mkdirSync7, existsSync as existsSync14, appendFileSync, readdirSync as readdirSync2 } from "fs";
6655
6783
  import path17 from "path";
6656
6784
  import os10 from "os";
@@ -7360,7 +7488,7 @@ function spawnEmployee(employeeName, exeSession, projectDir, opts) {
7360
7488
  let booted = false;
7361
7489
  for (let i = 0; i < 30; i++) {
7362
7490
  try {
7363
- execSync6("sleep 0.5");
7491
+ execSync7("sleep 0.5");
7364
7492
  } catch {
7365
7493
  }
7366
7494
  try {
@@ -8232,8 +8360,8 @@ async function main() {
8232
8360
  const agentId = folderArg.startsWith("exe/") ? folderArg.slice(4) : folderArg;
8233
8361
  let tmuxSession;
8234
8362
  try {
8235
- const { execSync: execSync7 } = await import("child_process");
8236
- const out = execSync7("tmux display-message -p '#{session_name}' 2>/dev/null", {
8363
+ const { execSync: execSync8 } = await import("child_process");
8364
+ const out = execSync8("tmux display-message -p '#{session_name}' 2>/dev/null", {
8237
8365
  encoding: "utf8",
8238
8366
  timeout: 1e3
8239
8367
  }).trim();