@remnic/core 10.0.30 → 10.0.32

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 (276) hide show
  1. package/dist/access-admin-ops-surface.js +47 -46
  2. package/dist/access-authorization-probe.js +48 -47
  3. package/dist/access-boundary.js +47 -46
  4. package/dist/access-cli.js +107 -107
  5. package/dist/access-extraction-force-flush.d.ts.map +1 -1
  6. package/dist/access-extraction-force-flush.js +47 -46
  7. package/dist/access-http-briefing.js +48 -47
  8. package/dist/access-http-query.js +49 -48
  9. package/dist/access-http.js +65 -64
  10. package/dist/access-identity-continuity-surface.js +47 -46
  11. package/dist/access-lcm-surface.js +47 -46
  12. package/dist/access-mcp.js +57 -56
  13. package/dist/access-namespace-preflight.js +47 -46
  14. package/dist/access-observe-write-surface.d.ts.map +1 -1
  15. package/dist/access-observe-write-surface.js +47 -46
  16. package/dist/access-offline-manifest.js +4 -4
  17. package/dist/access-operations-batch.js +48 -47
  18. package/dist/access-operations.js +55 -54
  19. package/dist/access-recall-concurrency.js +47 -46
  20. package/dist/access-recall-diagnostics.js +2 -2
  21. package/dist/access-recall-response.js +47 -46
  22. package/dist/access-recall-surface.js +47 -46
  23. package/dist/access-schema.d.ts +47 -47
  24. package/dist/access-service.js +47 -46
  25. package/dist/access-surface-catalog.js +49 -48
  26. package/dist/access-surface-catalog.js.map +1 -1
  27. package/dist/active-recall.js +20 -20
  28. package/dist/briefing.js +21 -21
  29. package/dist/buffer-turn-helpers.d.ts +20 -0
  30. package/dist/buffer-turn-helpers.d.ts.map +1 -1
  31. package/dist/buffer-turn-helpers.js +11 -3
  32. package/dist/buffer-turn.d.ts +50 -0
  33. package/dist/buffer-turn.d.ts.map +1 -0
  34. package/dist/buffer-turn.js +1 -0
  35. package/dist/buffer-turn.js.map +1 -0
  36. package/dist/buffer.d.ts +13 -1
  37. package/dist/buffer.d.ts.map +1 -1
  38. package/dist/buffer.js +4 -4
  39. package/dist/causal-consolidation.js +26 -26
  40. package/dist/{chunk-BIE3ZH3N.js → chunk-2IXEKMBJ.js} +143 -112
  41. package/dist/chunk-2IXEKMBJ.js.map +1 -0
  42. package/dist/{chunk-YGVZ4QOZ.js → chunk-3CRE3UZI.js} +2 -2
  43. package/dist/{chunk-YZTFQBYY.js → chunk-3GOPAWA7.js} +3 -3
  44. package/dist/{chunk-NAPHQ2MG.js → chunk-3IDNKOCE.js} +2 -2
  45. package/dist/{chunk-PYCTZ2HX.js → chunk-3VYNGM5A.js} +2 -2
  46. package/dist/{chunk-2XVLY424.js → chunk-42MM5DKK.js} +2 -2
  47. package/dist/{chunk-CKR7LXEK.js → chunk-464QR7WO.js} +255 -63
  48. package/dist/chunk-464QR7WO.js.map +1 -0
  49. package/dist/{chunk-3IXNL6SK.js → chunk-4ZTVOECF.js} +4 -4
  50. package/dist/{chunk-ETZUIRCI.js → chunk-53GYS3GG.js} +2 -2
  51. package/dist/{chunk-ZXTAHSQU.js → chunk-5GPHJ333.js} +2 -2
  52. package/dist/{chunk-AUYFUBBE.js → chunk-5HJCZ7SB.js} +4 -4
  53. package/dist/{chunk-52II7PB6.js → chunk-645WOU5I.js} +4 -4
  54. package/dist/{chunk-2WDMUQOH.js → chunk-64IO6ZEE.js} +2 -2
  55. package/dist/{chunk-OIIAIY7J.js → chunk-7SXUGYPE.js} +3 -3
  56. package/dist/{chunk-74IN6PV5.js → chunk-7WWITD3H.js} +4 -4
  57. package/dist/{chunk-7FZ4YVOH.js → chunk-A5ZY537U.js} +2 -2
  58. package/dist/{chunk-LDXNKEYB.js → chunk-A6PKEU7T.js} +1 -1
  59. package/dist/chunk-A6PKEU7T.js.map +1 -0
  60. package/dist/{chunk-VLBFSD7B.js → chunk-APRGEZQN.js} +2 -2
  61. package/dist/{chunk-XNROYP5E.js → chunk-AQ5XLA36.js} +2 -2
  62. package/dist/{chunk-K2REHR42.js → chunk-BDHYRMJC.js} +2 -2
  63. package/dist/{chunk-GQ7VWY6N.js → chunk-BQ6DGL6A.js} +2 -2
  64. package/dist/{chunk-4OE4UE2Y.js → chunk-D3EXT5KG.js} +2 -2
  65. package/dist/{chunk-MROA6OFU.js → chunk-DGBWPSM6.js} +2 -2
  66. package/dist/{chunk-NOMHXZD7.js → chunk-DNZ2CWPG.js} +2 -2
  67. package/dist/{chunk-HG2VVIKI.js → chunk-DZBMASSI.js} +12 -12
  68. package/dist/{chunk-NB2YX6X2.js → chunk-EXYDKAR6.js} +5 -5
  69. package/dist/{chunk-V4FI2TG6.js → chunk-F5FZ7DB4.js} +2 -2
  70. package/dist/{chunk-IY7DGT2Z.js → chunk-GDPTMK5V.js} +2 -2
  71. package/dist/{chunk-27OJ5G3D.js → chunk-GJBSEMC5.js} +7 -7
  72. package/dist/{chunk-MMBLOJJB.js → chunk-HMON55NJ.js} +85 -44
  73. package/dist/chunk-HMON55NJ.js.map +1 -0
  74. package/dist/{chunk-C2QVDLQV.js → chunk-HNTB7NIE.js} +2 -2
  75. package/dist/{chunk-4HNINU7Q.js → chunk-HSPEVXT5.js} +42 -42
  76. package/dist/{chunk-4QPW6JVI.js → chunk-ID2PLENW.js} +2 -2
  77. package/dist/{chunk-FN6OFDBZ.js → chunk-ID62FNER.js} +2 -2
  78. package/dist/{chunk-GSKW64NB.js → chunk-J6SZXAQ2.js} +2 -2
  79. package/dist/{chunk-3CHHQXAR.js → chunk-JTACUJP3.js} +2 -2
  80. package/dist/{chunk-3SN2D43X.js → chunk-K6RQ2KOX.js} +2 -2
  81. package/dist/{chunk-GWB7ZD2A.js → chunk-K6YJGWJP.js} +2 -2
  82. package/dist/{chunk-OANSZGAG.js → chunk-KFR343VH.js} +2 -2
  83. package/dist/{chunk-WC3V7HHP.js → chunk-KJZKO2M6.js} +2 -1
  84. package/dist/chunk-KJZKO2M6.js.map +1 -0
  85. package/dist/{chunk-T5IF2ZCE.js → chunk-KZMRMKC7.js} +81 -2
  86. package/dist/chunk-KZMRMKC7.js.map +1 -0
  87. package/dist/{chunk-NPO4ZQFY.js → chunk-LDXS746V.js} +3 -3
  88. package/dist/{chunk-UTXYOWDR.js → chunk-LGR54NYT.js} +3 -3
  89. package/dist/{chunk-UTXYOWDR.js.map → chunk-LGR54NYT.js.map} +1 -1
  90. package/dist/{chunk-DDLRKPR2.js → chunk-NKW27NU3.js} +2 -2
  91. package/dist/{chunk-4HYP4OKH.js → chunk-NU247WVX.js} +2 -2
  92. package/dist/{chunk-RRJ462HP.js → chunk-O6YJI5VX.js} +2 -2
  93. package/dist/{chunk-WYLBEJQI.js → chunk-OCWNT322.js} +4 -4
  94. package/dist/{chunk-UUYAW3JH.js → chunk-OIKLZCJD.js} +2 -2
  95. package/dist/{chunk-IO2UQVR2.js → chunk-OTWZXOJI.js} +2 -2
  96. package/dist/{chunk-OXYXMGRH.js → chunk-PGHYQMKZ.js} +11 -11
  97. package/dist/{chunk-LDEKVBVO.js → chunk-PZWW6MDE.js} +2 -2
  98. package/dist/{chunk-TFA6HPOA.js → chunk-QCP75JGO.js} +5 -5
  99. package/dist/{chunk-M236YHUH.js → chunk-RILIWZA6.js} +3 -3
  100. package/dist/{chunk-7VB3Y5OL.js → chunk-RRYN5FFC.js} +4 -4
  101. package/dist/{chunk-PZEADMX4.js → chunk-RU6WB55E.js} +9 -9
  102. package/dist/{chunk-VARNSLUW.js → chunk-SGII36L6.js} +2 -2
  103. package/dist/{chunk-KFKFK6G6.js → chunk-TB2J4PBY.js} +3 -3
  104. package/dist/{chunk-WQIYGYY6.js → chunk-TEUPXKC5.js} +2 -2
  105. package/dist/{chunk-VEB7NEON.js → chunk-U4BNX4R2.js} +3 -3
  106. package/dist/{chunk-7HFTCBCZ.js → chunk-UBBZFODO.js} +2 -2
  107. package/dist/{chunk-654GT5UP.js → chunk-UZDOPJ2P.js} +2 -2
  108. package/dist/{chunk-D4RV54HH.js → chunk-VAPVRDC4.js} +2 -2
  109. package/dist/{chunk-OXX4ORRL.js → chunk-W7X7XT7Z.js} +15 -15
  110. package/dist/{chunk-5NPZFXQH.js → chunk-WK7GFAQ2.js} +2 -2
  111. package/dist/{chunk-G6DAE2LT.js → chunk-WPCK6EJ2.js} +2 -2
  112. package/dist/{chunk-VKQI47DJ.js → chunk-Y7427SL7.js} +4 -4
  113. package/dist/{chunk-ZCRDYQL6.js → chunk-YGBWSKBD.js} +2 -2
  114. package/dist/{chunk-NCPR2FOJ.js → chunk-YXWLQHAW.js} +2 -2
  115. package/dist/{chunk-UM73Q46J.js → chunk-ZEMBRSKK.js} +2 -2
  116. package/dist/{chunk-TTIEXXL3.js → chunk-ZGP2XB4S.js} +16 -16
  117. package/dist/{chunk-UVUBLLM3.js → chunk-ZY4S5WMQ.js} +2 -2
  118. package/dist/cli.js +83 -82
  119. package/dist/coding/export-okf-codegraph.js +20 -20
  120. package/dist/compounding/engine.js +22 -22
  121. package/dist/config.js +20 -20
  122. package/dist/connectors/codex-materialize-runner.js +21 -21
  123. package/dist/connectors/index.js +21 -21
  124. package/dist/convergence-refresh.js +23 -23
  125. package/dist/conversation-index/backend.js +2 -2
  126. package/dist/corpus-watermark.js +23 -23
  127. package/dist/entity-retrieval.js +22 -22
  128. package/dist/event-order-recall.js +3 -3
  129. package/dist/external-wiki-access.js +48 -47
  130. package/dist/extraction.js +31 -31
  131. package/dist/harmonic-retrieval.js +21 -21
  132. package/dist/index.js +126 -126
  133. package/dist/lcm/engine.js +2 -2
  134. package/dist/lcm/index.js +2 -2
  135. package/dist/location/index.js +23 -23
  136. package/dist/maintenance/memory-governance.js +21 -21
  137. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +21 -21
  138. package/dist/maintenance/rebuild-memory-projection-runner.js +23 -23
  139. package/dist/maintenance/rebuild-memory-projection.js +22 -22
  140. package/dist/memory-browse-operations.js +48 -47
  141. package/dist/namespaces/migrate.js +22 -22
  142. package/dist/namespaces/scope-profiles.d.ts +1 -0
  143. package/dist/namespaces/scope-profiles.d.ts.map +1 -1
  144. package/dist/namespaces/search.js +9 -9
  145. package/dist/namespaces/storage.js +21 -21
  146. package/dist/offline-sync-impression-drain.js +3 -3
  147. package/dist/operator-doctor-corpus.js +24 -24
  148. package/dist/operator-toolkit.js +32 -32
  149. package/dist/orchestration/maintenance.js +33 -33
  150. package/dist/orchestration/session-context.d.ts +6 -0
  151. package/dist/orchestration/session-context.d.ts.map +1 -1
  152. package/dist/orchestration/turn-ingestion.d.ts +35 -1
  153. package/dist/orchestration/turn-ingestion.d.ts.map +1 -1
  154. package/dist/orchestrator.d.ts +2 -32
  155. package/dist/orchestrator.d.ts.map +1 -1
  156. package/dist/orchestrator.js +107 -107
  157. package/dist/recall-explain-renderer.js +3 -3
  158. package/dist/recall-navigate-access.js +2 -2
  159. package/dist/recall-navigate-disclosure.js +2 -2
  160. package/dist/recall-navigate.js +2 -2
  161. package/dist/recall-navigation-operations.js +48 -47
  162. package/dist/recall-navigation.js +47 -46
  163. package/dist/recall-xray-cli.js +4 -4
  164. package/dist/recall-xray-renderer.js +3 -3
  165. package/dist/recall-xray.js +2 -2
  166. package/dist/relay/mission.d.ts +2 -2
  167. package/dist/resume-bundles.js +20 -20
  168. package/dist/schemas.d.ts +4 -4
  169. package/dist/search/factory.js +8 -8
  170. package/dist/search/index.js +13 -13
  171. package/dist/search/lancedb-backend.js +2 -2
  172. package/dist/search/meilisearch-backend.js +2 -2
  173. package/dist/search/orama-backend.js +2 -2
  174. package/dist/semantic-consolidation.js +22 -22
  175. package/dist/semantic-rule-promotion.js +21 -21
  176. package/dist/semantic-rule-verifier.js +21 -21
  177. package/dist/source-agent-qualifier.js +24 -24
  178. package/dist/standup/build.js +21 -21
  179. package/dist/storage.js +20 -20
  180. package/dist/support-passport/contracts.d.ts +6 -6
  181. package/dist/support-passport/grant-contracts.d.ts +4 -4
  182. package/dist/support-passport/index.js +50 -49
  183. package/dist/transfer/export-okf.js +21 -21
  184. package/dist/types.d.ts +3 -17
  185. package/dist/types.d.ts.map +1 -1
  186. package/dist/types.js +1 -1
  187. package/dist/verified-recall.js +21 -21
  188. package/dist/who-knows-cli.js +22 -22
  189. package/dist/who-knows.js +21 -21
  190. package/package.json +2 -2
  191. package/src/access-extraction-force-flush.ts +37 -25
  192. package/src/access-observe-acceptance-boundary.test.ts +172 -0
  193. package/src/access-observe-replay-durability.test.ts +2212 -0
  194. package/src/access-observe-write-surface.ts +36 -41
  195. package/src/access-service-observe-lcm-parity.test.ts +63 -39
  196. package/src/access-service-observe-scope.test.ts +3 -2
  197. package/src/buffer-turn-helpers.ts +120 -1
  198. package/src/buffer-turn.ts +50 -0
  199. package/src/buffer.ts +115 -49
  200. package/src/namespaces/scope-profiles.ts +1 -1
  201. package/src/orchestration/extraction-run.ts +1 -1
  202. package/src/orchestration/session-context.ts +117 -49
  203. package/src/orchestration/turn-ingestion.ts +313 -9
  204. package/src/orchestrator-flush.test.ts +16 -3
  205. package/src/orchestrator.ts +2 -32
  206. package/src/types.ts +3 -17
  207. package/dist/chunk-BIE3ZH3N.js.map +0 -1
  208. package/dist/chunk-CKR7LXEK.js.map +0 -1
  209. package/dist/chunk-LDXNKEYB.js.map +0 -1
  210. package/dist/chunk-MMBLOJJB.js.map +0 -1
  211. package/dist/chunk-T5IF2ZCE.js.map +0 -1
  212. package/dist/chunk-WC3V7HHP.js.map +0 -1
  213. /package/dist/{chunk-YGVZ4QOZ.js.map → chunk-3CRE3UZI.js.map} +0 -0
  214. /package/dist/{chunk-YZTFQBYY.js.map → chunk-3GOPAWA7.js.map} +0 -0
  215. /package/dist/{chunk-NAPHQ2MG.js.map → chunk-3IDNKOCE.js.map} +0 -0
  216. /package/dist/{chunk-PYCTZ2HX.js.map → chunk-3VYNGM5A.js.map} +0 -0
  217. /package/dist/{chunk-2XVLY424.js.map → chunk-42MM5DKK.js.map} +0 -0
  218. /package/dist/{chunk-3IXNL6SK.js.map → chunk-4ZTVOECF.js.map} +0 -0
  219. /package/dist/{chunk-ETZUIRCI.js.map → chunk-53GYS3GG.js.map} +0 -0
  220. /package/dist/{chunk-ZXTAHSQU.js.map → chunk-5GPHJ333.js.map} +0 -0
  221. /package/dist/{chunk-AUYFUBBE.js.map → chunk-5HJCZ7SB.js.map} +0 -0
  222. /package/dist/{chunk-52II7PB6.js.map → chunk-645WOU5I.js.map} +0 -0
  223. /package/dist/{chunk-2WDMUQOH.js.map → chunk-64IO6ZEE.js.map} +0 -0
  224. /package/dist/{chunk-OIIAIY7J.js.map → chunk-7SXUGYPE.js.map} +0 -0
  225. /package/dist/{chunk-74IN6PV5.js.map → chunk-7WWITD3H.js.map} +0 -0
  226. /package/dist/{chunk-7FZ4YVOH.js.map → chunk-A5ZY537U.js.map} +0 -0
  227. /package/dist/{chunk-VLBFSD7B.js.map → chunk-APRGEZQN.js.map} +0 -0
  228. /package/dist/{chunk-XNROYP5E.js.map → chunk-AQ5XLA36.js.map} +0 -0
  229. /package/dist/{chunk-K2REHR42.js.map → chunk-BDHYRMJC.js.map} +0 -0
  230. /package/dist/{chunk-GQ7VWY6N.js.map → chunk-BQ6DGL6A.js.map} +0 -0
  231. /package/dist/{chunk-4OE4UE2Y.js.map → chunk-D3EXT5KG.js.map} +0 -0
  232. /package/dist/{chunk-MROA6OFU.js.map → chunk-DGBWPSM6.js.map} +0 -0
  233. /package/dist/{chunk-NOMHXZD7.js.map → chunk-DNZ2CWPG.js.map} +0 -0
  234. /package/dist/{chunk-HG2VVIKI.js.map → chunk-DZBMASSI.js.map} +0 -0
  235. /package/dist/{chunk-NB2YX6X2.js.map → chunk-EXYDKAR6.js.map} +0 -0
  236. /package/dist/{chunk-V4FI2TG6.js.map → chunk-F5FZ7DB4.js.map} +0 -0
  237. /package/dist/{chunk-IY7DGT2Z.js.map → chunk-GDPTMK5V.js.map} +0 -0
  238. /package/dist/{chunk-27OJ5G3D.js.map → chunk-GJBSEMC5.js.map} +0 -0
  239. /package/dist/{chunk-C2QVDLQV.js.map → chunk-HNTB7NIE.js.map} +0 -0
  240. /package/dist/{chunk-4HNINU7Q.js.map → chunk-HSPEVXT5.js.map} +0 -0
  241. /package/dist/{chunk-4QPW6JVI.js.map → chunk-ID2PLENW.js.map} +0 -0
  242. /package/dist/{chunk-FN6OFDBZ.js.map → chunk-ID62FNER.js.map} +0 -0
  243. /package/dist/{chunk-GSKW64NB.js.map → chunk-J6SZXAQ2.js.map} +0 -0
  244. /package/dist/{chunk-3CHHQXAR.js.map → chunk-JTACUJP3.js.map} +0 -0
  245. /package/dist/{chunk-3SN2D43X.js.map → chunk-K6RQ2KOX.js.map} +0 -0
  246. /package/dist/{chunk-GWB7ZD2A.js.map → chunk-K6YJGWJP.js.map} +0 -0
  247. /package/dist/{chunk-OANSZGAG.js.map → chunk-KFR343VH.js.map} +0 -0
  248. /package/dist/{chunk-NPO4ZQFY.js.map → chunk-LDXS746V.js.map} +0 -0
  249. /package/dist/{chunk-DDLRKPR2.js.map → chunk-NKW27NU3.js.map} +0 -0
  250. /package/dist/{chunk-4HYP4OKH.js.map → chunk-NU247WVX.js.map} +0 -0
  251. /package/dist/{chunk-RRJ462HP.js.map → chunk-O6YJI5VX.js.map} +0 -0
  252. /package/dist/{chunk-WYLBEJQI.js.map → chunk-OCWNT322.js.map} +0 -0
  253. /package/dist/{chunk-UUYAW3JH.js.map → chunk-OIKLZCJD.js.map} +0 -0
  254. /package/dist/{chunk-IO2UQVR2.js.map → chunk-OTWZXOJI.js.map} +0 -0
  255. /package/dist/{chunk-OXYXMGRH.js.map → chunk-PGHYQMKZ.js.map} +0 -0
  256. /package/dist/{chunk-LDEKVBVO.js.map → chunk-PZWW6MDE.js.map} +0 -0
  257. /package/dist/{chunk-TFA6HPOA.js.map → chunk-QCP75JGO.js.map} +0 -0
  258. /package/dist/{chunk-M236YHUH.js.map → chunk-RILIWZA6.js.map} +0 -0
  259. /package/dist/{chunk-7VB3Y5OL.js.map → chunk-RRYN5FFC.js.map} +0 -0
  260. /package/dist/{chunk-PZEADMX4.js.map → chunk-RU6WB55E.js.map} +0 -0
  261. /package/dist/{chunk-VARNSLUW.js.map → chunk-SGII36L6.js.map} +0 -0
  262. /package/dist/{chunk-KFKFK6G6.js.map → chunk-TB2J4PBY.js.map} +0 -0
  263. /package/dist/{chunk-WQIYGYY6.js.map → chunk-TEUPXKC5.js.map} +0 -0
  264. /package/dist/{chunk-VEB7NEON.js.map → chunk-U4BNX4R2.js.map} +0 -0
  265. /package/dist/{chunk-7HFTCBCZ.js.map → chunk-UBBZFODO.js.map} +0 -0
  266. /package/dist/{chunk-654GT5UP.js.map → chunk-UZDOPJ2P.js.map} +0 -0
  267. /package/dist/{chunk-D4RV54HH.js.map → chunk-VAPVRDC4.js.map} +0 -0
  268. /package/dist/{chunk-OXX4ORRL.js.map → chunk-W7X7XT7Z.js.map} +0 -0
  269. /package/dist/{chunk-5NPZFXQH.js.map → chunk-WK7GFAQ2.js.map} +0 -0
  270. /package/dist/{chunk-G6DAE2LT.js.map → chunk-WPCK6EJ2.js.map} +0 -0
  271. /package/dist/{chunk-VKQI47DJ.js.map → chunk-Y7427SL7.js.map} +0 -0
  272. /package/dist/{chunk-ZCRDYQL6.js.map → chunk-YGBWSKBD.js.map} +0 -0
  273. /package/dist/{chunk-NCPR2FOJ.js.map → chunk-YXWLQHAW.js.map} +0 -0
  274. /package/dist/{chunk-UM73Q46J.js.map → chunk-ZEMBRSKK.js.map} +0 -0
  275. /package/dist/{chunk-TTIEXXL3.js.map → chunk-ZGP2XB4S.js.map} +0 -0
  276. /package/dist/{chunk-UVUBLLM3.js.map → chunk-ZY4S5WMQ.js.map} +0 -0
