@cortexkit/opencode-magic-context 0.49.11 → 0.49.13

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 (253) hide show
  1. package/README.md +1 -1
  2. package/dist/agents/smart-notes-dreamer-gate.fixture.d.ts +28 -0
  3. package/dist/agents/smart-notes-dreamer-gate.fixture.d.ts.map +1 -0
  4. package/dist/{announcement-hdbkt8v5.js → announcement-g789dmt6.js} +2 -2
  5. package/dist/auto-search-worker.js +4 -4
  6. package/dist/chunk-embedding-write-worker.js +89 -0
  7. package/dist/{compaction-marker-candidates-xxz35vwp.js → compaction-marker-candidates-v5c6997n.js} +3 -3
  8. package/dist/compaction-marker-candidates-worker.js +1 -1
  9. package/dist/config/agent-disable.d.ts +14 -0
  10. package/dist/config/agent-disable.d.ts.map +1 -1
  11. package/dist/config/dependency-notes.d.ts +34 -0
  12. package/dist/config/dependency-notes.d.ts.map +1 -0
  13. package/dist/config/schema/agent-overrides.d.ts +12 -12
  14. package/dist/config/schema/magic-context.d.ts +88 -88
  15. package/dist/config/schema/magic-context.d.ts.map +1 -1
  16. package/dist/{conflict-warning-hook-xwkfncav.js → conflict-warning-hook-mgq17yr3.js} +8 -8
  17. package/dist/{context-twz3s0cg.js → context-azqk0vfd.js} +121 -145
  18. package/dist/{derive-budgets-3nbxsyss.js → derive-budgets-zn7yzd2d.js} +3 -3
  19. package/dist/embedding-backfill-5e1t5wha.js +22 -0
  20. package/dist/embedding-worker-process.js +2 -2
  21. package/dist/embedding-worker.js +6 -6
  22. package/dist/features/magic-context/chunk-embedding-write-worker.d.ts +2 -0
  23. package/dist/features/magic-context/chunk-embedding-write-worker.d.ts.map +1 -0
  24. package/dist/features/magic-context/chunk-embedding-writer.d.ts +48 -0
  25. package/dist/features/magic-context/chunk-embedding-writer.d.ts.map +1 -0
  26. package/dist/features/magic-context/compartment-chunk-embedding.d.ts +1 -1
  27. package/dist/features/magic-context/compartment-chunk-embedding.d.ts.map +1 -1
  28. package/dist/features/magic-context/dreamer/hidden-single-shot.d.ts +3 -2
  29. package/dist/features/magic-context/dreamer/hidden-single-shot.d.ts.map +1 -1
  30. package/dist/features/magic-context/dreamer/map-memories.d.ts +8 -1
  31. package/dist/features/magic-context/dreamer/map-memories.d.ts.map +1 -1
  32. package/dist/features/magic-context/dreamer/retrospective-raw-provider.d.ts +2 -0
  33. package/dist/features/magic-context/dreamer/retrospective-raw-provider.d.ts.map +1 -1
  34. package/dist/features/magic-context/dreamer/storage-dream-runs.d.ts +5 -0
  35. package/dist/features/magic-context/dreamer/storage-dream-runs.d.ts.map +1 -1
  36. package/dist/features/magic-context/dreamer/task-config.d.ts +22 -4
  37. package/dist/features/magic-context/dreamer/task-config.d.ts.map +1 -1
  38. package/dist/features/magic-context/dreamer/task-executor.d.ts.map +1 -1
  39. package/dist/features/magic-context/dreamer/task-registry.d.ts +22 -0
  40. package/dist/features/magic-context/dreamer/task-registry.d.ts.map +1 -1
  41. package/dist/features/magic-context/dreamer/task-scheduler.d.ts +4 -1
  42. package/dist/features/magic-context/dreamer/task-scheduler.d.ts.map +1 -1
  43. package/dist/features/magic-context/dreamer/verify-prompt.d.ts +6 -1
  44. package/dist/features/magic-context/dreamer/verify-prompt.d.ts.map +1 -1
  45. package/dist/features/magic-context/dreamer/verify.d.ts +25 -11
  46. package/dist/features/magic-context/dreamer/verify.d.ts.map +1 -1
  47. package/dist/features/magic-context/memory/embedding-openai.d.ts +32 -0
  48. package/dist/features/magic-context/memory/embedding-openai.d.ts.map +1 -1
  49. package/dist/features/magic-context/memory/project-identity.d.ts +1 -0
  50. package/dist/features/magic-context/memory/project-identity.d.ts.map +1 -1
  51. package/dist/features/magic-context/memory/unborn-head.d.ts +34 -0
  52. package/dist/features/magic-context/memory/unborn-head.d.ts.map +1 -0
  53. package/dist/features/magic-context/mural/compress-cues.d.ts +3 -0
  54. package/dist/features/magic-context/mural/compress-cues.d.ts.map +1 -1
  55. package/dist/features/magic-context/project-embedding-registry.d.ts +5 -0
  56. package/dist/features/magic-context/project-embedding-registry.d.ts.map +1 -1
  57. package/dist/features/magic-context/storage-tags.d.ts +2 -0
  58. package/dist/features/magic-context/storage-tags.d.ts.map +1 -1
  59. package/dist/{history-owner-ty29fz0f.js → history-owner-xp3pngv7.js} +3 -3
  60. package/dist/hooks/magic-context/apply-operations.d.ts.map +1 -1
  61. package/dist/hooks/magic-context/auto-embed-session.d.ts +10 -0
  62. package/dist/hooks/magic-context/auto-embed-session.d.ts.map +1 -0
  63. package/dist/hooks/magic-context/compartment-prompt.d.ts +6 -0
  64. package/dist/hooks/magic-context/compartment-prompt.d.ts.map +1 -1
  65. package/dist/hooks/magic-context/compartment-runner-incremental.d.ts.map +1 -1
  66. package/dist/hooks/magic-context/compartment-runner-types.d.ts +3 -0
  67. package/dist/hooks/magic-context/compartment-runner-types.d.ts.map +1 -1
  68. package/dist/hooks/magic-context/compartment-trigger-error.d.ts +12 -0
  69. package/dist/hooks/magic-context/compartment-trigger-error.d.ts.map +1 -0
  70. package/dist/hooks/magic-context/embed-session-state.d.ts +8 -1
  71. package/dist/hooks/magic-context/embed-session-state.d.ts.map +1 -1
  72. package/dist/hooks/magic-context/historian-prompt-fit.d.ts +2 -0
  73. package/dist/hooks/magic-context/historian-prompt-fit.d.ts.map +1 -1
  74. package/dist/hooks/magic-context/hook.d.ts +3 -1
  75. package/dist/hooks/magic-context/hook.d.ts.map +1 -1
  76. package/dist/hooks/magic-context/pending-materialization.d.ts +2 -0
  77. package/dist/hooks/magic-context/pending-materialization.d.ts.map +1 -1
  78. package/dist/hooks/magic-context/protected-tail-boundary.d.ts +12 -0
  79. package/dist/hooks/magic-context/protected-tail-boundary.d.ts.map +1 -1
  80. package/dist/hooks/magic-context/raw-exact-ordinal-read.d.ts +58 -0
  81. package/dist/hooks/magic-context/raw-exact-ordinal-read.d.ts.map +1 -0
  82. package/dist/hooks/magic-context/raw-ordinal-warmup.d.ts +7 -0
  83. package/dist/hooks/magic-context/raw-ordinal-warmup.d.ts.map +1 -1
  84. package/dist/hooks/magic-context/read-session-raw.d.ts +19 -0
  85. package/dist/hooks/magic-context/read-session-raw.d.ts.map +1 -1
  86. package/dist/hooks/magic-context/recomp-orchestrator.d.ts +2 -0
  87. package/dist/hooks/magic-context/recomp-orchestrator.d.ts.map +1 -1
  88. package/dist/hooks/magic-context/transform-compartment-phase.d.ts +2 -0
  89. package/dist/hooks/magic-context/transform-compartment-phase.d.ts.map +1 -1
  90. package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
  91. package/dist/hooks/magic-context/transform.d.ts +4 -0
  92. package/dist/hooks/magic-context/transform.d.ts.map +1 -1
  93. package/dist/hooks/magic-context/wrapup-orchestrator.d.ts.map +1 -1
  94. package/dist/{index-bzp9s8z2.js → index-1d289pq2.js} +2 -2
  95. package/dist/{index-w28y7d0z.js → index-1sarmj9z.js} +15 -15
  96. package/dist/{index-z7avx6rw.js → index-2jr1smmh.js} +280 -160
  97. package/dist/{index-4ccdr7yw.js → index-3kdm78zp.js} +5 -5
  98. package/dist/{index-9159kk15.js → index-3kx0kg0f.js} +64 -7
  99. package/dist/{index-0jz47061.js → index-a8bvhwqs.js} +190 -30
  100. package/dist/{index-84j7jq8a.js → index-aw1bh90w.js} +10 -10
  101. package/dist/{index-qr1mkc2y.js → index-b16gpywn.js} +9 -9
  102. package/dist/{index-g7jkrz0x.js → index-bp5083x2.js} +1 -1
  103. package/dist/{index-yhrrx7qa.js → index-bxdg2nbt.js} +3 -3
  104. package/dist/{index-0abg88h2.js → index-dgs16axy.js} +4 -4
  105. package/dist/{index-mp2kghkv.js → index-dyvbsvga.js} +1 -1
  106. package/dist/{index-bmwfzz28.js → index-e20m7284.js} +4 -4
  107. package/dist/{index-4jkhhpn1.js → index-e4dsjj1p.js} +3 -3
  108. package/dist/{index-s178h9z8.js → index-f71thw8j.js} +1 -1
  109. package/dist/{index-kvw6xew3.js → index-fkx2qnvw.js} +2 -2
  110. package/dist/{index-f8cn4xqa.js → index-fwefky9w.js} +18 -5
  111. package/dist/{index-0sahzkwr.js → index-g2q4htwp.js} +46 -2
  112. package/dist/{index-mw7c950g.js → index-gp3kcpc4.js} +1 -1
  113. package/dist/{index-g40wgxxt.js → index-hnm8raee.js} +4 -4
  114. package/dist/{index-gjvjh960.js → index-hqkczed7.js} +1 -1
  115. package/dist/{index-mvvephtj.js → index-j75v2476.js} +1 -1
  116. package/dist/{index-150zz6fh.js → index-k29z4aqh.js} +1 -1
  117. package/dist/{index-b64n4d0h.js → index-kee4kn5j.js} +1 -1
  118. package/dist/index-ksdyrrav.js +52 -0
  119. package/dist/{index-angx1s0k.js → index-mmfa86mt.js} +16 -6
  120. package/dist/{index-9jvab89d.js → index-n6m03s3n.js} +2 -2
  121. package/dist/{index-q28hsbpg.js → index-nj7yykkx.js} +1 -1
  122. package/dist/{index-ghc9f0n7.js → index-p5y3k4g7.js} +29 -1
  123. package/dist/{index-xztdf9t7.js → index-qkd9zz0p.js} +17 -17
  124. package/dist/index-saews2s3.js +229 -0
  125. package/dist/{index-kkvxnbt8.js → index-sj89f3b0.js} +62 -33
  126. package/dist/{index-jw4gbfkv.js → index-v10f1rjv.js} +5 -5
  127. package/dist/{index-0j6crjgh.js → index-v13skev1.js} +13 -13
  128. package/dist/{index-hqnggmxn.js → index-wj6ht7nm.js} +547 -179
  129. package/dist/{index-a865mj02.js → index-wk0n1cgt.js} +4 -4
  130. package/dist/{index-q3qck7j2.js → index-wz6mzzb1.js} +6 -5
  131. package/dist/{index-se1w3v2m.js → index-y1qysm3q.js} +332 -256
  132. package/dist/{index-a4b0gbyg.js → index-y9f76s3f.js} +1 -1
  133. package/dist/index.d.ts.map +1 -1
  134. package/dist/index.js +119 -129
  135. package/dist/{logger-wn328tfg.js → logger-jm3sqqzr.js} +2 -2
  136. package/dist/{message-index-bounded-0rbbg9rd.js → message-index-bounded-vm64mqpq.js} +16 -16
  137. package/dist/{message-index-ct5x2kwa.js → message-index-seaqpb7c.js} +16 -16
  138. package/dist/{message-time-backfill-nb5hhnrt.js → message-time-backfill-qjge9044.js} +3 -3
  139. package/dist/migration-worker.js +11 -11
  140. package/dist/plugin/dream-timer.d.ts.map +1 -1
  141. package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
  142. package/dist/plugin/tool-registry.d.ts.map +1 -1
  143. package/dist/{project-embedding-registry-ft9gh2e2.js → project-embedding-registry-x45bv3qr.js} +12 -11
  144. package/dist/raw-ordinal-warmup-worker.js +12 -7
  145. package/dist/{read-session-chunk-y3hhsbzw.js → read-session-chunk-ax05f7gr.js} +11 -11
  146. package/dist/{read-session-raw-gm6xj30v.js → read-session-raw-m56hc7v2.js} +7 -3
  147. package/dist/recomp-orchestrator-dmbeadwt.js +61 -0
  148. package/dist/{safe-notification-target-jdynm677.js → safe-notification-target-1szv1k5k.js} +3 -3
  149. package/dist/{search-jd8xh721.js → search-5yd5ytzs.js} +25 -24
  150. package/dist/{send-session-notification-vzhj8bsg.js → send-session-notification-24r4esbh.js} +6 -6
  151. package/dist/shared/data-path.d.ts +4 -0
  152. package/dist/shared/data-path.d.ts.map +1 -1
  153. package/dist/shared/model-suggestion-retry.d.ts +2 -0
  154. package/dist/shared/model-suggestion-retry.d.ts.map +1 -1
  155. package/dist/shared/prompt-async-transport.d.ts.map +1 -1
  156. package/dist/{storage-tags-35m4gms2.js → storage-tags-yygfb9c8.js} +7 -5
  157. package/dist/{task-config-cgpg0nvh.js → task-config-x3qmayd2.js} +6 -2
  158. package/dist/tools/ctx-note/tools.d.ts.map +1 -1
  159. package/dist/{transform-postprocess-phase-pmqxfq4q.js → transform-postprocess-phase-72v86syx.js} +32 -31
  160. package/dist/v2/auto-search-worker.js +4 -4
  161. package/dist/v2/chunk-embedding-write-worker.js +88 -0
  162. package/dist/v2/{compaction-marker-candidates-a15w3mqh.js → compaction-marker-candidates-1vqwr3s5.js} +2 -2
  163. package/dist/v2/compaction-marker-candidates-worker.js +1 -1
  164. package/dist/v2/{context-p1zfcw41.js → context-w055w17c.js} +628 -255
  165. package/dist/v2/{derive-budgets-0rmpmxjw.js → derive-budgets-2zh4gm2c.js} +3 -3
  166. package/dist/v2/embedding-backfill-jmaf8zrr.js +21 -0
  167. package/dist/v2/embedding-worker-process.js +1 -1
  168. package/dist/v2/embedding-worker.js +5 -5
  169. package/dist/v2/{history-owner-2cr9py37.js → history-owner-42e16w0n.js} +2 -2
  170. package/dist/v2/hooks/context.d.ts.map +1 -1
  171. package/dist/v2/hooks/dream-manual.d.ts.map +1 -1
  172. package/dist/v2/hooks/dream-trigger.d.ts +1 -1
  173. package/dist/v2/hooks/dream-trigger.d.ts.map +1 -1
  174. package/dist/v2/hooks/hidden-child.d.ts.map +1 -1
  175. package/dist/v2/hooks/transform-features.d.ts +3 -2
  176. package/dist/v2/hooks/transform-features.d.ts.map +1 -1
  177. package/dist/v2/{logger-te6e1j72.js → logger-7qt02bnb.js} +1 -1
  178. package/dist/v2/{message-index-bounded-7wcbp975.js → message-index-bounded-wepg5723.js} +15 -15
  179. package/dist/v2/{message-index-cjhv92m2.js → message-index-gcmd0ng0.js} +15 -15
  180. package/dist/v2/{message-time-backfill-rz1pnpaj.js → message-time-backfill-bsteyc4d.js} +2 -2
  181. package/dist/v2/migration-worker.js +10 -10
  182. package/dist/v2/{project-embedding-registry-g34gcf74.js → project-embedding-registry-0msp56p8.js} +11 -10
  183. package/dist/v2/raw-ordinal-warmup-worker.js +12 -7
  184. package/dist/v2/{read-session-chunk-8d3v87vr.js → read-session-chunk-hr3w5bjk.js} +10 -10
  185. package/dist/v2/{read-session-raw-h4azh85b.js → read-session-raw-b3tf6ra1.js} +6 -2
  186. package/dist/v2/recomp-orchestrator-ca7qt75a.js +60 -0
  187. package/dist/v2/retrospective-raw-provider.d.ts.map +1 -1
  188. package/dist/v2/{safe-notification-target-936374xx.js → safe-notification-target-qg7n2s77.js} +2 -2
  189. package/dist/v2/{search-a1acjwf8.js → search-c86dcv14.js} +24 -23
  190. package/dist/v2/{send-session-notification-z5mcjdea.js → send-session-notification-8ghn9tnv.js} +5 -5
  191. package/dist/v2/{server-npm52h2q.js → server-05xjtq6c.js} +1 -1
  192. package/dist/v2/{server-s6jqh8bj.js → server-0ppsweh6.js} +1 -1
  193. package/dist/v2/server-0s95v3en.js +49 -0
  194. package/dist/v2/{server-hn9fb3v0.js → server-34kwfsr4.js} +2 -2
  195. package/dist/v2/server-4gn3z5an.js +229 -0
  196. package/dist/v2/{server-kn7skz9r.js → server-6cdy4rc0.js} +3 -3
  197. package/dist/v2/{server-7dv9wt9r.js → server-6pmqg9m4.js} +1 -1
  198. package/dist/v2/{server-7fvmt15t.js → server-b81w6sw3.js} +273 -107
  199. package/dist/v2/{server-kmapq3v0.js → server-bxpwy6fy.js} +18 -5
  200. package/dist/v2/{server-d6t16r89.js → server-d8tj10db.js} +1 -1
  201. package/dist/v2/{server-cxsr0ng6.js → server-da07v4xp.js} +1 -1
  202. package/dist/v2/{server-rxcq4t50.js → server-ef89gdsx.js} +5 -5
  203. package/dist/v2/{server-9e5r8y60.js → server-f2xf5gcb.js} +46 -2
  204. package/dist/v2/{server-83d71zab.js → server-g10mdym6.js} +3 -3
  205. package/dist/v2/{server-njnx39q2.js → server-gvkm8xaj.js} +189 -29
  206. package/dist/v2/{server-ckrb5rm8.js → server-h0410h0v.js} +1 -1
  207. package/dist/v2/{server-sg68np13.js → server-hek6z3w6.js} +330 -254
  208. package/dist/v2/{server-f27he3j1.js → server-k2bzedxk.js} +4 -4
  209. package/dist/v2/{server-wkhfyzpg.js → server-m97brnat.js} +9 -9
  210. package/dist/v2/{server-erfp0xb6.js → server-n8ch9683.js} +16 -16
  211. package/dist/v2/{server-bx59ezg6.js → server-prg55b7k.js} +16 -6
  212. package/dist/v2/{server-89fcbe37.js → server-pwv4ezb0.js} +1 -1
  213. package/dist/v2/{server-r5p3b1wy.js → server-qd11g795.js} +29 -1
  214. package/dist/v2/{server-ewqshbs8.js → server-qhfvvfxj.js} +64 -7
  215. package/dist/v2/{server-988cqjme.js → server-rrqpvwqd.js} +2 -2
  216. package/dist/v2/{server-d3f4g62c.js → server-t4prcjc1.js} +13 -13
  217. package/dist/v2/{server-nveratm5.js → server-tbe1femw.js} +4 -4
  218. package/dist/v2/{server-jc8v585p.js → server-th4y11y7.js} +15 -15
  219. package/dist/v2/{server-h3wc20sv.js → server-vbe4se57.js} +4 -4
  220. package/dist/v2/{server-pbpp8r8h.js → server-xh7jar6k.js} +9 -9
  221. package/dist/v2/{server-63ha7f0f.js → server-yrvqaswb.js} +1 -1
  222. package/dist/v2/{server-5x7kmyz8.js → server-zc3e54vy.js} +10 -51
  223. package/dist/v2/{server-xqf2d2mg.js → server-zs8d0s3b.js} +2 -2
  224. package/dist/v2/server.d.ts.map +1 -1
  225. package/dist/v2/server.js +18 -10
  226. package/dist/v2/{storage-tags-c4zfcxv4.js → storage-tags-a2gq6dw7.js} +6 -4
  227. package/dist/v2/store-reader.d.ts +1 -0
  228. package/dist/v2/store-reader.d.ts.map +1 -1
  229. package/dist/v2/{task-config-x0hq3qfd.js → task-config-nvz8mapa.js} +6 -2
  230. package/dist/v2/{wrapup-orchestrator-87q9d5e2.js → wrapup-orchestrator-e1a2w6jh.js} +31 -29
  231. package/dist/wrapup-orchestrator-2051r6qm.js +48 -0
  232. package/package.json +6 -5
  233. package/src/agents/smart-notes-dreamer-gate.fixture.ts +171 -0
  234. package/src/agents/smart-notes-dreamer-gate.golden.json +245 -0
  235. package/src/agents/smart-notes-dreamer-gate.test.ts +161 -0
  236. package/src/config/agent-disable.ts +13 -0
  237. package/src/config/dependency-notes.test.ts +114 -0
  238. package/src/config/dependency-notes.ts +80 -0
  239. package/src/config/schema/magic-context.ts +23 -14
  240. package/src/features/magic-context/dreamer/task-registry.ts +40 -0
  241. package/src/shared/data-path.test.ts +35 -1
  242. package/src/shared/data-path.ts +57 -1
  243. package/src/shared/model-suggestion-retry.test.ts +34 -0
  244. package/src/shared/model-suggestion-retry.ts +23 -3
  245. package/src/shared/prompt-async-transport.test.ts +1 -1
  246. package/src/shared/prompt-async-transport.ts +16 -3
  247. package/dist/embedding-backfill-fjbfh1dt.js +0 -21
  248. package/dist/recomp-orchestrator-67k45s0b.js +0 -60
  249. package/dist/v2/embedding-backfill-xcw3t6hp.js +0 -20
  250. package/dist/v2/recomp-orchestrator-n0pq36f0.js +0 -59
  251. package/dist/wrapup-orchestrator-jqapepw0.js +0 -47
  252. /package/dist/{index-e6xnpach.js → index-b7p25tm0.js} +0 -0
  253. /package/dist/v2/{index-e6xnpach.js → index-b7p25tm0.js} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  log2
