@askexenow/exe-os 0.8.0

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 (131) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +139 -0
  3. package/dist/bin/backfill-responses.js +1912 -0
  4. package/dist/bin/backfill-vectors.js +1642 -0
  5. package/dist/bin/cleanup-stale-review-tasks.js +1339 -0
  6. package/dist/bin/cli.js +18800 -0
  7. package/dist/bin/exe-agent.js +1858 -0
  8. package/dist/bin/exe-assign.js +1957 -0
  9. package/dist/bin/exe-boot.js +6460 -0
  10. package/dist/bin/exe-call.js +197 -0
  11. package/dist/bin/exe-cloud.js +850 -0
  12. package/dist/bin/exe-dispatch.js +1146 -0
  13. package/dist/bin/exe-doctor.js +1657 -0
  14. package/dist/bin/exe-export-behaviors.js +1494 -0
  15. package/dist/bin/exe-forget.js +1627 -0
  16. package/dist/bin/exe-gateway.js +7732 -0
  17. package/dist/bin/exe-healthcheck.js +207 -0
  18. package/dist/bin/exe-heartbeat.js +1647 -0
  19. package/dist/bin/exe-kill.js +1479 -0
  20. package/dist/bin/exe-launch-agent.js +1704 -0
  21. package/dist/bin/exe-link.js +192 -0
  22. package/dist/bin/exe-new-employee.js +852 -0
  23. package/dist/bin/exe-pending-messages.js +1446 -0
  24. package/dist/bin/exe-pending-notifications.js +1321 -0
  25. package/dist/bin/exe-pending-reviews.js +1468 -0
  26. package/dist/bin/exe-repo-drift.js +95 -0
  27. package/dist/bin/exe-review.js +1590 -0
  28. package/dist/bin/exe-search.js +2651 -0
  29. package/dist/bin/exe-session-cleanup.js +3173 -0
  30. package/dist/bin/exe-settings.js +354 -0
  31. package/dist/bin/exe-status.js +1532 -0
  32. package/dist/bin/exe-team.js +1324 -0
  33. package/dist/bin/git-sweep.js +2185 -0
  34. package/dist/bin/graph-backfill.js +1968 -0
  35. package/dist/bin/graph-export.js +1604 -0
  36. package/dist/bin/install.js +656 -0
  37. package/dist/bin/list-providers.js +140 -0
  38. package/dist/bin/scan-tasks.js +1820 -0
  39. package/dist/bin/setup.js +951 -0
  40. package/dist/bin/shard-migrate.js +1494 -0
  41. package/dist/bin/update.js +95 -0
  42. package/dist/bin/wiki-sync.js +1514 -0
  43. package/dist/gateway/index.js +8848 -0
  44. package/dist/hooks/bug-report-worker.js +2743 -0
  45. package/dist/hooks/commit-complete.js +2108 -0
  46. package/dist/hooks/error-recall.js +2861 -0
  47. package/dist/hooks/exe-heartbeat-hook.js +232 -0
  48. package/dist/hooks/ingest-worker.js +4793 -0
  49. package/dist/hooks/ingest.js +684 -0
  50. package/dist/hooks/instructions-loaded.js +1880 -0
  51. package/dist/hooks/notification.js +1726 -0
  52. package/dist/hooks/post-compact.js +1751 -0
  53. package/dist/hooks/pre-compact.js +1746 -0
  54. package/dist/hooks/pre-tool-use.js +2191 -0
  55. package/dist/hooks/prompt-ingest-worker.js +2126 -0
  56. package/dist/hooks/prompt-submit.js +4693 -0
  57. package/dist/hooks/response-ingest-worker.js +1936 -0
  58. package/dist/hooks/session-end.js +1752 -0
  59. package/dist/hooks/session-start.js +2795 -0
  60. package/dist/hooks/stop.js +1835 -0
  61. package/dist/hooks/subagent-stop.js +1726 -0
  62. package/dist/hooks/summary-worker.js +2661 -0
  63. package/dist/index.js +11834 -0
  64. package/dist/lib/cloud-sync.js +495 -0
  65. package/dist/lib/config.js +222 -0
  66. package/dist/lib/consolidation.js +476 -0
  67. package/dist/lib/crypto.js +51 -0
  68. package/dist/lib/database.js +730 -0
  69. package/dist/lib/device-registry.js +900 -0
  70. package/dist/lib/embedder.js +632 -0
  71. package/dist/lib/employee-templates.js +543 -0
  72. package/dist/lib/employees.js +177 -0
  73. package/dist/lib/error-detector.js +156 -0
  74. package/dist/lib/exe-daemon-client.js +451 -0
  75. package/dist/lib/exe-daemon.js +8285 -0
  76. package/dist/lib/file-grep.js +199 -0
  77. package/dist/lib/hybrid-search.js +1819 -0
  78. package/dist/lib/identity-templates.js +320 -0
  79. package/dist/lib/identity.js +223 -0
  80. package/dist/lib/keychain.js +145 -0
  81. package/dist/lib/license.js +377 -0
  82. package/dist/lib/messaging.js +1376 -0
  83. package/dist/lib/reminders.js +63 -0
  84. package/dist/lib/schedules.js +1396 -0
  85. package/dist/lib/session-registry.js +52 -0
  86. package/dist/lib/skill-learning.js +477 -0
  87. package/dist/lib/status-brief.js +235 -0
  88. package/dist/lib/store.js +1551 -0
  89. package/dist/lib/task-router.js +62 -0
  90. package/dist/lib/tasks.js +2456 -0
  91. package/dist/lib/tmux-routing.js +2836 -0
  92. package/dist/lib/tmux-status.js +261 -0
  93. package/dist/lib/tmux-transport.js +83 -0
  94. package/dist/lib/transport.js +128 -0
  95. package/dist/lib/ws-auth.js +19 -0
  96. package/dist/lib/ws-client.js +160 -0
  97. package/dist/mcp/server.js +10538 -0
  98. package/dist/mcp/tools/complete-reminder.js +67 -0
  99. package/dist/mcp/tools/create-reminder.js +52 -0
  100. package/dist/mcp/tools/create-task.js +1853 -0
  101. package/dist/mcp/tools/deactivate-behavior.js +263 -0
  102. package/dist/mcp/tools/list-reminders.js +62 -0
  103. package/dist/mcp/tools/list-tasks.js +463 -0
  104. package/dist/mcp/tools/send-message.js +1382 -0
  105. package/dist/mcp/tools/update-task.js +1692 -0
  106. package/dist/runtime/index.js +6809 -0
  107. package/dist/tui/App.js +17479 -0
  108. package/package.json +104 -0
  109. package/src/commands/exe/assign.md +17 -0
  110. package/src/commands/exe/build-adv.md +381 -0
  111. package/src/commands/exe/call.md +133 -0
  112. package/src/commands/exe/cloud.md +17 -0
  113. package/src/commands/exe/employee-heartbeat.md +44 -0
  114. package/src/commands/exe/forget.md +15 -0
  115. package/src/commands/exe/heartbeat.md +92 -0
  116. package/src/commands/exe/intercom.md +81 -0
  117. package/src/commands/exe/kill.md +34 -0
  118. package/src/commands/exe/launch.md +52 -0
  119. package/src/commands/exe/link.md +17 -0
  120. package/src/commands/exe/logs.md +22 -0
  121. package/src/commands/exe/new-employee.md +12 -0
  122. package/src/commands/exe/review.md +14 -0
  123. package/src/commands/exe/schedule.md +108 -0
  124. package/src/commands/exe/search.md +13 -0
  125. package/src/commands/exe/sessions.md +25 -0
  126. package/src/commands/exe/settings.md +13 -0
  127. package/src/commands/exe/setup.md +171 -0
  128. package/src/commands/exe/status.md +15 -0
  129. package/src/commands/exe/team.md +11 -0
  130. package/src/commands/exe/update.md +11 -0
  131. package/src/commands/exe.md +181 -0
