@edihasaj/recall 0.8.13 → 0.8.16

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 (51) hide show
  1. package/dist/{chunk-JPHSGWSI.js → chunk-6I5U6KS3.js} +10 -10
  2. package/dist/{chunk-6CSJD45G.js → chunk-74MS4JSV.js} +15 -15
  3. package/dist/{chunk-FIWV6K57.js → chunk-C6YBSU6B.js} +15 -15
  4. package/dist/{chunk-CQZVFS3P.js → chunk-K6AFGQWR.js} +2 -2
  5. package/dist/{chunk-GLQOAY5O.js → chunk-KG7YFARS.js} +6 -6
  6. package/dist/{chunk-R4G62MKZ.js → chunk-M7OKBKKU.js} +8 -2
  7. package/dist/{chunk-R4G62MKZ.js.map → chunk-M7OKBKKU.js.map} +1 -1
  8. package/dist/{chunk-MIRCNPUN.js → chunk-NAYZL5XI.js} +8 -8
  9. package/dist/{chunk-TPCWQS6Q.js → chunk-O4KCMCJG.js} +326 -3
  10. package/dist/chunk-O4KCMCJG.js.map +1 -0
  11. package/dist/{chunk-XRM6FCWH.js → chunk-SRRPUFXI.js} +14 -14
  12. package/dist/{chunk-33KM4YYX.js → chunk-ZBIJDXA7.js} +7 -7
  13. package/dist/{cleanup-6OK2DCUA.js → cleanup-HWQCVPY4.js} +6 -5
  14. package/dist/cli.js +33 -27
  15. package/dist/cli.js.map +1 -1
  16. package/dist/daemon.js +97 -41
  17. package/dist/daemon.js.map +1 -1
  18. package/dist/{dispatcher-2Z27VP5Q.js → dispatcher-RU25CZK3.js} +6 -5
  19. package/dist/{embeddings-5ARZAEM5.js → embeddings-LNMNKWB7.js} +3 -3
  20. package/dist/{ingest-55ISNXYX.js → ingest-QSOE5XJZ.js} +5 -6
  21. package/dist/mcp.js +10 -10
  22. package/dist/{memory-value-56GK4AC6.js → memory-value-GH67CBQP.js} +6 -5
  23. package/dist/{quality-IXRBBLYF.js → quality-PZ36JND4.js} +7 -6
  24. package/dist/retrieval-HIE5MASN.js +13 -0
  25. package/dist/{store-QLWSC7S4.js → store-OPRTGS73.js} +4 -2
  26. package/dist/{tasks-OZ3IRHL5.js → tasks-LOZ7XWON.js} +6 -5
  27. package/dist/webui/assets/{index-CiEPavoy.js → index-BaaGKdcd.js} +242 -242
  28. package/dist/webui/assets/{index-CiEPavoy.js.map → index-BaaGKdcd.js.map} +1 -1
  29. package/dist/webui/index.html +1 -1
  30. package/package.json +1 -1
  31. package/dist/chunk-FKZ7IDIY.js +0 -235
  32. package/dist/chunk-FKZ7IDIY.js.map +0 -1
  33. package/dist/chunk-TPCWQS6Q.js.map +0 -1
  34. package/dist/retrieval-M566ZUK5.js +0 -13
  35. /package/dist/{chunk-JPHSGWSI.js.map → chunk-6I5U6KS3.js.map} +0 -0
  36. /package/dist/{chunk-6CSJD45G.js.map → chunk-74MS4JSV.js.map} +0 -0
  37. /package/dist/{chunk-FIWV6K57.js.map → chunk-C6YBSU6B.js.map} +0 -0
  38. /package/dist/{chunk-CQZVFS3P.js.map → chunk-K6AFGQWR.js.map} +0 -0
  39. /package/dist/{chunk-GLQOAY5O.js.map → chunk-KG7YFARS.js.map} +0 -0
  40. /package/dist/{chunk-MIRCNPUN.js.map → chunk-NAYZL5XI.js.map} +0 -0
  41. /package/dist/{chunk-XRM6FCWH.js.map → chunk-SRRPUFXI.js.map} +0 -0
  42. /package/dist/{chunk-33KM4YYX.js.map → chunk-ZBIJDXA7.js.map} +0 -0
  43. /package/dist/{cleanup-6OK2DCUA.js.map → cleanup-HWQCVPY4.js.map} +0 -0
  44. /package/dist/{dispatcher-2Z27VP5Q.js.map → dispatcher-RU25CZK3.js.map} +0 -0
  45. /package/dist/{embeddings-5ARZAEM5.js.map → embeddings-LNMNKWB7.js.map} +0 -0
  46. /package/dist/{ingest-55ISNXYX.js.map → ingest-QSOE5XJZ.js.map} +0 -0
  47. /package/dist/{memory-value-56GK4AC6.js.map → memory-value-GH67CBQP.js.map} +0 -0
  48. /package/dist/{quality-IXRBBLYF.js.map → quality-PZ36JND4.js.map} +0 -0
  49. /package/dist/{retrieval-M566ZUK5.js.map → retrieval-HIE5MASN.js.map} +0 -0
  50. /package/dist/{store-QLWSC7S4.js.map → store-OPRTGS73.js.map} +0 -0
  51. /package/dist/{tasks-OZ3IRHL5.js.map → tasks-LOZ7XWON.js.map} +0 -0
