@cortexkit/opencode-magic-context 0.49.43 → 0.49.45

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 (147) hide show
  1. package/dist/auto-search-worker.js +4 -4
  2. package/dist/chunk-embedding-write-worker.js +7 -7
  3. package/dist/{compaction-marker-candidates-5c44h1m9.js → compaction-marker-candidates-dkfp1q9j.js} +12 -2
  4. package/dist/compaction-marker-candidates-worker.js +5 -2
  5. package/dist/{compartment-chunk-embedding-ypktm0tk.js → compartment-chunk-embedding-snj51nmg.js} +5 -5
  6. package/dist/{conflict-warning-hook-b75jn458.js → conflict-warning-hook-w1aw6w5t.js} +4 -4
  7. package/dist/{context-zf1yj1g0.js → context-y85dvs6j.js} +28 -28
  8. package/dist/{embedding-backfill-rma0v2ct.js → embedding-backfill-kpy5shsa.js} +9 -9
  9. package/dist/embedding-worker.js +4 -4
  10. package/dist/features/magic-context/compaction-marker-candidates.d.ts +57 -4
  11. package/dist/features/magic-context/compaction-marker-candidates.d.ts.map +1 -1
  12. package/dist/features/magic-context/compaction-marker.d.ts +18 -3
  13. package/dist/features/magic-context/compaction-marker.d.ts.map +1 -1
  14. package/dist/features/magic-context/memory/embedding-openai.d.ts.map +1 -1
  15. package/dist/features/magic-context/memory/embedding-query-deadline.d.ts +8 -0
  16. package/dist/features/magic-context/memory/embedding-query-deadline.d.ts.map +1 -0
  17. package/dist/features/magic-context/overflow-detection.d.ts +16 -6
  18. package/dist/features/magic-context/overflow-detection.d.ts.map +1 -1
  19. package/dist/features/magic-context/scheduler.d.ts.map +1 -1
  20. package/dist/hooks/auto-update-checker/index.d.ts +6 -0
  21. package/dist/hooks/auto-update-checker/index.d.ts.map +1 -1
  22. package/dist/hooks/magic-context/apply-operations.d.ts +5 -4
  23. package/dist/hooks/magic-context/apply-operations.d.ts.map +1 -1
  24. package/dist/hooks/magic-context/cache-busting-signals.d.ts +4 -4
  25. package/dist/hooks/magic-context/cache-busting-signals.d.ts.map +1 -1
  26. package/dist/hooks/magic-context/compaction-marker-manager.d.ts +7 -1
  27. package/dist/hooks/magic-context/compaction-marker-manager.d.ts.map +1 -1
  28. package/dist/hooks/magic-context/compaction-marker-publication.d.ts.map +1 -1
  29. package/dist/hooks/magic-context/event-handler.d.ts.map +1 -1
  30. package/dist/hooks/magic-context/inject-compartments.d.ts +7 -2
  31. package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
  32. package/dist/hooks/magic-context/local-wire-reading.d.ts +54 -0
  33. package/dist/hooks/magic-context/local-wire-reading.d.ts.map +1 -0
  34. package/dist/hooks/magic-context/read-session-formatting.d.ts +2 -1
  35. package/dist/hooks/magic-context/read-session-formatting.d.ts.map +1 -1
  36. package/dist/hooks/magic-context/read-session-raw.d.ts.map +1 -1
  37. package/dist/hooks/magic-context/rust-mode-transform.d.ts.map +1 -1
  38. package/dist/hooks/magic-context/system-date-refresh.d.ts +1 -2
  39. package/dist/hooks/magic-context/system-date-refresh.d.ts.map +1 -1
  40. package/dist/hooks/magic-context/system-prompt-hash.d.ts.map +1 -1
  41. package/dist/hooks/magic-context/transform-context-state.d.ts +38 -6
  42. package/dist/hooks/magic-context/transform-context-state.d.ts.map +1 -1
  43. package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +5 -2
  44. package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
  45. package/dist/hooks/magic-context/transform.d.ts.map +1 -1
  46. package/dist/{index-ayk4we2k.js → index-0a79y98x.js} +41 -31
  47. package/dist/{index-jggt5gf2.js → index-1hwn96x1.js} +1 -1
  48. package/dist/{index-ae1ar4v1.js → index-25ka1jza.js} +1 -1
  49. package/dist/{index-c5dzns43.js → index-4dpvnp8k.js} +1 -1
  50. package/dist/{index-n8bsqg7b.js → index-7na94cjf.js} +3 -3
  51. package/dist/{index-fas76dft.js → index-980brvjr.js} +8 -8
  52. package/dist/{index-4xyjr62e.js → index-ak11t3gm.js} +4 -0
  53. package/dist/{index-vd2ywmfe.js → index-brj6was5.js} +1 -1
  54. package/dist/{index-gsqz39wk.js → index-bzq05g00.js} +3 -3
  55. package/dist/{index-ty4vhe4n.js → index-d4qw2h43.js} +4 -4
  56. package/dist/{index-5m2azs6v.js → index-dcdvyaeh.js} +4 -4
  57. package/dist/{index-g4t7850m.js → index-dj2p8653.js} +1 -1
  58. package/dist/{index-adt3jghq.js → index-fs3zfby1.js} +169 -61
  59. package/dist/{index-xjw9rres.js → index-gf1vx3bn.js} +3 -3
  60. package/dist/{index-3w1pbn85.js → index-gn6gfz4y.js} +64 -12
  61. package/dist/{index-8jjjmhab.js → index-gxqr0sbd.js} +1 -1
  62. package/dist/{index-b1ydbp95.js → index-h9m41624.js} +1 -1
  63. package/dist/{index-xd2p95m7.js → index-hkh8x221.js} +2 -2
  64. package/dist/{index-rdx17j04.js → index-jwa5t1s4.js} +6 -6
  65. package/dist/{index-dcjkw41m.js → index-qcz1fy7h.js} +3 -3
  66. package/dist/{index-1zv08avf.js → index-qdx8dq60.js} +5 -5
  67. package/dist/{index-z6v8086q.js → index-rk5hyc41.js} +5 -5
  68. package/dist/{index-21fgrfrf.js → index-s79g172v.js} +64 -22
  69. package/dist/{index-xnm0wq1r.js → index-sd2s4t4p.js} +1 -1
  70. package/dist/{index-jkanybgq.js → index-smtbdmc3.js} +1 -1
  71. package/dist/{index-p2e7j9p1.js → index-tvd2j34s.js} +2 -2
  72. package/dist/{index-zqsp3z0d.js → index-wwg1je98.js} +9 -6
  73. package/dist/{index-r2epb000.js → index-xa9mmq6c.js} +2 -1
  74. package/dist/{index-xmqj3cf5.js → index-xejh7cqv.js} +136 -63
  75. package/dist/{index-kfsqk1q7.js → index-z8dacvkt.js} +3 -3
  76. package/dist/index.d.ts.map +1 -1
  77. package/dist/index.js +44 -40
  78. package/dist/{message-fts-rowid-map-t6qsyg9s.js → message-fts-rowid-map-msffhkve.js} +2 -2
  79. package/dist/{message-index-bounded-5mj8p6nq.js → message-index-bounded-d8xt6q5c.js} +9 -9
  80. package/dist/migration-worker.js +5 -5
  81. package/dist/{project-embedding-registry-3yyegjma.js → project-embedding-registry-r6xfsrbe.js} +8 -8
  82. package/dist/raw-ordinal-warmup-worker.js +7 -7
  83. package/dist/{read-session-chunk-k70bhfjm.js → read-session-chunk-k3fqshw8.js} +7 -7
  84. package/dist/{read-session-raw-j7c9w57v.js → read-session-raw-x7a9b3jm.js} +1 -1
  85. package/dist/{recomp-orchestrator-2q4rmerf.js → recomp-orchestrator-y75thsc3.js} +21 -21
  86. package/dist/{render-36fvvwz6.js → render-3psbedzk.js} +14 -14
  87. package/dist/{search-archive-jwb2ctnq.js → search-archive-rvr7j5gx.js} +9 -9
  88. package/dist/{search-6v2na3af.js → search-hd16c8gq.js} +17 -17
  89. package/dist/{send-session-notification-14p3yje4.js → send-session-notification-j93pn2hn.js} +3 -3
  90. package/dist/shared/status-view.d.ts.map +1 -1
  91. package/dist/{storage-tags-vj0yj7ed.js → storage-tags-ye9aqrqy.js} +2 -2
  92. package/dist/tools/ctx-search/tools.d.ts.map +1 -1
  93. package/dist/{transform-postprocess-phase-0ms3ga4h.js → transform-postprocess-phase-1rzxmkhb.js} +22 -22
  94. package/dist/v2/auto-search-worker.js +4 -4
  95. package/dist/v2/chunk-embedding-write-worker.js +7 -7
  96. package/dist/v2/compaction-marker-candidates-worker.js +5 -2
  97. package/dist/v2/{compaction-marker-candidates-jy65jt49.js → compaction-marker-candidates-y737qb1v.js} +12 -2
  98. package/dist/v2/{compartment-chunk-embedding-qfk791bd.js → compartment-chunk-embedding-nj5nrnbj.js} +5 -5
  99. package/dist/v2/{context-2xr6vbt2.js → context-0e946t63.js} +194 -76
  100. package/dist/v2/{embedding-backfill-00tw59rx.js → embedding-backfill-360efh1t.js} +9 -9
  101. package/dist/v2/embedding-worker.js +4 -4
  102. package/dist/v2/hooks/context.d.ts.map +1 -1
  103. package/dist/v2/{message-fts-rowid-map-z86avy0n.js → message-fts-rowid-map-qe7cpksd.js} +2 -2
  104. package/dist/v2/{message-index-bounded-5341qsqd.js → message-index-bounded-wt64v2rn.js} +8 -8
  105. package/dist/v2/migration-worker.js +5 -5
  106. package/dist/v2/{project-embedding-registry-jqq2qeqb.js → project-embedding-registry-ek0cy0d5.js} +8 -8
  107. package/dist/v2/raw-ordinal-warmup-worker.js +7 -7
  108. package/dist/v2/{read-session-chunk-dgmq3ntm.js → read-session-chunk-4b31z6bz.js} +6 -6
  109. package/dist/v2/{read-session-raw-qpp6x9kg.js → read-session-raw-yss2ev98.js} +1 -1
  110. package/dist/v2/{recomp-orchestrator-2vmyhtst.js → recomp-orchestrator-6qrm2nea.js} +19 -19
  111. package/dist/v2/{render-kz0f40ws.js → render-f8mw16pp.js} +13 -13
  112. package/dist/v2/{search-archive-wajxd01m.js → search-archive-7d0xdp54.js} +8 -8
  113. package/dist/v2/{search-a9hwy1sw.js → search-ecjd7e50.js} +15 -15
  114. package/dist/v2/{send-session-notification-kxp47tsw.js → send-session-notification-na3q825m.js} +1 -1
  115. package/dist/v2/{server-09td1wgc.js → server-0ymsgh0j.js} +3 -3
  116. package/dist/v2/{server-nmyganc8.js → server-131h608x.js} +1 -1
  117. package/dist/v2/{server-7acq7815.js → server-2gjqhmn9.js} +64 -22
  118. package/dist/v2/{server-xy7w7hrd.js → server-2j87594q.js} +1 -1
  119. package/dist/v2/{server-7qc9tk6z.js → server-2qyfev3b.js} +5 -5
  120. package/dist/v2/{server-qehn6btp.js → server-39kzpp8q.js} +4 -4
  121. package/dist/v2/{server-969cdpmg.js → server-7vb38e51.js} +4 -0
  122. package/dist/v2/{server-sfcp13bn.js → server-an1ff8d8.js} +3 -3
  123. package/dist/v2/{server-tnzbk64q.js → server-b3r080cm.js} +2 -1
  124. package/dist/v2/{server-zzgtgqmd.js → server-ddw42d76.js} +1 -1
  125. package/dist/v2/{server-3m7p4g9w.js → server-ftyc8awt.js} +3 -3
  126. package/dist/v2/{server-xfjjbrkt.js → server-gwqfwtzq.js} +1 -1
  127. package/dist/v2/{server-dwpgzm0t.js → server-gwxys0d0.js} +64 -12
  128. package/dist/v2/{server-dqs8e4yt.js → server-hq7fdqfm.js} +7 -7
  129. package/dist/v2/{server-7zacmty5.js → server-p9s40wfa.js} +1 -1
  130. package/dist/v2/{server-nq3cb7be.js → server-pej5rnye.js} +1 -1
  131. package/dist/v2/{server-6vzh6wej.js → server-sg2qjkrb.js} +2 -2
  132. package/dist/v2/{server-gkse1wyz.js → server-sr8tf5dt.js} +4 -4
  133. package/dist/v2/{server-avdveykk.js → server-vjhk8v41.js} +1 -1
  134. package/dist/v2/{server-kqrpt2ht.js → server-vnpnmrsv.js} +8 -5
  135. package/dist/v2/{server-p78wdf43.js → server-wbxbk3za.js} +3 -3
  136. package/dist/v2/{server-cp1a03vc.js → server-y8n33d9j.js} +3 -3
  137. package/dist/v2/{server-5ydn39x3.js → server-zqzh2ybj.js} +135 -62
  138. package/dist/v2/server.js +4 -4
  139. package/dist/v2/{storage-tags-cw07ky67.js → storage-tags-8nttt1sk.js} +2 -2
  140. package/dist/v2/{v2-archive-reader-ag6sk771.js → v2-archive-reader-53kp5mme.js} +1 -1
  141. package/dist/v2/{wrapup-orchestrator-2a077zew.js → wrapup-orchestrator-bng0dfxy.js} +19 -19
  142. package/dist/{v2-archive-reader-chk95syc.js → v2-archive-reader-0fcxs5e9.js} +1 -1
  143. package/dist/{wrapup-orchestrator-rhs675kj.js → wrapup-orchestrator-r5cqgyrg.js} +22 -22
  144. package/package.json +1 -1
  145. package/src/config/schema/magic-context.ts +1 -1
  146. package/src/shared/status-view.ts +3 -5
  147. package/src/tui/dialogs/status-dialog-render.test.ts +1 -1
