@remnic/core 9.3.700 → 9.3.702

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 (323) hide show
  1. package/dist/access-boundary.d.ts +7 -7
  2. package/dist/access-boundary.js +17 -14
  3. package/dist/access-cli.js +40 -37
  4. package/dist/access-cli.js.map +1 -1
  5. package/dist/access-http.d.ts +7 -7
  6. package/dist/access-http.js +20 -17
  7. package/dist/access-mcp.d.ts +7 -7
  8. package/dist/access-mcp.js +19 -16
  9. package/dist/access-operations.d.ts +7 -7
  10. package/dist/access-operations.js +18 -15
  11. package/dist/{access-service-Cte3ol0W.d.ts → access-service-COCzhgEL.d.ts} +397 -19
  12. package/dist/access-service.d.ts +6 -6
  13. package/dist/access-service.js +16 -13
  14. package/dist/access-surface-catalog.d.ts +7 -7
  15. package/dist/action-confidence.d.ts +1 -1
  16. package/dist/active-memory-bridge.d.ts +1 -1
  17. package/dist/active-memory-bridge.js +2 -2
  18. package/dist/active-recall.d.ts +1 -1
  19. package/dist/active-recall.js +7 -6
  20. package/dist/active-recall.js.map +1 -1
  21. package/dist/behavior-learner.d.ts +1 -1
  22. package/dist/behavior-signals.d.ts +1 -1
  23. package/dist/bootstrap.d.ts +5 -5
  24. package/dist/briefing.d.ts +1 -1
  25. package/dist/briefing.js +8 -7
  26. package/dist/buffer-surprise-report.d.ts +1 -1
  27. package/dist/buffer.d.ts +1 -1
  28. package/dist/calibration.d.ts +1 -1
  29. package/dist/capabilities.d.ts +1 -1
  30. package/dist/{catalog-DN1PzThs.d.ts → catalog-DxCzhjE6.d.ts} +28 -54
  31. package/dist/causal-behavior.d.ts +1 -1
  32. package/dist/causal-consolidation.d.ts +1 -1
  33. package/dist/causal-consolidation.js +9 -8
  34. package/dist/causal-consolidation.js.map +1 -1
  35. package/dist/{chunk-XJNBEDFE.js → chunk-3FAMU5TX.js} +31 -74
  36. package/dist/chunk-3FAMU5TX.js.map +1 -0
  37. package/dist/{chunk-PCZR32VL.js → chunk-3JJWNZTT.js} +2 -2
  38. package/dist/{chunk-YXLT4EMM.js → chunk-4463LUIE.js} +12 -2
  39. package/dist/chunk-4463LUIE.js.map +1 -0
  40. package/dist/{chunk-R5DB26G6.js → chunk-4SBW47WK.js} +9 -23
  41. package/dist/chunk-4SBW47WK.js.map +1 -0
  42. package/dist/{chunk-CCOXIDRM.js → chunk-5VXVXJH6.js} +149 -6
  43. package/dist/{chunk-CCOXIDRM.js.map → chunk-5VXVXJH6.js.map} +1 -1
  44. package/dist/{chunk-PQG4T5V3.js → chunk-64XXOQRW.js} +49 -45
  45. package/dist/chunk-64XXOQRW.js.map +1 -0
  46. package/dist/{chunk-YXIFA36P.js → chunk-6TAETM63.js} +2 -2
  47. package/dist/{chunk-6JDGADXK.js → chunk-6VVP6NK7.js} +2 -2
  48. package/dist/{chunk-FN2SM5SN.js → chunk-ABCGDW3A.js} +75 -12
  49. package/dist/chunk-ABCGDW3A.js.map +1 -0
  50. package/dist/{chunk-CHM274U6.js → chunk-AMNLZ6SF.js} +2 -2
  51. package/dist/{chunk-JX3YZVII.js → chunk-CZJ6QSKG.js} +3 -3
  52. package/dist/{chunk-GYVVQYA3.js → chunk-EOOVJK2U.js} +3 -3
  53. package/dist/{chunk-JKW5XSWC.js → chunk-EYJD6KIO.js} +2 -2
  54. package/dist/{chunk-XY4WJTEX.js → chunk-EZR35XHX.js} +2 -2
  55. package/dist/{chunk-UU6MVCJ6.js → chunk-FIOYURII.js} +32 -25
  56. package/dist/chunk-FIOYURII.js.map +1 -0
  57. package/dist/{chunk-2NWHLAXX.js → chunk-FVI5B7DE.js} +2 -2
  58. package/dist/{chunk-X74FJSW7.js → chunk-GFIARMA7.js} +16 -8
  59. package/dist/chunk-GFIARMA7.js.map +1 -0
  60. package/dist/{chunk-PONNZ54D.js → chunk-GY3SKOS4.js} +4 -4
  61. package/dist/{chunk-U33LWTQQ.js → chunk-HV57RHMD.js} +4 -4
  62. package/dist/{chunk-RC3CNIPK.js → chunk-IO5NQEGZ.js} +2 -2
  63. package/dist/{chunk-IKNQAGBV.js → chunk-IX3UQT4H.js} +1 -1
  64. package/dist/{chunk-IKNQAGBV.js.map → chunk-IX3UQT4H.js.map} +1 -1
  65. package/dist/{chunk-HDLC75NX.js → chunk-IX72AAMZ.js} +2 -2
  66. package/dist/{chunk-DR2JTSLZ.js → chunk-JMA4RYRN.js} +62 -163
  67. package/dist/chunk-JMA4RYRN.js.map +1 -0
  68. package/dist/{chunk-G5PKTQ5J.js → chunk-JTKFZMZ7.js} +2 -2
  69. package/dist/{chunk-YMTGXDN6.js → chunk-KC6TCAWV.js} +5 -5
  70. package/dist/{chunk-ROZJACKP.js → chunk-KKK7YTYN.js} +4 -1
  71. package/dist/chunk-KKK7YTYN.js.map +1 -0
  72. package/dist/{chunk-EC2AYKRX.js → chunk-L6W77GWW.js} +10 -24
  73. package/dist/chunk-L6W77GWW.js.map +1 -0
  74. package/dist/{chunk-ED35D32I.js → chunk-LQ4J7ELC.js} +2 -2
  75. package/dist/{chunk-YPR7DOPD.js → chunk-LTJAMRGI.js} +4 -4
  76. package/dist/{chunk-YPR7DOPD.js.map → chunk-LTJAMRGI.js.map} +1 -1
  77. package/dist/chunk-LUPVCGYK.js +63 -0
  78. package/dist/chunk-LUPVCGYK.js.map +1 -0
  79. package/dist/{chunk-RJ2THZ4H.js → chunk-MBUM2Y3L.js} +2 -2
  80. package/dist/{chunk-T5QAZIBO.js → chunk-MOXFPLD6.js} +3 -3
  81. package/dist/{chunk-O54DY26V.js → chunk-MXEWQKM7.js} +2 -2
  82. package/dist/{chunk-33L6XHU2.js → chunk-NUIJEGVD.js} +6 -6
  83. package/dist/{chunk-3E5WRQNQ.js → chunk-OXEAMU42.js} +529 -9
  84. package/dist/chunk-OXEAMU42.js.map +1 -0
  85. package/dist/{chunk-EOBJRBLC.js → chunk-QGJAGC2J.js} +2 -2
  86. package/dist/{chunk-SMIVW7XC.js → chunk-QIMFOCSH.js} +2 -2
  87. package/dist/{chunk-IJEZMWKA.js → chunk-SFOAQQDJ.js} +3 -3
  88. package/dist/{chunk-HRUULBBV.js → chunk-SHRRWOVY.js} +81 -4
  89. package/dist/chunk-SHRRWOVY.js.map +1 -0
  90. package/dist/{chunk-NINRTFSV.js → chunk-SINGJCUR.js} +5 -5
  91. package/dist/{chunk-ZPQVJEVQ.js → chunk-SK2CR6MW.js} +146 -2
  92. package/dist/chunk-SK2CR6MW.js.map +1 -0
  93. package/dist/{chunk-SEWF2O74.js → chunk-TGAHHCB6.js} +2 -2
  94. package/dist/{chunk-D75JXBV4.js → chunk-WN4GHSDH.js} +2 -2
  95. package/dist/{chunk-K4DWSPMW.js → chunk-WRGPE6AW.js} +2 -2
  96. package/dist/{chunk-GA5A6MJH.js → chunk-XGMCUY5P.js} +62 -116
  97. package/dist/chunk-XGMCUY5P.js.map +1 -0
  98. package/dist/{chunk-SDPDU2PM.js → chunk-YTMDF6S7.js} +2 -2
  99. package/dist/{chunk-ZDK2IW5F.js → chunk-Z7XEIAV4.js} +2 -2
  100. package/dist/{chunk-NHBEO3F3.js → chunk-ZCEI242W.js} +24 -24
  101. package/dist/{cli--yVN9yEV.d.ts → cli-BM4xQPp4.d.ts} +3 -3
  102. package/dist/cli.d.ts +7 -7
  103. package/dist/cli.js +35 -34
  104. package/dist/compounding/engine.d.ts +1 -1
  105. package/dist/compounding/engine.js +8 -7
  106. package/dist/compounding/preference-consolidator.d.ts +1 -1
  107. package/dist/compression-optimizer.d.ts +1 -1
  108. package/dist/config.d.ts +1 -1
  109. package/dist/config.js +4 -2
  110. package/dist/connectors/codex-materialize-runner.d.ts +1 -1
  111. package/dist/connectors/codex-materialize-runner.js +8 -7
  112. package/dist/connectors/codex-materialize.d.ts +1 -1
  113. package/dist/connectors/index.d.ts +1 -1
  114. package/dist/connectors/index.js +9 -8
  115. package/dist/consolidation-provenance-check.d.ts +1 -1
  116. package/dist/consolidation-undo.d.ts +1 -1
  117. package/dist/contradiction/index.d.ts +2 -2
  118. package/dist/conversation-index/backend.d.ts +1 -1
  119. package/dist/conversation-index/chunker.d.ts +1 -1
  120. package/dist/conversation-index/faiss-adapter.d.ts +1 -1
  121. package/dist/conversation-index/indexer.d.ts +1 -1
  122. package/dist/conversation-index/search.d.ts +1 -1
  123. package/dist/day-summary.d.ts +1 -1
  124. package/dist/delinearize.d.ts +1 -1
  125. package/dist/direct-answer-wiring.d.ts +1 -1
  126. package/dist/direct-answer.d.ts +1 -1
  127. package/dist/embedding-fallback.d.ts +1 -1
  128. package/dist/enrichment/index.d.ts +1 -1
  129. package/dist/entity-retrieval.d.ts +1 -1
  130. package/dist/entity-retrieval.js +8 -7
  131. package/dist/entity-schema.d.ts +1 -1
  132. package/dist/event-order-recall.js +2 -1
  133. package/dist/explicit-capture.d.ts +5 -5
  134. package/dist/explicit-capture.js +2 -2
  135. package/dist/explicit-cue-recall.js +2 -1
  136. package/dist/extraction-faithfulness.d.ts +1 -1
  137. package/dist/extraction-judge-telemetry.d.ts +1 -1
  138. package/dist/extraction-judge-training.d.ts +1 -1
  139. package/dist/extraction-judge.d.ts +1 -1
  140. package/dist/extraction.d.ts +14 -1
  141. package/dist/extraction.js +5 -3
  142. package/dist/fallback-llm.d.ts +1 -1
  143. package/dist/{forget-BEXG5PQC.js → forget-6SOIPUMQ.js} +3 -3
  144. package/dist/identity-continuity.d.ts +1 -1
  145. package/dist/importance.d.ts +1 -1
  146. package/dist/index.d.ts +123 -123
  147. package/dist/index.js +57 -56
  148. package/dist/index.js.map +1 -1
  149. package/dist/intent.d.ts +1 -1
  150. package/dist/lcm/engine.d.ts +1 -1
  151. package/dist/lcm/index.d.ts +1 -1
  152. package/dist/lcm/tools.d.ts +1 -1
  153. package/dist/lifecycle.d.ts +1 -1
  154. package/dist/live-connectors-runner.d.ts +1 -1
  155. package/dist/local-llm.d.ts +1 -1
  156. package/dist/maintenance/memory-governance.d.ts +1 -1
  157. package/dist/maintenance/memory-governance.js +8 -7
  158. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +8 -7
  159. package/dist/maintenance/rebuild-memory-projection.js +9 -8
  160. package/dist/mcp-memory-inspector-app.d.ts +7 -7
  161. package/dist/memory-action-policy.d.ts +1 -1
  162. package/dist/memory-cache.d.ts +1 -1
  163. package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
  164. package/dist/memory-projection-store.d.ts +1 -1
  165. package/dist/memory-provenance.d.ts +1 -1
  166. package/dist/memory-worth-outcomes.d.ts +1 -1
  167. package/dist/models-json.d.ts +1 -1
  168. package/dist/namespaces/migrate.d.ts +2 -2
  169. package/dist/namespaces/migrate.js +9 -8
  170. package/dist/namespaces/principal.d.ts +1 -1
  171. package/dist/namespaces/search.d.ts +1 -1
  172. package/dist/namespaces/storage.d.ts +14 -3
  173. package/dist/namespaces/storage.js +8 -7
  174. package/dist/native-knowledge.d.ts +1 -1
  175. package/dist/operator-toolkit.d.ts +1 -1
  176. package/dist/operator-toolkit.js +14 -13
  177. package/dist/orchestration/maintenance.d.ts +2 -2
  178. package/dist/orchestration/maintenance.js +10 -9
  179. package/dist/{orchestrator-CJI4xdqV.d.ts → orchestrator-C9CDWAm6.d.ts} +4 -4
  180. package/dist/orchestrator.d.ts +5 -5
  181. package/dist/orchestrator.js +33 -31
  182. package/dist/patterns-cli.d.ts +1 -1
  183. package/dist/policy-runtime.d.ts +1 -1
  184. package/dist/provenance.d.ts +36 -2
  185. package/dist/provenance.js +5 -1
  186. package/dist/qmd-recall-cache.d.ts +1 -1
  187. package/dist/qmd.d.ts +1 -1
  188. package/dist/recall-disclosure-escalation.d.ts +1 -1
  189. package/dist/recall-explain-renderer.d.ts +1 -1
  190. package/dist/recall-explain-renderer.js +3 -3
  191. package/dist/recall-pipeline-stages.d.ts +15 -0
  192. package/dist/recall-pipeline-stages.js +3 -56
  193. package/dist/recall-pipeline-stages.js.map +1 -1
  194. package/dist/recall-planner-llm.d.ts +1 -1
  195. package/dist/recall-state.d.ts +1 -1
  196. package/dist/recall-tag-filter.d.ts +1 -1
  197. package/dist/recall-xray-cli.d.ts +1 -1
  198. package/dist/recall-xray-cli.js +4 -4
  199. package/dist/recall-xray-renderer.d.ts +1 -1
  200. package/dist/recall-xray-renderer.js +3 -3
  201. package/dist/recall-xray.d.ts +1 -1
  202. package/dist/recall-xray.js +2 -2
  203. package/dist/resolve-auth-token.d.ts +1 -1
  204. package/dist/response-guidance-recall.js +2 -1
  205. package/dist/resume-bundles.js +7 -5
  206. package/dist/retrieval-agents.d.ts +1 -1
  207. package/dist/retrieval-tiers.d.ts +1 -1
  208. package/dist/routing/engine.d.ts +1 -1
  209. package/dist/routing/store.d.ts +1 -1
  210. package/dist/schemas.d.ts +19 -0
  211. package/dist/schemas.js +1 -1
  212. package/dist/search/embed-helper.d.ts +1 -1
  213. package/dist/search/factory.d.ts +1 -1
  214. package/dist/search/index.d.ts +1 -1
  215. package/dist/search/lancedb-backend.d.ts +1 -1
  216. package/dist/search/meilisearch-backend.d.ts +1 -1
  217. package/dist/search/noop-backend.d.ts +1 -1
  218. package/dist/search/orama-backend.d.ts +1 -1
  219. package/dist/search/port.d.ts +1 -1
  220. package/dist/search/remote-backend.d.ts +1 -1
  221. package/dist/{semantic-DJR8_DMQ.d.ts → semantic-SLAa_prH.d.ts} +1 -1
  222. package/dist/{semantic-consolidation-BtUfv-AL.d.ts → semantic-consolidation-DgFXyALl.d.ts} +1 -1
  223. package/dist/semantic-consolidation.d.ts +2 -2
  224. package/dist/semantic-consolidation.js +9 -8
  225. package/dist/semantic-rule-promotion.js +8 -7
  226. package/dist/semantic-rule-verifier.d.ts +1 -1
  227. package/dist/semantic-rule-verifier.js +8 -7
  228. package/dist/session-observer-bands.d.ts +1 -1
  229. package/dist/session-observer-state.d.ts +1 -1
  230. package/dist/shared-context/manager.d.ts +1 -1
  231. package/dist/signal.d.ts +1 -1
  232. package/dist/storage.d.ts +13 -1
  233. package/dist/storage.js +7 -6
  234. package/dist/summarizer.d.ts +1 -1
  235. package/dist/summarizer.js +3 -2
  236. package/dist/summary-snapshot.d.ts +1 -1
  237. package/dist/summary-snapshot.js +2 -1
  238. package/dist/targeted-fact-recall.js +2 -1
  239. package/dist/temporal-supersession.d.ts +1 -1
  240. package/dist/temporal-validity.d.ts +1 -1
  241. package/dist/threading.d.ts +1 -1
  242. package/dist/tier-migration.d.ts +1 -1
  243. package/dist/tier-routing.d.ts +1 -1
  244. package/dist/topics.d.ts +1 -1
  245. package/dist/transcript.d.ts +1 -1
  246. package/dist/transcript.js +2 -2
  247. package/dist/{types-PuiPZ9iE.d.ts → types-MWKPZnM0.d.ts} +25 -1
  248. package/dist/types.d.ts +1 -1
  249. package/dist/types.js +1 -1
  250. package/dist/utility-runtime.d.ts +1 -1
  251. package/dist/utils/serialize-mutations.js +1 -1
  252. package/dist/verified-recall.js +8 -7
  253. package/package.json +2 -2
  254. package/src/access-http.ts +162 -0
  255. package/src/access-service.ts +215 -0
  256. package/src/admin/admin-surfaces.test.ts +458 -0
  257. package/src/admin/admin-surfaces.ts +819 -0
  258. package/src/event-order-recall.test.ts +53 -0
  259. package/src/event-order-recall.ts +61 -37
  260. package/src/explicit-cue-recall.ts +21 -1
  261. package/src/extraction.ts +91 -6
  262. package/src/namespaces/catalog.test.ts +222 -14
  263. package/src/namespaces/catalog.ts +54 -187
  264. package/src/namespaces/storage.ts +87 -80
  265. package/src/orchestrator.ts +46 -5
  266. package/src/provenance-extraction.test.ts +838 -0
  267. package/src/provenance.ts +413 -0
  268. package/src/recall-pipeline-parity.test.ts +288 -0
  269. package/src/recall-pipeline-stages.test.ts +43 -0
  270. package/src/recall-pipeline-stages.ts +22 -0
  271. package/src/response-guidance-recall.ts +32 -36
  272. package/src/schemas.ts +7 -0
  273. package/src/storage.ts +23 -0
  274. package/src/summary-snapshot.test.ts +63 -1
  275. package/src/summary-snapshot.ts +61 -80
  276. package/src/targeted-fact-recall.ts +25 -32
  277. package/src/types.ts +24 -0
  278. package/src/utils/serialize-mutations.ts +10 -6
  279. package/dist/chunk-3E5WRQNQ.js.map +0 -1
  280. package/dist/chunk-DR2JTSLZ.js.map +0 -1
  281. package/dist/chunk-EC2AYKRX.js.map +0 -1
  282. package/dist/chunk-FN2SM5SN.js.map +0 -1
  283. package/dist/chunk-GA5A6MJH.js.map +0 -1
  284. package/dist/chunk-HRUULBBV.js.map +0 -1
  285. package/dist/chunk-PQG4T5V3.js.map +0 -1
  286. package/dist/chunk-R5DB26G6.js.map +0 -1
  287. package/dist/chunk-ROZJACKP.js.map +0 -1
  288. package/dist/chunk-UU6MVCJ6.js.map +0 -1
  289. package/dist/chunk-X74FJSW7.js.map +0 -1
  290. package/dist/chunk-XJNBEDFE.js.map +0 -1
  291. package/dist/chunk-YXLT4EMM.js.map +0 -1
  292. package/dist/chunk-ZPQVJEVQ.js.map +0 -1
  293. /package/dist/{chunk-PCZR32VL.js.map → chunk-3JJWNZTT.js.map} +0 -0
  294. /package/dist/{chunk-YXIFA36P.js.map → chunk-6TAETM63.js.map} +0 -0
  295. /package/dist/{chunk-6JDGADXK.js.map → chunk-6VVP6NK7.js.map} +0 -0
  296. /package/dist/{chunk-CHM274U6.js.map → chunk-AMNLZ6SF.js.map} +0 -0
  297. /package/dist/{chunk-JX3YZVII.js.map → chunk-CZJ6QSKG.js.map} +0 -0
  298. /package/dist/{chunk-GYVVQYA3.js.map → chunk-EOOVJK2U.js.map} +0 -0
  299. /package/dist/{chunk-JKW5XSWC.js.map → chunk-EYJD6KIO.js.map} +0 -0
  300. /package/dist/{chunk-XY4WJTEX.js.map → chunk-EZR35XHX.js.map} +0 -0
  301. /package/dist/{chunk-2NWHLAXX.js.map → chunk-FVI5B7DE.js.map} +0 -0
  302. /package/dist/{chunk-PONNZ54D.js.map → chunk-GY3SKOS4.js.map} +0 -0
  303. /package/dist/{chunk-U33LWTQQ.js.map → chunk-HV57RHMD.js.map} +0 -0
  304. /package/dist/{chunk-RC3CNIPK.js.map → chunk-IO5NQEGZ.js.map} +0 -0
  305. /package/dist/{chunk-HDLC75NX.js.map → chunk-IX72AAMZ.js.map} +0 -0
  306. /package/dist/{chunk-G5PKTQ5J.js.map → chunk-JTKFZMZ7.js.map} +0 -0
  307. /package/dist/{chunk-YMTGXDN6.js.map → chunk-KC6TCAWV.js.map} +0 -0
  308. /package/dist/{chunk-ED35D32I.js.map → chunk-LQ4J7ELC.js.map} +0 -0
  309. /package/dist/{chunk-RJ2THZ4H.js.map → chunk-MBUM2Y3L.js.map} +0 -0
  310. /package/dist/{chunk-T5QAZIBO.js.map → chunk-MOXFPLD6.js.map} +0 -0
  311. /package/dist/{chunk-O54DY26V.js.map → chunk-MXEWQKM7.js.map} +0 -0
  312. /package/dist/{chunk-33L6XHU2.js.map → chunk-NUIJEGVD.js.map} +0 -0
  313. /package/dist/{chunk-EOBJRBLC.js.map → chunk-QGJAGC2J.js.map} +0 -0
  314. /package/dist/{chunk-SMIVW7XC.js.map → chunk-QIMFOCSH.js.map} +0 -0
  315. /package/dist/{chunk-IJEZMWKA.js.map → chunk-SFOAQQDJ.js.map} +0 -0
  316. /package/dist/{chunk-NINRTFSV.js.map → chunk-SINGJCUR.js.map} +0 -0
  317. /package/dist/{chunk-SEWF2O74.js.map → chunk-TGAHHCB6.js.map} +0 -0
  318. /package/dist/{chunk-D75JXBV4.js.map → chunk-WN4GHSDH.js.map} +0 -0
  319. /package/dist/{chunk-K4DWSPMW.js.map → chunk-WRGPE6AW.js.map} +0 -0
  320. /package/dist/{chunk-SDPDU2PM.js.map → chunk-YTMDF6S7.js.map} +0 -0
  321. /package/dist/{chunk-ZDK2IW5F.js.map → chunk-Z7XEIAV4.js.map} +0 -0
  322. /package/dist/{chunk-NHBEO3F3.js.map → chunk-ZCEI242W.js.map} +0 -0
  323. /package/dist/{forget-BEXG5PQC.js.map → forget-6SOIPUMQ.js.map} +0 -0
