@cortexkit/opencode-magic-context 0.49.19 → 0.49.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (323) hide show
  1. package/dist/auto-search-worker.js +48 -9
  2. package/dist/chunk-embedding-write-worker.js +30 -23
  3. package/dist/{compaction-marker-candidates-n4krhat4.js → compaction-marker-candidates-31h86ph0.js} +3 -3
  4. package/dist/compaction-marker-candidates-worker.js +2 -2
  5. package/dist/compartment-chunk-embedding-he60aaa2.js +65 -0
  6. package/dist/config/project-security.d.ts.map +1 -1
  7. package/dist/config/schema/magic-context.d.ts +43 -9
  8. package/dist/config/schema/magic-context.d.ts.map +1 -1
  9. package/dist/{conflict-warning-hook-4pmz879v.js → conflict-warning-hook-2r32hyx6.js} +9 -8
  10. package/dist/{context-j31m2dv7.js → context-j7hp43a0.js} +576 -185
  11. package/dist/{derive-budgets-zn7yzd2d.js → derive-budgets-pqybnx09.js} +2 -2
  12. package/dist/embedding-backfill-dtke6tck.js +25 -0
  13. package/dist/embedding-worker-process.js +2 -2
  14. package/dist/embedding-worker.js +6 -6
  15. package/dist/features/magic-context/chunk-embedding-writer.d.ts.map +1 -1
  16. package/dist/features/magic-context/compartment-chunk-embedding.d.ts +44 -1
  17. package/dist/features/magic-context/compartment-chunk-embedding.d.ts.map +1 -1
  18. package/dist/features/magic-context/dreamer/docs-proposals.d.ts +1 -0
  19. package/dist/features/magic-context/dreamer/docs-proposals.d.ts.map +1 -1
  20. package/dist/features/magic-context/dreamer/hidden-single-shot.d.ts.map +1 -1
  21. package/dist/features/magic-context/dreamer/task-config.d.ts.map +1 -1
  22. package/dist/features/magic-context/dreamer/task-executor.d.ts.map +1 -1
  23. package/dist/features/magic-context/dreamer/task-scheduler.d.ts +2 -0
  24. package/dist/features/magic-context/dreamer/task-scheduler.d.ts.map +1 -1
  25. package/dist/features/magic-context/memory/embedding-identity.d.ts.map +1 -1
  26. package/dist/features/magic-context/memory/embedding-local.d.ts +1 -0
  27. package/dist/features/magic-context/memory/embedding-local.d.ts.map +1 -1
  28. package/dist/features/magic-context/memory/embedding-synapse.d.ts.map +1 -1
  29. package/dist/features/magic-context/memory/embedding-worker-client.d.ts +7 -1
  30. package/dist/features/magic-context/memory/embedding-worker-client.d.ts.map +1 -1
  31. package/dist/features/magic-context/memory/local-embedding-pooling.d.ts +22 -0
  32. package/dist/features/magic-context/memory/local-embedding-pooling.d.ts.map +1 -0
  33. package/dist/features/magic-context/message-index-async.d.ts +7 -2
  34. package/dist/features/magic-context/message-index-async.d.ts.map +1 -1
  35. package/dist/features/magic-context/message-index.d.ts +2 -0
  36. package/dist/features/magic-context/message-index.d.ts.map +1 -1
  37. package/dist/features/magic-context/mural/compress-cues.d.ts.map +1 -1
  38. package/dist/features/magic-context/project-embedding-registry.d.ts +2 -0
  39. package/dist/features/magic-context/project-embedding-registry.d.ts.map +1 -1
  40. package/dist/features/magic-context/search-rerank.d.ts +9 -2
  41. package/dist/features/magic-context/search-rerank.d.ts.map +1 -1
  42. package/dist/features/magic-context/search.d.ts +29 -0
  43. package/dist/features/magic-context/search.d.ts.map +1 -1
  44. package/dist/features/magic-context/smart-notes/compiler.d.ts.map +1 -1
  45. package/dist/features/magic-context/storage-db.d.ts +2 -0
  46. package/dist/features/magic-context/storage-db.d.ts.map +1 -1
  47. package/dist/features/magic-context/storage-meta-persisted.d.ts +2 -0
  48. package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -1
  49. package/dist/features/magic-context/subagent-token-capture.d.ts +20 -0
  50. package/dist/features/magic-context/subagent-token-capture.d.ts.map +1 -1
  51. package/dist/features/magic-context/user-memory/review-user-memories.d.ts.map +1 -1
  52. package/dist/{history-owner-xp3pngv7.js → history-owner-36wp3mkb.js} +2 -2
  53. package/dist/hooks/magic-context/apply-operations.d.ts.map +1 -1
  54. package/dist/hooks/magic-context/auto-embed-session.d.ts.map +1 -1
  55. package/dist/hooks/magic-context/auto-search-hint.d.ts +7 -1
  56. package/dist/hooks/magic-context/auto-search-hint.d.ts.map +1 -1
  57. package/dist/hooks/magic-context/auto-search-runner.d.ts.map +1 -1
  58. package/dist/hooks/magic-context/auto-search-worker-client.d.ts +33 -6
  59. package/dist/hooks/magic-context/auto-search-worker-client.d.ts.map +1 -1
  60. package/dist/hooks/magic-context/cache-busting-signals.d.ts +6 -2
  61. package/dist/hooks/magic-context/cache-busting-signals.d.ts.map +1 -1
  62. package/dist/hooks/magic-context/channel2-delivery.d.ts.map +1 -1
  63. package/dist/hooks/magic-context/compartment-runner-historian.d.ts.map +1 -1
  64. package/dist/hooks/magic-context/compartment-runner-types.d.ts +5 -0
  65. package/dist/hooks/magic-context/compartment-runner-types.d.ts.map +1 -1
  66. package/dist/hooks/magic-context/compartment-trigger.d.ts +1 -1
  67. package/dist/hooks/magic-context/compartment-trigger.d.ts.map +1 -1
  68. package/dist/hooks/magic-context/diagnostic-log-state.d.ts +4 -0
  69. package/dist/hooks/magic-context/diagnostic-log-state.d.ts.map +1 -0
  70. package/dist/hooks/magic-context/execute-reclaim.d.ts +35 -0
  71. package/dist/hooks/magic-context/execute-reclaim.d.ts.map +1 -0
  72. package/dist/hooks/magic-context/hook-handlers.d.ts.map +1 -1
  73. package/dist/hooks/magic-context/hook.d.ts +1 -3
  74. package/dist/hooks/magic-context/hook.d.ts.map +1 -1
  75. package/dist/hooks/magic-context/latest-assistant-turn.d.ts +8 -0
  76. package/dist/hooks/magic-context/latest-assistant-turn.d.ts.map +1 -1
  77. package/dist/hooks/magic-context/lkg-recovery-fence.d.ts +5 -0
  78. package/dist/hooks/magic-context/lkg-recovery-fence.d.ts.map +1 -1
  79. package/dist/hooks/magic-context/nudge-evaluation-log.d.ts +3 -0
  80. package/dist/hooks/magic-context/nudge-evaluation-log.d.ts.map +1 -0
  81. package/dist/hooks/magic-context/pending-drop-eligibility.d.ts.map +1 -1
  82. package/dist/hooks/magic-context/protected-tail-boundary.d.ts +4 -0
  83. package/dist/hooks/magic-context/protected-tail-boundary.d.ts.map +1 -1
  84. package/dist/hooks/magic-context/raw-ordinal-warmup.d.ts.map +1 -1
  85. package/dist/hooks/magic-context/served-shape-repair.d.ts +19 -0
  86. package/dist/hooks/magic-context/served-shape-repair.d.ts.map +1 -0
  87. package/dist/hooks/magic-context/strip-content.d.ts +4 -2
  88. package/dist/hooks/magic-context/strip-content.d.ts.map +1 -1
  89. package/dist/hooks/magic-context/system-date-refresh.d.ts +5 -5
  90. package/dist/hooks/magic-context/system-prompt-hash.d.ts.map +1 -1
  91. package/dist/hooks/magic-context/system-prompt-sticky-date.d.ts +10 -0
  92. package/dist/hooks/magic-context/system-prompt-sticky-date.d.ts.map +1 -0
  93. package/dist/hooks/magic-context/tag-content-primitives.d.ts +1 -1
  94. package/dist/hooks/magic-context/tag-content-primitives.d.ts.map +1 -1
  95. package/dist/hooks/magic-context/tag-messages.d.ts +4 -1
  96. package/dist/hooks/magic-context/tag-messages.d.ts.map +1 -1
  97. package/dist/hooks/magic-context/text-complete.d.ts +1 -1
  98. package/dist/hooks/magic-context/text-complete.d.ts.map +1 -1
  99. package/dist/hooks/magic-context/transform-compartment-phase.d.ts.map +1 -1
  100. package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +21 -6
  101. package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
  102. package/dist/hooks/magic-context/transform.d.ts +2 -2
  103. package/dist/hooks/magic-context/transform.d.ts.map +1 -1
  104. package/dist/{index-3esx8tkf.js → index-11gzxvf4.js} +394 -125
  105. package/dist/{index-jn12fvvh.js → index-1gtfne2c.js} +3 -3
  106. package/dist/{index-jhghdnsm.js → index-1kbznkft.js} +521 -214
  107. package/dist/{index-3h4dp9wb.js → index-3svaejkh.js} +5 -5
  108. package/dist/{index-kee4kn5j.js → index-4pnsgvfk.js} +1 -1
  109. package/dist/{index-bjcnntmz.js → index-51rdvtkz.js} +501 -20
  110. package/dist/{v2/server-8cd2j99z.js → index-5kym00ag.js} +32 -13
  111. package/dist/{index-s74zqahq.js → index-66eby7hx.js} +4 -4
  112. package/dist/{index-63k48rv9.js → index-9q1g3c5q.js} +5 -5
  113. package/dist/{index-jrr131e0.js → index-a9zvn5fe.js} +29 -15
  114. package/dist/{index-c5pytzne.js → index-b88dwwrh.js} +1 -1
  115. package/dist/{index-nj7yykkx.js → index-c7phnbvk.js} +1 -1
  116. package/dist/index-cpjk5jd2.js +82 -0
  117. package/dist/{index-c1p88z1y.js → index-ffzhwfzy.js} +4 -4
  118. package/dist/{v2/server-beht37jy.js → index-gzy5w8ya.js} +194 -5
  119. package/dist/{index-j75v2476.js → index-h7tgn49j.js} +12 -15
  120. package/dist/{index-edmpdxcw.js → index-j32jj2t8.js} +5 -5
  121. package/dist/{index-ke416mdc.js → index-j76ah6d7.js} +2 -2
  122. package/dist/{index-s734jcsr.js → index-jfem3dgz.js} +9 -3
  123. package/dist/{index-n37sebck.js → index-jjvbk92s.js} +1 -1
  124. package/dist/{index-4911rn0b.js → index-jmq8kfe7.js} +6 -6
  125. package/dist/{index-rr2bb45z.js → index-kfyb3k6n.js} +2 -2
  126. package/dist/{index-2vxtcb95.js → index-kq5w68dp.js} +2 -2
  127. package/dist/{index-kq82mtg0.js → index-ksq50rg0.js} +3 -3
  128. package/dist/{index-b5vqckbw.js → index-m32esgmj.js} +314 -127
  129. package/dist/{index-9zcsy3hh.js → index-mnhcdfxg.js} +161 -13
  130. package/dist/{index-se4m2g6w.js → index-mnnkgq0q.js} +111 -19
  131. package/dist/{index-p5y3k4g7.js → index-nda0zgna.js} +2 -1
  132. package/dist/{index-wgypt3cs.js → index-nxrsns5x.js} +2466 -1290
  133. package/dist/{index-4s3t0nd0.js → index-qgh1qwjj.js} +2 -2
  134. package/dist/{index-y9f76s3f.js → index-rrv26qjz.js} +1 -1
  135. package/dist/{index-24fezq97.js → index-rxqr723x.js} +5 -5
  136. package/dist/{index-v10f1rjv.js → index-spwjbkc7.js} +1 -1
  137. package/dist/{index-dxmq29t1.js → index-syaazvy2.js} +182 -47
  138. package/dist/{index-k29z4aqh.js → index-t5pck3ss.js} +1 -1
  139. package/dist/{index-6x57ar45.js → index-wfybj1dw.js} +4 -6
  140. package/dist/{index-cf74k5ak.js → index-whcgcfrv.js} +9 -6
  141. package/dist/{index-a6mc0v4d.js → index-x6cbrv9h.js} +3 -3
  142. package/dist/{index-bp5083x2.js → index-x9k3mqrf.js} +1 -1
  143. package/dist/{index-rpxdjkm0.js → index-y76rhsnr.js} +319 -61
  144. package/dist/{index-ze7mvk54.js → index-zy67whjr.js} +95 -59
  145. package/dist/index.js +58 -54
  146. package/dist/{logger-jm3sqqzr.js → logger-94kew5wm.js} +1 -1
  147. package/dist/{message-fts-rowid-map-17s0dfn4.js → message-fts-rowid-map-e79b7b6x.js} +6 -5
  148. package/dist/{message-index-gtpqnj8w.js → message-index-4q8ek2fc.js} +17 -16
  149. package/dist/{message-index-bounded-zyc8h32y.js → message-index-bounded-rydsg9r5.js} +17 -16
  150. package/dist/{message-time-backfill-73mmm76q.js → message-time-backfill-4qva0b4f.js} +3 -3
  151. package/dist/migration-worker.js +13 -12
  152. package/dist/{model-resolution-nx97z3x7.js → model-resolution-280gmqvd.js} +1 -1
  153. package/dist/plugin/embedding-bootstrap.d.ts +4 -1
  154. package/dist/plugin/embedding-bootstrap.d.ts.map +1 -1
  155. package/dist/plugin/hooks/create-session-hooks.d.ts +1 -0
  156. package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
  157. package/dist/plugin/rpc-handlers.d.ts +8 -0
  158. package/dist/plugin/rpc-handlers.d.ts.map +1 -1
  159. package/dist/plugin/subagent-tool-policy.d.ts +9 -0
  160. package/dist/plugin/subagent-tool-policy.d.ts.map +1 -1
  161. package/dist/plugin/tool-registry.d.ts.map +1 -1
  162. package/dist/{project-embedding-registry-z74mhqkf.js → project-embedding-registry-hn529988.js} +16 -13
  163. package/dist/raw-ordinal-warmup-worker.js +136 -101
  164. package/dist/{read-session-chunk-jjb48bt9.js → read-session-chunk-t039f0m5.js} +12 -11
  165. package/dist/{read-session-raw-rsc8c7qy.js → read-session-raw-aw6jgvwg.js} +4 -3
  166. package/dist/recomp-orchestrator-hbm53jj5.js +62 -0
  167. package/dist/{safe-notification-target-1szv1k5k.js → safe-notification-target-mkr9yzvr.js} +2 -2
  168. package/dist/search-archive-weh164mh.js +26 -0
  169. package/dist/search-hea079d7.js +50 -0
  170. package/dist/{send-session-notification-6ve0e8p4.js → send-session-notification-gqzkz7da.js} +7 -6
  171. package/dist/shared/logger.d.ts.map +1 -1
  172. package/dist/shared/model-resolution.d.ts +2 -0
  173. package/dist/shared/model-resolution.d.ts.map +1 -1
  174. package/dist/shared/prompt-async-transport.d.ts +3 -0
  175. package/dist/shared/prompt-async-transport.d.ts.map +1 -1
  176. package/dist/shared/rpc-types.d.ts +7 -0
  177. package/dist/shared/rpc-types.d.ts.map +1 -1
  178. package/dist/shared/sqlite.d.ts +6 -1
  179. package/dist/shared/sqlite.d.ts.map +1 -1
  180. package/dist/shared/subagent-runner.d.ts +2 -0
  181. package/dist/shared/subagent-runner.d.ts.map +1 -1
  182. package/dist/shared/tag-transcript.d.ts +2 -0
  183. package/dist/shared/tag-transcript.d.ts.map +1 -1
  184. package/dist/shared/worker-shutdown.d.ts +68 -0
  185. package/dist/shared/worker-shutdown.d.ts.map +1 -0
  186. package/dist/shared/worker-shutdown.fixture.d.ts +2 -0
  187. package/dist/shared/worker-shutdown.fixture.d.ts.map +1 -0
  188. package/dist/{sqlite-zf72c52d.js → sqlite-zdgm52sv.js} +5 -1
  189. package/dist/{storage-memory-y3qmy00r.js → storage-memory-e6a7mb0k.js} +2 -2
  190. package/dist/{storage-tags-r7k9tjcv.js → storage-tags-a77q4v77.js} +5 -5
  191. package/dist/{task-config-x3qmayd2.js → task-config-t6bpyka7.js} +2 -2
  192. package/dist/tools/ctx-search/tools.d.ts.map +1 -1
  193. package/dist/tools/ctx-search/types.d.ts +1 -0
  194. package/dist/tools/ctx-search/types.d.ts.map +1 -1
  195. package/dist/{transform-postprocess-phase-jj99r7z2.js → transform-postprocess-phase-0b04tm1p.js} +35 -32
  196. package/dist/v2/auto-search-worker.js +48 -9
  197. package/dist/v2/chunk-embedding-write-worker.js +30 -23
  198. package/dist/v2/{compaction-marker-candidates-ebx3388k.js → compaction-marker-candidates-m4vmye3w.js} +3 -3
  199. package/dist/v2/compaction-marker-candidates-worker.js +2 -2
  200. package/dist/v2/compartment-chunk-embedding-8jjmcgeg.js +64 -0
  201. package/dist/v2/{context-y5yamxak.js → context-ea3x7smm.js} +1797 -810
  202. package/dist/v2/{derive-budgets-2zh4gm2c.js → derive-budgets-knf763tt.js} +3 -3
  203. package/dist/v2/embedding-backfill-5e74ae0m.js +24 -0
  204. package/dist/v2/embedding-worker-process.js +2 -2
  205. package/dist/v2/embedding-worker.js +6 -6
  206. package/dist/v2/hidden-child-record.d.ts +2 -0
  207. package/dist/v2/hidden-child-record.d.ts.map +1 -1
  208. package/dist/v2/hidden-completion.d.ts +2 -0
  209. package/dist/v2/hidden-completion.d.ts.map +1 -1
  210. package/dist/v2/hidden-model-activity.d.ts +7 -0
  211. package/dist/v2/hidden-model-activity.d.ts.map +1 -0
  212. package/dist/v2/{history-owner-42e16w0n.js → history-owner-ad0crnrn.js} +2 -2
  213. package/dist/v2/hooks/context.d.ts.map +1 -1
  214. package/dist/v2/hooks/copied-tag-notation.d.ts +1 -1
  215. package/dist/v2/hooks/copied-tag-notation.d.ts.map +1 -1
  216. package/dist/v2/hooks/dream-timer.d.ts +2 -0
  217. package/dist/v2/hooks/dream-timer.d.ts.map +1 -1
  218. package/dist/v2/hooks/embedding-lifecycle.d.ts +7 -0
  219. package/dist/v2/hooks/embedding-lifecycle.d.ts.map +1 -0
  220. package/dist/v2/hooks/generate.d.ts +36 -1
  221. package/dist/v2/hooks/generate.d.ts.map +1 -1
  222. package/dist/v2/hooks/lkg-system.d.ts +35 -4
  223. package/dist/v2/hooks/lkg-system.d.ts.map +1 -1
  224. package/dist/v2/hooks/payload.d.ts +16 -1
  225. package/dist/v2/hooks/payload.d.ts.map +1 -1
  226. package/dist/v2/hooks/store.d.ts +2 -0
  227. package/dist/v2/hooks/store.d.ts.map +1 -1
  228. package/dist/v2/hooks/tools.d.ts +2 -1
  229. package/dist/v2/hooks/tools.d.ts.map +1 -1
  230. package/dist/v2/hooks/transform-features.d.ts +2 -2
  231. package/dist/v2/hooks/transform-features.d.ts.map +1 -1
  232. package/dist/v2/{logger-7qt02bnb.js → logger-p34mjtja.js} +1 -1
  233. package/dist/v2/{message-fts-rowid-map-wfx67gfd.js → message-fts-rowid-map-n8fdg2ja.js} +6 -5
  234. package/dist/v2/{message-index-bounded-spd8r7pj.js → message-index-bounded-8rcd7qq9.js} +17 -16
  235. package/dist/v2/{message-index-8vz2pq76.js → message-index-qz9wdp82.js} +17 -16
  236. package/dist/v2/{message-time-backfill-04t0km1z.js → message-time-backfill-zvthw6xb.js} +3 -3
  237. package/dist/v2/migration-worker.js +13 -12
  238. package/dist/v2/{model-resolution-nx97z3x7.js → model-resolution-280gmqvd.js} +1 -1
  239. package/dist/v2/{project-embedding-registry-gnkj56xp.js → project-embedding-registry-v38q4xd5.js} +16 -13
  240. package/dist/v2/raw-ordinal-warmup-worker.js +136 -101
  241. package/dist/v2/{read-session-chunk-cwkxrmns.js → read-session-chunk-wazfyxcg.js} +12 -11
  242. package/dist/v2/{read-session-raw-yaegtjzh.js → read-session-raw-b70cpwzj.js} +4 -3
  243. package/dist/v2/recomp-orchestrator-b12zaptj.js +61 -0
  244. package/dist/v2/{safe-notification-target-qg7n2s77.js → safe-notification-target-khnzg57c.js} +2 -2
  245. package/dist/v2/search-archive-x64rtz1z.js +25 -0
  246. package/dist/v2/search-hza9x72a.js +49 -0
  247. package/dist/v2/{send-session-notification-3pxn658x.js → send-session-notification-8eqe259v.js} +7 -6
  248. package/dist/v2/{server-45q69hkq.js → server-132h8twc.js} +5 -5
  249. package/dist/v2/{server-h0410h0v.js → server-1bw1wcbp.js} +1 -1
  250. package/dist/v2/{server-271qxsf5.js → server-24g8r2d0.js} +2466 -1290
  251. package/dist/v2/{server-tbe1femw.js → server-29qp8nz4.js} +1 -1
  252. package/dist/v2/{server-gsxjv2q2.js → server-33nqbqkw.js} +182 -47
  253. package/dist/v2/{server-tgnbmwah.js → server-3mz2qh5a.js} +1 -1
  254. package/dist/v2/{server-n1prf1g6.js → server-3vhxy2k5.js} +2 -2
  255. package/dist/v2/{server-xj136kt8.js → server-4kjmrjn4.js} +9 -3
  256. package/dist/v2/{server-34kwfsr4.js → server-53eh1r8r.js} +2 -2
  257. package/dist/{index-8cd2j99z.js → v2/server-5kym00ag.js} +32 -13
  258. package/dist/v2/{server-46neh5fa.js → server-62g58aaz.js} +314 -127
  259. package/dist/v2/{server-f2xf5gcb.js → server-6495nmn9.js} +12 -15
  260. package/dist/v2/{server-a9xqj88f.js → server-6v3cdzsx.js} +4 -4
  261. package/dist/v2/{server-d04vrx0j.js → server-806rzhs6.js} +2 -2
  262. package/dist/v2/{server-qd11g795.js → server-92g7d776.js} +2 -1
  263. package/dist/v2/{server-nj659894.js → server-94wk1ey3.js} +14 -3
  264. package/dist/v2/{server-6tmj0s7j.js → server-ab1g0wn9.js} +4 -6
  265. package/dist/v2/{server-8by8qfec.js → server-ad18djzs.js} +95 -59
  266. package/dist/v2/{server-hy3d3vsx.js → server-bsgd4dk1.js} +2 -2
  267. package/dist/v2/server-cpjk5jd2.js +82 -0
  268. package/dist/v2/{server-g3qma5c0.js → server-d1dzgvwd.js} +2 -2
  269. package/dist/v2/{server-hm38q7r0.js → server-d48x3m4x.js} +5 -5
  270. package/dist/v2/{server-1wy7b9de.js → server-dtp8hcjh.js} +3 -3
  271. package/dist/v2/{server-27gq4mfz.js → server-fa7vtp40.js} +9 -6
  272. package/dist/v2/{server-6pmqg9m4.js → server-gyy4k6mf.js} +1 -1
  273. package/dist/{index-beht37jy.js → v2/server-gzy5w8ya.js} +194 -5
  274. package/dist/v2/{server-bmymkx73.js → server-j8h7bsca.js} +29 -15
  275. package/dist/v2/{server-n37sebck.js → server-jjvbk92s.js} +1 -1
  276. package/dist/v2/{server-da07v4xp.js → server-k3t06fxr.js} +1 -1
  277. package/dist/v2/{server-9hx7g5jp.js → server-m4bfaevz.js} +1197 -1049
  278. package/dist/v2/{server-2ar62dyx.js → server-ppcd1qxh.js} +191 -99
  279. package/dist/v2/{server-rmygf5pn.js → server-qjvk4a9t.js} +2 -2
  280. package/dist/v2/{server-zzkj2fch.js → server-qteg2kt9.js} +5 -5
  281. package/dist/v2/{server-pwv4ezb0.js → server-rqebawx1.js} +2 -2
  282. package/dist/v2/{server-h1v0pyxb.js → server-vr4szghm.js} +501 -20
  283. package/dist/v2/{server-xq7dfjke.js → server-wwaw5npa.js} +5 -5
  284. package/dist/v2/{server-6vdzn1td.js → server-zg5y109h.js} +323 -76
  285. package/dist/v2/server.js +8 -8
  286. package/dist/v2/{sqlite-zf72c52d.js → sqlite-zdgm52sv.js} +5 -1
  287. package/dist/v2/{storage-memory-y3qmy00r.js → storage-memory-e6a7mb0k.js} +2 -2
  288. package/dist/v2/{storage-tags-3wdb8zph.js → storage-tags-q71rnr9f.js} +5 -5
  289. package/dist/v2/store-reader.d.ts +10 -0
  290. package/dist/v2/store-reader.d.ts.map +1 -1
  291. package/dist/v2/{task-config-nvz8mapa.js → task-config-7md27rx8.js} +2 -2
  292. package/dist/v2/{wrapup-orchestrator-embdz8gj.js → wrapup-orchestrator-3ssd5yy1.js} +33 -32
  293. package/dist/wrapup-orchestrator-5vpcd1zx.js +49 -0
  294. package/package.json +2 -2
  295. package/src/config/index.test.ts +72 -6
  296. package/src/config/project-security.ts +15 -0
  297. package/src/config/rerank.test.ts +60 -0
  298. package/src/config/schema/magic-context.ts +57 -0
  299. package/src/shared/logger.test.ts +42 -1
  300. package/src/shared/logger.ts +11 -13
  301. package/src/shared/model-resolution.test.ts +67 -12
  302. package/src/shared/model-resolution.ts +43 -16
  303. package/src/shared/model-suggestion-retry.ts +2 -2
  304. package/src/shared/prompt-async-transport.ts +47 -3
  305. package/src/shared/rpc-types.ts +7 -0
  306. package/src/shared/sqlite-busy-budget-review.test.ts +6 -1
  307. package/src/shared/sqlite-turn-deadline.test.ts +270 -0
  308. package/src/shared/sqlite.ts +239 -9
  309. package/src/shared/subagent-runner.ts +2 -0
  310. package/src/shared/tag-transcript.ts +9 -1
  311. package/src/shared/worker-shutdown-fence.test.ts +87 -0
  312. package/src/shared/worker-shutdown.fixture.ts +25 -0
  313. package/src/shared/worker-shutdown.test.ts +127 -0
  314. package/src/shared/worker-shutdown.ts +160 -0
  315. package/dist/embedding-backfill-fmz50tsy.js +0 -24
  316. package/dist/recomp-orchestrator-999jj4bc.js +0 -61
  317. package/dist/search-archive-6vm0e2f5.js +0 -25
  318. package/dist/search-xsqk1bj4.js +0 -49
  319. package/dist/v2/embedding-backfill-7c7yr69y.js +0 -23
  320. package/dist/v2/recomp-orchestrator-f6m9jr7p.js +0 -60
  321. package/dist/v2/search-archive-wve3tq1k.js +0 -24
  322. package/dist/v2/search-hwg7jfbj.js +0 -48
  323. package/dist/wrapup-orchestrator-whhbjmaz.js +0 -48
