@askexenow/exe-os 0.8.0 → 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 (107) hide show
  1. package/README.md +178 -79
  2. package/package.json +1 -1
  3. package/dist/bin/backfill-responses.js +0 -1912
  4. package/dist/bin/backfill-vectors.js +0 -1642
  5. package/dist/bin/cleanup-stale-review-tasks.js +0 -1339
  6. package/dist/bin/cli.js +0 -18800
  7. package/dist/bin/exe-agent.js +0 -1858
  8. package/dist/bin/exe-assign.js +0 -1957
  9. package/dist/bin/exe-boot.js +0 -6460
  10. package/dist/bin/exe-call.js +0 -197
  11. package/dist/bin/exe-cloud.js +0 -850
  12. package/dist/bin/exe-dispatch.js +0 -1146
  13. package/dist/bin/exe-doctor.js +0 -1657
  14. package/dist/bin/exe-export-behaviors.js +0 -1494
  15. package/dist/bin/exe-forget.js +0 -1627
  16. package/dist/bin/exe-gateway.js +0 -7732
  17. package/dist/bin/exe-healthcheck.js +0 -207
  18. package/dist/bin/exe-heartbeat.js +0 -1647
  19. package/dist/bin/exe-kill.js +0 -1479
  20. package/dist/bin/exe-launch-agent.js +0 -1704
  21. package/dist/bin/exe-link.js +0 -192
  22. package/dist/bin/exe-new-employee.js +0 -852
  23. package/dist/bin/exe-pending-messages.js +0 -1446
  24. package/dist/bin/exe-pending-notifications.js +0 -1321
  25. package/dist/bin/exe-pending-reviews.js +0 -1468
  26. package/dist/bin/exe-repo-drift.js +0 -95
  27. package/dist/bin/exe-review.js +0 -1590
  28. package/dist/bin/exe-search.js +0 -2651
  29. package/dist/bin/exe-session-cleanup.js +0 -3173
  30. package/dist/bin/exe-settings.js +0 -354
  31. package/dist/bin/exe-status.js +0 -1532
  32. package/dist/bin/exe-team.js +0 -1324
  33. package/dist/bin/git-sweep.js +0 -2185
  34. package/dist/bin/graph-backfill.js +0 -1968
  35. package/dist/bin/graph-export.js +0 -1604
  36. package/dist/bin/install.js +0 -656
  37. package/dist/bin/list-providers.js +0 -140
  38. package/dist/bin/scan-tasks.js +0 -1820
  39. package/dist/bin/setup.js +0 -951
  40. package/dist/bin/shard-migrate.js +0 -1494
  41. package/dist/bin/update.js +0 -95
  42. package/dist/bin/wiki-sync.js +0 -1514
  43. package/dist/gateway/index.js +0 -8848
  44. package/dist/hooks/bug-report-worker.js +0 -2743
  45. package/dist/hooks/commit-complete.js +0 -2108
  46. package/dist/hooks/error-recall.js +0 -2861
  47. package/dist/hooks/exe-heartbeat-hook.js +0 -232
  48. package/dist/hooks/ingest-worker.js +0 -4793
  49. package/dist/hooks/ingest.js +0 -684
  50. package/dist/hooks/instructions-loaded.js +0 -1880
  51. package/dist/hooks/notification.js +0 -1726
  52. package/dist/hooks/post-compact.js +0 -1751
  53. package/dist/hooks/pre-compact.js +0 -1746
  54. package/dist/hooks/pre-tool-use.js +0 -2191
  55. package/dist/hooks/prompt-ingest-worker.js +0 -2126
  56. package/dist/hooks/prompt-submit.js +0 -4693
  57. package/dist/hooks/response-ingest-worker.js +0 -1936
  58. package/dist/hooks/session-end.js +0 -1752
  59. package/dist/hooks/session-start.js +0 -2795
  60. package/dist/hooks/stop.js +0 -1835
  61. package/dist/hooks/subagent-stop.js +0 -1726
  62. package/dist/hooks/summary-worker.js +0 -2661
  63. package/dist/index.js +0 -11834
  64. package/dist/lib/cloud-sync.js +0 -495
  65. package/dist/lib/config.js +0 -222
  66. package/dist/lib/consolidation.js +0 -476
  67. package/dist/lib/crypto.js +0 -51
  68. package/dist/lib/database.js +0 -730
  69. package/dist/lib/device-registry.js +0 -900
  70. package/dist/lib/embedder.js +0 -632
  71. package/dist/lib/employee-templates.js +0 -543
  72. package/dist/lib/employees.js +0 -177
  73. package/dist/lib/error-detector.js +0 -156
  74. package/dist/lib/exe-daemon-client.js +0 -451
  75. package/dist/lib/exe-daemon.js +0 -8285
  76. package/dist/lib/file-grep.js +0 -199
  77. package/dist/lib/hybrid-search.js +0 -1819
  78. package/dist/lib/identity-templates.js +0 -320
  79. package/dist/lib/identity.js +0 -223
  80. package/dist/lib/keychain.js +0 -145
  81. package/dist/lib/license.js +0 -377
  82. package/dist/lib/messaging.js +0 -1376
  83. package/dist/lib/reminders.js +0 -63
  84. package/dist/lib/schedules.js +0 -1396
  85. package/dist/lib/session-registry.js +0 -52
  86. package/dist/lib/skill-learning.js +0 -477
  87. package/dist/lib/status-brief.js +0 -235
  88. package/dist/lib/store.js +0 -1551
  89. package/dist/lib/task-router.js +0 -62
  90. package/dist/lib/tasks.js +0 -2456
  91. package/dist/lib/tmux-routing.js +0 -2836
  92. package/dist/lib/tmux-status.js +0 -261
  93. package/dist/lib/tmux-transport.js +0 -83
  94. package/dist/lib/transport.js +0 -128
  95. package/dist/lib/ws-auth.js +0 -19
  96. package/dist/lib/ws-client.js +0 -160
  97. package/dist/mcp/server.js +0 -10538
  98. package/dist/mcp/tools/complete-reminder.js +0 -67
  99. package/dist/mcp/tools/create-reminder.js +0 -52
  100. package/dist/mcp/tools/create-task.js +0 -1853
  101. package/dist/mcp/tools/deactivate-behavior.js +0 -263
  102. package/dist/mcp/tools/list-reminders.js +0 -62
  103. package/dist/mcp/tools/list-tasks.js +0 -463
  104. package/dist/mcp/tools/send-message.js +0 -1382
  105. package/dist/mcp/tools/update-task.js +0 -1692
  106. package/dist/runtime/index.js +0 -6809
  107. package/dist/tui/App.js +0 -17479
