@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
package/dist/index.js CHANGED
@@ -1893,8 +1893,8 @@ function findPackageRoot() {
1893
1893
  function getAvailableMemoryGB() {
1894
1894
  if (process.platform === "darwin") {
1895
1895
  try {
1896
- const { execSync: execSync8 } = __require("child_process");
1897
- const vmstat = execSync8("vm_stat", { encoding: "utf8" });
1896
+ const { execSync: execSync9 } = __require("child_process");
1897
+ const vmstat = execSync9("vm_stat", { encoding: "utf8" });
1898
1898
  const pageSize = 16384;
1899
1899
  const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
1900
1900
  const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
@@ -6803,6 +6803,7 @@ var init_tmux_routing = __esm({
6803
6803
  // src/lib/keychain.ts
6804
6804
  import { readFile as readFile4, writeFile as writeFile5, unlink, mkdir as mkdir4, chmod as chmod2 } from "fs/promises";
6805
6805
  import { existsSync as existsSync15 } from "fs";
6806
+ import { execSync as execSync8 } from "child_process";
6806
6807
  import path19 from "path";
6807
6808
  import os12 from "os";
6808
6809
  function getKeyDir() {
@@ -6811,6 +6812,59 @@ function getKeyDir() {
6811
6812
  function getKeyPath() {
6812
6813
  return path19.join(getKeyDir(), "master.key");
6813
6814
  }
6815
+ function macKeychainGet() {
6816
+ if (process.platform !== "darwin") return null;
6817
+ try {
6818
+ return execSync8(
6819
+ `security find-generic-password -s "${SERVICE}" -a "${ACCOUNT}" -w 2>/dev/null`,
6820
+ { encoding: "utf-8", timeout: 5e3 }
6821
+ ).trim();
6822
+ } catch {
6823
+ return null;
6824
+ }
6825
+ }
6826
+ function macKeychainSet(value) {
6827
+ if (process.platform !== "darwin") return false;
6828
+ try {
6829
+ try {
6830
+ execSync8(
6831
+ `security delete-generic-password -s "${SERVICE}" -a "${ACCOUNT}" 2>/dev/null`,
6832
+ { timeout: 5e3 }
6833
+ );
6834
+ } catch {
6835
+ }
6836
+ execSync8(
6837
+ `security add-generic-password -s "${SERVICE}" -a "${ACCOUNT}" -w "${value}"`,
6838
+ { timeout: 5e3 }
6839
+ );
6840
+ return true;
6841
+ } catch {
6842
+ return false;
6843
+ }
6844
+ }
6845
+ function linuxSecretGet() {
6846
+ if (process.platform !== "linux") return null;
6847
+ try {
6848
+ return execSync8(
6849
+ `secret-tool lookup service "${SERVICE}" account "${ACCOUNT}" 2>/dev/null`,
6850
+ { encoding: "utf-8", timeout: 5e3 }
6851
+ ).trim();
6852
+ } catch {
6853
+ return null;
6854
+ }
6855
+ }
6856
+ function linuxSecretSet(value) {
6857
+ if (process.platform !== "linux") return false;
6858
+ try {
6859
+ execSync8(
6860
+ `echo -n "${value}" | secret-tool store --label="exe-os master key" service "${SERVICE}" account "${ACCOUNT}"`,
6861
+ { timeout: 5e3 }
6862
+ );
6863
+ return true;
6864
+ } catch {
6865
+ return false;
6866
+ }
6867
+ }
6814
6868
  async function tryKeytar() {
6815
6869
  try {
6816
6870
  return await import("keytar");
@@ -6818,13 +6872,63 @@ async function tryKeytar() {
6818
6872
  return null;
6819
6873
  }
6820
6874
  }
6875
+ function deriveMachineKey() {
6876
+ try {
6877
+ const crypto11 = __require("crypto");
6878
+ const material = [
6879
+ os12.hostname(),
6880
+ os12.userInfo().username,
6881
+ os12.arch(),
6882
+ os12.platform(),
6883
+ // Machine ID on Linux (stable across reboots)
6884
+ process.platform === "linux" ? readMachineId() : ""
6885
+ ].join("|");
6886
+ return crypto11.createHash("sha256").update(material).digest();
6887
+ } catch {
6888
+ return null;
6889
+ }
6890
+ }
6891
+ function readMachineId() {
6892
+ try {
6893
+ const { readFileSync: readFileSync15 } = __require("fs");
6894
+ return readFileSync15("/etc/machine-id", "utf-8").trim();
6895
+ } catch {
6896
+ return "";
6897
+ }
6898
+ }
6899
+ function decryptWithMachineKey(encrypted, machineKey) {
6900
+ if (!encrypted.startsWith(ENCRYPTED_PREFIX)) return null;
6901
+ try {
6902
+ const crypto11 = __require("crypto");
6903
+ const parts = encrypted.slice(ENCRYPTED_PREFIX.length).split(":");
6904
+ if (parts.length !== 3) return null;
6905
+ const [ivB64, tagB64, cipherB64] = parts;
6906
+ const iv = Buffer.from(ivB64, "base64");
6907
+ const authTag = Buffer.from(tagB64, "base64");
6908
+ const decipher = crypto11.createDecipheriv("aes-256-gcm", machineKey, iv);
6909
+ decipher.setAuthTag(authTag);
6910
+ let decrypted = decipher.update(cipherB64, "base64", "utf-8");
6911
+ decrypted += decipher.final("utf-8");
6912
+ return decrypted;
6913
+ } catch {
6914
+ return null;
6915
+ }
6916
+ }
6821
6917
  async function getMasterKey() {
6918
+ const nativeValue = macKeychainGet() ?? linuxSecretGet();
6919
+ if (nativeValue) {
6920
+ return Buffer.from(nativeValue, "base64");
6921
+ }
6822
6922
  const keytar = await tryKeytar();
6823
6923
  if (keytar) {
6824
6924
  try {
6825
- const stored = await keytar.getPassword(SERVICE, ACCOUNT);
6826
- if (stored) {
6827
- return Buffer.from(stored, "base64");
6925
+ const keytarValue = await keytar.getPassword(SERVICE, ACCOUNT);
6926
+ if (keytarValue) {
6927
+ const migrated = macKeychainSet(keytarValue) || linuxSecretSet(keytarValue);
6928
+ if (migrated) {
6929
+ process.stderr.write("[keychain] Migrated key from keytar to native keychain.\n");
6930
+ }
6931
+ return Buffer.from(keytarValue, "base64");
6828
6932
  }
6829
6933
  } catch {
6830
6934
  }
@@ -6838,8 +6942,31 @@ async function getMasterKey() {
6838
6942
  return null;
6839
6943
  }
6840
6944
  try {
6841
- const content = await readFile4(keyPath, "utf-8");
6842
- return Buffer.from(content.trim(), "base64");
6945
+ const content = (await readFile4(keyPath, "utf-8")).trim();
6946
+ let b64Value;
6947
+ if (content.startsWith(ENCRYPTED_PREFIX)) {
6948
+ const machineKey = deriveMachineKey();
6949
+ if (!machineKey) {
6950
+ process.stderr.write("[keychain] Cannot derive machine key to decrypt stored key.\n");
6951
+ return null;
6952
+ }
6953
+ const decrypted = decryptWithMachineKey(content, machineKey);
6954
+ if (!decrypted) {
6955
+ process.stderr.write(
6956
+ "[keychain] Key decryption failed \u2014 machine may have changed.\n Use your 24-word recovery phrase: exe-os link import\n"
6957
+ );
6958
+ return null;
6959
+ }
6960
+ b64Value = decrypted;
6961
+ } else {
6962
+ b64Value = content;
6963
+ }
6964
+ const key = Buffer.from(b64Value, "base64");
6965
+ const migrated = macKeychainSet(b64Value) || linuxSecretSet(b64Value);
6966
+ if (migrated) {
6967
+ process.stderr.write("[keychain] Migrated key from file to native keychain.\n");
6968
+ }
6969
+ return key;
6843
6970
  } catch (err) {
6844
6971
  process.stderr.write(
6845
6972
  `[keychain] Key read failed at ${keyPath}: ${err instanceof Error ? err.message : String(err)}
@@ -6848,12 +6975,13 @@ async function getMasterKey() {
6848
6975
  return null;
6849
6976
  }
6850
6977
  }
6851
- var SERVICE, ACCOUNT;
6978
+ var SERVICE, ACCOUNT, ENCRYPTED_PREFIX;
6852
6979
  var init_keychain = __esm({
6853
6980
  "src/lib/keychain.ts"() {
6854
6981
  "use strict";
6855
6982
  SERVICE = "exe-mem";
6856
6983
  ACCOUNT = "master-key";
6984
+ ENCRYPTED_PREFIX = "enc:";
6857
6985
  }
6858
6986
  });
6859
6987