@@ -3,11 +3,11 @@ import {
3
3
  } from "./index-v0p37hm2.js";
4
4
  import {
5
5
  log2
6
- } from "./index-j75v2476.js";
6
+ } from "./index-h7tgn49j.js";
7
7
  import {
8
8
  inRootAsyncContext2,
9
9
  getSqliteDatabasePath2
10
- } from "./index-beht37jy.js";
10
+ } from "./index-gzy5w8ya.js";
11
11
 
12
12
  // src/features/magic-context/compaction-marker-candidates.ts
13
13
  import { existsSync, realpathSync } from "node:fs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  log2
3
- } from "./index-j75v2476.js";
3
+ } from "./index-h7tgn49j.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,21 +1,21 @@
1
1
  import {
2
2
  DEFAULT_LOCAL_EMBEDDING_MODEL
3
- } from "./index-wgypt3cs.js";
3
+ } from "./index-nxrsns5x.js";
4
4
  import {
5
5
  log2
6
- } from "./index-j75v2476.js";
6
+ } from "./index-h7tgn49j.js";
7
7
  import {
8
8
  isSynapseEmbeddingTruncated,
9
9
  SynapseEmbeddingProvider
10
- } from "./index-6x57ar45.js";
10
+ } from "./index-wfybj1dw.js";
11
11
  import {
12
12
  LocalEmbeddingProvider
13
- } from "./index-bjcnntmz.js";
13
+ } from "./index-51rdvtkz.js";
14
14
  import {
15
15
  OpenAICompatibleEmbeddingProvider,
16
16
  getProjectEmbeddingSnapshot2,
17
17
  embedBatchForProject2
18
- } from "./index-ze7mvk54.js";
18
+ } from "./index-zy67whjr.js";
19
19
  import {
20
20
  isEmbeddingHostBusy2
21
21
  } from "./index-qt1qqasc.js";
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  log2,
9
9
  sessionLog2
