@cortexkit/opencode-magic-context 0.48.0 → 0.49.1

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 (304) hide show
  1. package/dist/{announcement-fp14dw0n.js → announcement-hdbkt8v5.js} +1 -1
  2. package/dist/auto-search-worker.js +3 -3
  3. package/dist/config/{mural-model-deprecation.d.ts → deprecated-config.d.ts} +4 -1
  4. package/dist/config/deprecated-config.d.ts.map +1 -0
  5. package/dist/config/index.d.ts.map +1 -1
  6. package/dist/config/project-security.d.ts +2 -2
  7. package/dist/config/schema/magic-context.d.ts +4 -4
  8. package/dist/config/schema/magic-context.d.ts.map +1 -1
  9. package/dist/{conflict-warning-hook-w8cykrnf.js → conflict-warning-hook-asnt6hfc.js} +7 -7
  10. package/dist/{context-m0cy262m.js → context-tfyhtdcs.js} +187 -68
  11. package/dist/{derive-budgets-sg0xsq7s.js → derive-budgets-j4ry8j8n.js} +2 -2
  12. package/dist/embedding-backfill-wyc3ykyf.js +21 -0
  13. package/dist/embedding-worker-process.js +30 -0
  14. package/dist/embedding-worker.js +6 -6
  15. package/dist/features/magic-context/dreamer/task-registry.d.ts +2 -3
  16. package/dist/features/magic-context/dreamer/task-registry.d.ts.map +1 -1
  17. package/dist/features/magic-context/git-commits/search-git-commits.d.ts +2 -0
  18. package/dist/features/magic-context/git-commits/search-git-commits.d.ts.map +1 -1
  19. package/dist/features/magic-context/memory/embedding-worker-client.d.ts +8 -1
  20. package/dist/features/magic-context/memory/embedding-worker-client.d.ts.map +1 -1
  21. package/dist/features/magic-context/memory/embedding-worker-process.d.ts +2 -0
  22. package/dist/features/magic-context/memory/embedding-worker-process.d.ts.map +1 -0
  23. package/dist/features/magic-context/memory/onnx-telemetry.d.ts +3 -0
  24. package/dist/features/magic-context/memory/onnx-telemetry.d.ts.map +1 -0
  25. package/dist/features/magic-context/message-index.d.ts.map +1 -1
  26. package/dist/features/magic-context/overflow-detection.d.ts +1 -2
  27. package/dist/features/magic-context/overflow-detection.d.ts.map +1 -1
  28. package/dist/features/magic-context/pi-content-decisions.d.ts +1 -1
  29. package/dist/features/magic-context/pi-content-decisions.d.ts.map +1 -1
  30. package/dist/features/magic-context/search-rerank.d.ts +35 -0
  31. package/dist/features/magic-context/search-rerank.d.ts.map +1 -0
  32. package/dist/features/magic-context/search.d.ts +11 -0
  33. package/dist/features/magic-context/search.d.ts.map +1 -1
  34. package/dist/features/magic-context/storage-meta-persisted.d.ts +13 -2
  35. package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -1
  36. package/dist/features/magic-context/storage-meta-session.d.ts +1 -1
  37. package/dist/features/magic-context/storage-meta-session.d.ts.map +1 -1
  38. package/dist/features/magic-context/storage-meta.d.ts +1 -1
  39. package/dist/features/magic-context/storage-meta.d.ts.map +1 -1
  40. package/dist/features/magic-context/storage-session-tables.d.ts +2 -0
  41. package/dist/features/magic-context/storage-session-tables.d.ts.map +1 -1
  42. package/dist/features/magic-context/storage-tag-identity-revision.d.ts +29 -9
  43. package/dist/features/magic-context/storage-tag-identity-revision.d.ts.map +1 -1
  44. package/dist/features/magic-context/storage-tags.d.ts +9 -0
  45. package/dist/features/magic-context/storage-tags.d.ts.map +1 -1
  46. package/dist/features/magic-context/storage.d.ts +1 -1
  47. package/dist/features/magic-context/storage.d.ts.map +1 -1
  48. package/dist/features/magic-context/tagger.d.ts +2 -0
  49. package/dist/features/magic-context/tagger.d.ts.map +1 -1
  50. package/dist/features/magic-context/transform-decision-log.d.ts +4 -1
  51. package/dist/features/magic-context/transform-decision-log.d.ts.map +1 -1
  52. package/dist/features/magic-context/user-memory/storage-user-memory.d.ts +1 -0
  53. package/dist/features/magic-context/user-memory/storage-user-memory.d.ts.map +1 -1
  54. package/dist/hooks/magic-context/auto-search-deadline.d.ts.map +1 -1
  55. package/dist/hooks/magic-context/auto-search-replay.fixture.d.ts +24 -0
  56. package/dist/hooks/magic-context/auto-search-replay.fixture.d.ts.map +1 -0
  57. package/dist/hooks/magic-context/auto-search-runner.d.ts +1 -1
  58. package/dist/hooks/magic-context/auto-search-runner.d.ts.map +1 -1
  59. package/dist/hooks/magic-context/auto-search-worker-client.d.ts +2 -0
  60. package/dist/hooks/magic-context/auto-search-worker-client.d.ts.map +1 -1
  61. package/dist/hooks/magic-context/command-handler.d.ts +2 -0
  62. package/dist/hooks/magic-context/command-handler.d.ts.map +1 -1
  63. package/dist/hooks/magic-context/emergency-fail-closed.d.ts +28 -0
  64. package/dist/hooks/magic-context/emergency-fail-closed.d.ts.map +1 -1
  65. package/dist/hooks/magic-context/event-handler.d.ts.map +1 -1
  66. package/dist/hooks/magic-context/final-wire-token-estimate.d.ts +1 -0
  67. package/dist/hooks/magic-context/final-wire-token-estimate.d.ts.map +1 -1
  68. package/dist/hooks/magic-context/historian-host-runner.d.ts +8 -0
  69. package/dist/hooks/magic-context/historian-host-runner.d.ts.map +1 -1
  70. package/dist/hooks/magic-context/hook-handlers.d.ts.map +1 -1
  71. package/dist/hooks/magic-context/hook.d.ts +3 -1
  72. package/dist/hooks/magic-context/hook.d.ts.map +1 -1
  73. package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
  74. package/dist/hooks/magic-context/latest-thinking-recovery.d.ts +7 -0
  75. package/dist/hooks/magic-context/latest-thinking-recovery.d.ts.map +1 -1
  76. package/dist/hooks/magic-context/lkg-measured-request.d.ts +3 -1
  77. package/dist/hooks/magic-context/lkg-measured-request.d.ts.map +1 -1
  78. package/dist/hooks/magic-context/lkg-persist.d.ts +8 -14
  79. package/dist/hooks/magic-context/lkg-persist.d.ts.map +1 -1
  80. package/dist/hooks/magic-context/lkg-recovery-fence.d.ts +62 -0
  81. package/dist/hooks/magic-context/lkg-recovery-fence.d.ts.map +1 -0
  82. package/dist/hooks/magic-context/lkg-recovery-prefix.d.ts +38 -0
  83. package/dist/hooks/magic-context/lkg-recovery-prefix.d.ts.map +1 -0
  84. package/dist/hooks/magic-context/lkg-replay.d.ts +3 -1
  85. package/dist/hooks/magic-context/lkg-replay.d.ts.map +1 -1
  86. package/dist/hooks/magic-context/lkg-slot.d.ts.map +1 -1
  87. package/dist/hooks/magic-context/opaque-thinking.d.ts +12 -0
  88. package/dist/hooks/magic-context/opaque-thinking.d.ts.map +1 -0
  89. package/dist/hooks/magic-context/pass-outcome.d.ts +3 -2
  90. package/dist/hooks/magic-context/pass-outcome.d.ts.map +1 -1
  91. package/dist/hooks/magic-context/pending-materialization.d.ts +8 -0
  92. package/dist/hooks/magic-context/pending-materialization.d.ts.map +1 -0
  93. package/dist/hooks/magic-context/read-session-chunk.d.ts +7 -1
  94. package/dist/hooks/magic-context/read-session-chunk.d.ts.map +1 -1
  95. package/dist/hooks/magic-context/read-session-db.d.ts +3 -0
  96. package/dist/hooks/magic-context/read-session-db.d.ts.map +1 -1
  97. package/dist/hooks/magic-context/read-session-raw.d.ts +35 -0
  98. package/dist/hooks/magic-context/read-session-raw.d.ts.map +1 -1
  99. package/dist/hooks/magic-context/recomp-orchestrator.d.ts.map +1 -1
  100. package/dist/hooks/magic-context/rust-mode-transform.d.ts +37 -0
  101. package/dist/hooks/magic-context/rust-mode-transform.d.ts.map +1 -1
  102. package/dist/hooks/magic-context/shared-compartment-boundaries.d.ts +8 -1
  103. package/dist/hooks/magic-context/shared-compartment-boundaries.d.ts.map +1 -1
  104. package/dist/hooks/magic-context/strict-thinking-prefix.d.ts +8 -0
  105. package/dist/hooks/magic-context/strict-thinking-prefix.d.ts.map +1 -0
  106. package/dist/hooks/magic-context/strip-content.d.ts +5 -2
  107. package/dist/hooks/magic-context/strip-content.d.ts.map +1 -1
  108. package/dist/hooks/magic-context/system-date-refresh.d.ts +29 -0
  109. package/dist/hooks/magic-context/system-date-refresh.d.ts.map +1 -0
  110. package/dist/hooks/magic-context/system-prompt-dates.d.ts +6 -0
  111. package/dist/hooks/magic-context/system-prompt-dates.d.ts.map +1 -0
  112. package/dist/hooks/magic-context/system-prompt-delivery.d.ts +47 -0
  113. package/dist/hooks/magic-context/system-prompt-delivery.d.ts.map +1 -0
  114. package/dist/hooks/magic-context/system-prompt-hash.d.ts +4 -0
  115. package/dist/hooks/magic-context/system-prompt-hash.d.ts.map +1 -1
  116. package/dist/hooks/magic-context/tag-messages.d.ts +8 -0
  117. package/dist/hooks/magic-context/tag-messages.d.ts.map +1 -1
  118. package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +15 -0
  119. package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
  120. package/dist/hooks/magic-context/transform.d.ts +7 -0
  121. package/dist/hooks/magic-context/transform.d.ts.map +1 -1
  122. package/dist/{index-ty64eqcn.js → index-0pjvpfkf.js} +24 -4
  123. package/dist/{index-db7zwa3v.js → index-1bt88epp.js} +93 -9
  124. package/dist/{index-2y0s2hep.js → index-4mjhqadz.js} +1 -1
  125. package/dist/index-6m7rdv7y.js +733 -0
  126. package/dist/{index-k1xb52kd.js → index-6tfxmc4n.js} +11 -11
  127. package/dist/{index-fbv1dn35.js → index-7w18gg78.js} +26 -2
  128. package/dist/{index-7mx8v0pw.js → index-att4bfan.js} +4 -4
  129. package/dist/{index-mmyh6d8f.js → index-eypn4ba6.js} +11 -6
  130. package/dist/{index-q2tqeqde.js → index-fdtkt5r1.js} +1229 -78
  131. package/dist/{index-c43kr12f.js → index-fg00p1cg.js} +42 -40
  132. package/dist/{v2/server-1bc61ans.js → index-fvnzcnww.js} +44 -1
  133. package/dist/index-gbmqa9x9.js +1170 -0
  134. package/dist/{index-knh4y330.js → index-gzky5rva.js} +31 -49
  135. package/dist/{index-0qhce371.js → index-h2wc01qk.js} +2 -2
  136. package/dist/{index-dhwzyd54.js → index-h5zfkjyk.js} +160 -25
  137. package/dist/{index-bhvjj0ys.js → index-k6xvbj2e.js} +255 -1075
  138. package/dist/{index-0w56v4fm.js → index-mw7c950g.js} +1 -1
  139. package/dist/{index-8j7gqj40.js → index-nsjyysj0.js} +6 -2
  140. package/dist/{index-k9nnwad5.js → index-nydv6g8r.js} +44 -7
  141. package/dist/{index-f0h6xwqm.js → index-p0n5ryq8.js} +304 -960
  142. package/dist/{index-pg50n748.js → index-p1hnwfd8.js} +4 -4
  143. package/dist/{index-1qb0z7wa.js → index-qx53vezw.js} +1 -1
  144. package/dist/{index-5zygecde.js → index-r2zcs71c.js} +8 -6
  145. package/dist/{index-cb7emxgj.js → index-rafsaxac.js} +336 -6
  146. package/dist/{index-z8e0psj8.js → index-s7fc0fkn.js} +3 -3
  147. package/dist/{index-14cjxt20.js → index-sfhndpcb.js} +505 -11
  148. package/dist/index-sv0bb7vg.js +6972 -0
  149. package/dist/{index-jcbd3znx.js → index-tqf7yg27.js} +1 -1
  150. package/dist/{index-72nhv486.js → index-vkbqdnkj.js} +2 -2
  151. package/dist/{index-pdecwzrd.js → index-w23dh319.js} +18 -259
  152. package/dist/{index-yq8n9qcb.js → index-xgrwmj82.js} +4 -4
  153. package/dist/{index-0an7742d.js → index-xnanvj3w.js} +1364 -2278
  154. package/dist/{index-eeezr5zz.js → index-z1tjp257.js} +1 -1
  155. package/dist/{index-692jzy0p.js → index-zfzdpeq2.js} +2279 -4061
  156. package/dist/{index-q7h7csab.js → index-zg8yq4ya.js} +34 -749
  157. package/dist/index.d.ts.map +1 -1
  158. package/dist/index.js +241 -76
  159. package/dist/{logger-d3wex3dz.js → logger-ewak5q1s.js} +1 -1
  160. package/dist/{message-index-bounded-7ezbgddp.js → message-index-bounded-hqktkhdy.js} +15 -14
  161. package/dist/{message-time-backfill-brbd63hv.js → message-time-backfill-8x06r9kx.js} +2 -2
  162. package/dist/migration-worker.js +11 -10
  163. package/dist/plugin/hooks/create-session-hooks.d.ts +5 -1
  164. package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
  165. package/dist/plugin/messages-transform.d.ts.map +1 -1
  166. package/dist/plugin/rpc-handlers.d.ts.map +1 -1
  167. package/dist/plugin/tool-registry.d.ts.map +1 -1
  168. package/dist/{project-embedding-registry-7qzptcw7.js → project-embedding-registry-0gv3h6y8.js} +10 -10
  169. package/dist/raw-ordinal-warmup-worker.js +4 -4
  170. package/dist/{read-session-chunk-6k83m4fj.js → read-session-chunk-5mh0bh8y.js} +12 -9
  171. package/dist/{read-session-raw-3g9qy1xa.js → read-session-raw-8sjbc9h0.js} +5 -3
  172. package/dist/{recomp-orchestrator-d3fp1cy0.js → recomp-orchestrator-kpkhkjhq.js} +28 -27
  173. package/dist/{safe-notification-target-5ffqq32m.js → safe-notification-target-q0cyrx3x.js} +2 -2
  174. package/dist/{search-epax1ecv.js → search-p9w39qv4.js} +22 -21
  175. package/dist/{send-session-notification-erecz4y4.js → send-session-notification-xffh3bbe.js} +5 -5
  176. package/dist/shared/auto-search-lifecycle.d.ts +14 -0
  177. package/dist/shared/auto-search-lifecycle.d.ts.map +1 -1
  178. package/dist/shared/logger.d.ts.map +1 -1
  179. package/dist/shared/models-dev-cache.d.ts.map +1 -1
  180. package/dist/shared/models-dev-temperature.d.ts +18 -0
  181. package/dist/shared/models-dev-temperature.d.ts.map +1 -0
  182. package/dist/shared/project-directory-key.d.ts +16 -0
  183. package/dist/shared/project-directory-key.d.ts.map +1 -1
  184. package/dist/shared/storage-file-mutex.d.ts +9 -0
  185. package/dist/shared/storage-file-mutex.d.ts.map +1 -0
  186. package/dist/shared/storage-permissions.d.ts +6 -0
  187. package/dist/shared/storage-permissions.d.ts.map +1 -1
  188. package/dist/shared/subagent-temperature.d.ts +46 -0
  189. package/dist/shared/subagent-temperature.d.ts.map +1 -0
  190. package/dist/shared/window-geometry.d.ts +9 -66
  191. package/dist/shared/window-geometry.d.ts.map +1 -1
  192. package/dist/standalone-plugin-marker.d.ts +8 -0
  193. package/dist/standalone-plugin-marker.d.ts.map +1 -0
  194. package/dist/{storage-tags-d3b0v2ss.js → storage-tags-k0pda32s.js} +6 -4
  195. package/dist/tools/ctx-reduce/constants.d.ts +1 -2
  196. package/dist/tools/ctx-reduce/constants.d.ts.map +1 -1
  197. package/dist/tools/ctx-reduce/tools.d.ts +1 -1
  198. package/dist/tools/ctx-reduce/tools.d.ts.map +1 -1
  199. package/dist/tools/ctx-search/tools.d.ts.map +1 -1
  200. package/dist/tools/ctx-search/types.d.ts +1 -0
  201. package/dist/tools/ctx-search/types.d.ts.map +1 -1
  202. package/dist/{transform-postprocess-phase-spcy2qre.js → transform-postprocess-phase-481j5a7z.js} +28 -27
  203. package/dist/v2/auto-search-worker.js +3 -3
  204. package/dist/v2/{context-sf98kstd.js → context-gsdtha5v.js} +1619 -3111
  205. package/dist/v2/{derive-budgets-3vc0y84t.js → derive-budgets-enckmg7y.js} +3 -3
  206. package/dist/v2/embedding-backfill-dbvjbcmm.js +20 -0
  207. package/dist/v2/embedding-worker-process.js +29 -0
  208. package/dist/v2/embedding-worker.js +6 -7
  209. package/dist/v2/hidden-child-native.d.ts.map +1 -1
  210. package/dist/v2/hidden-completion.d.ts +7 -0
  211. package/dist/v2/hidden-completion.d.ts.map +1 -1
  212. package/dist/v2/hooks/context.d.ts.map +1 -1
  213. package/dist/v2/hooks/copied-tag-notation.d.ts +19 -0
  214. package/dist/v2/hooks/copied-tag-notation.d.ts.map +1 -0
  215. package/dist/v2/hooks/dream-trigger.d.ts +4 -1
  216. package/dist/v2/hooks/dream-trigger.d.ts.map +1 -1
  217. package/dist/v2/hooks/generate.d.ts +9 -2
  218. package/dist/v2/hooks/generate.d.ts.map +1 -1
  219. package/dist/v2/hooks/payload.d.ts.map +1 -1
  220. package/dist/v2/hooks/system-prompt-response.d.ts +5 -0
  221. package/dist/v2/hooks/system-prompt-response.d.ts.map +1 -0
  222. package/dist/v2/{logger-mxd0ym09.js → logger-pj02s7sr.js} +1 -1
  223. package/dist/v2/{message-index-bounded-dy3s2k1e.js → message-index-bounded-p6v0n8qh.js} +15 -14
  224. package/dist/v2/{message-time-backfill-gtx1pwk1.js → message-time-backfill-cje68egj.js} +2 -2
  225. package/dist/v2/migration-worker.js +11 -10
  226. package/dist/v2/{project-embedding-registry-1tgba5dv.js → project-embedding-registry-nyq7z8y6.js} +11 -12
  227. package/dist/v2/raw-ordinal-warmup-worker.js +4 -4
  228. package/dist/v2/{read-session-chunk-rh4khdkv.js → read-session-chunk-fhyfe4qa.js} +12 -9
  229. package/dist/v2/{read-session-raw-bsbmf0vj.js → read-session-raw-j8dvp7f4.js} +5 -3
  230. package/dist/v2/recomp-orchestrator-5xy7w136.js +57 -0
  231. package/dist/v2/{safe-notification-target-73ax1p5v.js → safe-notification-target-y3p1hce9.js} +2 -2
  232. package/dist/v2/{search-nzkwrc6n.js → search-j7bakcwa.js} +23 -23
  233. package/dist/v2/{send-session-notification-6km439kn.js → send-session-notification-f6v698r5.js} +5 -5
  234. package/dist/v2/{server-7wwc2nga.js → server-1fszbabv.js} +32 -32
  235. package/dist/v2/{server-k228xhjg.js → server-2htmbqbv.js} +26 -2
  236. package/dist/v2/{server-aan4q8mx.js → server-3t0q2cqx.js} +1 -1
  237. package/dist/v2/{server-686jg6eb.js → server-4c7jt8gq.js} +68 -7
  238. package/dist/v2/{server-xxm59eww.js → server-4enr7s6x.js} +4 -4
  239. package/dist/v2/{server-zxhgvsf9.js → server-676xw7at.js} +1 -1
  240. package/dist/v2/{server-52awr2mw.js → server-6byqfbqf.js} +93 -9
  241. package/dist/v2/{server-e0vdaae2.js → server-6tcrjfw8.js} +4 -4
  242. package/dist/v2/{server-qye6ykf7.js → server-7ekna9zs.js} +2 -2
  243. package/dist/v2/{server-g5r0n3b6.js → server-7h861yms.js} +160 -25
  244. package/dist/v2/{server-k8x2rbxc.js → server-7spkq1y6.js} +3457 -5192
  245. package/dist/v2/{server-8pyt7hev.js → server-7vkj6zhb.js} +34 -749
  246. package/dist/v2/{server-yczc713m.js → server-8xmq9h3f.js} +31 -49
  247. package/dist/v2/{server-sggvvzhb.js → server-bgzy0phk.js} +505 -11
  248. package/dist/v2/server-c7n2ftng.js +6860 -0
  249. package/dist/v2/server-cvgn49tr.js +733 -0
  250. package/dist/v2/{server-zm570tr2.js → server-cw6521wn.js} +232 -7
  251. package/dist/v2/{server-xdfwt6kh.js → server-czb2rkpk.js} +23 -3
  252. package/dist/v2/{server-x2g40a71.js → server-d6g4whc2.js} +21 -15
  253. package/dist/{index-1bc61ans.js → v2/server-fvnzcnww.js} +44 -1
  254. package/dist/v2/{server-4k748ke6.js → server-hb6xhh9q.js} +2 -2
  255. package/dist/v2/{server-gjcr4w98.js → server-kh958yj8.js} +5 -5
  256. package/dist/v2/{server-1r6pmz4f.js → server-kzns2hbz.js} +1 -1
  257. package/dist/v2/{server-psqc7e9n.js → server-mqvtz7wz.js} +1227 -78
  258. package/dist/v2/{server-vqpf3167.js → server-ras2sxnc.js} +135 -15
  259. package/dist/v2/{server-ezhze64f.js → server-s2st631p.js} +4 -4
  260. package/dist/v2/{server-5m3dt5r1.js → server-t4k4qexw.js} +6 -2
  261. package/dist/v2/{server-z2037m6z.js → server-t528t8qm.js} +2 -2
  262. package/dist/v2/{server-v06jcv0w.js → server-vb7pbd9p.js} +18 -259
  263. package/dist/v2/{server-8tqanswc.js → server-zbxjj2mz.js} +331 -4
  264. package/dist/v2/server.d.ts.map +1 -1
  265. package/dist/v2/server.js +150 -6
  266. package/dist/v2/{storage-tags-w4tv77sn.js → storage-tags-5yxrvkaf.js} +6 -4
  267. package/dist/v2/store-reader.d.ts +8 -2
  268. package/dist/v2/store-reader.d.ts.map +1 -1
  269. package/dist/v2/{wrapup-orchestrator-mz7efs7w.js → wrapup-orchestrator-yem5422s.js} +36 -36
  270. package/dist/wrapup-orchestrator-xvrr27ws.js +45 -0
  271. package/package.json +4 -4
  272. package/src/config/{mural-model-deprecation.ts → deprecated-config.ts} +19 -0
  273. package/src/config/index.test.ts +15 -37
  274. package/src/config/index.ts +2 -3
  275. package/src/config/project-security.ts +3 -3
  276. package/src/config/schema/magic-context.ts +11 -7
  277. package/src/features/magic-context/dreamer/task-registry.ts +2 -3
  278. package/src/shared/auto-search-lifecycle.ts +43 -0
  279. package/src/shared/logger.test.ts +38 -0
  280. package/src/shared/logger.ts +10 -2
  281. package/src/shared/models-dev-cache.ts +1 -7
  282. package/src/shared/models-dev-temperature.ts +107 -0
  283. package/src/shared/project-directory-key.test.ts +59 -0
  284. package/src/shared/project-directory-key.ts +20 -0
  285. package/src/shared/sqlite-640-review.test.ts +5 -1
  286. package/src/shared/storage-file-mutex-review.test.ts +162 -0
  287. package/src/shared/storage-file-mutex.ts +130 -0
  288. package/src/shared/storage-permissions.ts +46 -0
  289. package/src/shared/subagent-temperature.test.ts +270 -0
  290. package/src/shared/subagent-temperature.ts +110 -0
  291. package/src/shared/window-geometry.test.ts +102 -236
  292. package/src/shared/window-geometry.ts +23 -413
  293. package/dist/config/mural-model-deprecation.d.ts.map +0 -1
  294. package/dist/embedding-backfill-9rcm1mfy.js +0 -21
  295. package/dist/index-bdckkfw6.js +0 -3261
  296. package/dist/index-mfkzp7qj.js +0 -229
  297. package/dist/v2/embedding-backfill-vn8g1nh1.js +0 -21
  298. package/dist/v2/recomp-orchestrator-az61rfcg.js +0 -57
  299. package/dist/v2/server-2fbhp79z.js +0 -3205
  300. package/dist/v2/server-mfkzp7qj.js +0 -229
  301. package/dist/wrapup-orchestrator-amzta1t4.js +0 -44
  302. package/src/shared/__fixtures__/window-overlay.v1.json +0 -337
  303. /package/dist/{index-2pp04pmg.js → index-69vas84q.js} +0 -0
  304. /package/dist/v2/{index-2pp04pmg.js → index-69vas84q.js} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,qBAAqB,CAAC;AA2GvE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAoiCpC,QAAA,MAAM,MAAM,EAAE,YAAY,GAAG;IAAE,KAAK,EAAE,OAAO,KAAK,CAAA;CAIjD,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,qBAAqB,CAAC;AA4GvE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAqiCpC,QAAA,MAAM,MAAM,EAAE,YAAY,GAAG;IAAE,KAAK,EAAE,OAAO,KAAK,CAAA;CAIjD,CAAC;AAEF,eAAe,MAAM,CAAC"}
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  log2,
12
12
  sessionLog2,
