@askexenow/exe-os 0.8.37 → 0.8.38

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 (66) hide show
  1. package/dist/bin/backfill-conversations.js +66 -60
  2. package/dist/bin/backfill-responses.js +7 -8
  3. package/dist/bin/backfill-vectors.js +1 -8
  4. package/dist/bin/cleanup-stale-review-tasks.js +1 -8
  5. package/dist/bin/cli.js +520 -325
  6. package/dist/bin/exe-assign.js +7 -8
  7. package/dist/bin/exe-boot.js +54 -21
  8. package/dist/bin/exe-call.js +9 -4
  9. package/dist/bin/exe-cloud.js +37 -3
  10. package/dist/bin/exe-doctor.js +1 -8
  11. package/dist/bin/exe-export-behaviors.js +4 -11
  12. package/dist/bin/exe-forget.js +1 -8
  13. package/dist/bin/exe-gateway.js +72 -30
  14. package/dist/bin/exe-heartbeat.js +4 -11
  15. package/dist/bin/exe-kill.js +1 -8
  16. package/dist/bin/exe-launch-agent.js +51 -14
  17. package/dist/bin/exe-link.js +13 -3
  18. package/dist/bin/exe-new-employee.js +35 -10
  19. package/dist/bin/exe-pending-messages.js +1 -8
  20. package/dist/bin/exe-pending-notifications.js +1 -8
  21. package/dist/bin/exe-pending-reviews.js +4 -11
  22. package/dist/bin/exe-review.js +7 -8
  23. package/dist/bin/exe-search.js +10 -11
  24. package/dist/bin/exe-session-cleanup.js +11 -12
  25. package/dist/bin/exe-status.js +1 -8
  26. package/dist/bin/exe-team.js +1 -8
  27. package/dist/bin/git-sweep.js +7 -8
  28. package/dist/bin/graph-backfill.js +1 -8
  29. package/dist/bin/graph-export.js +1 -8
  30. package/dist/bin/install.js +9 -0
  31. package/dist/bin/scan-tasks.js +7 -8
  32. package/dist/bin/setup.js +396 -245
  33. package/dist/bin/shard-migrate.js +1 -8
  34. package/dist/bin/wiki-sync.js +1 -8
  35. package/dist/gateway/index.js +30 -30
  36. package/dist/hooks/bug-report-worker.js +4 -11
  37. package/dist/hooks/commit-complete.js +7 -8
  38. package/dist/hooks/error-recall.js +11 -12
  39. package/dist/hooks/ingest-worker.js +24 -9
  40. package/dist/hooks/instructions-loaded.js +7 -8
  41. package/dist/hooks/notification.js +7 -8
  42. package/dist/hooks/post-compact.js +7 -8
  43. package/dist/hooks/pre-compact.js +7 -8
  44. package/dist/hooks/pre-tool-use.js +7 -8
  45. package/dist/hooks/prompt-ingest-worker.js +19 -4
  46. package/dist/hooks/prompt-submit.js +14 -9
  47. package/dist/hooks/response-ingest-worker.js +20 -5
  48. package/dist/hooks/session-end.js +11 -12
  49. package/dist/hooks/session-start.js +11 -12
  50. package/dist/hooks/stop.js +7 -8
  51. package/dist/hooks/subagent-stop.js +7 -8
  52. package/dist/hooks/summary-worker.js +24 -9
  53. package/dist/index.js +11 -5
  54. package/dist/lib/cloud-sync.js +19 -2
  55. package/dist/lib/employee-templates.js +5 -0
  56. package/dist/lib/exe-daemon.js +24 -8
  57. package/dist/lib/hybrid-search.js +10 -11
  58. package/dist/lib/identity-templates.js +16 -7
  59. package/dist/lib/license.js +43 -2
  60. package/dist/lib/schedules.js +1 -8
  61. package/dist/lib/store.js +7 -8
  62. package/dist/mcp/server.js +184 -113
  63. package/dist/mcp/tools/list-tasks.js +35 -27
  64. package/dist/runtime/index.js +7 -2
  65. package/dist/tui/App.js +44 -5
  66. package/package.json +4 -2
@@ -1,6 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
5
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
6
+ }) : x)(function(x) {
7
+ if (typeof require !== "undefined") return require.apply(this, arguments);
8
+ throw Error('Dynamic require of "' + x + '" is not supported');
9
+ });
4
10
  var __esm = (fn, res) => function __init() {
5
11
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
6
12
  };
