@cortexkit/opencode-magic-context 0.49.104 → 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 (149) hide show
  1. package/dist/auto-search-worker.js +3 -3
  2. package/dist/chunk-embedding-write-worker.js +8 -5
  3. package/dist/{context-7hbmnpe8.js → context-wtnrsjkp.js} +113 -136
  4. package/dist/{embedding-backfill-aratv25b.js → embedding-backfill-kqwx0vhj.js} +4 -4
  5. package/dist/features/magic-context/chunk-embedding-write-worker-install-failure.fixture.d.ts +2 -0
  6. package/dist/features/magic-context/chunk-embedding-write-worker-install-failure.fixture.d.ts.map +1 -0
  7. package/dist/features/magic-context/chunk-scope-repair-revision.d.ts +16 -1
  8. package/dist/features/magic-context/chunk-scope-repair-revision.d.ts.map +1 -1
  9. package/dist/features/magic-context/dreamer/task-executor.d.ts.map +1 -1
  10. package/dist/features/magic-context/dreamer/verify-checkout.d.ts +2 -0
  11. package/dist/features/magic-context/dreamer/verify-checkout.d.ts.map +1 -0
  12. package/dist/features/magic-context/memory/embedding-worker-observer.fixture.d.ts +26 -0
  13. package/dist/features/magic-context/memory/embedding-worker-observer.fixture.d.ts.map +1 -0
  14. package/dist/features/magic-context/message-fts-rowid-map-startup-worker-test-support.d.ts +2 -0
  15. package/dist/features/magic-context/message-fts-rowid-map-startup-worker-test-support.d.ts.map +1 -0
  16. package/dist/features/magic-context/project-embedding-registry.d.ts +5 -0
  17. package/dist/features/magic-context/project-embedding-registry.d.ts.map +1 -1
  18. package/dist/features/magic-context/search-pool-fixture.d.ts +15 -0
  19. package/dist/features/magic-context/search-pool-fixture.d.ts.map +1 -1
  20. package/dist/features/magic-context/storage-db.d.ts.map +1 -1
  21. package/dist/hooks/magic-context/compartment-runner-incremental.d.ts.map +1 -1
  22. package/dist/hooks/magic-context/compartment-runner-types.d.ts +4 -1
  23. package/dist/hooks/magic-context/compartment-runner-types.d.ts.map +1 -1
  24. package/dist/hooks/magic-context/compartment-runner.d.ts.map +1 -1
  25. package/dist/hooks/magic-context/history-boundary-repair.d.ts +7 -2
  26. package/dist/hooks/magic-context/history-boundary-repair.d.ts.map +1 -1
  27. package/dist/hooks/magic-context/transform-compartment-phase.d.ts +1 -0
  28. package/dist/hooks/magic-context/transform-compartment-phase.d.ts.map +1 -1
  29. package/dist/hooks/magic-context/transform.d.ts +1 -0
  30. package/dist/hooks/magic-context/transform.d.ts.map +1 -1
  31. package/dist/{index-3nxhxeeg.js → index-1j4q0bd6.js} +4 -4
  32. package/dist/{index-fd3hkyk1.js → index-42fsf88t.js} +1 -1
  33. package/dist/{index-jjxpmypb.js → index-7z5cvfpg.js} +1 -1
  34. package/dist/{index-a9wn0d9h.js → index-8vv7axxg.js} +3 -3
  35. package/dist/{index-8yj4vd7k.js → index-92p5yfpp.js} +1 -1
  36. package/dist/{index-sqvkh5d0.js → index-9m2b5mwf.js} +20 -7
  37. package/dist/{index-mwjvjn0p.js → index-a3t1ck7g.js} +6 -6
  38. package/dist/{index-4ba3zp54.js → index-as8bg7eh.js} +365 -113
  39. package/dist/{index-8eke8yh2.js → index-cxh5g5bt.js} +1 -1
  40. package/dist/{index-vegw385y.js → index-cy5fn70d.js} +89 -1
  41. package/dist/{index-4dywj733.js → index-dzb1yc9w.js} +1 -1
  42. package/dist/{index-tvh3y650.js → index-edafv9d7.js} +5 -5
  43. package/dist/{index-8gzmeyae.js → index-ff1hqh4a.js} +3 -3
  44. package/dist/{index-ke0mkz7g.js → index-g1h1efr0.js} +1 -1
  45. package/dist/{index-f455a0g3.js → index-k37h4yrb.js} +5 -3
  46. package/dist/{index-3rp2b482.js → index-mg6cwqw2.js} +217 -24
  47. package/dist/{index-4536jdzj.js → index-xzs1fxzz.js} +2 -2
  48. package/dist/{index-hyvxmz3e.js → index-y1875y4h.js} +1 -1
  49. package/dist/{index-4v50y0jr.js → index-ydevzvfs.js} +1 -1
  50. package/dist/{index-ab86c21b.js → index-zj0ra8vs.js} +1 -1
  51. package/dist/index.js +50 -59
  52. package/dist/migration-worker.js +3 -3
  53. package/dist/{project-embedding-registry-1n4cexsv.js → project-embedding-registry-0z0nd73p.js} +3 -3
  54. package/dist/raw-ordinal-warmup-worker.js +2 -2
  55. package/dist/{recomp-orchestrator-16rs8aty.js → recomp-orchestrator-zagjzbz5.js} +12 -12
  56. package/dist/{render-f32trg2t.js → render-vwp72qd0.js} +6 -6
  57. package/dist/{search-v9ywqb4f.js → search-7e1rcqb7.js} +9 -9
  58. package/dist/{search-archive-yh6xtvrx.js → search-archive-6tr0gcf7.js} +2 -2
  59. package/dist/shared/sqlite-busy-test-support.d.ts +21 -0
  60. package/dist/shared/sqlite-busy-test-support.d.ts.map +1 -0
  61. package/dist/shared/sqlite-write-locker-test-support.d.ts +12 -0
  62. package/dist/shared/sqlite-write-locker-test-support.d.ts.map +1 -1
  63. package/dist/{store-wpx314rk.js → store-4eeezg83.js} +2 -2
  64. package/dist/{store-reader-c5fwa9qx.js → store-reader-g8w2wp88.js} +1 -1
  65. package/dist/{transform-postprocess-phase-yef4mxk3.js → transform-postprocess-phase-v3p3q2gf.js} +13 -13
  66. package/dist/v2/auto-search-worker.js +3 -3
  67. package/dist/v2/chunk-embedding-write-worker.js +8 -5
  68. package/dist/v2/{context-mk2h2ven.js → context-fbdac7qt.js} +163 -147
  69. package/dist/v2/{embedding-backfill-kyn5sv0f.js → embedding-backfill-e44pv5db.js} +4 -4
  70. package/dist/v2/event-subscription.fixture.d.ts +9 -0
  71. package/dist/v2/event-subscription.fixture.d.ts.map +1 -0
  72. package/dist/v2/hidden-model-activity.d.ts +13 -0
  73. package/dist/v2/hidden-model-activity.d.ts.map +1 -1
  74. package/dist/v2/hooks/context.d.ts +1 -0
  75. package/dist/v2/hooks/context.d.ts.map +1 -1
  76. package/dist/v2/hooks/dream-trigger.d.ts +2 -1
  77. package/dist/v2/hooks/dream-trigger.d.ts.map +1 -1
  78. package/dist/v2/hooks/event-subscription-worker.d.ts +11 -0
  79. package/dist/v2/hooks/event-subscription-worker.d.ts.map +1 -0
  80. package/dist/v2/hooks/types.d.ts +1 -0
  81. package/dist/v2/hooks/types.d.ts.map +1 -1
  82. package/dist/v2/hooks/update-check.d.ts +1 -0
  83. package/dist/v2/hooks/update-check.d.ts.map +1 -1
  84. package/dist/v2/{message-index-bounded-j1sxtefe.js → message-index-bounded-nwqfb1p5.js} +3 -3
  85. package/dist/v2/migration-worker.js +3 -3
  86. package/dist/v2/{project-embedding-registry-1jv2rxhb.js → project-embedding-registry-rhzjnypp.js} +3 -3
  87. package/dist/v2/raw-ordinal-warmup-worker.js +4 -4
  88. package/dist/v2/{read-session-chunk-p6z3kmdj.js → read-session-chunk-brqatg83.js} +2 -2
  89. package/dist/v2/{recomp-orchestrator-5t2csd46.js → recomp-orchestrator-1ech6k2n.js} +14 -14
  90. package/dist/v2/{render-jpj43axy.js → render-pfe3smhx.js} +10 -10
  91. package/dist/v2/{search-archive-wbhxp0p1.js → search-archive-r8krrz47.js} +5 -5
  92. package/dist/v2/{search-w9m2fd5c.js → search-sffewrs4.js} +12 -12
  93. package/dist/v2/{server-47ajg9xc.js → server-16115spd.js} +1 -1
  94. package/dist/v2/server-28jqb7s0.js +6 -0
  95. package/dist/v2/{server-qg8jyfxa.js → server-5xx10mqe.js} +1 -1
  96. package/dist/v2/{server-t45hgcsg.js → server-7jw608jk.js} +2 -2
  97. package/dist/v2/{server-8f92sd2r.js → server-7pxjk184.js} +6 -4
  98. package/dist/v2/{server-3mb205v9.js → server-83rjf4df.js} +1 -1
  99. package/dist/v2/{server-3gnpqjez.js → server-9t4yjj20.js} +26 -11
  100. package/dist/v2/{server-ga6y57vh.js → server-c32505fr.js} +6 -4
  101. package/dist/v2/{server-8m5wk6aq.js → server-cpb7b1f9.js} +5 -5
  102. package/dist/v2/{server-qdpd8h27.js → server-fn6k1ack.js} +1 -1
  103. package/dist/v2/{server-zsbc0n4v.js → server-ghb2q1z9.js} +1 -1
  104. package/dist/v2/{server-af51b1zg.js → server-hqcdvs2n.js} +11 -11
  105. package/dist/v2/{server-9ms9b75c.js → server-j00jprwm.js} +4 -6
  106. package/dist/v2/{server-xpy46ddq.js → server-jtd5vq5e.js} +3 -3
  107. package/dist/v2/{server-b01a7dhj.js → server-kk2kbzq3.js} +1 -1
  108. package/dist/v2/{server-mc5t7k8v.js → server-ma0qhqg9.js} +1 -1
  109. package/dist/v2/{server-x22jtpna.js → server-n3bfqd0j.js} +4 -2
  110. package/dist/v2/{server-wmpgvvc4.js → server-pjvqyg6g.js} +365 -113
  111. package/dist/v2/{server-jrs4gny6.js → server-qtajgx1e.js} +89 -1
  112. package/dist/v2/server-t104h957.js +177 -0
  113. package/dist/v2/{server-j09jx1n9.js → server-v2r04xds.js} +1 -1
  114. package/dist/v2/{server-7c5p0bh1.js → server-z77hman6.js} +1 -1
  115. package/dist/v2/server.js +31 -40
  116. package/dist/v2/{storage-tags-s7nvvyg8.js → storage-tags-ee72g2zv.js} +1 -1
  117. package/dist/v2/{store-mba47sxn.js → store-9rsrj5pt.js} +2 -2
  118. package/dist/v2/{store-reader-w7w8vfsy.js → store-reader-tb0f9621.js} +1 -1
  119. package/dist/v2/store-reader.d.ts +1 -1
  120. package/dist/v2/store-reader.d.ts.map +1 -1
  121. package/dist/v2/tui/index.d.ts.map +1 -1
  122. package/dist/v2/{v2-archive-reader-5njmg3a3.js → v2-archive-reader-0xysfgxh.js} +1 -1
  123. package/dist/v2/{wrapup-orchestrator-ykgx8hw8.js → wrapup-orchestrator-8d4ak3x3.js} +14 -14
  124. package/dist/{v2-archive-reader-y38khjax.js → v2-archive-reader-fac1zmhj.js} +1 -1
  125. package/dist/{wrapup-orchestrator-a9tshrp4.js → wrapup-orchestrator-wz10b94c.js} +13 -13
  126. package/package.json +1 -1
  127. package/src/config/migrate-config-location.test.ts +41 -29
  128. package/src/shared/model-suggestion-retry.test.ts +137 -90
  129. package/src/shared/off-thread-migration-clock.test.ts +19 -9
  130. package/src/shared/prompt-async-transport.test.ts +125 -42
  131. package/src/shared/rpc-async-probes.test.ts +56 -36
  132. package/src/shared/rpc-client.test.ts +51 -18
  133. package/src/shared/sqlite-acquisition-routing.test.ts +79 -22
  134. package/src/shared/sqlite-busy-budget-review.test.ts +129 -111
  135. package/src/shared/sqlite-busy-test-support.ts +154 -0
  136. package/src/shared/sqlite-foreground-wait.test.ts +213 -156
  137. package/src/shared/sqlite-pass-scope.test.ts +142 -105
  138. package/src/shared/sqlite-turn-deadline.test.ts +149 -124
  139. package/src/shared/sqlite-write-locker-test-support.ts +44 -12
  140. package/src/shared/stable-json-linear.test.ts +29 -11
  141. package/src/shared/startup-maintenance-policy.test.ts +72 -2
  142. package/src/shared/storage-busy.test.ts +45 -18
  143. package/src/shared/storage-file-mutex-review.test.ts +65 -51
  144. package/src/shared/tui-preferences.test.ts +15 -5
  145. package/src/shared/worker-shutdown.test.ts +26 -20
  146. package/src/tui/data/notification-socket.test.ts +220 -108
  147. package/src/v2/tui/index.ts +5 -1
  148. package/src/v2/tui/status-dialog-fallback.test.ts +23 -1
  149. package/dist/v2/server-84w6rvvf.js +0 -14
