@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
@@ -1,9 +1,8 @@
1
1
  import"./server-pavzsdc6.js";
2
2
  import {
3
3
  sessionLog2
4
- } from "./server-kzrrdjp5.js";
5
- import"./server-dt7cyqfe.js";
6
- import"./server-2wz6y46g.js";
4
+ } from "./server-xc7t2r4k.js";
5
+ import"./server-sfffm587.js";
7
6
  import {
8
7
  COMPARTMENT_LEASE_RENEWAL_MS,
9
8
  acquireCompartmentLease,
@@ -12,20 +11,20 @@ import {
12
11
  getCompartments,
13
12
  getLastCompartmentEndMessage,
14
13
  requestPendingMaterialization
15
- } from "./server-vntc961c.js";
14
+ } from "./server-zedjjdc5.js";
16
15
  import"./server-2amn2s73.js";
17
- import"./server-73bqw5c0.js";
18
- import"./server-k3ntgf6n.js";
16
+ import"./server-d46xewmt.js";
17
+ import"./server-b5eg9ct6.js";
19
18
  import {
20
19
  inRootAsyncContext2
21
20
  } from "./server-gzy5w8ya.js";
22
21
  import"./server-v0p37hm2.js";
23
22
  import"./server-96ztjvkn.js";
24
23
  import"./server-1d042x6w.js";
25
- import"./server-av3p9c8k.js";
26
- import"./server-40vdz8sf.js";
27
- import"./server-zemnpv92.js";
28
- import"./server-svccj9rd.js";
24
+ import"./server-54nc921b.js";
25
+ import"./server-98xd6j4r.js";
26
+ import"./server-ghk96d57.js";
27
+ import"./server-6mq43ear.js";
29
28
  import {
30
29
  getWrapupInProgressState,
31
30
  acquireWrapupInProgress,
@@ -33,28 +32,28 @@ import {
33
32
  releaseWrapupInProgress,
34
33
  getHistorianFailureState,
35
34
  clearEmergencyRecovery
36
- } from "./server-11ra1pmx.js";
37
- import"./server-4yrvbnnm.js";
38
- import"./server-vsx9tsks.js";
35
+ } from "./server-8xgs110k.js";
36
+ import"./server-bzebqckc.js";
37
+ import"./server-62t1852h.js";
39
38
  import"./server-1zx87sdm.js";
40
39
  import"./server-arfzfxe8.js";
41
40
  import"./server-2ra6pwf3.js";
42
- import"./server-bx5k66qc.js";
41
+ import"./server-vgy98kcd.js";
43
42
  import {
44
43
  prepareRawSessionOrdinals2
45
- } from "./server-db91dxwc.js";
44
+ } from "./server-7861dnm3.js";
46
45
  import"./server-fr0wbhdn.js";
47
- import"./server-2sare4qg.js";
48
- import"./server-n34vzyfm.js";
49
- import"./server-n33hyq9t.js";
50
- import"./server-vtkbxzw1.js";
46
+ import"./server-3mb205v9.js";
47
+ import"./server-3qeqa3b6.js";
48
+ import"./server-jrs4gny6.js";
49
+ import"./server-ysg14rv1.js";
51
50
  import"./server-fb3zxn06.js";
52
- import"./server-2qvnr3t7.js";
53
- import"./server-5t4nzfpt.js";
51
+ import"./server-5zx51pm4.js";
52
+ import"./server-j09jx1n9.js";
54
53
  import {
55
54
  pushNotification2
56
55
  } from "./server-y14pawe1.js";
57
- import"./server-379fd3n7.js";
56
+ import"./server-rbxtp4sm.js";
58
57
  import {
59
58
  describeBoundaryDiagnostics,
60
59
  resolveWrapupProtectedTailBoundary,
@@ -65,24 +64,24 @@ import {
65
64
  registerActiveCompartmentRun,
66
65
  setRecompStarting2,
67
66
  setRecompTerminal2
68
- } from "./server-w35ep6wn.js";
67
+ } from "./server-tk4hpcxq.js";
69
68
  import"./server-qt1qqasc.js";
