agent-recall-core 3.4.37 → 3.4.39

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 (150) hide show
  1. package/README.md +111 -53
  2. package/dist/helpers/activity-feed.d.ts.map +1 -1
  3. package/dist/helpers/activity-feed.js +12 -7
  4. package/dist/helpers/activity-feed.js.map +1 -1
  5. package/dist/helpers/alignment-patterns.d.ts.map +1 -1
  6. package/dist/helpers/alignment-patterns.js +8 -13
  7. package/dist/helpers/alignment-patterns.js.map +1 -1
  8. package/dist/helpers/handoff.d.ts.map +1 -1
  9. package/dist/helpers/handoff.js +5 -8
  10. package/dist/helpers/handoff.js.map +1 -1
  11. package/dist/helpers/journal-files.d.ts +17 -0
  12. package/dist/helpers/journal-files.d.ts.map +1 -1
  13. package/dist/helpers/journal-files.js +61 -0
  14. package/dist/helpers/journal-files.js.map +1 -1
  15. package/dist/helpers/journal-filter.d.ts +22 -0
  16. package/dist/helpers/journal-filter.d.ts.map +1 -1
  17. package/dist/helpers/journal-filter.js +23 -0
  18. package/dist/helpers/journal-filter.js.map +1 -1
  19. package/dist/helpers/journal-name-parser.d.ts +13 -2
  20. package/dist/helpers/journal-name-parser.d.ts.map +1 -1
  21. package/dist/helpers/journal-name-parser.js +46 -2
  22. package/dist/helpers/journal-name-parser.js.map +1 -1
  23. package/dist/helpers/journal-sig-theme.d.ts +11 -0
  24. package/dist/helpers/journal-sig-theme.d.ts.map +1 -1
  25. package/dist/helpers/journal-sig-theme.js +18 -0
  26. package/dist/helpers/journal-sig-theme.js.map +1 -1
  27. package/dist/host-profile.d.ts +69 -0
  28. package/dist/host-profile.d.ts.map +1 -0
  29. package/dist/host-profile.js +107 -0
  30. package/dist/host-profile.js.map +1 -0
  31. package/dist/index.d.ts +7 -2
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +11 -1
  34. package/dist/index.js.map +1 -1
  35. package/dist/naming.d.ts +10 -3
  36. package/dist/naming.d.ts.map +1 -1
  37. package/dist/naming.js +19 -15
  38. package/dist/naming.js.map +1 -1
  39. package/dist/palace/pipeline.d.ts +6 -0
  40. package/dist/palace/pipeline.d.ts.map +1 -1
  41. package/dist/palace/pipeline.js +15 -2
  42. package/dist/palace/pipeline.js.map +1 -1
  43. package/dist/palace/rooms.d.ts +20 -0
  44. package/dist/palace/rooms.d.ts.map +1 -1
  45. package/dist/palace/rooms.js +90 -0
  46. package/dist/palace/rooms.js.map +1 -1
  47. package/dist/palace/skills.d.ts +13 -0
  48. package/dist/palace/skills.d.ts.map +1 -1
  49. package/dist/palace/skills.js +53 -6
  50. package/dist/palace/skills.js.map +1 -1
  51. package/dist/storage/ab-experiment.d.ts.map +1 -1
  52. package/dist/storage/ab-experiment.js +8 -12
  53. package/dist/storage/ab-experiment.js.map +1 -1
  54. package/dist/storage/corrections.d.ts +146 -0
  55. package/dist/storage/corrections.d.ts.map +1 -1
  56. package/dist/storage/corrections.js +746 -151
  57. package/dist/storage/corrections.js.map +1 -1
  58. package/dist/storage/cwd-allowlist.d.ts.map +1 -1
  59. package/dist/storage/cwd-allowlist.js +2 -4
  60. package/dist/storage/cwd-allowlist.js.map +1 -1
  61. package/dist/storage/lifecycle-telemetry.d.ts +56 -0
  62. package/dist/storage/lifecycle-telemetry.d.ts.map +1 -0
  63. package/dist/storage/lifecycle-telemetry.js +134 -0
  64. package/dist/storage/lifecycle-telemetry.js.map +1 -0
  65. package/dist/storage/memory-protocol.d.ts.map +1 -1
  66. package/dist/storage/memory-protocol.js +6 -10
  67. package/dist/storage/memory-protocol.js.map +1 -1
  68. package/dist/storage/paths.d.ts +120 -1
  69. package/dist/storage/paths.d.ts.map +1 -1
  70. package/dist/storage/paths.js +145 -31
  71. package/dist/storage/paths.js.map +1 -1
  72. package/dist/storage/project.d.ts.map +1 -1
  73. package/dist/storage/project.js +12 -4
  74. package/dist/storage/project.js.map +1 -1
  75. package/dist/storage/sanitize.d.ts +55 -0
  76. package/dist/storage/sanitize.d.ts.map +1 -0
  77. package/dist/storage/sanitize.js +114 -0
  78. package/dist/storage/sanitize.js.map +1 -0
  79. package/dist/storage/session.d.ts +37 -4
  80. package/dist/storage/session.d.ts.map +1 -1
  81. package/dist/storage/session.js +105 -9
  82. package/dist/storage/session.js.map +1 -1
  83. package/dist/tools-logic/bootstrap.d.ts.map +1 -1
  84. package/dist/tools-logic/bootstrap.js +2 -4
  85. package/dist/tools-logic/bootstrap.js.map +1 -1
  86. package/dist/tools-logic/check-action.d.ts.map +1 -1
  87. package/dist/tools-logic/check-action.js +97 -3
  88. package/dist/tools-logic/check-action.js.map +1 -1
  89. package/dist/tools-logic/check.d.ts +22 -0
  90. package/dist/tools-logic/check.d.ts.map +1 -1
  91. package/dist/tools-logic/check.js +36 -9
  92. package/dist/tools-logic/check.js.map +1 -1
  93. package/dist/tools-logic/export-corrections.js +2 -2
  94. package/dist/tools-logic/export-corrections.js.map +1 -1
  95. package/dist/tools-logic/journal-capture.d.ts.map +1 -1
  96. package/dist/tools-logic/journal-capture.js +53 -36
  97. package/dist/tools-logic/journal-capture.js.map +1 -1
  98. package/dist/tools-logic/journal-write.d.ts.map +1 -1
  99. package/dist/tools-logic/journal-write.js +51 -28
  100. package/dist/tools-logic/journal-write.js.map +1 -1
  101. package/dist/tools-logic/knowledge-read.d.ts.map +1 -1
  102. package/dist/tools-logic/knowledge-read.js +8 -6
  103. package/dist/tools-logic/knowledge-read.js.map +1 -1
  104. package/dist/tools-logic/knowledge-write.d.ts.map +1 -1
  105. package/dist/tools-logic/knowledge-write.js +5 -8
  106. package/dist/tools-logic/knowledge-write.js.map +1 -1
  107. package/dist/tools-logic/palace-write.d.ts.map +1 -1
  108. package/dist/tools-logic/palace-write.js +5 -1
  109. package/dist/tools-logic/palace-write.js.map +1 -1
  110. package/dist/tools-logic/project-board.js +2 -2
  111. package/dist/tools-logic/project-board.js.map +1 -1
  112. package/dist/tools-logic/session-end.d.ts.map +1 -1
  113. package/dist/tools-logic/session-end.js +58 -8
  114. package/dist/tools-logic/session-end.js.map +1 -1
  115. package/dist/tools-logic/session-start.d.ts.map +1 -1
  116. package/dist/tools-logic/session-start.js +34 -10
  117. package/dist/tools-logic/session-start.js.map +1 -1
  118. package/dist/tools-logic/smart-recall.d.ts +93 -1
  119. package/dist/tools-logic/smart-recall.d.ts.map +1 -1
  120. package/dist/tools-logic/smart-recall.js +199 -11
  121. package/dist/tools-logic/smart-recall.js.map +1 -1
  122. package/dist/tools-logic/smart-remember.d.ts.map +1 -1
  123. package/dist/tools-logic/smart-remember.js +12 -0
  124. package/dist/tools-logic/smart-remember.js.map +1 -1
  125. package/dist/tools-logic/store-doctor.d.ts +1 -1
  126. package/dist/tools-logic/store-doctor.d.ts.map +1 -1
  127. package/dist/tools-logic/store-doctor.js +64 -0
  128. package/dist/tools-logic/store-doctor.js.map +1 -1
  129. package/dist/types.d.ts +1 -1
  130. package/dist/types.js +1 -1
  131. package/dist/vector/local-vector-store.d.ts.map +1 -1
  132. package/dist/vector/local-vector-store.js +5 -4
  133. package/dist/vector/local-vector-store.js.map +1 -1
  134. package/package.json +4 -3
  135. package/dist/tools-logic/brief.d.ts +0 -84
  136. package/dist/tools-logic/brief.d.ts.map +0 -1
  137. package/dist/tools-logic/brief.js +0 -193
  138. package/dist/tools-logic/brief.js.map +0 -1
  139. package/dist/tools-logic/dashboard-export.d.ts +0 -130
  140. package/dist/tools-logic/dashboard-export.d.ts.map +0 -1
  141. package/dist/tools-logic/dashboard-export.js +0 -485
  142. package/dist/tools-logic/dashboard-export.js.map +0 -1
  143. package/dist/tools-logic/memory-query.d.ts +0 -43
  144. package/dist/tools-logic/memory-query.d.ts.map +0 -1
  145. package/dist/tools-logic/memory-query.js +0 -77
  146. package/dist/tools-logic/memory-query.js.map +0 -1
  147. package/dist/tools-logic/project-status.d.ts +0 -24
  148. package/dist/tools-logic/project-status.d.ts.map +0 -1
  149. package/dist/tools-logic/project-status.js +0 -155
  150. package/dist/tools-logic/project-status.js.map +0 -1
