@edihasaj/recall 1.0.8 → 1.0.10

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 (41) hide show
  1. package/dist/{chunk-O52XDFLI.js → chunk-KD4OKHYF.js} +101 -21
  2. package/dist/chunk-KD4OKHYF.js.map +1 -0
  3. package/dist/{chunk-LKFQ4W3R.js → chunk-LYTIYKXH.js} +2 -2
  4. package/dist/{chunk-3AXRO4H4.js → chunk-PGTHECO2.js} +3 -3
  5. package/dist/{chunk-ICF4ZPAO.js → chunk-QAFWA4U6.js} +6 -6
  6. package/dist/{chunk-63DJ3SBO.js → chunk-SGL4ZDGZ.js} +7 -7
  7. package/dist/{chunk-B2FPSWII.js → chunk-TGWUGUVH.js} +3 -3
  8. package/dist/{chunk-HKODGJ25.js → chunk-TYXRTMDK.js} +3 -3
  9. package/dist/{chunk-4XP6POJG.js → chunk-WD55NWCC.js} +2 -2
  10. package/dist/{chunk-6RJ3RYKH.js → chunk-YC64D4QN.js} +44 -22
  11. package/dist/{chunk-6RJ3RYKH.js.map → chunk-YC64D4QN.js.map} +1 -1
  12. package/dist/{cleanup-FT4VSAVQ.js → cleanup-OJBSLUMO.js} +4 -4
  13. package/dist/cli.js +29 -20
  14. package/dist/cli.js.map +1 -1
  15. package/dist/daemon.js +11 -11
  16. package/dist/daemon.js.map +1 -1
  17. package/dist/{dispatcher-EPRCW6DH.js → dispatcher-IIFTDIOW.js} +4 -4
  18. package/dist/{embeddings-ZBTV5M2O.js → embeddings-CLBTYK7N.js} +4 -2
  19. package/dist/{ingest-5N3L72OM.js → ingest-NX53XWCU.js} +3 -3
  20. package/dist/mcp.js +7 -7
  21. package/dist/{memory-value-CHMQBOGG.js → memory-value-LISBUR2V.js} +4 -4
  22. package/dist/{quality-N6LN7DNU.js → quality-TM5E6JCK.js} +5 -5
  23. package/dist/{retrieval-G5WXWBOW.js → retrieval-63A775WR.js} +4 -4
  24. package/dist/{tasks-32Y37M27.js → tasks-UEROYP6D.js} +4 -4
  25. package/package.json +1 -1
  26. package/dist/chunk-O52XDFLI.js.map +0 -1
  27. /package/dist/{chunk-LKFQ4W3R.js.map → chunk-LYTIYKXH.js.map} +0 -0
  28. /package/dist/{chunk-3AXRO4H4.js.map → chunk-PGTHECO2.js.map} +0 -0
  29. /package/dist/{chunk-ICF4ZPAO.js.map → chunk-QAFWA4U6.js.map} +0 -0
  30. /package/dist/{chunk-63DJ3SBO.js.map → chunk-SGL4ZDGZ.js.map} +0 -0
  31. /package/dist/{chunk-B2FPSWII.js.map → chunk-TGWUGUVH.js.map} +0 -0
  32. /package/dist/{chunk-HKODGJ25.js.map → chunk-TYXRTMDK.js.map} +0 -0
  33. /package/dist/{chunk-4XP6POJG.js.map → chunk-WD55NWCC.js.map} +0 -0
  34. /package/dist/{cleanup-FT4VSAVQ.js.map → cleanup-OJBSLUMO.js.map} +0 -0
  35. /package/dist/{dispatcher-EPRCW6DH.js.map → dispatcher-IIFTDIOW.js.map} +0 -0
  36. /package/dist/{embeddings-ZBTV5M2O.js.map → embeddings-CLBTYK7N.js.map} +0 -0
  37. /package/dist/{ingest-5N3L72OM.js.map → ingest-NX53XWCU.js.map} +0 -0
  38. /package/dist/{memory-value-CHMQBOGG.js.map → memory-value-LISBUR2V.js.map} +0 -0
  39. /package/dist/{quality-N6LN7DNU.js.map → quality-TM5E6JCK.js.map} +0 -0
  40. /package/dist/{retrieval-G5WXWBOW.js.map → retrieval-63A775WR.js.map} +0 -0
  41. /package/dist/{tasks-32Y37M27.js.map → tasks-UEROYP6D.js.map} +0 -0