13
13
  flushLogger2
14
- } from "./index-8j7gqj40.js";
14
+ } from "./index-nsjyysj0.js";
15
15
  import {
16
16
  withContentLanguageDirective,
17
17
  string,
@@ -23,7 +23,7 @@ import {
23
23
  record,
24
24
  DEFAULT_EXECUTE_THRESHOLD_PERCENTAGE,
25
25
  DEFAULT_HISTORIAN_TIMEOUT_MS
26
- } from "./index-bhvjj0ys.js";
26
+ } from "./index-k6xvbj2e.js";
27
27
  import {
28
28
  denyTaskRoutingToCallerAgents,
29
29
  buildHiddenAgentRegistrations,
@@ -37,7 +37,6 @@ import {
37
37
  migrateMagicContextConfigLocations,
38
38
  getProtectedTokensTierOverrides,
39
39
  loadPluginConfigDetailed,
40
- BoundedSessionMap,
41
40
  historianRunConfig,
42
41
  dreamerRunConfig,
43
42
  pluginConfigReader,
@@ -51,35 +50,20 @@ import {
51
50
  invalidateAutoEmbedSession,
52
51
  getEmbedDrainUiStatus,
53
52
  clearEmbedSessionState,
54
- getProtectionWindowForSession,
55
- getPersistedReasoningWatermark,
56
- setPersistedReasoningWatermark,
57
- getChannel2NudgeState,
58
- getPersistedNoteNudge,
59
- removeNoteNudgeAnchorByMessageId,
60
- removeAutoSearchHintDecisionByMessageId,
61
- getHistorianFailureState,
62
- clearHistorianFailureState,
63
- getOverflowState,
64
- recordOverflowDetected,
65
- recordDetectedContextLimit,
66
- clearDetectedContextLimit,
67
- getPersistedCompactionMarkerState,
68
- removeStrippedPlaceholderId,
69
- getPendingCompactionMarkerState,
70
- clearPendingCompactionMarkerStateIf,
71
- getSessionsWithPendingMarker,
72
- getObservedEpochFloor,
73
53
  providerResponseFailed,
74
54
  isSuccessfulProviderCompletion,
75
- lkgProviderInputTotal,
76
- noteLkgProviderResponse,
77
- registerLkgPersistence,
78
- dropSlot,
55
+ forgetUnpublishedAutoSearchNoHint,
79
56
  getOrCreateSessionMeta,
80
57
  updateSessionMeta,
81
58
  markSessionCleanupPending,
82
59
  clearSession,
60
+ requestPendingMaterialization,
61
+ lkgProviderInputTotal,
62
+ noteLkgProviderResponse,
63
+ clearLkgMeasuredRequest,
64
+ createDbLkgPersistence,
65
+ registerLkgPersistence,
66
+ dropSlot,
83
67
  recordPromptSessionError,
84
68
  CTX_NOTE_LIGHT_DESCRIPTION,
85
69
  createPromptSurfaceRuntime,
@@ -88,10 +72,9 @@ import {
88
72
  checkCompactionMarkerConsistency,
89
73
  clearInjectionCache,
90
74
  clearNoteNudgeTriggerOnly
91
- } from "./index-692jzy0p.js";
75
+ } from "./index-zfzdpeq2.js";
92
76
  import"./index-sd3egckz.js";
93
77
  import {
94
- reloadWindowOverlay,
95
78
  hasTrustedAbsoluteWall,
96
79
  refreshModelLimitsFromApi,
97
80
  refreshModelLimitsAfterAuthOnce,
@@ -99,8 +82,7 @@ import {
99
82
  deriveHistorianChunkTokens2,
100
83
  resolveKnownHistorianContextLimit2,
101
84
  resolveHistorianContextLimit2
102
- } from "./index-pdecwzrd.js";
103
- import"./index-mfkzp7qj.js";
85
+ } from "./index-w23dh319.js";
104
86
  import {
105
87
  resolveOpenCodeDbPath,
106
88
  openCodeDbPathExists,
@@ -114,13 +96,10 @@ import {
114
96
  runSessionProjectBackfill,
115
97
  SMART_NOTE_COMPILER_SYSTEM_PROMPT,
116
98
  createLiveSessionState,
117
- getDefaultSubcConnectionFile,
118
- SubcModuleTransport,
119
99
  OpenCodeRetrospectiveRawProvider,
120
100
  createDreamTaskExecutor,
121
101
  runManualDream,
122
102
  runDueTasksForProject,
123
- createDbLkgPersistence,
124
103
  startDreamScheduleTimer,
125
104
  ensureProjectRegisteredFromOpenCodeDirectory,
126
105
  recordOpenCodeProvenInputFloor,
@@ -157,6 +136,7 @@ import {
157
136
  maybeDeliverChannel2,
158
137
  armLatestThinkingRecovery,
159
138
  armBindingRecoverySafely,
139
+ rustWrapupHistorianFields,
160
140
  clearMessageTokensCache,
161
141
  createTransform,
162
142
  createSubcModuleClient,
@@ -176,8 +156,9 @@ import {
176
156
  createCtxReduceTools,
177
157
  createCtxSearchTools,
178
158
  parameterDescriptionsFor,
179
- MagicContextRpcServer
180
- } from "./index-0an7742d.js";
159
+ MagicContextRpcServer,
160
+ applyHiddenSubagentTemperature
161
+ } from "./index-xnanvj3w.js";
181
162
  import {
182
163
  formatFailClosedBlockingMessage,
183
164
  createFailClosedController,
@@ -192,7 +173,7 @@ import {
192
173
  openDatabaseAsync,
193
174
  isDatabasePersisted,
194
175
  getDatabasePersistenceError
195
- } from "./index-q7h7csab.js";
176
+ } from "./index-zg8yq4ya.js";
196
177
  import {
197
178
  setHomeProjectPermission,
198
179
  ProjectIdentityError,
@@ -203,76 +184,101 @@ import {
203
184
  beginBootQuietPeriod,
204
185
  bootQuietRemainingMs,
205
186
  scheduleAfterBootQuiet
206
- } from "./index-knh4y330.js";
187
+ } from "./index-gzky5rva.js";
207
188
  import {
208
189
  deleteTemporalDecision
209
- } from "./index-db7zwa3v.js";
190
+ } from "./index-1bt88epp.js";
210
191
  import {
192
+ BoundedSessionMap,
211
193
  observeSessionActivity,
212
194
  backfillSessionActivity,
213
195
  deleteIndexedMessage
214
- } from "./index-14cjxt20.js";
196
+ } from "./index-sfhndpcb.js";
215
197
  import {
216
198
  recordSessionProjectIdentity,
217
199
  getProjectEmbeddingSnapshot2,
218
200
  getEmbeddingCoverageStatus2,
219
201
  getAutoEmbeddingSessionCoverage2
220
- } from "./index-c43kr12f.js";
202
+ } from "./index-fg00p1cg.js";
203
+ import"./index-6m7rdv7y.js";
221
204
  import"./index-fb3zxn06.js";
222
- import"./index-fbv1dn35.js";
223
- import"./index-7mx8v0pw.js";
205
+ import"./index-7w18gg78.js";
206
+ import"./index-att4bfan.js";
224
207
  import"./index-fr0wbhdn.js";
225
208
  import {
226
209
  preloadTokenizer
227
- } from "./index-1qb0z7wa.js";
210
+ } from "./index-qx53vezw.js";
228
211
  import {
229
212
  getCurrentToolSetHash,
230
213
  recordToolDefinition
231
- } from "./index-0qhce371.js";
214
+ } from "./index-h2wc01qk.js";
232
215
  import {
233
216
  invalidateTrueRawTokenCache,
234
217
  recordToolParameters,
235
218
  createDroppedInputToolExecuteBeforeHook,
219
+ getProtectionWindowForSession,
220
+ getPersistedReasoningWatermark,
221
+ setPersistedReasoningWatermark,
222
+ getChannel2NudgeState,
223
+ getPersistedNoteNudge,
224
+ removeNoteNudgeAnchorByMessageId,
225
+ removeAutoSearchHintDecisionByMessageId,
226
+ getHistorianFailureState,
227
+ clearHistorianFailureState,
228
+ getOverflowState,
229
+ recordOverflowDetected,
230
+ recordDetectedContextLimit,
231
+ clearDetectedContextLimit,
232
+ getPersistedCompactionMarkerState,
233
+ removeStrippedPlaceholderId,
234
+ getPendingCompactionMarkerState,
235
+ clearPendingCompactionMarkerStateIf,
236
+ getSessionsWithPendingMarker,
237
+ getObservedEpochFloor,
236
238
  detectThinkingBindingMismatch,
237
239
  detectLatestTurnThinkingMismatch,
238
240
  isPrefixBoundThinkingModel,
239
241
  detectOverflow,
240
242
  isAnthropicFamilyRoute,
241
243
  readRawSessionMessages2
242
- } from "./index-bdckkfw6.js";
243
- import"./index-72nhv486.js";
244
+ } from "./index-sv0bb7vg.js";
245
+ import"./index-vkbqdnkj.js";
246
+ import {
247
+ getDefaultSubcConnectionFile,
248
+ SubcModuleTransport
249
+ } from "./index-fdtkt5r1.js";
244
250
  import {
245
251
  isEmbeddingHostBusy2
246
252
  } from "./index-qt1qqasc.js";
