@cortexkit/opencode-magic-context 0.49.96 → 0.49.98

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 (199) hide show
  1. package/dist/{announcement-8nj2jd87.js → announcement-p2xjv6cp.js} +4 -5
  2. package/dist/auto-search-worker.js +5 -5
  3. package/dist/chunk-embedding-write-worker.js +15 -16
  4. package/dist/{compaction-marker-candidates-a4b0anvv.js → compaction-marker-candidates-2apg7ewt.js} +2 -3
  5. package/dist/compaction-marker-candidates-worker.js +1 -1
  6. package/dist/{compartment-chunk-embedding-re2cw7y3.js → compartment-chunk-embedding-gnemmf79.js} +7 -8
  7. package/dist/{conflict-warning-hook-wcq55y61.js → conflict-warning-hook-x1ynwzwz.js} +7 -8
  8. package/dist/{context-gtjdrp8f.js → context-0ae81pg4.js} +377 -60
  9. package/dist/{derive-budgets-g1sy72e8.js → derive-budgets-vbv0fwsd.js} +4 -5
  10. package/dist/embedding-backfill-7terr34j.js +28 -0
  11. package/dist/embedding-worker-process.js +1 -2
  12. package/dist/embedding-worker.js +6 -7
  13. package/dist/features/magic-context/storage-native-replay.d.ts +7 -0
  14. package/dist/features/magic-context/storage-native-replay.d.ts.map +1 -1
  15. package/dist/{history-owner-74826t4n.js → history-owner-8dj31nyf.js} +2 -3
  16. package/dist/hooks/magic-context/apply-operations.d.ts.map +1 -1
  17. package/dist/hooks/magic-context/tag-messages.d.ts +11 -1
  18. package/dist/hooks/magic-context/tag-messages.d.ts.map +1 -1
  19. package/dist/hooks/magic-context/transform.d.ts +2 -0
  20. package/dist/hooks/magic-context/transform.d.ts.map +1 -1
  21. package/dist/{index-0bjj9yf3.js → index-04zhtsb1.js} +2 -2
  22. package/dist/{index-fvfnq8n6.js → index-0wj3jr8n.js} +6 -6
  23. package/dist/{index-j4dcjb8t.js → index-1vv1ka4a.js} +4 -4
  24. package/dist/{index-zfx7mtqa.js → index-2m3t73wk.js} +1 -1
  25. package/dist/{index-3fhb0j32.js → index-34xvre52.js} +223 -5
  26. package/dist/{index-cq8znmyw.js → index-5wbqmvg8.js} +25 -17
  27. package/dist/{index-kj4bprep.js → index-61a853ky.js} +4 -4
  28. package/dist/{index-zmgp0tr6.js → index-74w347am.js} +3 -3
  29. package/dist/{index-hp46xe93.js → index-8hhmv0ff.js} +6 -6
  30. package/dist/{index-c205x7xd.js → index-8k9qpyjf.js} +1 -1
  31. package/dist/{index-tqtpgnhr.js → index-9awtk18w.js} +1 -1
  32. package/dist/{index-h7kta6cn.js → index-9eqt7755.js} +3 -3
  33. package/dist/{index-8sgv96kq.js → index-a1295271.js} +7 -7
  34. package/dist/{index-880a24vd.js → index-ab86c21b.js} +1 -1
  35. package/dist/{index-3n4j5rqc.js → index-abhmtj00.js} +1 -1
  36. package/dist/{index-tr4ep2ej.js → index-ajmy0v5j.js} +31 -0
  37. package/dist/{index-dj64gzg5.js → index-cayqdwf9.js} +2 -2
  38. package/dist/{index-910gahfb.js → index-db1art1p.js} +6 -8
  39. package/dist/{index-gnrwgvn7.js → index-em72jhc0.js} +14 -12
  40. package/dist/{index-7sdns2ww.js → index-fd3hkyk1.js} +2 -2
  41. package/dist/{index-fgw241hh.js → index-gcf2x04k.js} +2 -2
  42. package/dist/{index-89xg64wb.js → index-geph2sa6.js} +2 -2
  43. package/dist/{index-45qgkg8j.js → index-h1qh9n8b.js} +2 -2
  44. package/dist/{index-9jvxq5rt.js → index-h1xvt8fw.js} +4 -4
  45. package/dist/{index-0ve29s6f.js → index-hbqxxb2n.js} +1 -1
  46. package/dist/{index-0sqhg9nf.js → index-hmrkgd4v.js} +12 -12
  47. package/dist/{index-dnpcv1rg.js → index-hyvxmz3e.js} +4 -4
  48. package/dist/{index-hedgz8an.js → index-jsbgw33b.js} +1 -1
  49. package/dist/{index-t2e10rag.js → index-k86ec4j2.js} +5 -5
  50. package/dist/{index-mgy7g740.js → index-kjdys7e2.js} +1 -1
  51. package/dist/{index-e6ay1gez.js → index-mfx7hzyc.js} +2 -2
  52. package/dist/{index-r1d45dsr.js → index-nyjztqyj.js} +3 -3
  53. package/dist/{index-nqdwpdje.js → index-p52gf8a6.js} +23 -25
  54. package/dist/{index-azkfw78y.js → index-qxzk5s30.js} +1 -1
  55. package/dist/{index-6mryx739.js → index-t7st85f5.js} +1 -1
  56. package/dist/{index-89bkkgcn.js → index-tyjx0dwz.js} +4 -4
  57. package/dist/{index-k34hc455.js → index-vdzd98ry.js} +2 -2
  58. package/dist/{index-hj78hvhm.js → index-vegw385y.js} +2 -2
  59. package/dist/{index-f154w8m4.js → index-vxsxz3sp.js} +46 -43
  60. package/dist/{index-w7n7qkpf.js → index-w6kcwhhj.js} +4 -4
  61. package/dist/{index-2afrmgy3.js → index-xbna9akt.js} +5 -5
  62. package/dist/{index-cpbr0xvk.js → index-xtv4d4hv.js} +2 -2
  63. package/dist/{index-zkjx8gq3.js → index-xw608ytx.js} +11 -11
  64. package/dist/{index-jzrvdqb8.js → index-y5f5yg5a.js} +1 -1
  65. package/dist/{index-7m2tnk8q.js → index-z1mj8fv5.js} +9 -11
  66. package/dist/index.js +55 -56
  67. package/dist/{logger-nmb2508f.js → logger-dgtrf43g.js} +1 -2
  68. package/dist/{message-fts-rowid-map-vcatdan0.js → message-fts-rowid-map-cfq59g6g.js} +4 -5
  69. package/dist/{message-index-bounded-abhwe610.js → message-index-bounded-6y7p974x.js} +10 -11
  70. package/dist/{message-time-backfill-zc5rsvhv.js → message-time-backfill-av870n4c.js} +2 -3
  71. package/dist/migration-worker.js +12 -13
  72. package/dist/plugin/rpc-handlers.d.ts +1 -0
  73. package/dist/plugin/rpc-handlers.d.ts.map +1 -1
  74. package/dist/{project-embedding-registry-e566q4bg.js → project-embedding-registry-5rp9w92w.js} +13 -14
  75. package/dist/raw-ordinal-warmup-worker.js +8 -8
  76. package/dist/{read-session-chunk-sde0wym3.js → read-session-chunk-9ejnbe07.js} +8 -9
  77. package/dist/{read-session-raw-trhdgc9z.js → read-session-raw-pgc9gxtn.js} +2 -3
  78. package/dist/{recomp-orchestrator-d3rbpa59.js → recomp-orchestrator-kmkf8dm4.js} +32 -33
  79. package/dist/render-9712q3gp.js +42 -0
  80. package/dist/{safe-notification-target-54ns7dv9.js → safe-notification-target-01j8km9e.js} +2 -3
  81. package/dist/{search-archive-s9m5szf0.js → search-archive-5jr011gc.js} +11 -12
  82. package/dist/{search-11aw8wpq.js → search-kd84wg76.js} +25 -26
  83. package/dist/{send-session-notification-gxrj4w1r.js → send-session-notification-tfhs4dbc.js} +5 -6
  84. package/dist/shared/rpc-types.d.ts +5 -0
  85. package/dist/shared/rpc-types.d.ts.map +1 -1
  86. package/dist/shared/status-view-check.d.ts.map +1 -1
  87. package/dist/shared/status-view.d.ts +8 -0
  88. package/dist/shared/status-view.d.ts.map +1 -1
  89. package/dist/shared/transcript.d.ts +14 -0
  90. package/dist/shared/transcript.d.ts.map +1 -1
  91. package/dist/{storage-tags-jq0c0zsn.js → storage-tags-vd3sgd4s.js} +5 -6
  92. package/dist/{store-29ksp6vy.js → store-235fjtsn.js} +6 -4
  93. package/dist/{store-reader-dgh3ssxx.js → store-reader-01e8t5j0.js} +4 -1
  94. package/dist/{transform-postprocess-phase-376xn40x.js → transform-postprocess-phase-n4q1yd72.js} +33 -34
  95. package/dist/v2/auto-search-worker.js +5 -5
  96. package/dist/v2/checkpoint-instruction-status.d.ts +13 -0
  97. package/dist/v2/checkpoint-instruction-status.d.ts.map +1 -0
  98. package/dist/v2/chunk-embedding-write-worker.js +15 -16
  99. package/dist/v2/{compaction-marker-candidates-6nypmsr3.js → compaction-marker-candidates-3rxg3f1e.js} +2 -3
  100. package/dist/v2/compaction-marker-candidates-worker.js +1 -1
  101. package/dist/v2/{compartment-chunk-embedding-jthtfhcd.js → compartment-chunk-embedding-6v74y2r3.js} +7 -8
  102. package/dist/v2/{context-vm09agrs.js → context-fqeg60th.js} +392 -67
  103. package/dist/v2/{derive-budgets-wj0q7s7d.js → derive-budgets-9237wmq5.js} +5 -6
  104. package/dist/v2/embedding-backfill-dm33f3ce.js +28 -0
  105. package/dist/v2/embedding-worker-process.js +1 -2
  106. package/dist/v2/embedding-worker.js +6 -7
  107. package/dist/v2/fold/idle.d.ts +11 -1
  108. package/dist/v2/fold/idle.d.ts.map +1 -1
  109. package/dist/v2/fold/instruction-supersession.d.ts +22 -1
  110. package/dist/v2/fold/instruction-supersession.d.ts.map +1 -1
  111. package/dist/v2/fold/native-replay-v3.d.ts +1 -0
  112. package/dist/v2/fold/native-replay-v3.d.ts.map +1 -1
  113. package/dist/v2/fold/native-replay.d.ts +73 -0
  114. package/dist/v2/fold/native-replay.d.ts.map +1 -1
  115. package/dist/v2/{history-owner-8pd5ax3n.js → history-owner-k4gx50a0.js} +2 -3
  116. package/dist/v2/hooks/context.d.ts.map +1 -1
  117. package/dist/v2/{logger-58jfese9.js → logger-0ys28353.js} +1 -2
  118. package/dist/v2/{message-fts-rowid-map-ax4vk78j.js → message-fts-rowid-map-88x2zbyj.js} +4 -5
  119. package/dist/v2/{message-index-bounded-qh794qxx.js → message-index-bounded-wj5rs9az.js} +10 -11
  120. package/dist/v2/{message-time-backfill-yj773saf.js → message-time-backfill-5p4vwd79.js} +2 -3
  121. package/dist/v2/migration-worker.js +12 -13
  122. package/dist/v2/{project-embedding-registry-z05xvckg.js → project-embedding-registry-z9qxkdxm.js} +13 -14
  123. package/dist/v2/raw-ordinal-warmup-worker.js +8 -8
  124. package/dist/v2/{read-session-chunk-8tn2dbn1.js → read-session-chunk-89ep8br4.js} +8 -9
  125. package/dist/v2/{read-session-raw-ywebck9q.js → read-session-raw-seh1kcvp.js} +2 -3
  126. package/dist/v2/recomp-orchestrator-79362xbm.js +68 -0
  127. package/dist/v2/render-bzzypsgy.js +42 -0
  128. package/dist/v2/{safe-notification-target-zrwbh6k7.js → safe-notification-target-3e2rq2ys.js} +2 -3
  129. package/dist/v2/{search-35cz80x0.js → search-4f6kmq31.js} +24 -25
  130. package/dist/v2/{search-archive-5dpxv0ck.js → search-archive-4yr4hw2m.js} +11 -12
  131. package/dist/v2/{send-session-notification-8x146x5y.js → send-session-notification-vtnk598k.js} +5 -6
  132. package/dist/v2/{server-vj0xbbrc.js → server-0b3ms151.js} +2 -2
  133. package/dist/v2/{server-ppy2dj7g.js → server-1bks09js.js} +5 -5
  134. package/dist/v2/{server-63ree5ns.js → server-2xng77ch.js} +1 -1
  135. package/dist/v2/{server-2sare4qg.js → server-3mb205v9.js} +4 -4
  136. package/dist/v2/{server-n34vzyfm.js → server-3qeqa3b6.js} +1 -1
  137. package/dist/v2/{server-ganavh75.js → server-4ccgfzr2.js} +2 -2
  138. package/dist/v2/{server-av3p9c8k.js → server-54nc921b.js} +1 -1
  139. package/dist/v2/{server-2qvnr3t7.js → server-5zx51pm4.js} +1 -1
  140. package/dist/v2/{server-vsx9tsks.js → server-62t1852h.js} +11 -11
  141. package/dist/v2/{server-svccj9rd.js → server-6mq43ear.js} +4 -4
  142. package/dist/v2/{server-z2nv8jdv.js → server-70dhx58s.js} +12 -12
  143. package/dist/v2/{server-db91dxwc.js → server-7861dnm3.js} +6 -6
  144. package/dist/v2/{server-6qax5pds.js → server-7c5p0bh1.js} +2 -2
  145. package/dist/v2/{server-11ra1pmx.js → server-8xgs110k.js} +4 -4
  146. package/dist/v2/{server-40vdz8sf.js → server-98xd6j4r.js} +2 -2
  147. package/dist/v2/{server-nnh81jqy.js → server-b38pxt0e.js} +6 -8
  148. package/dist/v2/{server-k3ntgf6n.js → server-b5eg9ct6.js} +2 -2
  149. package/dist/v2/{server-2cq3e1c1.js → server-b65sqz7y.js} +4 -4
  150. package/dist/v2/{server-4yrvbnnm.js → server-bzebqckc.js} +2 -2
  151. package/dist/v2/{server-rt8t6s2a.js → server-cc58mckk.js} +2 -2
  152. package/dist/v2/{server-pcq2d1wh.js → server-d0h1gjz2.js} +6 -6
  153. package/dist/v2/{server-73bqw5c0.js → server-d46xewmt.js} +1 -1
  154. package/dist/v2/{server-rr5c0xcg.js → server-d4h86y7v.js} +2 -2
  155. package/dist/v2/{server-7tj8yzrv.js → server-e14d7ebh.js} +2 -2
  156. package/dist/v2/{server-gh2w75fn.js → server-e8ybwfv8.js} +3 -3
  157. package/dist/v2/{server-zemnpv92.js → server-ghk96d57.js} +4 -4
  158. package/dist/v2/{server-j1gxs1gj.js → server-h95cdc30.js} +1 -1
  159. package/dist/v2/{server-5t4nzfpt.js → server-j09jx1n9.js} +1 -1
  160. package/dist/v2/{server-n33hyq9t.js → server-jrs4gny6.js} +2 -2
  161. package/dist/v2/{server-z5cv5wm5.js → server-md1cabvq.js} +9 -11
  162. package/dist/v2/{server-7h4gwphm.js → server-pqgnjf38.js} +3 -3
  163. package/dist/v2/{server-379fd3n7.js → server-rbxtp4sm.js} +1 -1
  164. package/dist/v2/{server-2wz6y46g.js → server-sfffm587.js} +1 -1
  165. package/dist/v2/{server-w35ep6wn.js → server-tk4hpcxq.js} +24 -26
  166. package/dist/v2/{server-bx5k66qc.js → server-vgy98kcd.js} +1 -1
  167. package/dist/v2/{server-kzrrdjp5.js → server-xc7t2r4k.js} +223 -5
  168. package/dist/v2/{server-tq523gj6.js → server-yacpgq4s.js} +1 -1
  169. package/dist/v2/{server-vtkbxzw1.js → server-ysg14rv1.js} +31 -0
  170. package/dist/v2/{server-vntc961c.js → server-zedjjdc5.js} +14 -12
  171. package/dist/v2/server.js +8 -9
  172. package/dist/v2/{storage-tags-pcenytad.js → storage-tags-8kktww54.js} +5 -6
  173. package/dist/v2/{store-gx19qc3a.js → store-0kjfynwp.js} +6 -4
  174. package/dist/v2/{store-reader-qt2msa8z.js → store-reader-w0srb18d.js} +4 -1
  175. package/dist/v2/store-reader.d.ts +1 -0
  176. package/dist/v2/store-reader.d.ts.map +1 -1
  177. package/dist/v2/tui/index.d.ts +1 -1
  178. package/dist/v2/tui/index.d.ts.map +1 -1
  179. package/dist/v2/{v2-archive-reader-jqrwz7b8.js → v2-archive-reader-veyqp15a.js} +1 -1
  180. package/dist/v2/{wrapup-orchestrator-kcq3cv7y.js → wrapup-orchestrator-97s5wznb.js} +33 -34
  181. package/dist/{v2-archive-reader-64h2gtam.js → v2-archive-reader-3s332fn7.js} +1 -1
  182. package/dist/wrapup-orchestrator-bm0x49e5.js +55 -0
  183. package/package.json +2 -2
  184. package/src/shared/rpc-types.ts +6 -0
  185. package/src/shared/status-view-check.ts +11 -0
  186. package/src/shared/status-view.ts +24 -1
  187. package/src/shared/tag-transcript.ts +61 -10
  188. package/src/shared/test-preload-leak-scan.test.ts +56 -0
  189. package/src/shared/transcript.ts +16 -0
  190. package/src/v2/tui/index.ts +8 -1
  191. package/src/v2/tui/status-dialog-fallback.test.ts +21 -0
  192. package/dist/embedding-backfill-pdymqbnh.js +0 -29
  193. package/dist/index-dt7cyqfe.js +0 -223
  194. package/dist/render-6cf1dgc4.js +0 -43
  195. package/dist/v2/embedding-backfill-16b16m38.js +0 -29
  196. package/dist/v2/recomp-orchestrator-pfjpzdrb.js +0 -69
  197. package/dist/v2/render-7t5d7hkv.js +0 -43
  198. package/dist/v2/server-dt7cyqfe.js +0 -223
  199. package/dist/wrapup-orchestrator-knyac7jp.js +0 -56
