@remnic/core 9.6.37 → 9.6.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (272) hide show
  1. package/dist/access-admin-ops-surface.d.ts +6 -6
  2. package/dist/access-admin-ops-surface.js +8 -8
  3. package/dist/access-boundary.d.ts +6 -6
  4. package/dist/access-boundary.js +9 -9
  5. package/dist/access-cli.js +32 -32
  6. package/dist/access-http.d.ts +6 -6
  7. package/dist/access-http.js +13 -13
  8. package/dist/access-identity-continuity-surface.d.ts +5 -5
  9. package/dist/access-identity-continuity-surface.js +8 -8
  10. package/dist/access-lcm-surface.d.ts +6 -6
  11. package/dist/access-lcm-surface.js +8 -8
  12. package/dist/access-mcp.d.ts +6 -6
  13. package/dist/access-mcp.js +12 -12
  14. package/dist/access-observe-write-surface.d.ts +6 -6
  15. package/dist/access-observe-write-surface.js +8 -8
  16. package/dist/access-operations-batch.js +10 -10
  17. package/dist/access-operations.d.ts +7 -7
  18. package/dist/access-operations.js +11 -11
  19. package/dist/access-recall-surface.d.ts +6 -6
  20. package/dist/access-recall-surface.js +8 -8
  21. package/dist/{access-service-BofDzaPT.d.ts → access-service-Fw9AYEqG.d.ts} +4 -4
  22. package/dist/access-service.d.ts +6 -6
  23. package/dist/access-service.js +8 -8
  24. package/dist/access-surface-catalog.d.ts +6 -6
  25. package/dist/action-confidence.d.ts +1 -1
  26. package/dist/active-memory-bridge.d.ts +1 -1
  27. package/dist/active-recall.d.ts +1 -1
  28. package/dist/active-recall.js +2 -1
  29. package/dist/active-recall.js.map +1 -1
  30. package/dist/behavior-learner.d.ts +1 -1
  31. package/dist/behavior-signals.d.ts +1 -1
  32. package/dist/bootstrap.d.ts +5 -5
  33. package/dist/briefing.d.ts +2 -2
  34. package/dist/briefing.js +3 -3
  35. package/dist/buffer-surprise-report.d.ts +1 -1
  36. package/dist/buffer.d.ts +2 -2
  37. package/dist/bulk-import/index.d.ts +3 -3
  38. package/dist/calibration.d.ts +1 -1
  39. package/dist/capabilities.d.ts +1 -1
  40. package/dist/{catalog-9WanSGtt.d.ts → catalog-CnS_MP-8.d.ts} +1 -1
  41. package/dist/causal-behavior.d.ts +1 -1
  42. package/dist/causal-consolidation.d.ts +1 -1
  43. package/dist/causal-consolidation.js +4 -4
  44. package/dist/causal-trajectory-graph.d.ts +1 -1
  45. package/dist/{chunk-B4LPRAWL.js → chunk-2V6L3L56.js} +6 -6
  46. package/dist/{chunk-AXALUFAH.js → chunk-3BZDBG7U.js} +2 -2
  47. package/dist/{chunk-KL4UAXUY.js → chunk-3WULMX34.js} +73 -2
  48. package/dist/{chunk-KL4UAXUY.js.map → chunk-3WULMX34.js.map} +1 -1
  49. package/dist/{chunk-JODHPNLN.js → chunk-5ELELET5.js} +2 -2
  50. package/dist/{chunk-DQ42IQSK.js → chunk-5SORASJK.js} +2 -2
  51. package/dist/{chunk-DAAJUA6Q.js → chunk-6MWGGPJJ.js} +5 -5
  52. package/dist/{chunk-2K3OSLHE.js → chunk-7TEWOG3R.js} +2 -2
  53. package/dist/{chunk-23G3T2Q5.js → chunk-7XY6TJLM.js} +2 -2
  54. package/dist/{chunk-W2AHSCKY.js → chunk-AZK3NEHL.js} +2 -2
  55. package/dist/{chunk-7ZYBDQ7V.js → chunk-CVEEJKRD.js} +2 -2
  56. package/dist/{chunk-YQB32INI.js → chunk-EBVUFGJ4.js} +2 -2
  57. package/dist/{chunk-4Q2XWAHZ.js → chunk-EDD2G35Z.js} +2 -2
  58. package/dist/{chunk-CAZ3Z5M6.js → chunk-F7AE7L6G.js} +2 -2
  59. package/dist/{chunk-B5GBWBCZ.js → chunk-GCTJG5MP.js} +2 -2
  60. package/dist/{chunk-C6TKSI35.js → chunk-HVE3UVAB.js} +3 -3
  61. package/dist/{chunk-SDAXPXER.js → chunk-IGCQHJSQ.js} +2 -2
  62. package/dist/{chunk-3AC5UYKI.js → chunk-METJNEIB.js} +1 -1
  63. package/dist/chunk-METJNEIB.js.map +1 -0
  64. package/dist/{chunk-MXAGJHTA.js → chunk-NREKOGZ2.js} +3 -3
  65. package/dist/{chunk-H4FHR4UM.js → chunk-PQG2AOL4.js} +2 -2
  66. package/dist/{chunk-WSOEYOHN.js → chunk-PWSZNML3.js} +15 -15
  67. package/dist/{chunk-OXVKR5OU.js → chunk-RU73ZROD.js} +342 -16
  68. package/dist/chunk-RU73ZROD.js.map +1 -0
  69. package/dist/{chunk-VJRJTRYF.js → chunk-RVLE2SNP.js} +17 -17
  70. package/dist/{chunk-KVSVVKHA.js → chunk-U5JP7FCM.js} +2 -2
  71. package/dist/{chunk-GQURC4B7.js → chunk-VTRF5QBX.js} +2 -2
  72. package/dist/{chunk-FVTLSFWU.js → chunk-WHZ7MK72.js} +2 -2
  73. package/dist/{chunk-PUQZIS6A.js → chunk-WX4XTAOI.js} +4 -4
  74. package/dist/{chunk-VHJARF5R.js → chunk-XH2Y6UIW.js} +2 -2
  75. package/dist/{chunk-GQGDRLDM.js → chunk-YAN6NTJN.js} +3 -3
  76. package/dist/{chunk-DEKIXXIG.js → chunk-ZIKJD6NL.js} +2 -2
  77. package/dist/{chunk-KJIJNLXT.js → chunk-ZMXXHUEZ.js} +3 -3
  78. package/dist/{chunk-O6YI4CVI.js → chunk-ZSDRGPMV.js} +2 -2
  79. package/dist/{cli-3_x5sJTL.d.ts → cli-PGF41MN6.d.ts} +5 -5
  80. package/dist/cli.d.ts +8 -8
  81. package/dist/cli.js +26 -26
  82. package/dist/compounding/engine.d.ts +2 -2
  83. package/dist/compounding/engine.js +3 -3
  84. package/dist/compounding/preference-consolidator.d.ts +1 -1
  85. package/dist/compression-optimizer.d.ts +1 -1
  86. package/dist/config.d.ts +1 -1
  87. package/dist/config.js +2 -1
  88. package/dist/connectors/codex-materialize-runner.d.ts +1 -1
  89. package/dist/connectors/codex-materialize-runner.js +3 -3
  90. package/dist/connectors/codex-materialize.d.ts +1 -1
  91. package/dist/connectors/index.d.ts +1 -1
  92. package/dist/connectors/index.js +3 -3
  93. package/dist/consolidation-provenance-check.d.ts +2 -2
  94. package/dist/consolidation-undo.d.ts +2 -2
  95. package/dist/contradiction/index.d.ts +2 -2
  96. package/dist/conversation-index/backend.d.ts +1 -1
  97. package/dist/conversation-index/chunker.d.ts +1 -1
  98. package/dist/conversation-index/faiss-adapter.d.ts +1 -1
  99. package/dist/conversation-index/indexer.d.ts +1 -1
  100. package/dist/conversation-index/search.d.ts +1 -1
  101. package/dist/day-summary.d.ts +1 -1
  102. package/dist/delinearize.d.ts +1 -1
  103. package/dist/direct-answer-wiring.d.ts +1 -1
  104. package/dist/direct-answer.d.ts +1 -1
  105. package/dist/embedding-fallback.d.ts +1 -1
  106. package/dist/enrichment/index.d.ts +1 -1
  107. package/dist/entity-retrieval.d.ts +2 -2
  108. package/dist/entity-retrieval.js +3 -3
  109. package/dist/entity-schema.d.ts +1 -1
  110. package/dist/explicit-capture.d.ts +5 -5
  111. package/dist/extraction-faithfulness.d.ts +1 -1
  112. package/dist/extraction-judge-telemetry.d.ts +1 -1
  113. package/dist/extraction-judge-training.d.ts +1 -1
  114. package/dist/extraction-judge.d.ts +1 -1
  115. package/dist/extraction.d.ts +1 -1
  116. package/dist/fallback-llm.d.ts +1 -1
  117. package/dist/graph-dashboard-diff.d.ts +1 -1
  118. package/dist/graph-dashboard-key.d.ts +1 -1
  119. package/dist/graph-dashboard-parser.d.ts +1 -1
  120. package/dist/graph-edge-reinforcement.d.ts +1 -1
  121. package/dist/graph-snapshot.d.ts +1 -1
  122. package/dist/graph.d.ts +1 -1
  123. package/dist/identity-continuity.d.ts +1 -1
  124. package/dist/importance.d.ts +1 -1
  125. package/dist/importers/index.d.ts +1 -1
  126. package/dist/index.d.ts +13 -13
  127. package/dist/index.js +35 -35
  128. package/dist/intent.d.ts +1 -1
  129. package/dist/lcm/engine.d.ts +1 -1
  130. package/dist/lcm/index.d.ts +1 -1
  131. package/dist/lcm/tools.d.ts +1 -1
  132. package/dist/lifecycle.d.ts +1 -1
  133. package/dist/live-connectors-runner.d.ts +1 -1
  134. package/dist/local-llm.d.ts +1 -1
  135. package/dist/local-model-endpoint.d.ts +1 -1
  136. package/dist/maintenance/memory-governance.d.ts +1 -1
  137. package/dist/maintenance/memory-governance.js +3 -3
  138. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +3 -3
  139. package/dist/maintenance/rebuild-memory-projection.js +4 -4
  140. package/dist/mcp-memory-inspector-app.d.ts +6 -6
  141. package/dist/memory-action-policy.d.ts +1 -1
  142. package/dist/memory-cache.d.ts +1 -1
  143. package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
  144. package/dist/memory-projection-store.d.ts +1 -1
  145. package/dist/memory-provenance.d.ts +1 -1
  146. package/dist/memory-worth-outcomes.d.ts +2 -2
  147. package/dist/models-json.d.ts +1 -1
  148. package/dist/namespaces/migrate.d.ts +3 -3
  149. package/dist/namespaces/migrate.js +4 -4
  150. package/dist/namespaces/principal.d.ts +1 -1
  151. package/dist/namespaces/search.d.ts +1 -1
  152. package/dist/namespaces/storage.d.ts +3 -3
  153. package/dist/namespaces/storage.js +3 -3
  154. package/dist/native-knowledge.d.ts +1 -1
  155. package/dist/operator-toolkit.d.ts +2 -2
  156. package/dist/operator-toolkit.js +9 -8
  157. package/dist/orchestration/compression-guideline-coordinator.d.ts +2 -2
  158. package/dist/orchestration/maintenance.d.ts +2 -2
  159. package/dist/orchestration/maintenance.js +5 -5
  160. package/dist/{orchestrator-CAH5-PKN.d.ts → orchestrator-xePY-WPe.d.ts} +4 -4
  161. package/dist/orchestrator.d.ts +5 -5
  162. package/dist/orchestrator.js +32 -32
  163. package/dist/patterns-cli.d.ts +1 -1
  164. package/dist/{pipeline-CiD86zIk.d.ts → pipeline-Zgwz-Kne.d.ts} +1 -1
  165. package/dist/policy-runtime.d.ts +1 -1
  166. package/dist/provenance.d.ts +1 -1
  167. package/dist/{qmd-Bef7DDuQ.d.ts → qmd-B6Xwfn5_.d.ts} +1 -1
  168. package/dist/qmd-preflight.d.ts +2 -2
  169. package/dist/qmd-recall-cache.d.ts +1 -1
  170. package/dist/qmd.d.ts +2 -2
  171. package/dist/recall-disclosure-escalation.d.ts +1 -1
  172. package/dist/recall-explain-renderer.d.ts +1 -1
  173. package/dist/recall-explain-renderer.js +3 -3
  174. package/dist/recall-planner-llm.d.ts +1 -1
  175. package/dist/recall-state.d.ts +1 -1
  176. package/dist/recall-tag-filter.d.ts +1 -1
  177. package/dist/recall-timings.d.ts +1 -1
  178. package/dist/recall-xray-cli.d.ts +1 -1
  179. package/dist/recall-xray-cli.js +4 -4
  180. package/dist/recall-xray-renderer.d.ts +1 -1
  181. package/dist/recall-xray-renderer.js +3 -3
  182. package/dist/recall-xray.d.ts +1 -1
  183. package/dist/recall-xray.js +2 -2
  184. package/dist/replay/normalizers/chatgpt.d.ts +1 -1
  185. package/dist/replay/normalizers/claude.d.ts +1 -1
  186. package/dist/replay/normalizers/openclaw.d.ts +1 -1
  187. package/dist/replay/normalizers/shared.d.ts +1 -1
  188. package/dist/replay/runner.d.ts +1 -1
  189. package/dist/replay/types.d.ts +1 -1
  190. package/dist/resolve-auth-token.d.ts +1 -1
  191. package/dist/resume-bundles.js +3 -2
  192. package/dist/retrieval-agents.d.ts +2 -2
  193. package/dist/retrieval-tiers.d.ts +1 -1
  194. package/dist/routing/engine.d.ts +1 -1
  195. package/dist/routing/store.d.ts +1 -1
  196. package/dist/schemas.d.ts +2 -2
  197. package/dist/search/embed-helper.d.ts +1 -1
  198. package/dist/search/factory.d.ts +1 -1
  199. package/dist/search/index.d.ts +1 -1
  200. package/dist/search/lancedb-backend.d.ts +1 -1
  201. package/dist/search/meilisearch-backend.d.ts +1 -1
  202. package/dist/search/noop-backend.d.ts +1 -1
  203. package/dist/search/orama-backend.d.ts +1 -1
  204. package/dist/search/port.d.ts +1 -1
  205. package/dist/search/remote-backend.d.ts +1 -1
  206. package/dist/{semantic-consolidation-BTShF2Fo.d.ts → semantic-consolidation-ClfD_CWg.d.ts} +1 -1
  207. package/dist/semantic-consolidation.d.ts +2 -2
  208. package/dist/semantic-consolidation.js +4 -4
  209. package/dist/semantic-rule-promotion.js +3 -3
  210. package/dist/semantic-rule-verifier.d.ts +1 -1
  211. package/dist/semantic-rule-verifier.js +3 -3
  212. package/dist/session-observer-bands.d.ts +1 -1
  213. package/dist/session-observer-state.d.ts +1 -1
  214. package/dist/shared-context/manager.d.ts +3 -3
  215. package/dist/signal.d.ts +1 -1
  216. package/dist/{storage-DxPDAiU9.d.ts → storage-ZrHZ0dSM.d.ts} +1 -1
  217. package/dist/storage.d.ts +2 -2
  218. package/dist/storage.js +2 -2
  219. package/dist/summarizer.d.ts +1 -1
  220. package/dist/summary-snapshot.d.ts +1 -1
  221. package/dist/temporal-supersession.d.ts +2 -2
  222. package/dist/temporal-timeline-recall.d.ts +1 -1
  223. package/dist/temporal-validity.d.ts +1 -1
  224. package/dist/threading.d.ts +1 -1
  225. package/dist/tier-migration.d.ts +2 -2
  226. package/dist/tier-routing.d.ts +1 -1
  227. package/dist/topics.d.ts +1 -1
  228. package/dist/transcript.d.ts +1 -1
  229. package/dist/transfer/types.d.ts +10 -10
  230. package/dist/trust-score-stage.d.ts +1 -1
  231. package/dist/trust-score.d.ts +1 -1
  232. package/dist/{types-DDUDgd7T.d.ts → types-BbtQZBq9.d.ts} +33 -1
  233. package/dist/types.d.ts +1 -1
  234. package/dist/types.js +1 -1
  235. package/dist/utility-runtime.d.ts +1 -1
  236. package/dist/verified-recall.js +3 -3
  237. package/package.json +2 -2
  238. package/src/coding/codegraph-runtime.ts +539 -1
  239. package/src/coding/codegraph-surfaces.test.ts +75 -0
  240. package/src/coding/codegraph-surfaces.ts +34 -0
  241. package/src/coding/coding-knowledge-config.ts +100 -2
  242. package/src/types.ts +30 -0
  243. package/dist/chunk-3AC5UYKI.js.map +0 -1
  244. package/dist/chunk-OXVKR5OU.js.map +0 -1
  245. /package/dist/{chunk-B4LPRAWL.js.map → chunk-2V6L3L56.js.map} +0 -0
  246. /package/dist/{chunk-AXALUFAH.js.map → chunk-3BZDBG7U.js.map} +0 -0
  247. /package/dist/{chunk-JODHPNLN.js.map → chunk-5ELELET5.js.map} +0 -0
  248. /package/dist/{chunk-DQ42IQSK.js.map → chunk-5SORASJK.js.map} +0 -0
  249. /package/dist/{chunk-DAAJUA6Q.js.map → chunk-6MWGGPJJ.js.map} +0 -0
  250. /package/dist/{chunk-2K3OSLHE.js.map → chunk-7TEWOG3R.js.map} +0 -0
  251. /package/dist/{chunk-23G3T2Q5.js.map → chunk-7XY6TJLM.js.map} +0 -0
  252. /package/dist/{chunk-W2AHSCKY.js.map → chunk-AZK3NEHL.js.map} +0 -0
  253. /package/dist/{chunk-7ZYBDQ7V.js.map → chunk-CVEEJKRD.js.map} +0 -0
  254. /package/dist/{chunk-YQB32INI.js.map → chunk-EBVUFGJ4.js.map} +0 -0
  255. /package/dist/{chunk-4Q2XWAHZ.js.map → chunk-EDD2G35Z.js.map} +0 -0
  256. /package/dist/{chunk-CAZ3Z5M6.js.map → chunk-F7AE7L6G.js.map} +0 -0
  257. /package/dist/{chunk-B5GBWBCZ.js.map → chunk-GCTJG5MP.js.map} +0 -0
  258. /package/dist/{chunk-C6TKSI35.js.map → chunk-HVE3UVAB.js.map} +0 -0
  259. /package/dist/{chunk-SDAXPXER.js.map → chunk-IGCQHJSQ.js.map} +0 -0
  260. /package/dist/{chunk-MXAGJHTA.js.map → chunk-NREKOGZ2.js.map} +0 -0
  261. /package/dist/{chunk-H4FHR4UM.js.map → chunk-PQG2AOL4.js.map} +0 -0
  262. /package/dist/{chunk-WSOEYOHN.js.map → chunk-PWSZNML3.js.map} +0 -0
  263. /package/dist/{chunk-VJRJTRYF.js.map → chunk-RVLE2SNP.js.map} +0 -0
  264. /package/dist/{chunk-KVSVVKHA.js.map → chunk-U5JP7FCM.js.map} +0 -0
  265. /package/dist/{chunk-GQURC4B7.js.map → chunk-VTRF5QBX.js.map} +0 -0
  266. /package/dist/{chunk-FVTLSFWU.js.map → chunk-WHZ7MK72.js.map} +0 -0
  267. /package/dist/{chunk-PUQZIS6A.js.map → chunk-WX4XTAOI.js.map} +0 -0
  268. /package/dist/{chunk-VHJARF5R.js.map → chunk-XH2Y6UIW.js.map} +0 -0
  269. /package/dist/{chunk-GQGDRLDM.js.map → chunk-YAN6NTJN.js.map} +0 -0
  270. /package/dist/{chunk-DEKIXXIG.js.map → chunk-ZIKJD6NL.js.map} +0 -0
  271. /package/dist/{chunk-KJIJNLXT.js.map → chunk-ZMXXHUEZ.js.map} +0 -0
  272. /package/dist/{chunk-O6YI4CVI.js.map → chunk-ZSDRGPMV.js.map} +0 -0
