@askexenow/exe-os 0.8.83 → 0.8.86

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 (103) hide show
  1. package/dist/bin/backfill-conversations.js +746 -595
  2. package/dist/bin/backfill-responses.js +745 -594
  3. package/dist/bin/backfill-vectors.js +312 -226
  4. package/dist/bin/cleanup-stale-review-tasks.js +154 -21
  5. package/dist/bin/cli.js +14678 -12676
  6. package/dist/bin/exe-agent-config.js +242 -0
  7. package/dist/bin/exe-agent.js +100 -91
  8. package/dist/bin/exe-assign.js +1003 -854
  9. package/dist/bin/exe-boot.js +1420 -485
  10. package/dist/bin/exe-call.js +10 -0
  11. package/dist/bin/exe-cloud.js +29 -6
  12. package/dist/bin/exe-dispatch.js +572 -271
  13. package/dist/bin/exe-doctor.js +403 -6
  14. package/dist/bin/exe-export-behaviors.js +175 -72
  15. package/dist/bin/exe-forget.js +102 -3
  16. package/dist/bin/exe-gateway.js +796 -292
  17. package/dist/bin/exe-healthcheck.js +134 -1
  18. package/dist/bin/exe-heartbeat.js +172 -36
  19. package/dist/bin/exe-kill.js +175 -72
  20. package/dist/bin/exe-launch-agent.js +189 -76
  21. package/dist/bin/exe-link.js +927 -82
  22. package/dist/bin/exe-new-employee.js +60 -8
  23. package/dist/bin/exe-pending-messages.js +151 -19
  24. package/dist/bin/exe-pending-notifications.js +97 -2
  25. package/dist/bin/exe-pending-reviews.js +155 -22
  26. package/dist/bin/exe-rename.js +564 -23
  27. package/dist/bin/exe-review.js +231 -73
  28. package/dist/bin/exe-search.js +995 -228
  29. package/dist/bin/exe-session-cleanup.js +4930 -1664
  30. package/dist/bin/exe-settings.js +20 -5
  31. package/dist/bin/exe-start-codex.js +2598 -0
  32. package/dist/bin/exe-start.sh +15 -3
  33. package/dist/bin/exe-status.js +154 -21
  34. package/dist/bin/exe-team.js +97 -2
  35. package/dist/bin/git-sweep.js +1180 -363
  36. package/dist/bin/graph-backfill.js +175 -72
  37. package/dist/bin/graph-export.js +175 -72
  38. package/dist/bin/install.js +60 -7
  39. package/dist/bin/list-providers.js +1 -0
  40. package/dist/bin/scan-tasks.js +1185 -367
  41. package/dist/bin/setup.js +914 -270
  42. package/dist/bin/shard-migrate.js +175 -72
  43. package/dist/bin/update.js +1 -0
  44. package/dist/bin/wiki-sync.js +175 -72
  45. package/dist/gateway/index.js +792 -285
  46. package/dist/hooks/bug-report-worker.js +445 -135
  47. package/dist/hooks/commit-complete.js +1178 -361
  48. package/dist/hooks/error-recall.js +994 -228
  49. package/dist/hooks/ingest-worker.js +1799 -1234
  50. package/dist/hooks/ingest.js +3 -0
  51. package/dist/hooks/instructions-loaded.js +707 -97
  52. package/dist/hooks/notification.js +699 -89
  53. package/dist/hooks/post-compact.js +757 -109
  54. package/dist/hooks/pre-compact.js +1061 -244
  55. package/dist/hooks/pre-tool-use.js +787 -130
  56. package/dist/hooks/prompt-ingest-worker.js +242 -101
  57. package/dist/hooks/prompt-submit.js +1121 -299
  58. package/dist/hooks/response-ingest-worker.js +242 -101
  59. package/dist/hooks/session-end.js +4063 -397
  60. package/dist/hooks/session-start.js +1071 -254
  61. package/dist/hooks/stop.js +768 -120
  62. package/dist/hooks/subagent-stop.js +757 -109
  63. package/dist/hooks/summary-worker.js +1706 -1011
  64. package/dist/index.js +1821 -1098
  65. package/dist/lib/agent-config.js +167 -0
  66. package/dist/lib/cloud-sync.js +932 -88
  67. package/dist/lib/consolidation.js +2 -1
  68. package/dist/lib/database.js +642 -87
  69. package/dist/lib/db-daemon-client.js +503 -0
  70. package/dist/lib/device-registry.js +547 -7
  71. package/dist/lib/embedder.js +14 -28
  72. package/dist/lib/employee-templates.js +84 -74
  73. package/dist/lib/employees.js +9 -0
  74. package/dist/lib/exe-daemon-client.js +16 -29
  75. package/dist/lib/exe-daemon.js +2733 -1575
  76. package/dist/lib/hybrid-search.js +995 -228
  77. package/dist/lib/identity.js +87 -67
  78. package/dist/lib/keychain.js +9 -1
  79. package/dist/lib/messaging.js +103 -40
  80. package/dist/lib/reminders.js +91 -74
  81. package/dist/lib/runtime-table.js +16 -0
  82. package/dist/lib/schedules.js +96 -2
  83. package/dist/lib/session-wrappers.js +22 -0
  84. package/dist/lib/skill-learning.js +103 -85
  85. package/dist/lib/store.js +234 -73
  86. package/dist/lib/tasks.js +348 -134
  87. package/dist/lib/tmux-routing.js +422 -208
  88. package/dist/lib/token-spend.js +273 -0
  89. package/dist/lib/ws-client.js +11 -0
  90. package/dist/mcp/server.js +5742 -696
  91. package/dist/mcp/tools/complete-reminder.js +94 -77
  92. package/dist/mcp/tools/create-reminder.js +94 -77
  93. package/dist/mcp/tools/create-task.js +375 -152
  94. package/dist/mcp/tools/deactivate-behavior.js +95 -77
  95. package/dist/mcp/tools/list-reminders.js +94 -77
  96. package/dist/mcp/tools/list-tasks.js +99 -31
  97. package/dist/mcp/tools/send-message.js +108 -45
  98. package/dist/mcp/tools/update-task.js +162 -77
  99. package/dist/runtime/index.js +1075 -258
  100. package/dist/tui/App.js +1333 -506
  101. package/package.json +6 -1
  102. package/src/commands/exe/agent-config.md +27 -0
  103. package/src/commands/exe/cc-doctor.md +10 -0
