@cortexkit/opencode-magic-context 0.49.34 → 0.49.36
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.
- package/README.md +1 -1
- package/dist/auto-search-worker.js +163 -155
- package/dist/chunk-embedding-write-worker.js +70 -66
- package/dist/{compaction-marker-candidates-31h86ph0.js → compaction-marker-candidates-5p1qkve9.js} +5 -2
- package/dist/compaction-marker-candidates-worker.js +24 -23
- package/dist/{compartment-chunk-embedding-5q5gj67r.js → compartment-chunk-embedding-ypktm0tk.js} +10 -8
- package/dist/{conflict-warning-hook-xgskea1v.js → conflict-warning-hook-b75jn458.js} +11 -9
- package/dist/{context-p3xrarzt.js → context-969z683s.js} +1839 -746
- package/dist/{derive-budgets-pqybnx09.js → derive-budgets-htj16n4x.js} +3 -2
- package/dist/embedding-backfill-rma0v2ct.js +28 -0
- package/dist/embedding-worker-process.js +2 -1
- package/dist/embedding-worker.js +6 -5
- package/dist/expand-attachments-h33jbgyz.js +21 -0
- package/dist/features/magic-context/auto-search-diagnostics.d.ts +21 -0
- package/dist/features/magic-context/auto-search-diagnostics.d.ts.map +1 -0
- package/dist/features/magic-context/compaction-marker-candidates.d.ts.map +1 -1
- package/dist/features/magic-context/compaction-marker.d.ts +5 -3
- package/dist/features/magic-context/compaction-marker.d.ts.map +1 -1
- package/dist/features/magic-context/compartment-chunk-embedding.d.ts +1 -1
- package/dist/features/magic-context/compartment-chunk-embedding.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-gates.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/verify-gate.d.ts +2 -0
- package/dist/features/magic-context/dreamer/verify-gate.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/verify-state.d.ts +9 -0
- package/dist/features/magic-context/dreamer/verify-state.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/verify.d.ts +2 -1
- package/dist/features/magic-context/dreamer/verify.d.ts.map +1 -1
- package/dist/features/magic-context/migration-worker-client.d.ts +3 -0
- package/dist/features/magic-context/migration-worker-client.d.ts.map +1 -1
- package/dist/features/magic-context/migration-worker.d.ts +15 -0
- package/dist/features/magic-context/migration-worker.d.ts.map +1 -1
- package/dist/features/magic-context/overflow-detection.d.ts +2 -2
- package/dist/features/magic-context/overflow-detection.d.ts.map +1 -1
- package/dist/features/magic-context/search-rerank.d.ts.map +1 -1
- package/dist/features/magic-context/search.d.ts +4 -0
- package/dist/features/magic-context/search.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-persisted.d.ts +1 -0
- package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -1
- package/dist/features/magic-context/storage-tags.d.ts +4 -0
- package/dist/features/magic-context/storage-tags.d.ts.map +1 -1
- package/dist/features/magic-context/store-generation-rebase-labels.d.ts +6 -0
- package/dist/features/magic-context/store-generation-rebase-labels.d.ts.map +1 -0
- package/dist/features/magic-context/store-generation-rebase.d.ts.map +1 -1
- package/dist/features/magic-context/work-metrics-carry-storage.d.ts +10 -0
- package/dist/features/magic-context/work-metrics-carry-storage.d.ts.map +1 -0
- package/dist/{history-owner-36wp3mkb.js → history-owner-0z620wgz.js} +3 -2
- package/dist/hooks/magic-context/apply-operations.d.ts +20 -3
- package/dist/hooks/magic-context/apply-operations.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-search-observation.d.ts +13 -0
- package/dist/hooks/magic-context/auto-search-observation.d.ts.map +1 -0
- package/dist/hooks/magic-context/auto-search-runner.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-search-worker-client.d.ts +10 -2
- package/dist/hooks/magic-context/auto-search-worker-client.d.ts.map +1 -1
- package/dist/hooks/magic-context/compaction-marker-publication.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-commit-hashes.d.ts +4 -0
- package/dist/hooks/magic-context/compartment-commit-hashes.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-runner-historian.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-validation.d.ts +1 -0
- package/dist/hooks/magic-context/compartment-runner-validation.d.ts.map +1 -1
- package/dist/hooks/magic-context/event-resolvers.d.ts.map +1 -1
- package/dist/hooks/magic-context/final-wire-completeness.d.ts +15 -0
- package/dist/hooks/magic-context/final-wire-completeness.d.ts.map +1 -0
- package/dist/hooks/magic-context/final-wire-token-estimate.d.ts.map +1 -1
- package/dist/hooks/magic-context/issue-423-fixture.d.ts +1 -1
- package/dist/hooks/magic-context/issue-423-fixture.d.ts.map +1 -1
- package/dist/hooks/magic-context/issue-424-fixture.d.ts +1 -1
- package/dist/hooks/magic-context/issue-424-fixture.d.ts.map +1 -1
- package/dist/hooks/magic-context/project-structural-sentinels.d.ts +25 -0
- package/dist/hooks/magic-context/project-structural-sentinels.d.ts.map +1 -0
- package/dist/hooks/magic-context/protected-tail-boundary.d.ts +8 -1
- package/dist/hooks/magic-context/protected-tail-boundary.d.ts.map +1 -1
- package/dist/hooks/magic-context/raw-ordinal-warmup.d.ts +1 -0
- package/dist/hooks/magic-context/raw-ordinal-warmup.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-chunk.d.ts +11 -0
- package/dist/hooks/magic-context/read-session-chunk.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-formatting.d.ts +2 -0
- package/dist/hooks/magic-context/read-session-formatting.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-true-raw-tokens.d.ts +2 -0
- package/dist/hooks/magic-context/read-session-true-raw-tokens.d.ts.map +1 -1
- package/dist/hooks/magic-context/release-recovery-prefix.d.ts +9 -0
- package/dist/hooks/magic-context/release-recovery-prefix.d.ts.map +1 -0
- package/dist/hooks/magic-context/strip-structural-noise.d.ts +6 -3
- package/dist/hooks/magic-context/strip-structural-noise.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-context-state.d.ts +3 -0
- package/dist/hooks/magic-context/transform-context-state.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +3 -0
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/{index-cpjk5jd2.js → index-1d042x6w.js} +16 -14
- package/dist/{index-2743x98y.js → index-21fgrfrf.js} +35 -142
- package/dist/index-2amn2s73.js +123 -0
- package/dist/{index-c7phnbvk.js → index-2p37txes.js} +1 -1
- package/dist/index-2qbtqg1w.js +529 -0
- package/dist/{index-9gpw8hrm.js → index-2rs7912w.js} +4 -4
- package/dist/{index-m1x9ghk5.js → index-4ks89h5a.js} +37 -7
- package/dist/{index-b88dwwrh.js → index-4xyjr62e.js} +1 -1
- package/dist/index-4y35msh5.js +531 -0
- package/dist/index-66a50f3e.js +777 -0
- package/dist/index-72czy45z.js +4557 -0
- package/dist/index-7v05d9b7.js +58 -0
- package/dist/{index-qgh1qwjj.js → index-850vthn3.js} +9 -3
- package/dist/{index-np3rgfw4.js → index-8jjjmhab.js} +15 -4
- package/dist/index-96ztjvkn.js +204 -0
- package/dist/{index-fm36bjv4.js → index-9fgmkfaf.js} +22 -277
- package/dist/{index-atekmqef.js → index-9tdvbdv1.js} +508 -5547
- package/dist/{index-xrnsygfq.js → index-9wnbnx8f.js} +1 -1
- package/dist/{index-waktfbjy.js → index-ae1ar4v1.js} +4 -4
- package/dist/{index-v15ne3a3.js → index-b1ydbp95.js} +2 -2
- package/dist/{index-nxrsns5x.js → index-c5dzns43.js} +75 -75
- package/dist/{index-v7287tzq.js → index-dcjkw41m.js} +19 -8
- package/dist/{index-hbx7m8he.js → index-dfdg2cgg.js} +338 -86
- package/dist/{index-spwjbkc7.js → index-dnqqqc5f.js} +1 -1
- package/dist/{index-04z754rd.js → index-dz48h1wx.js} +33 -5
- package/dist/{index-rrv26qjz.js → index-fw42ms3m.js} +1 -1
- package/dist/{index-t5pck3ss.js → index-fxbk7gk3.js} +1 -1
- package/dist/{index-wfybj1dw.js → index-g4t7850m.js} +2 -2
- package/dist/{index-97spytxq.js → index-gnmhbyyc.js} +583 -474
- package/dist/{index-4pnsgvfk.js → index-hacf2tyx.js} +1 -1
- package/dist/index-j105mf16.js +270 -0
- package/dist/{index-gkee6p4g.js → index-jggt5gf2.js} +3 -3
- package/dist/{index-s1n8dd2n.js → index-jkanybgq.js} +2 -2
- package/dist/{index-h7tgn49j.js → index-jrfre9ah.js} +5 -222
- package/dist/{index-kfyb3k6n.js → index-jz5bk7xd.js} +2 -2
- package/dist/{index-7kkphb6c.js → index-nj360hcs.js} +4 -4
- package/dist/{index-07vskjn8.js → index-pp8vdn01.js} +15 -13
- package/dist/index-prw8apnc.js +194 -0
- package/dist/{index-rverk2vz.js → index-r2epb000.js} +34 -4
- package/dist/{index-7g9dr8gy.js → index-tn9drm1a.js} +125 -143
- package/dist/{index-kq5w68dp.js → index-txs8tce6.js} +1 -1
- package/dist/{index-rfxzazzy.js → index-ty4vhe4n.js} +5 -5
- package/dist/{index-y1qwzvxn.js → index-vd2ywmfe.js} +2 -2
- package/dist/{index-0677w9sd.js → index-wcwhhtdh.js} +58 -23
- package/dist/index-wh9fxds5.js +265 -0
- package/dist/{index-51rdvtkz.js → index-xd2p95m7.js} +3 -3
- package/dist/{index-as2amvn3.js → index-xnm0wq1r.js} +6 -531
- package/dist/{index-ftr84kkv.js → index-ys7j6679.js} +7 -5
- package/dist/index-z4p0ry94.js +222 -0
- package/dist/index-z9zygwse.js +89 -0
- package/dist/index.js +86 -74
- package/dist/{logger-94kew5wm.js → logger-qwnbcfj9.js} +2 -1
- package/dist/{message-fts-rowid-map-va36knh4.js → message-fts-rowid-map-t6qsyg9s.js} +7 -5
- package/dist/{message-index-bounded-qh91fdr3.js → message-index-bounded-wfk6aqxk.js} +15 -13
- package/dist/{message-time-backfill-4qva0b4f.js → message-time-backfill-39bm498k.js} +3 -2
- package/dist/migration-worker.js +55 -48
- package/dist/plugin/rpc-handlers.d.ts.map +1 -1
- package/dist/{project-embedding-registry-6yex0r9f.js → project-embedding-registry-3yyegjma.js} +16 -13
- package/dist/raw-ordinal-warmup-worker.js +114 -113
- package/dist/{read-session-chunk-kaghtr75.js → read-session-chunk-26yrrhyz.js} +18 -12
- package/dist/{read-session-raw-b2sd67v4.js → read-session-raw-j7c9w57v.js} +5 -3
- package/dist/recomp-orchestrator-wk509qkp.js +69 -0
- package/dist/render-h1qarr8a.js +44 -0
- package/dist/{safe-notification-target-mkr9yzvr.js → safe-notification-target-wztd7bgk.js} +3 -2
- package/dist/search-5h9fydyq.js +54 -0
- package/dist/search-archive-q79hyqxs.js +29 -0
- package/dist/{send-session-notification-vz86nt79.js → send-session-notification-14p3yje4.js} +9 -7
- package/dist/shared/model-suggestion-retry.d.ts +7 -0
- package/dist/shared/model-suggestion-retry.d.ts.map +1 -1
- package/dist/shared/prompt-async-transport.d.ts.map +1 -1
- package/dist/shared/reusable-worker-entry.d.ts +4 -0
- package/dist/shared/reusable-worker-entry.d.ts.map +1 -0
- package/dist/shared/reusable-worker.d.ts +6 -0
- package/dist/shared/reusable-worker.d.ts.map +1 -0
- package/dist/shared/reusable-worker.fixture.d.ts +2 -0
- package/dist/shared/reusable-worker.fixture.d.ts.map +1 -0
- package/dist/shared/worker-shutdown.d.ts +1 -1
- package/dist/shared/worker-shutdown.d.ts.map +1 -1
- package/dist/{storage-tags-6hvkk01c.js → storage-tags-vj0yj7ed.js} +5 -4
- package/dist/store-reader-yh19h38c.js +14 -0
- package/dist/store-s3eykdjt.js +21 -0
- package/dist/tools/ctx-expand/render.d.ts +5 -3
- package/dist/tools/ctx-expand/render.d.ts.map +1 -1
- package/dist/tools/ctx-expand/search-archive.d.ts.map +1 -1
- package/dist/tools/ctx-expand/tools.d.ts +2 -0
- package/dist/tools/ctx-expand/tools.d.ts.map +1 -1
- package/dist/tools/ctx-expand/v2-archive-reader.d.ts +33 -0
- package/dist/tools/ctx-expand/v2-archive-reader.d.ts.map +1 -0
- package/dist/{transform-postprocess-phase-ph38mhrs.js → transform-postprocess-phase-4gj0mtcg.js} +39 -32
- package/dist/v2/auto-search-worker.js +163 -155
- package/dist/v2/chunk-embedding-write-worker.js +71 -67
- package/dist/v2/compaction-marker-candidates-worker.js +24 -23
- package/dist/v2/{compaction-marker-candidates-m4vmye3w.js → compaction-marker-candidates-yeb2ky46.js} +6 -3
- package/dist/v2/{compartment-chunk-embedding-rc31e6md.js → compartment-chunk-embedding-qfk791bd.js} +11 -9
- package/dist/v2/{context-s60hcatx.js → context-bxr039be.js} +2678 -1246
- package/dist/v2/{derive-budgets-knf763tt.js → derive-budgets-sa0v7bz0.js} +4 -3
- package/dist/v2/embedding-backfill-00tw59rx.js +27 -0
- package/dist/v2/embedding-worker-process.js +2 -1
- package/dist/v2/embedding-worker.js +6 -5
- package/dist/v2/expand-attachments-h33jbgyz.js +21 -0
- package/dist/v2/fold/code-mode-catalog.d.ts +3 -0
- package/dist/v2/fold/code-mode-catalog.d.ts.map +1 -0
- package/dist/v2/fold/idle.d.ts +16 -0
- package/dist/v2/fold/idle.d.ts.map +1 -0
- package/dist/v2/fold/manual-baseline.d.ts +8 -0
- package/dist/v2/fold/manual-baseline.d.ts.map +1 -0
- package/dist/v2/fold/native-replay-v3.d.ts +75 -0
- package/dist/v2/fold/native-replay-v3.d.ts.map +1 -0
- package/dist/v2/fold/native-replay.d.ts +81 -8
- package/dist/v2/fold/native-replay.d.ts.map +1 -1
- package/dist/v2/fold/policy.d.ts +2 -1
- package/dist/v2/fold/policy.d.ts.map +1 -1
- package/dist/v2/fold/restore.d.ts.map +1 -1
- package/dist/v2/fold/summary.d.ts +4 -0
- package/dist/v2/fold/summary.d.ts.map +1 -0
- package/dist/v2/hidden-completion.d.ts.map +1 -1
- package/dist/v2/{history-owner-ad0crnrn.js → history-owner-fpka43cn.js} +3 -2
- package/dist/v2/hooks/channel2.d.ts +6 -0
- package/dist/v2/hooks/channel2.d.ts.map +1 -1
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/hooks/expand-attachments.d.ts +8 -0
- package/dist/v2/hooks/expand-attachments.d.ts.map +1 -0
- package/dist/v2/hooks/overflow-recovery.d.ts +45 -0
- package/dist/v2/hooks/overflow-recovery.d.ts.map +1 -0
- package/dist/v2/hooks/restore-rows.d.ts +12 -2
- package/dist/v2/hooks/restore-rows.d.ts.map +1 -1
- package/dist/v2/hooks/store.d.ts +7 -2
- package/dist/v2/hooks/store.d.ts.map +1 -1
- package/dist/v2/hooks/synthetic-admission.d.ts +7 -0
- package/dist/v2/hooks/synthetic-admission.d.ts.map +1 -0
- package/dist/v2/hooks/usage-persist.d.ts.map +1 -1
- package/dist/v2/{logger-p34mjtja.js → logger-4cj6d03m.js} +2 -1
- package/dist/v2/{message-fts-rowid-map-78awh03v.js → message-fts-rowid-map-z86avy0n.js} +8 -6
- package/dist/v2/{message-index-bounded-4htdr1j6.js → message-index-bounded-w14496s9.js} +16 -14
- package/dist/v2/{message-time-backfill-zvthw6xb.js → message-time-backfill-0c4h7sg6.js} +3 -2
- package/dist/v2/migration-worker.js +56 -49
- package/dist/v2/ordinal-range.fixture.d.ts +7 -0
- package/dist/v2/ordinal-range.fixture.d.ts.map +1 -0
- package/dist/v2/{project-embedding-registry-1x5qe2fy.js → project-embedding-registry-jqq2qeqb.js} +17 -14
- package/dist/v2/raw-ordinal-warmup-worker.js +114 -113
- package/dist/v2/{read-session-chunk-1fa9qzwb.js → read-session-chunk-tqnh1ret.js} +18 -12
- package/dist/v2/{read-session-raw-5x088amc.js → read-session-raw-qpp6x9kg.js} +6 -4
- package/dist/v2/recomp-orchestrator-9cjk6aej.js +68 -0
- package/dist/v2/render-5dz1knf2.js +43 -0
- package/dist/v2/{safe-notification-target-khnzg57c.js → safe-notification-target-gphhast7.js} +3 -2
- package/dist/v2/search-8yfet25y.js +52 -0
- package/dist/v2/search-archive-z6z9jqwf.js +28 -0
- package/dist/v2/{send-session-notification-x5nzy34v.js → send-session-notification-kxp47tsw.js} +9 -7
- package/dist/v2/{server-cpjk5jd2.js → server-1d042x6w.js} +16 -14
- package/dist/v2/server-2amn2s73.js +123 -0
- package/dist/v2/{server-6g98c227.js → server-3schkz95.js} +4 -4
- package/dist/v2/server-468mya5v.js +209 -0
- package/dist/v2/{server-z2wft9zv.js → server-5by3vdzs.js} +562 -5560
- package/dist/v2/{server-qjvk4a9t.js → server-69m30b21.js} +1 -1
- package/dist/v2/server-6emy0v9a.js +531 -0
- package/dist/v2/{server-vr4szghm.js → server-6vzh6wej.js} +3 -3
- package/dist/v2/{server-ajxhrgjv.js → server-7094pk3w.js} +80 -19
- package/dist/v2/{server-ab8017gw.js → server-7acq7815.js} +34 -141
- package/dist/v2/server-7v05d9b7.js +58 -0
- package/dist/v2/{server-24g8r2d0.js → server-7zacmty5.js} +75 -75
- package/dist/v2/{server-3mz2qh5a.js → server-969cdpmg.js} +1 -1
- package/dist/v2/server-96ztjvkn.js +204 -0
- package/dist/v2/{server-grakwy1v.js → server-a9w5f0yw.js} +37 -7
- package/dist/v2/{server-835q39kd.js → server-avdveykk.js} +3 -3
- package/dist/v2/{server-qc915kw2.js → server-bez34e60.js} +4 -4
- package/dist/v2/{server-h1byrhwx.js → server-cp1a03vc.js} +19 -8
- package/dist/v2/{server-bsgd4dk1.js → server-dcws5831.js} +2 -2
- package/dist/v2/{server-m1pfg2d4.js → server-dfq5vb8j.js} +4 -4
- package/dist/v2/server-e51xmr4d.js +194 -0
- package/dist/v2/server-ef1mskas.js +777 -0
- package/dist/v2/{server-1bw1wcbp.js → server-f0j864ma.js} +1 -1
- package/dist/v2/{server-jw5qe9y8.js → server-g3gqq4ac.js} +18 -217
- package/dist/v2/{server-2aasmpsp.js → server-gkse1wyz.js} +5 -5
- package/dist/v2/{server-6495nmn9.js → server-jb6tjyeb.js} +5 -222
- package/dist/v2/{server-qvy4qavp.js → server-jd7vzwn4.js} +125 -143
- package/dist/v2/{server-a7x00tw8.js → server-mfn1yf9d.js} +1 -1
- package/dist/v2/{server-awr8qa4c.js → server-nmyganc8.js} +2 -2
- package/dist/v2/{server-tkdabx8q.js → server-nq3cb7be.js} +5 -530
- package/dist/v2/server-qjyp27vf.js +270 -0
- package/dist/v2/{server-gyy4k6mf.js → server-qmmkhz2z.js} +1 -1
- package/dist/v2/{server-29qp8nz4.js → server-qxzbmtqt.js} +1 -1
- package/dist/v2/{server-806rzhs6.js → server-r4430x9m.js} +10 -4
- package/dist/v2/{server-53eh1r8r.js → server-sd8hvzte.js} +2 -2
- package/dist/v2/{server-k3t06fxr.js → server-sefxj8k1.js} +1 -1
- package/dist/v2/server-t8y64xj7.js +4513 -0
- package/dist/v2/{server-6vd2n183.js → server-tnzbk64q.js} +35 -5
- package/dist/v2/{server-v77xa5wj.js → server-tpt7bwq8.js} +1 -1
- package/dist/v2/{server-51779zs2.js → server-v0p37hm2.js} +4 -1
- package/dist/v2/{server-nxas8v1d.js → server-xfjjbrkt.js} +15 -4
- package/dist/v2/{server-cqjvxyrp.js → server-xy7w7hrd.js} +2 -2
- package/dist/v2/server-ypf1ap0v.js +529 -0
- package/dist/v2/server-z4p0ry94.js +222 -0
- package/dist/v2/server-z9zygwse.js +89 -0
- package/dist/v2/{server-ab1g0wn9.js → server-zzgtgqmd.js} +2 -2
- package/dist/v2/server.js +7 -6
- package/dist/v2/{storage-tags-18nbaanf.js → storage-tags-cw07ky67.js} +5 -4
- package/dist/v2/store-reader-cgx47zkp.js +14 -0
- package/dist/v2/store-reader.d.ts +9 -2
- package/dist/v2/store-reader.d.ts.map +1 -1
- package/dist/v2/store-z3qe67cg.js +21 -0
- package/dist/v2/v2-archive-reader-z7wr42ry.js +11 -0
- package/dist/v2/{wrapup-orchestrator-wxf7n5k6.js → wrapup-orchestrator-j1v62bkj.js} +50 -42
- package/dist/v2-archive-reader-028z6kck.js +11 -0
- package/dist/wrapup-orchestrator-xg9avt2p.js +56 -0
- package/package.json +1 -1
- package/src/shared/model-suggestion-retry.ts +1 -1
- package/src/shared/prompt-async-transport.test.ts +64 -3
- package/src/shared/prompt-async-transport.ts +61 -16
- package/src/shared/reusable-worker-entry.ts +58 -0
- package/src/shared/reusable-worker-reset.test.ts +108 -0
- package/src/shared/reusable-worker.fixture.ts +35 -0
- package/src/shared/reusable-worker.test.ts +253 -0
- package/src/shared/reusable-worker.ts +240 -0
- package/src/shared/sqlite-transaction-mode-guard.test.ts +2 -0
- package/src/shared/worker-shutdown.ts +21 -17
- package/dist/embedding-backfill-0jgtqxen.js +0 -25
- package/dist/recomp-orchestrator-0y983w7h.js +0 -62
- package/dist/search-archive-1kw2rp19.js +0 -26
- package/dist/search-p684j8ww.js +0 -50
- package/dist/v2/embedding-backfill-f43hd8y6.js +0 -24
- package/dist/v2/recomp-orchestrator-7q9nvxte.js +0 -61
- package/dist/v2/search-archive-xfp51s0g.js +0 -25
- package/dist/v2/search-wf8rqxhm.js +0 -48
- package/dist/wrapup-orchestrator-ys2nrkkb.js +0 -49
|
@@ -1,171 +1,179 @@
|
|
|
1
1
|
import {
|
|
2
2
|
exitOnWorkerClose
|
|
3
|
-
} from "./server-
|
|
3
|
+
} from "./server-1d042x6w.js";
|
|
4
|
+
import {
|
|
5
|
+
serveWorkerJobs
|
|
6
|
+
} from "./server-7v05d9b7.js";
|
|
4
7
|
|
|
5
8
|
// src/hooks/magic-context/auto-search-worker.ts
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
if (input.job === "messages") {
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
] = await Promise.all([
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
]);
|
|
38
|
-
setHarness(input.harness);
|
|
39
|
-
registerSqliteDiagnosticSink(log, getHarness);
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
port.on("message", (reply) => {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
return new Promise((resolve, reject) => {
|
|
55
|
-
const id = ++nextId;
|
|
56
|
-
pending.set(id, (reply) => reply.error ? reject(new Error(reply.error)) : resolve(reply));
|
|
57
|
-
port?.postMessage({ ...message, id });
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
db = new Database(input.path, input.job === "backfill" ? undefined : { readonly: true });
|
|
61
|
-
db.exec("PRAGMA busy_timeout = 250");
|
|
62
|
-
var { closePort } = exitOnWorkerClose(port, () => db.close());
|
|
63
|
-
var CHUNK_POOL_MAINTENANCE_INTERVAL_MS = 5000;
|
|
64
|
-
var maintenanceTimer;
|
|
65
|
-
var maintaining = false;
|
|
66
|
-
function maintainChunkPools() {
|
|
67
|
-
if (maintaining)
|
|
68
|
-
return;
|
|
69
|
-
maintaining = true;
|
|
70
|
-
maintainCompartmentChunkSearchPools(db).catch(() => {}).finally(() => {
|
|
71
|
-
maintaining = false;
|
|
9
|
+
serveWorkerJobs(async (initial, port) => {
|
|
10
|
+
let input = initial;
|
|
11
|
+
function post(reply) {
|
|
12
|
+
port.postMessage({ ...reply, jobId: input.jobId });
|
|
13
|
+
}
|
|
14
|
+
const persistent = input.persistent === true;
|
|
15
|
+
if (input.job === "messages") {
|
|
16
|
+
post({ kind: "accepted" });
|
|
17
|
+
}
|
|
18
|
+
const [
|
|
19
|
+
{ ensureMemoryEmbeddings },
|
|
20
|
+
{ getProjectEmbeddings },
|
|
21
|
+
{ getMemoriesByProject },
|
|
22
|
+
{ installProjectEmbeddingSearchBridge },
|
|
23
|
+
{ searchMessageHistory, unifiedSearch },
|
|
24
|
+
{ getLastCompartmentChunkPoolWarm, maintainCompartmentChunkSearchPools },
|
|
25
|
+
{ setEmbeddingSessionBusy },
|
|
26
|
+
{ getHarness, setHarness },
|
|
27
|
+
{ Database, registerSqliteDiagnosticSink },
|
|
28
|
+
{ log }
|
|
29
|
+
] = await Promise.all([
|
|
30
|
+
import("./embedding-backfill-00tw59rx.js"),
|
|
31
|
+
import("./embedding-cache-mgyr73ef.js"),
|
|
32
|
+
import("./storage-memory-e6a7mb0k.js"),
|
|
33
|
+
import("./project-embedding-registry-jqq2qeqb.js"),
|
|
34
|
+
import("./search-8yfet25y.js"),
|
|
35
|
+
import("./compartment-chunk-embedding-qfk791bd.js"),
|
|
36
|
+
import("./embedding-activity-g1dhes6g.js"),
|
|
37
|
+
import("./harness-e4avh192.js"),
|
|
38
|
+
import("./sqlite-zdgm52sv.js"),
|
|
39
|
+
import("./logger-4cj6d03m.js")
|
|
40
|
+
]);
|
|
41
|
+
setHarness(input.harness);
|
|
42
|
+
registerSqliteDiagnosticSink(log, getHarness);
|
|
43
|
+
let nextId = 0;
|
|
44
|
+
const pending = new Map;
|
|
45
|
+
let queryDimensions = null;
|
|
46
|
+
let db;
|
|
47
|
+
port.on("message", (reply) => {
|
|
48
|
+
if (reply.jobId !== input.jobId)
|
|
49
|
+
return;
|
|
50
|
+
if (reply.embeddingHostBusy !== undefined)
|
|
51
|
+
setEmbeddingSessionBusy(input.sessionId, reply.embeddingHostBusy);
|
|
52
|
+
const vector = reply.result instanceof Float32Array ? reply.result : reply.result?.vector;
|
|
53
|
+
if (vector)
|
|
54
|
+
queryDimensions = vector.length;
|
|
55
|
+
pending.get(reply.id)?.(reply);
|
|
56
|
+
pending.delete(reply.id);
|
|
72
57
|
});
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
maintenanceTimer.unref?.();
|
|
58
|
+
function request(message) {
|
|
59
|
+
return new Promise((resolve, reject) => {
|
|
60
|
+
const id = ++nextId;
|
|
61
|
+
pending.set(id, (reply) => reply.error ? reject(new Error(reply.error)) : resolve(reply));
|
|
62
|
+
post({ ...message, id });
|
|
63
|
+
});
|
|
80
64
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
embed: async (text) => {
|
|
94
|
-
const result = (await request({ kind: "query", text })).result;
|
|
95
|
-
return result instanceof Float32Array ? result : result?.vector ?? null;
|
|
96
|
-
},
|
|
97
|
-
embedBatch: async (texts, _signal, purpose = "passage") => {
|
|
98
|
-
const passage = (await request({ kind: "batch", texts, purpose })).passage;
|
|
99
|
-
const captured = input.snapshot;
|
|
100
|
-
if (!passage || !captured || passage.generation !== captured.generation || passage.modelId !== captured.modelId || passage.providerIdentity !== captured.providerIdentity || passage.runtimeFingerprint !== captured.runtimeFingerprint || !queryDimensions || passage.dimensions !== queryDimensions || passage.vectors.length !== texts.length)
|
|
101
|
-
return texts.map(() => null);
|
|
102
|
-
return passage.vectors.map((vector) => vector && vector.length === queryDimensions && vector.every(Number.isFinite) ? vector : null);
|
|
103
|
-
}
|
|
65
|
+
db = new Database(input.path, input.job === "backfill" ? undefined : { readonly: true });
|
|
66
|
+
db.exec("PRAGMA busy_timeout = 250");
|
|
67
|
+
const { closePort } = exitOnWorkerClose(port, () => db.close());
|
|
68
|
+
const CHUNK_POOL_MAINTENANCE_INTERVAL_MS = 5000;
|
|
69
|
+
let maintenanceTimer;
|
|
70
|
+
let maintaining = false;
|
|
71
|
+
function maintainChunkPools() {
|
|
72
|
+
if (maintaining)
|
|
73
|
+
return;
|
|
74
|
+
maintaining = true;
|
|
75
|
+
maintainCompartmentChunkSearchPools(db).catch(() => {}).finally(() => {
|
|
76
|
+
maintaining = false;
|
|
104
77
|
});
|
|
105
78
|
}
|
|
106
|
-
|
|
107
|
-
if (
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
79
|
+
function scheduleChunkPoolMaintenance() {
|
|
80
|
+
if (!persistent)
|
|
81
|
+
return;
|
|
82
|
+
if (!maintenanceTimer) {
|
|
83
|
+
maintenanceTimer = setInterval(maintainChunkPools, CHUNK_POOL_MAINTENANCE_INTERVAL_MS);
|
|
84
|
+
maintenanceTimer.unref?.();
|
|
85
|
+
}
|
|
86
|
+
setTimeout(maintainChunkPools, 0);
|
|
87
|
+
}
|
|
88
|
+
async function run(jobInput) {
|
|
89
|
+
input = jobInput;
|
|
90
|
+
queryDimensions = null;
|
|
91
|
+
setEmbeddingSessionBusy(input.sessionId, input.embeddingHostBusy === true);
|
|
92
|
+
if (input.snapshot) {
|
|
93
|
+
installProjectEmbeddingSearchBridge(input.snapshot, {
|
|
94
|
+
modelId: input.snapshot.modelId,
|
|
95
|
+
initialize: async () => true,
|
|
96
|
+
isLoaded: () => true,
|
|
97
|
+
dispose: async () => {},
|
|
98
|
+
embed: async (text) => {
|
|
99
|
+
const result = (await request({ kind: "query", text })).result;
|
|
100
|
+
return result instanceof Float32Array ? result : result?.vector ?? null;
|
|
101
|
+
},
|
|
102
|
+
embedBatch: async (texts, _signal, purpose = "passage") => {
|
|
103
|
+
const passage = (await request({ kind: "batch", texts, purpose })).passage;
|
|
104
|
+
const captured = input.snapshot;
|
|
105
|
+
if (!passage || !captured || passage.generation !== captured.generation || passage.modelId !== captured.modelId || passage.providerIdentity !== captured.providerIdentity || passage.runtimeFingerprint !== captured.runtimeFingerprint || !queryDimensions || passage.dimensions !== queryDimensions || passage.vectors.length !== texts.length)
|
|
106
|
+
return texts.map(() => null);
|
|
107
|
+
return passage.vectors.map((vector) => vector && vector.length === queryDimensions && vector.every(Number.isFinite) ? vector : null);
|
|
119
108
|
}
|
|
120
|
-
}
|
|
121
|
-
port.postMessage({ kind: "result", results: [] });
|
|
122
|
-
} else if (input.job === "messages") {
|
|
123
|
-
if (!input.messageRequest)
|
|
124
|
-
throw new Error("message search job carries no request");
|
|
125
|
-
const outcome = searchMessageHistory(db, input.messageRequest);
|
|
126
|
-
port.postMessage({ kind: "messages", outcome });
|
|
127
|
-
} else {
|
|
128
|
-
const jobStarted = performance.now();
|
|
129
|
-
const steps = {};
|
|
130
|
-
const results = await unifiedSearch(db, input.sessionId, input.projectPath, input.query, {
|
|
131
|
-
...input.options,
|
|
132
|
-
backfillMemoryEmbeddings: false,
|
|
133
|
-
countRetrievals: false,
|
|
134
|
-
measurementDisabled: true,
|
|
135
|
-
embedQuery: async (text) => (await request({ kind: "query", text })).result ?? null,
|
|
136
|
-
isEmbeddingRuntimeEnabled: () => input.embeddingRuntimeEnabled,
|
|
137
|
-
stepTimings: steps
|
|
138
109
|
});
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
110
|
+
}
|
|
111
|
+
try {
|
|
112
|
+
if (input.job === "backfill") {
|
|
113
|
+
if (input.snapshot?.enabled && input.snapshot.features.memoryEnabled) {
|
|
114
|
+
await request({ kind: "query", text: input.query });
|
|
115
|
+
if (queryDimensions) {
|
|
116
|
+
const existingEmbeddings = getProjectEmbeddings(db, input.projectPath, input.snapshot.modelId);
|
|
117
|
+
const memories = getMemoriesByProject(db, input.projectPath).filter((memory) => !existingEmbeddings.has(memory.id)).slice(0, 50);
|
|
118
|
+
await ensureMemoryEmbeddings({
|
|
119
|
+
db,
|
|
120
|
+
projectIdentity: input.projectPath,
|
|
121
|
+
memories,
|
|
122
|
+
existingEmbeddings
|
|
123
|
+
});
|
|
124
|
+
}
|
|
146
125
|
}
|
|
126
|
+
post({ kind: "result", results: [] });
|
|
127
|
+
} else if (input.job === "messages") {
|
|
128
|
+
if (!input.messageRequest)
|
|
129
|
+
throw new Error("message search job carries no request");
|
|
130
|
+
const outcome = searchMessageHistory(db, input.messageRequest);
|
|
131
|
+
post({ kind: "messages", outcome });
|
|
132
|
+
} else {
|
|
133
|
+
const jobStarted = performance.now();
|
|
134
|
+
const steps = {};
|
|
135
|
+
const diagnostics = input.options.autoSearchDiagnostics;
|
|
136
|
+
const results = await unifiedSearch(db, input.sessionId, input.projectPath, input.query, {
|
|
137
|
+
...input.options,
|
|
138
|
+
backfillMemoryEmbeddings: false,
|
|
139
|
+
countRetrievals: false,
|
|
140
|
+
measurementDisabled: true,
|
|
141
|
+
embedQuery: async (text) => (await request({ kind: "query", text })).result ?? null,
|
|
142
|
+
isEmbeddingRuntimeEnabled: () => input.embeddingRuntimeEnabled,
|
|
143
|
+
stepTimings: steps,
|
|
144
|
+
onAutoSearchDiagnostics: diagnostics ? () => port.postMessage({
|
|
145
|
+
kind: "diagnostics",
|
|
146
|
+
diagnostics,
|
|
147
|
+
jobId: jobInput.jobId
|
|
148
|
+
}) : undefined
|
|
149
|
+
});
|
|
150
|
+
post({
|
|
151
|
+
kind: "result",
|
|
152
|
+
results,
|
|
153
|
+
timings: {
|
|
154
|
+
steps,
|
|
155
|
+
jobMs: performance.now() - jobStarted,
|
|
156
|
+
lastPoolWarm: getLastCompartmentChunkPoolWarm()
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
scheduleChunkPoolMaintenance();
|
|
160
|
+
}
|
|
161
|
+
} catch (error) {
|
|
162
|
+
post({
|
|
163
|
+
kind: "error",
|
|
164
|
+
error: error instanceof Error ? error.message : String(error)
|
|
147
165
|
});
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
});
|
|
155
|
-
} finally {
|
|
156
|
-
setEmbeddingSessionBusy(input.sessionId, false);
|
|
157
|
-
if (!persistent) {
|
|
158
|
-
db.close();
|
|
159
|
-
closePort();
|
|
166
|
+
} finally {
|
|
167
|
+
setEmbeddingSessionBusy(input.sessionId, false);
|
|
168
|
+
if (!persistent) {
|
|
169
|
+
db.close();
|
|
170
|
+
closePort();
|
|
171
|
+
}
|
|
160
172
|
}
|
|
161
173
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
run(message.input);
|
|
166
|
-
});
|
|
167
|
-
run(input).catch((error) => {
|
|
168
|
-
setTimeout(() => {
|
|
169
|
-
throw error;
|
|
174
|
+
port.on("message", (message) => {
|
|
175
|
+
if (message.kind === "run" && message.input)
|
|
176
|
+
run(message.input);
|
|
170
177
|
});
|
|
178
|
+
await run(input);
|
|
171
179
|
});
|
|
@@ -10,88 +10,92 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
isWorkerCloseMessage,
|
|
12
12
|
exitOnWorkerClose
|
|
13
|
-
} from "./server-
|
|
14
|
-
import"./server-
|
|
15
|
-
import"./server-
|
|
16
|
-
import"./server-
|
|
17
|
-
import"./server-
|
|
18
|
-
import"./server-
|
|
19
|
-
import"./server-
|
|
13
|
+
} from "./server-1d042x6w.js";
|
|
14
|
+
import"./server-969cdpmg.js";
|
|
15
|
+
import"./server-jb6tjyeb.js";
|
|
16
|
+
import"./server-z4p0ry94.js";
|
|
17
|
+
import"./server-zzgtgqmd.js";
|
|
18
|
+
import"./server-v0p37hm2.js";
|
|
19
|
+
import"./server-96ztjvkn.js";
|
|
20
|
+
import"./server-tnzbk64q.js";
|
|
21
|
+
import"./server-nmyganc8.js";
|
|
20
22
|
import {
|
|
21
23
|
replaceCompartmentChunkEmbeddings2,
|
|
22
24
|
recordChunkEmbedBackoff2,
|
|
23
25
|
loadUnembeddedSessionChunkCandidates2,
|
|
24
26
|
countUnembeddedSessionCompartments2
|
|
25
|
-
} from "./server-
|
|
27
|
+
} from "./server-cp1a03vc.js";
|
|
26
28
|
import {
|
|
27
29
|
acquireGitSweepLease,
|
|
28
30
|
renewGitSweepLease,
|
|
29
31
|
releaseGitSweepLease,
|
|
30
32
|
recordSessionProjectIdentity
|
|
31
|
-
} from "./server-
|
|
32
|
-
import"./server-
|
|
33
|
-
import"./server-
|
|
33
|
+
} from "./server-dcws5831.js";
|
|
34
|
+
import"./server-69m30b21.js";
|
|
35
|
+
import"./server-sefxj8k1.js";
|
|
34
36
|
import {
|
|
35
37
|
LATEST_SUPPORTED_VERSION,
|
|
36
38
|
enforceSchemaFence
|
|
37
|
-
} from "./server-
|
|
38
|
-
import"./server-
|
|
39
|
-
import"./server-
|
|
39
|
+
} from "./server-g3gqq4ac.js";
|
|
40
|
+
import"./server-468mya5v.js";
|
|
41
|
+
import"./server-3schkz95.js";
|
|
42
|
+
import"./server-tpt7bwq8.js";
|
|
40
43
|
import"./server-fr0wbhdn.js";
|
|
41
44
|
import"./server-2ra6pwf3.js";
|
|
42
|
-
import"./server-
|
|
43
|
-
import"./server-
|
|
45
|
+
import"./server-xy7w7hrd.js";
|
|
46
|
+
import"./server-qmmkhz2z.js";
|
|
47
|
+
import {
|
|
48
|
+
serveWorkerJobs
|
|
49
|
+
} from "./server-7v05d9b7.js";
|
|
44
50
|
|
|
45
51
|
// src/features/magic-context/chunk-embedding-write-worker.ts
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
if (!enforceSchemaFence(db, workerData.path, LATEST_SUPPORTED_VERSION)) {
|
|
53
|
-
db.close();
|
|
54
|
-
throw new Error("chunk embedding writer rejected an unsupported store schema");
|
|
55
|
-
}
|
|
56
|
-
var timeout = Math.max(0, Math.floor(workerData.timeout));
|
|
57
|
-
db.exec(`PRAGMA busy_timeout=${timeout}; PRAGMA foreign_keys=ON`);
|
|
58
|
-
configureContextDatabasePragmas2(db);
|
|
59
|
-
exitOnWorkerClose(port, () => db.close());
|
|
60
|
-
port.on("message", (input) => {
|
|
61
|
-
if (isWorkerCloseMessage(input))
|
|
62
|
-
return;
|
|
63
|
-
try {
|
|
64
|
-
let value;
|
|
65
|
-
switch (input.kind) {
|
|
66
|
-
case "replace":
|
|
67
|
-
replaceCompartmentChunkEmbeddings2(db, input.rows, input.sourceKey);
|
|
68
|
-
break;
|
|
69
|
-
case "project":
|
|
70
|
-
recordSessionProjectIdentity(db, input.session, input.project);
|
|
71
|
-
break;
|
|
72
|
-
case "count":
|
|
73
|
-
value = countUnembeddedSessionCompartments2(db, input.project, input.session, input.model, input.tokens);
|
|
74
|
-
break;
|
|
75
|
-
case "candidates":
|
|
76
|
-
value = loadUnembeddedSessionChunkCandidates2(db, input.project, input.session, input.model, input.limit, input.excluded, input.tokens, true);
|
|
77
|
-
break;
|
|
78
|
-
case "backoff":
|
|
79
|
-
recordChunkEmbedBackoff2(db, input.candidate, input.project, input.model);
|
|
80
|
-
break;
|
|
81
|
-
case "acquire":
|
|
82
|
-
value = acquireGitSweepLease(db, input.project, input.holder, {
|
|
83
|
-
ignoreCooldown: true
|
|
84
|
-
});
|
|
85
|
-
break;
|
|
86
|
-
case "renew":
|
|
87
|
-
value = renewGitSweepLease(db, input.project, input.holder);
|
|
88
|
-
break;
|
|
89
|
-
case "release":
|
|
90
|
-
releaseGitSweepLease(db, input.project, input.holder);
|
|
91
|
-
break;
|
|
92
|
-
}
|
|
93
|
-
port.postMessage({ value });
|
|
94
|
-
} catch (error) {
|
|
95
|
-
port.postMessage({ error: error instanceof Error ? error.message : String(error) });
|
|
52
|
+
serveWorkerJobs((workerData, port) => {
|
|
53
|
+
setHarness2(workerData.harness);
|
|
54
|
+
const db = new Database2(workerData.path);
|
|
55
|
+
if (!enforceSchemaFence(db, workerData.path, LATEST_SUPPORTED_VERSION)) {
|
|
56
|
+
db.close();
|
|
57
|
+
throw new Error("chunk embedding writer rejected an unsupported store schema");
|
|
96
58
|
}
|
|
97
|
-
|
|
59
|
+
const timeout = Math.max(0, Math.floor(workerData.timeout));
|
|
60
|
+
db.exec(`PRAGMA busy_timeout=${timeout}; PRAGMA foreign_keys=ON`);
|
|
61
|
+
configureContextDatabasePragmas2(db);
|
|
62
|
+
exitOnWorkerClose(port, () => db.close(), false);
|
|
63
|
+
port.on("message", (input) => {
|
|
64
|
+
if (isWorkerCloseMessage(input))
|
|
65
|
+
return;
|
|
66
|
+
try {
|
|
67
|
+
let value;
|
|
68
|
+
switch (input.kind) {
|
|
69
|
+
case "replace":
|
|
70
|
+
replaceCompartmentChunkEmbeddings2(db, input.rows, input.sourceKey);
|
|
71
|
+
break;
|
|
72
|
+
case "project":
|
|
73
|
+
recordSessionProjectIdentity(db, input.session, input.project);
|
|
74
|
+
break;
|
|
75
|
+
case "count":
|
|
76
|
+
value = countUnembeddedSessionCompartments2(db, input.project, input.session, input.model, input.tokens);
|
|
77
|
+
break;
|
|
78
|
+
case "candidates":
|
|
79
|
+
value = loadUnembeddedSessionChunkCandidates2(db, input.project, input.session, input.model, input.limit, input.excluded, input.tokens, true);
|
|
80
|
+
break;
|
|
81
|
+
case "backoff":
|
|
82
|
+
recordChunkEmbedBackoff2(db, input.candidate, input.project, input.model);
|
|
83
|
+
break;
|
|
84
|
+
case "acquire":
|
|
85
|
+
value = acquireGitSweepLease(db, input.project, input.holder, {
|
|
86
|
+
ignoreCooldown: true
|
|
87
|
+
});
|
|
88
|
+
break;
|
|
89
|
+
case "renew":
|
|
90
|
+
value = renewGitSweepLease(db, input.project, input.holder);
|
|
91
|
+
break;
|
|
92
|
+
case "release":
|
|
93
|
+
releaseGitSweepLease(db, input.project, input.holder);
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
port.postMessage({ value });
|
|
97
|
+
} catch (error) {
|
|
98
|
+
port.postMessage({ error: error instanceof Error ? error.message : String(error) });
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
}, false);
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
serveWorkerJobs
|
|
3
|
+
} from "./server-7v05d9b7.js";
|
|
4
|
+
|
|
1
5
|
// src/features/magic-context/compaction-marker-candidates-worker.ts
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
port.postMessage(reply);
|
|
24
|
-
port.close();
|
|
6
|
+
serveWorkerJobs(async (input, port) => {
|
|
7
|
+
port.postMessage({ kind: "accepted" });
|
|
8
|
+
const [{ Database }, { scanMarkerCandidateSnapshot }] = await Promise.all([
|
|
9
|
+
import("./sqlite-zdgm52sv.js"),
|
|
10
|
+
import("./compaction-marker-candidates-yeb2ky46.js")
|
|
11
|
+
]);
|
|
12
|
+
let db;
|
|
13
|
+
let reply;
|
|
14
|
+
try {
|
|
15
|
+
db = new Database(input.path, { readonly: true });
|
|
16
|
+
db.exec("PRAGMA busy_timeout=250");
|
|
17
|
+
reply = { kind: "candidates", snapshot: scanMarkerCandidateSnapshot(db, input.sessionId) };
|
|
18
|
+
} catch (error) {
|
|
19
|
+
reply = { kind: "error", error: error instanceof Error ? error.message : String(error) };
|
|
20
|
+
} finally {
|
|
21
|
+
db?.close();
|
|
22
|
+
}
|
|
23
|
+
port.postMessage(reply);
|
|
24
|
+
port.close();
|
|
25
|
+
});
|
|
@@ -4,11 +4,14 @@ import {
|
|
|
4
4
|
readMarkerCandidateBasis2,
|
|
5
5
|
prepareMarkerCandidateBasis2,
|
|
6
6
|
scanMarkerCandidateSnapshot2
|
|
7
|
-
} from "./server-
|
|
8
|
-
import"./server-
|
|
7
|
+
} from "./server-r4430x9m.js";
|
|
8
|
+
import"./server-96ztjvkn.js";
|
|
9
|
+
import"./server-v0p37hm2.js";
|
|
9
10
|
import"./server-gzy5w8ya.js";
|
|
10
|
-
import"./server-
|
|
11
|
+
import"./server-jb6tjyeb.js";
|
|
11
12
|
import"./server-pavzsdc6.js";
|
|
13
|
+
import"./server-z4p0ry94.js";
|
|
14
|
+
import"./server-1d042x6w.js";
|
|
12
15
|
export {
|
|
13
16
|
invalidateMarkerCandidateBasis2 as invalidateMarkerCandidateBasis,
|
|
14
17
|
isMarkerCandidateBasisCurrent2 as isMarkerCandidateBasisCurrent,
|
package/dist/v2/{compartment-chunk-embedding-rc31e6md.js → compartment-chunk-embedding-qfk791bd.js}
RENAMED
|
@@ -24,17 +24,19 @@ import {
|
|
|
24
24
|
countSessionCompartmentEmbedCoverage2,
|
|
25
25
|
countSessionCompartmentEmbedCoveragePolite2,
|
|
26
26
|
countUnembeddedSessionCompartmentsPolite2
|
|
27
|
-
} from "./server-
|
|
28
|
-
import"./server-
|
|
29
|
-
import"./server-
|
|
30
|
-
import"./server-
|
|
31
|
-
import"./server-
|
|
32
|
-
import"./server-
|
|
33
|
-
import"./server-
|
|
27
|
+
} from "./server-cp1a03vc.js";
|
|
28
|
+
import"./server-zzgtgqmd.js";
|
|
29
|
+
import"./server-nmyganc8.js";
|
|
30
|
+
import"./server-tnzbk64q.js";
|
|
31
|
+
import"./server-96ztjvkn.js";
|
|
32
|
+
import"./server-v0p37hm2.js";
|
|
33
|
+
import"./server-qmmkhz2z.js";
|
|
34
|
+
import"./server-969cdpmg.js";
|
|
34
35
|
import"./server-gzy5w8ya.js";
|
|
35
|
-
import"./server-
|
|
36
|
+
import"./server-jb6tjyeb.js";
|
|
36
37
|
import"./server-pavzsdc6.js";
|
|
37
|
-
import"./server-
|
|
38
|
+
import"./server-z4p0ry94.js";
|
|
39
|
+
import"./server-1d042x6w.js";
|
|
38
40
|
export {
|
|
39
41
|
CHUNK_WINDOW_SAFETY_RATIO2 as CHUNK_WINDOW_SAFETY_RATIO,
|
|
40
42
|
DEFAULT_COMPARTMENT_CHUNK_MAX_INPUT_TOKENS2 as DEFAULT_COMPARTMENT_CHUNK_MAX_INPUT_TOKENS,
|