@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,365 +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
- autoUpdate: {
89
- checkOnBoot: true,
90
- autoInstall: false,
91
- checkIntervalMs: 24 * 60 * 60 * 1e3
92
- }
93
- };
94
- function migrateLegacyConfig(raw) {
95
- if ("r2" in raw) {
96
- process.stderr.write(
97
- "[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"
98
- );
99
- delete raw.r2;
100
- }
101
- if ("syncIntervalMs" in raw) {
102
- delete raw.syncIntervalMs;
103
- }
104
- return raw;
105
- }
106
- var CONFIG_MIGRATIONS = [
107
- {
108
- from: 0,
109
- to: 1,
110
- migrate: (cfg) => {
111
- cfg.config_version = 1;
112
- return cfg;
113
- }
114
- }
115
- ];
116
- function migrateConfig(raw) {
117
- const fromVersion = typeof raw.config_version === "number" ? raw.config_version : 0;
118
- let currentVersion = fromVersion;
119
- let migrated = false;
120
- if (currentVersion > CURRENT_CONFIG_VERSION) {
121
- return { config: raw, migrated: false, fromVersion };
122
- }
123
- for (const migration of CONFIG_MIGRATIONS) {
124
- if (currentVersion === migration.from && migration.to <= CURRENT_CONFIG_VERSION) {
125
- raw = migration.migrate(raw);
126
- currentVersion = migration.to;
127
- migrated = true;
128
- }
129
- }
130
- return { config: raw, migrated, fromVersion };
131
- }
132
- function normalizeScalingRoadmap(raw) {
133
- const defaultAuto = DEFAULT_CONFIG.scalingRoadmap.rerankerAutoTrigger;
134
- const userRoadmap = raw.scalingRoadmap ?? {};
135
- const userAuto = userRoadmap.rerankerAutoTrigger ?? {};
136
- if (userAuto.enabled === void 0 && raw.rerankerEnabled !== void 0) {
137
- userAuto.enabled = raw.rerankerEnabled;
138
- }
139
- raw.scalingRoadmap = {
140
- ...userRoadmap,
141
- rerankerAutoTrigger: { ...defaultAuto, ...userAuto }
142
- };
143
- }
144
- function normalizeSessionLifecycle(raw) {
145
- const defaultSL = DEFAULT_CONFIG.sessionLifecycle;
146
- const userSL = raw.sessionLifecycle ?? {};
147
- raw.sessionLifecycle = { ...defaultSL, ...userSL };
148
- }
149
- function normalizeAutoUpdate(raw) {
150
- const defaultAU = DEFAULT_CONFIG.autoUpdate;
151
- const userAU = raw.autoUpdate ?? {};
152
- raw.autoUpdate = { ...defaultAU, ...userAU };
153
- }
154
- async function loadConfig() {
155
- const dir = process.env.EXE_OS_DIR ?? process.env.EXE_MEM_DIR ?? EXE_AI_DIR;
156
- await mkdir(dir, { recursive: true });
157
- const configPath = path.join(dir, "config.json");
158
- if (!existsSync(configPath)) {
159
- return { ...DEFAULT_CONFIG, dbPath: path.join(dir, "memories.db") };
160
- }
161
- const raw = await readFile(configPath, "utf-8");
162
- try {
163
- let parsed = JSON.parse(raw);
164
- parsed = migrateLegacyConfig(parsed);
165
- const { config: migratedCfg, migrated, fromVersion } = migrateConfig(parsed);
166
- if (migrated) {
167
- process.stderr.write(`[exe-os] Config migrated from v${fromVersion} to v${migratedCfg.config_version}
168
- `);
169
- try {
170
- await writeFile(configPath, JSON.stringify(migratedCfg, null, 2) + "\n");
171
- } catch {
172
- }
173
- }
174
- normalizeScalingRoadmap(migratedCfg);
175
- normalizeSessionLifecycle(migratedCfg);
176
- normalizeAutoUpdate(migratedCfg);
177
- const config = { ...DEFAULT_CONFIG, dbPath: path.join(dir, "memories.db"), ...migratedCfg };
178
- if (config.dbPath.startsWith("~")) {
179
- config.dbPath = config.dbPath.replace(/^~/, os.homedir());
180
- }
181
- return config;
182
- } catch {
183
- return { ...DEFAULT_CONFIG, dbPath: path.join(dir, "memories.db") };
184
- }
185
- }
186
- async function saveConfig(config) {
187
- const dir = process.env.EXE_OS_DIR ?? process.env.EXE_MEM_DIR ?? EXE_AI_DIR;
188
- await mkdir(dir, { recursive: true });
189
- const configPath = path.join(dir, "config.json");
190
- await writeFile(configPath, JSON.stringify(config, null, 2) + "\n");
191
- }
192
-
193
- // src/lib/is-main.ts
194
- import { realpathSync } from "fs";
195
- import { fileURLToPath } from "url";
196
- function isMainModule(importMetaUrl) {
197
- if (process.argv[1] == null) return false;
198
- try {
199
- const scriptPath = realpathSync(process.argv[1]);
200
- const modulePath = realpathSync(fileURLToPath(importMetaUrl));
201
- return scriptPath === modulePath;
202
- } catch {
203
- return importMetaUrl === `file://${process.argv[1]}` || importMetaUrl === new URL(process.argv[1], "file://").href;
204
- }
205
- }
206
-
207
- // src/bin/exe-settings.ts
208
- function label(value) {
209
- return value ? "ON" : "OFF";
210
- }
211
- function searchLabel(mode) {
212
- if (mode === "hybrid") return "hybrid FTS + vector (best quality, uses embedding model)";
213
- return "fts Keywords only (fast, no embedding model)";
214
- }
215
- function hookSearchLabel(mode) {
216
- if (mode === "hybrid") return "hybrid FTS + vector (loads 639MB model \u2014 adds 3-8s on first call)";
217
- return "fts Keywords only (fast, ~200ms, no model load)";
218
- }
219
- function syncStatus(config) {
220
- if (config.cloud?.apiKey) return "Exe Cloud";
221
- if (config.turso?.url) return "libSQL (self-hosted)";
222
- return "local-only";
223
- }
224
- function printSettings(config) {
225
- console.log(`
226
- \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
227
- \u2502 exe-os settings \u2502
228
- \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
229
-
230
- 1. Auto-ingestion: ${label(config.autoIngestion).padEnd(5)} Store every tool call as a memory
231
- 2. Auto-retrieval: ${label(config.autoRetrieval).padEnd(5)} Inject relevant memories into context
232
- 3. MCP search mode: ${searchLabel(config.searchMode)}
233
- 4. Hook search mode: ${hookSearchLabel(config.hookSearchMode)}
234
- 5. Cloud sync: ${syncStatus(config)}
235
-
236
- Model: ${config.modelFile}
237
-
238
- Type a number to toggle, or "q" to quit.
239
- `);
240
- }
241
- async function main() {
242
- const config = await loadConfig();
243
- const rl = createInterface({
244
- input: process.stdin,
245
- output: process.stdout
246
- });
247
- const prompt = () => {
248
- printSettings(config);
249
- rl.question("> ", async (answer) => {
250
- const choice = answer.trim().toLowerCase();
251
- if (choice === "1") {
252
- config.autoIngestion = !config.autoIngestion;
253
- await saveConfig(config);
254
- console.log(`
255
- Auto-ingestion ${label(config.autoIngestion)}`);
256
- if (!config.autoIngestion) {
257
- console.log(" Tool calls will no longer be saved to memory.");
258
- console.log(" Use the store_memory MCP tool to save manually.");
259
- }
260
- prompt();
261
- } else if (choice === "2") {
262
- config.autoRetrieval = !config.autoRetrieval;
263
- await saveConfig(config);
264
- console.log(`
265
- Auto-retrieval ${label(config.autoRetrieval)}`);
266
- if (!config.autoRetrieval) {
267
- console.log(" Memories won't be injected automatically.");
268
- console.log(" Use recall_my_memory MCP tool to search manually.");
269
- }
270
- prompt();
271
- } else if (choice === "3") {
272
- config.searchMode = config.searchMode === "hybrid" ? "fts" : "hybrid";
273
- await saveConfig(config);
274
- console.log(`
275
- MCP search mode: ${config.searchMode}`);
276
- if (config.searchMode === "fts") {
277
- console.log(" MCP tools now use keyword search only.");
278
- console.log(" Faster queries, no embedding model needed for search.");
279
- } else {
280
- console.log(" MCP tools now use hybrid search (FTS + vector + RRF).");
281
- console.log(" Best quality \u2014 model is already warm in MCP server.");
282
- }
283
- prompt();
284
- } else if (choice === "4") {
285
- config.hookSearchMode = config.hookSearchMode === "fts" ? "hybrid" : "fts";
286
- await saveConfig(config);
287
- console.log(`
288
- Hook search mode: ${config.hookSearchMode}`);
289
- if (config.hookSearchMode === "hybrid") {
290
- console.log(" Hooks will load the embedding model for semantic search.");
291
- console.log(" Better recall, but first invocation adds 3-8s cold-start.");
292
- } else {
293
- console.log(" Hooks use keyword search only (~200ms, no model load).");
294
- console.log(" Recommended for daily use.");
295
- }
296
- prompt();
297
- } else if (choice === "5") {
298
- console.log(`
299
- Current sync: ${syncStatus(config)}`);
300
- console.log("\n Configure cloud sync:");
301
- console.log(" a. Exe Cloud \u2014 paste your API key (exe_sk_...)");
302
- console.log(" b. Disconnect \u2014 switch to local-only");
303
- console.log(" c. Cancel");
304
- rl.question("\n > ", async (syncChoice) => {
305
- const sc = syncChoice.trim().toLowerCase();
306
- if (sc === "a") {
307
- rl.question(" API key: ", async (apiKey) => {
308
- const key = apiKey.trim();
309
- if (!key) {
310
- console.log(" Cancelled.");
311
- prompt();
312
- return;
313
- }
314
- rl.question(" Endpoint [https://askexe.com/cloud]: ", async (ep) => {
315
- const endpoint = ep.trim() || "https://askexe.com/cloud";
316
- console.log(" Validating...");
317
- try {
318
- const resp = await fetch(`${endpoint}/auth/verify`, {
319
- method: "POST",
320
- headers: { "Authorization": `Bearer ${key}`, "Content-Type": "application/json" }
321
- });
322
- if (resp.ok) {
323
- config.cloud = { apiKey: key, endpoint };
324
- delete config.turso;
325
- await saveConfig(config);
326
- console.log(" \u2713 Cloud sync configured. Memories will sync on next ingestion.");
327
- } else {
328
- console.log(` \u2717 Validation failed (${resp.status}). Key not saved.`);
329
- }
330
- } catch (err) {
331
- console.log(` \u2717 Could not reach endpoint: ${err instanceof Error ? err.message : String(err)}`);
332
- console.log(" Key not saved. Check the endpoint URL.");
333
- }
334
- prompt();
335
- });
336
- });
337
- } else if (sc === "b") {
338
- delete config.cloud;
339
- delete config.turso;
340
- await saveConfig(config);
341
- console.log(" \u2713 Switched to local-only. Cloud sync disconnected.");
342
- prompt();
343
- } else {
344
- prompt();
345
- }
346
- });
347
- } else if (choice === "q" || choice === "quit" || choice === "") {
348
- rl.close();
349
- } else {
350
- console.log("\n Unknown option. Type 1-5, or q.");
351
- prompt();
352
- }
353
- });
354
- };
355
- prompt();
356
- }
357
- if (isMainModule(import.meta.url)) {
358
- main().catch((err) => {
359
- console.error("Settings error:", err instanceof Error ? err.message : err);
360
- process.exit(1);
361
- });
362
- }
363
- export {
364
- main
365
- };