@remnic/core 10.0.137 → 10.0.138

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 (172) hide show
  1. package/dist/access-admin-ops-surface.js +38 -38
  2. package/dist/access-cli.js +38 -38
  3. package/dist/access-extraction-force-flush-preempt.js +38 -38
  4. package/dist/access-extraction-force-flush.js +38 -38
  5. package/dist/access-http-briefing.js +38 -38
  6. package/dist/access-http-query.js +38 -38
  7. package/dist/access-http.js +38 -38
  8. package/dist/access-identity-continuity-surface.js +38 -38
  9. package/dist/access-lcm-surface.js +38 -38
  10. package/dist/access-mcp.js +38 -38
  11. package/dist/access-observe-write-surface.js +38 -38
  12. package/dist/access-operations-batch.js +38 -38
  13. package/dist/access-operations.js +38 -38
  14. package/dist/access-recall-concurrency.js +38 -38
  15. package/dist/access-recall-diagnostics.js +2 -2
  16. package/dist/access-recall-response.js +38 -38
  17. package/dist/access-recall-surface.js +38 -38
  18. package/dist/access-service.js +38 -38
  19. package/dist/active-recall.js +3 -3
  20. package/dist/briefing.js +3 -3
  21. package/dist/buffer-turn.d.ts +11 -0
  22. package/dist/buffer-turn.d.ts.map +1 -1
  23. package/dist/causal-consolidation.js +4 -4
  24. package/dist/{chunk-SDRF2WLZ.js → chunk-2NJ74RQU.js} +2 -2
  25. package/dist/{chunk-K4EBUTPN.js → chunk-2VS3DAXE.js} +2 -2
  26. package/dist/{chunk-W4VZ52B3.js → chunk-5IGWEYNV.js} +3 -3
  27. package/dist/{chunk-2SZWPNG4.js → chunk-A33VT7GC.js} +2 -2
  28. package/dist/{chunk-YDAAGCM5.js → chunk-AV6R66KO.js} +2 -2
  29. package/dist/{chunk-4HXJFMPS.js → chunk-CFSCKCT5.js} +2 -1
  30. package/dist/chunk-CFSCKCT5.js.map +1 -0
  31. package/dist/{chunk-IM4XEI2C.js → chunk-CKG7T4AD.js} +2 -2
  32. package/dist/{chunk-SMMRDLLU.js → chunk-DI2QWY6J.js} +8 -8
  33. package/dist/{chunk-7WIZNDR5.js → chunk-HOSS72UP.js} +2 -2
  34. package/dist/{chunk-5K2UIHW4.js → chunk-I3UBDUHO.js} +2 -2
  35. package/dist/{chunk-2LZHXBJM.js → chunk-JEAMQL63.js} +3 -3
  36. package/dist/{chunk-H2N65TDE.js → chunk-JG6AHBJW.js} +2 -2
  37. package/dist/{chunk-3F6COEHZ.js → chunk-JVNGFQJN.js} +1 -1
  38. package/dist/chunk-JVNGFQJN.js.map +1 -0
  39. package/dist/{chunk-V4HY4PEF.js → chunk-JY327EH4.js} +2 -2
  40. package/dist/{chunk-D3CBHMMY.js → chunk-K4DBE5MH.js} +2 -2
  41. package/dist/{chunk-E3DXY24J.js → chunk-KCLHHANX.js} +2 -2
  42. package/dist/{chunk-LKJVCDVS.js → chunk-KCVPKFDG.js} +2 -2
  43. package/dist/{chunk-EFMAYZOB.js → chunk-L6CMR5OI.js} +2 -2
  44. package/dist/{chunk-B7ZHJGPX.js → chunk-LEH4FVBJ.js} +2 -2
  45. package/dist/chunk-LEO4MQ3S.js +140 -0
  46. package/dist/chunk-LEO4MQ3S.js.map +1 -0
  47. package/dist/{chunk-4VL2H5Q3.js → chunk-LL7WIK2Z.js} +2 -2
  48. package/dist/{chunk-FIP6HDPC.js → chunk-LT35JWKZ.js} +2 -2
  49. package/dist/{chunk-O6NONCRR.js → chunk-MP6V4CLP.js} +2 -2
  50. package/dist/{chunk-N7HF7C4N.js → chunk-MXE42X3I.js} +3 -3
  51. package/dist/{chunk-ET3RHBTM.js → chunk-N6JGLQV7.js} +2 -2
  52. package/dist/{chunk-FJUCMMNT.js → chunk-NB2BKYUS.js} +2 -2
  53. package/dist/{chunk-3KOHTVQO.js → chunk-NOZDET3Q.js} +3 -3
  54. package/dist/{chunk-H3IOEMTW.js → chunk-OI3UMEW3.js} +2 -2
  55. package/dist/{chunk-TDPBSVFW.js → chunk-OJJ73HLA.js} +2 -2
  56. package/dist/{chunk-QYUYM7XE.js → chunk-PKPW7MXT.js} +2 -2
  57. package/dist/{chunk-X4V5BBI2.js → chunk-PKV3NNM2.js} +2 -2
  58. package/dist/{chunk-KYY7NODE.js → chunk-PNT3SZRY.js} +7 -7
  59. package/dist/{chunk-4XPWHXEF.js → chunk-POB7N5UM.js} +2 -2
  60. package/dist/{chunk-WS2X4WHX.js → chunk-PQ5FYNY2.js} +2 -2
  61. package/dist/{chunk-P3TQ62XC.js → chunk-QZ5JZNXN.js} +165 -56
  62. package/dist/chunk-QZ5JZNXN.js.map +1 -0
  63. package/dist/{chunk-S57YMPLX.js → chunk-SRW4IKHM.js} +2 -2
  64. package/dist/{chunk-UBSN42MM.js → chunk-VF3EVRUN.js} +2 -2
  65. package/dist/{chunk-DGKSCOB4.js → chunk-VSZEV7HG.js} +2 -2
  66. package/dist/{chunk-DONY5FXC.js → chunk-YDOLJQ55.js} +3 -3
  67. package/dist/cli.js +38 -38
  68. package/dist/coding/export-okf-codegraph.js +2 -2
  69. package/dist/compounding/engine.js +4 -4
  70. package/dist/config.d.ts.map +1 -1
  71. package/dist/config.js +3 -3
  72. package/dist/connectors/codex-materialize-runner.js +3 -3
  73. package/dist/connectors/index.js +3 -3
  74. package/dist/convergence-refresh.js +5 -5
  75. package/dist/corpus-watermark.js +5 -5
  76. package/dist/entity-retrieval.js +3 -3
  77. package/dist/explicit-capture.js +38 -38
  78. package/dist/extraction-window-drain.d.ts +21 -0
  79. package/dist/extraction-window-drain.d.ts.map +1 -1
  80. package/dist/extraction-window-drain.js +5 -3
  81. package/dist/extraction.js +3 -3
  82. package/dist/harmonic-retrieval.js +3 -3
  83. package/dist/index.js +38 -38
  84. package/dist/location/index.js +4 -4
  85. package/dist/maintenance/memory-governance.js +3 -3
  86. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +3 -3
  87. package/dist/maintenance/rebuild-memory-projection-runner.js +5 -5
  88. package/dist/maintenance/rebuild-memory-projection.js +4 -4
  89. package/dist/namespaces/migrate.js +4 -4
  90. package/dist/namespaces/storage.js +3 -3
  91. package/dist/operator-doctor-corpus.js +6 -6
  92. package/dist/operator-toolkit.js +10 -10
  93. package/dist/orchestration/backlog-scheduler.js +39 -39
  94. package/dist/orchestration/buffer-drain-runner.js +39 -39
  95. package/dist/orchestration/extraction-drain.d.ts +13 -0
  96. package/dist/orchestration/extraction-drain.d.ts.map +1 -1
  97. package/dist/orchestration/maintenance.js +11 -11
  98. package/dist/orchestrator.d.ts.map +1 -1
  99. package/dist/orchestrator.js +38 -38
  100. package/dist/recall-explain-renderer.js +3 -3
  101. package/dist/recall-navigate-access.js +2 -2
  102. package/dist/recall-navigate-disclosure.js +2 -2
  103. package/dist/recall-navigate.js +2 -2
  104. package/dist/recall-navigation.js +38 -38
  105. package/dist/recall-xray-cli.js +4 -4
  106. package/dist/recall-xray-renderer.js +3 -3
  107. package/dist/recall-xray.js +2 -2
  108. package/dist/resume-bundles.js +4 -4
  109. package/dist/semantic-consolidation.js +4 -4
  110. package/dist/semantic-rule-promotion.js +3 -3
  111. package/dist/semantic-rule-verifier.js +3 -3
  112. package/dist/source-agent-qualifier.js +3 -3
  113. package/dist/standup/build.js +3 -3
  114. package/dist/storage.js +2 -2
  115. package/dist/transfer/export-okf.js +3 -3
  116. package/dist/types.d.ts +5 -6
  117. package/dist/types.d.ts.map +1 -1
  118. package/dist/types.js +1 -1
  119. package/dist/verified-recall.js +3 -3
  120. package/dist/who-knows-cli.js +4 -4
  121. package/dist/who-knows.js +3 -3
  122. package/package.json +2 -2
  123. package/src/buffer-turn.ts +8 -0
  124. package/src/config.ts +2 -0
  125. package/src/extraction-window-drain.test.ts +66 -0
  126. package/src/extraction-window-drain.ts +113 -2
  127. package/src/orchestration/extraction-drain-parts.test.ts +260 -0
  128. package/src/orchestration/extraction-drain.ts +186 -23
  129. package/src/orchestrator-flush.test.ts +3 -0
  130. package/src/orchestrator.ts +1 -0
  131. package/src/part-failure-threshold.test.ts +91 -0
  132. package/src/types.ts +5 -6
  133. package/dist/chunk-3F6COEHZ.js.map +0 -1
  134. package/dist/chunk-4HXJFMPS.js.map +0 -1
  135. package/dist/chunk-LZIOY7ZU.js +0 -57
  136. package/dist/chunk-LZIOY7ZU.js.map +0 -1
  137. package/dist/chunk-P3TQ62XC.js.map +0 -1
  138. /package/dist/{chunk-SDRF2WLZ.js.map → chunk-2NJ74RQU.js.map} +0 -0
  139. /package/dist/{chunk-K4EBUTPN.js.map → chunk-2VS3DAXE.js.map} +0 -0
  140. /package/dist/{chunk-W4VZ52B3.js.map → chunk-5IGWEYNV.js.map} +0 -0
  141. /package/dist/{chunk-2SZWPNG4.js.map → chunk-A33VT7GC.js.map} +0 -0
  142. /package/dist/{chunk-YDAAGCM5.js.map → chunk-AV6R66KO.js.map} +0 -0
  143. /package/dist/{chunk-IM4XEI2C.js.map → chunk-CKG7T4AD.js.map} +0 -0
  144. /package/dist/{chunk-SMMRDLLU.js.map → chunk-DI2QWY6J.js.map} +0 -0
  145. /package/dist/{chunk-7WIZNDR5.js.map → chunk-HOSS72UP.js.map} +0 -0
  146. /package/dist/{chunk-5K2UIHW4.js.map → chunk-I3UBDUHO.js.map} +0 -0
  147. /package/dist/{chunk-2LZHXBJM.js.map → chunk-JEAMQL63.js.map} +0 -0
  148. /package/dist/{chunk-H2N65TDE.js.map → chunk-JG6AHBJW.js.map} +0 -0
  149. /package/dist/{chunk-V4HY4PEF.js.map → chunk-JY327EH4.js.map} +0 -0
  150. /package/dist/{chunk-D3CBHMMY.js.map → chunk-K4DBE5MH.js.map} +0 -0
  151. /package/dist/{chunk-E3DXY24J.js.map → chunk-KCLHHANX.js.map} +0 -0
  152. /package/dist/{chunk-LKJVCDVS.js.map → chunk-KCVPKFDG.js.map} +0 -0
  153. /package/dist/{chunk-EFMAYZOB.js.map → chunk-L6CMR5OI.js.map} +0 -0
  154. /package/dist/{chunk-B7ZHJGPX.js.map → chunk-LEH4FVBJ.js.map} +0 -0
  155. /package/dist/{chunk-4VL2H5Q3.js.map → chunk-LL7WIK2Z.js.map} +0 -0
  156. /package/dist/{chunk-FIP6HDPC.js.map → chunk-LT35JWKZ.js.map} +0 -0
  157. /package/dist/{chunk-O6NONCRR.js.map → chunk-MP6V4CLP.js.map} +0 -0
  158. /package/dist/{chunk-N7HF7C4N.js.map → chunk-MXE42X3I.js.map} +0 -0
  159. /package/dist/{chunk-ET3RHBTM.js.map → chunk-N6JGLQV7.js.map} +0 -0
  160. /package/dist/{chunk-FJUCMMNT.js.map → chunk-NB2BKYUS.js.map} +0 -0
  161. /package/dist/{chunk-3KOHTVQO.js.map → chunk-NOZDET3Q.js.map} +0 -0
  162. /package/dist/{chunk-H3IOEMTW.js.map → chunk-OI3UMEW3.js.map} +0 -0
  163. /package/dist/{chunk-TDPBSVFW.js.map → chunk-OJJ73HLA.js.map} +0 -0
  164. /package/dist/{chunk-QYUYM7XE.js.map → chunk-PKPW7MXT.js.map} +0 -0
  165. /package/dist/{chunk-X4V5BBI2.js.map → chunk-PKV3NNM2.js.map} +0 -0
  166. /package/dist/{chunk-KYY7NODE.js.map → chunk-PNT3SZRY.js.map} +0 -0
  167. /package/dist/{chunk-4XPWHXEF.js.map → chunk-POB7N5UM.js.map} +0 -0
  168. /package/dist/{chunk-WS2X4WHX.js.map → chunk-PQ5FYNY2.js.map} +0 -0
  169. /package/dist/{chunk-S57YMPLX.js.map → chunk-SRW4IKHM.js.map} +0 -0
  170. /package/dist/{chunk-UBSN42MM.js.map → chunk-VF3EVRUN.js.map} +0 -0
  171. /package/dist/{chunk-DGKSCOB4.js.map → chunk-VSZEV7HG.js.map} +0 -0
  172. /package/dist/{chunk-DONY5FXC.js.map → chunk-YDOLJQ55.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  RECALL_DISCLOSURE_LEVELS
3
- } from "./chunk-3F6COEHZ.js";
3
+ } from "./chunk-JVNGFQJN.js";
4
4
 