@@ -3,8 +3,11 @@
3
3
  */
4
4
  import * as fs from "node:fs";
5
5
  import * as path from "node:path";
6
+ import * as crypto from "node:crypto";
6
7
  import { journalDir, journalDirs } from "../storage/paths.js";
7
8
  import { ensureDir } from "../storage/fs-utils.js";
9
+ import { isJournalFile } from "./journal-filter.js";
10
+ import { parseJournalFileName } from "./journal-name-parser.js";
8
11
  /**
9
12
  * List all .md journal files across all directories for a project.
10
13
  * Returns sorted array with most recent first.
@@ -279,4 +282,62 @@ function updateJsonlIndex(project, entries) {
279
282
  }
280
283
  fs.writeFileSync(jsonlPath, lines.join("\n") + "\n", "utf-8");
281
284
  }
285
+ /**
286
+ * W2-2 (naming-v2 spec §4) — regenerate journal/_index.md, the materialized
287
+ * machine fast-path over the journal store: the last 10 entries, newest
288
+ * first, as `| date | saveType | sig | theme | slug |`. Rows are derived by
289
+ * PARSING existing filenames with parseJournalFileName — file CONTENTS are
290
+ * never opened, so this stays cheap even for a large journal directory.
291
+ *
292
+ * `isJournalFile` filters out capture logs, weekly rollups, `index.md`
293
+ * (the pre-existing Obsidian-style index) — and, critically, `_index.md`
294
+ * itself (underscore-prefixed files), so regenerating never counts its own
295
+ * previous output as an 11th entry.
296
+ *
297
+ * ATOMIC (write-temp + rename). NEVER throws: regeneration failure must
298
+ * never fail the journal write that triggered it — errors are logged to
299
+ * stderr as a one-liner and swallowed.
300
+ */
301
+ export function regenerateJournalIndex(project) {
302
+ try {
303
+ const dir = journalDir(project);
304
+ ensureDir(dir);
305
+ const files = fs.readdirSync(dir)
306
+ .filter(isJournalFile)
307
+ .sort()
308
+ .reverse()
309
+ .slice(0, 10);
310
+ const lines = [];
311
+ lines.push("# Journal Index — regenerated on write; do not edit");
312
+ lines.push("");
313
+ lines.push(`Generated: ${new Date().toISOString()}`);
314
+ lines.push(`${files.length} of last 10 entries shown, newest first.`);
315
+ lines.push("");
316
+ lines.push("| date | saveType | sig | theme | slug |");
317
+ lines.push("|---|---|---|---|---|");
318
+ for (const f of files) {
319
+ const parsed = parseJournalFileName(f);
320
+ const date = parsed.date || "—";
321
+ const saveType = parsed.saveType ?? "—";
322
+ const sig = parsed.sig ?? "—";
323
+ const theme = parsed.theme ?? "—";
324
+ const slug = parsed.slug ?? "—";
325
+ lines.push(`| ${date} | ${saveType} | ${sig} | ${theme} | ${slug} |`);
326
+ }
327
+ const content = lines.join("\n") + "\n";
328
+ const indexPath = path.join(dir, "_index.md");
329
+ const tmp = `${indexPath}.tmp-${crypto.randomBytes(4).toString("hex")}`;
330
+ fs.writeFileSync(tmp, content, "utf-8");
331
+ fs.renameSync(tmp, indexPath);
332
+ }
333
+ catch (err) {
334
+ try {
335
+ process.stderr.write(`[agent-recall] journal index regeneration failed for "${project}": ` +
336
+ `${err instanceof Error ? err.message : String(err)}\n`);
337
+ }
338
+ catch {
339
+ /* a diagnostic write must never throw into the caller */
340
+ }
341
+ }
342
+ }
282
343
  //# sourceMappingURL=journal-files.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"journal-files.js","sourceRoot":"","sources":["../../src/helpers/journal-files.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGnD;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAe,EAAE,cAAc,GAAG,KAAK;IACtE,MAAM,IAAI,GAAG,WAAW,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;IAClD,MAAM,OAAO,GAAmB,EAAE,CAAC;IACnC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAE/B,qEAAqE;IACrE,oDAAoD;IACpD,uDAAuD;IACvD,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,GA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K,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CACxD,CAAC;QACJ,CAAC;QAAC,MAAM,CAAC;YACP,yDAAyD;QAC3D,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -2,6 +2,28 @@