@@ -1,3 +1,6 @@
1
+ import {
2
+ openclawReplayNormalizer
3
+ } from "./chunk-H4CKS5B2.js";
1
4
  import {
2
5
  chatgptReplayNormalizer
3
6
  } from "./chunk-MMACM5G2.js";
@@ -5,8 +8,9 @@ import {
5
8
  claudeReplayNormalizer
6
9
  } from "./chunk-54BGIBCR.js";
7
10
  import {
8
- openclawReplayNormalizer
9
- } from "./chunk-H4CKS5B2.js";
11
+ exportOkfBundle,
12
+ parseIncludeStatus
13
+ } from "./chunk-ZY4S5WMQ.js";
10
14
  import {
11
15
  exportSqlite
12
16
  } from "./chunk-BV2TIZ4F.js";
@@ -31,13 +35,12 @@ import {
31
35
  import {
32
36
  exportMarkdownBundle
33
37
  } from "./chunk-765K3SAT.js";
34
- import {
35
- exportOkfBundle,
36
- parseIncludeStatus
37
- } from "./chunk-UVUBLLM3.js";
38
38
  import {
39
39
  RoutingRulesStore
40
40
  } from "./chunk-TBUEE7XF.js";
41
+ import {
42
+ WebDavServer
43
+ } from "./chunk-PYIFUBRK.js";
41
44
  import {
42
45
  buildReplayNormalizerRegistry,
43
46
  clampBatchSize,
@@ -47,21 +50,18 @@ import {
47
50
  isReplaySource,
48
51
  normalizeReplaySessionKey
49
52
  } from "./chunk-AJVLDJU6.js";
53
+ import {
54
+ rebuildObservations
55
+ } from "./chunk-WHCD4Z3D.js";
50
56
  import {
51
57
  TailscaleHelper
52
58
  } from "./chunk-SZDLX763.js";
53
- import {
54
- WebDavServer
55
- } from "./chunk-PYIFUBRK.js";
56
59
  import {
57
60
  migrateObservations
58
61
  } from "./chunk-EDR6CVWZ.js";
59
62
  import {
60
63
  rebuildMemoryLifecycleLedger
61
- } from "./chunk-LDEKVBVO.js";
62
- import {
63
- rebuildObservations
64
- } from "./chunk-WHCD4Z3D.js";
64
+ } from "./chunk-PZWW6MDE.js";
65
65
  import {
66
66
  archiveObservations
67
67
  } from "./chunk-7IGMKQWK.js";
@@ -77,9 +77,6 @@ import {
77
77
  import {
78
78
  lintOkfDir
79
79
  } from "./chunk-TRW7N4FS.js";
80
- import {
81
- searchVerifiedEpisodes
82
- } from "./chunk-NOMHXZD7.js";
83
80
  import {
84
81
  getUtilityLearningStatus,
85
82
  learnUtilityPromotionWeights
@@ -88,15 +85,18 @@ import {
88
85
  getUtilityTelemetryStatus,
89
86
  recordUtilityTelemetryEvent
90
87
  } from "./chunk-EOU6V4IN.js";
88
+ import {
89
+ searchVerifiedEpisodes
90
+ } from "./chunk-DNZ2CWPG.js";
91
91
  import {
92
92
  ThreadingManager
93
93
  } from "./chunk-R7WYAXPO.js";
94
- import {
95
- promoteSemanticRuleFromMemory
96
- } from "./chunk-NCPR2FOJ.js";
97
94
  import {
98
95
  searchVerifiedSemanticRules
99
- } from "./chunk-ZXTAHSQU.js";
96
+ } from "./chunk-5GPHJ333.js";
97
+ import {
98
+ promoteSemanticRuleFromMemory
99
+ } from "./chunk-YXWLQHAW.js";
100
100
  import {
101
101
  buildResumeBundleFromState,
102
102
  getResumeBundleStatus,
@@ -112,7 +112,7 @@ import {
112
112
  } from "./chunk-HDN7IVIO.js";
113
113
  import {
114
114
  parseXrayCliOptions
115
- } from "./chunk-NPO4ZQFY.js";
115
+ } from "./chunk-LDXS746V.js";
116
116
  import {
117
117
  collectPatternMemories,
118
118
  explainPatternMemory,
@@ -134,7 +134,7 @@ import {
134
134
  runOperatorInventory,
135
135
  runOperatorRepair,
136
136
  runOperatorSetup
137
- } from "./chunk-HG2VVIKI.js";
137
+ } from "./chunk-DZBMASSI.js";
138
138
  import {
139
139
  analyzeSessionIntegrity,
140
140
  applySessionRepair,
@@ -169,14 +169,14 @@ import {
169
169
  runEvalStoredBaselineCiGate,
170
170
  validateEvalBenchmarkPack
171
171
  } from "./chunk-JKMIGCK6.js";
172
- import {
173
- GraphDashboardServer
174
- } from "./chunk-EZ25VE3G.js";
175
172
  import {
176
173
  rebuildMemoryProjection,
177
174
  repairMemoryProjection,
178
175
  verifyMemoryProjection
179
- } from "./chunk-YZTFQBYY.js";
176
+ } from "./chunk-3GOPAWA7.js";
177
+ import {
178
+ GraphDashboardServer
179
+ } from "./chunk-EZ25VE3G.js";
180
180
  import {
181
181
  buildConnectorRowsFromDefinitions,
182
182
  parseConnectorsListOptions,
@@ -210,7 +210,7 @@ import {
210
210
  import {
211
211
  EngramAccessHttpServer,
212
212
  MeetingsInputError
213
- } from "./chunk-OXX4ORRL.js";
213
+ } from "./chunk-W7X7XT7Z.js";
214
214
  import {
215
215
  WearablesInputError
216
216
  } from "./chunk-V7IZKJI3.js";
@@ -220,10 +220,10 @@ import {
220
220
  loadChatSession,
221
221
  processChatMessage,
222
222
  sessionBelongsToPrincipal
223
- } from "./chunk-AUYFUBBE.js";
223
+ } from "./chunk-5HJCZ7SB.js";
224
224
  import {
225
225
  EngramAccessService
226
- } from "./chunk-BIE3ZH3N.js";
226
+ } from "./chunk-2IXEKMBJ.js";
227
227
  import {
228
228
  WorkStorage
229
229
  } from "./chunk-MPC7TYTZ.js";
@@ -240,10 +240,10 @@ import {
240
240
  parseRecallExplainFormat,
241
241
  renderRecallExplain,
242
242
  renderXray
243
- } from "./chunk-RRJ462HP.js";
243
+ } from "./chunk-O6YJI5VX.js";
244
244
  import {
245
245
  readAggregateExtractionWatermark
246
- } from "./chunk-3CHHQXAR.js";
246
+ } from "./chunk-JTACUJP3.js";
247
247
  import {
248
248
  getObjectiveStateStoreStatus
249
249
  } from "./chunk-4RNBLLZR.js";
