@cortexkit/opencode-magic-context 0.49.103 → 0.49.105

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 (166) hide show
  1. package/dist/auto-search-worker.js +5 -5
  2. package/dist/chunk-embedding-write-worker.js +8 -5
  3. package/dist/{context-jk7bgc3s.js → context-wtnrsjkp.js} +116 -139
  4. package/dist/{embedding-backfill-anty7zdf.js → embedding-backfill-kqwx0vhj.js} +6 -6
  5. package/dist/{v2/embedding-cache-dveynq4m.js → embedding-cache-fhdkn9nc.js} +3 -1
  6. package/dist/embedding-worker.js +1 -1
  7. package/dist/features/magic-context/chunk-embedding-write-worker-install-failure.fixture.d.ts +2 -0
  8. package/dist/features/magic-context/chunk-embedding-write-worker-install-failure.fixture.d.ts.map +1 -0
  9. package/dist/features/magic-context/chunk-scope-repair-revision.d.ts +16 -1
  10. package/dist/features/magic-context/chunk-scope-repair-revision.d.ts.map +1 -1
  11. package/dist/features/magic-context/dreamer/task-executor.d.ts.map +1 -1
  12. package/dist/features/magic-context/dreamer/verify-checkout.d.ts +2 -0
  13. package/dist/features/magic-context/dreamer/verify-checkout.d.ts.map +1 -0
  14. package/dist/features/magic-context/memory/embedding-cache.d.ts +1 -0
  15. package/dist/features/magic-context/memory/embedding-cache.d.ts.map +1 -1
  16. package/dist/features/magic-context/memory/embedding-worker-client.d.ts.map +1 -1
  17. package/dist/features/magic-context/memory/embedding-worker-loop.d.ts +9 -1
  18. package/dist/features/magic-context/memory/embedding-worker-loop.d.ts.map +1 -1
  19. package/dist/features/magic-context/memory/embedding-worker-observer.fixture.d.ts +26 -0
  20. package/dist/features/magic-context/memory/embedding-worker-observer.fixture.d.ts.map +1 -0
  21. package/dist/features/magic-context/message-fts-rowid-map-startup-worker-test-support.d.ts +2 -0
  22. package/dist/features/magic-context/message-fts-rowid-map-startup-worker-test-support.d.ts.map +1 -0
  23. package/dist/features/magic-context/project-embedding-registry.d.ts +5 -0
  24. package/dist/features/magic-context/project-embedding-registry.d.ts.map +1 -1
  25. package/dist/features/magic-context/search-pool-fixture.d.ts +15 -0
  26. package/dist/features/magic-context/search-pool-fixture.d.ts.map +1 -1
  27. package/dist/features/magic-context/storage-db.d.ts.map +1 -1
  28. package/dist/hooks/magic-context/compartment-runner-incremental.d.ts.map +1 -1
  29. package/dist/hooks/magic-context/compartment-runner-types.d.ts +4 -1
  30. package/dist/hooks/magic-context/compartment-runner-types.d.ts.map +1 -1
  31. package/dist/hooks/magic-context/compartment-runner.d.ts.map +1 -1
  32. package/dist/hooks/magic-context/history-boundary-repair.d.ts +7 -2
  33. package/dist/hooks/magic-context/history-boundary-repair.d.ts.map +1 -1
  34. package/dist/hooks/magic-context/transform-compartment-phase.d.ts +1 -0
  35. package/dist/hooks/magic-context/transform-compartment-phase.d.ts.map +1 -1
  36. package/dist/hooks/magic-context/transform.d.ts +1 -0
  37. package/dist/hooks/magic-context/transform.d.ts.map +1 -1
  38. package/dist/{index-3nxhxeeg.js → index-1j4q0bd6.js} +4 -4
  39. package/dist/{index-fd3hkyk1.js → index-42fsf88t.js} +1 -1
  40. package/dist/{v2/server-qbydvfev.js → index-6xg55350.js} +15 -11
  41. package/dist/{index-jjxpmypb.js → index-7z5cvfpg.js} +1 -1
  42. package/dist/{index-jg5whyrd.js → index-8vv7axxg.js} +3 -3
  43. package/dist/{index-42fg6tzz.js → index-92p5yfpp.js} +4 -4
  44. package/dist/{index-7jvc0rhh.js → index-9m2b5mwf.js} +21 -8
  45. package/dist/{index-9mxkvdtp.js → index-a3t1ck7g.js} +8 -8
  46. package/dist/{index-vhx6yph7.js → index-as8bg7eh.js} +367 -115
  47. package/dist/{index-jyj9jg9f.js → index-cxh5g5bt.js} +2 -2
  48. package/dist/{index-vegw385y.js → index-cy5fn70d.js} +89 -1
  49. package/dist/{index-4dywj733.js → index-dzb1yc9w.js} +1 -1
  50. package/dist/{index-t2h3484a.js → index-edafv9d7.js} +5 -5
  51. package/dist/{index-6t6v8prs.js → index-ff1hqh4a.js} +3 -3
  52. package/dist/{index-ke0mkz7g.js → index-g1h1efr0.js} +1 -1
  53. package/dist/{index-f455a0g3.js → index-k37h4yrb.js} +5 -3
  54. package/dist/{index-mes48s7a.js → index-mg6cwqw2.js} +220 -27
  55. package/dist/{index-nyjztqyj.js → index-p5ey52j9.js} +32 -5
  56. package/dist/{index-pw1f07vg.js → index-srpghrje.js} +1 -1
  57. package/dist/{index-4536jdzj.js → index-xzs1fxzz.js} +2 -2
  58. package/dist/{index-hyvxmz3e.js → index-y1875y4h.js} +1 -1
  59. package/dist/{index-4v50y0jr.js → index-ydevzvfs.js} +1 -1
  60. package/dist/{index-ab86c21b.js → index-zj0ra8vs.js} +1 -1
  61. package/dist/index.js +53 -62
  62. package/dist/migration-worker.js +3 -3
  63. package/dist/{project-embedding-registry-4cv7n37m.js → project-embedding-registry-0z0nd73p.js} +5 -5
  64. package/dist/raw-ordinal-warmup-worker.js +2 -2
  65. package/dist/{recomp-orchestrator-vg4cxyp7.js → recomp-orchestrator-zagjzbz5.js} +15 -15
  66. package/dist/{render-f32trg2t.js → render-vwp72qd0.js} +6 -6
  67. package/dist/{search-ygtyb91s.js → search-7e1rcqb7.js} +12 -12
  68. package/dist/{search-archive-yh6xtvrx.js → search-archive-6tr0gcf7.js} +2 -2
  69. package/dist/shared/sqlite-busy-test-support.d.ts +21 -0
  70. package/dist/shared/sqlite-busy-test-support.d.ts.map +1 -0
  71. package/dist/shared/sqlite-write-locker-test-support.d.ts +12 -0
  72. package/dist/shared/sqlite-write-locker-test-support.d.ts.map +1 -1
  73. package/dist/{storage-memory-p91f7b5h.js → storage-memory-24hsvzy8.js} +2 -2
  74. package/dist/{store-wpx314rk.js → store-4eeezg83.js} +2 -2
  75. package/dist/{store-reader-c5fwa9qx.js → store-reader-g8w2wp88.js} +1 -1
  76. package/dist/{transform-postprocess-phase-958fmjs5.js → transform-postprocess-phase-v3p3q2gf.js} +16 -16
  77. package/dist/v2/auto-search-worker.js +5 -5
  78. package/dist/v2/chunk-embedding-write-worker.js +8 -5
  79. package/dist/v2/{context-3g3jvxg8.js → context-fbdac7qt.js} +166 -150
  80. package/dist/v2/{embedding-backfill-ra9gbbs4.js → embedding-backfill-e44pv5db.js} +6 -6
  81. package/dist/{embedding-cache-dveynq4m.js → v2/embedding-cache-fhdkn9nc.js} +3 -1
  82. package/dist/v2/embedding-worker.js +1 -1
  83. package/dist/v2/event-subscription.fixture.d.ts +9 -0
  84. package/dist/v2/event-subscription.fixture.d.ts.map +1 -0
  85. package/dist/v2/hidden-model-activity.d.ts +13 -0
  86. package/dist/v2/hidden-model-activity.d.ts.map +1 -1
  87. package/dist/v2/hooks/context.d.ts +1 -0
  88. package/dist/v2/hooks/context.d.ts.map +1 -1
  89. package/dist/v2/hooks/dream-trigger.d.ts +2 -1
  90. package/dist/v2/hooks/dream-trigger.d.ts.map +1 -1
  91. package/dist/v2/hooks/event-subscription-worker.d.ts +11 -0
  92. package/dist/v2/hooks/event-subscription-worker.d.ts.map +1 -0
  93. package/dist/v2/hooks/types.d.ts +1 -0
  94. package/dist/v2/hooks/types.d.ts.map +1 -1
  95. package/dist/v2/hooks/update-check.d.ts +1 -0
  96. package/dist/v2/hooks/update-check.d.ts.map +1 -1
  97. package/dist/v2/{message-index-bounded-j1sxtefe.js → message-index-bounded-nwqfb1p5.js} +3 -3
  98. package/dist/v2/migration-worker.js +3 -3
  99. package/dist/v2/{project-embedding-registry-gdaqb7h0.js → project-embedding-registry-rhzjnypp.js} +5 -5
  100. package/dist/v2/raw-ordinal-warmup-worker.js +4 -4
  101. package/dist/v2/{read-session-chunk-p6z3kmdj.js → read-session-chunk-brqatg83.js} +2 -2
  102. package/dist/v2/{recomp-orchestrator-29m3cc5b.js → recomp-orchestrator-1ech6k2n.js} +17 -17
  103. package/dist/v2/{render-jpj43axy.js → render-pfe3smhx.js} +10 -10
  104. package/dist/v2/{search-archive-wbhxp0p1.js → search-archive-r8krrz47.js} +5 -5
  105. package/dist/v2/{search-ybyc7vmx.js → search-sffewrs4.js} +15 -15
  106. package/dist/v2/{server-kx5egpt7.js → server-16115spd.js} +4 -4
  107. package/dist/v2/server-28jqb7s0.js +6 -0
  108. package/dist/v2/{server-qg8jyfxa.js → server-5xx10mqe.js} +1 -1
  109. package/dist/{index-qbydvfev.js → v2/server-6xg55350.js} +15 -11
  110. package/dist/v2/{server-t45hgcsg.js → server-7jw608jk.js} +2 -2
  111. package/dist/v2/{server-8f92sd2r.js → server-7pxjk184.js} +6 -4
  112. package/dist/v2/{server-3mb205v9.js → server-83rjf4df.js} +1 -1
  113. package/dist/v2/{server-df5scn4q.js → server-9t4yjj20.js} +27 -12
  114. package/dist/v2/{server-ga6y57vh.js → server-c32505fr.js} +6 -4
  115. package/dist/v2/{server-8m5wk6aq.js → server-cpb7b1f9.js} +5 -5
  116. package/dist/v2/{server-qdpd8h27.js → server-fn6k1ack.js} +1 -1
  117. package/dist/v2/{server-1qxdyz4p.js → server-ghb2q1z9.js} +2 -2
  118. package/dist/v2/{server-pqgnjf38.js → server-gkb0y83n.js} +32 -5
  119. package/dist/v2/{server-r851hxn5.js → server-hqcdvs2n.js} +13 -13
  120. package/dist/v2/{server-9ms9b75c.js → server-j00jprwm.js} +4 -6
  121. package/dist/v2/{server-xpy46ddq.js → server-jtd5vq5e.js} +3 -3
  122. package/dist/v2/{server-b01a7dhj.js → server-kk2kbzq3.js} +1 -1
  123. package/dist/v2/{server-mc5t7k8v.js → server-ma0qhqg9.js} +1 -1
  124. package/dist/v2/{server-x22jtpna.js → server-n3bfqd0j.js} +4 -2
  125. package/dist/v2/{server-fagcnt6j.js → server-pjvqyg6g.js} +367 -115
  126. package/dist/v2/{server-jrs4gny6.js → server-qtajgx1e.js} +89 -1
  127. package/dist/v2/{server-pw1f07vg.js → server-srpghrje.js} +1 -1
  128. package/dist/v2/server-t104h957.js +177 -0
  129. package/dist/v2/{server-j09jx1n9.js → server-v2r04xds.js} +1 -1
  130. package/dist/v2/{server-7c5p0bh1.js → server-z77hman6.js} +1 -1
  131. package/dist/v2/server.js +31 -40
  132. package/dist/v2/{storage-memory-p91f7b5h.js → storage-memory-24hsvzy8.js} +2 -2
  133. package/dist/v2/{storage-tags-s7nvvyg8.js → storage-tags-ee72g2zv.js} +1 -1
  134. package/dist/v2/{store-mba47sxn.js → store-9rsrj5pt.js} +2 -2
  135. package/dist/v2/{store-reader-w7w8vfsy.js → store-reader-tb0f9621.js} +1 -1
  136. package/dist/v2/store-reader.d.ts +1 -1
  137. package/dist/v2/store-reader.d.ts.map +1 -1
  138. package/dist/v2/tui/index.d.ts.map +1 -1
  139. package/dist/v2/{v2-archive-reader-5njmg3a3.js → v2-archive-reader-0xysfgxh.js} +1 -1
  140. package/dist/v2/{wrapup-orchestrator-ahkq8a61.js → wrapup-orchestrator-8d4ak3x3.js} +17 -17
  141. package/dist/{v2-archive-reader-y38khjax.js → v2-archive-reader-fac1zmhj.js} +1 -1
  142. package/dist/{wrapup-orchestrator-gjqaac65.js → wrapup-orchestrator-wz10b94c.js} +16 -16
  143. package/package.json +1 -1
  144. package/src/config/migrate-config-location.test.ts +41 -29
  145. package/src/shared/model-suggestion-retry.test.ts +137 -90
  146. package/src/shared/off-thread-migration-clock.test.ts +19 -9
  147. package/src/shared/prompt-async-transport.test.ts +125 -42
  148. package/src/shared/rpc-async-probes.test.ts +56 -36
  149. package/src/shared/rpc-client.test.ts +51 -18
  150. package/src/shared/sqlite-acquisition-routing.test.ts +79 -22
  151. package/src/shared/sqlite-busy-budget-review.test.ts +129 -111
  152. package/src/shared/sqlite-busy-test-support.ts +154 -0
  153. package/src/shared/sqlite-foreground-wait.test.ts +213 -156
  154. package/src/shared/sqlite-pass-scope.test.ts +142 -105
  155. package/src/shared/sqlite-turn-deadline.test.ts +149 -124
  156. package/src/shared/sqlite-write-locker-test-support.ts +44 -12
  157. package/src/shared/stable-json-linear.test.ts +29 -11
  158. package/src/shared/startup-maintenance-policy.test.ts +72 -2
  159. package/src/shared/storage-busy.test.ts +45 -18
  160. package/src/shared/storage-file-mutex-review.test.ts +65 -51
  161. package/src/shared/tui-preferences.test.ts +15 -5
  162. package/src/shared/worker-shutdown.test.ts +26 -20
  163. package/src/tui/data/notification-socket.test.ts +220 -108
  164. package/src/v2/tui/index.ts +5 -1
  165. package/src/v2/tui/status-dialog-fallback.test.ts +23 -1
  166. package/dist/v2/server-84w6rvvf.js +0 -14
