@remnic/core 1.1.4 → 1.1.6

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 (204) hide show
  1. package/dist/access-cli.js +32 -30
  2. package/dist/access-cli.js.map +1 -1
  3. package/dist/access-http.d.ts +7 -7
  4. package/dist/access-http.js +13 -13
  5. package/dist/access-mcp.d.ts +7 -7
  6. package/dist/access-mcp.js +12 -12
  7. package/dist/access-schema.d.ts +89 -4
  8. package/dist/access-schema.js +3 -3
  9. package/dist/{access-service-CtXFnprR.d.ts → access-service-CcKu1Yc0.d.ts} +22 -18
  10. package/dist/access-service.d.ts +7 -7
  11. package/dist/access-service.js +10 -10
  12. package/dist/active-memory-bridge.d.ts +1 -1
  13. package/dist/active-recall.d.ts +1 -1
  14. package/dist/behavior-learner.d.ts +1 -1
  15. package/dist/behavior-signals.d.ts +1 -1
  16. package/dist/bootstrap.d.ts +6 -6
  17. package/dist/briefing.d.ts +2 -2
  18. package/dist/briefing.js +3 -3
  19. package/dist/buffer-surprise-report.d.ts +1 -1
  20. package/dist/buffer.d.ts +2 -2
  21. package/dist/calibration.d.ts +1 -1
  22. package/dist/calibration.js +1 -1
  23. package/dist/{capsule-crypto-5CYAGVC5.js → capsule-crypto-SJS5VVAP.js} +2 -2
  24. package/dist/{capsule-export-NZQPOTQ4.js → capsule-export-LLEVB2RG.js} +3 -3
  25. package/dist/{capsule-import-SDCUXLEV.js → capsule-import-UW45R2MZ.js} +3 -3
  26. package/dist/causal-behavior.d.ts +1 -1
  27. package/dist/causal-consolidation.d.ts +2 -2
  28. package/dist/causal-consolidation.js +4 -4
  29. package/dist/{chunk-CRU27Q4J.js → chunk-3P6TPZM4.js} +64 -5
  30. package/dist/chunk-3P6TPZM4.js.map +1 -0
  31. package/dist/{chunk-LW2NMHDW.js → chunk-5NS6NN5A.js} +2 -2
  32. package/dist/{chunk-KNKUID7G.js → chunk-767ODGE6.js} +1 -1
  33. package/dist/{chunk-V7TEH5I2.js → chunk-7RAW2T4P.js} +2 -2
  34. package/dist/{chunk-RILIVK4O.js → chunk-A4ACKWIW.js} +29 -3
  35. package/dist/chunk-A4ACKWIW.js.map +1 -0
  36. package/dist/{chunk-F5VQOQ2E.js → chunk-AIT53NLG.js} +2 -2
  37. package/dist/chunk-AKV3HOGZ.js +757 -0
  38. package/dist/chunk-AKV3HOGZ.js.map +1 -0
  39. package/dist/{chunk-NZS2BLTP.js → chunk-AOABCJVL.js} +772 -59
  40. package/dist/chunk-AOABCJVL.js.map +1 -0
  41. package/dist/{chunk-B2TL6GA2.js → chunk-BFVBG5XY.js} +2 -2
  42. package/dist/{chunk-43EKP2UK.js → chunk-COAGZQT7.js} +1 -1
  43. package/dist/{chunk-43EKP2UK.js.map → chunk-COAGZQT7.js.map} +1 -1
  44. package/dist/{chunk-USFPPRAF.js → chunk-D7WYTVUQ.js} +5 -3
  45. package/dist/chunk-D7WYTVUQ.js.map +1 -0
  46. package/dist/{chunk-Y4A6M3B6.js → chunk-DLYTYJ43.js} +2 -2
  47. package/dist/{chunk-ZIBOQULP.js → chunk-EONJ7GK3.js} +2 -2
  48. package/dist/{chunk-JWSENLQI.js → chunk-FSWYMUWI.js} +15 -1
  49. package/dist/chunk-FSWYMUWI.js.map +1 -0
  50. package/dist/{chunk-SMA4IMHV.js → chunk-KUIEFH2S.js} +3 -3
  51. package/dist/{chunk-EGEPUGN4.js → chunk-LKJA5MR2.js} +2 -2
  52. package/dist/{chunk-XRCYKJ3V.js → chunk-M3QQ5DRA.js} +61 -18
  53. package/dist/chunk-M3QQ5DRA.js.map +1 -0
  54. package/dist/{chunk-CUI2STX6.js → chunk-MYMOXFMR.js} +12 -6
  55. package/dist/chunk-MYMOXFMR.js.map +1 -0
  56. package/dist/{chunk-AEMBDV7M.js → chunk-OZAFME7S.js} +22 -17
  57. package/dist/chunk-OZAFME7S.js.map +1 -0
  58. package/dist/{chunk-IYY4MCPG.js → chunk-P73JTV34.js} +2 -2
  59. package/dist/{chunk-52PDY6GD.js → chunk-PT2EZWOH.js} +2 -2
  60. package/dist/{chunk-3KIS4VGT.js → chunk-QIGOEM65.js} +2 -2
  61. package/dist/{chunk-47WOM4YW.js → chunk-RXGR3YLU.js} +2 -2
  62. package/dist/{chunk-VTJVUHRK.js → chunk-SRBJUAMP.js} +1 -1
  63. package/dist/chunk-SRBJUAMP.js.map +1 -0
  64. package/dist/{chunk-XQ4EJLUD.js → chunk-TMSHGSIG.js} +2 -2
  65. package/dist/{chunk-X6VBWOVZ.js → chunk-UE2OQNQQ.js} +2 -2
  66. package/dist/{chunk-HIRKCQGF.js → chunk-XOG2FHYW.js} +44 -44
  67. package/dist/{chunk-HIRKCQGF.js.map → chunk-XOG2FHYW.js.map} +1 -1
  68. package/dist/{chunk-MUELDH4F.js → chunk-YELFQNQH.js} +2 -2
  69. package/dist/{chunk-TIFRGAKO.js → chunk-YKGRACQP.js} +5 -5
  70. package/dist/{chunk-AGZHRWPT.js → chunk-ZBZVNWQO.js} +2 -2
  71. package/dist/{chunk-W7WWT4FJ.js → chunk-ZOMA7J3J.js} +2 -2
  72. package/dist/{cli-lMql2FCr.d.ts → cli-WahR0rs-.d.ts} +4 -4
  73. package/dist/cli.d.ts +8 -8
  74. package/dist/cli.js +25 -25
  75. package/dist/{codex-materialize-CQlLTzke.d.ts → codex-materialize-D5d5vvyS.d.ts} +1 -1
  76. package/dist/compression-optimizer.d.ts +1 -1
  77. package/dist/config.d.ts +1 -1
  78. package/dist/config.js +1 -1
  79. package/dist/consolidation-provenance-check.d.ts +2 -2
  80. package/dist/consolidation-undo.d.ts +2 -2
  81. package/dist/day-summary.d.ts +1 -1
  82. package/dist/delinearize.d.ts +1 -1
  83. package/dist/direct-answer-wiring.d.ts +1 -1
  84. package/dist/direct-answer.d.ts +1 -1
  85. package/dist/embedding-fallback.d.ts +1 -1
  86. package/dist/{engine-O6YWKQM3.js → engine-5OTS6GY3.js} +4 -4
  87. package/dist/entity-retrieval.d.ts +2 -2
  88. package/dist/entity-retrieval.js +3 -3
  89. package/dist/entity-schema.d.ts +1 -1
  90. package/dist/explicit-capture.d.ts +6 -6
  91. package/dist/explicit-cue-recall.d.ts +40 -0
  92. package/dist/explicit-cue-recall.js +21 -0
  93. package/dist/extraction-judge-telemetry.d.ts +1 -1
  94. package/dist/extraction-judge-training.d.ts +1 -1
  95. package/dist/extraction-judge.d.ts +1 -1
  96. package/dist/extraction.d.ts +1 -1
  97. package/dist/extraction.js +2 -2
  98. package/dist/fallback-llm.d.ts +3 -1
  99. package/dist/fallback-llm.js +1 -1
  100. package/dist/identity-continuity.d.ts +1 -1
  101. package/dist/importance.d.ts +1 -1
  102. package/dist/index.d.ts +14 -13
  103. package/dist/index.js +191 -52
  104. package/dist/index.js.map +1 -1
  105. package/dist/intent.d.ts +1 -1
  106. package/dist/lifecycle.d.ts +1 -1
  107. package/dist/live-connectors-runner.d.ts +1 -1
  108. package/dist/local-llm.d.ts +1 -1
  109. package/dist/memory-action-policy.d.ts +1 -1
  110. package/dist/memory-cache.d.ts +1 -1
  111. package/dist/{memory-governance-JZHZDOLN.js → memory-governance-7MI7KE35.js} +4 -4
  112. package/dist/memory-governance-7MI7KE35.js.map +1 -0
  113. package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
  114. package/dist/{memory-projection-store-CY8TU40w.d.ts → memory-projection-store-BQt5VUQ8.d.ts} +1 -1
  115. package/dist/memory-projection-store.d.ts +2 -2
  116. package/dist/memory-worth-outcomes.d.ts +2 -2
  117. package/dist/models-json.d.ts +1 -1
  118. package/dist/native-knowledge.d.ts +1 -1
  119. package/dist/operator-toolkit.d.ts +2 -2
  120. package/dist/operator-toolkit.js +6 -6
  121. package/dist/{orchestrator-ChkesB8U.d.ts → orchestrator-D2lHhFWI.d.ts} +36 -11
  122. package/dist/orchestrator.d.ts +6 -6
  123. package/dist/orchestrator.js +24 -22
  124. package/dist/patterns-cli.d.ts +1 -1
  125. package/dist/policy-runtime.d.ts +1 -1
  126. package/dist/{port-hqGnoStS.d.ts → port-5W-r5SKc.d.ts} +1 -1
  127. package/dist/qmd-recall-cache.d.ts +2 -2
  128. package/dist/qmd.d.ts +2 -2
  129. package/dist/recall-disclosure-escalation.d.ts +1 -1
  130. package/dist/recall-explain-renderer.d.ts +1 -1
  131. package/dist/recall-explain-renderer.js +3 -3
  132. package/dist/recall-state.d.ts +1 -1
  133. package/dist/recall-tag-filter.d.ts +1 -1
  134. package/dist/recall-xray-cli.d.ts +1 -1
  135. package/dist/recall-xray-cli.js +4 -4
  136. package/dist/recall-xray-renderer.d.ts +1 -1
  137. package/dist/recall-xray-renderer.js +3 -3
  138. package/dist/recall-xray.d.ts +2 -2
  139. package/dist/recall-xray.js +2 -2
  140. package/dist/resolve-auth-token.d.ts +1 -1
  141. package/dist/resume-bundles.js +3 -3
  142. package/dist/retrieval-agents.d.ts +2 -2
  143. package/dist/retrieval-tiers.d.ts +1 -1
  144. package/dist/schemas.d.ts +54 -54
  145. package/dist/{semantic-consolidation-ByBXb-sf.d.ts → semantic-consolidation-tDODR2je.d.ts} +2 -2
  146. package/dist/semantic-consolidation.d.ts +3 -3
  147. package/dist/semantic-consolidation.js +3 -3
  148. package/dist/semantic-rule-promotion.js +3 -3
  149. package/dist/semantic-rule-verifier.d.ts +1 -1
  150. package/dist/semantic-rule-verifier.js +3 -3
  151. package/dist/session-observer-bands.d.ts +1 -1
  152. package/dist/session-observer-state.d.ts +1 -1
  153. package/dist/signal.d.ts +1 -1
  154. package/dist/storage.d.ts +2 -2
  155. package/dist/storage.js +2 -2
  156. package/dist/summarizer.d.ts +1 -1
  157. package/dist/summarizer.js +2 -2
  158. package/dist/summary-snapshot.d.ts +1 -1
  159. package/dist/temporal-supersession.d.ts +2 -2
  160. package/dist/temporal-validity.d.ts +1 -1
  161. package/dist/threading.d.ts +1 -1
  162. package/dist/tier-migration.d.ts +3 -3
  163. package/dist/tier-routing.d.ts +1 -1
  164. package/dist/topics.d.ts +1 -1
  165. package/dist/transcript.d.ts +1 -1
  166. package/dist/types-C-USTTAx.d.ts +2713 -0
  167. package/dist/types.d.ts +1 -2668
  168. package/dist/types.js +1 -1
  169. package/dist/utility-runtime.d.ts +1 -1
  170. package/dist/verified-recall.js +3 -3
  171. package/package.json +1 -1
  172. package/dist/chunk-AEMBDV7M.js.map +0 -1
  173. package/dist/chunk-CRU27Q4J.js.map +0 -1
  174. package/dist/chunk-CUI2STX6.js.map +0 -1
  175. package/dist/chunk-JWSENLQI.js.map +0 -1
  176. package/dist/chunk-NZS2BLTP.js.map +0 -1
  177. package/dist/chunk-RILIVK4O.js.map +0 -1
  178. package/dist/chunk-USFPPRAF.js.map +0 -1
  179. package/dist/chunk-VTJVUHRK.js.map +0 -1
  180. package/dist/chunk-XRCYKJ3V.js.map +0 -1
  181. /package/dist/{capsule-crypto-5CYAGVC5.js.map → capsule-crypto-SJS5VVAP.js.map} +0 -0
  182. /package/dist/{capsule-export-NZQPOTQ4.js.map → capsule-export-LLEVB2RG.js.map} +0 -0
  183. /package/dist/{capsule-import-SDCUXLEV.js.map → capsule-import-UW45R2MZ.js.map} +0 -0
  184. /package/dist/{chunk-LW2NMHDW.js.map → chunk-5NS6NN5A.js.map} +0 -0
  185. /package/dist/{chunk-KNKUID7G.js.map → chunk-767ODGE6.js.map} +0 -0
  186. /package/dist/{chunk-V7TEH5I2.js.map → chunk-7RAW2T4P.js.map} +0 -0
  187. /package/dist/{chunk-F5VQOQ2E.js.map → chunk-AIT53NLG.js.map} +0 -0
  188. /package/dist/{chunk-B2TL6GA2.js.map → chunk-BFVBG5XY.js.map} +0 -0
  189. /package/dist/{chunk-Y4A6M3B6.js.map → chunk-DLYTYJ43.js.map} +0 -0
  190. /package/dist/{chunk-ZIBOQULP.js.map → chunk-EONJ7GK3.js.map} +0 -0
  191. /package/dist/{chunk-SMA4IMHV.js.map → chunk-KUIEFH2S.js.map} +0 -0
  192. /package/dist/{chunk-EGEPUGN4.js.map → chunk-LKJA5MR2.js.map} +0 -0
  193. /package/dist/{chunk-IYY4MCPG.js.map → chunk-P73JTV34.js.map} +0 -0
  194. /package/dist/{chunk-52PDY6GD.js.map → chunk-PT2EZWOH.js.map} +0 -0
  195. /package/dist/{chunk-3KIS4VGT.js.map → chunk-QIGOEM65.js.map} +0 -0
  196. /package/dist/{chunk-47WOM4YW.js.map → chunk-RXGR3YLU.js.map} +0 -0
  197. /package/dist/{chunk-XQ4EJLUD.js.map → chunk-TMSHGSIG.js.map} +0 -0
  198. /package/dist/{chunk-X6VBWOVZ.js.map → chunk-UE2OQNQQ.js.map} +0 -0
  199. /package/dist/{chunk-MUELDH4F.js.map → chunk-YELFQNQH.js.map} +0 -0
  200. /package/dist/{chunk-TIFRGAKO.js.map → chunk-YKGRACQP.js.map} +0 -0
  201. /package/dist/{chunk-AGZHRWPT.js.map → chunk-ZBZVNWQO.js.map} +0 -0
  202. /package/dist/{chunk-W7WWT4FJ.js.map → chunk-ZOMA7J3J.js.map} +0 -0
  203. /package/dist/{engine-O6YWKQM3.js.map → engine-5OTS6GY3.js.map} +0 -0
  204. /package/dist/{memory-governance-JZHZDOLN.js.map → explicit-cue-recall.js.map} +0 -0