@@ -16,7 +16,7 @@ import {
16
16
  } from "./index-jsbgw33b.js";
17
17
  import {
18
18
  scheduleAfterBootQuiet
19
- } from "./index-vegw385y.js";
19
+ } from "./index-cy5fn70d.js";
20
20
  import {
21
21
  cleanSearchText,
22
22
  hintKeywordRelevance,
@@ -6,7 +6,7 @@ import {
6
6
  } from "./index-gzy5w8ya.js";
7
7
  import {
8
8
  managedAuthorityNoteRow
9
- } from "./index-hyvxmz3e.js";
9
+ } from "./index-y1875y4h.js";
10
10
 
11
11
  // src/features/magic-context/storage-notes.ts
12
12
  var NOTE_TYPES = new Set(["session", "smart"]);
package/dist/index.js CHANGED
@@ -47,7 +47,7 @@ import {
47
47
  checkCompactionMarkerConsistency,
48
48
  clearInjectionCache,
49
49
  clearNoteNudgeTriggerOnly
50
- } from "./index-sqvkh5d0.js";
50
+ } from "./index-9m2b5mwf.js";
51
51
  import {
52
52
  withContentLanguageDirective,
53
53
  string,
@@ -147,8 +147,9 @@ import {
147
147
  createCtxSearchTools,
148
148
  parameterDescriptionsFor,
149
149
  MagicContextRpcServer,
150
- applyHiddenSubagentTemperature
151
- } from "./index-3rp2b482.js";
150
+ applyHiddenSubagentTemperature,
151
+ startEventSubscriptionWorker
152
+ } from "./index-mg6cwqw2.js";
152
153
  import {
153
154
  resolveOpenCodeDbPath,
154
155
  openCodeDbPathExists,
@@ -175,7 +176,7 @@ import {
175
176
  beginBootQuietPeriod,
176
177
  bootQuietRemainingMs,
177
178
  scheduleAfterBootQuiet
178
- } from "./index-vegw385y.js";
179
+ } from "./index-cy5fn70d.js";
179
180
  import {
180
181
  BoundedSessionMap,
181
182
  deleteTemporalDecision,
@@ -202,10 +203,10 @@ import {
202
203
  dropServedRecord,
203
204
  registerLkgPersistence,
204
205
  dropSlot
205
- } from "./index-4536jdzj.js";
206
+ } from "./index-xzs1fxzz.js";
206
207
  import {
207
208
  recordSessionProjectIdentity
208
- } from "./index-fd3hkyk1.js";
209
+ } from "./index-42fsf88t.js";
209
210
  import"./index-fb3zxn06.js";