@@ -164,7 +164,7 @@ import {
164
164
  adoptNullOwnerToolTag2,
165
165
  getCandidateToolOwners2,
166
166
  pickNearestPriorOwner2
167
- } from "./index-w7n7qkpf.js";
167
+ } from "./index-w6kcwhhj.js";
168
168
  import {
169
169
  getHarness2
170
170
  } from "./index-pavzsdc6.js";
@@ -172,12 +172,12 @@ import {
172
172
  getMagicContextStorageDir,
173
173
  log2,
174
174
  sessionLog2
175
- } from "./index-3fhb0j32.js";
175
+ } from "./index-34xvre52.js";
176
176
  import {
177
177
  textMentionsRecentCommit,
178
178
  hasMeaningfulUserText2,
179
179
  estimateTokens
180
- } from "./index-zfx7mtqa.js";
180
+ } from "./index-2m3t73wk.js";
181
181
  import {
182
182
  inRootAsyncContext2,
183
183
  getTagIdentityWriteGeneration2,
@@ -193,7 +193,7 @@ import {
193
193
  } from "./index-1d042x6w.js";
194
194
  import {
195
195
  runSessionWarmupWorker
196
- } from "./index-hedgz8an.js";
196
+ } from "./index-jsbgw33b.js";
197
197
  import {
198
198
  getMaxM0MutationId,
199
199
  getLastCompartmentEndMessage,
@@ -218,11 +218,11 @@ import {
218
218
  saveSourceContent,
219
219
  replaceSourceContent,
220
220
  getSourceContents
221
- } from "./index-gnrwgvn7.js";
221
+ } from "./index-em72jhc0.js";
222
222
  import {
223
223
  cleanSearchText,
224
224
  matchedSearchSnippet
225
- } from "./index-89bkkgcn.js";
225
+ } from "./index-tyjx0dwz.js";
226
226
  import {
227
227
  BoundedSessionMap,
228
228
  tagRevisionKey,
@@ -230,7 +230,7 @@ import {
230
230
  getTemporalDecisions,
231
231
  freezeTemporalDecisions,
232
232
  stableStringify
233
- } from "./index-cpbr0xvk.js";
233
+ } from "./index-xtv4d4hv.js";
234
234
  import {
235
235
  isValidLanguageCode,
236
236
  resolveModelConfigValue,
@@ -242,7 +242,7 @@ import {
242
242
  withReadOnlySessionDb,
243
243
  getMessageTimesFromOpenCodeDb,
244
244
  findLastAssistantModelFromOpenCodeDb
245
- } from "./index-k34hc455.js";
245
+ } from "./index-vdzd98ry.js";
246
246
  import {
247
247
  stripSystemInjection,
248
248
  isTextPart,
@@ -255,30 +255,30 @@ import {
255
255
  extractToolCallObservation,
256
256
  ToolMutationBatch,
257
257
  createToolDropTarget
258
- } from "./index-hp46xe93.js";
258
+ } from "./index-8hhmv0ff.js";
259
259
  import {
260
260
  hasTrustedAbsoluteWall,
261
261
  applyProvenInputFloor,
262
262
  isSaneLimit,
263
263
  getSdkWindowGeometry,
264
264
  getSdkContextLimit
265
- } from "./index-45qgkg8j.js";
265
+ } from "./index-h1qh9n8b.js";
266
266
  import {
267
267
  getProjectEmbeddingSnapshot2,
268
268
  embedTextForProject2,
269
269
  embedBatchForProject2
270
- } from "./index-7m2tnk8q.js";
270
+ } from "./index-z1mj8fv5.js";
271
271
  import {
272
272
  isEmbeddingHostBusy2
273
273
  } from "./index-qt1qqasc.js";
