@cortexkit/opencode-magic-context 0.49.52 → 0.49.54

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 (156) hide show
  1. package/dist/auto-search-worker.js +3 -3
  2. package/dist/chunk-embedding-write-worker.js +3 -4
  3. package/dist/{context-bkkd7br4.js → context-vx5gw5h2.js} +117 -80
  4. package/dist/{embedding-backfill-3wdjzrvs.js → embedding-backfill-2dvf3rcn.js} +4 -4
  5. package/dist/embedding-worker.js +2 -2
  6. package/dist/features/magic-context/compartment-embedding.d.ts.map +1 -1
  7. package/dist/features/magic-context/message-fts-session-filter.d.ts +1 -1
  8. package/dist/features/magic-context/message-fts-session-filter.d.ts.map +1 -1
  9. package/dist/features/magic-context/project-embedding-registry.d.ts +8 -0
  10. package/dist/features/magic-context/project-embedding-registry.d.ts.map +1 -1
  11. package/dist/features/magic-context/search.d.ts.map +1 -1
  12. package/dist/features/magic-context/storage-host-instruction-retention.d.ts +10 -3
  13. package/dist/features/magic-context/storage-host-instruction-retention.d.ts.map +1 -1
  14. package/dist/features/magic-context/storage-meta-persisted.d.ts +19 -0
  15. package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -1
  16. package/dist/features/magic-context/storage-meta.d.ts +1 -1
  17. package/dist/features/magic-context/storage-meta.d.ts.map +1 -1
  18. package/dist/features/magic-context/storage.d.ts +1 -1
  19. package/dist/features/magic-context/storage.d.ts.map +1 -1
  20. package/dist/features/magic-context/transform-decision-log.d.ts +1 -1
  21. package/dist/features/magic-context/transform-decision-log.d.ts.map +1 -1
  22. package/dist/hooks/magic-context/active-anthropic-turn.d.ts +6 -0
  23. package/dist/hooks/magic-context/active-anthropic-turn.d.ts.map +1 -1
  24. package/dist/hooks/magic-context/compaction-marker-manager.d.ts +2 -1
  25. package/dist/hooks/magic-context/compaction-marker-manager.d.ts.map +1 -1
  26. package/dist/hooks/magic-context/emergency-drop.d.ts +75 -2
  27. package/dist/hooks/magic-context/emergency-drop.d.ts.map +1 -1
  28. package/dist/hooks/magic-context/event-handler.d.ts.map +1 -1
  29. package/dist/hooks/magic-context/final-wire-token-estimate.d.ts +14 -0
  30. package/dist/hooks/magic-context/final-wire-token-estimate.d.ts.map +1 -1
  31. package/dist/hooks/magic-context/heuristic-cleanup.d.ts +12 -0
  32. package/dist/hooks/magic-context/heuristic-cleanup.d.ts.map +1 -1
  33. package/dist/hooks/magic-context/hook.d.ts.map +1 -1
  34. package/dist/hooks/magic-context/host-served-rows.d.ts +12 -2
  35. package/dist/hooks/magic-context/host-served-rows.d.ts.map +1 -1
  36. package/dist/hooks/magic-context/inject-compartments.d.ts +10 -0
  37. package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
  38. package/dist/hooks/magic-context/latest-assistant-turn.d.ts +43 -0
  39. package/dist/hooks/magic-context/latest-assistant-turn.d.ts.map +1 -1
  40. package/dist/hooks/magic-context/latest-thinking-recovery.d.ts +102 -26
  41. package/dist/hooks/magic-context/latest-thinking-recovery.d.ts.map +1 -1
  42. package/dist/hooks/magic-context/lkg-recovery-prefix.d.ts +18 -2
  43. package/dist/hooks/magic-context/lkg-recovery-prefix.d.ts.map +1 -1
  44. package/dist/hooks/magic-context/lkg-slot.d.ts.map +1 -1
  45. package/dist/hooks/magic-context/pass-outcome.d.ts.map +1 -1
  46. package/dist/hooks/magic-context/pending-marker-rearm.d.ts +20 -0
  47. package/dist/hooks/magic-context/pending-marker-rearm.d.ts.map +1 -0
  48. package/dist/hooks/magic-context/priced-pass-sizing.d.ts +7 -0
  49. package/dist/hooks/magic-context/priced-pass-sizing.d.ts.map +1 -1
  50. package/dist/hooks/magic-context/routine-cleanup-decision.d.ts +11 -1
  51. package/dist/hooks/magic-context/routine-cleanup-decision.d.ts.map +1 -1
  52. package/dist/hooks/magic-context/rust-mode-transform.d.ts.map +1 -1
  53. package/dist/hooks/magic-context/served-check.d.ts +127 -0
  54. package/dist/hooks/magic-context/served-check.d.ts.map +1 -0
  55. package/dist/hooks/magic-context/signed-thinking-hold.d.ts +32 -4
  56. package/dist/hooks/magic-context/signed-thinking-hold.d.ts.map +1 -1
  57. package/dist/hooks/magic-context/tool-drop-target.d.ts.map +1 -1
  58. package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +35 -1
  59. package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
  60. package/dist/hooks/magic-context/transform.d.ts.map +1 -1
  61. package/dist/index-29ff546v.js +2747 -0
  62. package/dist/{index-8d7gkgjs.js → index-2vsd5064.js} +3 -3
  63. package/dist/{index-kaqs6h31.js → index-52x68mj4.js} +1 -1
  64. package/dist/{index-k2efzh9r.js → index-567xsm72.js} +7 -5
  65. package/dist/{index-q9m97m5g.js → index-5gqszjq9.js} +4 -4
  66. package/dist/{index-a4zmmhxs.js → index-5ptp2de1.js} +6 -8
  67. package/dist/{index-jjy5a5w0.js → index-6nqz8hsz.js} +16 -5
  68. package/dist/{index-a6aqpfp6.js → index-9mggb1nv.js} +403 -1
  69. package/dist/{index-kanfby7e.js → index-9n6mdfqy.js} +452 -442
  70. package/dist/{index-fxgaaptn.js → index-a3n2dczz.js} +8 -7
  71. package/dist/{index-g3j49m95.js → index-b6rdv8re.js} +1 -1
  72. package/dist/{index-qbda6a8k.js → index-by14cr73.js} +30 -19
  73. package/dist/{index-25tm250q.js → index-dhdv88e5.js} +1 -1
  74. package/dist/{index-4xpff2m1.js → index-eyr425dx.js} +820 -179
  75. package/dist/{index-x4h461yf.js → index-h62j8z2r.js} +1 -1
  76. package/dist/{index-xqhejxmd.js → index-pdh4tdcq.js} +1 -1
  77. package/dist/{index-9gs34125.js → index-sk6p6esd.js} +3777 -2544
  78. package/dist/{index-pb8ysnq2.js → index-sv5tn72j.js} +1 -1
  79. package/dist/{index-bamnjp2t.js → index-sx1sppd6.js} +11 -7
  80. package/dist/{index-x7jcqpy6.js → index-tx8nfw85.js} +539 -29
  81. package/dist/{index-42n4fhxy.js → index-xj5bap1r.js} +61 -54
  82. package/dist/{index-rbs27k1d.js → index-xstbytjn.js} +1 -1
  83. package/dist/{index-0jc25yjf.js → index-xvtjwhm6.js} +3 -3
  84. package/dist/{index-qtpkkzan.js → index-yamsmkmh.js} +4 -4
  85. package/dist/index.js +87 -68
  86. package/dist/{message-index-bounded-71b75npz.js → message-index-bounded-xav3h8qe.js} +5 -6
  87. package/dist/migration-worker.js +3 -4
  88. package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
  89. package/dist/plugin/messages-transform.d.ts +6 -0
  90. package/dist/plugin/messages-transform.d.ts.map +1 -1
  91. package/dist/{project-embedding-registry-5dwh5zfn.js → project-embedding-registry-f2azrq24.js} +5 -3
  92. package/dist/raw-ordinal-warmup-worker.js +4 -4
  93. package/dist/{read-session-chunk-bfv831yx.js → read-session-chunk-70aam2c1.js} +4 -5
  94. package/dist/{recomp-orchestrator-8gj1b7pz.js → recomp-orchestrator-wbm4kpq9.js} +15 -16
  95. package/dist/{render-b3zcz9x4.js → render-73vrt30h.js} +10 -11
  96. package/dist/{search-archive-dp9afcv1.js → search-archive-ew4c3bsw.js} +7 -8
  97. package/dist/{search-y3w590tn.js → search-jfwb4ms3.js} +14 -15
  98. package/dist/shared/test-open-files.d.ts +17 -0
  99. package/dist/shared/test-open-files.d.ts.map +1 -0
  100. package/dist/{storage-tags-kdb4qsyq.js → storage-tags-arnkn5t1.js} +4 -2
  101. package/dist/tools/ctx-expand/search-archive.d.ts.map +1 -1
  102. package/dist/{transform-postprocess-phase-8awze16a.js → transform-postprocess-phase-mt4dcbhd.js} +16 -17
  103. package/dist/v2/auto-search-worker.js +3 -3
  104. package/dist/v2/chunk-embedding-write-worker.js +3 -4
  105. package/dist/v2/{context-99v7x7fm.js → context-13er940g.js} +1147 -467
  106. package/dist/v2/{embedding-backfill-x1zpc04f.js → embedding-backfill-48qbnh7p.js} +4 -4
  107. package/dist/v2/embedding-worker.js +2 -2
  108. package/dist/v2/fold/instruction-supersession.d.ts.map +1 -1
  109. package/dist/v2/hooks/context.d.ts.map +1 -1
  110. package/dist/v2/{message-index-bounded-2pev910h.js → message-index-bounded-sw8hyqw1.js} +5 -6
  111. package/dist/v2/migration-worker.js +3 -4
  112. package/dist/v2/{project-embedding-registry-v2fxrs8b.js → project-embedding-registry-kwahtjgg.js} +5 -3
  113. package/dist/v2/raw-ordinal-warmup-worker.js +4 -4
  114. package/dist/v2/{read-session-chunk-a454a4d2.js → read-session-chunk-nqkn0yb4.js} +4 -5
  115. package/dist/v2/{recomp-orchestrator-03fskpsa.js → recomp-orchestrator-cdkfynz4.js} +15 -16
  116. package/dist/v2/{render-cryx4xsj.js → render-a7j6fqbd.js} +10 -11
  117. package/dist/v2/{search-2qj4w7rw.js → search-8dc9ex0a.js} +13 -14
  118. package/dist/v2/{search-archive-xw2rsq81.js → search-archive-3a36887a.js} +7 -8
  119. package/dist/v2/{server-kreheyw5.js → server-0ayyh3mx.js} +5 -7
  120. package/dist/v2/{server-t8n27rbt.js → server-4x0xq8a1.js} +1 -1
  121. package/dist/v2/{server-kaqs6h31.js → server-52x68mj4.js} +1 -1
  122. package/dist/v2/{server-cpstyzvy.js → server-578pc4tf.js} +3 -3
  123. package/dist/v2/{server-sb55ddgn.js → server-5p0bjk3y.js} +1 -1
  124. package/dist/v2/{server-58h6rrnx.js → server-6k0rnwbd.js} +1 -1
  125. package/dist/v2/{server-y5cma2j1.js → server-79tbtk5w.js} +8 -7
  126. package/dist/v2/{server-b3h8vqa6.js → server-7rmf6a57.js} +538 -28
  127. package/dist/v2/{server-xjzx27w2.js → server-7waad75d.js} +29 -18
  128. package/dist/v2/{server-wq9y9a03.js → server-96g41nad.js} +61 -54
  129. package/dist/v2/{server-txdsx71h.js → server-avfc9ezb.js} +4 -4
  130. package/dist/v2/{server-ww7xbxxf.js → server-b0357as4.js} +357 -1
  131. package/dist/v2/{server-qsvm6w79.js → server-beydmd68.js} +3763 -2484
  132. package/dist/v2/server-gge95a03.js +2687 -0
  133. package/dist/v2/{server-kfw4m268.js → server-jwydbwcx.js} +1 -1
  134. package/dist/v2/{server-brsx45r6.js → server-kwtnrhv3.js} +1 -1
  135. package/dist/v2/{server-4h4acntc.js → server-rpmkz5ta.js} +11 -7
  136. package/dist/v2/{server-0ms13pc8.js → server-rz6g5xne.js} +16 -5
  137. package/dist/v2/{server-dkfs58nq.js → server-v817sf79.js} +1 -1
  138. package/dist/v2/{server-vjadwb3j.js → server-ycvqg2s3.js} +3 -3
  139. package/dist/v2/server.js +4 -4
  140. package/dist/v2/{storage-tags-rzv7y0n3.js → storage-tags-19da4c0m.js} +4 -2
  141. package/dist/v2/{v2-archive-reader-3575hw8s.js → v2-archive-reader-jm3d7ccj.js} +1 -1
  142. package/dist/v2/{wrapup-orchestrator-shzv6t4v.js → wrapup-orchestrator-xnqq81c4.js} +18 -18
  143. package/dist/{v2-archive-reader-75fdm0te.js → v2-archive-reader-9bbfh131.js} +1 -1
  144. package/dist/{wrapup-orchestrator-e0z7nvnx.js → wrapup-orchestrator-svhee0fn.js} +16 -17
  145. package/package.json +1 -1
  146. package/src/shared/escalation-bands.test.ts +16 -1
  147. package/src/shared/sqlite-placeholders.test.ts +103 -0
  148. package/src/shared/storage-file-mutex-review.test.ts +5 -7
  149. package/src/shared/test-open-files.test.ts +194 -0
  150. package/src/shared/test-open-files.ts +71 -0
  151. package/dist/index-bkg4hdyh.js +0 -3865
  152. package/dist/index-d9vfe7xq.js +0 -16
  153. package/dist/index-hsv31e69.js +0 -405
  154. package/dist/v2/server-d9vfe7xq.js +0 -16
  155. package/dist/v2/server-kgq2e2hh.js +0 -361
  156. package/dist/v2/server-rcchadw0.js +0 -3865