3
- } from "./index-mvvephtj.js";
3
+ } from "./index-j75v2476.js";
4
4
 
5
5
  // src/shared/safe-notification-target.ts
6
6
  var DEFAULT_TITLE_RE = /^(New session - |Child session - )\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
@@ -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;AA8GvE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAuiCpC,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;AAmHvE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAsjCpC,QAAA,MAAM,MAAM,EAAE,YAAY,GAAG;IAAE,KAAK,EAAE,OAAO,KAAK,CAAA;CAIjD,CAAC;AAEF,eAAe,MAAM,CAAC"}
package/dist/index.js CHANGED
@@ -28,21 +28,23 @@ import {
28
28
  detectOverflow,
29
29
  isAnthropicFamilyRoute,
30
30
  readRawSessionMessages2
31
- } from "./index-qr1mkc2y.js";
31
+ } from "./index-b16gpywn.js";
32
32
  import {
33
33
  setHarness2
34
34
  } from "./index-pavzsdc6.js";
35
35
  import {
36
36
  getOpenCodeStorageDir,
37
- getMagicContextStorageDir
38
- } from "./index-0sahzkwr.js";
37
+ getMagicContextStorageDir,
38
+ isMagicContextStorageOutsideEngram,
39
+ claimStorageBackupWarningCheck
40
+ } from "./index-g2q4htwp.js";
39
41
  import {
40
42
  registerStalePluginBuildHost,
41
43
  importPluginModule,
42
44
  log2,
43
45
  sessionLog2,
44
46
  flushLogger2
45
- } from "./index-mvvephtj.js";
47
+ } from "./index-j75v2476.js";
46
48
  import {
47
49
  withContentLanguageDirective,
48
50
  string,
@@ -54,7 +56,7 @@ import {
54
56
  record,
55
57
  DEFAULT_EXECUTE_THRESHOLD_PERCENTAGE,
56
58
  DEFAULT_HISTORIAN_TIMEOUT_MS
57
- } from "./index-w28y7d0z.js";
59
+ } from "./index-1sarmj9z.js";
58
60
  import {
59
61
  denyTaskRoutingToCallerAgents,
60
62
  buildHiddenAgentRegistrations,
@@ -63,9 +65,6 @@ import {
63
65
  getMagicContextBuiltinCommands,
64
66
  formatConfigParseStatusLine,
65
67
  claimConfigParseFailuresOnce,
66
- isDreamerRunnable,
67
- isHistorianRunnable,
68
- isCompactionEnabled,
69
68
  migrateMagicContextConfigLocations,
70
69
  getProtectedTokensTierOverrides,
71
70
  loadPluginConfigDetailed,
@@ -76,12 +75,6 @@ import {
76
75
  COMPARTMENT_AGENT_SYSTEM_PROMPT,
77
76
  HISTORIAN_EDITOR_SYSTEM_PROMPT,
78
77
  COMPARTMENT_STRUCTURAL_SYSTEM_PROMPT,
79
- embedPauseBySession,
80
- autoEmbedAttemptedBySession,
81
- autoEmbedIdentityBySession,
82
- invalidateAutoEmbedSession,
83
- getEmbedDrainUiStatus,
84
- clearEmbedSessionState,
85
78
  providerResponseFailed,
86
79
  isSuccessfulProviderCompletion,
87
80
  forgetUnpublishedAutoSearchNoHint,
@@ -104,7 +97,7 @@ import {
104
97
  checkCompactionMarkerConsistency,
105
98
  clearInjectionCache,
106
99
  clearNoteNudgeTriggerOnly
107
- } from "./index-z7avx6rw.js";
100
+ } from "./index-2jr1smmh.js";
108
101
  import"./index-sd3egckz.js";
109
102
  import {
110
103
  hasTrustedAbsoluteWall,
@@ -114,17 +107,15 @@ import {
114
107
  deriveHistorianChunkTokens2,
115
108
  resolveKnownHistorianContextLimit2,
116
109
  resolveHistorianContextLimit2
117
- } from "./index-jw4gbfkv.js";
110
+ } from "./index-v10f1rjv.js";
118
111
  import {
119
- resolveOpenCodeDbPath,
120
- openCodeDbPathExists,
121
- formatOpenCodeDbMissingBanner,
122
- claimOpenCodeDbDiagnosticOnce
123
- } from "./index-58e3y90n.js";
124
- import {
125
- inRootAsyncContext2
126
- } from "./index-wafzvyhg.js";
112
+ buildDreamTaskRuntimeConfigs2,
113
+ userMemoryCollectionEnabled2,
114
+ userObservationCollectionEnabled2,
115
+ userObservationsRequested2
116
+ } from "./index-p5y3k4g7.js";
127
117
  import {
118
+ logConfigDependencyNotesOnce,
128
119
  openOpenCodeDb,
129
120
  DREAMER_SYSTEM_PROMPT,
130
121
  runSessionProjectBackfill,
@@ -166,6 +157,7 @@ import {
166
157
  buildStatusDetail,
167
158
  isDebugRpcEnabled,
168
159
  registerRpcHandlers,
160
+ maybeAutoEmbedSessionBackfill,
169
161
  clearTransformDecisionSession,
170
162
  scheduleOpenCodeTransformDecisionWrite,
171
163
  maybeDeliverChannel2,
@@ -193,7 +185,16 @@ import {
193
185
  parameterDescriptionsFor,
194
186
  MagicContextRpcServer,
195
187
  applyHiddenSubagentTemperature
196
- } from "./index-hqnggmxn.js";
188
+ } from "./index-wj6ht7nm.js";
189
+ import {
190
+ resolveOpenCodeDbPath,
191
+ openCodeDbPathExists,
192
+ formatOpenCodeDbMissingBanner,
193
+ claimOpenCodeDbDiagnosticOnce
194
+ } from "./index-58e3y90n.js";
195
+ import {
196
+ inRootAsyncContext2
197
+ } from "./index-wafzvyhg.js";
197
198
  import {
198
199
  formatFailClosedBlockingMessage,
199
200
  createFailClosedController,
@@ -208,7 +209,7 @@ import {
208
209
  openDatabaseAsync,
209
210
  isDatabasePersisted,
210
211
  getDatabasePersistenceError
211
- } from "./index-xztdf9t7.js";
212
+ } from "./index-qkd9zz0p.js";
212
213
  import {
213
214
  setHomeProjectPermission,
214
215
  ProjectIdentityError,
@@ -219,130 +220,132 @@ import {
219
220
  beginBootQuietPeriod,
220
221
  bootQuietRemainingMs,
221
222
  scheduleAfterBootQuiet
222
- } from "./index-0jz47061.js";
223
+ } from "./index-a8bvhwqs.js";
223
224
  import {
224
225
  deleteTemporalDecision
225
- } from "./index-g7jkrz0x.js";
226
+ } from "./index-bp5083x2.js";
226
227
  import {
227
228
  BoundedSessionMap,
228
229
  observeSessionActivity,
229
230
  backfillSessionActivity,
230
231
  deleteIndexedMessage2
231
- } from "./index-0j6crjgh.js";
232
+ } from "./index-v13skev1.js";
232
233
  import {
233
- recordSessionProjectIdentity,
234
- getProjectEmbeddingSnapshot2,
235
- getEmbeddingCoverageStatus2,
236
- getAutoEmbeddingSessionCoverage2
237
- } from "./index-se1w3v2m.js";
238
- import"./index-q28hsbpg.js";
234
+ recordSessionProjectIdentity
235
+ } from "./index-saews2s3.js";
236
+ import"./index-nj7yykkx.js";
239
237
  import"./index-fb3zxn06.js";