274
274
  import {
275
275
  userFacingFailureCode
276
- } from "./index-910gahfb.js";
276
+ } from "./index-db1art1p.js";
277
277
  import {
278
278
  getMessageIndexEpoch,
279
279
  isMessageIndexSearchable,
280
280
  createAutoSearchDiagnostics
281
- } from "./index-9jvxq5rt.js";
281
+ } from "./index-h1xvt8fw.js";
282
282
  import {
283
283
  compareOpenCodeMessagesByCanonicalOrder,
284
284
  startCompactionMarkerCandidatePreparation,
@@ -300,7 +300,7 @@ import {
300
300
  peekNoteNudgeText,
301
301
  markNoteNudgeDelivered,
302
302
  getActiveCompartmentRun
303
- } from "./index-nqdwpdje.js";
303
+ } from "./index-p52gf8a6.js";
304
304
  import {
305
305
  canonicalModelIdentity,
306
306
  piModelRefToCanonical,
@@ -311,7 +311,7 @@ import {
311
311
  } from "./index-y8v6yerm.js";
312
312
  import {
313
313
  logSlowWriteTransaction
314
- } from "./index-tqtpgnhr.js";
314
+ } from "./index-9awtk18w.js";
315
315
 
316
316
  // src/shared/model-cache-ttl.ts
