@cortexkit/opencode-magic-context 0.49.93 → 0.49.96

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 (256) hide show
  1. package/dist/{announcement-4ynkaf0d.js → announcement-8nj2jd87.js} +5 -5
  2. package/dist/auto-search-worker.js +5 -5
  3. package/dist/chunk-embedding-write-worker.js +16 -16
  4. package/dist/{compaction-marker-candidates-1ndjqh9k.js → compaction-marker-candidates-a4b0anvv.js} +3 -3
  5. package/dist/compaction-marker-candidates-worker.js +1 -1
  6. package/dist/{compartment-chunk-embedding-rp4asvk0.js → compartment-chunk-embedding-re2cw7y3.js} +8 -8
  7. package/dist/config/removed-agent-config.d.ts +1 -1
  8. package/dist/config/removed-agent-config.d.ts.map +1 -1
  9. package/dist/config/schema/magic-context.d.ts +0 -75
  10. package/dist/config/schema/magic-context.d.ts.map +1 -1
  11. package/dist/{conflict-warning-hook-exf96bpt.js → conflict-warning-hook-wcq55y61.js} +8 -8
  12. package/dist/{context-jpxthqxg.js → context-gtjdrp8f.js} +237 -140
  13. package/dist/{derive-budgets-hzzq71rm.js → derive-budgets-g1sy72e8.js} +5 -5
  14. package/dist/embedding-backfill-pdymqbnh.js +29 -0
  15. package/dist/embedding-worker-process.js +2 -2
  16. package/dist/embedding-worker.js +8 -8
  17. package/dist/features/magic-context/compartment-storage.d.ts.map +1 -1
  18. package/dist/features/magic-context/dreamer/docs-proposals.d.ts +5 -2
  19. package/dist/features/magic-context/dreamer/docs-proposals.d.ts.map +1 -1
  20. package/dist/features/magic-context/dreamer/token-budget.d.ts +2 -2
  21. package/dist/features/magic-context/dreamer/token-budget.d.ts.map +1 -1
  22. package/dist/features/magic-context/history-gap-recovery.d.ts +42 -0
  23. package/dist/features/magic-context/history-gap-recovery.d.ts.map +1 -0
  24. package/dist/features/magic-context/memory/embedding-synapse.d.ts +18 -5
  25. package/dist/features/magic-context/memory/embedding-synapse.d.ts.map +1 -1
  26. package/dist/features/magic-context/message-visibility.d.ts +10 -0
  27. package/dist/features/magic-context/message-visibility.d.ts.map +1 -0
  28. package/dist/features/magic-context/search-rerank.d.ts +2 -2
  29. package/dist/features/magic-context/search-rerank.d.ts.map +1 -1
  30. package/dist/features/magic-context/search.d.ts +4 -0
  31. package/dist/features/magic-context/search.d.ts.map +1 -1
  32. package/dist/features/magic-context/session-decision-calibration.d.ts.map +1 -1
  33. package/dist/features/magic-context/session-project-backfill.d.ts.map +1 -1
  34. package/dist/features/magic-context/store-generation-rebase.d.ts.map +1 -1
  35. package/dist/{history-owner-xqfsvf9k.js → history-owner-74826t4n.js} +3 -3
  36. package/dist/hooks/magic-context/compartment-runner-recomp.d.ts.map +1 -1
  37. package/dist/hooks/magic-context/compartment-trigger.d.ts +1 -1
  38. package/dist/hooks/magic-context/compartment-trigger.d.ts.map +1 -1
  39. package/dist/hooks/magic-context/history-boundary-repair.d.ts +2 -2
  40. package/dist/hooks/magic-context/history-boundary-repair.d.ts.map +1 -1
  41. package/dist/hooks/magic-context/hook.d.ts.map +1 -1
  42. package/dist/hooks/magic-context/inject-compartments.d.ts +6 -1
  43. package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
  44. package/dist/hooks/magic-context/lkg-persist.d.ts +3 -1
  45. package/dist/hooks/magic-context/lkg-persist.d.ts.map +1 -1
  46. package/dist/hooks/magic-context/lkg-recovery-fence.d.ts +1 -0
  47. package/dist/hooks/magic-context/lkg-recovery-fence.d.ts.map +1 -1
  48. package/dist/hooks/magic-context/lkg-replay.d.ts +3 -0
  49. package/dist/hooks/magic-context/lkg-replay.d.ts.map +1 -1
  50. package/dist/hooks/magic-context/raw-ordinal-warmup.d.ts +1 -0
  51. package/dist/hooks/magic-context/raw-ordinal-warmup.d.ts.map +1 -1
  52. package/dist/hooks/magic-context/tail-hygiene-output-count.d.ts +4 -0
  53. package/dist/hooks/magic-context/tail-hygiene-output-count.d.ts.map +1 -1
  54. package/dist/hooks/magic-context/tail-hygiene-walk.d.ts +2 -0
  55. package/dist/hooks/magic-context/tail-hygiene-walk.d.ts.map +1 -1
  56. package/dist/hooks/magic-context/transform-compartment-phase.d.ts +2 -1
  57. package/dist/hooks/magic-context/transform-compartment-phase.d.ts.map +1 -1
  58. package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +1 -0
  59. package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
  60. package/dist/hooks/magic-context/transform-stage-logger.d.ts +6 -0
  61. package/dist/hooks/magic-context/transform-stage-logger.d.ts.map +1 -1
  62. package/dist/hooks/magic-context/transform.d.ts +2 -0
  63. package/dist/hooks/magic-context/transform.d.ts.map +1 -1
  64. package/dist/{index-5zrzg8r1.js → index-0bjj9yf3.js} +2 -2
  65. package/dist/{index-g9qtxv87.js → index-0sqhg9nf.js} +132 -64
  66. package/dist/{index-nxxzeq4y.js → index-0ve29s6f.js} +1 -1
  67. package/dist/{index-g6y2wk32.js → index-2afrmgy3.js} +6 -6
  68. package/dist/{index-ywrz4wy2.js → index-3fhb0j32.js} +1 -1
  69. package/dist/{index-gqf8r04r.js → index-3n4j5rqc.js} +1 -1
  70. package/dist/{index-xsqw8kbd.js → index-45qgkg8j.js} +2 -2
  71. package/dist/{index-5df2fw5b.js → index-6mryx739.js} +1 -1
  72. package/dist/{index-n9kd68vc.js → index-7m2tnk8q.js} +10 -10
  73. package/dist/{index-r4y0dczp.js → index-7sdns2ww.js} +2 -2
  74. package/dist/{index-mjy2k9jr.js → index-880a24vd.js} +1 -1
  75. package/dist/{index-pnawfv4e.js → index-89bkkgcn.js} +4 -4
  76. package/dist/{index-s32f8y67.js → index-89xg64wb.js} +2 -2
  77. package/dist/{index-hee64h6k.js → index-8sgv96kq.js} +7 -7
  78. package/dist/{index-ttdk2w0z.js → index-910gahfb.js} +6 -6
  79. package/dist/{index-kty5k23y.js → index-9jvxq5rt.js} +4 -4
  80. package/dist/{index-832w615x.js → index-azkfw78y.js} +1 -1
  81. package/dist/{index-wh9fxds5.js → index-c205x7xd.js} +1 -1
  82. package/dist/{index-mg9s2rc3.js → index-cpbr0xvk.js} +2 -2
  83. package/dist/{index-g5c67kay.js → index-cq8znmyw.js} +17 -17
  84. package/dist/{index-cr483vx6.js → index-dj64gzg5.js} +2 -2
  85. package/dist/{index-jba6ny4m.js → index-dnpcv1rg.js} +4 -4
  86. package/dist/{index-z4p0ry94.js → index-dt7cyqfe.js} +2 -1
  87. package/dist/{index-j2w79s9r.js → index-e6ay1gez.js} +2 -2
  88. package/dist/{index-y2vshk67.js → index-f154w8m4.js} +229 -84
  89. package/dist/{index-6r99v53h.js → index-fgw241hh.js} +164 -62
  90. package/dist/{index-rz47hf2m.js → index-fvfnq8n6.js} +30 -14
  91. package/dist/{index-yqha238s.js → index-gnrwgvn7.js} +127 -17
  92. package/dist/{index-fpjnjxyx.js → index-h7kta6cn.js} +3 -3
  93. package/dist/{index-q7q6qp1f.js → index-hedgz8an.js} +1 -1
  94. package/dist/{index-5pgyqgmx.js → index-hj78hvhm.js} +2 -2
  95. package/dist/{index-dr6bd4c8.js → index-hp46xe93.js} +7 -7
  96. package/dist/{index-0twg41mh.js → index-j4dcjb8t.js} +4 -4
  97. package/dist/{index-e6ncz7a6.js → index-jzrvdqb8.js} +1 -1
  98. package/dist/{index-sp5pvs95.js → index-k34hc455.js} +2 -2
  99. package/dist/{index-9ffntwyr.js → index-kj4bprep.js} +4 -4
  100. package/dist/index-mgy7g740.js +119 -0
  101. package/dist/{index-za1yx1m4.js → index-nqdwpdje.js} +154 -32
  102. package/dist/{index-hes3k87g.js → index-r1d45dsr.js} +4 -4
  103. package/dist/{index-y915t3ey.js → index-r3f85n7y.js} +5 -1
  104. package/dist/{index-1kem0xxx.js → index-t2e10rag.js} +5 -5
  105. package/dist/{index-m0pwswv9.js → index-tqtpgnhr.js} +1 -1
  106. package/dist/{index-01h7tqe3.js → index-tr4ep2ej.js} +21 -6
  107. package/dist/{index-xr1t0fxb.js → index-w7n7qkpf.js} +49 -13
  108. package/dist/{index-s7460efs.js → index-zfx7mtqa.js} +1 -1
  109. package/dist/{index-gqfy38m9.js → index-zkjx8gq3.js} +11 -11
  110. package/dist/{index-et39x9k3.js → index-zmgp0tr6.js} +3 -3
  111. package/dist/index.js +59 -56
  112. package/dist/{logger-d7c8akh9.js → logger-nmb2508f.js} +2 -2
  113. package/dist/{message-fts-rowid-map-0xx8ge09.js → message-fts-rowid-map-vcatdan0.js} +5 -5
  114. package/dist/{message-index-bounded-vjrnptar.js → message-index-bounded-abhwe610.js} +12 -12
  115. package/dist/{message-time-backfill-pz5981mf.js → message-time-backfill-zc5rsvhv.js} +3 -3
  116. package/dist/migration-worker.js +13 -13
  117. package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
  118. package/dist/{project-embedding-registry-m8zcmrsg.js → project-embedding-registry-e566q4bg.js} +15 -15
  119. package/dist/raw-ordinal-warmup-worker.js +9 -9
  120. package/dist/{read-session-chunk-zkzdc0e5.js → read-session-chunk-sde0wym3.js} +10 -10
  121. package/dist/{read-session-raw-3sc9231y.js → read-session-raw-trhdgc9z.js} +3 -3
  122. package/dist/recomp-orchestrator-d3rbpa59.js +69 -0
  123. package/dist/render-6cf1dgc4.js +43 -0
  124. package/dist/{safe-notification-target-d21swr3n.js → safe-notification-target-54ns7dv9.js} +3 -3
  125. package/dist/{search-e9bb9hpx.js → search-11aw8wpq.js} +27 -27
  126. package/dist/search-archive-s9m5szf0.js +29 -0
  127. package/dist/{send-session-notification-0779tyd9.js → send-session-notification-gxrj4w1r.js} +6 -6
  128. package/dist/shared/host-sqlite-runtime.d.ts +3 -0
  129. package/dist/shared/host-sqlite-runtime.d.ts.map +1 -0
  130. package/dist/shared/redaction.d.ts.map +1 -1
  131. package/dist/shared/storage-file-mutex.d.ts.map +1 -1
  132. package/dist/{storage-tags-gk7gjkqt.js → storage-tags-jq0c0zsn.js} +7 -7
  133. package/dist/{store-yr443ye8.js → store-29ksp6vy.js} +4 -4
  134. package/dist/{store-reader-qbq6q4v0.js → store-reader-dgh3ssxx.js} +1 -1
  135. package/dist/tools/ctx-expand/search-archive.d.ts +3 -2
  136. package/dist/tools/ctx-expand/search-archive.d.ts.map +1 -1
  137. package/dist/tools/ctx-expand/tools.d.ts.map +1 -1
  138. package/dist/tools/ctx-expand/v2-archive-reader.d.ts +2 -0
  139. package/dist/tools/ctx-expand/v2-archive-reader.d.ts.map +1 -1
  140. package/dist/tools/ctx-search/tools.d.ts.map +1 -1
  141. package/dist/{transform-postprocess-phase-neds90e3.js → transform-postprocess-phase-376xn40x.js} +35 -35
  142. package/dist/v2/auto-search-worker.js +5 -5
  143. package/dist/v2/chunk-embedding-write-worker.js +16 -16
  144. package/dist/v2/{compaction-marker-candidates-bp1bn579.js → compaction-marker-candidates-6nypmsr3.js} +3 -3
  145. package/dist/v2/compaction-marker-candidates-worker.js +1 -1
  146. package/dist/v2/{compartment-chunk-embedding-w7ht0t9v.js → compartment-chunk-embedding-jthtfhcd.js} +8 -8
  147. package/dist/v2/{context-ctsd80vc.js → context-vm09agrs.js} +426 -185
  148. package/dist/v2/{derive-budgets-hr4qqrnv.js → derive-budgets-wj0q7s7d.js} +6 -6
  149. package/dist/v2/embedding-backfill-16b16m38.js +29 -0
  150. package/dist/v2/embedding-worker-process.js +2 -2
  151. package/dist/v2/embedding-worker.js +8 -8
  152. package/dist/v2/fold/memory-cache.d.ts +2 -0
  153. package/dist/v2/fold/memory-cache.d.ts.map +1 -1
  154. package/dist/v2/fold/native-replay.d.ts +23 -5
  155. package/dist/v2/fold/native-replay.d.ts.map +1 -1
  156. package/dist/v2/hidden-child-native.d.ts.map +1 -1
  157. package/dist/v2/hidden-child-record.d.ts +8 -0
  158. package/dist/v2/hidden-child-record.d.ts.map +1 -1
  159. package/dist/v2/hidden-completion.d.ts.map +1 -1
  160. package/dist/v2/hidden-run-holder.d.ts +8 -2
  161. package/dist/v2/hidden-run-holder.d.ts.map +1 -1
  162. package/dist/v2/{history-owner-260djmv5.js → history-owner-8pd5ax3n.js} +3 -3
  163. package/dist/v2/hooks/context.d.ts.map +1 -1
  164. package/dist/v2/hooks/hidden-child.d.ts +3 -0
  165. package/dist/v2/hooks/hidden-child.d.ts.map +1 -1
  166. package/dist/v2/hooks/revert-message-state.d.ts.map +1 -1
  167. package/dist/v2/hooks/session-project-backfill.d.ts +2 -1
  168. package/dist/v2/hooks/session-project-backfill.d.ts.map +1 -1
  169. package/dist/v2/{logger-zyf43np1.js → logger-58jfese9.js} +2 -2
  170. package/dist/v2/{message-fts-rowid-map-n8mcvcpz.js → message-fts-rowid-map-ax4vk78j.js} +5 -5
  171. package/dist/v2/{message-index-bounded-1vew9c37.js → message-index-bounded-qh794qxx.js} +12 -12
  172. package/dist/v2/{message-time-backfill-ynb3vg6r.js → message-time-backfill-yj773saf.js} +3 -3
  173. package/dist/v2/migration-worker.js +13 -13
  174. package/dist/v2/{project-embedding-registry-je5jam7y.js → project-embedding-registry-z05xvckg.js} +15 -15
  175. package/dist/v2/raw-ordinal-warmup-worker.js +9 -9
  176. package/dist/v2/{read-session-chunk-09sre4xv.js → read-session-chunk-8tn2dbn1.js} +10 -10
  177. package/dist/v2/{read-session-raw-wg5zc29f.js → read-session-raw-ywebck9q.js} +3 -3
  178. package/dist/v2/recomp-orchestrator-pfjpzdrb.js +69 -0
  179. package/dist/v2/render-7t5d7hkv.js +43 -0
  180. package/dist/v2/{safe-notification-target-y55z2zat.js → safe-notification-target-zrwbh6k7.js} +3 -3
  181. package/dist/v2/{search-gmye6n25.js → search-35cz80x0.js} +26 -26
  182. package/dist/v2/search-archive-5dpxv0ck.js +29 -0
  183. package/dist/v2/{send-session-notification-v69y04f5.js → send-session-notification-8x146x5y.js} +6 -6
  184. package/dist/v2/{server-z9czv2vb.js → server-11ra1pmx.js} +49 -13
  185. package/dist/v2/{server-gs2251jr.js → server-2cq3e1c1.js} +4 -4
  186. package/dist/v2/{server-39bcszk4.js → server-2qvnr3t7.js} +1 -1
  187. package/dist/v2/{server-jkj1dq6j.js → server-2sare4qg.js} +4 -4
  188. package/dist/v2/{server-jdfe07mp.js → server-2wz6y46g.js} +1 -1
  189. package/dist/v2/{server-at0v0z4t.js → server-379fd3n7.js} +1 -1
  190. package/dist/v2/{server-ds8vpfkr.js → server-40vdz8sf.js} +2 -2
  191. package/dist/v2/{server-qntmqaca.js → server-4yrvbnnm.js} +2 -2
  192. package/dist/v2/{server-x69fqsvz.js → server-5t4nzfpt.js} +1 -1
  193. package/dist/v2/{server-npdey91q.js → server-63ree5ns.js} +1 -1
  194. package/dist/v2/{server-gqkdfdvw.js → server-6qax5pds.js} +2 -2
  195. package/dist/v2/{server-qb3s0mnc.js → server-73bqw5c0.js} +1 -1
  196. package/dist/v2/{server-6chcnnhq.js → server-7h4gwphm.js} +4 -4
  197. package/dist/v2/{server-rkj44mez.js → server-7tj8yzrv.js} +2 -2
  198. package/dist/v2/{server-e6xneh68.js → server-arfzfxe8.js} +5 -1
  199. package/dist/v2/{server-6ash6z8z.js → server-av3p9c8k.js} +1 -1
  200. package/dist/v2/{server-5hwf5c7r.js → server-bx5k66qc.js} +1 -1
  201. package/dist/v2/{server-dgsjamm4.js → server-db91dxwc.js} +7 -7
  202. package/dist/v2/{server-z4p0ry94.js → server-dt7cyqfe.js} +2 -1
  203. package/dist/v2/{server-k1xc2bw1.js → server-ganavh75.js} +2 -2
  204. package/dist/v2/{server-6x40bnb7.js → server-gh2w75fn.js} +3 -3
  205. package/dist/v2/server-j1gxs1gj.js +119 -0
  206. package/dist/v2/{server-ps6zrzwj.js → server-k3ntgf6n.js} +164 -62
  207. package/dist/v2/{server-j8376q08.js → server-kzrrdjp5.js} +1 -1
  208. package/dist/v2/{server-1rrmxhd1.js → server-n33hyq9t.js} +2 -2
  209. package/dist/v2/{server-0tv6kytx.js → server-n34vzyfm.js} +1 -1
  210. package/dist/v2/{server-vc5fta6s.js → server-nnh81jqy.js} +6 -6
  211. package/dist/v2/{server-g53asaqt.js → server-pcq2d1wh.js} +30 -14
  212. package/dist/v2/{server-bnkc9kph.js → server-ppy2dj7g.js} +6 -6
  213. package/dist/v2/{server-96nm9vk4.js → server-rr5c0xcg.js} +2 -2
  214. package/dist/v2/{server-j4jjtdc5.js → server-rt8t6s2a.js} +2 -2
  215. package/dist/v2/{server-2xm0gxke.js → server-svccj9rd.js} +4 -4
  216. package/dist/v2/{server-5sbsnpkn.js → server-tq523gj6.js} +1 -1
  217. package/dist/v2/{server-00adcfjd.js → server-vj0xbbrc.js} +17 -3
  218. package/dist/v2/{server-4ecpanyn.js → server-vntc961c.js} +127 -17
  219. package/dist/v2/{server-btgnkr9z.js → server-vsx9tsks.js} +11 -11
  220. package/dist/v2/{server-vtgeyhq6.js → server-vtkbxzw1.js} +21 -6
  221. package/dist/v2/{server-cvp9w5gs.js → server-w35ep6wn.js} +192 -84
  222. package/dist/v2/{server-myp4pc6x.js → server-z2nv8jdv.js} +132 -64
  223. package/dist/v2/{server-pcarsvj2.js → server-z5cv5wm5.js} +10 -10
  224. package/dist/v2/{server-barj0mjz.js → server-zemnpv92.js} +4 -4
  225. package/dist/v2/server.js +9 -9
  226. package/dist/v2/{storage-tags-nccqr0kr.js → storage-tags-pcenytad.js} +7 -7
  227. package/dist/v2/{store-enef5jcn.js → store-gx19qc3a.js} +4 -4
  228. package/dist/v2/{store-reader-jbaqv1yp.js → store-reader-qt2msa8z.js} +1 -1
  229. package/dist/v2/store-reader.d.ts +1 -1
  230. package/dist/v2/store-reader.d.ts.map +1 -1
  231. package/dist/v2/{v2-archive-reader-7vmng8q7.js → v2-archive-reader-jqrwz7b8.js} +1 -1
  232. package/dist/v2/{wrapup-orchestrator-7r4y0bf6.js → wrapup-orchestrator-kcq3cv7y.js} +35 -35
  233. package/dist/{v2-archive-reader-7s90gfax.js → v2-archive-reader-64h2gtam.js} +1 -1
  234. package/dist/wrapup-orchestrator-knyac7jp.js +56 -0
  235. package/package.json +1 -1
  236. package/src/config/index.test.ts +23 -5
  237. package/src/config/live-run-config.test.ts +7 -7
  238. package/src/config/removed-agent-config.ts +14 -1
  239. package/src/config/schema/magic-context.ts +5 -1
  240. package/src/shared/host-sqlite-runtime.test.ts +21 -0
  241. package/src/shared/host-sqlite-runtime.ts +32 -0
  242. package/src/shared/redaction.test.ts +11 -8
  243. package/src/shared/redaction.ts +5 -1
  244. package/src/shared/storage-file-mutex-review.test.ts +110 -0
  245. package/src/shared/storage-file-mutex.ts +12 -0
  246. package/dist/embedding-backfill-6wzc4p2n.js +0 -29
  247. package/dist/index-52x68mj4.js +0 -58
  248. package/dist/recomp-orchestrator-qb2hymj5.js +0 -69
  249. package/dist/render-34p0kek8.js +0 -43
  250. package/dist/search-archive-08ppk0q5.js +0 -27
  251. package/dist/v2/embedding-backfill-40g0anxh.js +0 -29
  252. package/dist/v2/recomp-orchestrator-mgcty3we.js +0 -69
  253. package/dist/v2/render-ygcmyn9x.js +0 -43
  254. package/dist/v2/search-archive-nrsqqmk5.js +0 -27
  255. package/dist/v2/server-52x68mj4.js +0 -58
  256. package/dist/wrapup-orchestrator-m2p89973.js +0 -56