@@ -8,7 +8,7 @@ import {
8
8
  ensureColumn,
9
9
  healAllNullColumns,
10
10
  installV95PerfSchema
11
- } from "./index-a6aqpfp6.js";
11
+ } from "./index-9mggb1nv.js";
12
12
  import {
13
13
  resolveOpenCodeDbPath,
14
14
  openCodeDbPathExists,
@@ -46,7 +46,7 @@ import {
46
46
  } from "./index-hexdee98.js";
47
47
  import {
48
48
  DEFAULT_LOCAL_EMBEDDING_MODEL
49
- } from "./index-jjy5a5w0.js";
49
+ } from "./index-6nqz8hsz.js";
50
50
  import {
51
51
  embeddingModelsMatch,
52
52
  resolveEmbeddingTextPrefixes,
@@ -56,7 +56,7 @@ import {
56
56
  getEmbeddingProviderIdentity,
57
57
  dominantEmbeddingFailure,
58
58
  LocalEmbeddingProvider
59
- } from "./index-rbs27k1d.js";
59
+ } from "./index-xstbytjn.js";
60
60
  import {
61
61
  embedPauseBySession,
62
62
  activeEmbeddingSessions,
@@ -2573,17 +2573,21 @@ async function embedItemsForProject2(projectIdentity, items, signal, db, session
2573
2573
  }
2574
2574
  return { vectors, modelId, generation };
2575
2575
  }