317
317
  var MODEL_CACHE_LIFETIMES = [
@@ -4707,6 +4707,8 @@ function planNewToolDrop(target, options, prepare, plannedRemovals) {
4707
4707
  })
4708
4708
  };
4709
4709
  }
4710
+ if (prepare && target.prepareRemoval?.() === false)
4711
+ return;
4710
4712
  return {
4711
4713
  mode: "full",
4712
4714
  apply: () => {
@@ -4773,7 +4775,6 @@ function prepareLegacyToolSkeletonConversions(db, sessionId, targets, options =
4773
4775
  });
4774
4776
  };
4775
4777
  const rows = readRows(db);
4776
- options.prepareRemovals?.(rows);
4777
4778
  const converted = new Map;
4778
4779
  for (const row of rows) {
4779
4780
  const target = targets.get(row.tagNumber);
@@ -4792,6 +4793,7 @@ function prepareLegacyToolSkeletonConversions(db, sessionId, targets, options =
4792
4793
  }
4793
4794
  converted.set(row.tagNumber, mode);
4794
4795
  }
4796
+ options.prepareRemovals?.(rows.filter((row) => converted.get(row.tagNumber) !== "skeleton_real"));
4795
4797
  return {
4796
4798
  converted,
4797
4799
  isCurrent: (connection) => {
@@ -4830,7 +4832,6 @@ function prepareAgedToolSkeletonConversions(db, sessionId, targets, options = {}
4830
4832
  return { window, rows };
4831
4833
  };
4832
4834
  const snapshot = readRows(db);
4833
- options.prepareRemovals?.(snapshot.rows);
4834
4835
  const converted = new Map;
4835
4836
  const plannedRemovals = new Set;
4836
4837
  for (const row of snapshot.rows) {
@@ -4849,6 +4850,13 @@ function prepareAgedToolSkeletonConversions(db, sessionId, targets, options = {}
4849
4850
  converted.set(row.tagNumber, "full");
4850
4851
  target.notePlannedRemoval?.(plannedRemovals);
4851
4852
  }
4853
+ const retired = snapshot.rows.filter((row) => converted.has(row.tagNumber));
4854
+ options.prepareRemovals?.(retired);
4855
+ for (const row of retired) {
4856
+ const target = targets.get(row.tagNumber);
4857
+ if (target?.prepareRemoval?.() === false)
4858
+ converted.delete(row.tagNumber);
4859
+ }
4852
4860
  return {
4853
4861
  converted,
4854
4862
  isCurrent: (connection) => JSON.stringify(readRows(connection)) === JSON.stringify(snapshot),
@@ -4,13 +4,13 @@ import {
4
4
  import {
5
5
  importPluginModule,
6
6
  sessionLog2
7
- } from "./index-3fhb0j32.js";
7
+ } from "./index-34xvre52.js";
8
8
  import {
9
9
  isDefaultSessionTitle2
10
- } from "./index-jzrvdqb8.js";
10
+ } from "./index-y5f5yg5a.js";
11
11
  import {
12
12
  shouldHoldIgnoredNotification
13
- } from "./index-k34hc455.js";
13
+ } from "./index-vdzd98ry.js";
14
14
  import {
15
15
  getErrorMessage
16
16
  } from "./index-y8v6yerm.js";
@@ -142,7 +142,7 @@ async function sendIgnoredMessageNow(client, sessionId, text, params, forcePersi
142
142
  holdIgnoredNotification({ client, sessionId, text, params, forcePersist }, "during target checks");
143
143
  return "queued";
144
144
  }
145
- const { waitForSafeNotificationTarget } = await importPluginModule(() => import("./safe-notification-target-54ns7dv9.js"));
145
+ const { waitForSafeNotificationTarget } = await importPluginModule(() => import("./safe-notification-target-01j8km9e.js"));
146
146
  if (await waitForSafeNotificationTarget(client, sessionId) === "skip") {
147
147
  sessionLog2(sessionId, "notification skipped (session not titled yet)");
148
148
  return "skipped";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  importPluginModule,
3
3
  log2
4
- } from "./index-3fhb0j32.js";
4
+ } from "./index-34xvre52.js";
5
5
  import {
6
6
  sendStatusNotification2
7
- } from "./index-kj4bprep.js";
7
+ } from "./index-61a853ky.js";
8
8
  import {
9
9
  formatConflictShort
10
- } from "./index-0ve29s6f.js";
10
+ } from "./index-hbqxxb2n.js";
11
11
 