@@ -35,7 +35,7 @@ import {
35
35
  getRawSessionTagKeysThrough2,
36
36
  getLegacyProtectedTailStartOrdinal2,
37
37
  readSessionChunk2
38
- } from "./index-dr6bd4c8.js";
38
+ } from "./index-hp46xe93.js";
39
39
  import {
40
40
  getHarness2,
41
41
  harnessOwnsOpenCodeStore2
@@ -44,10 +44,10 @@ import {
44
44
  getMagicContextHistorianSessionDir,
45
45
  log2,
46
46
  sessionLog2
47
- } from "./index-ywrz4wy2.js";
47
+ } from "./index-3fhb0j32.js";
48
48
  import {
49
49
  sanitizeDiagnosticText
50
- } from "./index-z4p0ry94.js";
50
+ } from "./index-dt7cyqfe.js";
51
51
  import {
52
52
  createScanner,
53
53
  parseTree,
@@ -64,7 +64,7 @@ import {
64
64
  import {
65
65
  ensureStorageDirectorySync,
66
66
  writeStorageFileAtomicSync
67
- } from "./index-5df2fw5b.js";
67
+ } from "./index-6mryx739.js";
68
68
  import {
69
69
  catalogOutputReserve,
70
70
  setOutputReserveConfig,
@@ -74,7 +74,7 @@ import {
74
74
  deriveTriggerBudget2,
75
75
  resolveHistorianProducerLimits2,
76
76
  producerSourceLocalBudget2
77
- } from "./index-xsqw8kbd.js";
77
+ } from "./index-45qgkg8j.js";
78
78
  import {
79
79
  isCompactionEnabled,
80
80
  migrateLegacyAgentEnabledInMemory,
@@ -93,7 +93,7 @@ import {
93
93
  ConfigProfilesSchema,
94
94
  MagicContextConfigSchema,
95
95
  LIVE_RELOAD_CONFIG_PATHS
96
- } from "./index-y915t3ey.js";
96
+ } from "./index-r3f85n7y.js";
97
97
  import {
98
98
  providerMass,
99
99
  calibrationForModelKey,
@@ -102,11 +102,12 @@ import {
102
102
  import {
103
103
  hasMeaningfulUserText2,
104
104
  estimateTokens,
105
+ createTokenCountMemo,
105
106
  estimateFixedPromptTokens
106
- } from "./index-s7460efs.js";
107
+ } from "./index-zfx7mtqa.js";
107
108
  import {
108
109
  FAIL_CLOSED_DOCTOR_COMMAND
109
- } from "./index-wh9fxds5.js";
110
+ } from "./index-c205x7xd.js";
110
111
  import {
111
112
  inRootAsyncContext2,
112
113
  Database2,
@@ -117,13 +118,13 @@ import {
117
118
  import {
118
119
  shouldSkipHomeProjectMemory,
119
120
  resolveProjectIdentity
120
- } from "./index-5pgyqgmx.js";
121
+ } from "./index-hj78hvhm.js";
121
122
  import {
122
123
  getSchemaFenceRejection,
123
124
  LATEST_SUPPORTED_VERSION,
124
125
  getPersistedSchemaVersion,
125
126
  openDatabase
126
- } from "./index-gqfy38m9.js";
127
+ } from "./index-zkjx8gq3.js";
127
128
  import {
128
129
  areRustHistorianSyntheticParts2,
129
130
  isStrictGapHealingMessage2,
@@ -131,7 +132,7 @@ import {
131
132
  RawOrdinalsNotReady2,
132
133
  dropRawSessionOrdinalCheckpoints2,
133
134
  runSessionWarmupWorker
134
- } from "./index-q7q6qp1f.js";
135
+ } from "./index-hedgz8an.js";
135
136
  import {
136
137
  parseCompartmentOutput,
137
138
  resolveWorkspaceShareCategories,
@@ -140,10 +141,10 @@ import {
140
141
  resolveStoredPathWorkspaceIdentity,
141
142
  sourceNameForMemory,
142
143
  computeWorkspaceEpochFingerprint
143
- } from "./index-jba6ny4m.js";
144
+ } from "./index-dnpcv1rg.js";
144
145
  import {
145
146
  BoundedSessionMap
146
- } from "./index-mg9s2rc3.js";
147
+ } from "./index-cpbr0xvk.js";
147
148
  import {
148
149
  V2_MEMORY_CATEGORIES,
149
150
  CATEGORY_PRIORITY,
@@ -167,7 +168,7 @@ import {
167
168
  replaceCompartmentChunkEmbeddings2,
168
169
  deleteChunkEmbedBackoffForSession2,
169
170
  chunkWindowSourceKey2
170
- } from "./index-0twg41mh.js";
171
+ } from "./index-j4dcjb8t.js";
171
172
  import {
172
173
  COMPARTMENT_LEASE_RENEWAL_MS,
173
174
  getCompartmentLeaseBlocker,
@@ -176,6 +177,9 @@ import {
176
177
  releaseCompartmentLease,
177
178
  releaseCompartmentLeaseBestEffort,
178
179
  isCompartmentLeaseHeld,
180
+ readSummaryCoverage,
181
+ markHistoryGapAfterCoverageChange,
182
+ settleHistoryGapAfterReplacement,
179
183
  isNoContentCompartment,
180
184
  queueM0Mutation,
181
185
  getMaxM0MutationId,
@@ -212,14 +216,14 @@ import {
212
216
  getProjectState,
213
217
  recordSubagentInvocation,
214
218
  getLatestHistorianInvocationId
215
- } from "./index-yqha238s.js";
219
+ } from "./index-gnrwgvn7.js";
216
220
  import {
217
221
  clearCompressionDepth,
218
222
  clearCompressionDepthRange,
219
223
  toMessageIndexSource,
220
224
  clearIndexedMessagesInTransaction,
221
225
  indexSourcesAfterOrdinal
222
- } from "./index-pnawfv4e.js";
226
+ } from "./index-89bkkgcn.js";
223
227
  import {
224
228
  stripWellFormedLeadingTagPrefix,
225
229
  peelLeadingMcTagNotation,
@@ -270,17 +274,17 @@ import {
270
274
  foldShrunkPartTags2,
271
275
  getTagNumberByMessageId2,
272
276
  getActiveTagsBySession2
273
- } from "./index-xr1t0fxb.js";
277
+ } from "./index-w7n7qkpf.js";
274
278
  import {
275
279
  openCodeDbExists,
276
280
  withReadOnlySessionDb,
277
281
  getMessageTimesFromOpenCodeDb
278
- } from "./index-sp5pvs95.js";
282
+ } from "./index-k34hc455.js";
279
283
  import {
280
284
  getSessionNotes,
281
285
  getReadySmartNotes,
282
286
  insertPrimerCandidates
283
- } from "./index-mjy2k9jr.js";
287
+ } from "./index-880a24vd.js";
284
288
  import {
285
289
  pushNotification2
286
290
  } from "./index-y14pawe1.js";