@@ -9,9 +9,12 @@ import {
9
9
  import {
10
10
  importCapsule
11
11
  } from "./chunk-DL6H3D7S.js";
12
+ import {
13
+ planSessionTranscriptMigration
14
+ } from "./chunk-IQ7WCZRW.js";
12
15
  import {
13
16
  toRecallExplainJson
14
- } from "./chunk-D75JXBV4.js";
17
+ } from "./chunk-WN4GHSDH.js";
15
18
  import {
16
19
  applyTagFilter,
17
20
  normalizeTags,
@@ -29,9 +32,10 @@ import {
29
32
  projectTagProjectId,
30
33
  resolveCodingNamespaceOverlay,
31
34
  resolveGitContext,
35
+ resolveScopePlan,
32
36
  resolveScopeProfilePlan,
33
37
  sanitizeFragment
34
- } from "./chunk-HRUULBBV.js";
38
+ } from "./chunk-SHRRWOVY.js";
35
39
  import {
36
40
  getTrustZoneStoreStatus,
37
41
  isTrustZoneName,
@@ -46,7 +50,7 @@ import {
46
50
  } from "./chunk-FF4KLI5W.js";
47
51
  import {
48
52
  estimateRecallTokens
49
- } from "./chunk-SDPDU2PM.js";
53
+ } from "./chunk-YTMDF6S7.js";
50
54
  import {
51
55
  recordObjectiveStateSnapshotsFromObservedMessages
52
56
  } from "./chunk-BMFZLLNI.js";