5
5
  // src/recall-navigate.ts
6
6
  var RECALL_NAV_LINK_TYPES = [
@@ -48,4 +48,4 @@ export {
48
48
  expandRecallNode,
49
49
  traverseRecallLink
50
50
  };
51
- //# sourceMappingURL=chunk-EFMAYZOB.js.map
51
+ //# sourceMappingURL=chunk-L6CMR5OI.js.map
@@ -210,7 +210,7 @@ import {
210
210
  import {
211
211
  SPECULATIVE_TTL_DAYS,
212
212
  confidenceTier
213
- } from "./chunk-3F6COEHZ.js";
213
+ } from "./chunk-JVNGFQJN.js";
214
214
  import {
215
215
  isSupportPassportPrivateMemory
216
216
  } from "./chunk-TSUSHXBW.js";
@@ -13315,4 +13315,4 @@ export {
13315
13315
  isValidBufferSurpriseEvent,
13316
13316
  StorageManager3 as StorageManager
13317
13317
  };
13318
- //# sourceMappingURL=chunk-B7ZHJGPX.js.map
13318
+ //# sourceMappingURL=chunk-LEH4FVBJ.js.map
@@ -0,0 +1,140 @@
1
+ // src/extraction-window-drain.ts
2
+ function chunkExtractionWindow(turns, maxChars) {
3
+ if (turns.length === 0) return [];
4
+ const budget = Number.isFinite(maxChars) && maxChars > 0 ? Math.floor(maxChars) : Number.POSITIVE_INFINITY;
5
+ const chunks = [];
6
+ let current = [];
7
+ let currentChars = 0;
8
+ for (const turn of turns) {
9
+ const turnChars = turn.content.length;
10
+ if (current.length > 0 && currentChars + turnChars > budget) {
11
+ chunks.push(current);
12
+ current = [];
13
+ currentChars = 0;
14
+ }
15
+ current.push(turn);
16
+ currentChars += turnChars;
17
+ }
18
+ if (current.length > 0) chunks.push(current);
19
+ return chunks;
20
+ }
21
+ var DRAIN_DEFERRAL_REASONS = {
22
+ provider_circuit_open: true,
23
+ extraction_backoff: true,
24
+ scope_profile_no_writable_layer: true
25
+ };
26
+ function classifyDrainResult(result) {
27
+ if (result.status !== "skipped") return "drained";
28
+ if (result.reason !== void 0 && result.reason in DRAIN_DEFERRAL_REASONS) return "deferred";
29
+ if (result.retainedBuffer === true) return "failed";
30
+ return "drained";
31
+ }
32
+ function mergeDrainResults(previous, next) {
33
+ if (previous === null) return next;
34
+ const completed = previous.status === "completed" || next.status === "completed";
35
+ const merged = {
36
+ status: completed ? "completed" : "skipped",
37
+ persistedCount: previous.persistedCount + next.persistedCount,
38
+ durableOutputCount: previous.durableOutputCount + next.durableOutputCount
39
+ };
40
+ if (!completed) merged.reason = next.reason ?? previous.reason;
41
+ if (previous.postPersistMetadataFailed === true || next.postPersistMetadataFailed === true) {
42
+ merged.postPersistMetadataFailed = true;
43
+ }
44
+ return merged;
45
+ }
46
+ function extractionWindowBudgetChars(input) {
47
+ const callMax = input.callMaxChars ?? Number.POSITIVE_INFINITY;
48
+ const cap = Number.isFinite(callMax) && callMax > 0 ? callMax : Number.POSITIVE_INFINITY;
49
+ if (!input.registry || !input.localExtractionActive) return cap;
50
+ return Math.min(cap, input.registry.calculateContextSizes(input.model, input.maxContext).maxInputChars);
51
+ }
52
+ function splitSegments(content) {
53
+ const out = [];
54
+ let start = 0;
55
+ let index = 0;
56
+ while (index < content.length) {
57
+ const ch = content[index];
58
+ if (ch === "\n") {
59
+ let end = index;
60
+ while (end < content.length && content[end] === "\n") end += 1;
61
+ out.push(content.slice(start, end));
62
+ start = end;
63
+ index = end;
64
+ continue;
65
+ }
66
+ if (ch === "." || ch === "!" || ch === "?") {
67
+ let end = index + 1;
68
+ while (end < content.length && (content[end] === " " || content[end] === " ")) end += 1;
69
+ out.push(content.slice(start, end));
70
+ start = end;
71
+ index = end;
72
+ continue;
73
+ }
74
+ index += 1;
75
+ }
76
+ if (start < content.length) out.push(content.slice(start));
77
+ return out;
78
+ }
79
+ function splitTurnContent(content, maxChars) {
80
+ const segments = splitSegments(content);
81
+ const parts = [];
82
+ let current = "";
83
+ for (const segment of segments) {
84
+ let piece = segment;
85
+ while (piece.length > 0) {
86
+ const room = maxChars - current.length;
87
+ if (piece.length <= room) {
88
+ current += piece;
89
+ break;
90
+ }
91
+ if (current.length > 0) {
92
+ parts.push(current);
93
+ current = "";
94
+ continue;
95
+ }
96
+ parts.push(piece.slice(0, maxChars));
97
+ piece = piece.slice(maxChars);
98
+ }
99
+ }
100
+ if (current.length > 0) parts.push(current);
101
+ return parts;
102
+ }
103
+ function splitOversizedTurns(turns, maxChars, maxParts = 8) {
104
+ const partParents = /* @__PURE__ */ new Map();
105
+ const clampedParents = /* @__PURE__ */ new Set();
106
+ const budget = Math.floor(maxChars);
107
+ if (!(Number.isFinite(budget) && budget > 0)) {
108
+ return { turns: [...turns], partParents, clampedParents, clamped: false };
109
+ }
110
+ const out = [];
111
+ let clamped = false;
112
+ for (const turn of turns) {
113
+ if (turn.content.length <= budget) {
114
+ out.push(turn);
115
+ continue;
116
+ }
117
+ const slices = splitTurnContent(turn.content, budget);
118
+ const emitted = slices.slice(0, maxParts);
119
+ if (slices.length > maxParts) {
120
+ clamped = true;
121
+ clampedParents.add(turn);
122
+ }
123
+ const of = emitted.length;
124
+ for (const [index, slice] of emitted.entries()) {
125
+ const part = { ...turn, content: slice, extractionPartOf: { part: index + 1, of } };
126
+ partParents.set(part, turn);
127
+ out.push(part);
128
+ }
129
+ }
130
+ return { turns: out, partParents, clampedParents, clamped };
131
+ }
132
+
133
+ export {
134
+ chunkExtractionWindow,
135
+ classifyDrainResult,
136
+ mergeDrainResults,
137
+ extractionWindowBudgetChars,
138
+ splitOversizedTurns
139
+ };
140
+ //# sourceMappingURL=chunk-LEO4MQ3S.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/extraction-window-drain.ts"],"sourcesContent":["/**\n * Trigger-drain helpers (extraction trigger stall fix).\n *\n * A session whose buffered window outgrows the extraction model's context\n * never drains: the trigger fires `extract_batch` on every observe, the\n * oversized request fails, nothing is cleared, and the window only grows.\n * These helpers split such a window into budget-fitting chunks and classify\n * each extraction run so the caller can drain successes, defer on breaker/\n * backoff retention, and drop repeatedly failing chunks.\n */\n\nimport type { ExtractionRunResult } from \"./orchestration/extraction-run.js\";\n\n/**\n * Split `turns` into chunks whose summed content length stays within\n * `maxChars`. Chunks keep turn order and never split a turn; a single turn\n * longer than the budget becomes its own chunk (the extraction prompt still\n * clamps per-turn content). A non-positive or non-finite budget, or an empty\n * window, yields at most one chunk (no chunking).\n */\nexport function chunkExtractionWindow<T extends { content: string }>(\n turns: readonly T[],\n maxChars: number,\n): T[][] {\n if (turns.length === 0) return [];\n const budget =\n Number.isFinite(maxChars) && maxChars > 0 ? Math.floor(maxChars) : Number.POSITIVE_INFINITY;\n const chunks: T[][] = [];\n let current: T[] = [];\n let currentChars = 0;\n for (const turn of turns) {\n const turnChars = turn.content.length;\n if (current.length > 0 && currentChars + turnChars > budget) {\n chunks.push(current);\n current = [];\n currentChars = 0;\n }\n current.push(turn);\n currentChars += turnChars;\n }\n if (current.length > 0) chunks.push(current);\n return chunks;\n}\n\nexport type DrainVerdict = \"drained\" | \"deferred\" | \"failed\";\n\n/**\n * Run results that deliberately RETAIN the buffer (provider breaker open,\n * per-fingerprint backoff, a scope policy refusal) are deferrals, not chunk\n * failures — counting them would eventually drop good content that never got\n * its attempt.\n */\nconst DRAIN_DEFERRAL_REASONS = {\n provider_circuit_open: true,\n extraction_backoff: true,\n scope_profile_no_writable_layer: true,\n};\n\nexport function classifyDrainResult(result: ExtractionRunResult): DrainVerdict {\n if (result.status !== \"skipped\") return \"drained\";\n if (result.reason !== undefined && result.reason in DRAIN_DEFERRAL_REASONS) return \"deferred\";\n // A run that kept its window for retry did NOT consume the content: it is a\n // chunk failure, never a drain — even when the window was retained.\n if (result.retainedBuffer === true) return \"failed\";\n return \"drained\";\n}\n\n/**\n * Combine chunk results into the single `ExtractionRunResult` the queue\n * contract settles with: counts sum, any completed chunk completes the drain,\n * and the last non-completed reason wins.\n */\nexport function mergeDrainResults(\n previous: ExtractionRunResult | null,\n next: ExtractionRunResult,\n): ExtractionRunResult {\n if (previous === null) return next;\n const completed = previous.status === \"completed\" || next.status === \"completed\";\n const merged: ExtractionRunResult = {\n status: completed ? \"completed\" : \"skipped\",\n persistedCount: previous.persistedCount + next.persistedCount,\n durableOutputCount: previous.durableOutputCount + next.durableOutputCount,\n };\n if (!completed) merged.reason = next.reason ?? previous.reason;\n if (previous.postPersistMetadataFailed === true || next.postPersistMetadataFailed === true) {\n merged.postPersistMetadataFailed = true;\n }\n return merged;\n}\n\n/** The slice of ModelRegistry the drain budget needs. */\nexport interface WindowBudgetRegistry {\n calculateContextSizes(modelId: string, maxContextOverride?: number): { maxInputChars: number };\n}\n\n/**\n * Character budget for one extraction request. The learned local-model window\n * only describes the extractor when the local LLM does the extracting; with a\n * gateway extractor, a disabled local LLM, or no registry (legacy hosts, test\n * doubles) there is no budget and the window runs in one request as before.\n */\nexport function extractionWindowBudgetChars(input: {\n registry: WindowBudgetRegistry | undefined;\n localExtractionActive: boolean;\n model: string;\n maxContext: number | undefined;\n /** Configured per-call payload cap (`extractionCallMaxChars`). */\n callMaxChars?: number;\n}): number {\n const callMax = input.callMaxChars ?? Number.POSITIVE_INFINITY;\n const cap = Number.isFinite(callMax) && callMax > 0 ? callMax : Number.POSITIVE_INFINITY;\n if (!input.registry || !input.localExtractionActive) return cap;\n return Math.min(cap, input.registry.calculateContextSizes(input.model, input.maxContext).maxInputChars);\n}\n\n/**\n * Split `content` into budget-fitting slices at sentence/paragraph\n * boundaries; a segment longer than the budget hard-cuts at the boundary.\n * The slices are contiguous and verbatim — join(\"\") restores the input.\n */\nfunction splitSegments(content: string): string[] {\n const out: string[] = [];\n let start = 0;\n let index = 0;\n while (index < content.length) {\n const ch = content[index];\n if (ch === \"\\n\") {\n let end = index;\n while (end < content.length && content[end] === \"\\n\") end += 1;\n out.push(content.slice(start, end));\n start = end;\n index = end;\n continue;\n }\n if (ch === \".\" || ch === \"!\" || ch === \"?\") {\n let end = index + 1;\n while (end < content.length && (content[end] === \" \" || content[end] === \"\\t\")) end += 1;\n out.push(content.slice(start, end));\n start = end;\n index = end;\n continue;\n }\n index += 1;\n }\n if (start < content.length) out.push(content.slice(start));\n return out;\n}\n\nfunction splitTurnContent(content: string, maxChars: number): string[] {\n const segments = splitSegments(content);\n const parts: string[] = [];\n let current = \"\";\n for (const segment of segments) {\n let piece = segment;\n while (piece.length > 0) {\n const room = maxChars - current.length;\n if (piece.length <= room) {\n current += piece;\n break;\n }\n if (current.length > 0) {\n parts.push(current);\n current = \"\";\n continue;\n }\n parts.push(piece.slice(0, maxChars));\n piece = piece.slice(maxChars);\n }\n }\n if (current.length > 0) parts.push(current);\n return parts;\n}\n\n/**\n * Replace each turn over `maxChars` with in-memory part copies marked\n * `extractionPartOf {part,of}` (payload-cap drain). Parts keep order and\n * carry verbatim contiguous slices so joining them restores the turn —\n * nothing is dropped by the split itself. A turn needing more than\n * `maxParts` emits `maxParts` parts and reports `clamped` so the caller\n * can log the bounded loss rather than hide it.\n */\nexport interface OversizedTurnSplit<T extends { content: string }> {\n turns: T[];\n partParents: Map<T, T>;\n clampedParents: Set<T>;\n clamped: boolean;\n}\n\nexport function splitOversizedTurns<T extends { content: string }>(\n turns: readonly T[],\n maxChars: number,\n maxParts = 8,\n): OversizedTurnSplit<T> {\n const partParents = new Map<T, T>();\n const clampedParents = new Set<T>();\n const budget = Math.floor(maxChars);\n if (!(Number.isFinite(budget) && budget > 0)) {\n return { turns: [...turns], partParents, clampedParents, clamped: false };\n }\n const out: T[] = [];\n let clamped = false;\n for (const turn of turns) {\n if (turn.content.length <= budget) {\n out.push(turn);\n continue;\n }\n const slices = splitTurnContent(turn.content, budget);\n const emitted = slices.slice(0, maxParts);\n if (slices.length > maxParts) {\n clamped = true;\n clampedParents.add(turn);\n }\n const of = emitted.length;\n for (const [index, slice] of emitted.entries()) {\n const part = { ...turn, content: slice, extractionPartOf: { part: index + 1, of } };\n partParents.set(part, turn);\n out.push(part);\n }\n }\n return { turns: out, partParents, clampedParents, clamped };\n}\n"],"mappings":";AAoBO,SAAS,sBACd,OACA,UACO;AACP,MAAI,MAAM,WAAW,EAAG,QAAO,CAAC;AAChC,QAAM,SACJ,OAAO,SAAS,QAAQ,KAAK,WAAW,IAAI,KAAK,MAAM,QAAQ,IAAI,OAAO;AAC5E,QAAM,SAAgB,CAAC;AACvB,MAAI,UAAe,CAAC;AACpB,MAAI,eAAe;AACnB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O;AAC1C,SAAO;AACT;AAiBO,SAAS,oBACd,OACA,UACA,WAAW,GACY;AACvB,QAAM,cAAc,oBAAI,IAAU;AAClC,QAAM,iBAAiB,oBAAI,IAAO;AAClC,QAAM,SAAS,KAAK,MAAM,QAAQ;AAClC,MAAI,EAAE,OAAO,SAAS,MAAM,KAAK,SAAS,IAAI;AAC5C,WAAO,EAAE,OAAO,CAAC,GAAG,KAAK,GAAG,aAAa,gBAAgB,SAAS,MAAM;AAAA,EAC1E;AACA,QAAM,MAAW,CAAC;AAClB,MAAI,UAAU;AACd,aAAW,QAAQ,OAAO;AACxB,QAAI,KAAK,QAAQ,UAAU,QAAQ;AACjC,UAAI,KAAK,IAAI;AACb;AAAA,IACF;AACA,UAAM,SAAS,iBAAiB,KAAK,SAAS,MAAM;AACpD,UAAM,UAAU,OAAO,MAAM,GAAG,QAAQ;AACxC,QAAI,OAAO,SAAS,UAAU;AAC5B,gBAAU;AACV,qBAAe,IAAI,IAAI;AAAA,IACzB;AACA,UAAM,KAAK,QAAQ;AACnB,eAAW,CAAC,OAAO,KAAK,KAAK,QAAQ,QAAQ,GAAG;AAC9C,YAAM,OAAO,EAAE,GAAG,MAAM,SAAS,OAAO,kBAAkB,EAAE,MAAM,QAAQ,GAAG,GAAG,EAAE;AAClF,kBAAY,IAAI,MAAM,IAAI;AAC1B,UAAI,KAAK,IAAI;AAAA,IACf;AAAA,EACF;AACA,SAAO,EAAE,OAAO,KAAK,aAAa,gBAAgB,QAAQ;AAC5D;","names":[]}
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  RECALL_DISCLOSURE_LEVELS,
3
3
  isRecallDisclosure
4
- } from "./chunk-3F6COEHZ.js";
4
+ } from "./chunk-JVNGFQJN.js";
5
5
 