247
- import"./index-jcbd3znx.js";
253
+ import"./index-tqf7yg27.js";
248
254
  import {
249
255
  registerExitAbort,
250
256
  unregisterExitAbort,
251
257
  forgetRawSessionOrdinalWatermark2
252
- } from "./index-dhwzyd54.js";
258
+ } from "./index-h5zfkjyk.js";
253
259
  import {
254
260
  observeOpenCodeTurnEvent,
255
261
  clearTrackedOpenCodeSession,
256
262
  findLastAssistantModelFromOpenCodeDb
257
- } from "./index-ty64eqcn.js";
263
+ } from "./index-0pjvpfkf.js";
258
264
  import {
259
265
  sendCommandResult2,
260
266
  sendStatusNotification2
261
- } from "./index-yq8n9qcb.js";
267
+ } from "./index-xgrwmj82.js";
262
268
  import {
263
269
  detectConflicts,
264
270
  resolveCompactionForBoot
265
- } from "./index-eeezr5zz.js";
271
+ } from "./index-z1tjp257.js";
266
272
  import {
267
273
  sendConflictWarning2,
268
274
  cleanupConflictWarnings2
269
- } from "./index-z8e0psj8.js";
275
+ } from "./index-s7fc0fkn.js";
270
276
  import"./index-1zx87sdm.js";
