@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,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-8v1brm5n.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-x49x59ar.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-w9hxgntq.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:";
@@ -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";
@@ -6,14 +6,14 @@ import {
6
6
  StaleRouteHandleError,
7
7
  SubcClient,
8
8
  isConsumerReconnectTransient
9
- } from "./index-fgw241hh.js";
9
+ } from "./index-gcf2x04k.js";
10
10
  import {
11
11
  getHarness2
12
12
  } from "./index-pavzsdc6.js";
13
13
  import {
14
14
  getDataDir,
15
15
  log2
16
- } from "./index-3fhb0j32.js";
16
+ } from "./index-34xvre52.js";
17
17
  import {
18
18
  inRootAsyncContext2
19
19
  } from "./index-gzy5w8ya.js";
@@ -23,7 +23,7 @@ import {
23
23
  trackCompartmentChunkSearchPool2,
24
24
  peekCompartmentChunkSearchPool2,
25
25
  warmCompartmentChunkSearchPool2
26
- } from "./index-j4dcjb8t.js";
26
+ } from "./index-1vv1ka4a.js";
27
27
  import {
28
28
  saveCommitEmbedding,
29
29
  loadProjectCommitEmbeddings,
@@ -39,7 +39,7 @@ import {
39
39
  enqueueShadowEmbeddingItems2,
40
40
  getProjectEmbeddingSnapshot2,
41
41
  embedItemsForProject2
42
- } from "./index-7m2tnk8q.js";
42
+ } from "./index-z1mj8fv5.js";
43
43
  import {
44
44
  recordEmbeddingMeasurement
45
45
  } from "./index-2amn2s73.js";
@@ -55,7 +55,7 @@ import {
55
55
  sanitizeFtsQuery,
56
56
  searchMemoriesFTS,
57
57
  searchMemoriesFTSUnion
58
- } from "./index-910gahfb.js";
58
+ } from "./index-db1art1p.js";
59
59
  import {
60
60
  ModuleMemoryAuthorityError2,
61
61
  getMemoriesByProject2,
@@ -65,36 +65,36 @@ import {
65
65
  import {
66
66
  matchedSearchSnippet,
67
67
  getIndexedMessageCorpusSize
68
- } from "./index-89bkkgcn.js";
68
+ } from "./index-tyjx0dwz.js";
69
69
  import {
70
70
  getMessageIndexEpoch,
71
71
  isMessageIndexSearchable,
72
72
  withMemoryHintContent,
73
73
  autoSearchRelevance,
74
74
  recordAutoSearchLane
75
- } from "./index-9jvxq5rt.js";
75
+ } from "./index-h1xvt8fw.js";
76
76
  import {
77
77
  ensureMemoryEmbeddings2
78
- } from "./index-0bjj9yf3.js";
78
+ } from "./index-04zhtsb1.js";
79
79
  import {
80
80
  MESSAGE_FTS_SESSION_FILTER_SQL,
81
81
  withMessageFtsSessionFilter,
82
82
  messageTextVisibleInRequestSql
83
- } from "./index-mgy7g740.js";
83
+ } from "./index-kjdys7e2.js";
84
84
  import {
85
85
  isRecord
86
- } from "./index-w7n7qkpf.js";
86
+ } from "./index-w6kcwhhj.js";
87
87
  import {
88
88
  resolveWorkspaceShareCategories,
89
89
  resolveWorkspaceIdentitySet,
90
90
  expandWorkspaceIdentitySetWithAliases,
91
91
  resolveStoredPathWorkspaceIdentity,
92
92
  sourceNameForMemory
93
- } from "./index-dnpcv1rg.js";
93
+ } from "./index-hyvxmz3e.js";
94
94
  import {
95
95
  getNotes,
96
96
  getActivePrimers
97
- } from "./index-880a24vd.js";
97
+ } from "./index-ab86c21b.js";
98
98
  import {
99
99
  isKnownAutocommit
100
100
  } from "./index-8ajstryz.js";
@@ -3,12 +3,12 @@ import {
3
3
  } from "./index-fr0wbhdn.js";
