@askexenow/exe-os 0.9.85 → 0.9.87

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 (86) hide show
  1. package/dist/bin/agentic-ontology-backfill.js +50 -14
  2. package/dist/bin/agentic-reflection-backfill.js +50 -14
  3. package/dist/bin/agentic-semantic-label.js +50 -14
  4. package/dist/bin/backfill-conversations.js +50 -14
  5. package/dist/bin/backfill-responses.js +50 -14
  6. package/dist/bin/backfill-vectors.js +50 -14
  7. package/dist/bin/bulk-sync-postgres.js +50 -14
  8. package/dist/bin/cleanup-stale-review-tasks.js +53 -17
  9. package/dist/bin/cli.js +339 -81
  10. package/dist/bin/exe-agent.js +18 -0
  11. package/dist/bin/exe-assign.js +50 -14
  12. package/dist/bin/exe-boot.js +75 -39
  13. package/dist/bin/exe-call.js +18 -0
  14. package/dist/bin/exe-cloud.js +40 -4
  15. package/dist/bin/exe-dispatch.js +61 -25
  16. package/dist/bin/exe-doctor.js +40 -4
  17. package/dist/bin/exe-export-behaviors.js +50 -14
  18. package/dist/bin/exe-forget.js +50 -14
  19. package/dist/bin/exe-gateway.js +65 -29
  20. package/dist/bin/exe-heartbeat.js +55 -19
  21. package/dist/bin/exe-kill.js +54 -18
  22. package/dist/bin/exe-launch-agent.js +58 -22
  23. package/dist/bin/exe-new-employee.js +33 -2
  24. package/dist/bin/exe-pending-messages.js +53 -17
  25. package/dist/bin/exe-pending-notifications.js +53 -17
  26. package/dist/bin/exe-pending-reviews.js +55 -19
  27. package/dist/bin/exe-rename.js +52 -16
  28. package/dist/bin/exe-review.js +50 -14
  29. package/dist/bin/exe-search.js +58 -22
  30. package/dist/bin/exe-session-cleanup.js +85 -44
  31. package/dist/bin/exe-start-codex.js +57 -21
  32. package/dist/bin/exe-start-opencode.js +55 -19
  33. package/dist/bin/exe-status.js +62 -26
  34. package/dist/bin/exe-team.js +50 -14
  35. package/dist/bin/git-sweep.js +63 -27
  36. package/dist/bin/graph-backfill.js +50 -14
  37. package/dist/bin/graph-export.js +50 -14
  38. package/dist/bin/install.js +9 -0
  39. package/dist/bin/intercom-check.js +67 -31
  40. package/dist/bin/scan-tasks.js +63 -27
  41. package/dist/bin/setup.js +53 -13
  42. package/dist/bin/shard-migrate.js +50 -14
  43. package/dist/bin/stack-update.js +59 -2
  44. package/dist/bin/update.js +1 -1
  45. package/dist/gateway/index.js +65 -29
  46. package/dist/hooks/bug-report-worker.js +65 -29
  47. package/dist/hooks/codex-stop-task-finalizer.js +59 -23
  48. package/dist/hooks/commit-complete.js +64 -28
  49. package/dist/hooks/error-recall.js +62 -26
  50. package/dist/hooks/ingest-worker.js +4 -4
  51. package/dist/hooks/ingest.js +56 -20
  52. package/dist/hooks/instructions-loaded.js +50 -14
  53. package/dist/hooks/notification.js +50 -14
  54. package/dist/hooks/post-compact.js +50 -14
  55. package/dist/hooks/post-tool-combined.js +63 -27
  56. package/dist/hooks/pre-compact.js +61 -25
  57. package/dist/hooks/pre-tool-use.js +58 -22
  58. package/dist/hooks/prompt-submit.js +78 -42
  59. package/dist/hooks/session-end.js +66 -30
  60. package/dist/hooks/session-start.js +68 -32
  61. package/dist/hooks/stop.js +53 -17
  62. package/dist/hooks/subagent-stop.js +50 -14
  63. package/dist/hooks/summary-worker.js +55 -19
  64. package/dist/index.js +61 -25
  65. package/dist/lib/cloud-sync.js +32 -14
  66. package/dist/lib/database.js +22 -4
  67. package/dist/lib/db-daemon-client.js +16 -4
  68. package/dist/lib/db.js +22 -4
  69. package/dist/lib/device-registry.js +22 -4
  70. package/dist/lib/embedder.js +16 -4
  71. package/dist/lib/employee-templates.js +18 -0
  72. package/dist/lib/exe-daemon-client.js +16 -4
  73. package/dist/lib/exe-daemon.js +874 -232
  74. package/dist/lib/hybrid-search.js +58 -22
  75. package/dist/lib/identity-templates.js +6 -2
  76. package/dist/lib/schedules.js +53 -17
  77. package/dist/lib/skill-learning.js +16 -4
  78. package/dist/lib/store.js +50 -14
  79. package/dist/lib/tasks.js +16 -4
  80. package/dist/lib/tmux-routing.js +18 -6
  81. package/dist/mcp/server.js +809 -200
  82. package/dist/mcp/tools/create-task.js +24 -8
  83. package/dist/mcp/tools/update-task.js +18 -6
  84. package/dist/runtime/index.js +61 -25
  85. package/dist/tui/App.js +91 -55
  86. package/package.json +1 -1
