@remnic/core 1.1.0 → 1.1.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 (287) hide show
  1. package/dist/access-audit.d.ts +56 -0
  2. package/dist/access-audit.js +9 -0
  3. package/dist/access-cli.js +62 -45
  4. package/dist/access-cli.js.map +1 -1
  5. package/dist/access-http.d.ts +16 -9
  6. package/dist/access-http.js +25 -17
  7. package/dist/access-mcp.d.ts +16 -9
  8. package/dist/access-mcp.js +29 -7
  9. package/dist/access-schema.d.ts +124 -33
  10. package/dist/access-schema.js +5 -1
  11. package/dist/{access-service-HmO1Trrx.d.ts → access-service-Br8ZydTK.d.ts} +158 -63
  12. package/dist/access-service.d.ts +13 -6
  13. package/dist/access-service.js +22 -14
  14. package/dist/bootstrap.d.ts +6 -3
  15. package/dist/briefing.d.ts +1 -0
  16. package/dist/briefing.js +7 -6
  17. package/dist/buffer-surprise-report.d.ts +70 -0
  18. package/dist/buffer-surprise-report.js +7 -0
  19. package/dist/buffer-surprise-report.js.map +1 -0
  20. package/dist/buffer-surprise.d.ts +98 -0
  21. package/dist/buffer-surprise.js +11 -0
  22. package/dist/buffer-surprise.js.map +1 -0
  23. package/dist/buffer.d.ts +100 -2
  24. package/dist/buffer.js +1 -1
  25. package/dist/calibration.js +5 -5
  26. package/dist/causal-behavior.js +4 -4
  27. package/dist/causal-chain.js +2 -2
  28. package/dist/causal-consolidation.js +17 -16
  29. package/dist/causal-consolidation.js.map +1 -1
  30. package/dist/causal-retrieval.js +4 -4
  31. package/dist/causal-trajectory.js +1 -1
  32. package/dist/{chunk-QNJMBKFK.js → chunk-2LGMW3DJ.js} +3 -2
  33. package/dist/chunk-2LGMW3DJ.js.map +1 -0
  34. package/dist/{chunk-QDYXG4CS.js → chunk-3FPTCC3Z.js} +4 -3
  35. package/dist/chunk-3FPTCC3Z.js.map +1 -0
  36. package/dist/chunk-3GPTTA4J.js +57 -0
  37. package/dist/chunk-3GPTTA4J.js.map +1 -0
  38. package/dist/{chunk-44ICJRF3.js → chunk-3GXCSUXR.js} +4 -4
  39. package/dist/{chunk-ITRLGI2T.js → chunk-3OGMS3PE.js} +2 -2
  40. package/dist/chunk-54V4BZWP.js +139 -0
  41. package/dist/chunk-54V4BZWP.js.map +1 -0
  42. package/dist/chunk-5JRF2PZA.js +67 -0
  43. package/dist/chunk-5JRF2PZA.js.map +1 -0
  44. package/dist/chunk-64NJRYU2.js +332 -0
  45. package/dist/chunk-64NJRYU2.js.map +1 -0
  46. package/dist/{chunk-OIT5QGG4.js → chunk-6AUUAZEX.js} +72 -2
  47. package/dist/chunk-6AUUAZEX.js.map +1 -0
  48. package/dist/{chunk-ZVBB3T7V.js → chunk-7I7FKFZH.js} +24 -22
  49. package/dist/chunk-7I7FKFZH.js.map +1 -0
  50. package/dist/chunk-AJU4PJGY.js +126 -0
  51. package/dist/chunk-AJU4PJGY.js.map +1 -0
  52. package/dist/chunk-ASAITVLA.js +64 -0
  53. package/dist/chunk-ASAITVLA.js.map +1 -0
  54. package/dist/{chunk-3QHL5ABG.js → chunk-B5WXLVDY.js} +187 -6
  55. package/dist/chunk-B5WXLVDY.js.map +1 -0
  56. package/dist/{chunk-SYUK3VLY.js → chunk-BGJGXLZ7.js} +111 -2
  57. package/dist/{chunk-SYUK3VLY.js.map → chunk-BGJGXLZ7.js.map} +1 -1
  58. package/dist/{chunk-MBJHSA7F.js → chunk-BK2EFTE2.js} +258 -13
  59. package/dist/chunk-BK2EFTE2.js.map +1 -0
  60. package/dist/chunk-C4SQJZAF.js +486 -0
  61. package/dist/chunk-C4SQJZAF.js.map +1 -0
  62. package/dist/{chunk-6UJ47TVX.js → chunk-CUPFXL3J.js} +2 -2
  63. package/dist/chunk-DF3RVK3X.js +119 -0
  64. package/dist/chunk-DF3RVK3X.js.map +1 -0
  65. package/dist/{chunk-37UIFYWO.js → chunk-DFTTJYSO.js} +108 -9
  66. package/dist/chunk-DFTTJYSO.js.map +1 -0
  67. package/dist/chunk-DGVM5SFL.js +69 -0
  68. package/dist/chunk-DGVM5SFL.js.map +1 -0
  69. package/dist/chunk-EIR5VLIH.js +90 -0
  70. package/dist/chunk-EIR5VLIH.js.map +1 -0
  71. package/dist/{chunk-PAORGQRI.js → chunk-EPQJM2GC.js} +37 -23
  72. package/dist/chunk-EPQJM2GC.js.map +1 -0
  73. package/dist/{chunk-GV6NLQ4X.js → chunk-F5VP6YCB.js} +374 -16
  74. package/dist/chunk-F5VP6YCB.js.map +1 -0
  75. package/dist/{chunk-6ZH4TU6I.js → chunk-FAAFWE4G.js} +2 -1
  76. package/dist/chunk-FAAFWE4G.js.map +1 -0
  77. package/dist/{chunk-7WQ6SLIE.js → chunk-FVA6TGI3.js} +2 -2
  78. package/dist/chunk-GDFS42HT.js +206 -0
  79. package/dist/chunk-GDFS42HT.js.map +1 -0
  80. package/dist/{chunk-MVTHXUBX.js → chunk-GKFXUTJ2.js} +479 -20
  81. package/dist/chunk-GKFXUTJ2.js.map +1 -0
  82. package/dist/{chunk-NQEVYWX6.js → chunk-HK3FGIEW.js} +209 -5
  83. package/dist/chunk-HK3FGIEW.js.map +1 -0
  84. package/dist/chunk-IISBCCWR.js +52 -0
  85. package/dist/chunk-IISBCCWR.js.map +1 -0
  86. package/dist/{chunk-WBSAYXVI.js → chunk-INXV5JBT.js} +198 -42
  87. package/dist/chunk-INXV5JBT.js.map +1 -0
  88. package/dist/chunk-JBMSGZEQ.js +441 -0
  89. package/dist/chunk-JBMSGZEQ.js.map +1 -0
  90. package/dist/{chunk-J4IYOZZ5.js → chunk-JXS5PDQ7.js} +3 -1
  91. package/dist/chunk-JXS5PDQ7.js.map +1 -0
  92. package/dist/{chunk-6LX5ORAS.js → chunk-KUB6JU6H.js} +4 -4
  93. package/dist/chunk-KVBLZUKV.js +173 -0
  94. package/dist/chunk-KVBLZUKV.js.map +1 -0
  95. package/dist/chunk-LBLXEFWK.js +51 -0
  96. package/dist/chunk-LBLXEFWK.js.map +1 -0
  97. package/dist/{chunk-3WHVNEN7.js → chunk-LTCGGW2D.js} +1 -1
  98. package/dist/chunk-LTCGGW2D.js.map +1 -0
  99. package/dist/{chunk-UEYA6UC7.js → chunk-NZLQTHS5.js} +25 -2
  100. package/dist/chunk-NZLQTHS5.js.map +1 -0
  101. package/dist/chunk-PVPWZSSI.js +37 -0
  102. package/dist/chunk-PVPWZSSI.js.map +1 -0
  103. package/dist/{chunk-4NRAJUDS.js → chunk-RBBWYEFJ.js} +1 -1
  104. package/dist/chunk-RFYAYKTD.js +146 -0
  105. package/dist/chunk-RFYAYKTD.js.map +1 -0
  106. package/dist/{chunk-DHHP2Z4X.js → chunk-RGLL5SPU.js} +2 -2
  107. package/dist/{chunk-3SV6CQHO.js → chunk-S3EEFKNY.js} +101 -65
  108. package/dist/chunk-S3EEFKNY.js.map +1 -0
  109. package/dist/chunk-SOBJ6NEY.js +18 -0
  110. package/dist/chunk-SOBJ6NEY.js.map +1 -0
  111. package/dist/{chunk-JIU55F3X.js → chunk-SPI27QT6.js} +2 -2
  112. package/dist/chunk-TVVEYCNW.js +65 -0
  113. package/dist/chunk-TVVEYCNW.js.map +1 -0
  114. package/dist/chunk-ULYOGL6R.js +322 -0
  115. package/dist/chunk-ULYOGL6R.js.map +1 -0
  116. package/dist/{chunk-47UU5PU2.js → chunk-VBVG2M5G.js} +18 -3
  117. package/dist/chunk-VBVG2M5G.js.map +1 -0
  118. package/dist/{chunk-7ECD5ATE.js → chunk-VDX363PS.js} +2 -2
  119. package/dist/{chunk-DEPL3635.js → chunk-VYM3VWOF.js} +1432 -188
  120. package/dist/chunk-VYM3VWOF.js.map +1 -0
  121. package/dist/{chunk-MTLYEMJB.js → chunk-WCLICCGB.js} +18 -3
  122. package/dist/chunk-WCLICCGB.js.map +1 -0
  123. package/dist/{chunk-4LACOVZX.js → chunk-WVVA7F5A.js} +2 -2
  124. package/dist/chunk-X6GF3FX2.js +26 -0
  125. package/dist/chunk-X6GF3FX2.js.map +1 -0
  126. package/dist/{chunk-3QFQGRHO.js → chunk-XMHBH5H6.js} +4 -4
  127. package/dist/{chunk-BLKTA7MM.js → chunk-YNQKWQT4.js} +50 -17
  128. package/dist/chunk-YNQKWQT4.js.map +1 -0
  129. package/dist/chunk-ZAIM4TUE.js +488 -0
  130. package/dist/chunk-ZAIM4TUE.js.map +1 -0
  131. package/dist/{chunk-N42IWANG.js → chunk-ZEM3OK2K.js} +2 -2
  132. package/dist/chunk-ZZTOURJI.js +91 -0
  133. package/dist/chunk-ZZTOURJI.js.map +1 -0
  134. package/dist/{cli-BneVIEvh.d.ts → cli-BkeRaYfk.d.ts} +2 -2
  135. package/dist/cli.d.ts +13 -6
  136. package/dist/cli.js +40 -29
  137. package/dist/config.js +1 -1
  138. package/dist/consolidation-operator.d.ts +41 -0
  139. package/dist/consolidation-operator.js +11 -0
  140. package/dist/consolidation-operator.js.map +1 -0
  141. package/dist/consolidation-provenance-check.d.ts +68 -0
  142. package/dist/consolidation-provenance-check.js +9 -0
  143. package/dist/consolidation-provenance-check.js.map +1 -0
  144. package/dist/consolidation-undo.d.ts +123 -0
  145. package/dist/consolidation-undo.js +426 -0
  146. package/dist/consolidation-undo.js.map +1 -0
  147. package/dist/{contradiction-scan-GR33PONM.js → contradiction-scan-E3GJTI4F.js} +43 -7
  148. package/dist/contradiction-scan-E3GJTI4F.js.map +1 -0
  149. package/dist/cross-namespace-budget.d.ts +133 -0
  150. package/dist/cross-namespace-budget.js +9 -0
  151. package/dist/cross-namespace-budget.js.map +1 -0
  152. package/dist/direct-answer-wiring.js +5 -70
  153. package/dist/direct-answer-wiring.js.map +1 -1
  154. package/dist/{engine-5TIQBYZR.js → engine-F3GOXGE5.js} +8 -7
  155. package/dist/engine-F3GOXGE5.js.map +1 -0
  156. package/dist/entity-retrieval.d.ts +1 -0
  157. package/dist/entity-retrieval.js +7 -6
  158. package/dist/explicit-capture.d.ts +6 -3
  159. package/dist/explicit-capture.js +2 -2
  160. package/dist/extraction-judge-telemetry.d.ts +113 -0
  161. package/dist/extraction-judge-telemetry.js +14 -0
  162. package/dist/extraction-judge-telemetry.js.map +1 -0
  163. package/dist/extraction-judge-training.d.ts +85 -0
  164. package/dist/extraction-judge-training.js +16 -0
  165. package/dist/extraction-judge-training.js.map +1 -0
  166. package/dist/extraction-judge.d.ts +124 -2
  167. package/dist/extraction-judge.js +11 -1
  168. package/dist/extraction.js +6 -5
  169. package/dist/fallback-llm.js +2 -2
  170. package/dist/graph-recall.d.ts +100 -0
  171. package/dist/graph-recall.js +8 -0
  172. package/dist/graph-recall.js.map +1 -0
  173. package/dist/graph-retrieval.d.ts +271 -0
  174. package/dist/graph-retrieval.js +21 -0
  175. package/dist/graph-retrieval.js.map +1 -0
  176. package/dist/importance.js +1 -1
  177. package/dist/index.d.ts +585 -20
  178. package/dist/index.js +503 -312
  179. package/dist/index.js.map +1 -1
  180. package/dist/memory-worth-bench.d.ts +51 -0
  181. package/dist/memory-worth-bench.js +131 -0
  182. package/dist/memory-worth-bench.js.map +1 -0
  183. package/dist/memory-worth-filter.d.ts +128 -0
  184. package/dist/memory-worth-filter.js +10 -0
  185. package/dist/memory-worth-filter.js.map +1 -0
  186. package/dist/memory-worth-outcomes.d.ts +118 -0
  187. package/dist/memory-worth-outcomes.js +9 -0
  188. package/dist/memory-worth-outcomes.js.map +1 -0
  189. package/dist/memory-worth.d.ts +102 -0
  190. package/dist/memory-worth.js +7 -0
  191. package/dist/memory-worth.js.map +1 -0
  192. package/dist/operator-toolkit.d.ts +40 -1
  193. package/dist/operator-toolkit.js +23 -14
  194. package/dist/{orchestrator-DRYA6_lW.d.ts → orchestrator-CmJ-NTdJ.d.ts} +233 -8
  195. package/dist/orchestrator.d.ts +6 -3
  196. package/dist/orchestrator.js +49 -39
  197. package/dist/page-versioning.d.ts +12 -1
  198. package/dist/page-versioning.js +5 -3
  199. package/dist/{port-C1GZFv8h.d.ts → port-BADbLZU5.d.ts} +2 -2
  200. package/dist/qmd-recall-cache.d.ts +1 -1
  201. package/dist/qmd.d.ts +5 -3
  202. package/dist/qmd.js +1 -1
  203. package/dist/reasoning-trace-recall.d.ts +90 -0
  204. package/dist/reasoning-trace-recall.js +13 -0
  205. package/dist/reasoning-trace-recall.js.map +1 -0
  206. package/dist/reasoning-trace-types.d.ts +54 -0
  207. package/dist/reasoning-trace-types.js +17 -0
  208. package/dist/reasoning-trace-types.js.map +1 -0
  209. package/dist/recall-audit-anomaly.d.ts +112 -0
  210. package/dist/recall-audit-anomaly.js +11 -0
  211. package/dist/recall-audit-anomaly.js.map +1 -0
  212. package/dist/recall-audit.js +5 -44
  213. package/dist/recall-audit.js.map +1 -1
  214. package/dist/recall-explain-renderer.d.ts +49 -0
  215. package/dist/recall-explain-renderer.js +18 -0
  216. package/dist/recall-explain-renderer.js.map +1 -0
  217. package/dist/recall-state.d.ts +12 -1
  218. package/dist/recall-state.js +1 -1
  219. package/dist/recall-xray-cli.d.ts +40 -0
  220. package/dist/recall-xray-cli.js +11 -0
  221. package/dist/recall-xray-cli.js.map +1 -0
  222. package/dist/recall-xray-renderer.d.ts +44 -0
  223. package/dist/recall-xray-renderer.js +18 -0
  224. package/dist/recall-xray-renderer.js.map +1 -0
  225. package/dist/recall-xray.d.ts +179 -0
  226. package/dist/recall-xray.js +13 -0
  227. package/dist/recall-xray.js.map +1 -0
  228. package/dist/resume-bundles.js +5 -5
  229. package/dist/retrieval-agents.d.ts +1 -1
  230. package/dist/retrieval-tiers.d.ts +17 -0
  231. package/dist/retrieval-tiers.js +9 -0
  232. package/dist/retrieval-tiers.js.map +1 -0
  233. package/dist/schemas.d.ts +287 -31
  234. package/dist/schemas.js +1 -1
  235. package/dist/{semantic-consolidation-DrvSYRdB.d.ts → semantic-consolidation-CxJU6MJk.d.ts} +62 -1
  236. package/dist/semantic-consolidation.d.ts +2 -1
  237. package/dist/semantic-consolidation.js +21 -7
  238. package/dist/semantic-rule-promotion.js +7 -6
  239. package/dist/semantic-rule-verifier.js +7 -6
  240. package/dist/storage.d.ts +82 -1
  241. package/dist/storage.js +6 -5
  242. package/dist/summarizer.js +3 -3
  243. package/dist/temporal-supersession.d.ts +1 -0
  244. package/dist/tier-migration.d.ts +2 -1
  245. package/dist/types.d.ts +276 -2
  246. package/dist/types.js +1 -1
  247. package/dist/verified-recall.js +7 -6
  248. package/package.json +1 -1
  249. package/dist/chunk-37UIFYWO.js.map +0 -1
  250. package/dist/chunk-3QHL5ABG.js.map +0 -1
  251. package/dist/chunk-3SV6CQHO.js.map +0 -1
  252. package/dist/chunk-3WHVNEN7.js.map +0 -1
  253. package/dist/chunk-47UU5PU2.js.map +0 -1
  254. package/dist/chunk-6ZH4TU6I.js.map +0 -1
  255. package/dist/chunk-BLKTA7MM.js.map +0 -1
  256. package/dist/chunk-DEPL3635.js.map +0 -1
  257. package/dist/chunk-GV6NLQ4X.js.map +0 -1
  258. package/dist/chunk-J4IYOZZ5.js.map +0 -1
  259. package/dist/chunk-LAYN4LDC.js +0 -267
  260. package/dist/chunk-LAYN4LDC.js.map +0 -1
  261. package/dist/chunk-MBJHSA7F.js.map +0 -1
  262. package/dist/chunk-MTLYEMJB.js.map +0 -1
  263. package/dist/chunk-MVTHXUBX.js.map +0 -1
  264. package/dist/chunk-NQEVYWX6.js.map +0 -1
  265. package/dist/chunk-OIT5QGG4.js.map +0 -1
  266. package/dist/chunk-PAORGQRI.js.map +0 -1
  267. package/dist/chunk-QDYXG4CS.js.map +0 -1
  268. package/dist/chunk-QNJMBKFK.js.map +0 -1
  269. package/dist/chunk-UEYA6UC7.js.map +0 -1
  270. package/dist/chunk-UVJFDP7P.js +0 -202
  271. package/dist/chunk-UVJFDP7P.js.map +0 -1
  272. package/dist/chunk-WBSAYXVI.js.map +0 -1
  273. package/dist/chunk-ZVBB3T7V.js.map +0 -1
  274. package/dist/contradiction-scan-GR33PONM.js.map +0 -1
  275. /package/dist/{engine-5TIQBYZR.js.map → access-audit.js.map} +0 -0
  276. /package/dist/{chunk-44ICJRF3.js.map → chunk-3GXCSUXR.js.map} +0 -0
  277. /package/dist/{chunk-ITRLGI2T.js.map → chunk-3OGMS3PE.js.map} +0 -0
  278. /package/dist/{chunk-6UJ47TVX.js.map → chunk-CUPFXL3J.js.map} +0 -0
  279. /package/dist/{chunk-7WQ6SLIE.js.map → chunk-FVA6TGI3.js.map} +0 -0
  280. /package/dist/{chunk-6LX5ORAS.js.map → chunk-KUB6JU6H.js.map} +0 -0
  281. /package/dist/{chunk-4NRAJUDS.js.map → chunk-RBBWYEFJ.js.map} +0 -0
  282. /package/dist/{chunk-DHHP2Z4X.js.map → chunk-RGLL5SPU.js.map} +0 -0
  283. /package/dist/{chunk-JIU55F3X.js.map → chunk-SPI27QT6.js.map} +0 -0
  284. /package/dist/{chunk-7ECD5ATE.js.map → chunk-VDX363PS.js.map} +0 -0
  285. /package/dist/{chunk-4LACOVZX.js.map → chunk-WVVA7F5A.js.map} +0 -0
  286. /package/dist/{chunk-3QFQGRHO.js.map → chunk-XMHBH5H6.js.map} +0 -0
  287. /package/dist/{chunk-N42IWANG.js.map → chunk-ZEM3OK2K.js.map} +0 -0