package/dist/daemon.js CHANGED
@@ -2,10 +2,7 @@ import {
2
2
  computeQualityReport,
3
3
  listQualitySnapshots,
4
4
  recordQualitySnapshot
5
- } from "./chunk-CQZVFS3P.js";
6
- import {
7
- safeIngestMemoryById
8
- } from "./chunk-FKZ7IDIY.js";
5
+ } from "./chunk-K6AFGQWR.js";
9
6
  import {
10
7
  ensureDailyBackup,
11
8
  handleAssistantCompletionHook,
@@ -13,23 +10,13 @@ import {
13
10
  handleSessionEndHook,
14
11
  handleSessionStartHook,
15
12
  handleToolHook
16
- } from "./chunk-XRM6FCWH.js";
13
+ } from "./chunk-SRRPUFXI.js";
17
14
  import {
18
15
  createRecallMcpServer
19
- } from "./chunk-6CSJD45G.js";
16
+ } from "./chunk-74MS4JSV.js";
20
17
  import {
21
18
  graphQuery
22
- } from "./chunk-MIRCNPUN.js";
23
- import {
24
- countEntities,
25
- countRelations,
26
- getEntity,
27
- listAllRelations,
28
- listEntities,
29
- listEntitiesForMemory,
30
- listMemoryIdsForEntity,
31
- neighborsOf
32
- } from "./chunk-R4G62MKZ.js";
19
+ } from "./chunk-NAYZL5XI.js";
33
20
  import {
34
21
  bootstrapHistoryEmbeddings,
35
22
  compileContext,
@@ -71,11 +58,7 @@ import {
71
58
  updateHistorySnippet,
72
59
  verifyHistoryEmbeddings,
73
60
  writeRepoContextArtifact
74
- } from "./chunk-FIWV6K57.js";
75
- import "./chunk-33KM4YYX.js";
76
- import {
77
- Sentry
78
- } from "./chunk-PUMEMKGF.js";
61
+ } from "./chunk-C6YBSU6B.js";
79
62
  import {
80
63
  DEFAULT_ENQUEUE_CONFIG,
81
64
  autoResolveContradictions,
@@ -97,17 +80,23 @@ import {
97
80
  resolveContradiction,
98
81
  rollbackMemory,
99
82
  runDeterministicCleanup
100
- } from "./chunk-JPHSGWSI.js";
83
+ } from "./chunk-6I5U6KS3.js";
84
+ import "./chunk-ZBIJDXA7.js";
85
+ import "./chunk-VT5VAEHY.js";
86
+ import {
87
+ Sentry
88
+ } from "./chunk-PUMEMKGF.js";
101
89
  import {
102
90
  confirmMemory,
103
91
  getMemory,
92
+ ingestMemoryHeuristic,
104
93
  promoteMemory,
105
94
  queryMemories,
106
95
  recordFeedback,
107
96
  rejectMemory,
97
+ safeIngestMemoryById,
108
98
  statusFromConfidence
109
- } from "./chunk-TPCWQS6Q.js";
110
- import "./chunk-VT5VAEHY.js";
99
+ } from "./chunk-O4KCMCJG.js";
111
100
  import {
112
101
  bootstrapEmbeddings,
113
102
  ensureEmbeddingProviderReady,
@@ -116,7 +105,22 @@ import {
116
105
  queueMemoryEmbeddingSync,
117
106
  rebuildEmbeddingIndex,
118
107
  verifyEmbeddings
119
- } from "./chunk-GLQOAY5O.js";
108
+ } from "./chunk-KG7YFARS.js";
109
+ import {
110
+ hasProviderConfigured,
111
+ init_keychain
112
+ } from "./chunk-DNFKAHS6.js";
113
+ import {
114
+ clearGraph,
115
+ countEntities,
116
+ countRelations,
117
+ getEntity,
118
+ listAllRelations,
119
+ listEntities,
120
+ listEntitiesForMemory,
121
+ listMemoryIdsForEntity,
122
+ neighborsOf
123
+ } from "./chunk-M7OKBKKU.js";
120
124
  import {
121
125
  activityEvents,
122
126
  eq,
@@ -126,10 +130,6 @@ import {
126
130
  lt,
127
131
  memories
128
132
  } from "./chunk-55KCGAOX.js";
129
- import {
130
- hasProviderConfigured,
131
- init_keychain
132
- } from "./chunk-DNFKAHS6.js";
133
133
  import "./chunk-4CV4JOE5.js";
134
134
 
135
135
  // src/daemon.ts
@@ -170,10 +170,55 @@ function emit(name, payload) {
170
170
  }
171
171
  }