@@ -60,7 +64,7 @@ import {
60
64
  listMemoryGovernanceRuns,
61
65
  readMemoryGovernanceRunArtifact,
62
66
  runMemoryGovernance
63
- } from "./chunk-RJ2THZ4H.js";
67
+ } from "./chunk-MBUM2Y3L.js";
64
68
  import {
65
69
  namespaceCollectionName
66
70
  } from "./chunk-VPAFWWCL.js";
@@ -83,7 +87,7 @@ import {
83
87
  persistExplicitCapture,
84
88
  queueExplicitCaptureForReview,
85
89
  validateExplicitCaptureInput
86
- } from "./chunk-U33LWTQQ.js";
90
+ } from "./chunk-HV57RHMD.js";
87
91
  import {
88
92
  buildProcedurePersistBody,
89
93
  normalizeProcedureSteps
@@ -103,17 +107,17 @@ import {
103
107
  buildBriefing,
104
108
  parseBriefingFocus,
105
109
  parseBriefingWindow
106
- } from "./chunk-6JDGADXK.js";
110
+ } from "./chunk-6VVP6NK7.js";
107
111
  import {
108
112
  parseEntityFile
109
- } from "./chunk-X74FJSW7.js";
113
+ } from "./chunk-GFIARMA7.js";
110
114
  import {
111
115
  stripAttributesSuffix
112
116
  } from "./chunk-SVOZFLIQ.js";