@@ -9,13 +9,13 @@ import {
9
9
  getMemory,
10
10
  promoteMemory,
11
11
  queryMemories
12
- } from "./chunk-4XP6POJG.js";
12
+ } from "./chunk-WD55NWCC.js";
13
13
  import {
14
14
  cosineSimilarity,
15
15
  generateEmbedding,
16
16
  loadEmbedding,
17
17
  loadEmbeddingConfigFromEnv
18
- } from "./chunk-O52XDFLI.js";
18
+ } from "./chunk-KD4OKHYF.js";
19
19
  import {
20
20
  and,
21
21
  eq,
@@ -612,4 +612,4 @@ export {
612
612
  detectAndRecordRetrievalMissesSemantic,
613
613
  computeMemoryValueReport
614
614
  };
615
- //# sourceMappingURL=chunk-HKODGJ25.js.map
615
+ //# sourceMappingURL=chunk-TYXRTMDK.js.map
@@ -2,7 +2,7 @@ import {
2
2
  CONFIDENCE,
3
3
  PROMOTION,
4
4
  queueMemoryEmbeddingSync
5
- } from "./chunk-O52XDFLI.js";
5
+ } from "./chunk-KD4OKHYF.js";
6
6
  import {
7
7
  isPlausibleEntityName,
8
8
  linkMemoryToEntity,
@@ -810,4 +810,4 @@ export {
810
810
  getMemoryFeedbackSummaries,
811
811
  feedbackWeightedScore
812
812
  };
813
- //# sourceMappingURL=chunk-4XP6POJG.js.map
813
+ //# sourceMappingURL=chunk-WD55NWCC.js.map
@@ -6,13 +6,13 @@ import {
6
6
  recordAudit,
7
7
  redactSensitiveValue,
8
8
  seedScannedConfidence
9
- } from "./chunk-B2FPSWII.js";
9
+ } from "./chunk-TGWUGUVH.js";
10
10
  import {
11
11
  recordInjectionValueEvents,
12
12
  recordMemoryInjections,
13
13
  recordOutcomeValueEvent,
14
14
  resolveMemoryInjectionOutcome
15
- } from "./chunk-HKODGJ25.js";
15
+ } from "./chunk-TYXRTMDK.js";
16
16
  import {
17
17
  textMatchScore
18
18
  } from "./chunk-FHEH6QDU.js";