172
172
 
173
+ // src/daemon.ts
174
+ import { homedir } from "os";
175
+ import { join as join3 } from "path";
176
+
177
+ // src/graph/reconcile.ts
178
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
179
+ import { dirname, join } from "path";
180
+ var GRAPH_EXTRACTOR_VERSION = 2;
181
+ function reconcileGraph(db2) {
182
+ clearGraph(db2);
183
+ const rows = queryMemories(db2, { status: "active", limit: 1e5 });
184
+ let entityTouches = 0;
185
+ let relationTouches = 0;
186
+ for (const row of rows) {
187
+ const s = ingestMemoryHeuristic(db2, { id: row.id, text: row.text, repo: row.repo });
188
+ entityTouches += s.entities_created_or_updated;
189
+ relationTouches += s.relations_created_or_updated;
190
+ }
191
+ return { memories: rows.length, entity_touches: entityTouches, relation_touches: relationTouches };
192
+ }
193
+ function reconcileGraphIfStale(db2, dataDir) {
194
+ const markerPath = join(dataDir, ".graph-extractor-version");
195
+ if (readMarker(markerPath) >= GRAPH_EXTRACTOR_VERSION) return null;
196
+ const result = reconcileGraph(db2);
197
+ writeMarker(markerPath, GRAPH_EXTRACTOR_VERSION);
198
+ return result;
199
+ }
200
+ function readMarker(path) {
201
+ try {
202
+ if (!existsSync(path)) return 0;
203
+ const parsed = parseInt(readFileSync(path, "utf8").trim(), 10);
204
+ return Number.isFinite(parsed) ? parsed : 0;
205
+ } catch {
206
+ return 0;
207
+ }
208
+ }
209
+ function writeMarker(path, version) {
210
+ try {
211
+ mkdirSync(dirname(path), { recursive: true });
212
+ writeFileSync(path, `${version}
213
+ `, "utf8");
214
+ } catch {
215
+ }
216
+ }
217
+
173
218
  // src/webui/server.ts
174
219
  import { createServer } from "http";
