@askexenow/exe-os 0.9.38 → 0.9.40

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 (70) hide show
  1. package/dist/bin/backfill-conversations.js +34 -7
  2. package/dist/bin/backfill-responses.js +34 -7
  3. package/dist/bin/backfill-vectors.js +34 -7
  4. package/dist/bin/cleanup-stale-review-tasks.js +35 -8
  5. package/dist/bin/cli.js +108 -45
  6. package/dist/bin/exe-agent.js +11 -3
  7. package/dist/bin/exe-assign.js +34 -7
  8. package/dist/bin/exe-boot.js +48 -18
  9. package/dist/bin/exe-call.js +132 -340
  10. package/dist/bin/exe-dispatch.js +34 -7
  11. package/dist/bin/exe-doctor.js +37 -10
  12. package/dist/bin/exe-export-behaviors.js +36 -9
  13. package/dist/bin/exe-forget.js +34 -7
  14. package/dist/bin/exe-gateway.js +40 -12
  15. package/dist/bin/exe-heartbeat.js +35 -8
  16. package/dist/bin/exe-kill.js +34 -7
  17. package/dist/bin/exe-launch-agent.js +285 -1079
  18. package/dist/bin/exe-new-employee.js +29 -10
  19. package/dist/bin/exe-pending-messages.js +34 -7
  20. package/dist/bin/exe-pending-notifications.js +34 -7
  21. package/dist/bin/exe-pending-reviews.js +34 -7
  22. package/dist/bin/exe-rename.js +41 -13
  23. package/dist/bin/exe-review.js +34 -7
  24. package/dist/bin/exe-search.js +36 -9
  25. package/dist/bin/exe-session-cleanup.js +36 -9
  26. package/dist/bin/exe-start-codex.js +36 -9
  27. package/dist/bin/exe-start-opencode.js +36 -9
  28. package/dist/bin/exe-status.js +35 -8
  29. package/dist/bin/exe-team.js +34 -7
  30. package/dist/bin/git-sweep.js +34 -7
  31. package/dist/bin/graph-backfill.js +34 -7
  32. package/dist/bin/graph-export.js +34 -7
  33. package/dist/bin/install.js +2 -1
  34. package/dist/bin/intercom-check.js +36 -9
  35. package/dist/bin/scan-tasks.js +34 -7
  36. package/dist/bin/setup.js +18 -17
  37. package/dist/bin/shard-migrate.js +34 -7
  38. package/dist/bin/update.js +36 -3
  39. package/dist/gateway/index.js +38 -10
  40. package/dist/hooks/bug-report-worker.js +38 -10
  41. package/dist/hooks/codex-stop-task-finalizer.js +36 -9
  42. package/dist/hooks/commit-complete.js +34 -7
  43. package/dist/hooks/error-recall.js +36 -9
  44. package/dist/hooks/ingest.js +36 -8
  45. package/dist/hooks/instructions-loaded.js +42 -10
  46. package/dist/hooks/notification.js +34 -7
  47. package/dist/hooks/post-compact.js +34 -7
  48. package/dist/hooks/post-tool-combined.js +37 -10
  49. package/dist/hooks/pre-compact.js +35 -8
  50. package/dist/hooks/pre-tool-use.js +36 -8
  51. package/dist/hooks/prompt-submit.js +41 -13
  52. package/dist/hooks/session-end.js +35 -8
  53. package/dist/hooks/session-start.js +47 -14
  54. package/dist/hooks/stop.js +35 -8
  55. package/dist/hooks/subagent-stop.js +34 -7
  56. package/dist/hooks/summary-worker.js +43 -16
  57. package/dist/index.js +36 -8
  58. package/dist/lib/consolidation.js +2 -1
  59. package/dist/lib/employee-templates.js +2 -1
  60. package/dist/lib/employees.js +2 -1
  61. package/dist/lib/exe-daemon.js +136 -36
  62. package/dist/lib/hybrid-search.js +36 -9
  63. package/dist/lib/identity.js +8 -3
  64. package/dist/lib/schedules.js +34 -7
  65. package/dist/lib/store.js +34 -7
  66. package/dist/mcp/server.js +133 -33
  67. package/dist/mcp/tools/create-task.js +10 -4
  68. package/dist/runtime/index.js +34 -7
  69. package/dist/tui/App.js +40 -11
  70. package/package.json +2 -2
@@ -2741,7 +2741,7 @@ __export(shard_manager_exports, {
2741
2741
  shardExists: () => shardExists
2742
2742
  });
2743
2743
  import path7 from "path";