package/dist/bin/setup.js CHANGED
@@ -846,7 +846,7 @@ var init_daemon_auth = __esm({
846
846
  // src/lib/exe-daemon-client.ts
847
847
  import net from "net";
848
848
  import os3 from "os";
849
- import { spawn } from "child_process";
849
+ import { spawn, execSync as execSync2 } from "child_process";
850
850
  import { randomUUID } from "crypto";
851
851
  import { existsSync as existsSync6, unlinkSync as unlinkSync2, readFileSync as readFileSync3, openSync, closeSync, statSync as statSync2 } from "fs";
852
852
  import path5 from "path";
@@ -876,6 +876,14 @@ function handleData(chunk) {
876
876
  }
877
877
  }
878
878
  }
879
+ function isZombie(pid) {
880
+ try {
881
+ const state = execSync2(`ps -p ${pid} -o state=`, { encoding: "utf8", timeout: 2e3 }).trim();
882
+ return state.startsWith("Z");
883
+ } catch {
884
+ return false;
885
+ }
886
+ }
879
887
  function cleanupStaleFiles() {
880
888
  if (existsSync6(PID_PATH)) {
881
889
  try {
@@ -883,7 +891,11 @@ function cleanupStaleFiles() {
883
891
  if (pid > 0) {
884
892
  try {
885
893
  process.kill(pid, 0);
886
- return;
894
+ if (!isZombie(pid)) {
895
+ return;
896
+ }
897
+ process.stderr.write(`[exed-client] PID ${pid} is a zombie \u2014 cleaning up stale files
898
+ `);
887
899
  } catch {
888
900
  }
889
901
  }
@@ -911,8 +923,8 @@ function findPackageRoot() {
911
923
  function getAvailableMemoryGB() {
912
924
  if (process.platform === "darwin") {
913
925
  try {
914
- const { execSync: execSync4 } = __require("child_process");
915
- const vmstat = execSync4("vm_stat", { encoding: "utf8" });
926
+ const { execSync: execSync5 } = __require("child_process");
927
+ const vmstat = execSync5("vm_stat", { encoding: "utf8" });
916
928
  const pageSize = 16384;
917
929
  const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
918
930
  const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
@@ -2069,7 +2081,7 @@ __export(employees_exports, {
2069
2081
  });
2070
2082
  import { readFile as readFile3, writeFile as writeFile3, mkdir as mkdir4 } from "fs/promises";
2071
2083
  import { existsSync as existsSync9, symlinkSync, readlinkSync, readFileSync as readFileSync6, renameSync as renameSync3, unlinkSync as unlinkSync3, writeFileSync as writeFileSync4 } from "fs";
2072
- import { execSync as execSync2 } from "child_process";
2084
+ import { execSync as execSync3 } from "child_process";
2073
2085
  import path8 from "path";
2074
2086
  import os5 from "os";
2075
2087
  function normalizeRole(role) {
@@ -2245,7 +2257,7 @@ async function normalizeRosterCase(rosterPath) {
2245
2257
  }
2246
2258
  function findExeBin() {
2247
2259
  try {
2248
- return execSync2(process.platform === "win32" ? "where exe-os" : "which exe-os", { encoding: "utf8" }).trim();
2260
+ return execSync3(process.platform === "win32" ? "where exe-os" : "which exe-os", { encoding: "utf8" }).trim();
2249
2261
  } catch {
2250
2262
  return null;
2251
2263
  }
@@ -4453,6 +4465,12 @@ async function disposeDatabase() {
4453
4465
  clearInterval(_walCheckpointTimer);
4454
4466
  _walCheckpointTimer = null;
4455
4467
  }
4468
+ if (_client) {
4469
+ try {
4470
+ await _client.execute("PRAGMA wal_checkpoint(PASSIVE)");
4471
+ } catch {
4472
+ }
4473
+ }
4456
4474
  if (_daemonClient) {
4457
4475
  _daemonClient.close();
4458
4476
  _daemonClient = null;
@@ -6423,6 +6441,24 @@ var init_platform_procedures = __esm({
6423
6441
  priority: "p0",
6424
6442
  content: "When an agent encounters a suspected Exe OS bug, update breakage, MCP/tool failure, installer issue, memory/orchestration defect, or customer-local patch need, it MUST use create_bug_report. Do this before or alongside any local workaround so the report reaches AskExe support directly via the customer's license. Do NOT ask the founder for permission to file a required bug report. If create_bug_report is deferred/lazy-loaded, load it and call it. If it is unavailable in the live MCP surface, report 'create_bug_report unavailable in this session' and save a local report in exe/output \u2014 never claim the tool does not exist unless the live MCP surface was checked. If upstream delivery fails, call support_test (MCP) and include its result in the local report so AskExe can distinguish customer setup, license provisioning, and server intake issues; only ask the founder to run `exe-os support test` if MCP is disconnected/unavailable. Classify first: upstream_bug = reproducible exe-os/platform defect; customer_customization = identity, behavior, procedure, config, branding, workflow preference that belongs in customer-owned layers; emergency_hotfix = temporary local patch. For upstream bugs/emergency hotfixes include version, repro steps, expected/actual, files changed, workaround, and local diff summary. Avoid permanent platform-code patches unless founder approves; if a hotfix is unavoidable, document it in the bug report and re-check after npm update."
6425
6443
  },
6444
+ {
6445
+ title: "Bug report status check \u2014 surface available fixes on boot",
6446
+ domain: "support",
6447
+ priority: "p1",
6448
+ content: "Once per session (COO boot only, never repeat), call list_my_bug_reports to check if any previously filed bug reports have been fixed by AskExe. If any report has status 'fixed' with a fixed_version, surface it to the founder immediately: '\u{1F527} N bug fix(es) available \u2014 run exe-os update to get version X.Y.Z'. This is a one-time check at boot, not a recurring poll. If no reports exist or none are fixed, skip silently. If the MCP tool is unavailable or the network call fails, skip silently \u2014 this is informational, not blocking."
6449
+ },
6450
+ {
6451
+ title: "Feature request triage \u2014 upstream feature vs local customization",
6452
+ domain: "support",
6453
+ priority: "p0",
6454
+ content: "When an agent or founder identifies a desired capability that exe-os does not yet provide, the COO (or equivalent coordinator) must decide: is this a local customization (identity, behavior, procedure, config, branding, workflow preference that can be configured in customer-owned layers) or an upstream feature request (a platform capability that requires changes to exe-os code, shipped via npm update)? Local customizations: implement immediately using store_behavior, update_identity, company_procedure, or config changes. Upstream features: use create_feature_request to submit to AskExe. Include use case, business impact, and current workaround. Do NOT ask the founder for permission to file a feature request \u2014 file it proactively when the need is clear."
6455
+ },
6456
+ {
6457
+ title: "Feature request status check \u2014 surface shipped features on boot",
6458
+ domain: "support",
6459
+ priority: "p1",
6460
+ content: "Once per session (COO boot only, never repeat), call list_my_feature_requests to check if any previously filed feature requests have been shipped by AskExe. If any request has status 'shipped' with a shipped_version, surface it to the founder immediately: '\u{1F680} N feature(s) shipped \u2014 run exe-os update to get version X.Y.Z'. This is a one-time check at boot, not a recurring poll. If no requests exist or none are shipped, skip silently. If the MCP tool is unavailable or the network call fails, skip silently \u2014 this is informational, not blocking."
6461
+ },
6426
6462
  // --- Operations ---
6427
6463
  {
6428
6464
  title: "Managers must supervise deployed workers",
@@ -7453,12 +7489,14 @@ On EVERY new conversation, before doing anything else:
7453
7489
  1. **Memory scan**: Run recall_my_memory with broad queries \u2014 "project", "client", "pipeline", "campaign", "deal", "decision", "blocker". Summarize what you find.
7454
7490
  2. **Task scan**: Run list_tasks to see what's open, in progress, blocked, or needs review across all employees.
7455
7491
  3. **Team check**: Run ask_team_memory for recent activity from CTO/CMO/engineers.
7456
- 4. **Present the brief**: Give the founder a concise status report:
7492
+ 4. **Bug fix check** (one-time, never repeat): Call list_my_bug_reports to see if AskExe has fixed any previously filed bugs. If any have status "fixed" with a fixed_version, tell the founder: "\u{1F527} N bug fix(es) available \u2014 run \`exe-os update\` to get version X.Y.Z." Skip silently if none or if the call fails.
7493
+ 5. **Present the brief**: Give the founder a concise status report:
7457
7494
  - What's active and progressing
7458
7495
  - What's blocked and needs attention
7459
7496
  - What decisions are pending
7497
+ - Available bug fixes (from step 4, if any)
7460
7498
  - What you recommend doing next
7461
- 5. Then ask: "What's the priority?"
7499
+ 6. Then ask: "What's the priority?"
7462
7500
 
7463
7501
  If this is your FIRST ever conversation (few or no prior memories):
7464
7502
  - Search more broadly: "product", "SEO", "meeting", "strategy", "revenue"
@@ -7478,6 +7516,8 @@ Never say "I have no memories" without first searching broadly. Your memory may
7478
7516
  - **get_identity** \u2014 read any agent's identity for coordination
7479
7517
  - **set_agent_config** \u2014 view or change which tool (Claude Code, Codex, OpenCode) and model each agent uses. Call with no args to show all agents' current settings. Call with agent_id + runtime + model to change.
7480
7518
  - **send_message** \u2014 direct intercom to employees
7519
+ - **create_bug_report** \u2014 file a bug when you encounter an Exe OS platform issue
7520
+ - **list_my_bug_reports** \u2014 check status of filed bugs (boot check: surface available fixes to founder)
7481
7521
  ${PLAN_MODE_COMPAT}
7482
7522
  ## Completion Workflow
7483
7523
 
@@ -7907,7 +7947,7 @@ import {
7907
7947
  readdirSync as readdirSync4,
7908
7948
  unlinkSync as unlinkSync7
7909
7949
  } from "fs";
7910
- import { execSync as execSync3 } from "child_process";
7950
+ import { execSync as execSync4 } from "child_process";
7911
7951
  import path16 from "path";
7912
7952
  import { homedir as homedir3 } from "os";
7913
7953
  function generateSessionWrappers(packageRoot, homeDir) {
@@ -8004,12 +8044,12 @@ function writeWrapper(wrapperPath, content) {
8004
8044
  }
8005
8045
  function resolveGlobalBinDir() {
8006
8046
  try {
8007
- const exeOsPath = execSync3("command -v exe-os", { encoding: "utf8", timeout: 3e3 }).trim().split("\n")[0];
8047
+ const exeOsPath = execSync4("command -v exe-os", { encoding: "utf8", timeout: 3e3 }).trim().split("\n")[0];
8008
8048
  if (exeOsPath) return path16.dirname(exeOsPath);
8009
8049
  } catch {
8010
8050
  }
8011
8051
  try {
8012
- const prefix = execSync3("npm prefix -g", { encoding: "utf8", timeout: 3e3 }).trim();
8052
+ const prefix = execSync4("npm prefix -g", { encoding: "utf8", timeout: 3e3 }).trim();
8013
8053
  if (prefix) return path16.join(prefix, "bin");
8014
8054
  } catch {
8015
8055
  }
@@ -8203,8 +8243,8 @@ function ask(rl, prompt) {
8203
8243
  function getAvailableMemoryGB2() {
8204
8244
  if (process.platform === "darwin") {
8205
8245
  try {
8206
- const { execSync: execSync4 } = __require("child_process");
8207
- const vmstat = execSync4("vm_stat", { encoding: "utf8" });
8246
+ const { execSync: execSync5 } = __require("child_process");
8247
+ const vmstat = execSync5("vm_stat", { encoding: "utf8" });
8208
8248
  const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
8209
8249
  const pageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : 16384;
8210
8250
  const free = vmstat.match(/Pages free:\s+(\d+)/);
@@ -981,7 +981,7 @@ var init_daemon_auth = __esm({
981
981
  // src/lib/exe-daemon-client.ts
982
982
  import net from "net";
983
983
  import os4 from "os";
984
- import { spawn } from "child_process";
984
+ import { spawn, execSync as execSync2 } from "child_process";
985
985
  import { randomUUID } from "crypto";
986
986
  import { existsSync as existsSync5, unlinkSync as unlinkSync2, readFileSync as readFileSync4, openSync, closeSync, statSync } from "fs";
987
987
  import path5 from "path";
@@ -1011,6 +1011,14 @@ function handleData(chunk) {
1011
1011
  }
1012
1012
  }
1013
1013
  }
1014
+ function isZombie(pid) {
1015
+ try {
1016
+ const state = execSync2(`ps -p ${pid} -o state=`, { encoding: "utf8", timeout: 2e3 }).trim();
1017
+ return state.startsWith("Z");
1018
+ } catch {
1019
+ return false;
1020
+ }
1021
+ }
1014
1022
  function cleanupStaleFiles() {
1015
1023
  if (existsSync5(PID_PATH)) {
1016
1024
  try {
@@ -1018,7 +1026,11 @@ function cleanupStaleFiles() {
1018
1026
  if (pid > 0) {
1019
1027
  try {
1020
1028
  process.kill(pid, 0);
1021
- return;
1029
+ if (!isZombie(pid)) {
1030
+ return;
1031
+ }
1032
+ process.stderr.write(`[exed-client] PID ${pid} is a zombie \u2014 cleaning up stale files
1033
+ `);
1022
1034
  } catch {
1023
1035
  }
1024
1036
  }
@@ -1046,8 +1058,8 @@ function findPackageRoot() {
1046
1058
  function getAvailableMemoryGB() {
1047
1059
  if (process.platform === "darwin") {
1048
1060
  try {
1049
- const { execSync: execSync3 } = __require("child_process");
1050
- const vmstat = execSync3("vm_stat", { encoding: "utf8" });
1061
+ const { execSync: execSync4 } = __require("child_process");
1062
+ const vmstat = execSync4("vm_stat", { encoding: "utf8" });
1051
1063
  const pageSize = 16384;
1052
1064
  const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
1053
1065
  const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
@@ -2833,6 +2845,12 @@ async function disposeDatabase() {
2833
2845
  clearInterval(_walCheckpointTimer);
2834
2846
  _walCheckpointTimer = null;
2835
2847
  }
2848
+ if (_client) {
2849
+ try {
2850
+ await _client.execute("PRAGMA wal_checkpoint(PASSIVE)");
2851
+ } catch {
2852
+ }
2853
+ }
2836
2854
  if (_daemonClient) {
2837
2855
  _daemonClient.close();
2838
2856
  _daemonClient = null;
@@ -3364,6 +3382,24 @@ var init_platform_procedures = __esm({
3364
3382
  priority: "p0",
3365
3383
  content: "When an agent encounters a suspected Exe OS bug, update breakage, MCP/tool failure, installer issue, memory/orchestration defect, or customer-local patch need, it MUST use create_bug_report. Do this before or alongside any local workaround so the report reaches AskExe support directly via the customer's license. Do NOT ask the founder for permission to file a required bug report. If create_bug_report is deferred/lazy-loaded, load it and call it. If it is unavailable in the live MCP surface, report 'create_bug_report unavailable in this session' and save a local report in exe/output \u2014 never claim the tool does not exist unless the live MCP surface was checked. If upstream delivery fails, call support_test (MCP) and include its result in the local report so AskExe can distinguish customer setup, license provisioning, and server intake issues; only ask the founder to run `exe-os support test` if MCP is disconnected/unavailable. Classify first: upstream_bug = reproducible exe-os/platform defect; customer_customization = identity, behavior, procedure, config, branding, workflow preference that belongs in customer-owned layers; emergency_hotfix = temporary local patch. For upstream bugs/emergency hotfixes include version, repro steps, expected/actual, files changed, workaround, and local diff summary. Avoid permanent platform-code patches unless founder approves; if a hotfix is unavoidable, document it in the bug report and re-check after npm update."
3366
3384
  },
3385
+ {
3386
+ title: "Bug report status check \u2014 surface available fixes on boot",
3387
+ domain: "support",
3388
+ priority: "p1",
3389
+ content: "Once per session (COO boot only, never repeat), call list_my_bug_reports to check if any previously filed bug reports have been fixed by AskExe. If any report has status 'fixed' with a fixed_version, surface it to the founder immediately: '\u{1F527} N bug fix(es) available \u2014 run exe-os update to get version X.Y.Z'. This is a one-time check at boot, not a recurring poll. If no reports exist or none are fixed, skip silently. If the MCP tool is unavailable or the network call fails, skip silently \u2014 this is informational, not blocking."
3390
+ },
3391
+ {
3392
+ title: "Feature request triage \u2014 upstream feature vs local customization",
3393
+ domain: "support",
3394
+ priority: "p0",
3395
+ content: "When an agent or founder identifies a desired capability that exe-os does not yet provide, the COO (or equivalent coordinator) must decide: is this a local customization (identity, behavior, procedure, config, branding, workflow preference that can be configured in customer-owned layers) or an upstream feature request (a platform capability that requires changes to exe-os code, shipped via npm update)? Local customizations: implement immediately using store_behavior, update_identity, company_procedure, or config changes. Upstream features: use create_feature_request to submit to AskExe. Include use case, business impact, and current workaround. Do NOT ask the founder for permission to file a feature request \u2014 file it proactively when the need is clear."
3396
+ },
3397
+ {
3398
+ title: "Feature request status check \u2014 surface shipped features on boot",
3399
+ domain: "support",
3400
+ priority: "p1",
3401
+ content: "Once per session (COO boot only, never repeat), call list_my_feature_requests to check if any previously filed feature requests have been shipped by AskExe. If any request has status 'shipped' with a shipped_version, surface it to the founder immediately: '\u{1F680} N feature(s) shipped \u2014 run exe-os update to get version X.Y.Z'. This is a one-time check at boot, not a recurring poll. If no requests exist or none are shipped, skip silently. If the MCP tool is unavailable or the network call fails, skip silently \u2014 this is informational, not blocking."
3402
+ },
3367
3403
  // --- Operations ---
3368
3404
  {
3369
3405
  title: "Managers must supervise deployed workers",
@@ -3987,7 +4023,7 @@ init_database();
3987
4023
  // src/lib/keychain.ts
3988
4024
  import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3, chmod as chmod2 } from "fs/promises";
3989
4025
  import { existsSync as existsSync6, statSync as statSync2 } from "fs";
3990
- import { execSync as execSync2 } from "child_process";
4026
+ import { execSync as execSync3 } from "child_process";
3991
4027
  import path6 from "path";
3992
4028
  import os5 from "os";
3993
4029
  var SERVICE = "exe-os";
@@ -4008,13 +4044,13 @@ function linuxSecretAvailable() {
4008
4044
  if (process.platform !== "linux") return false;
4009
4045
  if (linuxSecretAvailability !== null) return linuxSecretAvailability;
4010
4046
  try {
4011
- execSync2("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
4047
+ execSync3("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
4012
4048
  } catch {
4013
4049
  linuxSecretAvailability = false;
4014
4050
  return false;
4015
4051
  }
4016
4052
  try {
4017
- execSync2("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
4053
+ execSync3("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
4018
4054
  linuxSecretAvailability = true;
4019
4055
  } catch {
4020
4056
  linuxSecretAvailability = false;
@@ -4038,7 +4074,7 @@ function macKeychainGet(service = SERVICE) {
4038
4074
  if (!nativeKeychainAllowed()) return null;
4039
4075
  if (process.platform !== "darwin") return null;
4040
4076
  try {
4041
- return execSync2(
4077
+ return execSync3(
4042
4078
  `security find-generic-password -s "${service}" -a "${ACCOUNT}" -w 2>/dev/null`,
4043
4079
  { encoding: "utf-8", timeout: 5e3 }
4044
4080
  ).trim();
@@ -4051,13 +4087,13 @@ function macKeychainSet(value, service = SERVICE) {
4051
4087
  if (process.platform !== "darwin") return false;
4052
4088
  try {
4053
4089
  try {
4054
- execSync2(
4090
+ execSync3(
4055
4091
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
4056
4092
  { timeout: 5e3 }
4057
4093
  );
4058
4094
  } catch {
4059
4095
  }
4060
- execSync2(
4096
+ execSync3(
4061
4097
  `security add-generic-password -s "${service}" -a "${ACCOUNT}" -w "${value}"`,
4062
4098
  { timeout: 5e3 }
4063
4099
  );
@@ -4070,7 +4106,7 @@ function macKeychainDelete(service = SERVICE) {
4070
4106
  if (!nativeKeychainAllowed()) return false;
4071
4107
  if (process.platform !== "darwin") return false;
4072
4108
  try {
4073
- execSync2(
4109
+ execSync3(
4074
4110
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
4075
4111
  { timeout: 5e3 }
4076
4112
  );
@@ -4082,7 +4118,7 @@ function macKeychainDelete(service = SERVICE) {
4082
4118
  function linuxSecretGet(service = SERVICE) {
4083
4119
  if (!linuxSecretAvailable()) return null;
4084
4120
  try {
4085
- return execSync2(
4121
+ return execSync3(
4086
4122
  `secret-tool lookup service "${service}" account "${ACCOUNT}" 2>/dev/null`,
4087
4123
  { encoding: "utf-8", timeout: 5e3 }
4088
4124
  ).trim();
@@ -4093,7 +4129,7 @@ function linuxSecretGet(service = SERVICE) {
4093
4129
  function linuxSecretSet(value, service = SERVICE) {
4094
4130
  if (!linuxSecretAvailable()) return false;
4095
4131
  try {
4096
- execSync2(
4132
+ execSync3(
4097
4133
  `echo -n "${value}" | secret-tool store --label="exe-os master key" service "${service}" account "${ACCOUNT}" 2>/dev/null`,
4098
4134
  { timeout: 5e3 }
4099
4135
  );
@@ -4106,7 +4142,7 @@ function linuxSecretDelete(service = SERVICE) {
4106
4142
  if (!nativeKeychainAllowed()) return false;
4107
4143
  if (process.platform !== "linux") return false;
4108
4144
  try {
4109
- execSync2(
4145
+ execSync3(
4110
4146
  `secret-tool clear service "${service}" account "${ACCOUNT}" 2>/dev/null`,
4111
4147
  { timeout: 5e3 }
4112
4148
  );
@@ -440,6 +440,9 @@ function installDockerUbuntu(exec) {
440
440
  function randomSecret(bytes = 32) {
441
441
  return randomBytes(bytes).toString("base64url");
442
442
  }
443
+ function randomHexSecret(bytes = 24) {
444
+ return randomBytes(bytes).toString("hex");
445
+ }
443
446
  function hydrateEnv(raw, opts) {
444
447
  let next = raw;
445
448
  const license = opts.licenseKey || process.env.EXE_LICENSE_KEY || loadLicense() || "";
@@ -449,6 +452,8 @@ function hydrateEnv(raw, opts) {
449
452
  for (const [key, value] of env.entries()) {
450
453
  if (!/CHANGEME/.test(value)) continue;
451
454
  if (key === "EXE_LICENSE_KEY" && license) replacements[key] = license;
455
+ else if (key === "MONITOR_AGENT_KEY") continue;
456
+ else if (key === "EXE_GATEWAY_WS_RELAY_AUTH_TOKEN") replacements[key] = randomHexSecret(24);
452
457
  else if (key.endsWith("_PASSWORD")) replacements[key] = randomSecret(24);
453
458
  else if (key.endsWith("_SECRET") || key.endsWith("_TOKEN") || key.endsWith("_KEY") || key.endsWith("_SALT")) replacements[key] = value.replace(/CHANGEME[A-Z0-9_]*/g, randomSecret(32));
454
459
  else if (key === "EXED_MCP_TOKEN") replacements[key] = randomSecret(32);
@@ -708,7 +713,9 @@ function defaultStackPaths() {
708
713
  // Packaged manifests keep cold-start installs unblocked even before update-service entitlements are provisioned.
709
714
  auditUrl: process.env.EXE_STACK_AUDIT_URL || (/^https?:\/\//.test(manifestRef) ? "https://update.askexe.com/v1/deploy-audits" : void 0),
710
715
  imageCredentialsUrl: process.env.EXE_STACK_IMAGE_CREDENTIALS_URL || (/^https?:\/\//.test(manifestRef) ? "https://update.askexe.com/v1/image-credentials" : void 0),
711
- manifestAuthToken: process.env.EXE_STACK_UPDATE_TOKEN || process.env.EXE_LICENSE_KEY || loadLicense() || void 0,
716
+ // License key IS the auth token for update.askexe.com no separate update token needed.
717
+ // EXE_STACK_UPDATE_TOKEN kept as legacy fallback during migration.
718
+ manifestAuthToken: process.env.EXE_LICENSE_KEY || loadLicense() || process.env.EXE_STACK_UPDATE_TOKEN || void 0,
712
719
  manifestPublicKey: loadDefaultPublicKey()
713
720
  };
714
721
  }
@@ -834,7 +841,14 @@ function printChanges(changes, composeFile, envFile) {
834
841
  if (changes.length === 0) {
835
842
  const running = areCliContainersRunning(composeFile, envFile);
836
843
  if (running) {
837
- console.log("\u2705 Stack already matches target manifest.");
844
+ console.log("Stack .env matches target manifest. Checking container health...\n");
845
+ const unhealthy = printContainerHealth(composeFile, envFile);
846
+ if (unhealthy > 0) {
847
+ console.log(`
848
+ \u{1F534} ${unhealthy} service(s) unhealthy or crashlooping. Run \`docker compose logs <service>\` to diagnose.`);
849
+ } else {
850
+ console.log("\n\u2705 Stack already matches target manifest. All services healthy.");
851
+ }
838
852
  } else {
839
853
  console.log("\u26A0\uFE0F Stack .env matches target manifest but containers are not running. Will start them.");
840
854
  }
@@ -857,6 +871,49 @@ function areCliContainersRunning(composeFile, envFile) {
857
871
  return false;
858
872
  }
859
873
  }
874
+ function getContainerHealth(composeFile, envFile) {
875
+ try {
876
+ const result = spawnSync2(
877
+ "docker",
878
+ ["compose", "--file", composeFile, "--env-file", envFile, "ps", "--format", "json"],
879
+ { stdio: ["pipe", "pipe", "pipe"], timeout: 15e3 }
880
+ );
881
+ if (result.status !== 0) return [];
882
+ const raw = result.stdout?.toString().trim() ?? "";
883
+ if (!raw) return [];
884
+ return raw.split("\n").filter(Boolean).map((line) => {
885
+ try {
886
+ const obj = JSON.parse(line);
887
+ return {
888
+ service: obj.Service ?? obj.Name ?? "unknown",
889
+ state: obj.State ?? "unknown",
890
+ health: obj.Health ?? "",
891
+ restartCount: typeof obj.RestartCount === "number" ? obj.RestartCount : 0
892
+ };
893
+ } catch {
894
+ return null;
895
+ }
896
+ }).filter((x) => x !== null);
897
+ } catch {
898
+ return [];
899
+ }
900
+ }
901
+ function printContainerHealth(composeFile, envFile) {
902
+ const containers = getContainerHealth(composeFile, envFile);
903
+ if (containers.length === 0) return 0;
904
+ let unhealthy = 0;
905
+ for (const c of containers) {
906
+ const isRestarting = c.state === "restarting" || c.restartCount > 2;
907
+ const isUnhealthy = c.health === "unhealthy" || c.state === "dead" || c.state === "exited";
908
+ if (isRestarting || isUnhealthy) {
909
+ unhealthy++;
910
+ console.log(` \u274C ${c.service}: ${c.state} (restarts: ${c.restartCount}${c.health ? `, health: ${c.health}` : ""})`);
911
+ } else {
912
+ console.log(` \u2705 ${c.service}: ${c.state}${c.health ? ` (${c.health})` : ""}`);
913
+ }
914
+ }
915
+ return unhealthy;
916
+ }
860
917
  function printBreaking(changes) {
861
918
  if (changes.length === 0) return;
862
919
  console.log("\nBreaking-change notices:");
@@ -804,7 +804,7 @@ async function runRestore() {
804
804
  }
805
805
  async function runUpdate(cliArgs) {
806
806
  const args = cliArgs ?? process.argv.slice(2);
807
- const autoMode = args.includes("--auto") || args.includes("-y");
807
+ const autoMode = args.includes("--auto") || args.includes("--yes") || args.includes("-y");
808
808
  const checkOnly = args.includes("--check");
809
809
  const restoreMode = args.includes("--restore");
810
810
  if (restoreMode) {