70
- import"./server-z5cv5wm5.js";
71
- import"./server-6qax5pds.js";
69
+ import"./server-md1cabvq.js";
70
+ import"./server-7c5p0bh1.js";
72
71
  import"./server-qjwpqvnf.js";
73
- import"./server-7h4gwphm.js";
74
- import"./server-nnh81jqy.js";
75
- import"./server-ganavh75.js";
72
+ import"./server-pqgnjf38.js";
73
+ import"./server-b38pxt0e.js";
74
+ import"./server-4ccgfzr2.js";
76
75
  import"./server-9emdjcb5.js";
77
- import"./server-vj0xbbrc.js";
78
- import"./server-rr5c0xcg.js";
76
+ import"./server-0b3ms151.js";
77
+ import"./server-d4h86y7v.js";
79
78
  import"./server-n5wn7d9b.js";
80
- import"./server-rt8t6s2a.js";
81
- import"./server-63ree5ns.js";
79
+ import"./server-cc58mckk.js";
80
+ import"./server-2xng77ch.js";
82
81
  import {
83
82
  sendStatusNotification2
84
- } from "./server-2cq3e1c1.js";
85
- import"./server-tq523gj6.js";
83
+ } from "./server-b65sqz7y.js";
84
+ import"./server-yacpgq4s.js";
86
85
 
87
86
  // src/hooks/magic-context/wrapup-orchestrator.ts
88
87
  import * as crypto from "node:crypto";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  readV2ArchiveOffThread2,
3
3
  serveV2ArchiveReads2
4
- } from "./index-2afrmgy3.js";
4
+ } from "./index-xbna9akt.js";
5
5
  import"./index-v0p37hm2.js";
6
6
  import"./index-gzy5w8ya.js";
7
7
  import"./index-1d042x6w.js";
