@askexenow/exe-os 0.8.89 → 0.8.91

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 (44) hide show
  1. package/dist/bin/backfill-conversations.js +10 -0
  2. package/dist/bin/backfill-responses.js +10 -0
  3. package/dist/bin/backfill-vectors.js +10 -0
  4. package/dist/bin/cli.js +75 -30
  5. package/dist/bin/exe-assign.js +13 -3
  6. package/dist/bin/exe-boot.js +34 -24
  7. package/dist/bin/exe-gateway.js +36 -26
  8. package/dist/bin/exe-link.js +10 -0
  9. package/dist/bin/exe-rename.js +10 -0
  10. package/dist/bin/exe-search.js +10 -0
  11. package/dist/bin/exe-session-cleanup.js +30 -20
  12. package/dist/bin/git-sweep.js +25 -15
  13. package/dist/bin/scan-tasks.js +27 -17
  14. package/dist/bin/setup.js +52 -7
  15. package/dist/gateway/index.js +34 -24
  16. package/dist/hooks/commit-complete.js +25 -15
  17. package/dist/hooks/error-recall.js +10 -0
  18. package/dist/hooks/ingest-worker.js +30 -20
  19. package/dist/hooks/instructions-loaded.js +15 -5
  20. package/dist/hooks/notification.js +13 -3
  21. package/dist/hooks/post-compact.js +17 -7
  22. package/dist/hooks/pre-compact.js +25 -15
  23. package/dist/hooks/pre-tool-use.js +20 -10
  24. package/dist/hooks/prompt-ingest-worker.js +10 -0
  25. package/dist/hooks/prompt-submit.js +20 -10
  26. package/dist/hooks/response-ingest-worker.js +10 -0
  27. package/dist/hooks/session-end.js +26 -16
  28. package/dist/hooks/session-start.js +19 -9
  29. package/dist/hooks/stop.js +17 -7
  30. package/dist/hooks/subagent-stop.js +17 -7
  31. package/dist/hooks/summary-worker.js +23 -13
  32. package/dist/index.js +29 -19
  33. package/dist/lib/cloud-sync.js +13 -3
  34. package/dist/lib/database.js +10 -0
  35. package/dist/lib/db-daemon-client.js +10 -0
  36. package/dist/lib/device-registry.js +12 -2
  37. package/dist/lib/embedder.js +10 -0
  38. package/dist/lib/exe-daemon-client.js +10 -0
  39. package/dist/lib/exe-daemon.js +31 -21
  40. package/dist/lib/hybrid-search.js +10 -0
  41. package/dist/mcp/server.js +38 -28
  42. package/dist/runtime/index.js +25 -15
  43. package/dist/tui/App.js +27 -17
  44. package/package.json +1 -1
