@edihasaj/recall 0.8.0 → 0.8.2

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 (31) hide show
  1. package/dist/{chunk-UBPGOOAN.js → chunk-3OYO5BW3.js} +7 -3
  2. package/dist/chunk-3OYO5BW3.js.map +1 -0
  3. package/dist/{chunk-2G5DMOVA.js → chunk-4LZMHQ6Y.js} +13 -8
  4. package/dist/chunk-4LZMHQ6Y.js.map +1 -0
  5. package/dist/{chunk-OLZS3M24.js → chunk-5E3KREDH.js} +4 -4
  6. package/dist/{chunk-AKODTKWM.js → chunk-72USXFEP.js} +2 -2
  7. package/dist/{chunk-BMWLHPLS.js → chunk-DRHHOFBX.js} +2 -2
  8. package/dist/{chunk-I5TTXHOM.js → chunk-L2YIWNLN.js} +5 -5
  9. package/dist/{chunk-QSJKGEID.js → chunk-R3DJIEID.js} +2 -2
  10. package/dist/{cleanup-2HK2TX7Q.js → cleanup-XOIYUPHS.js} +3 -3
  11. package/dist/cli.js +31 -18
  12. package/dist/cli.js.map +1 -1
  13. package/dist/daemon.js +7 -7
  14. package/dist/{dispatcher-Z4GEFOQG.js → dispatcher-43DWN3ZP.js} +3 -3
  15. package/dist/{ingest-JWXX22QX.js → ingest-QOZDSJOA.js} +3 -3
  16. package/dist/mcp.js +5 -5
  17. package/dist/{retrieval-GLAEYWGA.js → retrieval-PQE7OHHJ.js} +3 -3
  18. package/dist/{tasks-GJBURDAB.js → tasks-IFHV6EBT.js} +3 -3
  19. package/package.json +1 -1
  20. package/dist/chunk-2G5DMOVA.js.map +0 -1
  21. package/dist/chunk-UBPGOOAN.js.map +0 -1
  22. /package/dist/{chunk-OLZS3M24.js.map → chunk-5E3KREDH.js.map} +0 -0
  23. /package/dist/{chunk-AKODTKWM.js.map → chunk-72USXFEP.js.map} +0 -0
  24. /package/dist/{chunk-BMWLHPLS.js.map → chunk-DRHHOFBX.js.map} +0 -0
  25. /package/dist/{chunk-I5TTXHOM.js.map → chunk-L2YIWNLN.js.map} +0 -0
  26. /package/dist/{chunk-QSJKGEID.js.map → chunk-R3DJIEID.js.map} +0 -0
  27. /package/dist/{cleanup-2HK2TX7Q.js.map → cleanup-XOIYUPHS.js.map} +0 -0
  28. /package/dist/{dispatcher-Z4GEFOQG.js.map → dispatcher-43DWN3ZP.js.map} +0 -0
  29. /package/dist/{ingest-JWXX22QX.js.map → ingest-QOZDSJOA.js.map} +0 -0
  30. /package/dist/{retrieval-GLAEYWGA.js.map → retrieval-PQE7OHHJ.js.map} +0 -0
  31. /package/dist/{tasks-GJBURDAB.js.map → tasks-IFHV6EBT.js.map} +0 -0
@@ -15,18 +15,18 @@ import {
15
15
  signalOutcomeFallback,
16
16
  startSessionLifecycle,
17
17
  toolCallTouchesMemory
18
- } from "./chunk-2G5DMOVA.js";
18
+ } from "./chunk-4LZMHQ6Y.js";
19
19
  import {
20
20
  detectCorrections,
21
21
  isHighRiskRule,
22
22
  isTriggerTemplateRule,
23
23
  peekTasks,
24
24
  redactSensitiveText
25
- } from "./chunk-BMWLHPLS.js";
25
+ } from "./chunk-DRHHOFBX.js";
26
26
  import {
27
27
  hookCallDedupeKey,
28
28
  queryMemories
29
- } from "./chunk-UBPGOOAN.js";
29
+ } from "./chunk-3OYO5BW3.js";
30
30
  import {
31
31
  desc
32
32
  } from "./chunk-37K4DPRI.js";
@@ -987,4 +987,4 @@ export {
987
987
  readCodexSessionEndInputFromStdin,
988
988
  dispatchCodexNotify
989
989
  };