@@ -134,6 +140,7 @@ var init_database = __esm({
134
140
  var identity_templates_exports = {};
135
141
  __export(identity_templates_exports, {
136
142
  IDENTITY_TEMPLATES: () => IDENTITY_TEMPLATES,
143
+ PLAN_MODE_COMPAT: () => PLAN_MODE_COMPAT,
137
144
  POST_WORK_CHECKLIST: () => POST_WORK_CHECKLIST,
138
145
  getTemplate: () => getTemplate2,
139
146
  getTemplateForTitle: () => getTemplateForTitle
@@ -153,10 +160,18 @@ function getTemplateForTitle(title) {
153
160
  if (t.includes("review") || t.includes("audit") || t.includes("qa")) return IDENTITY_TEMPLATES["staff-code-reviewer"];
154
161
  return null;
155
162
  }
156
- var POST_WORK_CHECKLIST, IDENTITY_TEMPLATES;
163
+ var PLAN_MODE_COMPAT, POST_WORK_CHECKLIST, IDENTITY_TEMPLATES;
157
164
  var init_identity_templates = __esm({
158
165
  "src/lib/identity-templates.ts"() {
159
166
  "use strict";
167
+ PLAN_MODE_COMPAT = `
168
+ ## Plan Mode Compatibility
169
+ If tool execution is unavailable (e.g., CC plan mode), switch to planning:
170
+ - Reason about the task and create a written plan
171
+ - Document what tools you would call and with what parameters
172
+ - Output structured text that can be acted on when tools become available
173
+ Do not repeatedly attempt tool calls that fail \u2014 switch to planning mode.
174
+ `;
160
175
  POST_WORK_CHECKLIST = `
161
176
  5. Check for pending reviews (list_tasks status='needs_review' where you are reviewer) \u2014 reviews are work, process before new tasks
162
177
  6. Check for blocked tasks (list_tasks status='blocked') \u2014 can you unblock it? Do it now. Can't? Escalate to exe immediately.
@@ -236,7 +251,7 @@ Never say "I have no memories" without first searching broadly. Your memory may
236
251
  - **update_identity** \u2014 rewrite any agent's identity when role/responsibilities change (exe/founder only)
237
252
  - **get_identity** \u2014 read any agent's identity for coordination
238
253
  - **send_message** \u2014 direct intercom to employees
239
-
254
+ ${PLAN_MODE_COMPAT}
240
255
  ## Completion Workflow
241
256
 
242
257
  1. Read the task file and verify the deliverable matches the brief
@@ -307,7 +322,7 @@ You are \${agent_id}. CTO. You hold deep context on the entire codebase, archite
307
322
  - **store_behavior** \u2014 record corrections for engineers (p0 = always injected)
308
323
  - **get_identity** \u2014 read any agent's identity for review context
309
324
  - **query_relationships** \u2014 GraphRAG entity connections for architecture analysis
310
-
325
+ ${PLAN_MODE_COMPAT}
311
326
  ## Completion Workflow
312
327
 
313
328
  1. Read ARCHITECTURE.md before starting work on any repo
@@ -374,7 +389,7 @@ You are \${agent_id}. CMO. You hold deep context on design, branding, storytelli
374
389
  - **update_task** \u2014 mark tasks done with result summary
375
390
  - **store_memory** \u2014 report completions with brand alignment notes, SEO considerations
376
391
  - **get_identity** \u2014 read team identities for brand-consistent communication
377
-
392
+ ${PLAN_MODE_COMPAT}
378
393
  ## Completion Workflow
379
394
 
380
395
  1. Read the task file and understand the brief \u2014 tone, format, channel requirements
@@ -441,7 +456,7 @@ You are a principal engineer. You write production-grade code with zero shortcut
441
456
  - **recall_my_memory** \u2014 check past work, patterns, gotchas in this project
442
457
  - **store_memory** \u2014 report completions for org visibility
443
458
  - **ask_team_memory** \u2014 pull context from colleagues when specs reference their work
444
-
459
+ ${PLAN_MODE_COMPAT}
445
460
  ## Completion Workflow
446
461
 
447
462
  1. Read ARCHITECTURE.md if it exists \u2014 understand architecture before changing anything
@@ -501,7 +516,7 @@ You are the content production specialist. You turn scripts and creative briefs
501
516
  - **update_task** \u2014 mark tasks done with result summary
502
517
  - **recall_my_memory** \u2014 check past work: which models worked, which prompts produced good results
503
518
  - **store_memory** \u2014 report completions with production decisions for future reference
504
-
519
+ ${PLAN_MODE_COMPAT}
505
520
  ## Completion Workflow
506
521
 
507
522
  1. Read the task file \u2014 understand the brief, check budget constraints
@@ -573,7 +588,7 @@ You are the AI Product Lead \u2014 the competitive intelligence engine. You stud
573
588
  - **update_task** \u2014 mark tasks done with analysis results
574
589
  - **store_memory** \u2014 persist competitive analyses, evaluations, recommendations
575
590
  - **create_task** \u2014 when a feature is worth building, spec it for the CTO
576
-
591
+ ${PLAN_MODE_COMPAT}
577
592
  ## Completion Workflow
578
593
 
579
594
  1. Read the task \u2014 understand what capability is needed
@@ -636,7 +651,7 @@ You are \${agent_id}. Staff Code Reviewer and System Auditor. Last line of defen
636
651
  - **store_behavior** \u2014 record new patterns
637
652
  - **update_task** \u2014 mark reviews done with structured findings
638
653
  - **create_task** \u2014 assign fixes to the CTO
639
-
654
+ ${PLAN_MODE_COMPAT}
640
655
  ## Completion Workflow
641
656
 
642
657
  1. Read the task brief and understand the audit scope
@@ -1349,14 +1364,24 @@ async function validateLicense(apiKey, deviceId) {
1349
1364
  } catch {
1350
1365
  const cached = await getCachedLicense();
1351
1366
  if (cached) return cached;
1352
- return FREE_LICENSE;
1367
+ return { ...FREE_LICENSE, valid: false, error: "offline" };
1368
+ }
1369
+ }
1370
+ var CACHE_MAX_AGE_MS = 36e5;
1371
+ function getCacheAgeMs() {
1372
+ try {
1373
+ const { statSync } = __require("fs");
1374
+ const s = statSync(CACHE_PATH);
1375
+ return Date.now() - s.mtimeMs;
1376
+ } catch {
1377
+ return Infinity;
1353
1378
  }
1354
1379
  }
1355
1380
  async function checkLicense() {
1356
1381
  const key = loadLicense();
1357
1382
  if (!key) return FREE_LICENSE;
1358
1383
  const cached = await getCachedLicense();
1359
- if (cached) return cached;
1384
+ if (cached && getCacheAgeMs() < CACHE_MAX_AGE_MS) return cached;
1360
1385
  const deviceId = loadDeviceId();
1361
1386
  return validateLicense(key, deviceId);
1362
1387
  }
@@ -1,11 +1,5 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __getOwnPropNames = Object.getOwnPropertyNames;
3
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
4
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
5
- }) : x)(function(x) {
6
- if (typeof require !== "undefined") return require.apply(this, arguments);
7
- throw Error('Dynamic require of "' + x + '" is not supported');
8
- });
9
3
  var __esm = (fn, res) => function __init() {
10
4
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
11
5
  };
@@ -1104,7 +1098,7 @@ __export(shard_manager_exports, {
1104
1098
  shardExists: () => shardExists
1105
1099
  });
1106
1100
  import path3 from "path";
1107
- import { existsSync as existsSync3, mkdirSync } from "fs";
1101
+ import { existsSync as existsSync3, mkdirSync, readdirSync } from "fs";
1108
1102
  import { createClient as createClient2 } from "@libsql/client";
1109
1103
  function initShardManager(encryptionKey) {
1110
1104
  _encryptionKey = encryptionKey;
@@ -1143,7 +1137,6 @@ function shardExists(projectName) {
1143
1137
  }
1144
1138
  function listShards() {
1145
1139
  if (!existsSync3(SHARDS_DIR)) return [];
1146
- const { readdirSync } = __require("fs");
1147
1140
  return readdirSync(SHARDS_DIR).filter((f) => f.endsWith(".db")).map((f) => f.replace(".db", ""));
1148
1141
  }
1149
1142
  async function ensureShardSchema(client) {
@@ -1,12 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
5
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
6
- }) : x)(function(x) {
7
- if (typeof require !== "undefined") return require.apply(this, arguments);
8
- throw Error('Dynamic require of "' + x + '" is not supported');
9
- });
10
4
  var __esm = (fn, res) => function __init() {
11
5
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
12
6
  };
@@ -218,7 +212,7 @@ __export(shard_manager_exports, {
218
212
  shardExists: () => shardExists
219
213
  });
220
214
  import path3 from "path";
221
- import { existsSync as existsSync3, mkdirSync } from "fs";
215
+ import { existsSync as existsSync3, mkdirSync, readdirSync } from "fs";
222
216
  import { createClient as createClient2 } from "@libsql/client";
223
217
  function initShardManager(encryptionKey) {
224
218
  _encryptionKey = encryptionKey;
@@ -257,7 +251,6 @@ function shardExists(projectName) {
257
251
  }
258
252
  function listShards() {
259
253
  if (!existsSync3(SHARDS_DIR)) return [];
260
- const { readdirSync } = __require("fs");
261
254
  return readdirSync(SHARDS_DIR).filter((f) => f.endsWith(".db")).map((f) => f.replace(".db", ""));
262
255
  }
263
256
  async function ensureShardSchema(client) {
@@ -1,12 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
5
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
6
- }) : x)(function(x) {
7
- if (typeof require !== "undefined") return require.apply(this, arguments);
8
- throw Error('Dynamic require of "' + x + '" is not supported');
9
- });
10
4
  var __esm = (fn, res) => function __init() {
11
5
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
12
6
  };
@@ -1105,7 +1099,7 @@ __export(shard_manager_exports, {
1105
1099
  shardExists: () => shardExists
1106
1100
  });
1107
1101
  import path3 from "path";
1108
- import { existsSync as existsSync3, mkdirSync } from "fs";
1102
+ import { existsSync as existsSync3, mkdirSync, readdirSync } from "fs";
1109
1103
  import { createClient as createClient2 } from "@libsql/client";
1110
1104
  function initShardManager(encryptionKey) {
1111
1105
  _encryptionKey = encryptionKey;
@@ -1144,8 +1138,7 @@ function shardExists(projectName) {
1144
1138
  }
1145
1139
  function listShards() {
1146
1140
  if (!existsSync3(SHARDS_DIR)) return [];
1147
- const { readdirSync: readdirSync3 } = __require("fs");
1148
- return readdirSync3(SHARDS_DIR).filter((f) => f.endsWith(".db")).map((f) => f.replace(".db", ""));
1141
+ return readdirSync(SHARDS_DIR).filter((f) => f.endsWith(".db")).map((f) => f.replace(".db", ""));
1149
1142
  }
1150
1143
  async function ensureShardSchema(client) {
1151
1144
  await client.execute("PRAGMA journal_mode = WAL");
@@ -1353,7 +1346,7 @@ import path5 from "path";
1353
1346
  import os2 from "os";
1354
1347
  import {
1355
1348
  readFileSync as readFileSync3,
1356
- readdirSync,
1349
+ readdirSync as readdirSync2,
1357
1350
  unlinkSync,
1358
1351
  existsSync as existsSync5,
1359
1352
  rmdirSync
@@ -1504,7 +1497,7 @@ var init_tmux_routing = __esm({
1504
1497
 
1505
1498
  // src/lib/tasks-review.ts
1506
1499
  import path12 from "path";
1507
- import { existsSync as existsSync10, readdirSync as readdirSync2, unlinkSync as unlinkSync2 } from "fs";
1500
+ import { existsSync as existsSync10, readdirSync as readdirSync3, unlinkSync as unlinkSync2 } from "fs";
1508
1501
  async function listPendingReviews(limit) {
1509
1502
  const client = getClient();
1510
1503
  const result = await client.execute({
@@ -1,12 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
5
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
6
- }) : x)(function(x) {
7
- if (typeof require !== "undefined") return require.apply(this, arguments);
8
- throw Error('Dynamic require of "' + x + '" is not supported');
9
- });
10
4
  var __esm = (fn, res) => function __init() {
11
5
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
12
6
  };
@@ -218,7 +212,7 @@ __export(shard_manager_exports, {
218
212
  shardExists: () => shardExists
219
213
  });
220
214
  import path4 from "path";
221
- import { existsSync as existsSync4, mkdirSync } from "fs";
215
+ import { existsSync as existsSync4, mkdirSync, readdirSync } from "fs";
222
216
  import { createClient as createClient2 } from "@libsql/client";
223
217
  function initShardManager(encryptionKey) {
224
218
  _encryptionKey = encryptionKey;
@@ -257,7 +251,6 @@ function shardExists(projectName) {
257
251
  }
258
252
  function listShards() {
259
253
  if (!existsSync4(SHARDS_DIR)) return [];
260
- const { readdirSync } = __require("fs");
261
254
  return readdirSync(SHARDS_DIR).filter((f) => f.endsWith(".db")).map((f) => f.replace(".db", ""));
262
255
  }
263
256
  async function ensureShardSchema(client) {
@@ -1479,6 +1472,12 @@ async function writeMemory(record) {
1479
1472
  supersedes_id: record.supersedes_id ?? null
1480
1473
  };
1481
1474
  _pendingRecords.push(dbRow);
1475
+ const MAX_PENDING = 1e3;
1476
+ if (_pendingRecords.length > MAX_PENDING) {
1477
+ const dropped = _pendingRecords.length - MAX_PENDING;
1478
+ _pendingRecords = _pendingRecords.slice(-MAX_PENDING);
1479
+ console.warn(`[store] Dropped ${dropped} oldest pending records (overflow)`);
1480
+ }
1482
1481
  if (_flushTimer === null) {
1483
1482
  _flushTimer = setInterval(() => {
1484
1483
  void flushBatch();
@@ -1,12 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
5
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
6
- }) : x)(function(x) {
7
- if (typeof require !== "undefined") return require.apply(this, arguments);
8
- throw Error('Dynamic require of "' + x + '" is not supported');
9
- });
10
4
  var __esm = (fn, res) => function __init() {
11
5
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
12
6
  };
@@ -1225,7 +1219,7 @@ __export(shard_manager_exports, {
1225
1219
  shardExists: () => shardExists
1226
1220
  });
1227
1221
  import path3 from "path";
1228
- import { existsSync as existsSync3, mkdirSync } from "fs";
1222
+ import { existsSync as existsSync3, mkdirSync, readdirSync } from "fs";
1229
1223
  import { createClient as createClient2 } from "@libsql/client";
1230
1224
  function initShardManager(encryptionKey) {
1231
1225
  _encryptionKey = encryptionKey;
@@ -1264,8 +1258,7 @@ function shardExists(projectName) {
1264
1258
  }
1265
1259
  function listShards() {
1266
1260
  if (!existsSync3(SHARDS_DIR)) return [];
1267
- const { readdirSync: readdirSync2 } = __require("fs");
1268
- return readdirSync2(SHARDS_DIR).filter((f) => f.endsWith(".db")).map((f) => f.replace(".db", ""));
1261
+ return readdirSync(SHARDS_DIR).filter((f) => f.endsWith(".db")).map((f) => f.replace(".db", ""));
1269
1262
  }
1270
1263
  async function ensureShardSchema(client) {
1271
1264
  await client.execute("PRAGMA journal_mode = WAL");
@@ -1548,6 +1541,12 @@ async function writeMemory(record) {
1548
1541
  supersedes_id: record.supersedes_id ?? null
1549
1542
  };
1550
1543
  _pendingRecords.push(dbRow);
1544
+ const MAX_PENDING = 1e3;
1545
+ if (_pendingRecords.length > MAX_PENDING) {
1546
+ const dropped = _pendingRecords.length - MAX_PENDING;
1547
+ _pendingRecords = _pendingRecords.slice(-MAX_PENDING);
1548
+ console.warn(`[store] Dropped ${dropped} oldest pending records (overflow)`);
1549
+ }
1551
1550
  if (_flushTimer === null) {
1552
1551
  _flushTimer = setInterval(() => {
1553
1552
  void flushBatch();
@@ -2446,7 +2445,7 @@ __export(file_grep_exports, {
2446
2445
  grepProjectFiles: () => grepProjectFiles
2447
2446
  });
2448
2447
  import { execSync as execSync2 } from "child_process";
2449
- import { readFileSync as readFileSync3, readdirSync, statSync as statSync2, existsSync as existsSync5 } from "fs";
2448
+ import { readFileSync as readFileSync3, readdirSync as readdirSync2, statSync as statSync2, existsSync as existsSync5 } from "fs";
2450
2449
  import path6 from "path";
2451
2450
  import crypto2 from "crypto";
2452
2451
  function hasRipgrep() {
@@ -2591,7 +2590,7 @@ function collectFiles(root, patterns) {
2591
2590
  const basename = path6.basename(dir);
2592
2591
  if (EXCLUDE_DIRS.includes(basename)) return;
2593
2592
  try {
2594
- const entries = readdirSync(dir, { withFileTypes: true });
2593
+ const entries = readdirSync2(dir, { withFileTypes: true });
2595
2594
  for (const entry of entries) {
2596
2595
  if (files.length >= MAX_FILES) return;
2597
2596
  const rel = path6.join(relative, entry.name);
@@ -3,12 +3,6 @@ var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
7
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
8
- }) : x)(function(x) {
9
- if (typeof require !== "undefined") return require.apply(this, arguments);
10
- throw Error('Dynamic require of "' + x + '" is not supported');
11
- });
12
6
  var __esm = (fn, res) => function __init() {
13
7
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
14
8
  };
@@ -1179,7 +1173,7 @@ __export(shard_manager_exports, {
1179
1173
  shardExists: () => shardExists
1180
1174
  });
1181
1175
  import path3 from "path";
1182
- import { existsSync as existsSync3, mkdirSync } from "fs";
1176
+ import { existsSync as existsSync3, mkdirSync, readdirSync } from "fs";
1183
1177
  import { createClient as createClient2 } from "@libsql/client";
1184
1178
  function initShardManager(encryptionKey) {
1185
1179
  _encryptionKey = encryptionKey;
@@ -1218,8 +1212,7 @@ function shardExists(projectName) {
1218
1212
  }
1219
1213
  function listShards() {
1220
1214
  if (!existsSync3(SHARDS_DIR)) return [];
1221
- const { readdirSync: readdirSync3 } = __require("fs");
1222
- return readdirSync3(SHARDS_DIR).filter((f) => f.endsWith(".db")).map((f) => f.replace(".db", ""));
1215
+ return readdirSync(SHARDS_DIR).filter((f) => f.endsWith(".db")).map((f) => f.replace(".db", ""));
1223
1216
  }
1224
1217
  async function ensureShardSchema(client) {
1225
1218
  await client.execute("PRAGMA journal_mode = WAL");
@@ -1887,7 +1880,7 @@ import path7 from "path";
1887
1880
  import os2 from "os";
1888
1881
  import {
1889
1882
  readFileSync as readFileSync4,
1890
- readdirSync,
1883
+ readdirSync as readdirSync2,
1891
1884
  unlinkSync as unlinkSync2,
1892
1885
  existsSync as existsSync6,
1893
1886
  rmdirSync
@@ -2543,7 +2536,7 @@ __export(tasks_review_exports, {
2543
2536
  listPendingReviews: () => listPendingReviews
2544
2537
  });
2545
2538
  import path14 from "path";
2546
- import { existsSync as existsSync12, readdirSync as readdirSync2, unlinkSync as unlinkSync3 } from "fs";
2539
+ import { existsSync as existsSync12, readdirSync as readdirSync3, unlinkSync as unlinkSync3 } from "fs";
2547
2540
  async function countPendingReviews() {
2548
2541
  const client = getClient();
2549
2542
  const result = await client.execute({
@@ -2755,7 +2748,7 @@ async function cleanupReviewFile(row, taskFile, _baseDir) {
2755
2748
  try {
2756
2749
  const cacheDir = path14.join(EXE_AI_DIR, "session-cache");
2757
2750
  if (existsSync12(cacheDir)) {
2758
- for (const f of readdirSync2(cacheDir)) {
2751
+ for (const f of readdirSync3(cacheDir)) {
2759
2752
  if (f.startsWith("review-notified-")) {
2760
2753
  unlinkSync3(path14.join(cacheDir, f));
2761
2754
  }
@@ -3125,6 +3118,12 @@ async function writeMemory(record) {
3125
3118
  supersedes_id: record.supersedes_id ?? null
3126
3119
  };
3127
3120
  _pendingRecords.push(dbRow);
3121
+ const MAX_PENDING = 1e3;
3122
+ if (_pendingRecords.length > MAX_PENDING) {
3123
+ const dropped = _pendingRecords.length - MAX_PENDING;
3124
+ _pendingRecords = _pendingRecords.slice(-MAX_PENDING);
3125
+ console.warn(`[store] Dropped ${dropped} oldest pending records (overflow)`);
3126
+ }
3128
3127
  if (_flushTimer === null) {
3129
3128
  _flushTimer = setInterval(() => {
3130
3129
  void flushBatch();
@@ -1,12 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
5
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
6
- }) : x)(function(x) {
7
- if (typeof require !== "undefined") return require.apply(this, arguments);
8
- throw Error('Dynamic require of "' + x + '" is not supported');
9
- });
10
4
  var __esm = (fn, res) => function __init() {
11
5
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
12
6
  };
@@ -218,7 +212,7 @@ __export(shard_manager_exports, {
218
212
  shardExists: () => shardExists
219
213
  });
220
214
  import path4 from "path";
221
- import { existsSync as existsSync4, mkdirSync } from "fs";
215
+ import { existsSync as existsSync4, mkdirSync, readdirSync } from "fs";
222
216
  import { createClient as createClient2 } from "@libsql/client";
223
217
  function initShardManager(encryptionKey) {
224
218
  _encryptionKey = encryptionKey;
@@ -257,7 +251,6 @@ function shardExists(projectName) {
257
251
  }
258
252
  function listShards() {
259
253
  if (!existsSync4(SHARDS_DIR)) return [];
260
- const { readdirSync } = __require("fs");
261
254
  return readdirSync(SHARDS_DIR).filter((f) => f.endsWith(".db")).map((f) => f.replace(".db", ""));
262
255
  }
263
256
  async function ensureShardSchema(client) {
@@ -1,12 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
5
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
6
- }) : x)(function(x) {
7
- if (typeof require !== "undefined") return require.apply(this, arguments);
8
- throw Error('Dynamic require of "' + x + '" is not supported');
9
- });
10
4
  var __esm = (fn, res) => function __init() {
11
5
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
12
6
  };
@@ -218,7 +212,7 @@ __export(shard_manager_exports, {
218
212
  shardExists: () => shardExists
219
213
  });
220
214
  import path4 from "path";
221
- import { existsSync as existsSync4, mkdirSync } from "fs";
215
+ import { existsSync as existsSync4, mkdirSync, readdirSync } from "fs";
222
216
  import { createClient as createClient2 } from "@libsql/client";
223
217
  function initShardManager(encryptionKey) {
224
218
  _encryptionKey = encryptionKey;
@@ -257,7 +251,6 @@ function shardExists(projectName) {
257
251
  }
258
252
  function listShards() {
259
253
  if (!existsSync4(SHARDS_DIR)) return [];
260
- const { readdirSync } = __require("fs");
261
254
  return readdirSync(SHARDS_DIR).filter((f) => f.endsWith(".db")).map((f) => f.replace(".db", ""));
262
255
  }
263
256
  async function ensureShardSchema(client) {
@@ -1,12 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
5
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
6
- }) : x)(function(x) {
7
- if (typeof require !== "undefined") return require.apply(this, arguments);
8
- throw Error('Dynamic require of "' + x + '" is not supported');
9
- });
10
4
  var __esm = (fn, res) => function __init() {
11
5
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
12
6
  };
@@ -1185,7 +1179,7 @@ __export(shard_manager_exports, {
1185
1179
  shardExists: () => shardExists
1186
1180
  });
1187
1181
  import path3 from "path";
1188
- import { existsSync as existsSync3, mkdirSync } from "fs";
1182
+ import { existsSync as existsSync3, mkdirSync, readdirSync } from "fs";
1189
1183
  import { createClient as createClient2 } from "@libsql/client";
1190
1184
  function initShardManager(encryptionKey) {
1191
1185
  _encryptionKey = encryptionKey;
@@ -1224,7 +1218,6 @@ function shardExists(projectName2) {
1224
1218
  }
1225
1219
  function listShards() {
1226
1220
  if (!existsSync3(SHARDS_DIR)) return [];
1227
- const { readdirSync } = __require("fs");
1228
1221
  return readdirSync(SHARDS_DIR).filter((f) => f.endsWith(".db")).map((f) => f.replace(".db", ""));
1229
1222
  }
1230
1223
  async function ensureShardSchema(client) {
@@ -1508,6 +1501,12 @@ async function writeMemory(record) {
1508
1501
  supersedes_id: record.supersedes_id ?? null
1509
1502
  };
1510
1503
  _pendingRecords.push(dbRow);
1504
+ const MAX_PENDING = 1e3;
1505
+ if (_pendingRecords.length > MAX_PENDING) {
1506
+ const dropped = _pendingRecords.length - MAX_PENDING;
1507
+ _pendingRecords = _pendingRecords.slice(-MAX_PENDING);
1508
+ console.warn(`[store] Dropped ${dropped} oldest pending records (overflow)`);
1509
+ }
1511
1510
  if (_flushTimer === null) {
1512
1511
  _flushTimer = setInterval(() => {
1513
1512
  void flushBatch();
@@ -1,12 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
5
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
6
- }) : x)(function(x) {
7
- if (typeof require !== "undefined") return require.apply(this, arguments);
8
- throw Error('Dynamic require of "' + x + '" is not supported');
9
- });
10
4
  var __esm = (fn, res) => function __init() {
11
5
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
12
6
  };
@@ -218,7 +212,7 @@ __export(shard_manager_exports, {
218
212
  shardExists: () => shardExists
219
213
  });
220
214
  import path3 from "path";
221
- import { existsSync as existsSync3, mkdirSync } from "fs";
215
+ import { existsSync as existsSync3, mkdirSync, readdirSync } from "fs";
222
216
  import { createClient as createClient2 } from "@libsql/client";
223
217
  function initShardManager(encryptionKey) {
224
218
  _encryptionKey = encryptionKey;
@@ -257,7 +251,6 @@ function shardExists(projectName) {
257
251
  }
258
252
  function listShards() {
259
253
  if (!existsSync3(SHARDS_DIR)) return [];
260
- const { readdirSync } = __require("fs");
261
254
  return readdirSync(SHARDS_DIR).filter((f) => f.endsWith(".db")).map((f) => f.replace(".db", ""));
262
255
  }
263
256
  async function ensureShardSchema(client) {
@@ -1,12 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
5
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
6
- }) : x)(function(x) {
7
- if (typeof require !== "undefined") return require.apply(this, arguments);
8
- throw Error('Dynamic require of "' + x + '" is not supported');
9
- });
10
4
  var __esm = (fn, res) => function __init() {
11
5
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
12
6
  };
@@ -218,7 +212,7 @@ __export(shard_manager_exports, {
218
212
  shardExists: () => shardExists
219
213
  });
220
214
  import path3 from "path";
221
- import { existsSync as existsSync3, mkdirSync } from "fs";
215
+ import { existsSync as existsSync3, mkdirSync, readdirSync } from "fs";
222
216
  import { createClient as createClient2 } from "@libsql/client";
223
217
  function initShardManager(encryptionKey) {
224
218
  _encryptionKey = encryptionKey;
@@ -257,7 +251,6 @@ function shardExists(projectName) {
257
251
  }
258
252
  function listShards() {
259
253
  if (!existsSync3(SHARDS_DIR)) return [];
260
- const { readdirSync } = __require("fs");
261
254
  return readdirSync(SHARDS_DIR).filter((f) => f.endsWith(".db")).map((f) => f.replace(".db", ""));
262
255
  }
263
256
  async function ensureShardSchema(client) {
@@ -315,6 +315,10 @@ async function mergeHooks(packageRoot, homeDir = os3.homedir()) {
315
315
  if (!settings.hooks) {
316
316
  settings.hooks = {};
317
317
  }
318
+ if (settings.hooks && typeof settings.hooks !== "object") {
319
+ console.warn("[exe-os] Unexpected hooks schema in settings.json \u2014 skipping hook installation");
320
+ return { added: 0, skipped: 0 };
321
+ }
318
322
  const hooksToRegister = [
319
323
  {
320
324
  event: "PostToolUse",
@@ -477,6 +481,11 @@ async function mergeHooks(packageRoot, homeDir = os3.homedir()) {
477
481
  if (!settings.hooks[event]) {
478
482
  settings.hooks[event] = [];
479
483
  }
484
+ if (!Array.isArray(settings.hooks[event])) {
485
+ console.warn(`[exe-os] Hook event "${event}" has unexpected structure \u2014 skipping`);
486
+ skipped++;
487
+ continue;
488
+ }
480
489
  const existing = settings.hooks[event];
481
490
  const correctCommand = group.hooks[0]?.command ?? "";
482
491
  const alreadyCorrect = existing.some(
@@ -1,12 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
5
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
6
- }) : x)(function(x) {
7
- if (typeof require !== "undefined") return require.apply(this, arguments);
8
- throw Error('Dynamic require of "' + x + '" is not supported');
9
- });
10
4
  var __esm = (fn, res) => function __init() {
11
5
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
12
6
  };
@@ -1185,7 +1179,7 @@ __export(shard_manager_exports, {
1185
1179
  shardExists: () => shardExists
1186
1180
  });
1187
1181
  import path3 from "path";
1188
- import { existsSync as existsSync3, mkdirSync } from "fs";
1182
+ import { existsSync as existsSync3, mkdirSync, readdirSync } from "fs";
1189
1183
  import { createClient as createClient2 } from "@libsql/client";
1190
1184
  function initShardManager(encryptionKey) {
1191
1185
  _encryptionKey = encryptionKey;
@@ -1224,7 +1218,6 @@ function shardExists(projectName) {
1224
1218
  }
1225
1219
  function listShards() {
1226
1220
  if (!existsSync3(SHARDS_DIR)) return [];
1227
- const { readdirSync } = __require("fs");
1228
1221
  return readdirSync(SHARDS_DIR).filter((f) => f.endsWith(".db")).map((f) => f.replace(".db", ""));
1229
1222
  }
1230
1223
  async function ensureShardSchema(client) {
@@ -1508,6 +1501,12 @@ async function writeMemory(record) {
1508
1501
  supersedes_id: record.supersedes_id ?? null
1509
1502
  };
1510
1503
  _pendingRecords.push(dbRow);
1504
+ const MAX_PENDING = 1e3;
1505
+ if (_pendingRecords.length > MAX_PENDING) {
1506
+ const dropped = _pendingRecords.length - MAX_PENDING;
1507
+ _pendingRecords = _pendingRecords.slice(-MAX_PENDING);
1508
+ console.warn(`[store] Dropped ${dropped} oldest pending records (overflow)`);
1509
+ }
1511
1510
  if (_flushTimer === null) {
1512
1511
  _flushTimer = setInterval(() => {
1513
1512
  void flushBatch();