@cortexkit/opencode-magic-context 0.49.33 → 0.49.35

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 (229) hide show
  1. package/dist/auto-search-worker.js +11 -6
  2. package/dist/chunk-embedding-write-worker.js +16 -14
  3. package/dist/{compaction-marker-candidates-31h86ph0.js → compaction-marker-candidates-g0p67ced.js} +3 -2
  4. package/dist/compaction-marker-candidates-worker.js +1 -1
  5. package/dist/{compartment-chunk-embedding-5q5gj67r.js → compartment-chunk-embedding-y4136are.js} +8 -7
  6. package/dist/{conflict-warning-hook-xgskea1v.js → conflict-warning-hook-hhw8z5ak.js} +9 -8
  7. package/dist/{context-jyzkstnr.js → context-fk8e3h9p.js} +1400 -701
  8. package/dist/{derive-budgets-pqybnx09.js → derive-budgets-htj16n4x.js} +3 -2
  9. package/dist/embedding-backfill-q6n72sy0.js +27 -0
  10. package/dist/embedding-worker-process.js +2 -1
  11. package/dist/embedding-worker.js +5 -4
  12. package/dist/expand-attachments-h33jbgyz.js +21 -0
  13. package/dist/features/magic-context/auto-search-diagnostics.d.ts +21 -0
  14. package/dist/features/magic-context/auto-search-diagnostics.d.ts.map +1 -0
  15. package/dist/features/magic-context/compaction-marker.d.ts +22 -6
  16. package/dist/features/magic-context/compaction-marker.d.ts.map +1 -1
  17. package/dist/features/magic-context/compartment-chunk-embedding.d.ts +1 -1
  18. package/dist/features/magic-context/compartment-chunk-embedding.d.ts.map +1 -1
  19. package/dist/features/magic-context/search.d.ts +4 -0
  20. package/dist/features/magic-context/search.d.ts.map +1 -1
  21. package/dist/features/magic-context/storage-meta-persisted.d.ts +7 -0
  22. package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -1
  23. package/dist/features/magic-context/store-generation-rebase-labels.d.ts +6 -0
  24. package/dist/features/magic-context/store-generation-rebase-labels.d.ts.map +1 -0
  25. package/dist/features/magic-context/store-generation-rebase.d.ts.map +1 -1
  26. package/dist/{history-owner-36wp3mkb.js → history-owner-0z620wgz.js} +3 -2
  27. package/dist/hooks/magic-context/apply-operations.d.ts +20 -3
  28. package/dist/hooks/magic-context/apply-operations.d.ts.map +1 -1
  29. package/dist/hooks/magic-context/auto-search-observation.d.ts +13 -0
  30. package/dist/hooks/magic-context/auto-search-observation.d.ts.map +1 -0
  31. package/dist/hooks/magic-context/auto-search-runner.d.ts.map +1 -1
  32. package/dist/hooks/magic-context/auto-search-worker-client.d.ts +5 -1
  33. package/dist/hooks/magic-context/auto-search-worker-client.d.ts.map +1 -1
  34. package/dist/hooks/magic-context/compaction-marker-manager.d.ts +5 -5
  35. package/dist/hooks/magic-context/compaction-marker-manager.d.ts.map +1 -1
  36. package/dist/hooks/magic-context/compaction-marker-publication.d.ts +9 -0
  37. package/dist/hooks/magic-context/compaction-marker-publication.d.ts.map +1 -0
  38. package/dist/hooks/magic-context/compartment-commit-hashes.d.ts +4 -0
  39. package/dist/hooks/magic-context/compartment-commit-hashes.d.ts.map +1 -0
  40. package/dist/hooks/magic-context/compartment-runner-validation.d.ts +1 -0
  41. package/dist/hooks/magic-context/compartment-runner-validation.d.ts.map +1 -1
  42. package/dist/hooks/magic-context/event-resolvers.d.ts.map +1 -1
  43. package/dist/hooks/magic-context/final-wire-completeness.d.ts +15 -0
  44. package/dist/hooks/magic-context/final-wire-completeness.d.ts.map +1 -0
  45. package/dist/hooks/magic-context/final-wire-token-estimate.d.ts.map +1 -1
  46. package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
  47. package/dist/hooks/magic-context/raw-ordinal-warmup.d.ts +1 -0
  48. package/dist/hooks/magic-context/raw-ordinal-warmup.d.ts.map +1 -1
  49. package/dist/hooks/magic-context/read-session-chunk.d.ts +11 -0
  50. package/dist/hooks/magic-context/read-session-chunk.d.ts.map +1 -1
  51. package/dist/hooks/magic-context/read-session-formatting.d.ts +2 -0
  52. package/dist/hooks/magic-context/read-session-formatting.d.ts.map +1 -1
  53. package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
  54. package/dist/hooks/magic-context/transform.d.ts.map +1 -1
  55. package/dist/{index-as2amvn3.js → index-0c7p8mq5.js} +6 -531
  56. package/dist/{index-51rdvtkz.js → index-1rhgxqs8.js} +2 -2
  57. package/dist/index-2amn2s73.js +123 -0
  58. package/dist/{index-c7phnbvk.js → index-2p37txes.js} +1 -1
  59. package/dist/index-2qbtqg1w.js +529 -0
  60. package/dist/{index-waktfbjy.js → index-2v6nvy3k.js} +4 -4
  61. package/dist/{index-dq5xzeb9.js → index-3d3872c6.js} +7 -5
  62. package/dist/{index-qr2mb02j.js → index-3j9t1v4n.js} +55 -21
  63. package/dist/{index-2xh37qn5.js → index-4bgk5ztz.js} +576 -5524
  64. package/dist/{index-b88dwwrh.js → index-4xyjr62e.js} +1 -1
  65. package/dist/index-66a50f3e.js +777 -0
  66. package/dist/{index-94ef0qe2.js → index-87ctnzz9.js} +33 -5
  67. package/dist/{index-xrnsygfq.js → index-9wnbnx8f.js} +1 -1
  68. package/dist/{index-3fkk2gwj.js → index-b6xz3qbe.js} +246 -420
  69. package/dist/{index-0fe4q77z.js → index-brg2w6qc.js} +146 -134
  70. package/dist/{index-spwjbkc7.js → index-dnqqqc5f.js} +1 -1
  71. package/dist/index-dy7w6wm4.js +194 -0
  72. package/dist/{index-3jmx3fae.js → index-ezv6dz3y.js} +37 -7
  73. package/dist/index-f297z1n8.js +4557 -0
  74. package/dist/{index-qgh1qwjj.js → index-f9b3vtt1.js} +1 -1
  75. package/dist/{index-v15ne3a3.js → index-faxb7mck.js} +2 -2
  76. package/dist/{index-rrv26qjz.js → index-fw42ms3m.js} +1 -1
  77. package/dist/{index-t5pck3ss.js → index-fxbk7gk3.js} +1 -1
  78. package/dist/{index-wfybj1dw.js → index-g4t7850m.js} +2 -2
  79. package/dist/{index-hbt0sbv2.js → index-gyaa159j.js} +18 -276
  80. package/dist/{index-4pnsgvfk.js → index-hacf2tyx.js} +1 -1
  81. package/dist/{index-s1n8dd2n.js → index-jkanybgq.js} +2 -2
  82. package/dist/{index-2743x98y.js → index-jn0ddrhp.js} +29 -138
  83. package/dist/{index-h7tgn49j.js → index-jrfre9ah.js} +5 -222
  84. package/dist/{index-kfyb3k6n.js → index-jz5bk7xd.js} +2 -2
  85. package/dist/{index-np3rgfw4.js → index-ksv0a31x.js} +3 -3
  86. package/dist/{index-7kkphb6c.js → index-nj360hcs.js} +4 -4
  87. package/dist/{index-gkee6p4g.js → index-p56dszfp.js} +3 -3
  88. package/dist/{index-4s4zq97n.js → index-pq0dpwrc.js} +4 -4
  89. package/dist/{index-rfxzazzy.js → index-pswsyf1w.js} +4 -4
  90. package/dist/{index-y1qwzvxn.js → index-pztqab6k.js} +2 -2
  91. package/dist/{index-rverk2vz.js → index-qncw9hey.js} +1 -1
  92. package/dist/index-qx8j6kds.js +270 -0
  93. package/dist/{index-kq5w68dp.js → index-txs8tce6.js} +1 -1
  94. package/dist/index-vzhhr1ht.js +532 -0
  95. package/dist/index-wh9fxds5.js +265 -0
  96. package/dist/{index-b7w46fp2.js → index-x2mrq5xv.js} +170 -48
  97. package/dist/{index-43vqx0za.js → index-xwwsbsd3.js} +15 -13
  98. package/dist/index-z4p0ry94.js +222 -0
  99. package/dist/index-z9zygwse.js +89 -0
  100. package/dist/{index-v7287tzq.js → index-zhqwda72.js} +19 -8
  101. package/dist/index.js +83 -72
  102. package/dist/{logger-94kew5wm.js → logger-qwnbcfj9.js} +2 -1
  103. package/dist/{message-fts-rowid-map-va36knh4.js → message-fts-rowid-map-xg7hr0mk.js} +5 -4
  104. package/dist/{message-index-bounded-zq7a5nm6.js → message-index-bounded-narw7bnz.js} +12 -11
  105. package/dist/{message-time-backfill-4qva0b4f.js → message-time-backfill-39bm498k.js} +3 -2
  106. package/dist/migration-worker.js +13 -11
  107. package/dist/{project-embedding-registry-6yex0r9f.js → project-embedding-registry-tdz7985n.js} +13 -11
  108. package/dist/raw-ordinal-warmup-worker.js +12 -7
  109. package/dist/{read-session-chunk-1ndphmb8.js → read-session-chunk-vmg1zjg0.js} +15 -10
  110. package/dist/{read-session-raw-b2sd67v4.js → read-session-raw-mncmzbm9.js} +3 -2
  111. package/dist/recomp-orchestrator-qyyhnc9b.js +68 -0
  112. package/dist/render-c5p0k846.js +43 -0
  113. package/dist/{safe-notification-target-mkr9yzvr.js → safe-notification-target-wztd7bgk.js} +3 -2
  114. package/dist/{search-archive-sr07c6aj.js → search-archive-0ny7p3bw.js} +13 -11
  115. package/dist/{search-040pac3a.js → search-f6hwvcxk.js} +26 -23
  116. package/dist/{send-session-notification-vz86nt79.js → send-session-notification-0gwcz3fw.js} +7 -6
  117. package/dist/{storage-tags-6hvkk01c.js → storage-tags-zx1023km.js} +5 -4
  118. package/dist/store-620rjzt9.js +21 -0
  119. package/dist/store-reader-yh19h38c.js +14 -0
  120. package/dist/tools/ctx-expand/render.d.ts +5 -3
  121. package/dist/tools/ctx-expand/render.d.ts.map +1 -1
  122. package/dist/tools/ctx-expand/search-archive.d.ts.map +1 -1
  123. package/dist/tools/ctx-expand/tools.d.ts +2 -0
  124. package/dist/tools/ctx-expand/tools.d.ts.map +1 -1
  125. package/dist/tools/ctx-expand/v2-archive-reader.d.ts +33 -0
  126. package/dist/tools/ctx-expand/v2-archive-reader.d.ts.map +1 -0
  127. package/dist/{transform-postprocess-phase-zx1peqma.js → transform-postprocess-phase-807ff6t2.js} +36 -30
  128. package/dist/v2/auto-search-worker.js +11 -6
  129. package/dist/v2/chunk-embedding-write-worker.js +16 -14
  130. package/dist/v2/{compaction-marker-candidates-m4vmye3w.js → compaction-marker-candidates-t1aq6gsj.js} +3 -2
  131. package/dist/v2/compaction-marker-candidates-worker.js +1 -1
  132. package/dist/v2/{compartment-chunk-embedding-rc31e6md.js → compartment-chunk-embedding-ncsk0r9e.js} +8 -7
  133. package/dist/v2/{context-3c4z2wj5.js → context-znqfkap4.js} +1725 -1095
  134. package/dist/v2/{derive-budgets-knf763tt.js → derive-budgets-sa0v7bz0.js} +4 -3
  135. package/dist/v2/embedding-backfill-11j425e0.js +26 -0
  136. package/dist/v2/embedding-worker-process.js +2 -1
  137. package/dist/v2/embedding-worker.js +5 -4
  138. package/dist/v2/expand-attachments-h33jbgyz.js +21 -0
  139. package/dist/v2/fold/idle.d.ts +15 -0
  140. package/dist/v2/fold/idle.d.ts.map +1 -0
  141. package/dist/v2/fold/native-replay-v3.d.ts +68 -0
  142. package/dist/v2/fold/native-replay-v3.d.ts.map +1 -0
  143. package/dist/v2/fold/native-replay.d.ts +58 -2
  144. package/dist/v2/fold/native-replay.d.ts.map +1 -1
  145. package/dist/v2/fold/policy.d.ts +2 -1
  146. package/dist/v2/fold/policy.d.ts.map +1 -1
  147. package/dist/v2/{history-owner-ad0crnrn.js → history-owner-fpka43cn.js} +3 -2
  148. package/dist/v2/hooks/context.d.ts.map +1 -1
  149. package/dist/v2/hooks/expand-attachments.d.ts +8 -0
  150. package/dist/v2/hooks/expand-attachments.d.ts.map +1 -0
  151. package/dist/v2/hooks/overflow-recovery.d.ts +45 -0
  152. package/dist/v2/hooks/overflow-recovery.d.ts.map +1 -0
  153. package/dist/v2/hooks/store.d.ts +7 -2
  154. package/dist/v2/hooks/store.d.ts.map +1 -1
  155. package/dist/v2/{logger-p34mjtja.js → logger-4cj6d03m.js} +2 -1
  156. package/dist/v2/{message-fts-rowid-map-78awh03v.js → message-fts-rowid-map-rmk571mb.js} +5 -4
  157. package/dist/v2/{message-index-bounded-jvgz7vk9.js → message-index-bounded-620bppw7.js} +12 -11
  158. package/dist/v2/{message-time-backfill-zvthw6xb.js → message-time-backfill-0c4h7sg6.js} +3 -2
  159. package/dist/v2/migration-worker.js +13 -11
  160. package/dist/v2/ordinal-range.fixture.d.ts +7 -0
  161. package/dist/v2/ordinal-range.fixture.d.ts.map +1 -0
  162. package/dist/v2/{project-embedding-registry-1x5qe2fy.js → project-embedding-registry-bm5fe1a8.js} +13 -11
  163. package/dist/v2/raw-ordinal-warmup-worker.js +12 -7
  164. package/dist/v2/{read-session-chunk-djzgm4jg.js → read-session-chunk-qfwv1k71.js} +15 -10
  165. package/dist/v2/{read-session-raw-5x088amc.js → read-session-raw-q294t8xs.js} +3 -2
  166. package/dist/v2/recomp-orchestrator-fcnjref7.js +67 -0
  167. package/dist/v2/render-98a1qv0b.js +42 -0
  168. package/dist/v2/{safe-notification-target-khnzg57c.js → safe-notification-target-gphhast7.js} +3 -2
  169. package/dist/v2/{search-archive-n3dhns4r.js → search-archive-r0y1bafr.js} +13 -11
  170. package/dist/v2/{search-q3wkpe8t.js → search-z1zqzsmh.js} +25 -22
  171. package/dist/v2/{send-session-notification-x5nzy34v.js → send-session-notification-fst6hkg7.js} +7 -6
  172. package/dist/v2/{server-rb8m4vry.js → server-1xesqm5h.js} +146 -134
  173. package/dist/v2/server-2amn2s73.js +123 -0
  174. package/dist/v2/{server-6g98c227.js → server-3schkz95.js} +4 -4
  175. package/dist/v2/server-468mya5v.js +209 -0
  176. package/dist/v2/server-55v5hpth.js +270 -0
  177. package/dist/v2/server-5jp38p98.js +532 -0
  178. package/dist/v2/{server-qjvk4a9t.js → server-69m30b21.js} +1 -1
  179. package/dist/v2/{server-d01pe8q5.js → server-7ccxt4nq.js} +14 -216
  180. package/dist/v2/{server-3mz2qh5a.js → server-969cdpmg.js} +1 -1
  181. package/dist/v2/{server-835q39kd.js → server-9k0mjef7.js} +2 -2
  182. package/dist/v2/{server-qc915kw2.js → server-bez34e60.js} +4 -4
  183. package/dist/v2/{server-nxas8v1d.js → server-bpvsvtph.js} +3 -3
  184. package/dist/v2/{server-ab8017gw.js → server-bxpz2dcn.js} +29 -138
  185. package/dist/v2/{server-bsgd4dk1.js → server-dcws5831.js} +2 -2
  186. package/dist/v2/server-ef1mskas.js +777 -0
  187. package/dist/v2/{server-1bw1wcbp.js → server-f0j864ma.js} +1 -1
  188. package/dist/v2/{server-aqbm9c8d.js → server-fqj6ddpr.js} +632 -5540
  189. package/dist/v2/{server-rr4cbkr0.js → server-hnknwaz8.js} +37 -7
  190. package/dist/v2/{server-h1byrhwx.js → server-hsf0qsn5.js} +19 -8
  191. package/dist/v2/{server-6495nmn9.js → server-jb6tjyeb.js} +5 -222
  192. package/dist/v2/{server-2aasmpsp.js → server-kkxzwa6w.js} +4 -4
  193. package/dist/v2/{server-a7x00tw8.js → server-mfn1yf9d.js} +1 -1
  194. package/dist/v2/{server-tkdabx8q.js → server-q0z2q2dx.js} +5 -530
  195. package/dist/v2/{server-n14edf07.js → server-qa74bj91.js} +77 -17
  196. package/dist/v2/server-qf2kzsh2.js +4513 -0
  197. package/dist/v2/{server-gyy4k6mf.js → server-qmmkhz2z.js} +1 -1
  198. package/dist/v2/{server-29qp8nz4.js → server-qxzbmtqt.js} +1 -1
  199. package/dist/v2/{server-hwag0khr.js → server-r3chnxs5.js} +4 -4
  200. package/dist/v2/{server-vr4szghm.js → server-rktnzs89.js} +2 -2
  201. package/dist/v2/{server-6vd2n183.js → server-s9xgyyj9.js} +1 -1
  202. package/dist/v2/{server-53eh1r8r.js → server-sd8hvzte.js} +2 -2
  203. package/dist/v2/{server-k3t06fxr.js → server-sefxj8k1.js} +1 -1
  204. package/dist/v2/{server-v77xa5wj.js → server-tpt7bwq8.js} +1 -1
  205. package/dist/v2/{server-awr8qa4c.js → server-ws5exe6q.js} +2 -2
  206. package/dist/v2/server-x4m6xcn4.js +194 -0
  207. package/dist/v2/{server-806rzhs6.js → server-xbtw0p9t.js} +1 -1
  208. package/dist/v2/{server-cqjvxyrp.js → server-xy7w7hrd.js} +2 -2
  209. package/dist/v2/server-ypf1ap0v.js +529 -0
  210. package/dist/v2/server-z4p0ry94.js +222 -0
  211. package/dist/v2/server-z9zygwse.js +89 -0
  212. package/dist/v2/{server-ab1g0wn9.js → server-zzgtgqmd.js} +2 -2
  213. package/dist/v2/server.js +6 -5
  214. package/dist/v2/{storage-tags-18nbaanf.js → storage-tags-19s0ebf0.js} +5 -4
  215. package/dist/v2/store-reader-cgx47zkp.js +14 -0
  216. package/dist/v2/store-reader.d.ts +9 -2
  217. package/dist/v2/store-reader.d.ts.map +1 -1
  218. package/dist/v2/store-vdm8v3jd.js +21 -0
  219. package/dist/v2/v2-archive-reader-t2c0eypn.js +11 -0
  220. package/dist/v2/{wrapup-orchestrator-ga5vfmwr.js → wrapup-orchestrator-aqpqsveg.js} +46 -39
  221. package/dist/v2-archive-reader-tm2eayp2.js +11 -0
  222. package/dist/wrapup-orchestrator-k5yp19a6.js +55 -0
  223. package/package.json +1 -1
  224. package/src/shared/sqlite-transaction-mode-guard.test.ts +4 -0
  225. package/dist/embedding-backfill-0jgtqxen.js +0 -25
  226. package/dist/recomp-orchestrator-skqzzvby.js +0 -62
  227. package/dist/v2/embedding-backfill-f43hd8y6.js +0 -24
  228. package/dist/v2/recomp-orchestrator-qfqdvbta.js +0 -61
  229. package/dist/wrapup-orchestrator-dy8r3gp8.js +0 -49