@@ -34,8 +34,9 @@ import {
34
34
  recordFeedback,
35
35
  rejectMemory,
36
36
  statusFromConfidence
37
- } from "./chunk-4XP6POJG.js";
37
+ } from "./chunk-WD55NWCC.js";
38
38
  import {
39
+ BACKGROUND_INDEX_BATCH_SIZE,
39
40
  CONFIDENCE,
40
41
  RetrievalEvalCase,
41
42
  RetrievalEvalFile,
@@ -53,7 +54,7 @@ import {
53
54
  readUtf8FileIfExists,
54
55
  resolveProvider,
55
56
  tagActivitySource
56
- } from "./chunk-O52XDFLI.js";
57
+ } from "./chunk-KD4OKHYF.js";
57
58
  import {
58
59
  Column,
59
60
  Columns,
@@ -4439,7 +4440,7 @@ function removeHistoryVecRow(db, snippetId) {
4439
4440
  if (!hasHistoryVecIndex(db)) return;
4440
4441
  getSqlite(db).prepare(`delete from ${VEC_HISTORY_INDEX} where snippet_id = ?`).run(snippetId);
4441
4442
  }
4442
- function rebuildHistoryVecIndex(db, config, options = {}) {
4443
+ async function rebuildHistoryVecIndexResponsive(db, config, options = {}) {
4443
4444
  const rows = db.select({
4444
4445
  id: historySnippets.id,
4445
4446
  repo: historySnippets.repo,
@@ -4447,13 +4448,10 @@ function rebuildHistoryVecIndex(db, config, options = {}) {
4447
4448
  index_dimensions: historySnippetEmbeddings.index_dimensions,
4448
4449
  embedding: historySnippetEmbeddings.embedding
4449
4450
  }).from(historySnippets).innerJoin(historySnippetEmbeddings, eq(historySnippetEmbeddings.snippet_id, historySnippets.id)).all().filter((row) => !options.repo || row.repo === options.repo);
4450
- const storedDimension = getHistoryVecDimension(rows);
4451
- const targetDimension = storedDimension ?? config.dimensions;
4451
+ const targetDimension = getHistoryVecDimension(rows) ?? config.dimensions;
4452
4452
  const sqlite = getSqlite(db);
4453
4453
  if (options.repo) {
4454
- if (rows.length > 0) {
4455
- ensureHistoryVecIndex(db, targetDimension);
4456
- }
4454
+ if (rows.length > 0) ensureHistoryVecIndex(db, targetDimension);
4457
4455
  if (!hasHistoryVecIndex(db)) return 0;
4458
4456
  sqlite.prepare(`delete from ${VEC_HISTORY_INDEX} where repo = ?`).run(options.repo);
4459
4457
  if (rows.length === 0) return 0;
@@ -4461,20 +4459,20 @@ function rebuildHistoryVecIndex(db, config, options = {}) {
4461
4459
  sqlite.exec(`drop table if exists ${VEC_HISTORY_INDEX};`);
4462
4460
  ensureHistoryVecIndex(db, targetDimension);
4463
4461
  }
4464
- const stmt = getSqlite(db).prepare(`
4465
- insert into ${VEC_HISTORY_INDEX} (
4466
- embedding,
4467
- snippet_id,
4468
- repo,
4469
- kind
4470
- ) values (?, ?, ?, ?)
4462
+ const stmt = sqlite.prepare(`
4463
+ insert into ${VEC_HISTORY_INDEX} (embedding, snippet_id, repo, kind)
4464
+ values (?, ?, ?, ?)
4471
4465
  `);
4472
- const insertMany = getSqlite(db).transaction((batch) => {
4466
+ const insertMany = sqlite.transaction((batch) => {
4473
4467
  for (const row of batch) {
4474
4468
  stmt.run(projectIndexBuffer(row.embedding, row.index_dimensions), row.id, row.repo ?? "", row.kind);
4475
4469
  }
4476
4470
  });
4477
- insertMany(rows);
4471
+ await processInResponsiveBatches(rows, async (batch) => {
4472
+ insertMany(batch);
4473
+ }, {
4474
+ batchSize: BACKGROUND_INDEX_BATCH_SIZE
4475
+ });
4478
4476
  return rows.length;
4479
4477
  }
4480
4478
  function projectIndexBuffer(buffer, indexDimensions) {
@@ -4625,6 +4623,30 @@ function rebuildHistoryFtsIndex(db, options = {}) {
4625
4623
  insertMany(rows);
4626
4624
  return rows.length;
4627
4625
  }
4626
+ async function rebuildHistoryFtsIndexResponsive(db, options = {}) {
4627
+ const sqlite = getSqlite2(db);
4628
+ if (options.repo) {
4629
+ ensureHistoryFtsIndex(db);
4630
+ sqlite.prepare(`delete from ${FTS_HISTORY_INDEX} where repo = ?`).run(options.repo);
4631
+ } else {
4632
+ sqlite.exec(`drop table if exists ${FTS_HISTORY_INDEX};`);
4633
+ ensureHistoryFtsIndex(db);
4634
+ }
4635
+ const rows = db.select().from(historySnippets).all().filter((row) => !options.repo || row.repo === options.repo);
4636
+ const stmt = sqlite.prepare(`
4637
+ insert into ${FTS_HISTORY_INDEX} (snippet_id, text, repo, kind)
4638
+ values (?, ?, ?, ?)
4639
+ `);
4640
+ const insertMany = sqlite.transaction((batch) => {
4641
+ for (const row of batch) stmt.run(row.id, row.text, row.repo ?? "", row.kind);
4642
+ });
4643
+ await processInResponsiveBatches(rows, async (batch) => {
4644
+ insertMany(batch);
4645
+ }, {
4646
+ batchSize: BACKGROUND_INDEX_BATCH_SIZE
4647
+ });
4648
+ return rows.length;
4649
+ }
4628
4650
  function verifyHistoryFtsIndex(db, options = {}) {
4629
4651
  const sqlite = getSqlite2(db);
4630
4652
  const exists2 = sqlite.prepare("select 1 from sqlite_master where type = 'table' and name = ?").get(FTS_HISTORY_INDEX);
@@ -4752,8 +4774,8 @@ async function bootstrapHistoryEmbeddings(db, config, options = {}) {
4752
4774
  total++;
4753
4775
  }
4754
4776
  });
4755
- rebuildHistoryFtsIndex(db, options);
4756
- rebuildHistoryVecIndex(db, config, options);
4777
+ await rebuildHistoryFtsIndexResponsive(db, options);
4778
+ await rebuildHistoryVecIndexResponsive(db, config, options);
4757
4779
  return total;
4758
4780
  }
4759
4781
  function verifyHistoryEmbeddings(db, config, options = {}) {
@@ -6626,4 +6648,4 @@ export {
6626
6648
  pruneMemories,
6627
6649
  formatPruneReport
6628
6650
  };
6629
- //# sourceMappingURL=chunk-6RJ3RYKH.js.map
6651
+ //# sourceMappingURL=chunk-YC64D4QN.js.map