@askexenow/exe-os 0.9.60 → 0.9.62

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 (106) hide show
  1. package/deploy/stack-manifests/v0.9.json +62 -13
  2. package/dist/bin/backfill-conversations.js +282 -7
  3. package/dist/bin/backfill-responses.js +282 -7
  4. package/dist/bin/backfill-vectors.js +119 -7
  5. package/dist/bin/cc-doctor.js +376 -0
  6. package/dist/bin/cleanup-stale-review-tasks.js +282 -7
  7. package/dist/bin/cli.js +455 -77
  8. package/dist/bin/customer-readiness.js +33 -0
  9. package/dist/bin/exe-agent-config.js +2 -2
  10. package/dist/bin/exe-agent.js +3 -3
  11. package/dist/bin/exe-assign.js +282 -7
  12. package/dist/bin/exe-boot.js +125 -13
  13. package/dist/bin/exe-call.js +3 -3
  14. package/dist/bin/exe-cloud.js +2 -2
  15. package/dist/bin/exe-dispatch.js +282 -7
  16. package/dist/bin/exe-doctor.js +119 -7
  17. package/dist/bin/exe-export-behaviors.js +282 -7
  18. package/dist/bin/exe-forget.js +336 -7
  19. package/dist/bin/exe-gateway.js +282 -7
  20. package/dist/bin/exe-heartbeat.js +284 -9
  21. package/dist/bin/exe-kill.js +282 -7
  22. package/dist/bin/exe-launch-agent.js +282 -7
  23. package/dist/bin/exe-link.js +121 -9
  24. package/dist/bin/exe-new-employee.js +50 -21
  25. package/dist/bin/exe-pending-messages.js +282 -7
  26. package/dist/bin/exe-pending-notifications.js +282 -7
  27. package/dist/bin/exe-pending-reviews.js +282 -7
  28. package/dist/bin/exe-rename.js +282 -7
  29. package/dist/bin/exe-review.js +282 -7
  30. package/dist/bin/exe-search.js +306 -8
  31. package/dist/bin/exe-session-cleanup.js +282 -7
  32. package/dist/bin/exe-settings.js +2 -2
  33. package/dist/bin/exe-start-codex.js +326 -21
  34. package/dist/bin/exe-start-opencode.js +304 -10
  35. package/dist/bin/exe-status.js +282 -7
  36. package/dist/bin/exe-team.js +282 -7
  37. package/dist/bin/git-sweep.js +282 -7
  38. package/dist/bin/graph-backfill.js +282 -7
  39. package/dist/bin/graph-export.js +282 -7
  40. package/dist/bin/install.js +58 -33
  41. package/dist/bin/intercom-check.js +282 -7
  42. package/dist/bin/pre-build-guard.js +98 -0
  43. package/dist/bin/scan-tasks.js +282 -7
  44. package/dist/bin/setup.js +122 -10
  45. package/dist/bin/shard-migrate.js +282 -7
  46. package/dist/bin/stack-update.js +79 -11
  47. package/dist/bin/update.js +2 -2
  48. package/dist/gateway/index.js +288 -13
  49. package/dist/hooks/bug-report-worker.js +282 -7
  50. package/dist/hooks/codex-stop-task-finalizer.js +282 -7
  51. package/dist/hooks/commit-complete.js +282 -7
  52. package/dist/hooks/error-recall.js +306 -8
  53. package/dist/hooks/exe-heartbeat-hook.js +2 -2
  54. package/dist/hooks/ingest-worker.js +2 -2
  55. package/dist/hooks/ingest.js +282 -7
  56. package/dist/hooks/instructions-loaded.js +282 -7
  57. package/dist/hooks/notification.js +282 -7
  58. package/dist/hooks/post-compact.js +282 -7
  59. package/dist/hooks/post-tool-combined.js +306 -8
  60. package/dist/hooks/pre-compact.js +282 -7
  61. package/dist/hooks/pre-tool-use.js +282 -7
  62. package/dist/hooks/prompt-submit.js +306 -8
  63. package/dist/hooks/session-end.js +282 -7
  64. package/dist/hooks/session-start.js +308 -10
  65. package/dist/hooks/stop.js +282 -7
  66. package/dist/hooks/subagent-stop.js +282 -7
  67. package/dist/hooks/summary-worker.js +125 -13
  68. package/dist/index.js +288 -13
  69. package/dist/lib/agent-config.js +2 -2
  70. package/dist/lib/cloud-sync.js +121 -9
  71. package/dist/lib/config.js +2 -2
  72. package/dist/lib/consolidation.js +2 -2
  73. package/dist/lib/database.js +115 -3
  74. package/dist/lib/db-daemon-client.js +2 -2
  75. package/dist/lib/db.js +115 -3
  76. package/dist/lib/device-registry.js +115 -3
  77. package/dist/lib/embedder.js +2 -2
  78. package/dist/lib/employee-templates.js +3 -3
  79. package/dist/lib/employees.js +2 -2
  80. package/dist/lib/exe-daemon-client.js +2 -2
  81. package/dist/lib/exe-daemon.js +339 -31
  82. package/dist/lib/hybrid-search.js +306 -8
  83. package/dist/lib/identity.js +2 -2
  84. package/dist/lib/license.js +2 -2
  85. package/dist/lib/messaging.js +2 -2
  86. package/dist/lib/reminders.js +2 -2
  87. package/dist/lib/schedules.js +119 -7
  88. package/dist/lib/skill-learning.js +2 -2
  89. package/dist/lib/store.js +282 -7
  90. package/dist/lib/task-router.js +2 -2
  91. package/dist/lib/tasks.js +2 -2
  92. package/dist/lib/tmux-routing.js +2 -2
  93. package/dist/lib/token-spend.js +2 -2
  94. package/dist/mcp/server.js +339 -31
  95. package/dist/mcp/tools/complete-reminder.js +2 -2
  96. package/dist/mcp/tools/create-reminder.js +2 -2
  97. package/dist/mcp/tools/create-task.js +2 -2
  98. package/dist/mcp/tools/deactivate-behavior.js +2 -2
  99. package/dist/mcp/tools/list-reminders.js +2 -2
  100. package/dist/mcp/tools/list-tasks.js +2 -2
  101. package/dist/mcp/tools/send-message.js +2 -2
  102. package/dist/mcp/tools/update-task.js +2 -2
  103. package/dist/runtime/index.js +282 -7
  104. package/dist/tui/App.js +290 -15
  105. package/package.json +3 -2
  106. package/stack.release.json +23 -7