6
6
  // src/recall-navigate-disclosure.ts
7
7
  function disclosureRank(level) {
@@ -27,4 +27,4 @@ export {
27
27
  disclosureRank,
28
28
  planDisclosureStep
29
29
  };
30
- //# sourceMappingURL=chunk-4VL2H5Q3.js.map
30
+ //# sourceMappingURL=chunk-LL7WIK2Z.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  rebuildMemoryProjection,
3
3
  watchProjectionRebuildParent
4
- } from "./chunk-3KOHTVQO.js";
4
+ } from "./chunk-NOZDET3Q.js";
5
5
  import {
6
6
  initLogger,
7
7
  log
@@ -77,4 +77,4 @@ if (invokedAsRunner) {
77
77
  export {
78
78
  PROJECTION_REBUILD_RUNNER_FLAG
79
79
  };
80
- //# sourceMappingURL=chunk-FIP6HDPC.js.map
80
+ //# sourceMappingURL=chunk-LT35JWKZ.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  StorageManager
3
- } from "./chunk-B7ZHJGPX.js";
3
+ } from "./chunk-LEH4FVBJ.js";
4
4
  import {
5
5
  keyring_exports,
6
6
  secureStoreDir
@@ -416,4 +416,4 @@ export {
416
416
  resolveNamespaceStorageRoot,
417
417
  NamespaceStorageRouter
418
418
  };
419
- //# sourceMappingURL=chunk-O6NONCRR.js.map
419
+ //# sourceMappingURL=chunk-MP6V4CLP.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  resolveDefaultNamespaceRoot
3
- } from "./chunk-O6NONCRR.js";
3
+ } from "./chunk-MP6V4CLP.js";
4
4
  import {
5
5
  StorageManager
6
- } from "./chunk-B7ZHJGPX.js";
6
+ } from "./chunk-LEH4FVBJ.js";
7
7
  import {
8
8
  composeLocationDayBody,
9
9
  composeLocationDayMeta,
@@ -779,4 +779,4 @@ export {
779
779
  LOCATION_SYNC_DEFAULT_INTERVAL_MS,
780
780
  startLocationAutoSync
781
781
  };
782
- //# sourceMappingURL=chunk-N7HF7C4N.js.map
782
+ //# sourceMappingURL=chunk-MXE42X3I.js.map
@@ -2,7 +2,7 @@ import {
2
2
  WHO_KNOWS_DEFAULT_LIMIT,
3
3
  WHO_KNOWS_MAX_LIMIT,
4
4
  validateWhoKnowsInput
5
- } from "./chunk-4XPWHXEF.js";
5
+ } from "./chunk-POB7N5UM.js";
6
6
 