2
2
  * Returns true if a filename is a "real" journal entry (not a capture log,
3
3
  * weekly rollup, index, or merged file). Use this everywhere readdirSync
4
4
  * scans journal directories.
5
+ *
6
+ * W2-2 (naming-v2 spec §4, 2026-07-20): also excludes any underscore-prefixed
7
+ * file (`_index.md` and any future materialized-index/marker file). Without
8
+ * this, the new `journal/_index.md` machine fast-path would itself be counted
9
+ * as a journal entry by every consumer of this filter — reproducing the
10
+ * exact v3.4.26 "inflated session count" bug class. Verified call sites:
11
+ * - tools-logic/session-start.ts (session/resume counting) — already safe
12
+ * by construction (each loop also requires a leading YYYY-MM-DD date
13
+ * match before counting, and "_index.md" never matches that), but the
14
+ * underscore guard is added here too as the single source of truth.
15
+ * - tools-logic/project-board.ts — NOT independently safe: it takes
16
+ * `files[0]` after `.sort().reverse()` with NO secondary date-match
17
+ * check. Since "_" (0x5F) sorts AFTER any digit, an un-excluded
18
+ * "_index.md" would become `files[0]` post-reverse, its date-match would
19
+ * fail, and the project would be silently DROPPED from the board — a
20
+ * worse regression than miscounting. This guard is the actual fix for
21
+ * that path (see regression test in materialized-indexes.test.mjs).
22
+ * - tools-logic/recognition-builder.ts — safe by construction (same
23
+ * per-item date-match pattern as session-start.ts) but covered anyway.
24
+ * - storage/project.ts's own local `isJournalFile` copy already requires a
25
+ * leading date match (`/^\d{4}-\d{2}-\d{2}/.test(f)`), so it is
26
+ * independently safe and was intentionally left unchanged.
5
27
  */
6
28
  export declare function isJournalFile(filename: string): boolean;
7
29
  //# sourceMappingURL=journal-filter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"journal-filter.d.ts","sourceRoot":"","sources":["../../src/helpers/journal-filter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CASvD"}