package/dist/types.d.ts CHANGED
@@ -1,2668 +1 @@
1
- /**
2
- * dreams-ledger.ts — per-phase telemetry for the Dreams consolidation pipeline.
3
- *
4
- * Every scheduled or manual phase run appends one JSONL entry to
5
- * <memoryDir>/state/dreams-ledger.jsonl
6
- *
7
- * The entry records which phase ran, how long it took, and a small
8
- * itemsProcessed counter so `remnic dreams status` can aggregate the last
9
- * 24-hour window without scanning the full memory corpus.
10
- *
11
- * This module is intentionally side-effect-free on import (no fs calls at
12
- * module load time) so tests can import it without touching the filesystem.
13
- */
14
- /** The three named phases of the Dreams consolidation pipeline. */
15
- type DreamsPhase = "lightSleep" | "rem" | "deepSleep";
16
- /** Aggregated stats for a single phase over a time window. */
17
- interface DreamsPhaseStatus {
18
- phase: DreamsPhase;
19
- /** Number of phase runs in the window. */
20
- runCount: number;
21
- /** Total wall-clock milliseconds across all runs in the window. */
22
- totalDurationMs: number;
23
- /** Total items processed across all runs in the window. */
24
- totalItemsProcessed: number;
25
- /** ISO-8601 timestamp of the most recent completed run, or null if none. */
26
- lastRunAt: string | null;
27
- /** Duration of the most recent run in ms, or null if none. */
28
- lastDurationMs: number | null;
29
- }
30
- /** Shape returned by `getDreamsStatus` — the canonical telemetry response. */
31
- interface DreamsStatusResult {
32
- /** ISO-8601 start of the query window (inclusive). */
33
- windowStart: string;
34
- /** ISO-8601 end of the query window (exclusive). */
35
- windowEnd: string;
36
- /** Per-phase summaries, always present for all three phases. */
37
- phases: {
38
- lightSleep: DreamsPhaseStatus;
39
- rem: DreamsPhaseStatus;
40
- deepSleep: DreamsPhaseStatus;
41
- };
42
- }
43
- /** Public result shape — identical to what HTTP, MCP, and CLI surfaces expose. */
44
- interface DreamsRunResult {
45
- phase: DreamsPhase;
46
- dryRun: boolean;
47
- durationMs: number;
48
- itemsProcessed: number;
49
- notes?: string;
50
- }
51
-
52
- type ReasoningEffort = "none" | "low" | "medium" | "high";
53
- type TriggerMode = "smart" | "every_n" | "time_based";
54
- type SignalLevel = "none" | "low" | "medium" | "high";
55
- type MemoryCategory = "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
56
- type ConsolidationAction = "ADD" | "MERGE" | "UPDATE" | "INVALIDATE" | "SKIP";
57
- type ConfidenceTier = "explicit" | "implied" | "inferred" | "speculative";
58
- type PrincipalFromSessionKeyMode = "map" | "prefix" | "regex";
59
- type RecallPlanMode = "no_recall" | "minimal" | "full" | "graph_mode";
60
- type CronRecallMode = "all" | "none" | "allowlist";
61
- type CronConversationRecallMode = "auto" | "always" | "never";
62
- type IdentityInjectionMode = "recovery_only" | "minimal" | "full";
63
- type CaptureMode = "implicit" | "explicit" | "hybrid";
64
- type MemoryOsPresetName = "conservative" | "balanced" | "research-max" | "local-llm-heavy";
65
- type ExtractionPassSource = "base" | "proactive";
66
- /**
67
- * Scope classification for extracted facts (issue #XXX).
68
- *
69
- * - `"project"` — knowledge specific to one codebase: file paths, environment
70
- * configs, deployment details, project-specific workarounds, team/stakeholder
71
- * info tied to one project.
72
- * - `"global"` — knowledge that applies across projects: core framework bugs,
73
- * library behavior, API patterns, user preferences, tool configurations,
74
- * general coding patterns, infrastructure knowledge.
75
- *
76
- * Default is `"project"` when a coding context is active, `"global"` when no
77
- * coding context is present.
78
- */
79
- type MemoryScope = "project" | "global";
80
- type SlotMismatchMode = "error" | "warn" | "silent";
81
- type CodexCompactionFlushMode = "signal" | "heuristic" | "auto";
82
- type DreamingNarrativePromptStyle = "reflective" | "diary" | "analytical";
83
- type HeartbeatDetectionMode = "runtime-signal" | "heuristic" | "auto";
84
- type ActiveRecallQueryMode = "message" | "recent" | "full";
85
- type ActiveRecallPromptStyle = "balanced" | "strict" | "contextual" | "recall-heavy" | "precision-heavy" | "preference-only";
86
- type ActiveRecallThinking = "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "adaptive";
87
- type ActiveRecallChatType = "direct" | "group" | "channel";
88
- type ActiveRecallModelFallbackPolicy = "default-remote" | "resolved-only";
89
- /**
90
- * Retrieval tier ladder (issue #518). Identifies which tier served a recall
91
- * result. Ordered top-to-bottom by cost, but routing is not strictly
92
- * sequential — callers may jump straight to a lower tier when eligibility
93
- * does not hold.
94
- */
95
- type RetrievalTier = "exact-cache" | "fuzzy-cache" | "direct-answer" | "hybrid" | "rerank-graph" | "agentic";
96
- /**
97
- * Per-recall annotation describing which retrieval tier served a result,
98
- * why that tier was chosen, and what was filtered along the way. Added as
99
- * part of issue #518 (direct-answer tier + `query --explain`).
100
- *
101
- * Not to be confused with the existing `recallExplain` operation
102
- * (graph-path explanation) — that is a user-invoked RPC; this is a
103
- * per-result annotation that can be attached to any recall response.
104
- */
105
- interface RecallTierExplain {
106
- tier: RetrievalTier;
107
- tierReason: string;
108
- filteredBy: string[];
109
- candidatesConsidered: number;
110
- latencyMs: number;
111
- sourceAnchors?: Array<{
112
- path: string;
113
- lineRange?: [number, number];
114
- }>;
115
- }
116
- /**
117
- * Recall disclosure depth (issue #677). Selects how much content each
118
- * recall result returns:
119
- *
120
- * - `"chunk"` — semantic chunk excerpt (cheapest; default).
121
- * - `"section"` — full markdown section / memory body (current pre-#677 behavior).
122
- * - `"raw"` — raw transcript / archive excerpts from `lcm/` when present.
123
- *
124
- * Disclosure is **orthogonal** to the retrieval-tier ladder
125
- * (`RetrievalTier` / `RETRIEVAL_TIERS`). The tier ladder controls *which
126
- * pipeline stage served a result*; disclosure controls *how deep into the
127
- * underlying memory the result reaches*. A request can mix any retrieval
128
- * tier with any disclosure depth.
129
- *
130
- * Default is `"chunk"` when the caller omits the field; this preserves the
131
- * existing recall behavior because callers that did not request a disclosure
132
- * level continue to receive the same chunk-shaped previews they always had.
133
- * Surfaces (CLI / HTTP / MCP) and downstream telemetry are wired in later
134
- * PRs of #677.
135
- */
136
- type RecallDisclosure = "chunk" | "section" | "raw";
137
- /**
138
- * Ordered list of disclosure levels, cheapest to most expensive. Used for
139
- * validation, escalation policy comparisons, and future telemetry rollups.
140
- * Treat this as the single source of truth — do not hard-code disclosure
141
- * strings elsewhere.
142
- */
143
- declare const RECALL_DISCLOSURE_LEVELS: readonly RecallDisclosure[];
144
- /**
145
- * Default disclosure level when a caller omits `disclosure`. Set to `chunk`
146
- * so callers that did not opt in to deeper disclosure see the same
147
- * preview-shaped behavior as before #677.
148
- */
149
- declare const DEFAULT_RECALL_DISCLOSURE: RecallDisclosure;
150
- declare function isRecallDisclosure(value: unknown): value is RecallDisclosure;
151
- interface RecallSectionConfig {
152
- id: string;
153
- enabled?: boolean;
154
- maxChars?: number | null;
155
- maxHints?: number;
156
- maxSupportingFacts?: number;
157
- maxRelatedEntities?: number;
158
- consolidateTriggerLines?: number;
159
- consolidateTargetLines?: number;
160
- maxEntities?: number;
161
- maxResults?: number;
162
- recentTurns?: number;
163
- maxTurns?: number;
164
- maxTokens?: number;
165
- lookbackHours?: number;
166
- maxCount?: number;
167
- topK?: number;
168
- timeoutMs?: number;
169
- maxPatterns?: number;
170
- maxRubrics?: number;
171
- }
172
- interface RecallPipelineConfig {
173
- recallBudgetChars: number;
174
- pipeline: RecallSectionConfig[];
175
- }
176
- interface SessionObserverBandConfig {
177
- maxBytes: number;
178
- triggerDeltaBytes: number;
179
- triggerDeltaTokens: number;
180
- }
181
- interface FileHygieneConfig {
182
- enabled: boolean;
183
- lintEnabled: boolean;
184
- lintBudgetBytes: number;
185
- lintWarnRatio: number;
186
- lintPaths: string[];
187
- rotateEnabled: boolean;
188
- rotateMaxBytes: number;
189
- rotateKeepTailChars: number;
190
- rotatePaths: string[];
191
- archiveDir: string;
192
- runMinIntervalMs: number;
193
- warningsLogEnabled: boolean;
194
- warningsLogPath: string;
195
- indexEnabled: boolean;
196
- indexPath: string;
197
- }
198
- interface NativeKnowledgeConfig {
199
- enabled: boolean;
200
- includeFiles: string[];
201
- maxChunkChars: number;
202
- maxResults: number;
203
- maxChars: number;
204
- stateDir: string;
205
- obsidianVaults: NativeKnowledgeObsidianVaultConfig[];
206
- openclawWorkspace?: NativeKnowledgeOpenClawWorkspaceConfig;
207
- }
208
- interface NativeKnowledgeFolderRuleConfig {
209
- pathPrefix: string;
210
- namespace?: string;
211
- privacyClass?: string;
212
- }
213
- interface NativeKnowledgeObsidianVaultConfig {
214
- id: string;
215
- rootDir: string;
216
- includeGlobs: string[];
217
- excludeGlobs: string[];
218
- namespace?: string;
219
- privacyClass?: string;
220
- folderRules: NativeKnowledgeFolderRuleConfig[];
221
- dailyNotePatterns: string[];
222
- materializeBacklinks: boolean;
223
- }
224
- interface NativeKnowledgeOpenClawWorkspaceConfig {
225
- enabled: boolean;
226
- bootstrapFiles: string[];
227
- handoffGlobs: string[];
228
- dailySummaryGlobs: string[];
229
- automationNoteGlobs: string[];
230
- workspaceDocGlobs: string[];
231
- excludeGlobs: string[];
232
- sharedSafeGlobs: string[];
233
- }
234
- /**
235
- * OpenClaw SecretRef shape (issue #757).
236
- *
237
- * OpenClaw resolves these at runtime via its built-in secret resolver
238
- * (e.g. exec providers like `kc_*` for macOS Keychain). Plugins receive
239
- * the raw object in `pluginConfig` and must call the gateway's resolver
240
- * before using the value. Standalone Remnic does NOT resolve SecretRefs;
241
- * operators must use plain strings or `${ENV_VAR}` expansion instead.
242
- */
243
- interface SecretRef {
244
- source: string;
245
- provider?: string;
246
- id?: string;
247
- command?: unknown;
248
- [key: string]: unknown;
249
- }
250
- type AgentAccessAuthToken = string | SecretRef;
251
- interface AgentAccessHttpConfig {
252
- enabled: boolean;
253
- host: string;
254
- port: number;
255
- /**
256
- * Bearer token. Either a literal string (env-expanded) or an unresolved
257
- * SecretRef object preserved verbatim from openclaw.json — resolved at
258
- * service-start time via {@link resolveAgentAccessAuthToken}.
259
- */
260
- authToken?: AgentAccessAuthToken;
261
- principal?: string;
262
- maxBodyBytes: number;
263
- }
264
- interface DreamingConfig {
265
- enabled: boolean;
266
- journalPath: string;
267
- maxEntries: number;
268
- injectRecentCount: number;
269
- minIntervalMinutes: number;
270
- narrativeModel: string | null;
271
- narrativePromptStyle: DreamingNarrativePromptStyle;
272
- watchFile: boolean;
273
- }
274
- /**
275
- * Light-sleep phase config (issue #678 PR 2/4).
276
- *
277
- * Groups existing top-level lifecycle-policy gates under a unified namespace.
278
- * When `dreams.phases.lightSleep.*` keys are set they WIN over the legacy
279
- * top-level keys; the legacy keys remain readable for backward compatibility.
280
- *
281
- * Light sleep: recent activity scoring + clustering (tier-routing value score,
282
- * observation ledger, buffer state — `runLifecyclePolicyPass` in orchestrator).
283
- */
284
- interface DreamsLightSleepConfig {
285
- /** Phase master switch. Mirrors `lifecyclePolicyEnabled` when not set explicitly. */
286
- enabled: boolean;
287
- /** Minimum interval between light-sleep passes in milliseconds. */
288
- cadenceMs: number;
289
- /** Value score above which a memory is treated as hot. Mirrors `lifecyclePromoteHeatThreshold`. */
290
- promoteHeatThreshold: number;
291
- /** Value score below which a memory starts to decay. Mirrors `lifecycleStaleDecayThreshold`. */
292
- staleDecayThreshold: number;
293
- /** Value score below which a memory is eligible for archive. Mirrors `lifecycleArchiveDecayThreshold`. */
294
- archiveDecayThreshold: number;
295
- /** Whether stale memories are filtered from recall. Mirrors `lifecycleFilterStaleEnabled`. */
296
- filterStaleEnabled: boolean;
297
- }
298
- /**
299
- * REM phase config (issue #678 PR 2/4).
300
- *
301
- * Groups existing top-level semantic-consolidation and supersession gates.
302
- * When `dreams.phases.rem.*` keys are set they WIN over the legacy top-level
303
- * keys.
304
- *
305
- * REM: cross-session synthesis, supersession resolution, semantic consolidation
306
- * (`runSemanticConsolidation` in orchestrator).
307
- */
308
- interface DreamsRemConfig {
309
- /** Phase master switch. Mirrors `semanticConsolidationEnabled` when not set explicitly. */
310
- enabled: boolean;
311
- /**
312
- * How often the REM pass runs, in milliseconds.
313
- * Derived from `semanticConsolidationIntervalHours` (×3 600 000) when not set explicitly.
314
- */
315
- cadenceMs: number;
316
- /** Cosine-similarity threshold for cluster membership. Mirrors `semanticConsolidationThreshold`. */
317
- similarityThreshold: number;
318
- /** Minimum cluster size before consolidation runs. Mirrors `semanticConsolidationMinClusterSize`. */
319
- minClusterSize: number;
320
- /** Max cluster operations per run. Mirrors `semanticConsolidationMaxPerRun`. */
321
- maxPerRun: number;
322
- /** Minimum gap between consolidation passes (ms). Mirrors `consolidationMinIntervalMs`. */
323
- minIntervalMs: number;
324
- }
325
- /**
326
- * Deep-sleep phase config (issue #678 PR 2/4).
327
- *
328
- * Groups existing versioning and tier-migration gates.
329
- * When `dreams.phases.deepSleep.*` keys are set they WIN over the legacy
330
- * top-level keys.
331
- *
332
- * Deep sleep: promotion to durable memory, hot→cold tier migration,
333
- * page-version snapshots, archive (`engram-nightly-governance` cron,
334
- * `tier-migration.ts`, `page-versioning.ts`, `hygiene.ts`).
335
- */
336
- interface DreamsDeepSleepConfig {
337
- /**
338
- * Phase master switch. No single direct legacy mirror; defaults false unless
339
- * an existing deep-sleep surface such as nightly governance auto-registration,
340
- * tier migration, or page versioning is explicitly enabled. Set to `false`
341
- * to disable those surfaces without removing legacy config keys.
342
- */
343
- enabled: boolean;
344
- /** True only when dreams.phases.deepSleep.enabled was explicitly configured. */
345
- enabledExplicitlySet?: boolean;
346
- /**
347
- * Minimum interval between deep-sleep passes in milliseconds.
348
- * Informational only in PR 2; PR 4 will wire this into the cron scheduler.
349
- */
350
- cadenceMs: number;
351
- /** Enable page-version snapshots on every overwrite. Mirrors `versioningEnabled`. */
352
- versioningEnabled: boolean;
353
- /** Max snapshots per page. Mirrors `versioningMaxPerPage`. */
354
- versioningMaxPerPage: number;
355
- }
356
- /**
357
- * Unified dreams phases config block (issue #678 PR 2/4).
358
- *
359
- * Operators set `dreams.phases.{lightSleep,rem,deepSleep}.*` in their plugin
360
- * config. Values under this block WIN over the equivalent legacy top-level keys
361
- * when both are set. Legacy keys continue to be parsed so existing configs do
362
- * not need to change.
363
- *
364
- * This block is intentionally separate from `DreamingConfig` which controls the
365
- * diary surface (`surfaces/dreams.ts`) — a different feature. See docs/dreams.md.
366
- */
367
- interface DreamsPhasesConfig {
368
- lightSleep: DreamsLightSleepConfig;
369
- rem: DreamsRemConfig;
370
- deepSleep: DreamsDeepSleepConfig;
371
- }
372
- /** Procedural memory (issue #519): mining + recall gates. All sub-features default off. */
373
- interface ProceduralConfig {
374
- enabled: boolean;
375
- /** Minimum cluster size before emitting a candidate; `0` disables mining (`minOccurrences_zero`). */
376
- minOccurrences: number;
377
- /** Minimum success rate from trajectory outcomes in [0, 1]. */
378
- successFloor: number;
379
- /** When auto-promotion is enabled, promote pending_review → active after this many occurrences. */
380
- autoPromoteOccurrences: number;
381
- autoPromoteEnabled: boolean;
382
- lookbackDays: number;
383
- /** When true, installer may register the nightly procedural mining cron (default off). */
384
- proceduralMiningCronAutoRegister: boolean;
385
- /** Max procedure memories to inject on task-initiation recall (1–10). */
386
- recallMaxProcedures: number;
387
- }
388
- /**
389
- * Coding-agent mode config (issue #569).
390
- *
391
- * When the connector provides a `CodingContext` (see below), Remnic overlays
392
- * a project- and/or branch-scoped namespace on top of the principal's default
393
- * namespace so that memories written while working on project A do not surface
394
- * while working on project B.
395
- *
396
- * Both flags default off-for-branch / on-for-project. Per CLAUDE.md #30 every
397
- * filter or transform needs an escape hatch: set `projectScope: false` to
398
- * exactly restore pre-#569 behaviour.
399
- */
400
- interface CodingModeConfig {
401
- /**
402
- * When true (default), a session with a resolved `CodingContext` uses a
403
- * project-scoped namespace. When false, the principal's default namespace
404
- * is used unchanged (pre-#569 behaviour).
405
- */
406
- projectScope: boolean;
407
- /**
408
- * When true, recall/write also overlay the current branch on top of the
409
- * project namespace. Default false — branch-scope is opt-in because active
410
- * development typically wants recall across branches. (Wired by PR 3 of
411
- * issue #569; declared here so the schema ships in one slice.)
412
- */
413
- branchScope: boolean;
414
- /**
415
- * When true (default), project-scoped and branch-scoped sessions include
416
- * the root/default namespace in their read fallbacks so globally useful
417
- * memories remain visible from any project. When false, project-scoped
418
- * sessions only see their own namespace (strict isolation).
419
- *
420
- * CLAUDE.md #30: configuration gate for the recall fan-out to the root
421
- * namespace. Does not affect writes — those always go to the project
422
- * namespace only.
423
- */
424
- globalFallback: boolean;
425
- }
426
- /**
427
- * Session-scoped coding context. Produced by `resolveGitContext()` in the
428
- * connector layer and attached to a session so that recall + write paths can
429
- * compute an overlay namespace.
430
- *
431
- * All fields mirror `GitContext` from `./coding/git-context.ts`; kept as a
432
- * separate interface because `types.ts` must stay dependency-free (it is
433
- * imported by every other module).
434
- */
435
- interface CodingContext {
436
- projectId: string;
437
- branch: string | null;
438
- rootPath: string;
439
- defaultBranch: string | null;
440
- }
441
- /** Configuration for the nightly contradiction-scan cron (issue #520). */
442
- interface ContradictionScanConfig {
443
- /** Master switch for the contradiction scan cron. Default true. */
444
- enabled: boolean;
445
- /** Embedding cosine similarity floor for candidate pair generation. Default 0.82. */
446
- similarityFloor: number;
447
- /** Minimum topic-token Jaccard overlap for unstructured pairs. Default 0.4. */
448
- topicOverlapFloor: number;
449
- /** Cap on candidate pairs evaluated per cron run. Default 500. */
450
- maxPairsPerRun: number;
451
- /** Cooldown in days before re-evaluating a pair judged independent/both-valid. Default 14. */
452
- cooldownDays: number;
453
- /** When true, pairs judged "duplicates" are auto-flagged for dedup (still need user approval). Default false. */
454
- autoMergeDuplicates: boolean;
455
- }
456
- interface HeartbeatConfig {
457
- enabled: boolean;
458
- journalPath: string;
459
- maxPreviousRuns: number;
460
- watchFile: boolean;
461
- detectionMode: HeartbeatDetectionMode;
462
- gateExtractionDuringHeartbeat: boolean;
463
- }
464
- interface SlotBehaviorConfig {
465
- requireExclusiveMemorySlot: boolean;
466
- onSlotMismatch: SlotMismatchMode;
467
- }
468
- interface CodexCompatConfig {
469
- enabled: boolean;
470
- threadIdBufferKeying: boolean;
471
- compactionFlushMode: CodexCompactionFlushMode;
472
- fingerprintDedup: boolean;
473
- }
474
- declare function confidenceTier(score: number): ConfidenceTier;
475
- /** Default TTL in days for speculative memories (auto-expire if unconfirmed) */
476
- declare const SPECULATIVE_TTL_DAYS = 30;
477
- /**
478
- * Shape for semantic chunking config overrides stored in PluginConfig.
479
- * Mirrors SemanticChunkingConfig from semantic-chunking.ts without creating
480
- * a circular import (types.ts is imported by everything).
481
- */
482
- interface SemanticChunkingConfigShape {
483
- targetTokens: number;
484
- minTokens: number;
485
- maxTokens: number;
486
- smoothingWindowSize: number;
487
- boundaryThresholdStdDevs: number;
488
- embeddingBatchSize: number;
489
- fallbackToRecursive: boolean;
490
- }
491
- interface PluginConfig {
492
- openaiApiKey: string | undefined;
493
- openaiBaseUrl: string | undefined;
494
- model: string;
495
- reasoningEffort: ReasoningEffort;
496
- triggerMode: TriggerMode;
497
- bufferMaxTurns: number;
498
- bufferMaxMinutes: number;
499
- /**
500
- * Surprise-gated buffer flush (issue #563, D-MEM).
501
- *
502
- * When enabled, every turn added to the smart buffer is scored against a
503
- * configurable window of recent memories using an embedding-distance proxy
504
- * for novelty (see `buffer-surprise.ts`). A turn whose surprise score
505
- * exceeds `bufferSurpriseThreshold` triggers an immediate extract flush,
506
- * even if the existing signal/turn-count/time triggers would otherwise keep
507
- * buffering. Disabled by default — when `false`, buffer behavior is
508
- * identical to pre-#563 code. Additive only: existing triggers are never
509
- * suppressed by this flag.
510
- */
511
- bufferSurpriseTriggerEnabled: boolean;
512
- /**
513
- * Threshold in `[0, 1]` above which a surprise score causes an immediate
514
- * flush. `0.35` is a conservative default chosen to favor precision over
515
- * recall during the opt-in phase. Ignored unless
516
- * `bufferSurpriseTriggerEnabled` is `true`.
517
- */
518
- bufferSurpriseThreshold: number;
519
- /**
520
- * Number of nearest neighbors to average over when computing the surprise
521
- * score (see `computeSurprise`). Default `5`. Clamped to the recent-memory
522
- * window size at call time.
523
- */
524
- bufferSurpriseK: number;
525
- /**
526
- * Maximum number of recent memories to sample when computing the surprise
527
- * score. Bounds embedding cost per turn. Default `20`. Set to `0` to
528
- * disable the trigger even when the flag is on (no memories to compare
529
- * against → treat as not-applicable rather than maximally surprising).
530
- */
531
- bufferSurpriseRecentMemoryCount: number;
532
- /**
533
- * Hard timeout (ms) for the surprise probe. If the probe does not
534
- * resolve within this window, the buffer treats the probe as failed,
535
- * logs at debug, and falls through to the existing triggers. Ensures
536
- * a slow or hung embedder cannot stall the turn-append path. Default
537
- * `2000` (2s).
538
- */
539
- bufferSurpriseProbeTimeoutMs: number;
540
- consolidateEveryN: number;
541
- highSignalPatterns: string[];
542
- maxMemoryTokens: number;
543
- memoryOsPreset?: MemoryOsPresetName;
544
- qmdEnabled: boolean;
545
- qmdCollection: string;
546
- qmdMaxResults: number;
547
- qmdColdTierEnabled?: boolean;
548
- qmdColdCollection?: string;
549
- qmdColdMaxResults?: number;
550
- qmdTierMigrationEnabled: boolean;
551
- qmdTierDemotionMinAgeDays: number;
552
- qmdTierDemotionValueThreshold: number;
553
- qmdTierPromotionValueThreshold: number;
554
- qmdTierParityGraphEnabled: boolean;
555
- qmdTierParityHiMemEnabled: boolean;
556
- qmdTierAutoBackfillEnabled: boolean;
557
- embeddingFallbackEnabled: boolean;
558
- embeddingFallbackProvider: "auto" | "openai" | "local";
559
- /** Optional absolute path to qmd binary. If unset, PATH/fallback discovery is used. */
560
- qmdPath?: string;
561
- memoryDir: string;
562
- debug: boolean;
563
- identityEnabled: boolean;
564
- identityContinuityEnabled: boolean;
565
- identityInjectionMode: IdentityInjectionMode;
566
- identityMaxInjectChars: number;
567
- continuityIncidentLoggingEnabled: boolean;
568
- continuityAuditEnabled: boolean;
569
- sessionObserverEnabled?: boolean;
570
- sessionObserverDebounceMs?: number;
571
- sessionObserverBands?: SessionObserverBandConfig[];
572
- injectQuestions: boolean;
573
- commitmentDecayDays: number;
574
- workspaceDir: string;
575
- captureMode: CaptureMode;
576
- fileHygiene?: FileHygieneConfig;
577
- nativeKnowledge?: NativeKnowledgeConfig;
578
- agentAccessHttp: AgentAccessHttpConfig;
579
- accessTrackingEnabled: boolean;
580
- accessTrackingBufferMaxSize: number;
581
- recencyWeight: number;
582
- boostAccessCount: boolean;
583
- /** Record empty recall impressions (memoryIds: []) when no memories are injected. Disabled by default. */
584
- recordEmptyRecallImpressions: boolean;
585
- queryExpansionEnabled: boolean;
586
- queryExpansionMaxQueries: number;
587
- /** Minimum token length to consider for query expansion. */
588
- queryExpansionMinTokenLen: number;
589
- rerankEnabled: boolean;
590
- /** Rerank provider. "local" uses Local LLM only; "cloud" uses gateway fallback chain. */
591
- rerankProvider: "local" | "cloud";
592
- rerankMaxCandidates: number;
593
- rerankTimeoutMs: number;
594
- rerankCacheEnabled: boolean;
595
- rerankCacheTtlMs: number;
596
- feedbackEnabled: boolean;
597
- /** If true, allow recording negative examples and apply a soft penalty during ranking. */
598
- negativeExamplesEnabled: boolean;
599
- /** Score penalty per "not useful" hit (typical QMD scores ~0-1). Keep small. */
600
- negativeExamplesPenaltyPerHit: number;
601
- /** Maximum penalty applied from negative examples. */
602
- negativeExamplesPenaltyCap: number;
603
- chunkingEnabled: boolean;
604
- chunkingTargetTokens: number;
605
- chunkingMinTokens: number;
606
- chunkingOverlapSentences: number;
607
- /** Enable semantic chunking with embedding-based topic boundary detection. Default: false. */
608
- semanticChunkingEnabled: boolean;
609
- /** Optional overrides for the semantic chunking algorithm. */
610
- semanticChunkingConfig: Partial<SemanticChunkingConfigShape>;
611
- contradictionDetectionEnabled: boolean;
612
- contradictionSimilarityThreshold: number;
613
- contradictionMinConfidence: number;
614
- contradictionAutoResolve: boolean;
615
- /** Nightly contradiction-scan cron config (issue #520). */
616
- contradictionScan: ContradictionScanConfig;
617
- /**
618
- * When enabled, writes that carry `structuredAttributes` mark any older
619
- * fact with the same `entityRef + attribute_name` supersession key and a
620
- * conflicting value as `status: "superseded"`.
621
- */
622
- temporalSupersessionEnabled: boolean;
623
- /**
624
- * When enabled, superseded memories are still returned by recall (useful
625
- * for audit/history queries). Default: false — superseded memories are
626
- * filtered out.
627
- */
628
- temporalSupersessionIncludeInRecall: boolean;
629
- /**
630
- * When true, recall checks whether a single validated memory in a
631
- * high-trust taxonomy bucket can answer the query before invoking QMD.
632
- * Default false — enable explicitly after bench validation.
633
- */
634
- recallDirectAnswerEnabled: boolean;
635
- /**
636
- * Disclosure auto-escalation policy (issue #677 PR 4/4). When set to
637
- * `"auto"`, recalls without an explicit caller-supplied disclosure
638
- * escalate from `chunk` to `section` if the top-K confidence falls
639
- * below {@link recallDisclosureEscalationThreshold}. `raw` is never
640
- * auto-selected — it requires an explicit caller request. Default
641
- * `"manual"` preserves pre-#677 behavior.
642
- */
643
- recallDisclosureEscalation: "manual" | "auto";
644
- /**
645
- * Top-K confidence threshold (in `[0, 1]`) below which auto-escalation
646
- * promotes `chunk` → `section`. Only consulted when
647
- * {@link recallDisclosureEscalation} is `"auto"`. Default `0.5`.
648
- */
649
- recallDisclosureEscalationThreshold: number;
650
- /**
651
- * Graph-based retrieval tier via Personalized PageRank (issue #559 PR 4).
652
- * When true, recall builds a retrieval graph from memory frontmatter
653
- * and runs PPR, merging the result with QMD via MMR. Default false —
654
- * ships off pending the retrieval-graph bench in PR 5.
655
- */
656
- recallGraphEnabled: boolean;
657
- /** PPR damping factor used when `recallGraphEnabled` is true. */
658
- recallGraphDamping: number;
659
- /** PPR power-iteration cap used when `recallGraphEnabled` is true. */
660
- recallGraphIterations: number;
661
- /**
662
- * Max memories returned by the graph tier before MMR. Set to 0 to
663
- * disable the graph tier's contribution without flipping the flag.
664
- */
665
- recallGraphTopK: number;
666
- /**
667
- * Minimum token-overlap ratio (query tokens ∩ memory tokens / query tokens)
668
- * required for direct-answer eligibility. Set to 0 to disable the gate.
669
- */
670
- recallDirectAnswerTokenOverlapFloor: number;
671
- /**
672
- * Minimum calibrated importance score required for direct-answer
673
- * eligibility. Set to 0 to disable the gate.
674
- */
675
- recallDirectAnswerImportanceFloor: number;
676
- /**
677
- * Ambiguity margin: if the second-best candidate scores within this
678
- * ratio of the top candidate, direct-answer defers to the hybrid tier.
679
- */
680
- recallDirectAnswerAmbiguityMargin: number;
681
- /**
682
- * Taxonomy category IDs eligible for direct-answer routing. Memories
683
- * whose resolved taxonomy category is not in this list never qualify.
684
- */
685
- recallDirectAnswerEligibleTaxonomyBuckets: string[];
686
- /**
687
- * Cross-namespace query-budget limiter (issue #565 PR 4/5). When true,
688
- * a principal that issues a burst of recalls against namespaces other
689
- * than their own is throttled once its per-window count crosses
690
- * `recallCrossNamespaceBudgetHardLimit`. Default false — ships disabled.
691
- */
692
- recallCrossNamespaceBudgetEnabled: boolean;
693
- /** Rolling window in milliseconds over which cross-namespace reads are counted. */
694
- recallCrossNamespaceBudgetWindowMs: number;
695
- /**
696
- * Soft threshold — the first point at which the limiter flags a burst.
697
- * Calls are still allowed; anomaly detection (issue #565 PR 5) will
698
- * surface the warning.
699
- */
700
- recallCrossNamespaceBudgetSoftLimit: number;
701
- /** Hard threshold — calls past this count are denied in the window. */
702
- recallCrossNamespaceBudgetHardLimit: number;
703
- /**
704
- * When true, recall multiplies candidate scores by the Memory Worth
705
- * factor computed from `mw_success` / `mw_fail` counters on each
706
- * memory's frontmatter (see `computeMemoryWorth`). Memories with a
707
- * history of failed sessions sink; neutral / uninstrumented memories
708
- * are untouched (multiplier 1.0). Default false — flip to true in PR 5
709
- * once the benchmark shows precision tie-or-win.
710
- */
711
- recallMemoryWorthFilterEnabled: boolean;
712
- /**
713
- * Recall-audit anomaly detector (issue #565 PR 5/5). When true,
714
- * access surfaces run the anomaly detector over a tail of the audit
715
- * trail after each recall and surface any flags via logs / metrics.
716
- * Ships disabled.
717
- */
718
- recallAuditAnomalyDetectionEnabled: boolean;
719
- /** Rolling window over which audit entries are analyzed. */
720
- recallAuditAnomalyWindowMs: number;
721
- /** Threshold for the `repeat-query` flag. */
722
- recallAuditAnomalyRepeatQueryLimit: number;
723
- /** Threshold for the `namespace-walk` flag (distinct namespaces). */
724
- recallAuditAnomalyNamespaceWalkLimit: number;
725
- /** Threshold for the `high-cardinality-return` flag. */
726
- recallAuditAnomalyHighCardinalityLimit: number;
727
- /** Threshold for the `rapid-fire` flag. */
728
- recallAuditAnomalyRapidFireLimit: number;
729
- /**
730
- * Optional half-life for Memory Worth decay, in milliseconds. When
731
- * positive, older outcome observations are exponentially decayed toward
732
- * the uniform prior. Set to 0 (default) to disable decay and use raw
733
- * counter values.
734
- */
735
- recallMemoryWorthHalfLifeMs: number;
736
- memoryLinkingEnabled: boolean;
737
- threadingEnabled: boolean;
738
- threadingGapMinutes: number;
739
- summarizationEnabled: boolean;
740
- summarizationTriggerCount: number;
741
- summarizationRecentToKeep: number;
742
- summarizationImportanceThreshold: number;
743
- summarizationProtectedTags: string[];
744
- topicExtractionEnabled: boolean;
745
- topicExtractionTopN: number;
746
- transcriptEnabled: boolean;
747
- transcriptRetentionDays: number;
748
- /** Channel types to skip from transcript logging (e.g., ["cron"]) */
749
- transcriptSkipChannelTypes: string[];
750
- transcriptRecallHours: number;
751
- maxTranscriptTurns: number;
752
- maxTranscriptTokens: number;
753
- checkpointEnabled: boolean;
754
- checkpointTurns: number;
755
- compactionResetEnabled: boolean;
756
- beforeResetTimeoutMs: number;
757
- flushOnResetEnabled: boolean;
758
- commandsListEnabled: boolean;
759
- openclawToolsEnabled: boolean;
760
- openclawToolSnippetMaxChars: number;
761
- sessionTogglesEnabled: boolean;
762
- verboseRecallVisibility: boolean;
763
- recallTranscriptsEnabled: boolean;
764
- recallTranscriptRetentionDays: number;
765
- respectBundledActiveMemoryToggle: boolean;
766
- activeRecallEnabled: boolean;
767
- activeRecallAgents: string[] | null;
768
- activeRecallAllowedChatTypes: ActiveRecallChatType[];
769
- activeRecallQueryMode: ActiveRecallQueryMode;
770
- activeRecallPromptStyle: ActiveRecallPromptStyle;
771
- activeRecallPromptOverride: string | null;
772
- activeRecallPromptAppend: string | null;
773
- activeRecallMaxSummaryChars: number;
774
- activeRecallRecentUserTurns: number;
775
- activeRecallRecentAssistantTurns: number;
776
- activeRecallRecentUserChars: number;
777
- activeRecallRecentAssistantChars: number;
778
- activeRecallThinking: ActiveRecallThinking;
779
- activeRecallTimeoutMs: number;
780
- activeRecallCacheTtlMs: number;
781
- activeRecallModel: string | null;
782
- activeRecallModelFallbackPolicy: ActiveRecallModelFallbackPolicy;
783
- activeRecallPersistTranscripts: boolean;
784
- activeRecallTranscriptDir: string;
785
- activeRecallEntityGraphDepth: number;
786
- activeRecallIncludeCausalTrajectories: boolean;
787
- activeRecallIncludeDaySummary: boolean;
788
- activeRecallAttachRecallExplain: boolean;
789
- activeRecallAllowChainedActiveMemory: boolean;
790
- dreaming: DreamingConfig;
791
- /**
792
- * Unified dreams-phases config block (issue #678 PR 2/4).
793
- * Groups existing lifecycle, REM, and deep-sleep gates under one namespace.
794
- * Values here WIN over equivalent legacy top-level keys when set. See docs/dreams.md.
795
- */
796
- dreamsPhases: DreamsPhasesConfig;
797
- procedural: ProceduralConfig;
798
- /**
799
- * At-rest encryption configuration (issue #690 PR 3/4).
800
- *
801
- * When `secureStoreEnabled` is true, `StorageManager` reads and
802
- * writes memory files through the `secure-fs` encryption layer.
803
- * The store must be unlocked via `remnic secure-store unlock` before
804
- * any recall or store operations will succeed.
805
- *
806
- * When `secureStoreEncryptOnWrite` is true (the default when enabled),
807
- * every new memory write is encrypted. Set to false to pause new
808
- * encryptions while still being able to decrypt existing files.
809
- */
810
- secureStoreEnabled: boolean;
811
- /** Encrypt new writes when the secure-store is unlocked. Default true. */
812
- secureStoreEncryptOnWrite: boolean;
813
- codingMode: CodingModeConfig;
814
- heartbeat: HeartbeatConfig;
815
- slotBehavior: SlotBehaviorConfig;
816
- codexCompat: CodexCompatConfig;
817
- /**
818
- * When true (default), the extraction prompt instructs the LLM to classify
819
- * each fact as `"project"` or `"global"` scope. Global-scoped facts are
820
- * promoted to the shared namespace so they are visible across all projects.
821
- * When false, all facts go to whatever namespace the session is in (pre-
822
- * scope-classification behavior). Rule 30: configuration gate.
823
- */
824
- extractionScopeClassificationEnabled: boolean;
825
- /** Enable the LLM-as-judge fact-worthiness gate on extracted facts. Default false (opt-in). */
826
- extractionJudgeEnabled: boolean;
827
- /** Model override for the judge LLM. Empty string means use the local model. */
828
- extractionJudgeModel: string;
829
- /** Maximum number of candidate facts per judge LLM batch call. */
830
- extractionJudgeBatchSize: number;
831
- /** Shadow mode: log judge verdicts but do not filter facts. Default false. */
832
- extractionJudgeShadow: boolean;
833
- /**
834
- * Maximum number of times the same candidate text may be deferred before
835
- * the judge forcibly converts the verdict to `"reject"`. Prevents
836
- * pathological LLM responses from looping forever on ambiguous facts.
837
- * Defaults to 2 (issue #562, PR 2).
838
- */
839
- extractionJudgeMaxDeferrals: number;
840
- /**
841
- * Emit structured telemetry rows to
842
- * `state/observation-ledger/extraction-judge-verdicts.jsonl` on every
843
- * judge verdict. Off by default; enable to collect defer-rate / latency
844
- * metrics for operator dashboards (issue #562, PR 3).
845
- */
846
- extractionJudgeTelemetryEnabled: boolean;
847
- /**
848
- * Collect `(candidate_text, verdict_kind, reason)` tuples into
849
- * `~/.remnic/judge-training/<date>.jsonl` for use by a future GRPO
850
- * training pipeline (issue #562, PR 4). Off by default. Rows live in
851
- * the user's home directory rather than the shared memory directory so
852
- * they are not committed, sync'd, or bundled into memory exports.
853
- */
854
- collectJudgeTrainingPairs: boolean;
855
- /**
856
- * Override directory for judge training-pair collection. Empty string
857
- * means use the default (`~/.remnic/judge-training`). Primarily for
858
- * tests and for operators who want the output to land in a specific
859
- * location.
860
- */
861
- judgeTrainingDir: string;
862
- hourlySummariesEnabled: boolean;
863
- daySummaryEnabled: boolean;
864
- /** If true, Engram may attempt to auto-register an hourly summary cron job (default off). */
865
- hourlySummaryCronAutoRegister: boolean;
866
- /** If true, Engram may attempt to auto-register the nightly governance cron job (default off). */
867
- nightlyGovernanceCronAutoRegister: boolean;
868
- summaryRecallHours: number;
869
- maxSummaryCount: number;
870
- summaryModel: string;
871
- hourlySummariesExtendedEnabled: boolean;
872
- hourlySummariesIncludeToolStats: boolean;
873
- hourlySummariesIncludeSystemMessages: boolean;
874
- hourlySummariesMaxTurnsPerRun: number;
875
- conversationIndexEnabled: boolean;
876
- conversationIndexBackend: "qmd" | "faiss";
877
- conversationIndexQmdCollection: string;
878
- conversationIndexRetentionDays: number;
879
- conversationIndexMinUpdateIntervalMs: number;
880
- conversationIndexEmbedOnUpdate: boolean;
881
- conversationIndexFaissScriptPath?: string;
882
- conversationIndexFaissPythonBin?: string;
883
- conversationIndexFaissModelId: string;
884
- conversationIndexFaissIndexDir: string;
885
- conversationIndexFaissUpsertTimeoutMs: number;
886
- conversationIndexFaissSearchTimeoutMs: number;
887
- conversationIndexFaissHealthTimeoutMs: number;
888
- conversationIndexFaissMaxBatchSize: number;
889
- conversationIndexFaissMaxSearchK: number;
890
- conversationRecallTopK: number;
891
- conversationRecallMaxChars: number;
892
- conversationRecallTimeoutMs: number;
893
- evalHarnessEnabled: boolean;
894
- evalShadowModeEnabled: boolean;
895
- benchmarkBaselineSnapshotsEnabled: boolean;
896
- benchmarkDeltaReporterEnabled: boolean;
897
- benchmarkStoredBaselineEnabled: boolean;
898
- evalStoreDir: string;
899
- objectiveStateMemoryEnabled: boolean;
900
- objectiveStateSnapshotWritesEnabled: boolean;
901
- objectiveStateRecallEnabled: boolean;
902
- objectiveStateStoreDir: string;
903
- causalTrajectoryMemoryEnabled: boolean;
904
- causalTrajectoryStoreDir: string;
905
- causalTrajectoryRecallEnabled: boolean;
906
- actionGraphRecallEnabled: boolean;
907
- trustZonesEnabled: boolean;
908
- quarantinePromotionEnabled: boolean;
909
- trustZoneStoreDir: string;
910
- trustZoneRecallEnabled: boolean;
911
- memoryPoisoningDefenseEnabled: boolean;
912
- memoryRedTeamBenchEnabled: boolean;
913
- harmonicRetrievalEnabled: boolean;
914
- abstractionAnchorsEnabled: boolean;
915
- abstractionNodeStoreDir: string;
916
- verifiedRecallEnabled: boolean;
917
- semanticRulePromotionEnabled: boolean;
918
- semanticRuleVerificationEnabled: boolean;
919
- semanticConsolidationEnabled: boolean;
920
- semanticConsolidationModel: string;
921
- semanticConsolidationThreshold: number;
922
- semanticConsolidationMinClusterSize: number;
923
- semanticConsolidationExcludeCategories: string[];
924
- semanticConsolidationIntervalHours: number;
925
- semanticConsolidationMaxPerRun: number;
926
- /**
927
- * When true (default), semantic-consolidation prompts the LLM with an
928
- * operator-aware format asking for JSON `{operator, output}` and records
929
- * the resulting SPLIT/MERGE/UPDATE operator on `derived_via`. When
930
- * false, falls back to the legacy plain-text prompt — `derived_via` is
931
- * still populated via the cluster-shape heuristic in
932
- * `chooseConsolidationOperator`. Issue #561 PR 3.
933
- */
934
- operatorAwareConsolidationEnabled: boolean;
935
- /**
936
- * When true, the pattern-reinforcement maintenance job runs on its
937
- * configured cadence and clusters duplicate non-procedural memories
938
- * by normalized content. Clusters with `>= patternReinforcementMinCount`
939
- * members produce a canonical (most-recent) memory tagged with
940
- * `reinforcement_count` + `last_reinforced_at`; the older duplicates
941
- * are marked `superseded` and pointed at the canonical. Default
942
- * `false` — opt-in until bench validation lands.
943
- */
944
- patternReinforcementEnabled: boolean;
945
- /**
946
- * Minimum interval (ms) between pattern-reinforcement runs. Default
947
- * `7 * 24 * 60 * 60 * 1000` (7 days). Set to `0` to disable cadence
948
- * gating (useful for tests / manual invocation).
949
- */
950
- patternReinforcementCadenceMs: number;
951
- /**
952
- * Minimum cluster size before pattern reinforcement promotes a
953
- * canonical and supersedes duplicates. Default `3`. Clamped to
954
- * `>= 2` at config-parse time — a "cluster of 1" is just a single
955
- * memory and a "cluster of 0" is meaningless.
956
- */
957
- patternReinforcementMinCount: number;
958
- /**
959
- * Memory categories the pattern-reinforcement job considers.
960
- * Default `["preference", "fact", "decision"]`. The job
961
- * intentionally skips procedural memories so it stays disjoint from
962
- * the procedural mining pipeline.
963
- */
964
- patternReinforcementCategories: string[];
965
- /** issue #687 PR 3/4: opt-in recall score boost for reinforced memories. Default false. */
966
- reinforcementRecallBoostEnabled: boolean;
967
- /** Score bonus per unit of reinforcement_count. Range [0, 1]. Default 0.05. */
968
- reinforcementRecallBoostWeight: number;
969
- /** Maximum additive reinforcement boost per result. Range [0, 1]. Default 0.3. */
970
- reinforcementRecallBoostMax: number;
971
- /**
972
- * Async peer profile reasoner — issue #679 PR 2/5.
973
- *
974
- * Default `false` (opt-in). When enabled, the reasoner runs after
975
- * `runSemanticConsolidation` (the REM phase of the dreams pipeline)
976
- * and updates per-peer profile.md files with provenance-tagged
977
- * field updates derived from the peer's interaction log.
978
- */
979
- peerProfileReasonerEnabled: boolean;
980
- /**
981
- * Model identifier used by the peer profile reasoner. Logged for
982
- * telemetry only — actual dispatch is via the same FallbackLlmClient
983
- * the orchestrator uses for semantic consolidation. Default `gpt-5.2`.
984
- */
985
- peerProfileReasonerModel: string;
986
- /**
987
- * Minimum new interaction-log entries a peer must accumulate since
988
- * the previous reasoner run before being processed again. Default 5.
989
- * Setting to 0 forces every run to consider every peer.
990
- */
991
- peerProfileReasonerMinInteractions: number;
992
- /**
993
- * Hard cap on the total number of profile fields the reasoner will
994
- * apply across all peers in a single run. Default 8.
995
- */
996
- peerProfileReasonerMaxFieldsPerRun: number;
997
- /**
998
- * When true, inject the active peer's profile fields into the recall
999
- * context as a "## Peer Profile" section. Default false (opt-in,
1000
- * Gotcha #30/#48 — least-privileged default). Requires the session's
1001
- * peer ID to be registered via `setPeerIdForSession` before recall.
1002
- */
1003
- peerProfileRecallEnabled: boolean;
1004
- /**
1005
- * Maximum number of peer profile fields to inject per recall. Only
1006
- * the most-recently-updated N fields are included to keep the context
1007
- * budget predictable. Default 5. Setting to 0 disables field
1008
- * injection even when `peerProfileRecallEnabled` is true.
1009
- */
1010
- peerProfileRecallMaxFields: number;
1011
- creationMemoryEnabled: boolean;
1012
- memoryUtilityLearningEnabled: boolean;
1013
- promotionByOutcomeEnabled: boolean;
1014
- commitmentLedgerEnabled: boolean;
1015
- commitmentLifecycleEnabled: boolean;
1016
- commitmentStaleDays: number;
1017
- commitmentLedgerDir: string;
1018
- resumeBundlesEnabled: boolean;
1019
- resumeBundleDir: string;
1020
- workProductRecallEnabled: boolean;
1021
- workProductLedgerDir: string;
1022
- workTasksEnabled: boolean;
1023
- workProjectsEnabled: boolean;
1024
- workTasksDir: string;
1025
- workProjectsDir: string;
1026
- workIndexEnabled: boolean;
1027
- workIndexDir: string;
1028
- workTaskIndexEnabled: boolean;
1029
- workProjectIndexEnabled: boolean;
1030
- workIndexAutoRebuildEnabled: boolean;
1031
- workIndexAutoRebuildDebounceMs: number;
1032
- localLlmEnabled: boolean;
1033
- localLlmUrl: string;
1034
- localLlmModel: string;
1035
- /** Optional API key for authenticated OpenAI-compatible endpoints. */
1036
- localLlmApiKey?: string;
1037
- /** Additional headers for local/compatible endpoint requests. */
1038
- localLlmHeaders?: Record<string, string>;
1039
- /** If false, do not send Authorization header even when localLlmApiKey is set. */
1040
- localLlmAuthHeader: boolean;
1041
- localLlmFallback: boolean;
1042
- /** Optional home directory override for local LLM helpers (LM Studio settings, CLI PATH). */
1043
- localLlmHomeDir?: string;
1044
- /** Optional absolute path to LMS CLI binary (preferred over auto-detection). */
1045
- localLmsCliPath?: string;
1046
- /** Optional bin directory prepended to PATH for LMS CLI execution. */
1047
- localLmsBinDir?: string;
1048
- /** Hard timeout for local LLM requests (ms). */
1049
- localLlmTimeoutMs: number;
1050
- /** Max context window for local LLM (override auto-detection). Set lower if your LLM server defaults to smaller contexts. */
1051
- localLlmMaxContext?: number;
1052
- /** If true, log slow operations (local LLM + related I/O) with durations and metadata (no content). */
1053
- slowLogEnabled: boolean;
1054
- /**
1055
- * If true, include the full recalled memory text in `RecallTraceEvent.recalledContent`.
1056
- * Disabled by default — enable only when you want external trace subscribers (e.g. Langfuse)
1057
- * to see the exact memory context injected into each conversation turn.
1058
- * This adds payload to trace events but does not log to files or the gateway log.
1059
- */
1060
- traceRecallContent: boolean;
1061
- /** Threshold for slow operation logging (ms). */
1062
- slowLogThresholdMs: number;
1063
- /** If true, collect and persist timing traces for recall and extraction pipelines. */
1064
- profilingEnabled: boolean;
1065
- /** Directory for profiling trace JSONL files. Defaults to <memoryDir>/profiling. */
1066
- profilingStorageDir: string;
1067
- /** Maximum number of trace files to keep (rolling window). */
1068
- profilingMaxTraces: number;
1069
- extractionDedupeEnabled: boolean;
1070
- extractionDedupeWindowMs: number;
1071
- extractionMinChars: number;
1072
- extractionMinUserTurns: number;
1073
- extractionMaxTurnChars: number;
1074
- extractionMaxFactsPerRun: number;
1075
- extractionMaxEntitiesPerRun: number;
1076
- extractionMaxQuestionsPerRun: number;
1077
- extractionMaxProfileUpdatesPerRun: number;
1078
- /**
1079
- * Minimum importance level required to persist an extracted fact. Facts
1080
- * whose locally-scored level falls below this threshold are dropped before
1081
- * write and counted toward the `importance_gated` metric. Defaults to
1082
- * "low" so trivial content (greetings, single-word replies, filler) is
1083
- * silently dropped while everything else still passes.
1084
- */
1085
- extractionMinImportanceLevel: ImportanceLevel;
1086
- /**
1087
- * Inline source attribution (issue #369).
1088
- * When enabled, extracted facts carry a compact provenance tag (agent,
1089
- * session, timestamp) inlined into the fact text — not just in YAML
1090
- * frontmatter — so the citation survives prompt injection, copy/paste,
1091
- * and LLM quoting. Off by default to preserve backwards compatibility
1092
- * with existing downstream consumers that expect raw fact text.
1093
- */
1094
- inlineSourceAttributionEnabled: boolean;
1095
- /**
1096
- * Template used when injecting inline citations. Supported placeholders:
1097
- * `{agent}`, `{session}`, `{sessionId}`, `{ts}`, `{date}`. Defaults to
1098
- * `[Source: agent={agent}, session={sessionId}, ts={ts}]`.
1099
- */
1100
- inlineSourceAttributionFormat: string;
1101
- consolidationRequireNonZeroExtraction: boolean;
1102
- consolidationMinIntervalMs: number;
1103
- qmdMaintenanceEnabled: boolean;
1104
- qmdMaintenanceDebounceMs: number;
1105
- qmdAutoEmbedEnabled: boolean;
1106
- qmdEmbedMinIntervalMs: number;
1107
- qmdUpdateTimeoutMs: number;
1108
- qmdUpdateMinIntervalMs: number;
1109
- localLlmRetry5xxCount: number;
1110
- localLlmRetryBackoffMs: number;
1111
- localLlm400TripThreshold: number;
1112
- localLlm400CooldownMs: number;
1113
- localLlmFastEnabled: boolean;
1114
- localLlmFastModel: string;
1115
- localLlmFastUrl: string;
1116
- localLlmFastTimeoutMs: number;
1117
- /**
1118
- * Suppress chain-of-thought / thinking mode on the main local LLM
1119
- * (issue #548). When true, Remnic injects
1120
- * `chat_template_kwargs: { enable_thinking: false }` on every
1121
- * request so thinking-capable models (Qwen 3.5, Gemma 4, DeepSeek,
1122
- * etc.) skip reasoning tokens that structured-output tasks like
1123
- * extraction and consolidation cannot benefit from. Default: true
1124
- * — the dominant localLlm use case is JSON-shaped extraction where
1125
- * thinking is pure latency tax and a common cause of 60s timeouts.
1126
- * Set to false to restore thinking for narrative tasks.
1127
- *
1128
- * The fast-tier client (`fastLlm`) always disables thinking; that
1129
- * contract is baked into "fast tier" and is unaffected by this flag.
1130
- */
1131
- localLlmDisableThinking: boolean;
1132
- gatewayConfig?: GatewayConfig;
1133
- modelSource: "plugin" | "gateway";
1134
- gatewayAgentId: string;
1135
- fastGatewayAgentId: string;
1136
- namespacesEnabled: boolean;
1137
- defaultNamespace: string;
1138
- sharedNamespace: string;
1139
- principalFromSessionKeyMode: PrincipalFromSessionKeyMode;
1140
- principalFromSessionKeyRules: PrincipalRule[];
1141
- namespacePolicies: NamespacePolicy[];
1142
- defaultRecallNamespaces: Array<"self" | "shared">;
1143
- cronRecallMode: CronRecallMode;
1144
- cronRecallAllowlist: string[];
1145
- cronRecallPolicyEnabled: boolean;
1146
- cronRecallNormalizedQueryMaxChars: number;
1147
- cronRecallInstructionHeavyTokenCap: number;
1148
- cronConversationRecallMode: CronConversationRecallMode;
1149
- autoPromoteToSharedEnabled: boolean;
1150
- autoPromoteToSharedCategories: Array<"fact" | "correction" | "decision" | "preference">;
1151
- autoPromoteMinConfidenceTier: ConfidenceTier;
1152
- routingRulesEnabled: boolean;
1153
- routingRulesStateFile: string;
1154
- sharedContextEnabled: boolean;
1155
- sharedContextDir?: string;
1156
- sharedContextMaxInjectChars: number;
1157
- crossSignalsSemanticEnabled: boolean;
1158
- crossSignalsSemanticTimeoutMs: number;
1159
- sharedCrossSignalSemanticEnabled?: boolean;
1160
- sharedCrossSignalSemanticTimeoutMs?: number;
1161
- sharedCrossSignalSemanticMaxCandidates?: number;
1162
- compoundingEnabled: boolean;
1163
- compoundingWeeklyCronEnabled: boolean;
1164
- compoundingSemanticEnabled: boolean;
1165
- compoundingSynthesisTimeoutMs: number;
1166
- compoundingInjectEnabled: boolean;
1167
- ircEnabled: boolean;
1168
- ircMaxPreferences: number;
1169
- ircIncludeCorrections: boolean;
1170
- ircMinConfidence: number;
1171
- cmcEnabled: boolean;
1172
- cmcStitchLookbackDays: number;
1173
- cmcStitchMinScore: number;
1174
- cmcStitchMaxEdgesPerTrajectory: number;
1175
- cmcConsolidationEnabled: boolean;
1176
- cmcConsolidationMinRecurrence: number;
1177
- cmcConsolidationMinSessions: number;
1178
- cmcConsolidationSuccessThreshold: number;
1179
- cmcRetrievalEnabled: boolean;
1180
- cmcRetrievalMaxDepth: number;
1181
- cmcRetrievalMaxChars: number;
1182
- cmcRetrievalCounterfactualBoost: number;
1183
- cmcBehaviorLearningEnabled: boolean;
1184
- cmcBehaviorMinFrequency: number;
1185
- cmcBehaviorMinSessions: number;
1186
- cmcBehaviorConfidenceThreshold: number;
1187
- cmcLifecycleCausalImpactWeight: number;
1188
- calibrationEnabled: boolean;
1189
- calibrationMaxRulesPerRecall: number;
1190
- calibrationMaxChars: number;
1191
- searchBackend?: "qmd" | "remote" | "noop" | "lancedb" | "meilisearch" | "orama";
1192
- remoteSearchBaseUrl?: string;
1193
- remoteSearchApiKey?: string;
1194
- remoteSearchTimeoutMs?: number;
1195
- lancedbEnabled: boolean;
1196
- lanceDbPath?: string;
1197
- lanceEmbeddingDimension?: number;
1198
- meilisearchEnabled: boolean;
1199
- meilisearchHost?: string;
1200
- meilisearchApiKey?: string;
1201
- meilisearchTimeoutMs?: number;
1202
- meilisearchAutoIndex?: boolean;
1203
- oramaEnabled: boolean;
1204
- oramaDbPath?: string;
1205
- oramaEmbeddingDimension?: number;
1206
- qmdDaemonEnabled: boolean;
1207
- qmdDaemonUrl: string;
1208
- qmdDaemonRecheckIntervalMs: number;
1209
- qmdIntentHintsEnabled: boolean;
1210
- qmdExplainEnabled: boolean;
1211
- knowledgeIndexEnabled: boolean;
1212
- knowledgeIndexMaxEntities: number;
1213
- knowledgeIndexMaxChars: number;
1214
- entityRetrievalEnabled: boolean;
1215
- entityRetrievalMaxChars: number;
1216
- entityRetrievalMaxHints: number;
1217
- entityRetrievalMaxSupportingFacts: number;
1218
- entityRetrievalMaxRelatedEntities: number;
1219
- entityRetrievalRecentTurns: number;
1220
- entitySchemas?: Record<string, EntitySchemaDefinition>;
1221
- recallBudgetChars: number;
1222
- recallOuterTimeoutMs: number;
1223
- recallCoreDeadlineMs: number;
1224
- recallEnrichmentDeadlineMs: number;
1225
- recallPipeline: RecallSectionConfig[];
1226
- /** Apply Maximal Marginal Relevance to the final recall selection per-section. */
1227
- recallMmrEnabled: boolean;
1228
- /** MMR λ parameter. 1.0 = pure relevance, 0.0 = pure diversity. Default 0.7. */
1229
- recallMmrLambda: number;
1230
- /** MMR is applied over the top N candidates per section. Default 40. */
1231
- recallMmrTopN: number;
1232
- /**
1233
- * Boost stored `reasoning_trace` memories in recall results when the
1234
- * incoming query reads like a problem-solving ask (e.g. "how do I…",
1235
- * "step by step", "walk me through…"). Default false — opt in after
1236
- * benchmarking (issue #564 PR 3).
1237
- */
1238
- recallReasoningTraceBoostEnabled: boolean;
1239
- qmdRecallCacheTtlMs: number;
1240
- qmdRecallCacheStaleTtlMs: number;
1241
- qmdRecallCacheMaxEntries: number;
1242
- entityRelationshipsEnabled: boolean;
1243
- entityActivityLogEnabled: boolean;
1244
- entityActivityLogMaxEntries: number;
1245
- entityAliasesEnabled: boolean;
1246
- entitySummaryEnabled: boolean;
1247
- entitySynthesisMaxTokens: number;
1248
- /** Enable content-hash deduplication to prevent storing semantically identical facts. */
1249
- factDeduplicationEnabled: boolean;
1250
- /**
1251
- * Issue #373 — Write-time semantic similarity guard. When enabled (default),
1252
- * the orchestrator embeds each candidate fact and queries the existing
1253
- * embedding index for its top-K nearest neighbors. If the best cosine
1254
- * similarity is at or above `semanticDedupThreshold`, the fact is dropped
1255
- * as a near-duplicate. Fails open (keeps the fact) if the embedding backend
1256
- * is unavailable.
1257
- */
1258
- semanticDedupEnabled: boolean;
1259
- /** Cosine similarity threshold in [0, 1] above which a candidate fact is skipped. */
1260
- semanticDedupThreshold: number;
1261
- /** Number of nearest-neighbor candidates to consider during semantic dedup. */
1262
- semanticDedupCandidates: number;
1263
- /** Enable automatic archival of old, low-importance, rarely-accessed facts. */
1264
- factArchivalEnabled: boolean;
1265
- /** Minimum age in days before a fact is eligible for archival. */
1266
- factArchivalAgeDays: number;
1267
- /** Maximum importance score for archival eligibility (0-1). Only facts below this are archived. */
1268
- factArchivalMaxImportance: number;
1269
- /** Maximum access count for archival eligibility. Only rarely-accessed facts are archived. */
1270
- factArchivalMaxAccessCount: number;
1271
- /** Tags that protect a fact from archival regardless of other criteria. */
1272
- factArchivalProtectedCategories: string[];
1273
- lifecyclePolicyEnabled: boolean;
1274
- lifecycleFilterStaleEnabled: boolean;
1275
- lifecyclePromoteHeatThreshold: number;
1276
- lifecycleStaleDecayThreshold: number;
1277
- lifecycleArchiveDecayThreshold: number;
1278
- lifecycleProtectedCategories: MemoryCategory[];
1279
- lifecycleMetricsEnabled: boolean;
1280
- proactiveExtractionEnabled: boolean;
1281
- contextCompressionActionsEnabled: boolean;
1282
- compressionGuidelineLearningEnabled: boolean;
1283
- compressionGuidelineSemanticRefinementEnabled: boolean;
1284
- compressionGuidelineSemanticTimeoutMs: number;
1285
- maxProactiveQuestionsPerExtraction: number;
1286
- proactiveExtractionTimeoutMs: number;
1287
- proactiveExtractionMaxTokens: number;
1288
- extractionMaxOutputTokens: number;
1289
- proactiveExtractionCategoryAllowlist?: MemoryCategory[];
1290
- maxCompressionTokensPerHour: number;
1291
- behaviorLoopAutoTuneEnabled: boolean;
1292
- behaviorLoopLearningWindowDays: number;
1293
- behaviorLoopMinSignalCount: number;
1294
- behaviorLoopMaxDeltaPerCycle: number;
1295
- behaviorLoopProtectedParams: string[];
1296
- recallPlannerEnabled: boolean;
1297
- recallPlannerModel: string;
1298
- recallPlannerTimeoutMs: number;
1299
- recallPlannerUseResponsesApi: boolean;
1300
- recallPlannerMaxPromptChars: number;
1301
- recallPlannerMaxMemoryHints: number;
1302
- recallPlannerShadowMode: boolean;
1303
- recallPlannerTelemetryEnabled: boolean;
1304
- recallPlannerMaxQmdResultsMinimal: number;
1305
- recallPlannerMaxQmdResultsFull: number;
1306
- intentRoutingEnabled: boolean;
1307
- intentRoutingBoost: number;
1308
- verbatimArtifactsEnabled: boolean;
1309
- verbatimArtifactsMinConfidence: number;
1310
- verbatimArtifactsMaxRecall: number;
1311
- verbatimArtifactCategories: MemoryCategory[];
1312
- memoryBoxesEnabled: boolean;
1313
- /** Jaccard overlap threshold below which a topic shift triggers box sealing (0-1, default 0.35) */
1314
- boxTopicShiftThreshold: number;
1315
- /** Time gap in ms before an open box is sealed (default 30 min) */
1316
- boxTimeGapMs: number;
1317
- /** Max memories per box before forced seal */
1318
- boxMaxMemories: number;
1319
- traceWeaverEnabled: boolean;
1320
- /** Days back to search for trace links */
1321
- traceWeaverLookbackDays: number;
1322
- /** Minimum Jaccard overlap to assign the same traceId (0-1, default 0.4) */
1323
- traceWeaverOverlapThreshold: number;
1324
- /** Number of recent days of boxes to inject during recall */
1325
- boxRecallDays: number;
1326
- /** Classify extracted memories as episode or note and tag with memoryKind */
1327
- episodeNoteModeEnabled: boolean;
1328
- /** Build and maintain temporal (state/index_time.json) and tag (state/index_tags.json) indexes */
1329
- queryAwareIndexingEnabled: boolean;
1330
- /** Max candidate paths returned from index prefilter (0 = no cap) */
1331
- queryAwareIndexingMaxCandidates: number;
1332
- temporalIndexWindowDays: number;
1333
- temporalIndexMaxEntries: number;
1334
- temporalBoostRecentDays: number;
1335
- temporalBoostScore: number;
1336
- temporalDecayEnabled: boolean;
1337
- tagMemoryEnabled: boolean;
1338
- tagMaxPerMemory: number;
1339
- tagIndexMaxEntries: number;
1340
- tagRecallBoost: number;
1341
- tagRecallMaxMatches: number;
1342
- multiGraphMemoryEnabled: boolean;
1343
- graphRecallEnabled: boolean;
1344
- graphRecallMaxExpansions: number;
1345
- graphRecallMaxPerSeed: number;
1346
- graphRecallMinEdgeWeight: number;
1347
- graphRecallShadowEnabled: boolean;
1348
- graphRecallSnapshotEnabled: boolean;
1349
- graphRecallShadowSampleRate: number;
1350
- graphRecallExplainToolEnabled: boolean;
1351
- graphRecallStoreColdMirror: boolean;
1352
- graphRecallColdMirrorCollection?: string;
1353
- graphRecallColdMirrorMinAgeDays: number;
1354
- graphRecallUseEntityPriors: boolean;
1355
- graphRecallEntityPriorBoost: number;
1356
- graphRecallPreferHubSeeds: boolean;
1357
- graphRecallHubBias: number;
1358
- graphRecallRecencyHalfLifeDays: number;
1359
- graphRecallDampingFactor: number;
1360
- graphRecallMaxSeedNodes: number;
1361
- graphRecallMaxExpandedNodes: number;
1362
- graphRecallMaxTrailPerNode: number;
1363
- graphRecallMinSeedScore: number;
1364
- graphRecallExpansionScoreThreshold: number;
1365
- graphRecallExplainMaxPaths: number;
1366
- graphRecallExplainMaxChars: number;
1367
- graphRecallExplainEdgeLimit: number;
1368
- graphRecallExplainEnabled: boolean;
1369
- graphRecallEntityHintsEnabled: boolean;
1370
- graphRecallEntityHintMax: number;
1371
- graphRecallEntityHintMaxChars: number;
1372
- graphRecallSnapshotDir: string;
1373
- graphRecallEnableTrace: boolean;
1374
- graphRecallEnableDebug: boolean;
1375
- /** Allow graph_mode escalation for broader causal/timeline phrasing beyond strict keywords. */
1376
- graphExpandedIntentEnabled?: boolean;
1377
- /** Run bounded graph expansion in full mode when enough recall seeds exist. */
1378
- graphAssistInFullModeEnabled?: boolean;
1379
- /** In full mode, compute graph assist for telemetry/snapshotting but do not inject merged results. */
1380
- graphAssistShadowEvalEnabled?: boolean;
1381
- /** Minimum seed results required before full-mode graph assist runs. */
1382
- graphAssistMinSeedResults?: number;
1383
- entityGraphEnabled: boolean;
1384
- timeGraphEnabled: boolean;
1385
- /** When true, write fallback temporal adjacency edges for consecutive extracted memories. */
1386
- graphWriteSessionAdjacencyEnabled?: boolean;
1387
- causalGraphEnabled: boolean;
1388
- maxGraphTraversalSteps: number;
1389
- graphActivationDecay: number;
1390
- /** Weight of graph activation score when blending with seed QMD score (0-1). */
1391
- graphExpansionActivationWeight: number;
1392
- /** Lower bound for blended graph-expanded recall scores (0-1). */
1393
- graphExpansionBlendMin: number;
1394
- /** Upper bound for blended graph-expanded recall scores (0-1). */
1395
- graphExpansionBlendMax: number;
1396
- maxEntityGraphEdgesPerMemory: number;
1397
- /** SimpleMem-inspired de-linearization: resolve pronouns and anchor relative dates after extraction. */
1398
- delinearizeEnabled: boolean;
1399
- /** Synapse-inspired confidence gate — skip memory injection when top score is below threshold. */
1400
- recallConfidenceGateEnabled: boolean;
1401
- recallConfidenceGateThreshold: number;
1402
- /** PlugMem-inspired causal rule extraction: mine IF→THEN rules during consolidation. */
1403
- causalRuleExtractionEnabled: boolean;
1404
- /** E-Mem-inspired memory reconstruction: targeted retrieval for missing entity context. */
1405
- memoryReconstructionEnabled: boolean;
1406
- /** Maximum number of entity expansions per recall. */
1407
- memoryReconstructionMaxExpansions: number;
1408
- /** Synapse-inspired lateral inhibition to suppress hub-node dominance. */
1409
- graphLateralInhibitionEnabled: boolean;
1410
- /** Inhibition strength (default 0.15). Higher = more suppression. */
1411
- graphLateralInhibitionBeta: number;
1412
- /** Number of top competing nodes considered for inhibition (default 7). */
1413
- graphLateralInhibitionTopM: number;
1414
- /** Enable the periodic graph-edge confidence decay job. Default false (opt-in). */
1415
- graphEdgeDecayEnabled: boolean;
1416
- /** Cadence in milliseconds at which the cron triggers the decay job. Default 7d. */
1417
- graphEdgeDecayCadenceMs: number;
1418
- /** Decay window passed through to `decayEdgeConfidence`. Default 90 days. */
1419
- graphEdgeDecayWindowMs: number;
1420
- /** Per-window confidence drop. Default 0.1. */
1421
- graphEdgeDecayPerWindow: number;
1422
- /** Floor confidence will not decay below. Default 0.1. */
1423
- graphEdgeDecayFloor: number;
1424
- /** Confidence threshold for the "below visibility" telemetry counter. Default 0.2. */
1425
- graphEdgeDecayVisibilityThreshold: number;
1426
- /**
1427
- * Issue #681 PR 3/3 — minimum edge confidence required for an edge to be
1428
- * traversed during spreading activation. Edges with `confidence` below this
1429
- * floor are pruned and contribute neither activation nor downstream
1430
- * neighbors. Legacy edges without `confidence` are treated as 1.0 so they
1431
- * always pass the floor. Range `[0, 1]`; default `0.2`.
1432
- */
1433
- graphTraversalConfidenceFloor: number;
1434
- /**
1435
- * Issue #681 PR 3/3 — number of PageRank-style refinement iterations applied
1436
- * on top of the BFS spreading-activation scores. Each iteration redistributes
1437
- * a node's confidence-weighted activation along its outgoing edges. Set to 0
1438
- * to disable refinement and use raw BFS scores. Default `8`.
1439
- */
1440
- graphTraversalPageRankIterations: number;
1441
- temporalMemoryTreeEnabled: boolean;
1442
- tmtHourlyMinMemories: number;
1443
- tmtSummaryMaxTokens: number;
1444
- lcmEnabled: boolean;
1445
- lcmLeafBatchSize: number;
1446
- lcmRollupFanIn: number;
1447
- lcmFreshTailTurns: number;
1448
- lcmMaxDepth: number;
1449
- lcmRecallBudgetShare: number;
1450
- lcmDeterministicMaxTokens: number;
1451
- lcmArchiveRetentionDays: number;
1452
- /** Enable three-agent parallel retrieval (DirectFact + Contextual + Temporal). Default false. */
1453
- parallelRetrievalEnabled: boolean;
1454
- /** Per-agent source weights for score blending during merge. */
1455
- parallelAgentWeights: {
1456
- direct: number;
1457
- contextual: number;
1458
- temporal: number;
1459
- };
1460
- /** Max results fetched per agent before merge. */
1461
- parallelMaxResultsPerAgent: number;
1462
- /** Briefing configuration knobs — see BriefingConfig for field docs. */
1463
- briefing: BriefingConfig;
1464
- codex: CodexConnectorConfig;
1465
- connectors: LiveConnectorsConfig;
1466
- /** Enable the MECE taxonomy knowledge directory. Default false. */
1467
- taxonomyEnabled: boolean;
1468
- /** Auto-regenerate RESOLVER.md when taxonomy changes. Default true. */
1469
- taxonomyAutoGenResolver: boolean;
1470
- /** Materialize Remnic memories into Codex's expected ~/.codex/memories/ layout. Default true. */
1471
- codexMaterializeMemories: boolean;
1472
- /** Namespace to materialize; "auto" derives from the connector context. Default "auto". */
1473
- codexMaterializeNamespace: string;
1474
- /** Max whitespace-tokenized size of memory_summary.md. Default 4500. */
1475
- codexMaterializeMaxSummaryTokens: number;
1476
- /** Max age in days for rollout_summaries/*.md before pruning. Default 30. */
1477
- codexMaterializeRolloutRetentionDays: number;
1478
- /** Run materialization after semantic/causal consolidation completes. Default true. */
1479
- codexMaterializeOnConsolidation: boolean;
1480
- /** Run materialization at Codex session-end hook. Default true. */
1481
- codexMaterializeOnSessionEnd: boolean;
1482
- /** Enable Codex marketplace integration. Default true. */
1483
- codexMarketplaceEnabled: boolean;
1484
- /** Enable page-level versioning with sidecar snapshots. Default false. */
1485
- versioningEnabled: boolean;
1486
- /** Maximum number of version snapshots to keep per page. Default 50. Set to 0 to disable pruning. */
1487
- versioningMaxPerPage: number;
1488
- /** Name of the sidecar directory inside memoryDir. Default ".versions". */
1489
- versioningSidecarDir: string;
1490
- /** Enable binary file lifecycle management (mirror, redirect, clean). Default: false. */
1491
- binaryLifecycleEnabled: boolean;
1492
- /** Grace period in days before a mirrored binary is eligible for local cleanup. Default: 7. */
1493
- binaryLifecycleGracePeriodDays: number;
1494
- /** Storage backend type: "filesystem" copies to a local dir, "none" is no-op. Default: "none". */
1495
- binaryLifecycleBackendType: "filesystem" | "s3" | "none";
1496
- /** Base path for the filesystem backend. Required when backendType is "filesystem". */
1497
- binaryLifecycleBackendPath: string;
1498
- /** Enable oai-mem-citation blocks in recall responses. Default false. */
1499
- citationsEnabled: boolean;
1500
- /** Auto-enable citations when the Codex adapter is detected. Default true. */
1501
- citationsAutoDetect: boolean;
1502
- /** Enable the external enrichment pipeline. Default false. */
1503
- enrichmentEnabled: boolean;
1504
- /** Automatically enrich new entities on creation. Default false. */
1505
- enrichmentAutoOnCreate: boolean;
1506
- /** Max candidates accepted per entity per enrichment run. Default 20. */
1507
- enrichmentMaxCandidatesPerEntity: number;
1508
- /** Whether third-party memory extensions are discovered and injected into consolidation. Default true. */
1509
- memoryExtensionsEnabled: boolean;
1510
- /**
1511
- * Root directory for memory extensions. Empty string means derive from
1512
- * memoryDir: go up to the Remnic home dir and append memory_extensions.
1513
- */
1514
- memoryExtensionsRoot: string;
1515
- }
1516
- /** Runtime configuration for the daily context briefing feature. */
1517
- interface BriefingConfig {
1518
- /** Whether `remnic briefing` CLI and MCP tool are enabled. */
1519
- enabled: boolean;
1520
- /** Default lookback window token (e.g. "yesterday", "3d", "1w", "24h"). */
1521
- defaultWindow: string;
1522
- /** Default output format for the CLI. */
1523
- defaultFormat: "markdown" | "json";
1524
- /** Maximum number of LLM-generated suggested follow-ups. */
1525
- maxFollowups: number;
1526
- /** Optional path to an ICS or JSON calendar file. null disables the section. */
1527
- calendarSource: string | null;
1528
- /** If true, CLI writes a dated briefing file by default. */
1529
- saveByDefault: boolean;
1530
- /** Override directory for saved briefings. null → $REMNIC_HOME/briefings/. */
1531
- saveDir: string | null;
1532
- /** Whether to call the Responses API for follow-up suggestions. */
1533
- llmFollowups: boolean;
1534
- }
1535
- /** Parsed representation of a briefing lookback window. */
1536
- type BriefingWindow = "yesterday" | "today" | string;
1537
- /** Filter the briefing to a single entity / project / topic. */
1538
- interface BriefingFocus {
1539
- type: "person" | "project" | "topic";
1540
- value: string;
1541
- }
1542
- /** Calendar event surfaced by a CalendarSource implementation. */
1543
- interface CalendarEvent {
1544
- /** Stable identifier for dedupe / linking. */
1545
- id: string;
1546
- /** Event title (short). */
1547
- title: string;
1548
- /** ISO 8601 start timestamp. */
1549
- start: string;
1550
- /** Optional ISO 8601 end timestamp. */
1551
- end?: string;
1552
- /** Optional freeform location. */
1553
- location?: string;
1554
- /** Optional short notes. */
1555
- notes?: string;
1556
- }
1557
- /** Abstraction over any calendar backend. Concrete implementations: `FileCalendarSource`. */
1558
- interface CalendarSource {
1559
- /** Return events that fall on the given UTC date (YYYY-MM-DD). */
1560
- eventsForDate(dateIso: string): Promise<CalendarEvent[]>;
1561
- }
1562
- /** A single "active thread" surfaced in a briefing. */
1563
- interface BriefingActiveThread {
1564
- id: string;
1565
- title: string;
1566
- updatedAt: string;
1567
- reason: string;
1568
- }
1569
- /** A single "recent entity" entry. */
1570
- interface BriefingRecentEntity {
1571
- name: string;
1572
- type: string;
1573
- updatedAt: string;
1574
- score: number;
1575
- summary?: string;
1576
- }
1577
- /** A single unresolved commitment or open question. */
1578
- interface BriefingOpenCommitment {
1579
- id: string;
1580
- kind: "question" | "commitment" | "pending_memory";
1581
- text: string;
1582
- source?: string;
1583
- createdAt?: string;
1584
- }
1585
- /** An LLM-generated short follow-up suggestion. */
1586
- interface BriefingFollowup {
1587
- text: string;
1588
- rationale?: string;
1589
- }
1590
- /** Structured sections of a briefing result. */
1591
- interface BriefingSections {
1592
- activeThreads: BriefingActiveThread[];
1593
- recentEntities: BriefingRecentEntity[];
1594
- openCommitments: BriefingOpenCommitment[];
1595
- suggestedFollowups: BriefingFollowup[];
1596
- /** Only populated when a calendar source is configured and returns events. */
1597
- todayCalendar?: CalendarEvent[];
1598
- }
1599
- /** A calendar source failure recorded when a CalendarSource throws during briefing generation. */
1600
- interface BriefingCalendarSourceError {
1601
- /** Human-readable description of the source (e.g. file path or source name). */
1602
- source: string;
1603
- /** Stringified error message from the failed source. */
1604
- error: string;
1605
- }
1606
- /** Result returned by `buildBriefing`. */
1607
- interface BriefingResult {
1608
- markdown: string;
1609
- json: Record<string, unknown>;
1610
- sections: BriefingSections;
1611
- /** Reason why suggested follow-ups were omitted (e.g. missing API key, LLM error). */
1612
- followupsUnavailableReason?: string;
1613
- /** Effective lookback window (ISO date range) used for this briefing. */
1614
- window: {
1615
- from: string;
1616
- to: string;
1617
- };
1618
- /**
1619
- * Calendar sources that failed during this briefing run.
1620
- * Only present (non-empty) when at least one source threw.
1621
- * Allows callers to distinguish "no events today" from "source unavailable".
1622
- */
1623
- calendarSourceErrors?: BriefingCalendarSourceError[];
1624
- }
1625
- /**
1626
- * Settings for the Codex CLI connector. These are consumed by
1627
- * `remnic connectors install codex-cli` to decide where the phase-2 memory
1628
- * extension is dropped and whether to install it at all.
1629
- */
1630
- interface CodexConnectorConfig {
1631
- /**
1632
- * Whether to install the Remnic memory extension into
1633
- * `<codex_home>/memories_extensions/remnic/` when the `codex-cli`
1634
- * connector is installed. Default `true`. Set to `false` for users who
1635
- * self-manage the Codex memory extensions folder.
1636
- */
1637
- installExtension: boolean;
1638
- /**
1639
- * Optional override for the Codex home directory. When `null`, the
1640
- * connector reads `$CODEX_HOME` and falls back to `~/.codex`. Setting
1641
- * this is useful for integration tests and non-default installs.
1642
- */
1643
- codexHome: string | null;
1644
- }
1645
- /**
1646
- * Container for live-connector config blocks (issue #683 PR 2/N).
1647
- *
1648
- * Lives at `connectors.*` rather than the top level so future connectors
1649
- * (Notion, Gmail, GitHub) can slot in without bloating `PluginConfig`.
1650
- *
1651
- * Every child block must default to `enabled: false` per CLAUDE.md gotcha
1652
- * #30 (escape hatch by default) and gotcha #48 (least-privileged enum
1653
- * defaults). Concrete connectors are also expected to short-circuit at
1654
- * registration time when their credentials are not populated.
1655
- */
1656
- interface LiveConnectorsConfig {
1657
- /** Google Drive live connector (issue #683 PR 2/N). */
1658
- googleDrive: GoogleDriveLiveConnectorConfig;
1659
- /** Notion live connector (issue #683 PR 3/N). */
1660
- notion: NotionLiveConnectorConfig;
1661
- /** Gmail live connector (issue #683 PR 4/6). */
1662
- gmail: GmailLiveConnectorConfig;
1663
- /** GitHub live connector (issue #683 PR 5/6). */
1664
- github: GitHubLiveConnectorConfig;
1665
- }
1666
- /**
1667
- * Operator-facing config for the Google Drive live connector. The connector
1668
- * module itself defines a separate, *validated* `GoogleDriveConnectorConfig`
1669
- * shape (frozen, post-validation). This interface is the pre-validation
1670
- * shape that `parseConfig` round-trips through.
1671
- *
1672
- * `clientId` / `clientSecret` / `refreshToken` are stored as strings here so
1673
- * the schema can ship in `openclaw.plugin.json` and operators can populate
1674
- * them from a secret store (e.g. an env-substituted plist or systemd
1675
- * EnvironmentFile). They MUST NEVER be committed to source. The repo-wide
1676
- * privacy policy in CLAUDE.md applies.
1677
- */
1678
- interface GoogleDriveLiveConnectorConfig {
1679
- /** Master gate. Default false — operators must opt in explicitly. */
1680
- enabled: boolean;
1681
- /** OAuth2 client id. Populate from a secret store; never commit. */
1682
- clientId: string;
1683
- /** OAuth2 client secret. Populate from a secret store; never commit. */
1684
- clientSecret: string;
1685
- /** OAuth2 refresh token. Populate from a secret store; never commit. */
1686
- refreshToken: string;
1687
- /** Poll interval in ms. Default 300000 (5 min); min 1000; max 86400000 (24h). */
1688
- pollIntervalMs: number;
1689
- /** Optional folder-id scope. Empty array = all accessible files. */
1690
- folderIds: string[];
1691
- }
1692
- /**
1693
- * Operator-facing config for the Notion live connector (issue #683 PR 3/N).
1694
- * The connector module defines a separate validated `NotionConnectorConfig`
1695
- * shape (frozen, post-validation). This interface is the pre-validation shape
1696
- * that `parseConfig` round-trips through.
1697
- *
1698
- * `token` is stored as a string here so operators can populate it from a
1699
- * secret store (e.g. an env-substituted plist or systemd EnvironmentFile).
1700
- * It MUST NEVER be committed to source. The repo-wide privacy policy in
1701
- * CLAUDE.md applies.
1702
- */
1703
- interface NotionLiveConnectorConfig {
1704
- /** Master gate. Default false — operators must opt in explicitly. */
1705
- enabled: boolean;
1706
- /** Notion integration token. Starts with `secret_`. Populate from a secret store; never commit. */
1707
- token: string;
1708
- /** Array of Notion database ids to import pages from. Empty = connector is a no-op. */
1709
- databaseIds: string[];
1710
- /** Poll interval in ms. Default 300000 (5 min); min 1000; max 86400000 (24h). */
1711
- pollIntervalMs: number;
1712
- }
1713
- /**
1714
- * Operator-facing config for the Gmail live connector (issue #683 PR 4/6).
1715
- * The connector module defines a separate validated `GmailConnectorConfig`
1716
- * shape (frozen, post-validation). This interface is the pre-validation shape
1717
- * that `parseConfig` round-trips through.
1718
- *
1719
- * OAuth2 credentials are stored as strings here so operators can populate
1720
- * them from a secret store (e.g. env-substituted plist or systemd
1721
- * EnvironmentFile). They MUST NEVER be committed to source. The repo-wide
1722
- * privacy policy in CLAUDE.md applies.
1723
- */
1724
- interface GmailLiveConnectorConfig {
1725
- /** Master gate. Default false — operators must opt in explicitly. */
1726
- enabled: boolean;
1727
- /** OAuth2 client id. Populate from a secret store; never commit. */
1728
- clientId: string;
1729
- /** OAuth2 client secret. Populate from a secret store; never commit. */
1730
- clientSecret: string;
1731
- /** OAuth2 refresh token issued for the Gmail scope. Populate from a secret store; never commit. */
1732
- refreshToken: string;
1733
- /** Gmail userId. Defaults to "me" (the authenticated user). */
1734
- userId: string;
1735
- /** Gmail search query applied in addition to the watermark filter. Default "in:inbox". */
1736
- query: string;
1737
- /** Poll interval in ms. Default 300000 (5 min); min 1000; max 86400000 (24h). */
1738
- pollIntervalMs: number;
1739
- }
1740
- /**
1741
- * Operator-facing config for the GitHub live connector (issue #683 PR 5/6).
1742
- * The connector module defines a separate validated `GitHubConnectorConfig`
1743
- * shape (frozen, post-validation). This interface is the pre-validation shape
1744
- * that `parseConfig` round-trips through.
1745
- *
1746
- * `token` is stored as a string here so operators can populate it from a
1747
- * secret store (e.g. an env-substituted plist or systemd EnvironmentFile).
1748
- * It MUST NEVER be committed to source. The repo-wide privacy policy in
1749
- * CLAUDE.md applies.
1750
- */
1751
- interface GitHubLiveConnectorConfig {
1752
- /** Master gate. Default false — operators must opt in explicitly. */
1753
- enabled: boolean;
1754
- /** GitHub personal access token. Populate from a secret store; never commit. */
1755
- token: string;
1756
- /** GitHub login of the user whose comments will be imported. Required. */
1757
- userLogin: string;
1758
- /** Repos to poll in "owner/repo" format. Empty = connector is a no-op. */
1759
- repos: string[];
1760
- /** Poll interval in ms. Default 300000 (5 min); min 1000; max 86400000 (24h). */
1761
- pollIntervalMs: number;
1762
- /** Whether to fetch Discussion comments in addition to issue/PR comments. Default false. */
1763
- includeDiscussions: boolean;
1764
- }
1765
- interface BootstrapOptions {
1766
- dryRun?: boolean;
1767
- sessionsDir?: string;
1768
- limit?: number;
1769
- since?: Date;
1770
- }
1771
- interface BootstrapResult {
1772
- sessionsScanned: number;
1773
- turnsProcessed: number;
1774
- highSignalTurns: number;
1775
- memoriesCreated: number;
1776
- skipped: number;
1777
- }
1778
- interface PrincipalRule {
1779
- match: string;
1780
- principal: string;
1781
- }
1782
- interface NamespacePolicy {
1783
- name: string;
1784
- readPrincipals: string[];
1785
- writePrincipals: string[];
1786
- includeInRecallByDefault?: boolean;
1787
- }
1788
- interface RelevanceFeedback {
1789
- up: number;
1790
- down: number;
1791
- lastUpdatedAt: string;
1792
- notes?: string[];
1793
- }
1794
- interface BufferTurn {
1795
- role: "user" | "assistant";
1796
- content: string;
1797
- timestamp: string;
1798
- sessionKey?: string;
1799
- logicalSessionKey?: string;
1800
- providerThreadId?: string | null;
1801
- turnFingerprint?: string;
1802
- persistProcessedFingerprint?: boolean;
1803
- }
1804
- interface BufferEntryState {
1805
- turns: BufferTurn[];
1806
- lastExtractionAt: string | null;
1807
- extractionCount: number;
1808
- /**
1809
- * Turns retained across `clearAfterExtraction` so a later extraction pass
1810
- * sees the context that caused a defer verdict (issue #562, PR 2). Bounded
1811
- * to the configured retention cap by `retainDeferredTurns`. Empty / absent
1812
- * means no retention in effect.
1813
- */
1814
- retainedTurns?: BufferTurn[];
1815
- }
1816
- interface BufferState {
1817
- turns: BufferTurn[];
1818
- lastExtractionAt: string | null;
1819
- extractionCount: number;
1820
- entries?: Record<string, BufferEntryState>;
1821
- }
1822
- interface BehaviorLoopAdjustment {
1823
- parameter: string;
1824
- previousValue: number;
1825
- nextValue: number;
1826
- delta: number;
1827
- evidenceCount: number;
1828
- confidence: number;
1829
- reason: string;
1830
- appliedAt: string;
1831
- }
1832
- interface BehaviorLoopPolicyState {
1833
- version: number;
1834
- windowDays: number;
1835
- minSignalCount: number;
1836
- maxDeltaPerCycle: number;
1837
- protectedParams: string[];
1838
- adjustments: BehaviorLoopAdjustment[];
1839
- updatedAt: string;
1840
- }
1841
- type BehaviorSignalType = "correction_override" | "preference_affinity" | "topic_revisitation" | "action_pattern" | "outcome_preference" | "phrasing_style";
1842
- type BehaviorSignalDirection = "positive" | "negative";
1843
- interface BehaviorSignalEvent {
1844
- timestamp: string;
1845
- namespace: string;
1846
- memoryId: string;
1847
- category: Extract<MemoryCategory, "correction" | "preference">;
1848
- signalType: BehaviorSignalType;
1849
- direction: BehaviorSignalDirection;
1850
- confidence: number;
1851
- signalHash: string;
1852
- source: "extraction" | "correction";
1853
- }
1854
- /**
1855
- * One row of the buffer-surprise telemetry ledger (issue #563 PR 3).
1856
- *
1857
- * Emitted by `SmartBuffer` each time the surprise probe produces a score
1858
- * for an incoming turn (i.e. the feature flag is on and the existing
1859
- * trigger-logic path called through to the probe). Not written when the
1860
- * probe is skipped — the absence of a row is meaningful and matches the
1861
- * "probe was not consulted" state.
1862
- *
1863
- * The ledger is intentionally lean: we record the score, the threshold in
1864
- * force, whether the turn caused a flush, and the turn count so operators
1865
- * can re-derive precision/recall without replaying traffic. Turn content
1866
- * is never persisted — this ledger is safe to commit to shared storage.
1867
- */
1868
- interface BufferSurpriseEvent {
1869
- /** Literal tag to simplify multiplexed log consumers. */
1870
- event: "BUFFER_SURPRISE";
1871
- /** ISO timestamp when the decision was made. Server-side, not turn ts. */
1872
- timestamp: string;
1873
- /** Buffer identifier (session / thread). Opaque string. */
1874
- bufferKey: string;
1875
- /** Session key if available; null when the turn has no session binding. */
1876
- sessionKey: string | null;
1877
- /** Role of the scored turn. */
1878
- turnRole: "user" | "assistant";
1879
- /** Surprise score in `[0, 1]`, already clamped. */
1880
- surpriseScore: number;
1881
- /** Threshold in force when the decision was made. */
1882
- threshold: number;
1883
- /** Whether this turn upgraded `keep_buffering` → `extract_now`. */
1884
- triggeredFlush: boolean;
1885
- /** Number of turns in the buffer (including the current turn). */
1886
- turnCountInWindow: number;
1887
- }
1888
- /** Memory status for lifecycle management */
1889
- type MemoryStatus = "active" | "pending_review" | "rejected" | "quarantined" | "superseded" | "archived"
1890
- /**
1891
- * Operator explicitly forgot the memory (issue #686 PR 4/6). Soft
1892
- * delete: the file stays on disk and a page-version snapshot is kept
1893
- * so the act is reversible during a configurable retention window
1894
- * (default 90 days), but the memory is excluded from recall, browse,
1895
- * and entity attribution. After the retention window passes, a
1896
- * future maintenance cron will hard-delete forgotten memories.
1897
- */
1898
- | "forgotten";
1899
- type LifecycleState = "candidate" | "validated" | "active" | "stale" | "archived";
1900
- type VerificationState = "unverified" | "user_confirmed" | "system_inferred" | "disputed";
1901
- type PolicyClass = "ephemeral" | "durable" | "protected";
1902
- /** Importance level tiers */
1903
- type ImportanceLevel = "critical" | "high" | "normal" | "low" | "trivial";
1904
- /** Importance scoring result */
1905
- interface ImportanceScore {
1906
- /** Numeric score 0-1 */
1907
- score: number;
1908
- /** Tier level */
1909
- level: ImportanceLevel;
1910
- /** Reasons for this score */
1911
- reasons: string[];
1912
- /** Salient keywords extracted */
1913
- keywords: string[];
1914
- }
1915
- interface MemoryFrontmatter {
1916
- id: string;
1917
- category: MemoryCategory;
1918
- created: string;
1919
- updated: string;
1920
- source: string;
1921
- confidence: number;
1922
- confidenceTier: ConfidenceTier;
1923
- tags: string[];
1924
- entityRef?: string;
1925
- supersedes?: string;
1926
- /** ISO 8601 date — memory expires and gets cleaned up after this date */
1927
- expiresAt?: string;
1928
- /** IDs of parent memories this was derived from (lineage tracking) */
1929
- lineage?: string[];
1930
- /** Memory status: active (default), pending_review, rejected, quarantined, superseded, archived, or forgotten */
1931
- status?: MemoryStatus;
1932
- /** ID of memory that superseded this one */
1933
- supersededBy?: string;
1934
- /** Timestamp when superseded */
1935
- supersededAt?: string;
1936
- /** Timestamp when archived */
1937
- archivedAt?: string;
1938
- /**
1939
- * Explicit fact validity start (issue #680). ISO 8601 timestamp.
1940
- *
1941
- * When present, marks the moment at which the fact begins being
1942
- * "true" / authoritative. When absent at read time, callers fall
1943
- * back to `created` so legacy memories written before #680 still
1944
- * participate in `as_of` recall filtering without a migration.
1945
- */
1946
- valid_at?: string;
1947
- /**
1948
- * Explicit fact validity end (issue #680). ISO 8601 timestamp.
1949
- *
1950
- * Set automatically by the temporal-supersession pipeline when a
1951
- * newer fact supersedes this one — the value is the superseder's
1952
- * `valid_at` (or `created` if no `valid_at` was set). May also be
1953
- * set manually for facts that are known to expire at a specific
1954
- * point in time.
1955
- */
1956
- invalid_at?: string;
1957
- /**
1958
- * Timestamp when the operator explicitly forgot this memory
1959
- * (issue #686 PR 4/6). Set by `remnic forget <id>`. Memories with
1960
- * `status === "forgotten"` are excluded from recall, browse, and
1961
- * entity attribution; the file remains on disk until the retention
1962
- * window passes.
1963
- */
1964
- forgottenAt?: string;
1965
- /** Optional human-readable reason captured by `remnic forget --reason`. */
1966
- forgottenReason?: string;
1967
- /** Policy-driven lifecycle state used for retrieval eligibility/ranking. */
1968
- lifecycleState?: LifecycleState;
1969
- /** Verification provenance used by lifecycle policy. */
1970
- verificationState?: VerificationState;
1971
- /** Policy class used by lifecycle guardrails. */
1972
- policyClass?: PolicyClass;
1973
- /** Last lifecycle validation timestamp (ISO 8601). */
1974
- lastValidatedAt?: string;
1975
- /** Lifecycle decay score in [0,1]. */
1976
- decayScore?: number;
1977
- /** Lifecycle heat score in [0,1]. */
1978
- heatScore?: number;
1979
- /** Number of times this memory has been retrieved */
1980
- accessCount?: number;
1981
- /** Last time this memory was accessed (ISO 8601) */
1982
- lastAccessed?: string;
1983
- /** Number of sessions where this memory was retrieved and the outcome was judged a success. */
1984
- mw_success?: number;
1985
- /** Number of sessions where this memory was retrieved and the outcome was judged a failure. */
1986
- mw_fail?: number;
1987
- /** Importance score with level, reasons, and keywords */
1988
- importance?: ImportanceScore;
1989
- /** Parent memory ID if this is a chunk */
1990
- parentId?: string;
1991
- /** Chunk index within parent (0-based) */
1992
- chunkIndex?: number;
1993
- /** Total number of chunks for this parent */
1994
- chunkTotal?: number;
1995
- /** Links to other memories */
1996
- links?: MemoryLink[];
1997
- intentGoal?: string;
1998
- intentActionType?: string;
1999
- intentEntityTypes?: string[];
2000
- artifactType?: "decision" | "constraint" | "todo" | "definition" | "commitment" | "correction" | "fact";
2001
- sourceMemoryId?: string;
2002
- sourceTurnId?: string;
2003
- /** episode = time-specific event; note = stable belief/preference/decision */
2004
- memoryKind?: "episode" | "note" | "box" | "dream" | "procedural";
2005
- /** Structured key-value attributes extracted from the content (e.g., product attributes, dates, quantities). */
2006
- structuredAttributes?: Record<string, string>;
2007
- /**
2008
- * SHA-256 (via ContentHashIndex.computeHash) of the raw content that was
2009
- * used as the dedup key at write time. Persists through archive and
2010
- * consolidation so the hash can be removed from the index even if the stored
2011
- * content has been transformed (e.g. an inline citation was appended).
2012
- *
2013
- * When present, archive/consolidation paths use this directly instead of
2014
- * calling stripCitation(memory.content), which only handles the default
2015
- * [Source: ...] format and silently fails for custom citation templates.
2016
- */
2017
- contentHash?: string;
2018
- /**
2019
- * Consolidation provenance — pointers to the page-versioning snapshots
2020
- * that this memory was derived from (issue #561). Each entry is a
2021
- * `"<memory-path>:<version-number>"` string (e.g.
2022
- * `"facts/preferences.md:3"`) referencing a snapshot recorded by
2023
- * `page-versioning.ts`.
2024
- *
2025
- * PR 1 introduces this field as read-through only — storage preserves
2026
- * it verbatim but no code produces it yet. PR 2 populates it on
2027
- * consolidation writes; PR 4 adds a `remnic doctor` integrity check
2028
- * that validates each referent actually exists.
2029
- */
2030
- derived_from?: string[];
2031
- /**
2032
- * Which consolidation operator produced this memory (issue #561,
2033
- * extended in #687). See `ConsolidationOperator` in
2034
- * `semantic-consolidation.ts` for the operator algebra. Absent on
2035
- * memories that were not produced by a consolidation pass.
2036
- *
2037
- * `"pattern-reinforcement"` (issue #687 PR 2/4) tags memories that
2038
- * were promoted to canonical by the pattern-reinforcement
2039
- * maintenance job after observing the same content across
2040
- * multiple sessions.
2041
- */
2042
- derived_via?: "split" | "merge" | "update" | "pattern-reinforcement";
2043
- /**
2044
- * Number of source memories that reinforced this canonical memory
2045
- * (issue #687 PR 2/4). Set by the pattern-reinforcement
2046
- * maintenance job when it clusters duplicate memories and promotes
2047
- * the most recent member to canonical. Counts the cluster size at
2048
- * the time of the run; subsequent runs update this monotonically.
2049
- *
2050
- * Always a positive integer when present. Absent on memories that
2051
- * have not been touched by pattern reinforcement.
2052
- */
2053
- reinforcement_count?: number;
2054
- /**
2055
- * ISO 8601 timestamp recording the most recent pattern-reinforcement
2056
- * run that touched this memory (issue #687 PR 2/4). Updated each
2057
- * time the cluster size grows. Absent when `reinforcement_count`
2058
- * is absent.
2059
- */
2060
- last_reinforced_at?: string;
2061
- }
2062
- /** Memory link relationship types */
2063
- type MemoryLinkType = "follows" | "references" | "contradicts" | "supports" | "related";
2064
- /** A link between memories */
2065
- interface MemoryLink {
2066
- targetId: string;
2067
- linkType: MemoryLinkType;
2068
- strength: number;
2069
- reason?: string;
2070
- }
2071
- interface ConversationThread {
2072
- id: string;
2073
- title: string;
2074
- createdAt: string;
2075
- updatedAt: string;
2076
- sessionKey?: string;
2077
- episodeIds: string[];
2078
- linkedThreadIds: string[];
2079
- }
2080
- interface MemorySummary {
2081
- id: string;
2082
- createdAt: string;
2083
- timeRangeStart: string;
2084
- timeRangeEnd: string;
2085
- summaryText: string;
2086
- keyFacts: string[];
2087
- keyEntities: string[];
2088
- sourceEpisodeIds: string[];
2089
- }
2090
- interface DaySummaryResult {
2091
- summary: string;
2092
- bullets: string[];
2093
- next_actions: string[];
2094
- risks_or_open_loops: string[];
2095
- }
2096
- interface TopicScore {
2097
- term: string;
2098
- score: number;
2099
- count: number;
2100
- }
2101
- interface MemoryFile {
2102
- path: string;
2103
- frontmatter: MemoryFrontmatter;
2104
- content: string;
2105
- }
2106
- /**
2107
- * Public type representing the **Observation** stage in the
2108
- * Trace → Observation → Primitive pipeline (issue #685).
2109
- *
2110
- * - **Trace**: raw conversation turns captured in `buffer.ts`. Noisy,
2111
- * verbose, ephemeral.
2112
- * - **Observation** (this type): post-extraction, importance-scored
2113
- * fact candidate emitted by `extraction.ts` / `extraction-judge.ts`.
2114
- * Already distilled — but not yet consolidated against the corpus.
2115
- * - **Primitive**: the durable `MemoryFile` written by `storage.ts`,
2116
- * reinforced over time by `compounding/engine.ts`.
2117
- *
2118
- * `MemoryObservation` is the named handle on the intermediate stage
2119
- * the codebase has always produced but never publicly typed. It lets
2120
- * callers (telemetry, doctor surfaces, tests, downstream tooling)
2121
- * inspect the post-extraction shape without reaching into extraction
2122
- * internals.
2123
- *
2124
- * Naming note: this is intentionally NOT the same as the existing
2125
- * `state/observation-ledger/` directory, which is telemetry storage
2126
- * for the extraction pipeline (turn-count aggregates rebuilt by
2127
- * `maintenance/rebuild-observations.ts` and judge verdict events
2128
- * appended by `extraction-judge-telemetry.ts`). Lifecycle events on
2129
- * primitives — status flips, supersessions, archival, forget — live
2130
- * in `state/memory-lifecycle-ledger.jsonl`, written by
2131
- * `StorageManager`. A `MemoryObservation` describes the in-flight
2132
- * candidate that became (or didn't become) a primitive; the ledger
2133
- * directory is how the pipeline reports on itself. See
2134
- * `docs/trace-to-primitive.md` for the full pipeline walkthrough.
2135
- */
2136
- interface MemoryObservation {
2137
- /** Stable id for this observation, distinct from any primitive id. */
2138
- id: string;
2139
- /** Source session id the trace came from. */
2140
- sessionId?: string;
2141
- /** ISO timestamp the observation was emitted. */
2142
- observedAt: string;
2143
- /** The extracted fact candidate (category, content, confidence, tags, etc.). */
2144
- fact: ExtractedFact;
2145
- /** Importance score in [0,1], from `importance.ts`. */
2146
- importance?: number;
2147
- /**
2148
- * Whether the observation passed the extraction judge
2149
- * (`extraction-judge.ts`). When `false`, the observation was
2150
- * captured for telemetry but not persisted as a primitive.
2151
- */
2152
- judgeAccepted?: boolean;
2153
- /** Optional reason the judge gave when rejecting. */
2154
- judgeRejectionReason?: string;
2155
- /**
2156
- * Id of the resulting `MemoryFile` primitive once consolidation runs.
2157
- * Absent until consolidation decides to ADD/MERGE/UPDATE the
2158
- * observation into the corpus.
2159
- */
2160
- resultingPrimitiveId?: string;
2161
- }
2162
- /** Ordered step for extracted procedure memories (issue #519). */
2163
- interface ExtractedProcedureStep {
2164
- order: number;
2165
- intent: string;
2166
- toolCall?: {
2167
- kind: string;
2168
- signature: string;
2169
- };
2170
- expectedOutcome?: string;
2171
- optional?: boolean;
2172
- }
2173
- interface ExtractedFact {
2174
- category: MemoryCategory;
2175
- content: string;
2176
- confidence: number;
2177
- tags: string[];
2178
- entityRef?: string;
2179
- source?: ExtractionPassSource;
2180
- promptedByQuestion?: string;
2181
- /**
2182
- * Whether this fact is project-scoped or globally applicable.
2183
- * When `extractionScopeClassificationEnabled` is true, the extraction LLM
2184
- * classifies each fact. Default is `"project"` when a coding context is
2185
- * active, `"global"` when no coding context is present.
2186
- */
2187
- scope?: MemoryScope;
2188
- /** Structured key-value attributes extracted from the content (e.g., product attributes, dates, quantities). */
2189
- structuredAttributes?: Record<string, string>;
2190
- /** When category is `procedure`, ordered steps with intents (persisted under procedures/). */
2191
- procedureSteps?: ExtractedProcedureStep[];
2192
- /**
2193
- * When category is `reasoning_trace`, the stored solution chain the user
2194
- * walked through. Persisted under reasoning-traces/.
2195
- */
2196
- reasoningTrace?: ExtractedReasoningTrace;
2197
- }
2198
- interface ExtractedReasoningTraceStep {
2199
- order: number;
2200
- description: string;
2201
- }
2202
- interface ExtractedReasoningTrace {
2203
- steps: ExtractedReasoningTraceStep[];
2204
- finalAnswer: string;
2205
- observedOutcome?: string;
2206
- }
2207
- interface MemoryIntent {
2208
- goal: string;
2209
- actionType: string;
2210
- entityTypes: string[];
2211
- /** True when the prompt reads like starting a concrete task (ship/deploy/tests/PR, etc.). */
2212
- taskInitiation?: boolean;
2213
- }
2214
- interface ExtractedQuestion {
2215
- question: string;
2216
- context: string;
2217
- priority: number;
2218
- }
2219
- interface QuestionEntry {
2220
- id: string;
2221
- question: string;
2222
- context: string;
2223
- priority: number;
2224
- created: string;
2225
- resolved: boolean;
2226
- resolvedAt?: string;
2227
- }
2228
- interface ExtractionResult {
2229
- facts: ExtractedFact[];
2230
- profileUpdates: string[];
2231
- entities: EntityMention[];
2232
- questions: ExtractedQuestion[];
2233
- identityReflection?: string;
2234
- relationships?: ExtractedRelationship[];
2235
- }
2236
- interface EntityMention {
2237
- name: string;
2238
- type: "person" | "project" | "tool" | "company" | "place" | "other";
2239
- facts: string[];
2240
- structuredSections?: EntityStructuredSection[];
2241
- source?: ExtractionPassSource;
2242
- promptedByQuestion?: string;
2243
- }
2244
- interface EntityRelationship {
2245
- target: string;
2246
- label: string;
2247
- }
2248
- interface EntityActivityEntry {
2249
- date: string;
2250
- note: string;
2251
- }
2252
- interface EntityTimelineEntry {
2253
- timestamp: string;
2254
- text: string;
2255
- source?: string;
2256
- sessionKey?: string;
2257
- principal?: string;
2258
- }
2259
- interface EntityStructuredSection {
2260
- key: string;
2261
- title: string;
2262
- facts: string[];
2263
- }
2264
- interface EntitySchemaSectionDefinition {
2265
- key: string;
2266
- title: string;
2267
- description: string;
2268
- aliases?: string[];
2269
- }
2270
- interface EntitySchemaDefinition {
2271
- sections: EntitySchemaSectionDefinition[];
2272
- }
2273
- interface EntityFile {
2274
- name: string;
2275
- type: string;
2276
- created?: string;
2277
- updated: string;
2278
- extraFrontmatterLines?: string[];
2279
- preSectionLines?: string[];
2280
- facts: string[];
2281
- summary?: string;
2282
- synthesis?: string;
2283
- synthesisUpdatedAt?: string;
2284
- synthesisTimelineCount?: number;
2285
- synthesisStructuredFactCount?: number;
2286
- synthesisStructuredFactDigest?: string;
2287
- synthesisVersion?: number;
2288
- timeline: EntityTimelineEntry[];
2289
- structuredSections?: EntityStructuredSection[];
2290
- relationships: EntityRelationship[];
2291
- activity: EntityActivityEntry[];
2292
- aliases: string[];
2293
- extraSections?: Array<{
2294
- title: string;
2295
- lines: string[];
2296
- }>;
2297
- }
2298
- interface ScoredEntity {
2299
- name: string;
2300
- type: string;
2301
- score: number;
2302
- factCount: number;
2303
- summary?: string;
2304
- topRelationships: string[];
2305
- }
2306
- interface ExtractedRelationship {
2307
- source: string;
2308
- target: string;
2309
- label: string;
2310
- extractionSource?: ExtractionPassSource;
2311
- promptedByQuestion?: string;
2312
- }
2313
- interface ConsolidationItem {
2314
- existingId: string;
2315
- action: ConsolidationAction;
2316
- mergeWith?: string;
2317
- updatedContent?: string;
2318
- reason: string;
2319
- }
2320
- interface ConsolidationResult {
2321
- items: ConsolidationItem[];
2322
- profileUpdates: string[];
2323
- entityUpdates: EntityMention[];
2324
- }
2325
- interface ConsolidationObservation {
2326
- runAt: string;
2327
- recentMemories: MemoryFile[];
2328
- existingMemories: MemoryFile[];
2329
- profile: string;
2330
- result: ConsolidationResult;
2331
- merged: number;
2332
- invalidated: number;
2333
- }
2334
- interface QmdSearchResult {
2335
- docid: string;
2336
- path: string;
2337
- snippet: string;
2338
- score: number;
2339
- explain?: QmdSearchExplain;
2340
- transport?: "daemon" | "subprocess" | "hybrid" | "scoped_prefilter";
2341
- }
2342
- interface QmdSearchExplain {
2343
- ftsScores?: number[];
2344
- vectorScores?: number[];
2345
- rrf?: number;
2346
- rerankScore?: number;
2347
- blendedScore?: number;
2348
- /** Additive boost applied from `reinforcement_count` frontmatter (issue #687 PR 3/4). */
2349
- reinforcementBoost?: number;
2350
- }
2351
- interface MetaState {
2352
- extractionCount: number;
2353
- lastExtractionAt: string | null;
2354
- lastConsolidationAt: string | null;
2355
- totalMemories: number;
2356
- totalEntities: number;
2357
- processedExtractionFingerprints?: Array<{
2358
- fingerprint: string;
2359
- observedAt: string;
2360
- }>;
2361
- }
2362
- type MemoryActionType = "store_episode" | "store_note" | "update_note" | "create_artifact" | "summarize_node" | "discard" | "link_graph";
2363
- type MemoryActionOutcome = "applied" | "skipped" | "failed";
2364
- type MemoryActionPolicyDecision = "allow" | "defer" | "deny";
2365
- type MemoryActionStatus = "validated" | "applied" | "rejected";
2366
- type MemoryActionEligibilitySource = "extraction" | "consolidation" | "replay" | "manual" | "unknown";
2367
- interface MemoryActionEligibilityContext {
2368
- confidence: number;
2369
- lifecycleState: LifecycleState;
2370
- importance: number;
2371
- source: MemoryActionEligibilitySource;
2372
- }
2373
- interface MemoryActionPolicyResult {
2374
- action: MemoryActionType;
2375
- decision: MemoryActionPolicyDecision;
2376
- rationale: string;
2377
- eligibility: MemoryActionEligibilityContext;
2378
- }
2379
- interface MemoryActionEvent {
2380
- schemaVersion?: number;
2381
- actionId?: string;
2382
- timestamp: string;
2383
- action: MemoryActionType;
2384
- outcome: MemoryActionOutcome;
2385
- status?: MemoryActionStatus;
2386
- actor?: string;
2387
- subsystem?: string;
2388
- reason?: string;
2389
- memoryId?: string;
2390
- namespace?: string;
2391
- sessionKey?: string;
2392
- sourceSessionKey?: string;
2393
- checkpointCapturedAt?: string;
2394
- checkpointTtl?: string;
2395
- checkpointTurnCount?: number;
2396
- inputSummary?: string;
2397
- outputMemoryIds?: string[];
2398
- dryRun?: boolean;
2399
- policyVersion?: string;
2400
- promptHash?: string;
2401
- policyDecision?: MemoryActionPolicyDecision;
2402
- policyRationale?: string;
2403
- policyEligibility?: MemoryActionEligibilityContext;
2404
- }
2405
- type MemoryLifecycleEventType = "created" | "updated" | "superseded" | "archived" | "rejected" | "restored" | "merged" | "imported" | "promoted" | "explicit_capture_accepted" | "explicit_capture_queued";
2406
- interface MemoryLifecycleStateSummary {
2407
- category?: MemoryCategory;
2408
- path?: string;
2409
- status?: MemoryStatus;
2410
- lifecycleState?: LifecycleState;
2411
- }
2412
- interface MemoryLifecycleEvent {
2413
- eventId: string;
2414
- memoryId: string;
2415
- eventType: MemoryLifecycleEventType;
2416
- timestamp: string;
2417
- actor: string;
2418
- reasonCode?: string;
2419
- ruleVersion: string;
2420
- relatedMemoryIds?: string[];
2421
- before?: MemoryLifecycleStateSummary;
2422
- after?: MemoryLifecycleStateSummary;
2423
- correlationId?: string;
2424
- }
2425
- interface MemoryProjectionCurrentState {
2426
- memoryId: string;
2427
- category: MemoryCategory;
2428
- status: MemoryStatus;
2429
- lifecycleState?: LifecycleState;
2430
- path: string;
2431
- pathRel: string;
2432
- created: string;
2433
- updated: string;
2434
- archivedAt?: string;
2435
- supersededAt?: string;
2436
- entityRef?: string;
2437
- source: string;
2438
- confidence: number;
2439
- confidenceTier: ConfidenceTier;
2440
- memoryKind?: MemoryFrontmatter["memoryKind"];
2441
- accessCount?: number;
2442
- lastAccessed?: string;
2443
- tags?: string[];
2444
- preview?: string;
2445
- }
2446
- interface CompressionGuidelineOptimizerSourceWindow {
2447
- from: string;
2448
- to: string;
2449
- }
2450
- interface CompressionGuidelineOptimizerEventCounts {
2451
- total: number;
2452
- applied: number;
2453
- skipped: number;
2454
- failed: number;
2455
- }
2456
- type CompressionGuidelineActivationState = "draft" | "active";
2457
- interface CompressionGuidelineOptimizerActionSummary {
2458
- action: MemoryActionType;
2459
- total: number;
2460
- outcomes: Record<MemoryActionOutcome, number>;
2461
- quality: {
2462
- good: number;
2463
- poor: number;
2464
- unknown: number;
2465
- };
2466
- }
2467
- interface CompressionGuidelineOptimizerRuleUpdate {
2468
- action: MemoryActionType;
2469
- delta: number;
2470
- direction: "increase" | "decrease" | "hold";
2471
- confidence: "low" | "medium" | "high";
2472
- notes: string[];
2473
- }
2474
- interface CompressionGuidelineOptimizerState {
2475
- version: number;
2476
- updatedAt: string;
2477
- sourceWindow: CompressionGuidelineOptimizerSourceWindow;
2478
- eventCounts: CompressionGuidelineOptimizerEventCounts;
2479
- guidelineVersion: number;
2480
- contentHash?: string;
2481
- activationState?: CompressionGuidelineActivationState;
2482
- actionSummaries?: CompressionGuidelineOptimizerActionSummary[];
2483
- ruleUpdates?: CompressionGuidelineOptimizerRuleUpdate[];
2484
- }
2485
- type ContinuityIncidentState = "open" | "closed";
2486
- interface ContinuityIncidentRecord {
2487
- id: string;
2488
- state: ContinuityIncidentState;
2489
- openedAt: string;
2490
- updatedAt: string;
2491
- triggerWindow?: string;
2492
- symptom: string;
2493
- suspectedCause?: string;
2494
- fixApplied?: string;
2495
- verificationResult?: string;
2496
- preventiveRule?: string;
2497
- closedAt?: string;
2498
- filePath?: string;
2499
- }
2500
- interface ContinuityIncidentOpenInput {
2501
- triggerWindow?: string;
2502
- symptom: string;
2503
- suspectedCause?: string;
2504
- }
2505
- interface ContinuityIncidentCloseInput {
2506
- fixApplied: string;
2507
- verificationResult: string;
2508
- preventiveRule?: string;
2509
- }
2510
- type ContinuityLoopCadence = "daily" | "weekly" | "monthly" | "quarterly";
2511
- type ContinuityLoopStatus = "active" | "paused" | "retired";
2512
- interface ContinuityImprovementLoop {
2513
- id: string;
2514
- cadence: ContinuityLoopCadence;
2515
- purpose: string;
2516
- status: ContinuityLoopStatus;
2517
- killCondition: string;
2518
- lastReviewed: string;
2519
- notes?: string;
2520
- }
2521
- interface ContinuityLoopUpsertInput {
2522
- id: string;
2523
- cadence: ContinuityLoopCadence;
2524
- purpose: string;
2525
- status: ContinuityLoopStatus;
2526
- killCondition: string;
2527
- lastReviewed?: string;
2528
- notes?: string;
2529
- }
2530
- interface ContinuityLoopReviewInput {
2531
- status?: ContinuityLoopStatus;
2532
- notes?: string;
2533
- reviewedAt?: string;
2534
- }
2535
- /** Entry in the access tracking buffer (batched updates) */
2536
- interface AccessTrackingEntry {
2537
- memoryId: string;
2538
- newCount: number;
2539
- lastAccessed: string;
2540
- }
2541
- interface SignalScanResult {
2542
- level: SignalLevel;
2543
- patterns: string[];
2544
- }
2545
- interface LlmTraceEvent {
2546
- kind: "llm_start" | "llm_end" | "llm_error";
2547
- traceId: string;
2548
- model: string;
2549
- operation: "extraction" | "consolidation" | "profile_consolidation" | "identity_consolidation" | "day_summary";
2550
- input?: string;
2551
- output?: string;
2552
- durationMs?: number;
2553
- error?: string;
2554
- tokenUsage?: {
2555
- input?: number;
2556
- output?: number;
2557
- total?: number;
2558
- };
2559
- }
2560
- interface RecallTraceEvent {
2561
- kind: "recall_summary";
2562
- traceId: string;
2563
- operation: "recall";
2564
- sessionKey?: string;
2565
- promptHash: string;
2566
- promptLength: number;
2567
- retrievalQueryHash: string;
2568
- retrievalQueryLength: number;
2569
- recallMode: RecallPlanMode;
2570
- recallResultLimit: number;
2571
- qmdEnabled: boolean;
2572
- qmdAvailable: boolean;
2573
- recallNamespaces: string[];
2574
- source: "none" | "hot_qmd" | "hot_embedding" | "cold_fallback" | "recent_scan";
2575
- recalledMemoryCount: number;
2576
- injected: boolean;
2577
- contextChars: number;
2578
- policyVersion?: string;
2579
- identityInjectionMode?: IdentityInjectionMode | "none";
2580
- identityInjectedChars?: number;
2581
- identityInjectionTruncated?: boolean;
2582
- durationMs: number;
2583
- timings?: Record<string, string>;
2584
- /**
2585
- * The full recalled memory context injected into the system prompt.
2586
- * Only populated when `traceRecallContent` config option is `true`.
2587
- * Omitted by default to avoid sending potentially sensitive memory content
2588
- * to external trace collectors unless explicitly opted in.
2589
- */
2590
- recalledContent?: string;
2591
- }
2592
- type EngramTraceEvent = LlmTraceEvent | RecallTraceEvent;
2593
- type LlmTraceCallback = (event: EngramTraceEvent) => void;
2594
- type ModelApi = "openai-completions" | "anthropic-messages" | "google-generative" | string;
2595
- type ModelProviderAuthMode = "bearer" | "header" | "query";
2596
- interface ModelDefinitionConfig {
2597
- id: string;
2598
- name?: string;
2599
- contextWindow?: number;
2600
- maxOutputTokens?: number;
2601
- costPer1MInput?: number;
2602
- costPer1MOutput?: number;
2603
- aliases?: string[];
2604
- }
2605
- interface ModelProviderConfig {
2606
- baseUrl: string;
2607
- apiKey?: string | Record<string, unknown>;
2608
- auth?: ModelProviderAuthMode;
2609
- api?: ModelApi;
2610
- headers?: Record<string, string>;
2611
- authHeader?: boolean;
2612
- models: ModelDefinitionConfig[];
2613
- }
2614
- interface AgentDefaultsConfig {
2615
- model?: {
2616
- primary?: string;
2617
- backup?: string;
2618
- fallbacks?: string[];
2619
- };
2620
- thinking?: {
2621
- mode?: "off" | "on" | "adaptive";
2622
- budget?: number;
2623
- };
2624
- }
2625
- interface AgentPersonaModelConfig {
2626
- primary?: string;
2627
- fallbacks?: string[];
2628
- }
2629
- interface AgentPersona {
2630
- id: string;
2631
- name?: string;
2632
- model?: AgentPersonaModelConfig;
2633
- }
2634
- interface GatewayConfig {
2635
- agents?: {
2636
- defaults?: AgentDefaultsConfig;
2637
- list?: AgentPersona[];
2638
- };
2639
- models?: {
2640
- providers?: Record<string, ModelProviderConfig>;
2641
- };
2642
- }
2643
- interface TranscriptEntry {
2644
- timestamp: string;
2645
- role: "user" | "assistant";
2646
- content: string;
2647
- sessionKey: string;
2648
- turnId: string;
2649
- metadata?: {
2650
- compactAfter?: boolean;
2651
- compactionId?: string | null;
2652
- };
2653
- }
2654
- interface Checkpoint {
2655
- sessionKey: string;
2656
- capturedAt: string;
2657
- turns: TranscriptEntry[];
2658
- ttl: string;
2659
- }
2660
- interface HourlySummary {
2661
- hour: string;
2662
- sessionKey: string;
2663
- bullets: string[];
2664
- turnCount: number;
2665
- generatedAt: string;
2666
- }
2667
-
2668
- export { type AccessTrackingEntry, type ActiveRecallChatType, type ActiveRecallModelFallbackPolicy, type ActiveRecallPromptStyle, type ActiveRecallQueryMode, type ActiveRecallThinking, type AgentAccessAuthToken, type AgentAccessHttpConfig, type AgentDefaultsConfig, type AgentPersona, type AgentPersonaModelConfig, type BehaviorLoopAdjustment, type BehaviorLoopPolicyState, type BehaviorSignalDirection, type BehaviorSignalEvent, type BehaviorSignalType, type BootstrapOptions, type BootstrapResult, type BriefingActiveThread, type BriefingCalendarSourceError, type BriefingConfig, type BriefingFocus, type BriefingFollowup, type BriefingOpenCommitment, type BriefingRecentEntity, type BriefingResult, type BriefingSections, type BriefingWindow, type BufferEntryState, type BufferState, type BufferSurpriseEvent, type BufferTurn, type CalendarEvent, type CalendarSource, type CaptureMode, type Checkpoint, type CodexCompactionFlushMode, type CodexCompatConfig, type CodexConnectorConfig, type CodingContext, type CodingModeConfig, type CompressionGuidelineActivationState, type CompressionGuidelineOptimizerActionSummary, type CompressionGuidelineOptimizerEventCounts, type CompressionGuidelineOptimizerRuleUpdate, type CompressionGuidelineOptimizerSourceWindow, type CompressionGuidelineOptimizerState, type ConfidenceTier, type ConsolidationAction, type ConsolidationItem, type ConsolidationObservation, type ConsolidationResult, type ContinuityImprovementLoop, type ContinuityIncidentCloseInput, type ContinuityIncidentOpenInput, type ContinuityIncidentRecord, type ContinuityIncidentState, type ContinuityLoopCadence, type ContinuityLoopReviewInput, type ContinuityLoopStatus, type ContinuityLoopUpsertInput, type ContradictionScanConfig, type ConversationThread, type CronConversationRecallMode, type CronRecallMode, DEFAULT_RECALL_DISCLOSURE, type DaySummaryResult, type DreamingConfig, type DreamingNarrativePromptStyle, type DreamsDeepSleepConfig, type DreamsLightSleepConfig, type DreamsPhase, type DreamsPhaseStatus, type DreamsPhasesConfig, type DreamsRemConfig, type DreamsRunResult, type DreamsStatusResult, type EngramTraceEvent, type EntityActivityEntry, type EntityFile, type EntityMention, type EntityRelationship, type EntitySchemaDefinition, type EntitySchemaSectionDefinition, type EntityStructuredSection, type EntityTimelineEntry, type ExtractedFact, type ExtractedProcedureStep, type ExtractedQuestion, type ExtractedReasoningTrace, type ExtractedReasoningTraceStep, type ExtractedRelationship, type ExtractionPassSource, type ExtractionResult, type FileHygieneConfig, type GatewayConfig, type GitHubLiveConnectorConfig, type GmailLiveConnectorConfig, type GoogleDriveLiveConnectorConfig, type HeartbeatConfig, type HeartbeatDetectionMode, type HourlySummary, type IdentityInjectionMode, type ImportanceLevel, type ImportanceScore, type LifecycleState, type LiveConnectorsConfig, type LlmTraceCallback, type LlmTraceEvent, type MemoryActionEligibilityContext, type MemoryActionEligibilitySource, type MemoryActionEvent, type MemoryActionOutcome, type MemoryActionPolicyDecision, type MemoryActionPolicyResult, type MemoryActionStatus, type MemoryActionType, type MemoryCategory, type MemoryFile, type MemoryFrontmatter, type MemoryIntent, type MemoryLifecycleEvent, type MemoryLifecycleEventType, type MemoryLifecycleStateSummary, type MemoryLink, type MemoryLinkType, type MemoryObservation, type MemoryOsPresetName, type MemoryProjectionCurrentState, type MemoryScope, type MemoryStatus, type MemorySummary, type MetaState, type ModelApi, type ModelDefinitionConfig, type ModelProviderAuthMode, type ModelProviderConfig, type NamespacePolicy, type NativeKnowledgeConfig, type NativeKnowledgeFolderRuleConfig, type NativeKnowledgeObsidianVaultConfig, type NativeKnowledgeOpenClawWorkspaceConfig, type NotionLiveConnectorConfig, type PluginConfig, type PolicyClass, type PrincipalFromSessionKeyMode, type PrincipalRule, type ProceduralConfig, type QmdSearchExplain, type QmdSearchResult, type QuestionEntry, RECALL_DISCLOSURE_LEVELS, type ReasoningEffort, type RecallDisclosure, type RecallPipelineConfig, type RecallPlanMode, type RecallSectionConfig, type RecallTierExplain, type RecallTraceEvent, type RelevanceFeedback, type RetrievalTier, SPECULATIVE_TTL_DAYS, type ScoredEntity, type SecretRef, type SemanticChunkingConfigShape, type SessionObserverBandConfig, type SignalLevel, type SignalScanResult, type SlotBehaviorConfig, type SlotMismatchMode, type TopicScore, type TranscriptEntry, type TriggerMode, type VerificationState, confidenceTier, isRecallDisclosure };
1
+ export { K as AccessTrackingEntry, A as ActiveRecallChatType, d as ActiveRecallModelFallbackPolicy, b as ActiveRecallPromptStyle, a as ActiveRecallQueryMode, c as ActiveRecallThinking, af as AgentAccessAuthToken, aW as AgentAccessHttpConfig, aX as AgentDefaultsConfig, aY as AgentPersona, aZ as AgentPersonaModelConfig, a_ as BehaviorLoopAdjustment, e as BehaviorLoopPolicyState, a$ as BehaviorSignalDirection, B as BehaviorSignalEvent, b0 as BehaviorSignalType, V as BootstrapOptions, W as BootstrapResult, ab as BriefingActiveThread, b1 as BriefingCalendarSourceError, aq as BriefingConfig, a8 as BriefingFocus, a7 as BriefingFollowup, ar as BriefingOpenCommitment, ad as BriefingRecentEntity, ac as BriefingResult, a6 as BriefingSections, as as BriefingWindow, b2 as BufferEntryState, q as BufferState, t as BufferSurpriseEvent, a1 as BufferTurn, aa as CalendarEvent, a9 as CalendarSource, b3 as CaptureMode, a3 as Checkpoint, b4 as CodexCompactionFlushMode, at as CodexCompatConfig, b5 as CodexConnectorConfig, S as CodingContext, ap as CodingModeConfig, b6 as CompressionGuidelineActivationState, ah as CompressionGuidelineOptimizerActionSummary, ag as CompressionGuidelineOptimizerEventCounts, ai as CompressionGuidelineOptimizerRuleUpdate, b7 as CompressionGuidelineOptimizerSourceWindow, C as CompressionGuidelineOptimizerState, b8 as ConfidenceTier, b9 as ConsolidationAction, ba as ConsolidationItem, X as ConsolidationObservation, ao as ConsolidationResult, x as ContinuityImprovementLoop, w as ContinuityIncidentCloseInput, u as ContinuityIncidentOpenInput, v as ContinuityIncidentRecord, bb as ContinuityIncidentState, bc as ContinuityLoopCadence, z as ContinuityLoopReviewInput, bd as ContinuityLoopStatus, y as ContinuityLoopUpsertInput, be as ContradictionScanConfig, aV as ConversationThread, bf as CronConversationRecallMode, bg as CronRecallMode, au as DEFAULT_RECALL_DISCLOSURE, D as DaySummaryResult, bh as DreamingConfig, bi as DreamingNarrativePromptStyle, bj as DreamsDeepSleepConfig, bk as DreamsLightSleepConfig, l as DreamsPhase, bl as DreamsPhaseStatus, bm as DreamsPhasesConfig, bn as DreamsRemConfig, m as DreamsRunResult, k as DreamsStatusResult, bo as EngramTraceEvent, J as EntityActivityEntry, E as EntityFile, ak as EntityMention, H as EntityRelationship, al as EntitySchemaDefinition, am as EntitySchemaSectionDefinition, p as EntityStructuredSection, Z as EntityTimelineEntry, av as ExtractedFact, bp as ExtractedProcedureStep, bq as ExtractedQuestion, br as ExtractedReasoningTrace, bs as ExtractedReasoningTraceStep, bt as ExtractedRelationship, bu as ExtractionPassSource, _ as ExtractionResult, F as FileHygieneConfig, G as GatewayConfig, bv as GitHubLiveConnectorConfig, bw as GmailLiveConnectorConfig, bx as GoogleDriveLiveConnectorConfig, by as HeartbeatConfig, bz as HeartbeatDetectionMode, a4 as HourlySummary, $ as IdentityInjectionMode, an as ImportanceLevel, I as ImportanceScore, aN as LifecycleState, a0 as LiveConnectorsConfig, bA as LlmTraceCallback, bB as LlmTraceEvent, ay as MemoryActionEligibilityContext, az as MemoryActionEligibilitySource, s as MemoryActionEvent, bC as MemoryActionOutcome, bD as MemoryActionPolicyDecision, aO as MemoryActionPolicyResult, bE as MemoryActionStatus, aj as MemoryActionType, M as MemoryCategory, f as MemoryFile, o as MemoryFrontmatter, Y as MemoryIntent, h as MemoryLifecycleEvent, aP as MemoryLifecycleEventType, aQ as MemoryLifecycleStateSummary, n as MemoryLink, bF as MemoryLinkType, aA as MemoryObservation, bG as MemoryOsPresetName, N as MemoryProjectionCurrentState, aB as MemoryScope, i as MemoryStatus, O as MemorySummary, r as MetaState, bH as ModelApi, bI as ModelDefinitionConfig, bJ as ModelProviderAuthMode, aR as ModelProviderConfig, bK as NamespacePolicy, aS as NativeKnowledgeConfig, bL as NativeKnowledgeFolderRuleConfig, bM as NativeKnowledgeObsidianVaultConfig, bN as NativeKnowledgeOpenClawWorkspaceConfig, bO as NotionLiveConnectorConfig, P as PluginConfig, bP as PolicyClass, bQ as PrincipalFromSessionKeyMode, bR as PrincipalRule, bS as ProceduralConfig, aM as QmdSearchExplain, U as QmdSearchResult, bT as QuestionEntry, aD as RECALL_DISCLOSURE_LEVELS, bU as ReasoningEffort, g as RecallDisclosure, bV as RecallPipelineConfig, R as RecallPlanMode, bW as RecallSectionConfig, Q as RecallTierExplain, bX as RecallTraceEvent, bY as RelevanceFeedback, aT as RetrievalTier, bZ as SPECULATIVE_TTL_DAYS, b_ as ScoredEntity, ae as SecretRef, b$ as SemanticChunkingConfigShape, a5 as SessionObserverBandConfig, c0 as SignalLevel, aU as SignalScanResult, c1 as SlotBehaviorConfig, c2 as SlotMismatchMode, T as TopicScore, a2 as TranscriptEntry, c3 as TriggerMode, c4 as VerificationState, c5 as confidenceTier, aF as isRecallDisclosure } from './types-C-USTTAx.js';