@askexenow/exe-os 0.9.181 → 0.9.183

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.
@@ -580,6 +580,19 @@ async function loadModel() {
580
580
  } else {
581
581
  process.stderr.write(`[exed] Embed worker failed 3 times \u2014 running without embeddings.
582
582
  `);
583
+ try {
584
+ if (_storeInitialized) {
585
+ const client = getClient();
586
+ client.execute(
587
+ `INSERT INTO notifications (id, agent_id, event_type, title, body, created_at)
588
+ VALUES (lower(hex(randomblob(16))), 'exe', 'embed_failure',
589
+ 'Embedding daemon offline \u2014 recall degraded to keyword-only',
590
+ 'Embed worker crashed 3 times and will not restart. Semantic search is unavailable. Recall falls back to FTS keyword matching. Fix: check ~/.exe-os/logs/exed-launchd.log for embed worker errors, then restart daemon.',
591
+ datetime(''now''))`
592
+ );
593
+ }
594
+ } catch {
595
+ }
583
596
  }
584
597
  });
585
598
  } catch (err) {
@@ -785,8 +798,8 @@ async function shutdown() {
785
798
  `);
786
799
  }
787
800
  try {
788
- const { getClient } = await import("./database.js");
789
- const client = getClient();
801
+ const { getClient: getClient2 } = await import("./database.js");
802
+ const client = getClient2();
790
803
  await client.execute("PRAGMA wal_checkpoint(TRUNCATE)");
791
804
  process.stderr.write("[exed] WAL checkpoint complete \u2014 all writes flushed to DB.\n");
792
805
  } catch (e) {
@@ -887,8 +900,8 @@ async function handleDbExecute(socket, requestId, sql, args) {
887
900
  sendResponse(socket, { id: requestId, error: "DB not initialized" });
888
901
  return;
889
902
  }
890
- const { getClient } = await import("./database.js");
891
- const client = getClient();
903
+ const { getClient: getClient2 } = await import("./database.js");
904
+ const client = getClient2();
892
905
  const deserializedArgs = deserializeArgs(args);
893
906
  const result = await client.execute({ sql, args: deserializedArgs });
894
907
  _dbRequestsServed++;
@@ -913,8 +926,8 @@ async function handleDbBatch(socket, requestId, statements, mode) {
913
926
  sendResponse(socket, { id: requestId, error: "DB not initialized" });
914
927
  return;
915
928
  }
916
- const { getClient } = await import("./database.js");
917
- const client = getClient();
929
+ const { getClient: getClient2 } = await import("./database.js");
930
+ const client = getClient2();
918
931
  const stmts = statements.map((s) => ({
919
932
  sql: s.sql,
920
933
  args: deserializeArgs(s.args)
@@ -1049,8 +1062,8 @@ async function _writeMemoryRecordInner(entry) {
1049
1062
  `);
1050
1063
  }
1051
1064
  }
1052
- const { getClient } = await import("./database.js");
1053
- const client = getClient();
1065
+ const { getClient: getClient2 } = await import("./database.js");
1066
+ const client = getClient2();
1054
1067
  const hasVector = vectorBlob !== null;