@@ -11,7 +11,7 @@ import {
11
11
  PER_HARNESS_MODEL_KEYS,
12
12
  ConfigProfilesSchema,
13
13
  MagicContextConfigSchema
14
- } from "./server-7zacmty5.js";
14
+ } from "./server-p9s40wfa.js";
15
15
  import {
16
16
  isCompactionEnabled,
17
17
  migrateLegacyAgentEnabledInMemory
@@ -18,7 +18,7 @@ import {
18
18
  TAG_SELECT_COLUMNS2,
19
19
  getCandidateToolOwners2,
20
20
  pickNearestPriorOwner2
21
- } from "./server-xfjjbrkt.js";
21
+ } from "./server-gwqfwtzq.js";
22
22
  import {
23
23
  OMO_INTERNAL_INITIATOR_MARKER,
24
24
  isSystemDirective,
@@ -36,7 +36,7 @@ import {
36
36
  formatBlock,
37
37
  compactTextForSummary,
38
38
  mergeCommitHashes
39
- } from "./server-969cdpmg.js";
39
+ } from "./server-7vb38e51.js";
40
40
  import {
41
41
  getHarness2
42
42
  } from "./server-pavzsdc6.js";
@@ -53,7 +53,7 @@ import {
53
53
  renderToolTemplate,
54
54
  resolveModelConfigValue,
55
55
  deriveDefaultProtectedTokens
56
- } from "./server-7zacmty5.js";
56
+ } from "./server-p9s40wfa.js";
57
57
  import {
58
58
  readRawSessionMessagesFromDb2,
59
59
  readRawSessionMessagePageFromDb2,
@@ -70,7 +70,7 @@ import {
70
70
  readRawSeedTailFromDb2,
71
71
  readRawSessionBoundaryEndpointsFromDb2,
72
72
  prewarmRawSessionOrdinalsForDb
73
- } from "./server-tnzbk64q.js";
73
+ } from "./server-b3r080cm.js";
74
74
  import {
75
75
  openCodeDbExists,
76
76
  withReadOnlySessionDb,
@@ -81,7 +81,7 @@ import {
81
81
  getToolDefinitionMeasurementSignature,
82
82
  getMeasuredToolDefinitionTokens,
83
83
  getSessionToolDefinitionTokens
84
- } from "./server-xy7w7hrd.js";
84
+ } from "./server-2j87594q.js";
85
85
  import {
86
86
  markHostUnservedRow,
87
87
  isHostUnservedRow
@@ -4338,6 +4338,9 @@ function detectLatestTurnThinkingMismatch(error) {
4338
4338
  }
4339
4339
  var PREFIX_BOUND_THINKING_MODELS = [
4340
4340
  ["fable", 5, 1],
4341
+ ["fable", 5, 2],
4342
+ ["mythos", 5, 1],
4343
+ ["mythos", 5, 2],
4341
4344
  ["opus", 5, 5],
4342
4345
  ["sonnet", 5, 5],
4343
4346
  ["haiku", 5, 5]
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  estimateTokens
3
- } from "./server-969cdpmg.js";
3
+ } from "./server-7vb38e51.js";
4
4
  import {
5
5
  expandToolPart,
6
6
  visitRawSessionMessages2,
7
7
  readRawSessionMessageById2
8
- } from "./server-kqrpt2ht.js";
8
+ } from "./server-vnpnmrsv.js";
9
9
  import {
10
10
  getTagById2
11
- } from "./server-xfjjbrkt.js";
11
+ } from "./server-gwqfwtzq.js";
12
12
 