@@ -1,23 +1,16 @@
1
1
  import {
2
- sanitizeDiagnosticText,
3
- sessionLog2
4
- } from "./index-h7tgn49j.js";
5
- import {
6
- getHarness2
7
- } from "./index-pavzsdc6.js";
8
- import {
9
- isTransientSqliteError2
10
- } from "./index-gzy5w8ya.js";
2
+ sanitizeDiagnosticText
3
+ } from "./index-z4p0ry94.js";
11
4
  import {
12
5
  PROMOTABLE_CATEGORIES,
13
6
  CATEGORY_DEFAULT_TTL
14
7
  } from "./index-fr0wbhdn.js";
15
8
  import {
16
- managedAuthorityNoteRow
17
- } from "./index-7kkphb6c.js";
9
+ sessionLog2
10
+ } from "./index-jrfre9ah.js";
18
11
  import {
19
12
  embedTextForProject2
20
- } from "./index-2743x98y.js";
13
+ } from "./index-jn0ddrhp.js";
21
14
  import {
22
15
  saveEmbeddingIfHashMatches
23
16
  } from "./index-4dhv7mqz.js";
@@ -363,524 +356,6 @@ function dreamFailureCode(failureClass) {
363
356
  function renderEmbeddingFailure(failureClass, style = "markdown") {
364
357
  return renderUserFacingFailure(EMBEDDING_FAILURE_KEYS[failureClass], style);
365
358
  }
366
-
367
- // src/features/magic-context/storage-notes.ts
368
- var NOTE_TYPES = new Set(["session", "smart"]);
369
- var NOTE_STATUSES = new Set(["active", "pending", "ready", "dismissed"]);
370
- var NOTE_CHECK_STATUSES = new Set([
371
- "uncompiled",
372
- "compiled",
373
- "failing",
374
- "fallback",
375
- "parked"
376
- ]);
377
- var CONDITION_COMPILE_STATUSES = new Set([
378
- "compiled",
379
- "plain",
380
- "refused"
381
- ]);
382
- var DEFAULT_SMART_STATUSES = ["pending", "ready"];
383
- function toNullableString(value) {
384
- return typeof value === "string" && value.length > 0 ? value : null;
385
- }
386
- function toNullableNumber(value) {
387
- return typeof value === "number" ? value : null;
388
- }
389
- function isNoteRow(row) {
390
- if (row === null || typeof row !== "object")
391
- return false;
392
- const candidate = row;
393
- return typeof candidate.id === "number" && typeof candidate.type === "string" && NOTE_TYPES.has(candidate.type) && typeof candidate.status === "string" && NOTE_STATUSES.has(candidate.status) && typeof candidate.content === "string" && (candidate.session_id === null || typeof candidate.session_id === "string") && (candidate.project_path === null || typeof candidate.project_path === "string") && (candidate.surface_condition === null || typeof candidate.surface_condition === "string") && typeof candidate.created_at === "number" && typeof candidate.updated_at === "number" && (candidate.last_checked_at === null || typeof candidate.last_checked_at === "number") && (candidate.ready_at === null || typeof candidate.ready_at === "number") && (candidate.ready_reason === null || typeof candidate.ready_reason === "string");
394
- }
395
- function toNote(row) {
396
- return {
397
- id: row.id,
398
- type: row.type,
399
- status: row.status,
400
- content: row.content,
401
- sessionId: toNullableString(row.session_id),
402
- projectPath: toNullableString(row.project_path),
403
- surfaceCondition: toNullableString(row.surface_condition),
404
- compiledProvider: toNullableString(row.compiled_provider),
405
- compiledConfig: toNullableString(row.compiled_config),
406
- compiledAt: toNullableNumber(row.compiled_at),
407
- compileStatus: typeof row.compile_status === "string" && CONDITION_COMPILE_STATUSES.has(row.compile_status) ? row.compile_status : null,
408
- createdAt: row.created_at,
409
- updatedAt: row.updated_at,
410
- lastCheckedAt: toNullableNumber(row.last_checked_at),
411
- readyAt: toNullableNumber(row.ready_at),
412
- readyReason: toNullableString(row.ready_reason),
413
- anchorOrdinal: toNullableNumber(row.anchor_ordinal),
414
- compiledCheck: toNullableString(row.compiled_check),
415
- manifestJson: toNullableString(row.manifest_json),
416
- checkHash: toNullableString(row.check_hash),
417
- checkCron: toNullableString(row.check_cron),
418
- checkVersion: toNullableNumber(row.check_version),
419
- checkStatus: typeof row.check_status === "string" && NOTE_CHECK_STATUSES.has(row.check_status) ? row.check_status : null,
420
- checkFailureCount: toNullableNumber(row.check_failure_count) ?? 0,
421
- checkNetworkFailureCount: toNullableNumber(row.check_network_failure_count) ?? 0,
422
- checkQuarantinedUntil: toNullableNumber(row.check_quarantined_until),
423
- checkNextDueAt: toNullableNumber(row.check_next_due_at),
424
- checkCompiledAt: toNullableNumber(row.check_compiled_at),
425
- checkFalseSinceAt: toNullableNumber(row.check_false_since_at),
426
- checkLastLivenessAt: toNullableNumber(row.check_last_liveness_at),
427
- policyVersion: toNullableNumber(row.policy_version)
428
- };
429
- }
430
- function noteCheckColumnsExist(db) {
431
- try {
432
- const rows = db.prepare("PRAGMA table_info(notes)").all();
433
- return rows.some((row) => row.name === "compiled_check");
434
- } catch {
435
- return false;
436
- }
437
- }
438
- var PENDING_SESSION_NOTE_PREDICATE = "type = 'session' AND status = 'pending' AND surface_condition IS NOT NULL";
439
- function healPendingSessionNotes(db) {
440
- let predicate = `${PENDING_SESSION_NOTE_PREDICATE} AND NOT ${managedAuthorityNoteRow("notes")}`;
441
- let healable;
442
- try {
443
- healable = db.prepare(`SELECT 1 FROM notes WHERE ${predicate} LIMIT 1`).get();
444
- } catch (error) {
445
- if (!(error instanceof Error) || !error.message.includes("no such table"))
446
- throw error;
447
- predicate = PENDING_SESSION_NOTE_PREDICATE;
448
- healable = db.prepare(`SELECT 1 FROM notes WHERE ${predicate} LIMIT 1`).get();
449
- }
450
- if (healable == null)
451
- return;
452
- try {
453
- db.prepare(`UPDATE notes SET status = 'active', surface_condition = NULL WHERE ${predicate}`).run();
454
- } catch (error) {
455
- if (!isTransientSqliteError2(error))
456
- throw error;
457
- }
458
- }
459
- var SESSION_NOTE_CONDITION_ERROR = "Only a note created with a condition can have one. Write a new note with surface_condition, and dismiss this one.";
460
- function getNoteById(db, noteId) {
461
- healPendingSessionNotes(db);
462
- const row = db.prepare("SELECT * FROM notes WHERE id = ?").get(noteId);
463
- return isNoteRow(row) ? toNote(row) : null;
464
- }
465
- function getNoteByIdInScope(db, noteId, scope) {
466
- const note = getNoteById(db, noteId);
467
- return note && noteBelongsToScope(note, scope) ? note : null;
468
- }
469
- function noteBelongsToScope(note, scope) {
470
- if (note.type === "session") {
471
- return note.sessionId === scope.sessionId;
472
- }
473
- return note.projectPath === scope.projectPath;
474
- }
475
- function buildStatusClause(status) {
476
- if (status === undefined) {
477
- return null;
478
- }
479
- const statuses = Array.isArray(status) ? status : [status];
480
- if (statuses.length === 0) {
481
- return null;
482
- }
483
- const placeholders = statuses.map(() => "?").join(", ");
484
- return {
485
- sql: `status IN (${placeholders})`,
486
- params: statuses
487
- };
488
- }
489
- function getNotes(db, options = {}) {
490
- healPendingSessionNotes(db);
491
- const clauses = [];
492
- const params = [];
493
- if (options.sessionId !== undefined) {
494
- clauses.push("session_id = ?");
495
- params.push(options.sessionId);
496
- }
497
- if (options.projectPath !== undefined) {
498
- clauses.push("project_path = ?");
499
- params.push(options.projectPath);
500
- }
501
- if (options.type !== undefined) {
502
- clauses.push("type = ?");
503
- params.push(options.type);
504
- }
505
- const statusClause = buildStatusClause(options.status);
506
- if (statusClause) {
507
- clauses.push(statusClause.sql);
508
- params.push(...statusClause.params);
509
- }
510
- const where = clauses.length > 0 ? ` WHERE ${clauses.join(" AND ")}` : "";
511
- return db.prepare(`SELECT * FROM notes${where} ORDER BY created_at ASC, id ASC`).all(...params).filter(isNoteRow).map(toNote);
512
- }
513
- function addNote(db, type, options) {
514
- const now = Date.now();
515
- const result = type === "session" ? db.prepare("INSERT INTO notes (type, status, content, session_id, created_at, updated_at, harness, anchor_ordinal) VALUES ('session', 'active', ?, ?, ?, ?, ?, ?) RETURNING *").get(options.content, options.sessionId, now, now, getHarness2(), options.anchorOrdinal ?? null) : db.prepare("INSERT INTO notes (type, status, content, session_id, project_path, surface_condition, compiled_provider, compiled_config, compiled_at, compile_status, created_at, updated_at, harness, anchor_ordinal) VALUES ('smart', 'pending', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING *").get(options.content, options.sessionId ?? null, options.projectPath, options.surfaceCondition, options.compiledProvider ?? null, options.compiledConfig ?? null, options.compiledAt ?? null, options.compileStatus ?? null, now, now, getHarness2(), options.anchorOrdinal ?? null);
516
- if (!isNoteRow(result)) {
517
- throw new Error("[notes] failed to insert note");
518
- }
519
- return toNote(result);
520
- }
521
- function getSessionNotes(db, sessionId) {
522
- return getNotes(db, { sessionId, type: "session", status: "active" });
523
- }
524
- function getSmartNotes(db, projectPath, status) {
525
- return getNotes(db, {
526
- projectPath,
527
- type: "smart",
528
- status: status ?? DEFAULT_SMART_STATUSES
529
- });
530
- }
531
- function getPendingSmartNotes(db, projectPath) {
532
- return getSmartNotes(db, projectPath, "pending");
533
- }
534
- function getReadySmartNotes(db, projectPath) {
535
- return getSmartNotes(db, projectPath, "ready");
536
- }
537
- function updateNote(db, noteId, updates, scope) {
538
- const existing = getNoteByIdInScope(db, noteId, scope);
539
- if (!existing) {
540
- return null;
541
- }
542
- if (updates.surfaceCondition !== undefined && existing.type !== "smart") {
543
- return null;
544
- }
545
- const now = Date.now();
546
- const sets = ["updated_at = ?"];
547
- const params = [now];
548
- if (updates.content !== undefined) {
549
- sets.push("content = ?");
550
- params.push(updates.content);
551
- }
552
- if (updates.sessionId !== undefined) {
553
- sets.push("session_id = ?");
554
- params.push(updates.sessionId);
555
- }
556
- const smartConditionChanged = existing.type === "smart" && updates.surfaceCondition !== undefined && updates.surfaceCondition !== existing.surfaceCondition;
557
- if (updates.status !== undefined && !smartConditionChanged) {
558
- sets.push("status = ?");
559
- params.push(updates.status);
560
- }
561
- if (existing.type === "smart") {
562
- if (updates.projectPath !== undefined) {
563
- sets.push("project_path = ?");
564
- params.push(updates.projectPath);
565
- }
566
- if (updates.surfaceCondition !== undefined) {
567
- sets.push("surface_condition = ?");
568
- params.push(updates.surfaceCondition);
569
- }
570
- if (smartConditionChanged) {
571
- sets.push("status = 'pending'", "last_checked_at = NULL", "ready_at = NULL", "ready_reason = NULL");
572
- sets.push("compiled_provider = ?", "compiled_config = ?", "compiled_at = ?", "compile_status = ?");
573
- params.push(updates.compiledProvider ?? null, updates.compiledConfig ?? null, updates.compiledAt ?? null, updates.compileStatus ?? null);
574
- if (noteCheckColumnsExist(db)) {
575
- sets.push("compiled_check = NULL", "manifest_json = NULL", "check_hash = NULL", "check_cron = NULL", "check_version = 0", "check_status = 'uncompiled'", "check_failure_count = 0", "check_network_failure_count = 0", "check_quarantined_until = NULL", "check_next_due_at = NULL", "check_compiled_at = NULL", "check_false_since_at = NULL", "check_last_liveness_at = NULL");
576
- }
577
- } else {
578
- if (updates.lastCheckedAt !== undefined) {
579
- sets.push("last_checked_at = ?");
580
- params.push(updates.lastCheckedAt);
581
- }
582
- if (updates.readyAt !== undefined) {
583
- sets.push("ready_at = ?");
584
- params.push(updates.readyAt);
585
- }
586
- if (updates.readyReason !== undefined) {
587
- sets.push("ready_reason = ?");
588
- params.push(updates.readyReason);
589
- }
590
- }
591
- }
592
- if (sets.length === 1) {
593
- return null;
594
- }
595
- params.push(noteId);
596
- const result = db.prepare(`UPDATE notes SET ${sets.join(", ")} WHERE id = ? RETURNING *`).get(...params);
597
- return isNoteRow(result) ? toNote(result) : null;
598
- }
599
- function dismissNotes(db, noteIds, scope) {
600
- const now = Date.now();
601
- return db.transaction(() => noteIds.map((noteId) => {
602
- const existing = getNoteById(db, noteId);
603
- if (!existing)
604
- return { noteId, outcome: "not_found" };
605
- if (!noteBelongsToScope(existing, scope)) {
606
- return { noteId, outcome: "not_owned" };
607
- }
608
- if (existing.status === "dismissed") {
609
- return { noteId, outcome: "already_dismissed" };
610
- }
611
- const result = db.prepare("UPDATE notes SET status = 'dismissed', updated_at = ? WHERE id = ? AND status != 'dismissed'").run(now, noteId);
612
- return {
613
- noteId,
614
- outcome: result.changes > 0 ? "dismissed" : "already_dismissed"
615
- };
616
- })).immediate();
617
- }
618
- function dismissNote(db, noteId, scope) {
619
- return dismissNotes(db, [noteId], scope)[0]?.outcome === "dismissed";
620
- }
621
- function markNoteReady(db, noteId, reason) {
622
- const now = Date.now();
623
- db.prepare("UPDATE notes SET status = 'ready', ready_at = ?, ready_reason = ?, updated_at = ?, last_checked_at = ? WHERE id = ? AND type = 'smart'").run(now, reason ?? null, now, now, noteId);
624
- }
625
- function markNoteChecked(db, noteId) {
626
- const now = Date.now();
627
- db.prepare("UPDATE notes SET last_checked_at = ?, updated_at = ? WHERE id = ? AND type = 'smart'").run(now, now, noteId);
628
- }
629
-
630
- // src/features/magic-context/storage-primers.ts
631
- var PRIMER_CANDIDATE_TTL_MS = 90 * 24 * 60 * 60 * 1000;
632
- var PRIMER_CANDIDATE_MAX_AGE_MS = 180 * 24 * 60 * 60 * 1000;
633
- function normalizePrimerQuestion(question) {
634
- return question.trim().toLowerCase().replace(/[“”]/g, '"').replace(/[’]/g, "'").replace(/\s+/g, " ").replace(/[?.!]+$/g, "").trim();
635
- }
636
- function primerOccurrenceKey(candidate) {
637
- return [
638
- candidate.projectPath,
639
- candidate.harness,
640
- candidate.sessionId,
641
- candidate.sourceStartMessageId,
642
- candidate.sourceEndMessageId
643
- ].join("\x1F");
644
- }
645
- function primerOccurrenceUtcDay(sourceMessageTime) {
646
- return new Date(sourceMessageTime).toISOString().slice(0, 10);
647
- }
648
- function vectorBlob(vector) {
649
- if (!vector)
650
- return null;
651
- return new Uint8Array(vector.buffer, vector.byteOffset, vector.byteLength);
652
- }
653
- function blobToFloat32Array(value) {
654
- if (!value)
655
- return null;
656
- const bytes = value instanceof ArrayBuffer ? new Uint8Array(value) : value;
657
- return new Float32Array(bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength));
658
- }
659
- function parseCandidateIds(raw) {
660
- if (!raw)
661
- return [];
662
- try {
663
- const parsed = JSON.parse(raw);
664
- return Array.isArray(parsed) ? parsed.filter((id) => typeof id === "number" && Number.isFinite(id)) : [];
665
- } catch {
666
- return [];
667
- }
668
- }
669
- function parsePrimerSourceProvenance(raw) {
670
- if (raw === null)
671
- return null;
672
- try {
673
- const parsed = JSON.parse(raw);
674
- if (!Array.isArray(parsed))
675
- return null;
676
- const provenance = [];
677
- for (const value of parsed) {
678
- if (!value || typeof value !== "object")
679
- return null;
680
- const source = value;
681
- if (typeof source.candidate_id !== "number" || !Number.isFinite(source.candidate_id) || typeof source.project_path !== "string" || typeof source.harness !== "string" || typeof source.session_id !== "string" || source.source_compartment_start !== null && typeof source.source_compartment_start !== "number" || source.source_compartment_end !== null && typeof source.source_compartment_end !== "number" || typeof source.source_start_message_id !== "string" || typeof source.source_end_message_id !== "string") {
682
- return null;
683
- }
684
- provenance.push({
685
- candidateId: source.candidate_id,
686
- projectPath: source.project_path,
687
- harness: source.harness,
688
- sessionId: source.session_id,
689
- sourceCompartmentStart: source.source_compartment_start,
690
- sourceCompartmentEnd: source.source_compartment_end,
691
- sourceStartMessageId: source.source_start_message_id,
692
- sourceEndMessageId: source.source_end_message_id
693
- });
694
- }
695
- return provenance;
696
- } catch {
697
- return null;
698
- }
699
- }
700
- function loadPrimerSourceProvenance(db, candidateIds) {
701
- const ids = [...new Set(candidateIds)].sort((a, b) => a - b);
702
- if (ids.length === 0)
703
- return [];
704
- const placeholders = ids.map(() => "?").join(",");
705
- const rows = db.prepare(`SELECT id, project_path, harness, session_id,
706
- source_compartment_start, source_compartment_end,
707
- source_start_message_id, source_end_message_id
708
- FROM primer_candidates
709
- WHERE id IN (${placeholders})
710
- ORDER BY id ASC`).all(...ids);
711
- return rows.map((row) => ({
712
- candidateId: row.id,
713
- projectPath: row.project_path,
714
- harness: row.harness,
715
- sessionId: row.session_id,
716
- sourceCompartmentStart: row.source_compartment_start,
717
- sourceCompartmentEnd: row.source_compartment_end,
718
- sourceStartMessageId: row.source_start_message_id,
719
- sourceEndMessageId: row.source_end_message_id
720
- }));
721
- }
722
- function serializePrimerSourceProvenance(provenance, sourceCandidateIds) {
723
- if (provenance.length === 0 && sourceCandidateIds.length > 0)
724
- return null;
725
- return JSON.stringify(provenance.map((source) => ({
726
- candidate_id: source.candidateId,
727
- project_path: source.projectPath,
728
- harness: source.harness,
729
- session_id: source.sessionId,
730
- source_compartment_start: source.sourceCompartmentStart,
731
- source_compartment_end: source.sourceCompartmentEnd,
732
- source_start_message_id: source.sourceStartMessageId,
733
- source_end_message_id: source.sourceEndMessageId
734
- })));
735
- }
736
- function normalizedCandidateIds(candidateIds) {
737
- return [...new Set(candidateIds)].sort((a, b) => a - b);
738
- }
739
- function toCandidate(row) {
740
- return {
741
- id: row.id,
742
- projectPath: row.project_path,
743
- harness: row.harness,
744
- sessionId: row.session_id,
745
- question: row.question,
746
- normalizedQuestion: row.normalized_question,
747
- sourceCompartmentStart: row.source_compartment_start,
748
- sourceCompartmentEnd: row.source_compartment_end,
749
- sourceStartMessageId: row.source_start_message_id,
750
- sourceEndMessageId: row.source_end_message_id,
751
- sourceMessageTime: row.source_message_time,
752
- questionEmbedding: blobToFloat32Array(row.question_embedding),
753
- questionEmbeddingModelId: row.question_embedding_model_id,
754
- createdAt: row.created_at
755
- };
756
- }
757
- function toPrimer(row) {
758
- const status = row.status === "archived" ? "archived" : "active";
759
- return {
760
- id: row.id,
761
- projectPath: row.project_path,
762
- question: row.question,
763
- questionEmbedding: blobToFloat32Array(row.question_embedding),
764
- questionEmbeddingModelId: row.question_embedding_model_id,
765
- answer: row.answer,
766
- status,
767
- totalSupport: row.total_support,
768
- lastObservedAt: row.last_observed_at,
769
- answerRefreshedAt: row.answer_refreshed_at,
770
- sourceCandidateIds: parseCandidateIds(row.source_candidate_ids),
771
- sourceProvenance: parsePrimerSourceProvenance(row.source_candidate_provenance),
772
- createdAt: row.created_at,
773
- updatedAt: row.updated_at
774
- };
775
- }
776
- function insertPrimerCandidates(db, candidates) {
777
- const ids = [];
778
- const stmt = db.prepare(`
779
- INSERT INTO primer_candidates (
780
- project_path, harness, session_id, question, normalized_question,
781
- source_compartment_start, source_compartment_end,
782
- source_start_message_id, source_end_message_id, source_message_time,
783
- question_embedding, question_embedding_model_id, created_at
784
- ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
785
- ON CONFLICT(project_path, harness, session_id, source_start_message_id, source_end_message_id)
786
- DO UPDATE SET
787
- question = excluded.question,
788
- normalized_question = excluded.normalized_question,
789
- source_compartment_start = excluded.source_compartment_start,
790
- source_compartment_end = excluded.source_compartment_end,
791
- source_message_time = excluded.source_message_time,
792
- question_embedding = COALESCE(excluded.question_embedding, primer_candidates.question_embedding),
793
- question_embedding_model_id = COALESCE(excluded.question_embedding_model_id, primer_candidates.question_embedding_model_id),
794
- created_at = MIN(primer_candidates.created_at, excluded.created_at)
795
- `);
796
- const select = db.prepare(`
797
- SELECT id FROM primer_candidates
798
- WHERE project_path = ? AND harness = ? AND session_id = ?
799
- AND source_start_message_id = ? AND source_end_message_id = ?
800
- `);
801
- db.transaction(() => {
802
- for (const candidate of candidates) {
803
- const question = candidate.question.trim();
804
- if (!question)
805
- continue;
806
- const normalized = candidate.normalizedQuestion ?? normalizePrimerQuestion(question);
807
- stmt.run(candidate.projectPath, candidate.harness || "opencode", candidate.sessionId, question, normalized, candidate.sourceCompartmentStart ?? null, candidate.sourceCompartmentEnd ?? null, candidate.sourceStartMessageId, candidate.sourceEndMessageId, candidate.sourceMessageTime, vectorBlob(candidate.questionEmbedding), candidate.questionEmbeddingModelId ?? null, candidate.createdAt ?? Date.now());
808
- const row = select.get(candidate.projectPath, candidate.harness || "opencode", candidate.sessionId, candidate.sourceStartMessageId, candidate.sourceEndMessageId);
809
- if (typeof row?.id === "number")
810
- ids.push(row.id);
811
- }
812
- }).immediate();
813
- return ids;
814
- }
815
- function updatePrimerCandidateEmbedding(db, candidateId, vector, modelId) {
816
- db.prepare("UPDATE primer_candidates SET question_embedding = ?, question_embedding_model_id = ? WHERE id = ?").run(vectorBlob(vector), modelId, candidateId);
817
- }
818
- function getPrimerCandidatesByIds(db, ids) {
819
- if (ids.length === 0)
820
- return [];
821
- const placeholders = ids.map(() => "?").join(",");
822
- const rows = db.prepare(`SELECT * FROM primer_candidates WHERE id IN (${placeholders})`).all(...ids);
823
- return rows.map(toCandidate);
824
- }
825
- function getPrimerCandidatesForPromotion(db, projectPath, now = Date.now(), ttlMs = PRIMER_CANDIDATE_TTL_MS) {
826
- const cutoff = now - ttlMs;
827
- const rows = db.prepare(`SELECT * FROM primer_candidates
828
- WHERE project_path = ? AND source_message_time >= ?
829
- ORDER BY project_path ASC, harness ASC, session_id ASC, source_start_message_id ASC, source_end_message_id ASC, id ASC`).all(projectPath, cutoff);
830
- return rows.map(toCandidate);
831
- }
832
- function countPrimerCandidatesForProject(db, projectPath) {
833
- const row = db.prepare("SELECT COUNT(*) AS count FROM primer_candidates WHERE project_path = ?").get(projectPath);
834
- return row?.count ?? 0;
835
- }
836
- function getActivePrimers(db, projectPath) {
837
- const rows = db.prepare(`SELECT * FROM primers
838
- WHERE project_path = ? AND status = 'active'
839
- ORDER BY COALESCE(last_observed_at, created_at) DESC, id ASC`).all(projectPath);
840
- return rows.map(toPrimer);
841
- }
842
- function createPrimer(db, input) {
843
- return db.transaction(() => {
844
- const now = input.now ?? Date.now();
845
- const sourceCandidateIds = normalizedCandidateIds(input.sourceCandidateIds);
846
- const sourceProvenance = loadPrimerSourceProvenance(db, sourceCandidateIds);
847
- const info = db.prepare(`INSERT INTO primers (
848
- project_path, question, question_embedding, question_embedding_model_id, answer,
849
- status, total_support, last_observed_at, answer_refreshed_at,
850
- source_candidate_ids, source_candidate_provenance, created_at, updated_at
851
- ) VALUES (?, ?, ?, ?, ?, 'active', ?, ?, NULL, ?, ?, ?, ?)`).run(input.projectPath, input.question, vectorBlob(input.questionEmbedding), input.questionEmbeddingModelId ?? null, input.answer ?? "", input.totalSupport, input.lastObservedAt, JSON.stringify(sourceCandidateIds), serializePrimerSourceProvenance(sourceProvenance, sourceCandidateIds), now, now);
852
- return Number(info.lastInsertRowid);
853
- }).immediate();
854
- }
855
- function updatePrimerSupport(db, input) {
856
- db.transaction(() => {
857
- const sourceCandidateIds = normalizedCandidateIds(input.sourceCandidateIds);
858
- const allowedIds = new Set(sourceCandidateIds);
859
- const existingRow = db.prepare("SELECT source_candidate_provenance FROM primers WHERE id = ?").get(input.primerId);
860
- const provenanceByCandidateId = new Map;
861
- for (const source of parsePrimerSourceProvenance(existingRow?.source_candidate_provenance ?? null) ?? []) {
862
- if (allowedIds.has(source.candidateId)) {
863
- provenanceByCandidateId.set(source.candidateId, source);
864
- }
865
- }
866
- for (const source of loadPrimerSourceProvenance(db, sourceCandidateIds)) {
867
- provenanceByCandidateId.set(source.candidateId, source);
868
- }
869
- const sourceProvenance = [...provenanceByCandidateId.values()].sort((a, b) => a.candidateId - b.candidateId);
870
- db.prepare(`UPDATE primers
871
- SET question_embedding = COALESCE(?, question_embedding),
872
- question_embedding_model_id = COALESCE(?, question_embedding_model_id),
873
- total_support = ?,
874
- last_observed_at = ?,
875
- source_candidate_ids = ?,
876
- source_candidate_provenance = ?,
877
- updated_at = ?
878
- WHERE id = ?`).run(vectorBlob(input.questionEmbedding), input.questionEmbeddingModelId ?? null, input.totalSupport, input.lastObservedAt, JSON.stringify(sourceCandidateIds), serializePrimerSourceProvenance(sourceProvenance, sourceCandidateIds), input.now ?? Date.now(), input.primerId);
879
- }).immediate();
880
- }
881
- function updatePrimerAnswer(db, primerId, answer, refreshedAt = Date.now()) {
882
- db.prepare("UPDATE primers SET answer = ?, answer_refreshed_at = ?, updated_at = ? WHERE id = ?").run(answer, refreshedAt, refreshedAt, primerId);
883
- }
884
359
  // src/features/magic-context/memory/promotion.ts