990
- //# sourceMappingURL=chunk-OLZS3M24.js.map
990
+ //# sourceMappingURL=chunk-5E3KREDH.js.map
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-Z6RT5BUO.js";
6
6
  import {
7
7
  getMemory
8
- } from "./chunk-UBPGOOAN.js";
8
+ } from "./chunk-3OYO5BW3.js";
9
9
  import {
10
10
  hybridSearch,
11
11
  searchMemoryFtsIndex
@@ -120,4 +120,4 @@ async function graphQuery(db, query, embeddingConfig, options = {}) {
120
120
  export {
121
121
  graphQuery
122
122
  };
123
- //# sourceMappingURL=chunk-AKODTKWM.js.map
123
+ //# sourceMappingURL=chunk-72USXFEP.js.map
@@ -12,7 +12,7 @@ import {
12
12
  promoteMemory,
13
13
  queryMemories,
14
14
  updateMemoryCaptureContext
15
- } from "./chunk-UBPGOOAN.js";
15
+ } from "./chunk-3OYO5BW3.js";
16
16
  import {
17
17
  desc
18
18
  } from "./chunk-37K4DPRI.js";
@@ -3418,4 +3418,4 @@ export {
3418
3418
  processCorrection,
3419
3419
  processReviewFeedback
3420
3420
  };
3421
- //# sourceMappingURL=chunk-BMWLHPLS.js.map
3421
+ //# sourceMappingURL=chunk-DRHHOFBX.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  graphQuery
3
- } from "./chunk-AKODTKWM.js";
3
+ } from "./chunk-72USXFEP.js";
4
4
  import {
5
5
  getEntity,
6
6
  listEntities,
@@ -30,7 +30,7 @@ import {
30
30
  scanAndStore,
31
31
  sessionEndFallback,
32
32
  signalOutcomeFallback
33
- } from "./chunk-2G5DMOVA.js";
33
+ } from "./chunk-4LZMHQ6Y.js";
34
34
  import {
35
35
  DEFAULT_LEASE_SECONDS,
36
36
  TaskClaimConflictError,
@@ -51,14 +51,14 @@ import {
51
51
  releaseTask,
52
52
  rollbackMemory,
53
53
  submitTask
54
- } from "./chunk-BMWLHPLS.js";
54
+ } from "./chunk-DRHHOFBX.js";
55
55
  import {
56
56
  confirmMemory,
57
57
  demoteGlobalMemory,
58
58
  getMemory,
59
59
  queryMemories,
60
60
  rejectMemory
61
- } from "./chunk-UBPGOOAN.js";
61
+ } from "./chunk-3OYO5BW3.js";
62
62
  import {
63
63
  loadEmbeddingConfigFromEnv,
64
64
  tagActivitySource
@@ -1131,4 +1131,4 @@ function createRecallMcpServer(db = initDb()) {
1131
1131
  export {
1132
1132
  createRecallMcpServer
1133
1133
  };
1134
- //# sourceMappingURL=chunk-I5TTXHOM.js.map
1134
+ //# sourceMappingURL=chunk-L2YIWNLN.js.map
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-Z6RT5BUO.js";
7
7
  import {
8
8
  getMemory
9
- } from "./chunk-UBPGOOAN.js";
9
+ } from "./chunk-3OYO5BW3.js";
10
10
 
11
11
  // src/graph/extractor.ts
12
12
  var PATH_RE = /(?:^|[\s`'"(])((?:\.{0,2}\/)?(?:[A-Za-z0-9_.-]+\/){1,}[A-Za-z0-9_.-]+\.[A-Za-z0-9]{1,8})/g;
@@ -232,4 +232,4 @@ export {
232
232
  mergeAndIngest,
233
233
  safeIngestMemoryById
234
234
  };
235
- //# sourceMappingURL=chunk-QSJKGEID.js.map
235
+ //# sourceMappingURL=chunk-R3DJIEID.js.map
@@ -9,8 +9,8 @@ import {
9
9
  qualityReasons,
10
10
  revertCleanupRun,
11
11
  runDeterministicCleanup
12
- } from "./chunk-BMWLHPLS.js";
13
- import "./chunk-UBPGOOAN.js";
12
+ } from "./chunk-DRHHOFBX.js";
13
+ import "./chunk-3OYO5BW3.js";
14
14
  import "./chunk-37K4DPRI.js";
15
15
  import "./chunk-JRIM7VBY.js";
16
16
  import "./chunk-QDA5M3AJ.js";
@@ -28,4 +28,4 @@ export {
28
28
  revertCleanupRun,
29
29
  runDeterministicCleanup
30
30
  };
31
- //# sourceMappingURL=cleanup-2HK2TX7Q.js.map
31
+ //# sourceMappingURL=cleanup-XOIYUPHS.js.map
package/dist/cli.js CHANGED
@@ -22,7 +22,7 @@ import {
22
22
  readCodexSessionStartInputFromStdin,
23
23
  readCodexToolInputFromStdin,
24
24
  restoreBackup
25
- } from "./chunk-OLZS3M24.js";
25
+ } from "./chunk-5E3KREDH.js";
26
26
  import {
27
27
  RECALL_DB_USER_VERSION,
28
28
  compileContext,
@@ -61,7 +61,7 @@ import {
61
61
  startEvalSession,
62
62
  togglePolicy,
63
63
  writeRepoContextArtifact
64
- } from "./chunk-2G5DMOVA.js";
64
+ } from "./chunk-4LZMHQ6Y.js";
65
65
  import {
66
66
  autoResolveContradictions,
67
67
  computeAllHealthScores,
@@ -79,7 +79,7 @@ import {
79
79
  recordAudit,
80
80
  resolveContradiction,
81
81
  rollbackMemory
82
- } from "./chunk-BMWLHPLS.js";
82
+ } from "./chunk-DRHHOFBX.js";
83
83
  import {
84
84
  confirmMemory,
85
85
  createMemory,
@@ -88,7 +88,7 @@ import {
88
88
  listRepos,
89
89
  queryMemories,
90
90
  rejectMemory
91
- } from "./chunk-UBPGOOAN.js";
91
+ } from "./chunk-3OYO5BW3.js";
92
92
  import "./chunk-37K4DPRI.js";
93
93
  import {
94
94
  bootstrapEmbeddings,
@@ -167,6 +167,7 @@ function tokenOverlap(query, text) {
167
167
  return hits / q.size;
168
168
  }
169
169
  function makeRecallBackend(db) {
170
+ const umpSessionId = `ump:${process.pid}:${Date.now().toString(36)}`;
170
171
  return {
171
172
  queryMemories: (f) => queryMemories(db, { repo: f.repo }).map(toRecallMemory),
172
173
  getMemory: (id) => {
@@ -224,9 +225,13 @@ function makeRecallBackend(db) {
224
225
  tombstone: (id) => rejectMemory(db, id),
225
226
  capture: async ({ text, repo, path }) => {
226
227
  const res = await processCorrection(db, text, {
227
- sessionId: "ump",
228
+ // Unique per server process: a constant "ump" session id made
229
+ // stablePromptId() dedupe identical rule text forever, so a rule
230
+ // re-sent in a later UMP session was silently never re-extracted.
231
+ sessionId: umpSessionId,
228
232
  repo,
229
- path
233
+ path,
234
+ agent: "ump"
230
235
  });
231
236
  return { ids: res.ids ?? [] };
232
237
  }
@@ -1057,6 +1062,13 @@ function buildCodexManagedGroups(options) {
1057
1062
  }
1058
1063
  ];
1059
1064
  }
1065
+ if (installedEvents.size === 0 || installedEvents.has("session_ended")) {
1066
+ groups.Stop = [
1067
+ {
1068
+ hooks: [commandHook2(`${commandPrefix} hook session-end --agent codex --codex-stdin`, "session-end")]
1069
+ }
1070
+ ];
1071
+ }
1060
1072
  return groups;
1061
1073
  }
1062
1074
  function commandHook2(command, tag) {
@@ -1113,9 +1125,10 @@ function isCodexManagedGroup(group) {
1113
1125
  function cloneCodexHooks(file) {
1114
1126
  return JSON.parse(JSON.stringify(file));
1115
1127
  }
1128
+ var CODEX_HOOKS_FLAG_PATTERN = /^\s*(?:codex_)?hooks\s*=\s*true\b/m;
1116
1129
  function ensureCodexHooksFeatureFlag(targetConfigPath) {
1117
1130
  const existing = existsSync2(targetConfigPath) ? readFileSync2(targetConfigPath, "utf-8") : "";
1118
- if (/^\s*codex_hooks\s*=\s*true\b/m.test(existing)) {
1131
+ if (CODEX_HOOKS_FLAG_PATTERN.test(existing)) {
1119
1132
  return { ok: true, changed: false, config_path: targetConfigPath, message: "" };
1120
1133
  }
1121
1134
  const featureHeader = /^\[features\]\s*$/m;
@@ -1142,7 +1155,7 @@ function removeCodexHooksFeatureFlag(targetConfigPath) {
1142
1155
  }
1143
1156
  const existing = readFileSync2(targetConfigPath, "utf-8");
1144
1157
  const managedLine = new RegExp(
1145
- `^\\s*codex_hooks\\s*=\\s*true\\s*${escapeRegExp(MANAGED_FEATURE_FLAG)}\\s*$\\n?`,
1158
+ `^\\s*(?:codex_)?hooks\\s*=\\s*true\\s*${escapeRegExp(MANAGED_FEATURE_FLAG)}\\s*$\\n?`,
1146
1159
  "m"
1147
1160
  );
1148
1161
  if (!managedLine.test(existing)) {
@@ -2140,7 +2153,7 @@ function inspectCodexInstall(home) {
2140
2153
  if (existsSync6(configPath3)) {
2141
2154
  const raw = readFileSync4(configPath3, "utf-8");
2142
2155
  mcp = /\[mcp_servers\.recall\]/.test(raw);
2143
- const featureFlagSet = /^\s*codex_hooks\s*=\s*true\b/m.test(raw);
2156
+ const featureFlagSet = /^\s*(?:codex_)?hooks\s*=\s*true\b/m.test(raw);
2144
2157
  const managedHooksJson = existsSync6(hooksPath) && readFileSync4(hooksPath, "utf-8").includes("recall:managed:codex");
2145
2158
  hooks = featureFlagSet && managedHooksJson;
2146
2159
  legacy_notify_bridge = raw.includes("# recall:managed:codex:start") && raw.includes("codex-notify");
@@ -2150,7 +2163,7 @@ function inspectCodexInstall(home) {
2150
2163
  "Legacy notify bridge present \u2014 install the new hooks.json path to enable per-turn memory injection"
2151
2164
  );
2152
2165
  }
2153
- if (!featureFlagSet) notes.push("codex_hooks = true missing from [features]");
2166
+ if (!featureFlagSet) notes.push("hooks = true (or legacy codex_hooks = true) missing from [features]");
2154
2167
  if (!managedHooksJson) notes.push("No Recall-managed entries in ~/.codex/hooks.json");
2155
2168
  } else if (detected) {
2156
2169
  notes.push("Codex CLI detected but config.toml missing");
@@ -3463,7 +3476,7 @@ graphCmd.command("stats").description("Show entity/relation counts").action(asyn
3463
3476
  });
3464
3477
  graphCmd.command("backfill").description("Run the heuristic extractor over every active memory (idempotent)").option("--repo <repo>", "Limit to a single repo").option("--limit <n>", "Cap rows processed", "10000").action(async (opts) => {
3465
3478
  const db = initDb();
3466
- const { ingestMemoryHeuristic } = await import("./ingest-JWXX22QX.js");
3479
+ const { ingestMemoryHeuristic } = await import("./ingest-QOZDSJOA.js");
3467
3480
  const rows = queryMemories(db, {
3468
3481
  repo: opts.repo,
3469
3482
  status: "active",
@@ -3501,7 +3514,7 @@ graphCmd.command("entities").description("List entities").option("--repo <repo>"
3501
3514
  });
3502
3515
  graphCmd.command("query <query...>").description("Run graph-aware retrieval for a query").option("--repo <repo>", "Restrict to repo").option("--hops <n>", "Graph hops", "2").option("--limit <n>", "Max hits", "10").action(async (queryTokens, opts) => {
3503
3516
  const db = initDb();
3504
- const { graphQuery } = await import("./retrieval-GLAEYWGA.js");
3517
+ const { graphQuery } = await import("./retrieval-PQE7OHHJ.js");
3505
3518
  const { loadEmbeddingConfigFromEnv: loadEmbeddingConfigFromEnv2 } = await import("./embeddings-GKNH2E3N.js");
3506
3519
  const embeddingConfig = loadEmbeddingConfigFromEnv2();
3507
3520
  const result = await graphQuery(db, queryTokens.join(" "), embeddingConfig, {
@@ -3518,7 +3531,7 @@ graphCmd.command("query <query...>").description("Run graph-aware retrieval for
3518
3531
  });
3519
3532
  var maintenanceCmd = program.command("maintenance").description("Inspect and manage the delegated maintenance task queue");
3520
3533
  maintenanceCmd.command("stats").description("Show backlog counts, completion stats, and mean latency").action(async () => {
3521
- const { getTaskStats } = await import("./tasks-GJBURDAB.js");
3534
+ const { getTaskStats } = await import("./tasks-IFHV6EBT.js");
3522
3535
  const db = initDb();
3523
3536
  const stats = getTaskStats(db);
3524
3537
  console.log(`Total tasks: ${stats.total}`);
@@ -3544,7 +3557,7 @@ maintenanceCmd.command("stats").description("Show backlog counts, completion sta
3544
3557
  }
3545
3558
  });
3546
3559
  maintenanceCmd.command("list").description("List tasks (default: pending)").option("-s, --status <status>", "pending|claimed|completed|abandoned", "pending").option("-k, --kind <kind>", "Filter by kind").option("-r, --repo <repo>", "Filter by repo").option("-n, --limit <n>", "Max entries", "20").action(async (opts) => {
3547
- const { listTasks } = await import("./tasks-GJBURDAB.js");
3560
+ const { listTasks } = await import("./tasks-IFHV6EBT.js");
3548
3561
  const db = initDb();
3549
3562
  const tasks = listTasks(db, {
3550
3563
  status: opts.status,
@@ -3566,7 +3579,7 @@ maintenanceCmd.command("list").description("List tasks (default: pending)").opti
3566
3579
  }
3567
3580
  });
3568
3581
  maintenanceCmd.command("drop").description("Delete a task by id (or id prefix)").argument("<task-id>", "Task id or prefix").action(async (taskIdArg) => {
3569
- const { deleteTask, listTasks } = await import("./tasks-GJBURDAB.js");
3582
+ const { deleteTask, listTasks } = await import("./tasks-IFHV6EBT.js");
3570
3583
  const db = initDb();
3571
3584
  const all = listTasks(db, { limit: 1e4 });
3572
3585
  const matches = all.filter((t) => t.id === taskIdArg || t.id.startsWith(taskIdArg));
@@ -3672,8 +3685,8 @@ credentialsCmd.command("clear").description("Remove provider credentials from th
3672
3685
  else console.log(`No ${provider} credentials found in Keychain.`);
3673
3686
  });
3674
3687
  maintenanceCmd.command("dispatch").description("Run the daemon-owned dispatcher once against pending maintenance tasks (requires a configured LLM provider)").option("--provider <provider>", "openai|anthropic|azure-openai (defaults to whichever is configured)").option("--model <model>", "Model override").option("--kind <kind>", "Restrict to a single task kind (repeatable)", (value, acc = []) => [...acc, value], []).option("--repo <repo>", "Restrict to a single repo").option("--max <n>", "Max tasks to run this round", "5").option("--dry-run", "Show which tasks would be dispatched; do not call the LLM").option("--preview", "Show the actual prompts that would be sent (no provider needed; no LLM call)").option("--json", "Emit the raw JSON report").action(async (opts) => {
3675
- const { dispatchPendingTasks, formatDispatchReport, buildPrompt } = await import("./dispatcher-Z4GEFOQG.js");
3676
- const { listTasks } = await import("./tasks-GJBURDAB.js");
3688
+ const { dispatchPendingTasks, formatDispatchReport, buildPrompt } = await import("./dispatcher-43DWN3ZP.js");
3689
+ const { listTasks } = await import("./tasks-IFHV6EBT.js");
3677
3690
  const db = initDb();
3678
3691
  if (opts.preview) {
3679
3692
  const pending = listTasks(db, {
@@ -3730,7 +3743,7 @@ ${p.prompt.max_output_tokens}
3730
3743
  console.log(formatDispatchReport(report));
3731
3744
  });
3732
3745
  maintenanceCmd.command("cleanup").description("Run deterministic, LLM-free cleanup: exact-text dedupe, fragment rejection, repeat-correction promotion").option("--apply", "Persist changes (default is dry-run)").option("--only <action>", "Restrict to one action: dedupe_exact_merge|reject_fragment_candidate|promote_repeat_correction").option("--revert <run-id>", "Revert a previous cleanup run (id or 8-char prefix)").option("--list", "List recent cleanup runs").option("--json", "Emit the raw JSON report").action(async (opts) => {
3733
- const { runDeterministicCleanup, formatCleanupReport, revertCleanupRun, listCleanupRuns } = await import("./cleanup-2HK2TX7Q.js");
3746
+ const { runDeterministicCleanup, formatCleanupReport, revertCleanupRun, listCleanupRuns } = await import("./cleanup-XOIYUPHS.js");
3734
3747
  const db = initDb();
3735
3748
  if (opts.list) {
3736
3749
  const runs = listCleanupRuns(db);