10
- } from "./index-j75v2476.js";
10
+ } from "./index-h7tgn49j.js";
11
11
  import {
12
12
  localBudget,
13
13
  calibrationForModelKey
@@ -6,7 +6,7 @@ import {
6
6
  StaleRouteHandleError,
7
7
  SubcClient,
8
8
  isConsumerReconnectTransient
9
- } from "./index-6x57ar45.js";
9
+ } from "./index-wfybj1dw.js";
10
10
  import {
11
11
  getHarness2
12
12
  } from "./index-pavzsdc6.js";
@@ -15,14 +15,16 @@ import {
15
15
  } from "./index-g2q4htwp.js";
16
16
  import {
17
17
  log2
18
- } from "./index-j75v2476.js";
18
+ } from "./index-h7tgn49j.js";
19
19
  import {
20
20
  inRootAsyncContext2
21
- } from "./index-beht37jy.js";
21
+ } from "./index-gzy5w8ya.js";
22
22
  import {
23
- buildCanonicalChunkTextFromFts,
24
- loadCompartmentChunkEmbeddingsForSearch
25
- } from "./index-b5vqckbw.js";
23
+ buildCanonicalChunkTextFromFts2,
24
+ loadCompartmentChunkEmbeddingsForSearch2,
25
+ peekCompartmentChunkSearchPool2,
26
+ warmCompartmentChunkSearchPool2
27
+ } from "./index-m32esgmj.js";
26
28
  import {
27
29
  recordEmbeddingMeasurement,
28
30
  saveCommitEmbedding,
@@ -39,7 +41,7 @@ import {
39
41
  enqueueShadowEmbeddingItems2,
40
42
  getProjectEmbeddingSnapshot2,
41
43
  embedItemsForProject2
42
- } from "./index-ze7mvk54.js";
44
+ } from "./index-zy67whjr.js";
43
45
  import {
44
46
  getProjectEmbeddings2
45
47
  } from "./index-4dhv7mqz.js";