@@ -1,15 +1,7 @@
1
- // src/lib/global-procedures.ts
2
- import { randomUUID } from "crypto";
3
-
4
- // src/lib/database.ts
5
- import { createClient } from "@libsql/client";
6
-
7
- // src/lib/employees.ts
8
- import { readFile as readFile2, writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
9
- import { existsSync as existsSync2, symlinkSync, readlinkSync, readFileSync as readFileSync2, renameSync as renameSync2, unlinkSync, writeFileSync } from "fs";
10
- import { execSync } from "child_process";
11
- import path2 from "path";
12
- import os2 from "os";
1
+ var __getOwnPropNames = Object.getOwnPropertyNames;
2
+ var __esm = (fn, res) => function __init() {
3
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
4
+ };
13
5
 
14
6
  // src/lib/config.ts
15
7
  import { readFile, writeFile, mkdir, chmod } from "fs/promises";
@@ -32,71 +24,89 @@ function resolveDataDir() {
32
24
  }
33
25
  return newDir;
34
26
  }
35
- var EXE_AI_DIR = resolveDataDir();
36
- var DB_PATH = path.join(EXE_AI_DIR, "memories.db");
37
- var MODELS_DIR = path.join(EXE_AI_DIR, "models");
38
- var CONFIG_PATH = path.join(EXE_AI_DIR, "config.json");
39
- var LEGACY_LANCE_PATH = path.join(EXE_AI_DIR, "local.lance");
40
- var CURRENT_CONFIG_VERSION = 1;
41
- var DEFAULT_CONFIG = {
42
- config_version: CURRENT_CONFIG_VERSION,
43
- dbPath: DB_PATH,
44
- modelFile: "jina-embeddings-v5-small-q4_k_m.gguf",
45
- embeddingDim: 1024,
46
- batchSize: 20,
47
- flushIntervalMs: 1e4,
48
- autoIngestion: true,
49
- autoRetrieval: true,
50
- searchMode: "hybrid",
51
- hookSearchMode: "hybrid",
52
- fileGrepEnabled: true,
53
- splashEffect: true,
54
- consolidationEnabled: true,
55
- consolidationIntervalMs: 6 * 60 * 60 * 1e3,
56
- consolidationModel: "claude-haiku-4-5-20251001",
57
- consolidationMaxCallsPerRun: 20,
58
- selfQueryRouter: true,
59
- selfQueryModel: "claude-haiku-4-5-20251001",
60
- rerankerEnabled: true,
61
- scalingRoadmap: {
62
- rerankerAutoTrigger: {
63
- enabled: true,
64
- broadQueryMinCardinality: 5e4,
65
- fetchTopK: 150,
66
- returnTopK: 5
67
- }
68
- },
69
- graphRagEnabled: true,
70
- wikiEnabled: false,
71
- wikiUrl: "",
72
- wikiApiKey: "",
73
- wikiSyncIntervalMs: 30 * 60 * 1e3,
74
- wikiWorkspaceMapping: {},
75
- wikiAutoUpdate: true,
76
- wikiAutoUpdateThreshold: 0.5,
77
- wikiAutoUpdateCreateNew: true,
78
- skillLearning: true,
79
- skillThreshold: 3,
80
- skillModel: "claude-haiku-4-5-20251001",
81
- exeHeartbeat: {
82
- enabled: true,
83
- intervalSeconds: 60,
84
- staleInProgressThresholdHours: 2
85
- },
86
- sessionLifecycle: {
87
- idleKillEnabled: true,
88
- idleKillTicksRequired: 3,
89
- idleKillIntercomAckWindowMs: 1e4,
90
- maxAutoInstances: 10
91
- },
92
- autoUpdate: {
93
- checkOnBoot: true,
94
- autoInstall: false,
95
- checkIntervalMs: 24 * 60 * 60 * 1e3
27
+ var EXE_AI_DIR, DB_PATH, MODELS_DIR, CONFIG_PATH, LEGACY_LANCE_PATH, CURRENT_CONFIG_VERSION, DEFAULT_CONFIG;
28
+ var init_config = __esm({
29
+ "src/lib/config.ts"() {
30
+ "use strict";
31
+ EXE_AI_DIR = resolveDataDir();
32
+ DB_PATH = path.join(EXE_AI_DIR, "memories.db");
33
+ MODELS_DIR = path.join(EXE_AI_DIR, "models");
34
+ CONFIG_PATH = path.join(EXE_AI_DIR, "config.json");
35
+ LEGACY_LANCE_PATH = path.join(EXE_AI_DIR, "local.lance");
36
+ CURRENT_CONFIG_VERSION = 1;
37
+ DEFAULT_CONFIG = {
38
+ config_version: CURRENT_CONFIG_VERSION,
39
+ dbPath: DB_PATH,
40
+ modelFile: "jina-embeddings-v5-small-q4_k_m.gguf",
41
+ embeddingDim: 1024,
42
+ batchSize: 20,
43
+ flushIntervalMs: 1e4,
44
+ autoIngestion: true,
45
+ autoRetrieval: true,
46
+ searchMode: "hybrid",
47
+ hookSearchMode: "hybrid",
48
+ fileGrepEnabled: true,
49
+ splashEffect: true,
50
+ consolidationEnabled: true,
51
+ consolidationIntervalMs: 6 * 60 * 60 * 1e3,
52
+ consolidationModel: "claude-haiku-4-5-20251001",
53
+ consolidationMaxCallsPerRun: 20,
54
+ selfQueryRouter: true,
55
+ selfQueryModel: "claude-haiku-4-5-20251001",
56
+ rerankerEnabled: true,
57
+ scalingRoadmap: {
58
+ rerankerAutoTrigger: {
59
+ enabled: true,
60
+ broadQueryMinCardinality: 5e4,
61
+ fetchTopK: 150,
62
+ returnTopK: 5
63
+ }
64
+ },
65
+ graphRagEnabled: true,
66
+ wikiEnabled: false,
67
+ wikiUrl: "",
68
+ wikiApiKey: "",
69
+ wikiSyncIntervalMs: 30 * 60 * 1e3,
70
+ wikiWorkspaceMapping: {},
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
+ };
96
94
  }
97
- };
95
+ });
96
+
97
+ // src/lib/global-procedures.ts
98
+ import { randomUUID } from "crypto";
99
+
100
+ // src/lib/database.ts
101
+ import { createClient } from "@libsql/client";
98
102
 
99
103
  // src/lib/employees.ts
104
+ init_config();
105
+ import { readFile as readFile2, writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
106
+ import { existsSync as existsSync2, symlinkSync, readlinkSync, readFileSync as readFileSync2, renameSync as renameSync2, unlinkSync, writeFileSync } from "fs";
107
+ import { execSync } from "child_process";
108
+ import path2 from "path";
109
+ import os2 from "os";
100
110
  var EMPLOYEES_PATH = path2.join(EXE_AI_DIR, "exe-employees.json");
101
111
 
102
112
  // src/lib/platform-procedures.ts
@@ -167,6 +167,14 @@ function hasRole(agentName, role) {
167
167
  const emp = getEmployee(employees, agentName);
168
168
  return emp ? emp.role.toLowerCase() === role.toLowerCase() : false;
169
169
  }
170
+ function baseAgentName(name, employees) {
171
+ const match = name.match(/^([a-zA-Z]+)\d+$/);
172
+ if (!match) return name;
173
+ const base = match[1];
174
+ const roster = employees ?? loadEmployeesSync();
175
+ if (getEmployee(roster, base)) return base;
176
+ return name;
177
+ }
170
178
  var MULTI_INSTANCE_ROLES = /* @__PURE__ */ new Set(["principal engineer", "content production specialist", "staff code reviewer"]);
171
179
  function isMultiInstance(agentName, employees) {
172
180
  const roster = employees ?? loadEmployeesSync();
@@ -256,6 +264,7 @@ export {
256
264
  DEFAULT_COORDINATOR_TEMPLATE_NAME,
257
265
  EMPLOYEES_PATH,
258
266
  addEmployee,
267
+ baseAgentName,
259
268
  canCoordinate,
260
269
  getCoordinatorEmployee,
261
270
  getCoordinatorName,
@@ -118,10 +118,12 @@ function handleData(chunk) {
118
118
  if (!line) continue;
119
119
  try {
120
120
  const response = JSON.parse(line);
121
- const entry = _pending.get(response.id);
121
+ const id = response.id;
122
+ if (!id) continue;
123
+ const entry = _pending.get(id);
122
124
  if (entry) {
123
125
  clearTimeout(entry.timer);
124
- _pending.delete(response.id);
126
+ _pending.delete(id);
125
127
  entry.resolve(response);
126
128
  }
127
129
  } catch {
@@ -292,6 +294,9 @@ async function connectEmbedDaemon() {
292
294
  return false;
293
295
  }
294
296
  function sendRequest(texts, priority) {
297
+ return sendDaemonRequest({ texts, priority });
298
+ }
299
+ function sendDaemonRequest(payload, timeoutMs = REQUEST_TIMEOUT_MS) {
295
300
  return new Promise((resolve) => {
296
301
  if (!_socket || !_connected) {
297
302
  resolve({ error: "Not connected" });
@@ -301,10 +306,10 @@ function sendRequest(texts, priority) {
301
306
  const timer = setTimeout(() => {
302
307
  _pending.delete(id);
303
308
  resolve({ error: "Request timeout" });
304
- }, REQUEST_TIMEOUT_MS);
309
+ }, timeoutMs);
305
310
  _pending.set(id, { resolve, timer });
306
311
  try {
307
- _socket.write(JSON.stringify({ id, texts, priority }) + "\n");
312
+ _socket.write(JSON.stringify({ id, ...payload }) + "\n");
308
313
  } catch {
309
314
  clearTimeout(timer);
310
315
  _pending.delete(id);
@@ -314,30 +319,11 @@ function sendRequest(texts, priority) {
314
319
  }
315
320
  async function pingDaemon() {
316
321
  if (!_socket || !_connected) return null;
317
- return new Promise((resolve) => {
318
- const id = randomUUID();
319
- const timer = setTimeout(() => {
320
- _pending.delete(id);
321
- resolve(null);
322
- }, 5e3);
323
- _pending.set(id, {
324
- resolve: (data) => {
325
- if (data.health) {
326
- resolve(data.health);
327
- } else {
328
- resolve(null);
329
- }
330
- },
331
- timer
332
- });
333
- try {
334
- _socket.write(JSON.stringify({ id, type: "health" }) + "\n");
335
- } catch {
336
- clearTimeout(timer);
337
- _pending.delete(id);
338
- resolve(null);
339
- }
340
- });
322
+ const response = await sendDaemonRequest({ type: "health" }, 5e3);
323
+ if (response.health) {
324
+ return response.health;
325
+ }
326
+ return null;
341
327
  }
342
328
  function killAndRespawnDaemon() {
343
329
  process.stderr.write("[exed-client] Killing daemon for restart...\n");
@@ -455,5 +441,6 @@ export {
455
441
  embedBatchViaClient,
456
442
  embedViaClient,
457
443
  isClientConnected,
458
- pingDaemon
444
+ pingDaemon,
445
+ sendDaemonRequest
459
446
  };