@@ -0,0 +1,376 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/bin/exe-healthcheck.ts
4
+ import { existsSync, readFileSync, readdirSync } from "fs";
5
+ import path from "path";
6
+ import { execSync } from "child_process";
7
+ import { fileURLToPath as fileURLToPath2 } from "url";
8
+
9
+ // src/lib/is-main.ts
10
+ import { realpathSync } from "fs";
11
+ import { fileURLToPath } from "url";
12
+ function isMainModule(importMetaUrl) {
13
+ if (process.argv[1] == null) return false;
14
+ if (process.argv[1].includes("mcp/server")) return false;
15
+ try {
16
+ const scriptPath = realpathSync(process.argv[1]);
17
+ const modulePath = realpathSync(fileURLToPath(importMetaUrl));
18
+ return scriptPath === modulePath;
19
+ } catch {
20
+ return importMetaUrl === `file://${process.argv[1]}` || importMetaUrl === new URL(process.argv[1], "file://").href;
21
+ }
22
+ }
23
+
24
+ // src/bin/exe-healthcheck.ts
25
+ function findPackageRoot() {
26
+ let dir = path.dirname(fileURLToPath2(import.meta.url));
27
+ const { root } = path.parse(dir);
28
+ while (dir !== root) {
29
+ if (existsSync(path.join(dir, "package.json"))) return dir;
30
+ dir = path.dirname(dir);
31
+ }
32
+ throw new Error("Cannot find package root");
33
+ }
34
+ function checkBuildIntegrity(pkgRoot) {
35
+ const results = [];
36
+ const tsupConfig = path.join(pkgRoot, "tsup.config.ts");
37
+ if (!existsSync(tsupConfig)) {
38
+ return [{ name: "build/tsup-config", pass: false, detail: "tsup.config.ts not found" }];
39
+ }
40
+ const configContent = readFileSync(tsupConfig, "utf-8");
41
+ const entryMatches = configContent.matchAll(/"([^"]+)":\s*"src\//g);
42
+ const missing = [];
43
+ let total = 0;
44
+ for (const match of entryMatches) {
45
+ const outputKey = match[1];
46
+ const expectedPath = path.join(pkgRoot, "dist", `${outputKey}.js`);
47
+ total++;
48
+ if (!existsSync(expectedPath)) {
49
+ missing.push(`dist/${outputKey}.js`);
50
+ }
51
+ }
52
+ if (missing.length > 0) {
53
+ results.push({
54
+ name: "build/entry-points",
55
+ pass: false,
56
+ detail: `${missing.length}/${total} entry points missing:
57
+ ${missing.join("\n ")}`
58
+ });
59
+ } else {
60
+ results.push({
61
+ name: "build/entry-points",
62
+ pass: true,
63
+ detail: `${total} entry points verified`
64
+ });
65
+ }
66
+ return results;
67
+ }
68
+ function checkEmbedPipeline(pkgRoot) {
69
+ const results = [];
70
+ const daemonPath = path.join(pkgRoot, "dist", "lib", "exe-daemon.js");
71
+ if (!existsSync(daemonPath)) {
72
+ results.push({
73
+ name: "exed/daemon-exists",
74
+ pass: false,
75
+ detail: `exe-daemon.js not found at ${daemonPath}`
76
+ });
77
+ return results;
78
+ }
79
+ results.push({ name: "exed/daemon-exists", pass: true, detail: "dist/lib/exe-daemon.js exists" });
80
+ const entryDirs = ["dist/hooks", "dist/bin", "dist/mcp"];
81
+ for (const dir of entryDirs) {
82
+ const fullDir = path.join(pkgRoot, dir);
83
+ if (!existsSync(fullDir)) continue;
84
+ let walkDir = fullDir;
85
+ const { root } = path.parse(walkDir);
86
+ let foundRoot = null;
87
+ while (walkDir !== root) {
88
+ if (existsSync(path.join(walkDir, "package.json"))) {
89
+ foundRoot = walkDir;
90
+ break;
91
+ }
92
+ walkDir = path.dirname(walkDir);
93
+ }
94
+ if (!foundRoot) {
95
+ results.push({
96
+ name: `exed/reachable-from-${dir}`,
97
+ pass: false,
98
+ detail: `Cannot find package root from ${dir}`
99
+ });
100
+ continue;
101
+ }
102
+ const resolvedDaemon = path.join(foundRoot, "dist", "lib", "exe-daemon.js");
103
+ const reachable = existsSync(resolvedDaemon);
104
+ results.push({
105
+ name: `exed/reachable-from-${dir}`,
106
+ pass: reachable,
107
+ detail: reachable ? `Resolves to ${resolvedDaemon}` : `NOT FOUND: ${resolvedDaemon}`
108
+ });
109
+ }
110
+ return results;
111
+ }
112
+ function checkTaskSystem(pkgRoot) {
113
+ const results = [];
114
+ const scannerPath = path.join(pkgRoot, "dist", "bin", "scan-tasks.js");
115
+ if (!existsSync(scannerPath)) {
116
+ results.push({ name: "tasks/scanner", pass: false, detail: "scan-tasks.js not found" });
117
+ return results;
118
+ }
119
+ try {
120
+ execSync(`node "${scannerPath}" /tmp/nonexistent-healthcheck-test --format=json 2>/dev/null`, {
121
+ timeout: 1e4,
122
+ encoding: "utf-8"
123
+ });
124
+ results.push({ name: "tasks/scanner", pass: true, detail: "scan-tasks.js runs without import errors" });
125
+ } catch (err) {
126
+ const msg = err instanceof Error ? err.message : String(err);
127
+ if (msg.includes("Cannot find module") || msg.includes("ERR_MODULE_NOT_FOUND") || msg.includes("SyntaxError")) {
128
+ results.push({ name: "tasks/scanner", pass: false, detail: `Import error: ${msg.slice(0, 200)}` });
129
+ } else {
130
+ results.push({ name: "tasks/scanner", pass: true, detail: "scan-tasks.js runs (no import errors)" });
131
+ }
132
+ }
133
+ return results;
134
+ }
135
+ function checkWorkerSpawning(pkgRoot) {
136
+ const results = [];
137
+ const workerPath = path.join(pkgRoot, "dist", "hooks", "ingest-worker.js");
138
+ if (!existsSync(workerPath)) {
139
+ results.push({ name: "workers/ingest-worker", pass: false, detail: "ingest-worker.js not found" });
140
+ return results;
141
+ }
142
+ try {
143
+ execSync(`node --check "${workerPath}" 2>&1`, { timeout: 1e4, encoding: "utf-8" });
144
+ results.push({ name: "workers/ingest-worker", pass: true, detail: "ingest-worker.js parses OK" });
145
+ } catch (err) {
146
+ results.push({
147
+ name: "workers/ingest-worker",
148
+ pass: false,
149
+ detail: `Parse error: ${err instanceof Error ? err.message.slice(0, 200) : String(err)}`
150
+ });
151
+ }
152
+ const hooksDir = path.join(pkgRoot, "dist", "hooks");
153
+ if (existsSync(hooksDir)) {
154
+ const hookFiles = readdirSync(hooksDir).filter((f) => f.endsWith(".js") && !f.endsWith(".js.map"));
155
+ let hooksPassed = 0;
156
+ const hooksFailed = [];
157
+ for (const hook of hookFiles) {
158
+ try {
159
+ execSync(`node --check "${path.join(hooksDir, hook)}" 2>&1`, { timeout: 1e4, encoding: "utf-8" });
160
+ hooksPassed++;
161
+ } catch {
162
+ hooksFailed.push(hook);
163
+ }
164
+ }
165
+ if (hooksFailed.length > 0) {
166
+ results.push({
167
+ name: "workers/hooks-parse",
168
+ pass: false,
169
+ detail: `${hooksFailed.length}/${hookFiles.length} hooks fail to parse: ${hooksFailed.join(", ")}`
170
+ });
171
+ } else {
172
+ results.push({
173
+ name: "workers/hooks-parse",
174
+ pass: true,
175
+ detail: `${hooksPassed} hook entry points parse OK`
176
+ });
177
+ }
178
+ }
179
+ return results;
180
+ }
181
+ function checkClaudeCodeInstall() {
182
+ const results = [];
183
+ const execPath = process.env.CLAUDE_CODE_EXECPATH ?? "";
184
+ if (execPath.length > 0 && (execPath.includes("claude/versions/") || execPath.includes("claude.exe") || execPath.includes("claude-native"))) {
185
+ results.push({
186
+ name: "cc/execpath-clean",
187
+ pass: false,
188
+ detail: `CLAUDE_CODE_EXECPATH points to native binary: "${execPath}" \u2014 20K phantom billing risk. Unset it: unset CLAUDE_CODE_EXECPATH`
189
+ });
190
+ } else {
191
+ results.push({
192
+ name: "cc/execpath-clean",
193
+ pass: true,
194
+ detail: execPath ? `CLAUDE_CODE_EXECPATH=${execPath} (node runtime, OK)` : "CLAUDE_CODE_EXECPATH is unset"
195
+ });
196
+ }
197
+ try {
198
+ const claudePath = execSync("which claude 2>/dev/null || true", { encoding: "utf8", timeout: 5e3 }).trim();
199
+ if (!claudePath) {
200
+ results.push({
201
+ name: "cc/cli-binary",
202
+ pass: false,
203
+ detail: "claude not found in PATH"
204
+ });
205
+ } else {
206
+ let resolved = claudePath;
207
+ try {
208
+ resolved = execSync(`readlink -f "${claudePath}" 2>/dev/null || readlink "${claudePath}" 2>/dev/null || echo "${claudePath}"`, {
209
+ encoding: "utf8",
210
+ timeout: 5e3
211
+ }).trim();
212
+ } catch {
213
+ }
214
+ if (resolved.includes("bin/claude.exe") || resolved.includes("bin/claude-native")) {
215
+ results.push({
216
+ name: "cc/cli-binary",
217
+ pass: false,
218
+ detail: `claude resolves to native binary: ${resolved}. Should be cli.js. Run: npm install -g @anthropic-ai/claude-code@2.1.98`
219
+ });
220
+ } else {
221
+ results.push({
222
+ name: "cc/cli-binary",
223
+ pass: true,
224
+ detail: `claude resolves to: ${resolved}`
225
+ });
226
+ }
227
+ }
228
+ } catch {
229
+ results.push({
230
+ name: "cc/cli-binary",
231
+ pass: false,
232
+ detail: "Failed to check claude binary path"
233
+ });
234
+ }
235
+ const versionsDir = path.join(
236
+ process.env.HOME ?? process.env.USERPROFILE ?? "",
237
+ ".local",
238
+ "share",
239
+ "claude",
240
+ "versions"
241
+ );
242
+ if (existsSync(versionsDir)) {
243
+ try {
244
+ const entries = readdirSync(versionsDir);
245
+ if (entries.length > 0) {
246
+ results.push({
247
+ name: "cc/native-cache-clean",
248
+ pass: false,
249
+ detail: `${entries.length} cached native version(s) found in ${versionsDir}: ${entries.slice(0, 3).join(", ")}${entries.length > 3 ? "..." : ""}. Remove: rm -rf "${versionsDir}"`
250
+ });
251
+ } else {
252
+ results.push({
253
+ name: "cc/native-cache-clean",
254
+ pass: true,
255
+ detail: `${versionsDir} is empty`
256
+ });
257
+ }
258
+ } catch {
259
+ results.push({
260
+ name: "cc/native-cache-clean",
261
+ pass: true,
262
+ detail: `${versionsDir} not readable (OK)`
263
+ });
264
+ }
265
+ } else {
266
+ results.push({
267
+ name: "cc/native-cache-clean",
268
+ pass: true,
269
+ detail: `${versionsDir} does not exist`
270
+ });
271
+ }
272
+ const disableOld = process.env.DISABLE_AUTOUPDATER === "1";
273
+ const disableNew = process.env.CLAUDE_CODE_AUTOUPDATER_DISABLED === "1";
274
+ if (!disableOld && !disableNew) {
275
+ results.push({
276
+ name: "cc/autoupdater-disabled",
277
+ pass: false,
278
+ detail: "Neither DISABLE_AUTOUPDATER=1 nor CLAUDE_CODE_AUTOUPDATER_DISABLED=1 is set. Auto-updater may install infected native binary. Export both in your shell profile."
279
+ });
280
+ } else {
281
+ const which = [
282
+ disableOld ? "DISABLE_AUTOUPDATER=1" : null,
283
+ disableNew ? "CLAUDE_CODE_AUTOUPDATER_DISABLED=1" : null
284
+ ].filter(Boolean).join(" + ");
285
+ results.push({
286
+ name: "cc/autoupdater-disabled",
287
+ pass: true,
288
+ detail: `Auto-updater disabled via ${which}`
289
+ });
290
+ }
291
+ try {
292
+ const ccVersion = execSync("claude --version 2>/dev/null || echo unknown", {
293
+ encoding: "utf8",
294
+ timeout: 5e3
295
+ }).trim();
296
+ const versionMatch = ccVersion.match(/(\d+\.\d+\.\d+)/);
297
+ if (versionMatch) {
298
+ const ver = versionMatch[1];
299
+ const [, minor] = ver.split(".").map(Number);
300
+ const isRisky = minor !== void 0 && minor >= 1 && parseInt(ver.split(".")[2] ?? "0") >= 119;
301
+ results.push({
302
+ name: "cc/version",
303
+ pass: !isRisky,
304
+ detail: isRisky ? `CC version ${ver} \u2014 \u22652.1.119 ships native binary only. Pin: npm install -g @anthropic-ai/claude-code@2.1.98` : `CC version ${ver}`
305
+ });
306
+ }
307
+ } catch {
308
+ }
309
+ return results;
310
+ }
311
+ function runHealthCheck() {
312
+ const pkgRoot = findPackageRoot();
313
+ const results = [
314
+ ...checkBuildIntegrity(pkgRoot),
315
+ ...checkEmbedPipeline(pkgRoot),
316
+ ...checkTaskSystem(pkgRoot),
317
+ ...checkWorkerSpawning(pkgRoot),
318
+ ...checkClaudeCodeInstall()
319
+ ];
320
+ const passed = results.filter((r) => r.pass).length;
321
+ const failed = results.filter((r) => !r.pass).length;
322
+ return { results, passed, failed };
323
+ }
324
+ if (isMainModule(import.meta.url)) {
325
+ const { results, passed, failed } = runHealthCheck();
326
+ console.log("\n exe-os Health Check\n");
327
+ for (const r of results) {
328
+ const icon = r.pass ? "\x1B[32m\u2713\x1B[0m" : "\x1B[31m\u2717\x1B[0m";
329
+ console.log(` ${icon} ${r.name}`);
330
+ console.log(` ${r.detail}`);
331
+ }
332
+ console.log(`
333
+ ${passed} passed, ${failed} failed
334
+ `);
335
+ process.exit(failed > 0 ? 1 : 0);
336
+ }
337
+
338
+ // src/bin/cc-doctor.ts
339
+ var LABELS = {
340
+ "cc/execpath-clean": "EXECPATH",
341
+ "cc/cli-binary": "Symlink",
342
+ "cc/native-cache-clean": "Native cache",
343
+ "cc/autoupdater-disabled": "Auto-updater",
344
+ "cc/version": "Version"
345
+ };
346
+ function formatResult(r) {
347
+ const icon = r.pass ? "\x1B[32m\u2713\x1B[0m" : "\x1B[31m\u2717\x1B[0m";
348
+ const label = LABELS[r.name] ?? r.name;
349
+ return `${icon} ${label}: ${r.detail}`;
350
+ }
351
+ function runCcDoctor() {
352
+ const results = checkClaudeCodeInstall();
353
+ const passed = results.filter((r) => r.pass).length;
354
+ const failed = results.filter((r) => !r.pass).length;
355
+ return { results, passed, failed };
356
+ }
357
+ if (isMainModule(import.meta.url)) {
358
+ const { results, passed, failed } = runCcDoctor();
359
+ console.log("\n CC Install Health Check\n");
360
+ for (const r of results) {
361
+ console.log(` ${formatResult(r)}`);
362
+ }
363
+ if (failed === 0) {
364
+ console.log(`
365
+ \x1B[32mStatus: CLEAN\x1B[0m \u2014 no 20K billing risk (${passed} checks passed)
366
+ `);
367
+ } else {
368
+ console.log(`
369
+ \x1B[31mStatus: ${failed} ISSUE${failed > 1 ? "S" : ""} FOUND\x1B[0m \u2014 ${passed} passed, ${failed} failed`);
370
+ console.log(" Fix: npm install -g @anthropic-ai/claude-code@2.1.98\n");
371
+ }
372
+ process.exit(failed > 0 ? 1 : 0);
373
+ }
374
+ export {
375
+ runCcDoctor
376
+ };