210
211
  import {
211
212
  startBootDeadline,
@@ -216,7 +217,7 @@ import {
216
217
  openDatabaseAsync,
217
218
  isDatabasePersisted,
218
219
  getDatabasePersistenceError
219
- } from "./index-f455a0g3.js";
220
+ } from "./index-k37h4yrb.js";
220
221
  import {
221
222
  registerExitAbort,
222
223
  unregisterExitAbort
@@ -227,7 +228,7 @@ import {
227
228
  forgetRawSessionOrdinalWatermark2
228
229
  } from "./index-jsbgw33b.js";
229
230
  import"./index-geph2sa6.js";
230
- import"./index-hyvxmz3e.js";
231
+ import"./index-y1875y4h.js";
231
232
  import"./index-fr0wbhdn.js";
232
233
  import {
233
234
  preloadTokenizer,
@@ -237,7 +238,7 @@ import"./index-gcf2x04k.js";
237
238
  import {
238
239
  getDefaultSubcConnectionFile,
239
240
  SubcModuleTransport
240
- } from "./index-mwjvjn0p.js";
241
+ } from "./index-a3t1ck7g.js";
241
242
  import"./index-qt1qqasc.js";
242
243
  import"./index-y5f5yg5a.js";
243
244
  import {
@@ -314,18 +315,18 @@ import"./index-1vv1ka4a.js";
314
315
  import {
315
316
  deleteIndexedMessage
316
317
  } from "./index-p8nc9axh.js";
317
- import"./index-ke0mkz7g.js";
318
- import"./index-ab86c21b.js";
318
+ import"./index-g1h1efr0.js";
319
+ import"./index-zj0ra8vs.js";
319
320
  import {
320
321
  pushNotification2
321
322
  } from "./index-y14pawe1.js";
322
323
  import"./index-p5ey52j9.js";
323
324
  import {
324
325
  getEmbeddingCoverageStatus2
325
- } from "./index-4ba3zp54.js";
326
+ } from "./index-as8bg7eh.js";
326
327
  import"./index-6xg55350.js";
327
- import"./index-8yj4vd7k.js";
328
- import"./index-8eke8yh2.js";
328
+ import"./index-92p5yfpp.js";
329
+ import"./index-cxh5g5bt.js";
329
330
  import"./index-srpghrje.js";
330
331
  import"./index-qxzk5s30.js";
331
332
  import {
@@ -348,13 +349,13 @@ import {
348
349
  armBindingRecoverySafely,
349
350
  collectForeignTextParts,
350
351
  resetDegradedCacheCount2
351
- } from "./index-tvh3y650.js";
352
+ } from "./index-edafv9d7.js";
352
353
  import {
353
354
  scheduleClearAndReindex
354
- } from "./index-4v50y0jr.js";
355
+ } from "./index-ydevzvfs.js";
355
356
  import {
356
357
  runManagedRecomp2
357
- } from "./index-a9wn0d9h.js";
358
+ } from "./index-8vv7axxg.js";
358
359
  import {
359
360
  isValidSemver,
360
361
  compareSemverCore
@@ -362,11 +363,11 @@ import {
362
363
  import"./index-fmsr7v69.js";
363
364
  import {
364
365
  runManagedWrapup2
365
- } from "./index-8gzmeyae.js";
366
+ } from "./index-ff1hqh4a.js";
366
367
  import"./index-zh683xh2.js";
367
368
  import"./index-6gd9akdt.js";
368
- import"./index-3nxhxeeg.js";
369
- import"./index-jjxpmypb.js";
369
+ import"./index-1j4q0bd6.js";
370
+ import"./index-7z5cvfpg.js";
370
371
  import {
371
372
  __toESM,
372
373
  __commonJS
@@ -8222,7 +8223,7 @@ var require_src2 = __commonJS(function(exports, module) {
8222
8223
  // package.json
8223
8224
  var package_default = {
8224
8225
  name: "@cortexkit/opencode-magic-context",
8225
- version: "0.49.104",
8226
+ version: "0.49.105",
8226
8227
  type: "module",
8227
8228
  description: "OpenCode plugin for Magic Context — cross-session memory and context management",
8228
8229
  main: "dist/index.js",
@@ -11971,7 +11972,7 @@ async function sendOpenCodeRefusal(client, sessionId, message, refusal) {
11971
11972
  sessionLog2(sessionId, "refusal notice skipped: no terminal viewing the session", refusal.name);
11972
11973
  }
11973
11974
  if (storageBusy) {
11974
- const { abortSessionFailClosed } = await importPluginModule(() => import("./transform-postprocess-phase-yef4mxk3.js"));
11975
+ const { abortSessionFailClosed } = await importPluginModule(() => import("./transform-postprocess-phase-v3p3q2gf.js"));
11975
11976
  await abortSessionFailClosed(client, sessionId);
11976
11977
  }
11977
11978
  }
@@ -12155,6 +12156,7 @@ function registerStandalonePluginMarker(version) {
12155
12156
  import { existsSync as existsSync8, readFileSync as readFileSync7 } from "node:fs";
12156
12157
  import { dirname as dirname4, join as join10 } from "node:path";
12157
12158
  import { fileURLToPath as fileURLToPath2 } from "node:url";
12159
+ var UPDATE_EVENT_TYPES = ["session.execution.succeeded"];
12158
12160
  var cachedPackageInfo;
12159
12161
  function packageInfo() {
12160
12162
  if (cachedPackageInfo)
@@ -12183,45 +12185,34 @@ function formatUpdateAvailableMessage(latest, current) {
12183
12185
  function startUpdateChecks(context, check = (signal) => {
12184
12186
  return packageInfo().development ? Promise.resolve(null) : getLatestVersion("latest", { signal });
12185
12187
  }) {
12186
- const controller = new AbortController;
12187
12188
  let lastCheckAt;
12188
12189
  let loaded = false;
12189
- const done = (async () => {
12190
- try {
12191
- for await (const _event of context.event.subscribe({ signal: controller.signal })) {
12192
- if (controller.signal.aborted)
12193
- break;
12194
- if (loaded && typeof lastCheckAt === "number" && Date.now() - lastCheckAt < 60 * 60 * 1000)
12195
- continue;
12196
- lastCheckAt = await context.storage.get("version-check-at");
12197
- loaded = true;
12198
- if (typeof lastCheckAt === "number" && Date.now() - lastCheckAt < 60 * 60 * 1000)
12199
- continue;
12200
- const now = Date.now();
12201
- await context.storage.set("version-check-at", now);
12202
- lastCheckAt = now;
12203
- const latest = await check(controller.signal);
12204
- const current = packageInfo().version;
12205
- const comparison = latest ? compareSemverCore(latest, current) : null;
12206
- if (latest && !controller.signal.aborted && comparison !== null && comparison > 0) {
12207
- pushNotification2("toast", {
12208
- message: formatUpdateAvailableMessage(latest, current),
12209
- variant: "info"
12210
- });
12211
- }
12212
- }
12213
- } catch (error) {
12214
- if (!controller.signal.aborted)
12215
- log2("[magic-context] v2 update check unavailable", error);
12216
- }
12217
- })();
12218
- return {
12219
- done,
12220
- async dispose() {
12221
- controller.abort();
12222
- await done;
12190
+ return startEventSubscriptionWorker(context.event, UPDATE_EVENT_TYPES, {
12191
+ subscriptionEnded: (error) => log2("[magic-context] v2 update event subscription ended; retrying", error),
12192
+ handlerFailed: (error) => log2("[magic-context] v2 update check unavailable", error)
12193
+ }, async (value, signal) => {
12194
+ if (value?.type !== UPDATE_EVENT_TYPES[0])
12195
+ return false;
12196
+ if (loaded && typeof lastCheckAt === "number" && Date.now() - lastCheckAt < 60 * 60 * 1000)
12197
+ return false;
12198
+ lastCheckAt = await context.storage.get("version-check-at");
12199
+ loaded = true;
12200
+ if (typeof lastCheckAt === "number" && Date.now() - lastCheckAt < 60 * 60 * 1000)
12201
+ return true;
12202
+ const now = Date.now();
12203
+ await context.storage.set("version-check-at", now);
12204
+ lastCheckAt = now;
12205
+ const latest = await check(signal);
12206
+ const current = packageInfo().version;
12207
+ const comparison = latest ? compareSemverCore(latest, current) : null;
12208
+ if (latest && !signal.aborted && comparison !== null && comparison > 0) {
12209
+ pushNotification2("toast", {
12210
+ message: formatUpdateAvailableMessage(latest, current),
12211
+ variant: "info"
12212
+ });
12223
12213
  }
12224
- };
12214
+ return true;
12215
+ });
12225
12216
  }
12226
12217
 
12227
12218
  // src/v2/server.ts
@@ -12241,7 +12232,7 @@ async function setup(context) {
12241
12232
  if (claimStorageBackupWarningCheck() && isMagicContextStorageOutsideEngram(storageDir)) {
12242
12233
  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.`);
12243
12234
  }
12244
- const { registerContext } = await import("./context-7hbmnpe8.js");
12235
+ const { registerContext } = await import("./context-wtnrsjkp.js");
12245
12236
  setHarness2("opencode2");
12246
12237
  bindStaleBuildNotice({}, import.meta.url, "opencode2");
12247
12238
  const duties = await registerContext(context);
@@ -9,17 +9,17 @@ import {
9
9
  import"./index-fr0wbhdn.js";
10
10
  import {
11
11
  runMigrationsWithRetry
12
- } from "./index-hyvxmz3e.js";
12
+ } from "./index-y1875y4h.js";
13
13
  import"./index-xtv4d4hv.js";
14
14
  import"./index-58e3y90n.js";
15
15
  import"./index-abhmtj00.js";
16
16
  import"./index-t7st85f5.js";
17
- import"./index-vegw385y.js";
17
+ import"./index-cy5fn70d.js";
18
18
  import"./index-fb3zxn06.js";
19
19
  import {
20
20
  setSqlitePragmaConfig,
21
21
  initializeDatabase
22
- } from "./index-f455a0g3.js";
22
+ } from "./index-k37h4yrb.js";
23
23
  import"./index-8k9qpyjf.js";
24
24
  import"./index-v0p37hm2.js";
25
25
  import"./index-96ztjvkn.js";
@@ -39,16 +39,16 @@ import {
39
39
  sweepAllRegisteredProjects2,
40
40
  _setTestProviderFactoryForProject2,
41
41
  _resetProjectEmbeddingRegistryForTests2
42
- } from "./index-4ba3zp54.js";
42
+ } from "./index-as8bg7eh.js";
43
43
  import"./index-6xg55350.js";
44
44
  import"./index-2amn2s73.js";
45
45
  import"./index-qt1qqasc.js";
46
46
  import"./index-p5ey52j9.js";
47
47
  import"./index-r3f85n7y.js";
48
- import"./index-fd3hkyk1.js";
48
+ import"./index-42fsf88t.js";
49
49
  import"./index-1vv1ka4a.js";
50
50
  import"./index-gcf2x04k.js";
51
- import"./index-vegw385y.js";
51
+ import"./index-cy5fn70d.js";
52
52
  import"./index-geph2sa6.js";
53
53
  import"./index-jsbgw33b.js";
54
54
  import"./index-96ztjvkn.js";
@@ -19,7 +19,7 @@ serveWorkerJobs(async (input, port) => {
19
19
  await main();
20
20
  async function main() {
21
21
  if (input.v2ArchiveReader) {
22
- const { serveV2ArchiveReads } = await import("./v2-archive-reader-y38khjax.js");
22
+ const { serveV2ArchiveReads } = await import("./v2-archive-reader-fac1zmhj.js");
23
23
  await serveV2ArchiveReads(port, openConnections);
24
24
  return;
25
25
  }
@@ -51,7 +51,7 @@ serveWorkerJobs(async (input, port) => {
51
51
  await runMessageFtsRowidMapBackfill(db);
52
52
  reply = { kind: "fts-rowid-backfill" };
53
53
  } else if (input.searchArchive) {
54
- const { renderSearchArchive } = await import("./search-archive-yh6xtvrx.js");
54
+ const { renderSearchArchive } = await import("./search-archive-6tr0gcf7.js");
55
55
  const { readRawSessionMessageIdOrdinalsForRangeFromDb } = await import("./read-session-raw-pgc9gxtn.js");
56
56
  const archive = input.searchArchive;
57
57
  let raw;
@@ -7,20 +7,20 @@ import {
7
7
  setRecompTerminal2,
8
8
  buildRecompDeps2,
9
9
  runManagedRecomp2
10
- } from "./index-a9wn0d9h.js";
11
- import"./index-sqvkh5d0.js";
10
+ } from "./index-8vv7axxg.js";
11
+ import"./index-9m2b5mwf.js";
12
12
  import"./index-qxzk5s30.js";
13
13
  import"./index-sd3egckz.js";
14
- import"./index-8yj4vd7k.js";
15
- import"./index-8eke8yh2.js";
14
+ import"./index-92p5yfpp.js";
15
+ import"./index-cxh5g5bt.js";
16
16
  import"./index-srpghrje.js";
17
- import"./index-4ba3zp54.js";
17
+ import"./index-as8bg7eh.js";
18
18
  import"./index-6xg55350.js";
19
- import"./index-4536jdzj.js";
20
- import"./index-ab86c21b.js";
19
+ import"./index-xzs1fxzz.js";
20
+ import"./index-zj0ra8vs.js";
21
21
  import"./index-p8nc9axh.js";
22
22
  import"./index-2amn2s73.js";
23
- import"./index-ke0mkz7g.js";
23
+ import"./index-g1h1efr0.js";
24
24
  import"./index-h1qh9n8b.js";
25
25
  import"./index-fqth7850.js";
26
26
  import"./index-61a853ky.js";
@@ -33,14 +33,14 @@ import"./index-y14pawe1.js";
33
33
  import"./index-y5f5yg5a.js";
34
34
  import"./index-p5ey52j9.js";
35
35
  import"./index-r3f85n7y.js";
36
- import"./index-fd3hkyk1.js";
36
+ import"./index-42fsf88t.js";
37
37
  import"./index-1vv1ka4a.js";
38
38
  import"./index-gcf2x04k.js";
39
- import"./index-f455a0g3.js";
39
+ import"./index-k37h4yrb.js";
40
40
  import"./index-fb3zxn06.js";
41
- import"./index-hyvxmz3e.js";
41
+ import"./index-y1875y4h.js";
42
42
  import"./index-fr0wbhdn.js";
43
- import"./index-vegw385y.js";
43
+ import"./index-cy5fn70d.js";
44
44
  import"./index-geph2sa6.js";
45
45
  import"./index-8k9qpyjf.js";
46
46
  import"./index-xtv4d4hv.js";
@@ -3,11 +3,11 @@ import {
3
3
  renderVerboseRangeForTool2,
4
4
  renderItemByTag2
5
5
  } from "./index-zh683xh2.js";
6
- import"./index-4536jdzj.js";
7
- import"./index-ab86c21b.js";
6
+ import"./index-xzs1fxzz.js";
7
+ import"./index-zj0ra8vs.js";
8
8
  import"./index-p8nc9axh.js";
9
9
  import"./index-2amn2s73.js";
10
- import"./index-ke0mkz7g.js";
10
+ import"./index-g1h1efr0.js";
11
11
  import"./index-9jqaha1g.js";
12
12
  import"./index-qzfz2tvk.js";
13
13
  import"./index-1zx87sdm.js";
@@ -15,11 +15,11 @@ import"./index-vdzd98ry.js";
15
15
  import"./index-r3f85n7y.js";
16
16
  import"./index-1vv1ka4a.js";
17
17
  import"./index-gcf2x04k.js";
18
- import"./index-f455a0g3.js";
18
+ import"./index-k37h4yrb.js";
19
19
  import"./index-fb3zxn06.js";
20
- import"./index-hyvxmz3e.js";
20
+ import"./index-y1875y4h.js";
21
21
  import"./index-fr0wbhdn.js";
22
- import"./index-vegw385y.js";
22
+ import"./index-cy5fn70d.js";
23
23
  import"./index-geph2sa6.js";
24
24
  import"./index-8k9qpyjf.js";
25
25
  import"./index-xtv4d4hv.js";
@@ -5,15 +5,15 @@ import {
5
5
  resolveMemoriesByIdsForSearch2,
6
6
  unifiedSearch2,
7
7
  formatSearchResults2
8
- } from "./index-mwjvjn0p.js";
9
- import"./index-4v50y0jr.js";
8
+ } from "./index-a3t1ck7g.js";
9
+ import"./index-ydevzvfs.js";
10
10
  import"./index-6gd9akdt.js";
11
- import"./index-8yj4vd7k.js";
12
- import"./index-8eke8yh2.js";
11
+ import"./index-92p5yfpp.js";
12
+ import"./index-cxh5g5bt.js";
13
13
  import"./index-srpghrje.js";
14
- import"./index-4ba3zp54.js";
14
+ import"./index-as8bg7eh.js";
15
15
  import"./index-6xg55350.js";
16
- import"./index-ab86c21b.js";
16
+ import"./index-zj0ra8vs.js";
17
17
  import"./index-p8nc9axh.js";
18
18
  import"./index-2amn2s73.js";
19
19
  import"./index-qt1qqasc.js";
@@ -23,12 +23,12 @@ import"./index-1zx87sdm.js";
23
23
  import"./index-vdzd98ry.js";
24
24
  import"./index-p5ey52j9.js";
25
25
  import"./index-r3f85n7y.js";
26
- import"./index-fd3hkyk1.js";
26
+ import"./index-42fsf88t.js";
27
27
  import"./index-1vv1ka4a.js";
28
28
  import"./index-gcf2x04k.js";
29
- import"./index-hyvxmz3e.js";
29
+ import"./index-y1875y4h.js";
30
30
  import"./index-fr0wbhdn.js";
31
- import"./index-vegw385y.js";
31
+ import"./index-cy5fn70d.js";
32
32
  import"./index-geph2sa6.js";
33
33
  import"./index-xtv4d4hv.js";
34
34
  import"./index-jsbgw33b.js";
@@ -2,8 +2,8 @@ import {
2
2
  unresolvedLiveTailRefusal2,
3
3
  renderSearchArchive2,
4
4
  renderSearchArchiveOffThread2
5
- } from "./index-jjxpmypb.js";
6
- import"./index-3nxhxeeg.js";
5
+ } from "./index-7z5cvfpg.js";
6
+ import"./index-1j4q0bd6.js";
7
7
  import"./index-6gd9akdt.js";
8
8
  import"./index-9jqaha1g.js";
9
9
  import"./index-qzfz2tvk.js";
@@ -0,0 +1,21 @@
1
+ import { Database as NativeDatabase } from "bun:sqlite";
2
+ type Method = "exec" | "prepare" | "run" | "get" | "all" | "values" | "iterate.next";
3
+ /**
4
+ * Install before opening the connection: the router captures the native methods
5
+ * when it opens. Match only the SQL under test. Each matched native call sees a
6
+ * zero timeout so the real lock can return BUSY immediately; `timeouts` records
7
+ * the policy value before that change. Restore the spy after closing the fixture.
8
+ */
9
+ export declare function observeSqliteBusy(matches: (sql: string, method: Method, db: NativeDatabase) => boolean, onAttempt?: (timeout: number, sql: string) => void, onBusy?: (timeout: number, sql: string) => void): {
10
+ timeouts: number[];
11
+ errors: unknown[];
12
+ restore(): void;
13
+ };
14
+ /** Freeze the monotonic clock and advance retry timers one boundary at a time. */
15
+ export declare function startSqliteRetryClock(onSchedule?: (delay: number) => void): {
16
+ elapse(ms: number): void;
17
+ advance(ms: number): Promise<void>;
18
+ restore(): void;
19
+ };
20
+ export {};
21
+ //# sourceMappingURL=sqlite-busy-test-support.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sqlite-busy-test-support.d.ts","sourceRoot":"","sources":["../../src/shared/sqlite-busy-test-support.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,cAAc,EAAyB,MAAM,YAAY,CAAC;AAE/E,KAAK,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,QAAQ,GAAG,cAAc,CAAC;AAErF;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC7B,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,cAAc,KAAK,OAAO,EACrE,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,EAClD,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI;;;;EAqFlD;AAED,kFAAkF;AAClF,wBAAgB,qBAAqB,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI;eAiCvD,MAAM;gBAGC,MAAM;;EAgB/B"}
@@ -2,6 +2,18 @@ export interface SqliteWriteLocker {
2
2
  /** Resolves with the locker's exit code after it has committed and exited. */
3
3
  exited: Promise<number>;
4
4
  }
5
+ type Lock = "write" | "exclusive" | {
6
+ read: string;
7
+ };
5
8
  /** Start the locker and resolve once it reports that it holds the write lock. */
6
9
  export declare function startSqliteWriteLocker(dbPath: string, holdMs: number): Promise<SqliteWriteLocker>;
10
+ /** Keep the lock until release(); an exit code of zero confirms the commit. */
11
+ export declare function startGatedSqliteWriteLocker(dbPath: string, holdMs?: number): Promise<SqliteWriteLocker & {
12
+ release: () => void;
13
+ }>;
14
+ /** Use an exclusive lock to block reads, or a read transaction to block COMMIT in DELETE mode. */
15
+ export declare function startGatedSqliteLocker(dbPath: string, lock: Lock): Promise<SqliteWriteLocker & {
16
+ release: () => void;
17
+ }>;
18
+ export {};
7
19
  //# sourceMappingURL=sqlite-write-locker-test-support.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sqlite-write-locker-test-support.d.ts","sourceRoot":"","sources":["../../src/shared/sqlite-write-locker-test-support.ts"],"names":[],"mappings":"AAeA,MAAM,WAAW,iBAAiB;IAC9B,8EAA8E;IAC9E,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;CAC3B;AAED,iFAAiF;AACjF,wBAAsB,sBAAsB,CACxC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GACf,OAAO,CAAC,iBAAiB,CAAC,CAmB5B"}
1
+ {"version":3,"file":"sqlite-write-locker-test-support.d.ts","sourceRoot":"","sources":["../../src/shared/sqlite-write-locker-test-support.ts"],"names":[],"mappings":"AAeA,MAAM,WAAW,iBAAiB;IAC9B,8EAA8E;IAC9E,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;CAC3B;AAED,KAAK,IAAI,GAAG,OAAO,GAAG,WAAW,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAuCrD,iFAAiF;AACjF,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAEjG;AAED,+EAA+E;AAC/E,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,SAAI;aAtC5B,MAAM,IAAI;GAwCnD;AAED,kGAAkG;AAClG,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI;aA3CvB,MAAM,IAAI;GA6CnD"}
@@ -8,8 +8,8 @@ import {
8
8
  readV2RawMessagePagesForConversion2,
9
9
  createV2RawMessageReader2,
10
10
  createV2RawMessageProvider2
11
- } from "./index-4dywj733.js";
12
- import"./index-ke0mkz7g.js";
11
+ } from "./index-dzb1yc9w.js";
12
+ import"./index-g1h1efr0.js";
13
13
  import"./index-8k9qpyjf.js";
14
14
  import"./index-58e3y90n.js";
15
15
  import"./index-2m3t73wk.js";
@@ -3,7 +3,7 @@ import {
3
3
  RAW_MESSAGE_TYPES2,
4
4
  V2StoreReaderPool2,
5
5
  V2StoreReader2
6
- } from "./index-ke0mkz7g.js";
6
+ } from "./index-g1h1efr0.js";
7
7
  import"./index-58e3y90n.js";
8
8
  import"./index-2m3t73wk.js";
9
9
  import"./index-gzy5w8ya.js";
@@ -19,21 +19,21 @@ import {
19
19
  finalizeMessageRepresentation2,
20
20
  runPostTransformPhase2,
21
21
  checkM0MutationDriftAndSignal2
22
- } from "./index-tvh3y650.js";
23
- import"./index-4v50y0jr.js";
24
- import"./index-sqvkh5d0.js";
22
+ } from "./index-edafv9d7.js";
23
+ import"./index-ydevzvfs.js";
24
+ import"./index-9m2b5mwf.js";
25
25
  import"./index-qxzk5s30.js";
26
26
  import"./index-sd3egckz.js";
27
- import"./index-8yj4vd7k.js";
28
- import"./index-8eke8yh2.js";
27
+ import"./index-92p5yfpp.js";
28
+ import"./index-cxh5g5bt.js";
29
29
  import"./index-srpghrje.js";
30
- import"./index-4ba3zp54.js";
30
+ import"./index-as8bg7eh.js";
31
31
  import"./index-6xg55350.js";
32
- import"./index-4536jdzj.js";
33
- import"./index-ab86c21b.js";
32
+ import"./index-xzs1fxzz.js";
33
+ import"./index-zj0ra8vs.js";
34
34
  import"./index-p8nc9axh.js";
35
35
  import"./index-2amn2s73.js";
36
- import"./index-ke0mkz7g.js";
36
+ import"./index-g1h1efr0.js";
37
37
  import"./index-h1qh9n8b.js";
38
38
  import"./index-fqth7850.js";
39
39
  import"./index-61a853ky.js";
@@ -46,14 +46,14 @@ import"./index-y14pawe1.js";
46
46
  import"./index-y5f5yg5a.js";
47
47
  import"./index-p5ey52j9.js";
48
48
  import"./index-r3f85n7y.js";
49
- import"./index-fd3hkyk1.js";
49
+ import"./index-42fsf88t.js";
50
50
  import"./index-1vv1ka4a.js";
51
51
  import"./index-gcf2x04k.js";
52
- import"./index-f455a0g3.js";
52
+ import"./index-k37h4yrb.js";
53
53
  import"./index-fb3zxn06.js";
54
- import"./index-hyvxmz3e.js";
54
+ import"./index-y1875y4h.js";
55
55
  import"./index-fr0wbhdn.js";
56
- import"./index-vegw385y.js";
56
+ import"./index-cy5fn70d.js";
57
57
  import"./index-geph2sa6.js";
58
58
  import"./index-8k9qpyjf.js";
59
59
  import"./index-xtv4d4hv.js";
@@ -27,11 +27,11 @@ serveWorkerJobs(async (initial, port) => {
27
27
  { Database, registerSqliteDiagnosticSink },
28
28
  { log }
29
29
  ] = await Promise.all([
30
- import("./embedding-backfill-kyn5sv0f.js"),
30
+ import("./embedding-backfill-e44pv5db.js"),
31
31
  import("./embedding-cache-fhdkn9nc.js"),
32
32
  import("./storage-memory-24hsvzy8.js"),
33
- import("./project-embedding-registry-1jv2rxhb.js"),
34
- import("./search-w9m2fd5c.js"),
33
+ import("./project-embedding-registry-rhzjnypp.js"),
34
+ import("./search-sffewrs4.js"),
35
35
  import("./compartment-chunk-embedding-6v74y2r3.js"),
36
36
  import("./embedding-activity-g1dhes6g.js"),
37
37
  import("./harness-e4avh192.js"),
@@ -11,8 +11,11 @@ import {
11
11
  isWorkerCloseMessage,
12
12
  exitOnWorkerClose
13
13
  } from "./server-1d042x6w.js";
14
- import"./server-d46xewmt.js";
15
14
  import"./server-xc7t2r4k.js";
15
+ import {
16
+ tryInstallChunkScopeRepairTriggers
17
+ } from "./server-qtajgx1e.js";
18
+ import"./server-d46xewmt.js";
16
19
  import"./server-b5eg9ct6.js";
17
20
  import"./server-v0p37hm2.js";
18
21
  import"./server-96ztjvkn.js";
@@ -29,16 +32,15 @@ import {
29
32
  renewGitSweepLease,
30
33
  releaseGitSweepLease,
31
34
  recordSessionProjectIdentity
32
- } from "./server-7c5p0bh1.js";
35
+ } from "./server-z77hman6.js";
33
36
  import"./server-sfffm587.js";
34
37
  import"./server-3qeqa3b6.js";
35
- import"./server-jrs4gny6.js";
36
38
  import {
37
39
  LATEST_SUPPORTED_VERSION,
38
40
  enforceSchemaFence
39
- } from "./server-ga6y57vh.js";
41
+ } from "./server-c32505fr.js";
40
42
  import"./server-5zx51pm4.js";
41
- import"./server-3mb205v9.js";
43
+ import"./server-83rjf4df.js";
42
44
  import"./server-bzebqckc.js";
43
45
  import"./server-fr0wbhdn.js";
44
46
  import"./server-2ra6pwf3.js";
@@ -58,6 +60,7 @@ serveWorkerJobs((workerData, port) => {
58
60
  const timeout = Math.max(0, Math.floor(workerData.timeout));
59
61
  db.exec(`PRAGMA busy_timeout=${timeout}; PRAGMA foreign_keys=ON`);
60
62
  configureContextDatabasePragmas2(db);
63
+ tryInstallChunkScopeRepairTriggers(db);
61
64
  exitOnWorkerClose(port, () => db.close(), false);
62
65
  port.on("message", (input) => {
63
66
  if (isWorkerCloseMessage(input))