271
277
  import {
272
278
  stripPersistedAssistantText,
273
279
  deleteTagsByMessageId2,
274
280
  getMaxTagNumberBySession2
275
- } from "./index-k9nnwad5.js";
281
+ } from "./index-nydv6g8r.js";
276
282
  import {
277
283
  resolveHistorianModel2,
278
284
  resolveOpenCodeAgentOverrides2,
@@ -282,33 +288,33 @@ import {
282
288
  buildDreamTaskRuntimeConfigs2,
283
289
  userMemoryCollectionEnabled2
284
290
  } from "./index-ghc9f0n7.js";
285
- import"./index-pg50n748.js";
286
- import"./index-cb7emxgj.js";
291
+ import"./index-p1hnwfd8.js";
292
+ import"./index-rafsaxac.js";
287
293
  import {
288
294
  pushNotification2
289
295
  } from "./index-x8a7jmkh.js";
296
+ import"./index-gbmqa9x9.js";
290
297
  import"./index-4dhv7mqz.js";
291
- import"./index-5zygecde.js";
298
+ import"./index-r2zcs71c.js";
292
299
  import"./index-7jzrrxap.js";
293
- import"./index-q2tqeqde.js";
294
300
  import {
295
301
  createTagger,
296
302
  cavemanWordRulesForLanguage,
297
303
  setCtxReduceRegisteredGlobally,
298
304
  clearToolPermissionDenied,
299
305
  resetDegradedCacheCount2
300
- } from "./index-f0h6xwqm.js";
306
+ } from "./index-p0n5ryq8.js";
301
307
  import {
302
308
  runManagedRecomp2
303
- } from "./index-mmyh6d8f.js";
309
+ } from "./index-eypn4ba6.js";
304
310
  import {
305
311
  isValidSemver,
306
312
  compareSemverCore
307
- } from "./index-0w56v4fm.js";
313
+ } from "./index-mw7c950g.js";
308
314
  import"./index-fmsr7v69.js";