175
- import { createReadStream, existsSync, statSync } from "fs";
176
- import { extname, join, normalize, resolve, sep } from "path";
220
+ import { createReadStream, existsSync as existsSync2, statSync } from "fs";
221
+ import { extname, join as join2, normalize, resolve, sep } from "path";
177
222
  import { fileURLToPath } from "url";
178
223
 
179
224
  // src/webui/ws.ts
@@ -331,14 +376,14 @@ function defaultDistDir() {
331
376
  const here = fileURLToPath(new URL(".", import.meta.url));
332
377
  let dir = here;
333
378
  for (let i = 0; i < 8; i++) {
334
- if (existsSync(join(dir, "package.json"))) {
335
- return join(dir, "dist", "webui");
379
+ if (existsSync2(join2(dir, "package.json"))) {
380
+ return join2(dir, "dist", "webui");
336
381
  }
337
382
  const parent = resolve(dir, "..");
338
383
  if (parent === dir) break;
339
384
  dir = parent;
340
385
  }
341
- return join(here, "..", "..", "dist", "webui");
386
+ return join2(here, "..", "..", "dist", "webui");
342
387
  }
343
388
  function getStatus() {
344
389
  if (!active) {
@@ -350,7 +395,7 @@ function getStatus() {
350
395
  url: null,
351
396
  client_count: 0,
352
397
  dist_dir: distDir,
353
- dist_exists: existsSync(distDir),
398
+ dist_exists: existsSync2(distDir),
354
399
  started_at: null
355
400
  };
356
401
  }
@@ -361,7 +406,7 @@ function getStatus() {
361
406
  url: `http://${active.host}:${active.port}`,
362
407
  client_count: clientCount(),
363
408
  dist_dir: active.distDir,
364
- dist_exists: existsSync(active.distDir),
409
+ dist_exists: existsSync2(active.distDir),
365
410
  started_at: active.startedAt
366
411
  };
367
412
  }
@@ -428,15 +473,15 @@ function handleHttp(req, res, distDir) {
428
473
  return;
429
474
  }
430
475
  const relative = decoded === "/" ? "index.html" : decoded.replace(/^\/+/, "");
431
- const fullPath = normalize(join(distDir, relative));
476
+ const fullPath = normalize(join2(distDir, relative));
432
477
  if (!fullPath.startsWith(distDir + sep) && fullPath !== distDir) {
433
478
  res.statusCode = 403;
434
479
  res.end();
435
480
  return;
436
481
  }
437
- if (!existsSync(fullPath) || !statSync(fullPath).isFile()) {
438
- const indexPath = join(distDir, "index.html");
439
- if (existsSync(indexPath)) {
482
+ if (!existsSync2(fullPath) || !statSync(fullPath).isFile()) {
483
+ const indexPath = join2(distDir, "index.html");
484
+ if (existsSync2(indexPath)) {
440
485
  serveFile(res, indexPath);
441
486
  } else {
442
487
  res.statusCode = 503;
@@ -1956,6 +2001,17 @@ async function startDaemon() {
1956
2001
  console.log(`[recall] backup created ${backup.created} (retained ${backup.retained.length})`);
1957
2002
  }
1958
2003
  db = initDb();
2004
+ try {
2005
+ const dataDir = process.env.RECALL_DATA_DIR ?? join3(homedir(), ".recall");
2006
+ const reconciled = reconcileGraphIfStale(db, dataDir);
2007
+ if (reconciled) {
2008
+ console.log(
2009
+ `[recall] graph rebuilt under new extractor rules \u2014 ${reconciled.memories} active memories, ${reconciled.entity_touches} entity touches`
2010
+ );
2011
+ }
2012
+ } catch (error) {
2013
+ console.error(`[recall] graph reconcile failed: ${error instanceof Error ? error.message : String(error)}`);
2014
+ }
1959
2015
  server.listen(PORT, () => {
1960
2016
  console.log(`Recall daemon listening on http://localhost:${PORT}`);
1961
2017
  scheduleMaintenanceLoop();