885
360
  function isPromotableCategory(category) {
886
361
  return PROMOTABLE_CATEGORIES.some((promotableCategory) => promotableCategory === category);
@@ -1311,4 +786,4 @@ async function normalizeVerificationFiles(args) {
1311
786
  gitRoot
1312
787
  };
1313
788
  }
1314
- export { USER_FACING_FAILURES, renderUserFacingFailure, userFacingFailureCode, renderCapabilityRefusal, capabilityRefusalCode, renderDreamFailure, dreamFailureCode, renderEmbeddingFailure, SESSION_NOTE_CONDITION_ERROR, getNoteByIdInScope, getNotes, addNote, getSessionNotes, getPendingSmartNotes, getReadySmartNotes, updateNote, dismissNotes, dismissNote, markNoteReady, markNoteChecked, PRIMER_CANDIDATE_TTL_MS, PRIMER_CANDIDATE_MAX_AGE_MS, primerOccurrenceKey, primerOccurrenceUtcDay, insertPrimerCandidates, updatePrimerCandidateEmbedding, getPrimerCandidatesByIds, getPrimerCandidatesForPromotion, countPrimerCandidatesForProject, getActivePrimers, createPrimer, updatePrimerSupport, updatePrimerAnswer, promoteSessionFactsDurable, embedPromotedFacts, relaxedFtsQuery, sanitizeFtsQuery, searchMemoriesFTS, searchMemoriesFTSUnion, recordMemoryMapping, recordMemoryVerifications, getUnmappedMemoryIds, clearMemoryVerifications, getMemoryVerifications, resolveGitTopLevel, readGitHead, readGitChangedFilesSince, readGitFileChangeTimesSince, verificationFileExists, normalizeVerificationFiles };
789
+ export { USER_FACING_FAILURES, renderUserFacingFailure, userFacingFailureCode, renderCapabilityRefusal, capabilityRefusalCode, renderDreamFailure, dreamFailureCode, renderEmbeddingFailure, promoteSessionFactsDurable, embedPromotedFacts, relaxedFtsQuery, sanitizeFtsQuery, searchMemoriesFTS, searchMemoriesFTSUnion, recordMemoryMapping, recordMemoryVerifications, getUnmappedMemoryIds, clearMemoryVerifications, getMemoryVerifications, resolveGitTopLevel, readGitHead, readGitChangedFilesSince, readGitFileChangeTimesSince, verificationFileExists, normalizeVerificationFiles };
@@ -3,7 +3,7 @@ import {
3
3
  } from "./index-nxrsns5x.js";
4
4
  import {
5
5
  getSynapseLaneIdentity
6
- } from "./index-wfybj1dw.js";
6
+ } from "./index-g4t7850m.js";
7
7
  import {
8
8
  getHarness2
9
9
  } from "./index-pavzsdc6.js";
@@ -13,7 +13,7 @@ import {
13
13
  import {
14
14
  importPluginModule,
15
15
  log2
16
- } from "./index-h7tgn49j.js";
16
+ } from "./index-jrfre9ah.js";
17
17
  import {
18
18
  inRootAsyncContext2
19
19
  } from "./index-gzy5w8ya.js";