7
7
  // src/who-knows-cli.ts
8
8
  function extractWhoKnowsRawArgs(rest) {
@@ -74,4 +74,4 @@ export {
74
74
  renderWhoKnowsText,
75
75
  renderWhoKnows
76
76
  };
77
- //# sourceMappingURL=chunk-ET3RHBTM.js.map
77
+ //# sourceMappingURL=chunk-N6JGLQV7.js.map
@@ -14,7 +14,7 @@ import {
14
14
  } from "./chunk-3UXOZBHV.js";
15
15
  import {
16
16
  StorageManager
17
- } from "./chunk-B7ZHJGPX.js";
17
+ } from "./chunk-LEH4FVBJ.js";
18
18
  import {
19
19
  OKF_PROFILE_TYPE,
20
20
  okfTypeForMemory
@@ -272,4 +272,4 @@ export {
272
272
  exportOkfBundle,
273
273
  firstHeading
274
274
  };
275
- //# sourceMappingURL=chunk-FJUCMMNT.js.map
275
+ //# sourceMappingURL=chunk-NB2BKYUS.js.map
@@ -4,13 +4,13 @@ import {
4
4
  import {
5
5
  listMemoryGovernanceRuns,
6
6
  readMemoryGovernanceRunArtifact
7
- } from "./chunk-UBSN42MM.js";
7
+ } from "./chunk-VF3EVRUN.js";
8
8
  import {
9
9
  loadPersistedNativeKnowledgeChunks
10
10
  } from "./chunk-2DQ2XREU.js";
11
11
  import {
12
12
  StorageManager
13
- } from "./chunk-B7ZHJGPX.js";
13
+ } from "./chunk-LEH4FVBJ.js";
14
14
  import {
15
15
  normalizeProjectionPreview,
16
16
  normalizeProjectionTags
@@ -1156,4 +1156,4 @@ export {
1156
1156
  verifyMemoryProjection,
1157
1157
  repairMemoryProjection
1158
1158
  };
1159
- //# sourceMappingURL=chunk-3KOHTVQO.js.map
1159
+ //# sourceMappingURL=chunk-NOZDET3Q.js.map
@@ -36,7 +36,7 @@ import {
36
36
  } from "./chunk-2DQ2XREU.js";
37
37
  import {
38
38
  compareEntityTimestamps
39
- } from "./chunk-B7ZHJGPX.js";
39
+ } from "./chunk-LEH4FVBJ.js";
40
40
  import {
41
41
  normalizeEntityText,
42
42
  resolveRequestedEntitySectionKeys
@@ -877,4 +877,4 @@ export {
877
877
  entityIndexVersion,
878
878
  entityRecentTranscriptLookbackHours
879
879
  };
880
- //# sourceMappingURL=chunk-H3IOEMTW.js.map
880
+ //# sourceMappingURL=chunk-OI3UMEW3.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  NamespaceStorageRouter
3
- } from "./chunk-O6NONCRR.js";
3
+ } from "./chunk-MP6V4CLP.js";
4
4
  import {
5
5
  namespaceCollectionName
6
6
  } from "./chunk-U3GJUARA.js";