@@ -2698,6 +2698,7 @@ var init_reranker = __esm({
2698
2698
 
2699
2699
  // src/lib/exe-daemon-client.ts
2700
2700
  import net from "net";
2701
+ import os4 from "os";
2701
2702
  import { spawn } from "child_process";
2702
2703
  import { randomUUID as randomUUID2 } from "crypto";
2703
2704
  import { existsSync as existsSync6, unlinkSync as unlinkSync2, readFileSync as readFileSync3, openSync, closeSync, statSync } from "fs";
@@ -2761,6 +2762,15 @@ function findPackageRoot() {
2761
2762
  return null;
2762
2763
  }
2763
2764
  function spawnDaemon() {
2765
+ const freeGB = os4.freemem() / (1024 * 1024 * 1024);
2766
+ const totalGB = os4.totalmem() / (1024 * 1024 * 1024);
2767
+ if (freeGB < 1.5 && totalGB <= 8) {
2768
+ process.stderr.write(
2769
+ `[exed-client] SKIP: low memory (${freeGB.toFixed(1)}GB free / ${totalGB.toFixed(0)}GB total). Embedding daemon not started \u2014 using keyword search only. Close other apps and retry.
2770
+ `
2771
+ );
2772
+ return;
2773
+ }
2764
2774
  const pkgRoot = findPackageRoot();
2765
2775
  if (!pkgRoot) {
2766
2776
  process.stderr.write("[exed-client] WARN: cannot find package root\n");
@@ -3977,12 +3987,12 @@ var init_session_key = __esm({
3977
3987
 
3978
3988
  // src/lib/session-registry.ts
3979
3989
  import path10 from "path";
3980
- import os4 from "os";
3990
+ import os5 from "os";
3981
3991
  var REGISTRY_PATH;
3982
3992
  var init_session_registry = __esm({
3983
3993
  "src/lib/session-registry.ts"() {
3984
3994
  "use strict";
3985
- REGISTRY_PATH = path10.join(os4.homedir(), ".exe-os", "session-registry.json");
3995
+ REGISTRY_PATH = path10.join(os5.homedir(), ".exe-os", "session-registry.json");
3986
3996
  }
3987
3997
  });
3988
3998
 
@@ -4176,7 +4186,7 @@ __export(intercom_queue_exports, {
4176
4186
  });
4177
4187
  import { readFileSync as readFileSync7, writeFileSync as writeFileSync4, renameSync as renameSync3, existsSync as existsSync9, mkdirSync as mkdirSync4 } from "fs";
4178
4188
  import path12 from "path";
4179
- import os5 from "os";
4189
+ import os6 from "os";
4180
4190
  function ensureDir() {
4181
4191
  const dir = path12.dirname(QUEUE_PATH);
4182
4192
  if (!existsSync9(dir)) mkdirSync4(dir, { recursive: true });
@@ -4275,10 +4285,10 @@ var QUEUE_PATH, MAX_RETRIES2, TTL_MS, INTERCOM_LOG;
4275
4285
  var init_intercom_queue = __esm({
4276
4286
  "src/lib/intercom-queue.ts"() {
4277
4287
  "use strict";
4278
- QUEUE_PATH = path12.join(os5.homedir(), ".exe-os", "intercom-queue.json");
4288
+ QUEUE_PATH = path12.join(os6.homedir(), ".exe-os", "intercom-queue.json");
4279
4289
  MAX_RETRIES2 = 5;
4280
4290
  TTL_MS = 60 * 60 * 1e3;
4281
- INTERCOM_LOG = path12.join(os5.homedir(), ".exe-os", "intercom.log");
4291
+ INTERCOM_LOG = path12.join(os6.homedir(), ".exe-os", "intercom.log");
4282
4292
  }
4283
4293
  });
4284
4294
 
@@ -4316,7 +4326,7 @@ var init_plan_limits = __esm({
4316
4326
  // src/lib/tmux-routing.ts
4317
4327
  import { readFileSync as readFileSync10, writeFileSync as writeFileSync6, mkdirSync as mkdirSync6, existsSync as existsSync12, appendFileSync } from "fs";
4318
4328
  import path15 from "path";
4319
- import os6 from "os";
4329
+ import os7 from "os";
4320
4330
  import { fileURLToPath as fileURLToPath2 } from "url";
4321
4331
  function getMySession() {
4322
4332
  return getTransport().getMySession();
@@ -4514,11 +4524,11 @@ var init_tmux_routing = __esm({
4514
4524
  init_intercom_queue();
4515
4525
  init_plan_limits();
4516
4526
  init_employees();
4517
- SPAWN_LOCK_DIR = path15.join(os6.homedir(), ".exe-os", "spawn-locks");
4518
- SESSION_CACHE = path15.join(os6.homedir(), ".exe-os", "session-cache");
4527
+ SPAWN_LOCK_DIR = path15.join(os7.homedir(), ".exe-os", "spawn-locks");
4528
+ SESSION_CACHE = path15.join(os7.homedir(), ".exe-os", "session-cache");
4519
4529
  VALID_SESSION_NAME = /^[a-z]+\d*-[a-zA-Z0-9_]+$/;
4520
4530
  INTERCOM_DEBOUNCE_MS = 3e4;
4521
- INTERCOM_LOG2 = path15.join(os6.homedir(), ".exe-os", "intercom.log");
4531
+ INTERCOM_LOG2 = path15.join(os7.homedir(), ".exe-os", "intercom.log");
4522
4532
  DEBOUNCE_FILE = path15.join(SESSION_CACHE, "intercom-debounce.json");
4523
4533
  DEBOUNCE_CLEANUP_AGE_MS = 5 * 60 * 1e3;
4524
4534
  BUSY_PATTERN = /[✻✽✶✳·].*…|Running…/;
@@ -4779,7 +4789,7 @@ var init_messaging = __esm({
4779
4789
  // src/lib/notifications.ts
4780
4790
  import crypto3 from "crypto";
4781
4791
  import path16 from "path";
4782
- import os7 from "os";
4792
+ import os8 from "os";
4783
4793
  import {
4784
4794
  readFileSync as readFileSync11,
4785
4795
  readdirSync as readdirSync4,
@@ -1770,6 +1770,7 @@ ${p.content}`).join("\n\n");
1770
1770
 
1771
1771
  // src/lib/exe-daemon-client.ts
1772
1772
  import net from "net";
1773
+ import os4 from "os";
1773
1774
  import { spawn } from "child_process";
1774
1775
  import { randomUUID as randomUUID2 } from "crypto";
1775
1776
  import { existsSync as existsSync5, unlinkSync as unlinkSync2, readFileSync as readFileSync3, openSync, closeSync, statSync } from "fs";
@@ -1833,6 +1834,15 @@ function findPackageRoot() {
1833
1834
  return null;
1834
1835
  }
1835
1836
  function spawnDaemon() {
1837
+ const freeGB = os4.freemem() / (1024 * 1024 * 1024);
1838
+ const totalGB = os4.totalmem() / (1024 * 1024 * 1024);
1839
+ if (freeGB < 1.5 && totalGB <= 8) {
1840
+ process.stderr.write(
1841
+ `[exed-client] SKIP: low memory (${freeGB.toFixed(1)}GB free / ${totalGB.toFixed(0)}GB total). Embedding daemon not started \u2014 using keyword search only. Close other apps and retry.
1842
+ `
1843
+ );
1844
+ return;
1845
+ }
1836
1846
  const pkgRoot = findPackageRoot();
1837
1847
  if (!pkgRoot) {
1838
1848
  process.stderr.write("[exed-client] WARN: cannot find package root\n");
@@ -662,6 +662,7 @@ var init_db_retry = __esm({
662
662
 
663
663
  // src/lib/exe-daemon-client.ts
664
664
  import net from "net";
665
+ import os5 from "os";
665
666
  import { spawn } from "child_process";
666
667
  import { randomUUID } from "crypto";
667
668
  import { existsSync as existsSync6, unlinkSync as unlinkSync3, readFileSync as readFileSync7, openSync, closeSync, statSync } from "fs";
@@ -725,6 +726,15 @@ function findPackageRoot() {
725
726
  return null;
726
727
  }
727
728
  function spawnDaemon() {
729
+ const freeGB = os5.freemem() / (1024 * 1024 * 1024);
730
+ const totalGB = os5.totalmem() / (1024 * 1024 * 1024);
731
+ if (freeGB < 1.5 && totalGB <= 8) {
732
+ process.stderr.write(
733
+ `[exed-client] SKIP: low memory (${freeGB.toFixed(1)}GB free / ${totalGB.toFixed(0)}GB total). Embedding daemon not started \u2014 using keyword search only. Close other apps and retry.
734
+ `
735
+ );
736
+ return;
737
+ }
728
738
  const pkgRoot = findPackageRoot();
729
739
  if (!pkgRoot) {
730
740
  process.stderr.write("[exed-client] WARN: cannot find package root\n");
@@ -2225,7 +2235,7 @@ __export(notifications_exports, {
2225
2235
  });
2226
2236
  import crypto from "crypto";
2227
2237
  import path10 from "path";
2228
- import os5 from "os";
2238
+ import os6 from "os";
2229
2239
  import {
2230
2240
  readFileSync as readFileSync10,
2231
2241
  readdirSync as readdirSync2,
@@ -2366,7 +2376,7 @@ function formatNotifications(notifications) {
2366
2376
  return lines.join("\n");
2367
2377
  }
2368
2378
  async function migrateJsonNotifications() {
2369
- const base = process.env.EXE_OS_DIR || process.env.EXE_MEM_DIR || path10.join(os5.homedir(), ".exe-os");
2379
+ const base = process.env.EXE_OS_DIR || process.env.EXE_MEM_DIR || path10.join(os6.homedir(), ".exe-os");
2370
2380
  const notifDir = path10.join(base, "notifications");
2371
2381
  if (!existsSync9(notifDir)) return 0;
2372
2382
  let migrated = 0;
@@ -2554,7 +2564,7 @@ __export(tasks_crud_exports, {
2554
2564
  });
2555
2565
  import crypto3 from "crypto";
2556
2566
  import path11 from "path";
2557
- import os6 from "os";
2567
+ import os7 from "os";
2558
2568
  import { execSync as execSync5 } from "child_process";
2559
2569
  import { mkdir as mkdir3, writeFile as writeFile3, appendFile } from "fs/promises";
2560
2570
  import { existsSync as existsSync10, readFileSync as readFileSync11 } from "fs";
@@ -2769,7 +2779,7 @@ ${laneWarning}` : laneWarning;
2769
2779
  });
2770
2780
  if (input2.baseDir) {
2771
2781
  try {
2772
- const EXE_OS_DIR = path11.join(os6.homedir(), ".exe-os");
2782
+ const EXE_OS_DIR = path11.join(os7.homedir(), ".exe-os");
2773
2783
  const mdPath = path11.join(EXE_OS_DIR, taskFile);
2774
2784
  const mdDir = path11.dirname(mdPath);
2775
2785
  if (!existsSync10(mdDir)) await mkdir3(mdDir, { recursive: true });
@@ -4415,7 +4425,7 @@ __export(tmux_routing_exports, {
4415
4425
  import { execFileSync as execFileSync2, execSync as execSync7 } from "child_process";
4416
4426
  import { readFileSync as readFileSync12, writeFileSync as writeFileSync8, mkdirSync as mkdirSync7, existsSync as existsSync12, appendFileSync } from "fs";
4417
4427
  import path16 from "path";
4418
- import os7 from "os";
4428
+ import os8 from "os";
4419
4429
  import { fileURLToPath as fileURLToPath2 } from "url";
4420
4430
  import { unlinkSync as unlinkSync7 } from "fs";
4421
4431
  function spawnLockPath(sessionName) {
@@ -4829,7 +4839,7 @@ function spawnEmployee(employeeName, exeSession, projectDir, opts) {
4829
4839
  const transport = getTransport();
4830
4840
  const sessionName = employeeSessionName(employeeName, exeSession, opts?.instance);
4831
4841
  const instanceLabel = opts?.instance != null && opts.instance > 0 ? `${employeeName}${opts.instance}` : employeeName;
4832
- const logDir = path16.join(os7.homedir(), ".exe-os", "session-logs");
4842
+ const logDir = path16.join(os8.homedir(), ".exe-os", "session-logs");
4833
4843
  const logFile = path16.join(logDir, `${instanceLabel}-${Date.now()}.log`);
4834
4844
  if (!existsSync12(logDir)) {
4835
4845
  mkdirSync7(logDir, { recursive: true });
@@ -4845,7 +4855,7 @@ function spawnEmployee(employeeName, exeSession, projectDir, opts) {
4845
4855
  } catch {
4846
4856
  }
4847
4857
  try {
4848
- const claudeJsonPath = path16.join(os7.homedir(), ".claude.json");
4858
+ const claudeJsonPath = path16.join(os8.homedir(), ".claude.json");
4849
4859
  let claudeJson = {};
4850
4860
  try {
4851
4861
  claudeJson = JSON.parse(readFileSync12(claudeJsonPath, "utf8"));
@@ -4860,7 +4870,7 @@ function spawnEmployee(employeeName, exeSession, projectDir, opts) {
4860
4870
  } catch {
4861
4871
  }
4862
4872
  try {
4863
- const settingsDir = path16.join(os7.homedir(), ".claude", "projects");
4873
+ const settingsDir = path16.join(os8.homedir(), ".claude", "projects");
4864
4874
  const normalizedKey = (opts?.cwd ?? projectDir).replace(/\//g, "-").replace(/^-/, "");
4865
4875
  const projSettingsDir = path16.join(settingsDir, normalizedKey);
4866
4876
  const settingsPath = path16.join(projSettingsDir, "settings.json");
@@ -4911,7 +4921,7 @@ function spawnEmployee(employeeName, exeSession, projectDir, opts) {
4911
4921
  let legacyFallbackWarned = false;
4912
4922
  if (!useExeAgent && !useBinSymlink) {
4913
4923
  const identityPath = path16.join(
4914
- os7.homedir(),
4924
+ os8.homedir(),
4915
4925
  ".exe-os",
4916
4926
  "identity",
4917
4927
  `${employeeName}.md`
@@ -4941,7 +4951,7 @@ function spawnEmployee(employeeName, exeSession, projectDir, opts) {
4941
4951
  }
4942
4952
  let sessionContextFlag = "";
4943
4953
  try {
4944
- const ctxDir = path16.join(os7.homedir(), ".exe-os", "session-cache");
4954
+ const ctxDir = path16.join(os8.homedir(), ".exe-os", "session-cache");
4945
4955
  mkdirSync7(ctxDir, { recursive: true });
4946
4956
  const ctxFile = path16.join(ctxDir, `session-context-${sessionName}.md`);
4947
4957
  const ctxContent = [
@@ -5102,13 +5112,13 @@ var init_tmux_routing = __esm({
5102
5112
  init_intercom_queue();
5103
5113
  init_plan_limits();
5104
5114
  init_employees();
5105
- SPAWN_LOCK_DIR = path16.join(os7.homedir(), ".exe-os", "spawn-locks");
5106
- SESSION_CACHE = path16.join(os7.homedir(), ".exe-os", "session-cache");
5115
+ SPAWN_LOCK_DIR = path16.join(os8.homedir(), ".exe-os", "spawn-locks");
5116
+ SESSION_CACHE = path16.join(os8.homedir(), ".exe-os", "session-cache");
5107
5117
  BEHAVIORS_EXPORT_TIMEOUT_MS = 1e4;
5108
5118
  VALID_SESSION_NAME = /^[a-z]+\d*-[a-zA-Z0-9_]+$/;
5109
5119
  VERIFY_PANE_LINES = 200;
5110
5120
  INTERCOM_DEBOUNCE_MS = 3e4;
5111
- INTERCOM_LOG2 = path16.join(os7.homedir(), ".exe-os", "intercom.log");
5121
+ INTERCOM_LOG2 = path16.join(os8.homedir(), ".exe-os", "intercom.log");
5112
5122
  DEBOUNCE_FILE = path16.join(SESSION_CACHE, "intercom-debounce.json");
5113
5123
  DEBOUNCE_CLEANUP_AGE_MS = 5 * 60 * 1e3;
5114
5124
  BUSY_PATTERN = /[✻✽✶✳·].*…|Running…/;
@@ -5152,9 +5162,9 @@ var init_memory = __esm({
5152
5162
  import { readFile as readFile4, writeFile as writeFile5, unlink, mkdir as mkdir4, chmod as chmod2 } from "fs/promises";
5153
5163
  import { existsSync as existsSync13 } from "fs";
5154
5164
  import path17 from "path";
5155
- import os8 from "os";
5165
+ import os9 from "os";
5156
5166
  function getKeyDir() {
5157
- return process.env.EXE_OS_DIR ?? process.env.EXE_MEM_DIR ?? path17.join(os8.homedir(), ".exe-os");
5167
+ return process.env.EXE_OS_DIR ?? process.env.EXE_MEM_DIR ?? path17.join(os9.homedir(), ".exe-os");
5158
5168
  }
5159
5169
  function getKeyPath() {
5160
5170
  return path17.join(getKeyDir(), "master.key");
@@ -5180,7 +5190,7 @@ async function getMasterKey() {
5180
5190
  const keyPath = getKeyPath();
5181
5191
  if (!existsSync13(keyPath)) {
5182
5192
  process.stderr.write(
5183
- `[keychain] Key not found at ${keyPath} (HOME=${os8.homedir()}, EXE_OS_DIR=${process.env.EXE_OS_DIR ?? "unset"})
5193
+ `[keychain] Key not found at ${keyPath} (HOME=${os9.homedir()}, EXE_OS_DIR=${process.env.EXE_OS_DIR ?? "unset"})
5184
5194
  `
5185
5195
  );
5186
5196
  return null;
@@ -2681,6 +2681,7 @@ var init_reranker = __esm({
2681
2681
 
2682
2682
  // src/lib/exe-daemon-client.ts
2683
2683
  import net from "net";
2684
+ import os4 from "os";
2684
2685
  import { spawn } from "child_process";
2685
2686
  import { randomUUID as randomUUID2 } from "crypto";
2686
2687
  import { existsSync as existsSync6, unlinkSync as unlinkSync2, readFileSync as readFileSync3, openSync, closeSync, statSync } from "fs";
@@ -2744,6 +2745,15 @@ function findPackageRoot() {
2744
2745
  return null;
2745
2746
  }
2746
2747
  function spawnDaemon() {
2748
+ const freeGB = os4.freemem() / (1024 * 1024 * 1024);
2749
+ const totalGB = os4.totalmem() / (1024 * 1024 * 1024);
2750
+ if (freeGB < 1.5 && totalGB <= 8) {
2751
+ process.stderr.write(
2752
+ `[exed-client] SKIP: low memory (${freeGB.toFixed(1)}GB free / ${totalGB.toFixed(0)}GB total). Embedding daemon not started \u2014 using keyword search only. Close other apps and retry.
2753
+ `
2754
+ );
2755
+ return;
2756
+ }
2747
2757
  const pkgRoot = findPackageRoot();
2748
2758
  if (!pkgRoot) {
2749
2759
  process.stderr.write("[exed-client] WARN: cannot find package root\n");
@@ -3960,12 +3970,12 @@ var init_session_key = __esm({
3960
3970
 
3961
3971
  // src/lib/session-registry.ts
3962
3972
  import path10 from "path";
3963
- import os4 from "os";
3973
+ import os5 from "os";
3964
3974
  var REGISTRY_PATH;
3965
3975
  var init_session_registry = __esm({
3966
3976
  "src/lib/session-registry.ts"() {
3967
3977
  "use strict";
3968
- REGISTRY_PATH = path10.join(os4.homedir(), ".exe-os", "session-registry.json");
3978
+ REGISTRY_PATH = path10.join(os5.homedir(), ".exe-os", "session-registry.json");
3969
3979
  }
3970
3980
  });
3971
3981
 
@@ -4144,14 +4154,14 @@ var init_agent_config = __esm({
4144
4154
  // src/lib/intercom-queue.ts
4145
4155
  import { readFileSync as readFileSync7, writeFileSync as writeFileSync4, renameSync as renameSync3, existsSync as existsSync9, mkdirSync as mkdirSync4 } from "fs";
4146
4156
  import path12 from "path";
4147
- import os5 from "os";
4157
+ import os6 from "os";
4148
4158
  var QUEUE_PATH, TTL_MS, INTERCOM_LOG;
4149
4159
  var init_intercom_queue = __esm({
4150
4160
  "src/lib/intercom-queue.ts"() {
4151
4161
  "use strict";
4152
- QUEUE_PATH = path12.join(os5.homedir(), ".exe-os", "intercom-queue.json");
4162
+ QUEUE_PATH = path12.join(os6.homedir(), ".exe-os", "intercom-queue.json");
4153
4163
  TTL_MS = 60 * 60 * 1e3;
4154
- INTERCOM_LOG = path12.join(os5.homedir(), ".exe-os", "intercom.log");
4164
+ INTERCOM_LOG = path12.join(os6.homedir(), ".exe-os", "intercom.log");
4155
4165
  }
4156
4166
  });
4157
4167
 
@@ -4189,7 +4199,7 @@ var init_plan_limits = __esm({
4189
4199
  // src/lib/tmux-routing.ts
4190
4200
  import { readFileSync as readFileSync10, writeFileSync as writeFileSync6, mkdirSync as mkdirSync6, existsSync as existsSync12, appendFileSync } from "fs";
4191
4201
  import path15 from "path";
4192
- import os6 from "os";
4202
+ import os7 from "os";
4193
4203
  import { fileURLToPath as fileURLToPath2 } from "url";
4194
4204
  function getMySession() {
4195
4205
  return getTransport().getMySession();
@@ -4236,9 +4246,9 @@ var init_tmux_routing = __esm({
4236
4246
  init_intercom_queue();
4237
4247
  init_plan_limits();
4238
4248
  init_employees();
4239
- SPAWN_LOCK_DIR = path15.join(os6.homedir(), ".exe-os", "spawn-locks");
4240
- SESSION_CACHE = path15.join(os6.homedir(), ".exe-os", "session-cache");
4241
- INTERCOM_LOG2 = path15.join(os6.homedir(), ".exe-os", "intercom.log");
4249
+ SPAWN_LOCK_DIR = path15.join(os7.homedir(), ".exe-os", "spawn-locks");
4250
+ SESSION_CACHE = path15.join(os7.homedir(), ".exe-os", "session-cache");
4251
+ INTERCOM_LOG2 = path15.join(os7.homedir(), ".exe-os", "intercom.log");
4242
4252
  DEBOUNCE_FILE = path15.join(SESSION_CACHE, "intercom-debounce.json");
4243
4253
  DEBOUNCE_CLEANUP_AGE_MS = 5 * 60 * 1e3;
4244
4254
  }
@@ -557,6 +557,7 @@ var init_db_retry = __esm({
557
557
 
558
558
  // src/lib/exe-daemon-client.ts
559
559
  import net from "net";
560
+ import os5 from "os";
560
561
  import { spawn } from "child_process";
561
562
  import { randomUUID } from "crypto";
562
563
  import { existsSync as existsSync5, unlinkSync as unlinkSync3, readFileSync as readFileSync6, openSync, closeSync, statSync } from "fs";
@@ -620,6 +621,15 @@ function findPackageRoot() {
620
621
  return null;
621
622
  }
622
623
  function spawnDaemon() {
624
+ const freeGB = os5.freemem() / (1024 * 1024 * 1024);
625
+ const totalGB = os5.totalmem() / (1024 * 1024 * 1024);
626
+ if (freeGB < 1.5 && totalGB <= 8) {
627
+ process.stderr.write(
628
+ `[exed-client] SKIP: low memory (${freeGB.toFixed(1)}GB free / ${totalGB.toFixed(0)}GB total). Embedding daemon not started \u2014 using keyword search only. Close other apps and retry.
629
+ `
630
+ );
631
+ return;
632
+ }
623
633
  const pkgRoot = findPackageRoot();
624
634
  if (!pkgRoot) {
625
635
  process.stderr.write("[exed-client] WARN: cannot find package root\n");
@@ -2039,7 +2049,7 @@ var init_plan_limits = __esm({
2039
2049
  // src/lib/tmux-routing.ts
2040
2050
  import { readFileSync as readFileSync9, writeFileSync as writeFileSync6, mkdirSync as mkdirSync5, existsSync as existsSync8, appendFileSync } from "fs";
2041
2051
  import path10 from "path";
2042
- import os5 from "os";
2052
+ import os6 from "os";
2043
2053
  import { fileURLToPath as fileURLToPath2 } from "url";
2044
2054
  function getMySession() {
2045
2055
  return getTransport().getMySession();
@@ -2086,9 +2096,9 @@ var init_tmux_routing = __esm({
2086
2096
  init_intercom_queue();
2087
2097
  init_plan_limits();
2088
2098
  init_employees();
2089
- SPAWN_LOCK_DIR = path10.join(os5.homedir(), ".exe-os", "spawn-locks");
2090
- SESSION_CACHE = path10.join(os5.homedir(), ".exe-os", "session-cache");
2091
- INTERCOM_LOG2 = path10.join(os5.homedir(), ".exe-os", "intercom.log");
2099
+ SPAWN_LOCK_DIR = path10.join(os6.homedir(), ".exe-os", "spawn-locks");
2100
+ SESSION_CACHE = path10.join(os6.homedir(), ".exe-os", "session-cache");
2101
+ INTERCOM_LOG2 = path10.join(os6.homedir(), ".exe-os", "intercom.log");
2092
2102
  DEBOUNCE_FILE = path10.join(SESSION_CACHE, "intercom-debounce.json");
2093
2103
  DEBOUNCE_CLEANUP_AGE_MS = 5 * 60 * 1e3;
2094
2104
  }
@@ -2131,9 +2141,9 @@ var init_memory = __esm({
2131
2141
  import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3, chmod as chmod2 } from "fs/promises";
2132
2142
  import { existsSync as existsSync9 } from "fs";
2133
2143
  import path11 from "path";
2134
- import os6 from "os";
2144
+ import os7 from "os";
2135
2145
  function getKeyDir() {
2136
- return process.env.EXE_OS_DIR ?? process.env.EXE_MEM_DIR ?? path11.join(os6.homedir(), ".exe-os");
2146
+ return process.env.EXE_OS_DIR ?? process.env.EXE_MEM_DIR ?? path11.join(os7.homedir(), ".exe-os");
2137
2147
  }
2138
2148
  function getKeyPath() {
2139
2149
  return path11.join(getKeyDir(), "master.key");
@@ -2159,7 +2169,7 @@ async function getMasterKey() {
2159
2169
  const keyPath = getKeyPath();
2160
2170
  if (!existsSync9(keyPath)) {
2161
2171
  process.stderr.write(
2162
- `[keychain] Key not found at ${keyPath} (HOME=${os6.homedir()}, EXE_OS_DIR=${process.env.EXE_OS_DIR ?? "unset"})
2172
+ `[keychain] Key not found at ${keyPath} (HOME=${os7.homedir()}, EXE_OS_DIR=${process.env.EXE_OS_DIR ?? "unset"})
2163
2173
  `
2164
2174
  );
2165
2175
  return null;
@@ -538,6 +538,7 @@ var init_db_retry = __esm({
538
538
 
539
539
  // src/lib/exe-daemon-client.ts
540
540
  import net from "net";
541
+ import os5 from "os";
541
542
  import { spawn } from "child_process";
542
543
  import { randomUUID } from "crypto";
543
544
  import { existsSync as existsSync5, unlinkSync as unlinkSync3, readFileSync as readFileSync6, openSync, closeSync, statSync } from "fs";
@@ -601,6 +602,15 @@ function findPackageRoot() {
601
602
  return null;
602
603
  }
603
604
  function spawnDaemon() {
605
+ const freeGB = os5.freemem() / (1024 * 1024 * 1024);
606
+ const totalGB = os5.totalmem() / (1024 * 1024 * 1024);
607
+ if (freeGB < 1.5 && totalGB <= 8) {
608
+ process.stderr.write(
609
+ `[exed-client] SKIP: low memory (${freeGB.toFixed(1)}GB free / ${totalGB.toFixed(0)}GB total). Embedding daemon not started \u2014 using keyword search only. Close other apps and retry.
610
+ `
611
+ );
612
+ return;
613
+ }
604
614
  const pkgRoot = findPackageRoot();
605
615
  if (!pkgRoot) {
606
616
  process.stderr.write("[exed-client] WARN: cannot find package root\n");
@@ -2020,7 +2030,7 @@ var init_plan_limits = __esm({
2020
2030
  // src/lib/tmux-routing.ts
2021
2031
  import { readFileSync as readFileSync9, writeFileSync as writeFileSync6, mkdirSync as mkdirSync5, existsSync as existsSync8, appendFileSync } from "fs";
2022
2032
  import path10 from "path";
2023
- import os5 from "os";
2033
+ import os6 from "os";
2024
2034
  import { fileURLToPath as fileURLToPath2 } from "url";
2025
2035
  function getMySession() {
2026
2036
  return getTransport().getMySession();
@@ -2067,9 +2077,9 @@ var init_tmux_routing = __esm({
2067
2077
  init_intercom_queue();
2068
2078
  init_plan_limits();
2069
2079
  init_employees();
2070
- SPAWN_LOCK_DIR = path10.join(os5.homedir(), ".exe-os", "spawn-locks");
2071
- SESSION_CACHE = path10.join(os5.homedir(), ".exe-os", "session-cache");
2072
- INTERCOM_LOG2 = path10.join(os5.homedir(), ".exe-os", "intercom.log");
2080
+ SPAWN_LOCK_DIR = path10.join(os6.homedir(), ".exe-os", "spawn-locks");
2081
+ SESSION_CACHE = path10.join(os6.homedir(), ".exe-os", "session-cache");
2082
+ INTERCOM_LOG2 = path10.join(os6.homedir(), ".exe-os", "intercom.log");
2073
2083
  DEBOUNCE_FILE = path10.join(SESSION_CACHE, "intercom-debounce.json");
2074
2084
  DEBOUNCE_CLEANUP_AGE_MS = 5 * 60 * 1e3;
2075
2085
  }
@@ -2112,9 +2122,9 @@ var init_memory = __esm({
2112
2122
  import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3, chmod as chmod2 } from "fs/promises";
2113
2123
  import { existsSync as existsSync9 } from "fs";
2114
2124
  import path11 from "path";
2115
- import os6 from "os";
2125
+ import os7 from "os";
2116
2126
  function getKeyDir() {
2117
- return process.env.EXE_OS_DIR ?? process.env.EXE_MEM_DIR ?? path11.join(os6.homedir(), ".exe-os");
2127
+ return process.env.EXE_OS_DIR ?? process.env.EXE_MEM_DIR ?? path11.join(os7.homedir(), ".exe-os");
2118
2128
  }
2119
2129
  function getKeyPath() {
2120
2130
  return path11.join(getKeyDir(), "master.key");
@@ -2140,7 +2150,7 @@ async function getMasterKey() {
2140
2150
  const keyPath = getKeyPath();
2141
2151
  if (!existsSync9(keyPath)) {
2142
2152
  process.stderr.write(
2143
- `[keychain] Key not found at ${keyPath} (HOME=${os6.homedir()}, EXE_OS_DIR=${process.env.EXE_OS_DIR ?? "unset"})
2153
+ `[keychain] Key not found at ${keyPath} (HOME=${os7.homedir()}, EXE_OS_DIR=${process.env.EXE_OS_DIR ?? "unset"})
2144
2154
  `
2145
2155
  );
2146
2156
  return null;
@@ -430,6 +430,7 @@ var init_employees = __esm({
430
430
 
431
431
  // src/lib/exe-daemon-client.ts
432
432
  import net from "net";
433
+ import os3 from "os";
433
434
  import { spawn } from "child_process";
434
435
  import { randomUUID } from "crypto";
435
436
  import { existsSync as existsSync3, unlinkSync as unlinkSync2, readFileSync as readFileSync3, openSync, closeSync, statSync } from "fs";
@@ -493,6 +494,15 @@ function findPackageRoot() {
493
494
  return null;
494
495
  }
495
496
  function spawnDaemon() {
497
+ const freeGB = os3.freemem() / (1024 * 1024 * 1024);
498
+ const totalGB = os3.totalmem() / (1024 * 1024 * 1024);
499
+ if (freeGB < 1.5 && totalGB <= 8) {
500
+ process.stderr.write(
501
+ `[exed-client] SKIP: low memory (${freeGB.toFixed(1)}GB free / ${totalGB.toFixed(0)}GB total). Embedding daemon not started \u2014 using keyword search only. Close other apps and retry.
502
+ `
503
+ );
504
+ return;
505
+ }
496
506
  const pkgRoot = findPackageRoot();
497
507
  if (!pkgRoot) {
498
508
  process.stderr.write("[exed-client] WARN: cannot find package root\n");
@@ -1986,9 +1996,9 @@ __export(keychain_exports, {
1986
1996
  import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3, chmod as chmod2 } from "fs/promises";
1987
1997
  import { existsSync as existsSync4 } from "fs";
1988
1998
  import path4 from "path";
1989
- import os3 from "os";
1999
+ import os4 from "os";
1990
2000
  function getKeyDir() {
1991
- return process.env.EXE_OS_DIR ?? process.env.EXE_MEM_DIR ?? path4.join(os3.homedir(), ".exe-os");
2001
+ return process.env.EXE_OS_DIR ?? process.env.EXE_MEM_DIR ?? path4.join(os4.homedir(), ".exe-os");
1992
2002
  }
1993
2003
  function getKeyPath() {
1994
2004
  return path4.join(getKeyDir(), "master.key");
@@ -2014,7 +2024,7 @@ async function getMasterKey() {
2014
2024
  const keyPath = getKeyPath();
2015
2025
  if (!existsSync4(keyPath)) {
2016
2026
  process.stderr.write(
2017
- `[keychain] Key not found at ${keyPath} (HOME=${os3.homedir()}, EXE_OS_DIR=${process.env.EXE_OS_DIR ?? "unset"})
2027
+ `[keychain] Key not found at ${keyPath} (HOME=${os4.homedir()}, EXE_OS_DIR=${process.env.EXE_OS_DIR ?? "unset"})
2018
2028
  `
2019
2029
  );
2020
2030
  return null;
@@ -2581,7 +2591,7 @@ ${p.content}`).join("\n\n");
2581
2591
  // src/lib/notifications.ts
2582
2592
  import crypto from "crypto";
2583
2593
  import path6 from "path";
2584
- import os4 from "os";
2594
+ import os5 from "os";
2585
2595
  import {
2586
2596
  readFileSync as readFileSync4,
2587
2597
  readdirSync as readdirSync2,
@@ -2622,12 +2632,12 @@ var init_notifications = __esm({
2622
2632
 
2623
2633
  // src/lib/session-registry.ts
2624
2634
  import path7 from "path";
2625
- import os5 from "os";
2635
+ import os6 from "os";
2626
2636
  var REGISTRY_PATH;
2627
2637
  var init_session_registry = __esm({
2628
2638
  "src/lib/session-registry.ts"() {
2629
2639
  "use strict";
2630
- REGISTRY_PATH = path7.join(os5.homedir(), ".exe-os", "session-registry.json");
2640
+ REGISTRY_PATH = path7.join(os6.homedir(), ".exe-os", "session-registry.json");
2631
2641
  }
2632
2642
  });
2633
2643
 
@@ -2841,14 +2851,14 @@ var init_agent_config = __esm({
2841
2851
  // src/lib/intercom-queue.ts
2842
2852
  import { readFileSync as readFileSync6, writeFileSync as writeFileSync3, renameSync as renameSync3, existsSync as existsSync8, mkdirSync as mkdirSync3 } from "fs";
2843
2853
  import path9 from "path";
2844
- import os6 from "os";
2854
+ import os7 from "os";
2845
2855
  var QUEUE_PATH, TTL_MS, INTERCOM_LOG;
2846
2856
  var init_intercom_queue = __esm({
2847
2857
  "src/lib/intercom-queue.ts"() {
2848
2858
  "use strict";
2849
- QUEUE_PATH = path9.join(os6.homedir(), ".exe-os", "intercom-queue.json");
2859
+ QUEUE_PATH = path9.join(os7.homedir(), ".exe-os", "intercom-queue.json");
2850
2860
  TTL_MS = 60 * 60 * 1e3;
2851
- INTERCOM_LOG = path9.join(os6.homedir(), ".exe-os", "intercom.log");
2861
+ INTERCOM_LOG = path9.join(os7.homedir(), ".exe-os", "intercom.log");
2852
2862
  }
2853
2863
  });
2854
2864
 
@@ -3367,7 +3377,7 @@ var init_plan_limits = __esm({
3367
3377
  // src/lib/tmux-routing.ts
3368
3378
  import { readFileSync as readFileSync9, writeFileSync as writeFileSync5, mkdirSync as mkdirSync5, existsSync as existsSync11, appendFileSync } from "fs";
3369
3379
  import path12 from "path";
3370
- import os7 from "os";
3380
+ import os8 from "os";
3371
3381
  import { fileURLToPath as fileURLToPath2 } from "url";
3372
3382
  function getMySession() {
3373
3383
  return getTransport().getMySession();
@@ -3414,9 +3424,9 @@ var init_tmux_routing = __esm({
3414
3424
  init_intercom_queue();
3415
3425
  init_plan_limits();
3416
3426
  init_employees();
3417
- SPAWN_LOCK_DIR = path12.join(os7.homedir(), ".exe-os", "spawn-locks");
3418
- SESSION_CACHE = path12.join(os7.homedir(), ".exe-os", "session-cache");
3419
- INTERCOM_LOG2 = path12.join(os7.homedir(), ".exe-os", "intercom.log");
3427
+ SPAWN_LOCK_DIR = path12.join(os8.homedir(), ".exe-os", "spawn-locks");
3428
+ SESSION_CACHE = path12.join(os8.homedir(), ".exe-os", "session-cache");
3429
+ INTERCOM_LOG2 = path12.join(os8.homedir(), ".exe-os", "intercom.log");
3420
3430
  DEBOUNCE_FILE = path12.join(SESSION_CACHE, "intercom-debounce.json");
3421
3431
  DEBOUNCE_CLEANUP_AGE_MS = 5 * 60 * 1e3;
3422
3432
  }