309
315
  import {
310
316
  runManagedWrapup2
311
- } from "./index-k1xb52kd.js";
317
+ } from "./index-6tfxmc4n.js";
312
318
  import {
313
319
  __toESM,
314
320
  __commonJS
@@ -321,14 +327,14 @@ import {
321
327
  ensureStorageDirectorySync,
322
328
  writeStorageFileSync,
323
329
  writeStorageFileAtomicSync
324
- } from "./index-1bc61ans.js";
330
+ } from "./index-fvnzcnww.js";
325
331
  import {
326
332
  piModelRefToCanonical
327
333
  } from "./index-avwt563y.js";
328
334
  import {
329
335
  closeQuietly
330
336
  } from "./index-8ajstryz.js";
331
- import"./index-2y0s2hep.js";
337
+ import"./index-4mjhqadz.js";
332
338
 
333
339
  // ../../node_modules/.bun/esprima@4.0.1/node_modules/esprima/dist/esprima.js
334
340
  var require_esprima = __commonJS(function(exports, module) {
@@ -8167,6 +8173,132 @@ var require_src2 = __commonJS(function(exports, module) {
8167
8173
  removeBlankLines
8168
8174
  };
8169
8175
  });
8176
+ // package.json
8177
+ var package_default = {
8178
+ name: "@cortexkit/opencode-magic-context",
8179
+ version: "0.49.1",
8180
+ type: "module",
8181
+ description: "OpenCode plugin for Magic Context — cross-session memory and context management",
8182
+ main: "dist/index.js",
8183
+ types: "dist/index.d.ts",
8184
+ author: "ualtinok",
8185
+ license: "MIT",
8186
+ keywords: [
8187
+ "opencode",
8188
+ "plugin",
8189
+ "context",
8190
+ "memory",
8191
+ "ai",
8192
+ "llm",
8193
+ "prompt-caching",
8194
+ "session-history"
8195
+ ],
8196
+ repository: {
8197
+ type: "git",
8198
+ url: "https://github.com/cortexkit/magic-context",
8199
+ directory: "packages/plugin"
8200
+ },
8201
+ files: [
8202
+ "dist",
8203
+ "index.js",
8204
+ "tui.js",
8205
+ "src/tui",
8206
+ "src/tui-compiled",
8207
+ "src/v2/tui",
8208
+ "src/shared",
8209
+ "src/config",
8210
+ "src/agents",
8211
+ "src/features/magic-context/dreamer/cron.ts",
8212
+ "src/features/magic-context/dreamer/task-registry.ts",
8213
+ "README.md"
8214
+ ],
8215
+ scripts: {
8216
+ build: "bun ../../scripts/check-bun.mjs && tsc -p ../retina-local-fs/tsconfig.build.json && bun run build:tui && bun ../../scripts/clean-dist-chunks.mjs dist index.js transformers-web.js transformers-node-wasm.js && bun build src/features/magic-context/memory/transformers-web-entry.ts --outfile dist/transformers-web.js --target browser --format esm --external onnxruntime-web && bun scripts/build-transformers-node-wasm.ts dist && bun build src/index.ts src/features/magic-context/memory/embedding-worker.ts src/features/magic-context/memory/embedding-worker-process.ts src/features/magic-context/migration-worker.ts src/hooks/magic-context/auto-search-worker.ts src/hooks/magic-context/raw-ordinal-warmup-worker.ts --outdir dist --entry-naming '[name].[ext]' --target node --format esm --splitting --external @opencode-ai/plugin --external onnxruntime-node --external onnxruntime-web --external sharp --external bun:ffi --external bun:sqlite --external node:sqlite && bun run build:v2 && tsc --emitDeclarationOnly",
8217
+ "build:v2": "bun ../../scripts/clean-dist-chunks.mjs dist/v2 server.js embedding-worker.js embedding-worker-process.js migration-worker.js && bun build src/features/magic-context/memory/transformers-web-entry.ts --outfile dist/v2/transformers-web.js --target browser --format esm --external onnxruntime-web && bun scripts/build-transformers-node-wasm.ts dist/v2 && bun build src/v2/server.ts src/features/magic-context/memory/embedding-worker.ts src/features/magic-context/memory/embedding-worker-process.ts src/features/magic-context/migration-worker.ts src/hooks/magic-context/auto-search-worker.ts src/hooks/magic-context/raw-ordinal-warmup-worker.ts --outdir dist/v2 --entry-naming '[name].[ext]' --target node --format esm --splitting --external @opencode/plugin --external onnxruntime-node --external onnxruntime-web --external sharp --external bun:ffi --external bun:sqlite --external node:sqlite",
8218
+ "build:tui": "bun scripts/build-tui.ts",
8219
+ "check:tui-compiled": 'git diff --exit-code -- src/tui-compiled && test -z "$(git status --porcelain -- src/tui-compiled)"',
8220
+ "check:transformers-node-wasm": "bun scripts/verify-transformers-node-wasm.ts",
8221
+ typecheck: "tsc -p ../retina-local-fs/tsconfig.build.json && tsc --noEmit && tsc -p tsconfig.scripts.json",
8222
+ test: "bun ../../scripts/check-bun.mjs && bun install --frozen-lockfile && BUN_JSC_useOMGJIT=0 bun test --parallel=4 --timeout 30000",
8223
+ "test:serial": "bun install --frozen-lockfile && BUN_JSC_useOMGJIT=0 bun test --timeout 30000",
8224
+ "test:parallel:probe": "bun scripts/verify-parallel-db-isolation.ts",
8225
+ lint: "bun ../../scripts/check-bun.mjs && biome check .",
8226
+ "lint:fix": "biome check --write .",
8227
+ format: "biome format --write .",
8228
+ "format:check": "biome format .",
8229
+ clean: "bun ../../scripts/clean-dist-chunks.mjs dist index.js embedding-worker.js embedding-worker-process.js migration-worker.js transformers-web.js transformers-node-wasm.js && bun ../../scripts/clean-dist-chunks.mjs dist/v2 server.js embedding-worker.js embedding-worker-process.js migration-worker.js transformers-web.js transformers-node-wasm.js",
8230
+ prepublishOnly: "bun run build && bun run check:tui-compiled"
8231
+ },
8232
+ "//check:tui-compiled": "Check drift on output already generated by build or build:tui; this check never regenerates files. CI and prepublishOnly build first.",
8233
+ "//test": "Only test runs disable JSC's optimizing WebAssembly tier so per-file isolation does not pay its compilation cost on every file. This is not a production setting and does not change host process engine options.",
8234
+ dependencies: {
8235
+ "@cortexkit/subc-client": "0.11.1",
8236
+ "@jitl/quickjs-singlefile-cjs-release-asyncify": "0.32.0",
8237
+ "@opencode-ai/plugin": "^1.17.11",
8238
+ "@opencode-ai/sdk": "^1.17.11",
8239
+ "ai-tokenizer": "^1.0.6",
8240
+ "comment-json": "^5.0.0",
8241
+ "jsonc-parser": "^3.3.1",
8242
+ "onnxruntime-web": "1.26.0-dev.20260416-b7804b056c",
8243
+ "quickjs-emscripten": "^0.32.0",
8244
+ zod: "^4.1.8"
8245
+ },
8246
+ optionalDependencies: {
8247
+ "onnxruntime-node": "1.30.0",
8248
+ sharp: "^0.35.0"
8249
+ },
8250
+ devDependencies: {
8251
+ "@opentui/core": "^0.4.2",
8252
+ "@opentui/solid": "^0.4.2",
8253
+ "solid-js": "1.9.12",
8254
+ "@opencode/plugin": "2.0.22",
8255
+ "@opencode/ai": "2.0.22",
8256
+ "@opencode/cli": "2.0.22",
8257
+ "@opencode/client": "2.0.22",
8258
+ effect: "4.0.0-rc.112",
8259
+ "@ai-sdk/anthropic": "3.0.82",
8260
+ ai: "6.0.168",
8261
+ "@huggingface/transformers": "^4.3.0",
8262
+ "@ai-sdk/openai-compatible": "2.0.41",
8263
+ "@biomejs/biome": "^2.5.1",
8264
+ "@types/better-sqlite3": "^7.6.13",
8265
+ "@types/bun": "^1.3.10",
8266
+ "@types/node": "^22.20.0",
8267
+ "bun-types": "^1.3.10",
8268
+ typescript: "^5.8.0"
8269
+ },
8270
+ exports: {
8271
+ ".": {
8272
+ types: "./dist/index.d.ts",
8273
+ import: "./dist/index.js"
8274
+ },
8275
+ "./tui": {
8276
+ types: "./src/tui/index.tsx",
8277
+ import: "./src/tui/entry.mjs"
8278
+ }
8279
+ },
8280
+ "oc-plugin": [
8281
+ "server",
8282
+ "tui"
8283
+ ],
8284
+ peerDependencies: {
8285
+ "@opencode-ai/plugin": ">=1.15.0",
8286
+ "@opentui/core": ">=0.4.2",
8287
+ "@opentui/solid": ">=0.4.2",
8288
+ "solid-js": "^1.9.12"
8289
+ },
8290
+ peerDependenciesMeta: {
8291
+ "@opentui/core": {
8292
+ optional: true
8293
+ },
8294
+ "@opentui/solid": {
8295
+ optional: true
8296
+ },
8297
+ "solid-js": {
8298
+ optional: true
8299
+ }
8300
+ }
8301
+ };
8170
8302
 
8171
8303
  // src/features/magic-context/v22-deferred-backfill.ts
8172
8304
  import { createHash } from "node:crypto";
@@ -9501,7 +9633,7 @@ async function deliverChannel2IfPending(deps, sessionId) {
9501
9633
  }
9502
9634
  }
