@askexenow/exe-os 0.8.1 → 0.8.2

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/package.json +1 -1
  2. package/dist/bin/backfill-responses.js +0 -2064
  3. package/dist/bin/backfill-vectors.js +0 -1771
  4. package/dist/bin/cleanup-stale-review-tasks.js +0 -1468
  5. package/dist/bin/cli.js +0 -21371
  6. package/dist/bin/exe-agent.js +0 -2016
  7. package/dist/bin/exe-assign.js +0 -2176
  8. package/dist/bin/exe-boot.js +0 -6332
  9. package/dist/bin/exe-call.js +0 -341
  10. package/dist/bin/exe-cloud.js +0 -861
  11. package/dist/bin/exe-dispatch.js +0 -1159
  12. package/dist/bin/exe-doctor.js +0 -1786
  13. package/dist/bin/exe-export-behaviors.js +0 -1637
  14. package/dist/bin/exe-forget.js +0 -1784
  15. package/dist/bin/exe-gateway.js +0 -8140
  16. package/dist/bin/exe-healthcheck.js +0 -207
  17. package/dist/bin/exe-heartbeat.js +0 -1778
  18. package/dist/bin/exe-kill.js +0 -1622
  19. package/dist/bin/exe-launch-agent.js +0 -1847
  20. package/dist/bin/exe-link.js +0 -192
  21. package/dist/bin/exe-new-employee.js +0 -1384
  22. package/dist/bin/exe-pending-messages.js +0 -1576
  23. package/dist/bin/exe-pending-notifications.js +0 -1450
  24. package/dist/bin/exe-pending-reviews.js +0 -1598
  25. package/dist/bin/exe-repo-drift.js +0 -95
  26. package/dist/bin/exe-review.js +0 -1742
  27. package/dist/bin/exe-search.js +0 -3116
  28. package/dist/bin/exe-session-cleanup.js +0 -3360
  29. package/dist/bin/exe-settings.js +0 -365
  30. package/dist/bin/exe-status.js +0 -1661
  31. package/dist/bin/exe-team.js +0 -1453
  32. package/dist/bin/git-sweep.js +0 -2441
  33. package/dist/bin/graph-backfill.js +0 -2111
  34. package/dist/bin/graph-export.js +0 -1747
  35. package/dist/bin/install.js +0 -661
  36. package/dist/bin/list-providers.js +0 -140
  37. package/dist/bin/scan-tasks.js +0 -2039
  38. package/dist/bin/setup.js +0 -2717
  39. package/dist/bin/shard-migrate.js +0 -1637
  40. package/dist/bin/update.js +0 -98
  41. package/dist/bin/wiki-sync.js +0 -1657
  42. package/dist/gateway/index.js +0 -9256
  43. package/dist/hooks/bug-report-worker.js +0 -2903
  44. package/dist/hooks/commit-complete.js +0 -2364
  45. package/dist/hooks/error-recall.js +0 -3327
  46. package/dist/hooks/exe-heartbeat-hook.js +0 -237
  47. package/dist/hooks/ingest-worker.js +0 -5065
  48. package/dist/hooks/ingest.js +0 -695
  49. package/dist/hooks/instructions-loaded.js +0 -2069
  50. package/dist/hooks/notification.js +0 -1915
  51. package/dist/hooks/post-compact.js +0 -1940
  52. package/dist/hooks/pre-compact.js +0 -1935
  53. package/dist/hooks/pre-tool-use.js +0 -2380
  54. package/dist/hooks/prompt-ingest-worker.js +0 -2291
  55. package/dist/hooks/prompt-submit.js +0 -5189
  56. package/dist/hooks/response-ingest-worker.js +0 -2431
  57. package/dist/hooks/session-end.js +0 -2196
  58. package/dist/hooks/session-start.js +0 -3259
  59. package/dist/hooks/stop.js +0 -2025
  60. package/dist/hooks/subagent-stop.js +0 -1915
  61. package/dist/hooks/summary-worker.js +0 -2931
  62. package/dist/index.js +0 -12327
  63. package/dist/lib/cloud-sync.js +0 -500
  64. package/dist/lib/config.js +0 -235
  65. package/dist/lib/consolidation.js +0 -481
  66. package/dist/lib/crypto.js +0 -51
  67. package/dist/lib/database.js +0 -834
  68. package/dist/lib/device-registry.js +0 -1009
  69. package/dist/lib/embedder.js +0 -645
  70. package/dist/lib/employee-templates.js +0 -570
  71. package/dist/lib/employees.js +0 -182
  72. package/dist/lib/error-detector.js +0 -156
  73. package/dist/lib/exe-daemon-client.js +0 -456
  74. package/dist/lib/exe-daemon.js +0 -8699
  75. package/dist/lib/file-grep.js +0 -215
  76. package/dist/lib/hybrid-search.js +0 -3064
  77. package/dist/lib/identity-templates.js +0 -441
  78. package/dist/lib/identity.js +0 -228
  79. package/dist/lib/keychain.js +0 -145
  80. package/dist/lib/license.js +0 -382
  81. package/dist/lib/messaging.js +0 -1389
  82. package/dist/lib/reminders.js +0 -63
  83. package/dist/lib/schedules.js +0 -1525
  84. package/dist/lib/session-registry.js +0 -52
  85. package/dist/lib/skill-learning.js +0 -488
  86. package/dist/lib/status-brief.js +0 -240
  87. package/dist/lib/store.js +0 -1740
  88. package/dist/lib/task-router.js +0 -128
  89. package/dist/lib/tasks.js +0 -2585
  90. package/dist/lib/tmux-routing.js +0 -2969
  91. package/dist/lib/tmux-status.js +0 -261
  92. package/dist/lib/tmux-transport.js +0 -83
  93. package/dist/lib/transport.js +0 -128
  94. package/dist/lib/ws-auth.js +0 -19
  95. package/dist/lib/ws-client.js +0 -160
  96. package/dist/mcp/server.js +0 -10812
  97. package/dist/mcp/tools/complete-reminder.js +0 -67
  98. package/dist/mcp/tools/create-reminder.js +0 -52
  99. package/dist/mcp/tools/create-task.js +0 -1903
  100. package/dist/mcp/tools/deactivate-behavior.js +0 -268
  101. package/dist/mcp/tools/list-reminders.js +0 -62
  102. package/dist/mcp/tools/list-tasks.js +0 -491
  103. package/dist/mcp/tools/send-message.js +0 -1395
  104. package/dist/mcp/tools/update-task.js +0 -1807
  105. package/dist/runtime/index.js +0 -7201
  106. package/dist/tui/App.js +0 -17874
