@cortexkit/opencode-magic-context 0.49.16 → 0.49.17
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/dist/auto-search-worker.js +76 -63
- package/dist/chunk-embedding-write-worker.js +11 -11
- package/dist/{compaction-marker-candidates-v5c6997n.js → compaction-marker-candidates-n4krhat4.js} +2 -2
- package/dist/compaction-marker-candidates-worker.js +2 -2
- package/dist/config/schema/magic-context.d.ts +394 -394
- package/dist/{conflict-warning-hook-znry4j76.js → conflict-warning-hook-4pmz879v.js} +5 -5
- package/dist/{context-3znk23va.js → context-yhetp0kn.js} +294 -144
- package/dist/{embedding-backfill-q4n8dend.js → embedding-backfill-fmz50tsy.js} +11 -11
- package/dist/embedding-worker-process.js +1 -1
- package/dist/embedding-worker.js +4 -4
- 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/git-commits/indexer.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-openai.d.ts.map +1 -1
- package/dist/features/magic-context/memory/project-identity-cache.d.ts +2 -0
- package/dist/features/magic-context/memory/project-identity-cache.d.ts.map +1 -1
- package/dist/features/magic-context/message-index-async.d.ts +1 -1
- package/dist/features/magic-context/message-index-async.d.ts.map +1 -1
- package/dist/features/magic-context/message-index.d.ts +5 -0
- package/dist/features/magic-context/message-index.d.ts.map +1 -1
- package/dist/features/magic-context/search.d.ts +6 -1
- package/dist/features/magic-context/search.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-session.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-shared.d.ts +2 -2
- package/dist/features/magic-context/storage-meta-shared.d.ts.map +1 -1
- package/dist/features/magic-context/storage-session-tables.d.ts +9 -1
- package/dist/features/magic-context/storage-session-tables.d.ts.map +1 -1
- package/dist/hooks/magic-context/apply-operations.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-search-deadline.d.ts +2 -1
- package/dist/hooks/magic-context/auto-search-deadline.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-search-hint.d.ts +3 -0
- package/dist/hooks/magic-context/auto-search-hint.d.ts.map +1 -1
- 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/compartment-runner-historian.d.ts +2 -0
- package/dist/hooks/magic-context/compartment-runner-historian.d.ts.map +1 -1
- package/dist/hooks/magic-context/historian-host-runner.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/lkg-recovery-fence.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-chunk.d.ts.map +1 -1
- package/dist/hooks/magic-context/system-prompt-diagnostics.d.ts +8 -0
- package/dist/hooks/magic-context/system-prompt-diagnostics.d.ts.map +1 -0
- package/dist/hooks/magic-context/system-prompt-hash.d.ts.map +1 -1
- package/dist/hooks/magic-context/tag-messages.d.ts +6 -1
- package/dist/hooks/magic-context/tag-messages.d.ts.map +1 -1
- package/dist/hooks/magic-context/todo-view.d.ts +2 -2
- package/dist/hooks/magic-context/tool-drop-target.d.ts +3 -2
- package/dist/hooks/magic-context/tool-drop-target.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-stage-logger.d.ts +3 -0
- package/dist/hooks/magic-context/transform-stage-logger.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts +1 -0
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/{index-9nkg2dzk.js → index-24fezq97.js} +3 -3
- package/dist/{index-a8bvhwqs.js → index-2vxtcb95.js} +32 -3
- package/dist/{index-f71thw8j.js → index-4s3t0nd0.js} +1 -1
- package/dist/{index-kn4t1haw.js → index-4yt7dtf4.js} +450 -227
- package/dist/{index-v9asb16b.js → index-5a1ex6x8.js} +5 -5
- package/dist/{index-fkx2qnvw.js → index-6x57ar45.js} +2 -2
- package/dist/{index-dqe8pq4x.js → index-a6mc0v4d.js} +6 -3
- package/dist/{index-ayym1x7f.js → index-a7c4r5re.js} +145 -736
- package/dist/{index-ek1yxvvz.js → index-aabzay3h.js} +165 -46
- package/dist/{index-hehkf6zm.js → index-b5vqckbw.js} +12 -6
- package/dist/{v2/server-wafzvyhg.js → index-beht37jy.js} +8 -0
- package/dist/{index-7b2cfmaz.js → index-bjcnntmz.js} +2 -2
- package/dist/{index-hqkczed7.js → index-c5pytzne.js} +22 -2
- package/dist/{index-p4vde22c.js → index-cwzfcbtq.js} +956 -77
- package/dist/{index-cj9g0j7a.js → index-fb2qxs2y.js} +7 -7
- package/dist/{index-nd7m2a5a.js → index-hqhm3wke.js} +25 -3
- package/dist/{index-5mwk1nek.js → index-jn12fvvh.js} +1 -1
- package/dist/{index-n6m03s3n.js → index-ke416mdc.js} +1 -1
- package/dist/{index-6a6dq53h.js → index-kmdj7dsq.js} +5 -5
- package/dist/{index-mtw9e71a.js → index-kq82mtg0.js} +2 -2
- package/dist/{index-n78avt2p.js → index-n37sebck.js} +1 -1
- package/dist/{index-v63beg1z.js → index-nkpmm9q8.js} +3 -3
- package/dist/{index-j6zw70pf.js → index-p7m7j0cp.js} +24 -16
- package/dist/{index-wk0n1cgt.js → index-qn7xstt2.js} +2 -2
- package/dist/{index-saews2s3.js → index-rr2bb45z.js} +1 -1
- package/dist/{index-7pa32z07.js → index-s734jcsr.js} +1 -1
- package/dist/{index-b17m64g9.js → index-s74zqahq.js} +1 -1
- package/dist/{index-wv9n2zcq.js → index-v8awdgvd.js} +4 -4
- package/dist/{index-4qfy7v57.js → index-vrzjhftj.js} +31 -20
- package/dist/{index-qrahzcqv.js → index-ze7mvk54.js} +10 -7
- package/dist/index.js +39 -39
- package/dist/{message-fts-rowid-map-yvx5a9jw.js → message-fts-rowid-map-17s0dfn4.js} +5 -3
- package/dist/{message-index-bounded-6th8djy9.js → message-index-bounded-1633vc7f.js} +17 -17
- package/dist/{message-index-t4pz7akd.js → message-index-dprebmtt.js} +13 -13
- package/dist/{message-time-backfill-8egzkd3z.js → message-time-backfill-73mmm76q.js} +1 -1
- package/dist/migration-worker.js +8 -8
- package/dist/plugin/dream-timer.d.ts +11 -0
- package/dist/plugin/dream-timer.d.ts.map +1 -1
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/{project-embedding-registry-2dea0a77.js → project-embedding-registry-z74mhqkf.js} +10 -10
- package/dist/raw-ordinal-warmup-worker.js +10 -10
- package/dist/{read-session-chunk-4pwqxm5a.js → read-session-chunk-4zp09ejb.js} +7 -7
- package/dist/{read-session-raw-5ar8se5v.js → read-session-raw-rsc8c7qy.js} +2 -2
- package/dist/{recomp-orchestrator-tjcaj5x7.js → recomp-orchestrator-z3ecszx6.js} +24 -24
- package/dist/{search-rb01n29x.js → search-6mee3vty.js} +20 -20
- package/dist/{search-archive-02jws7hw.js → search-archive-znyy44ve.js} +8 -8
- package/dist/{send-session-notification-2x9edkrp.js → send-session-notification-6ve0e8p4.js} +4 -4
- package/dist/shared/historian-cache.d.ts +8 -0
- package/dist/shared/historian-cache.d.ts.map +1 -0
- package/dist/shared/model-suggestion-retry.d.ts +2 -0
- package/dist/shared/model-suggestion-retry.d.ts.map +1 -1
- package/dist/shared/rpc-discovery-cleanup.d.ts +3 -0
- package/dist/shared/rpc-discovery-cleanup.d.ts.map +1 -0
- package/dist/shared/rpc-server.d.ts +2 -0
- package/dist/shared/rpc-server.d.ts.map +1 -1
- package/dist/shared/search-text.d.ts +8 -0
- package/dist/shared/search-text.d.ts.map +1 -0
- package/dist/shared/sqlite.d.ts +4 -2
- package/dist/shared/sqlite.d.ts.map +1 -1
- package/dist/shared/storage-file-mutex.d.ts.map +1 -1
- package/dist/shared/subagent-runner.d.ts +2 -0
- package/dist/shared/subagent-runner.d.ts.map +1 -1
- package/dist/shared/system-directive.d.ts +2 -0
- package/dist/shared/system-directive.d.ts.map +1 -1
- package/dist/{sqlite-4pqyynrs.js → sqlite-zf72c52d.js} +1 -1
- package/dist/{storage-memory-j3v3hc83.js → storage-memory-y3qmy00r.js} +2 -2
- package/dist/{storage-tags-4z1w27xa.js → storage-tags-8qns3012.js} +8 -4
- package/dist/{transform-postprocess-phase-xaw5c3xp.js → transform-postprocess-phase-3ydzxa62.js} +24 -24
- package/dist/v2/auto-search-worker.js +76 -63
- package/dist/v2/chunk-embedding-write-worker.js +11 -11
- package/dist/v2/{compaction-marker-candidates-1vqwr3s5.js → compaction-marker-candidates-ebx3388k.js} +2 -2
- package/dist/v2/compaction-marker-candidates-worker.js +2 -2
- package/dist/v2/{context-acw1nhv8.js → context-jn3zpeqh.js} +882 -393
- package/dist/v2/embedding-backfill-7c7yr69y.js +23 -0
- package/dist/v2/embedding-worker-process.js +1 -1
- package/dist/v2/embedding-worker.js +4 -4
- package/dist/v2/fold/native-replay.d.ts +11 -2
- package/dist/v2/fold/native-replay.d.ts.map +1 -1
- package/dist/v2/fold/policy.d.ts.map +1 -1
- package/dist/v2/fold/restore.d.ts.map +1 -1
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/hooks/hidden-child.d.ts +8 -0
- package/dist/v2/hooks/hidden-child.d.ts.map +1 -1
- package/dist/v2/hooks/types.d.ts +17 -0
- package/dist/v2/hooks/types.d.ts.map +1 -1
- package/dist/v2/{message-fts-rowid-map-8vf0v7cr.js → message-fts-rowid-map-wfx67gfd.js} +5 -3
- package/dist/v2/{message-index-bounded-dsrf49y7.js → message-index-bounded-hpejqyd8.js} +17 -17
- package/dist/v2/{message-index-e6qzw477.js → message-index-pxehjpzx.js} +13 -13
- package/dist/v2/{message-time-backfill-q5pgxf0d.js → message-time-backfill-04t0km1z.js} +1 -1
- package/dist/v2/migration-worker.js +8 -8
- package/dist/v2/{project-embedding-registry-rek75aqw.js → project-embedding-registry-gnkj56xp.js} +10 -10
- package/dist/v2/raw-ordinal-warmup-worker.js +10 -10
- package/dist/v2/{read-session-chunk-7bpygfv2.js → read-session-chunk-zdppn4bj.js} +7 -7
- package/dist/v2/{read-session-raw-pw2n1qgc.js → read-session-raw-yaegtjzh.js} +2 -2
- package/dist/v2/{recomp-orchestrator-hzpgg06e.js → recomp-orchestrator-cmqnfpp3.js} +24 -24
- package/dist/v2/{search-sf2vg5pk.js → search-66842dya.js} +20 -20
- package/dist/v2/{search-archive-fn4wy8sx.js → search-archive-gfh11vs0.js} +8 -8
- package/dist/v2/{send-session-notification-hmr7q0nt.js → send-session-notification-3pxn658x.js} +4 -4
- package/dist/v2/{server-785mb90s.js → server-1wy7b9de.js} +6 -3
- package/dist/v2/{server-g59aatsz.js → server-3rhpvy84.js} +956 -77
- package/dist/v2/{server-kqpawe1a.js → server-46neh5fa.js} +12 -6
- package/dist/v2/{server-rrqpvwqd.js → server-6tmj0s7j.js} +2 -2
- package/dist/v2/{server-kr2kc9dz.js → server-8by8qfec.js} +10 -7
- package/dist/v2/{server-vbe4se57.js → server-a9xqj88f.js} +1 -1
- package/dist/{index-wafzvyhg.js → v2/server-beht37jy.js} +8 -0
- package/dist/v2/{server-05xjtq6c.js → server-d04vrx0j.js} +1 -1
- package/dist/v2/{server-zyw55ygv.js → server-ec4ca92p.js} +5 -5
- package/dist/v2/{server-6fyp0v67.js → server-fw7wrk01.js} +145 -737
- package/dist/v2/{server-zs8d0s3b.js → server-g3qma5c0.js} +1 -1
- package/dist/v2/{server-00hx04yn.js → server-gpvay0xz.js} +2 -2
- package/dist/v2/{server-r9gjxcte.js → server-gtfhttbr.js} +7 -7
- package/dist/v2/{server-gha9x4qq.js → server-h1v0pyxb.js} +2 -2
- package/dist/v2/{server-hgg55hde.js → server-hy3d3vsx.js} +1 -1
- package/dist/v2/{server-1hcbw661.js → server-kh7dpa1a.js} +24 -16
- package/dist/v2/{server-vgpab6rd.js → server-my7k4eds.js} +4 -4
- package/dist/v2/{server-d8tj10db.js → server-n1prf1g6.js} +1 -1
- package/dist/v2/{server-n78avt2p.js → server-n37sebck.js} +1 -1
- package/dist/v2/{server-y5pznjt9.js → server-nj659894.js} +5 -5
- package/dist/v2/{server-e3ftpk7v.js → server-rmygf5pn.js} +32 -3
- package/dist/v2/{server-0ppsweh6.js → server-tgnbmwah.js} +22 -2
- package/dist/v2/{server-n5q841qn.js → server-vsw8tmm6.js} +31 -20
- package/dist/v2/{server-6714jebr.js → server-xj136kt8.js} +1 -1
- package/dist/v2/{server-0mzjjw3s.js → server-zyzawhdw.js} +25 -3
- package/dist/v2/{server-aavz8pm6.js → server-zzkj2fch.js} +3 -3
- package/dist/v2/server.js +4 -4
- package/dist/v2/{sqlite-4pqyynrs.js → sqlite-zf72c52d.js} +1 -1
- package/dist/v2/{storage-memory-j3v3hc83.js → storage-memory-y3qmy00r.js} +2 -2
- package/dist/v2/{storage-tags-hkwtbp3g.js → storage-tags-1h8k6ra9.js} +8 -4
- package/dist/v2/store-reader.d.ts +2 -0
- package/dist/v2/store-reader.d.ts.map +1 -1
- package/dist/v2/{wrapup-orchestrator-x4xj1782.js → wrapup-orchestrator-xs8redz9.js} +24 -24
- package/dist/wrapup-orchestrator-j7d7ry5b.js +48 -0
- package/package.json +1 -1
- package/src/config/latch-permanence-guard.test.ts +4 -0
- package/src/shared/historian-cache.test.ts +69 -0
- package/src/shared/historian-cache.ts +55 -0
- package/src/shared/model-suggestion-retry.ts +2 -0
- package/src/shared/rpc-discovery-cleanup.test.ts +57 -0
- package/src/shared/rpc-discovery-cleanup.ts +57 -0
- package/src/shared/rpc-server.ts +36 -13
- package/src/shared/search-text.test.ts +47 -0
- package/src/shared/search-text.ts +63 -0
- package/src/shared/sqlite.test.ts +56 -0
- package/src/shared/sqlite.ts +51 -2
- package/src/shared/storage-file-mutex-review.test.ts +22 -2
- package/src/shared/storage-file-mutex.ts +11 -1
- package/src/shared/subagent-runner.ts +2 -0
- package/src/shared/system-directive.ts +19 -1
- package/src/shared/tag-transcript.ts +12 -4
- package/dist/v2/embedding-backfill-jyd6492b.js +0 -23
- package/dist/wrapup-orchestrator-vj2tbp22.js +0 -48
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
// src/hooks/magic-context/auto-search-worker.ts
|
|
2
2
|
import { parentPort, workerData } from "node:worker_threads";
|
|
3
|
-
|
|
4
|
-
if (!port)
|
|
3
|
+
if (!parentPort)
|
|
5
4
|
throw new Error("auto-search worker requires a parent port");
|
|
5
|
+
var port = parentPort;
|
|
6
6
|
var input = workerData;
|
|
7
|
+
var persistent = input.persistent === true;
|
|
7
8
|
if (input.job === "messages") {
|
|
8
9
|
port.postMessage({ kind: "accepted" });
|
|
9
10
|
}
|
|
@@ -18,19 +19,18 @@ var [
|
|
|
18
19
|
{ Database, registerSqliteDiagnosticSink },
|
|
19
20
|
{ log }
|
|
20
21
|
] = await Promise.all([
|
|
21
|
-
import("./embedding-backfill-
|
|
22
|
+
import("./embedding-backfill-7c7yr69y.js"),
|
|
22
23
|
import("./embedding-cache-mgyr73ef.js"),
|
|
23
|
-
import("./storage-memory-
|
|
24
|
-
import("./project-embedding-registry-
|
|
25
|
-
import("./search-
|
|
24
|
+
import("./storage-memory-y3qmy00r.js"),
|
|
25
|
+
import("./project-embedding-registry-gnkj56xp.js"),
|
|
26
|
+
import("./search-66842dya.js"),
|
|
26
27
|
import("./embedding-activity-g1dhes6g.js"),
|
|
27
28
|
import("./harness-e4avh192.js"),
|
|
28
|
-
import("./sqlite-
|
|
29
|
+
import("./sqlite-zf72c52d.js"),
|
|
29
30
|
import("./logger-7qt02bnb.js")
|
|
30
31
|
]);
|
|
31
32
|
setHarness(input.harness);
|
|
32
33
|
registerSqliteDiagnosticSink(log, getHarness);
|
|
33
|
-
setEmbeddingSessionBusy(input.sessionId, input.embeddingHostBusy === true);
|
|
34
34
|
var nextId = 0;
|
|
35
35
|
var pending = new Map;
|
|
36
36
|
var queryDimensions = null;
|
|
@@ -51,65 +51,78 @@ function request(message) {
|
|
|
51
51
|
port?.postMessage({ ...message, id });
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
|
-
if (input.snapshot) {
|
|
55
|
-
installProjectEmbeddingSearchBridge(input.snapshot, {
|
|
56
|
-
modelId: input.snapshot.modelId,
|
|
57
|
-
initialize: async () => true,
|
|
58
|
-
isLoaded: () => true,
|
|
59
|
-
dispose: async () => {},
|
|
60
|
-
embed: async (text) => {
|
|
61
|
-
const result = (await request({ kind: "query", text })).result;
|
|
62
|
-
return result instanceof Float32Array ? result : result?.vector ?? null;
|
|
63
|
-
},
|
|
64
|
-
embedBatch: async (texts, _signal, purpose = "passage") => {
|
|
65
|
-
const passage = (await request({ kind: "batch", texts, purpose })).passage;
|
|
66
|
-
const captured = input.snapshot;
|
|
67
|
-
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)
|
|
68
|
-
return texts.map(() => null);
|
|
69
|
-
return passage.vectors.map((vector) => vector && vector.length === queryDimensions && vector.every(Number.isFinite) ? vector : null);
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
54
|
db = new Database(input.path, input.job === "backfill" ? undefined : { readonly: true });
|
|
74
55
|
db.exec("PRAGMA busy_timeout = 250");
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
56
|
+
async function run(jobInput) {
|
|
57
|
+
input = jobInput;
|
|
58
|
+
queryDimensions = null;
|
|
59
|
+
setEmbeddingSessionBusy(input.sessionId, input.embeddingHostBusy === true);
|
|
60
|
+
if (input.snapshot) {
|
|
61
|
+
installProjectEmbeddingSearchBridge(input.snapshot, {
|
|
62
|
+
modelId: input.snapshot.modelId,
|
|
63
|
+
initialize: async () => true,
|
|
64
|
+
isLoaded: () => true,
|
|
65
|
+
dispose: async () => {},
|
|
66
|
+
embed: async (text) => {
|
|
67
|
+
const result = (await request({ kind: "query", text })).result;
|
|
68
|
+
return result instanceof Float32Array ? result : result?.vector ?? null;
|
|
69
|
+
},
|
|
70
|
+
embedBatch: async (texts, _signal, purpose = "passage") => {
|
|
71
|
+
const passage = (await request({ kind: "batch", texts, purpose })).passage;
|
|
72
|
+
const captured = input.snapshot;
|
|
73
|
+
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)
|
|
74
|
+
return texts.map(() => null);
|
|
75
|
+
return passage.vectors.map((vector) => vector && vector.length === queryDimensions && vector.every(Number.isFinite) ? vector : null);
|
|
88
76
|
}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
try {
|
|
80
|
+
if (input.job === "backfill") {
|
|
81
|
+
if (input.snapshot?.enabled && input.snapshot.features.memoryEnabled) {
|
|
82
|
+
await request({ kind: "query", text: input.query });
|
|
83
|
+
if (queryDimensions) {
|
|
84
|
+
const existingEmbeddings = getProjectEmbeddings(db, input.projectPath, input.snapshot.modelId);
|
|
85
|
+
const memories = getMemoriesByProject(db, input.projectPath).filter((memory) => !existingEmbeddings.has(memory.id)).slice(0, 50);
|
|
86
|
+
await ensureMemoryEmbeddings({
|
|
87
|
+
db,
|
|
88
|
+
projectIdentity: input.projectPath,
|
|
89
|
+
memories,
|
|
90
|
+
existingEmbeddings
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
port.postMessage({ kind: "result", results: [] });
|
|
95
|
+
} else if (input.job === "messages") {
|
|
96
|
+
if (!input.messageRequest)
|
|
97
|
+
throw new Error("message search job carries no request");
|
|
98
|
+
const outcome = searchMessageHistory(db, input.messageRequest);
|
|
99
|
+
port.postMessage({ kind: "messages", outcome });
|
|
100
|
+
} else {
|
|
101
|
+
const results = await unifiedSearch(db, input.sessionId, input.projectPath, input.query, {
|
|
102
|
+
...input.options,
|
|
103
|
+
backfillMemoryEmbeddings: false,
|
|
104
|
+
countRetrievals: false,
|
|
105
|
+
measurementDisabled: true,
|
|
106
|
+
embedQuery: async (text) => (await request({ kind: "query", text })).result ?? null,
|
|
107
|
+
isEmbeddingRuntimeEnabled: () => input.embeddingRuntimeEnabled
|
|
108
|
+
});
|
|
109
|
+
port.postMessage({ kind: "result", results });
|
|
89
110
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
const outcome = searchMessageHistory(db, input.messageRequest);
|
|
95
|
-
port.postMessage({ kind: "messages", outcome });
|
|
96
|
-
} else {
|
|
97
|
-
const results = await unifiedSearch(db, input.sessionId, input.projectPath, input.query, {
|
|
98
|
-
...input.options,
|
|
99
|
-
backfillMemoryEmbeddings: false,
|
|
100
|
-
countRetrievals: false,
|
|
101
|
-
measurementDisabled: true,
|
|
102
|
-
embedQuery: async (text) => (await request({ kind: "query", text })).result ?? null,
|
|
103
|
-
isEmbeddingRuntimeEnabled: () => input.embeddingRuntimeEnabled
|
|
111
|
+
} catch (error) {
|
|
112
|
+
port.postMessage({
|
|
113
|
+
kind: "error",
|
|
114
|
+
error: error instanceof Error ? error.message : String(error)
|
|
104
115
|
});
|
|
105
|
-
|
|
116
|
+
} finally {
|
|
117
|
+
setEmbeddingSessionBusy(input.sessionId, false);
|
|
118
|
+
if (!persistent) {
|
|
119
|
+
db.close();
|
|
120
|
+
port?.close();
|
|
121
|
+
}
|
|
106
122
|
}
|
|
107
|
-
} catch (error) {
|
|
108
|
-
port.postMessage({
|
|
109
|
-
kind: "error",
|
|
110
|
-
error: error instanceof Error ? error.message : String(error)
|
|
111
|
-
});
|
|
112
|
-
} finally {
|
|
113
|
-
db.close();
|
|
114
|
-
port.close();
|
|
115
123
|
}
|
|
124
|
+
port.on("message", (message) => {
|
|
125
|
+
if (message.kind === "run" && message.input)
|
|
126
|
+
run(message.input);
|
|
127
|
+
});
|
|
128
|
+
await run(input);
|
|
@@ -3,39 +3,39 @@ import {
|
|
|
3
3
|
} from "./server-pavzsdc6.js";
|
|
4
4
|
import {
|
|
5
5
|
Database2
|
|
6
|
-
} from "./server-
|
|
6
|
+
} from "./server-beht37jy.js";
|
|
7
7
|
import {
|
|
8
8
|
configureContextDatabasePragmas2
|
|
9
9
|
} from "./server-fb3zxn06.js";
|
|
10
|
-
import"./server-
|
|
10
|
+
import"./server-tgnbmwah.js";
|
|
11
11
|
import"./server-f2xf5gcb.js";
|
|
12
|
-
import"./server-
|
|
12
|
+
import"./server-6tmj0s7j.js";
|
|
13
13
|
import"./server-51779zs2.js";
|
|
14
|
-
import"./server-
|
|
15
|
-
import"./server-
|
|
14
|
+
import"./server-xj136kt8.js";
|
|
15
|
+
import"./server-1wy7b9de.js";
|
|
16
16
|
import {
|
|
17
17
|
replaceCompartmentChunkEmbeddings,
|
|
18
18
|
recordChunkEmbedBackoff,
|
|
19
19
|
loadUnembeddedSessionChunkCandidates,
|
|
20
20
|
countUnembeddedSessionCompartments
|
|
21
|
-
} from "./server-
|
|
21
|
+
} from "./server-46neh5fa.js";
|
|
22
22
|
import {
|
|
23
23
|
acquireGitSweepLease,
|
|
24
24
|
renewGitSweepLease,
|
|
25
25
|
releaseGitSweepLease,
|
|
26
26
|
recordSessionProjectIdentity
|
|
27
|
-
} from "./server-
|
|
28
|
-
import"./server-
|
|
27
|
+
} from "./server-hy3d3vsx.js";
|
|
28
|
+
import"./server-rmygf5pn.js";
|
|
29
29
|
import"./server-da07v4xp.js";
|
|
30
30
|
import {
|
|
31
31
|
LATEST_SUPPORTED_VERSION,
|
|
32
32
|
enforceSchemaFence
|
|
33
|
-
} from "./server-
|
|
34
|
-
import"./server-
|
|
33
|
+
} from "./server-gtfhttbr.js";
|
|
34
|
+
import"./server-gpvay0xz.js";
|
|
35
35
|
import"./server-pwv4ezb0.js";
|
|
36
36
|
import"./server-fr0wbhdn.js";
|
|
37
37
|
import"./server-2ra6pwf3.js";
|
|
38
|
-
import"./server-
|
|
38
|
+
import"./server-g3qma5c0.js";
|
|
39
39
|
import"./server-6pmqg9m4.js";
|
|
40
40
|
|
|
41
41
|
// src/features/magic-context/chunk-embedding-write-worker.ts
|
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
readMarkerCandidateBasis2,
|
|
5
5
|
prepareMarkerCandidateBasis2,
|
|
6
6
|
scanMarkerCandidateSnapshot2
|
|
7
|
-
} from "./server-
|
|
7
|
+
} from "./server-d04vrx0j.js";
|
|
8
8
|
import"./server-51779zs2.js";
|
|
9
|
-
import"./server-
|
|
9
|
+
import"./server-beht37jy.js";
|
|
10
10
|
import"./server-f2xf5gcb.js";
|
|
11
11
|
import"./server-pavzsdc6.js";
|
|
12
12
|
export {
|
|
@@ -5,8 +5,8 @@ if (!port)
|
|
|
5
5
|
throw new Error("marker candidate worker requires a parent port");
|
|
6
6
|
port.postMessage({ kind: "accepted" });
|
|
7
7
|
var [{ Database }, { scanMarkerCandidateSnapshot }] = await Promise.all([
|
|
8
|
-
import("./sqlite-
|
|
9
|
-
import("./compaction-marker-candidates-
|
|
8
|
+
import("./sqlite-zf72c52d.js"),
|
|
9
|
+
import("./compaction-marker-candidates-ebx3388k.js")
|
|
10
10
|
]);
|
|
11
11
|
var input = workerData;
|
|
12
12
|
var db;
|