@@ -213,4 +213,4 @@ export {
213
213
  verifyNamespaces,
214
214
  runNamespaceMigration
215
215
  };
216
- //# sourceMappingURL=chunk-TDPBSVFW.js.map
216
+ //# sourceMappingURL=chunk-OJJ73HLA.js.map
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-I4WBNM3M.js";
7
7
  import {
8
8
  isRecallDisclosure
9
- } from "./chunk-3F6COEHZ.js";
9
+ } from "./chunk-JVNGFQJN.js";
10
10
 
11
11
  // src/recall-xray.ts
12
12
  import { randomUUID } from "crypto";
@@ -312,4 +312,4 @@ export {
312
312
  RecallXrayBuilder,
313
313
  summarizeDisclosureTokens
314
314
  };
315
- //# sourceMappingURL=chunk-QYUYM7XE.js.map
315
+ //# sourceMappingURL=chunk-PKPW7MXT.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-KJTKLXTH.js";
4
4
  import {
5
5
  StorageManager
6
- } from "./chunk-B7ZHJGPX.js";
6
+ } from "./chunk-LEH4FVBJ.js";
7
7
  import {
8
8
  assertInjectedStorageRooted
9
9
  } from "./chunk-BNZAR6PO.js";
@@ -260,4 +260,4 @@ export {
260
260
  backupExistingLedger,
261
261
  rebuildMemoryLifecycleLedger
262
262
  };