2576
- async function embedItemsWindowBounded(projectIdentity, items, signal, db) {
2576
+ async function embedItemsWindowBounded2(projectIdentity, items, signal, db, sessionId = projectIdentity, options = {}) {
2577
2577
  if (items.length <= MAX_WINDOWS_PER_EMBED_CALL) {
2578
- return embedItemsForProject2(projectIdentity, items, signal, db, projectIdentity);
2578
+ return embedItemsForProject2(projectIdentity, items, signal, db, sessionId);
2579
2579
  }
2580
2580
  const vectors = new Map;
2581
2581
  let modelId = null;
2582
2582
  let generation = null;
2583
2583
  for (let start = 0;start < items.length; start += MAX_WINDOWS_PER_EMBED_CALL) {
2584
- const result = await embedItemsForProject2(projectIdentity, items.slice(start, start + MAX_WINDOWS_PER_EMBED_CALL), signal, db, projectIdentity);
2584
+ const slice = items.slice(start, start + MAX_WINDOWS_PER_EMBED_CALL);
2585
+ const result = await embedItemsForProject2(projectIdentity, slice, signal, db, sessionId);
2585
2586
  if (!result)
2586
2587
  return null;
2588
+ if (options.stopOnIncompleteSlice && slice.some((item) => !result.vectors.has(item.id))) {
2589
+ return null;
2590
+ }
2587
2591
  if (modelId === null) {
2588
2592
  modelId = result.modelId;
2589
2593
  generation = result.generation;
@@ -2796,7 +2800,7 @@ async function embedCandidateChunkBatch(db, projectIdentity, modelId, candidates
2796
2800
  let result = null;
2797
2801
  const attemptStart = Date.now();
2798
2802
  try {
2799
- result = await embedItemsWindowBounded(projectIdentity, items, signal, db);
2803
+ result = await embedItemsWindowBounded2(projectIdentity, items, signal, db);
2800
2804
  } catch (error) {
2801
2805
  log2("[magic-context] failed to proactively embed compartment chunks:", error);
2802
2806
  }
@@ -3160,4 +3164,4 @@ function _resetProjectEmbeddingRegistryForTests2() {
3160
3164
  setBootQuietPeriodForTests(null);
3161
3165
  }
3162
3166
 
3163
- export { withQueryEmbeddingDeadline, OpenAICompatibleEmbeddingProvider, saveCommitEmbedding, loadProjectCommitEmbeddings, loadUnembeddedCommits, countEmbeddedCommits, upsertCommits, getLatestIndexedCommitSha, enforceProjectCap, describeShadowBackfillWriteRefusal2, listShadowBackfillStalls2, retainProjectEmbedding2, getShadowBackfillStopReason2, markProjectLoadUntrusted2, contentSha2562, drainProjectEmbeddingIdentityMaintenance2, drainStaleEmbeddingIdentitiesForProject2, registerProjectEmbedding2, registerProjectShadowEmbedding2, getShadowEmbeddingMeasurementCohort2, getPrimaryEmbeddingMeasurementCohort2, embedShadowTextForProject2, enqueueShadowEmbeddingItems2, getShadowBackfillRemaining2, flushShadowEmbeddingBacklog2, registerProjectInObservationMode2, unregisterProjectShadowEmbedding2, unregisterProjectEmbedding2, getProjectEmbeddingSnapshot2, installProjectEmbeddingSearchBridge2, getProjectChunkEmbeddingModelId2, getProjectEmbeddingMaxInputTokens2, embedTextForProject2, embedBatchForProject2, embedItemsForProject2, embedUnembeddedMemoriesForProject2, embedUnembeddedMemoriesForProjectOutcome2, drainCommitBacklogForProject2, embedUnembeddedCompartmentChunksForProject2, embedSessionCompartmentChunks2, getEmbeddingCoverageStatus2, getAutoEmbeddingSessionCoverage2, sweepAllRegisteredProjects2, _setTestProviderFactoryForProject2, _resetProjectEmbeddingRegistryForTests2 };
3167
+ export { withQueryEmbeddingDeadline, OpenAICompatibleEmbeddingProvider, saveCommitEmbedding, loadProjectCommitEmbeddings, loadUnembeddedCommits, countEmbeddedCommits, upsertCommits, getLatestIndexedCommitSha, enforceProjectCap, describeShadowBackfillWriteRefusal2, listShadowBackfillStalls2, retainProjectEmbedding2, getShadowBackfillStopReason2, markProjectLoadUntrusted2, contentSha2562, drainProjectEmbeddingIdentityMaintenance2, drainStaleEmbeddingIdentitiesForProject2, registerProjectEmbedding2, registerProjectShadowEmbedding2, getShadowEmbeddingMeasurementCohort2, getPrimaryEmbeddingMeasurementCohort2, embedShadowTextForProject2, enqueueShadowEmbeddingItems2, getShadowBackfillRemaining2, flushShadowEmbeddingBacklog2, registerProjectInObservationMode2, unregisterProjectShadowEmbedding2, unregisterProjectEmbedding2, getProjectEmbeddingSnapshot2, installProjectEmbeddingSearchBridge2, getProjectChunkEmbeddingModelId2, getProjectEmbeddingMaxInputTokens2, embedTextForProject2, embedBatchForProject2, embedItemsForProject2, embedItemsWindowBounded2, embedUnembeddedMemoriesForProject2, embedUnembeddedMemoriesForProjectOutcome2, drainCommitBacklogForProject2, embedUnembeddedCompartmentChunksForProject2, embedSessionCompartmentChunks2, getEmbeddingCoverageStatus2, getAutoEmbeddingSessionCoverage2, sweepAllRegisteredProjects2, _setTestProviderFactoryForProject2, _resetProjectEmbeddingRegistryForTests2 };