@@ -252,21 +252,21 @@ import {
252
252
  } from "./chunk-BDLOEODO.js";
253
253
  import {
254
254
  searchHarmonicRetrieval
255
- } from "./chunk-YGVZ4QOZ.js";
255
+ } from "./chunk-3CRE3UZI.js";
256
+ import {
257
+ listMemoryGovernanceRuns,
258
+ readMemoryGovernanceRunArtifact,
259
+ restoreMemoryGovernanceRun,
260
+ runMemoryGovernance
261
+ } from "./chunk-NKW27NU3.js";
256
262
  import {
257
263
  listNamespaces,
258
264
  runNamespaceMigration,
259
265
  verifyNamespaces
260
- } from "./chunk-OIIAIY7J.js";
266
+ } from "./chunk-7SXUGYPE.js";
261
267
  import {
262
268
  getCueAnchorStoreStatus
263
269
  } from "./chunk-LXATZLSC.js";
264
- import {
265
- listMemoryGovernanceRuns,
266
- readMemoryGovernanceRunArtifact,
267
- restoreMemoryGovernanceRun,
268
- runMemoryGovernance
269
- } from "./chunk-DDLRKPR2.js";
270
270
  import {
271
271
  analyzeGraphHealth
272
272
  } from "./chunk-4IYIGN53.js";