240
- import"./index-mp2kghkv.js";
241
- import"./index-a865mj02.js";
238
+ import"./index-dyvbsvga.js";
239
+ import"./index-wk0n1cgt.js";
242
240
  import"./index-fr0wbhdn.js";
243
241
  import {
244
242
  preloadTokenizer
245
- } from "./index-gjvjh960.js";
243
+ } from "./index-hqkczed7.js";
246
244
  import {
247
245
  getCurrentToolSetHash,
248
246
  recordToolDefinition
249
- } from "./index-9jvab89d.js";
250
- import"./index-kvw6xew3.js";
247
+ } from "./index-n6m03s3n.js";
248
+ import"./index-fkx2qnvw.js";
251
249
  import {
252
250
  getDefaultSubcConnectionFile,
253
251
  SubcModuleTransport
254
- } from "./index-84j7jq8a.js";
255
- import {
256
- isEmbeddingHostBusy2
257
- } from "./index-qt1qqasc.js";
258
- import"./index-a4b0gbyg.js";
252
+ } from "./index-aw1bh90w.js";
253
+ import"./index-qt1qqasc.js";
254
+ import"./index-y9f76s3f.js";
259
255
  import {
260
256
  registerExitAbort,
261
257
  unregisterExitAbort
262
258
  } from "./index-v0p37hm2.js";