@@ -48,13 +50,13 @@ import {
48
50
  isEmbeddingEnabled,
49
51
  embedText,
50
52
  ensureMemoryEmbeddings2
51
- } from "./index-24fezq97.js";
53
+ } from "./index-rxqr723x.js";
52
54
  import {
53
55
  ModuleMemoryAuthorityError2,
54
56
  getMemoriesByProject2,
55
57
  getMemoriesByProjects2,
56
58
  updateMemoryRetrievalCount2
57
- } from "./index-n37sebck.js";
59
+ } from "./index-jjvbk92s.js";
58
60
  import {
59
61
  USER_FACING_FAILURES,
60
62
  getNotes,
@@ -63,27 +65,27 @@ import {
63
65
  sanitizeFtsQuery,
64
66
  searchMemoriesFTS,
65
67
  searchMemoriesFTSUnion
66
- } from "./index-3h4dp9wb.js";
68
+ } from "./index-3svaejkh.js";
67
69
  import {
68
70
  cleanSearchText,
69
71
  keywordRelevance,
70
72
  matchedSearchSnippet,
71
73
  getIndexedMessageCorpusSize2
72
- } from "./index-se4m2g6w.js";
74
+ } from "./index-mnnkgq0q.js";
73
75
  import {
74
76
  MESSAGE_FTS_SESSION_FILTER_SQL,
75
77
  withMessageFtsSessionFilter
76
78
  } from "./index-kaqs6h31.js";