@@ -303,7 +303,7 @@ import {
303
303
  } from "./chunk-C2RW36YR.js";
304
304
  import {
305
305
  meetingIdDate
306
- } from "./chunk-TTIEXXL3.js";
306
+ } from "./chunk-ZGP2XB4S.js";
307
307
  import {
308
308
  isValidTranscriptDate
309
309
  } from "./chunk-UHVXE24Y.js";
@@ -327,7 +327,7 @@ import {
327
327
  import {
328
328
  RECALL_DISCLOSURE_LEVELS,
329
329
  isRecallDisclosure
330
- } from "./chunk-LDXNKEYB.js";
330
+ } from "./chunk-A6PKEU7T.js";
331
331
  import {
332
332
  activityDateInTimezone,
333
333
  isValidActivityDate
@@ -10140,4 +10140,4 @@ export {
10140
10140
  listMemoryMarkdownFilePaths,
10141
10141
  registerCli
10142
10142
  };
10143
- //# sourceMappingURL=chunk-4HNINU7Q.js.map
10143
+ //# sourceMappingURL=chunk-HSPEVXT5.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-TOTT6S2V.js";
4
4
  import {
5
5
  isRecallDisclosure
6
- } from "./chunk-LDXNKEYB.js";
6
+ } from "./chunk-A6PKEU7T.js";
7
7
  import {
8
8
  normalizeRetrievedMemoryProvenance
9
9
  } from "./chunk-I4WBNM3M.js";
@@ -312,4 +312,4 @@ export {
312
312
  RecallXrayBuilder,
313
313
  summarizeDisclosureTokens
314
314
  };
315
- //# sourceMappingURL=chunk-4QPW6JVI.js.map
315
+ //# sourceMappingURL=chunk-ID2PLENW.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getOperation
3
- } from "./chunk-BIE3ZH3N.js";
3
+ } from "./chunk-2IXEKMBJ.js";
4
4
  import {
5
5
  EngramAccessInputError
6
6
  } from "./chunk-3MUKQQ7A.js";
@@ -21,4 +21,4 @@ async function respondBriefingHttp(options) {
21
21
  export {
22
22
  respondBriefingHttp
23
23
  };
24
- //# sourceMappingURL=chunk-FN6OFDBZ.js.map
24
+ //# sourceMappingURL=chunk-ID62FNER.js.map
@@ -3,7 +3,7 @@ import {
3
3
  getOperation,
4
4
  operationRequiresAuthorizedNamespace,
5
5
  operationUsesPrincipalNamespace
6
- } from "./chunk-BIE3ZH3N.js";
6
+ } from "./chunk-2IXEKMBJ.js";
7
7
  import {
8
8
  assertOperationAuthorizationAllowed
9
9
  } from "./chunk-IG747LRN.js";
@@ -60,4 +60,4 @@ export {
60
60
  authorizationProbeNamespaces,
61
61
  authorizationProbeRequiresPrincipalNamespace
62
62
  };
63
- //# sourceMappingURL=chunk-GSKW64NB.js.map
63
+ //# sourceMappingURL=chunk-J6SZXAQ2.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveCorpusNamespaceRoots
3
- } from "./chunk-D4RV54HH.js";
3
+ } from "./chunk-VAPVRDC4.js";
4
4
  import {
5
5
  capabilityAllowsNamespace
6
6
  } from "./chunk-IG747LRN.js";
@@ -200,4 +200,4 @@ async function readAggregateExtractionWatermark(options) {
200
200
  export {
201
201
  readAggregateExtractionWatermark
202
202
  };
203
- //# sourceMappingURL=chunk-3CHHQXAR.js.map
203
+ //# sourceMappingURL=chunk-JTACUJP3.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  rebuildMemoryProjection,
3
3
  watchProjectionRebuildParent
4
- } from "./chunk-YZTFQBYY.js";
4
+ } from "./chunk-3GOPAWA7.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-3SN2D43X.js.map
80
+ //# sourceMappingURL=chunk-K6RQ2KOX.js.map
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-6JMQR72P.js";
7
7
  import {
8
8
  StorageManager
9
- } from "./chunk-TTIEXXL3.js";
9
+ } from "./chunk-ZGP2XB4S.js";
10
10
  import {
11
11
  normalizeEntityName
12
12
  } from "./chunk-YXZG5TVN.js";
@@ -962,4 +962,4 @@ export {
962
962
  resolveBriefingSaveDir,
963
963
  briefingFilename
964
964
  };
965
- //# sourceMappingURL=chunk-GWB7ZD2A.js.map
965
+ //# sourceMappingURL=chunk-K6YJGWJP.js.map
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-5JMAGU26.js";
6
6
  import {
7
7
  runPostConsolidationMaterialize
8
- } from "./chunk-V4FI2TG6.js";
8
+ } from "./chunk-F5FZ7DB4.js";
9
9
  import {
10
10
  isSemanticConsolidationLlmOperator
11
11
  } from "./chunk-G7D6GZ5J.js";
@@ -220,4 +220,4 @@ export {
220
220
  buildExtensionsBlockForConsolidation,
221
221
  materializeAfterSemanticConsolidation
222
222
  };
223
- //# sourceMappingURL=chunk-OANSZGAG.js.map
223
+ //# sourceMappingURL=chunk-KFR343VH.js.map
@@ -335,7 +335,8 @@ function expandScopeProfileReadNamespaces(options) {
335
335
  }
336
336
 
337
337
  export {
338
+ hasExplicitNamespacePolicy,
338
339
  resolveScopeProfilePlan,
339
340
  expandScopeProfileReadNamespaces
340
341
  };