263
- //# sourceMappingURL=chunk-X4V5BBI2.js.map
263
+ //# sourceMappingURL=chunk-PKV3NNM2.js.map
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  rebuildMemoryLifecycleLedger
3
- } from "./chunk-X4V5BBI2.js";
3
+ } from "./chunk-PKV3NNM2.js";
4
4
  import {
5
5
  PROJECTION_REBUILD_RUNNER_FLAG
6
- } from "./chunk-FIP6HDPC.js";
6
+ } from "./chunk-LT35JWKZ.js";
7
7
  import {
8
8
  startLocationAutoSync
9
- } from "./chunk-N7HF7C4N.js";
9
+ } from "./chunk-MXE42X3I.js";
10
10
  import {
11
11
  ensureContradictionScanCron,
12
12
  ensureDaySummaryCron,
@@ -21,14 +21,14 @@ import {
21
21
  isIsoWeekId,
22
22
  msUntilNextIsoWeek,
23
23
  previousIsoWeekId
24
- } from "./chunk-2LZHXBJM.js";
24
+ } from "./chunk-JEAMQL63.js";
25
25
  import {
26
26
  planNamespaceMaintenance,
27
27
  runNamespaceMaintenanceBatchPlan
28
- } from "./chunk-DGKSCOB4.js";
28
+ } from "./chunk-VSZEV7HG.js";
29
29
  import {
30
30
  rebuildMemoryProjection
31
- } from "./chunk-3KOHTVQO.js";
31
+ } from "./chunk-NOZDET3Q.js";
32
32
  import {
33
33
  LocalLlmClient
34
34
  } from "./chunk-AWKD2A73.js";
