@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,197 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/bin/exe-call.ts
4
+ import path3 from "path";
5
+ import { mkdir as mkdir3, writeFile as writeFile3 } from "fs/promises";
6
+ import { execSync as execSync2 } from "child_process";
7
+ import { fileURLToPath as fileURLToPath2 } from "url";
8
+
9
+ // src/lib/employees.ts
10
+ import { readFile as readFile2, writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
11
+ import { existsSync as existsSync2, symlinkSync, readlinkSync } from "fs";
12
+ import { execSync } from "child_process";
13
+ import path2 from "path";
14
+
15
+ // src/lib/config.ts
16
+ import { readFile, writeFile, mkdir } from "fs/promises";
17
+ import { readFileSync, existsSync, renameSync } from "fs";
18
+ import path from "path";
19
+ import os from "os";
20
+ function resolveDataDir() {
21
+ if (process.env.EXE_OS_DIR) return process.env.EXE_OS_DIR;
22
+ if (process.env.EXE_MEM_DIR) return process.env.EXE_MEM_DIR;
23
+ const newDir = path.join(os.homedir(), ".exe-os");
24
+ const legacyDir = path.join(os.homedir(), ".exe-mem");
25
+ if (!existsSync(newDir) && existsSync(legacyDir)) {
26
+ try {
27
+ renameSync(legacyDir, newDir);
28
+ process.stderr.write(`[exe-os] Migrated data directory: ~/.exe-mem \u2192 ~/.exe-os
29
+ `);
30
+ } catch {
31
+ return legacyDir;
32
+ }
33
+ }
34
+ return newDir;
35
+ }
36
+ var EXE_AI_DIR = resolveDataDir();
37
+ var DB_PATH = path.join(EXE_AI_DIR, "memories.db");
38
+ var MODELS_DIR = path.join(EXE_AI_DIR, "models");
39
+ var CONFIG_PATH = path.join(EXE_AI_DIR, "config.json");
40
+ var LEGACY_LANCE_PATH = path.join(EXE_AI_DIR, "local.lance");
41
+ var CURRENT_CONFIG_VERSION = 1;
42
+ var DEFAULT_CONFIG = {
43
+ config_version: CURRENT_CONFIG_VERSION,
44
+ dbPath: DB_PATH,
45
+ modelFile: "jina-embeddings-v5-small-q4_k_m.gguf",
46
+ embeddingDim: 1024,
47
+ batchSize: 20,
48
+ flushIntervalMs: 1e4,
49
+ autoIngestion: true,
50
+ autoRetrieval: true,
51
+ searchMode: "hybrid",
52
+ hookSearchMode: "hybrid",
53
+ fileGrepEnabled: true,
54
+ splashEffect: true,
55
+ consolidationEnabled: true,
56
+ consolidationIntervalMs: 6 * 60 * 60 * 1e3,
57
+ consolidationModel: "claude-haiku-4-5-20251001",
58
+ consolidationMaxCallsPerRun: 20,
59
+ selfQueryRouter: true,
60
+ selfQueryModel: "claude-haiku-4-5-20251001",
61
+ rerankerEnabled: true,
62
+ scalingRoadmap: {
63
+ rerankerAutoTrigger: {
64
+ enabled: true,
65
+ broadQueryMinCardinality: 5e4,
66
+ fetchTopK: 150,
67
+ returnTopK: 5
68
+ }
69
+ },
70
+ graphRagEnabled: true,
71
+ wikiEnabled: false,
72
+ wikiUrl: "",
73
+ wikiApiKey: "",
74
+ wikiSyncIntervalMs: 30 * 60 * 1e3,
75
+ wikiWorkspaceMapping: {
76
+ exe: "Executive",
77
+ yoshi: "Engineering",
78
+ mari: "Marketing",
79
+ tom: "Engineering",
80
+ sasha: "Production"
81
+ },
82
+ wikiAutoUpdate: true,
83
+ wikiAutoUpdateThreshold: 0.5,
84
+ wikiAutoUpdateCreateNew: true,
85
+ skillLearning: true,
86
+ skillThreshold: 3,
87
+ skillModel: "claude-haiku-4-5-20251001",
88
+ exeHeartbeat: {
89
+ enabled: true,
90
+ intervalSeconds: 60,
91
+ staleInProgressThresholdHours: 2
92
+ },
93
+ sessionLifecycle: {
94
+ idleKillEnabled: true,
95
+ idleKillTicksRequired: 3,
96
+ idleKillIntercomAckWindowMs: 1e4,
97
+ maxAutoInstances: 10
98
+ }
99
+ };
100
+
101
+ // src/lib/employees.ts
102
+ var EMPLOYEES_PATH = path2.join(EXE_AI_DIR, "exe-employees.json");
103
+ async function loadEmployees(employeesPath = EMPLOYEES_PATH) {
104
+ if (!existsSync2(employeesPath)) {
105
+ return [];
106
+ }
107
+ const raw = await readFile2(employeesPath, "utf-8");
108
+ try {
109
+ return JSON.parse(raw);
110
+ } catch {
111
+ return [];
112
+ }
113
+ }
114
+ function getEmployee(employees, name) {
115
+ return employees.find((e) => e.name === name);
116
+ }
117
+
118
+ // src/lib/is-main.ts
119
+ import { realpathSync } from "fs";
120
+ import { fileURLToPath } from "url";
121
+ function isMainModule(importMetaUrl) {
122
+ if (process.argv[1] == null) return false;
123
+ try {
124
+ const scriptPath = realpathSync(process.argv[1]);
125
+ const modulePath = realpathSync(fileURLToPath(importMetaUrl));
126
+ return scriptPath === modulePath;
127
+ } catch {
128
+ return importMetaUrl === `file://${process.argv[1]}` || importMetaUrl === new URL(process.argv[1], "file://").href;
129
+ }
130
+ }
131
+
132
+ // src/bin/exe-call.ts
133
+ function resolveEmployee(name, employees) {
134
+ const resolved = name || "exe";
135
+ const employee = getEmployee(employees, resolved);
136
+ if (!employee) {
137
+ throw new Error(
138
+ `Employee '${resolved}' not found. Run /exe-team to see available employees.`
139
+ );
140
+ }
141
+ return employee;
142
+ }
143
+ function buildSessionEnv(employee, sessionDir) {
144
+ const env = {};
145
+ for (const [key, value] of Object.entries(process.env)) {
146
+ if (value !== void 0) {
147
+ env[key] = value;
148
+ }
149
+ }
150
+ env["CLAUDE_CONFIG_DIR"] = sessionDir;
151
+ env["AGENT_ID"] = employee.name;
152
+ env["AGENT_ROLE"] = employee.role;
153
+ return env;
154
+ }
155
+ async function prepareSessionDir(name, systemPrompt, sessionsBase = path3.join(EXE_AI_DIR, "sessions")) {
156
+ const sessionDir = path3.join(sessionsBase, name);
157
+ await mkdir3(sessionDir, { recursive: true });
158
+ await writeFile3(path3.join(sessionDir, "CLAUDE.md"), systemPrompt, "utf-8");
159
+ return sessionDir;
160
+ }
161
+ if (isMainModule(import.meta.url)) {
162
+ const name = process.argv[2];
163
+ if (!name || name === "exe") {
164
+ const __dirname = path3.dirname(fileURLToPath2(import.meta.url));
165
+ const bootPath = path3.join(__dirname, "exe-boot.js");
166
+ try {
167
+ execSync2(`node "${bootPath}"`, { stdio: "inherit" });
168
+ } catch {
169
+ process.exit(1);
170
+ }
171
+ process.exit(0);
172
+ }
173
+ try {
174
+ const employees = await loadEmployees();
175
+ if (employees.length === 0) {
176
+ console.error("No employees found. Run /exe first to initialize.");
177
+ process.exit(1);
178
+ }
179
+ const employee = resolveEmployee(name, employees);
180
+ const sessionDir = await prepareSessionDir(name, employee.systemPrompt);
181
+ const env = buildSessionEnv(employee, sessionDir);
182
+ console.log(
183
+ `Launching ${employee.name} (${employee.role}) session...`
184
+ );
185
+ execSync2("claude --dangerously-skip-permissions", { stdio: "inherit", env });
186
+ } catch (err) {
187
+ console.error(
188
+ err instanceof Error ? err.message : String(err)
189
+ );
190
+ process.exit(1);
191
+ }
192
+ }
193
+ export {
194
+ buildSessionEnv,
195
+ prepareSessionDir,
196
+ resolveEmployee
197
+ };