4
4
  import {
5
5
  log2
6
- } from "./index-3fhb0j32.js";
6
+ } from "./index-34xvre52.js";
7
7
  import {
8
8
  ensureColumn,
9
9
  healAllNullColumns,
10
10
  installV95PerfSchema
11
- } from "./index-cpbr0xvk.js";
11
+ } from "./index-xtv4d4hv.js";
12
12
  import {
13
13
  resolveOpenCodeDbPath,
14
14
  openCodeDbPathExists,
@@ -20,10 +20,10 @@ import {
20
20
  import {
21
21
  normalizeStoredProjectPath,
22
22
  storedPathBelongsToIdentity
23
- } from "./index-hj78hvhm.js";
23
+ } from "./index-vegw385y.js";
24
24
  import {
25
25
  logSlowWriteTransaction
26
- } from "./index-tqtpgnhr.js";
26
+ } from "./index-9awtk18w.js";
27
27
 
28
28
  // src/features/magic-context/lkg-prefix-chunks.ts
29
29
  import { createHash } from "node:crypto";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./index-v0p37hm2.js";
4
4
  import {
5
5
  log2
6
- } from "./index-3fhb0j32.js";
6
+ } from "./index-34xvre52.js";
7
7
  import {
8
8
  inRootAsyncContext2,
9
9
  getSqliteDatabasePath2,
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  sessionLog2
3
- } from "./index-3fhb0j32.js";
3
+ } from "./index-34xvre52.js";
4
4
  import {
5
5
  clearEmergencyRecovery
6
- } from "./index-w7n7qkpf.js";
6
+ } from "./index-w6kcwhhj.js";
7
7
  import {
8
8
  requestPendingMaterialization,
9
9
  dropSlot
10
- } from "./index-8v1brm5n.js";
10
+ } from "./index-em72jhc0.js";
11
11
  import {
12
12
  pausedRecompReason,
13
13
  executeContextRecomp
14
- } from "./index-x49x59ar.js";
14
+ } from "./index-p52gf8a6.js";
15
15
  import {
16
16
  renderUserFacingFailure,
17
17
  userFacingFailureCode
18
- } from "./index-910gahfb.js";
18
+ } from "./index-db1art1p.js";
19
19
 
20
20
  // src/hooks/magic-context/recomp-orchestrator.ts
21
21
  function resolveLiveModelKey(liveSessionState, sessionId) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  TEXT_TAG_IDENTITY_MARKER
3
- } from "./index-w7n7qkpf.js";
3
+ } from "./index-w6kcwhhj.js";
4
4
 
5
5
  // src/features/magic-context/message-fts-session-filter.ts
6
6
  var MESSAGE_FTS_SESSION_FILTER_SQL = `+message_history_fts.rowid IN (
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  formatFailClosedBlockingSummary
3
- } from "./index-c205x7xd.js";
3
+ } from "./index-8k9qpyjf.js";
4
4
  import {
5
5
  RAW_MESSAGE_TYPES2
6
- } from "./index-tr4ep2ej.js";
6
+ } from "./index-ajmy0v5j.js";
7
7
  import {
8
8
  markHostUnservedRow
9
9
  } from "./index-s9x93tfs.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./index-r3f85n7y.js";
4
4
  import {
5
5
  getSynapseLaneIdentity
6
- } from "./index-fgw241hh.js";
6
+ } from "./index-gcf2x04k.js";
7
7
  import {
8
8
  getHarness2
9
9
  } from "./index-pavzsdc6.js";
@@ -12,7 +12,7 @@ import {
12
12
  importPluginModule,
13
13
  log2,
14
14
  flushLogger2
15
- } from "./index-3fhb0j32.js";
15
+ } from "./index-34xvre52.js";
16
16
  import {
17
17
  inRootAsyncContext2
18
18
  } from "./index-gzy5w8ya.js";
@@ -22,7 +22,7 @@ import {
22
22
  writeStorageFileAsync,
23
23
  writeStorageFileHandleAsync,
24
24
  createStorageFileHandleAsync
25
- } from "./index-6mryx739.js";
25
+ } from "./index-t7st85f5.js";
26
26
  import {
27
27
  computeNormalizedHash
28
28
  } from "./index-2bvekkfy.js";