package/dist/schemas.d.ts CHANGED
@@ -7,13 +7,13 @@ declare const MemoryActionEligibilityContextSchema: z.ZodObject<{
7
7
  importance: z.ZodNumber;
8
8
  source: z.ZodEnum<["extraction", "consolidation", "replay", "manual", "unknown"]>;
9
9
  }, "strict", z.ZodTypeAny, {
10
+ source: "extraction" | "consolidation" | "replay" | "manual" | "unknown";
10
11
  confidence: number;
11
- source: "unknown" | "extraction" | "consolidation" | "replay" | "manual";
12
12
  lifecycleState: "active" | "archived" | "candidate" | "validated" | "stale";
13
13
  importance: number;
14
14
  }, {
15
+ source: "extraction" | "consolidation" | "replay" | "manual" | "unknown";
15
16
  confidence: number;
16
- source: "unknown" | "extraction" | "consolidation" | "replay" | "manual";
17
17
  lifecycleState: "active" | "archived" | "candidate" | "validated" | "stale";
18
18
  importance: number;
19
19
  }>;
@@ -54,7 +54,7 @@ declare const ProcedureStepExtractSchema: z.ZodObject<{
54
54
  optional?: boolean | null | undefined;
55
55
  }>;
56
56
  declare const ExtractedFactSchema: z.ZodObject<{
57
- category: z.ZodEnum<["fact", "preference", "correction", "entity", "decision", "relationship", "principle", "commitment", "moment", "skill", "rule", "procedure"]>;
57
+ category: z.ZodEnum<["fact", "preference", "correction", "entity", "decision", "relationship", "principle", "commitment", "moment", "skill", "rule", "procedure", "reasoning_trace"]>;
58
58
  content: z.ZodString;
59
59
  confidence: z.ZodNumber;
60
60
  tags: z.ZodArray<z.ZodString, "many">;
@@ -95,11 +95,63 @@ declare const ExtractedFactSchema: z.ZodObject<{
95
95
  expectedOutcome?: string | null | undefined;
96
96
  optional?: boolean | null | undefined;
97
97
  }>, "many">>>;
98
+ reasoningTrace: z.ZodNullable<z.ZodOptional<z.ZodEffects<z.ZodObject<{
99
+ steps: z.ZodArray<z.ZodObject<{
100
+ order: z.ZodNumber;
101
+ description: z.ZodString;
102
+ }, "strip", z.ZodTypeAny, {
103
+ description: string;
104
+ order: number;
105
+ }, {
106
+ description: string;
107
+ order: number;
108
+ }>, "many">;
109
+ finalAnswer: z.ZodNullable<z.ZodOptional<z.ZodString>>;
110
+ final_answer: z.ZodNullable<z.ZodOptional<z.ZodString>>;
111
+ observedOutcome: z.ZodNullable<z.ZodOptional<z.ZodString>>;
112
+ observed_outcome: z.ZodNullable<z.ZodOptional<z.ZodString>>;
113
+ }, "strip", z.ZodTypeAny, {
114
+ steps: {
115
+ description: string;
116
+ order: number;
117
+ }[];
118
+ finalAnswer?: string | null | undefined;
119
+ final_answer?: string | null | undefined;
120
+ observedOutcome?: string | null | undefined;
121
+ observed_outcome?: string | null | undefined;
122
+ }, {
123
+ steps: {
124
+ description: string;
125
+ order: number;
126
+ }[];
127
+ finalAnswer?: string | null | undefined;
128
+ final_answer?: string | null | undefined;
129
+ observedOutcome?: string | null | undefined;
130
+ observed_outcome?: string | null | undefined;
131
+ }>, {
132
+ steps: {
133
+ description: string;
134
+ order: number;
135
+ }[];
136
+ finalAnswer?: string | null | undefined;
137
+ final_answer?: string | null | undefined;
138
+ observedOutcome?: string | null | undefined;
139
+ observed_outcome?: string | null | undefined;
140
+ }, {
141
+ steps: {
142
+ description: string;
143
+ order: number;
144
+ }[];
145
+ finalAnswer?: string | null | undefined;
146
+ final_answer?: string | null | undefined;
147
+ observedOutcome?: string | null | undefined;
148
+ observed_outcome?: string | null | undefined;
149
+ }>>>;
98
150
  }, "strip", z.ZodTypeAny, {
99
- category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure";
151
+ tags: string[];
100
152
  content: string;
153
+ category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
101
154
  confidence: number;
102
- tags: string[];
103
155
  entityRef?: string | null | undefined;
104
156
  structuredAttributes?: Record<string, string> | null | undefined;
105
157
  promptedByQuestion?: string | null | undefined;
@@ -113,11 +165,21 @@ declare const ExtractedFactSchema: z.ZodObject<{
113
165
  expectedOutcome?: string | null | undefined;
114
166
  optional?: boolean | null | undefined;
115
167
  }[] | null | undefined;
168
+ reasoningTrace?: {
169
+ steps: {
170
+ description: string;
171
+ order: number;
172
+ }[];
173
+ finalAnswer?: string | null | undefined;
174
+ final_answer?: string | null | undefined;
175
+ observedOutcome?: string | null | undefined;
176
+ observed_outcome?: string | null | undefined;
177
+ } | null | undefined;
116
178
  }, {
117
- category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure";
179
+ tags: string[];
118
180
  content: string;
181
+ category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
119
182
  confidence: number;
120
- tags: string[];
121
183
  entityRef?: string | null | undefined;
122
184
  structuredAttributes?: Record<string, string> | null | undefined;
123
185
  promptedByQuestion?: string | null | undefined;
@@ -131,6 +193,16 @@ declare const ExtractedFactSchema: z.ZodObject<{
131
193
  expectedOutcome?: string | null | undefined;
132
194
  optional?: boolean | null | undefined;
133
195
  }[] | null | undefined;
196
+ reasoningTrace?: {
197
+ steps: {
198
+ description: string;
199
+ order: number;
200
+ }[];
201
+ finalAnswer?: string | null | undefined;
202
+ final_answer?: string | null | undefined;
203
+ observedOutcome?: string | null | undefined;
204
+ observed_outcome?: string | null | undefined;
205
+ } | null | undefined;
134
206
  }>;