1
+ {"version":3,"file":"journal-filter.d.ts","sourceRoot":"","sources":["../../src/helpers/journal-filter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAUvD"}
@@ -2,10 +2,33 @@
2
2
  * Returns true if a filename is a "real" journal entry (not a capture log,
3
3
  * weekly rollup, index, or merged file). Use this everywhere readdirSync
4
4
  * scans journal directories.
5
+ *
6
+ * W2-2 (naming-v2 spec §4, 2026-07-20): also excludes any underscore-prefixed
7
+ * file (`_index.md` and any future materialized-index/marker file). Without
8
+ * this, the new `journal/_index.md` machine fast-path would itself be counted
9
+ * as a journal entry by every consumer of this filter — reproducing the
10
+ * exact v3.4.26 "inflated session count" bug class. Verified call sites:
11
+ * - tools-logic/session-start.ts (session/resume counting) — already safe
12
+ * by construction (each loop also requires a leading YYYY-MM-DD date
13
+ * match before counting, and "_index.md" never matches that), but the
14
+ * underscore guard is added here too as the single source of truth.
15
+ * - tools-logic/project-board.ts — NOT independently safe: it takes
16
+ * `files[0]` after `.sort().reverse()` with NO secondary date-match
17
+ * check. Since "_" (0x5F) sorts AFTER any digit, an un-excluded
18
+ * "_index.md" would become `files[0]` post-reverse, its date-match would
19
+ * fail, and the project would be silently DROPPED from the board — a
20
+ * worse regression than miscounting. This guard is the actual fix for
21
+ * that path (see regression test in materialized-indexes.test.mjs).
22
+ * - tools-logic/recognition-builder.ts — safe by construction (same
23
+ * per-item date-match pattern as session-start.ts) but covered anyway.
24
+ * - storage/project.ts's own local `isJournalFile` copy already requires a
25
+ * leading date match (`/^\d{4}-\d{2}-\d{2}/.test(f)`), so it is
26
+ * independently safe and was intentionally left unchanged.
5
27
  */
6
28
  export function isJournalFile(filename) {
7
29
  return (filename.endsWith(".md") &&
8
30
  filename !== "index.md" &&
31
+ !filename.startsWith("_") &&
9
32
  !filename.includes("-log.") &&
10
33
  !filename.includes("--capture--") &&
11
34
  !filename.endsWith(".merged.md") &&
@@ -1 +1 @@
1
- {"version":3,"file":"journal-filter.js","sourceRoot":"","sources":["../../src/helpers/journal-filter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,QAAgB;IAC5C,OAAO,CACL,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC;QACxB,QAAQ,KAAK,UAAU;QACvB,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC;QAC3B,CAAC,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC;QACjC,CAAC,QAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC;QAChC,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAC9B,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"journal-filter.js","sourceRoot":"","sources":["../../src/helpers/journal-filter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,aAAa,CAAC,QAAgB;IAC5C,OAAO,CACL,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC;QACxB,QAAQ,KAAK,UAAU;QACvB,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC;QACzB,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC;QAC3B,CAAC,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC;QACjC,CAAC,QAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC;QAChC,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAC9B,CAAC;AACJ,CAAC"}
@@ -1,8 +1,19 @@
1
1
  /**
2
- * Parse journal filenames across all 3 generations:
2
+ * Parse journal filenames across all generations:
3
3
  * Legacy: YYYY-MM-DD.md (or YYYY-MM-DD-sessionid.md)
4
4
  * Old: YYYY-MM-DD--type--NL--slug.md (has {n}L part)
5
- * New: YYYY-MM-DD--type--sig--theme--slug.md
5
+ * Current: YYYY-MM-DD--type--sig--theme--slug.md (fixed 5 parts)
6
+ * v2: YYYY-MM-DD--type--[sig]--[theme]--slug.md (naming-v2 spec §3 —
7
+ * null sig/theme OMITTED rather than printed as "none", so the
8
+ * part count varies 3-5; middle segments are classified by ENUM
9
+ * MEMBERSHIP against SIGNIFICANCE_TAGS/THEME_TAGS, not position,
10
+ * since a 4-part name is otherwise ambiguous between sig-only
11
+ * and theme-only).
12
+ *
13
+ * Cross-generation discrimination is purely structural (no in-name version
14
+ * sentinel — see spec §3 "journal parsing note"): a well-formed v2 name that
15
+ * happens to have BOTH sig and theme present is structurally identical to a
16
+ * "current" 5-part name and is parsed by that same branch, byte-identically.
6
17
  */
7
18
  export interface ParsedJournalName {
8
19
  date: string;
@@ -1 +1 @@
1
- {"version":3,"file":"journal-name-parser.d.ts","sourceRoot":"","sources":["../../src/helpers/journal-name-parser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB,CA8BxE"}
1
+ {"version":3,"file":"journal-name-parser.d.ts","sourceRoot":"","sources":["../../src/helpers/journal-name-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAkBH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB,CAiDxE"}
@@ -1,9 +1,33 @@
1
1
  /**
2
- * Parse journal filenames across all 3 generations:
2
+ * Parse journal filenames across all generations:
3
3
  * Legacy: YYYY-MM-DD.md (or YYYY-MM-DD-sessionid.md)
4
4
  * Old: YYYY-MM-DD--type--NL--slug.md (has {n}L part)
5
- * New: YYYY-MM-DD--type--sig--theme--slug.md
5
+ * Current: YYYY-MM-DD--type--sig--theme--slug.md (fixed 5 parts)
6
+ * v2: YYYY-MM-DD--type--[sig]--[theme]--slug.md (naming-v2 spec §3 —
7
+ * null sig/theme OMITTED rather than printed as "none", so the
8
+ * part count varies 3-5; middle segments are classified by ENUM
9
+ * MEMBERSHIP against SIGNIFICANCE_TAGS/THEME_TAGS, not position,
10
+ * since a 4-part name is otherwise ambiguous between sig-only
11
+ * and theme-only).
12
+ *
13
+ * Cross-generation discrimination is purely structural (no in-name version
14
+ * sentinel — see spec §3 "journal parsing note"): a well-formed v2 name that
15
+ * happens to have BOTH sig and theme present is structurally identical to a
16
+ * "current" 5-part name and is parsed by that same branch, byte-identically.
6
17
  */
18
+ import { SIGNIFICANCE_TAGS, THEME_TAGS } from "./journal-sig-theme.js";
19
+ const SIG_SET = new Set(SIGNIFICANCE_TAGS);
20
+ const THEME_SET = new Set(THEME_TAGS);
21
+ /**
22
+ * v2 save-type anchors (naming-v2 spec §3 journal row). Deliberately
23
+ * duplicated rather than imported from storage/session.ts's `SaveType` union
24
+ * — helpers/ sits below storage/ in the module layering (session.ts already
25
+ * imports FROM helpers/), so importing the other direction here would invert
26
+ * that. storage/session.ts is the source of truth if this list ever grows.
27
+ */
28
+ const SAVE_TYPE_SET = new Set([
29
+ "arsave", "arsaveall", "hook-end", "hook-correction", "capture", "hook-archive",
30
+ ]);
7
31
  export function parseJournalFileName(filename) {
8
32
  // Strip directory prefix if present
9
33
  const base = filename.split("/").pop()?.replace(/\.md$/, "") ?? filename.replace(/\.md$/, "");
@@ -21,6 +45,26 @@ export function parseJournalFileName(filename) {
21
45
  if (parts.length === 4 && /^\d+L$/.test(parts[2])) {
22
46
  return { date, saveType: parts[1], sig: null, theme: null, slug: parts[3], isLegacy: true };
23
47
  }
48
+ // v2: date--type--[sig]--[theme]--slug, 3 or 4 parts, sig/theme omitted
49
+ // when absent. seg[1] must be a known SaveType to anchor this branch
50
+ // (distinguishes a v2 write from an unrelated dashed slug that happens to
51
+ // have 3-4 "--" separated parts). A 4-part name's lone middle segment is
52
+ // classified by enum membership: sig if it's a SignificanceTag, theme if
53
+ // it's a ThemeTag. An unrecognized middle segment fails closed (both null)
54
+ // rather than guessing.
55
+ if ((parts.length === 3 || parts.length === 4) && SAVE_TYPE_SET.has(parts[1])) {
56
+ const slug = parts[parts.length - 1];
57
+ let sig = null;
58
+ let theme = null;
59
+ if (parts.length === 4) {
60
+ const middle = parts[2];
61
+ if (SIG_SET.has(middle))
62
+ sig = middle;
63
+ else if (THEME_SET.has(middle))
64
+ theme = middle;
65
+ }
66
+ return { date, saveType: parts[1], sig, theme, slug, isLegacy: false };
67
+ }
24
68
  // New format: date--type--sig--theme--slug (5 parts)
25
69
  if (parts.length === 5) {
26
70
  return { date, saveType: parts[1], sig: parts[2], theme: parts[3], slug: parts[4], isLegacy: false };
@@ -1 +1 @@
1
- {"version":3,"file":"journal-name-parser.js","sourceRoot":"","sources":["../../src/helpers/journal-name-parser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAWH,MAAM,UAAU,oBAAoB,CAAC,QAAgB;IACnD,oCAAoC;IACpC,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,QAAQ,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" | "audit" | "decision" | "research" | "recovery" | "minor" | "none";
6
6
  export type ThemeTag = "naming-drift" | "mcp-unavailable" | "publish-gate" | "cross-project" | "test-gap" | "silent-failure" | "multi-loop" | "agent-fix" | "version-bump" | "okr-aligned" | "phantom-project" | "none";
7
+ /**
8
+ * Runtime-checkable mirrors of the two type unions above (SAME vocabulary,
9
+ * not new values) — naming-v2 spec §3's journal filename parser needs to
10
+ * classify an unlabeled filename segment by ENUM MEMBERSHIP ("is this token
11
+ * a sig or a theme?") rather than by position, since sig/theme are now
12
+ * omitted when absent and a 4-segment name is positionally ambiguous.
13
+ * journal-name-parser.ts imports these; do not let them drift from the type
14
+ * unions above.
15
+ */
16
+ export declare const SIGNIFICANCE_TAGS: readonly SignificanceTag[];
17
+ export declare const THEME_TAGS: readonly ThemeTag[];
7
18
  /**
8
19
  * Auto-classify significance from summary text.
9
20
  * Check in order, stop at first match. Default: "minor".
@@ -1 +1 @@
1
- {"version":3,"file":"journal-sig-theme.d.ts","sourceRoot":"","sources":["../../src/helpers/journal-sig-theme.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,eAAe,GACvB,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,UAAU,GAChD,OAAO,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,OAAO,GAAG,MAAM,CAAC;AAEtE,MAAM,MAAM,QAAQ,GAChB,cAAc,GAAG,iBAAiB,GAAG,cAAc,GAAG,eAAe,GACrE,UAAU,GAAG,gBAAgB,GAAG,YAAY,GAAG,WAAW,GAC1D,cAAc,GAAG,aAAa,GAAG,iBAAiB,GAAG,MAAM,CAAC;AAEhE;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,CAWhE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,CAkB3D"}
1
+ {"version":3,"file":"journal-sig-theme.d.ts","sourceRoot":"","sources":["../../src/helpers/journal-sig-theme.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,eAAe,GACvB,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,UAAU,GAChD,OAAO,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,OAAO,GAAG,MAAM,CAAC;AAEtE,MAAM,MAAM,QAAQ,GAChB,cAAc,GAAG,iBAAiB,GAAG,cAAc,GAAG,eAAe,GACrE,UAAU,GAAG,gBAAgB,GAAG,YAAY,GAAG,WAAW,GAC1D,cAAc,GAAG,aAAa,GAAG,iBAAiB,GAAG,MAAM,CAAC;AAEhE;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,eAAe,EAGvD,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,SAAS,QAAQ,EAIzC,CAAC;AAEF;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,CAWhE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,CAkB3D"}
@@ -2,6 +2,24 @@
2
2
  * Significance and theme tags for journal filename classification.
3
3
  * sig = per-session importance; theme = recurring cross-session pattern.
4
4
  */
5
+ /**
6
+ * Runtime-checkable mirrors of the two type unions above (SAME vocabulary,
7
+ * not new values) — naming-v2 spec §3's journal filename parser needs to
8
+ * classify an unlabeled filename segment by ENUM MEMBERSHIP ("is this token
9
+ * a sig or a theme?") rather than by position, since sig/theme are now
10
+ * omitted when absent and a 4-segment name is positionally ambiguous.
11
+ * journal-name-parser.ts imports these; do not let them drift from the type
12
+ * unions above.
13
+ */
14
+ export const SIGNIFICANCE_TAGS = [
15
+ "shipped", "milestone", "blocked", "critical",
16
+ "audit", "decision", "research", "recovery", "minor", "none",
17
+ ];
18
+ export const THEME_TAGS = [
19
+ "naming-drift", "mcp-unavailable", "publish-gate", "cross-project",
20
+ "test-gap", "silent-failure", "multi-loop", "agent-fix",
21
+ "version-bump", "okr-aligned", "phantom-project", "none",
22
+ ];
5
23
  /**
6
24
  * Auto-classify significance from summary text.
7
25
  * Check in order, stop at first match. Default: "minor".
@@ -1 +1 @@
1
- {"version":3,"file":"journal-sig-theme.js","sourceRoot":"","sources":["../../src/helpers/journal-sig-theme.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,OAAe;IAC7C,MAAM,CAAC,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAChC,IAAI,8CAA8C,CAAC,IAAI,CAAC,CAAC,CAAC;QAAE,OAAO,SAAS,CAAC;IAC7E,IAAI,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC;QAAE,OAAO,SAAS,CAAC;IAChD,IAAI,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC;QAAE,OAAO,WAAW,CAAC;IAC/E,IAAI,yCAAyC,CAAC,IAAI,CAAC,CAAC,CAAC;QAAE,OAAO,UAAU,CAAC;IACzE,IAAI,oCAAoC,CAAC,IAAI,CAAC,CAAC,CAAC;QAAE,OAAO,OAAO,CAAC;IACjE,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;QAAE,OAAO,UAAU,CAAC;IAC7C,IAAI,iDAAiD,CAAC,IAAI,CAAC,CAAC,CAAC;QAAE,OAAO,UAAU,CAAC;IACjF,IAAI,oCAAoC,CAAC,IAAI,CAAC,CAAC,CAAC;QAAE,OAAO,UAAU,CAAC;IACpE,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAe;IAC/C,MAAM,CAAC,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAChC,8DAA8D;IAC9D,IAAI,+DAA+D,CAAC,IAAI,CAAC,CAAC,CAAC;QAAE,OAAO,cAAc,CAAC;IACnG,IAAI,6CAA6C,CAAC,IAAI,CAA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AAE,OAAO,cAAc,CAAC;IACnG,IAAI,6CAA6C,CAAC,IAAI,CAAC,CAAC,CAAC;QAAE,OAAO,iBAAiB,CAAC;IACpF,IAAI,sDAAsD,CAAC,IAAI,CAAC,CAAC,CAAC;QAAE,OAAO,cAAc,CAAC;IAC1F,IAAI,oEAAoE,CAAC,IAAI,CAAC,CAAC,CAAC;QAAE,OAAO,gBAAgB,CAAC;IAC1G,IAAI,wCAAwC,CAAC,IAAI,CAAC,CAAC,CAAC;QAAE,OAAO,WAAW,CAAC;IACzE,IAAI,wCAAwC,CAAC,IAAI,CAAC,CAAC,CAAC;QAAE,OAAO,cAAc,CAAC;IAC5E,iDAAiD;IACjD,MAAM,YAAY,GAAG,CAAC,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;IAC7G,MAAM,eAAe,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAChE,IAAI,eAAe,CAAC,MAAM,IAAI,CAAC;QAAE,OAAO,eAAe,CAAC;IACxD,IAAI,+CAA+C,CAAC,IAAI,CAAC,CAAC,CAAC;QAAE,OAAO,UAAU,CAAC;IAC/E,IAAI,gDAAgD,CAAC,IAAI,CAAC,CAAC,CAAC;QAAE,OAAO,YAAY,CAAC;IAClF,IAAI,sBAAsB,CAAC,IAAI,CAAC,CAAC,CAAC;QAAE,OAAO,aAAa,CAAC;IACzD,IAAI,wDAAwD,CAAC,IAAI,CAAC,CAAC,CAAC;QAAE,OAAO,iBAAiB,CAAC;IAC/F,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Host profile — the 3-tier lifecycle-capability model behind AgentRecall's
3
+ * "memory arrives unasked" doctrine.
4
+ *
5
+ * The customer's only action is describing intent. Memory lifecycle
6
+ * (session_start / session_end) is invisible runtime machinery — it must
7
+ * never require the customer to type a command. How that invisibility is
8
+ * achieved differs by host:
9
+ *
10
+ * Tier A — hooks Host fires the lifecycle for the agent (Claude Code's
11
+ * SessionStart/Stop hooks). The agent doesn't have to
12
+ * remember anything; calls it makes anyway are safe
13
+ * and idempotent alongside the hooks.
14
+ * Tier B — mcp-instructions
15
+ * MCP is available but no hook fires automatically
16
+ * (Codex, Cursor, raw MCP clients). Nothing saves
17
+ * itself — the AGENT must drive session_start at
18
+ * entry and session_end at exit, unprompted. This is
19
+ * non-negotiable, not optional: on these hosts the
20
+ * MCP `instructions` string (see lifecycleInstructions
21
+ * below) is the only carrier telling the agent it is
22
+ * the sole lifecycle driver.
23
+ * Tier C — manual No MCP session at all — the caller is integrating
24
+ * directly via the SDK or CLI. There is no server
25
+ * `instructions` handshake to piggyback on, so the
26
+ * calling code must invoke session_start/session_end
27
+ * itself.
28
+ *
29
+ * Detection order (resolveHostProfile):
30
+ * 1. Explicit `AR_HOST` env override — always wins, never guessed away.
31
+ * Known values: claude-code, codex, cursor, raw, openclaw, chatbox,
32
+ * generic (all Tier B except claude-code) and sdk, cli (Tier C).
33
+ * An unrecognized explicit value conservatively resolves to Tier B —
34
+ * under-promising "hooks will save you" beats silently losing data.
35
+ * 2. Best-effort inference when AR_HOST is unset:
36
+ * - `CLAUDECODE` or any `CLAUDE_CODE_*` env var present → Tier A
37
+ * (Claude Code sets these in every subprocess it spawns).
38
+ * - Otherwise → Tier B, on the assumption that a process resolving
39
+ * this at all is running as (or on behalf of) an MCP server with
40
+ * no confirmed hook signal. SDK/CLI callers do not get inferred
41
+ * into Tier C — they must pass `AR_HOST=sdk`/`AR_HOST=cli`
42
+ * explicitly, since there is no environment signal that reliably
43
+ * distinguishes "no MCP at all" from "MCP host that just didn't
44
+ * set CLAUDE_CODE_*".
45
+ */
46
+ export type HostTier = "A" | "B" | "C";
47
+ export type Lifecycle = "hook-driven" | "agent-driven" | "manual";
48
+ export interface HostProfile {
49
+ /** Normalized host identifier (explicit AR_HOST value, or an inferred name). */
50
+ host: string;
51
+ tier: HostTier;
52
+ lifecycle: Lifecycle;
53
+ }
54
+ /**
55
+ * Resolve the current host's lifecycle-capability tier.
56
+ *
57
+ * Safe to call repeatedly and cheaply (no I/O) — callers should not cache
58
+ * the result across process env mutations in tests.
59
+ */
60
+ export declare function resolveHostProfile(): HostProfile;
61
+ /**
62
+ * The single canonical source for AgentRecall's lifecycle instructions, one
63
+ * variant per host tier. `packages/mcp-server/src/server.ts` and any
64
+ * documentation describing the lifecycle (e.g. root AGENTS.md) must derive
65
+ * their text from this function rather than hardcoding it, so the two
66
+ * surfaces can never silently diverge again.
67
+ */
68
+ export declare function lifecycleInstructions(tier: HostTier): string;
69
+ //# sourceMappingURL=host-profile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-profile.d.ts","sourceRoot":"","sources":["../src/host-profile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,MAAM,MAAM,QAAQ,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AACvC,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,cAAc,GAAG,QAAQ,CAAC;AAElE,MAAM,WAAW,WAAW;IAC1B,gFAAgF;IAChF,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,SAAS,CAAC;CACtB;AAqBD;;;;;GAKG;AACH,wBAAgB,kBAAkB,IAAI,WAAW,CAqBhD;AAWD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAI5D"}
@@ -0,0 +1,107 @@
1
+ /**
2
+ * Host profile — the 3-tier lifecycle-capability model behind AgentRecall's
3
+ * "memory arrives unasked" doctrine.
4
+ *
5
+ * The customer's only action is describing intent. Memory lifecycle
6
+ * (session_start / session_end) is invisible runtime machinery — it must
7
+ * never require the customer to type a command. How that invisibility is
8
+ * achieved differs by host:
9
+ *
10
+ * Tier A — hooks Host fires the lifecycle for the agent (Claude Code's
11
+ * SessionStart/Stop hooks). The agent doesn't have to
12
+ * remember anything; calls it makes anyway are safe
13
+ * and idempotent alongside the hooks.
14
+ * Tier B — mcp-instructions
15
+ * MCP is available but no hook fires automatically
16
+ * (Codex, Cursor, raw MCP clients). Nothing saves
17
+ * itself — the AGENT must drive session_start at
18
+ * entry and session_end at exit, unprompted. This is
19
+ * non-negotiable, not optional: on these hosts the
20
+ * MCP `instructions` string (see lifecycleInstructions
21
+ * below) is the only carrier telling the agent it is
22
+ * the sole lifecycle driver.
23
+ * Tier C — manual No MCP session at all — the caller is integrating
24
+ * directly via the SDK or CLI. There is no server
25
+ * `instructions` handshake to piggyback on, so the
26
+ * calling code must invoke session_start/session_end
27
+ * itself.
28
+ *
29
+ * Detection order (resolveHostProfile):
30
+ * 1. Explicit `AR_HOST` env override — always wins, never guessed away.
31
+ * Known values: claude-code, codex, cursor, raw, openclaw, chatbox,
32
+ * generic (all Tier B except claude-code) and sdk, cli (Tier C).
33
+ * An unrecognized explicit value conservatively resolves to Tier B —
34
+ * under-promising "hooks will save you" beats silently losing data.
35
+ * 2. Best-effort inference when AR_HOST is unset:
36
+ * - `CLAUDECODE` or any `CLAUDE_CODE_*` env var present → Tier A
37
+ * (Claude Code sets these in every subprocess it spawns).
38
+ * - Otherwise → Tier B, on the assumption that a process resolving
39
+ * this at all is running as (or on behalf of) an MCP server with
40
+ * no confirmed hook signal. SDK/CLI callers do not get inferred
41
+ * into Tier C — they must pass `AR_HOST=sdk`/`AR_HOST=cli`
42
+ * explicitly, since there is no environment signal that reliably
43
+ * distinguishes "no MCP at all" from "MCP host that just didn't
44
+ * set CLAUDE_CODE_*".
45
+ */
46
+ /** Known `AR_HOST` values and the tier they map to. Unlisted values default to Tier B (see resolveHostProfile). */
47
+ const KNOWN_HOST_TIERS = {
48
+ "claude-code": "A",
49
+ "codex": "B",
50
+ "cursor": "B",
51
+ "raw": "B",
52
+ "openclaw": "B",
53
+ "chatbox": "B",
54
+ "generic": "B",
55
+ "sdk": "C",
56
+ "cli": "C",
57
+ };
58
+ function tierToLifecycle(tier) {
59
+ if (tier === "A")
60
+ return "hook-driven";
61
+ if (tier === "C")
62
+ return "manual";
63
+ return "agent-driven";
64
+ }
65
+ /**
66
+ * Resolve the current host's lifecycle-capability tier.
67
+ *
68
+ * Safe to call repeatedly and cheaply (no I/O) — callers should not cache
69
+ * the result across process env mutations in tests.
70
+ */
71
+ export function resolveHostProfile() {
72
+ const explicit = process.env["AR_HOST"]?.trim().toLowerCase();
73
+ if (explicit) {
74
+ // Unknown explicit host names default to Tier B, never Tier A — a host
75
+ // must be a KNOWN hook-driven host to earn the "hooks will save you" claim.
76
+ const tier = KNOWN_HOST_TIERS[explicit] ?? "B";
77
+ return { host: explicit, tier, lifecycle: tierToLifecycle(tier) };
78
+ }
79
+ const hasClaudeCodeSignal = Boolean(process.env["CLAUDECODE"]) ||
80
+ Object.keys(process.env).some((key) => key.startsWith("CLAUDE_CODE_"));
81
+ if (hasClaudeCodeSignal) {
82
+ return { host: "claude-code", tier: "A", lifecycle: "hook-driven" };
83
+ }
84
+ // No AR_HOST, no Claude Code signal — conservatively assume an MCP host
85
+ // with no confirmed hooks (Tier B). This is the correct default for
86
+ // packages/mcp-server, which is the only caller that resolves this
87
+ // without an explicit AR_HOST today.
88
+ return { host: "mcp", tier: "B", lifecycle: "agent-driven" };
89
+ }
90
+ const TIER_A_INSTRUCTIONS = "AgentRecall is your memory across sessions. In this host, lifecycle hooks call session_start automatically at session entry and session_end at session exit — you do not need to drive the lifecycle yourself. session_start, session_end, remember, recall, and check remain safe to call directly at any time; those calls are idempotent alongside the hooks. DURABLE INTENT still applies: the moment you or the user says save / remember / checkpoint / 记住 / 保存, call session_end (or remember for a single fact) immediately rather than waiting for the exit hook.";
91
+ const TIER_B_INSTRUCTIONS = "AgentRecall is your memory across sessions. YOU drive its lifecycle — no harness fires it for you; if you don't call these tools, nothing is saved. (1) ENTRY: when a session resumes prior work, call session_start FIRST, before acting. (2) DURABLE INTENT: the moment you or the user says save / remember / checkpoint / 记住 / 保存, call session_end (or remember for a single fact). Saying it is not saving it. (3) EXIT: before you stop, call session_end. recall and check are safe to call freely, any time. Hooks auto-fire only in Claude Code; in every other host (Codex, chatbox, raw API) you are the sole lifecycle driver.";
92
+ const TIER_C_INSTRUCTIONS = "AgentRecall has no MCP session and no hooks here — this is a direct SDK/CLI integration. Nothing saves itself: call session_start (or `ar cold-start`) yourself when a run begins, session_end (or `ar saveall`) yourself before it ends, and remember/recall on demand. Saying it is not saving it.";
93
+ /**
94
+ * The single canonical source for AgentRecall's lifecycle instructions, one
95
+ * variant per host tier. `packages/mcp-server/src/server.ts` and any
96
+ * documentation describing the lifecycle (e.g. root AGENTS.md) must derive
97
+ * their text from this function rather than hardcoding it, so the two
98
+ * surfaces can never silently diverge again.
99
+ */
100
+ export function lifecycleInstructions(tier) {
101
+ if (tier === "A")
102
+ return TIER_A_INSTRUCTIONS;
103
+ if (tier === "C")
104
+ return TIER_C_INSTRUCTIONS;
105
+ return TIER_B_INSTRUCTIONS;
106
+ }
107
+ //# sourceMappingURL=host-profile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-profile.js","sourceRoot":"","sources":["../src/host-profile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAYH,mHAAmH;AACnH,MAAM,gBAAgB,GAAuC;IAC3D,aAAa,EAAE,GAAG;IAClB,OAAO,EAAE,GAAG;IACZ,QAAQ,EAAE,GAAG;IACb,KAAK,EAAE,GAAG;IACV,UAAU,EAAE,GAAG;IACf,SAAS,EAAE,GAAG;IACd,SAAS,EAAE,GAAG;IACd,KAAK,EAAE,GAAG;IACV,KAAK,EAAE,GAAG;CACX,CAAC;AAEF,SAAS,eAAe,CAAC,IAAc;IACrC,IAAI,IAAI,KAAK,GAAG;QAAE,O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AAI,IAAI,KAAK,GAAG;QAAE,OAAO,mBAAmB,CAAC;IAC7C,IAAI,IAAI,KAAK,GAAG;QAAE,OAAO,mBAAmB,CAAC;IAC7C,OAAO,mBAAmB,CAAC;AAC7B,CAAC"}
package/dist/index.d.ts CHANGED
@@ -51,7 +51,12 @@ export { checkAction, tokenize, overlap } from "./tools-logic/check-action.js";
51
51
  export type { CheckActionInput, CheckActionResult, RuleMatch, CorrectionMatch, InsightMatch, } from "./tools-logic/check-action.js";
52
52
  export { getSessionId, journalFileName, captureLogFileName, resetOwnedFiles, resetSessionState } from "./storage/session.js";
53
53
  export type { SaveType, SmartNameOpts } from "./storage/session.js";
54
+ export { claimSessionStartOnce, getCachedSessionEnd, setCachedSessionEnd, resetIdempotencyState, } from "./storage/session.js";
55
+ export { recordLifecycleEvent, lifecycleStats } from "./storage/lifecycle-telemetry.js";
56
+ export type { LifecycleEvent, LifecycleTelemetryRow, LifecycleStats } from "./storage/lifecycle-telemetry.js";
54
57
  export { acquireLock, withLock, STALE_LOCK_MS } from "./storage/filelock.js";
58
+ export { resolveHostProfile, lifecycleInstructions } from "./host-profile.js";
59
+ export type { HostTier, Lifecycle, HostProfile } from "./host-profile.js";
55
60
  export { writeCorrection, readCorrections, readActiveCorrections, readP0Corrections, retractCorrection, isLikelyRealCorrection, dropHardNoise, logRejectedCorrection, readRejectedCorrections, getRejectedStats, GATE_VERSION, splitSentences, isStaleCorrection, reviewNoiseCorrections, rankCorrections, } from "./storage/corrections.js";
56
61
  export type { CorrectionRecord, WriteCorrectionResult, RetractCorrectionResult, RejectedCorrectionRecord, RejectedStats, NoiseReview, } from "./storage/corrections.js";
57
62
  export { detectCorrectionConflicts, reviewSupersessions } from "./tools-logic/supersession.js";
@@ -171,8 +176,8 @@ export { skillRecall } from "./tools-logic/skill-recall.js";
171
176
  export type { SkillRecallInput, SkillRecallResult, SkillRecallHit } from "./tools-logic/skill-recall.js";
172
177
  export { skillList } from "./tools-logic/skill-list.js";
173
178
  export type { SkillListInput, SkillListResult, SkillListItem } from "./tools-logic/skill-list.js";
174
- export { recordOutcome, getCorrectionKPIs, readOutcomesForToday, readOutcomesBefore, readOutcomesOnDate, readAllOutcomeKinds, listUnknownVerdicts, } from "./storage/corrections.js";
175
- export type { CorrectionOutcome, CorrectionKPI, UnknownVerdictCandidate } from "./storage/corrections.js";
179
+ export { recordOutcome, getCorrectionKPIs, readOutcomesForToday, readOutcomesBefore, readOutcomesOnDate, readAllOutcomeKinds, listUnknownVerdicts, runOutcomesRebuild, recomputeCorrectionCounters, computeLedgerDivergence, } from "./storage/corrections.js";
180
+ export type { CorrectionOutcome, CorrectionKPI, UnknownVerdictCandidate, MalformedOutcomeRow, RecomputedCounters, DivergenceEntry, OutcomesRebuildOptions, OutcomesRebuildCorrectionDiff, OutcomesRebuildResult, } from "./storage/corrections.js";
176
181
  export { deriveBlindSpots } from "./helpers/blind-spots.js";
177
182
  export type { BlindSpot, BlindSpotProfile } from "./helpers/blind-spots.js";
178
183
  export { writeBlindSpots, readBlindSpots, recomputeBlindSpots } from "./storage/blind-spots-store.js";