341
- //# sourceMappingURL=chunk-WC3V7HHP.js.map
342
+ //# sourceMappingURL=chunk-KJZKO2M6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/namespaces/scope-profiles.ts"],"sourcesContent":["import { resolveNamespaceCapabilities } from \"../capabilities.js\";\nimport { createHash } from \"node:crypto\";\n\nimport { combineNamespaces, type CodingNamespaceOverlay } from \"../coding/coding-namespace.js\";\nimport { stableHash } from \"../coding/git-context.js\";\nimport { isSafeRouteNamespace } from \"../routing/engine.js\";\nimport type {\n CodingContext,\n PluginConfig,\n ScopeProfileConfig,\n ScopeProfileLayerId,\n ScopeProfilePromotionTarget,\n ScopeTeamConfig,\n} from \"../types.js\";\nimport {\n canReadNamespace,\n canWriteNamespace,\n defaultNamespaceForPrincipal,\n} from \"./principal.js\";\nimport { normalizeNamespaceIdentity } from \"./identity.js\";\n\ntype ScopeProfileCodingOverlay = Pick<CodingNamespaceOverlay, \"namespace\" | \"readFallbacks\">;\n\nexport interface ScopeProfileLayerResolution {\n id: ScopeProfileLayerId;\n kind: \"user-project\" | \"team-project\" | \"user-global\" | \"server-shared\";\n namespace?: string;\n readable: boolean;\n writable: boolean;\n promotable: boolean;\n reason: string;\n}\n\nexport interface ScopeProfilePromotionResolution {\n target: ScopeProfilePromotionTarget;\n namespace?: string;\n authorized: boolean;\n reason: string;\n}\n\nexport interface ResolvedScopeProfilePlan {\n profileId: string;\n profile: ScopeProfileConfig;\n baseNamespace: string;\n writeLayer: ScopeProfileLayerId;\n writeNamespace: string;\n readNamespaces: string[];\n layers: ScopeProfileLayerResolution[];\n promotionTargets: ScopeProfilePromotionResolution[];\n warnings: string[];\n}\n\nexport interface ResolveScopeProfilePlanOptions {\n config: PluginConfig;\n principal?: string;\n codingContext?: CodingContext | null;\n codingOverlay?: ScopeProfileCodingOverlay | null;\n}\n\nfunction activeScopeProfile(config: PluginConfig): { profileId: string; profile: ScopeProfileConfig } | null {\n const profileId = config.defaultScopeProfile;\n if (!profileId) return null;\n const profile = (config.scopeProfiles ?? {})[profileId];\n return profile ? { profileId, profile } : null;\n}\n\nfunction principalListed(list: string[], principal: string | undefined): boolean {\n if (!principal) return false;\n return list.includes(principal) || list.includes(\"*\");\n}\n\nfunction derivedScopeProfileSelfNamespace(principal: string | undefined, config: PluginConfig): string | null {\n if (\n !principal ||\n normalizeNamespaceIdentity(principal) === normalizeNamespaceIdentity(config.defaultNamespace) ||\n normalizeNamespaceIdentity(principal) === normalizeNamespaceIdentity(config.sharedNamespace)\n ) {\n return null;\n }\n if (isSafeRouteNamespace(principal)) return principal;\n return \"principal-\" + createHash(\"sha256\").update(principal).digest(\"hex\").slice(0, 54);\n}\n\nfunction scopeProfileSelfNamespace(principal: string | undefined, config: PluginConfig): string {\n const existing = defaultNamespaceForPrincipal(principal, config);\n if (normalizeNamespaceIdentity(existing) !== normalizeNamespaceIdentity(config.defaultNamespace)) return existing;\n return derivedScopeProfileSelfNamespace(principal, config) ?? existing;\n}\n\nexport function hasExplicitNamespacePolicy(namespace: string, config: PluginConfig): boolean {\n const identity = normalizeNamespaceIdentity(namespace);\n return (config.namespacePolicies ?? []).some(\n (policy) => normalizeNamespaceIdentity(policy.name) === identity,\n );\n}\n\nfunction isScopeProfileImplicitSelfNamespace(\n principal: string | undefined,\n namespace: string,\n config: PluginConfig,\n): boolean {\n const derived = derivedScopeProfileSelfNamespace(principal, config);\n return Boolean(\n derived &&\n normalizeNamespaceIdentity(namespace) === normalizeNamespaceIdentity(derived) &&\n normalizeNamespaceIdentity(namespace) !== normalizeNamespaceIdentity(config.defaultNamespace) &&\n normalizeNamespaceIdentity(namespace) !== normalizeNamespaceIdentity(config.sharedNamespace) &&\n isSafeRouteNamespace(namespace) &&\n !hasExplicitNamespacePolicy(namespace, config),\n );\n}\n\nfunction canReadScopeProfileNamespace(\n principal: string | undefined,\n namespace: string,\n config: PluginConfig,\n): boolean {\n return isScopeProfileImplicitSelfNamespace(principal, namespace, config) || canReadNamespace(principal, namespace, config);\n}\n\nfunction canWriteScopeProfileNamespace(\n principal: string | undefined,\n namespace: string,\n config: PluginConfig,\n): boolean {\n return isScopeProfileImplicitSelfNamespace(principal, namespace, config) || canWriteNamespace(principal, namespace, config);\n}\n\nfunction resolveTeam(\n config: PluginConfig,\n profile: ScopeProfileConfig,\n principal: string | undefined,\n): { teamId: string; team: ScopeTeamConfig } | null {\n const configuredTeamId = profile.teamProject?.teamId;\n if (configuredTeamId) {\n const configured = (config.teams ?? {})[configuredTeamId];\n return configured ? { teamId: configuredTeamId, team: configured } : null;\n }\n const readableTeams = Object.entries(config.teams ?? {}).filter(([, team]) =>\n principalListed(team.principals, principal) || principalListed(team.read, principal),\n );\n const needsWritableTeam = profile.writeDefault === \"teamProject\" || profile.readOrder.includes(\"teamProject\");\n if (needsWritableTeam) {\n const writableTeam = readableTeams.find(([, team]) => principalListed(team.write, principal));\n if (writableTeam) return { teamId: writableTeam[0], team: writableTeam[1] };\n }\n const needsPromotableTeam =\n profile.promotionTargets.includes(\"teamProject\") || profile.autoPromote.targets.includes(\"teamProject\");\n if (needsPromotableTeam) {\n const promotableTeam = readableTeams.find(\n ([, team]) => principalListed(team.promote, principal) || principalListed(team.write, principal),\n );\n if (promotableTeam) return { teamId: promotableTeam[0], team: promotableTeam[1] };\n }\n const firstReadableTeam = readableTeams[0];\n return firstReadableTeam\n ? { teamId: firstReadableTeam[0], team: firstReadableTeam[1] }\n : null;\n}\n\nfunction renderTeamProjectNamespace(params: {\n template: string;\n teamId: string;\n principal: string | undefined;\n codingContext: CodingContext;\n codingOverlay: ScopeProfileCodingOverlay;\n}): { namespace: string; unknownPlaceholders: string[] } {\n const replacements: Record<string, string> = {\n teamId: params.teamId,\n principal: params.principal ?? \"anonymous\",\n projectId: params.codingContext.projectId,\n projectHash: stableHash(params.codingContext.projectId),\n projectNamespace: params.codingOverlay.namespace,\n };\n const unknownPlaceholders: string[] = [];\n const namespace = params.template.replace(/\\{([A-Za-z][A-Za-z0-9]*)\\}/g, (match, key: string) => {\n const replacement = replacements[key];\n if (replacement !== undefined) return replacement;\n if (!unknownPlaceholders.includes(key)) unknownPlaceholders.push(key);\n return match;\n });\n return { namespace, unknownPlaceholders };\n}\n\nfunction resolveLayer(params: {\n id: ScopeProfileLayerId;\n config: PluginConfig;\n profile: ScopeProfileConfig;\n principal: string | undefined;\n baseNamespace: string;\n codingContext: CodingContext | null | undefined;\n codingOverlay: ScopeProfileCodingOverlay | null | undefined;\n}): ScopeProfileLayerResolution {\n const { id, config, profile, principal, baseNamespace, codingContext, codingOverlay } = params;\n if (id === \"userGlobal\") {\n return {\n id,\n kind: \"user-global\",\n namespace: baseNamespace,\n readable: canReadScopeProfileNamespace(principal, baseNamespace, config),\n writable: canWriteScopeProfileNamespace(principal, baseNamespace, config),\n promotable: canWriteScopeProfileNamespace(principal, baseNamespace, config),\n reason: \"principal self/global namespace\",\n };\n }\n if (id === \"serverShared\") {\n return {\n id,\n kind: \"server-shared\",\n namespace: config.sharedNamespace,\n readable: canReadNamespace(principal, config.sharedNamespace, config),\n writable: canWriteNamespace(principal, config.sharedNamespace, config),\n promotable: canWriteNamespace(principal, config.sharedNamespace, config),\n reason: \"configured shared namespace\",\n };\n }\n if (id === \"userProject\") {\n if (!codingContext || !codingOverlay) {\n return {\n id,\n kind: \"user-project\",\n readable: false,\n writable: false,\n promotable: false,\n reason: \"missing project context\",\n };\n }\n const namespace = combineNamespaces(baseNamespace, codingOverlay.namespace);\n const explicitProjectPolicy = hasExplicitNamespacePolicy(namespace, config);\n const baseReadable = canReadScopeProfileNamespace(principal, baseNamespace, config);\n const baseWritable = canWriteScopeProfileNamespace(principal, baseNamespace, config);\n const projectReadable = explicitProjectPolicy\n ? canReadNamespace(principal, namespace, config)\n : baseReadable;\n const projectWritable = explicitProjectPolicy\n ? canWriteNamespace(principal, namespace, config)\n : baseWritable;\n return {\n id,\n kind: \"user-project\",\n namespace,\n readable: projectReadable,\n writable: projectWritable,\n promotable: projectWritable,\n reason: explicitProjectPolicy\n ? \"explicit user-project namespace policy\"\n : baseReadable || baseWritable\n ? \"principal project namespace derived from coding context\"\n : \"principal base namespace is not authorized\",\n };\n }\n const team = resolveTeam(config, profile, principal);\n if (!team) {\n return {\n id,\n kind: \"team-project\",\n readable: false,\n writable: false,\n promotable: false,\n reason: \"no authorized team mapping\",\n };\n }\n if (!codingContext || !codingOverlay) {\n return {\n id,\n kind: \"team-project\",\n readable: false,\n writable: false,\n promotable: false,\n reason: \"missing project context\",\n };\n }\n const template =\n profile.teamProject?.namespaceTemplate ??\n team.team.projectNamespaceTemplate ??\n \"team-{teamId}-project-{projectHash}\";\n const renderedNamespace = renderTeamProjectNamespace({\n template,\n teamId: team.teamId,\n principal,\n codingContext,\n codingOverlay,\n });\n const namespace = renderedNamespace.namespace.trim();\n if (renderedNamespace.unknownPlaceholders.length > 0) {\n return {\n id,\n kind: \"team-project\",\n namespace,\n readable: false,\n writable: false,\n promotable: false,\n reason: `unknown team-project namespace template placeholder(s): ${renderedNamespace.unknownPlaceholders.join(\", \")}`,\n };\n }\n if (!namespace || !isSafeRouteNamespace(namespace)) {\n return {\n id,\n kind: \"team-project\",\n namespace,\n readable: false,\n writable: false,\n promotable: false,\n reason: \"team-project namespace template resolved to an unsafe namespace\",\n };\n }\n const teamReadable = principalListed(team.team.read, principal) || principalListed(team.team.principals, principal);\n const teamWritable = principalListed(team.team.write, principal);\n const teamPromotable = principalListed(team.team.promote, principal) || principalListed(team.team.write, principal);\n const userProjectSuffix = `-${codingOverlay.namespace}`;\n const userProjectBase = namespace.endsWith(userProjectSuffix)\n ? namespace.slice(0, -userProjectSuffix.length)\n : \"\";\n const userProjectBaseIdentity = normalizeNamespaceIdentity(userProjectBase);\n const defaultIdentity = normalizeNamespaceIdentity(config.defaultNamespace);\n const sharedIdentity = normalizeNamespaceIdentity(config.sharedNamespace);\n const namespaceIdentity = normalizeNamespaceIdentity(namespace);\n const dynamicUserProjectCollision =\n userProjectBase.length > 0 &&\n (userProjectBaseIdentity === defaultIdentity ||\n userProjectBaseIdentity === sharedIdentity ||\n (config.namespacePolicies ?? []).some(\n (policy) => normalizeNamespaceIdentity(policy.name) === userProjectBaseIdentity,\n ));\n const protectedNamespace =\n namespaceIdentity === defaultIdentity ||\n namespaceIdentity === sharedIdentity ||\n dynamicUserProjectCollision ||\n (config.namespacePolicies ?? []).some(\n (policy) => normalizeNamespaceIdentity(policy.name) === namespaceIdentity,\n );\n const policyReadable = !protectedNamespace || canReadNamespace(principal, namespace, config);\n const policyWritable = !protectedNamespace || canWriteNamespace(principal, namespace, config);\n const policyBlocked = protectedNamespace && (!policyReadable || !policyWritable);\n return {\n id,\n kind: \"team-project\",\n namespace,\n readable: teamReadable && policyReadable,\n writable: teamWritable && policyWritable,\n promotable: teamPromotable && policyWritable,\n reason: policyBlocked\n ? \"team-project namespace collides with a protected namespace policy\"\n : \"trusted team-project namespace derived from team and project config\",\n };\n}\n\nexport function resolveScopeProfilePlan(\n options: ResolveScopeProfilePlanOptions,\n): ResolvedScopeProfilePlan | null {\n const active = activeScopeProfile(options.config);\n if (!active || !resolveNamespaceCapabilities(options.config).namespaces) return null;\n\n const baseNamespace = scopeProfileSelfNamespace(options.principal, options.config);\n const layerIds = Array.from(\n new Set<ScopeProfileLayerId>([\n ...active.profile.readOrder,\n active.profile.writeDefault,\n \"userGlobal\",\n ...active.profile.promotionTargets.filter((target): target is ScopeProfileLayerId =>\n [\"userProject\", \"teamProject\", \"userGlobal\", \"serverShared\"].includes(target),\n ),\n ]),\n );\n const layerMap = new Map<ScopeProfileLayerId, ScopeProfileLayerResolution>();\n for (const id of layerIds) {\n layerMap.set(\n id,\n resolveLayer({\n id,\n config: options.config,\n profile: active.profile,\n principal: options.principal,\n baseNamespace,\n codingContext: options.codingContext,\n codingOverlay: options.codingOverlay,\n }),\n );\n }\n\n const readNamespaces: string[] = [];\n for (const id of active.profile.readOrder) {\n const layer = layerMap.get(id);\n if (layer?.readable && layer.namespace && !readNamespaces.includes(layer.namespace)) {\n readNamespaces.push(layer.namespace);\n }\n }\n\n const preferredWriteLayer = layerMap.get(active.profile.writeDefault);\n const readableWriteLayers = active.profile.readOrder\n .map((id) => layerMap.get(id))\n .filter(\n (layer): layer is ScopeProfileLayerResolution =>\n Boolean(layer?.writable && layer.namespace && readNamespaces.includes(layer.namespace)),\n );\n const fallbackWriteLayer =\n preferredWriteLayer?.writable &&\n preferredWriteLayer.namespace &&\n readNamespaces.includes(preferredWriteLayer.namespace)\n ? preferredWriteLayer\n : readableWriteLayers[0];\n const warnings: string[] = [];\n if (!fallbackWriteLayer?.namespace) {\n warnings.push(`scope profile ${active.profileId} has no writable layer inside the profile read stack; writes disabled`);\n } else if (fallbackWriteLayer.id !== active.profile.writeDefault) {\n warnings.push(\n `scope profile ${active.profileId} writeDefault ${active.profile.writeDefault} unavailable: ${preferredWriteLayer?.reason ?? \"not resolved\"}`,\n );\n }\n\n const promotionTargets = active.profile.promotionTargets.map((target) => {\n const layer = layerMap.get(target as ScopeProfileLayerId);\n if (!layer) {\n return {\n target,\n authorized: false,\n reason: \"promotion target did not resolve to a profile layer\",\n };\n }\n return {\n target,\n namespace: layer.namespace,\n authorized: layer.promotable && Boolean(layer.namespace),\n reason: layer.reason,\n };\n });\n\n return {\n profileId: active.profileId,\n profile: active.profile,\n baseNamespace,\n writeLayer: fallbackWriteLayer?.id ?? active.profile.writeDefault,\n writeNamespace: fallbackWriteLayer?.namespace ?? \"\",\n readNamespaces,\n layers: [...layerMap.values()],\n promotionTargets,\n warnings,\n };\n}\n\nexport function expandScopeProfileReadNamespaces(options: {\n profilePlan: ResolvedScopeProfilePlan;\n principalSelfNamespace: string;\n config: PluginConfig;\n principal?: string;\n codingOverlay?: ScopeProfileCodingOverlay | null;\n legacyRecallNamespaces?: string[];\n}): string[] {\n if (options.profilePlan.readNamespaces.length === 0) {\n return [];\n }\n const out = [...options.profilePlan.readNamespaces];\n const add = (namespace: string | undefined): void => {\n if (namespace && !out.includes(namespace)) out.push(namespace);\n };\n const userProjectReadable =\n options.profilePlan.profile.readOrder.includes(\"userProject\") &&\n options.profilePlan.layers.some(\n (layer) => layer.id === \"userProject\" && layer.readable && layer.namespace,\n );\n const userGlobalReadable =\n options.profilePlan.profile.readOrder.includes(\"userGlobal\") &&\n options.profilePlan.layers.some(\n (layer) => layer.id === \"userGlobal\" && layer.readable && layer.namespace,\n );\n if (userProjectReadable) {\n for (const fallback of options.codingOverlay?.readFallbacks ?? []) {\n if (fallback === \"\" && !userGlobalReadable) continue;\n const fallbackNamespace = combineNamespaces(options.principalSelfNamespace, fallback);\n if (\n !hasExplicitNamespacePolicy(fallbackNamespace, options.config) ||\n canReadScopeProfileNamespace(options.principal, fallbackNamespace, options.config)\n ) {\n add(fallbackNamespace);\n }\n }\n }\n return out;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AACA,SAAS,kBAAkB;AA0D3B,SAAS,mBAAmB,QAAiF;AAC3G,QAAM,YAAY,OAAO;AACzB,MAAI,CAAC,UAAW,QAAO;AACvB,QAAM,WAAW,OAAO,iBAAiB,CAAC,GAAG,SAAS;AACtD,SAAO,UAAU,EAAE,WAAW,QAAQ,IAAI;AAC5C;AAEA,SAAS,gBAA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S,iCAAiC,SAOpC;AACX,MAAI,QAAQ,YAAY,eAAe,WAAW,GAAG;AACnD,WAAO,CAAC;AAAA,EACV;AACA,QAAM,MAAM,CAAC,GAAG,QAAQ,YAAY,cAAc;AAClD,QAAM,MAAM,CAAC,cAAwC;AACnD,QAAI,aAAa,CAAC,IAAI,SAAS,SAAS,EAAG,KAAI,KAAK,SAAS;AAAA,EAC/D;AACA,QAAM,sBACJ,QAAQ,YAAY,QAAQ,UAAU,SAAS,aAAa,KAC5D,QAAQ,YAAY,OAAO;AAAA,IACzB,CAAC,UAAU,MAAM,OAAO,iBAAiB,MAAM,YAAY,MAAM;AAAA,EACnE;AACF,QAAM,qBACJ,QAAQ,YAAY,QAAQ,UAAU,SAAS,YAAY,KAC3D,QAAQ,YAAY,OAAO;AAAA,IACzB,CAAC,UAAU,MAAM,OAAO,gBAAgB,MAAM,YAAY,MAAM;AAAA,EAClE;AACF,MAAI,qBAAqB;AACvB,eAAW,YAAY,QAAQ,eAAe,iBAAiB,CAAC,GAAG;AACjE,UAAI,aAAa,MAAM,CAAC,mBAAoB;AAC5C,YAAM,oBAAoB,kBAAkB,QAAQ,wBAAwB,QAAQ;AACpF,UACE,CAAC,2BAA2B,mBAAmB,QAAQ,MAAM,KAC7D,6BAA6B,QAAQ,WAAW,mBAAmB,QAAQ,MAAM,GACjF;AACA,YAAI,iBAAiB;AAAA,MACvB;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;","names":["namespace"]}
@@ -41,11 +41,86 @@ function copyBufferTurn(turn) {
41
41
  if (typeof turn.ambientCapture === "boolean") {
42
42
  copy.ambientCapture = turn.ambientCapture;
43
43
  }
44
+ if (turn.sourceValidAt !== void 0) {
45
+ copy.sourceValidAt = turn.sourceValidAt;
46
+ }
47
+ if (turn.parts !== void 0) {
48
+ copy.parts = turn.parts;
49
+ }
50
+ if (turn.rawContent !== void 0) {
51
+ copy.rawContent = turn.rawContent;
52
+ }
53
+ if (turn.sourceFormat !== void 0) {
54
+ copy.sourceFormat = turn.sourceFormat;
55
+ }
56
+ if (turn.writeNamespaceOverride !== void 0) {
57
+ copy.writeNamespaceOverride = turn.writeNamespaceOverride;
58
+ }
59
+ if (turn.principalOverride !== void 0) {
60
+ copy.principalOverride = turn.principalOverride;
61
+ }
62
+ if (turn.scopeProfileWritePlan !== void 0) {
63
+ copy.scopeProfileWritePlan = turn.scopeProfileWritePlan;
64
+ }
65
+ if (turn.acceptedCapture === true) {
66
+ copy.acceptedCapture = true;
67
+ }
68
+ const ctx = turn.codingContext;
69
+ if (ctx) {
70
+ copy.codingContext = {
71
+ projectId: ctx.projectId,
72
+ branch: ctx.branch,
73
+ rootPath: ctx.rootPath,
74
+ defaultBranch: ctx.defaultBranch
75
+ };
76
+ }
44
77
  return copy;
45
78
  }