135
207
  declare const EntityMentionSchema: z.ZodObject<{
136
208
  name: z.ZodString;
@@ -229,7 +301,7 @@ declare const ExtractedRelationshipSchema: z.ZodObject<{
229
301
  }>;
230
302
  declare const ProactiveExtractionResultSchema: z.ZodObject<{
231
303
  facts: z.ZodArray<z.ZodObject<{
232
- category: z.ZodEnum<["fact", "preference", "correction", "entity", "decision", "relationship", "principle", "commitment", "moment", "skill", "rule", "procedure"]>;
304
+ category: z.ZodEnum<["fact", "preference", "correction", "entity", "decision", "relationship", "principle", "commitment", "moment", "skill", "rule", "procedure", "reasoning_trace"]>;
233
305
  content: z.ZodString;
234
306
  confidence: z.ZodNumber;
235
307
  tags: z.ZodArray<z.ZodString, "many">;
@@ -270,11 +342,63 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
270
342
  expectedOutcome?: string | null | undefined;
271
343
  optional?: boolean | null | undefined;
272
344
  }>, "many">>>;
345
+ reasoningTrace: z.ZodNullable<z.ZodOptional<z.ZodEffects<z.ZodObject<{
346
+ steps: z.ZodArray<z.ZodObject<{
347
+ order: z.ZodNumber;
348
+ description: z.ZodString;
349
+ }, "strip", z.ZodTypeAny, {
350
+ description: string;
351
+ order: number;
352
+ }, {
353
+ description: string;
354
+ order: number;
355
+ }>, "many">;
356
+ finalAnswer: z.ZodNullable<z.ZodOptional<z.ZodString>>;
357
+ final_answer: z.ZodNullable<z.ZodOptional<z.ZodString>>;
358
+ observedOutcome: z.ZodNullable<z.ZodOptional<z.ZodString>>;
359
+ observed_outcome: z.ZodNullable<z.ZodOptional<z.ZodString>>;
360
+ }, "strip", z.ZodTypeAny, {
361
+ steps: {
362
+ description: string;
363
+ order: number;
364
+ }[];
365
+ finalAnswer?: string | null | undefined;
366
+ final_answer?: string | null | undefined;
367
+ observedOutcome?: string | null | undefined;
368
+ observed_outcome?: string | null | undefined;
369
+ }, {
370
+ steps: {
371
+ description: string;
372
+ order: number;
373
+ }[];
374
+ finalAnswer?: string | null | undefined;
375
+ final_answer?: string | null | undefined;
376
+ observedOutcome?: string | null | undefined;
377
+ observed_outcome?: string | null | undefined;
378
+ }>, {
379
+ steps: {
380
+ description: string;
381
+ order: number;
382
+ }[];
383
+ finalAnswer?: string | null | undefined;
384
+ final_answer?: string | null | undefined;
385
+ observedOutcome?: string | null | undefined;
386
+ observed_outcome?: string | null | undefined;
387
+ }, {
388
+ steps: {
389
+ description: string;
390
+ order: number;
391
+ }[];
392
+ finalAnswer?: string | null | undefined;
393
+ final_answer?: string | null | undefined;
394
+ observedOutcome?: string | null | undefined;
395
+ observed_outcome?: string | null | undefined;
396
+ }>>>;
273
397
  }, "strip", z.ZodTypeAny, {
274
- category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure";
398
+ tags: string[];
275
399
  content: string;
400
+ category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
276
401
  confidence: number;
277
- tags: string[];
278
402
  entityRef?: string | null | undefined;
279
403
  structuredAttributes?: Record<string, string> | null | undefined;
280
404
  promptedByQuestion?: string | null | undefined;
@@ -288,11 +412,21 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
288
412
  expectedOutcome?: string | null | undefined;
289
413
  optional?: boolean | null | undefined;
290
414
  }[] | null | undefined;
415
+ reasoningTrace?: {
416
+ steps: {
417
+ description: string;
418
+ order: number;
419
+ }[];
420
+ finalAnswer?: string | null | undefined;
421
+ final_answer?: string | null | undefined;
422
+ observedOutcome?: string | null | undefined;
423
+ observed_outcome?: string | null | undefined;
424
+ } | null | undefined;
291
425
  }, {
292
- category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure";
426
+ tags: string[];
293
427
  content: string;
428
+ category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
294
429
  confidence: number;
295
- tags: string[];
296
430
  entityRef?: string | null | undefined;
297
431
  structuredAttributes?: Record<string, string> | null | undefined;
298
432
  promptedByQuestion?: string | null | undefined;
@@ -306,6 +440,16 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
306
440
  expectedOutcome?: string | null | undefined;
307
441
  optional?: boolean | null | undefined;
308
442
  }[] | null | undefined;