@@ -18,7 +18,7 @@ import {
18
18
  } from "./chunk-T4WDJPEZ.js";
19
19
  import {
20
20
  getOperation
21
- } from "./chunk-GQURC4B7.js";
21
+ } from "./chunk-VTRF5QBX.js";
22
22
  import {
23
23
  assertOperationAllowed,
24
24
  capabilityAllowsOp,
@@ -27,7 +27,7 @@ import {
27
27
  } from "./chunk-D7FOKIY5.js";
28
28
  import {
29
29
  EngramAccessInputError
30
- } from "./chunk-OXVKR5OU.js";
30
+ } from "./chunk-RU73ZROD.js";
31
31
  import {
32
32
  readEnvVar
33
33
  } from "./chunk-JUC24CTX.js";
@@ -3771,4 +3771,4 @@ export {
3771
3771
  MCP_SUPPORTED_PROTOCOL_VERSIONS,
3772
3772
  EngramMcpServer
3773
3773
  };
3774
- //# sourceMappingURL=chunk-MXAGJHTA.js.map
3774
+ //# sourceMappingURL=chunk-NREKOGZ2.js.map
@@ -37,7 +37,7 @@ import {
37
37
  import {
38
38
  SPECULATIVE_TTL_DAYS,
39
39
  confidenceTier
40
- } from "./chunk-3AC5UYKI.js";
40
+ } from "./chunk-METJNEIB.js";
41
41
  import {
42
42
  markProjectedMemoryPathInvalid,
43
43
  readProjectedGovernanceRecord,
@@ -7207,4 +7207,4 @@ export {
7207
7207
  isValidBufferSurpriseEvent,
7208
7208
  StorageManager3 as StorageManager
7209
7209
  };
7210
- //# sourceMappingURL=chunk-H4FHR4UM.js.map
7210
+ //# sourceMappingURL=chunk-PQG2AOL4.js.map
@@ -10,7 +10,7 @@ import {
10
10
  } from "./chunk-BRDJ2HFP.js";
11
11
  import {
12
12
  MaintenanceScheduler
13
- } from "./chunk-JODHPNLN.js";
13
+ } from "./chunk-5ELELET5.js";
14
14
  import {
15
15
  runPeerProfileReasoner
16
16
  } from "./chunk-I74SUMNI.js";