@@ -1,354 +0,0 @@
1
- // src/bin/exe-settings.ts
2
- import { createInterface } from "readline";
3
-
4
- // src/lib/config.ts
5
- import { readFile, writeFile, mkdir } from "fs/promises";
6
- import { readFileSync, existsSync, renameSync } from "fs";
7
- import path from "path";
8
- import os from "os";
9
- function resolveDataDir() {
10
- if (process.env.EXE_OS_DIR) return process.env.EXE_OS_DIR;
11
- if (process.env.EXE_MEM_DIR) return process.env.EXE_MEM_DIR;
12
- const newDir = path.join(os.homedir(), ".exe-os");
13
- const legacyDir = path.join(os.homedir(), ".exe-mem");
14
- if (!existsSync(newDir) && existsSync(legacyDir)) {
15
- try {
16
- renameSync(legacyDir, newDir);
17
- process.stderr.write(`[exe-os] Migrated data directory: ~/.exe-mem \u2192 ~/.exe-os
18
- `);
19
- } catch {
20
- return legacyDir;
21
- }
22
- }
23
- return newDir;
24
- }
25
- var EXE_AI_DIR = resolveDataDir();
26
- var DB_PATH = path.join(EXE_AI_DIR, "memories.db");
27
- var MODELS_DIR = path.join(EXE_AI_DIR, "models");
28
- var CONFIG_PATH = path.join(EXE_AI_DIR, "config.json");
29
- var LEGACY_LANCE_PATH = path.join(EXE_AI_DIR, "local.lance");
30
- var CURRENT_CONFIG_VERSION = 1;
31
- var DEFAULT_CONFIG = {
32
- config_version: CURRENT_CONFIG_VERSION,
33
- dbPath: DB_PATH,
34
- modelFile: "jina-embeddings-v5-small-q4_k_m.gguf",
35
- embeddingDim: 1024,
36
- batchSize: 20,
37
- flushIntervalMs: 1e4,
38
- autoIngestion: true,
39
- autoRetrieval: true,
40
- searchMode: "hybrid",
41
- hookSearchMode: "hybrid",
42
- fileGrepEnabled: true,
43
- splashEffect: true,
44
- consolidationEnabled: true,
45
- consolidationIntervalMs: 6 * 60 * 60 * 1e3,
46
- consolidationModel: "claude-haiku-4-5-20251001",
47
- consolidationMaxCallsPerRun: 20,
48
- selfQueryRouter: true,
49
- selfQueryModel: "claude-haiku-4-5-20251001",
50
- rerankerEnabled: true,
51
- scalingRoadmap: {
52
- rerankerAutoTrigger: {
53
- enabled: true,
54
- broadQueryMinCardinality: 5e4,
55
- fetchTopK: 150,
56
- returnTopK: 5
57
- }
58
- },
59
- graphRagEnabled: true,
60
- wikiEnabled: false,
61
- wikiUrl: "",
62
- wikiApiKey: "",
63
- wikiSyncIntervalMs: 30 * 60 * 1e3,
64
- wikiWorkspaceMapping: {
65
- exe: "Executive",
66
- yoshi: "Engineering",
67
- mari: "Marketing",
68
- tom: "Engineering",
69
- sasha: "Production"
70
- },
71
- wikiAutoUpdate: true,
72
- wikiAutoUpdateThreshold: 0.5,
73
- wikiAutoUpdateCreateNew: true,
74
- skillLearning: true,
75
- skillThreshold: 3,
76
- skillModel: "claude-haiku-4-5-20251001",
77
- exeHeartbeat: {
78
- enabled: true,
79
- intervalSeconds: 60,
80
- staleInProgressThresholdHours: 2
81
- },
82
- sessionLifecycle: {
83
- idleKillEnabled: true,
84
- idleKillTicksRequired: 3,
85
- idleKillIntercomAckWindowMs: 1e4,
86
- maxAutoInstances: 10
87
- }
88
- };
89
- function migrateLegacyConfig(raw) {
90
- if ("r2" in raw) {
91
- process.stderr.write(
92
- "[exe-os] Warning: config.json contains deprecated 'r2' field from v1.0. R2 sync has been replaced in v1.1. The 'r2' field will be ignored.\n"
93
- );
94
- delete raw.r2;
95
- }
96
- if ("syncIntervalMs" in raw) {
97
- delete raw.syncIntervalMs;
98
- }
99
- return raw;
100
- }
101
- var CONFIG_MIGRATIONS = [
102
- {
103
- from: 0,
104
- to: 1,
105
- migrate: (cfg) => {
106
- cfg.config_version = 1;
107
- return cfg;
108
- }
109
- }
110
- ];
111
- function migrateConfig(raw) {
112
- const fromVersion = typeof raw.config_version === "number" ? raw.config_version : 0;
113
- let currentVersion = fromVersion;
114
- let migrated = false;
115
- if (currentVersion > CURRENT_CONFIG_VERSION) {
116
- return { config: raw, migrated: false, fromVersion };
117
- }
118
- for (const migration of CONFIG_MIGRATIONS) {
119
- if (currentVersion === migration.from && migration.to <= CURRENT_CONFIG_VERSION) {
120
- raw = migration.migrate(raw);
121
- currentVersion = migration.to;
122
- migrated = true;
123
- }
124
- }
125
- return { config: raw, migrated, fromVersion };
126
- }
127
- function normalizeScalingRoadmap(raw) {
128
- const defaultAuto = DEFAULT_CONFIG.scalingRoadmap.rerankerAutoTrigger;
129
- const userRoadmap = raw.scalingRoadmap ?? {};
130
- const userAuto = userRoadmap.rerankerAutoTrigger ?? {};
131
- if (userAuto.enabled === void 0 && raw.rerankerEnabled !== void 0) {
132
- userAuto.enabled = raw.rerankerEnabled;
133
- }
134
- raw.scalingRoadmap = {
135
- ...userRoadmap,
136
- rerankerAutoTrigger: { ...defaultAuto, ...userAuto }
137
- };
138
- }
139
- function normalizeSessionLifecycle(raw) {
140
- const defaultSL = DEFAULT_CONFIG.sessionLifecycle;
141
- const userSL = raw.sessionLifecycle ?? {};
142
- raw.sessionLifecycle = { ...defaultSL, ...userSL };
143
- }
144
- async function loadConfig() {
145
- const dir = process.env.EXE_OS_DIR ?? process.env.EXE_MEM_DIR ?? EXE_AI_DIR;
146
- await mkdir(dir, { recursive: true });
147
- const configPath = path.join(dir, "config.json");
148
- if (!existsSync(configPath)) {
149
- return { ...DEFAULT_CONFIG, dbPath: path.join(dir, "memories.db") };
150
- }
151
- const raw = await readFile(configPath, "utf-8");
152
- try {
153
- let parsed = JSON.parse(raw);
154
- parsed = migrateLegacyConfig(parsed);
155
- const { config: migratedCfg, migrated, fromVersion } = migrateConfig(parsed);
156
- if (migrated) {
157
- process.stderr.write(`[exe-os] Config migrated from v${fromVersion} to v${migratedCfg.config_version}
158
- `);
159
- try {
160
- await writeFile(configPath, JSON.stringify(migratedCfg, null, 2) + "\n");
161
- } catch {
162
- }
163
- }
164
- normalizeScalingRoadmap(migratedCfg);
165
- normalizeSessionLifecycle(migratedCfg);
166
- const config = { ...DEFAULT_CONFIG, dbPath: path.join(dir, "memories.db"), ...migratedCfg };
167
- if (config.dbPath.startsWith("~")) {
168
- config.dbPath = config.dbPath.replace(/^~/, os.homedir());
169
- }
170
- return config;
171
- } catch {
172
- return { ...DEFAULT_CONFIG, dbPath: path.join(dir, "memories.db") };
173
- }
174
- }
175
- async function saveConfig(config) {
176
- const dir = process.env.EXE_OS_DIR ?? process.env.EXE_MEM_DIR ?? EXE_AI_DIR;
177
- await mkdir(dir, { recursive: true });
178
- const configPath = path.join(dir, "config.json");
179
- await writeFile(configPath, JSON.stringify(config, null, 2) + "\n");
180
- }
181
-
182
- // src/lib/is-main.ts
183
- import { realpathSync } from "fs";
184
- import { fileURLToPath } from "url";
185
- function isMainModule(importMetaUrl) {
186
- if (process.argv[1] == null) return false;
187
- try {
188
- const scriptPath = realpathSync(process.argv[1]);
189
- const modulePath = realpathSync(fileURLToPath(importMetaUrl));
190
- return scriptPath === modulePath;
191
- } catch {
192
- return importMetaUrl === `file://${process.argv[1]}` || importMetaUrl === new URL(process.argv[1], "file://").href;
193
- }
194
- }
195
-
196
- // src/bin/exe-settings.ts
197
- function label(value) {
198
- return value ? "ON" : "OFF";
199
- }
200
- function searchLabel(mode) {
201
- if (mode === "hybrid") return "hybrid FTS + vector (best quality, uses embedding model)";
202
- return "fts Keywords only (fast, no embedding model)";
203
- }
204
- function hookSearchLabel(mode) {
205
- if (mode === "hybrid") return "hybrid FTS + vector (loads 639MB model \u2014 adds 3-8s on first call)";
206
- return "fts Keywords only (fast, ~200ms, no model load)";
207
- }
208
- function syncStatus(config) {
209
- if (config.cloud?.apiKey) return "Exe Cloud";
210
- if (config.turso?.url) return "libSQL (self-hosted)";
211
- return "local-only";
212
- }
213
- function printSettings(config) {
214
- console.log(`
215
- \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510
216
- \u2502 exe-os settings \u2502
217
- \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518
218
-
219
- 1. Auto-ingestion: ${label(config.autoIngestion).padEnd(5)} Store every tool call as a memory
220
- 2. Auto-retrieval: ${label(config.autoRetrieval).padEnd(5)} Inject relevant memories into context
221
- 3. MCP search mode: ${searchLabel(config.searchMode)}
222
- 4. Hook search mode: ${hookSearchLabel(config.hookSearchMode)}
223
- 5. Cloud sync: ${syncStatus(config)}
224
-
225
- Model: ${config.modelFile}
226
-
227
- Type a number to toggle, or "q" to quit.
228
- `);
229
- }
230
- async function main() {
231
- const config = await loadConfig();
232
- const rl = createInterface({
233
- input: process.stdin,
234
- output: process.stdout
235
- });
236
- const prompt = () => {
237
- printSettings(config);
238
- rl.question("> ", async (answer) => {
239
- const choice = answer.trim().toLowerCase();
240
- if (choice === "1") {
241
- config.autoIngestion = !config.autoIngestion;
242
- await saveConfig(config);
243
- console.log(`
244
- Auto-ingestion ${label(config.autoIngestion)}`);
245
- if (!config.autoIngestion) {
246
- console.log(" Tool calls will no longer be saved to memory.");
247
- console.log(" Use the store_memory MCP tool to save manually.");
248
- }
249
- prompt();
250
- } else if (choice === "2") {
251
- config.autoRetrieval = !config.autoRetrieval;
252
- await saveConfig(config);
253
- console.log(`
254
- Auto-retrieval ${label(config.autoRetrieval)}`);
255
- if (!config.autoRetrieval) {
256
- console.log(" Memories won't be injected automatically.");
257
- console.log(" Use recall_my_memory MCP tool to search manually.");
258
- }
259
- prompt();
260
- } else if (choice === "3") {
261
- config.searchMode = config.searchMode === "hybrid" ? "fts" : "hybrid";
262
- await saveConfig(config);
263
- console.log(`
264
- MCP search mode: ${config.searchMode}`);
265
- if (config.searchMode === "fts") {
266
- console.log(" MCP tools now use keyword search only.");
267
- console.log(" Faster queries, no embedding model needed for search.");
268
- } else {
269
- console.log(" MCP tools now use hybrid search (FTS + vector + RRF).");
270
- console.log(" Best quality \u2014 model is already warm in MCP server.");
271
- }
272
- prompt();
273
- } else if (choice === "4") {
274
- config.hookSearchMode = config.hookSearchMode === "fts" ? "hybrid" : "fts";
275
- await saveConfig(config);
276
- console.log(`
277
- Hook search mode: ${config.hookSearchMode}`);
278
- if (config.hookSearchMode === "hybrid") {
279
- console.log(" Hooks will load the embedding model for semantic search.");
280
- console.log(" Better recall, but first invocation adds 3-8s cold-start.");
281
- } else {
282
- console.log(" Hooks use keyword search only (~200ms, no model load).");
283
- console.log(" Recommended for daily use.");
284
- }
285
- prompt();
286
- } else if (choice === "5") {
287
- console.log(`
288
- Current sync: ${syncStatus(config)}`);
289
- console.log("\n Configure cloud sync:");
290
- console.log(" a. Exe Cloud \u2014 paste your API key (exe_sk_...)");
291
- console.log(" b. Disconnect \u2014 switch to local-only");
292
- console.log(" c. Cancel");
293
- rl.question("\n > ", async (syncChoice) => {
294
- const sc = syncChoice.trim().toLowerCase();
295
- if (sc === "a") {
296
- rl.question(" API key: ", async (apiKey) => {
297
- const key = apiKey.trim();
298
- if (!key) {
299
- console.log(" Cancelled.");
300
- prompt();
301
- return;
302
- }
303
- rl.question(" Endpoint [https://askexe.com/cloud]: ", async (ep) => {
304
- const endpoint = ep.trim() || "https://askexe.com/cloud";
305
- console.log(" Validating...");
306
- try {
307
- const resp = await fetch(`${endpoint}/auth/verify`, {
308
- method: "POST",
309
- headers: { "Authorization": `Bearer ${key}`, "Content-Type": "application/json" }
310
- });
311
- if (resp.ok) {
312
- config.cloud = { apiKey: key, endpoint };
313
- delete config.turso;
314
- await saveConfig(config);
315
- console.log(" \u2713 Cloud sync configured. Memories will sync on next ingestion.");
316
- } else {
317
- console.log(` \u2717 Validation failed (${resp.status}). Key not saved.`);
318
- }
319
- } catch (err) {
320
- console.log(` \u2717 Could not reach endpoint: ${err instanceof Error ? err.message : String(err)}`);
321
- console.log(" Key not saved. Check the endpoint URL.");
322
- }
323
- prompt();
324
- });
325
- });
326
- } else if (sc === "b") {
327
- delete config.cloud;
328
- delete config.turso;
329
- await saveConfig(config);
330
- console.log(" \u2713 Switched to local-only. Cloud sync disconnected.");
331
- prompt();
332
- } else {
333
- prompt();
334
- }
335
- });
336
- } else if (choice === "q" || choice === "quit" || choice === "") {
337
- rl.close();
338
- } else {
339
- console.log("\n Unknown option. Type 1-5, or q.");
340
- prompt();
341
- }
342
- });
343
- };
344
- prompt();
345
- }
346
- if (isMainModule(import.meta.url)) {
347
- main().catch((err) => {
348
- console.error("Settings error:", err instanceof Error ? err.message : err);
349
- process.exit(1);
350
- });
351
- }
352
- export {
353
- main
354
- };