@edihasaj/recall 0.8.20 → 0.9.1

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 (74) hide show
  1. package/README.md +13 -0
  2. package/dist/{chunk-S7FJMV5O.js → chunk-3PPYB7BX.js} +8 -8
  3. package/dist/{chunk-ZBIJDXA7.js → chunk-4W4J7Z24.js} +17 -111
  4. package/dist/chunk-4W4J7Z24.js.map +1 -0
  5. package/dist/{chunk-O4KCMCJG.js → chunk-A27AP4NR.js} +21 -6
  6. package/dist/chunk-A27AP4NR.js.map +1 -0
  7. package/dist/{chunk-VT5VAEHY.js → chunk-CW3XJDH7.js} +2 -2
  8. package/dist/chunk-DWA2IO5N.js +105 -0
  9. package/dist/chunk-DWA2IO5N.js.map +1 -0
  10. package/dist/{chunk-M7OKBKKU.js → chunk-EAFRT7RX.js} +2 -2
  11. package/dist/{chunk-QKN6IWJ3.js → chunk-EZUMD27V.js} +68 -72
  12. package/dist/{chunk-QKN6IWJ3.js.map → chunk-EZUMD27V.js.map} +1 -1
  13. package/dist/{chunk-K6AFGQWR.js → chunk-FNQABJTM.js} +4 -4
  14. package/dist/{chunk-6I5U6KS3.js → chunk-G6YAXFT4.js} +70 -41
  15. package/dist/chunk-G6YAXFT4.js.map +1 -0
  16. package/dist/{chunk-LGTD5A4A.js → chunk-GE5BPNHC.js} +78 -16
  17. package/dist/chunk-GE5BPNHC.js.map +1 -0
  18. package/dist/{chunk-4CV4JOE5.js → chunk-JYWURG5T.js} +8 -3
  19. package/dist/{chunk-55KCGAOX.js → chunk-LUIYWYOT.js} +2 -2
  20. package/dist/{chunk-KG7YFARS.js → chunk-PQJRYAVG.js} +92 -14
  21. package/dist/chunk-PQJRYAVG.js.map +1 -0
  22. package/dist/{chunk-DNFKAHS6.js → chunk-VYZSP23L.js} +95 -12
  23. package/dist/chunk-VYZSP23L.js.map +1 -0
  24. package/dist/{chunk-NAYZL5XI.js → chunk-YDSCPOIJ.js} +4 -4
  25. package/dist/{cleanup-HWQCVPY4.js → cleanup-MBXKIGT6.js} +10 -9
  26. package/dist/cli.js +951 -161
  27. package/dist/cli.js.map +1 -1
  28. package/dist/daemon.js +113 -56
  29. package/dist/daemon.js.map +1 -1
  30. package/dist/dispatcher-YN6545TF.js +21 -0
  31. package/dist/{embeddings-LNMNKWB7.js → embeddings-E362AC3R.js} +5 -5
  32. package/dist/ingest-7FAOX7YV.js +18 -0
  33. package/dist/{keychain-5QG52ANO.js → keychain-PWFWKTZW.js} +3 -3
  34. package/dist/mcp.js +13 -12
  35. package/dist/mcp.js.map +1 -1
  36. package/dist/{memory-value-GH67CBQP.js → memory-value-ZLVZTE5M.js} +10 -9
  37. package/dist/quality-UUEBGSAQ.js +24 -0
  38. package/dist/retrieval-YU2PLBUS.js +13 -0
  39. package/dist/{store-OPRTGS73.js → store-5C7ZKKZF.js} +4 -4
  40. package/dist/sync-server.js +1 -1
  41. package/dist/{tasks-LOZ7XWON.js → tasks-AEKGKZZF.js} +10 -9
  42. package/dist/{usage-CAAACLUR.js → usage-VQ5LJCNH.js} +4 -4
  43. package/dist/webui/assets/{index-BODg2A9d.js → index-DAoAhOb4.js} +244 -244
  44. package/dist/webui/assets/{index-BODg2A9d.js.map → index-DAoAhOb4.js.map} +1 -1
  45. package/dist/webui/index.html +1 -1
  46. package/package.json +34 -2
  47. package/dist/chunk-6I5U6KS3.js.map +0 -1
  48. package/dist/chunk-DNFKAHS6.js.map +0 -1
  49. package/dist/chunk-KG7YFARS.js.map +0 -1
  50. package/dist/chunk-LGTD5A4A.js.map +0 -1
  51. package/dist/chunk-O4KCMCJG.js.map +0 -1
  52. package/dist/chunk-ZBIJDXA7.js.map +0 -1
  53. package/dist/dispatcher-RU25CZK3.js +0 -20
  54. package/dist/ingest-QSOE5XJZ.js +0 -18
  55. package/dist/quality-PZ36JND4.js +0 -23
  56. package/dist/retrieval-HIE5MASN.js +0 -13
  57. /package/dist/{chunk-S7FJMV5O.js.map → chunk-3PPYB7BX.js.map} +0 -0
  58. /package/dist/{chunk-VT5VAEHY.js.map → chunk-CW3XJDH7.js.map} +0 -0
  59. /package/dist/{chunk-M7OKBKKU.js.map → chunk-EAFRT7RX.js.map} +0 -0
  60. /package/dist/{chunk-K6AFGQWR.js.map → chunk-FNQABJTM.js.map} +0 -0
  61. /package/dist/{chunk-4CV4JOE5.js.map → chunk-JYWURG5T.js.map} +0 -0
  62. /package/dist/{chunk-55KCGAOX.js.map → chunk-LUIYWYOT.js.map} +0 -0
  63. /package/dist/{chunk-NAYZL5XI.js.map → chunk-YDSCPOIJ.js.map} +0 -0
  64. /package/dist/{cleanup-HWQCVPY4.js.map → cleanup-MBXKIGT6.js.map} +0 -0
  65. /package/dist/{dispatcher-RU25CZK3.js.map → dispatcher-YN6545TF.js.map} +0 -0
  66. /package/dist/{embeddings-LNMNKWB7.js.map → embeddings-E362AC3R.js.map} +0 -0
  67. /package/dist/{ingest-QSOE5XJZ.js.map → ingest-7FAOX7YV.js.map} +0 -0
  68. /package/dist/{keychain-5QG52ANO.js.map → keychain-PWFWKTZW.js.map} +0 -0
  69. /package/dist/{memory-value-GH67CBQP.js.map → memory-value-ZLVZTE5M.js.map} +0 -0
  70. /package/dist/{quality-PZ36JND4.js.map → quality-UUEBGSAQ.js.map} +0 -0
  71. /package/dist/{retrieval-HIE5MASN.js.map → retrieval-YU2PLBUS.js.map} +0 -0
  72. /package/dist/{store-OPRTGS73.js.map → store-5C7ZKKZF.js.map} +0 -0
  73. /package/dist/{tasks-LOZ7XWON.js.map → tasks-AEKGKZZF.js.map} +0 -0
  74. /package/dist/{usage-CAAACLUR.js.map → usage-VQ5LJCNH.js.map} +0 -0
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  computeMemoryValueReport
3
- } from "./chunk-ZBIJDXA7.js";
3
+ } from "./chunk-4W4J7Z24.js";
4
4
  import {
5
5
  desc
6
- } from "./chunk-VT5VAEHY.js";
6
+ } from "./chunk-CW3XJDH7.js";
7
7
  import {
8
8
  and,
9
9
  eq,
@@ -14,7 +14,7 @@ import {
14
14
  memoryInjections,
15
15
  qualitySnapshots,
16
16
  sql
17
- } from "./chunk-55KCGAOX.js";
17
+ } from "./chunk-LUIYWYOT.js";
18
18
 