@@ -26,7 +26,7 @@ import {
26
26
  import {
27
27
  CompoundingEngine,
28
28
  defaultTierMigrationCycleBudget
29
- } from "./chunk-B5GBWBCZ.js";
29
+ } from "./chunk-GCTJG5MP.js";
30
30
  import {
31
31
  SharedContextManager
32
32
  } from "./chunk-UI4FVU6T.js";
@@ -202,7 +202,7 @@ import {
202
202
  buildEntityRecallSection,
203
203
  entityRecentTranscriptLookbackHours,
204
204
  readRecentEntityTranscriptEntries
205
- } from "./chunk-FVTLSFWU.js";
205
+ } from "./chunk-WHZ7MK72.js";
206
206
  import {
207
207
  normalizeReplaySessionKey
208
208
  } from "./chunk-AJVLDJU6.js";
@@ -212,14 +212,14 @@ import {
212
212
  import {
213
213
  compareVerifiedEpisodeResults,
214
214
  searchVerifiedEpisodes
215
- } from "./chunk-2K3OSLHE.js";
215
+ } from "./chunk-7TEWOG3R.js";
216
216
  import {
217
217
  ThreadingManager
218
218
  } from "./chunk-DBRYEIGY.js";
219
219
  import {
220
220
  compareVerifiedSemanticRuleResults,
221
221
  searchVerifiedSemanticRules
222
- } from "./chunk-DEKIXXIG.js";
222
+ } from "./chunk-ZIKJD6NL.js";
223
223
  import {
224
224
  searchWorkProductLedgerEntries
225
225
  } from "./chunk-ZRWB5D4H.js";
