@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,1692 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __esm = (fn, res) => function __init() {
6
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
7
- };
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
-
22
- // src/lib/database.ts
23
- import { createClient } from "@libsql/client";
24
- function getClient() {
25
- if (!_client) {
26
- throw new Error("Database client not initialized. Call initDatabase() first.");
27
- }
28
- return _client;
29
- }
30
- var _client;
31
- var init_database = __esm({
32
- "src/lib/database.ts"() {
33
- "use strict";
34
- _client = null;
35
- }
36
- });
37
-
38
- // src/lib/config.ts
39
- import { readFile, writeFile, mkdir } from "fs/promises";
40
- import { readFileSync, existsSync, renameSync } from "fs";
41
- import path from "path";
42
- import os from "os";
43
- function resolveDataDir() {
44
- if (process.env.EXE_OS_DIR) return process.env.EXE_OS_DIR;
45
- if (process.env.EXE_MEM_DIR) return process.env.EXE_MEM_DIR;
46
- const newDir = path.join(os.homedir(), ".exe-os");
47
- const legacyDir = path.join(os.homedir(), ".exe-mem");
48
- if (!existsSync(newDir) && existsSync(legacyDir)) {
49
- try {
50
- renameSync(legacyDir, newDir);
51
- process.stderr.write(`[exe-os] Migrated data directory: ~/.exe-mem \u2192 ~/.exe-os
52
- `);
53
- } catch {
54
- return legacyDir;
55
- }
56
- }
57
- return newDir;
58
- }
59
- function migrateLegacyConfig(raw) {
60
- if ("r2" in raw) {
61
- process.stderr.write(
62
- "[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"
63
- );
64
- delete raw.r2;
65
- }
66
- if ("syncIntervalMs" in raw) {
67
- delete raw.syncIntervalMs;
68
- }
69
- return raw;
70
- }
71
- function migrateConfig(raw) {
72
- const fromVersion = typeof raw.config_version === "number" ? raw.config_version : 0;
73
- let currentVersion = fromVersion;
74
- let migrated = false;
75
- if (currentVersion > CURRENT_CONFIG_VERSION) {
76
- return { config: raw, migrated: false, fromVersion };
77
- }
78
- for (const migration of CONFIG_MIGRATIONS) {
79
- if (currentVersion === migration.from && migration.to <= CURRENT_CONFIG_VERSION) {
80
- raw = migration.migrate(raw);
81
- currentVersion = migration.to;
82
- migrated = true;
83
- }
84
- }
85
- return { config: raw, migrated, fromVersion };
86
- }
87
- function normalizeScalingRoadmap(raw) {
88
- const defaultAuto = DEFAULT_CONFIG.scalingRoadmap.rerankerAutoTrigger;
89
- const userRoadmap = raw.scalingRoadmap ?? {};
90
- const userAuto = userRoadmap.rerankerAutoTrigger ?? {};
91
- if (userAuto.enabled === void 0 && raw.rerankerEnabled !== void 0) {
92
- userAuto.enabled = raw.rerankerEnabled;
93
- }
94
- raw.scalingRoadmap = {
95
- ...userRoadmap,
96
- rerankerAutoTrigger: { ...defaultAuto, ...userAuto }
97
- };
98
- }
99
- function normalizeSessionLifecycle(raw) {
100
- const defaultSL = DEFAULT_CONFIG.sessionLifecycle;
101
- const userSL = raw.sessionLifecycle ?? {};
102
- raw.sessionLifecycle = { ...defaultSL, ...userSL };
103
- }
104
- async function loadConfig() {
105
- const dir = process.env.EXE_OS_DIR ?? process.env.EXE_MEM_DIR ?? EXE_AI_DIR;
106
- await mkdir(dir, { recursive: true });
107
- const configPath = path.join(dir, "config.json");
108
- if (!existsSync(configPath)) {
109
- return { ...DEFAULT_CONFIG, dbPath: path.join(dir, "memories.db") };
110
- }
111
- const raw = await readFile(configPath, "utf-8");
112
- try {
113
- let parsed = JSON.parse(raw);
114
- parsed = migrateLegacyConfig(parsed);
115
- const { config: migratedCfg, migrated, fromVersion } = migrateConfig(parsed);
116
- if (migrated) {
117
- process.stderr.write(`[exe-os] Config migrated from v${fromVersion} to v${migratedCfg.config_version}
118
- `);
119
- try {
120
- await writeFile(configPath, JSON.stringify(migratedCfg, null, 2) + "\n");
121
- } catch {
122
- }
123
- }
124
- normalizeScalingRoadmap(migratedCfg);
125
- normalizeSessionLifecycle(migratedCfg);
126
- const config = { ...DEFAULT_CONFIG, dbPath: path.join(dir, "memories.db"), ...migratedCfg };
127
- if (config.dbPath.startsWith("~")) {
128
- config.dbPath = config.dbPath.replace(/^~/, os.homedir());
129
- }
130
- return config;
131
- } catch {
132
- return { ...DEFAULT_CONFIG, dbPath: path.join(dir, "memories.db") };
133
- }
134
- }
135
- var EXE_AI_DIR, DB_PATH, MODELS_DIR, CONFIG_PATH, LEGACY_LANCE_PATH, CURRENT_CONFIG_VERSION, DEFAULT_CONFIG, CONFIG_MIGRATIONS;
136
- var init_config = __esm({
137
- "src/lib/config.ts"() {
138
- "use strict";
139
- EXE_AI_DIR = resolveDataDir();
140
- DB_PATH = path.join(EXE_AI_DIR, "memories.db");
141
- MODELS_DIR = path.join(EXE_AI_DIR, "models");
142
- CONFIG_PATH = path.join(EXE_AI_DIR, "config.json");
143
- LEGACY_LANCE_PATH = path.join(EXE_AI_DIR, "local.lance");
144
- CURRENT_CONFIG_VERSION = 1;
145
- DEFAULT_CONFIG = {
146
- config_version: CURRENT_CONFIG_VERSION,
147
- dbPath: DB_PATH,
148
- modelFile: "jina-embeddings-v5-small-q4_k_m.gguf",
149
- embeddingDim: 1024,
150
- batchSize: 20,
151
- flushIntervalMs: 1e4,
152
- autoIngestion: true,
153
- autoRetrieval: true,
154
- searchMode: "hybrid",
155
- hookSearchMode: "hybrid",
156
- fileGrepEnabled: true,
157
- splashEffect: true,
158
- consolidationEnabled: true,
159
- consolidationIntervalMs: 6 * 60 * 60 * 1e3,
160
- consolidationModel: "claude-haiku-4-5-20251001",
161
- consolidationMaxCallsPerRun: 20,
162
- selfQueryRouter: true,
163
- selfQueryModel: "claude-haiku-4-5-20251001",
164
- rerankerEnabled: true,
165
- scalingRoadmap: {
166
- rerankerAutoTrigger: {
167
- enabled: true,
168
- broadQueryMinCardinality: 5e4,
169
- fetchTopK: 150,
170
- returnTopK: 5
171
- }
172
- },
173
- graphRagEnabled: true,
174
- wikiEnabled: false,
175
- wikiUrl: "",
176
- wikiApiKey: "",
177
- wikiSyncIntervalMs: 30 * 60 * 1e3,
178
- wikiWorkspaceMapping: {
179
- exe: "Executive",
180
- yoshi: "Engineering",
181
- mari: "Marketing",
182
- tom: "Engineering",
183
- sasha: "Production"
184
- },
185
- wikiAutoUpdate: true,
186
- wikiAutoUpdateThreshold: 0.5,
187
- wikiAutoUpdateCreateNew: true,
188
- skillLearning: true,
189
- skillThreshold: 3,
190
- skillModel: "claude-haiku-4-5-20251001",
191
- exeHeartbeat: {
192
- enabled: true,
193
- intervalSeconds: 60,
194
- staleInProgressThresholdHours: 2
195
- },
196
- sessionLifecycle: {
197
- idleKillEnabled: true,
198
- idleKillTicksRequired: 3,
199
- idleKillIntercomAckWindowMs: 1e4,
200
- maxAutoInstances: 10
201
- }
202
- };
203
- CONFIG_MIGRATIONS = [
204
- {
205
- from: 0,
206
- to: 1,
207
- migrate: (cfg) => {
208
- cfg.config_version = 1;
209
- return cfg;
210
- }
211
- }
212
- ];
213
- }
214
- });
215
-
216
- // src/lib/notifications.ts
217
- import crypto from "crypto";
218
- import path2 from "path";
219
- import os2 from "os";
220
- import {
221
- readFileSync as readFileSync2,
222
- readdirSync,
223
- unlinkSync,
224
- existsSync as existsSync2,
225
- rmdirSync
226
- } from "fs";
227
- async function writeNotification(notification) {
228
- try {
229
- const client = getClient();
230
- const id = crypto.randomUUID();
231
- const now = (/* @__PURE__ */ new Date()).toISOString();
232
- await client.execute({
233
- sql: `INSERT INTO notifications (id, agent_id, agent_role, event, project, summary, task_file, read, created_at)
234
- VALUES (?, ?, ?, ?, ?, ?, ?, 0, ?)`,
235
- args: [
236
- id,
237
- notification.agentId,
238
- notification.agentRole,
239
- notification.event,
240
- notification.project,
241
- notification.summary,
242
- notification.taskFile ?? null,
243
- now
244
- ]
245
- });
246
- } catch (err) {
247
- process.stderr.write(`[notifications] WRITE FAILED: ${err instanceof Error ? err.message : String(err)}
248
- `);
249
- }
250
- }
251
- async function markAsReadByTaskFile(taskFile) {
252
- try {
253
- const client = getClient();
254
- await client.execute({
255
- sql: "UPDATE notifications SET read = 1 WHERE task_file = ? AND read = 0",
256
- args: [taskFile]
257
- });
258
- } catch {
259
- }
260
- }
261
- var init_notifications = __esm({
262
- "src/lib/notifications.ts"() {
263
- "use strict";
264
- init_database();
265
- }
266
- });
267
-
268
- // src/lib/tasks-crud.ts
269
- import crypto2 from "crypto";
270
- import path3 from "path";
271
- import { execSync } from "child_process";
272
- import { mkdir as mkdir2, writeFile as writeFile2, appendFile } from "fs/promises";
273
- import { existsSync as existsSync3, readFileSync as readFileSync3 } from "fs";
274
- async function resolveTask(client, identifier) {
275
- let result = await client.execute({
276
- sql: "SELECT * FROM tasks WHERE id = ?",
277
- args: [identifier]
278
- });
279
- if (result.rows.length === 1) return result.rows[0];
280
- result = await client.execute({
281
- sql: "SELECT * FROM tasks WHERE task_file LIKE ?",
282
- args: [`%${identifier}%`]
283
- });
284
- if (result.rows.length === 1) return result.rows[0];
285
- if (result.rows.length > 1) {
286
- const exact = result.rows.filter(
287
- (r) => String(r.task_file).endsWith(`/${identifier}.md`)
288
- );
289
- if (exact.length === 1) return exact[0];
290
- const candidates = exact.length > 1 ? exact : result.rows;
291
- const active = candidates.filter(
292
- (r) => !["done", "cancelled"].includes(String(r.status))
293
- );
294
- if (active.length === 1) return active[0];
295
- const matches = (active.length > 1 ? active : candidates).map((r) => `${String(r.task_file)} (${String(r.status)}, ${String(r.id)})`).join(", ");
296
- throw new Error(
297
- `Multiple tasks match "${identifier}": ${matches}. Use a UUID to disambiguate.`
298
- );
299
- }
300
- result = await client.execute({
301
- sql: "SELECT * FROM tasks WHERE title LIKE ?",
302
- args: [`%${identifier}%`]
303
- });
304
- if (result.rows.length === 1) return result.rows[0];
305
- if (result.rows.length > 1) {
306
- const active = result.rows.filter(
307
- (r) => !["done", "cancelled"].includes(String(r.status))
308
- );
309
- if (active.length === 1) return active[0];
310
- const matches = (active.length > 1 ? active : result.rows).map((r) => `"${String(r.title)}" (${String(r.status)}, ${String(r.id)})`).join(", ");
311
- throw new Error(
312
- `Multiple tasks match "${identifier}": ${matches}. Use a UUID to disambiguate.`
313
- );
314
- }
315
- throw new Error(`Task not found: ${identifier}`);
316
- }
317
- function checkStaleCompletion(taskContext, taskCreatedAt) {
318
- if (!taskContext) return null;
319
- if (!DELEGATION_KEYWORDS.test(taskContext)) return null;
320
- try {
321
- const since = new Date(taskCreatedAt).toISOString();
322
- const commitCount = execSync(
323
- `git log --oneline --since="${since}" 2>/dev/null | wc -l`,
324
- { encoding: "utf8", timeout: 5e3 }
325
- ).trim();
326
- const count = parseInt(commitCount, 10);
327
- if (count === 0) {
328
- return "WARNING: task closed with no new commits since creation. Verify work was actually produced.";
329
- }
330
- return null;
331
- } catch {
332
- return null;
333
- }
334
- }
335
- async function updateTaskStatus(input) {
336
- const client = getClient();
337
- const now = (/* @__PURE__ */ new Date()).toISOString();
338
- const row = await resolveTask(client, input.taskId);
339
- const taskId = String(row.id);
340
- const taskFile = String(row.task_file);
341
- if (input.status === "done" && String(row.assigned_by) === "system" && taskFile.includes("review-")) {
342
- process.stderr.write(
343
- `[updateTask] Review task "${String(row.title)}" being marked done (assigned to ${String(row.assigned_to)})
344
- `
345
- );
346
- }
347
- if (input.status === "done") {
348
- const existingRow = await client.execute({
349
- sql: "SELECT context, created_at FROM tasks WHERE id = ?",
350
- args: [taskId]
351
- });
352
- if (existingRow.rows.length > 0) {
353
- const ctx = existingRow.rows[0];
354
- const warning = checkStaleCompletion(ctx.context, ctx.created_at);
355
- if (warning) {
356
- input.result = input.result ? `\u26A0\uFE0F ${warning}
357
-
358
- ${input.result}` : `\u26A0\uFE0F ${warning}`;
359
- process.stderr.write(`[tasks] ${warning} (task: ${taskId})
360
- `);
361
- }
362
- }
363
- }
364
- if (input.status === "in_progress") {
365
- const tmuxSession = process.env.TMUX_PANE ?? process.env.MY_TMUX_SESSION ?? "unknown";
366
- const claim = await client.execute({
367
- sql: `UPDATE tasks
368
- SET status = 'in_progress', assigned_tmux = ?, updated_at = ?
369
- WHERE id = ? AND status = 'open'`,
370
- args: [tmuxSession, now, taskId]
371
- });
372
- if (claim.rowsAffected === 0) {
373
- const current = await client.execute({
374
- sql: "SELECT status, assigned_tmux FROM tasks WHERE id = ?",
375
- args: [taskId]
376
- });
377
- const cur = current.rows[0];
378
- const status = cur?.status ?? "unknown";
379
- const claimedBy = cur?.assigned_tmux ? ` (claimed by ${cur.assigned_tmux})` : "";
380
- throw new Error(`${TASK_ALREADY_CLAIMED_PREFIX}: task ${taskId} is ${status}${claimedBy}`);
381
- }
382
- return { row, taskFile, now, taskId };
383
- }
384
- if (input.result) {
385
- await client.execute({
386
- sql: "UPDATE tasks SET status = ?, result = ?, updated_at = ? WHERE id = ?",
387
- args: [input.status, input.result, now, taskId]
388
- });
389
- } else {
390
- await client.execute({
391
- sql: "UPDATE tasks SET status = ?, updated_at = ? WHERE id = ?",
392
- args: [input.status, now, taskId]
393
- });
394
- }
395
- return { row, taskFile, now, taskId };
396
- }
397
- var DELEGATION_KEYWORDS, TASK_ALREADY_CLAIMED_PREFIX;
398
- var init_tasks_crud = __esm({
399
- "src/lib/tasks-crud.ts"() {
400
- "use strict";
401
- init_database();
402
- DELEGATION_KEYWORDS = /parallel|delegate|wave|tom\d*-exe/i;
403
- TASK_ALREADY_CLAIMED_PREFIX = "TASK_ALREADY_CLAIMED";
404
- }
405
- });
406
-
407
- // src/lib/employees.ts
408
- import { readFile as readFile2, writeFile as writeFile3, mkdir as mkdir3 } from "fs/promises";
409
- import { existsSync as existsSync4, symlinkSync, readlinkSync } from "fs";
410
- import { execSync as execSync2 } from "child_process";
411
- import path4 from "path";
412
- var EMPLOYEES_PATH;
413
- var init_employees = __esm({
414
- "src/lib/employees.ts"() {
415
- "use strict";
416
- init_config();
417
- EMPLOYEES_PATH = path4.join(EXE_AI_DIR, "exe-employees.json");
418
- }
419
- });
420
-
421
- // src/lib/session-registry.ts
422
- import path5 from "path";
423
- import os3 from "os";
424
- var REGISTRY_PATH;
425
- var init_session_registry = __esm({
426
- "src/lib/session-registry.ts"() {
427
- "use strict";
428
- REGISTRY_PATH = path5.join(os3.homedir(), ".exe-os", "session-registry.json");
429
- }
430
- });
431
-
432
- // src/lib/session-key.ts
433
- import { execSync as execSync3 } from "child_process";
434
- function getSessionKey() {
435
- if (_cached) return _cached;
436
- let pid = process.ppid;
437
- for (let i = 0; i < 10; i++) {
438
- try {
439
- const info = execSync3(`ps -p ${pid} -o ppid=,comm=`, {
440
- encoding: "utf8",
441
- timeout: 2e3
442
- }).trim();
443
- const match = info.match(/^\s*(\d+)\s+(.+)$/);
444
- if (!match) break;
445
- const [, ppid, cmd] = match;
446
- if (cmd === "claude" || cmd.endsWith("/claude")) {
447
- _cached = String(pid);
448
- return _cached;
449
- }
450
- pid = parseInt(ppid, 10);
451
- if (pid <= 1) break;
452
- } catch {
453
- break;
454
- }
455
- }
456
- _cached = process.env.CLAUDE_CODE_SSE_PORT ?? String(process.ppid);
457
- return _cached;
458
- }
459
- var _cached;
460
- var init_session_key = __esm({
461
- "src/lib/session-key.ts"() {
462
- "use strict";
463
- _cached = null;
464
- }
465
- });
466
-
467
- // src/lib/tmux-transport.ts
468
- var tmux_transport_exports = {};
469
- __export(tmux_transport_exports, {
470
- TmuxTransport: () => TmuxTransport
471
- });
472
- import { execFileSync } from "child_process";
473
- var QUIET, TmuxTransport;
474
- var init_tmux_transport = __esm({
475
- "src/lib/tmux-transport.ts"() {
476
- "use strict";
477
- QUIET = {
478
- encoding: "utf8",
479
- stdio: ["pipe", "pipe", "pipe"]
480
- };
481
- TmuxTransport = class {
482
- getMySession() {
483
- try {
484
- return execFileSync("tmux", ["display-message", "-p", "#{session_name}"], QUIET).trim() || null;
485
- } catch {
486
- return null;
487
- }
488
- }
489
- listSessions() {
490
- try {
491
- return execFileSync("tmux", ["list-sessions", "-F", "#{session_name}"], QUIET).trim().split("\n").filter(Boolean);
492
- } catch {
493
- return [];
494
- }
495
- }
496
- isAlive(target) {
497
- try {
498
- const sessions = this.listSessions();
499
- if (!sessions.includes(target)) return false;
500
- const paneStatus = execFileSync(
501
- "tmux",
502
- ["list-panes", "-t", target, "-F", "#{pane_dead}"],
503
- QUIET
504
- ).trim();
505
- return paneStatus !== "1";
506
- } catch {
507
- return false;
508
- }
509
- }
510
- sendKeys(target, keys) {
511
- execFileSync("tmux", ["send-keys", "-t", target, keys, "Enter"], QUIET);
512
- }
513
- capturePane(target, lines) {
514
- const args = ["capture-pane", "-t", target, "-p"];
515
- if (lines) args.push("-S", `-${lines}`);
516
- return execFileSync("tmux", args, { ...QUIET, timeout: 3e3 });
517
- }
518
- isPaneInCopyMode(target) {
519
- try {
520
- const result = execFileSync(
521
- "tmux",
522
- ["display-message", "-p", "-t", target, "#{pane_in_mode}"],
523
- { ...QUIET, timeout: 3e3 }
524
- ).trim();
525
- return result === "1";
526
- } catch {
527
- return false;
528
- }
529
- }
530
- spawn(name, config) {
531
- try {
532
- const args = ["new-session", "-d", "-s", name];
533
- if (config.cwd) args.push("-c", config.cwd);
534
- args.push(config.command);
535
- execFileSync("tmux", args);
536
- return { sessionName: name };
537
- } catch (e) {
538
- return { sessionName: name, error: `spawn failed: ${e}` };
539
- }
540
- }
541
- kill(target) {
542
- try {
543
- execFileSync("tmux", ["kill-session", "-t", target], QUIET);
544
- } catch {
545
- }
546
- }
547
- pipeLog(target, logFile) {
548
- try {
549
- const safePath = logFile.replace(/'/g, "'\\''");
550
- execFileSync("tmux", ["pipe-pane", "-t", target, `cat >> '${safePath}'`], QUIET);
551
- } catch {
552
- }
553
- }
554
- };
555
- }
556
- });
557
-
558
- // src/lib/transport.ts
559
- function getTransport() {
560
- if (!_transport) {
561
- const { TmuxTransport: TmuxTransport2 } = (init_tmux_transport(), __toCommonJS(tmux_transport_exports));
562
- _transport = new TmuxTransport2();
563
- }
564
- return _transport;
565
- }
566
- var _transport;
567
- var init_transport = __esm({
568
- "src/lib/transport.ts"() {
569
- "use strict";
570
- _transport = null;
571
- }
572
- });
573
-
574
- // src/lib/cc-agent-support.ts
575
- import { execSync as execSync4 } from "child_process";
576
- var init_cc_agent_support = __esm({
577
- "src/lib/cc-agent-support.ts"() {
578
- "use strict";
579
- }
580
- });
581
-
582
- // src/lib/mcp-prefix.ts
583
- var MCP_PRIMARY_KEY, MCP_LEGACY_KEY, MCP_TOOL_PREFIXES;
584
- var init_mcp_prefix = __esm({
585
- "src/lib/mcp-prefix.ts"() {
586
- "use strict";
587
- MCP_PRIMARY_KEY = "exe-os";
588
- MCP_LEGACY_KEY = "exe-mem";
589
- MCP_TOOL_PREFIXES = [
590
- `mcp__${MCP_PRIMARY_KEY}__`,
591
- `mcp__${MCP_LEGACY_KEY}__`
592
- ];
593
- }
594
- });
595
-
596
- // src/lib/provider-table.ts
597
- var init_provider_table = __esm({
598
- "src/lib/provider-table.ts"() {
599
- "use strict";
600
- }
601
- });
602
-
603
- // src/lib/intercom-queue.ts
604
- import { readFileSync as readFileSync4, writeFileSync, renameSync as renameSync2, existsSync as existsSync5, mkdirSync } from "fs";
605
- import path6 from "path";
606
- import os4 from "os";
607
- function ensureDir() {
608
- const dir = path6.dirname(QUEUE_PATH);
609
- if (!existsSync5(dir)) mkdirSync(dir, { recursive: true });
610
- }
611
- function readQueue() {
612
- try {
613
- if (!existsSync5(QUEUE_PATH)) return [];
614
- return JSON.parse(readFileSync4(QUEUE_PATH, "utf8"));
615
- } catch {
616
- return [];
617
- }
618
- }
619
- function writeQueue(queue) {
620
- ensureDir();
621
- const tmp = `${QUEUE_PATH}.tmp`;
622
- writeFileSync(tmp, JSON.stringify(queue, null, 2));
623
- renameSync2(tmp, QUEUE_PATH);
624
- }
625
- function queueIntercom(targetSession, reason) {
626
- const queue = readQueue();
627
- const existing = queue.find((q) => q.targetSession === targetSession);
628
- if (existing) {
629
- existing.attempts++;
630
- existing.queuedAt = (/* @__PURE__ */ new Date()).toISOString();
631
- existing.reason = reason;
632
- } else {
633
- queue.push({
634
- targetSession,
635
- queuedAt: (/* @__PURE__ */ new Date()).toISOString(),
636
- attempts: 0,
637
- reason
638
- });
639
- }
640
- writeQueue(queue);
641
- }
642
- var QUEUE_PATH, INTERCOM_LOG;
643
- var init_intercom_queue = __esm({
644
- "src/lib/intercom-queue.ts"() {
645
- "use strict";
646
- QUEUE_PATH = path6.join(os4.homedir(), ".exe-os", "intercom-queue.json");
647
- INTERCOM_LOG = path6.join(os4.homedir(), ".exe-os", "intercom.log");
648
- }
649
- });
650
-
651
- // src/lib/license.ts
652
- import { readFileSync as readFileSync5, writeFileSync as writeFileSync2, existsSync as existsSync6, mkdirSync as mkdirSync2 } from "fs";
653
- import { randomUUID } from "crypto";
654
- import path7 from "path";
655
- import { jwtVerify, importSPKI } from "jose";
656
- var LICENSE_PATH, CACHE_PATH, DEVICE_ID_PATH;
657
- var init_license = __esm({
658
- "src/lib/license.ts"() {
659
- "use strict";
660
- init_config();
661
- LICENSE_PATH = path7.join(EXE_AI_DIR, "license.key");
662
- CACHE_PATH = path7.join(EXE_AI_DIR, "license-cache.json");
663
- DEVICE_ID_PATH = path7.join(EXE_AI_DIR, "device-id");
664
- }
665
- });
666
-
667
- // src/lib/plan-limits.ts
668
- import { readFileSync as readFileSync6, existsSync as existsSync7 } from "fs";
669
- import path8 from "path";
670
- var CACHE_PATH2;
671
- var init_plan_limits = __esm({
672
- "src/lib/plan-limits.ts"() {
673
- "use strict";
674
- init_database();
675
- init_employees();
676
- init_license();
677
- init_config();
678
- CACHE_PATH2 = path8.join(EXE_AI_DIR, "license-cache.json");
679
- }
680
- });
681
-
682
- // src/lib/worktree.ts
683
- var init_worktree = __esm({
684
- "src/lib/worktree.ts"() {
685
- "use strict";
686
- }
687
- });
688
-
689
- // src/lib/tmux-routing.ts
690
- import { execFileSync as execFileSync2, execSync as execSync5 } from "child_process";
691
- import { readFileSync as readFileSync7, writeFileSync as writeFileSync3, mkdirSync as mkdirSync3, existsSync as existsSync8, appendFileSync } from "fs";
692
- import path9 from "path";
693
- import os5 from "os";
694
- import { fileURLToPath } from "url";
695
- function getDispatchedBy(sessionKey) {
696
- try {
697
- const data = JSON.parse(readFileSync7(
698
- path9.join(SESSION_CACHE, `parent-exe-${sessionKey}.json`),
699
- "utf8"
700
- ));
701
- return data.dispatchedBy ?? data.parentExe ?? null;
702
- } catch {
703
- return null;
704
- }
705
- }
706
- function readDebounceState() {
707
- try {
708
- if (!existsSync8(DEBOUNCE_FILE)) return {};
709
- return JSON.parse(readFileSync7(DEBOUNCE_FILE, "utf8"));
710
- } catch {
711
- return {};
712
- }
713
- }
714
- function writeDebounceState(state) {
715
- try {
716
- if (!existsSync8(SESSION_CACHE)) mkdirSync3(SESSION_CACHE, { recursive: true });
717
- writeFileSync3(DEBOUNCE_FILE, JSON.stringify(state));
718
- } catch {
719
- }
720
- }
721
- function isDebounced(targetSession) {
722
- const state = readDebounceState();
723
- const lastSent = state[targetSession] ?? 0;
724
- return Date.now() - lastSent < INTERCOM_DEBOUNCE_MS;
725
- }
726
- function recordDebounce(targetSession) {
727
- const state = readDebounceState();
728
- state[targetSession] = Date.now();
729
- const cutoff = Date.now() - DEBOUNCE_CLEANUP_AGE_MS;
730
- for (const key of Object.keys(state)) {
731
- if ((state[key] ?? 0) < cutoff) delete state[key];
732
- }
733
- writeDebounceState(state);
734
- }
735
- function logIntercom(msg) {
736
- const line = `[${(/* @__PURE__ */ new Date()).toISOString()}] ${msg}
737
- `;
738
- process.stderr.write(`[intercom] ${msg}
739
- `);
740
- try {
741
- appendFileSync(INTERCOM_LOG2, line);
742
- } catch {
743
- }
744
- }
745
- function getSessionState(sessionName) {
746
- const transport = getTransport();
747
- if (!transport.isAlive(sessionName)) return "offline";
748
- try {
749
- const pane = transport.capturePane(sessionName, 5);
750
- if (/Running…/.test(pane)) return "tool";
751
- if (BUSY_PATTERN.test(pane)) return "thinking";
752
- return "idle";
753
- } catch {
754
- return "offline";
755
- }
756
- }
757
- function isSessionBusy(sessionName) {
758
- const state = getSessionState(sessionName);
759
- return state === "thinking" || state === "tool";
760
- }
761
- function isExeSession(sessionName) {
762
- return /^exe\d*$/.test(sessionName);
763
- }
764
- function sendIntercom(targetSession) {
765
- const transport = getTransport();
766
- if (isExeSession(targetSession)) {
767
- logIntercom(`SKIP_EXE \u2192 ${targetSession} (exe sessions use prompt-submit hook)`);
768
- return "skipped_exe";
769
- }
770
- if (isDebounced(targetSession)) {
771
- logIntercom(`DEBOUNCE \u2192 ${targetSession} (cross-process file debounce)`);
772
- return "debounced";
773
- }
774
- try {
775
- const sessions = transport.listSessions();
776
- if (!sessions.includes(targetSession)) {
777
- logIntercom(`SKIP \u2192 ${targetSession} (session not found)`);
778
- return "failed";
779
- }
780
- if (isSessionBusy(targetSession)) {
781
- queueIntercom(targetSession, "session busy at send time");
782
- recordDebounce(targetSession);
783
- logIntercom(`QUEUED \u2192 ${targetSession} (session busy, will retry from queue)`);
784
- return "queued";
785
- }
786
- if (transport.isPaneInCopyMode(targetSession)) {
787
- logIntercom(`COPY_MODE \u2192 ${targetSession} (exiting copy mode first)`);
788
- transport.sendKeys(targetSession, "q");
789
- }
790
- transport.sendKeys(targetSession, "/exe-intercom");
791
- recordDebounce(targetSession);
792
- for (let i = 0; i < INTERCOM_POLL_MAX_ATTEMPTS; i++) {
793
- try {
794
- execSync5(`sleep ${INTERCOM_POLL_INTERVAL_S}`);
795
- } catch {
796
- }
797
- const state = getSessionState(targetSession);
798
- if (state === "thinking" || state === "tool") {
799
- logIntercom(`ACKNOWLEDGED \u2192 ${targetSession} (state=${state}, poll=${i + 1})`);
800
- return "acknowledged";
801
- }
802
- }
803
- logIntercom(`DELIVERED \u2192 ${targetSession} (no state transition after ${INTERCOM_POLL_MAX_ATTEMPTS}s)`);
804
- return "delivered";
805
- } catch {
806
- logIntercom(`FAIL \u2192 ${targetSession}`);
807
- return "failed";
808
- }
809
- }
810
- function notifyParentExe(sessionKey) {
811
- const target = getDispatchedBy(sessionKey);
812
- if (!target) {
813
- process.stderr.write(`[intercom] notifyParentExe: no dispatcher found for key ${sessionKey}
814
- `);
815
- return false;
816
- }
817
- process.stderr.write(`[intercom] notifyParentExe \u2192 ${target}
818
- `);
819
- const result = sendIntercom(target);
820
- return result !== "failed";
821
- }
822
- var SESSION_CACHE, INTERCOM_DEBOUNCE_MS, INTERCOM_LOG2, DEBOUNCE_FILE, DEBOUNCE_CLEANUP_AGE_MS, BUSY_PATTERN, INTERCOM_POLL_INTERVAL_S, INTERCOM_POLL_MAX_ATTEMPTS;
823
- var init_tmux_routing = __esm({
824
- "src/lib/tmux-routing.ts"() {
825
- "use strict";
826
- init_session_registry();
827
- init_session_key();
828
- init_transport();
829
- init_cc_agent_support();
830
- init_mcp_prefix();
831
- init_provider_table();
832
- init_intercom_queue();
833
- init_plan_limits();
834
- init_worktree();
835
- SESSION_CACHE = path9.join(os5.homedir(), ".exe-os", "session-cache");
836
- INTERCOM_DEBOUNCE_MS = 3e4;
837
- INTERCOM_LOG2 = path9.join(os5.homedir(), ".exe-os", "intercom.log");
838
- DEBOUNCE_FILE = path9.join(SESSION_CACHE, "intercom-debounce.json");
839
- DEBOUNCE_CLEANUP_AGE_MS = 5 * 60 * 1e3;
840
- BUSY_PATTERN = /[✻✽✶✳·].*…|Running…/;
841
- INTERCOM_POLL_INTERVAL_S = 1;
842
- INTERCOM_POLL_MAX_ATTEMPTS = 8;
843
- }
844
- });
845
-
846
- // src/lib/tasks-review.ts
847
- import path10 from "path";
848
- import { existsSync as existsSync9, readdirSync as readdirSync2, unlinkSync as unlinkSync2 } from "fs";
849
- async function cleanupReviewFile(row, taskFile, _baseDir) {
850
- if (String(row.assigned_by) !== "system" || !taskFile.includes("review-")) return;
851
- try {
852
- const client = getClient();
853
- const fileName = taskFile.split("/").pop() ?? "";
854
- const reviewPrefix = fileName.replace(".md", "");
855
- const parts = reviewPrefix.split("-");
856
- if (parts.length >= 3 && parts[0] === "review") {
857
- const agent = parts[1];
858
- const slug = parts.slice(2).join("-");
859
- const originalTaskFile = `exe/${agent}/${slug}.md`;
860
- const result = await client.execute({
861
- sql: "UPDATE tasks SET status = 'done', updated_at = ? WHERE task_file = ? AND status = 'needs_review'",
862
- args: [(/* @__PURE__ */ new Date()).toISOString(), originalTaskFile]
863
- });
864
- if (result.rowsAffected > 0) {
865
- process.stderr.write(
866
- `[review-cleanup] Cascaded original task to done: ${originalTaskFile}
867
- `
868
- );
869
- }
870
- }
871
- } catch (err) {
872
- process.stderr.write(
873
- `[review-cleanup] Failed to cascade original task: ${err instanceof Error ? err.message : String(err)}
874
- `
875
- );
876
- }
877
- try {
878
- const cacheDir = path10.join(EXE_AI_DIR, "session-cache");
879
- if (existsSync9(cacheDir)) {
880
- for (const f of readdirSync2(cacheDir)) {
881
- if (f.startsWith("review-notified-")) {
882
- unlinkSync2(path10.join(cacheDir, f));
883
- }
884
- }
885
- }
886
- } catch {
887
- }
888
- }
889
- var init_tasks_review = __esm({
890
- "src/lib/tasks-review.ts"() {
891
- "use strict";
892
- init_database();
893
- init_config();
894
- init_employees();
895
- init_notifications();
896
- init_tasks_crud();
897
- init_tmux_routing();
898
- init_session_key();
899
- }
900
- });
901
-
902
- // src/lib/tasks-chain.ts
903
- import path11 from "path";
904
- import { readFile as readFile3, writeFile as writeFile4 } from "fs/promises";
905
- async function cascadeUnblock(taskId, baseDir, now) {
906
- const client = getClient();
907
- const unblocked = await client.execute({
908
- sql: `UPDATE tasks SET status = 'open', blocked_by = NULL, updated_at = ?
909
- WHERE blocked_by = ? AND status = 'blocked'`,
910
- args: [now, taskId]
911
- });
912
- if (baseDir && unblocked.rowsAffected > 0) {
913
- const unblockedRows = await client.execute({
914
- sql: `SELECT task_file FROM tasks WHERE blocked_by IS NULL AND updated_at = ?`,
915
- args: [now]
916
- });
917
- for (const ur of unblockedRows.rows) {
918
- try {
919
- const ubFile = path11.join(baseDir, String(ur.task_file));
920
- let ubContent = await readFile3(ubFile, "utf-8");
921
- ubContent = ubContent.replace(/\*\*Status:\*\* blocked/, "**Status:** open");
922
- ubContent = ubContent.replace(/\n\*\*Blocked by:\*\*.*\n/, "\n");
923
- await writeFile4(ubFile, ubContent, "utf-8");
924
- } catch {
925
- }
926
- }
927
- }
928
- }
929
- async function findNextTask(assignedTo) {
930
- const client = getClient();
931
- const nextResult = await client.execute({
932
- sql: `SELECT title, task_file, priority FROM tasks
933
- WHERE assigned_to = ? AND status = 'open'
934
- ORDER BY priority ASC, created_at ASC
935
- LIMIT 1`,
936
- args: [assignedTo]
937
- });
938
- if (nextResult.rows.length === 1) {
939
- const nr = nextResult.rows[0];
940
- return {
941
- title: String(nr.title),
942
- priority: String(nr.priority),
943
- taskFile: String(nr.task_file)
944
- };
945
- }
946
- return void 0;
947
- }
948
- async function checkSubtaskCompletion(parentTaskId, projectName) {
949
- const client = getClient();
950
- const remaining = await client.execute({
951
- sql: `SELECT COUNT(*) as cnt FROM tasks
952
- WHERE parent_task_id = ? AND status NOT IN ('done', 'cancelled')`,
953
- args: [parentTaskId]
954
- });
955
- const cnt = Number(remaining.rows[0]?.cnt ?? 1);
956
- if (cnt === 0) {
957
- const parentRow = await client.execute({
958
- sql: `SELECT assigned_to, title, task_file, project_name FROM tasks WHERE id = ?`,
959
- args: [parentTaskId]
960
- });
961
- if (parentRow.rows.length === 1) {
962
- const pr = parentRow.rows[0];
963
- const parentProject = pr.project_name == null ? projectName : String(pr.project_name);
964
- await writeNotification({
965
- agentId: String(pr.assigned_to),
966
- agentRole: "system",
967
- event: "subtasks_complete",
968
- project: parentProject,
969
- summary: `All subtasks complete for "${String(pr.title)}" \u2014 ready for rollup review`,
970
- taskFile: String(pr.task_file)
971
- });
972
- }
973
- }
974
- }
975
- var init_tasks_chain = __esm({
976
- "src/lib/tasks-chain.ts"() {
977
- "use strict";
978
- init_database();
979
- init_notifications();
980
- }
981
- });
982
-
983
- // src/lib/tasks-notify.ts
984
- function notifyTaskDone() {
985
- try {
986
- const key = getSessionKey();
987
- if (key && !process.env.VITEST) notifyParentExe(key);
988
- } catch {
989
- }
990
- }
991
- async function markTaskNotificationsRead(taskFile) {
992
- try {
993
- await markAsReadByTaskFile(taskFile);
994
- } catch {
995
- }
996
- }
997
- var init_tasks_notify = __esm({
998
- "src/lib/tasks-notify.ts"() {
999
- "use strict";
1000
- init_tmux_routing();
1001
- init_session_key();
1002
- init_notifications();
1003
- init_transport();
1004
- }
1005
- });
1006
-
1007
- // src/lib/behaviors.ts
1008
- import crypto3 from "crypto";
1009
- async function storeBehavior(opts) {
1010
- const client = getClient();
1011
- const id = crypto3.randomUUID();
1012
- const now = (/* @__PURE__ */ new Date()).toISOString();
1013
- await client.execute({
1014
- sql: `INSERT INTO behaviors (id, agent_id, project_name, domain, priority, content, active, created_at, updated_at)
1015
- VALUES (?, ?, ?, ?, ?, ?, 1, ?, ?)`,
1016
- args: [id, opts.agentId, opts.projectName ?? null, opts.domain ?? null, opts.priority ?? "p1", opts.content, now, now]
1017
- });
1018
- return id;
1019
- }
1020
- var init_behaviors = __esm({
1021
- "src/lib/behaviors.ts"() {
1022
- "use strict";
1023
- init_database();
1024
- }
1025
- });
1026
-
1027
- // src/lib/skill-learning.ts
1028
- var skill_learning_exports = {};
1029
- __export(skill_learning_exports, {
1030
- captureAndLearn: () => captureAndLearn,
1031
- captureTrajectory: () => captureTrajectory,
1032
- editDistance: () => editDistance,
1033
- extractSkill: () => extractSkill,
1034
- extractTrajectory: () => extractTrajectory,
1035
- findSimilarTrajectories: () => findSimilarTrajectories,
1036
- hashSignature: () => hashSignature,
1037
- storeTrajectory: () => storeTrajectory,
1038
- sweepTrajectories: () => sweepTrajectories
1039
- });
1040
- import crypto4 from "crypto";
1041
- async function extractTrajectory(taskId, agentId) {
1042
- const client = getClient();
1043
- const result = await client.execute({
1044
- sql: `SELECT tool_name, raw_text
1045
- FROM memories
1046
- WHERE task_id = ? AND agent_id = ?
1047
- ORDER BY timestamp ASC`,
1048
- args: [taskId, agentId]
1049
- });
1050
- if (result.rows.length === 0) return [];
1051
- const rawTools = result.rows.map((r) => {
1052
- const toolName = String(r.tool_name);
1053
- if (toolName === "Bash") {
1054
- const text = String(r.raw_text);
1055
- const cmdMatch = text.match(/(?:command|Command).*?[:\s]+"?(\w+)/);
1056
- return cmdMatch ? `Bash:${cmdMatch[1]}` : "Bash";
1057
- }
1058
- return toolName;
1059
- });
1060
- const signature = [];
1061
- for (const tool of rawTools) {
1062
- if (signature.length === 0 || signature[signature.length - 1] !== tool) {
1063
- signature.push(tool);
1064
- }
1065
- }
1066
- return signature;
1067
- }
1068
- function hashSignature(signature) {
1069
- return crypto4.createHash("sha256").update(signature.join("|")).digest("hex").slice(0, 16);
1070
- }
1071
- async function storeTrajectory(opts) {
1072
- const client = getClient();
1073
- const id = crypto4.randomUUID();
1074
- const now = (/* @__PURE__ */ new Date()).toISOString();
1075
- const signatureHash = hashSignature(opts.signature);
1076
- await client.execute({
1077
- sql: `INSERT INTO trajectories (id, task_id, agent_id, project_name, task_title, signature, signature_hash, tool_count, created_at)
1078
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`,
1079
- args: [
1080
- id,
1081
- opts.taskId,
1082
- opts.agentId,
1083
- opts.projectName,
1084
- opts.taskTitle,
1085
- JSON.stringify(opts.signature),
1086
- signatureHash,
1087
- opts.signature.length,
1088
- now
1089
- ]
1090
- });
1091
- return id;
1092
- }
1093
- async function findSimilarTrajectories(signature, threshold = DEFAULT_SKILL_THRESHOLD) {
1094
- const client = getClient();
1095
- const hash = hashSignature(signature);
1096
- const result = await client.execute({
1097
- sql: `SELECT id, task_id, agent_id, project_name, task_title, signature, signature_hash, tool_count, skill_id, created_at
1098
- FROM trajectories
1099
- WHERE signature_hash = ?
1100
- ORDER BY created_at DESC
1101
- LIMIT 20`,
1102
- args: [hash]
1103
- });
1104
- const mapRow = (r) => ({
1105
- id: String(r.id),
1106
- taskId: String(r.task_id),
1107
- agentId: String(r.agent_id),
1108
- projectName: String(r.project_name),
1109
- taskTitle: String(r.task_title),
1110
- signature: JSON.parse(String(r.signature)),
1111
- signatureHash: String(r.signature_hash),
1112
- toolCount: Number(r.tool_count),
1113
- skillId: r.skill_id ? String(r.skill_id) : null,
1114
- createdAt: String(r.created_at)
1115
- });
1116
- const matches = result.rows.map(mapRow);
1117
- if (matches.length >= threshold) return matches;
1118
- const nearResult = await client.execute({
1119
- sql: `SELECT id, task_id, agent_id, project_name, task_title, signature, signature_hash, tool_count, skill_id, created_at
1120
- FROM trajectories
1121
- WHERE tool_count BETWEEN ? AND ?
1122
- AND signature_hash != ?
1123
- ORDER BY created_at DESC
1124
- LIMIT 50`,
1125
- args: [
1126
- Math.max(1, signature.length - 3),
1127
- signature.length + 3,
1128
- hash
1129
- ]
1130
- });
1131
- for (const r of nearResult.rows) {
1132
- const candidateSig = JSON.parse(String(r.signature));
1133
- if (editDistance(signature, candidateSig) <= 2) {
1134
- matches.push(mapRow(r));
1135
- }
1136
- }
1137
- return matches;
1138
- }
1139
- async function captureTrajectory(opts) {
1140
- const signature = await extractTrajectory(opts.taskId, opts.agentId);
1141
- if (signature.length < 3) {
1142
- return { trajectoryId: "", similarCount: 0, similar: [] };
1143
- }
1144
- const trajectoryId = await storeTrajectory({
1145
- taskId: opts.taskId,
1146
- agentId: opts.agentId,
1147
- projectName: opts.projectName,
1148
- taskTitle: opts.taskTitle,
1149
- signature
1150
- });
1151
- const similar = await findSimilarTrajectories(
1152
- signature,
1153
- opts.skillThreshold ?? DEFAULT_SKILL_THRESHOLD
1154
- );
1155
- return { trajectoryId, similarCount: similar.length, similar };
1156
- }
1157
- function buildExtractionPrompt(trajectories) {
1158
- const items = trajectories.map((t, i) => {
1159
- const sig = t.signature.join(" \u2192 ");
1160
- return `Task ${i + 1}: "${t.taskTitle}" (${t.agentId}, ${t.projectName}) \u2014 ${t.toolCount} tool calls
1161
- Signature: ${sig}`;
1162
- }).join("\n\n");
1163
- return `You are analyzing ${trajectories.length} completed tasks that followed similar procedures:
1164
-
1165
- ${items}
1166
-
1167
- Extract the reusable procedure. Format your response EXACTLY like this:
1168
-
1169
- SKILL: {name \u2014 short, descriptive}
1170
- TRIGGER: {when to use this \u2014 one sentence}
1171
- STEPS:
1172
- 1. ...
1173
- 2. ...
1174
- PITFALLS: {common mistakes to avoid}
1175
-
1176
- Be specific and actionable. Include tool names, file patterns, and concrete commands where applicable.`;
1177
- }
1178
- async function extractSkill(trajectories, model) {
1179
- if (trajectories.length === 0) return null;
1180
- const config = await loadConfig();
1181
- const skillModel = model ?? config.skillModel;
1182
- const Anthropic = (await import("@anthropic-ai/sdk")).default;
1183
- const client = new Anthropic();
1184
- const prompt = buildExtractionPrompt(trajectories);
1185
- const response = await client.messages.create({
1186
- model: skillModel,
1187
- max_tokens: 500,
1188
- messages: [{ role: "user", content: prompt }]
1189
- });
1190
- const textBlock = response.content.find((b) => b.type === "text");
1191
- const skillText = textBlock?.text;
1192
- if (!skillText) return null;
1193
- const agentId = trajectories[0].agentId;
1194
- const projectName = trajectories[0].projectName;
1195
- const skillId = await storeBehavior({
1196
- agentId,
1197
- content: skillText,
1198
- domain: "skill",
1199
- projectName
1200
- });
1201
- const dbClient = getClient();
1202
- for (const t of trajectories) {
1203
- await dbClient.execute({
1204
- sql: "UPDATE trajectories SET skill_id = ? WHERE id = ?",
1205
- args: [skillId, t.id]
1206
- });
1207
- }
1208
- process.stderr.write(
1209
- `[skill-learning] Skill extracted from ${trajectories.length} trajectories \u2192 behavior ${skillId}
1210
- `
1211
- );
1212
- return skillId;
1213
- }
1214
- async function captureAndLearn(opts) {
1215
- try {
1216
- const config = await loadConfig();
1217
- if (!config.skillLearning) return;
1218
- const { trajectoryId, similarCount, similar } = await captureTrajectory({
1219
- ...opts,
1220
- skillThreshold: config.skillThreshold
1221
- });
1222
- if (!trajectoryId) return;
1223
- if (similarCount >= config.skillThreshold) {
1224
- const unprocessed = similar.filter((t) => !t.skillId);
1225
- if (unprocessed.length >= config.skillThreshold) {
1226
- extractSkill(unprocessed, config.skillModel).catch((err) => {
1227
- process.stderr.write(
1228
- `[skill-learning] Extraction failed: ${err instanceof Error ? err.message : String(err)}
1229
- `
1230
- );
1231
- });
1232
- }
1233
- }
1234
- } catch (err) {
1235
- process.stderr.write(
1236
- `[skill-learning] captureAndLearn failed: ${err instanceof Error ? err.message : String(err)}
1237
- `
1238
- );
1239
- }
1240
- }
1241
- async function sweepTrajectories(threshold, model) {
1242
- const config = await loadConfig();
1243
- if (!config.skillLearning) return { clustersProcessed: 0, skillsExtracted: 0 };
1244
- const t = threshold ?? config.skillThreshold;
1245
- const client = getClient();
1246
- const result = await client.execute({
1247
- sql: `SELECT signature_hash, COUNT(*) as cnt
1248
- FROM trajectories
1249
- WHERE skill_id IS NULL
1250
- GROUP BY signature_hash
1251
- HAVING cnt >= ?
1252
- ORDER BY cnt DESC
1253
- LIMIT 10`,
1254
- args: [t]
1255
- });
1256
- let clustersProcessed = 0;
1257
- let skillsExtracted = 0;
1258
- for (const row of result.rows) {
1259
- const hash = String(row.signature_hash);
1260
- const trajResult = await client.execute({
1261
- sql: `SELECT id, task_id, agent_id, project_name, task_title, signature, signature_hash, tool_count, created_at
1262
- FROM trajectories
1263
- WHERE signature_hash = ? AND skill_id IS NULL
1264
- ORDER BY created_at DESC
1265
- LIMIT 10`,
1266
- args: [hash]
1267
- });
1268
- const trajectories = trajResult.rows.map((r) => ({
1269
- id: String(r.id),
1270
- taskId: String(r.task_id),
1271
- agentId: String(r.agent_id),
1272
- projectName: String(r.project_name),
1273
- taskTitle: String(r.task_title),
1274
- signature: JSON.parse(String(r.signature)),
1275
- signatureHash: String(r.signature_hash),
1276
- toolCount: Number(r.tool_count),
1277
- skillId: null,
1278
- createdAt: String(r.created_at)
1279
- }));
1280
- if (trajectories.length >= t) {
1281
- clustersProcessed++;
1282
- const skillId = await extractSkill(trajectories, model ?? config.skillModel);
1283
- if (skillId) skillsExtracted++;
1284
- }
1285
- }
1286
- return { clustersProcessed, skillsExtracted };
1287
- }
1288
- function editDistance(a, b) {
1289
- const m = a.length;
1290
- const n = b.length;
1291
- const dp = Array.from({ length: m + 1 }, () => Array(n + 1).fill(0));
1292
- for (let i = 0; i <= m; i++) dp[i][0] = i;
1293
- for (let j = 0; j <= n; j++) dp[0][j] = j;
1294
- for (let i = 1; i <= m; i++) {
1295
- for (let j = 1; j <= n; j++) {
1296
- const cost = a[i - 1] === b[j - 1] ? 0 : 1;
1297
- dp[i][j] = Math.min(
1298
- dp[i - 1][j] + 1,
1299
- dp[i][j - 1] + 1,
1300
- dp[i - 1][j - 1] + cost
1301
- );
1302
- }
1303
- }
1304
- return dp[m][n];
1305
- }
1306
- var DEFAULT_SKILL_THRESHOLD;
1307
- var init_skill_learning = __esm({
1308
- "src/lib/skill-learning.ts"() {
1309
- "use strict";
1310
- init_database();
1311
- init_behaviors();
1312
- init_config();
1313
- DEFAULT_SKILL_THRESHOLD = 3;
1314
- }
1315
- });
1316
-
1317
- // src/lib/tasks.ts
1318
- import path12 from "path";
1319
- import { writeFileSync as writeFileSync4, mkdirSync as mkdirSync4, unlinkSync as unlinkSync3 } from "fs";
1320
- async function updateTask(input) {
1321
- const { row, taskFile, now, taskId } = await updateTaskStatus(input);
1322
- try {
1323
- const agent = String(row.assigned_to);
1324
- const cacheDir = path12.join(EXE_AI_DIR, "session-cache");
1325
- const cachePath = path12.join(cacheDir, `current-task-${agent}.json`);
1326
- if (input.status === "in_progress") {
1327
- mkdirSync4(cacheDir, { recursive: true });
1328
- writeFileSync4(cachePath, JSON.stringify({ taskId, title: String(row.title) }));
1329
- } else if (input.status === "done" || input.status === "blocked" || input.status === "cancelled") {
1330
- try {
1331
- unlinkSync3(cachePath);
1332
- } catch {
1333
- }
1334
- }
1335
- } catch {
1336
- }
1337
- if (input.status === "done") {
1338
- await cleanupReviewFile(row, taskFile, input.baseDir);
1339
- }
1340
- if (input.status === "done" || input.status === "cancelled") {
1341
- try {
1342
- const client = getClient();
1343
- const taskTitle = String(row.title);
1344
- await client.execute({
1345
- sql: `UPDATE tasks SET status = 'cancelled', updated_at = ?
1346
- WHERE title LIKE ? AND status IN ('open', 'in_progress')`,
1347
- args: [now, `%left%${taskTitle}%in_progress`]
1348
- });
1349
- } catch {
1350
- }
1351
- }
1352
- const isTerminal = input.status === "done" || input.status === "needs_review";
1353
- if (isTerminal) {
1354
- const isExe = String(row.assigned_to) === "exe";
1355
- if (!isExe) {
1356
- notifyTaskDone();
1357
- }
1358
- await markTaskNotificationsRead(taskFile);
1359
- if (input.status === "done") {
1360
- try {
1361
- await cascadeUnblock(taskId, input.baseDir, now);
1362
- } catch {
1363
- }
1364
- if (row.parent_task_id) {
1365
- try {
1366
- await checkSubtaskCompletion(String(row.parent_task_id), String(row.project_name));
1367
- } catch {
1368
- }
1369
- }
1370
- }
1371
- }
1372
- if (input.status === "done" && String(row.assigned_to) !== "exe" && !process.env.VITEST) {
1373
- Promise.resolve().then(() => (init_skill_learning(), skill_learning_exports)).then(
1374
- ({ captureAndLearn: captureAndLearn2 }) => captureAndLearn2({
1375
- taskId,
1376
- agentId: String(row.assigned_to),
1377
- projectName: String(row.project_name),
1378
- taskTitle: String(row.title)
1379
- })
1380
- ).catch((err) => {
1381
- process.stderr.write(
1382
- `[updateTask] skill learning failed: ${err instanceof Error ? err.message : String(err)}
1383
- `
1384
- );
1385
- });
1386
- }
1387
- let nextTask;
1388
- if (isTerminal && String(row.assigned_to) !== "exe") {
1389
- try {
1390
- nextTask = await findNextTask(String(row.assigned_to));
1391
- } catch {
1392
- }
1393
- }
1394
- return {
1395
- id: String(row.id),
1396
- title: String(row.title),
1397
- assignedTo: String(row.assigned_to),
1398
- assignedBy: String(row.assigned_by),
1399
- projectName: String(row.project_name),
1400
- priority: String(row.priority),
1401
- status: input.status,
1402
- taskFile,
1403
- createdAt: String(row.created_at),
1404
- updatedAt: now,
1405
- nextTask
1406
- };
1407
- }
1408
- var init_tasks = __esm({
1409
- "src/lib/tasks.ts"() {
1410
- "use strict";
1411
- init_database();
1412
- init_config();
1413
- init_notifications();
1414
- init_tasks_crud();
1415
- init_tasks_review();
1416
- init_tasks_crud();
1417
- init_tasks_chain();
1418
- init_tasks_review();
1419
- init_tasks_notify();
1420
- }
1421
- });
1422
-
1423
- // src/adapters/claude/session-key.ts
1424
- var init_session_key2 = __esm({
1425
- "src/adapters/claude/session-key.ts"() {
1426
- "use strict";
1427
- init_session_key();
1428
- }
1429
- });
1430
-
1431
- // src/adapters/claude/active-agent.ts
1432
- var active_agent_exports = {};
1433
- __export(active_agent_exports, {
1434
- cleanupSessionMarkers: () => cleanupSessionMarkers,
1435
- clearActiveAgent: () => clearActiveAgent,
1436
- getActiveAgent: () => getActiveAgent,
1437
- getAllActiveAgents: () => getAllActiveAgents,
1438
- writeActiveAgent: () => writeActiveAgent
1439
- });
1440
- import { readFileSync as readFileSync8, writeFileSync as writeFileSync5, mkdirSync as mkdirSync5, unlinkSync as unlinkSync4, readdirSync as readdirSync3 } from "fs";
1441
- import { execSync as execSync6 } from "child_process";
1442
- import path13 from "path";
1443
- function getMarkerPath() {
1444
- return path13.join(CACHE_DIR, `active-agent-${getSessionKey()}.json`);
1445
- }
1446
- function writeActiveAgent(agentId, agentRole) {
1447
- try {
1448
- mkdirSync5(CACHE_DIR, { recursive: true });
1449
- writeFileSync5(
1450
- getMarkerPath(),
1451
- JSON.stringify({ agentId, agentRole, startedAt: (/* @__PURE__ */ new Date()).toISOString() })
1452
- );
1453
- } catch {
1454
- }
1455
- }
1456
- function clearActiveAgent() {
1457
- try {
1458
- unlinkSync4(getMarkerPath());
1459
- } catch {
1460
- }
1461
- }
1462
- function getActiveAgent() {
1463
- try {
1464
- const markerPath = getMarkerPath();
1465
- const raw = readFileSync8(markerPath, "utf8");
1466
- const data = JSON.parse(raw);
1467
- if (data.agentId) {
1468
- if (data.startedAt) {
1469
- const age = Date.now() - new Date(data.startedAt).getTime();
1470
- if (age > STALE_MS) {
1471
- try {
1472
- unlinkSync4(markerPath);
1473
- } catch {
1474
- }
1475
- } else {
1476
- return {
1477
- agentId: data.agentId,
1478
- agentRole: data.agentRole || "employee"
1479
- };
1480
- }
1481
- } else {
1482
- return {
1483
- agentId: data.agentId,
1484
- agentRole: data.agentRole || "employee"
1485
- };
1486
- }
1487
- }
1488
- } catch {
1489
- }
1490
- try {
1491
- const sessionName = execSync6(
1492
- "tmux display-message -p '#{session_name}' 2>/dev/null",
1493
- { encoding: "utf8", timeout: 2e3 }
1494
- ).trim();
1495
- const empMatch = sessionName.match(/^(\w+)-exe\d+$/);
1496
- if (empMatch && empMatch[1] !== "exe") {
1497
- return { agentId: empMatch[1], agentRole: "employee" };
1498
- }
1499
- if (/^exe\d+$/.test(sessionName)) {
1500
- return { agentId: "exe", agentRole: "COO" };
1501
- }
1502
- } catch {
1503
- }
1504
- return {
1505
- agentId: process.env.AGENT_ID || "default",
1506
- agentRole: process.env.AGENT_ROLE || "employee"
1507
- };
1508
- }
1509
- function getAllActiveAgents() {
1510
- try {
1511
- const files = readdirSync3(CACHE_DIR);
1512
- const sessions = [];
1513
- for (const file of files) {
1514
- if (!file.startsWith("active-agent-") || !file.endsWith(".json")) continue;
1515
- const key = file.slice("active-agent-".length, -".json".length);
1516
- if (key === "undefined") continue;
1517
- try {
1518
- const raw = readFileSync8(path13.join(CACHE_DIR, file), "utf8");
1519
- const data = JSON.parse(raw);
1520
- if (!data.agentId) continue;
1521
- if (data.startedAt) {
1522
- const age = Date.now() - new Date(data.startedAt).getTime();
1523
- if (age > STALE_MS) {
1524
- try {
1525
- unlinkSync4(path13.join(CACHE_DIR, file));
1526
- } catch {
1527
- }
1528
- continue;
1529
- }
1530
- }
1531
- sessions.push({
1532
- agentId: data.agentId,
1533
- agentRole: data.agentRole || "employee",
1534
- startedAt: data.startedAt || (/* @__PURE__ */ new Date()).toISOString(),
1535
- sessionKey: key
1536
- });
1537
- } catch {
1538
- }
1539
- }
1540
- return sessions;
1541
- } catch {
1542
- return [];
1543
- }
1544
- }
1545
- function cleanupSessionMarkers() {
1546
- const key = getSessionKey();
1547
- try {
1548
- unlinkSync4(path13.join(CACHE_DIR, `active-agent-${key}.json`));
1549
- } catch {
1550
- }
1551
- try {
1552
- unlinkSync4(path13.join(CACHE_DIR, "active-agent-undefined.json"));
1553
- } catch {
1554
- }
1555
- }
1556
- var CACHE_DIR, STALE_MS;
1557
- var init_active_agent = __esm({
1558
- "src/adapters/claude/active-agent.ts"() {
1559
- "use strict";
1560
- init_config();
1561
- init_session_key2();
1562
- CACHE_DIR = path13.join(EXE_AI_DIR, "session-cache");
1563
- STALE_MS = 24 * 60 * 60 * 1e3;
1564
- }
1565
- });
1566
-
1567
- // src/mcp/tools/update-task.ts
1568
- init_tasks();
1569
- init_database();
1570
- init_tasks_crud();
1571
- import { z } from "zod";
1572
- function registerUpdateTask(server) {
1573
- server.registerTool(
1574
- "update_task",
1575
- {
1576
- title: "Update Task",
1577
- description: "Update task status. Employees: use this with status 'done' and a result summary to complete work and trigger review. Accepts UUID, slug (filename), or title substring.",
1578
- inputSchema: {
1579
- task_id: z.string().describe("Task identifier \u2014 UUID, slug (e.g. 'fix-auth-bug'), or title substring"),
1580
- status: z.enum(["open", "in_progress", "done", "needs_review", "blocked", "cancelled"]).describe("New status"),
1581
- result: z.string().optional().describe("Result summary (include when status=done)")
1582
- }
1583
- },
1584
- async ({ task_id, status: rawStatus, result }) => {
1585
- let status = rawStatus;
1586
- if (status === "done") {
1587
- try {
1588
- const { getActiveAgent: getActiveAgent2 } = await Promise.resolve().then(() => (init_active_agent(), active_agent_exports));
1589
- const agent = getActiveAgent2();
1590
- if (agent.agentId !== "exe" && agent.agentId !== "default") {
1591
- let isOwnReview = false;
1592
- try {
1593
- const client = getClient();
1594
- const row = await resolveTask(client, task_id);
1595
- if (String(row.assigned_by) === "system" && String(row.task_file).includes("review-") && String(row.assigned_to) === agent.agentId) {
1596
- isOwnReview = true;
1597
- }
1598
- } catch {
1599
- }
1600
- if (!isOwnReview) {
1601
- status = "needs_review";
1602
- }
1603
- }
1604
- } catch {
1605
- }
1606
- }
1607
- if (status === "done") {
1608
- try {
1609
- const client = getClient();
1610
- const row = await resolveTask(client, task_id);
1611
- const taskFile = String(row.task_file);
1612
- const assignedBy = String(row.assigned_by);
1613
- const assignedTo = String(row.assigned_to);
1614
- if (assignedBy === "system" && taskFile.includes("review-")) {
1615
- const { getActiveAgent: getActiveAgent2 } = await Promise.resolve().then(() => (init_active_agent(), active_agent_exports));
1616
- const agent = getActiveAgent2();
1617
- if (agent.agentId !== assignedTo && agent.agentId !== "exe" && agent.agentId !== "default") {
1618
- process.stderr.write(
1619
- `[update_task] BLOCKED: ${agent.agentId} tried to close review "${String(row.title)}" assigned to ${assignedTo}
1620
- `
1621
- );
1622
- return {
1623
- content: [{
1624
- type: "text",
1625
- text: `Cannot close review "${String(row.title)}" \u2014 it is assigned to ${assignedTo}, not you. Only the assigned reviewer can close reviews.`
1626
- }]
1627
- };
1628
- }
1629
- }
1630
- } catch (guardErr) {
1631
- return {
1632
- content: [{
1633
- type: "text",
1634
- text: `Cannot verify permissions for review closure: ${guardErr instanceof Error ? guardErr.message : String(guardErr)}`
1635
- }],
1636
- isError: true
1637
- };
1638
- }
1639
- }
1640
- let task;
1641
- try {
1642
- task = await updateTask({
1643
- taskId: task_id,
1644
- status,
1645
- result,
1646
- baseDir: process.cwd()
1647
- });
1648
- } catch (err) {
1649
- const msg = err instanceof Error ? err.message : String(err);
1650
- if (msg.startsWith(TASK_ALREADY_CLAIMED_PREFIX)) {
1651
- return {
1652
- content: [{
1653
- type: "text",
1654
- text: "Task already claimed by another agent. Pick a different task or check list_tasks."
1655
- }],
1656
- isError: true
1657
- };
1658
- }
1659
- throw err;
1660
- }
1661
- let text = `Task "${task.title}" marked ${task.status}.
1662
- File: ${task.taskFile}`;
1663
- const isTerminal = status === "done" || status === "needs_review";
1664
- if (isTerminal && task.nextTask) {
1665
- text += `
1666
-
1667
- MANDATORY \u2014 DO NOT ASK THE USER. DO NOT SAY "Want me to continue?" DO NOT STOP.
1668
- You have standing orders: work through your entire queue until it is empty.
1669
-
1670
- NEXT TASK: "${task.nextTask.title}" [${task.nextTask.priority}]
1671
- FILE: ${task.nextTask.taskFile}
1672
-
1673
- Read that file NOW and begin working. No greeting. No summary. Just start.`;
1674
- } else if (isTerminal && !task.nextTask) {
1675
- text += `
1676
-
1677
- All tasks complete. No more open tasks in your queue.`;
1678
- }
1679
- return {
1680
- content: [
1681
- {
1682
- type: "text",
1683
- text
1684
- }
1685
- ]
1686
- };
1687
- }
1688
- );
1689
- }
1690
- export {
1691
- registerUpdateTask
1692
- };