2744
- import { existsSync as existsSync7, mkdirSync as mkdirSync2, readdirSync } from "fs";
2744
+ import { existsSync as existsSync7, mkdirSync as mkdirSync2, readdirSync, renameSync as renameSync3, statSync as statSync2 } from "fs";
2745
2745
  import { createClient as createClient2 } from "@libsql/client";
2746
2746
  function initShardManager(encryptionKey) {
2747
2747
  _encryptionKey = encryptionKey;
@@ -2763,7 +2763,7 @@ function getShardClient(projectName) {
2763
2763
  if (!_encryptionKey) {
2764
2764
  throw new Error("Shard manager not initialized. Call initShardManager() first.");
2765
2765
  }
2766
- const safeName = projectName.replace(/[^a-zA-Z0-9_-]/g, "_");
2766
+ const safeName = safeShardName(projectName);
2767
2767
  if (!safeName || safeName === "unknown") {
2768
2768
  throw new Error(`Invalid project name for shard: "${projectName}" (resolved to "${safeName}")`);
2769
2769
  }
@@ -2785,9 +2785,12 @@ function getShardClient(projectName) {
2785
2785
  return client;
2786
2786
  }
2787
2787
  function shardExists(projectName) {
2788
- const safeName = projectName.replace(/[^a-zA-Z0-9_-]/g, "_");
2788
+ const safeName = safeShardName(projectName);
2789
2789
  return existsSync7(path7.join(SHARDS_DIR, `${safeName}.db`));
2790
2790
  }
2791
+ function safeShardName(projectName) {
2792
+ return projectName.replace(/[^a-zA-Z0-9_-]/g, "_");
2793
+ }
2791
2794
  function listShards() {
2792
2795
  if (!existsSync7(SHARDS_DIR)) return [];
2793
2796
  return readdirSync(SHARDS_DIR).filter((f) => f.endsWith(".db")).map((f) => f.replace(".db", ""));
@@ -2881,7 +2884,8 @@ async function ensureShardSchema(client) {
2881
2884
  "ALTER TABLE memories ADD COLUMN token_cost REAL",
2882
2885
  "ALTER TABLE memories ADD COLUMN audience TEXT",
2883
2886
  "ALTER TABLE memories ADD COLUMN language_type TEXT",
2884
- "ALTER TABLE memories ADD COLUMN parent_memory_id TEXT"
2887
+ "ALTER TABLE memories ADD COLUMN parent_memory_id TEXT",
2888
+ "ALTER TABLE memories ADD COLUMN deleted_at TEXT"
2885
2889
  ]) {
2886
2890
  try {
2887
2891
  await client.execute(col);
@@ -2977,9 +2981,32 @@ async function ensureShardSchema(client) {
2977
2981
  }
2978
2982
  }
2979
2983
  async function getReadyShardClient(projectName) {
2980
- const client = getShardClient(projectName);
2981
- await ensureShardSchema(client);
2982
- return client;
2984
+ const safeName = safeShardName(projectName);
2985
+ let client = getShardClient(projectName);
2986
+ try {
2987
+ await ensureShardSchema(client);
2988
+ return client;
2989
+ } catch (err) {
2990
+ const message = err instanceof Error ? err.message : String(err);
2991
+ if (!/SQLITE_NOTADB|file is not a database/i.test(message)) throw err;
2992
+ client.close();
2993
+ _shards.delete(safeName);
2994
+ _shardLastAccess.delete(safeName);
2995
+ const dbPath = path7.join(SHARDS_DIR, `${safeName}.db`);
2996
+ if (existsSync7(dbPath)) {
2997
+ const stat2 = statSync2(dbPath);
2998
+ const stamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
2999
+ const archivedPath = path7.join(SHARDS_DIR, `${safeName}.db.broken-${stamp}`);
3000
+ renameSync3(dbPath, archivedPath);
3001
+ process.stderr.write(
3002
+ `[shard-manager] Archived unreadable shard ${safeName}: ${archivedPath} (${stat2.size} bytes, mtime ${stat2.mtime.toISOString()})
3003
+ `
3004
+ );
3005
+ }
3006
+ client = getShardClient(projectName);
3007
+ await ensureShardSchema(client);
3008
+ return client;
3009
+ }
2983
3010
  }
2984
3011
  function evictLRU() {
2985
3012
  let oldest = null;
@@ -2741,7 +2741,7 @@ __export(shard_manager_exports, {
2741
2741
  shardExists: () => shardExists
2742
2742
  });
2743
2743
  import path7 from "path";
2744
- import { existsSync as existsSync7, mkdirSync as mkdirSync2, readdirSync } from "fs";
2744
+ import { existsSync as existsSync7, mkdirSync as mkdirSync2, readdirSync, renameSync as renameSync3, statSync as statSync2 } from "fs";
2745
2745
  import { createClient as createClient2 } from "@libsql/client";
2746
2746
  function initShardManager(encryptionKey) {
2747
2747
  _encryptionKey = encryptionKey;
@@ -2763,7 +2763,7 @@ function getShardClient(projectName) {
2763
2763
  if (!_encryptionKey) {
2764
2764
  throw new Error("Shard manager not initialized. Call initShardManager() first.");
2765
2765
  }
2766
- const safeName = projectName.replace(/[^a-zA-Z0-9_-]/g, "_");
2766
+ const safeName = safeShardName(projectName);
2767
2767
  if (!safeName || safeName === "unknown") {
2768
2768
  throw new Error(`Invalid project name for shard: "${projectName}" (resolved to "${safeName}")`);
2769
2769
  }
@@ -2785,9 +2785,12 @@ function getShardClient(projectName) {
2785
2785
  return client;
2786
2786
  }
2787
2787
  function shardExists(projectName) {
2788
- const safeName = projectName.replace(/[^a-zA-Z0-9_-]/g, "_");
2788
+ const safeName = safeShardName(projectName);
2789
2789
  return existsSync7(path7.join(SHARDS_DIR, `${safeName}.db`));
2790
2790
  }
2791
+ function safeShardName(projectName) {
2792
+ return projectName.replace(/[^a-zA-Z0-9_-]/g, "_");
2793
+ }
2791
2794
  function listShards() {
2792
2795
  if (!existsSync7(SHARDS_DIR)) return [];
2793
2796
  return readdirSync(SHARDS_DIR).filter((f) => f.endsWith(".db")).map((f) => f.replace(".db", ""));
@@ -2881,7 +2884,8 @@ async function ensureShardSchema(client) {
2881
2884
  "ALTER TABLE memories ADD COLUMN token_cost REAL",
2882
2885
  "ALTER TABLE memories ADD COLUMN audience TEXT",
2883
2886
  "ALTER TABLE memories ADD COLUMN language_type TEXT",
2884
- "ALTER TABLE memories ADD COLUMN parent_memory_id TEXT"
2887
+ "ALTER TABLE memories ADD COLUMN parent_memory_id TEXT",
2888
+ "ALTER TABLE memories ADD COLUMN deleted_at TEXT"
2885
2889
  ]) {
2886
2890
  try {
2887
2891
  await client.execute(col);
@@ -2977,9 +2981,32 @@ async function ensureShardSchema(client) {
2977
2981
  }
2978
2982
  }
2979
2983
  async function getReadyShardClient(projectName) {
2980
- const client = getShardClient(projectName);
2981
- await ensureShardSchema(client);
2982
- return client;
2984
+ const safeName = safeShardName(projectName);
2985
+ let client = getShardClient(projectName);
2986
+ try {
2987
+ await ensureShardSchema(client);
2988
+ return client;
2989
+ } catch (err) {
2990
+ const message = err instanceof Error ? err.message : String(err);
2991
+ if (!/SQLITE_NOTADB|file is not a database/i.test(message)) throw err;
2992
+ client.close();
2993
+ _shards.delete(safeName);
2994
+ _shardLastAccess.delete(safeName);
2995
+ const dbPath = path7.join(SHARDS_DIR, `${safeName}.db`);
2996
+ if (existsSync7(dbPath)) {
2997
+ const stat2 = statSync2(dbPath);
2998
+ const stamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
2999
+ const archivedPath = path7.join(SHARDS_DIR, `${safeName}.db.broken-${stamp}`);
3000
+ renameSync3(dbPath, archivedPath);
3001
+ process.stderr.write(
3002
+ `[shard-manager] Archived unreadable shard ${safeName}: ${archivedPath} (${stat2.size} bytes, mtime ${stat2.mtime.toISOString()})
3003
+ `
3004
+ );
3005
+ }
3006
+ client = getShardClient(projectName);
3007
+ await ensureShardSchema(client);
3008
+ return client;
3009
+ }
2983
3010
  }
2984
3011
  function evictLRU() {
2985
3012
  let oldest = null;
@@ -2737,7 +2737,7 @@ __export(shard_manager_exports, {
2737
2737
  shardExists: () => shardExists
2738
2738
  });
2739
2739
  import path7 from "path";
2740
- import { existsSync as existsSync7, mkdirSync as mkdirSync2, readdirSync } from "fs";
2740
+ import { existsSync as existsSync7, mkdirSync as mkdirSync2, readdirSync, renameSync as renameSync3, statSync as statSync2 } from "fs";
2741
2741
  import { createClient as createClient2 } from "@libsql/client";
2742
2742
  function initShardManager(encryptionKey) {
2743
2743
  _encryptionKey = encryptionKey;
@@ -2759,7 +2759,7 @@ function getShardClient(projectName) {
2759
2759
  if (!_encryptionKey) {
2760
2760
  throw new Error("Shard manager not initialized. Call initShardManager() first.");
2761
2761
  }
2762
- const safeName = projectName.replace(/[^a-zA-Z0-9_-]/g, "_");
2762
+ const safeName = safeShardName(projectName);
2763
2763
  if (!safeName || safeName === "unknown") {
2764
2764
  throw new Error(`Invalid project name for shard: "${projectName}" (resolved to "${safeName}")`);
2765
2765
  }
@@ -2781,9 +2781,12 @@ function getShardClient(projectName) {
2781
2781
  return client;
2782
2782
  }
2783
2783
  function shardExists(projectName) {
2784
- const safeName = projectName.replace(/[^a-zA-Z0-9_-]/g, "_");
2784
+ const safeName = safeShardName(projectName);
2785
2785
  return existsSync7(path7.join(SHARDS_DIR, `${safeName}.db`));
2786
2786
  }
2787
+ function safeShardName(projectName) {
2788
+ return projectName.replace(/[^a-zA-Z0-9_-]/g, "_");
2789
+ }
2787
2790
  function listShards() {
2788
2791
  if (!existsSync7(SHARDS_DIR)) return [];
2789
2792
  return readdirSync(SHARDS_DIR).filter((f) => f.endsWith(".db")).map((f) => f.replace(".db", ""));
@@ -2877,7 +2880,8 @@ async function ensureShardSchema(client) {
2877
2880
  "ALTER TABLE memories ADD COLUMN token_cost REAL",
2878
2881
  "ALTER TABLE memories ADD COLUMN audience TEXT",
2879
2882
  "ALTER TABLE memories ADD COLUMN language_type TEXT",
2880
- "ALTER TABLE memories ADD COLUMN parent_memory_id TEXT"
2883
+ "ALTER TABLE memories ADD COLUMN parent_memory_id TEXT",
2884
+ "ALTER TABLE memories ADD COLUMN deleted_at TEXT"
2881
2885
  ]) {
2882
2886
  try {
2883
2887
  await client.execute(col);
@@ -2973,9 +2977,32 @@ async function ensureShardSchema(client) {
2973
2977
  }
2974
2978
  }
2975
2979
  async function getReadyShardClient(projectName) {
2976
- const client = getShardClient(projectName);
2977
- await ensureShardSchema(client);
2978
- return client;
2980
+ const safeName = safeShardName(projectName);
2981
+ let client = getShardClient(projectName);
2982
+ try {
2983
+ await ensureShardSchema(client);
2984
+ return client;
2985
+ } catch (err) {
2986
+ const message = err instanceof Error ? err.message : String(err);
2987
+ if (!/SQLITE_NOTADB|file is not a database/i.test(message)) throw err;
2988
+ client.close();
2989
+ _shards.delete(safeName);
2990
+ _shardLastAccess.delete(safeName);
2991
+ const dbPath = path7.join(SHARDS_DIR, `${safeName}.db`);
2992
+ if (existsSync7(dbPath)) {
2993
+ const stat = statSync2(dbPath);
2994
+ const stamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
2995
+ const archivedPath = path7.join(SHARDS_DIR, `${safeName}.db.broken-${stamp}`);
2996
+ renameSync3(dbPath, archivedPath);
2997
+ process.stderr.write(
2998
+ `[shard-manager] Archived unreadable shard ${safeName}: ${archivedPath} (${stat.size} bytes, mtime ${stat.mtime.toISOString()})
2999
+ `
3000
+ );
3001
+ }
3002
+ client = getShardClient(projectName);
3003
+ await ensureShardSchema(client);
3004
+ return client;
3005
+ }
2979
3006
  }
2980
3007
  function evictLRU() {
2981
3008
  let oldest = null;
@@ -3261,7 +3261,7 @@ __export(shard_manager_exports, {
3261
3261
  shardExists: () => shardExists
3262
3262
  });
3263
3263
  import path7 from "path";
3264
- import { existsSync as existsSync7, mkdirSync as mkdirSync2, readdirSync } from "fs";
3264
+ import { existsSync as existsSync7, mkdirSync as mkdirSync2, readdirSync, renameSync as renameSync3, statSync as statSync2 } from "fs";
3265
3265
  import { createClient as createClient2 } from "@libsql/client";
3266
3266
  function initShardManager(encryptionKey) {
3267
3267
  _encryptionKey = encryptionKey;
@@ -3283,7 +3283,7 @@ function getShardClient(projectName) {
3283
3283
  if (!_encryptionKey) {
3284
3284
  throw new Error("Shard manager not initialized. Call initShardManager() first.");
3285
3285
  }
3286
- const safeName = projectName.replace(/[^a-zA-Z0-9_-]/g, "_");
3286
+ const safeName = safeShardName(projectName);
3287
3287
  if (!safeName || safeName === "unknown") {
3288
3288
  throw new Error(`Invalid project name for shard: "${projectName}" (resolved to "${safeName}")`);
3289
3289
  }
@@ -3305,9 +3305,12 @@ function getShardClient(projectName) {
3305
3305
  return client;
3306
3306
  }
3307
3307
  function shardExists(projectName) {
3308
- const safeName = projectName.replace(/[^a-zA-Z0-9_-]/g, "_");
3308
+ const safeName = safeShardName(projectName);
3309
3309
  return existsSync7(path7.join(SHARDS_DIR, `${safeName}.db`));
3310
3310
  }
3311
+ function safeShardName(projectName) {
3312
+ return projectName.replace(/[^a-zA-Z0-9_-]/g, "_");
3313
+ }
3311
3314
  function listShards() {
3312
3315
  if (!existsSync7(SHARDS_DIR)) return [];
3313
3316
  return readdirSync(SHARDS_DIR).filter((f) => f.endsWith(".db")).map((f) => f.replace(".db", ""));
@@ -3401,7 +3404,8 @@ async function ensureShardSchema(client) {
3401
3404
  "ALTER TABLE memories ADD COLUMN token_cost REAL",
3402
3405
  "ALTER TABLE memories ADD COLUMN audience TEXT",
3403
3406
  "ALTER TABLE memories ADD COLUMN language_type TEXT",
3404
- "ALTER TABLE memories ADD COLUMN parent_memory_id TEXT"
3407
+ "ALTER TABLE memories ADD COLUMN parent_memory_id TEXT",
3408
+ "ALTER TABLE memories ADD COLUMN deleted_at TEXT"
3405
3409
  ]) {
3406
3410
  try {
3407
3411
  await client.execute(col);
@@ -3497,9 +3501,32 @@ async function ensureShardSchema(client) {
3497
3501
  }
3498
3502
  }
3499
3503
  async function getReadyShardClient(projectName) {
3500
- const client = getShardClient(projectName);
3501
- await ensureShardSchema(client);
3502
- return client;
3504
+ const safeName = safeShardName(projectName);
3505
+ let client = getShardClient(projectName);
3506
+ try {
3507
+ await ensureShardSchema(client);
3508
+ return client;
3509
+ } catch (err) {
3510
+ const message = err instanceof Error ? err.message : String(err);
3511
+ if (!/SQLITE_NOTADB|file is not a database/i.test(message)) throw err;
3512
+ client.close();
3513
+ _shards.delete(safeName);
3514
+ _shardLastAccess.delete(safeName);
3515
+ const dbPath = path7.join(SHARDS_DIR, `${safeName}.db`);
3516
+ if (existsSync7(dbPath)) {
3517
+ const stat = statSync2(dbPath);
3518
+ const stamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
3519
+ const archivedPath = path7.join(SHARDS_DIR, `${safeName}.db.broken-${stamp}`);
3520
+ renameSync3(dbPath, archivedPath);
3521
+ process.stderr.write(
3522
+ `[shard-manager] Archived unreadable shard ${safeName}: ${archivedPath} (${stat.size} bytes, mtime ${stat.mtime.toISOString()})
3523
+ `
3524
+ );
3525
+ }
3526
+ client = getShardClient(projectName);
3527
+ await ensureShardSchema(client);
3528
+ return client;
3529
+ }
3503
3530
  }
3504
3531
  function evictLRU() {
3505
3532
  let oldest = null;
@@ -4702,7 +4729,7 @@ var init_agent_config = __esm({
4702
4729
  });
4703
4730
 
4704
4731
  // src/lib/intercom-queue.ts
4705
- import { readFileSync as readFileSync6, writeFileSync as writeFileSync4, renameSync as renameSync3, existsSync as existsSync9, mkdirSync as mkdirSync3 } from "fs";
4732
+ import { readFileSync as readFileSync6, writeFileSync as writeFileSync4, renameSync as renameSync4, existsSync as existsSync9, mkdirSync as mkdirSync3 } from "fs";
4706
4733
  import path10 from "path";
4707
4734
  import os7 from "os";
4708
4735
  var QUEUE_PATH, TTL_MS, INTERCOM_LOG;