@@ -232,14 +232,14 @@ import {
232
232
  import {
233
233
  runNamespaceMaintenanceFanout,
234
234
  summarizeNamespaceMaintenanceHealth
235
- } from "./chunk-B4LPRAWL.js";
235
+ } from "./chunk-2V6L3L56.js";
236
236
  import {
237
237
  NamespaceCatalog,
238
238
  planNamespaceMaintenance
239
- } from "./chunk-VHJARF5R.js";
239
+ } from "./chunk-XH2Y6UIW.js";
240
240
  import {
241
241
  NamespaceStorageRouter
242
- } from "./chunk-23G3T2Q5.js";
242
+ } from "./chunk-7XY6TJLM.js";
243
243
  import {
244
244
  searchHarmonicRetrieval
245
245
  } from "./chunk-AV5ZEH4M.js";
@@ -274,7 +274,7 @@ import {
274
274
  materializeAfterSemanticConsolidation,
275
275
  parseConsolidationResponse,
276
276
  parseOperatorAwareConsolidationResponse
277
- } from "./chunk-AXALUFAH.js";
277
+ } from "./chunk-3BZDBG7U.js";
278
278
  import {
279
279
  buildRecallQueryPolicy
280
280
  } from "./chunk-LBJBNWS2.js";
@@ -323,7 +323,7 @@ import {
323
323
  createCorrectionService,
324
324
  detectPassiveCorrections,
325
325
  qmdCollectionPathParts
326
- } from "./chunk-OXVKR5OU.js";
326
+ } from "./chunk-RU73ZROD.js";
327
327
  import {
328
328
  importCapsule
329
329
  } from "./chunk-M5QKGHCR.js";
@@ -339,7 +339,7 @@ import {
339
339
  } from "./chunk-FF4KLI5W.js";
340
340
  import {
341
341
  buildXraySnapshot
342
- } from "./chunk-W2AHSCKY.js";
342
+ } from "./chunk-AZK3NEHL.js";
343
343
  import {
344
344
  objectiveStateStoreOverrideForNamespace,
345
345
  searchObjectiveStateSnapshots
@@ -394,7 +394,7 @@ import {
394
394
  } from "./chunk-TBBDFYXW.js";
395
395
  import {
396
396
  buildChainFollowupGenerator
397
- } from "./chunk-7ZYBDQ7V.js";
397
+ } from "./chunk-CVEEJKRD.js";
398
398
  import {
399
399
  ContentHashIndex,
400
400
  StorageManager,
@@ -409,7 +409,7 @@ import {
409
409
  reconstructFusionInputs,
410
410
  selfDeps,
411
411
  serializeFusionDay
412
- } from "./chunk-H4FHR4UM.js";
412
+ } from "./chunk-PQG2AOL4.js";
413
413
  import {
414
414
  bodyIsEscaped,
415
415
  decodeTranscriptBody,
@@ -446,7 +446,7 @@ import {
446
446
  } from "./chunk-SVOZFLIQ.js";
447
447
  import {
448
448
  confidenceTier
449
- } from "./chunk-3AC5UYKI.js";
449
+ } from "./chunk-METJNEIB.js";
450
450
  import {
451
451
  buildQmdRecallCacheKey,
452
452
  getCachedQmdRecall,
@@ -23092,4 +23092,4 @@ export {
23092
23092
  blendGraphExpandedRecallScore,
23093
23093
  Orchestrator
23094
23094
  };
23095
- //# sourceMappingURL=chunk-WSOEYOHN.js.map
23095
+ //# sourceMappingURL=chunk-PWSZNML3.js.map
@@ -31,10 +31,10 @@ import {
31
31
  } from "./chunk-BT7NVCML.js";
32
32
  import {
33
33
  toRecallExplainJson
34
- } from "./chunk-DQ42IQSK.js";
34
+ } from "./chunk-5SORASJK.js";
35
35
  import {
36
36
  estimateRecallTokens
37
- } from "./chunk-W2AHSCKY.js";
37
+ } from "./chunk-AZK3NEHL.js";
38
38
  import {
39
39
  decideDisclosureEscalation
40
40
  } from "./chunk-H7XKCNR6.js";