46
79
  function bufferTurnsEqual(left, right) {
47
80
  if (!left) return false;
48
- return left.role === right.role && left.content === right.content && left.timestamp === right.timestamp && left.sessionKey === right.sessionKey && left.sessionOwnerPrincipal === right.sessionOwnerPrincipal && left.logicalSessionKey === right.logicalSessionKey && left.providerThreadId === right.providerThreadId && left.turnFingerprint === right.turnFingerprint && left.persistProcessedFingerprint === right.persistProcessedFingerprint && left.sourceConnector === right.sourceConnector && left.originRole === right.originRole && left.ambientCapture === right.ambientCapture;
81
+ return left.role === right.role && left.content === right.content && left.timestamp === right.timestamp && left.sessionKey === right.sessionKey && left.sessionOwnerPrincipal === right.sessionOwnerPrincipal && left.logicalSessionKey === right.logicalSessionKey && left.providerThreadId === right.providerThreadId && left.turnFingerprint === right.turnFingerprint && left.persistProcessedFingerprint === right.persistProcessedFingerprint && left.sourceConnector === right.sourceConnector && left.originRole === right.originRole && left.ambientCapture === right.ambientCapture && left.sourceValidAt === right.sourceValidAt && left.acceptedCapture === right.acceptedCapture && left.codingContext?.projectId === right.codingContext?.projectId && left.codingContext?.rootPath === right.codingContext?.rootPath && left.codingContext?.branch === right.codingContext?.branch && left.codingContext?.defaultBranch === right.codingContext?.defaultBranch && // #3251 scope pins compare by identity triple, not deep plan equality: a
82
+ // restart-rehydrated plan must still match the pin it was accepted under.
83
+ left.writeNamespaceOverride === right.writeNamespaceOverride && left.principalOverride === right.principalOverride && scopeProfilePlanIdentity(left.scopeProfileWritePlan) === scopeProfilePlanIdentity(right.scopeProfileWritePlan);
84
+ }
85
+ function selectRetainedDeferredTurns(existing, turns, max, originalTurns) {
86
+ const others = originalTurns === void 0 ? [] : existing.filter(
87
+ (turn) => !originalTurns.some((original) => bufferTurnsEqual(turn, original))
88
+ );
89
+ if (!Array.isArray(turns) || max <= 0) return others;
90
+ return [...others, ...turns.slice(-max).map(copyBufferTurn)];
91
+ }
92
+ function hasPinnedCaptureScope(turn) {
93
+ return turn.acceptedCapture === true || turn.writeNamespaceOverride !== void 0 || turn.scopeProfileWritePlan !== void 0;
94
+ }
95
+ function scopeProfilePlanIdentity(plan) {
96
+ if (!plan) return "";
97
+ return `${plan.profileId}\0${plan.writeLayer}\0${plan.writeNamespace}`;
98
+ }
99
+ function groupTurnsByExtractionScope(turns) {
100
+ const groups = /* @__PURE__ */ new Map();
101
+ for (const turn of turns) {
102
+ const key = [
103
+ turn.writeNamespaceOverride ?? "",
104
+ turn.principalOverride ?? "",
105
+ scopeProfilePlanIdentity(turn.scopeProfileWritePlan),
106
+ turn.codingContext?.projectId ?? "",
107
+ turn.codingContext?.rootPath ?? "",
108
+ turn.codingContext?.branch ?? "",
109
+ turn.codingContext?.defaultBranch ?? ""
110
+ ].join("\0");
111
+ const group = groups.get(key);
112
+ if (group) {
113
+ group.turns.push(turn);
114
+ } else {
115
+ const created = { turns: [turn] };
116
+ if (turn.writeNamespaceOverride !== void 0) created.writeNamespaceOverride = turn.writeNamespaceOverride;
117
+ if (turn.principalOverride !== void 0) created.principalOverride = turn.principalOverride;
118
+ if (turn.scopeProfileWritePlan !== void 0) created.scopeProfileWritePlan = turn.scopeProfileWritePlan;
119
+ if (turn.codingContext !== void 0) created.codingContext = turn.codingContext;
120
+ groups.set(key, created);
121
+ }
122
+ }
123
+ return [...groups.values()];
49
124
  }