19
19
  // src/maintenance/quality.ts
20
20
  import { randomUUID } from "crypto";
@@ -180,4 +180,4 @@ export {
180
180
  diffQualitySnapshots,
181
181
  formatQualityReport
182
182
  };
183
- //# sourceMappingURL=chunk-K6AFGQWR.js.map
183
+ //# sourceMappingURL=chunk-FNQABJTM.js.map
@@ -1,10 +1,15 @@
1
+ import {
2
+ matchTokens,
3
+ textMatchScore
4
+ } from "./chunk-DWA2IO5N.js";
1
5
  import {
2
6
  desc
3
- } from "./chunk-VT5VAEHY.js";
7
+ } from "./chunk-CW3XJDH7.js";
4
8
  import {
5
9
  appendEvidence,
6
10
  countDistinctCorrectionSessions,
7
11
  createMemory,
12
+ defineOwn,
8
13
  demoteMemory,
9
14
  getMemory,
10
15
  getMemoryFeedback,
@@ -15,7 +20,7 @@ import {
15
20
  promoteMemory,
16
21
  queryMemories,
17
22
  updateMemoryCaptureContext
18
- } from "./chunk-O4KCMCJG.js";
23
+ } from "./chunk-A27AP4NR.js";
19
24
  import {
20
25
  CONFIDENCE,
21
26
  LlmCredentialError,
@@ -24,11 +29,11 @@ import {
24
29
  findSimilarRejectedExemplar,
25
30
  loadEmbeddingConfigFromEnv,
26
31
  queueMemoryEmbeddingSync
27
- } from "./chunk-KG7YFARS.js";
32
+ } from "./chunk-PQJRYAVG.js";
28
33
  import {
29
34
  hasProviderConfigured,
30
35
  init_keychain
31
- } from "./chunk-DNFKAHS6.js";
36
+ } from "./chunk-VYZSP23L.js";
32
37
  import {
33
38
  activityEvents,
34
39
  and,
@@ -49,7 +54,7 @@ import {
49
54
  memoryMaintenanceTasks,
50
55
  or,
51
56
  sql
52
- } from "./chunk-55KCGAOX.js";
57
+ } from "./chunk-LUIYWYOT.js";
53
58
 
