@cortexkit/opencode-magic-context 0.49.97 → 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 (190) 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-br04s0b6.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/{history-owner-74826t4n.js → history-owner-8dj31nyf.js} +2 -3
  14. package/dist/hooks/magic-context/transform.d.ts +2 -0
  15. package/dist/hooks/magic-context/transform.d.ts.map +1 -1
  16. package/dist/{index-0bjj9yf3.js → index-04zhtsb1.js} +2 -2
  17. package/dist/{index-tbdy1hk0.js → index-0wj3jr8n.js} +6 -6
  18. package/dist/{index-j4dcjb8t.js → index-1vv1ka4a.js} +4 -4
  19. package/dist/{index-zfx7mtqa.js → index-2m3t73wk.js} +1 -1
  20. package/dist/{index-3fhb0j32.js → index-34xvre52.js} +223 -5
  21. package/dist/{index-pkxkeezb.js → index-5wbqmvg8.js} +15 -15
  22. package/dist/{index-kj4bprep.js → index-61a853ky.js} +4 -4
  23. package/dist/{index-zmgp0tr6.js → index-74w347am.js} +3 -3
  24. package/dist/{index-hp46xe93.js → index-8hhmv0ff.js} +6 -6
  25. package/dist/{index-c205x7xd.js → index-8k9qpyjf.js} +1 -1
  26. package/dist/{index-tqtpgnhr.js → index-9awtk18w.js} +1 -1
  27. package/dist/{index-h7kta6cn.js → index-9eqt7755.js} +3 -3
  28. package/dist/{index-mmf6e740.js → index-a1295271.js} +7 -7
  29. package/dist/{index-880a24vd.js → index-ab86c21b.js} +1 -1
  30. package/dist/{index-3n4j5rqc.js → index-abhmtj00.js} +1 -1
  31. package/dist/{index-tr4ep2ej.js → index-ajmy0v5j.js} +31 -0
  32. package/dist/{index-dj64gzg5.js → index-cayqdwf9.js} +2 -2
  33. package/dist/{index-910gahfb.js → index-db1art1p.js} +6 -8
  34. package/dist/{index-8v1brm5n.js → index-em72jhc0.js} +11 -11
  35. package/dist/{index-7sdns2ww.js → index-fd3hkyk1.js} +2 -2
  36. package/dist/{index-fgw241hh.js → index-gcf2x04k.js} +2 -2
  37. package/dist/{index-89xg64wb.js → index-geph2sa6.js} +2 -2
  38. package/dist/{index-45qgkg8j.js → index-h1qh9n8b.js} +2 -2
  39. package/dist/{index-9jvxq5rt.js → index-h1xvt8fw.js} +4 -4
  40. package/dist/{index-0ve29s6f.js → index-hbqxxb2n.js} +1 -1
  41. package/dist/{index-0sqhg9nf.js → index-hmrkgd4v.js} +12 -12
  42. package/dist/{index-dnpcv1rg.js → index-hyvxmz3e.js} +4 -4
  43. package/dist/{index-hedgz8an.js → index-jsbgw33b.js} +1 -1
  44. package/dist/{index-w9hxgntq.js → index-k86ec4j2.js} +5 -5
  45. package/dist/{index-mgy7g740.js → index-kjdys7e2.js} +1 -1
  46. package/dist/{index-e6ay1gez.js → index-mfx7hzyc.js} +2 -2
  47. package/dist/{index-r1d45dsr.js → index-nyjztqyj.js} +3 -3
  48. package/dist/{index-x49x59ar.js → index-p52gf8a6.js} +23 -25
  49. package/dist/{index-azkfw78y.js → index-qxzk5s30.js} +1 -1
  50. package/dist/{index-6mryx739.js → index-t7st85f5.js} +1 -1
  51. package/dist/{index-89bkkgcn.js → index-tyjx0dwz.js} +4 -4
  52. package/dist/{index-k34hc455.js → index-vdzd98ry.js} +2 -2
  53. package/dist/{index-hj78hvhm.js → index-vegw385y.js} +2 -2
  54. package/dist/{index-qdjxrbnr.js → index-vxsxz3sp.js} +46 -43
  55. package/dist/{index-w7n7qkpf.js → index-w6kcwhhj.js} +4 -4
  56. package/dist/{index-xcej5kpt.js → index-xbna9akt.js} +5 -5
  57. package/dist/{index-cpbr0xvk.js → index-xtv4d4hv.js} +2 -2
  58. package/dist/{index-zkjx8gq3.js → index-xw608ytx.js} +11 -11
  59. package/dist/{index-jzrvdqb8.js → index-y5f5yg5a.js} +1 -1
  60. package/dist/{index-7m2tnk8q.js → index-z1mj8fv5.js} +9 -11
  61. package/dist/index.js +55 -56
  62. package/dist/{logger-nmb2508f.js → logger-dgtrf43g.js} +1 -2
  63. package/dist/{message-fts-rowid-map-vcatdan0.js → message-fts-rowid-map-cfq59g6g.js} +4 -5
  64. package/dist/{message-index-bounded-abhwe610.js → message-index-bounded-6y7p974x.js} +10 -11
  65. package/dist/{message-time-backfill-zc5rsvhv.js → message-time-backfill-av870n4c.js} +2 -3
  66. package/dist/migration-worker.js +12 -13
  67. package/dist/plugin/rpc-handlers.d.ts +1 -0
  68. package/dist/plugin/rpc-handlers.d.ts.map +1 -1
  69. package/dist/{project-embedding-registry-e566q4bg.js → project-embedding-registry-5rp9w92w.js} +13 -14
  70. package/dist/raw-ordinal-warmup-worker.js +8 -8
  71. package/dist/{read-session-chunk-sde0wym3.js → read-session-chunk-9ejnbe07.js} +8 -9
  72. package/dist/{read-session-raw-trhdgc9z.js → read-session-raw-pgc9gxtn.js} +2 -3
  73. package/dist/{recomp-orchestrator-dapm3e4v.js → recomp-orchestrator-kmkf8dm4.js} +32 -33
  74. package/dist/render-9712q3gp.js +42 -0
  75. package/dist/{safe-notification-target-54ns7dv9.js → safe-notification-target-01j8km9e.js} +2 -3
  76. package/dist/{search-archive-4bbn3ztv.js → search-archive-5jr011gc.js} +11 -12
  77. package/dist/{search-11aw8wpq.js → search-kd84wg76.js} +25 -26
  78. package/dist/{send-session-notification-gxrj4w1r.js → send-session-notification-tfhs4dbc.js} +5 -6
  79. package/dist/shared/rpc-types.d.ts +5 -0
  80. package/dist/shared/rpc-types.d.ts.map +1 -1
  81. package/dist/shared/status-view-check.d.ts.map +1 -1
  82. package/dist/shared/status-view.d.ts +8 -0
  83. package/dist/shared/status-view.d.ts.map +1 -1
  84. package/dist/{storage-tags-jq0c0zsn.js → storage-tags-vd3sgd4s.js} +5 -6
  85. package/dist/{store-29ksp6vy.js → store-235fjtsn.js} +6 -4
  86. package/dist/{store-reader-dgh3ssxx.js → store-reader-01e8t5j0.js} +4 -1
  87. package/dist/{transform-postprocess-phase-1xrjg6be.js → transform-postprocess-phase-n4q1yd72.js} +33 -34
  88. package/dist/v2/auto-search-worker.js +5 -5
  89. package/dist/v2/checkpoint-instruction-status.d.ts +13 -0
  90. package/dist/v2/checkpoint-instruction-status.d.ts.map +1 -0
  91. package/dist/v2/chunk-embedding-write-worker.js +15 -16
  92. package/dist/v2/{compaction-marker-candidates-6nypmsr3.js → compaction-marker-candidates-3rxg3f1e.js} +2 -3
  93. package/dist/v2/compaction-marker-candidates-worker.js +1 -1
  94. package/dist/v2/{compartment-chunk-embedding-jthtfhcd.js → compartment-chunk-embedding-6v74y2r3.js} +7 -8
  95. package/dist/v2/{context-43r0mzkp.js → context-fqeg60th.js} +382 -65
  96. package/dist/v2/{derive-budgets-wj0q7s7d.js → derive-budgets-9237wmq5.js} +5 -6
  97. package/dist/v2/embedding-backfill-dm33f3ce.js +28 -0
  98. package/dist/v2/embedding-worker-process.js +1 -2
  99. package/dist/v2/embedding-worker.js +6 -7
  100. package/dist/v2/fold/idle.d.ts +11 -1
  101. package/dist/v2/fold/idle.d.ts.map +1 -1
  102. package/dist/v2/fold/instruction-supersession.d.ts +22 -1
  103. package/dist/v2/fold/instruction-supersession.d.ts.map +1 -1
  104. package/dist/v2/fold/native-replay-v3.d.ts +1 -0
  105. package/dist/v2/fold/native-replay-v3.d.ts.map +1 -1
  106. package/dist/v2/fold/native-replay.d.ts +73 -0
  107. package/dist/v2/fold/native-replay.d.ts.map +1 -1
  108. package/dist/v2/{history-owner-8pd5ax3n.js → history-owner-k4gx50a0.js} +2 -3
  109. package/dist/v2/hooks/context.d.ts.map +1 -1
  110. package/dist/v2/{logger-58jfese9.js → logger-0ys28353.js} +1 -2
  111. package/dist/v2/{message-fts-rowid-map-ax4vk78j.js → message-fts-rowid-map-88x2zbyj.js} +4 -5
  112. package/dist/v2/{message-index-bounded-qh794qxx.js → message-index-bounded-wj5rs9az.js} +10 -11
  113. package/dist/v2/{message-time-backfill-yj773saf.js → message-time-backfill-5p4vwd79.js} +2 -3
  114. package/dist/v2/migration-worker.js +12 -13
  115. package/dist/v2/{project-embedding-registry-z05xvckg.js → project-embedding-registry-z9qxkdxm.js} +13 -14
  116. package/dist/v2/raw-ordinal-warmup-worker.js +8 -8
  117. package/dist/v2/{read-session-chunk-8tn2dbn1.js → read-session-chunk-89ep8br4.js} +8 -9
  118. package/dist/v2/{read-session-raw-ywebck9q.js → read-session-raw-seh1kcvp.js} +2 -3
  119. package/dist/v2/recomp-orchestrator-79362xbm.js +68 -0
  120. package/dist/v2/render-bzzypsgy.js +42 -0
  121. package/dist/v2/{safe-notification-target-zrwbh6k7.js → safe-notification-target-3e2rq2ys.js} +2 -3
  122. package/dist/v2/{search-35cz80x0.js → search-4f6kmq31.js} +24 -25
  123. package/dist/v2/{search-archive-8zqsf9e6.js → search-archive-4yr4hw2m.js} +11 -12
  124. package/dist/v2/{send-session-notification-8x146x5y.js → send-session-notification-vtnk598k.js} +5 -6
  125. package/dist/v2/{server-vj0xbbrc.js → server-0b3ms151.js} +2 -2
  126. package/dist/v2/{server-r3h4fy4k.js → server-1bks09js.js} +5 -5
  127. package/dist/v2/{server-63ree5ns.js → server-2xng77ch.js} +1 -1
  128. package/dist/v2/{server-2sare4qg.js → server-3mb205v9.js} +4 -4
  129. package/dist/v2/{server-n34vzyfm.js → server-3qeqa3b6.js} +1 -1
  130. package/dist/v2/{server-ganavh75.js → server-4ccgfzr2.js} +2 -2
  131. package/dist/v2/{server-av3p9c8k.js → server-54nc921b.js} +1 -1
  132. package/dist/v2/{server-2qvnr3t7.js → server-5zx51pm4.js} +1 -1
  133. package/dist/v2/{server-vsx9tsks.js → server-62t1852h.js} +11 -11
  134. package/dist/v2/{server-svccj9rd.js → server-6mq43ear.js} +4 -4
  135. package/dist/v2/{server-z2nv8jdv.js → server-70dhx58s.js} +12 -12
  136. package/dist/v2/{server-db91dxwc.js → server-7861dnm3.js} +6 -6
  137. package/dist/v2/{server-6qax5pds.js → server-7c5p0bh1.js} +2 -2
  138. package/dist/v2/{server-11ra1pmx.js → server-8xgs110k.js} +4 -4
  139. package/dist/v2/{server-40vdz8sf.js → server-98xd6j4r.js} +2 -2
  140. package/dist/v2/{server-nnh81jqy.js → server-b38pxt0e.js} +6 -8
  141. package/dist/v2/{server-k3ntgf6n.js → server-b5eg9ct6.js} +2 -2
  142. package/dist/v2/{server-2cq3e1c1.js → server-b65sqz7y.js} +4 -4
  143. package/dist/v2/{server-4yrvbnnm.js → server-bzebqckc.js} +2 -2
  144. package/dist/v2/{server-rt8t6s2a.js → server-cc58mckk.js} +2 -2
  145. package/dist/v2/{server-xekyjy4w.js → server-d0h1gjz2.js} +6 -6
  146. package/dist/v2/{server-73bqw5c0.js → server-d46xewmt.js} +1 -1
  147. package/dist/v2/{server-rr5c0xcg.js → server-d4h86y7v.js} +2 -2
  148. package/dist/v2/{server-7tj8yzrv.js → server-e14d7ebh.js} +2 -2
  149. package/dist/v2/{server-gh2w75fn.js → server-e8ybwfv8.js} +3 -3
  150. package/dist/v2/{server-zemnpv92.js → server-ghk96d57.js} +4 -4
  151. package/dist/v2/{server-j1gxs1gj.js → server-h95cdc30.js} +1 -1
  152. package/dist/v2/{server-5t4nzfpt.js → server-j09jx1n9.js} +1 -1
  153. package/dist/v2/{server-n33hyq9t.js → server-jrs4gny6.js} +2 -2
  154. package/dist/v2/{server-z5cv5wm5.js → server-md1cabvq.js} +9 -11
  155. package/dist/v2/{server-7h4gwphm.js → server-pqgnjf38.js} +3 -3
  156. package/dist/v2/{server-379fd3n7.js → server-rbxtp4sm.js} +1 -1
  157. package/dist/v2/{server-2wz6y46g.js → server-sfffm587.js} +1 -1
  158. package/dist/v2/{server-1fnsfm3a.js → server-tk4hpcxq.js} +24 -26
  159. package/dist/v2/{server-bx5k66qc.js → server-vgy98kcd.js} +1 -1
  160. package/dist/v2/{server-kzrrdjp5.js → server-xc7t2r4k.js} +223 -5
  161. package/dist/v2/{server-tq523gj6.js → server-yacpgq4s.js} +1 -1
  162. package/dist/v2/{server-vtkbxzw1.js → server-ysg14rv1.js} +31 -0
  163. package/dist/v2/{server-qjjky07w.js → server-zedjjdc5.js} +11 -11
  164. package/dist/v2/server.js +8 -9
  165. package/dist/v2/{storage-tags-pcenytad.js → storage-tags-8kktww54.js} +5 -6
  166. package/dist/v2/{store-gx19qc3a.js → store-0kjfynwp.js} +6 -4
  167. package/dist/v2/{store-reader-qt2msa8z.js → store-reader-w0srb18d.js} +4 -1
  168. package/dist/v2/store-reader.d.ts +1 -0
  169. package/dist/v2/store-reader.d.ts.map +1 -1
  170. package/dist/v2/tui/index.d.ts +1 -1
  171. package/dist/v2/tui/index.d.ts.map +1 -1
  172. package/dist/v2/{v2-archive-reader-hvdyz30c.js → v2-archive-reader-veyqp15a.js} +1 -1
  173. package/dist/v2/{wrapup-orchestrator-0d4ceff3.js → wrapup-orchestrator-97s5wznb.js} +33 -34
  174. package/dist/{v2-archive-reader-qs24chs6.js → v2-archive-reader-3s332fn7.js} +1 -1
  175. package/dist/wrapup-orchestrator-bm0x49e5.js +55 -0
  176. package/package.json +2 -2
  177. package/src/shared/rpc-types.ts +6 -0
  178. package/src/shared/status-view-check.ts +11 -0
  179. package/src/shared/status-view.ts +24 -1
  180. package/src/shared/test-preload-leak-scan.test.ts +56 -0
  181. package/src/v2/tui/index.ts +8 -1
  182. package/src/v2/tui/status-dialog-fallback.test.ts +21 -0
  183. package/dist/embedding-backfill-pdymqbnh.js +0 -29
  184. package/dist/index-dt7cyqfe.js +0 -223
  185. package/dist/render-6vmqzcem.js +0 -43
  186. package/dist/v2/embedding-backfill-16b16m38.js +0 -29
  187. package/dist/v2/recomp-orchestrator-vzygyqwn.js +0 -69
  188. package/dist/v2/render-9b5dxp9e.js +0 -43
  189. package/dist/v2/server-dt7cyqfe.js +0 -223
  190. package/dist/wrapup-orchestrator-v1mhjw55.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-qjjky07w.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-1fnsfm3a.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-xcej5kpt.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.97",
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",
@@ -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
+ });
@@ -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
- };
@@ -1,223 +0,0 @@
1
- // src/shared/redaction.ts
2
- import { homedir, userInfo } from "node:os";
3
- function escapeRegex(value) {
4
- return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
5
- }
6
- var SECRET_WORDS = [
7
- "key",
8
- "token",
9
- "secret",
10
- "password",
11
- "auth",
12
- "authorization",
13
- "bearer",
14
- "credential"
15
- ];
16
- var SECRET_SEGMENT_PATTERN = new RegExp(`^(?:${SECRET_WORDS.map((w) => `${w}s?`).join("|")})$`, "i");
17
- var TRAILING_DESCRIPTORS = new Set(["id", "ids", "value", "values", "header", "headers"]);
18
- function redactionTypeForKey(key) {
19
- const normalized = key.trim().toLowerCase().replace(/[^a-z0-9_.-]+/g, "_");
20
- const suffix = normalized.split(".").filter(Boolean).at(-1) ?? normalized;
21
- return suffix || "secret";
22
- }
23
- function isNonSecretScalarValue(value) {
24
- const v = value.trim();
25
- if (v === "true" || v === "false" || v === "null" || v === "undefined")
26
- return true;
27
- return /^[+-]?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?$/.test(v);
28
- }
29
- var SECRET_QUALIFIERS = new Set([
30
- "api",
31
- "access",
32
- "private",
33
- "client",
34
- "auth",
35
- "authorization",
36
- "secret",
37
- "bearer",
38
- "session",
39
- "refresh",
40
- "service",
41
- "x",
42
- "openai",
43
- "anthropic",
44
- "google",
45
- "github",
46
- "huggingface",
47
- "aws",
48
- "azure",
49
- "id"
50
- ]);
51
- var UNQUALIFIED_SECRET_SEGMENT_PATTERN = /^(?:password|secret|credential|bearer|authorization)s?$/;
52
- function isSecretKey(key) {
53
- const segments = key.replace(/([a-z0-9])([A-Z])/g, "$1_$2").toLowerCase().split(/[._-]+/).filter(Boolean);
54
- if (segments.length === 0)
55
- return false;
56
- if (segments.length === 1) {
57
- const first = segments[0];
58
- return Boolean(first && SECRET_SEGMENT_PATTERN.test(first));
59
- }
60
- for (let i = 0;i < segments.length; i++) {
61
- const seg = segments[i];
62
- if (!seg || !SECRET_SEGMENT_PATTERN.test(seg))
63
- continue;
64
- let trailingOk = true;
65
- for (let j = i + 1;j < segments.length; j++) {
66
- const tail = segments[j];
67
- if (!tail)
68
- continue;
69
- if (TRAILING_DESCRIPTORS.has(tail))
70
- continue;
71
- if (SECRET_SEGMENT_PATTERN.test(tail))
72
- continue;
73
- trailingOk = false;
74
- break;
75
- }
76
- if (!trailingOk)
77
- continue;
78
- if (UNQUALIFIED_SECRET_SEGMENT_PATTERN.test(seg))
79
- return true;
80
- for (let k = i - 1;k >= 0; k--) {
81
- const lead = segments[k];
82
- if (lead && SECRET_QUALIFIERS.has(lead))
83
- return true;
84
- }
85
- }
86
- return false;
87
- }
88
- function sanitizePathString(value) {
89
- const home = process.env.HOME || process.env.USERPROFILE || homedir();
90
- const username = userInfo().username;
91
- let sanitized = value;
92
- if (home) {
93
- sanitized = sanitized.replace(new RegExp(escapeRegex(home), "g"), "~");
94
- }
95
- sanitized = sanitized.replace(/\/Users\/[^/]+\//g, "/Users/<USER>/");
96
- sanitized = sanitized.replace(/\/home\/[^/]+\//g, "/home/<USER>/");
97
- sanitized = sanitized.replace(/C:\\Users\\[^\\]+\\/g, "C:\\Users\\<USER>\\");
98
- if (username) {
99
- const word = "[\\p{L}\\p{M}\\p{N}_]";
100
- sanitized = sanitized.replace(new RegExp(`(?<!${word})${escapeRegex(username)}(?!${word})`, "gu"), "<USER>");
101
- }
102
- return sanitized;
103
- }
104
- var SECRET_TEXT_PATTERNS = [
105
- {
106
- pattern: /\bsk-ant-(?:api03-)?[A-Za-z0-9_-]{32,}/g,
107
- replacement: "<ANTHROPIC_API_KEY_REDACTED>"
108
- },
109
- {
110
- pattern: /\bsk-(?:proj-)?[A-Za-z0-9_-]{12,}/g,
111
- replacement: "<OPENAI_API_KEY_REDACTED>"
112
- },
113
- {
114
- pattern: /\bgithub_pat_[A-Za-z0-9_]{20,}/g,
115
- replacement: "<GITHUB_PAT_REDACTED>"
116
- },
117
- {
118
- pattern: /\b(?:gh[opsu]|ghr)_[A-Za-z0-9_-]{30,}/g,
119
- replacement: "<GITHUB_TOKEN_REDACTED>"
120
- },
121
- {
122
- pattern: /\bhf_[A-Za-z0-9]{30,}/g,
123
- replacement: "<HUGGINGFACE_TOKEN_REDACTED>"
124
- },
125
- {
126
- pattern: /\b(?:AKIA|ASIA)[0-9A-Z]{16}\b/g,
127
- replacement: "<AWS_ACCESS_KEY_ID_REDACTED>"
128
- },
129
- {
130
- pattern: /\bxox[abprsuvc]-[A-Za-z0-9-]{10,}/g,
131
- replacement: "<SLACK_TOKEN_REDACTED>"
132
- },
133
- {
134
- pattern: /\bAIza[A-Za-z0-9_-]{35}\b/g,
135
- replacement: "<GOOGLE_API_KEY_REDACTED>"
136
- },
137
- {
138
- pattern: /\b(Authorization\s*:\s*Bearer\s+)([A-Za-z0-9._~+/=-]{8,})/gi,
139
- replacement: (_full, prefix) => `${prefix}<REDACTED:bearer>`
140
- },
141
- {
142
- pattern: /\b((?:Proxy-)?Authorization\s*:\s*(?:Basic|Digest|Token|Negotiate|NTLM)\s+)([A-Za-z0-9._~+/=-]{4,})/gi,
143
- replacement: (_full, prefix) => `${prefix}<REDACTED:authorization>`
144
- },
145
- {
146
- pattern: /\b((?:x-)?(?:api-?key|api-?token|auth-?token|access-?token)\s*:\s*)([^\s'"`,;<>]{6,})/gi,
147
- replacement: (full, prefix, value) => isNonSecretScalarValue(value) ? full : `${prefix}<REDACTED:api_key>`
148
- },
149
- {
150
- pattern: /\b((?:api[_-]?key|client[_-]?secret|access[_-]?token|token|secret|password|passwd|pwd)\s*:\s*)([^\s'"`,;<>]{6,})/gi,
151
- replacement: (full, prefix, value) => isNonSecretScalarValue(value) ? full : `${prefix}<REDACTED:credential>`
152
- },
153
- {
154
- pattern: /\b([a-z][a-z0-9+.-]*:\/\/[^\s/:@]+:)([^\s/@]+)(@)/gi,
155
- replacement: (_full, prefix, _password, at) => `${prefix}<REDACTED:password>${at}`
156
- },
157
- {
158
- pattern: /\beyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g,
159
- replacement: "<JWT_REDACTED>"
160
- },
161
- {
162
- pattern: /(["'])([^"']*(?:key|token|secret|password|auth|bearer|credential)[^"']*)\1(\s*:\s*)(["'])([^"']*)\4/gi,
163
- replacement: (full, quote, key, separator, valueQuote, value) => isNonSecretScalarValue(value) ? full : `${quote}${key}${quote}${separator}${valueQuote}<REDACTED:${redactionTypeForKey(key)}>${valueQuote}`
164
- },
165
- {
166
- pattern: /\b([A-Za-z0-9_.-]*(?:key|token|secret|password|auth|bearer|credential)[A-Za-z0-9_.-]*)\s*=\s*([^\s'"`]+)/gi,
167
- replacement: (full, key, value) => isNonSecretScalarValue(value) ? full : `${key}=<REDACTED:${redactionTypeForKey(key)}>`
168
- }
169
- ];
170
- function redactSecretText(value) {
171
- let redacted = value;
172
- for (const { pattern, replacement } of SECRET_TEXT_PATTERNS) {
173
- if (typeof replacement === "string") {
174
- redacted = redacted.replace(pattern, replacement);
175
- } else {
176
- redacted = redacted.replace(pattern, replacement);
177
- }
178
- }
179
- return redacted;
180
- }
181
- function sanitizeDiagnosticText(value) {
182
- return redactSecretText(sanitizePathString(value));
183
- }
184
- var SHAREABILITY_SENSITIVE_PATTERNS = [
185
- /\bC:\/Users\/[^/\s]+/i,
186
- /(?:^|\s)~\/[^\s]+/,
187
- /\b(?:api[_-]?key|secret|token|password|passwd|pwd|client[_-]?secret|access[_-]?key)\b\s*[:=]\s*\S+/i,
188
- /\b(?:localhost|127\.0\.0\.1|0\.0\.0\.0|\[::1\])(?::\d+)?\b/i,
189
- /\b(?:10|127)\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/,
190
- /\b192\.168\.\d{1,3}\.\d{1,3}\b/,
191
- /\b172\.(?:1[6-9]|2\d|3[01])\.\d{1,3}\.\d{1,3}\b/
192
- ];
193
- function hasShareabilitySensitiveText(text) {
194
- try {
195
- if (sanitizeDiagnosticText(text) !== text)
196
- return true;
197
- return SHAREABILITY_SENSITIVE_PATTERNS.some((pattern) => pattern.test(text));
198
- } catch {
199
- return true;
200
- }
201
- }
202
- function sanitizeConfigValue(value, keyPath = []) {
203
- if (value === null || typeof value === "number" || typeof value === "boolean")
204
- return value;
205
- const key = keyPath.at(-1) ?? "";
206
- if (key && isSecretKey(key)) {
207
- return `<REDACTED:${redactionTypeForKey(key)}>`;
208
- }
209
- if (typeof value === "string")
210
- return sanitizeDiagnosticText(value);
211
- if (Array.isArray(value)) {
212
- return value.map((entry, index) => sanitizeConfigValue(entry, [...keyPath, String(index)]));
213
- }
214
- if (value && typeof value === "object") {
215
- return Object.fromEntries(Object.entries(value).map(([entryKey, entry]) => [
216
- entryKey,
217
- sanitizeConfigValue(entry, [...keyPath, entryKey])
218
- ]));
219
- }
220
- return value;
221
- }
222
-
223
- export { sanitizeDiagnosticText, hasShareabilitySensitiveText, sanitizeConfigValue };