50
125
  function bufferTurnArraysEqual(left, right) {
51
126
  return left.length === right.length && left.every((turn, index) => bufferTurnsEqual(turn, right[index]));
@@ -108,6 +183,10 @@ export {
108
183
  describeError,
109
184
  copyBufferTurn,
110
185
  bufferTurnsEqual,
186
+ selectRetainedDeferredTurns,
187
+ hasPinnedCaptureScope,
188
+ scopeProfilePlanIdentity,
189
+ groupTurnsByExtractionScope,
111
190
  bufferTurnArraysEqual,
112
191
  bufferTurnArrayIsSuffixOfSnapshot,
113
192
  liveTurnsFromExtractionSnapshot,
@@ -115,4 +194,4 @@ export {
115
194
  ProbeTimeoutError,
116
195
  probeWithTimeout
117
196
  };
118
- //# sourceMappingURL=chunk-T5IF2ZCE.js.map
197
+ //# sourceMappingURL=chunk-KZMRMKC7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/buffer-turn-helpers.ts"],"sourcesContent":["import type { BufferEntryState, BufferTurn } from \"./types.js\";\n\nexport interface BufferTurnOwner {\n /**\n * Server-resolved principal that owns this session at the authenticated\n * observe/write boundary. Persisted with the buffered turn so lifecycle\n * flushes do not have to infer ownership from a client-chosen session key.\n */\n sessionOwnerPrincipal?: string;\n}\n\nexport interface AmbientCaptureProvenance {\n /**\n * True when this turn's content came from an always-on ambient capture\n * device (a wearable recorder, a room microphone) and may therefore carry\n * speech the user never authored: TV, podcasts, music, overheard\n * conversation (issue #2294). Set by the ingesting subsystem, never from\n * tool arguments — extraction reads it to warn the model about media audio\n * and to clamp high-impact personal facts to the speculative tier.\n */\n ambientCapture?: boolean;\n}\n\nexport function describeError(err: unknown): string {\n if (err instanceof Error) return err.message;\n if (err === null) return \"null\";\n if (err === undefined) return \"undefined\";\n if (typeof err === \"string\") return err;\n try {\n return JSON.stringify(err);\n } catch {\n return String(err);\n }\n}\n\nexport function copyBufferTurn(turn: BufferTurn): BufferTurn {\n const copy: BufferTurn = {\n role: turn.role,\n content: turn.content,\n timestamp: turn.timestamp,\n };\n if (typeof turn.sessionKey === \"string\") copy.sessionKey = turn.sessionKey;\n if (typeof turn.logicalSessionKey === \"string\") {\n copy.logicalSessionKey = turn.logicalSessionKey;\n }\n if (turn.providerThreadId === null || typeof turn.providerThreadId === \"string\") {\n copy.providerThreadId = turn.providerThreadId;\n }\n if (typeof turn.sessionOwnerPrincipal === \"string\") {\n copy.sessionOwnerPrincipal = turn.sessionOwnerPrincipal;\n }\n if (typeof turn.turnFingerprint === \"string\") {\n copy.turnFingerprint = turn.turnFingerprint;\n }\n if (typeof turn.persistProcessedFingerprint === \"boolean\") {\n copy.persistProcessedFingerprint = turn.persistProcessedFingerprint;\n }\n if (typeof turn.sourceConnector === \"string\") {\n copy.sourceConnector = turn.sourceConnector;\n }\n if (turn.originRole === \"user\" || turn.originRole === \"assistant\" || turn.originRole === \"tool\") {\n copy.originRole = turn.originRole;\n }\n if (typeof turn.ambientCapture === \"boolean\") {\n copy.ambientCapture = turn.ambientCapture;\n }\n if (turn.sourceValidAt !== undefined) {\n copy.sourceValidAt = turn.sourceValidAt;\n }\n if (turn.parts !== undefined) {\n copy.parts = turn.parts;\n }\n if (turn.rawContent !== undefined) {\n copy.rawContent = turn.rawContent;\n }\n if (turn.sourceFormat !== undefined) {\n copy.sourceFormat = turn.sourceFormat;\n }\n // #3251 scope pins: strings copy by value; the plan object is an immutable\n // config-derived identity passed by reference.\n if (turn.writeNamespaceOverride !== undefined) {\n copy.writeNamespaceOverride = turn.writeNamespaceOverride;\n }\n if (turn.principalOverride !== undefined) {\n copy.principalOverride = turn.principalOverride;\n }\n if (turn.scopeProfileWritePlan !== undefined) {\n copy.scopeProfileWritePlan = turn.scopeProfileWritePlan;\n }\n if (turn.acceptedCapture === true) {\n copy.acceptedCapture = true;\n }\n const ctx = turn.codingContext;\n if (ctx) {\n // All four fields are identity inputs (branchScope uses branch) — copy\n // explicitly as-is; never a spread of external input.\n copy.codingContext = {\n projectId: ctx.projectId,\n branch: ctx.branch,\n rootPath: ctx.rootPath,\n defaultBranch: ctx.defaultBranch,\n };\n }\n return copy;\n}\n\nexport function bufferTurnsEqual(left: BufferTurn | undefined, right: BufferTurn): boolean {\n if (!left) return false;\n return (\n left.role === right.role &&\n left.content === right.content &&\n left.timestamp === right.timestamp &&\n left.sessionKey === right.sessionKey &&\n left.sessionOwnerPrincipal === right.sessionOwnerPrincipal &&\n left.logicalSessionKey === right.logicalSessionKey &&\n left.providerThreadId === right.providerThreadId &&\n left.turnFingerprint === right.turnFingerprint &&\n left.persistProcessedFingerprint === right.persistProcessedFingerprint &&\n left.sourceConnector === right.sourceConnector &&\n left.originRole === right.originRole &&\n left.ambientCapture === right.ambientCapture &&\n left.sourceValidAt === right.sourceValidAt &&\n left.acceptedCapture === right.acceptedCapture &&\n left.codingContext?.projectId === right.codingContext?.projectId &&\n left.codingContext?.rootPath === right.codingContext?.rootPath &&\n left.codingContext?.branch === right.codingContext?.branch &&\n left.codingContext?.defaultBranch === right.codingContext?.defaultBranch &&\n // #3251 scope pins compare by identity triple, not deep plan equality: a\n // restart-rehydrated plan must still match the pin it was accepted under.\n left.writeNamespaceOverride === right.writeNamespaceOverride &&\n left.principalOverride === right.principalOverride &&\n scopeProfilePlanIdentity(left.scopeProfileWritePlan) ===\n scopeProfilePlanIdentity(right.scopeProfileWritePlan)\n );\n}\n\n/** Replace only the processed snapshot; callers without one retain legacy whole-slot semantics. */\nexport function selectRetainedDeferredTurns(\n existing: readonly BufferTurn[],\n turns: BufferTurn[],\n max: number,\n originalTurns?: readonly BufferTurn[],\n): BufferTurn[] {\n const others = originalTurns === undefined ? [] : existing.filter(\n (turn) => !originalTurns.some((original) => bufferTurnsEqual(turn, original)),\n );\n if (!Array.isArray(turns) || max <= 0) return others;\n return [...others, ...turns.slice(-max).map(copyBufferTurn)];\n}\n\nexport function hasPinnedCaptureScope(turn: BufferTurn): boolean {\n return turn.acceptedCapture === true ||\n turn.writeNamespaceOverride !== undefined ||\n turn.scopeProfileWritePlan !== undefined;\n}\n\n/** Stable identity string for a pinned scope-profile plan (#3251). */\nexport function scopeProfilePlanIdentity(\n plan: BufferTurn[\"scopeProfileWritePlan\"],\n): string {\n if (!plan) return \"\";\n return `${plan.profileId}\\u0000${plan.writeLayer}\\u0000${plan.writeNamespace}`;\n}\n\nexport interface ExtractionScopeGroup {\n writeNamespaceOverride?: string;\n principalOverride?: string;\n scopeProfileWritePlan?: BufferTurn[\"scopeProfileWritePlan\"];\n codingContext?: BufferTurn[\"codingContext\"];\n turns: BufferTurn[];\n}\n\n/**\n * Partition extraction turns by their durable scope pins (#3251). Turns\n * captured under different namespaces / principals / scope profiles /\n * project bindings must never be extracted together — each group runs its\n * own extraction under its own scope. Native (unpinned) turns form their own\n * group and keep today's single-store routing.\n */\nexport function groupTurnsByExtractionScope(turns: BufferTurn[]): ExtractionScopeGroup[] {\n const groups = new Map<string, ExtractionScopeGroup>();\n for (const turn of turns) {\n const key = [\n turn.writeNamespaceOverride ?? \"\",\n turn.principalOverride ?? \"\",\n scopeProfilePlanIdentity(turn.scopeProfileWritePlan),\n turn.codingContext?.projectId ?? \"\",\n turn.codingContext?.rootPath ?? \"\",\n turn.codingContext?.branch ?? \"\",\n turn.codingContext?.defaultBranch ?? \"\",\n ].join(\"\\u0000\");\n const group = groups.get(key);\n if (group) {\n group.turns.push(turn);\n } else {\n const created: ExtractionScopeGroup = { turns: [turn] };\n if (turn.writeNamespaceOverride !== undefined) created.writeNamespaceOverride = turn.writeNamespaceOverride;\n if (turn.principalOverride !== undefined) created.principalOverride = turn.principalOverride;\n if (turn.scopeProfileWritePlan !== undefined) created.scopeProfileWritePlan = turn.scopeProfileWritePlan;\n if (turn.codingContext !== undefined) created.codingContext = turn.codingContext;\n groups.set(key, created);\n }\n }\n return [...groups.values()];\n}\n\nexport function bufferTurnArraysEqual(\n left: readonly BufferTurn[],\n right: readonly BufferTurn[],\n): boolean {\n return left.length === right.length && left.every((turn, index) => bufferTurnsEqual(turn, right[index]));\n}\n\nexport function bufferTurnArrayIsSuffixOfSnapshot(\n liveTurns: readonly BufferTurn[],\n snapshot: readonly BufferTurn[],\n): boolean {\n if (liveTurns.length === 0 || liveTurns.length > snapshot.length) {\n return false;\n }\n const offset = snapshot.length - liveTurns.length;\n return liveTurns.every((turn, index) => bufferTurnsEqual(turn, snapshot[offset + index]));\n}\n\nexport function liveTurnsFromExtractionSnapshot(\n entry: BufferEntryState,\n extractedTurns: readonly BufferTurn[],\n): readonly BufferTurn[] {\n const retainedTurns = entry.retainedTurns ?? [];\n if (\n retainedTurns.length > 0 &&\n extractedTurns.length >= retainedTurns.length &&\n retainedTurns.every((turn, index) => bufferTurnsEqual(extractedTurns[index], turn))\n ) {\n const withoutRetainedPrefix = extractedTurns.slice(retainedTurns.length);\n if (withoutRetainedPrefix.length > 0 && matchingPrefixLength(entry.turns, withoutRetainedPrefix) > 0) {\n return withoutRetainedPrefix;\n }\n }\n return extractedTurns;\n}\n\nfunction matchingPrefixLength(\n liveTurns: readonly BufferTurn[],\n extractedTurns: readonly BufferTurn[],\n): number {\n let index = 0;\n while (\n index < liveTurns.length &&\n index < extractedTurns.length &&\n bufferTurnsEqual(liveTurns[index], extractedTurns[index])\n ) {\n index += 1;\n }\n return index;\n}\n\nexport function matchingQueuedExtractionPrefixLength(\n liveTurns: readonly BufferTurn[],\n extractedTurns: readonly BufferTurn[],\n): number {\n let bestMatchedCount = 0;\n for (let start = 0; start < extractedTurns.length; start += 1) {\n const matchedCount = matchingPrefixLength(liveTurns, extractedTurns.slice(start));\n if (matchedCount > bestMatchedCount) {\n bestMatchedCount = matchedCount;\n if (bestMatchedCount === liveTurns.length) break;\n }\n }\n return bestMatchedCount;\n}\n\nexport class ProbeTimeoutError extends Error {\n constructor(timeoutMs: number) {\n super(`probe exceeded ${timeoutMs}ms`);\n this.name = \"ProbeTimeoutError\";\n }\n}\n\nexport function probeWithTimeout<T>(inflight: Promise<T>, timeoutMs: number): Promise<T> {\n let timer: NodeJS.Timeout | null = null;\n const timeout = new Promise<T>((_, reject) => {\n timer = setTimeout(() => reject(new ProbeTimeoutError(timeoutMs)), timeoutMs);\n if (typeof (timer as NodeJS.Timeout).unref === \"function\") {\n (timer as NodeJS.Timeout).unref();\n }\n });\n return Promise.race([inflight, timeout]).finally(() => {\n if (timer) clearTimeout(timer);\n });\n}\n"],"mappings":";AAuBO,SAAS,cAAc,KAAsB;AAClD,MAAI,eAAe,MAAO,QAAO,IAAI;AACrC,MAAI,QAAQ,KAAM,QAAO;AACzB,MAAI,QAAQ,OAAW,QAAO;AAC9B,MAAI,OAAO,QAAQ,SAAU,QAAO;AACpC,MAAI;AACF,WAAO,KAAK,UAAU,GAAG;AAAA,EAC3B,QAAQ;AACN,WAAO,OAAO,GAAG;AAAA,EACnB;AACF;AAEO,SAAS,eAAe,MAA8B;AAC3D,QAAM,OAAmB;AAAA,IACvB,MAAM,KAAK;AAAA,IACX,SAAS,KAAK;AAAA,IACd,WAAW,KAAK;AAAA,EAClB;AACA,MAAI,OAAO,KAAK,eAAe,SAAU,MAAK,aAAa,KAAK;AAChE,MAAI,OAAO,KAAK,sBAAsB,UAAU;AAC9C,SAAK,oBAAoB,KAAK;AAAA,EAChC;AACA,MAAI,KAAK,qBAAqB,QAAQ,OAAO,KAAK,qBAAqB,UAAU;AAC/E,SAAK,mBAAmB,KAAK;AAAA,EAC/B;AACA,MAAI,OAAO,KAAK,0BAA0B,UAAU;AAClD,SAAK,wBAAwB,KAAK;AAAA,EACpC;AACA,MAAI,OAAO,KAAK,oBAAoB,UAAU;AAC5C,SAAK,kBAAkB,KAAK;AAAA,EAC9B;AACA,MAAI,OAAO,KAAK,gCAAgC,WAAW;AACzD,SAAK,8BAA8B,KAAK;AAAA,EAC1C;AACA,MAAI,OAAO,KAAK,oBAAoB,UAAU;AAC5C,SAAK,kBAAkB,KAAK;AAAA,EAC9B;AACA,MAAI,KAAK,eAAe,UAAU,KAAK,eAAe,eAAe,KAAK,eAAe,QAAQ;AAC/F,SAAK,aAAa,KAAK;AAAA,EACzB;AACA,MAAI,O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AAI,QAAQ;AACZ,SACE,QAAQ,UAAU,UAClB,QAAQ,eAAe,UACvB,iBAAiB,UAAU,KAAK,GAAG,eAAe,KAAK,CAAC,GACxD;AACA,aAAS;AAAA,EACX;AACA,SAAO;AACT;AAEO,SAAS,qCACd,WACA,gBACQ;AACR,MAAI,mBAAmB;AACvB,WAAS,QAAQ,GAAG,QAAQ,eAAe,QAAQ,SAAS,GAAG;AAC7D,UAAM,eAAe,qBAAqB,WAAW,eAAe,MAAM,KAAK,CAAC;AAChF,QAAI,eAAe,kBAAkB;AACnC,yBAAmB;AACnB,UAAI,qBAAqB,UAAU,OAAQ;AAAA,IAC7C;AAAA,EACF;AACA,SAAO;AACT;AAEO,IAAM,oBAAN,cAAgC,MAAM;AAAA,EAC3C,YAAY,WAAmB;AAC7B,UAAM,kBAAkB,SAAS,IAAI;AACrC,SAAK,OAAO;AAAA,EACd;AACF;AAEO,SAAS,iBAAoB,UAAsB,WAA+B;AACvF,MAAI,QAA+B;AACnC,QAAM,UAAU,IAAI,QAAW,CAAC,GAAG,WAAW;AAC5C,YAAQ,WAAW,MAAM,OAAO,IAAI,kBAAkB,SAAS,CAAC,GAAG,SAAS;AAC5E,QAAI,OAAQ,MAAyB,UAAU,YAAY;AACzD,MAAC,MAAyB,MAAM;AAAA,IAClC;AAAA,EACF,CAAC;AACD,SAAO,QAAQ,KAAK,CAAC,UAAU,OAAO,CAAC,EAAE,QAAQ,MAAM;AACrD,QAAI,MAAO,cAAa,KAAK;AAAA,EAC/B,CAAC;AACH;","names":[]}
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  parseXrayFormat
3
- } from "./chunk-RRJ462HP.js";
3
+ } from "./chunk-O6YJI5VX.js";
4
4
  import {
5
5
  RECALL_DISCLOSURE_LEVELS,
6
6
  isRecallDisclosure
7
- } from "./chunk-LDXNKEYB.js";
7
+ } from "./chunk-A6PKEU7T.js";
8
8
 