263
259
  import {
264
260
  forgetRawSessionOrdinalWatermark2
265
- } from "./index-angx1s0k.js";
261
+ } from "./index-mmfa86mt.js";
266
262
  import {
267
263
  observeOpenCodeTurnEvent,
268
264
  clearTrackedOpenCodeSession,
269
265
  findLastAssistantModelFromOpenCodeDb
270
- } from "./index-bzp9s8z2.js";
266
+ } from "./index-1d289pq2.js";
271
267
  import {
272
268
  sendCommandResult2,
273
269
  sendStatusNotification2
274
- } from "./index-0abg88h2.js";
270
+ } from "./index-dgs16axy.js";
275
271
  import {
276
272
  detectConflicts,
277
273
  resolveCompactionForBoot
278
- } from "./index-b64n4d0h.js";
274
+ } from "./index-kee4kn5j.js";
279
275
  import {
280
276
  sendConflictWarning2,
281
277
  cleanupConflictWarnings2
282
- } from "./index-4jkhhpn1.js";
278
+ } from "./index-e4dsjj1p.js";
283
279
  import"./index-1zx87sdm.js";
284
280
  import {
285
281
  stripPersistedAssistantText,
286
282
  deleteTagsByMessageId2,
287
283
  getMaxTagNumberBySession2
288
- } from "./index-f8cn4xqa.js";
284
+ } from "./index-fwefky9w.js";
289
285
  import {
290
286
  resolveHistorianModel2,
291
287
  resolveOpenCodeAgentOverrides2,
292
288
  resolveHistorianAgentOverrides2
293
289
  } from "./index-8cd2j99z.js";