@@ -1,661 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- // src/adapters/claude/installer.ts
4
- import { readFile as readFile3, writeFile as writeFile3, mkdir as mkdir3, readdir } from "fs/promises";
5
- import { existsSync as existsSync4, readFileSync as readFileSync2 } from "fs";
6
- import path4 from "path";
7
- import os3 from "os";
8
- import { fileURLToPath } from "url";
9
-
10
- // src/lib/agent-symlinks.ts
11
- import os2 from "os";
12
- import path3 from "path";
13
- import {
14
- existsSync as existsSync3,
15
- lstatSync,
16
- mkdirSync,
17
- readlinkSync as readlinkSync2,
18
- symlinkSync as symlinkSync2
19
- } from "fs";
20
-
21
- // src/lib/employees.ts
22
- import { readFile as readFile2, writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
23
- import { existsSync as existsSync2, symlinkSync, readlinkSync } from "fs";
24
- import { execSync } from "child_process";
25
- import path2 from "path";
26
-
27
- // src/lib/config.ts
28
- import { readFile, writeFile, mkdir } from "fs/promises";
29
- import { readFileSync, existsSync, renameSync } from "fs";
30
- import path from "path";
31
- import os from "os";
32
- function resolveDataDir() {
33
- if (process.env.EXE_OS_DIR) return process.env.EXE_OS_DIR;
34
- if (process.env.EXE_MEM_DIR) return process.env.EXE_MEM_DIR;
35
- const newDir = path.join(os.homedir(), ".exe-os");
36
- const legacyDir = path.join(os.homedir(), ".exe-mem");
37
- if (!existsSync(newDir) && existsSync(legacyDir)) {
38
- try {
39
- renameSync(legacyDir, newDir);
40
- process.stderr.write(`[exe-os] Migrated data directory: ~/.exe-mem \u2192 ~/.exe-os
41
- `);
42
- } catch {
43
- return legacyDir;
44
- }
45
- }
46
- return newDir;
47
- }
48
- var EXE_AI_DIR = resolveDataDir();
49
- var DB_PATH = path.join(EXE_AI_DIR, "memories.db");
50
- var MODELS_DIR = path.join(EXE_AI_DIR, "models");
51
- var CONFIG_PATH = path.join(EXE_AI_DIR, "config.json");
52
- var LEGACY_LANCE_PATH = path.join(EXE_AI_DIR, "local.lance");
53
- var CURRENT_CONFIG_VERSION = 1;
54
- var DEFAULT_CONFIG = {
55
- config_version: CURRENT_CONFIG_VERSION,
56
- dbPath: DB_PATH,
57
- modelFile: "jina-embeddings-v5-small-q4_k_m.gguf",
58
- embeddingDim: 1024,
59
- batchSize: 20,
60
- flushIntervalMs: 1e4,
61
- autoIngestion: true,
62
- autoRetrieval: true,
63
- searchMode: "hybrid",
64
- hookSearchMode: "hybrid",
65
- fileGrepEnabled: true,
66
- splashEffect: true,
67
- consolidationEnabled: true,
68
- consolidationIntervalMs: 6 * 60 * 60 * 1e3,
69
- consolidationModel: "claude-haiku-4-5-20251001",
70
- consolidationMaxCallsPerRun: 20,
71
- selfQueryRouter: true,
72
- selfQueryModel: "claude-haiku-4-5-20251001",
73
- rerankerEnabled: true,
74
- scalingRoadmap: {
75
- rerankerAutoTrigger: {
76
- enabled: true,
77
- broadQueryMinCardinality: 5e4,
78
- fetchTopK: 150,
79
- returnTopK: 5
80
- }
81
- },
82
- graphRagEnabled: true,
83
- wikiEnabled: false,
84
- wikiUrl: "",
85
- wikiApiKey: "",
86
- wikiSyncIntervalMs: 30 * 60 * 1e3,
87
- wikiWorkspaceMapping: {
88
- exe: "Executive",
89
- yoshi: "Engineering",
90
- mari: "Marketing",
91
- tom: "Engineering",
92
- sasha: "Production"
93
- },
94
- wikiAutoUpdate: true,
95
- wikiAutoUpdateThreshold: 0.5,
96
- wikiAutoUpdateCreateNew: true,
97
- skillLearning: true,
98
- skillThreshold: 3,
99
- skillModel: "claude-haiku-4-5-20251001",
100
- exeHeartbeat: {
101
- enabled: true,
102
- intervalSeconds: 60,
103
- staleInProgressThresholdHours: 2
104
- },
105
- sessionLifecycle: {
106
- idleKillEnabled: true,
107
- idleKillTicksRequired: 3,
108
- idleKillIntercomAckWindowMs: 1e4,
109
- maxAutoInstances: 10
110
- },
111
- autoUpdate: {
112
- checkOnBoot: true,
113
- autoInstall: false,
114
- checkIntervalMs: 24 * 60 * 60 * 1e3
115
- }
116
- };
117
-
118
- // src/lib/employees.ts
119
- var EMPLOYEES_PATH = path2.join(EXE_AI_DIR, "exe-employees.json");
120
- async function loadEmployees(employeesPath = EMPLOYEES_PATH) {
121
- if (!existsSync2(employeesPath)) {
122
- return [];
123
- }
124
- const raw = await readFile2(employeesPath, "utf-8");
125
- try {
126
- return JSON.parse(raw);
127
- } catch {
128
- return [];
129
- }
130
- }
131
-
132
- // src/lib/agent-symlinks.ts
133
- function claudeAgentsDir(homeDir) {
134
- return path3.join(homeDir, ".claude", "agents");
135
- }
136
- function identitySourcePath(homeDir, agentId) {
137
- return path3.join(homeDir, ".exe-os", "identity", `${agentId}.md`);
138
- }
139
- function claudeAgentLinkPath(homeDir, agentId) {
140
- return path3.join(claudeAgentsDir(homeDir), `${agentId}.md`);
141
- }
142
- function ensureAgentSymlink(agentId, homeDir = os2.homedir()) {
143
- const target = identitySourcePath(homeDir, agentId);
144
- const link = claudeAgentLinkPath(homeDir, agentId);
145
- mkdirSync(claudeAgentsDir(homeDir), { recursive: true });
146
- if (existsSync3(link)) {
147
- let stat;
148
- try {
149
- stat = lstatSync(link);
150
- } catch {
151
- return { agentId, action: "conflict", target, link, conflict: "stat_failed" };
152
- }
153
- if (!stat.isSymbolicLink()) {
154
- return { agentId, action: "conflict", target, link, conflict: "regular_file" };
155
- }
156
- let currentTarget;
157
- try {
158
- currentTarget = readlinkSync2(link);
159
- } catch {
160
- return { agentId, action: "conflict", target, link, conflict: "readlink_failed" };
161
- }
162
- if (currentTarget === target) {
163
- return { agentId, action: "already_correct", target, link };
164
- }
165
- return { agentId, action: "conflict", target, link, conflict: `points_to:${currentTarget}` };
166
- }
167
- try {
168
- symlinkSync2(target, link);
169
- } catch (err) {
170
- return {
171
- agentId,
172
- action: "conflict",
173
- target,
174
- link,
175
- conflict: err instanceof Error ? err.message : String(err)
176
- };
177
- }
178
- return { agentId, action: "created", target, link };
179
- }
180
- async function ensureAllAgentSymlinks(homeDir = os2.homedir()) {
181
- const employees = await loadEmployees();
182
- return employees.map((emp) => ensureAgentSymlink(emp.name, homeDir));
183
- }
184
-
185
- // src/lib/mcp-prefix.ts
186
- var MCP_PRIMARY_KEY = "exe-os";
187
- var MCP_LEGACY_KEY = "exe-mem";
188
- var MCP_TOOL_PREFIXES = [
189
- `mcp__${MCP_PRIMARY_KEY}__`,
190
- `mcp__${MCP_LEGACY_KEY}__`
191
- ];
192
- function expandDualPrefixTools(shortNames) {
193
- const out = [];
194
- for (const name of shortNames) {
195
- for (const prefix of MCP_TOOL_PREFIXES) {
196
- out.push(prefix + name);
197
- }
198
- }
199
- return out;
200
- }
201
-
202
- // src/adapters/claude/installer.ts
203
- function resolvePackageRoot() {
204
- const thisFile = fileURLToPath(import.meta.url);
205
- let dir = path4.dirname(thisFile);
206
- const root = path4.parse(dir).root;
207
- while (dir !== root) {
208
- const pkgPath = path4.join(dir, "package.json");
209
- if (existsSync4(pkgPath)) {
210
- try {
211
- const pkg = JSON.parse(readFileSync2(pkgPath, "utf-8"));
212
- if (pkg.name === "exe-os") return dir;
213
- } catch {
214
- }
215
- }
216
- dir = path4.dirname(dir);
217
- }
218
- return path4.resolve(path4.dirname(thisFile), "..", "..", "..");
219
- }
220
- async function copySlashCommands(packageRoot, homeDir = os3.homedir()) {
221
- let copied = 0;
222
- let skipped = 0;
223
- const skillsBase = path4.join(homeDir, ".claude", "skills");
224
- const exeDir = path4.join(packageRoot, "src", "commands", "exe");
225
- if (existsSync4(exeDir)) {
226
- const entries = await readdir(exeDir);
227
- const mdFiles = entries.filter((f) => f.endsWith(".md"));
228
- for (const file of mdFiles) {
229
- const name = file.replace(".md", "");
230
- const destDir = path4.join(skillsBase, `exe-${name}`);
231
- await mkdir3(destDir, { recursive: true });
232
- const srcPath = path4.join(exeDir, file);
233
- const destPath = path4.join(destDir, "SKILL.md");
234
- const result = await copyAsSkill(srcPath, destPath, `exe-${name}`);
235
- if (result) copied++;
236
- else skipped++;
237
- }
238
- }
239
- const topLevelSrc = path4.join(packageRoot, "src", "commands", "exe.md");
240
- if (existsSync4(topLevelSrc)) {
241
- const destDir = path4.join(skillsBase, "exe");
242
- await mkdir3(destDir, { recursive: true });
243
- const destPath = path4.join(destDir, "SKILL.md");
244
- const result = await copyAsSkill(topLevelSrc, destPath, "exe");
245
- if (result) copied++;
246
- else skipped++;
247
- }
248
- return { copied, skipped };
249
- }
250
- async function copyAsSkill(srcPath, destPath, skillName) {
251
- let content = await readFile3(srcPath, "utf-8");
252
- const fmMatch = content.match(/^---\n([\s\S]*?)\n---/);
253
- if (fmMatch?.[1]) {
254
- const fm = fmMatch[1];
255
- if (fm.includes("name:")) {
256
- content = content.replace(
257
- /^(---\n[\s\S]*?)name:\s*[^\n]+/,
258
- `$1name: ${skillName}`
259
- );
260
- } else {
261
- content = content.replace(/^---\n/, `---
262
- name: ${skillName}
263
- `);
264
- }
265
- }
266
- if (existsSync4(destPath)) {
267
- const existing = await readFile3(destPath, "utf-8");
268
- if (existing === content) return false;
269
- }
270
- await writeFile3(destPath, content);
271
- return true;
272
- }
273
- async function registerMcpServer(packageRoot, homeDir = os3.homedir()) {
274
- const claudeJsonPath = path4.join(homeDir, ".claude.json");
275
- let claudeJson = {};
276
- if (existsSync4(claudeJsonPath)) {
277
- try {
278
- claudeJson = JSON.parse(await readFile3(claudeJsonPath, "utf-8"));
279
- } catch {
280
- claudeJson = {};
281
- }
282
- }
283
- if (!claudeJson.mcpServers) {
284
- claudeJson.mcpServers = {};
285
- }
286
- const newEntry = {
287
- type: "stdio",
288
- command: "node",
289
- args: [path4.join(packageRoot, "dist", "mcp", "server.js")],
290
- env: {}
291
- };
292
- const legacy = claudeJson.mcpServers[MCP_LEGACY_KEY];
293
- const current = claudeJson.mcpServers[MCP_PRIMARY_KEY];
294
- const currentMatches = current && JSON.stringify(current) === JSON.stringify(newEntry);
295
- if (currentMatches && !legacy) {
296
- return false;
297
- }
298
- claudeJson.mcpServers[MCP_PRIMARY_KEY] = newEntry;
299
- if (legacy) {
300
- delete claudeJson.mcpServers[MCP_LEGACY_KEY];
301
- }
302
- await writeFile3(claudeJsonPath, JSON.stringify(claudeJson, null, 2) + "\n");
303
- return true;
304
- }
305
- async function mergeHooks(packageRoot, homeDir = os3.homedir()) {
306
- const settingsPath = path4.join(homeDir, ".claude", "settings.json");
307
- let settings = {};
308
- if (existsSync4(settingsPath)) {
309
- try {
310
- settings = JSON.parse(await readFile3(settingsPath, "utf-8"));
311
- } catch {
312
- settings = {};
313
- }
314
- }
315
- if (!settings.hooks) {
316
- settings.hooks = {};
317
- }
318
- const hooksToRegister = [
319
- {
320
- event: "PostToolUse",
321
- group: {
322
- matcher: "Bash|Edit|Write|Read|Glob|Grep|Agent|mcp__.*",
323
- hooks: [
324
- {
325
- type: "command",
326
- command: `node "${path4.join(packageRoot, "dist", "hooks", "ingest.js")}"`
327
- },
328
- {
329
- type: "command",
330
- command: `node "${path4.join(packageRoot, "dist", "hooks", "error-recall.js")}"`
331
- }
332
- ]
333
- },
334
- marker: "dist/hooks/ingest.js"
335
- },
336
- {
337
- event: "SessionStart",
338
- group: {
339
- hooks: [
340
- {
341
- type: "command",
342
- command: `node "${path4.join(packageRoot, "dist", "hooks", "session-start.js")}"`,
343
- timeout: 1e4
344
- }
345
- ]
346
- },
347
- marker: "dist/hooks/session-start.js"
348
- },
349
- {
350
- event: "UserPromptSubmit",
351
- group: {
352
- hooks: [
353
- {
354
- type: "command",
355
- command: `node "${path4.join(packageRoot, "dist", "hooks", "prompt-submit.js")}"`
356
- }
357
- ]
358
- },
359
- marker: "dist/hooks/prompt-submit.js"
360
- },
361
- {
362
- event: "UserPromptSubmit",
363
- group: {
364
- hooks: [
365
- {
366
- type: "command",
367
- command: `node "${path4.join(packageRoot, "dist", "hooks", "exe-heartbeat-hook.js")}"`,
368
- timeout: 5e3
369
- }
370
- ]
371
- },
372
- marker: "dist/hooks/exe-heartbeat-hook.js"
373
- },
374
- {
375
- event: "Stop",
376
- group: {
377
- hooks: [
378
- {
379
- type: "command",
380
- command: `node "${path4.join(packageRoot, "dist", "hooks", "stop.js")}"`
381
- }
382
- ]
383
- },
384
- marker: "dist/hooks/stop.js"
385
- },
386
- {
387
- event: "PreToolUse",
388
- group: {
389
- matcher: "Write|Edit|Read|Bash",
390
- hooks: [
391
- {
392
- type: "command",
393
- command: `node "${path4.join(packageRoot, "dist", "hooks", "pre-tool-use.js")}"`
394
- }
395
- ]
396
- },
397
- marker: "dist/hooks/pre-tool-use.js"
398
- },
399
- {
400
- event: "SubagentStop",
401
- group: {
402
- hooks: [
403
- {
404
- type: "command",
405
- command: `node "${path4.join(packageRoot, "dist", "hooks", "subagent-stop.js")}"`
406
- }
407
- ]
408
- },
409
- marker: "dist/hooks/subagent-stop.js"
410
- },
411
- {
412
- event: "PreCompact",
413
- group: {
414
- hooks: [
415
- {
416
- type: "command",
417
- command: `node "${path4.join(packageRoot, "dist", "hooks", "pre-compact.js")}"`,
418
- timeout: 1e4
419
- }
420
- ]
421
- },
422
- marker: "dist/hooks/pre-compact.js"
423
- },
424
- {
425
- event: "SessionEnd",
426
- group: {
427
- hooks: [
428
- {
429
- type: "command",
430
- command: `node "${path4.join(packageRoot, "dist", "hooks", "session-end.js")}"`
431
- }
432
- ]
433
- },
434
- marker: "dist/hooks/session-end.js"
435
- },
436
- {
437
- event: "Notification",
438
- group: {
439
- hooks: [
440
- {
441
- type: "command",
442
- command: `node "${path4.join(packageRoot, "dist", "hooks", "notification.js")}"`
443
- }
444
- ]
445
- },
446
- marker: "dist/hooks/notification.js"
447
- },
448
- {
449
- event: "PostCompact",
450
- group: {
451
- hooks: [
452
- {
453
- type: "command",
454
- command: `node "${path4.join(packageRoot, "dist", "hooks", "post-compact.js")}"`,
455
- timeout: 1e4
456
- }
457
- ]
458
- },
459
- marker: "dist/hooks/post-compact.js"
460
- },
461
- {
462
- event: "InstructionsLoaded",
463
- group: {
464
- hooks: [
465
- {
466
- type: "command",
467
- command: `node "${path4.join(packageRoot, "dist", "hooks", "instructions-loaded.js")}"`
468
- }
469
- ]
470
- },
471
- marker: "dist/hooks/instructions-loaded.js"
472
- }
473
- ];
474
- let added = 0;
475
- let skipped = 0;
476
- for (const { event, group, marker } of hooksToRegister) {
477
- if (!settings.hooks[event]) {
478
- settings.hooks[event] = [];
479
- }
480
- const existing = settings.hooks[event];
481
- const alreadyExists = existing.some(
482
- (g) => g.hooks.some((h) => h.command.includes(marker))
483
- );
484
- if (alreadyExists) {
485
- skipped++;
486
- } else {
487
- existing.push(group);
488
- added++;
489
- }
490
- }
491
- const perms = settings.permissions;
492
- if (!perms) {
493
- settings.permissions = {};
494
- }
495
- const permissions = settings.permissions;
496
- if (!Array.isArray(permissions.allow)) {
497
- permissions.allow = [];
498
- }
499
- const toolNames = [
500
- "store_memory",
501
- "recall_my_memory",
502
- "create_task",
503
- "list_tasks",
504
- "get_task",
505
- "update_task",
506
- "close_task",
507
- "store_behavior",
508
- "deactivate_behavior",
509
- "send_message",
510
- "get_identity",
511
- "update_identity",
512
- "ask_team_memory",
513
- "get_session_context",
514
- "create_reminder",
515
- "complete_reminder",
516
- "list_reminders",
517
- "list_behaviors",
518
- "query_relationships",
519
- "commit_to_long_term_memory"
520
- ];
521
- const allowList = permissions.allow;
522
- for (const tool of expandDualPrefixTools(toolNames)) {
523
- if (!allowList.includes(tool)) {
524
- allowList.push(tool);
525
- }
526
- }
527
- await mkdir3(path4.dirname(settingsPath), { recursive: true });
528
- await writeFile3(settingsPath, JSON.stringify(settings, null, 2) + "\n");
529
- return { added, skipped };
530
- }
531
- var EXE_SECTION_START = "<!-- exe-os:orchestration-start -->";
532
- var EXE_SECTION_END = "<!-- exe-os:orchestration-end -->";
533
- var ORCHESTRATION_RULES = `${EXE_SECTION_START}
534
- ## exe-os Multi-Agent Orchestration (auto-managed \u2014 do not edit)
535
-
536
- These rules are injected by exe-os and override default behavior for multi-agent coordination.
537
-
538
- - **Session routing is deterministic.** When working in exeN (e.g. exe1), ALL employee sessions use the same number: yoshi-exe1, tom-exe1, mari-exe1. NEVER reference, consider, or dispatch to employee sessions from other project numbers. This is not a choice \u2014 it is a hard constraint.
539
- - **Always use create_task to assign work.** Never use messages, tmux send-keys, or ad-hoc instructions as a substitute for tasks.
540
- - **Never modify another agent's in-progress task.** Create a new task instead. Modifying active tasks causes race conditions.
541
- - **Chain of command:** founder \u2192 exe \u2192 yoshi \u2192 engineers. Exe does not assign directly to tom or other engineers below yoshi.
542
- - **Verify dispatch.** After every create_task, confirm the employee received and started the task via tmux capture-pane.
543
- ${EXE_SECTION_END}`;
544
- async function injectOrchestrationRules(homeDir) {
545
- const claudeDir = path4.join(homeDir, ".claude");
546
- const claudeMdPath = path4.join(claudeDir, "CLAUDE.md");
547
- await mkdir3(claudeDir, { recursive: true });
548
- let existing = "";
549
- try {
550
- existing = await readFile3(claudeMdPath, "utf-8");
551
- } catch {
552
- }
553
- const startIdx = existing.indexOf(EXE_SECTION_START);
554
- const endIdx = existing.indexOf(EXE_SECTION_END);
555
- if (startIdx !== -1 && endIdx !== -1) {
556
- const currentSection = existing.slice(startIdx, endIdx + EXE_SECTION_END.length);
557
- if (currentSection === ORCHESTRATION_RULES) {
558
- return "unchanged";
559
- }
560
- const updated = existing.slice(0, startIdx) + ORCHESTRATION_RULES + existing.slice(endIdx + EXE_SECTION_END.length);
561
- await writeFile3(claudeMdPath, updated, "utf-8");
562
- return "updated";
563
- }
564
- const separator = existing.length > 0 && !existing.endsWith("\n\n") ? "\n\n" : "";
565
- await writeFile3(claudeMdPath, existing + separator + ORCHESTRATION_RULES + "\n", "utf-8");
566
- return "injected";
567
- }
568
- async function runInstaller(homeDir) {
569
- const packageRoot = resolvePackageRoot();
570
- process.stderr.write(`exe-os installer v1.3.0
571
- `);
572
- process.stderr.write(`Package root: ${packageRoot}
573
-
574
- `);
575
- const cmdResult = await copySlashCommands(packageRoot, homeDir);
576
- process.stderr.write(
577
- `Slash commands: ${cmdResult.copied} copied, ${cmdResult.skipped} unchanged
578
- `
579
- );
580
- const mcpChanged = await registerMcpServer(packageRoot, homeDir);
581
- process.stderr.write(
582
- `MCP server: ${mcpChanged ? "registered" : "already registered"}
583
- `
584
- );
585
- const hookResult = await mergeHooks(packageRoot, homeDir);
586
- process.stderr.write(
587
- `Hooks: ${hookResult.added} added, ${hookResult.skipped} unchanged
588
- `
589
- );
590
- const resolvedHome = homeDir ?? os3.homedir();
591
- const exeWorkspace = path4.join(resolvedHome, "exe");
592
- if (!existsSync4(exeWorkspace)) {
593
- try {
594
- await mkdir3(path4.join(exeWorkspace, "content"), { recursive: true });
595
- await mkdir3(path4.join(exeWorkspace, "operations"), { recursive: true });
596
- await mkdir3(path4.join(exeWorkspace, "output"), { recursive: true });
597
- process.stderr.write(
598
- `Created ~/exe/ \u2014 your automation workspace for non-code projects
599
- `
600
- );
601
- } catch {
602
- }
603
- }
604
- const claudeMdResult = await injectOrchestrationRules(resolvedHome);
605
- process.stderr.write(
606
- `CLAUDE.md orchestration: ${claudeMdResult}
607
- `
608
- );
609
- const symlinkResults = await ensureAllAgentSymlinks(resolvedHome);
610
- process.stderr.write(
611
- `Agent symlinks: ${summarizeSymlinkResults(symlinkResults)}
612
- `
613
- );
614
- process.stderr.write(`
615
- exe-os installed successfully.
616
- `);
617
- }
618
- function summarizeSymlinkResults(results) {
619
- if (results.length === 0) return "no employees in roster";
620
- const created = results.filter((r) => r.action === "created").length;
621
- const already = results.filter((r) => r.action === "already_correct").length;
622
- const conflicts = results.filter((r) => r.action === "conflict");
623
- let summary = `${created} created, ${already} already linked`;
624
- if (conflicts.length > 0) {
625
- const details = conflicts.map((r) => `${r.agentId} (${r.conflict ?? "unknown"})`).join(", ");
626
- summary += `, ${conflicts.length} conflict(s): ${details}`;
627
- }
628
- return summary;
629
- }
630
-
631
- // src/bin/install.ts
632
- var args = process.argv.slice(2);
633
- if (args.includes("--commands-only")) {
634
- try {
635
- const packageRoot = resolvePackageRoot();
636
- const result = await copySlashCommands(packageRoot);
637
- if (result.copied > 0) {
638
- process.stderr.write(
639
- `exe-os: ${result.copied} slash command(s) updated
640
- `
641
- );
642
- }
643
- } catch {
644
- }
645
- } else if (args.includes("--global")) {
646
- try {
647
- await runInstaller();
648
- } catch (err) {
649
- console.error(
650
- "Installation failed:",
651
- err instanceof Error ? err.message : String(err)
652
- );
653
- process.exit(1);
654
- }
655
- } else {
656
- console.error("Usage: npx exe-os --global");
657
- console.error(
658
- " Installs exe-os commands, MCP server, and hooks into ~/.claude/"
659
- );
660
- process.exit(1);
661
- }