54
59
  // src/maintenance/tasks.ts
55
60
  import { randomUUID as randomUUID5 } from "crypto";
@@ -720,8 +725,8 @@ function formatDispatchReport(report) {
720
725
  import { createHash } from "crypto";
721
726
 
722
727
  // src/capture/scope.ts
723
- import { execSync } from "child_process";
724
- import { dirname, extname, basename } from "path";
728
+ import { existsSync, readFileSync } from "fs";
729
+ import { dirname, extname, basename, join } from "path";
725
730
  var SCOPE_MARKERS = [
726
731
  {
727
732
  pattern: /\b(in this file|this file only|just this file)\b/i,
@@ -868,17 +873,18 @@ function inferPathScope(filePath) {
868
873
  return `${dir}/**`;
869
874
  }
870
875
  function hasSpecificFileReference(text) {
871
- return /\b[\w-]+\.(ts|js|py|rs|go|swift|java|rb|tsx|jsx|vue|svelte)\b/.test(text) || /\b(src|lib|app|components|utils|test|spec)\//.test(text);
876
+ return /\b[\w-]+\.(ts|js|py|rs|go|swift|java|rb|tsx|jsx|vue|svelte)\b/.test(text) || /\b(src|lib|components|utils|test|spec)\/[\w/.-]+/.test(text) || /\b(?:in|under|inside|path|file|directory|folder)\s+(?:the\s+)?app\/[\w/.-]+/i.test(text) || /`app\/[\w/.-]+`/.test(text);
872
877
  }
873
878
  function extractPathFromText(text) {
874
879
  const pathMatch = text.match(
875
- /\b((?:src|lib|app|components|utils|test|spec)\/[\w/.-]+)/
880
+ /\b((?:src|lib|components|utils|test|spec)\/[\w/.-]+)/
876
881
  );
877
882
  if (pathMatch) return `${pathMatch[1]}**`;
878
- const dirMatch = text.match(
879
- /\b((?:src|lib|app|components|utils|test|spec)\/[\w/-]*)/
883
+ const explicitAppPath = text.match(
884
+ /(?:`(app\/[\w/.-]+)`|\b(?:in|under|inside|path|file|directory|folder)\s+(?:the\s+)?(app\/[\w/.-]+))/i
880
885
  );
881
- if (dirMatch) return `${dirMatch[1]}/**`;
886
+ const appPath = explicitAppPath?.[1] ?? explicitAppPath?.[2];
887
+ if (appPath) return `${appPath}**`;
882
888
  return null;
883
889
  }
884
890
  var SOURCE_AWARE_TOOLS = /* @__PURE__ */ new Set([
@@ -953,16 +959,17 @@ function inferFromAssistantTurn(assistantTurn) {
953
959
  }
954
960
  function inferFromGitOwnership(filePath, repoPath) {
955
961
  try {
956
- const codeowners = execSync(
957
- `cat .github/CODEOWNERS 2>/dev/null || cat CODEOWNERS 2>/dev/null || echo ""`,
958
- { cwd: repoPath, encoding: "utf-8" }
959
- ).trim();
962
+ const candidates = [
963
+ join(repoPath, ".github", "CODEOWNERS"),
964
+ join(repoPath, "CODEOWNERS")
965
+ ];
966
+ const codeownersPath = candidates.find((candidate) => existsSync(candidate));
967
+ const codeowners = codeownersPath ? readFileSync(codeownersPath, "utf-8").trim() : "";
960
968
  if (codeowners) {
961
- const dir = dirname(filePath);
962
969
  for (const line of codeowners.split("\n")) {
963
970
  if (line.startsWith("#") || !line.trim()) continue;
964
971
  const parts = line.trim().split(/\s+/);
965
- if (parts.length >= 2 && filePath.includes(parts[0].replace("*", ""))) {
972
+ if (parts.length >= 2 && filePath.includes(parts[0].replaceAll("*", ""))) {
966
973
  return {
967
974
  scope: "path",
968
975
  path_scope: `${parts[0]}`,
@@ -1005,7 +1012,7 @@ function detectContradictions(db, repo) {
1005
1012
  ).get();
1006
1013
  if (!existing) {
1007
1014
  const id = randomUUID2();
1008
- const now = (/* @__PURE__ */ new Date()).toISOString();
1015
+ const now2 = (/* @__PURE__ */ new Date()).toISOString();
1009
1016
  db.insert(contradictions).values({
1010
1017
  id,
1011
1018
  memory_a_id: a.id,
@@ -1014,7 +1021,7 @@ function detectContradictions(db, repo) {
1014
1021
  severity: contradiction.severity,
1015
1022
  description: contradiction.description,
1016
1023
  resolved: false,
1017
- detected_at: now
1024
+ detected_at: now2
1018
1025
  }).run();
1019
1026
  recordAudit(db, a.id, "contradiction_detected", "system", contradiction.description);
1020
1027
  recordAudit(db, b.id, "contradiction_detected", "system", contradiction.description);
@@ -1027,13 +1034,27 @@ function detectContradictions(db, repo) {
1027
1034
  description: contradiction.description,
1028
1035
  resolved: false,
1029
1036
  resolution: null,
1030
- detected_at: now,
1037
+ detected_at: now2,
1031
1038
  resolved_at: null
1032
1039
  });
1033
1040
  }
1034
1041
  }
1035
1042
  }
1036
1043
  }
1044
+ const now = (/* @__PURE__ */ new Date()).toISOString();
1045
+ const unresolved = db.select().from(contradictions).where(eq(contradictions.resolved, false)).all();
1046
+ for (const row of unresolved) {
1047
+ const a = getMemory(db, row.memory_a_id);
1048
+ const b = getMemory(db, row.memory_b_id);
1049
+ if (repo && a?.repo !== repo && b?.repo !== repo) continue;
1050
+ const eligible = a && b && (a.status === "active" || a.status === "candidate") && (b.status === "active" || b.status === "candidate");
1051
+ if (eligible && checkContradiction(a, b)) continue;
1052
+ db.update(contradictions).set({
1053
+ resolved: true,
1054
+ resolution: "Auto-resolved: pair no longer satisfies contradiction rules",
1055
+ resolved_at: now
1056
+ }).where(eq(contradictions.id, row.id)).run();
1057
+ }
1037
1058
  return found;
1038
1059
  }
1039
1060
  function checkContradiction(a, b) {
@@ -1081,15 +1102,15 @@ function checkDirectNegation(a, b) {
1081
1102
  function checkConflictingRules(a, b) {
1082
1103
  if (a.type !== b.type) return null;
1083
1104
  if (a.type !== "rule" && a.type !== "command") return null;
1084
- const useA = a.text.match(/\buse\s+(\S+)/i);
1085
- const useB = b.text.match(/\buse\s+(\S+)/i);
1105
+ const useA = extractAffirmativeUseDirective(a.text);
1106
+ const useB = extractAffirmativeUseDirective(b.text);
1086
1107
  if (useA && useB) {
1087
- const toolA = useA[1].toLowerCase().replace(/[,.:;]/g, "");
1088
- const toolB = useB[1].toLowerCase().replace(/[,.:;]/g, "");
1108
+ const toolA = useA.choice;
1109
+ const toolB = useB.choice;
1089
1110
  if (toolA !== toolB) {
1090
- const contextA = extractContext(a.text);
1091
- const contextB = extractContext(b.text);
1092
- if (contextA && contextB && wordOverlap(contextA, contextB) > 0.3) {
1111
+ const contextA = useA.context;
1112
+ const contextB = useB.context;
1113
+ if (matchTokens(contextA).length >= 2 && matchTokens(contextB).length >= 2 && textMatchScore(contextA, contextB).score >= 0.72) {
1093
1114
  return {
1094
1115
  type: "conflicting_rules",
1095
1116
  severity: "medium",
@@ -1098,14 +1119,6 @@ function checkConflictingRules(a, b) {
1098
1119
  }
1099
1120
  }
1100
1121
  }
1101
- const sim = wordOverlap(a.text, b.text);
1102
- if (sim > 0.6 && sim < 0.95 && a.text !== b.text) {
1103
- return {
1104
- type: "scope_overlap",
1105
- severity: "low",
1106
- description: `Very similar memories (${(sim * 100).toFixed(0)}% overlap): "${a.text.slice(0, 50)}" vs "${b.text.slice(0, 50)}"`
1107
- };
1108
- }
1109
1122
  return null;
1110
1123
  }
1111
1124
  function resolveContradiction(db, contradictionId, keepMemoryId, actor, resolution) {
@@ -1163,8 +1176,14 @@ function scopesOverlap(a, b) {
1163
1176
  function extractSubject(text) {
1164
1177
  return text.replace(/\b(always|never|must|do not|don't|use|do|run|call|import)\b/gi, "").trim().toLowerCase();
1165
1178
  }
1166
- function extractContext(text) {
1167
- return text.replace(/\buse\s+\S+/i, "").trim().toLowerCase();
1179
+ function extractAffirmativeUseDirective(text) {
1180
+ const match = text.trim().match(
1181
+ /^(?:always\s+|prefer\s+)?use\s+([a-z0-9][\w.+-]*)\s+(?:for|when|on|as)\s+(.+)$/i
1182
+ );
1183
+ if (!match) return null;
1184
+ const choice = match[1].toLowerCase();
1185
+ if (["a", "an", "the", "this", "that", "it"].includes(choice)) return null;
1186
+ return { choice, context: match[2].trim().toLowerCase() };
1168
1187
  }
1169
1188
  function wordOverlap(a, b) {
1170
1189
  const wordsA = new Set(a.toLowerCase().split(/\s+/).filter((w) => w.length > 2));
@@ -1579,6 +1598,16 @@ var VERB_HINTS = [
1579
1598
  "receive",
1580
1599
  "treat",
1581
1600
  "propose",
1601
+ "capture",
1602
+ "record",
1603
+ "report",
1604
+ "preserve",
1605
+ "inspect",
1606
+ "challenge",
1607
+ "invoke",
1608
+ "dispatch",
1609
+ "rerun",
1610
+ "cancel",
1582
1611
  "configure",
1583
1612
  "enable",
1584
1613
  "disable"
@@ -1609,7 +1638,7 @@ var ACTIVE_FRAGMENT_REASONS = /* @__PURE__ */ new Set([
1609
1638
  "e2e_verification_artifact",
1610
1639
  "embedded_question"
1611
1640
  ]);
1612
- var MAX_RULE_LENGTH = 300;
1641
+ var MAX_RULE_LENGTH = 500;
1613
1642
  var MIN_RULE_LENGTH = 20;
1614
1643
  function planRejectFragments(db) {
1615
1644
  const rows = db.select({
@@ -2241,7 +2270,7 @@ function redactSensitiveValue(value) {
2241
2270
  if (!value || typeof value !== "object") return value;
2242
2271
  const out = {};
2243
2272
  for (const [key, entry] of Object.entries(value)) {
2244
- out[key] = redactSensitiveValue(entry);
2273
+ defineOwn(out, key, redactSensitiveValue(entry));
2245
2274
  }
2246
2275
  return out;
2247
2276
  }
@@ -3856,4 +3885,4 @@ export {
3856
3885
  processCorrection,
3857
3886
  processReviewFeedback
3858
3887
  };
3859
- //# sourceMappingURL=chunk-6I5U6KS3.js.map
3888
+ //# sourceMappingURL=chunk-G6YAXFT4.js.map