@@ -0,0 +1,55 @@
1
+ import {
2
+ runManagedWrapup2
3
+ } from "./index-a1295271.js";
4
+ import"./index-k86ec4j2.js";
5
+ import"./index-p52gf8a6.js";
6
+ import"./index-qxzk5s30.js";
7
+ import"./index-sd3egckz.js";
8
+ import"./index-db1art1p.js";
9
+ import"./index-04zhtsb1.js";
10
+ import"./index-9emdjcb5.js";
11
+ import"./index-z1mj8fv5.js";
12
+ import"./index-qjwpqvnf.js";
13
+ import"./index-em72jhc0.js";
14
+ import"./index-ab86c21b.js";
15
+ import"./index-tyjx0dwz.js";
16
+ import"./index-2amn2s73.js";
17
+ import"./index-ajmy0v5j.js";
18
+ import"./index-h1qh9n8b.js";
19
+ import"./index-fqth7850.js";
20
+ import"./index-61a853ky.js";
21
+ import"./index-qt1qqasc.js";
22
+ import"./index-8hhmv0ff.js";
23
+ import"./index-w6kcwhhj.js";
24
+ import"./index-1zx87sdm.js";
25
+ import"./index-vdzd98ry.js";
26
+ import"./index-y14pawe1.js";
27
+ import"./index-y5f5yg5a.js";
28
+ import"./index-nyjztqyj.js";
29
+ import"./index-r3f85n7y.js";
30
+ import"./index-fd3hkyk1.js";
31
+ import"./index-1vv1ka4a.js";
32
+ import"./index-gcf2x04k.js";
33
+ import"./index-xw608ytx.js";
34
+ import"./index-fb3zxn06.js";
35
+ import"./index-hyvxmz3e.js";
36
+ import"./index-fr0wbhdn.js";
37
+ import"./index-vegw385y.js";
38
+ import"./index-geph2sa6.js";
39
+ import"./index-8k9qpyjf.js";
40
+ import"./index-xtv4d4hv.js";
41
+ import"./index-jsbgw33b.js";
42
+ import"./index-96ztjvkn.js";
43
+ import"./index-v0p37hm2.js";
44
+ import"./index-58e3y90n.js";
45
+ import"./index-9awtk18w.js";
46
+ import"./index-t7st85f5.js";
47
+ import"./index-abhmtj00.js";
48
+ import"./index-2m3t73wk.js";
49
+ import"./index-gzy5w8ya.js";
50
+ import"./index-34xvre52.js";
51
+ import"./index-pavzsdc6.js";
52
+ import"./index-1d042x6w.js";
53
+ export {
54
+ runManagedWrapup2 as runManagedWrapup
55
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cortexkit/opencode-magic-context",
3
- "version": "0.49.96",
3
+ "version": "0.49.98",
4
4
  "type": "module",
5
5
  "description": "OpenCode plugin for Magic Context — cross-session memory and context management",
6
6
  "main": "dist/index.js",
@@ -44,7 +44,7 @@
44
44
  "check:transformers-node-wasm": "bun scripts/verify-transformers-node-wasm.ts",
45
45
  "typecheck": "tsc -p ../retina-local-fs/tsconfig.build.json && tsc --noEmit && tsc -p tsconfig.scripts.json",
46
46
  "test": "bun ../../scripts/check-bun.mjs && bun install --frozen-lockfile && MC_SLOW_TESTS=0 MC_REVIEW_ASSERT_LIVENESS=1 BUN_JSC_useOMGJIT=0 bun test --parallel=4 --timeout 30000 --test-name-pattern '^(?!.*\\[slow\\] )'",
47
- "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 old chunks' --timeout 120000",
47
+ "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 old chunks' --timeout 120000",
48
48
  "test:serial": "bun install --frozen-lockfile && MC_REVIEW_ASSERT_LIVENESS=1 BUN_JSC_useOMGJIT=0 bun test --timeout 30000",
49
49
  "test:parallel:probe": "bun scripts/verify-parallel-db-isolation.ts",
50
50
  "lint": "bun ../../scripts/check-bun.mjs && biome check .",
@@ -193,7 +193,13 @@ export interface RunnerStatus {
193
193
  observed: "last_completion" | "resolved_for_route";
194
194
  }
195
195
 
196
+ export interface CheckpointInstructionEstimate {
197
+ rows: number;
198
+ tokens: number;
199
+ }
200
+
196
201
  export interface StatusDetail extends SidebarSnapshot {
202
+ checkpointInstructions?: CheckpointInstructionEstimate;
197
203
  /**
198
204
  * Version of the Magic Context package the answering server runs. The TUI
199
205
  * compares it with its own so the status dialog can say when the two differ
@@ -303,6 +303,17 @@ export function checkStatusViewSource(candidate: unknown):
303
303
  compressionUsage: optional.read("compressionUsage", isNullableString) ?? null,
304
304
  executeThresholdClamped: optional.read("executeThresholdClamped", isBoolean),
305
305
  windowGeometry: optional.read("windowGeometry", isWindowGeometry),
306
+ checkpointInstructions: optional.read(
307
+ "checkpointInstructions",
308
+ (value): value is NonNullable<StatusViewSource["checkpointInstructions"]> =>
309
+ isRecord(value) &&
310
+ isFiniteNumber(value.rows) &&
311
+ Number.isSafeInteger(value.rows) &&
312
+ value.rows > 0 &&
313
+ isFiniteNumber(value.tokens) &&
314
+ Number.isSafeInteger(value.tokens) &&
315
+ value.tokens > 0,
316
+ ),
306
317
  tailHygiene: optional.read("tailHygiene", isTailHygiene),
307
318
  tagCountsAuthoritative: optional.read("tagCountsAuthoritative", isBoolean),
308
319
  compactionMarker: optional.read("compactionMarker", isCompactionMarker),
@@ -186,6 +186,7 @@ export interface StatusViewSource {
186
186
  };
187
187
  readonly hiddenVariantWarnings?: readonly string[];
188
188
  readonly projectBindingWarning?: string;
189
+ readonly checkpointInstructions?: { readonly rows: number; readonly tokens: number };
189
190
  }
190
191
 
191
192
  declare const checkedStatusViewSource: unique symbol;
@@ -206,6 +207,13 @@ export interface StatusViewOptions {
206
207
  readonly now?: number;
207
208
  }
208
209
 
210
+ export function checkpointInstructionStatusText(estimate: {
211
+ rows: number;
212
+ tokens: number;
213
+ }): string {
214
+ return `${estimate.rows.toLocaleString()} update ${estimate.rows === 1 ? "row" : "rows"} (about ${estimate.tokens.toLocaleString()} tokens) since the last checkpoint. /compact removes them.`;
215
+ }
216
+
209
217
  /**
210
218
  * Category palette, kept identical to the sidebar breakdown
211
219
  * (`src/tui/slots/sidebar-content.tsx`) so one colour means one category
@@ -682,7 +690,22 @@ function statusSections(source: StatusViewSource, now: number): StatusSection[]
682
690
  ],
683
691
  },
684
692
  { title: "Cache TTL", labelWidth: 14, rows: cacheRows(source, now) },
685
- { title: "History Compression", labelWidth: 14, rows: historyRows(source, now) },
693
+ {
694
+ title: "History Compression",
695
+ labelWidth: 14,
696
+ rows: [
697
+ ...historyRows(source, now),
698
+ ...(source.checkpointInstructions?.tokens
699
+ ? [
700
+ {
701
+ label: "Instructions",
702
+ value: checkpointInstructionStatusText(source.checkpointInstructions),
703
+ tone: "muted" as const,
704
+ },
705
+ ]
706
+ : []),
707
+ ],
708
+ },
686
709
  ...configSection,
687
710
  {
688
711
  title: "Memory",
@@ -1423,11 +1423,27 @@ function buildAggregateTarget(
1423
1423
  return any ? "truncated" : "absent";
1424
1424
  };
1425
1425
 
1426
+ // Whether the host keeps this kept call's real arguments. Asks every call
1427
+ // occurrence, so the host learns about each call it must send that way.
1428
+ const keepsRealArgumentsWhenKept = (): boolean => {
1429
+ let keeps = false;
1430
+ for (const occ of occurrences) {
1431
+ if (occ.kind === "tool_use" && occ.part.keepsRealArgumentsWhenKept?.() === true)
1432
+ keeps = true;
1433
+ }
1434
+ return keeps;
1435
+ };
1436
+
1426
1437
  // Adapters without structural removal (or arcs that must keep their pair
1427
1438
  // beside native reasoning) cannot remove the call; drop() would keep it.
1439
+ // Asked without recording a removal where the host can: a planner keeps
1440
+ // the call when this says so, and a recorded removal would be replayed
1441
+ // into the kept call's native history item.
1428
1442
  const cannotRemove = (): boolean => {
1429
1443
  if (requiresToolArcSkeleton) return true;
1430
- const authorization = occurrences.map((occ) => occ.part.canRemove?.());
1444
+ const authorization = occurrences.map((occ) =>
1445
+ occ.part.wouldRemove ? occ.part.wouldRemove() : occ.part.canRemove?.(),
1446
+ );
1431
1447
  return !occurrences.every(
1432
1448
  (occ, index) => occ.part.remove && authorization[index] !== false,
1433
1449
  );
@@ -1441,7 +1457,11 @@ function buildAggregateTarget(
1441
1457
  measureReclaim(skeleton) {
1442
1458
  let beforeTools = 0;
1443
1459
  let afterTools = 0;
1444
- const authorization = occurrences.map((occ) => occ.part.canRemove?.());
1460
+ // Measuring must not record a removal for a call the caller may
1461
+ // leave in place; ask without recording where the host can.
1462
+ const authorization = occurrences.map((occ) =>
1463
+ occ.part.wouldRemove ? occ.part.wouldRemove() : occ.part.canRemove?.(),
1464
+ );
1445
1465
  const removable =
1446
1466
  !requiresToolArcSkeleton &&
1447
1467
  occurrences.every(
@@ -1510,18 +1530,34 @@ function buildAggregateTarget(
1510
1530
  // "truncated" tells callers to persist that mode
1511
1531
  // (`skeleton_real`), so later passes serve the same bytes.
1512
1532
  // (The sentinel fallback below keeps call and result in place,
1513
- // so it needs no exception.)
1514
- if (conversationEnd?.wouldStrand(occurrences)) return skeletonReal();
1533
+ // so it needs no exception.) The host is asked about the call
1534
+ // too, so a host that keeps real arguments for it sends the
1535
+ // same arguments in every copy of the call.
1536
+ if (conversationEnd?.wouldStrand(occurrences)) {
1537
+ keepsRealArgumentsWhenKept();
1538
+ return skeletonReal();
1539
+ }
1515
1540
  let removed = false;
1516
1541
  for (const occ of occurrences) removed = occ.part.remove?.() || removed;
1517
1542
  if (removed) conversationEnd?.noteRemoved(occurrences);
1518
1543
  return removed ? "removed" : "absent";
1519
1544
  }
1520
1545
  }
1521
- // Adapters without structural removal retain paired sentinels. This
1522
- // writes a marker into the call's arguments, so only replays of
1523
- // existing `full` tags reach it: new drops check cannotRemove() and
1524
- // use skeletonReal(), and a HARD fold converts the existing ones.
1546
+ // The call stays in place on this pass. When the host keeps its real
1547
+ // arguments (on Pi: a removal of this pair was recorded on a pass
1548
+ // whose model allowed it), this renders the bytes of a
1549
+ // `skeleton_real` row: real arguments, `[dropped §N§]` result. The
1550
+ // row stays `full`, so a later pass that can remove the call does.
1551
+ if (keepsRealArgumentsWhenKept()) return skeletonReal();
1552
+ // Otherwise the call keeps its place with a `{"dropped": …}` marker
1553
+ // in its arguments. That is the form such a row has had since it was
1554
+ // dropped, and replaying it keeps the cached prompt's bytes: a `full`
1555
+ // row that was never removed, which `/ctx-flush` leaves when it marks
1556
+ // queued drops `full` without asking whether the call can be removed,
1557
+ // and a `ctx_reduce` drop whose call was absent when it applied. A
1558
+ // new drop planned by planNewToolDrop keeps a call it cannot remove
1559
+ // as `skeleton_real` instead, and a HARD fold converts such a row to
1560
+ // `skeleton_real` when its call cannot be removed.
1525
1561
  const sentinel = `[dropped \u00a7${tagId}\u00a7]`;
1526
1562
  let any = false;
1527
1563
  for (const occ of occurrences) {
@@ -1567,8 +1603,23 @@ function buildAggregateTarget(
1567
1603
  }
1568
1604
  return any ? "truncated" : "absent";
1569
1605
  },
1570
- // Open invocations still belong to the current turn; only complete arcs reclaim.
1571
- prepareDrop: () => !occurrences.some((occ) => occ.part.canRemove?.() === "defer"),
1606
+ // Admission for a new drop of this arc: false while the host already
1607
+ // knows it cannot decide the arc's removal (a removal answer of
1608
+ // "defer"). Asked without recording anything where the host can, since
1609
+ // the drop may keep the call in place; on Pi the answer does not
1610
+ // foresee whether a later write of the record succeeds (prepareRemoval
1611
+ // finds that out).
1612
+ prepareDrop: () =>
1613
+ !occurrences.some(
1614
+ (occ) =>
1615
+ (occ.part.wouldRemove ? occ.part.wouldRemove() : occ.part.canRemove?.()) ===
1616
+ "defer",
1617
+ ),
1618
+ // Prepare this arc's removal: on Pi this records the removal decision,
1619
+ // and refuses (false) when that record cannot be written. Call it only
1620
+ // for an arc that will be removed: the record is replayed into the
1621
+ // call's native history item on every later pass.
1622
+ prepareRemoval: () => !occurrences.some((occ) => occ.part.canRemove?.() === "defer"),
1572
1623
  prepareReplayDrop: () => {
1573
1624
  if (complete() && !requiresToolArcSkeleton) {
1574
1625
  for (const occ of occurrences) occ.part.canRemove?.();
@@ -0,0 +1,56 @@
1
+ import { expect, test } from "bun:test";
2
+ import { spawnSync } from "node:child_process";
3
+ import { mkdirSync, writeFileSync } from "node:fs";
4
+ import { join } from "node:path";
5
+ import { fileURLToPath } from "node:url";
6
+ import { withTestTempDir } from "./test-temp-dir";
7
+
8
+ const preload = fileURLToPath(new URL("../../test-preload.ts", import.meta.url));
9
+
10
+ /**
11
+ * Runs one passing test file under the package preload with `cwd` set to a
12
+ * fresh folder that stands in for the repository root, after writing a
13
+ * `context.db` at `store` (relative to that folder). The preload's leak scan
14
+ * then walks that folder.
15
+ */
16
+ function runWithStoreAt(store: string) {
17
+ return withTestTempDir("mc-plugin-preload-leak-scan-", (cwd) => {
18
+ const path = join(cwd, store);
19
+ mkdirSync(join(path, ".."), { recursive: true });
20
+ writeFileSync(path, "a store this run did not create\n");
21
+ const probe = join(cwd, "probe.test.ts");
22
+ writeFileSync(
23
+ probe,
24
+ 'import { expect, test } from "bun:test";\ntest("probe", () => expect(1).toBe(1));\n',
25
+ );
26
+ const child = spawnSync(process.execPath, ["test", "--preload", preload, probe], {
27
+ cwd,
28
+ encoding: "utf8",
29
+ timeout: 30_000,
30
+ windowsHide: true,
31
+ });
32
+ if (child.error) throw child.error;
33
+ return { status: child.status, output: child.stdout + child.stderr, store };
34
+ });
35
+ }
36
+
37
+ test("the preload leak scan skips a store under the cwd's top-level target folder", () => {
38
+ const run = runWithStoreAt("target/scratch/other-task/crates/testdata/context.db");
39
+ expect(run.output).not.toContain("Test storage leaked");
40
+ expect(run.output).toContain("1 pass");
41
+ expect(run.status).toBe(0);
42
+ });
43
+
44
+ test("the preload leak scan still fails on a store inside a package folder", () => {
45
+ const run = runWithStoreAt("packages/plugin/leaked/context.db");
46
+ expect(run.status).toBe(1);
47
+ expect(run.output).toContain("Test storage leaked into the package directory");
48
+ expect(run.output).toContain(run.store);
49
+ });
50
+
51
+ test("the preload leak scan skips only the top-level target folder, not a nested one", () => {
52
+ const run = runWithStoreAt("packages/plugin/target/context.db");
53
+ expect(run.status).toBe(1);
54
+ expect(run.output).toContain("Test storage leaked into the package directory");
55
+ expect(run.output).toContain(run.store);
56
+ });
@@ -177,12 +177,28 @@ export interface TranscriptPart {
177
177
  */
178
178
  replaceWithSentinel(sentinelText: string): boolean;
179
179
 
180
+ /**
181
+ * Tool calls only: true when a dropped call that this pass keeps in place
182
+ * keeps the arguments the model wrote (only its result becomes the
183
+ * placeholder) instead of the `{"dropped": …}` marker. Absent or false
184
+ * means the marker. A host that answers true may note the call, so every
185
+ * copy of it the host sends carries the same arguments.
186
+ */
187
+ keepsRealArgumentsWhenKept?(): boolean;
188
+
180
189
  /** Remove one half of a complete tool arc. Callers must remove both halves together. */
181
190
  remove?(): boolean;
182
191
  /** Refuse structural deletion when the adapter cannot match provider-native identity safely. */
183
192
  /** A deferred durable decision vetoes the whole drop, including sentinel fallback. */
184
193
  canRemove?(): boolean | "defer";
185
194
 
195
+ /**
196
+ * What canRemove() would answer, without recording anything. Measuring a
197
+ * candidate for a drop uses it: only a drop that is actually chosen may
198
+ * record a removal, which later passes replay.
199
+ */
200
+ wouldRemove?(): boolean | "defer";
201
+
186
202
  /**
187
203
  * Optional: serialized byte size of the part's REAL payload, including
188
204
  * non-text content (images, structured data) that `getText()` can't
@@ -3,7 +3,10 @@ import { COMPACTION_ENABLED_PATH } from "../../config/agent-disable";
3
3
  import { log } from "../../shared/logger";
4
4
  import { pluginPackageVersion } from "../../shared/plugin-package-version";
5
5
  import type { SidebarSnapshot, StatusDetail } from "../../shared/rpc-types";
6
- import { buildUnavailableStatusView } from "../../shared/status-view";
6
+ import {
7
+ buildUnavailableStatusView,
8
+ checkpointInstructionStatusText,
9
+ } from "../../shared/status-view";
7
10
  import { statusVersionNotice } from "../../shared/status-view-check";
8
11
  import { compactionOffSidebarRows, nativeCompactionContextLabel } from "../../tui/compaction-off";
9
12
  import {
@@ -103,6 +106,7 @@ export function statusText(
103
106
  | "configReloadFailure"
104
107
  | "lastTransformError"
105
108
  | "projectBindingWarning"
109
+ | "checkpointInstructions"
106
110
  >,
107
111
  ): string {
108
112
  const context =
@@ -120,6 +124,9 @@ export function statusText(
120
124
  `Compartments: ${detail.compartmentCount}`,
121
125
  `Memories: ${detail.memoryBlockCount} injected / ${detail.memoryCount} stored`,
122
126
  `Pending reductions: ${detail.pendingOpsCount}`,
127
+ ...(detail.checkpointInstructions?.tokens
128
+ ? [`Instructions: ${checkpointInstructionStatusText(detail.checkpointInstructions)}`]
129
+ : []),
123
130
  `Harness: opencode2`,
124
131
  ...(detail.configGeneration === undefined
125
132
  ? []
@@ -95,3 +95,24 @@ test("the text dialog carries the status a component dialog would have drawn", (
95
95
  ].join("\n"),
96
96
  );
97
97
  });
98
+
99
+ test("OpenCode 2 text status explains how to remove instruction update rows", () => {
100
+ const detail = {
101
+ usagePercentage: 10,
102
+ inputTokens: 1_000,
103
+ contextLimit: 10_000,
104
+ historianRunning: false,
105
+ compartmentCount: 0,
106
+ memoryBlockCount: 0,
107
+ memoryCount: 0,
108
+ pendingOpsCount: 0,
109
+ lastTransformError: null,
110
+ checkpointInstructions: { rows: 2, tokens: 24 },
111
+ } as StatusDetail;
112
+ expect(statusText(detail)).toContain(
113
+ "Instructions: 2 update rows (about 24 tokens) since the last checkpoint. /compact removes them.",
114
+ );
115
+ expect(statusText({ ...detail, checkpointInstructions: { rows: 0, tokens: 0 } })).not.toContain(
116
+ "Instructions:",
117
+ );
118
+ });
@@ -1,29 +0,0 @@
1
- import {
2
- ensureMemoryEmbeddings2
3
- } from "./index-0bjj9yf3.js";
4
- import"./index-7m2tnk8q.js";
5
- import"./index-qjwpqvnf.js";
6
- import"./index-2amn2s73.js";
7
- import"./index-qt1qqasc.js";
8
- import"./index-r1d45dsr.js";
9
- import"./index-r3f85n7y.js";
10
- import"./index-7sdns2ww.js";
11
- import"./index-j4dcjb8t.js";
12
- import"./index-fgw241hh.js";
13
- import"./index-hj78hvhm.js";
14
- import"./index-89xg64wb.js";
15
- import"./index-hedgz8an.js";
16
- import"./index-96ztjvkn.js";
17
- import"./index-v0p37hm2.js";
18
- import"./index-tqtpgnhr.js";
19
- import"./index-6mryx739.js";
20
- import"./index-3n4j5rqc.js";
21
- import"./index-zfx7mtqa.js";
22
- import"./index-gzy5w8ya.js";
23
- import"./index-3fhb0j32.js";
24
- import"./index-pavzsdc6.js";
25
- import"./index-dt7cyqfe.js";
26
- import"./index-1d042x6w.js";
27
- export {
28
- ensureMemoryEmbeddings2 as ensureMemoryEmbeddings
29
- };