12
12
  // src/plugin/conflict-warning-hook.ts
13
13
  import { existsSync, readFileSync } from "node:fs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  sessionLog2
3
- } from "./index-3fhb0j32.js";
3
+ } from "./index-34xvre52.js";
4
4
  import {
5
5
  stripTagPrefix,
6
6
  isRecord,
@@ -9,7 +9,7 @@ import {
9
9
  estimateMessageTokens,
10
10
  getCandidateToolOwners2,
11
11
  pickNearestPriorOwner2
12
- } from "./index-w7n7qkpf.js";
12
+ } from "./index-w6kcwhhj.js";
13
13
  import {
14
14
  OMO_INTERNAL_INITIATOR_MARKER,
15
15
  isSystemDirective,
@@ -24,10 +24,10 @@ import {
24
24
  formatBlock,
25
25
  compactTextForSummary,
26
26
  mergeCommitHashes
27
- } from "./index-zfx7mtqa.js";
27
+ } from "./index-2m3t73wk.js";
28
28
  import {
29
29
  stableStringify
30
- } from "./index-cpbr0xvk.js";
30
+ } from "./index-xtv4d4hv.js";
31
31
  import {
32
32
  renderToolTemplate
33
33
  } from "./index-r3f85n7y.js";
@@ -47,13 +47,13 @@ import {
47
47
  readRawSeedTailFromDb2,
48
48
  readRawSessionBoundaryEndpointsFromDb2,
49
49
  prewarmRawSessionOrdinalsForDb
50
- } from "./index-hedgz8an.js";
50
+ } from "./index-jsbgw33b.js";
51
51
  import {
52
52
  openCodeDbExists,
53
53
  withReadOnlySessionDb,
54
54
  getRawSessionMessageCountFromDb,
55
55
  getMessageTimesFromOpenCodeDb
56
- } from "./index-k34hc455.js";
56
+ } from "./index-vdzd98ry.js";
57
57
  import {
58
58
  markHostUnservedRow,
59
59
  isHostUnservedRow
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  sanitizeDiagnosticText
3
- } from "./index-dt7cyqfe.js";
3
+ } from "./index-34xvre52.js";
4
4
 