113
117
  import {
114
118
  DEFAULT_RECALL_DISCLOSURE,
115
119
  isRecallDisclosure
116
- } from "./chunk-IKNQAGBV.js";
120
+ } from "./chunk-IX3UQT4H.js";
117
121
  import {
118
122
  normalizeProjectionPreview,
119
123
  normalizeProjectionTags
@@ -2420,6 +2424,365 @@ function formatProcedureStatsText(report) {
2420
2424
  return lines.join("\n") + "\n";
2421
2425
  }
2422
2426
 
2427
+ // src/admin/admin-surfaces.ts
2428
+ import path5 from "path";
2429
+ var REDACTED = "<redacted>";
2430
+ var SENSITIVE_KEY_RE = /(token|secret|password|api[_-]?key|bearer|authorization|credential|private[_-]?key)/i;
2431
+ var BEARER_VALUE_RE = /^(bearer|sk-|pk-|xox[bp]-|AKIA)/i;
2432
+ var LONG_OPAQUE_RE = /^[A-Za-z0-9_\-]{32,}$/;
2433
+ var SAFE_DIAGNOSTIC_KEYS = /* @__PURE__ */ new Set(["identityToken"]);
2434
+ function redactSensitive(value) {
2435
+ return walkRedact(value, void 0);
2436
+ }
2437
+ function walkRedact(value, key) {
2438
+ if (typeof value === "string") {
2439
+ if (key && SENSITIVE_KEY_RE.test(key) && !SAFE_DIAGNOSTIC_KEYS.has(key)) {
2440
+ return REDACTED;
2441
+ }
2442
+ if (BEARER_VALUE_RE.test(value)) return REDACTED;
2443
+ if (!(key && SAFE_DIAGNOSTIC_KEYS.has(key)) && LONG_OPAQUE_RE.test(value) && value.length >= 40 && !/^[0-9a-f]{16}$/.test(value)) {
2444
+ return REDACTED;
2445
+ }
2446
+ return value;
2447
+ }
2448
+ if (Array.isArray(value)) {
2449
+ return value.map((entry) => walkRedact(entry, void 0));
2450
+ }
2451
+ if (value && typeof value === "object") {
2452
+ const record = value;
2453
+ const out = {};
2454
+ for (const [k, v] of Object.entries(record)) {
2455
+ out[k] = walkRedact(v, k);
2456
+ }
2457
+ return out;
2458
+ }
2459
+ return value;
2460
+ }
2461
+ function inspectScope(options) {
2462
+ const { config } = options;
2463
+ const namespacesEnabled = options.namespacesEnabled ?? config.namespacesEnabled === true;
2464
+ const plan = resolveScopePlan({
2465
+ config,
2466
+ sessionKey: options.sessionKey,
2467
+ namespace: options.namespace,
2468
+ principalOverride: options.principalOverride,
2469
+ codingContext: options.codingContext ?? null,
2470
+ namespacesEnabled
2471
+ });
2472
+ const warnings = [];
2473
+ if (namespacesEnabled && !plan.principal) {
2474
+ warnings.push("namespace routing is enabled but no principal resolved for this session key");
2475
+ }
2476
+ if (config.codingMode?.projectScope && namespacesEnabled && options.codingContext && !plan.codingOverlay) {
2477
+ warnings.push("coding project scope is enabled but the overlay was suppressed by an explicit namespace override");
2478
+ }
2479
+ if (options.namespace && options.namespace.trim().length > 0 && !plan.namespaceOverride) {
2480
+ warnings.push(
2481
+ `requested namespace override '${options.namespace}' is not readable by this principal and was ignored`
2482
+ );
2483
+ }
2484
+ const layers = [];
2485
+ const scopeProfilePlan = plan.scopeProfilePlan;
2486
+ if (scopeProfilePlan) {
2487
+ for (const layer of scopeProfilePlan.layers) {
2488
+ layers.push({
2489
+ id: layer.id,
2490
+ namespace: layer.namespace,
2491
+ readable: layer.readable,
2492
+ writable: layer.writable,
2493
+ promotable: layer.promotable,
2494
+ reason: layer.reason
2495
+ });
2496
+ }
2497
+ for (const target of scopeProfilePlan.promotionTargets) {
2498
+ if (!layers.some((layer) => layer.id === target.target)) {
2499
+ layers.push({
2500
+ id: target.target,
2501
+ namespace: target.namespace,
2502
+ readable: false,
2503
+ writable: false,
2504
+ promotable: target.authorized,
2505
+ reason: target.reason
2506
+ });
2507
+ }
2508
+ }
2509
+ } else {
2510
+ layers.push({
2511
+ id: "self",
2512
+ namespace: plan.baseNamespace,
2513
+ readable: canReadNamespace(plan.principal, plan.baseNamespace, config),
2514
+ writable: canWriteNamespace(plan.principal, plan.baseNamespace, config),
2515
+ promotable: false,
2516
+ reason: "principal self namespace (no scope profile active)"
2517
+ });
2518
+ }
2519
+ if (plan.codingOverlay) {
2520
+ layers.push({
2521
+ id: "coding",
2522
+ namespace: plan.codingOverlay.namespace,
2523
+ readable: true,
2524
+ writable: true,
2525
+ promotable: false,
2526
+ reason: "coding overlay namespace combined with the principal base (rule 42)"
2527
+ });
2528
+ }
2529
+ if (plan.namespaceOverride) {
2530
+ layers.push({
2531
+ id: "explicit",
2532
+ namespace: plan.namespaceOverride,
2533
+ readable: true,
2534
+ writable: canWriteNamespace(plan.principal, plan.namespaceOverride, config),
2535
+ promotable: false,
2536
+ reason: "explicit namespace override authorized for this principal"
2537
+ });
2538
+ }
2539
+ const promotionTargets = scopeProfilePlan ? scopeProfilePlan.promotionTargets.map((target) => ({
2540
+ target: target.target,
2541
+ namespace: target.namespace,
2542
+ authorized: target.authorized,
2543
+ reason: target.reason
2544
+ })) : [];
2545
+ for (const warning of scopeProfilePlan?.warnings ?? []) {
2546
+ warnings.push(warning);
2547
+ }
2548
+ return {
2549
+ principal: plan.principal,
2550
+ namespaceOverride: plan.namespaceOverride,
2551
+ writeNamespace: plan.baseNamespace,
2552
+ readNamespaces: [...plan.readNamespaces],
2553
+ codingOverlay: plan.codingOverlay ? {
2554
+ namespace: plan.codingOverlay.namespace,
2555
+ readFallbacks: plan.codingOverlay.readFallbacks
2556
+ } : null,
2557
+ scopeProfileId: scopeProfilePlan?.profileId ?? null,
2558
+ layers,
2559
+ promotionTargets,
2560
+ warnings,
2561
+ plan
2562
+ };
2563
+ }
2564
+ async function listAdminNamespaces(options) {
2565
+ const { catalog, filter } = options;
2566
+ if (!catalog.enabled) {
2567
+ return { enabled: false, entries: [] };
2568
+ }
2569
+ const staleMs = (options.staleThresholdDays ?? 30) * 24 * 60 * 60 * 1e3;
2570
+ const staleBefore = new Date(Date.now() - staleMs);
2571
+ const records = await catalog.listNamespaces({
2572
+ kind: filter?.kind,
2573
+ discoveredBy: filter?.discoveredBy,
2574
+ writtenSince: filter?.writtenSince
2575
+ });
2576
+ let entries = records.map((record) => toAdminEntry(record, staleBefore));
2577
+ if (filter?.principal) {
2578
+ entries = entries.filter((entry) => entry.principal === filter.principal);
2579
+ }
2580
+ if (filter?.projectId) {
2581
+ entries = entries.filter((entry) => entry.projectId === filter.projectId);
2582
+ }
2583
+ if (filter?.staleBefore) {
2584
+ const cutoff = filter.staleBefore.getTime();
2585
+ entries = entries.filter((entry) => {
2586
+ if (!entry.lastWriteAt) return true;
2587
+ const ms = Date.parse(entry.lastWriteAt);
2588
+ return Number.isFinite(ms) && ms <= cutoff;
2589
+ });
2590
+ }
2591
+ return { enabled: true, entries };
2592
+ }
2593
+ function toAdminEntry(record, staleBefore) {
2594
+ const lastWriteMs = record.lastWriteAt ? Date.parse(record.lastWriteAt) : Number.NaN;
2595
+ const stale = !Number.isFinite(lastWriteMs) || lastWriteMs < staleBefore.getTime();
2596
+ return {
2597
+ namespace: record.namespace,
2598
+ identityToken: record.identityToken,
2599
+ kind: record.kind,
2600
+ principal: record.principal,
2601
+ projectId: record.projectId,
2602
+ branch: record.branch,
2603
+ parentNamespace: record.parentNamespace,
2604
+ createdAt: record.createdAt,
2605
+ lastReadAt: record.lastReadAt,
2606
+ lastWriteAt: record.lastWriteAt,
2607
+ lastMaintenanceAt: record.lastMaintenanceAt,
2608
+ storageDir: record.storageDir,
2609
+ discoveredBy: record.discoveredBy,
2610
+ stale
2611
+ };
2612
+ }
2613
+ async function gatherMaintenanceHealth(options) {
2614
+ const { catalog, qmdHealthProvider } = options;
2615
+ if (!catalog.enabled) {
2616
+ return { enabled: false, degradedMode: false, perNamespace: [] };
2617
+ }
2618
+ const records = await catalog.listNamespaces();
2619
+ let degradedMode = false;
2620
+ const perNamespace = await Promise.all(
2621
+ records.map(async (record) => {
2622
+ const entry = {
2623
+ namespace: record.namespace,
2624
+ kind: record.kind,
2625
+ lastMaintenanceAt: record.lastMaintenanceAt,
2626
+ maintenanceMissing: !record.lastMaintenanceAt || Object.keys(record.lastMaintenanceAt).length === 0,
2627
+ qmdDegraded: false
2628
+ };
2629
+ if (qmdHealthProvider) {
2630
+ try {
2631
+ const qmd = await qmdHealthProvider(record.namespace);
2632
+ if (qmd) {
2633
+ entry.qmd = qmd;
2634
+ entry.qmdDegraded = !qmd.available || qmd.collectionState === "missing" || qmd.collectionState === "unknown";
2635
+ }
2636
+ } catch (err) {
2637
+ entry.qmdDegraded = true;
2638
+ entry.qmdError = "QMD health probe failed";
2639
+ }
2640
+ }
2641
+ if (entry.qmdDegraded) degradedMode = true;
2642
+ return entry;
2643
+ })
2644
+ );
2645
+ return { enabled: true, degradedMode, perNamespace };
2646
+ }
2647
+ async function auditTranscripts(memoryDir) {
2648
+ const plan = await planSessionTranscriptMigration({
2649
+ memoryDir,
2650
+ apply: false
2651
+ });
2652
+ const files = plan.files.map((file) => ({
2653
+ sourceRelPath: file.sourceRelPath,
2654
+ fileName: file.fileName,
2655
+ distinctSessions: file.groups.length,
2656
+ movedEntries: file.groups.reduce((sum, group) => sum + group.entryCount, 0),
2657
+ unmovableLines: file.unmovableLines
2658
+ }));
2659
+ const mixedOtherDefault = files.some((file) => file.sourceRelPath.split(path5.sep).includes("other"));
2660
+ const summary = plan.movedEntries === 0 ? "No mixed-session transcript data detected; nothing to migrate." : `Found ${plan.movedEntries} entries across ${plan.distinctSessions} distinct sessions stranded in shared/legacy directories. Run the CLI migration command to re-home them.`;
2661
+ return {
2662
+ generatedAt: plan.generatedAt,
2663
+ dryRun: true,
2664
+ transcriptsDir: plan.transcriptsDir,
2665
+ mixedOtherDefault,
2666
+ distinctSessions: plan.distinctSessions,
2667
+ movedEntries: plan.movedEntries,
2668
+ files,
2669
+ summary
2670
+ };
2671
+ }
2672
+ var AdminPromotionError = class extends Error {
2673
+ code;
2674
+ constructor(code, message) {
2675
+ super(message);
2676
+ this.name = "AdminPromotionError";
2677
+ this.code = code;
2678
+ }
2679
+ };
2680
+ async function promoteMemory(options) {
2681
+ const reason = options.reason.trim();
2682
+ if (reason.length === 0) {
2683
+ throw new AdminPromotionError("reason_required", "promotion requires a non-empty reason");
2684
+ }
2685
+ if (options.targets.length === 0) {
2686
+ throw new AdminPromotionError("targets_required", "promotion requires at least one target");
2687
+ }
2688
+ const { config, principal, scopeProfilePlan } = options;
2689
+ const resolvedTargets = options.targets.map((requested) => {
2690
+ if (requested.kind === "explicit") {
2691
+ const namespace = requested.namespace?.trim();
2692
+ if (!namespace) {
2693
+ return {
2694
+ target: requested.kind,
2695
+ namespace: "",
2696
+ authorized: false,
2697
+ promoted: false,
2698
+ reason: "explicit promotion requires a namespace"
2699
+ };
2700
+ }
2701
+ const authorized = canWriteNamespace(principal, namespace, config);
2702
+ return {
2703
+ target: requested.kind,
2704
+ namespace,
2705
+ authorized,
2706
+ promoted: false,
2707
+ reason: authorized ? "explicit namespace writable by this principal" : "explicit namespace is not writable by this principal"
2708
+ };
2709
+ }
2710
+ const layer = scopeProfilePlan?.promotionTargets.find((t) => t.target === requested.kind);
2711
+ if (!layer) {
2712
+ return {
2713
+ target: requested.kind,
2714
+ namespace: "",
2715
+ authorized: false,
2716
+ promoted: false,
2717
+ reason: `promotion target '${requested.kind}' is not configured on the active scope profile`
2718
+ };
2719
+ }
2720
+ return {
2721
+ target: requested.kind,
2722
+ namespace: layer.namespace ?? "",
2723
+ authorized: layer.authorized && Boolean(layer.namespace),
2724
+ promoted: false,
2725
+ reason: layer.reason
2726
+ };
2727
+ });
2728
+ const sourceMemory = await options.storage.readMemory(options.sourceNamespace, options.sourceMemoryId);
2729
+ if (!sourceMemory) {
2730
+ throw new AdminPromotionError(
2731
+ "source_not_found",
2732
+ `source memory ${options.sourceMemoryId} not found in namespace ${options.sourceNamespace}`
2733
+ );
2734
+ }
2735
+ const auditTargets = [];
2736
+ for (const target of resolvedTargets) {
2737
+ if (!target.authorized || !target.namespace) {
2738
+ auditTargets.push({ target: target.target, namespace: target.namespace, promoted: false });
2739
+ continue;
2740
+ }
2741
+ if (target.namespace === options.sourceNamespace) {
2742
+ target.reason = "target namespace equals source namespace; nothing to promote";
2743
+ auditTargets.push({ target: target.target, namespace: target.namespace, promoted: false });
2744
+ continue;
2745
+ }
2746
+ try {
2747
+ const promotedId = await options.storage.writePromotedMemory(target.namespace, {
2748
+ category: sourceMemory.category,
2749
+ content: sourceMemory.content,
2750
+ confidence: sourceMemory.frontmatter.confidence ?? 0.5,
2751
+ tags: [...sourceMemory.frontmatter.tags ?? [], `admin-promotion-${target.target}`],
2752
+ entityRef: sourceMemory.frontmatter.entityRef,
2753
+ sourceMemoryId: options.sourceMemoryId,
2754
+ sourceNamespace: options.sourceNamespace,
2755
+ reason,
2756
+ actor: options.actor,
2757
+ validAt: sourceMemory.frontmatter.valid_at,
2758
+ lineage: [options.sourceMemoryId]
2759
+ });
2760
+ target.promoted = true;
2761
+ target.promotedMemoryId = promotedId;
2762
+ auditTargets.push({ target: target.target, namespace: target.namespace, promoted: true });
2763
+ } catch (err) {
2764
+ target.reason = "promotion write failed";
2765
+ auditTargets.push({ target: target.target, namespace: target.namespace, promoted: false });
2766
+ }
2767
+ }
2768
+ const at = (/* @__PURE__ */ new Date()).toISOString();
2769
+ const audit = {
2770
+ at,
2771
+ actor: options.actor,
2772
+ sourceMemoryId: options.sourceMemoryId,
2773
+ sourceNamespace: options.sourceNamespace,
2774
+ reason,
2775
+ targets: auditTargets
2776
+ };
2777
+ return {
2778
+ ok: resolvedTargets.some((t) => t.promoted),
2779
+ sourceMemoryId: options.sourceMemoryId,
2780
+ sourceNamespace: options.sourceNamespace,
2781
+ targets: resolvedTargets,
2782
+ audit
2783
+ };
2784
+ }
2785
+
2423
2786
  // src/access-service.ts
2424
2787
  import * as nodePath from "path";
2425
2788
  var EngramAccessInputError = class extends Error {
@@ -7730,6 +8093,163 @@ ${next}`);
7730
8093
  limit: request.limit
7731
8094
  });
7732
8095
  }
8096
+ // ── Admin console surfaces (issue #1502) ────────────────────────────────
8097
+ //
8098
+ // Thin delegators. Every method threads `this.orchestrator` references
8099
+ // into the pure `admin/admin-surfaces.ts` functions so the dashboard
8100
+ // never re-resolves scope, re-derives promotion targets, or re-lists
8101
+ // namespaces.
8102
+ /**
8103
+ * Resolve an effective scope inspection for the console. Inputs are
8104
+ * redacted before return so an operator-supplied principal preview /
8105
+ * namespace override never echoes a pasted credential back.
8106
+ */
8107
+ async adminInspectScope(options) {
8108
+ const config = this.orchestrator.config;
8109
+ const codingContext = options.sessionKey ? this.orchestrator.getCodingContextForSession(options.sessionKey) ?? null : null;
8110
+ const inspection = inspectScope({
8111
+ config,
8112
+ sessionKey: options.sessionKey,
8113
+ namespace: options.namespace,
8114
+ principalOverride: options.principalOverride,
8115
+ codingContext,
8116
+ operation: options.operation
8117
+ });
8118
+ return redactSensitive(inspection);
8119
+ }
8120
+ /**
8121
+ * List configured + discovered namespaces from the catalog with the
8122
+ * admin filters the console exposes.
8123
+ */
8124
+ async adminListNamespaces(filter) {
8125
+ const result = await listAdminNamespaces({
8126
+ catalog: this.orchestrator.namespaceCatalog,
8127
+ filter
8128
+ });
8129
+ return redactSensitive(result);
8130
+ }
8131
+ /**
8132
+ * Per-namespace maintenance + QMD health. QMD diagnostics are probed via
8133
+ * the orchestrator's search health accessor (one probe per namespace).
8134
+ */
8135
+ async adminMaintenanceHealth() {
8136
+ const report = await gatherMaintenanceHealth({
8137
+ catalog: this.orchestrator.namespaceCatalog,
8138
+ qmdHealthProvider: async (namespace) => {
8139
+ try {
8140
+ const health = await this.orchestrator.searchHealthForNamespace(namespace);
8141
+ return {
8142
+ namespace,
8143
+ collection: health.collection,
8144
+ available: health.available,
8145
+ collectionState: health.collectionState,
8146
+ debugStatus: health.debugStatus,
8147
+ installedVersion: health.installedVersion,
8148
+ supportedVersion: health.supportedVersion,
8149
+ supported: health.supported,
8150
+ upgradeAvailable: health.upgradeAvailable,
8151
+ daemonMode: health.daemonMode
8152
+ };
8153
+ } catch (err) {
8154
+ throw err;
8155
+ }
8156
+ }
8157
+ });
8158
+ return redactSensitive(report);
8159
+ }
8160
+ /**
8161
+ * Dry-run transcript/session audit. Detects mixed `other/default` data
8162
+ * and legacy stranded directories. Never applies a migration.
8163
+ */
8164
+ async adminTranscriptAudit() {
8165
+ const result = await auditTranscripts(this.orchestrator.config.memoryDir);
8166
+ return redactSensitive(result);
8167
+ }
8168
+ /**
8169
+ * Manually promote a memory into one or more authorized targets. Requires
8170
+ * a non-empty reason (audit-logged). Reuses the scope-profile promotion
8171
+ * resolution and `canWriteNamespace` gate — there is no dashboard-only
8172
+ * write path.
8173
+ */
8174
+ async adminPromoteMemory(request) {
8175
+ const config = this.orchestrator.config;
8176
+ const namespacesEnabled = config.namespacesEnabled === true;
8177
+ let sourceNamespace;
8178
+ if (request.namespace) {
8179
+ sourceNamespace = this.resolveReadableNamespace(
8180
+ request.namespace,
8181
+ request.principal
8182
+ );
8183
+ } else {
8184
+ const codingContext2 = request.sessionKey ? this.orchestrator.getCodingContextForSession(request.sessionKey) ?? null : null;
8185
+ const plan = resolveScopePlan({
8186
+ config,
8187
+ sessionKey: request.sessionKey,
8188
+ principalOverride: request.principal,
8189
+ codingContext: codingContext2,
8190
+ namespacesEnabled
8191
+ });
8192
+ sourceNamespace = this.resolveReadableNamespace(
8193
+ plan.baseNamespace,
8194
+ request.principal
8195
+ );
8196
+ }
8197
+ const codingContext = request.sessionKey ? this.orchestrator.getCodingContextForSession(request.sessionKey) ?? null : null;
8198
+ const codingOverlay = codingContext ? resolveCodingNamespaceOverlay(
8199
+ codingContext,
8200
+ config.codingMode,
8201
+ config.defaultNamespace
8202
+ ) : null;
8203
+ const scopeProfilePlan = resolveScopeProfilePlan({
8204
+ config,
8205
+ principal: request.principal,
8206
+ codingContext,
8207
+ codingOverlay
8208
+ });
8209
+ const storage = {
8210
+ readMemory: async (namespace, memoryId) => {
8211
+ const resolved = await this.orchestrator.getStorage(namespace);
8212
+ const memory = await resolved.getMemoryById(memoryId);
8213
+ if (!memory) return null;
8214
+ return {
8215
+ category: memory.frontmatter.category,
8216
+ content: memory.content,
8217
+ frontmatter: memory.frontmatter
8218
+ };
8219
+ },
8220
+ writePromotedMemory: async (namespace, memory) => {
8221
+ const resolved = await this.orchestrator.getStorage(namespace);
8222
+ return resolved.writeMemory(memory.category, memory.content, {
8223
+ confidence: memory.confidence,
8224
+ tags: memory.tags,
8225
+ entityRef: memory.entityRef,
8226
+ source: `admin-promotion:${memory.sourceNamespace}:${memory.reason.slice(0, 120)}`,
8227
+ lineage: memory.lineage,
8228
+ sourceMemoryId: memory.sourceMemoryId,
8229
+ actor: memory.actor,
8230
+ validAt: memory.validAt
8231
+ });
8232
+ }
8233
+ };
8234
+ try {
8235
+ return await promoteMemory({
8236
+ config,
8237
+ sourceMemoryId: request.sourceMemoryId,
8238
+ sourceNamespace,
8239
+ principal: request.principal,
8240
+ targets: request.targets,
8241
+ reason: request.reason,
8242
+ actor: request.principal ?? "admin-console",
8243
+ storage,
8244
+ scopeProfilePlan
8245
+ });
8246
+ } catch (err) {
8247
+ if (err instanceof AdminPromotionError) {
8248
+ throw new EngramAccessInputError(err.message);
8249
+ }
8250
+ throw err;
8251
+ }
8252
+ }
7733
8253
  };
7734
8254
 
7735
8255
  export {
@@ -7743,4 +8263,4 @@ export {
7743
8263
  shapeMemorySummary,
7744
8264
  EngramAccessService
7745
8265
  };
7746
- //# sourceMappingURL=chunk-3E5WRQNQ.js.map
8266
+ //# sourceMappingURL=chunk-OXEAMU42.js.map