@@ -116,13 +116,13 @@ import {
116
116
  import {
117
117
  shouldSkipHomeProjectMemory,
118
118
  resolveProjectIdentity
119
- } from "./index-vegw385y.js";
119
+ } from "./index-cy5fn70d.js";
120
120
  import {
121
121
  getSchemaFenceRejection,
122
122
  LATEST_SUPPORTED_VERSION,
123
123
  getPersistedSchemaVersion,
124
124
  openDatabase
125
- } from "./index-f455a0g3.js";
125
+ } from "./index-k37h4yrb.js";
126
126
  import {
127
127
  areRustHistorianSyntheticParts2,
128
128
  isStrictGapHealingMessage2,
@@ -139,7 +139,7 @@ import {
139
139
  resolveStoredPathWorkspaceIdentity,
140
140
  sourceNameForMemory,
141
141
  computeWorkspaceEpochFingerprint
142
- } from "./index-hyvxmz3e.js";
142
+ } from "./index-y1875y4h.js";
143
143
  import {
144
144
  BoundedSessionMap
145
145
  } from "./index-xtv4d4hv.js";
@@ -214,7 +214,7 @@ import {
214
214
  getProjectState,
215
215
  recordSubagentInvocation,
216
216
  getLatestHistorianInvocationId
217
- } from "./index-4536jdzj.js";
217
+ } from "./index-xzs1fxzz.js";
218
218
  import {
219
219
  clearCompressionDepth,
220
220
  clearCompressionDepthRange,
@@ -282,7 +282,7 @@ import {
282
282
  getSessionNotes,
283
283
  getReadySmartNotes,
284
284
  insertPrimerCandidates
285
- } from "./index-ab86c21b.js";
285
+ } from "./index-zj0ra8vs.js";
286
286
  import {
287
287
  pushNotification2
288
288
  } from "./index-y14pawe1.js";