443
+ reasoningTrace?: {
444
+ steps: {
445
+ description: string;
446
+ order: number;
447
+ }[];
448
+ finalAnswer?: string | null | undefined;
449
+ final_answer?: string | null | undefined;
450
+ observedOutcome?: string | null | undefined;
451
+ observed_outcome?: string | null | undefined;
452
+ } | null | undefined;
309
453
  }>, "many">;
310
454
  profileUpdates: z.ZodArray<z.ZodString, "many">;
311
455
  entities: z.ZodArray<z.ZodObject<{
@@ -365,10 +509,10 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
365
509
  }>, "many">>>;
366
510
  }, "strip", z.ZodTypeAny, {
367
511
  facts: {
368
- category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure";
512
+ tags: string[];
369
513
  content: string;
514
+ category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
370
515
  confidence: number;
371
- tags: string[];
372
516
  entityRef?: string | null | undefined;
373
517
  structuredAttributes?: Record<string, string> | null | undefined;
374
518
  promptedByQuestion?: string | null | undefined;
@@ -382,6 +526,16 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
382
526
  expectedOutcome?: string | null | undefined;
383
527
  optional?: boolean | null | undefined;
384
528
  }[] | null | undefined;
529
+ reasoningTrace?: {
530
+ steps: {
531
+ description: string;
532
+ order: number;
533
+ }[];
534
+ finalAnswer?: string | null | undefined;
535
+ final_answer?: string | null | undefined;
536
+ observedOutcome?: string | null | undefined;
537
+ observed_outcome?: string | null | undefined;
538
+ } | null | undefined;
385
539
  }[];