294
290
  import {
295
- buildDreamTaskRuntimeConfigs2,
296
- userMemoryCollectionEnabled2
297
- } from "./index-ghc9f0n7.js";
298
- import"./index-9159kk15.js";
299
- import"./index-yhrrx7qa.js";
291
+ getEmbedDrainUiStatus,
292
+ clearEmbedSessionState,
293
+ getEmbeddingCoverageStatus2
294
+ } from "./index-y1qysm3q.js";
295
+ import"./index-3kx0kg0f.js";
296
+ import"./index-bxdg2nbt.js";
300
297
  import {
301
298
  pushNotification2
302
299
  } from "./index-x8a7jmkh.js";
303
- import"./index-bmwfzz28.js";
300
+ import"./index-e20m7284.js";
304
301
  import"./index-4dhv7mqz.js";
305
- import"./index-4ccdr7yw.js";
302
+ import"./index-3kdm78zp.js";
306
303
  import"./index-n78avt2p.js";
307
- import"./index-s178h9z8.js";
304
+ import"./index-f71thw8j.js";
308
305
  import {
309
306
  createTagger,
310
307
  cavemanWordRulesForLanguage,
311
308
  setCtxReduceRegisteredGlobally,
312
309
  clearToolPermissionDenied,
313
310
  resetDegradedCacheCount2
314
- } from "./index-kkvxnbt8.js";
311
+ } from "./index-sj89f3b0.js";
315
312
  import {
316
313
  runManagedRecomp2
317
- } from "./index-g40wgxxt.js";
314
+ } from "./index-hnm8raee.js";
318
315
  import {
319
316
  isValidSemver,
320
317
  compareSemverCore
321
- } from "./index-mw7c950g.js";
318
+ } from "./index-gp3kcpc4.js";
322
319
  import"./index-fmsr7v69.js";
323
320
  import {
324
321
  runManagedWrapup2
325
- } from "./index-q3qck7j2.js";
322
+ } from "./index-wz6mzzb1.js";
323
+ import {
324
+ isDreamerRunnable,
325
+ isSmartNoteSurfaceAvailable,
326
+ isHistorianRunnable,
327
+ isCompactionEnabled
328
+ } from "./index-ksdyrrav.js";
326
329
  import {
327
330
  __toESM,
328
331
  __commonJS
329
332
  } from "./index-22jkk6wg.js";
333
+ import {
334
+ piModelRefToCanonical
335
+ } from "./index-avwt563y.js";
330
336
  import {
331
337
  getErrorMessage
332
338
  } from "./index-y8v6yerm.js";
339
+ import {
340
+ closeQuietly
341
+ } from "./index-8ajstryz.js";
342
+ import"./index-k29z4aqh.js";
333
343
  import {
334
344
  setStoragePrivatePermissionEnforcement,
335
345
  ensureStorageDirectorySync,
336
346
  writeStorageFileSync,
337
347
  writeStorageFileAtomicSync
338
348
  } from "./index-fvnzcnww.js";
339
- import {
340
- piModelRefToCanonical
341
- } from "./index-avwt563y.js";
342
- import {
343
- closeQuietly
344
- } from "./index-8ajstryz.js";
345
- import"./index-150zz6fh.js";
346
349
 
347
350
  // ../../node_modules/.bun/esprima@4.0.1/node_modules/esprima/dist/esprima.js