1055
1068
  await client.execute({
1056
1069
  sql: hasVector ? `INSERT OR IGNORE INTO memories
@@ -1457,7 +1470,7 @@ async function startMcpHttpServer() {
1457
1470
  activeSessions: transports.size
1458
1471
  });
1459
1472
  }, mcpSessionOwnerKey2 = function(details) {
1460
- return `${details.runtime}:${details.agentId}:${details.sessionHint || "unknown-session"}`;
1473
+ return `${details.runtime}:${details.agentId}:${details.sessionHint || `anon-${randomUUID().slice(0, 8)}`}`;
1461
1474
  }, evictDuplicateMcpSessions2 = function(ownerKey, keepSid) {
1462
1475
  for (const [sid, existingOwner] of sessionOwnerKeys.entries()) {
1463
1476
  if (sid !== keepSid && existingOwner === ownerKey) {
@@ -2162,8 +2175,8 @@ async function startReviewPolling() {
2162
2175
  fired("review_polling");
2163
2176
  if (!await ensureStoreForPolling()) return;
2164
2177
  try {
2165
- const { getClient } = await import("./database.js");
2166
- const deps = polling.createRealDeps(getClient);
2178
+ const { getClient: getClient2 } = await import("./database.js");
2179
+ const deps = polling.createRealDeps(getClient2);
2167
2180
  const sent = await polling.pollPendingReviews(deps, state);
2168
2181
  if (sent.length > 0) acted("review_polling");
2169
2182
  for (const s of sent) {
@@ -2186,9 +2199,9 @@ function startSessionTTL() {
2186
2199
  fired("session_ttl");
2187
2200
  if (!await ensureStoreForPolling()) return;
2188
2201
  try {
2189
- const { getClient } = await import("./database.js");
2202
+ const { getClient: getClient2 } = await import("./database.js");
2190
2203
  const { checkSessionTTL, createSessionTTLRealDeps } = await import("../daemon-orchestration-CF5CT3DV.js");
2191
- const deps = createSessionTTLRealDeps(getClient);
2204
+ const deps = createSessionTTLRealDeps(getClient2);
2192
2205
  const killed = await checkSessionTTL(deps);
2193
2206
  if (killed.length > 0) acted("session_ttl");
2194
2207
  } catch (err) {
@@ -2235,10 +2248,10 @@ function startIdleKill() {
2235
2248
  try {
2236
2249
  const cfg = await getCachedConfig();
2237
2250
  if (!cfg) return;
2238
- const { getClient } = await import("./database.js");
2251
+ const { getClient: getClient2 } = await import("./database.js");
2239
2252
  const { pollIdleKill, createIdleKillRealDeps } = await import("../daemon-orchestration-CF5CT3DV.js");
2240
2253
  const deps = createIdleKillRealDeps(
2241
- getClient,
2254
+ getClient2,
2242
2255
  cfg.sessionLifecycle.idleKillIntercomAckWindowMs
2243
2256
  );
2244
2257
  const killed = await pollIdleKill(deps, _idleTickCounts, {
@@ -2272,8 +2285,8 @@ function startConsolidation() {
2272
2285
  if (!config.consolidationEnabled) return;
2273
2286
  if (!process.env.ANTHROPIC_API_KEY) return;
2274
2287
  if (!await ensureStoreForPolling()) return;
2275
- const { getClient } = await import("./database.js");
2276
- const client = getClient();
2288
+ const { getClient: getClient2 } = await import("./database.js");
2289
+ const client = getClient2();
2277
2290
  const { countUnconsolidated, isUserIdle, runConsolidation } = await import("./consolidation.js");
2278
2291
  const count = await countUnconsolidated(client);
2279
2292
  if (count < 20) {
@@ -2480,8 +2493,8 @@ function startGraphExtraction() {
2480
2493
  if (config.graphRagEnabled === false) return;
2481
2494
  if (!process.env.ANTHROPIC_API_KEY) return;
2482
2495
  if (!await ensureStoreForPolling()) return;
2483
- const { getClient } = await import("./database.js");
2484
- const client = getClient();
2496
+ const { getClient: getClient2 } = await import("./database.js");
2497
+ const client = getClient2();
2485
2498
  const { extractBatch } = await import("../graph-rag-G3EG5Q6L.js");
2486
2499
  const result = await extractBatch(client, 50, config.selfQueryModel);
2487
2500
  if (result.processed > 0) {
@@ -2508,8 +2521,8 @@ async function writeAgentStats() {
2508
2521
  if (!await ensureStoreForPolling()) return;
2509
2522
  try {
2510
2523
  acted("agent_stats");
2511
- const { getClient } = await import("./database.js");
2512
- const client = getClient();
2524
+ const { getClient: getClient2 } = await import("./database.js");
2525
+ const client = getClient2();
2513
2526
  const result = await client.execute({
2514
2527
  sql: `SELECT agent_id,
2515
2528
  COUNT(*) as total,
@@ -2581,8 +2594,8 @@ function startConfidenceDecay() {
2581
2594
  fired("confidence_decay");
2582
2595
  if (!await ensureStoreForPolling()) return;
2583
2596
  try {
2584
- const { getClient } = await import("./database.js");
2585
- const client = getClient();
2597
+ const { getClient: getClient2 } = await import("./database.js");
2598
+ const client = getClient2();
2586
2599
  const result = await client.execute({
2587
2600
  sql: `UPDATE memories
2588
2601
  SET confidence = MAX(0.3, COALESCE(confidence, 0.7) - 0.01)
@@ -2613,8 +2626,8 @@ function startReflectionSweep() {
2613
2626
  fired("reflection_sweep");
2614
2627
  if (!await ensureStoreForPolling()) return;
2615
2628
  try {
2616
- const { getClient } = await import("./database.js");
2617
- const client = getClient();
2629
+ const { getClient: getClient2 } = await import("./database.js");
2630
+ const client = getClient2();
2618
2631
  const agents = await client.execute(
2619
2632
  "SELECT DISTINCT agent_id FROM memory_cards WHERE active = 1 LIMIT 50"
2620
2633
  );
@@ -2723,9 +2736,9 @@ function startSoftDeletePurge() {
2723
2736
  fired("soft_delete_purge");
2724
2737
  if (!await ensureStoreForPolling()) return;
2725
2738
  try {
2726
- const { getClient } = await import("./database.js");
2739
+ const { getClient: getClient2 } = await import("./database.js");
2727
2740
  const { SOFT_DELETE_RETENTION_DAYS } = await import("./database.js");
2728
- const client = getClient();
2741
+ const client = getClient2();
2729
2742
  const cutoffDate = new Date(Date.now() - SOFT_DELETE_RETENTION_DAYS * 24 * 60 * 60 * 1e3).toISOString();
2730
2743
  const result = await client.execute({
2731
2744
  sql: `SELECT COUNT(*) as cnt FROM memories WHERE status = 'deleted' AND deleted_at IS NOT NULL AND deleted_at < ?`,
@@ -2870,8 +2883,8 @@ function startWalCheckpoint() {
2870
2883
  fired("wal_checkpoint");
2871
2884
  if (!await ensureStoreForPolling()) return;
2872
2885
  try {
2873
- const { getClient } = await import("./database.js");
2874
- const client = getClient();
2886
+ const { getClient: getClient2 } = await import("./database.js");
2887
+ const client = getClient2();
2875
2888
  await client.execute("PRAGMA wal_checkpoint(TRUNCATE)");
2876
2889
  acted("wal_checkpoint");
2877
2890
  } catch {
@@ -2888,9 +2901,9 @@ function startStuckTaskRelease() {
2888
2901
  fired("stuck_task_release");
2889
2902
  if (!await ensureStoreForPolling()) return;
2890
2903
  try {
2891
- const { getClient } = await import("./database.js");
2904
+ const { getClient: getClient2 } = await import("./database.js");
2892
2905
  const { releaseStuckTasks, createStuckTaskRealDeps } = await import("../daemon-orchestration-CF5CT3DV.js");
2893
- const deps = createStuckTaskRealDeps(getClient);
2906
+ const deps = createStuckTaskRealDeps(getClient2);
2894
2907
  const released = await releaseStuckTasks(deps);
2895
2908
  if (released.length > 0) {
2896
2909
  acted("stuck_task_release");
@@ -2933,7 +2946,7 @@ function startTaskEnforcementScanner() {
2933
2946
  const { runTaskEnforcementTick } = await import("../task-enforcement-OJAURWWJ.js");
2934
2947
  const { getTransport } = await import("./transport.js");
2935
2948
  const { loadAgentConfig } = await import("./agent-config.js");
2936
- const { getClient } = await import("./database.js");
2949
+ const { getClient: getClient2 } = await import("./database.js");
2937
2950
  const { loadEmployeesSync } = await import("./employees.js");
2938
2951
  const { sessionScopeFilter } = await import("../task-scope-ZINRRB5G.js");
2939
2952
  const transport = getTransport();
@@ -2943,7 +2956,7 @@ function startTaskEnforcementScanner() {
2943
2956
  transport,
2944
2957
  agentConfig: loadAgentConfig(),
2945
2958
  employees: loadEmployeesSync(),
2946
- client: await getClient(),
2959
+ client: await getClient2(),
2947
2960
  scopeFilter: sessionScopeFilter(),
2948
2961
  capturePaneAsync,
2949
2962
  paneCache
@@ -3163,8 +3176,8 @@ function startBugAutoFix() {
3163
3176
  const tick = async () => {
3164
3177
  fired("bug_autofix");
3165
3178
  try {
3166
- const { getClient } = await import("./database.js");
3167
- const client = await getClient();
3179
+ const { getClient: getClient2 } = await import("./database.js");
3180
+ const client = await getClient2();
3168
3181
  const result = await client.execute({
3169
3182
  sql: `SELECT id, title, priority, assigned_to, status FROM tasks
3170
3183
  WHERE priority IN ('p0', 'p1')
@@ -3500,8 +3513,8 @@ try {
3500
3513
  try {
3501
3514
  if (!await ensureStoreForPolling()) return;
3502
3515
  const { readdirSync, readFileSync: rfs } = await import("fs");
3503
- const { getClient } = await import("./database.js");
3504
- const client = getClient();
3516
+ const { getClient: getClient2 } = await import("./database.js");
3517
+ const client = getClient2();
3505
3518
  const tasksRoot = path3.join(os2.homedir(), ".exe-os", "tasks");
3506
3519
  let synced = 0;
3507
3520
  const walk = (dir) => {
@@ -3568,9 +3581,9 @@ try {
3568
3581
  fired("intercom_dedup_cleanup");
3569
3582
  try {
3570
3583
  if (!await ensureStoreForPolling()) return;
3571
- const { getClient } = await import("./database.js");
3584
+ const { getClient: getClient2 } = await import("./database.js");
3572
3585
  const { deduplicateIntercomMemories } = await import("./consolidation.js");
3573
- const count = await deduplicateIntercomMemories(getClient());
3586
+ const count = await deduplicateIntercomMemories(getClient2());
3574
3587
  if (count > 0) {
3575
3588
  acted("intercom_dedup_cleanup");
3576
3589
  process.stderr.write(`[exed] Intercom dedup: archived ${count} duplicate intercom memories
@@ -3585,9 +3598,9 @@ try {
3585
3598
  fired("trace_ttl_sweep");
3586
3599
  try {
3587
3600
  if (!await ensureStoreForPolling()) return;
3588
- const { getClient } = await import("./database.js");
3601
+ const { getClient: getClient2 } = await import("./database.js");
3589
3602
  const { sweepExpiredTraces } = await import("./consolidation.js");
3590
- const count = await sweepExpiredTraces(getClient());
3603
+ const count = await sweepExpiredTraces(getClient2());
3591
3604
  if (count > 0) {
3592
3605
  acted("trace_ttl_sweep");
3593
3606
  process.stderr.write(`[exed] Trace TTL: deleted ${count} expired raw tool traces (>7d, importance<7)
@@ -3654,7 +3667,7 @@ try {
3654
3667
  const { createWsClient } = await import("./ws-client.js");
3655
3668
  const { initStore } = await import("./store.js");
3656
3669
  const { sendMessage, deliverLocalMessage, setWsClientSend } = await import("./messaging.js");
3657
- const { getClient } = await import("./database.js");
3670
+ const { getClient: getClient2 } = await import("./database.js");
3658
3671
  await initStore();
3659
3672
  const wsClient = createWsClient({
3660
3673
  endpoint: config.cloud.endpoint.replace(/^https?/, "wss") + "/ws",
@@ -3680,7 +3693,7 @@ try {
3680
3693
  },
3681
3694
  onRegistry: async (devices) => {
3682
3695
  try {
3683
- const client = getClient();
3696
+ const client = getClient2();
3684
3697
  const now = (/* @__PURE__ */ new Date()).toISOString();
3685
3698
  for (const d of devices) {
3686
3699
  await client.execute({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@askexenow/exe-os",
3
- "version": "0.9.181",
3
+ "version": "0.9.183",
4
4
  "description": "AI employee operating system — persistent memory, task management, and multi-agent coordination for Claude Code.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",