@@ -293,20 +293,20 @@ import {
293
293
  getMemoriesByProject2,
294
294
  getMemoriesByProjects2,
295
295
  getMaxMemoryIdForProjects2
296
- } from "./index-pw1f07vg.js";
296
+ } from "./index-srpghrje.js";
297
297
  import {
298
298
  contentSha2562,
299
299
  enqueueShadowEmbeddingItems2,
300
300
  getProjectChunkEmbeddingModelId2,
301
301
  getProjectEmbeddingMaxInputTokens2,
302
302
  embedItemsWindowBounded2
303
- } from "./index-vhx6yph7.js";
303
+ } from "./index-as8bg7eh.js";
304
304
  import {
305
305
  renderUserFacingFailure,
306
306
  userFacingFailureCode,
307
307
  promoteSessionFactsDurable,
308
308
  embedPromotedFacts
309
- } from "./index-42fg6tzz.js";
309
+ } from "./index-92p5yfpp.js";
310
310
  import {
311
311
  isMarkerCandidateBasisCurrent2,
312
312
  invalidateMarkerCandidateBasis2,
@@ -18112,6 +18112,10 @@ async function runCompartmentAgent(deps) {
18112
18112
  const producerKey = (typeof deps.model === "string" ? deps.model : deps.model?.model) ?? deps.fallbackModelId;
18113
18113
  const historianChunkTokens = producerSourceLocalBudget2(providerHistorianChunkTokens, producerKey);
18114
18114
  const ordinalsReady = await prepareRawSessionOrdinals2(sessionId);
18115
+ if (deps.isHistorianInstanceDisposed?.()) {
18116
+ updateSessionMeta(db, sessionId, { compartmentInProgress: false });
18117
+ return;
18118
+ }
18115
18119
  let completedSuccessfully = false;
18116
18120
  let publishCommitted = false;
18117
18121
  let retainDrainReservationForRetryThrottle = false;
@@ -18300,6 +18304,11 @@ async function runCompartmentAgent(deps) {
18300
18304
  }
18301
18305
  throw error;
18302
18306
  }
18307
+ if (deps.isHistorianInstanceDisposed?.()) {
18308
+ telemetry.status = "noop";
18309
+ telemetry.failureReason = "hidden_instance_disposed";
18310
+ return;
18311
+ }
18303
18312
  if (checked.kind === "not-ready") {
18304
18313
  deferUntilOrdinalsReady(`boundary validation ${checked.reason}`);
18305
18314
  return;
@@ -19927,6 +19936,10 @@ function startBackgroundCompartmentAgent(deps, runAgent, prepareBoundary) {
19927
19936
  }
19928
19937
  });