9503
9635
  function cleanupRemovedMessageState(deps, sessionId, messageId) {
9504
- return deps.db.transaction(() => {
9636
+ const result = deps.db.transaction(() => {
9505
9637
  const removedTagNumbers = deleteTagsByMessageId2(deps.db, sessionId, messageId);
9506
9638
  deleteTemporalDecision(deps.db, sessionId, messageId);
9507
9639
  sessionLog2(sessionId, `event message.removed: deleted ${removedTagNumbers.length} tag(s) for message ${messageId}`);
@@ -9531,6 +9663,8 @@ function cleanupRemovedMessageState(deps, sessionId, messageId) {
9531
9663
  clearedNoteNudge
9532
9664
  };
9533
9665
  }).immediate();
9666
+ forgetUnpublishedAutoSearchNoHint(sessionId, messageId);
9667
+ return result;
9534
9668
  }
9535
9669
  function createEventHandler2(deps) {
9536
9670
  const newestUsageMessageIdBySession = new Map;
@@ -10022,13 +10156,14 @@ function createEventHandler2(deps) {
10022
10156
  return;
10023
10157
  }
10024
10158
  dropSlot(sessionId, "session.deleted");
10159
+ clearLkgMeasuredRequest(sessionId);
10025
10160
  clearTrackedOpenCodeSession(sessionId);
10026
10161
  try {
10027
10162
  const rustCleanupPending = markSessionCleanupPending(deps.db, sessionId, deps.rustSessionCleanup === true);
10028
10163
  await deps.onSessionDeleted?.(sessionId);
10029
10164
  if (!rustCleanupPending || deps.rustSessionCleanup === true) {
10030
10165
  removeCompactionMarkerForSession(deps.db, sessionId);
10031
- clearSession(deps.db, sessionId, deps.rustSessionCleanup === true);
10166
+ clearSession(deps.db, sessionId, deps.rustSessionCleanup === true, true);
10032
10167
  }
10033
10168
  } catch (error) {
10034
10169
  sessionLog2(sessionId, "event session.deleted persistence failed:", error);
@@ -10583,6 +10718,15 @@ function createMagicContextHook(deps) {
10583
10718
  historyBudgetPercentage: deps.config.history_budget_percentage,
10584
10719
  transformMode: deps.config.transform_mode,
10585
10720
  rustModeModuleClient,
10721
+ resolveRustWrapupHistorianFields: () => {
10722
+ const run = sampleHistorian();
10723
+ return rustWrapupHistorianFields({
10724
+ historianModel: run.model,
10725
+ fallbackModels: run.fallbackModels,
10726
+ timeoutMs: run.timeoutMs,
10727
+ maxOutputTokens: run.maxOutputTokens
10728
+ });
10729
+ },
10586
10730
  projectRoot: deps.directory,
10587
10731
  commitClusterTrigger: deps.config.commit_cluster_trigger,
10588
10732
  sampleCommitClusterTrigger: () => (deps.sampleHistorianConfig?.() ?? deps.config).commit_cluster_trigger,
@@ -10608,7 +10752,7 @@ function createMagicContextHook(deps) {
10608
10752
  onFlush: (sessionId) => {
10609
10753
  historyRefreshSessions.add(sessionId);
10610
10754
  systemPromptRefreshSessions.add(sessionId);
10611
- pendingMaterializationSessions.add(sessionId);
10755
+ requestPendingMaterialization(pendingMaterializationSessions, sessionId, "user_flush");
10612
10756
  },
10613
10757
  executeWrapup: historianRunnable ? async (sessionId, options) => runManagedWrapup2(buildManagedWrapupCtx(sessionId), sessionId, options) : undefined,
10614
10758
  executeRecomp: historianRunnable ? async (sessionId, options) => runManagedRecomp2(buildManagedRecompCtx(sessionId), sessionId, options) : undefined,
@@ -11743,6 +11887,7 @@ function createToolRegistry(args) {
11743
11887
  }),
11744
11888
  ...createCtxSearchTools({
11745
11889
  db,
11890
+ rerankConnectionFile: pluginConfig.subc?.connection_file,
11746
11891
  resolveProjectPath,
11747
11892
  ensureProjectRegistered: ensureProjectRegisteredFromOpenCodeDirectory
11748
11893
  }),
@@ -11805,6 +11950,24 @@ function buildOpenCodeConfigWarningBanner(warnings, parseFailures, allParseFailu
11805
11950
  `);
11806
11951
  }
11807
11952
 
11953
+ // src/standalone-plugin-marker.ts
11954
+ var markerSymbol = Symbol.for("cortexkit.standalone-plugins");
11955
+ function registerStandalonePluginMarker(version) {
11956
+ try {
11957
+ const globals = globalThis;
11958
+ let registry = globals[markerSymbol];
11959
+ if (registry === undefined) {
11960
+ registry = new Map;
11961
+ globals[markerSymbol] = registry;
11962
+ }
11963
+ registry.set("magic-context", { version });
11964
+ } catch (error) {
11965
+ try {
11966
+ log2("could not register the standalone plugin marker", error);
11967
+ } catch {}
11968
+ }
11969
+ }
11970
+
11808
11971
  // src/v2/hooks/update-check.ts
11809
11972
  import { existsSync as existsSync8, readFileSync as readFileSync7 } from "node:fs";
11810
11973
  import { dirname as dirname4, join as join10 } from "node:path";
@@ -11879,6 +12042,7 @@ function startUpdateChecks(context, check = (signal) => {
11879
12042
  }
11880
12043
 
11881
12044
  // src/v2/server.ts
12045
+ registerStandalonePluginMarker(package_default.version);
11882
12046
  function isOpenCode2HostContext(context) {
11883
12047
  if (typeof context !== "object" || context === null)
11884
12048
  return false;
@@ -11890,7 +12054,7 @@ async function setup(context) {
11890
12054
  log2("v2 setup() called on a host without session.hook; v1 server lane owns this host, v2 lane inert");
11891
12055
  return async () => {};
11892
12056
  }
11893
- const { registerContext } = await import("./context-m0cy262m.js");
12057
+ const { registerContext } = await import("./context-tfyhtdcs.js");
11894
12058
  setHarness2("opencode2");
11895
12059
  bindStaleBuildNotice({}, import.meta.url, "opencode2");
11896
12060
  const duties = await registerContext(context);
@@ -11906,6 +12070,7 @@ async function setup(context) {
11906
12070
  // src/index.ts
11907
12071
  var BOOT_SERVER_DEADLINE_MS = 15000;
11908
12072
  var RESOLVED_CONFIG_TIMEOUT_MS = 2000;
12073
+ registerStandalonePluginMarker(package_default.version);
11909
12074
  var server = async (ctx) => {
11910
12075
  bindStaleBuildNotice(ctx.client, import.meta.url);
11911
12076
  const bootStartedAt = performance.now();
@@ -11930,7 +12095,6 @@ var server = async (ctx) => {
11930
12095
  setHomeProjectPermission(pluginConfig.allow_home_project);
11931
12096
  const liveConfigReader = pluginConfigReader(ctx.directory, pluginConfig);
11932
12097
  const dreamerCap = createDreamerOutputCapSampler(pluginConfig, () => liveConfigReader.poll().effective);
11933
- reloadWindowOverlay(pluginConfig.models?.window_overlay_path);
11934
12098
  const promptSurfaceRuntime = createPromptSurfaceRuntime({
11935
12099
  harness: "opencode",
11936
12100
  directory: ctx.directory,
@@ -11961,7 +12125,7 @@ var server = async (ctx) => {
11961
12125
  if (hasBannerEntries)
11962
12126
  setTimeout(async () => {
11963
12127
  try {
11964
- const { sendStatusNotification } = await importPluginModule(() => import("./send-session-notification-erecz4y4.js"));
12128
+ const { sendStatusNotification } = await importPluginModule(() => import("./send-session-notification-xffh3bbe.js"));
11965
12129
  const clientWithSessions = ctx.client;
11966
12130
  const sessions = await Promise.resolve(clientWithSessions.session?.list?.()).catch(() => null);
11967
12131
  const sessionList = Array.isArray(sessions) ? sessions : sessions?.data;
@@ -11978,7 +12142,7 @@ var server = async (ctx) => {
11978
12142
  log2(`[magic-context] opencode_db_missing path=${openCodeDbResolution.path} source=${openCodeDbResolution.source}`);
11979
12143
  setTimeout(async () => {
11980
12144
  try {
11981
- const { sendStatusNotification } = await importPluginModule(() => import("./send-session-notification-erecz4y4.js"));
12145
+ const { sendStatusNotification } = await importPluginModule(() => import("./send-session-notification-xffh3bbe.js"));
11982
12146
  const clientWithSessions = ctx.client;
11983
12147
  const sessions = await Promise.resolve(clientWithSessions.session?.list?.()).catch(() => null);
11984
12148
  const sessionList = Array.isArray(sessions) ? sessions : sessions?.data;
@@ -12254,12 +12418,12 @@ var server = async (ctx) => {
12254
12418
  {
12255
12419
  const fence = getSchemaFenceRejection();
12256
12420
  if (fence) {
12257
- importPluginModule(() => import("./conflict-warning-hook-w8cykrnf.js")).then(({ sendSchemaFenceWarning }) => sendSchemaFenceWarning(ctx.client, ctx.directory, fence)).catch((error) => log2("[magic-context] schema-fence warning unavailable:", error));
12421
+ importPluginModule(() => import("./conflict-warning-hook-asnt6hfc.js")).then(({ sendSchemaFenceWarning }) => sendSchemaFenceWarning(ctx.client, ctx.directory, fence)).catch((error) => log2("[magic-context] schema-fence warning unavailable:", error));
12258
12422
  }
12259
12423
  }
12260
12424
  const serverUrl = ctx.serverUrl;
12261
12425
  const serverUrlStr = serverUrl instanceof URL ? serverUrl.toString().replace(/\/$/, "") : typeof serverUrl === "string" ? serverUrl.replace(/\/$/, "") : undefined;
12262
- importPluginModule(() => import("./send-session-notification-erecz4y4.js")).then(({ setNotificationServerUrl }) => {
12426
+ importPluginModule(() => import("./send-session-notification-xffh3bbe.js")).then(({ setNotificationServerUrl }) => {
12263
12427
  setNotificationServerUrl(serverUrlStr);
12264
12428
  }).catch((error) => log2("[magic-context] notification transport unavailable:", error));
12265
12429
  if (conflictResult?.hasConflict) {
@@ -12273,7 +12437,7 @@ var server = async (ctx) => {
12273
12437
  }
12274
12438
  if (pluginConfig.enabled && !conflictResult?.hasConflict) {
12275
12439
  setTimeout(() => {
12276
- importPluginModule(() => import("./announcement-fp14dw0n.js")).then(({
12440
+ importPluginModule(() => import("./announcement-hdbkt8v5.js")).then(({
12277
12441
  shouldShowAnnouncement,
12278
12442
  ANNOUNCEMENT_VERSION,
12279
12443
  ANNOUNCEMENT_FEATURES,
@@ -12282,7 +12446,7 @@ var server = async (ctx) => {
12282
12446
  }) => {
12283
12447
  if (!shouldShowAnnouncement())
12284
12448
  return;
12285
- return importPluginModule(() => import("./conflict-warning-hook-w8cykrnf.js")).then(({ sendStartupAnnouncement }) => sendStartupAnnouncement(ctx.client, ctx.directory, ANNOUNCEMENT_VERSION, ANNOUNCEMENT_FEATURES, ANNOUNCEMENT_FOOTER, markAnnouncementSeen));
12449
+ return importPluginModule(() => import("./conflict-warning-hook-asnt6hfc.js")).then(({ sendStartupAnnouncement }) => sendStartupAnnouncement(ctx.client, ctx.directory, ANNOUNCEMENT_VERSION, ANNOUNCEMENT_FEATURES, ANNOUNCEMENT_FOOTER, markAnnouncementSeen));
12286
12450
  }).catch(() => {});
12287
12451
  }, 8000);
12288
12452
  }
@@ -12344,6 +12508,7 @@ var server = async (ctx) => {
12344
12508
  }),
12345
12509
  "chat.params": async (input, output) => {
12346
12510
  dreamerCap.apply(input, output);
12511
+ applyHiddenSubagentTemperature(input, output, log2);
12347
12512
  },
12348
12513
  "experimental.chat.messages.transform": createMessagesTransformHandler({
12349
12514
  magicContext: magicContextRuntime.magicContext,
@@ -12355,8 +12520,8 @@ var server = async (ctx) => {
12355
12520
  tryReopenStorage,
12356
12521
  rustReplayParticipant: () => magicContextRuntime.magicContext?.getRustReplayParticipant?.() ?? null,
12357
12522
  onStorageBusyRefusal: async (sessionId, message) => {
12358
- const { sendStatusNotification } = await importPluginModule(() => import("./send-session-notification-erecz4y4.js"));
12359
- const { abortSessionFailClosed } = await importPluginModule(() => import("./transform-postprocess-phase-spcy2qre.js"));
12523
+ const { sendStatusNotification } = await importPluginModule(() => import("./send-session-notification-xffh3bbe.js"));
12524
+ const { abortSessionFailClosed } = await importPluginModule(() => import("./transform-postprocess-phase-481j5a7z.js"));
12360
12525
  await sendStatusNotification(ctx.client, sessionId, message, {
12361
12526
  toastDurationMs: 15000
12362
12527
  });
@@ -6,7 +6,7 @@ import {
6
6
  getLoggerDiagnostics2,
7
7
  flushLogger2,
8
8
  getLogFilePath2
9
- } from "./index-8j7gqj40.js";
9
+ } from "./index-nsjyysj0.js";
10
10
  import"./index-0sahzkwr.js";
11
11
  import"./index-pavzsdc6.js";
12
12
  export {