5
5
  // src/features/magic-context/fail-closed-block.ts
6
6
  var FAIL_CLOSED_DOCTOR_COMMAND = "npx @cortexkit/magic-context@latest doctor";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  log2
3
- } from "./index-3fhb0j32.js";
3
+ } from "./index-34xvre52.js";
4
4
 
5
5
  // src/shared/write-transaction-timing.ts
6
6
  var SLOW_WRITE_TRANSACTION_THRESHOLD_MS = 1000;
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  estimateTokens
3
- } from "./index-zfx7mtqa.js";
3
+ } from "./index-2m3t73wk.js";
4
4
  import {
5
5
  getTagById2
6
- } from "./index-w7n7qkpf.js";
6
+ } from "./index-w6kcwhhj.js";
7
7
  import {
8
8
  expandToolPart,
9
9
  visitRawSessionMessages2,
10
10
  readRawSessionMessageById2
11
- } from "./index-hp46xe93.js";
11
+ } from "./index-8hhmv0ff.js";
12
12
 
13
13
  // src/tools/ctx-expand/render.ts
14
14
  import { createHash } from "node:crypto";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  sessionLog2
3
- } from "./index-3fhb0j32.js";
3
+ } from "./index-34xvre52.js";
4
4
  import {
5
5
  COMPARTMENT_LEASE_RENEWAL_MS,
6
6
  acquireCompartmentLease,
@@ -9,7 +9,7 @@ import {
9
9
  getCompartments,
10
10
  getLastCompartmentEndMessage,
11
11
  requestPendingMaterialization
12
- } from "./index-gnrwgvn7.js";
12
+ } from "./index-em72jhc0.js";
13
13
  import {
14
14
  inRootAsyncContext2
15
15
  } from "./index-gzy5w8ya.js";
@@ -20,10 +20,10 @@ import {
20
20
  releaseWrapupInProgress,
21
21
  getHistorianFailureState,
22
22
  clearEmergencyRecovery
23
- } from "./index-w7n7qkpf.js";
23
+ } from "./index-w6kcwhhj.js";
24
24
  import {
25
25
  prepareRawSessionOrdinals2
26
- } from "./index-hp46xe93.js";
26
+ } from "./index-8hhmv0ff.js";
27
27
  import {
28
28
  pushNotification2
29
29
  } from "./index-y14pawe1.js";
@@ -35,14 +35,14 @@ import {
35
35
  getActiveCompartmentRun,
36
36
  markActiveCompartmentRunPublished,
37
37
  registerActiveCompartmentRun
38
- } from "./index-nqdwpdje.js";
38
+ } from "./index-p52gf8a6.js";
39
39
  import {
40
40
  sendStatusNotification2
41
- } from "./index-kj4bprep.js";
41
+ } from "./index-61a853ky.js";
42
42
  import {
43
43
  setRecompStarting2,
44
44
  setRecompTerminal2
45
- } from "./index-t2e10rag.js";
45
+ } from "./index-k86ec4j2.js";
46
46
 
47
47
  // src/hooks/magic-context/wrapup-orchestrator.ts
48
48
  import * as crypto from "node:crypto";
@@ -6,7 +6,7 @@ import {
6
6
  } from "./index-gzy5w8ya.js";
7
7
  import {
8
8
  managedAuthorityNoteRow
9
- } from "./index-dnpcv1rg.js";
9
+ } from "./index-hyvxmz3e.js";
10
10
 
11
11
  // src/features/magic-context/storage-notes.ts
12
12
  var NOTE_TYPES = new Set(["session", "smart"]);
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  log2
3
- } from "./index-3fhb0j32.js";
3
+ } from "./index-34xvre52.js";
4
4
  import {
5
5
  canonicalProjectDirectory
6
6
  } from "./index-knvkbfvh.js";