@@ -70,7 +70,7 @@ import {
70
70
  listMemoryGovernanceRuns,
71
71
  readMemoryGovernanceRunArtifact,
72
72
  runMemoryGovernance
73
- } from "./chunk-O6YI4CVI.js";
73
+ } from "./chunk-ZSDRGPMV.js";
74
74
  import {
75
75
  recordMemoryOutcome
76
76
  } from "./chunk-EIR5VLIH.js";
@@ -111,11 +111,11 @@ import {
111
111
  enqueuePassiveCorrectionNotification,
112
112
  parseBriefingFocus,
113
113
  parseBriefingWindow
114
- } from "./chunk-7ZYBDQ7V.js";
114
+ } from "./chunk-CVEEJKRD.js";
115
115
  import {
116
116
  parseEntityFile,
117
117
  selfDeps
118
- } from "./chunk-H4FHR4UM.js";
118
+ } from "./chunk-PQG2AOL4.js";
119
119
  import {
120
120
  supersessionKeysForFact
121
121
  } from "./chunk-EHK6KZHK.js";
@@ -128,7 +128,7 @@ import {
128
128
  import {
129
129
  DEFAULT_RECALL_DISCLOSURE,
130
130
  isRecallDisclosure
131
- } from "./chunk-3AC5UYKI.js";
131
+ } from "./chunk-METJNEIB.js";
132
132
  import {
133
133
  getMemoryProjectionPath
134
134
  } from "./chunk-RHOZ5LLO.js";
@@ -1204,12 +1204,12 @@ async function findArchitectureCardMemory(storage) {
1204
1204
  });
1205
1205
  return cards[0] ?? null;
1206
1206
  }