13
13
  // src/tools/ctx-expand/render.ts
14
14
  import { createHash } from "node:crypto";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getTokenEstimatorFingerprint,
3
3
  estimateTokens
4
- } from "./server-969cdpmg.js";
4
+ } from "./server-7vb38e51.js";
5
5
  import {
6
6
  getHarness2
7
7
  } from "./server-pavzsdc6.js";
@@ -10,10 +10,10 @@ import {
10
10
  } from "./server-jb6tjyeb.js";
11
11
  import {
12
12
  isSynapseEmbeddingTruncated
13
- } from "./server-zzgtgqmd.js";
13
+ } from "./server-ddw42d76.js";
14
14
  import {
15
15
  messageFtsOrdinalRangeIsMapped2
16
- } from "./server-nmyganc8.js";
16
+ } from "./server-131h608x.js";
17
17
  import {
18
18
  isKnownAutocommit
19
19
  } from "./server-8ajstryz.js";
@@ -20,7 +20,7 @@ import {
20
20
  cortexKitProjectConfigBasePath,
21
21
  resolveLegacyConfigSourcesForHarness,
22
22
  loadPluginConfigDetailed
23
- } from "./server-avdveykk.js";
23
+ } from "./server-vjhk8v41.js";
24
24
  import {
25
25
  catalogOutputReserve,
26
26
  getSdkContextLimit,
@@ -33,7 +33,7 @@ import {
33
33
  resolvePromptSurface,
34
34
  DEFAULT_HISTORIAN_TIMEOUT_MS,
35
35
  LIVE_RELOAD_CONFIG_PATHS
36
- } from "./server-7zacmty5.js";
36
+ } from "./server-p9s40wfa.js";
37
37
  import {
38
38
  inRootAsyncContext2,
39
39
  Database2,
@@ -48,7 +48,7 @@ import {
48
48
  RawOrdinalsNotReady2,
49
49
  dropRawSessionOrdinalCheckpoints2,
50
50
  runSessionWarmupWorker
51
- } from "./server-tnzbk64q.js";
51
+ } from "./server-b3r080cm.js";
52
52
  import {
53
53
  providerMass,
54
54
  calibrationForModelKey,
@@ -64,12 +64,12 @@ import {
64
64
  foldShrunkPartTags2,
65
65
  getTagNumberByMessageId2,
66
66
  getActiveTagsBySession2
67
- } from "./server-xfjjbrkt.js";
67
+ } from "./server-gwqfwtzq.js";
68
68
  import {
69
69
  hasMeaningfulUserText2,
70
70
  estimateTokens,
71
71
  estimateFixedPromptTokens
72
- } from "./server-969cdpmg.js";
72
+ } from "./server-7vb38e51.js";
73
73
  import {
74
74
  resolveOpenCodeDbPath,
75
75
  assertOpenCodeStoreGeneration,
@@ -152,17 +152,17 @@ import {
152
152
  getRawSessionTagKeysThrough2,
153
153
  getLegacyProtectedTailStartOrdinal2,
154
154
  readSessionChunk2
155
- } from "./server-kqrpt2ht.js";
155
+ } from "./server-vnpnmrsv.js";
156
156
  import {
157
157
  BoundedSessionMap
158
- } from "./server-xy7w7hrd.js";
158
+ } from "./server-2j87594q.js";
159
159
  import {
160
160
  clearCompressionDepth,
161
161
  clearCompressionDepthRange,
162
162
  toMessageIndexSource,
163
163
  clearIndexedMessagesInTransaction,
164
164
  indexSourcesAfterOrdinal
165
- } from "./server-3m7p4g9w.js";
165
+ } from "./server-ftyc8awt.js";
166
166
  import {
167
167
  COMPARTMENT_LEASE_RENEWAL_MS,
168
168
  getCompartmentLeaseBlocker,
@@ -206,7 +206,7 @@ import {
206
206
  getProjectState,
207
207
  recordSubagentInvocation,
208
208
  getLatestHistorianInvocationId
209
- } from "./server-7qc9tk6z.js";
209
+ } from "./server-2qyfev3b.js";
210
210
  import {
211
211
  invalidateAutoEmbedSession
212
212
  } from "./server-2amn2s73.js";