@@ -298,13 +302,13 @@ import {
298
302
  getProjectChunkEmbeddingModelId2,
299
303
  getProjectEmbeddingMaxInputTokens2,
300
304
  embedItemsWindowBounded2
301
- } from "./index-n9kd68vc.js";
305
+ } from "./index-7m2tnk8q.js";
302
306
  import {
303
307
  renderUserFacingFailure,
304
308
  userFacingFailureCode,
305
309
  promoteSessionFactsDurable,
306
310
  embedPromotedFacts
307
- } from "./index-ttdk2w0z.js";
311
+ } from "./index-910gahfb.js";
308
312
  import {
309
313
  isMarkerCandidateBasisCurrent2,
310
314
  invalidateMarkerCandidateBasis2,
@@ -315,10 +319,10 @@ import {
315
319
  certifiedMarkerReferenceFloor2,
316
320
  readMarkerReferenceRows2,
317
321
  readKnownMarkerReferenceRows2
318
- } from "./index-832w615x.js";
322
+ } from "./index-azkfw78y.js";
319
323
  import {
320
324
  sendStatusNotification2
321
- } from "./index-9ffntwyr.js";
325
+ } from "./index-kj4bprep.js";
322
326
  import {
323
327
  retreatPastHostUnservedRows,
324
328
  snapTerminalCompartmentToServedRow,
@@ -338,7 +342,7 @@ import {
338
342
  import {
339
343
  logSlowWriteTransaction,
340
344
  WriteTransactionSteps
341
- } from "./index-m0pwswv9.js";
345
+ } from "./index-tqtpgnhr.js";
342
346
  import {
343
347
  sameProjectDirectory
344
348
  } from "./index-knvkbfvh.js";
@@ -2540,6 +2544,7 @@ function loadRawConfigFile(options) {
2540
2544
 
2541
2545
  // src/config/removed-agent-config.ts
2542
2546
  var REMOVED_AGENT_CONFIG_KEY = "sidekick";
2547
+ var REMOVED_DREAMER_KEYS = ["prompt", "tools", "permission"];
2543
2548
  var REMOVED_AGENT_CONFIG_WARNING = `The "${REMOVED_AGENT_CONFIG_KEY}" configuration was removed and is ignored.`;
2544
2549
  function isPlainObject3(value) {
2545
2550
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -2569,6 +2574,19 @@ function stripRemovedAgentConfig(rawConfig, warnings) {
2569
2574
  if (removed && !warnings.includes(REMOVED_AGENT_CONFIG_WARNING)) {
2570
2575
  warnings.push(REMOVED_AGENT_CONFIG_WARNING);
2571
2576
  }
2577
+ if (isPlainObject3(patched.dreamer)) {
2578
+ const dreamer = { ...patched.dreamer };
2579
+ for (const key of REMOVED_DREAMER_KEYS) {
2580
+ if (!Object.hasOwn(dreamer, key))
2581
+ continue;
2582
+ delete dreamer[key];
2583
+ removed = true;
2584
+ const warning = `dreamer.${key} has no effect; remove it from your settings.`;
2585
+ if (!warnings.includes(warning))
2586
+ warnings.push(warning);
2587
+ }
2588
+ patched.dreamer = dreamer;
2589
+ }
2572
2590
  return removed ? patched : rawConfig;
2573
2591
  }
2574
2592
 
@@ -4746,8 +4764,92 @@ function withoutHistorianTailCache(body) {
4746
4764
  // src/v2/hidden-run-holder.ts
4747
4765
  import { createHash as createHash3, randomUUID } from "node:crypto";
4748
4766
  import { stat } from "node:fs/promises";
4767
+
4768
+ // src/v2/hidden-child-record.ts
4769
+ function keptUnderRetention(keepSubagents, child) {
4770
+ return keepSubagents && (child.ever_settled === true || child.role === "historian");
4771
+ }
4772
+ function roleTitle(role) {
4773
+ return role === "historian" ? "Magic Context historian" : "Magic Context dreamer";
4774
+ }
4775
+ function roleAgent(role) {
4776
+ if (role === "historian")
4777
+ return HIDDEN_HISTORIAN_AGENT;
4778
+ return role === "dreamer-curate" ? HIDDEN_CURATE_AGENT : HIDDEN_DREAMER_AGENT;
4779
+ }
4780
+ function childCreateInput(identity, role, model) {
4781
+ const agent = hiddenToolLoop(identity) ? hiddenAgentFor(identity) : roleAgent(role);
4782
+ return {
4783
+ title: roleTitle(role),
4784
+ agent,
4785
+ model: {
4786
+ providerID: model.providerID,
4787
+ id: model.modelID,
4788
+ ...model.variant ? { variant: model.variant } : {}
4789
+ },
4790
+ location: { directory: identity.directory },
4791
+ metadata: { magic_context: "hidden-run", role },
4792
+ permissions: hiddenChildPermissions(agent, model.providerID)
4793
+ };
4794
+ }
4795
+ function assistantOutcome(row) {
4796
+ const outcome = row?.data.outcome;
4797
+ return outcome === "succeeded" || outcome === "failed" || outcome === "interrupted" ? outcome : undefined;
4798
+ }
4799
+ function withReader(openReader, read) {
4800
+ const reader = openReader();
4801
+ try {
4802
+ return read(reader);
4803
+ } finally {
4804
+ reader.close?.();
4805
+ }
4806
+ }
4807
+ function errorText(value) {
4808
+ if (value instanceof Error)
4809
+ return value.message;
4810
+ if (typeof value === "string")
4811
+ return value;
4812
+ try {
4813
+ return JSON.stringify(value);
4814
+ } catch {
4815
+ return String(value);
4816
+ }
4817
+ }
4818
+
4819
+ // src/v2/hidden-run-holder.ts
4749
4820
  var HOLDER_PREFIX = "ses_mc_bg_";
4750
4821
  var HOLDER_CANDIDATES = 3;
4822
+ var HOLDER_ARCHIVE_TIMEOUT_MS = 250;
4823
+ var archivingHolders = new Set;
4824
+ var loggedArchiveFailure = false;
4825
+ function supportsHolderArchive(version) {
4826
+ const release = version?.match(/^2\.(\d+)\.(\d+)$/);
4827
+ return !release || Number(release[1]) > 4 || Number(release[1]) === 4 && Number(release[2]) >= 3;
4828
+ }
4829
+ function archiveBackgroundHolder(id, archive) {
4830
+ if (archivingHolders.has(id))
4831
+ return;
4832
+ archivingHolders.add(id);
4833
+ (async () => {
4834
+ let timer;
4835
+ try {
4836
+ await Promise.race([
4837
+ Promise.resolve().then(() => archive.update({ sessionID: id, archived: true })),
4838
+ new Promise((_, reject) => {
4839
+ timer = setTimeout(() => reject(new Error(`session.update timed out after ${HOLDER_ARCHIVE_TIMEOUT_MS}ms`)), HOLDER_ARCHIVE_TIMEOUT_MS);
4840
+ })
4841
+ ]);
4842
+ } catch (error) {
4843
+ if (!loggedArchiveFailure) {
4844
+ loggedArchiveFailure = true;
4845
+ archive.log(`[magic-context] could not archive background holder ${id}: ${errorText(error)}`);
4846
+ }
4847
+ } finally {
4848
+ clearTimeout(timer);
4849
+ archivingHolders.delete(id);
4850
+ }
4851
+ })();
4852
+ }
4751
4853
  function isHiddenRunHolder(id) {
4752
4854
  return id.startsWith(HOLDER_PREFIX);
4753
4855
  }
@@ -4757,7 +4859,7 @@ function supportsQuietHiddenChildren(version) {
4757
4859
  function matchesHiddenRunLocation(wanted, returned) {
4758
4860
  return sameProjectDirectory(wanted, returned ?? "");
4759
4861
  }
4760
- async function hiddenRunPlacement(createHolder, directory, budget) {
4862
+ async function hiddenRunPlacement(createHolder, directory, budget, archive) {
4761
4863
  const work = budget?.work ?? ((start) => start());
4762
4864
  budget?.setStage("checking the holder directory");
4763
4865
  if (!(await work(() => stat(directory))).isDirectory())
@@ -4776,6 +4878,8 @@ async function hiddenRunPlacement(createHolder, directory, budget) {
4776
4878
  if (holder.id !== id || holder.parentID)
4777
4879
  throw new Error(`OpenCode did not return the expected background holder ${id}`);
4778
4880
  if (holder.metadata?.magic_context === "background-holder" && matchesHiddenRunLocation(directory, holder.location?.directory)) {
4881
+ if (archive && holder.time?.archived == null)
4882
+ archiveBackgroundHolder(id, archive);
4779
4883
  return { id: `ses_aut_${randomUUID()}`, parentID: id };
4780
4884
  }
4781
4885
  displaced.push(id);
@@ -5223,6 +5327,12 @@ class HiddenChildHook {
5223
5327
  onBudgetUpdate({ ...selected.budget.snapshot(), sessionId: draft.sessionID });
5224
5328
  }
5225
5329
  }
5330
+ if (selected.budget) {
5331
+ const count = selected.countRequestText ??= createTokenCountMemo(256, 2 * 1024 * 1024);
5332
+ const messageTokens = draft.messages.reduce((total, message) => total + count(JSON.stringify(message.content ?? message.parts) ?? ""), 0);
5333
+ const toolTokens = Object.values(draft.tools).reduce((total, tool) => total + count(tool.description) + count(JSON.stringify(tool.input) ?? ""), 0);
5334
+ (selected.requestTokenEstimates ??= []).push(count(systemText) + messageTokens + toolTokens);
5335
+ }
5226
5336
  selected.observedMessages = draft.messages;
5227
5337
  selected.shaped = true;
5228
5338
  return true;
@@ -10394,11 +10504,12 @@ function clearDegradedRebuild(sessionId) {
10394
10504
  degradedRebuildCountBySession.delete(sessionId);
10395
10505
  reAnchorLoggedBySession.delete(sessionId);
10396
10506
  }
10397
- function logReanchorOnce(sessionId, message) {
10507
+ function logReanchorOnce(sessionId, message, quiet) {
10398
10508
  if (reAnchorLoggedBySession.get(sessionId))
10399
10509
  return;
10400
10510
  reAnchorLoggedBySession.set(sessionId, true);
10401
- sessionLog2(sessionId, message);
10511
+ if (!quiet)
10512
+ sessionLog2(sessionId, message);
10402
10513
  }
10403
10514
  function findVisibleReanchorIndex(compartments, visibleMessageIds) {
10404
10515
  for (let index = compartments.length - 1;index >= 0; index -= 1) {
@@ -10525,7 +10636,9 @@ function cutCoveredPrefix(messages, count, coveredInstructions) {
10525
10636
  coveredInstructions.push(message);
10526
10637
  }
10527
10638
  }
10528
- function prepareCompartmentInjection(db, sessionId, messages, isCacheBusting, coveredInstructions, projectPath, injectionBudgetTokens, temporalAwareness, frozenBaseline) {
10639
+ function prepareCompartmentInjection(db, sessionId, messages, isCacheBusting, coveredInstructions, projectPath, injectionBudgetTokens, temporalAwareness, frozenBaseline, restoredBoundaryDiagnostic) {
10640
+ if (restoredBoundaryDiagnostic)
10641
+ restoredBoundaryDiagnostic.expectedAbsence = false;
10529
10642
  const cached = injectionCache.get(sessionId);
10530
10643
  if (cached && cached.db !== db) {
10531
10644
  clearInjectionCache(sessionId);
@@ -10671,6 +10784,9 @@ function prepareCompartmentInjection(db, sessionId, messages, isCacheBusting, co
10671
10784
  resultEndMessageId = trimEndMessageId;
10672
10785
  resultEndMessagePartial = trimEndMessagePartial;
10673
10786
  } else {
10787
+ const quiet = restoredBoundaryDiagnostic?.restoredAfterId === trimEndMessageId;
10788
+ if (restoredBoundaryDiagnostic)
10789
+ restoredBoundaryDiagnostic.expectedAbsence = quiet;
10674
10790
  const degradedCount = noteDegradedRebuild(sessionId);
10675
10791
  if (isCacheBusting) {
10676
10792
  reconcileForkOrphanedCompactionMarkers(db, sessionId, isCacheBusting);
@@ -10693,14 +10809,14 @@ function prepareCompartmentInjection(db, sessionId, messages, isCacheBusting, co
10693
10809
  resultEndMessage = reAnchorCompartment.endMessage;
10694
10810
  resultEndMessageId = reAnchorCompartment.endMessageId;
10695
10811
  reAnchored = true;
10696
- logReanchorOnce(sessionId, `compartment injection re-anchored: natural boundary ${trimEndMessageId} not visible for ${degradedCount} passes; splicing at visible compartment boundary ${resultEndMessageId} (ordinal ${resultEndMessage})`);
10812
+ logReanchorOnce(sessionId, `compartment injection re-anchored: natural boundary ${trimEndMessageId} not visible for ${degradedCount} passes; splicing at visible compartment boundary ${resultEndMessageId} (ordinal ${resultEndMessage})`, quiet);
10697
10813
  }
10698
10814
  }
10699
10815
  if (!reAnchored) {
10700
10816
  needsFreshMaterialization = true;
10701
- logReanchorOnce(sessionId, `compartment injection degraded: boundary ${trimEndMessageId} not visible for ${degradedCount} passes and no compartment boundary is visible; requesting fresh materialization to re-cut the baseline`);
10817
+ logReanchorOnce(sessionId, `compartment injection degraded: boundary ${trimEndMessageId} not visible for ${degradedCount} passes and no compartment boundary is visible; requesting fresh materialization to re-cut the baseline`, quiet);
10702
10818
  }
10703
- } else {
10819
+ } else if (!quiet) {
10704
10820
  sessionLog2(sessionId, `compartment injection entering degraded mode: boundary ${trimEndMessageId} not in visible messages (consecutive degraded passes: ${degradedCount})`);
10705
10821
  }
10706
10822
  }
@@ -16062,6 +16178,7 @@ function* rebaseSteps(args) {
16062
16178
  outcome.partTagsFolded = fold.foldedTagNumbers.length;
16063
16179
  outcome.partTagsRekeyed = fold.rekeyedTagNumbers.length;
16064
16180
  outcome.queuedReductionsDiscarded = fold.discardedDropTagNumbers.length;
16181
+ const previousCoverage = readSummaryCoverage(db, sessionId);
16065
16182
  const updateCompartment = {
16066
16183
  compartments: db.prepare("UPDATE compartments SET start_message = ?, end_message = ?, rebase_status = ?, title = ?, content = ?, p1 = ?, p2 = ?, p3 = ?, p4 = ? WHERE id = ?"),
16067
16184
  recomp_compartments: db.prepare("UPDATE recomp_compartments SET start_message = ?, end_message = ?, rebase_status = ?, title = ?, content = ?, p1 = ?, p2 = ?, p3 = ?, p4 = ? WHERE id = ?")
@@ -16103,6 +16220,7 @@ function* rebaseSteps(args) {
16103
16220
  outcome.recompCompartmentsUnresolved += unresolved;
16104
16221
  }
16105
16222
  }
16223
+ markHistoryGapAfterCoverageChange(db, sessionId, previousCoverage, true);
16106
16224
  const updateNote = db.prepare("UPDATE notes SET anchor_ordinal = ? WHERE id = ? AND session_id = ?");
16107
16225
  for (const plan of movedNotes) {
16108
16226
  updateNote.run(plan.ordinal, plan.id, sessionId);
@@ -16190,9 +16308,11 @@ function recoverUnresolvedCompartments(args) {
16190
16308
  db.exec("BEGIN IMMEDIATE");
16191
16309
  let committed = false;
16192
16310
  try {
16311
+ const previousCoverage = readSummaryCoverage(db, sessionId);
16193
16312
  for (const plan of changed) {
16194
16313
  db.prepare("UPDATE compartments SET start_message = ?, end_message = ?, rebase_status = ? WHERE id = ?").run(plan.start, plan.end, plan.status, plan.id);
16195
16314
  }
16315
+ markHistoryGapAfterCoverageChange(db, sessionId, previousCoverage);
16196
16316
  const previous = readCoordinateRebaseNotice(db, sessionId);
16197
16317
  const generation = previous?.generation ?? readCoordinateGeneration(db, sessionId);
16198
16318
  if (generation !== null) {
@@ -18764,10 +18884,12 @@ function promoteRecompStaging(db, sessionId, holderId, stopped, carriedRows) {
18764
18884
  }
18765
18885
  }
18766
18886
  const compartments = carried ? [...staging.compartments, ...carried.compartments] : staging.compartments;
18887
+ const previousCoverage = readSummaryCoverage(db, sessionId);
18767
18888
  deleteChunkEmbedBackoffForSession2(db, sessionId);
18768
18889
  db.prepare("DELETE FROM compartments WHERE session_id = ?").run(sessionId);
18769
18890
  db.prepare("DELETE FROM session_facts WHERE session_id = ?").run(sessionId);
18770
18891
  insertRecompCompartmentRows(db, sessionId, compartments, now, carried?.rows ?? carriedRows);
18892
+ settleHistoryGapAfterReplacement(db, sessionId, previousCoverage, staging.compartments.some((row) => !isNoContentCompartment(row)));
18771
18893
  queueM0Mutation(db, {
18772
18894
  sessionId,
18773
18895
  mutationType: "recomp_boundary_change",
@@ -19838,4 +19960,4 @@ async function executeContextRecomp(deps, options = {}) {
19838
19960
  return (await executeContextRecompWithResult(deps, options)).message;
19839
19961
  }
19840
19962
 
19841
- export { denyTaskRoutingToCallerAgents, buildHiddenAgentRegistrations, buildZenReadAgentRegistrations, buildHiddenAgentConfig, getMagicContextBuiltinCommands, formatConfigParseStatusLine, claimConfigParseFailuresOnce, isCommitRetentionPaused, cortexKitUserConfigBasePath, cortexKitProjectConfigBasePath, resolveLegacyConfigSources, migrateMagicContextConfigLocations, getProtectedTokensTierOverrides, loadPluginConfigDetailed, historianRunConfig, dreamerRunConfig, pluginConfigReader, currentPluginConfigReader, withLiveDreamerOutputCap, createDreamerOutputCapSampler, COMPARTMENT_AGENT_SYSTEM_PROMPT, HISTORIAN_EDITOR_SYSTEM_PROMPT, COMPARTMENT_STRUCTURAL_SYSTEM_PROMPT, clampProducerAtomChars, producerInputTokenLimit, historianProducerReserve, producerPromptFailureReason, DREAMER_AGENT, DREAMER_RETROSPECTIVE_AGENT, DREAMER_PRIMER_INVESTIGATOR_AGENT, DREAMER_MEMORY_MAPPER_AGENT, DREAMER_CLASSIFIER_AGENT, DREAMER_DOCS_AGENT, DREAMER_REVIEWER_AGENT, createChildSessionWithFence, HiddenCompletionRefusal, DreamerProviderOutputFailureError, providerOutputFailureFromInvalidManifest, supportsQuietHiddenChildren, matchesHiddenRunLocation, hiddenRunPlacement, HIDDEN_HISTORIAN_AGENT, HIDDEN_DREAMER_AGENT, HIDDEN_CURATE_AGENT, hiddenAgentFor, hiddenToolLoop, HIDDEN_RUN_DISPOSED_REASON, noteChildOfDisposedInstance, noteTimedOutHiddenChild, hiddenChildPermissions, registerHiddenChildAgents, hiddenToolCallRefusal, HiddenAgentStepLimit, HiddenChildHook, extractLatestAssistantText, hasLengthCappedOutput, isLatestAssistantLengthCapped, parseProviderModel, modelBodyField, toModelEntry, hiddenModelCooldowns, ModelProducedNoOutputError, promptTransportBudget, notePromptSetupTimeout, noteModelActivityMonitored, noteModelOutputReceived, isPromptTimeoutError, getPromptFailureDetail, raceWithSignal, promptSyncWithValidatedOutputRetry, normalizeSDKResponse, annotateSubagentInvocationError, failedInvocationStatus, emptyTokenTotals, sumTokensFromChildMessages, recordChildInvocation, recordPromptSessionError, createPromptAsyncTransport, CTX_NOTE_LIGHT_DESCRIPTION, ACTIVE_TOOL_IDS, systemPromptFingerprint, createPromptSurfaceRuntime, createPromptSurfaceGuidanceEpochCache, setKeepSubagents, teardownChildSession, getCompartmentEvents, runTokenLog, formatRunTokenLog, validateStoredCompartments, buildMagicContextSection, getMuralIdentity, getMural, modelKeyAcceptsImages, resolveMuralWire, v2ToolDefinitionsHash, v2RequestToolsFingerprint, classifyRequestToolsChange, USER_MEMORY_CANDIDATE_TTL_MS, insertUserMemoryCandidates, getUserMemoryCandidates, deleteUserMemoryCandidates, pruneExpiredUserMemoryCandidates, insertUserMemory, getActiveUserMemories, updateUserMemoryContent, dismissUserMemory, getOpenCodeDbPath, compareOpenCodeMessagesByCanonicalOrder, startCompactionMarkerCandidatePreparation, removeMcOwnedCompactionMarkers, MARKER_SUMMARY_TEXT, markerUpdateDefinitelyDidNotCut, applyDeferredCompactionMarker, removeCompactionMarkerForSession, checkCompactionMarkerConsistency, extractM0Block, formatDate, TEMPORAL_MARKER_REPLAY_PATTERN, collectTemporalCandidates, injectTemporalMarkers, clearInjectionCache, getVisibleMemoryIds, selectHiddenMessagesAtCompactionSeam, prepareCompartmentInjection, renderCompartmentInjection, MaterializeContentionError, mustMaterialize, trimMemoriesToBudgetV2, renderMemoryBlockV2, stripMemoryMuralBlock, servedHeadTexts, materializeM0, hydrateCachedM0Mural, resetPrefixTrimFallbackState, findHostCompactionWindow, capturePrefixTrimSourceOrder, prepareCachedM0M1Replay, headMessagesForSizing, rawTailAfterNewestCompartment, hasCompleteCachedM0M1, injectM0M1, resolveHiddenCompletionExecutor, createV1HiddenCompletionExecutor, pausedRecompReason, readCoordinateGeneration, readCoordinateRebaseNotice, formatCoordinateRebaseNotice, rebaseSessionCoordinatesAsync, omitIncompleteFileTokenTotals, describeBoundaryDiagnostics, RECOVERY_NO_HEAD_LIMIT, resolveOpenCodeProtectedTailBoundary, resolveWrapupProtectedTailBoundary, getRawHistoryEligibility, hasRunnableCompartmentWindow, recordHighPressureNoEligibleHead, reportProviderRecoveryDrainSkip, isHistorianDrainBudgetSpent, readHistorianFailureStreak, describeHistorianJoinRefusal, shouldWaitForNewHistorianHistory, EMPTY_READ_REPLY, noteTouchedAt, renderGlance, renderNotesById, formatWriteReply, observeNoteNudgeServe, onNoteTrigger, peekNoteNudgeText, markNoteNudgeDelivered, clearNoteNudgeTriggerAndCooldown, resetNoteNudgeCooldownOnly, clearNoteNudgeTriggerOnly, noteTransformPassForExactOrdinalReads, nonNarrativeStoredGapRanges, runCompartmentAgent, snapRangeToCompartments, getActiveCompartmentRun, markActiveCompartmentRunPublished, registerActiveCompartmentRun, startCompartmentAgent, executeContextRecomp };
19963
+ export { denyTaskRoutingToCallerAgents, buildHiddenAgentRegistrations, buildZenReadAgentRegistrations, buildHiddenAgentConfig, getMagicContextBuiltinCommands, formatConfigParseStatusLine, claimConfigParseFailuresOnce, isCommitRetentionPaused, cortexKitUserConfigBasePath, cortexKitProjectConfigBasePath, resolveLegacyConfigSources, migrateMagicContextConfigLocations, getProtectedTokensTierOverrides, loadPluginConfigDetailed, historianRunConfig, dreamerRunConfig, pluginConfigReader, currentPluginConfigReader, withLiveDreamerOutputCap, createDreamerOutputCapSampler, COMPARTMENT_AGENT_SYSTEM_PROMPT, HISTORIAN_EDITOR_SYSTEM_PROMPT, COMPARTMENT_STRUCTURAL_SYSTEM_PROMPT, clampProducerAtomChars, producerInputTokenLimit, historianProducerReserve, producerPromptFailureReason, DREAMER_AGENT, DREAMER_RETROSPECTIVE_AGENT, DREAMER_PRIMER_INVESTIGATOR_AGENT, DREAMER_MEMORY_MAPPER_AGENT, DREAMER_CLASSIFIER_AGENT, DREAMER_DOCS_AGENT, DREAMER_REVIEWER_AGENT, createChildSessionWithFence, HiddenCompletionRefusal, DreamerProviderOutputFailureError, providerOutputFailureFromInvalidManifest, keptUnderRetention, roleTitle, childCreateInput, assistantOutcome, withReader, errorText, supportsHolderArchive, supportsQuietHiddenChildren, matchesHiddenRunLocation, hiddenRunPlacement, HIDDEN_CURATE_AGENT, hiddenToolLoop, HIDDEN_RUN_DISPOSED_REASON, noteChildOfDisposedInstance, noteTimedOutHiddenChild, registerHiddenChildAgents, hiddenToolCallRefusal, HiddenAgentStepLimit, HiddenChildHook, extractLatestAssistantText, hasLengthCappedOutput, isLatestAssistantLengthCapped, parseProviderModel, modelBodyField, toModelEntry, hiddenModelCooldowns, ModelProducedNoOutputError, promptTransportBudget, notePromptSetupTimeout, noteModelActivityMonitored, noteModelOutputReceived, isPromptTimeoutError, getPromptFailureDetail, raceWithSignal, promptSyncWithValidatedOutputRetry, normalizeSDKResponse, annotateSubagentInvocationError, failedInvocationStatus, emptyTokenTotals, sumTokensFromChildMessages, recordChildInvocation, recordPromptSessionError, createPromptAsyncTransport, CTX_NOTE_LIGHT_DESCRIPTION, ACTIVE_TOOL_IDS, systemPromptFingerprint, createPromptSurfaceRuntime, createPromptSurfaceGuidanceEpochCache, setKeepSubagents, teardownChildSession, getCompartmentEvents, runTokenLog, formatRunTokenLog, validateStoredCompartments, buildMagicContextSection, getMuralIdentity, getMural, modelKeyAcceptsImages, resolveMuralWire, v2ToolDefinitionsHash, v2RequestToolsFingerprint, classifyRequestToolsChange, USER_MEMORY_CANDIDATE_TTL_MS, insertUserMemoryCandidates, getUserMemoryCandidates, deleteUserMemoryCandidates, pruneExpiredUserMemoryCandidates, insertUserMemory, getActiveUserMemories, updateUserMemoryContent, dismissUserMemory, getOpenCodeDbPath, compareOpenCodeMessagesByCanonicalOrder, startCompactionMarkerCandidatePreparation, removeMcOwnedCompactionMarkers, MARKER_SUMMARY_TEXT, markerUpdateDefinitelyDidNotCut, applyDeferredCompactionMarker, removeCompactionMarkerForSession, checkCompactionMarkerConsistency, extractM0Block, formatDate, TEMPORAL_MARKER_REPLAY_PATTERN, collectTemporalCandidates, injectTemporalMarkers, clearInjectionCache, getVisibleMemoryIds, selectHiddenMessagesAtCompactionSeam, prepareCompartmentInjection, renderCompartmentInjection, MaterializeContentionError, mustMaterialize, trimMemoriesToBudgetV2, renderMemoryBlockV2, stripMemoryMuralBlock, servedHeadTexts, materializeM0, hydrateCachedM0Mural, resetPrefixTrimFallbackState, findHostCompactionWindow, capturePrefixTrimSourceOrder, prepareCachedM0M1Replay, headMessagesForSizing, rawTailAfterNewestCompartment, hasCompleteCachedM0M1, injectM0M1, resolveHiddenCompletionExecutor, createV1HiddenCompletionExecutor, pausedRecompReason, readCoordinateGeneration, readCoordinateRebaseNotice, formatCoordinateRebaseNotice, rebaseSessionCoordinatesAsync, omitIncompleteFileTokenTotals, describeBoundaryDiagnostics, RECOVERY_NO_HEAD_LIMIT, resolveOpenCodeProtectedTailBoundary, resolveWrapupProtectedTailBoundary, getRawHistoryEligibility, hasRunnableCompartmentWindow, recordHighPressureNoEligibleHead, reportProviderRecoveryDrainSkip, isHistorianDrainBudgetSpent, readHistorianFailureStreak, describeHistorianJoinRefusal, shouldWaitForNewHistorianHistory, EMPTY_READ_REPLY, noteTouchedAt, renderGlance, renderNotesById, formatWriteReply, observeNoteNudgeServe, onNoteTrigger, peekNoteNudgeText, markNoteNudgeDelivered, clearNoteNudgeTriggerAndCooldown, resetNoteNudgeCooldownOnly, clearNoteNudgeTriggerOnly, noteTransformPassForExactOrdinalReads, nonNarrativeStoredGapRanges, runCompartmentAgent, snapRangeToCompartments, getActiveCompartmentRun, markActiveCompartmentRunPublished, registerActiveCompartmentRun, startCompartmentAgent, executeContextRecomp };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  DEFAULT_LOCAL_EMBEDDING_MODEL
3
- } from "./index-y915t3ey.js";
3
+ } from "./index-r3f85n7y.js";
4
4
  import {
5
5
  getSynapseLaneIdentity
6
- } from "./index-6r99v53h.js";
6
+ } from "./index-fgw241hh.js";
7
7
  import {
8
8
  getHarness2
9
9
  } from "./index-pavzsdc6.js";
@@ -12,7 +12,7 @@ import {
12
12
  importPluginModule,
13
13
  log2,
14
14
  flushLogger2
15
- } from "./index-ywrz4wy2.js";
15
+ } from "./index-3fhb0j32.js";
16
16
  import {
17
17
  inRootAsyncContext2
18
18
  } from "./index-gzy5w8ya.js";
@@ -22,7 +22,7 @@ import {
22
22
  writeStorageFileAsync,
23
23
  writeStorageFileHandleAsync,
24
24
  createStorageFileHandleAsync
25
- } from "./index-5df2fw5b.js";
25
+ } from "./index-6mryx739.js";
26
26
  import {
27
27
  computeNormalizedHash
28
28
  } from "./index-2bvekkfy.js";
@@ -6843,7 +6843,11 @@ var AgentMetadataSchema = AgentOverrideConfigSchema.pick({
6843
6843
  permission: true,
6844
6844
  maxTokens: true
6845
6845
  });
6846
- var DreamerConfigSchema = AgentMetadataSchema.extend({
6846
+ var DreamerConfigSchema = AgentMetadataSchema.omit({
6847
+ prompt: true,
6848
+ tools: true,
6849
+ permission: true
6850
+ }).extend({
6847
6851
  disable: boolean().optional().describe("Disable the dreamer: no scheduled or manual dream task runs. Also turns off smart notes (ctx_note drops surface_condition even with smart_notes.enabled true) and the historian's collection of user observations for review-user-memories. dreamer.inject_docs still applies."),
6848
6852
  runner: _enum(["broca", "host"]).optional().describe(`Which side runs the dreamer completions the Rust module routes (classify-memories) in Rust transform mode: "host" runs them on this process's carrier, "broca" routes them to the Broca module. When unset, historian.runner applies, and when that is unset too the harness decides the same way it does for the historian. User-level config only.`),
6849
6853
  opencode: DreamerOpenCodeHarnessBlockSchema.optional(),
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  sessionLog2
3
- } from "./index-ywrz4wy2.js";
3
+ } from "./index-3fhb0j32.js";
4
4
  import {
5
5
  clearEmergencyRecovery
6
- } from "./index-xr1t0fxb.js";
6
+ } from "./index-w7n7qkpf.js";
7
7
  import {
8
8
  requestPendingMaterialization,
9
9
  dropSlot
10
- } from "./index-yqha238s.js";
10
+ } from "./index-gnrwgvn7.js";
11
11
  import {
12
12
  pausedRecompReason,
13
13
  executeContextRecomp
14
- } from "./index-za1yx1m4.js";
14
+ } from "./index-nqdwpdje.js";
15
15
  import {
16
16
  renderUserFacingFailure,
17
17
  userFacingFailureCode
18
- } from "./index-ttdk2w0z.js";
18
+ } from "./index-910gahfb.js";
19
19
 
20
20
  // src/hooks/magic-context/recomp-orchestrator.ts
21
21
  function resolveLiveModelKey(liveSessionState, sessionId) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  log2
3
- } from "./index-ywrz4wy2.js";
3
+ } from "./index-3fhb0j32.js";
4
4
 
5
5
  // src/shared/write-transaction-timing.ts
6
6
  var SLOW_WRITE_TRANSACTION_THRESHOLD_MS = 1000;
@@ -122,16 +122,32 @@ function decode(row) {
122
122
  }
123
123
  return { ...row, data };
124
124
  }
125
- function connect(path, identity = "") {
125
+ function fileIdentity(path) {
126
126
  const stat = statSync(path);
127
- const acquiredIdentity = identity || `${stat.dev}:${stat.ino}:${stat.birthtimeMs}`;
127
+ return `${stat.dev}:${stat.ino}:${stat.birthtimeMs}`;
128
+ }
129
+ function openConfirmed(path, identity) {
128
130
  const db = new Database2(path, { readonly: true, fileMustExist: true });
129
131
  try {
130
- assertOpenCodeStoreGeneration(db, "v2", path);
132
+ if (fileIdentity(path) === identity) {
133
+ assertOpenCodeStoreGeneration(db, "v2", path);
134
+ return db;
135
+ }
131
136
  } catch (error) {
132
137
  db.close();
133
138
  throw error;
134
139
  }
140
+ db.close();
141
+ return;
142
+ }
143
+ function connect(path, identity = fileIdentity(path)) {
144
+ let db = openConfirmed(path, identity);
145
+ if (!db) {
146
+ identity = fileIdentity(path);
147
+ db = openConfirmed(path, identity);
148
+ if (!db)
149
+ throw new Error("OpenCode database file changed during reader open");
150
+ }
135
151
  const counters = debugCounters();
136
152
  counters.openReaders += 1;
137
153
  counters.readersOpened += 1;
@@ -139,7 +155,7 @@ function connect(path, identity = "") {
139
155
  return {
140
156
  db,
141
157
  statements: new Map,
142
- identity: acquiredIdentity,
158
+ identity,
143
159
  leases: 0,
144
160
  retired: false,
145
161
  ordinalSequences: new Map
@@ -175,8 +191,7 @@ class V2StoreReaderPool2 {
175
191
  if (this.closed)
176
192
  throw new Error("Store reader pool is closed");
177
193
  const key = resolve(path);
178
- const stat = statSync(key);
179
- const identity = `${stat.dev}:${stat.ino}:${stat.birthtimeMs}`;
194
+ const identity = fileIdentity(key);
180
195
  let connection = this.connections.get(key);
181
196
  if (connection && connection.identity !== identity) {
182
197
  this.connections.delete(key);