1207
- function createArchitectureVersioningHook(enabled, maxVersionsPerPage, sidecarDir, memoryDir, readFile6, writeVersion) {
1207
+ function createArchitectureVersioningHook(enabled, maxVersionsPerPage, sidecarDir, memoryDir, readFile7, writeVersion) {
1208
1208
  return {
1209
1209
  async snapshotIfExists(memory) {
1210
1210
  if (!enabled) return;
1211
1211
  try {
1212
- const fullContent = await readFile6(memory.path);
1212
+ const fullContent = await readFile7(memory.path);
1213
1213
  await writeVersion(
1214
1214
  memory.path,
1215
1215
  fullContent,
@@ -1227,6 +1227,9 @@ function createArchitectureVersioningHook(enabled, maxVersionsPerPage, sidecarDi
1227
1227
 
1228
1228
  // src/coding/codegraph-runtime.ts
1229
1229
  import path2 from "path";
1230
+ import { readFile as readFile2, realpath } from "fs/promises";
1231
+ import { readFileSync, realpathSync } from "fs";
1232
+ import { pathToFileURL } from "url";
1230
1233
  import { createHash } from "crypto";
1231
1234
  var CODEGRAPH_SPECIFIER = "@remnic/coding-graph";
1232
1235
  function codegraphSurfaceVisible(config) {
@@ -1394,7 +1397,8 @@ function makeCodegraphRuntimeDelegates() {
1394
1397
  runReindex: (store, repoRoot, mode) => runCodegraphReindex({ store, repoRoot, mode }),
1395
1398
  reportIndexStatus: (store, repoRoot) => reportCodegraphIndexStatus({ store, repoRoot }),
1396
1399
  detectChanges: (store, repoRoot, head) => detectCodegraphChanges({ store, repoRoot, head }),
1397
- ingestTraces: (store, traces) => ingestCodegraphTraces({ store, traces })
1400
+ ingestTraces: (store, traces) => ingestCodegraphTraces({ store, traces }),
1401
+ runLspResolution: (store, repoRoot, lspConfig) => runCodegraphLspResolution({ store, repoRoot, lspConfig })
1398
1402
  };
1399
1403
  }
1400
1404
  async function runCodegraphReindex(params) {
@@ -1445,6 +1449,316 @@ async function runCodegraphReindex(params) {
1445
1449
  return { ok: false, code: "store_error", message: msg };
1446
1450
  }
1447
1451
  }
1452
+ async function lspPathEscapesRoot(repoRoot, absPath) {
1453
+ try {
1454
+ const [realRoot, realAbs] = await Promise.all([realpath(repoRoot), realpath(absPath)]);
1455
+ const rel = path2.relative(realRoot, realAbs);
1456
+ return rel === ".." || rel.startsWith(".." + path2.sep) || path2.isAbsolute(rel);
1457
+ } catch {
1458
+ return false;
1459
+ }
1460
+ }
1461
+ function lspPathEscapesRootSync(repoRoot, absPath) {
1462
+ try {
1463
+ const realRoot = realpathSync(repoRoot);
1464
+ const realAbs = realpathSync(absPath);
1465
+ const rel = path2.relative(realRoot, realAbs);
1466
+ return rel === ".." || rel.startsWith(".." + path2.sep) || path2.isAbsolute(rel);
1467
+ } catch {
1468
+ return false;
1469
+ }
1470
+ }
1471
+ var DEFAULT_LSP_SERVERS = {
1472
+ typescript: { command: "typescript-language-server", args: ["--stdio"] },
1473
+ tsx: { command: "typescript-language-server", args: ["--stdio"] },
1474
+ javascript: { command: "typescript-language-server", args: ["--stdio"] },
1475
+ python: { command: "pyright-langserver", args: ["--stdio"] },
1476
+ go: { command: "gopls", args: [] },
1477
+ rust: { command: "rust-analyzer", args: [] }
1478
+ };
1479
+ async function runCodegraphLspResolution(params) {
1480
+ const mod = await loadCodegraphModule();
1481
+ if (mod === null) {
1482
+ return { ok: false, code: "package_missing", message: "@remnic/coding-graph is not installed." };
1483
+ }
1484
+ if (typeof mod.executeLspResolution !== "function" || typeof mod.planLspUpgrades !== "function" || typeof mod.LspClient?.connect !== "function") {
1485
+ return { ok: false, code: "runtime_unavailable", message: "LSP resolution is not available in the installed @remnic/coding-graph." };
1486
+ }
1487
+ const engine = mod.createCodingGraphEngine?.() ?? null;
1488
+ if (engine === null) {
1489
+ return { ok: false, code: "engine_unavailable", message: "createCodingGraphEngine is not available." };
1490
+ }
1491
+ const repoRoot = path2.resolve(params.repoRoot);
1492
+ const gitFactory = mod.defaultCodingGitInvoker;
1493
+ if (typeof gitFactory !== "function") {
1494
+ return { ok: true, upgraded: 0, unresolved: 0, budgetExhausted: 0 };
1495
+ }
1496
+ const tracked = gitFactory().listTrackedFiles(repoRoot);
1497
+ if (!("paths" in tracked)) {
1498
+ return { ok: true, upgraded: 0, unresolved: 0, budgetExhausted: 0 };
1499
+ }
1500
+ const resolvedCalleesBySrc = /* @__PURE__ */ new Map();
1501
+ const alreadyResolved = (filePath, srcQualifiedName, calleeName) => {
1502
+ const key = `${filePath}\0${srcQualifiedName}`;
1503
+ let names = resolvedCalleesBySrc.get(key);
1504
+ if (names === void 0) {
1505
+ names = /* @__PURE__ */ new Set();
1506
+ if (typeof params.store.resolvedCalleeNames === "function") {
1507
+ for (const name of params.store.resolvedCalleeNames(srcQualifiedName, "heuristic", filePath)) {
1508
+ names.add(name);
1509
+ }
1510
+ }
1511
+ resolvedCalleesBySrc.set(key, names);
1512
+ }
1513
+ return names.has(calleeName);
1514
+ };
1515
+ const sites = [];
1516
+ const gatheredCountByFile = /* @__PURE__ */ new Map();
1517
+ const filteredCountByFile = /* @__PURE__ */ new Map();
1518
+ const filteredSrcByFile = /* @__PURE__ */ new Map();
1519
+ const parsedFiles = /* @__PURE__ */ new Set();
1520
+ for (const rel of tracked.paths) {
1521
+ const absPath = path2.join(repoRoot, rel);
1522
+ if (await lspPathEscapesRoot(repoRoot, absPath)) continue;
1523
+ let content;
1524
+ try {
1525
+ content = await readFile2(absPath, "utf-8");
1526
+ } catch {
1527
+ continue;
1528
+ }
1529
+ let parsed;
1530
+ try {
1531
+ parsed = await engine.parseFile({ path: rel, content });
1532
+ } catch {
1533
+ continue;
1534
+ }
1535
+ if (!parsed || typeof parsed !== "object" || !("ok" in parsed) || parsed.ok !== true || !("ir" in parsed)) continue;
1536
+ const ir = parsed.ir;
1537
+ if (!ir || typeof ir !== "object" || !("callSites" in ir) || !Array.isArray(ir.callSites)) continue;
1538
+ parsedFiles.add(rel);
1539
+ const language = "language" in ir && typeof ir.language === "string" ? ir.language : "";
1540
+ const symbols = "symbols" in ir && Array.isArray(ir.symbols) ? ir.symbols : [];
1541
+ const contentBytes = Buffer.from(content, "utf-8");
1542
+ for (const site of ir.callSites) {
1543
+ if (!site || typeof site !== "object" || !("span" in site)) continue;
1544
+ const span = site.span;
1545
+ if (!span || typeof span !== "object" || !("startByte" in span) || typeof span.startByte !== "number") continue;
1546
+ const calleeName = "calleeNameCandidates" in site && Array.isArray(site.calleeNameCandidates) && typeof site.calleeNameCandidates[0] === "string" ? site.calleeNameCandidates[0] : "";
1547
+ if (calleeName.length === 0) continue;
1548
+ let srcQualifiedName = "";
1549
+ let bestSpanSize = Number.POSITIVE_INFINITY;
1550
+ for (const sym of symbols) {
1551
+ if (!sym || typeof sym !== "object" || !("span" in sym) || !("qualifiedName" in sym)) continue;
1552
+ const ss = sym.span;
1553
+ if (!ss || typeof ss !== "object" || !("startByte" in ss) || !("endByte" in ss)) continue;
1554
+ if (typeof ss.startByte !== "number" || typeof ss.endByte !== "number") continue;
1555
+ if (ss.startByte <= span.startByte && span.startByte < ss.endByte) {
1556
+ const size = ss.endByte - ss.startByte;
1557
+ if (size < bestSpanSize) {
1558
+ bestSpanSize = size;
1559
+ srcQualifiedName = typeof sym.qualifiedName === "string" ? sym.qualifiedName : "";
1560
+ }
1561
+ }
1562
+ }
1563
+ if (srcQualifiedName.length === 0) continue;
1564
+ const memberAccess = "memberAccess" in site && site.memberAccess === true;
1565
+ if (!memberAccess && alreadyResolved(rel, srcQualifiedName, calleeName)) {
1566
+ filteredCountByFile.set(rel, (filteredCountByFile.get(rel) ?? 0) + 1);
1567
+ let srcs = filteredSrcByFile.get(rel);
1568
+ if (srcs === void 0) {
1569
+ srcs = /* @__PURE__ */ new Map();
1570
+ filteredSrcByFile.set(rel, srcs);
1571
+ }
1572
+ const callees = srcs.get(srcQualifiedName);
1573
+ if (callees === void 0) srcs.set(srcQualifiedName, /* @__PURE__ */ new Set([calleeName]));
1574
+ else callees.add(calleeName);
1575
+ continue;
1576
+ }
1577
+ const nameIdx = contentBytes.indexOf(Buffer.from(calleeName, "utf-8"), span.startByte);
1578
+ const endByte = "endByte" in span && typeof span.endByte === "number" ? span.endByte : span.startByte + calleeName.length;
1579
+ const calleeByteOffset = nameIdx >= 0 && nameIdx < endByte ? nameIdx : span.startByte;
1580
+ sites.push({ filePath: rel, language, content, calleeByteOffset, calleeName, srcQualifiedName });
1581
+ gatheredCountByFile.set(rel, (gatheredCountByFile.get(rel) ?? 0) + 1);
1582
+ }
1583
+ }
1584
+ const canPreserve = typeof params.store.callEdgesForCaller === "function";
1585
+ const preservedEdgesForFile = (rel) => {
1586
+ const srcs = filteredSrcByFile.get(rel);
1587
+ if (srcs === void 0 || !canPreserve) return [];
1588
+ const preserved = [];
1589
+ for (const [src] of srcs) {
1590
+ const heuristicDsts = new Set(
1591
+ params.store.callEdgesForCaller(src, rel, "heuristic").map((e) => e.dstQualifiedName)
1592
+ );
1593
+ for (const edge of params.store.callEdgesForCaller(src, rel, "lsp")) {
1594
+ if (!heuristicDsts.has(edge.dstQualifiedName)) continue;
1595
+ preserved.push({
1596
+ srcQualifiedName: edge.srcQualifiedName,
1597
+ dstQualifiedName: edge.dstQualifiedName,
1598
+ type: edge.type
1599
+ });
1600
+ }
1601
+ }
1602
+ return preserved;
1603
+ };
1604
+ if (typeof params.store.reconcileLspEdges === "function") {
1605
+ for (const rel of parsedFiles) {
1606
+ if ((gatheredCountByFile.get(rel) ?? 0) !== 0) continue;
1607
+ const filteredCount = filteredCountByFile.get(rel) ?? 0;
1608
+ if (filteredCount > 0 && !canPreserve) continue;
1609
+ params.store.reconcileLspEdges(rel, preservedEdgesForFile(rel));
1610
+ }
1611
+ }
1612
+ if (sites.length === 0) {
1613
+ return { ok: true, upgraded: 0, unresolved: 0, budgetExhausted: 0 };
1614
+ }
1615
+ const byLanguage = /* @__PURE__ */ new Map();
1616
+ const srcToFiles = /* @__PURE__ */ new Map();
1617
+ for (const site of sites) {
1618
+ const group = byLanguage.get(site.language);
1619
+ if (group === void 0) byLanguage.set(site.language, [site]);
1620
+ else group.push(site);
1621
+ const files = srcToFiles.get(site.srcQualifiedName);
1622
+ if (files === void 0) srcToFiles.set(site.srcQualifiedName, /* @__PURE__ */ new Set([site.filePath]));
1623
+ else files.add(site.filePath);
1624
+ }
1625
+ const configServers = params.lspConfig.servers ?? {};
1626
+ const timeoutMs = params.lspConfig.timeoutMs ?? 3e3;
1627
+ let remainingBudget = Math.max(1, Math.floor(params.lspConfig.maxRequestsPerRun ?? 500));
1628
+ const rootUri = pathToFileURL(repoRoot).href;
1629
+ const resolveContent = (filePath) => {
1630
+ const absPath = path2.join(repoRoot, filePath);
1631
+ if (lspPathEscapesRootSync(repoRoot, absPath)) return null;
1632
+ try {
1633
+ return readFileSync(absPath, "utf-8");
1634
+ } catch {
1635
+ return null;
1636
+ }
1637
+ };
1638
+ let upgraded = 0;
1639
+ let unresolved = 0;
1640
+ let budgetExhausted = 0;
1641
+ const degradations = [];
1642
+ for (const [language, group] of byLanguage) {
1643
+ if (remainingBudget <= 0) {
1644
+ budgetExhausted += group.length;
1645
+ continue;
1646
+ }
1647
+ const rawSpec = configServers[language] ?? DEFAULT_LSP_SERVERS[language];
1648
+ if (rawSpec === void 0) {
1649
+ degradations.push({
1650
+ language,
1651
+ code: "no_launch_spec",
1652
+ message: `No LSP server configured for ${language} (${group.length} candidate call site(s)); set codingKnowledge.lsp.servers.${language}.`
1653
+ });
1654
+ unresolved += group.length;
1655
+ continue;
1656
+ }
1657
+ const launchSpec = { command: rawSpec.command, args: rawSpec.args ?? [] };
1658
+ const plan = mod.planLspUpgrades(group, { maxRequests: remainingBudget });
1659
+ budgetExhausted += plan.budgetExhausted;
1660
+ remainingBudget -= plan.requests.length;
1661
+ if (plan.requests.length === 0) continue;
1662
+ const plannedCountByFile = /* @__PURE__ */ new Map();
1663
+ for (const req of plan.requests) {
1664
+ if (req && typeof req === "object" && "filePath" in req && typeof req.filePath === "string") {
1665
+ plannedCountByFile.set(req.filePath, (plannedCountByFile.get(req.filePath) ?? 0) + 1);
1666
+ }
1667
+ }
1668
+ const connected = await mod.LspClient.connect({ launchSpec, rootUri, timeoutMs });
1669
+ if (!connected.ok) {
1670
+ const deg = connected.degradation;
1671
+ const code = deg && typeof deg === "object" && "code" in deg && typeof deg.code === "string" ? deg.code : "connect_failed";
1672
+ const message = deg && typeof deg === "object" && "detail" in deg && typeof deg.detail === "string" ? deg.detail : `LSP server for ${language} failed to connect.`;
1673
+ degradations.push({ language, code, message });
1674
+ unresolved += plan.requests.length;
1675
+ remainingBudget += plan.requests.length;
1676
+ continue;
1677
+ }
1678
+ const client = connected.client;
1679
+ let skippedEdgesTotal = 0;
1680
+ const skippedFiles = /* @__PURE__ */ new Set();
1681
+ try {
1682
+ const result = await mod.executeLspResolution(plan.requests, {
1683
+ client,
1684
+ workspaceRoot: repoRoot,
1685
+ resolveContent,
1686
+ nodeLocator: (filePath, byteOffset) => typeof params.store.findNodeBySpan === "function" ? params.store.findNodeBySpan(filePath, byteOffset) : null,
1687
+ applyUpgrades: async (upgrades) => {
1688
+ if (typeof params.store.upsertEdges !== "function") {
1689
+ throw new Error("store.upsertEdges is not available");
1690
+ }
1691
+ const result2 = await params.store.upsertEdges(upgrades);
1692
+ if (!result2.ok) {
1693
+ degradations.push({
1694
+ language,
1695
+ code: "edge_write_failed",
1696
+ message: `upsertEdges failed for ${language}: ${result2.code}.`
1697
+ });
1698
+ throw new Error(`upsertEdges failed: ${result2.code}`);
1699
+ }
1700
+ if (result2.skipped > 0) {
1701
+ skippedEdgesTotal += result2.skipped;
1702
+ for (const upgrade of upgrades) {
1703
+ for (const file of srcToFiles.get(upgrade.srcQualifiedName) ?? []) {
1704
+ skippedFiles.add(file);
1705
+ }
1706
+ }
1707
+ degradations.push({
1708
+ language,
1709
+ code: "edges_skipped",
1710
+ message: `upsertEdges persisted ${result2.persisted} and skipped ${result2.skipped} edge(s) for ${language} (unresolvable endpoints).`
1711
+ });
1712
+ }
1713
+ },
1714
+ reconcileLspEdges: (filePath, assertedEdges) => {
1715
+ if (typeof params.store.reconcileLspEdges !== "function") return;
1716
+ if (plannedCountByFile.get(filePath) !== gatheredCountByFile.get(filePath)) return;
1717
+ if (skippedFiles.has(filePath)) return;
1718
+ if ((filteredCountByFile.get(filePath) ?? 0) > 0 && !canPreserve) return;
1719
+ params.store.reconcileLspEdges(filePath, [...assertedEdges, ...preservedEdgesForFile(filePath)]);
1720
+ }
1721
+ });
1722
+ if (result && typeof result === "object" && "upgraded" in result && typeof result.upgraded === "number") {
1723
+ upgraded += Math.max(0, result.upgraded - skippedEdgesTotal);
1724
+ unresolved += "unresolved" in result && typeof result.unresolved === "number" ? result.unresolved : 0;
1725
+ budgetExhausted += "budgetExhausted" in result && typeof result.budgetExhausted === "number" ? result.budgetExhausted : 0;
1726
+ if ("degradation" in result && result.degradation && typeof result.degradation === "object") {
1727
+ const rd = result.degradation;
1728
+ degradations.push({
1729
+ language,
1730
+ code: "code" in rd && typeof rd.code === "string" ? rd.code : "lsp_degraded",
1731
+ message: "detail" in rd && typeof rd.detail === "string" ? rd.detail : `LSP pass for ${language} degraded mid-run.`
1732
+ });
1733
+ }
1734
+ } else {
1735
+ unresolved += plan.requests.length;
1736
+ }
1737
+ } catch (err) {
1738
+ const detail = displayErrorDetail(err);
1739
+ return {
1740
+ ok: false,
1741
+ code: "lsp_resolution_error",
1742
+ message: detail.length > 0 ? `LSP resolution failed: ${detail}.` : "LSP resolution failed."
1743
+ };
1744
+ } finally {
1745
+ const disposable = client;
1746
+ if (typeof disposable.dispose === "function") {
1747
+ try {
1748
+ await disposable.dispose();
1749
+ } catch {
1750
+ }
1751
+ }
1752
+ }
1753
+ }
1754
+ return {
1755
+ ok: true,
1756
+ upgraded,
1757
+ unresolved,
1758
+ budgetExhausted,
1759
+ ...degradations.length > 0 ? { degradations } : {}
1760
+ };
1761
+ }
1448
1762
  async function reportCodegraphIndexStatus(params) {
1449
1763
  const mod = await loadCodegraphModule();
1450
1764
  if (mod === null) {
@@ -1786,6 +2100,17 @@ async function handleIndex(request, ctx) {
1786
2100
  if (!outcome.ok) {
1787
2101
  return { tool: request.tool, ok: false, code: outcome.code, message: outcome.message };
1788
2102
  }
2103
+ let lspUpgradeSummary;
2104
+ const lspConfig = ctx.config.codingKnowledge.lsp;
2105
+ if (lspConfig?.enabled === true && ctx.runLspResolution) {
2106
+ const lspResult = await ctx.runLspResolution(store, repoRoot, lspConfig);
2107
+ lspUpgradeSummary = lspResult.ok ? {
2108
+ upgraded: lspResult.upgraded ?? 0,
2109
+ unresolved: lspResult.unresolved ?? 0,
2110
+ budgetExhausted: lspResult.budgetExhausted ?? 0,
2111
+ ...lspResult.degradations !== void 0 && lspResult.degradations.length > 0 ? { degradations: lspResult.degradations } : {}
2112
+ } : { error: lspResult.code ?? "lsp_error", message: lspResult.message ?? "" };
2113
+ }
1789
2114
  const stats = store.schemaStats();
1790
2115
  return {
1791
2116
  tool: request.tool,
@@ -1795,7 +2120,8 @@ async function handleIndex(request, ctx) {
1795
2120
  mode: outcome.mode,
1796
2121
  filesIngested: outcome.filesIngested,
1797
2122
  head: outcome.head,
1798
- stats
2123
+ stats,
2124
+ ...lspUpgradeSummary ? { lsp: lspUpgradeSummary } : {}
1799
2125
  }
1800
2126
  };
1801
2127
  }
@@ -1943,7 +2269,7 @@ function isLikelyCypher(input) {
1943
2269
  }
1944
2270
 
1945
2271
  // src/coding/session-delta.ts
1946
- import { readFile as readFile2, writeFile, mkdir, rename } from "fs/promises";
2272
+ import { readFile as readFile3, writeFile, mkdir, rename } from "fs/promises";
1947
2273
  import path3 from "path";
1948
2274
  var MAX_DELTA_COMMITS = 20;
1949
2275
  var MAX_DELTA_FILES = 50;
@@ -2009,7 +2335,7 @@ function sessionDeltaStatePath(memoryDir, namespace) {
2009
2335
  }
2010
2336
  async function readLastSeenState(statePath) {
2011
2337
  try {
2012
- const raw = await readFile2(statePath, "utf8");
2338
+ const raw = await readFile3(statePath, "utf8");
2013
2339
  const parsed = JSON.parse(raw);
2014
2340
  if (typeof parsed !== "object" || parsed === null) return null;
2015
2341
  const obj = parsed;
@@ -2423,7 +2749,7 @@ var CorrectionContractError = class extends Error {
2423
2749
  };
2424
2750
 
2425
2751
  // src/correction/correction-planner.ts
2426
- import { mkdir as mkdir2, readFile as readFile3, rename as rename2, unlink, readdir as readdir2, writeFile as writeFile2 } from "fs/promises";
2752
+ import { mkdir as mkdir2, readFile as readFile4, rename as rename2, unlink, readdir as readdir2, writeFile as writeFile2 } from "fs/promises";
2427
2753
  import path4 from "path";
2428
2754
  var REDACTED_REQUEST_TEXT = "[redacted \u2014 never-store/redaction correction text withheld from the pending-plan file]";
2429
2755
  var CorrectionPlanner = class _CorrectionPlanner {
@@ -2627,7 +2953,7 @@ var CorrectionPlanner = class _CorrectionPlanner {
2627
2953
  return serializeMutations(`correction-plan:${file}`, async () => {
2628
2954
  let raw;
2629
2955
  try {
2630
- raw = await readFile3(file, "utf-8");
2956
+ raw = await readFile4(file, "utf-8");
2631
2957
  } catch (err) {
2632
2958
  const code = err?.code;
2633
2959
  if (code === "ENOENT") return null;
@@ -2667,7 +2993,7 @@ var CorrectionPlanner = class _CorrectionPlanner {
2667
2993
  await serializeMutations(`correction-plan:${file}`, async () => {
2668
2994
  let raw;
2669
2995
  try {
2670
- raw = await readFile3(file, "utf-8");
2996
+ raw = await readFile4(file, "utf-8");
2671
2997
  } catch (err) {
2672
2998
  const code = err?.code;
2673
2999
  if (code === "ENOENT") return;
@@ -10924,4 +11250,4 @@ export {
10924
11250
  EngramAccessService,
10925
11251
  AccessAdminOpsSurface
10926
11252
  };
10927
- //# sourceMappingURL=chunk-OXVKR5OU.js.map
11253
+ //# sourceMappingURL=chunk-RU73ZROD.js.map