@@ -219,13 +219,18 @@ import {
219
219
  replaceCompartmentChunkEmbeddings2,
220
220
  deleteChunkEmbedBackoffForSession2,
221
221
  chunkWindowSourceKey2
222
- } from "./server-cp1a03vc.js";
222
+ } from "./server-y8n33d9j.js";
223
223
  import {
224
224
  isMarkerCandidateBasisCurrent2,
225
225
  invalidateMarkerCandidateBasis2,
226
+ discardMarkerCandidateBasis2,
226
227
  readMarkerCandidateBasis2,
227
- prepareMarkerCandidateBasis2
228
- } from "./server-dwpgzm0t.js";
228
+ prepareMarkerCandidateBasis2,
229
+ readMarkerFrontiers2,
230
+ certifiedMarkerReferenceFloor2,
231
+ readMarkerReferenceRows2,
232
+ readKnownMarkerReferenceRows2
233
+ } from "./server-gwxys0d0.js";
229
234
  import {
230
235
  shouldSkipHomeProjectMemory,
231
236
  resolveProjectIdentity
@@ -236,7 +241,7 @@ import {
236
241
  getProjectChunkEmbeddingModelId2,
237
242
  getProjectEmbeddingMaxInputTokens2,
238
243
  embedItemsForProject2
239
- } from "./server-7acq7815.js";
244
+ } from "./server-2gjqhmn9.js";
240
245
  import {
241
246
  V2_MEMORY_CATEGORIES,
242
247
  CATEGORY_PRIORITY,
@@ -255,13 +260,13 @@ import {
255
260
  userFacingFailureCode,
256
261
  promoteSessionFactsDurable,
257
262
  embedPromotedFacts
258
- } from "./server-nq3cb7be.js";
263
+ } from "./server-pej5rnye.js";
259
264
  import {
260
265
  getSchemaFenceRejection,
261
266
  LATEST_SUPPORTED_VERSION,
262
267
  getPersistedSchemaVersion,
263
268
  openDatabase
264
- } from "./server-09td1wgc.js";
269
+ } from "./server-0ymsgh0j.js";
265
270
  import {
266
271
  parseCompartmentOutput,
267
272
  resolveWorkspaceShareCategories,
@@ -1564,18 +1569,27 @@ function isCompactionMarkerIntentAbsent(marker, targetEndMessageId) {
1564
1569
  return !db.prepare(`SELECT 1 FROM message WHERE id IN (?, ?)
1565
1570
  UNION ALL SELECT 1 FROM part WHERE id IN (?, ?) LIMIT 1`).get(targetEndMessageId, marker.summaryMessageId, marker.compactionPartId, marker.summaryPartId);
1566
1571
  }
1567
- function withCompactionMarkerPublicationLock(operation, sessionId) {
1572
+ function withCompactionMarkerPublicationLock(operation, sessionId, onReferencesMissing) {
1568
1573
  const db = getWritableOpenCodeDb();
1569
1574
  const snapshot = prepareMarkerReplacementSnapshot(db, sessionId);
1570
- return runMarkerWriteTransaction(db, "compaction-marker-replace", () => {
1571
- if (snapshot)
1572
- activeMarkerReplacementSnapshots.set(db, snapshot);
1573
- try {
1574
- return operation();
1575
- } finally {
1576
- activeMarkerReplacementSnapshots.delete(db);
1577
- }
1578
- });
1575
+ if (snapshot === "references-missing" && onReferencesMissing) {
1576
+ startCompactionMarkerCandidatePreparation(sessionId);
1577
+ return onReferencesMissing();
1578
+ }
1579
+ try {
1580
+ return runMarkerWriteTransaction(db, "compaction-marker-replace", () => {
1581
+ if (typeof snapshot === "object")
1582
+ activeMarkerReplacementSnapshots.set(db, snapshot);
1583
+ try {
1584
+ return operation();
1585
+ } finally {
1586
+ activeMarkerReplacementSnapshots.delete(db);
1587
+ }
1588
+ });
1589
+ } finally {
1590
+ if (warmAfterCommit.delete(sessionId) && !db.inTransaction)
1591
+ startCompactionMarkerCandidatePreparation(sessionId);
1592
+ }
1579
1593
  }
1580
1594
  function inspectCompactionMarkerPublication(sessionId, recognized, summaryText, targetBoundaryMessageId, preferred) {
1581
1595
  const db = getWritableOpenCodeDb();
@@ -1683,12 +1697,37 @@ async function prepareCompactionMarkerCandidates(sessionId, options = {}) {
1683
1697
  if (!harnessOwnsOpenCodeStore2())
1684
1698
  return true;
1685
1699
  try {
1686
- return await prepareMarkerCandidateBasis2(getWritableOpenCodeDb(), sessionId, options);
1700
+ const db = getWritableOpenCodeDb();
1701
+ if (markerDiscoveryReady(db, sessionId))
1702
+ return true;
1703
+ discardMarkerCandidateBasis2(db, sessionId);
1704
+ const prepared = await prepareMarkerCandidateBasis2(db, sessionId, {
1705
+ references: !markerReplacementSnapshots.get(db)?.has(sessionId),
1706
+ ...options
1707
+ });
1708
+ return prepared && markerDiscoveryReady(db, sessionId);
1687
1709
  } catch (error) {
1688
1710
  log2(`[magic-context] compaction-marker: deferred candidate preparation for ${sessionId}: ${error instanceof Error ? error.message : String(error)}; marker unchanged`);
1689
1711
  return false;
1690
1712
  }
1691
1713
  }
1714
+ function startCompactionMarkerCandidatePreparation(sessionId) {
1715
+ if (!harnessOwnsOpenCodeStore2())
1716
+ return "ready";
1717
+ try {
1718
+ if (markerDiscoveryReady(getWritableOpenCodeDb(), sessionId))
1719
+ return "ready";
1720
+ } catch (error) {
1721
+ log2(`[magic-context] compaction-marker: deferred candidate preparation for ${sessionId}: ${error instanceof Error ? error.message : String(error)}; marker unchanged`);
1722
+ return "unavailable";
1723
+ }
1724
+ prepareCompactionMarkerCandidates(sessionId);
1725
+ return "preparing";
1726
+ }
1727
+ function markerDiscoveryReady(db, sessionId) {
1728
+ const basis = readMarkerCandidateBasis2(db, sessionId);
1729
+ return basis !== undefined && (basis.references !== undefined || markerReplacementSnapshots.get(db)?.has(sessionId) === true);
1730
+ }
1692
1731
  function injectCompactionMarkerFromBasis(args, validatedBasis, preserveExistingLineages = false) {
1693
1732
  const db = getWritableOpenCodeDb();
1694
1733
  if (!isOpenCodeSchemaCompatible(db, getOpenCodeDbPath())) {
@@ -1783,18 +1822,7 @@ class MarkerCandidateUnavailableError extends Error {
1783
1822
  }
1784
1823
  var activeMarkerReplacementSnapshots = new WeakMap;
1785
1824
  var markerReplacementSnapshots = new WeakMap;
1786
- var MARKER_TAIL_REFERENCE_COLUMNS = `id,
1787
- CASE WHEN data LIKE '%tail_start_id%' THEN json_extract(data, '$.tail_start_id') END AS direct,
1788
- CASE WHEN data LIKE '%tail_start_id%' THEN json_extract(data, '$.compaction.tail_start_id') END AS nested`;
1789
- function readMarkerReferenceRows(db, sessionId, table, highestId) {
1790
- return db.prepare(`SELECT ${MARKER_TAIL_REFERENCE_COLUMNS} FROM ${table}
1791
- WHERE ${highestId === undefined ? "session_id = ?" : "id > ? AND +session_id = ?"}
1792
- AND ${table === "part" ? "data LIKE '%compaction%' AND json_valid(data) AND json_extract(data, '$.type') = 'compaction'" : "(data LIKE '%compaction%' OR data LIKE '%tail_start_id%') AND json_valid(data) AND (json_type(data, '$.compaction') IS NOT NULL OR json_type(data, '$.tail_start_id') IS NOT NULL)"}`).all(...highestId === undefined ? [sessionId] : [highestId, sessionId]);
1793
- }
1794
- function readKnownMarkerReferenceRows(db, sessionId, table, ids) {
1795
- const byId = db.prepare(`SELECT ${MARKER_TAIL_REFERENCE_COLUMNS} FROM ${table} WHERE id = ? AND session_id = ?`);
1796
- return ids.flatMap((id) => byId.all(id, sessionId));
1797
- }
1825
+ var warmAfterCommit = new Set;
1798
1826
  function prepareMarkerReplacementSnapshot(db, sessionId) {
1799
1827
  const sessions = markerReplacementSnapshots.get(db) ?? new Map;
1800
1828
  markerReplacementSnapshots.set(db, sessions);
@@ -1822,23 +1850,37 @@ function prepareMarkerReplacementSnapshot(db, sessionId) {
1822
1850
  sessions.delete(sessionId);
1823
1851
  return;
1824
1852
  }
1825
- const previous = sessions.get(sessionId);
1826
- const highestId = (table) => reader.prepare(`SELECT id FROM ${table} ORDER BY id DESC LIMIT 1`).all()[0]?.id ?? "";
1827
- const discover = (table, ids, highest) => previous ? [
1853
+ const cached = sessions.get(sessionId);
1854
+ let knownParts;
1855
+ for (const seed of [cached, basis.references]) {
1856
+ const floor = seed ? certifiedMarkerReferenceFloor2(reader, "part", seed.partFrontiers) : undefined;
1857
+ if (seed && floor !== undefined) {
1858
+ knownParts = { seed, floor };
1859
+ break;
1860
+ }
1861
+ }
1862
+ if (!knownParts) {
1863
+ sessions.delete(sessionId);
1864
+ discardMarkerCandidateBasis2(db, sessionId);
1865
+ log2(`[magic-context] compaction-marker: deferred replacement for ${sessionId}: part reference discovery is missing or its frontier changed; marker unchanged`);
1866
+ return "references-missing";
1867
+ }
1868
+ const discover = (table, ids, floor) => [
1828
1869
  ...new Map([
1829
- ...readKnownMarkerReferenceRows(reader, sessionId, table, ids),
1830
- ...readMarkerReferenceRows(reader, sessionId, table, highest)
1870
+ ...readKnownMarkerReferenceRows2(reader, sessionId, table, ids),
1871
+ ...readMarkerReferenceRows2(reader, sessionId, table, floor)
1831
1872
  ].map((row) => [row.id, row])).values()
1832
- ] : readMarkerReferenceRows(reader, sessionId, table);
1833
- const parts = discover("part", previous?.partIds ?? [], previous?.highestPartId ?? "");
1834
- const messages = discover("message", previous?.messageIds ?? [], previous?.highestMessageId ?? "");
1873
+ ];
1874
+ const parts = discover("part", knownParts.seed.partIds, knownParts.floor);
1875
+ const messageFloor = cached ? certifiedMarkerReferenceFloor2(reader, "message", cached.messageFrontiers) : undefined;
1876
+ const messages = cached && messageFloor !== undefined ? discover("message", cached.messageIds, messageFloor) : readMarkerReferenceRows2(reader, sessionId, "message");
1835
1877
  snapshot = {
1836
1878
  sessionId,
1837
1879
  basis,
1838
1880
  partIds: parts.map((row) => row.id),
1839
1881
  messageIds: messages.map((row) => row.id),
1840
- highestPartId: highestId("part"),
1841
- highestMessageId: highestId("message"),
1882
+ partFrontiers: readMarkerFrontiers2(reader, "part"),
1883
+ messageFrontiers: readMarkerFrontiers2(reader, "message"),
1842
1884
  references: [...parts, ...messages]
1843
1885
  };
1844
1886
  } finally {
@@ -1855,7 +1897,7 @@ function prepareMarkerReplacementSnapshot(db, sessionId) {
1855
1897
  throw error;
1856
1898
  }
1857
1899
  }
1858
- function markerRowsAreReferenced(db, snapshot, existing) {
1900
+ function markerRowsAreReferenced(db, snapshot, existing, seen) {
1859
1901
  const deleted = new Set([
1860
1902
  existing.summaryMessageId,
1861
1903
  existing.summaryPartId,
@@ -1864,13 +1906,18 @@ function markerRowsAreReferenced(db, snapshot, existing) {
1864
1906
  const referencesDeleted = (row) => !deleted.has(row.id) && [row.direct, row.nested].some((id) => typeof id === "string" && deleted.has(id));
1865
1907
  if (snapshot.references.some(referencesDeleted))
1866
1908
  throw new Error("a surviving tail_start_id references a recorded marker row; marker unchanged");
1867
- for (const [table, ids, highestId] of [
1868
- ["part", snapshot.partIds, snapshot.highestPartId],
1869
- ["message", snapshot.messageIds, snapshot.highestMessageId]
1909
+ for (const [table, ids, frontiers] of [
1910
+ ["part", snapshot.partIds, snapshot.partFrontiers],
1911
+ ["message", snapshot.messageIds, snapshot.messageFrontiers]
1870
1912
  ]) {
1871
- if (readKnownMarkerReferenceRows(db, snapshot.sessionId, table, ids).some(referencesDeleted))
1913
+ const floor = certifiedMarkerReferenceFloor2(db, table, frontiers);
1914
+ if (floor === undefined)
1915
+ throw new MarkerCandidateUnavailableError(`host ${table} frontier changed after marker reference discovery; marker unchanged`);
1916
+ if (readKnownMarkerReferenceRows2(db, snapshot.sessionId, table, ids).some(referencesDeleted))
1872
1917
  return true;
1873
- if (readMarkerReferenceRows(db, snapshot.sessionId, table, highestId).some(referencesDeleted))
1918
+ const suffix = readMarkerReferenceRows2(db, snapshot.sessionId, table, floor);
1919
+ seen[table].push(...suffix.map((row) => row.id));
1920
+ if (suffix.some(referencesDeleted))
1874
1921
  return true;
1875
1922
  }
1876
1923
  return false;
@@ -1883,19 +1930,21 @@ function replaceCompactionMarker(existing, args, preserveExistingLineages = fals
1883
1930
  const db = getWritableOpenCodeDb();
1884
1931
  connection = db;
1885
1932
  const snapshot = activeMarkerReplacementSnapshots.get(db) ?? prepareMarkerReplacementSnapshot(db, args.sessionId);
1886
- if (!snapshot || snapshot.sessionId !== args.sessionId) {
1933
+ if (typeof snapshot !== "object" || snapshot.sessionId !== args.sessionId) {
1887
1934
  return {
1888
1935
  kind: "deferred",
1889
1936
  error: new Error("marker candidate preparation pending; marker unchanged")
1890
1937
  };
1891
1938
  }
1892
1939
  const { basis } = snapshot;
1940
+ let advanceFrontiers;
1893
1941
  const marker = runMarkerWriteTransaction(db, "compaction-marker-replace", () => {
1894
1942
  entered = true;
1895
1943
  if (!isMarkerCandidateBasisCurrent2(db, basis))
1896
1944
  throw new MarkerCandidateUnavailableError("host store changed after marker candidate preparation; marker unchanged");
1945
+ const seen = { part: [], message: [] };
1897
1946
  if (existing) {
1898
- if (markerRowsAreReferenced(db, snapshot, existing))
1947
+ if (markerRowsAreReferenced(db, snapshot, existing, seen))
1899
1948
  throw new MarkerCandidateUnavailableError("a surviving tail_start_id references a recorded marker row; marker unchanged");
1900
1949
  db.prepare("DELETE FROM part WHERE id = ?").run(existing.summaryPartId);
1901
1950
  db.prepare("DELETE FROM message WHERE id = ?").run(existing.summaryMessageId);
@@ -1905,9 +1954,28 @@ function replaceCompactionMarker(existing, args, preserveExistingLineages = fals
1905
1954
  if (!replacement) {
1906
1955
  throw new Error(`failed to inject replacement marker at ordinal ${args.endOrdinal}`);
1907
1956
  }
1957
+ if (existing) {
1958
+ try {
1959
+ const partFrontiers = readMarkerFrontiers2(db, "part");
1960
+ const messageFrontiers = readMarkerFrontiers2(db, "message");
1961
+ advanceFrontiers = () => {
1962
+ snapshot.partIds = [...new Set([...snapshot.partIds, ...seen.part])];
1963
+ snapshot.messageIds = [
1964
+ ...new Set([...snapshot.messageIds, ...seen.message])
1965
+ ];
1966
+ snapshot.partFrontiers = partFrontiers;
1967
+ snapshot.messageFrontiers = messageFrontiers;
1968
+ };
1969
+ } catch {}
1970
+ }
1908
1971
  readyToCommit = true;
1909
1972
  return replacement;
1910
1973
  });
1974
+ advanceFrontiers?.();
1975
+ if (db.inTransaction)
1976
+ warmAfterCommit.add(args.sessionId);
1977
+ else
1978
+ startCompactionMarkerCandidatePreparation(args.sessionId);
1911
1979
  return { kind: "committed", marker };
1912
1980
  } catch (error) {
1913
1981
  if (error instanceof MarkerCandidateUnavailableError)
@@ -4586,7 +4654,13 @@ function publishRecoverableCompactionMarker(db, args, targetIsCurrent) {
4586
4654
  if (replacement.kind !== "committed")
4587
4655
  cut = replacement.kind === "uncertain" ? "uncertain" : "definitely-no-cut";
4588
4656
  return replacement;
4589
- }, sessionId);
4657
+ }, sessionId, () => {
4658
+ reason = "candidate-preparation";
4659
+ return {
4660
+ kind: "deferred",
4661
+ error: new Error("marker reference discovery pending; marker unchanged")
4662
+ };
4663
+ });
4590
4664
  if (result.kind === "committed") {
4591
4665
  if (!intended)
4592
4666
  throw new Error("committed marker has no publication intent");
@@ -4672,7 +4746,7 @@ function boundaryWouldDiscardUncoveredMessage(db, sessionId, ordinal, boundaryMe
4672
4746
  }
4673
4747
  return false;
4674
4748
  }
4675
- function applyDeferredCompactionMarker(db, sessionId, pending, directory, trustedBoundary) {
4749
+ function applyDeferredCompactionMarker(db, sessionId, pending, directory, trustedBoundary, options = {}) {
4676
4750
  let cut = "uncertain";
4677
4751
  let stepStartedAt = performance.now();
4678
4752
  const stepMs = [];
@@ -4728,6 +4802,8 @@ function applyDeferredCompactionMarker(db, sessionId, pending, directory, truste
4728
4802
  return { kind: "stale-skip", reason: "partial-message-boundary" };
4729
4803
  }
4730
4804
  endStep("discardCheck");
4805
+ if (options.validateOnly)
4806
+ return { kind: "deferred", reason: "candidate-preparation" };
4731
4807
  cut = "uncertain";
4732
4808
  const replacement = publishRecoverableCompactionMarker(db, {
4733
4809
  sessionId,
@@ -8513,9 +8589,6 @@ function mustMaterialize(args) {
8513
8589
  m0ToolSetHashNew: liveToolSetHash
8514
8590
  } : null;
8515
8591
  const withToolSetHashComparison = (decision) => toolSetHashComparison ? { ...decision, ...toolSetHashComparison } : decision;
8516
- if (hard.cacheExpired && hard.lastResponseTime > 0 && hard.lastResponseTime > (args.state.cachedM0MaterializedAt ?? 0)) {
8517
- return withToolSetHashComparison({ value: true, reason: "ttl_idle" });
8518
- }
8519
8592
  const hostCompaction = hard.hostCompaction;
8520
8593
  if (hostCompaction !== undefined && hostCompaction.completedAt > (args.state.cachedM0MaterializedAt ?? 0)) {
8521
8594
  return withToolSetHashComparison({ value: true, reason: "host_compaction" });
@@ -15941,4 +16014,4 @@ ${failure}`;
15941
16014
  }
15942
16015
  }
15943
16016
 
15944
- export { historianRunConfig, dreamerRunConfig, pluginConfigReader, currentPluginConfigReader, withLiveDreamerOutputCap, v2ToolDefinitionsHash, readCoordinateGeneration, rebaseSessionCoordinatesAsync, HiddenCompletionRefusal, getOpenCodeDbPath, compareOpenCodeMessagesByCanonicalOrder, prepareCompactionMarkerCandidates, removeMcOwnedCompactionMarkers, getCompartmentEvents, USER_MEMORY_CANDIDATE_TTL_MS, insertUserMemoryCandidates, getUserMemoryCandidates, deleteUserMemoryCandidates, pruneExpiredUserMemoryCandidates, insertUserMemory, getActiveUserMemories, updateUserMemoryContent, dismissUserMemory, DreamerProviderOutputFailureError, withDreamerModelCooldown, providerOutputFailureFromInvalidManifest, DREAMER_AGENT, DREAMER_RETROSPECTIVE_AGENT, DREAMER_PRIMER_INVESTIGATOR_AGENT, DREAMER_MEMORY_MAPPER_AGENT, DREAMER_CLASSIFIER_AGENT, DREAMER_DOCS_AGENT, DREAMER_REVIEWER_AGENT, HIDDEN_HISTORIAN_AGENT, HIDDEN_DREAMER_AGENT, HIDDEN_CURATE_AGENT, hiddenAgentFor, hiddenToolLoop, HIDDEN_RUN_DISPOSED_REASON, noteChildOfDisposedInstance, hiddenChildPermissions, registerHiddenChildAgents, hiddenToolCallRefusal, HiddenAgentStepLimit, HiddenChildHook, extractLatestAssistantText, hasLengthCappedOutput, parseProviderModel, modelBodyField, toModelEntry, ModelProducedNoOutputError, noteModelActivityMonitored, noteModelOutputReceived, isPromptTimeoutError, getPromptFailureDetail, raceWithSignal, promptSyncWithValidatedOutputRetry, normalizeSDKResponse, annotateSubagentInvocationError, failedInvocationStatus, emptyTokenTotals, sumTokensFromChildMessages, recordChildInvocation, createPromptAsyncTransport, CTX_NOTE_LIGHT_DESCRIPTION, ACTIVE_TOOL_IDS, systemPromptFingerprint, createPromptSurfaceRuntime, createPromptSurfaceGuidanceEpochCache, MARKER_SUMMARY_TEXT, markerUpdateDefinitelyDidNotCut, applyDeferredCompactionMarker, teardownChildSession, runTokenLog, formatRunTokenLog, createChildSessionWithFence, buildMagicContextSection, getMuralIdentity, getMural, modelKeyAcceptsImages, resolveMuralWire, extractM0Block, formatDate, TEMPORAL_MARKER_REPLAY_PATTERN, collectTemporalCandidates, injectTemporalMarkers, clearInjectionCache, getVisibleMemoryIds, selectHiddenMessagesAtCompactionSeam, prepareCompartmentInjection, renderCompartmentInjection, MaterializeContentionError, mustMaterialize, trimMemoriesToBudgetV2, renderMemoryBlockV2, materializeM0, hydrateCachedM0Mural, resetPrefixTrimFallbackState, findHostCompactionWindow, capturePrefixTrimSourceOrder, prepareCachedM0M1Replay, hasCompleteCachedM0M1, injectM0M1, clampProducerAtomChars, producerInputTokenLimit, historianProducerReserve, producerPromptFailureReason, resolveHiddenCompletionExecutor, createV1HiddenCompletionExecutor, shouldWaitForNewHistorianHistory, EMPTY_READ_REPLY, noteTouchedAt, renderGlance, renderNotesById, formatWriteReply, observeNoteNudgeServe, onNoteTrigger, peekNoteNudgeText, markNoteNudgeDelivered, clearNoteNudgeTriggerAndCooldown, omitIncompleteFileTokenTotals, describeBoundaryDiagnostics, RECOVERY_NO_HEAD_LIMIT, deriveProtectedTailTokenTarget, selectPerRunCap, resolveOpenCodeProtectedTailBoundary, resolveWrapupProtectedTailBoundary, getRawHistoryEligibility, hasRunnableCompartmentWindow, recordHighPressureNoEligibleHead, noteTransformPassForExactOrdinalReads, runCompartmentAgent, getActiveCompartmentRun, markActiveCompartmentRunPublished, registerActiveCompartmentRun, startCompartmentAgent, isRecompFailure2, isRecompSkip2, extractRecompReason2, setRecompStarting2, setRecompNote2, setRecompTerminal2, buildRecompDeps2, runManagedRecomp2 };
16017
+ export { historianRunConfig, dreamerRunConfig, pluginConfigReader, currentPluginConfigReader, withLiveDreamerOutputCap, v2ToolDefinitionsHash, readCoordinateGeneration, rebaseSessionCoordinatesAsync, HiddenCompletionRefusal, getOpenCodeDbPath, compareOpenCodeMessagesByCanonicalOrder, startCompactionMarkerCandidatePreparation, removeMcOwnedCompactionMarkers, getCompartmentEvents, USER_MEMORY_CANDIDATE_TTL_MS, insertUserMemoryCandidates, getUserMemoryCandidates, deleteUserMemoryCandidates, pruneExpiredUserMemoryCandidates, insertUserMemory, getActiveUserMemories, updateUserMemoryContent, dismissUserMemory, DreamerProviderOutputFailureError, withDreamerModelCooldown, providerOutputFailureFromInvalidManifest, DREAMER_AGENT, DREAMER_RETROSPECTIVE_AGENT, DREAMER_PRIMER_INVESTIGATOR_AGENT, DREAMER_MEMORY_MAPPER_AGENT, DREAMER_CLASSIFIER_AGENT, DREAMER_DOCS_AGENT, DREAMER_REVIEWER_AGENT, HIDDEN_HISTORIAN_AGENT, HIDDEN_DREAMER_AGENT, HIDDEN_CURATE_AGENT, hiddenAgentFor, hiddenToolLoop, HIDDEN_RUN_DISPOSED_REASON, noteChildOfDisposedInstance, hiddenChildPermissions, registerHiddenChildAgents, hiddenToolCallRefusal, HiddenAgentStepLimit, HiddenChildHook, extractLatestAssistantText, hasLengthCappedOutput, parseProviderModel, modelBodyField, toModelEntry, ModelProducedNoOutputError, noteModelActivityMonitored, noteModelOutputReceived, isPromptTimeoutError, getPromptFailureDetail, raceWithSignal, promptSyncWithValidatedOutputRetry, normalizeSDKResponse, annotateSubagentInvocationError, failedInvocationStatus, emptyTokenTotals, sumTokensFromChildMessages, recordChildInvocation, createPromptAsyncTransport, CTX_NOTE_LIGHT_DESCRIPTION, ACTIVE_TOOL_IDS, systemPromptFingerprint, createPromptSurfaceRuntime, createPromptSurfaceGuidanceEpochCache, MARKER_SUMMARY_TEXT, markerUpdateDefinitelyDidNotCut, applyDeferredCompactionMarker, teardownChildSession, runTokenLog, formatRunTokenLog, createChildSessionWithFence, buildMagicContextSection, getMuralIdentity, getMural, modelKeyAcceptsImages, resolveMuralWire, extractM0Block, formatDate, TEMPORAL_MARKER_REPLAY_PATTERN, collectTemporalCandidates, injectTemporalMarkers, clearInjectionCache, getVisibleMemoryIds, selectHiddenMessagesAtCompactionSeam, prepareCompartmentInjection, renderCompartmentInjection, MaterializeContentionError, mustMaterialize, trimMemoriesToBudgetV2, renderMemoryBlockV2, materializeM0, hydrateCachedM0Mural, resetPrefixTrimFallbackState, findHostCompactionWindow, capturePrefixTrimSourceOrder, prepareCachedM0M1Replay, hasCompleteCachedM0M1, injectM0M1, clampProducerAtomChars, producerInputTokenLimit, historianProducerReserve, producerPromptFailureReason, resolveHiddenCompletionExecutor, createV1HiddenCompletionExecutor, shouldWaitForNewHistorianHistory, EMPTY_READ_REPLY, noteTouchedAt, renderGlance, renderNotesById, formatWriteReply, observeNoteNudgeServe, onNoteTrigger, peekNoteNudgeText, markNoteNudgeDelivered, clearNoteNudgeTriggerAndCooldown, omitIncompleteFileTokenTotals, describeBoundaryDiagnostics, RECOVERY_NO_HEAD_LIMIT, deriveProtectedTailTokenTarget, selectPerRunCap, resolveOpenCodeProtectedTailBoundary, resolveWrapupProtectedTailBoundary, getRawHistoryEligibility, hasRunnableCompartmentWindow, recordHighPressureNoEligibleHead, noteTransformPassForExactOrdinalReads, runCompartmentAgent, getActiveCompartmentRun, markActiveCompartmentRunPublished, registerActiveCompartmentRun, startCompartmentAgent, isRecompFailure2, isRecompSkip2, extractRecompReason2, setRecompStarting2, setRecompNote2, setRecompTerminal2, buildRecompDeps2, runManagedRecomp2 };
package/dist/v2/server.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  loadPluginConfigDetailed
3
- } from "./server-avdveykk.js";
3
+ } from "./server-vjhk8v41.js";
4
4
  import {
5
5
  setHarness2
6
6
  } from "./server-pavzsdc6.js";
@@ -22,7 +22,7 @@ import {
22
22
  union,
23
23
  tuple,
24
24
  record
25
- } from "./server-7zacmty5.js";
25
+ } from "./server-p9s40wfa.js";
26
26
  import {
27
27
  pushNotification2
28
28
  } from "./server-x8a7jmkh.js";
@@ -7875,7 +7875,7 @@ var require_src2 = __commonJS(function(exports, module) {
7875
7875
  // package.json
7876
7876
  var package_default = {
7877
7877
  name: "@cortexkit/opencode-magic-context",
7878
- version: "0.49.43",
7878
+ version: "0.49.45",
7879
7879
  type: "module",
7880
7880
  description: "OpenCode plugin for Magic Context — cross-session memory and context management",
7881
7881
  main: "dist/index.js",
@@ -8196,7 +8196,7 @@ async function setup(context) {
8196
8196
  if (claimStorageBackupWarningCheck() && isMagicContextStorageOutsideEngram(storageDir)) {
8197
8197
  log2(`[magic-context] Magic Context storage is at ${storageDir}, outside the folder Engram backs up (~/.local/share/cortexkit/magic-context). It is not included in CortexKit backups.`);
8198
8198
  }
8199
- const { registerContext } = await import("./context-2xr6vbt2.js");
8199
+ const { registerContext } = await import("./context-0e946t63.js");
8200
8200
  setHarness2("opencode2");
8201
8201
  bindStaleBuildNotice({}, import.meta.url, "opencode2");
8202
8202
  const duties = await registerContext(context);
@@ -63,10 +63,10 @@ import {
63
63
  adoptNullOwnerToolTag2,
64
64
  getCandidateToolOwners2,
65
65
  pickNearestPriorOwner2
66
- } from "./server-xfjjbrkt.js";
66
+ } from "./server-gwqfwtzq.js";
67
67
  import"./server-1zx87sdm.js";
68
68
  import"./server-tpt7bwq8.js";
69
- import"./server-969cdpmg.js";
69
+ import"./server-7vb38e51.js";
70
70
  import"./server-gzy5w8ya.js";
71
71
  import"./server-jb6tjyeb.js";
72
72
  import"./server-pavzsdc6.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  readV2ArchiveOffThread2,
3
3
  serveV2ArchiveReads2
4
- } from "./server-sfcp13bn.js";
4
+ } from "./server-an1ff8d8.js";
5
5
  import"./server-v0p37hm2.js";
6
6
  import"./server-gzy5w8ya.js";
7
7
  import"./server-1d042x6w.js";
@@ -11,20 +11,20 @@ import {
11
11
  releaseCompartmentLeaseBestEffort,
12
12
  getCompartments,
13
13
  getLastCompartmentEndMessage
14
- } from "./server-7qc9tk6z.js";
14
+ } from "./server-2qyfev3b.js";
15
15
  import"./server-2amn2s73.js";
16
- import"./server-969cdpmg.js";
17
- import"./server-zzgtgqmd.js";
16
+ import"./server-7vb38e51.js";
17
+ import"./server-ddw42d76.js";
18
18
  import {
19
19
  inRootAsyncContext2
20
20
  } from "./server-gzy5w8ya.js";
21
21
  import"./server-v0p37hm2.js";
22
22
  import"./server-96ztjvkn.js";
23
23
  import"./server-1d042x6w.js";
24
- import"./server-tnzbk64q.js";
25
- import"./server-nmyganc8.js";
26
- import"./server-cp1a03vc.js";
27
- import"./server-3m7p4g9w.js";
24
+ import"./server-b3r080cm.js";
25
+ import"./server-131h608x.js";
26
+ import"./server-y8n33d9j.js";
27
+ import"./server-ftyc8awt.js";
28
28
  import {
29
29
  getWrapupInProgressState,
30
30
  acquireWrapupInProgress,
@@ -33,15 +33,15 @@ import {
33
33
  getHistorianFailureState,
34
34
  clearEmergencyRecovery,
35
35
  prepareRawSessionOrdinals2
36
- } from "./server-kqrpt2ht.js";
36
+ } from "./server-vnpnmrsv.js";
37
37
  import"./server-tpt7bwq8.js";
38
- import"./server-09td1wgc.js";
38
+ import"./server-0ymsgh0j.js";
39
39
  import"./server-1zx87sdm.js";
40
- import"./server-xfjjbrkt.js";
41
- import"./server-7zacmty5.js";
40
+ import"./server-gwqfwtzq.js";
41
+ import"./server-p9s40wfa.js";
42
42
  import"./server-2ra6pwf3.js";
43
43
  import"./server-mfn1yf9d.js";
44
- import"./server-xy7w7hrd.js";
44
+ import"./server-2j87594q.js";
45
45
  import"./server-fr0wbhdn.js";
46
46
  import"./server-3schkz95.js";
47
47
  import"./server-69m30b21.js";
@@ -52,7 +52,7 @@ import"./server-ypf1ap0v.js";
52
52
  import {
53
53
  pushNotification2
54
54
  } from "./server-x8a7jmkh.js";
55
- import"./server-dwpgzm0t.js";
55
+ import"./server-gwxys0d0.js";
56
56
  import {
57
57
  describeBoundaryDiagnostics,
58
58
  resolveWrapupProtectedTailBoundary,
@@ -63,16 +63,16 @@ import {
63
63
  registerActiveCompartmentRun,
64
64
  setRecompStarting2,
65
65
  setRecompTerminal2
66
- } from "./server-5ydn39x3.js";
66
+ } from "./server-zqzh2ybj.js";
67
67
  import"./server-qt1qqasc.js";
68
- import"./server-7acq7815.js";
68
+ import"./server-2gjqhmn9.js";
69
69
  import"./server-dcws5831.js";
70
70
  import"./server-4dhv7mqz.js";
71
- import"./server-6vzh6wej.js";
72
- import"./server-gkse1wyz.js";
71
+ import"./server-sg2qjkrb.js";
72
+ import"./server-sr8tf5dt.js";
73
73
  import"./server-jjvbk92s.js";
74
- import"./server-nq3cb7be.js";
75
- import"./server-avdveykk.js";
74
+ import"./server-pej5rnye.js";
75
+ import"./server-vjhk8v41.js";
76
76
  import"./server-qxzbmtqt.js";
77
77
  import"./server-sd8hvzte.js";
78
78
  import"./server-f0j864ma.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  readV2ArchiveOffThread2,
3
3
  serveV2ArchiveReads2
4
- } from "./index-n8bsqg7b.js";
4
+ } from "./index-7na94cjf.js";
5
5
  import"./index-v0p37hm2.js";
6
6
  import"./index-gzy5w8ya.js";
7
7
  import"./index-1d042x6w.js";