@@ -2874,4 +2874,4 @@ export {
2874
2874
  ActivitySyncScheduler,
2875
2875
  MaintenanceScheduler
2876
2876
  };
2877
- //# sourceMappingURL=chunk-KYY7NODE.js.map
2877
+ //# sourceMappingURL=chunk-PNT3SZRY.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  parseEntityFile
3
- } from "./chunk-B7ZHJGPX.js";
3
+ } from "./chunk-LEH4FVBJ.js";
4
4
  import {
5
5
  inferMemoryStatus
6
6
  } from "./chunk-7RJUVTVF.js";
@@ -253,4 +253,4 @@ export {
253
253
  WHO_KNOWS_MCP_TOOLS,
254
254
  handleWhoKnowsHttpQuery
255
255
  };
256
- //# sourceMappingURL=chunk-4XPWHXEF.js.map
256
+ //# sourceMappingURL=chunk-POB7N5UM.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  StorageManager
3
- } from "./chunk-B7ZHJGPX.js";
3
+ } from "./chunk-LEH4FVBJ.js";
4
4
  import {
5
5
  composeMemoryEnvelope
6
6
  } from "./chunk-X26YOFGS.js";
@@ -546,4 +546,4 @@ export {
546
546
  setSemanticRulePromotionTestHooks,
547
547
  promoteSemanticRuleFromMemory
548
548
  };
549
- //# sourceMappingURL=chunk-WS2X4WHX.js.map
549
+ //# sourceMappingURL=chunk-PQ5FYNY2.js.map