19929
19938
  const promise = new Promise((resolve) => setTimeout(resolve, 0)).then(() => withRawSessionMessageCache2(() => {
19939
+ if (deps.isHistorianInstanceDisposed?.()) {
19940
+ updateSessionMeta(deps.db, deps.sessionId, { compartmentInProgress: false });
19941
+ return;
19942
+ }
19930
19943
  const snapshot = deps.boundarySnapshot;
19931
19944
  try {
19932
19945
  primeTailRawMessageCache2({
@@ -39,13 +39,13 @@ import {
39
39
  enqueueShadowEmbeddingItems2,
40
40
  getProjectEmbeddingSnapshot2,
41
41
  embedItemsForProject2
42
- } from "./index-vhx6yph7.js";
42
+ } from "./index-as8bg7eh.js";
43
43
  import {
44
44
  recordEmbeddingMeasurement
45
45
  } from "./index-2amn2s73.js";
46
46
  import {
47
47
  getProjectEmbeddings2
48
- } from "./index-qbydvfev.js";
48
+ } from "./index-6xg55350.js";
49
49
  import {
50
50
  USER_FACING_FAILURES,
51
51
  cosineSimilarity,
@@ -55,13 +55,13 @@ import {
55
55
  sanitizeFtsQuery,
56
56
  searchMemoriesFTS,
57
57
  searchMemoriesFTSUnion
58
- } from "./index-42fg6tzz.js";
58
+ } from "./index-92p5yfpp.js";
59
59
  import {
60
60
  ModuleMemoryAuthorityError2,
61
61
  getMemoriesByProject2,
62
62
  getMemoriesByProjects2,
63
63
  updateMemoryRetrievalCount2
64
- } from "./index-pw1f07vg.js";
64
+ } from "./index-srpghrje.js";
65
65
  import {
66
66
  matchedSearchSnippet,
67
67
  getIndexedMessageCorpusSize
@@ -72,10 +72,10 @@ import {
72
72
  withMemoryHintContent,
73
73
  autoSearchRelevance,
74
74
  recordAutoSearchLane
75
- } from "./index-4v50y0jr.js";
75
+ } from "./index-ydevzvfs.js";
76
76
  import {
77
77
  ensureMemoryEmbeddings2
78
- } from "./index-jyj9jg9f.js";
78
+ } from "./index-cxh5g5bt.js";
79
79
  import {
80
80
  MESSAGE_FTS_SESSION_FILTER_SQL,
81
81
  withMessageFtsSessionFilter,
@@ -90,11 +90,11 @@ import {
90
90
  expandWorkspaceIdentitySetWithAliases,
91
91
  resolveStoredPathWorkspaceIdentity,
92
92
  sourceNameForMemory
93
- } from "./index-hyvxmz3e.js";
93
+ } from "./index-y1875y4h.js";
94
94
  import {
95
95
  getNotes,
96
96
  getActivePrimers
97
- } from "./index-ab86c21b.js";
97
+ } from "./index-zj0ra8vs.js";
98
98
  import {
99
99
  isKnownAutocommit
100
100
  } from "./index-8ajstryz.js";