9
9
  // src/recall-xray-cli.ts
10
10
  function parseXrayDisclosureFlag(value) {
@@ -50,4 +50,4 @@ export {
50
50
  parseXrayBudgetFlag,
51
51
  parseXrayCliOptions
52
52
  };
53
- //# sourceMappingURL=chunk-NPO4ZQFY.js.map
53
+ //# sourceMappingURL=chunk-LDXS746V.js.map
@@ -15,7 +15,7 @@ import {
15
15
  } from "./chunk-PL26BCRN.js";
16
16
  import {
17
17
  resolveScopeProfilePlan
18
- } from "./chunk-WC3V7HHP.js";
18
+ } from "./chunk-KJZKO2M6.js";
19
19
  import {
20
20
  parseFlexibleIsoTimestamp
21
21
  } from "./chunk-P7FMDTKL.js";
@@ -1015,7 +1015,7 @@ ${normalized}`).digest("hex");
1015
1015
  getDeferredCount: () => this.deps.getLastPersistExtractionDeferredCount(),
1016
1016
  normalizedTurns,
1017
1017
  bufferKey,
1018
- retainDeferredTurns: (key, retainedTurns, max) => this.deps.getBuffer().retainDeferredTurns(key, retainedTurns, max),
1018
+ retainDeferredTurns: (key, retainedTurns, max) => this.deps.getBuffer().retainDeferredTurns(key, retainedTurns, max, turns),
1019
1019
  clearBuffer,
1020
1020
  failOnExtractionFailure: options.failOnExtractionFailure === true
1021
1021
  });
@@ -1093,4 +1093,4 @@ export {
1093
1093
  ExtractionDeadlineError,
1094
1094
  ExtractionRunCoordinator
1095
1095
  };
1096
- //# sourceMappingURL=chunk-UTXYOWDR.js.map
1096
+ //# sourceMappingURL=chunk-LGR54NYT.js.map