@@ -0,0 +1,207 @@
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
+ try {
15
+ const scriptPath = realpathSync(process.argv[1]);
16
+ const modulePath = realpathSync(fileURLToPath(importMetaUrl));
17
+ return scriptPath === modulePath;
18
+ } catch {
19
+ return importMetaUrl === `file://${process.argv[1]}` || importMetaUrl === new URL(process.argv[1], "file://").href;
20
+ }
21
+ }
22
+
23
+ // src/bin/exe-healthcheck.ts
24
+ function findPackageRoot() {
25
+ let dir = path.dirname(fileURLToPath2(import.meta.url));
26
+ const { root } = path.parse(dir);
27
+ while (dir !== root) {
28
+ if (existsSync(path.join(dir, "package.json"))) return dir;
29
+ dir = path.dirname(dir);
30
+ }
31
+ throw new Error("Cannot find package root");
32
+ }
33
+ function checkBuildIntegrity(pkgRoot) {
34
+ const results = [];
35
+ const tsupConfig = path.join(pkgRoot, "tsup.config.ts");
36
+ if (!existsSync(tsupConfig)) {
37
+ return [{ name: "build/tsup-config", pass: false, detail: "tsup.config.ts not found" }];
38
+ }
39
+ const configContent = readFileSync(tsupConfig, "utf-8");
40
+ const entryMatches = configContent.matchAll(/"([^"]+)":\s*"src\//g);
41
+ const missing = [];
42
+ let total = 0;
43
+ for (const match of entryMatches) {
44
+ const outputKey = match[1];
45
+ const expectedPath = path.join(pkgRoot, "dist", `${outputKey}.js`);
46
+ total++;
47
+ if (!existsSync(expectedPath)) {
48
+ missing.push(`dist/${outputKey}.js`);
49
+ }
50
+ }
51
+ if (missing.length > 0) {
52
+ results.push({
53
+ name: "build/entry-points",
54
+ pass: false,
55
+ detail: `${missing.length}/${total} entry points missing:
56
+ ${missing.join("\n ")}`
57
+ });
58
+ } else {
59
+ results.push({
60
+ name: "build/entry-points",
61
+ pass: true,
62
+ detail: `${total} entry points verified`
63
+ });
64
+ }
65
+ return results;
66
+ }
67
+ function checkEmbedPipeline(pkgRoot) {
68
+ const results = [];
69
+ const daemonPath = path.join(pkgRoot, "dist", "lib", "exe-daemon.js");
70
+ if (!existsSync(daemonPath)) {
71
+ results.push({
72
+ name: "exed/daemon-exists",
73
+ pass: false,
74
+ detail: `exe-daemon.js not found at ${daemonPath}`
75
+ });
76
+ return results;
77
+ }
78
+ results.push({ name: "exed/daemon-exists", pass: true, detail: "dist/lib/exe-daemon.js exists" });
79
+ const entryDirs = ["dist/hooks", "dist/bin", "dist/mcp"];
80
+ for (const dir of entryDirs) {
81
+ const fullDir = path.join(pkgRoot, dir);
82
+ if (!existsSync(fullDir)) continue;
83
+ let walkDir = fullDir;
84
+ const { root } = path.parse(walkDir);
85
+ let foundRoot = null;
86
+ while (walkDir !== root) {
87
+ if (existsSync(path.join(walkDir, "package.json"))) {
88
+ foundRoot = walkDir;
89
+ break;
90
+ }
91
+ walkDir = path.dirname(walkDir);
92
+ }
93
+ if (!foundRoot) {
94
+ results.push({
95
+ name: `exed/reachable-from-${dir}`,
96
+ pass: false,
97
+ detail: `Cannot find package root from ${dir}`
98
+ });
99
+ continue;
100
+ }
101
+ const resolvedDaemon = path.join(foundRoot, "dist", "lib", "exe-daemon.js");
102
+ const reachable = existsSync(resolvedDaemon);
103
+ results.push({
104
+ name: `exed/reachable-from-${dir}`,
105
+ pass: reachable,
106
+ detail: reachable ? `Resolves to ${resolvedDaemon}` : `NOT FOUND: ${resolvedDaemon}`
107
+ });
108
+ }
109
+ return results;
110
+ }
111
+ function checkTaskSystem(pkgRoot) {
112
+ const results = [];
113
+ const scannerPath = path.join(pkgRoot, "dist", "bin", "scan-tasks.js");
114
+ if (!existsSync(scannerPath)) {
115
+ results.push({ name: "tasks/scanner", pass: false, detail: "scan-tasks.js not found" });
116
+ return results;
117
+ }
118
+ try {
119
+ execSync(`node "${scannerPath}" /tmp/nonexistent-healthcheck-test --format=json 2>/dev/null`, {
120
+ timeout: 1e4,
121
+ encoding: "utf-8"
122
+ });
123
+ results.push({ name: "tasks/scanner", pass: true, detail: "scan-tasks.js runs without import errors" });
124
+ } catch (err) {
125
+ const msg = err instanceof Error ? err.message : String(err);
126
+ if (msg.includes("Cannot find module") || msg.includes("ERR_MODULE_NOT_FOUND") || msg.includes("SyntaxError")) {
127
+ results.push({ name: "tasks/scanner", pass: false, detail: `Import error: ${msg.slice(0, 200)}` });
128
+ } else {
129
+ results.push({ name: "tasks/scanner", pass: true, detail: "scan-tasks.js runs (no import errors)" });
130
+ }
131
+ }
132
+ return results;
133
+ }
134
+ function checkWorkerSpawning(pkgRoot) {
135
+ const results = [];
136
+ const workerPath = path.join(pkgRoot, "dist", "hooks", "ingest-worker.js");
137
+ if (!existsSync(workerPath)) {
138
+ results.push({ name: "workers/ingest-worker", pass: false, detail: "ingest-worker.js not found" });
139
+ return results;
140
+ }
141
+ try {
142
+ execSync(`node --check "${workerPath}" 2>&1`, { timeout: 1e4, encoding: "utf-8" });
143
+ results.push({ name: "workers/ingest-worker", pass: true, detail: "ingest-worker.js parses OK" });
144
+ } catch (err) {
145
+ results.push({
146
+ name: "workers/ingest-worker",
147
+ pass: false,
148
+ detail: `Parse error: ${err instanceof Error ? err.message.slice(0, 200) : String(err)}`
149
+ });
150
+ }
151
+ const hooksDir = path.join(pkgRoot, "dist", "hooks");
152
+ if (existsSync(hooksDir)) {
153
+ const hookFiles = readdirSync(hooksDir).filter((f) => f.endsWith(".js") && !f.endsWith(".js.map"));
154
+ let hooksPassed = 0;
155
+ const hooksFailed = [];
156
+ for (const hook of hookFiles) {
157
+ try {
158
+ execSync(`node --check "${path.join(hooksDir, hook)}" 2>&1`, { timeout: 1e4, encoding: "utf-8" });
159
+ hooksPassed++;
160
+ } catch {
161
+ hooksFailed.push(hook);
162
+ }
163
+ }
164
+ if (hooksFailed.length > 0) {
165
+ results.push({
166
+ name: "workers/hooks-parse",
167
+ pass: false,
168
+ detail: `${hooksFailed.length}/${hookFiles.length} hooks fail to parse: ${hooksFailed.join(", ")}`
169
+ });
170
+ } else {
171
+ results.push({
172
+ name: "workers/hooks-parse",
173
+ pass: true,
174
+ detail: `${hooksPassed} hook entry points parse OK`
175
+ });
176
+ }
177
+ }
178
+ return results;
179
+ }
180
+ function runHealthCheck() {
181
+ const pkgRoot = findPackageRoot();
182
+ const results = [
183
+ ...checkBuildIntegrity(pkgRoot),
184
+ ...checkEmbedPipeline(pkgRoot),
185
+ ...checkTaskSystem(pkgRoot),
186
+ ...checkWorkerSpawning(pkgRoot)
187
+ ];
188
+ const passed = results.filter((r) => r.pass).length;
189
+ const failed = results.filter((r) => !r.pass).length;
190
+ return { results, passed, failed };
191
+ }
192
+ if (isMainModule(import.meta.url)) {
193
+ const { results, passed, failed } = runHealthCheck();
194
+ console.log("\n exe-os Health Check\n");
195
+ for (const r of results) {
196
+ const icon = r.pass ? "\x1B[32m\u2713\x1B[0m" : "\x1B[31m\u2717\x1B[0m";
197
+ console.log(` ${icon} ${r.name}`);
198
+ console.log(` ${r.detail}`);
199
+ }
200
+ console.log(`
201
+ ${passed} passed, ${failed} failed
202
+ `);
203
+ process.exit(failed > 0 ? 1 : 0);
204
+ }
205
+ export {
206
+ runHealthCheck
207
+ };