@@ -5,6 +5,9 @@ import {
5
5
  import {
6
6
  Database2
7
7
  } from "./index-gzy5w8ya.js";
8
+ import {
9
+ estimateTokens
10
+ } from "./index-2m3t73wk.js";
8
11
  import {
9
12
  sameProjectDirectory
10
13
  } from "./index-knvkbfvh.js";
@@ -14,6 +17,31 @@ import { createHash } from "node:crypto";
14
17
  import { statSync } from "node:fs";
15
18
  import { hostname } from "node:os";
16
19
  import { resolve } from "node:path";
20
+
21
+ // src/v2/checkpoint-instruction-status.ts
22
+ function estimateRows(rows) {
23
+ let rowsCount = 0;
24
+ let tokens = 0;
25
+ for (const row of rows) {
26
+ const { text, metadata } = JSON.parse(row.data);
27
+ const sources = metadata?.instructionSources;
28
+ if (metadata?.notice !== "instructions" || !Array.isArray(sources) || sources.length === 0 || !sources.every((source) => typeof source === "string" && source.length > 0) || typeof text !== "string")
29
+ continue;
30
+ rowsCount++;
31
+ tokens += estimateTokens(text);
32
+ }
33
+ return { rows: rowsCount, tokens };
34
+ }
35
+ function readCheckpointInstructionEstimate(db, sessionID) {
36
+ return estimateRows(db.prepare(`SELECT data FROM session_message
37
+ WHERE session_id = ? AND type = 'system' AND seq > COALESCE((
38
+ SELECT seq FROM session_message WHERE session_id = ? AND type = 'compaction'
39
+ AND CASE WHEN json_valid(data) THEN json_extract(data, '$.status') END = 'completed'
40
+ ORDER BY seq DESC LIMIT 1
41
+ ), -1) ORDER BY seq`).iterate(sessionID, sessionID));
42
+ }
43
+
44
+ // src/v2/store-reader.ts
17
45
  function gaDatabasePath2(dataHome, channel = "latest", env = process.env) {
18
46
  return resolveOpenCodeDbPath("v2", { dataHome, channel, env }).path;
19
47
  }
@@ -734,6 +762,9 @@ class V2StoreReader2 {
734
762
  ORDER BY seq ASC`).all(sessionID, throughSeq).map(decode);
735
763
  });
736
764
  }
765
+ checkpointInstructionEstimate(sessionID) {
766
+ return readCheckpointInstructionEstimate(this.db, sessionID);
767
+ }
737
768
  sequenceForId(sessionID, id) {
738
769
  if (!id)
739
770
  return;
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  getMagicContextStorageDir
3
- } from "./index-3fhb0j32.js";
3
+ } from "./index-34xvre52.js";
4
4
  import {
5
5
  ensureStorageDirectorySync,
6
6
  writeStorageFileAtomicSync
7
- } from "./index-6mryx739.js";
7
+ } from "./index-t7st85f5.js";
8
8
 
9
9
  // src/hooks/auto-update-checker/semver.ts
10
10
  function isValidSemver(version) {
@@ -1,6 +1,7 @@
1
1
  import {
2
- sanitizeDiagnosticText
3
- } from "./index-dt7cyqfe.js";
2
+ sanitizeDiagnosticText,
3
+ sessionLog2
4
+ } from "./index-34xvre52.js";
4
5
  import {
5
6
  PROMOTABLE_CATEGORIES,
6
7
  CATEGORY_DEFAULT_TTL
@@ -8,20 +9,17 @@ import {
8
9
  import {
9
10
  DEFAULT_LOCAL_EMBEDDING_MODEL
10
11
  } from "./index-r3f85n7y.js";
11
- import {
12
- sessionLog2
13
- } from "./index-3fhb0j32.js";
14
12
  import {
15
13
  isSynapseEmbeddingTruncated,
16
14
  SynapseEmbeddingProvider
17
- } from "./index-fgw241hh.js";
15
+ } from "./index-gcf2x04k.js";
18
16
  import {
19
17
  LocalEmbeddingProvider
20
- } from "./index-r1d45dsr.js";
18
+ } from "./index-nyjztqyj.js";
21
19
  import {
22
20
  OpenAICompatibleEmbeddingProvider,
23
21
  embedTextForProject2
24
- } from "./index-7m2tnk8q.js";
22
+ } from "./index-z1mj8fv5.js";
25
23
  import {
26
24
  saveEmbeddingIfHashMatches
27
25
  } from "./index-qjwpqvnf.js";
@@ -7,7 +7,7 @@ import {
7
7
  deleteTagIdentityRevisions,
8
8
  getTableColumnNames,
9
9
  getMeasuredToolDefinitionTokens
10
- } from "./index-cpbr0xvk.js";
10
+ } from "./index-xtv4d4hv.js";
11
11
  import {
12
12
  invalidateAutoEmbedSession,
13
13
  drainBackgroundBatches
@@ -20,7 +20,7 @@ import {
20
20
  getMagicContextStorageDir,
21
21
  log2,
22
22
  sessionLog2
23
- } from "./index-3fhb0j32.js";
23
+ } from "./index-34xvre52.js";
24
24
  import {
25
25
  prepareCachedStatement2,
26
26
  withSqliteBackgroundWriter2,
@@ -28,14 +28,14 @@ import {
28
28
  } from "./index-gzy5w8ya.js";
29
29
  import {
30
30
  deleteUnmappedMessageFtsRows2
31
- } from "./index-89xg64wb.js";
31
+ } from "./index-geph2sa6.js";
32
32
  import {
33
33
  deleteChunkEmbedBackoffForSession2
34
- } from "./index-j4dcjb8t.js";
34
+ } from "./index-1vv1ka4a.js";
35
35
  import {
36
36
  isPidAlive,
37
37
  readProcessStartTime
38
- } from "./index-3n4j5rqc.js";
38
+ } from "./index-abhmtj00.js";
39
39
  import {
40
40
  stripTagPrefix,
41
41
  isRecord,
@@ -68,25 +68,25 @@ import {
68
68
  getPendingPiCompactionMarkerState,
69
69
  logPiCompactionMarkerClear,
70
70
  isPrefixBoundThinkingModel
71
- } from "./index-w7n7qkpf.js";
71
+ } from "./index-w6kcwhhj.js";
72
72
  import {
73
73
  withReadOnlySessionDb
74
- } from "./index-k34hc455.js";
74
+ } from "./index-vdzd98ry.js";
75
75
  import {
76
76
  layoutLkgPrefix,
77
77
  assembleLkgPrefix
78
- } from "./index-dnpcv1rg.js";
78
+ } from "./index-hyvxmz3e.js";
79
79
  import {
80
80
  ensurePrivateStorageDirectorySync,
81
81
  writeStorageFileSync,
82
82
  writeStorageFileAtomicSync,
83
83
  syncStorageDirectorySync,
84
84
  writeStorageFileDurableAtomicSync
85
- } from "./index-6mryx739.js";
85
+ } from "./index-t7st85f5.js";
86
86
  import {
87
87
  gaDatabasePath2,
88
88
  V2StoreReader2
89
- } from "./index-tr4ep2ej.js";
89
+ } from "./index-ajmy0v5j.js";
90
90
  import {
91
91
  markHostInstructionRow,
92
92
  hostInstructionRowID,
@@ -99,7 +99,7 @@ import {
99
99
  } from "./index-avwt563y.js";
100
100
  import {
101
101
  logSlowWriteTransaction
102
- } from "./index-tqtpgnhr.js";
102
+ } from "./index-9awtk18w.js";
103
103
 
104
104
  // src/features/magic-context/session-activity.ts
105
105
  var PREFIX = "retrospective_activity:";
@@ -4501,8 +4501,10 @@ function decodePiContentDecision(value) {
4501
4501
  var NATIVE_TOOL_INPUTS = "native tool inputs";
4502
4502
  var NATIVE_REASONING_IDS = "native reasoning ids";
4503
4503
  var nativeWriteBarriers = new WeakMap;
4504
+ class PersistedReplayStateError extends Error {
4505
+ }
4504
4506
  function invalidPersistedReplayState(lane, sessionId) {
4505
- return new Error(`invalid persisted ${lane} state for session ${sessionId}`);
4507
+ return new PersistedReplayStateError(`invalid persisted ${lane} state for session ${sessionId}`);
4506
4508
  }
4507
4509
  function assertNonEmptyId(value, lane, sessionId) {
4508
4510
  if (typeof value !== "string" || value.length === 0) {
@@ -3,10 +3,10 @@ import {
3
3
  } from "./index-pavzsdc6.js";
4
4
  import {
5
5
  isUserHomeDirectory
6
- } from "./index-hj78hvhm.js";
6
+ } from "./index-vegw385y.js";
7
7
  import {
8
8
  logSlowWriteTransaction
9
- } from "./index-tqtpgnhr.js";
9
+ } from "./index-9awtk18w.js";
10
10
 
11
11
  // src/features/magic-context/session-project-storage.ts
12
12
  var SESSION_CHUNK_REPAIR_BATCH_SIZE = 100;
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  estimateTokens
3
- } from "./index-zfx7mtqa.js";
3
+ } from "./index-2m3t73wk.js";
4
4
  import {
5
5
  getHarness2
6
6
  } from "./index-pavzsdc6.js";
7
7
  import {
8
8
  log2
9
- } from "./index-3fhb0j32.js";
9
+ } from "./index-34xvre52.js";
10
10
  import {
11
11
  inRootAsyncContext2
12
12
  } from "./index-gzy5w8ya.js";
@@ -5,10 +5,10 @@ import {
5
5
  } from "./index-gzy5w8ya.js";
6
6
  import {
7
7
  runSessionWarmupWorker
8
- } from "./index-hedgz8an.js";
8
+ } from "./index-jsbgw33b.js";
9
9
  import {
10
10
  logSlowWriteTransaction
11
- } from "./index-tqtpgnhr.js";
11
+ } from "./index-9awtk18w.js";
12
12
 
13
13
  // src/features/magic-context/message-fts-rowid-map.ts
14
14
  import { createHash } from "node:crypto";
@@ -5,10 +5,10 @@ import {
5
5
  getMagicContextStorageDir,
6
6
  log2,
7
7
  sessionLog2
8
- } from "./index-3fhb0j32.js";
8
+ } from "./index-34xvre52.js";
9
9
  import {
10
10
  writeStorageFileAtomicSync
11
- } from "./index-6mryx739.js";
11
+ } from "./index-t7st85f5.js";
12
12
  import {
13
13
  localBudget,
14
14
  calibrationForModelKey
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  log2,
6
6
  sessionLog2
7
- } from "./index-3fhb0j32.js";
7
+ } from "./index-34xvre52.js";
8
8
  import {
9
9
  inRootAsyncContext2,
10
10
  getSqliteDatabasePath2,
@@ -13,10 +13,10 @@ import {
13
13
  } from "./index-gzy5w8ya.js";
14
14
  import {
15
15
  runSessionWarmupWorker
16
- } from "./index-hedgz8an.js";
16
+ } from "./index-jsbgw33b.js";
17
17
  import {
18
18
  scheduleAfterBootQuiet
19
- } from "./index-hj78hvhm.js";
19
+ } from "./index-vegw385y.js";
20
20
  import {
21
21
  cleanSearchText,
22
22
  hintKeywordRelevance,
@@ -28,7 +28,7 @@ import {
28
28
  clearIndexedMessages,
29
29
  indexSingleMessage,
30
30
  indexMessagesAfterOrdinal
31
- } from "./index-89bkkgcn.js";
31
+ } from "./index-tyjx0dwz.js";
32
32
 
33
33
  // src/features/magic-context/message-index-async.ts
34
34
  var indexCancellations = new Map;
@@ -3,7 +3,7 @@ import {
3
3
  } from "./index-sd3egckz.js";
4
4
  import {
5
5
  log2
6
- } from "./index-3fhb0j32.js";
6
+ } from "./index-34xvre52.js";
7
7
 
8
8
  // src/shared/conflict-detector.ts
9
9
  import { homedir as homedir2 } from "node:os";