386
540
  entities: {
387
541
  facts: string[];
@@ -403,10 +557,10 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
403
557
  }[] | null | undefined;
404
558
  }, {
405
559
  facts: {
406
- category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure";
560
+ tags: string[];
407
561
  content: string;
562
+ category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
408
563
  confidence: number;
409
- tags: string[];
410
564
  entityRef?: string | null | undefined;
411
565
  structuredAttributes?: Record<string, string> | null | undefined;
412
566
  promptedByQuestion?: string | null | undefined;
@@ -420,6 +574,16 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
420
574
  expectedOutcome?: string | null | undefined;
421
575
  optional?: boolean | null | undefined;
422
576
  }[] | null | undefined;
577
+ reasoningTrace?: {
578
+ steps: {
579
+ description: string;
580
+ order: number;
581
+ }[];
582
+ finalAnswer?: string | null | undefined;
583
+ final_answer?: string | null | undefined;
584
+ observedOutcome?: string | null | undefined;
585
+ observed_outcome?: string | null | undefined;
586
+ } | null | undefined;
423
587
  }[];
424
588
  entities: {
425
589
  facts: string[];
@@ -442,7 +606,7 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
442
606
  }>;
443
607
  declare const ExtractionResultSchema: z.ZodObject<{
444
608
  facts: z.ZodArray<z.ZodObject<{
445
- category: z.ZodEnum<["fact", "preference", "correction", "entity", "decision", "relationship", "principle", "commitment", "moment", "skill", "rule", "procedure"]>;
609
+ category: z.ZodEnum<["fact", "preference", "correction", "entity", "decision", "relationship", "principle", "commitment", "moment", "skill", "rule", "procedure", "reasoning_trace"]>;
446
610
  content: z.ZodString;
447
611
  confidence: z.ZodNumber;
448
612
  tags: z.ZodArray<z.ZodString, "many">;
@@ -483,11 +647,63 @@ declare const ExtractionResultSchema: z.ZodObject<{
483
647
  expectedOutcome?: string | null | undefined;
484
648
  optional?: boolean | null | undefined;
485
649
  }>, "many">>>;
650
+ reasoningTrace: z.ZodNullable<z.ZodOptional<z.ZodEffects<z.ZodObject<{
651
+ steps: z.ZodArray<z.ZodObject<{
652
+ order: z.ZodNumber;
653
+ description: z.ZodString;
654
+ }, "strip", z.ZodTypeAny, {
655
+ description: string;
656
+ order: number;
657
+ }, {
658
+ description: string;
659
+ order: number;
660
+ }>, "many">;
661
+ finalAnswer: z.ZodNullable<z.ZodOptional<z.ZodString>>;
662
+ final_answer: z.ZodNullable<z.ZodOptional<z.ZodString>>;
663
+ observedOutcome: z.ZodNullable<z.ZodOptional<z.ZodString>>;
664
+ observed_outcome: z.ZodNullable<z.ZodOptional<z.ZodString>>;
665
+ }, "strip", z.ZodTypeAny, {
666
+ steps: {
667
+ description: string;
668
+ order: number;
669
+ }[];
670
+ finalAnswer?: string | null | undefined;
671
+ final_answer?: string | null | undefined;
672
+ observedOutcome?: string | null | undefined;
673
+ observed_outcome?: string | null | undefined;
674
+ }, {
675
+ steps: {
676
+ description: string;
677
+ order: number;
678
+ }[];
679
+ finalAnswer?: string | null | undefined;
680
+ final_answer?: string | null | undefined;
681
+ observedOutcome?: string | null | undefined;
682
+ observed_outcome?: string | null | undefined;
683
+ }>, {
684
+ steps: {
685
+ description: string;
686
+ order: number;
687
+ }[];
688
+ finalAnswer?: string | null | undefined;
689
+ final_answer?: string | null | undefined;
690
+ observedOutcome?: string | null | undefined;
691
+ observed_outcome?: string | null | undefined;
692
+ }, {
693
+ steps: {
694
+ description: string;
695
+ order: number;
696
+ }[];
697
+ finalAnswer?: string | null | undefined;
698
+ final_answer?: string | null | undefined;
699
+ observedOutcome?: string | null | undefined;
700
+ observed_outcome?: string | null | undefined;
701
+ }>>>;
486
702
  }, "strip", z.ZodTypeAny, {
487
- category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure";
703
+ tags: string[];
488
704
  content: string;
705
+ category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
489
706
  confidence: number;
490
- tags: string[];
491
707
  entityRef?: string | null | undefined;
492
708
  structuredAttributes?: Record<string, string> | null | undefined;
493
709
  promptedByQuestion?: string | null | undefined;
@@ -501,11 +717,21 @@ declare const ExtractionResultSchema: z.ZodObject<{
501
717
  expectedOutcome?: string | null | undefined;
502
718
  optional?: boolean | null | undefined;
503
719
  }[] | null | undefined;
720
+ reasoningTrace?: {
721
+ steps: {
722
+ description: string;
723
+ order: number;
724
+ }[];
725
+ finalAnswer?: string | null | undefined;
726
+ final_answer?: string | null | undefined;
727
+ observedOutcome?: string | null | undefined;
728
+ observed_outcome?: string | null | undefined;
729
+ } | null | undefined;
504
730
  }, {
505
- category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure";
731
+ tags: string[];
506
732
  content: string;
733
+ category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
507
734
  confidence: number;
508
- tags: string[];
509
735
  entityRef?: string | null | undefined;
510
736
  structuredAttributes?: Record<string, string> | null | undefined;
511
737
  promptedByQuestion?: string | null | undefined;
@@ -519,6 +745,16 @@ declare const ExtractionResultSchema: z.ZodObject<{
519
745
  expectedOutcome?: string | null | undefined;
520
746
  optional?: boolean | null | undefined;
521
747
  }[] | null | undefined;
748
+ reasoningTrace?: {
749
+ steps: {
750
+ description: string;
751
+ order: number;
752
+ }[];
753
+ finalAnswer?: string | null | undefined;
754
+ final_answer?: string | null | undefined;
755
+ observedOutcome?: string | null | undefined;
756
+ observed_outcome?: string | null | undefined;
757
+ } | null | undefined;
522
758
  }>, "many">;
523
759
  profileUpdates: z.ZodArray<z.ZodString, "many">;
524
760
  entities: z.ZodArray<z.ZodObject<{
@@ -592,10 +828,10 @@ declare const ExtractionResultSchema: z.ZodObject<{
592
828
  }>, "many">>>;
593
829
  }, "strip", z.ZodTypeAny, {
594
830
  facts: {
595
- category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure";
831
+ tags: string[];
596
832
  content: string;
833
+ category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
597
834
  confidence: number;
598
- tags: string[];
599
835
  entityRef?: string | null | undefined;
600
836
  structuredAttributes?: Record<string, string> | null | undefined;
601
837
  promptedByQuestion?: string | null | undefined;
@@ -609,6 +845,16 @@ declare const ExtractionResultSchema: z.ZodObject<{
609
845
  expectedOutcome?: string | null | undefined;
610
846
  optional?: boolean | null | undefined;
611
847
  }[] | null | undefined;
848
+ reasoningTrace?: {
849
+ steps: {
850
+ description: string;
851
+ order: number;
852
+ }[];
853
+ finalAnswer?: string | null | undefined;
854
+ final_answer?: string | null | undefined;
855
+ observedOutcome?: string | null | undefined;
856
+ observed_outcome?: string | null | undefined;
857
+ } | null | undefined;
612
858
  }[];
613
859
  entities: {
614
860
  facts: string[];
@@ -636,10 +882,10 @@ declare const ExtractionResultSchema: z.ZodObject<{
636
882
  identityReflection?: string | null | undefined;
637
883
  }, {
638
884
  facts: {
639
- category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure";
885
+ tags: string[];
640
886
  content: string;
887
+ category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
641
888
  confidence: number;
642
- tags: string[];
643
889
  entityRef?: string | null | undefined;
644
890
  structuredAttributes?: Record<string, string> | null | undefined;
645
891
  promptedByQuestion?: string | null | undefined;
@@ -653,6 +899,16 @@ declare const ExtractionResultSchema: z.ZodObject<{
653
899
  expectedOutcome?: string | null | undefined;
654
900
  optional?: boolean | null | undefined;
655
901
  }[] | null | undefined;
902
+ reasoningTrace?: {
903
+ steps: {
904
+ description: string;
905
+ order: number;
906
+ }[];
907
+ finalAnswer?: string | null | undefined;
908
+ final_answer?: string | null | undefined;
909
+ observedOutcome?: string | null | undefined;
910
+ observed_outcome?: string | null | undefined;
911
+ } | null | undefined;
656
912
  }[];
657
913
  entities: {
658
914
  facts: string[];
@@ -943,8 +1199,8 @@ declare const BehaviorLoopAdjustmentSchema: z.ZodObject<{
943
1199
  reason: z.ZodString;
944
1200
  appliedAt: z.ZodString;
945
1201
  }, "strip", z.ZodTypeAny, {
946
- confidence: number;
947
1202
  reason: string;
1203
+ confidence: number;
948
1204
  parameter: string;
949
1205
  previousValue: number;
950
1206
  nextValue: number;
@@ -952,8 +1208,8 @@ declare const BehaviorLoopAdjustmentSchema: z.ZodObject<{
952
1208
  evidenceCount: number;
953
1209
  appliedAt: string;
954
1210
  }, {
955
- confidence: number;
956
1211
  reason: string;
1212
+ confidence: number;
957
1213
  parameter: string;
958
1214
  previousValue: number;
959
1215
  nextValue: number;
@@ -977,8 +1233,8 @@ declare const BehaviorLoopPolicyStateSchema: z.ZodObject<{
977
1233
  reason: z.ZodString;
978
1234
  appliedAt: z.ZodString;
979
1235
  }, "strip", z.ZodTypeAny, {
980
- confidence: number;
981
1236
  reason: string;
1237
+ confidence: number;
982
1238
  parameter: string;
983
1239
  previousValue: number;
984
1240
  nextValue: number;
@@ -986,8 +1242,8 @@ declare const BehaviorLoopPolicyStateSchema: z.ZodObject<{
986
1242
  evidenceCount: number;
987
1243
  appliedAt: string;
988
1244
  }, {
989
- confidence: number;
990
1245
  reason: string;
1246
+ confidence: number;
991
1247
  parameter: string;
992
1248
  previousValue: number;
993
1249
  nextValue: number;
@@ -1004,8 +1260,8 @@ declare const BehaviorLoopPolicyStateSchema: z.ZodObject<{
1004
1260
  maxDeltaPerCycle: number;
1005
1261
  protectedParams: string[];
1006
1262
  adjustments: {
1007
- confidence: number;
1008
1263
  reason: string;
1264
+ confidence: number;
1009
1265
  parameter: string;
1010
1266
  previousValue: number;
1011
1267
  nextValue: number;
@@ -1021,8 +1277,8 @@ declare const BehaviorLoopPolicyStateSchema: z.ZodObject<{
1021
1277
  maxDeltaPerCycle: number;
1022
1278
  protectedParams: string[];
1023
1279
  adjustments: {
1024
- confidence: number;
1025
1280
  reason: string;
1281
+ confidence: number;
1026
1282
  parameter: string;
1027
1283
  previousValue: number;
1028
1284
  nextValue: number;
package/dist/schemas.js CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  buildProfileConsolidationResultSchema,
24
24
  parseMemoryActionEligibilityContext,
25
25
  parseMemoryActionType
26
- } from "./chunk-UEYA6UC7.js";
26
+ } from "./chunk-NZLQTHS5.js";
27
27
  export {
28
28
  BehaviorLoopAdjustmentSchema,
29
29
  BehaviorLoopPolicyStateSchema,
@@ -1,6 +1,7 @@
1
1
  import { PluginConfig, MemoryFile } from './types.js';
2
2
  import { R as RolloutSummaryInput, M as MaterializeResult } from './codex-materialize-CQlLTzke.js';
3
3
  import { LoggerBackend } from './logger.js';
4
+ import { ConsolidationOperator } from './consolidation-operator.js';
4
5
 
5
6
  /**
6
7
  * memory-extension-host/types.ts — Types for third-party memory extension discovery.
@@ -92,6 +93,66 @@ declare function buildConsolidationPrompt(cluster: ConsolidationCluster): string
92
93
  * Parse the LLM response to extract the canonical content.
93
94
  */
94
95
  declare function parseConsolidationResponse(response: string): string;
96
+ /**
97
+ * Structured result from an operator-aware consolidation LLM call.
98
+ *
99
+ * - `operator` — the consolidation operator the LLM chose for this cluster.
100
+ * Falls back to the heuristic default when the LLM omits or returns an
101
+ * unknown value (the parser never surfaces an invalid operator; see
102
+ * `parseOperatorAwareConsolidationResponse`).
103
+ * - `output` — the canonical content (same format the legacy prompt
104
+ * returns). Callers persist this as the body of the new memory.
105
+ */
106
+ interface OperatorAwareConsolidationResult {
107
+ operator: ConsolidationOperator;
108
+ output: string;
109
+ }
110
+ /**
111
+ * Heuristic default operator for a cluster. Used as the fallback when the
112
+ * LLM does not return a parseable operator, and as the "floor" decision in
113
+ * `parseOperatorAwareConsolidationResponse`.
114
+ *
115
+ * Current heuristic (kept deliberately conservative — PR 3 only):
116
+ *
117
+ * - Two or more memories being collapsed into one canonical blob is a
118
+ * MERGE by definition. This is the path the current clustering
119
+ * pipeline exercises.
120
+ * - A cluster of size 1 that still reaches consolidation (future path,
121
+ * e.g. supersession of a single older memory by a newer value) is an
122
+ * UPDATE.
123
+ * - SPLIT is never selected by the heuristic because the current write
124
+ * path emits exactly one canonical memory per cluster. The prompt
125
+ * reserves SPLIT for future cluster shapes where the LLM decides one
126
+ * logical source actually encodes several distinct facts — at which
127
+ * point the orchestrator would need to write multiple outputs.
128
+ */
129
+ declare function chooseConsolidationOperator(cluster: ConsolidationCluster): ConsolidationOperator;
130
+ /**
131
+ * Build the operator-aware LLM prompt. The LLM is asked to return a
132
+ * JSON object `{ "operator": <split|merge|update>, "output": <content> }`.
133
+ *
134
+ * The prompt is additive: it still asks for a single canonical blob under
135
+ * `output`, so the upstream write path does not change. Future expansions
136
+ * (SPLIT emitting multiple outputs) are explicitly documented as
137
+ * out-of-scope for the parser — `parseOperatorAwareConsolidationResponse`
138
+ * collapses any SPLIT response into a single canonical output for now.
139
+ */
140
+ declare function buildOperatorAwareConsolidationPrompt(cluster: ConsolidationCluster): string;
141
+ /**
142
+ * Parse an operator-aware consolidation response.
143
+ *
144
+ * Contract:
145
+ * - Accepts strict JSON `{ "operator": "...", "output": "..." }`.
146
+ * - Tolerates a JSON payload wrapped in a fenced code block (```json ...```).
147
+ * - Falls back to the heuristic operator when the JSON is malformed,
148
+ * the `operator` field is missing / unknown, or the raw response is
149
+ * a plain blob with no JSON at all. This keeps PR 3 backwards
150
+ * compatible with older models that ignore the JSON instruction.
151
+ * - Never throws. A missing / empty `output` field falls back to the
152
+ * trimmed raw response so the caller still writes something rather
153
+ * than dropping the cluster.
154
+ */
155
+ declare function parseOperatorAwareConsolidationResponse(response: string, cluster: ConsolidationCluster): OperatorAwareConsolidationResult;
95
156
  /**
96
157
  * Discover extensions and build the block to append to a consolidation prompt.
97
158
  * Returns "" when extensions are disabled or none are found.
@@ -116,4 +177,4 @@ declare function materializeAfterSemanticConsolidation(options: {
116
177
  now?: Date;
117
178
  }): Promise<MaterializeResult | null>;
118
179
 
119
- export { type ConsolidationCluster as C, type DiscoveredExtension as D, type ExtensionSchema as E, REMNIC_EXTENSIONS_TOTAL_TOKEN_LIMIT as R, type SemanticConsolidationResult as S, buildConsolidationPrompt as a, buildExtensionsBlockForConsolidation as b, discoverMemoryExtensions as d, findSimilarClusters as f, materializeAfterSemanticConsolidation as m, parseConsolidationResponse as p, resolveExtensionsRoot as r };
180
+ export { type ConsolidationCluster as C, type DiscoveredExtension as D, type ExtensionSchema as E, type OperatorAwareConsolidationResult as O, REMNIC_EXTENSIONS_TOTAL_TOKEN_LIMIT as R, type SemanticConsolidationResult as S, buildConsolidationPrompt as a, buildExtensionsBlockForConsolidation as b, buildOperatorAwareConsolidationPrompt as c, discoverMemoryExtensions as d, chooseConsolidationOperator as e, findSimilarClusters as f, parseOperatorAwareConsolidationResponse as g, materializeAfterSemanticConsolidation as m, parseConsolidationResponse as p, resolveExtensionsRoot as r };
@@ -1,4 +1,5 @@
1
1
  import './types.js';
2
2
  import './codex-materialize-CQlLTzke.js';
3
- export { C as ConsolidationCluster, S as SemanticConsolidationResult, a as buildConsolidationPrompt, b as buildExtensionsBlockForConsolidation, f as findSimilarClusters, m as materializeAfterSemanticConsolidation, p as parseConsolidationResponse, r as resolveExtensionsRoot } from './semantic-consolidation-DrvSYRdB.js';
3
+ export { C as ConsolidationCluster, O as OperatorAwareConsolidationResult, S as SemanticConsolidationResult, a as buildConsolidationPrompt, b as buildExtensionsBlockForConsolidation, c as buildOperatorAwareConsolidationPrompt, e as chooseConsolidationOperator, f as findSimilarClusters, m as materializeAfterSemanticConsolidation, p as parseConsolidationResponse, g as parseOperatorAwareConsolidationResponse, r as resolveExtensionsRoot } from './semantic-consolidation-CxJU6MJk.js';
4
+ export { CONSOLIDATION_OPERATORS, ConsolidationOperator, isConsolidationOperator, isValidDerivedFromEntry } from './consolidation-operator.js';
4
5
  import './logger.js';