348
351
  var require_esprima = __commonJS(function(exports, module) {
@@ -8184,7 +8187,7 @@ var require_src2 = __commonJS(function(exports, module) {
8184
8187
  // package.json
8185
8188
  var package_default = {
8186
8189
  name: "@cortexkit/opencode-magic-context",
8187
- version: "0.49.11",
8190
+ version: "0.49.13",
8188
8191
  type: "module",
8189
8192
  description: "OpenCode plugin for Magic Context — cross-session memory and context management",
8190
8193
  main: "dist/index.js",
@@ -8221,13 +8224,14 @@ var package_default = {
8221
8224
  "README.md"
8222
8225
  ],
8223
8226
  scripts: {
8224
- 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 src/features/magic-context/compaction-marker-candidates-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",
8225
- "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 src/features/magic-context/compaction-marker-candidates-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",
8227
+ 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 src/features/magic-context/compaction-marker-candidates-worker.ts src/features/magic-context/chunk-embedding-write-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",
8228
+ "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 src/features/magic-context/compaction-marker-candidates-worker.ts src/features/magic-context/chunk-embedding-write-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",
8226
8229
  "build:tui": "bun scripts/build-tui.ts",
8227
8230
  "check:tui-compiled": 'git diff --exit-code -- src/tui-compiled && test -z "$(git status --porcelain -- src/tui-compiled)"',
8228
8231
  "check:transformers-node-wasm": "bun scripts/verify-transformers-node-wasm.ts",
8229
8232
  typecheck: "tsc -p ../retina-local-fs/tsconfig.build.json && tsc --noEmit && tsc -p tsconfig.scripts.json",
8230
- test: "bun ../../scripts/check-bun.mjs && bun install --frozen-lockfile && MC_REVIEW_ASSERT_LIVENESS=1 BUN_JSC_useOMGJIT=0 bun test --parallel=4 --timeout 30000",
8233
+ test: "bun ../../scripts/check-bun.mjs && bun install --frozen-lockfile && bun run test:active-session-backfill && MC_REVIEW_ASSERT_LIVENESS=1 BUN_JSC_useOMGJIT=0 bun test --parallel=4 --timeout 30000 --test-name-pattern '^(?!re-embeds 1600 old chunks)'",
8234
+ "test:active-session-backfill": "MC_REVIEW_ASSERT_LIVENESS=1 BUN_JSC_useOMGJIT=0 bun test src/hooks/magic-context/auto-embed-session.test.ts --test-name-pattern '^re-embeds 1600 old chunks' --timeout 120000",
8231
8235
  "test:serial": "bun install --frozen-lockfile && MC_REVIEW_ASSERT_LIVENESS=1 BUN_JSC_useOMGJIT=0 bun test --timeout 30000",
8232
8236
  "test:parallel:probe": "bun scripts/verify-parallel-db-isolation.ts",
8233
8237
  lint: "bun ../../scripts/check-bun.mjs && biome check .",
@@ -8238,7 +8242,7 @@ var package_default = {
8238
8242
  prepublishOnly: "bun run build && bun run check:tui-compiled"
8239
8243
  },
8240
8244
  "//check:tui-compiled": "Check drift on output already generated by build or build:tui; this check never regenerates files. CI and prepublishOnly build first.",
8241
- "//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.",
8245
+ "//test": "The strict 50ms active-session backfill latency gate runs alone before the four-worker suite, which excludes only that already-run case. Unrelated workers can deschedule the latency monitor. Test runs also disable JSC's optimizing WebAssembly tier so per-file isolation does not pay its compilation cost on every file; production host options are unchanged.",
8242
8246
  dependencies: {
8243
8247
  "@cortexkit/subc-client": "0.11.1",
8244
8248
  "@jitl/quickjs-singlefile-cjs-release-asyncify": "0.32.0",
@@ -10290,7 +10294,8 @@ function createMagicContextHook(deps) {
10290
10294
  twoPass: config.historian?.two_pass === true,
10291
10295
  expandTools: config.historian?.expand_tools,
10292
10296
  autoPromote: config.memory?.auto_promote ?? true,
10293
- userMemoriesEnabled: userMemoryCollectionEnabled2(config.dreamer),
10297
+ userMemoriesEnabled: userObservationCollectionEnabled2(config.dreamer),
10298
+ userObservationsRequested: userObservationsRequested2(config.dreamer),
10294
10299
  commitClusterTrigger: config.commit_cluster_trigger,
10295
10300
  chunkTokens: deriveHistorianChunkTokens2(resolveHistorianContextLimit2(attempts.primary?.model))
10296
10301
  };
@@ -10389,6 +10394,7 @@ function createMagicContextHook(deps) {
10389
10394
  historianTwoPass: historianRun.twoPass,
10390
10395
  historianExpandTools: historianRun.expandTools,
10391
10396
  userMemoriesEnabled: historianRun.userMemoriesEnabled,
10397
+ userObservationsRequested: historianRun.userObservationsRequested,
10392
10398
  ensureProjectRegistered: ensureProjectRegisteredFromOpenCodeDirectory,
10393
10399
  getNotificationParams: (sid) => getLiveNotificationParams(sid, liveModelBySession, variantBySession, agentBySession, historianRun.toastDurationMs)
10394
10400
  };
@@ -10435,52 +10441,18 @@ function createMagicContextHook(deps) {
10435
10441
  });
10436
10442
  };
10437
10443
  const maybeAutoEmbedSession = (sessionId) => {
10438
- if (isEmbeddingHostBusy2())
10439
- return;
10440
10444
  const directory = sessionDirectoryBySession.get(sessionId) ?? deps.directory;
10441
10445
  const identity = resolveProjectIdentityForSession(directory, deps.config.allow_home_project);
10442
- const snapshot = identity ? getProjectEmbeddingSnapshot2(identity) : undefined;
10443
- const embedIdentity = snapshot ? JSON.stringify([
10444
- snapshot.providerIdentity,
10445
- snapshot.chunkModelId,
10446
- snapshot.runtimeFingerprint
10447
- ]) : "off";
10448
- if (autoEmbedIdentityBySession.get(sessionId) !== embedIdentity) {
10449
- invalidateAutoEmbedSession(sessionId);
10450
- }
10451
- if (autoEmbedAttemptedBySession.has(sessionId))
10452
- return;
10453
- if (embedPauseBySession.has(sessionId))
10446
+ if (!identity)
10454
10447
  return;
10455
- autoEmbedAttemptedBySession.add(sessionId);
10456
- autoEmbedIdentityBySession.set(sessionId, embedIdentity);
10457
- (async () => {
10458
- try {
10459
- await new Promise((resolve) => setTimeout(resolve, 0));
10460
- if (isEmbeddingHostBusy2()) {
10461
- invalidateAutoEmbedSession(sessionId);
10462
- return;
10463
- }
10448
+ maybeAutoEmbedSessionBackfill({
10449
+ db,
10450
+ projectIdentity: identity,
10451
+ ensureRegistered: async () => {
10464
10452
  await ensureProjectRegisteredFromOpenCodeDirectory(directory, db);
10465
- const sessionProjectIdentity = resolveProjectIdentityForSession(directory, deps.config.allow_home_project);
10466
- if (!sessionProjectIdentity) {
10467
- invalidateAutoEmbedSession(sessionId);
10468
- return;
10469
- }
10470
10453
  maybeSendProjectIdentitySessionWarning(sessionId, directory);
10471
- const coverage = await getAutoEmbeddingSessionCoverage2(db, sessionProjectIdentity, sessionId);
10472
- if (!coverage.enabled) {
10473
- invalidateAutoEmbedSession(sessionId);
10474
- return;
10475
- }
10476
- const remaining = coverage.total - coverage.embedded;
10477
- if (remaining <= 0)
10478
- return;
10479
- await executeEmbedHistory(sessionId, { silent: true });
10480
- } catch (error) {
10481
- log2("[magic-context] auto-embed drain failed:", error);
10482
10454
  }
10483
- })();
10455
+ }, sessionId);
10484
10456
  };
10485
10457
  const rustMemorySyncRequestedSessions = new Set;
10486
10458
  const rustModeModuleClient = deps.config.transform_mode === "rust" ? deps.rustModeModuleClient ?? createSubcModuleClient({
@@ -10573,7 +10545,8 @@ function createMagicContextHook(deps) {
10573
10545
  projectPath,
10574
10546
  historianRunnable,
10575
10547
  compactionOff,
10576
- experimentalUserMemories: userMemoryCollectionEnabled2(dreamerConfig),
10548
+ experimentalUserMemories: userObservationCollectionEnabled2(dreamerConfig),
10549
+ userObservationsRequested: userObservationsRequested2(dreamerConfig),
10577
10550
  experimentalTemporalAwareness: deps.config.temporal_awareness === true,
10578
10551
  muralEnabled: deps.config.mural?.enabled === true,
10579
10552
  historianTwoPass: deps.config.historian?.two_pass === true,
@@ -10701,7 +10674,8 @@ function createMagicContextHook(deps) {
10701
10674
  projectIdentity: projectPath,
10702
10675
  tasks: runtimeConfigs,
10703
10676
  executor,
10704
- projectMemoryEnabled: deps.config.memory?.enabled !== false
10677
+ projectMemoryEnabled: deps.config.memory?.enabled !== false,
10678
+ smartNotesEnabled: deps.config.smart_notes?.enabled
10705
10679
  }).catch((error) => {
10706
10680
  log2("[dreamer] scheduled task run failed:", error);
10707
10681
  });
@@ -10774,6 +10748,7 @@ function createMagicContextHook(deps) {
10774
10748
  db,
10775
10749
  projectIdentity: projectPath,
10776
10750
  projectMemoryEnabled: sampledDream.memory?.enabled,
10751
+ smartNotesEnabled: deps.config.smart_notes?.enabled,
10777
10752
  tasks: buildDreamTaskRuntimeConfigs2(currentDreamer, "opencode", deps.config.language, deps.config.smart_notes?.enabled),
10778
10753
  executor: createDreamTaskExecutor({
10779
10754
  client: deps.client,
@@ -11910,8 +11885,9 @@ function createToolRegistry(args) {
11910
11885
  warn: (message) => log2(`[magic-context] config warning: ${message}`)
11911
11886
  });
11912
11887
  const registration = promptSurfaceRuntime.resolveRegistration(args.registrationPromptSurface ?? pluginConfig.prompt_surface);
11888
+ const smartNotesAvailable = isSmartNoteSurfaceAvailable(pluginConfig);
11913
11889
  const surfacedTools = Object.fromEntries(Object.entries(allTools).map(([toolId, definition]) => {
11914
- const parameterDescriptions = parameterDescriptionsFor(toolId, registration.preset, pluginConfig.smart_notes?.enabled);
11890
+ const parameterDescriptions = parameterDescriptionsFor(toolId, registration.preset, smartNotesAvailable);
11915
11891
  const argsWithPresetDescriptions = parameterDescriptions ? Object.fromEntries(Object.entries(definition.args).map(([name, schema]) => [
11916
11892
  name,
11917
11893
  parameterDescriptions[name] ? schema.describe(parameterDescriptions[name]) : schema
@@ -11921,7 +11897,7 @@ function createToolRegistry(args) {
11921
11897
  {
11922
11898
  ...definition,
11923
11899
  args: argsWithPresetDescriptions,
11924
- description: toolId === "ctx_note" && pluginConfig.smart_notes?.enabled === false ? withoutSmartNoteText(registration.preset === "light" ? CTX_NOTE_LIGHT_DESCRIPTION : definition.description ?? "") : registration.descriptionFor(toolId, definition.description ?? "")
11900
+ description: toolId === "ctx_note" && !smartNotesAvailable ? withoutSmartNoteText(registration.preset === "light" ? CTX_NOTE_LIGHT_DESCRIPTION : definition.description ?? "") : registration.descriptionFor(toolId, definition.description ?? "")
11925
11901
  }
11926
11902
  ];
11927
11903
  }));
@@ -12053,7 +12029,11 @@ async function setup(context) {
12053
12029
  log2("v2 setup() called on a host without session.hook; v1 server lane owns this host, v2 lane inert");
12054
12030
  return async () => {};
12055
12031
  }
12056
- const { registerContext } = await import("./context-twz3s0cg.js");
12032
+ const storageDir = getMagicContextStorageDir();
12033
+ if (claimStorageBackupWarningCheck() && isMagicContextStorageOutsideEngram(storageDir)) {
12034
+ log2(`[magic-context] Magic Context storage is at ${storageDir}, outside the folder Engram backs up (~/.local/share/cortexkit/magic-context). It is not included in CortexKit backups.`);
12035
+ }
12036
+ const { registerContext } = await import("./context-azqk0vfd.js");
12057
12037
  setHarness2("opencode2");
12058
12038
  bindStaleBuildNotice({}, import.meta.url, "opencode2");
12059
12039
  const duties = await registerContext(context);
@@ -12069,6 +12049,14 @@ async function setup(context) {
12069
12049
  // src/index.ts
12070
12050
  var BOOT_SERVER_DEADLINE_MS = 15000;
12071
12051
  var RESOLVED_CONFIG_TIMEOUT_MS = 2000;
12052
+ function warnStorageBackupOnce(storageDir) {
12053
+ if (!claimStorageBackupWarningCheck())
12054
+ return;
12055
+ if (isMagicContextStorageOutsideEngram(storageDir)) {
12056
+ log2(`[magic-context] Magic Context storage is at ${storageDir}, outside the folder Engram backs up (~/.local/share/cortexkit/magic-context). It is not included in CortexKit backups.`);
12057
+ flushLogger2();
12058
+ }
12059
+ }
12072
12060
  registerStandalonePluginMarker(package_default.version);
12073
12061
  var server = async (ctx) => {
12074
12062
  bindStaleBuildNotice(ctx.client, import.meta.url);
@@ -12124,7 +12112,7 @@ var server = async (ctx) => {
12124
12112
  if (hasBannerEntries)
12125
12113
  setTimeout(async () => {
12126
12114
  try {
12127
- const { sendStatusNotification } = await importPluginModule(() => import("./send-session-notification-vzhj8bsg.js"));
12115
+ const { sendStatusNotification } = await importPluginModule(() => import("./send-session-notification-24r4esbh.js"));
12128
12116
  const clientWithSessions = ctx.client;
12129
12117
  const sessions = await Promise.resolve(clientWithSessions.session?.list?.()).catch(() => null);
12130
12118
  const sessionList = Array.isArray(sessions) ? sessions : sessions?.data;
@@ -12135,13 +12123,14 @@ var server = async (ctx) => {
12135
12123
  } catch {}
12136
12124
  }, 3000);
12137
12125
  }
12126
+ logConfigDependencyNotesOnce(pluginConfig, log2);
12138
12127
  const openCodeDbResolution = resolveOpenCodeDbPath();
12139
12128
  if (!openCodeDbPathExists(openCodeDbResolution) && claimOpenCodeDbDiagnosticOnce("boot-banner", openCodeDbResolution)) {
12140
12129
  const missingDbBanner = formatOpenCodeDbMissingBanner(openCodeDbResolution);
12141
12130
  log2(`[magic-context] opencode_db_missing path=${openCodeDbResolution.path} source=${openCodeDbResolution.source}`);
12142
12131
  setTimeout(async () => {
12143
12132
  try {
12144
- const { sendStatusNotification } = await importPluginModule(() => import("./send-session-notification-vzhj8bsg.js"));
12133
+ const { sendStatusNotification } = await importPluginModule(() => import("./send-session-notification-24r4esbh.js"));
12145
12134
  const clientWithSessions = ctx.client;
12146
12135
  const sessions = await Promise.resolve(clientWithSessions.session?.list?.()).catch(() => null);
12147
12136
  const sessionList = Array.isArray(sessions) ? sessions : sessions?.data;
@@ -12304,6 +12293,7 @@ var server = async (ctx) => {
12304
12293
  }, 0);
12305
12294
  }
12306
12295
  const storageDir = getMagicContextStorageDir();
12296
+ warnStorageBackupOnce(storageDir);
12307
12297
  let rpcServer = null;
12308
12298
  let stopDreamTimerRegistration;
12309
12299
  if (pluginConfig.enabled) {
@@ -12417,12 +12407,12 @@ var server = async (ctx) => {
12417
12407
  {
12418
12408
  const fence = getSchemaFenceRejection();
12419
12409
  if (fence) {
12420
- importPluginModule(() => import("./conflict-warning-hook-xwkfncav.js")).then(({ sendSchemaFenceWarning }) => sendSchemaFenceWarning(ctx.client, ctx.directory, fence)).catch((error) => log2("[magic-context] schema-fence warning unavailable:", error));
12410
+ importPluginModule(() => import("./conflict-warning-hook-mgq17yr3.js")).then(({ sendSchemaFenceWarning }) => sendSchemaFenceWarning(ctx.client, ctx.directory, fence)).catch((error) => log2("[magic-context] schema-fence warning unavailable:", error));
12421
12411
  }
12422
12412
  }
12423
12413
  const serverUrl = ctx.serverUrl;
12424
12414
  const serverUrlStr = serverUrl instanceof URL ? serverUrl.toString().replace(/\/$/, "") : typeof serverUrl === "string" ? serverUrl.replace(/\/$/, "") : undefined;
12425
- importPluginModule(() => import("./send-session-notification-vzhj8bsg.js")).then(({ setNotificationServerUrl }) => {
12415
+ importPluginModule(() => import("./send-session-notification-24r4esbh.js")).then(({ setNotificationServerUrl }) => {
12426
12416
  setNotificationServerUrl(serverUrlStr);
12427
12417
  }).catch((error) => log2("[magic-context] notification transport unavailable:", error));
12428
12418
  if (conflictResult?.hasConflict) {
@@ -12436,7 +12426,7 @@ var server = async (ctx) => {
12436
12426
  }
12437
12427
  if (pluginConfig.enabled && !conflictResult?.hasConflict) {
12438
12428
  setTimeout(() => {
12439
- importPluginModule(() => import("./announcement-hdbkt8v5.js")).then(({
12429
+ importPluginModule(() => import("./announcement-g789dmt6.js")).then(({
12440
12430
  shouldShowAnnouncement,
12441
12431
  ANNOUNCEMENT_VERSION,
12442
12432
  ANNOUNCEMENT_FEATURES,
@@ -12445,7 +12435,7 @@ var server = async (ctx) => {
12445
12435
  }) => {
12446
12436
  if (!shouldShowAnnouncement())
12447
12437
  return;
12448
- return importPluginModule(() => import("./conflict-warning-hook-xwkfncav.js")).then(({ sendStartupAnnouncement }) => sendStartupAnnouncement(ctx.client, ctx.directory, ANNOUNCEMENT_VERSION, ANNOUNCEMENT_FEATURES, ANNOUNCEMENT_FOOTER, markAnnouncementSeen));
12438
+ return importPluginModule(() => import("./conflict-warning-hook-mgq17yr3.js")).then(({ sendStartupAnnouncement }) => sendStartupAnnouncement(ctx.client, ctx.directory, ANNOUNCEMENT_VERSION, ANNOUNCEMENT_FEATURES, ANNOUNCEMENT_FOOTER, markAnnouncementSeen));
12449
12439
  }).catch(() => {});
12450
12440
  }, 8000);
12451
12441
  }
@@ -12519,8 +12509,8 @@ var server = async (ctx) => {
12519
12509
  tryReopenStorage,
12520
12510
  rustReplayParticipant: () => magicContextRuntime.magicContext?.getRustReplayParticipant?.() ?? null,
12521
12511
  onStorageBusyRefusal: async (sessionId, message) => {
12522
- const { sendStatusNotification } = await importPluginModule(() => import("./send-session-notification-vzhj8bsg.js"));
12523
- const { abortSessionFailClosed } = await importPluginModule(() => import("./transform-postprocess-phase-pmqxfq4q.js"));
12512
+ const { sendStatusNotification } = await importPluginModule(() => import("./send-session-notification-24r4esbh.js"));
12513
+ const { abortSessionFailClosed } = await importPluginModule(() => import("./transform-postprocess-phase-72v86syx.js"));
12524
12514
  await sendStatusNotification(ctx.client, sessionId, message, {
12525
12515
  toastDurationMs: 15000
12526
12516
  });
@@ -6,8 +6,8 @@ import {
6
6
  getLoggerDiagnostics2,
7
7
  flushLogger2,
8
8
  getLogFilePath2
9
- } from "./index-mvvephtj.js";
10
- import"./index-0sahzkwr.js";
9
+ } from "./index-j75v2476.js";
10
+ import"./index-g2q4htwp.js";
11
11
  import"./index-pavzsdc6.js";
12
12
  export {
13
13
  flushLogger2 as flushLogger,
@@ -4,19 +4,19 @@ import {
4
4
  yieldIndexChunk2
5
5
  } from "./index-wafzvyhg.js";
6
6
  import"./index-1zx87sdm.js";
7
- import"./index-f8cn4xqa.js";
8
- import"./index-gjvjh960.js";
7
+ import"./index-fwefky9w.js";
8
+ import"./index-hqkczed7.js";
9
9
  import"./index-pavzsdc6.js";
10
- import"./index-0sahzkwr.js";
11
- import"./index-mvvephtj.js";
12
- import"./index-g7jkrz0x.js";
13
- import"./index-w28y7d0z.js";
10
+ import"./index-g2q4htwp.js";
11
+ import"./index-j75v2476.js";
12
+ import"./index-bp5083x2.js";
13
+ import"./index-1sarmj9z.js";
14
14
  import"./index-v0p37hm2.js";
15
- import"./index-angx1s0k.js";
15
+ import"./index-mmfa86mt.js";
16
16
  import"./index-58e3y90n.js";
17
- import"./index-bzp9s8z2.js";
18
- import"./index-qr1mkc2y.js";
19
- import"./index-9jvab89d.js";
17
+ import"./index-1d289pq2.js";
18
+ import"./index-b16gpywn.js";
19
+ import"./index-n6m03s3n.js";
20
20
  import {
21
21
  MESSAGE_INDEX_MAX_FTS_BYTES2,
22
22
  messageIndexSkipKey2,
@@ -24,12 +24,12 @@ import {
24
24
  markMessageIndexDirty2,
25
25
  getIndexableContent2,
26
26
  indexSingleMessage2
27
- } from "./index-0j6crjgh.js";
28
- import"./index-mp2kghkv.js";
29
- import"./index-q28hsbpg.js";
30
- import"./index-kvw6xew3.js";
31
- import"./index-9159kk15.js";
32
- import"./index-150zz6fh.js";
27
+ } from "./index-v13skev1.js";
28
+ import"./index-dyvbsvga.js";
29
+ import"./index-nj7yykkx.js";
30
+ import"./index-fkx2qnvw.js";
31
+ import"./index-3kx0kg0f.js";
32
+ import"./index-k29z4aqh.js";
33
33
 
34
34
  // src/features/magic-context/message-index-bounded.ts
35
35
  import { createHash } from "node:crypto";