77
79
  import {
78
80
  isRecord
79
- } from "./index-cf74k5ak.js";
81
+ } from "./index-whcgcfrv.js";
80
82
  import {
81
83
  resolveWorkspaceShareCategories,
82
84
  resolveWorkspaceIdentitySet,
83
85
  expandWorkspaceIdentitySetWithAliases,
84
86
  resolveStoredPathWorkspaceIdentity,
85
87
  sourceNameForMemory
86
- } from "./index-63k48rv9.js";
88
+ } from "./index-9q1g3c5q.js";
87
89
  import {
88
90
  isKnownAutocommit
89
91
  } from "./index-8ajstryz.js";
@@ -1427,6 +1429,7 @@ function sha256(value) {
1427
1429
  var RERANK_MODEL = "gte-reranker-modernbert-base-f32";
1428
1430
  var RERANK_LANE_LIMIT = 25;
1429
1431
  var DEADLINE_MS = 1500;
1432
+ var DOCUMENT_BYTES = 1024;
1430
1433
  function isProseQuery(query) {
1431
1434
  const text = query.trim();
1432
1435
  if (!text || /[\n;]|^["'`]|["'`]$/.test(text))
@@ -1506,7 +1509,7 @@ function candidateText(location, title, body) {
1506
1509
  ${truncateUtf8(title.replaceAll(`
1507
1510
  `, " "), 120)}
1508
1511
  `;
1509
- return header + truncateUtf8(body, 1024 - Buffer.byteLength(header));
1512
+ return header + truncateUtf8(body, DOCUMENT_BYTES - Buffer.byteLength(header));
1510
1513
  }
1511
1514
 
1512
1515
  class RerankFailure extends Error {
@@ -1576,7 +1579,79 @@ async function connect(connectionFile) {
1576
1579
  }
1577
1580
  return bounded(connection);
1578
1581
  }
1579
- async function prepareReranker(projectRoot, sessionId, connectionFile, injectedClient) {
1582
+ async function remoteScores(config, query, documents, signal) {
1583
+ const controller = new AbortController;
1584
+ let timer;
1585
+ let onAbort;
1586
+ try {
1587
+ const cancelled = new Promise((_, reject) => {
1588
+ const cancel = (reason) => {
1589
+ reject(new RerankFailure(reason));
1590
+ controller.abort();
1591
+ };
1592
+ onAbort = () => cancel("aborted");
1593
+ if (signal?.aborted)
1594
+ onAbort();
1595
+ else
1596
+ signal?.addEventListener("abort", onAbort, { once: true });
1597
+ timer = setTimeout(() => cancel("timeout"), Math.max(50, Math.min(15000, config.timeout_ms ?? DEADLINE_MS)));
1598
+ });
1599
+ const request = async () => {
1600
+ const tei = config.endpoint?.startsWith("tei+");
1601
+ const endpoint = (tei ? config.endpoint?.slice(4) : config.endpoint)?.replace(/\/+$/, "");
1602
+ if (!endpoint || !/^https?:\/\//.test(endpoint))
1603
+ throw new RerankFailure("invalid_endpoint");
1604
+ const response = await fetch(`${endpoint}/rerank`, {
1605
+ method: "POST",
1606
+ headers: {
1607
+ "Content-Type": "application/json",
1608
+ ...config.api_key ? { Authorization: `Bearer ${config.api_key}` } : {}
1609
+ },
1610
+ body: JSON.stringify(tei ? { query, texts: documents } : {
1611
+ model: config.model,
1612
+ query,
1613
+ documents,
1614
+ top_n: documents.length
1615
+ }),
1616
+ signal: controller.signal,
1617
+ redirect: "error"
1618
+ });
1619
+ if (!response.ok)
1620
+ throw new RerankFailure(`http_${response.status}`);
1621
+ const body = await response.json();
1622
+ const rows = tei ? body : body?.results;
1623
+ if (!Array.isArray(rows) || rows.length !== documents.length)
1624
+ throw new RerankFailure("invalid_reply");
1625
+ const scores = new Array(documents.length);
1626
+ const seen = new Set;
1627
+ for (const row of rows) {
1628
+ const index = row?.index;
1629
+ const score = tei ? row?.score : row?.relevance_score;
1630
+ if (!Number.isInteger(index) || index < 0 || index >= documents.length || seen.has(index) || typeof score !== "number" || !Number.isFinite(score))
1631
+ throw new RerankFailure("invalid_reply");
1632
+ seen.add(index);
1633
+ scores[index] = score;
1634
+ }
1635
+ return scores;
1636
+ };
1637
+ return await Promise.race([cancelled, request()]);
1638
+ } finally {
1639
+ clearTimeout(timer);
1640
+ if (onAbort)
1641
+ signal?.removeEventListener("abort", onAbort);
1642
+ }
1643
+ }
1644
+ function remoteRerankSkipped(reason, onSkipped) {
1645
+ const safe = /^(?:invalid_reply|invalid_endpoint|validation|timeout|aborted|candidate_validation|http_\d{3})$/.test(reason) ? reason : "remote_error";
1646
+ const line = `Reranking skipped: ${safe}`;
1647
+ logRerankFallback(safe);
1648
+ onSkipped?.(line);
1649
+ }
1650
+ async function prepareReranker(projectRoot, sessionId, connectionFile, injectedClient, config) {
1651
+ if (config?.provider === "off")
1652
+ return null;
1653
+ if (config?.provider === "remote")
1654
+ return { remote: config };
1580
1655
  try {
1581
1656
  if (injectedClient === null)
1582
1657
  throw new RerankFailure("missing_synapse");
@@ -1593,36 +1668,43 @@ async function prepareReranker(projectRoot, sessionId, connectionFile, injectedC
1593
1668
  return null;
1594
1669
  }
1595
1670
  }
1596
- async function rerankSearchResults(session, query, baseline, pool, texts, limit) {
1671
+ async function rerankSearchResults(session, query, baseline, pool, texts, limit, signal, onSkipped) {
1597
1672
  if (!pool.length)
1598
1673
  return baseline;
1599
1674
  try {
1600
- if (pool.length > 20 || texts.length !== pool.length || texts.some((text) => Buffer.byteLength(text) > 1024))
1601
- throw new RerankFailure("validation");
1602
- const body = unwrap(await bounded(session.client.call("synapse", "rerank.score", {
1603
- model: RERANK_MODEL,
1604
- query,
1605
- candidates: texts,
1606
- required_fingerprint: session.lane.fingerprint,
1607
- allow_equivalent: false,
1608
- accept_declared: false,
1609
- max_queue_ms: 100,
1610
- deadline_ms: DEADLINE_MS
1611
- }, {
1612
- timeoutMs: DEADLINE_MS,
1613
- targetKind: "management_surface",
1614
- identity: session.identity
1615
- })));
1616
- if (body.fingerprint !== session.lane.fingerprint)
1617
- throw new RerankFailure("fingerprint_mismatch");
1618
- if (body.table_epoch !== session.lane.tableEpoch)
1619
- throw new RerankFailure("epoch_mismatch");
1620
- if (!Array.isArray(body.scores) || body.scores.length !== pool.length || body.scores.some((score) => typeof score !== "number" || !Number.isFinite(score)))
1675
+ if (pool.length > 20 || texts.length !== pool.length || texts.some((text) => Buffer.byteLength(text) > DOCUMENT_BYTES))
1621
1676
  throw new RerankFailure("validation");
1622
- const scores = body.scores;
1677
+ let scores;
1678
+ if ("remote" in session) {
1679
+ scores = await remoteScores(session.remote, query, texts, signal);
1680
+ } else {
1681
+ const body = unwrap(await bounded(session.client.call("synapse", "rerank.score", {
1682
+ model: RERANK_MODEL,
1683
+ query,
1684
+ candidates: texts,
1685
+ required_fingerprint: session.lane.fingerprint,
1686
+ allow_equivalent: false,
1687
+ max_queue_ms: 100,
1688
+ deadline_ms: DEADLINE_MS
1689
+ }, {
1690
+ timeoutMs: DEADLINE_MS,
1691
+ targetKind: "management_surface",
1692
+ identity: session.identity
1693
+ })));
1694
+ if (body.fingerprint !== session.lane.fingerprint)
1695
+ throw new RerankFailure("fingerprint_mismatch");
1696
+ if (body.table_epoch !== session.lane.tableEpoch)
1697
+ throw new RerankFailure("epoch_mismatch");
1698
+ if (!Array.isArray(body.scores) || body.scores.length !== pool.length || body.scores.some((score) => typeof score !== "number" || !Number.isFinite(score)))
1699
+ throw new RerankFailure("validation");
1700
+ scores = body.scores;
1701
+ }
1623
1702
  return pool.map((hit, index) => ({ hit, index, score: scores[index] })).sort((a, b) => b.score - a.score || a.index - b.index).slice(0, limit).map((row) => row.hit);
1624
1703
  } catch (error) {
1625
- logRerankFallback(reasonOf(error));
1704
+ if ("remote" in session)
1705
+ remoteRerankSkipped(error instanceof RerankFailure ? error.reason : "remote_error", onSkipped);
1706
+ else
1707
+ logRerankFallback(reasonOf(error));
1626
1708
  return baseline;
1627
1709
  }
1628
1710
  }
@@ -1677,7 +1759,7 @@ Reason: ${row.reason}` : ""}`;
1677
1759
  case "compartment": {
1678
1760
  title = hit.title;
1679
1761
  location = `compartment ${hit.compartmentId} ${hit.sessionId} @${hit.startOrdinal}-${hit.endOrdinal}`;
1680
- body = buildCanonicalChunkTextFromFts(db, hit.sessionId, hit.startOrdinal, hit.endOrdinal) ?? "";
1762
+ body = buildCanonicalChunkTextFromFts2(db, hit.sessionId, hit.startOrdinal, hit.endOrdinal) ?? "";
1681
1763
  break;
1682
1764
  }
1683
1765
  }
@@ -2616,10 +2698,42 @@ function searchNotes(args) {
2616
2698
  }));
2617
2699
  }
2618
2700
  async function searchCompartmentChunks(args) {
2619
- if (!args.queryEmbedding || args.limit <= 0 || !args.modelId || args.modelId === "off")
2701
+ if (args.limit <= 0 || !args.modelId || args.modelId === "off") {
2702
+ if (args.timings)
2703
+ args.timings.chunkPool = "off";
2704
+ return [];
2705
+ }
2706
+ if (!args.queryEmbedding) {
2707
+ if (args.timings)
2708
+ args.timings.chunkPool = "no-vector";
2709
+ if (args.warmOnly)
2710
+ warmCompartmentChunkSearchPool2(args.db, args.sessionId, args.projectPath, args.modelId);
2620
2711
  return [];
2712
+ }
2621
2713
  const cutoff = args.maxOrdinal != null && args.maxOrdinal >= 0 ? args.maxOrdinal : null;
2622
- const rows = await loadCompartmentChunkEmbeddingsForSearch(args.db, args.sessionId, args.projectPath, args.modelId, args.dateRange);
2714
+ let rows;
2715
+ if (args.warmOnly) {
2716
+ const warm = peekCompartmentChunkSearchPool2(args.db, args.sessionId, args.projectPath, args.modelId, args.dateRange);
2717
+ if (warm === null) {
2718
+ if (args.timings)
2719
+ args.timings.chunkPool = "cold";
2720
+ warmCompartmentChunkSearchPool2(args.db, args.sessionId, args.projectPath, args.modelId);
2721
+ return [];
2722
+ }
2723
+ if (args.timings)
2724
+ args.timings.chunkPool = "warm";
2725
+ rows = warm;
2726
+ } else {
2727
+ try {
2728
+ rows = await loadCompartmentChunkEmbeddingsForSearch2(args.db, args.sessionId, args.projectPath, args.modelId, args.dateRange, args.signal);
2729
+ } catch (error) {
2730
+ if (args.signal?.aborted)
2731
+ return [];
2732
+ throw error;
2733
+ }
2734
+ if (args.timings)
2735
+ args.timings.chunkPool = "loaded";
2736
+ }
2623
2737
  if (rows.length === 0)
2624
2738
  return [];
2625
2739
  const byCompartment = new Map;
@@ -2911,7 +3025,7 @@ async function unifiedSearch2(db, sessionId, projectPath, query, options = {}) {
2911
3025
  return [];
2912
3026
  }
2913
3027
  const limit = normalizeLimit(options.limit);
2914
- const reranker = options.explicitSearch && options.rerank !== false && isProseQuery(trimmedQuery) ? await prepareReranker(projectPath, sessionId, options.rerankConnectionFile, options.rerankClient) : null;
3028
+ const reranker = options.explicitSearch && options.rerank !== false && isProseQuery(trimmedQuery) ? await prepareReranker(projectPath, sessionId, options.rerankConnectionFile, options.rerankClient, options.rerankConfig) : null;
2915
3029
  const lanes = reranker || options.captureRerankLanes ? emptySearchLanes() : undefined;
2916
3030
  const dateRange = normalizeDateRange(options.from, options.to);
2917
3031
  const tierLimit = Math.max(limit * 3, DEFAULT_UNIFIED_SEARCH_LIMIT);
@@ -2944,6 +3058,8 @@ async function unifiedSearch2(db, sessionId, projectPath, query, options = {}) {
2944
3058
  if (options.signal?.aborted)
2945
3059
  return [];
2946
3060
  const messageProbes = options.explicitSearch ? extractLiteralProbes(trimmedQuery) : [];
3061
+ const timings = options.stepTimings;
3062
+ let stepStartedAt = performance.now();
2947
3063
  let messageResults = [];
2948
3064
  if (runMessages) {
2949
3065
  const messageRequest = {
@@ -2970,8 +3086,13 @@ async function unifiedSearch2(db, sessionId, projectPath, query, options = {}) {
2970
3086
  messageResults = outcome.results.filter((result) => result.messageId !== options.excludeMessageId);
2971
3087
  if (lanes)
2972
3088
  lanes.message_fts = (outcome.laneResults ?? outcome.results).slice(0, 25);
3089
+ if (timings)
3090
+ timings.messageMs = performance.now() - stepStartedAt;
2973
3091
  }
3092
+ stepStartedAt = performance.now();
2974
3093
  const capturedQuery = await queryEmbeddingPromise;
3094
+ if (timings && needsEmbedding)
3095
+ timings.vectorWaitMs = performance.now() - stepStartedAt;
2975
3096
  if (options.signal?.aborted)
2976
3097
  return [];
2977
3098
  const embeddingSnapshot = getProjectEmbeddingSnapshot2(projectPath);
@@ -2981,6 +3102,9 @@ async function unifiedSearch2(db, sessionId, projectPath, query, options = {}) {
2981
3102
  const workspace = resolveSearchWorkspaceContext(db, projectPath);
2982
3103
  const embeddingModelId = queryContract?.modelId ?? options.embeddingModelIdOverride ?? embeddingSnapshot?.modelId;
2983
3104
  const chunkModelId = queryContract?.chunkModelId ?? options.chunkModelIdOverride ?? embeddingSnapshot?.chunkModelId;
3105
+ stepStartedAt = performance.now();
3106
+ if (timings)
3107
+ timings.chunkPool = "off";
2984
3108
  const compartmentResults = runCompartmentChunks ? await searchCompartmentChunks({
2985
3109
  db,
2986
3110
  sessionId,
@@ -2989,8 +3113,14 @@ async function unifiedSearch2(db, sessionId, projectPath, query, options = {}) {
2989
3113
  limit: lanes ? Math.max(tierLimit, 25) : tierLimit,
2990
3114
  maxOrdinal: options.maxMessageOrdinal,
2991
3115
  modelId: chunkModelId && chunkModelId !== "off" ? chunkModelId : null,
2992
- dateRange
3116
+ dateRange,
3117
+ warmOnly: options.chunkPoolWarmOnly,
3118
+ signal: options.signal,
3119
+ timings
2993
3120
  }) : [];
3121
+ if (timings && runCompartmentChunks)
3122
+ timings.chunkMs = performance.now() - stepStartedAt;
3123
+ stepStartedAt = performance.now();
2994
3124
  if (lanes)
2995
3125
  lanes.chunk_vector = compartmentResults.slice(0, 25);
2996
3126
  const messageLikeResults = mergeMessageAndCompartmentResults({
@@ -3046,6 +3176,8 @@ async function unifiedSearch2(db, sessionId, projectPath, query, options = {}) {
3046
3176
  dateRange
3047
3177
  })) : Promise.resolve([])
3048
3178
  ]);
3179
+ if (timings)
3180
+ timings.otherLanesMs = performance.now() - stepStartedAt;
3049
3181
  if (options.diagnostics) {
3050
3182
  options.diagnostics.suppressedVisibleMemoryIds = memoryOutcome.suppressedVisibleIds;
3051
3183
  }
@@ -3063,11 +3195,14 @@ async function unifiedSearch2(db, sessionId, projectPath, query, options = {}) {
3063
3195
  options.captureRerankLanes?.(lanes);
3064
3196
  }
3065
3197
  if (reranker && lanes) {
3066
- const pool = fuseSearchLanes(lanes);
3198
+ const pool = fuseSearchLanes(lanes).slice(0, "remote" in reranker ? reranker.remote.top_n : 20);
3067
3199
  try {
3068
- results = await rerankSearchResults(reranker, trimmedQuery, results, pool, candidateTexts(db, sessionId, projectPath, pool), limit);
3200
+ results = await rerankSearchResults(reranker, trimmedQuery, results, pool, candidateTexts(db, sessionId, projectPath, pool), limit, options.signal, options.onRerankSkipped);
3069
3201
  } catch {
3070
- logRerankFallback("candidate_validation");
3202
+ if ("remote" in reranker)
3203
+ remoteRerankSkipped("candidate_validation", options.onRerankSkipped);
3204
+ else
3205
+ logRerankFallback("candidate_validation");
3071
3206
  }
3072
3207
  }
3073
3208
  if (!options.measurementDisabled) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  log2
3
- } from "./index-j75v2476.js";
3
+ } from "./index-h7tgn49j.js";
4
4
 
5
5
  // src/shared/write-transaction-timing.ts
6
6
  var SLOW_WRITE_TRANSACTION_THRESHOLD_MS = 1000;
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  estimateTokens
3
- } from "./index-c5pytzne.js";
3
+ } from "./index-b88dwwrh.js";
4
4
  import {
5
5
  getHarness2
6
6
  } from "./index-pavzsdc6.js";
7
7
  import {
8
8
  log2
9
- } from "./index-j75v2476.js";
9
+ } from "./index-h7tgn49j.js";
10
10
  import {
11
11
  inRootAsyncContext2
12
- } from "./index-beht37jy.js";
12
+ } from "./index-gzy5w8ya.js";
13
13
 
14
14
  // ../../node_modules/.bun/@cortexkit+subc-client@0.11.1/node_modules/@cortexkit/subc-client/dist/client.js
15
15
  import { promises as fs2 } from "node:fs";
@@ -1786,7 +1786,6 @@ function getSynapseBatchRequestKey(args) {
1786
1786
  required_fingerprint: args.fingerprint,
1787
1787
  required_epoch: args.tableEpoch,
1788
1788
  allow_equivalent: false,
1789
- accept_declared: false,
1790
1789
  ids: args.items.map((item) => item.id),
1791
1790
  content_sha256: args.items.map((item) => item.contentSha256),
1792
1791
  ...args.purpose === "query" ? { purpose: args.purpose } : {}
@@ -2175,8 +2174,7 @@ class SynapseEmbeddingProvider {
2175
2174
  model: metadata.model,
2176
2175
  required_fingerprint: metadata.fingerprint,
2177
2176
  required_epoch: metadata.table_epoch,
2178
- allow_equivalent: false,
2179
- accept_declared: false
2177
+ allow_equivalent: false
2180
2178
  };
2181
2179
  }
2182
2180
  batchRequest(items, requestKey, purpose) {
@@ -4,23 +4,23 @@ import {
4
4
  } from "./index-1zx87sdm.js";
5
5
  import {
6
6
  estimateTokens
7
- } from "./index-c5pytzne.js";
7
+ } from "./index-b88dwwrh.js";
8
8
  import {
9
9
  getHarness2
10
10
  } from "./index-pavzsdc6.js";
11
11
  import {
12
12
  sessionLog2
13
- } from "./index-j75v2476.js";
13
+ } from "./index-h7tgn49j.js";
14
14
  import {
15
15
  getTagIdentityWriteGeneration2,
16
16
  getSqliteDatabasePath2
17
- } from "./index-beht37jy.js";
17
+ } from "./index-gzy5w8ya.js";
18
18
  import {
19
19
  tagIdentityRevisionKey,
20
20
  tagOrderConstraintIndex,
21
21
  stableStringify,
22
22
  stableStringifyHash
23
- } from "./index-bp5083x2.js";
23
+ } from "./index-x9k3mqrf.js";
24
24
  import {
25
25
  DEFAULT_PROTECTED_TOOLS,
26
26
  normalizeProtectedToolName,
@@ -88,13 +88,16 @@ function stripDanglingTagNotationGlobally(value) {
88
88
  function stripTagSectionCharacters(value) {
89
89
  return value.replace(STRAY_SECTION_CHAR_REGEX, "");
90
90
  }
91
- function stripPersistedAssistantText(value) {
91
+ function stripPersistedAssistantText(value, acceptsEmpty = true) {
92
+ if (!acceptsEmpty && !value.includes("§") && !value.trim())
93
+ return value;
92
94
  let text = stripWellFormedLeadingTagPrefix(value);
93
95
  text = stripCompleteTagPairsGlobally(text);
94
96
  text = stripMalformedTagNotationGlobally(text);
95
97
  text = stripDanglingTagNotationGlobally(text);
96
98
  text = stripTagSectionCharacters(text);
97
- return text.trim();
99
+ const stripped = text.trim();
100
+ return !acceptsEmpty && value.trim().length > 0 && stripped.length === 0 ? value : stripped;
98
101
  }
99
102
  function byteSize(value) {
100
103
  return encoder.encode(value).length;
@@ -2,13 +2,13 @@ import {
2
2
  getSqliteDatabasePath2,
3
3
  withSqliteBackgroundWriter2,
4
4
  withoutSqliteTransformPass2
5
- } from "./index-beht37jy.js";
5
+ } from "./index-gzy5w8ya.js";
6
6
  import {
7
7
  runSessionWarmupWorker
8
- } from "./index-s734jcsr.js";
8
+ } from "./index-jfem3dgz.js";
9
9
  import {
10
10
  logSlowWriteTransaction
11
- } from "./index-k29z4aqh.js";
11
+ } from "./index-t5pck3ss.js";
12
12
 
13
13
  // src/features/magic-context/message-fts-rowid-map.ts
14
14
  import { createHash } from "node:crypto";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  sessionLog2
3
- } from "./index-j75v2476.js";
3
+ } from "./index-h7tgn49j.js";
4
4
  import {
5
5
  isKnownAutocommit
6
6
  } from "./index-8ajstryz.js";