@cortexkit/opencode-magic-context 0.49.42 → 0.49.44
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 +3 -3
- package/dist/chunk-embedding-write-worker.js +1 -1
- package/dist/{compaction-marker-candidates-5c44h1m9.js → compaction-marker-candidates-dkfp1q9j.js} +12 -2
- package/dist/compaction-marker-candidates-worker.js +5 -2
- package/dist/{context-zf1yj1g0.js → context-ws6gbyrr.js} +19 -19
- package/dist/{embedding-backfill-rma0v2ct.js → embedding-backfill-zxj35jkq.js} +4 -4
- package/dist/embedding-worker.js +2 -2
- package/dist/features/magic-context/compaction-marker-candidates.d.ts +57 -4
- package/dist/features/magic-context/compaction-marker-candidates.d.ts.map +1 -1
- package/dist/features/magic-context/compaction-marker.d.ts +18 -3
- package/dist/features/magic-context/compaction-marker.d.ts.map +1 -1
- package/dist/features/magic-context/scheduler.d.ts.map +1 -1
- package/dist/hooks/magic-context/apply-operations.d.ts +5 -4
- package/dist/hooks/magic-context/apply-operations.d.ts.map +1 -1
- package/dist/hooks/magic-context/cache-busting-signals.d.ts +4 -4
- package/dist/hooks/magic-context/cache-busting-signals.d.ts.map +1 -1
- package/dist/hooks/magic-context/compaction-marker-manager.d.ts +7 -1
- package/dist/hooks/magic-context/compaction-marker-manager.d.ts.map +1 -1
- package/dist/hooks/magic-context/compaction-marker-publication.d.ts.map +1 -1
- package/dist/hooks/magic-context/event-handler.d.ts.map +1 -1
- package/dist/hooks/magic-context/inject-compartments.d.ts +7 -2
- package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
- package/dist/hooks/magic-context/local-wire-reading.d.ts +54 -0
- package/dist/hooks/magic-context/local-wire-reading.d.ts.map +1 -0
- package/dist/hooks/magic-context/rust-mode-transform.d.ts.map +1 -1
- package/dist/hooks/magic-context/system-date-refresh.d.ts +1 -2
- package/dist/hooks/magic-context/system-date-refresh.d.ts.map +1 -1
- package/dist/hooks/magic-context/system-prompt-hash.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-context-state.d.ts +38 -6
- package/dist/hooks/magic-context/transform-context-state.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +5 -2
- 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-zqsp3z0d.js → index-1j8m4ad0.js} +1 -1
- package/dist/{index-5m2azs6v.js → index-24y47287.js} +4 -4
- package/dist/{index-c5dzns43.js → index-4dpvnp8k.js} +1 -1
- package/dist/{index-ty4vhe4n.js → index-66qexmjw.js} +3 -3
- package/dist/{index-kfsqk1q7.js → index-6qnhaaa0.js} +1 -1
- package/dist/{index-n8bsqg7b.js → index-7y8c2n52.js} +3 -3
- package/dist/{index-ayk4we2k.js → index-8w3y6pxc.js} +36 -26
- package/dist/{index-p2e7j9p1.js → index-91y4xvx6.js} +1 -1
- package/dist/{index-rdx17j04.js → index-dasvhxwg.js} +1 -1
- package/dist/{index-z6v8086q.js → index-g0mjm7e4.js} +2 -2
- package/dist/{index-1zv08avf.js → index-g7rrfjkq.js} +4 -4
- package/dist/{index-3w1pbn85.js → index-gn6gfz4y.js} +64 -12
- package/dist/{index-xnm0wq1r.js → index-kgk64zyx.js} +1 -1
- package/dist/{index-xjw9rres.js → index-knnscj54.js} +1 -1
- package/dist/{index-gsqz39wk.js → index-m1mttf6y.js} +1 -1
- package/dist/{index-adt3jghq.js → index-ntssp0dt.js} +159 -49
- package/dist/{index-xd2p95m7.js → index-p6gs3xpx.js} +1 -1
- package/dist/{index-21fgrfrf.js → index-rhcwddn9.js} +2 -2
- package/dist/{index-fas76dft.js → index-v64se1t6.js} +5 -5
- package/dist/{index-xmqj3cf5.js → index-wapyeb06.js} +129 -56
- package/dist/index.js +23 -23
- package/dist/{message-index-bounded-5mj8p6nq.js → message-index-bounded-dmq6ne7d.js} +3 -3
- package/dist/migration-worker.js +1 -1
- package/dist/{project-embedding-registry-3yyegjma.js → project-embedding-registry-m47vg1ce.js} +3 -3
- package/dist/raw-ordinal-warmup-worker.js +3 -3
- package/dist/{read-session-chunk-k70bhfjm.js → read-session-chunk-3m7z9v3t.js} +2 -2
- package/dist/{recomp-orchestrator-2q4rmerf.js → recomp-orchestrator-9wtcpd7d.js} +12 -12
- package/dist/{render-36fvvwz6.js → render-esw55s0k.js} +6 -6
- package/dist/{search-6v2na3af.js → search-3b4kbhtw.js} +9 -9
- package/dist/{search-archive-jwb2ctnq.js → search-archive-wna5basn.js} +4 -4
- package/dist/shared/status-view.d.ts.map +1 -1
- package/dist/{transform-postprocess-phase-0ms3ga4h.js → transform-postprocess-phase-1y6p9ccc.js} +13 -13
- package/dist/v2/auto-search-worker.js +3 -3
- package/dist/v2/chunk-embedding-write-worker.js +1 -1
- package/dist/v2/compaction-marker-candidates-worker.js +5 -2
- package/dist/v2/{compaction-marker-candidates-jy65jt49.js → compaction-marker-candidates-y737qb1v.js} +12 -2
- package/dist/v2/{context-2xr6vbt2.js → context-sfgk72cj.js} +184 -64
- package/dist/v2/{embedding-backfill-00tw59rx.js → embedding-backfill-ahwzfc7v.js} +4 -4
- package/dist/v2/embedding-worker.js +2 -2
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/{message-index-bounded-5341qsqd.js → message-index-bounded-mapha2ag.js} +3 -3
- package/dist/v2/migration-worker.js +1 -1
- package/dist/v2/{project-embedding-registry-jqq2qeqb.js → project-embedding-registry-mn403rp5.js} +3 -3
- package/dist/v2/raw-ordinal-warmup-worker.js +3 -3
- package/dist/v2/{read-session-chunk-dgmq3ntm.js → read-session-chunk-svcthp0n.js} +2 -2
- package/dist/v2/{recomp-orchestrator-2vmyhtst.js → recomp-orchestrator-2bkv46am.js} +12 -12
- package/dist/v2/{render-kz0f40ws.js → render-315tv10c.js} +6 -6
- package/dist/v2/{search-archive-wajxd01m.js → search-archive-hnx40ts0.js} +4 -4
- package/dist/v2/{search-a9hwy1sw.js → search-bhrr075t.js} +8 -8
- package/dist/v2/{server-7qc9tk6z.js → server-1c720m9s.js} +1 -1
- package/dist/v2/{server-qehn6btp.js → server-1yx5455s.js} +2 -2
- package/dist/v2/{server-p78wdf43.js → server-63cz4w5t.js} +1 -1
- package/dist/v2/{server-kqrpt2ht.js → server-78mc9sxx.js} +1 -1
- package/dist/v2/{server-7acq7815.js → server-86sk7h34.js} +2 -2
- package/dist/v2/{server-6vzh6wej.js → server-8xdnk7vz.js} +1 -1
- package/dist/v2/{server-gkse1wyz.js → server-aqgg41wb.js} +3 -3
- package/dist/v2/{server-3m7p4g9w.js → server-g8xvnxcf.js} +1 -1
- package/dist/v2/{server-dwpgzm0t.js → server-gwxys0d0.js} +64 -12
- package/dist/v2/{server-5ydn39x3.js → server-ngdrh7rv.js} +130 -57
- package/dist/v2/{server-7zacmty5.js → server-p9s40wfa.js} +1 -1
- package/dist/v2/{server-dqs8e4yt.js → server-qs0mdpc1.js} +4 -4
- package/dist/v2/{server-sfcp13bn.js → server-rqypazrp.js} +3 -3
- package/dist/v2/{server-09td1wgc.js → server-t5gxvcc3.js} +1 -1
- package/dist/v2/{server-avdveykk.js → server-vjhk8v41.js} +1 -1
- package/dist/v2/{server-nq3cb7be.js → server-xnz3nrt2.js} +1 -1
- package/dist/v2/server.js +4 -4
- package/dist/v2/{v2-archive-reader-ag6sk771.js → v2-archive-reader-qwn0me88.js} +1 -1
- package/dist/v2/{wrapup-orchestrator-2a077zew.js → wrapup-orchestrator-ts0sqwp3.js} +12 -12
- package/dist/{v2-archive-reader-chk95syc.js → v2-archive-reader-vqqjkeaq.js} +1 -1
- package/dist/{wrapup-orchestrator-rhs675kj.js → wrapup-orchestrator-qxvbvr4r.js} +13 -13
- package/package.json +1 -1
- package/src/config/schema/magic-context.ts +1 -1
- package/src/shared/status-view.ts +3 -5
- package/src/tui/dialogs/status-dialog-render.test.ts +1 -1
|
@@ -10,14 +10,14 @@ import"./server-pavzsdc6.js";
|
|
|
10
10
|
import"./server-jb6tjyeb.js";
|
|
11
11
|
import"./server-z4p0ry94.js";
|
|
12
12
|
import"./server-tpt7bwq8.js";
|
|
13
|
-
import"./server-
|
|
13
|
+
import"./server-p9s40wfa.js";
|
|
14
14
|
import"./server-v0p37hm2.js";
|
|
15
15
|
import"./server-96ztjvkn.js";
|
|
16
16
|
import"./server-1d042x6w.js";
|
|
17
17
|
import"./server-tnzbk64q.js";
|
|
18
18
|
import"./server-2ra6pwf3.js";
|
|
19
19
|
import"./server-mfn1yf9d.js";
|
|
20
|
-
import"./server-
|
|
20
|
+
import"./server-78mc9sxx.js";
|
|
21
21
|
import"./server-xy7w7hrd.js";
|
|
22
22
|
import {
|
|
23
23
|
MESSAGE_INDEX_MAX_FTS_BYTES,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
markMessageIndexDirty,
|
|
27
27
|
getIndexableContent,
|
|
28
28
|
indexSingleMessage
|
|
29
|
-
} from "./server-
|
|
29
|
+
} from "./server-g8xvnxcf.js";
|
|
30
30
|
import"./server-nmyganc8.js";
|
|
31
31
|
import"./server-qmmkhz2z.js";
|
|
32
32
|
|
package/dist/v2/{project-embedding-registry-jqq2qeqb.js → project-embedding-registry-mn403rp5.js}
RENAMED
|
@@ -35,12 +35,12 @@ import {
|
|
|
35
35
|
sweepAllRegisteredProjects2,
|
|
36
36
|
_setTestProviderFactoryForProject2,
|
|
37
37
|
_resetProjectEmbeddingRegistryForTests2
|
|
38
|
-
} from "./server-
|
|
38
|
+
} from "./server-86sk7h34.js";
|
|
39
39
|
import"./server-4dhv7mqz.js";
|
|
40
40
|
import"./server-2amn2s73.js";
|
|
41
41
|
import"./server-qt1qqasc.js";
|
|
42
|
-
import"./server-
|
|
43
|
-
import"./server-
|
|
42
|
+
import"./server-8xdnk7vz.js";
|
|
43
|
+
import"./server-p9s40wfa.js";
|
|
44
44
|
import"./server-dcws5831.js";
|
|
45
45
|
import"./server-cp1a03vc.js";
|
|
46
46
|
import"./server-zzgtgqmd.js";
|
|
@@ -19,7 +19,7 @@ serveWorkerJobs(async (input, port) => {
|
|
|
19
19
|
await main();
|
|
20
20
|
async function main() {
|
|
21
21
|
if (input.v2ArchiveReader) {
|
|
22
|
-
const { serveV2ArchiveReads } = await import("./v2-archive-reader-
|
|
22
|
+
const { serveV2ArchiveReads } = await import("./v2-archive-reader-qwn0me88.js");
|
|
23
23
|
await serveV2ArchiveReads(port, openConnections);
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
@@ -51,7 +51,7 @@ serveWorkerJobs(async (input, port) => {
|
|
|
51
51
|
await runMessageFtsRowidMapBackfill(db);
|
|
52
52
|
reply = { kind: "fts-rowid-backfill" };
|
|
53
53
|
} else if (input.searchArchive) {
|
|
54
|
-
const { renderSearchArchive } = await import("./search-archive-
|
|
54
|
+
const { renderSearchArchive } = await import("./search-archive-hnx40ts0.js");
|
|
55
55
|
const { readRawSessionMessageIdOrdinalsForRangeFromDb } = await import("./read-session-raw-qpp6x9kg.js");
|
|
56
56
|
const archive = input.searchArchive;
|
|
57
57
|
let raw;
|
|
@@ -81,7 +81,7 @@ serveWorkerJobs(async (input, port) => {
|
|
|
81
81
|
const { setHarness } = await import("./harness-e4avh192.js");
|
|
82
82
|
setHarness(input.harness ?? "opencode");
|
|
83
83
|
const [{ indexMessageInShortChunks }, { configureContextDatabasePragmas }] = await Promise.all([
|
|
84
|
-
import("./message-index-bounded-
|
|
84
|
+
import("./message-index-bounded-mapha2ag.js"),
|
|
85
85
|
import("./sqlite-context-pragmas-mv9jqwjh.js")
|
|
86
86
|
]);
|
|
87
87
|
configureContextDatabasePragmas(db);
|
|
@@ -38,11 +38,11 @@ import {
|
|
|
38
38
|
readSessionChunk2,
|
|
39
39
|
getRawSessionMessageIdsThrough2,
|
|
40
40
|
readRawSessionSeedTail2
|
|
41
|
-
} from "./server-
|
|
41
|
+
} from "./server-78mc9sxx.js";
|
|
42
42
|
import"./server-xfjjbrkt.js";
|
|
43
43
|
import"./server-1zx87sdm.js";
|
|
44
44
|
import"./server-mfn1yf9d.js";
|
|
45
|
-
import"./server-
|
|
45
|
+
import"./server-p9s40wfa.js";
|
|
46
46
|
import"./server-xy7w7hrd.js";
|
|
47
47
|
import"./server-tpt7bwq8.js";
|
|
48
48
|
import"./server-tnzbk64q.js";
|
|
@@ -7,35 +7,35 @@ import {
|
|
|
7
7
|
setRecompTerminal2,
|
|
8
8
|
buildRecompDeps2,
|
|
9
9
|
runManagedRecomp2
|
|
10
|
-
} from "./server-
|
|
11
|
-
import"./server-
|
|
12
|
-
import"./server-
|
|
13
|
-
import"./server-
|
|
10
|
+
} from "./server-ngdrh7rv.js";
|
|
11
|
+
import"./server-gwxys0d0.js";
|
|
12
|
+
import"./server-xnz3nrt2.js";
|
|
13
|
+
import"./server-aqgg41wb.js";
|
|
14
14
|
import"./server-jjvbk92s.js";
|
|
15
|
-
import"./server-
|
|
15
|
+
import"./server-86sk7h34.js";
|
|
16
16
|
import"./server-4dhv7mqz.js";
|
|
17
|
-
import"./server-
|
|
17
|
+
import"./server-1c720m9s.js";
|
|
18
18
|
import"./server-ypf1ap0v.js";
|
|
19
|
-
import"./server-
|
|
19
|
+
import"./server-g8xvnxcf.js";
|
|
20
20
|
import"./server-2amn2s73.js";
|
|
21
21
|
import"./server-ef1mskas.js";
|
|
22
22
|
import"./server-sd8hvzte.js";
|
|
23
23
|
import"./server-bez34e60.js";
|
|
24
24
|
import"./server-qt1qqasc.js";
|
|
25
|
-
import"./server-
|
|
25
|
+
import"./server-78mc9sxx.js";
|
|
26
26
|
import"./server-xfjjbrkt.js";
|
|
27
27
|
import"./server-1zx87sdm.js";
|
|
28
28
|
import"./server-mfn1yf9d.js";
|
|
29
29
|
import"./server-f0j864ma.js";
|
|
30
|
-
import"./server-
|
|
30
|
+
import"./server-vjhk8v41.js";
|
|
31
31
|
import"./server-qxzbmtqt.js";
|
|
32
32
|
import"./server-x8a7jmkh.js";
|
|
33
|
-
import"./server-
|
|
34
|
-
import"./server-
|
|
33
|
+
import"./server-8xdnk7vz.js";
|
|
34
|
+
import"./server-p9s40wfa.js";
|
|
35
35
|
import"./server-dcws5831.js";
|
|
36
36
|
import"./server-cp1a03vc.js";
|
|
37
37
|
import"./server-zzgtgqmd.js";
|
|
38
|
-
import"./server-
|
|
38
|
+
import"./server-t5gxvcc3.js";
|
|
39
39
|
import"./server-fb3zxn06.js";
|
|
40
40
|
import"./server-3schkz95.js";
|
|
41
41
|
import"./server-fr0wbhdn.js";
|
|
@@ -2,20 +2,20 @@ import {
|
|
|
2
2
|
renderMessageByOrdinal2,
|
|
3
3
|
renderVerboseRangeForTool2,
|
|
4
4
|
renderItemByTag2
|
|
5
|
-
} from "./server-
|
|
6
|
-
import"./server-
|
|
5
|
+
} from "./server-63cz4w5t.js";
|
|
6
|
+
import"./server-1c720m9s.js";
|
|
7
7
|
import"./server-ypf1ap0v.js";
|
|
8
|
-
import"./server-
|
|
8
|
+
import"./server-g8xvnxcf.js";
|
|
9
9
|
import"./server-2amn2s73.js";
|
|
10
10
|
import"./server-ef1mskas.js";
|
|
11
|
-
import"./server-
|
|
11
|
+
import"./server-78mc9sxx.js";
|
|
12
12
|
import"./server-xfjjbrkt.js";
|
|
13
13
|
import"./server-1zx87sdm.js";
|
|
14
14
|
import"./server-mfn1yf9d.js";
|
|
15
|
-
import"./server-
|
|
15
|
+
import"./server-p9s40wfa.js";
|
|
16
16
|
import"./server-cp1a03vc.js";
|
|
17
17
|
import"./server-zzgtgqmd.js";
|
|
18
|
-
import"./server-
|
|
18
|
+
import"./server-t5gxvcc3.js";
|
|
19
19
|
import"./server-fb3zxn06.js";
|
|
20
20
|
import"./server-3schkz95.js";
|
|
21
21
|
import"./server-fr0wbhdn.js";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
renderSearchArchive2,
|
|
3
3
|
renderSearchArchiveOffThread2
|
|
4
|
-
} from "./server-
|
|
5
|
-
import"./server-
|
|
4
|
+
} from "./server-1yx5455s.js";
|
|
5
|
+
import"./server-rqypazrp.js";
|
|
6
6
|
import"./server-kaqs6h31.js";
|
|
7
|
-
import"./server-
|
|
7
|
+
import"./server-78mc9sxx.js";
|
|
8
8
|
import"./server-xfjjbrkt.js";
|
|
9
9
|
import"./server-1zx87sdm.js";
|
|
10
10
|
import"./server-mfn1yf9d.js";
|
|
11
|
-
import"./server-
|
|
11
|
+
import"./server-p9s40wfa.js";
|
|
12
12
|
import"./server-xy7w7hrd.js";
|
|
13
13
|
import"./server-tpt7bwq8.js";
|
|
14
14
|
import"./server-tnzbk64q.js";
|
|
@@ -5,23 +5,23 @@ import {
|
|
|
5
5
|
resolveMemoriesByIdsForSearch2,
|
|
6
6
|
unifiedSearch2,
|
|
7
7
|
formatSearchResults2
|
|
8
|
-
} from "./server-
|
|
8
|
+
} from "./server-qs0mdpc1.js";
|
|
9
9
|
import"./server-kaqs6h31.js";
|
|
10
|
-
import"./server-
|
|
11
|
-
import"./server-
|
|
10
|
+
import"./server-xnz3nrt2.js";
|
|
11
|
+
import"./server-aqgg41wb.js";
|
|
12
12
|
import"./server-jjvbk92s.js";
|
|
13
|
-
import"./server-
|
|
13
|
+
import"./server-86sk7h34.js";
|
|
14
14
|
import"./server-4dhv7mqz.js";
|
|
15
15
|
import"./server-ypf1ap0v.js";
|
|
16
|
-
import"./server-
|
|
16
|
+
import"./server-g8xvnxcf.js";
|
|
17
17
|
import"./server-2amn2s73.js";
|
|
18
18
|
import"./server-qt1qqasc.js";
|
|
19
|
-
import"./server-
|
|
19
|
+
import"./server-78mc9sxx.js";
|
|
20
20
|
import"./server-xfjjbrkt.js";
|
|
21
21
|
import"./server-1zx87sdm.js";
|
|
22
22
|
import"./server-mfn1yf9d.js";
|
|
23
|
-
import"./server-
|
|
24
|
-
import"./server-
|
|
23
|
+
import"./server-8xdnk7vz.js";
|
|
24
|
+
import"./server-p9s40wfa.js";
|
|
25
25
|
import"./server-dcws5831.js";
|
|
26
26
|
import"./server-cp1a03vc.js";
|
|
27
27
|
import"./server-zzgtgqmd.js";
|
|
@@ -19,10 +19,10 @@ import {
|
|
|
19
19
|
rawMessageWorkerSource2,
|
|
20
20
|
rawMessageOffThreadRangeReader2,
|
|
21
21
|
readRawSessionMessageIdOrdinalsForRange2
|
|
22
|
-
} from "./server-
|
|
22
|
+
} from "./server-78mc9sxx.js";
|
|
23
23
|
import {
|
|
24
24
|
readV2ArchiveOffThread2
|
|
25
|
-
} from "./server-
|
|
25
|
+
} from "./server-rqypazrp.js";
|
|
26
26
|
|
|
27
27
|
// src/tools/ctx-expand/search-archive.ts
|
|
28
28
|
var archiveReadsOnThisThread = 0;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DEFAULT_LOCAL_EMBEDDING_MODEL
|
|
3
|
-
} from "./server-
|
|
3
|
+
} from "./server-p9s40wfa.js";
|
|
4
4
|
import {
|
|
5
5
|
embedPauseBySession,
|
|
6
6
|
activeEmbeddingSessions,
|
|
@@ -83,7 +83,7 @@ import {
|
|
|
83
83
|
logLocalEmbeddingPoolingUnavailableOnce,
|
|
84
84
|
getEmbeddingProviderIdentity,
|
|
85
85
|
LocalEmbeddingProvider
|
|
86
|
-
} from "./server-
|
|
86
|
+
} from "./server-8xdnk7vz.js";
|
|
87
87
|
import {
|
|
88
88
|
isKnownAutocommit
|
|
89
89
|
} from "./server-8ajstryz.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DEFAULT_LOCAL_EMBEDDING_MODEL
|
|
3
|
-
} from "./server-
|
|
3
|
+
} from "./server-p9s40wfa.js";
|
|
4
4
|
import {
|
|
5
5
|
log2
|
|
6
6
|
} from "./server-jb6tjyeb.js";
|
|
@@ -10,12 +10,12 @@ import {
|
|
|
10
10
|
} from "./server-zzgtgqmd.js";
|
|
11
11
|
import {
|
|
12
12
|
LocalEmbeddingProvider
|
|
13
|
-
} from "./server-
|
|
13
|
+
} from "./server-8xdnk7vz.js";
|
|
14
14
|
import {
|
|
15
15
|
OpenAICompatibleEmbeddingProvider,
|
|
16
16
|
getProjectEmbeddingSnapshot2,
|
|
17
17
|
embedBatchForProject2
|
|
18
|
-
} from "./server-
|
|
18
|
+
} from "./server-86sk7h34.js";
|
|
19
19
|
import {
|
|
20
20
|
isEmbeddingHostBusy2
|
|
21
21
|
} from "./server-qt1qqasc.js";
|
|
@@ -26,9 +26,10 @@ var missingWorkerWarnings = new Set;
|
|
|
26
26
|
var ownWriteRevisions = new Map;
|
|
27
27
|
var exitRegistered = false;
|
|
28
28
|
function reportWorkerUnavailable(entry, detail) {
|
|
29
|
-
|
|
29
|
+
const key = `${entry.href}\x00${detail}`;
|
|
30
|
+
if (missingWorkerWarnings.has(key))
|
|
30
31
|
return;
|
|
31
|
-
missingWorkerWarnings.add(
|
|
32
|
+
missingWorkerWarnings.add(key);
|
|
32
33
|
const path = entry.protocol === "file:" ? fileURLToPath(entry) : entry.href;
|
|
33
34
|
log2(`[magic-context] [ERROR] compaction-marker: candidate worker unavailable ${path}: ${detail}; marker unchanged, advancement deferred`);
|
|
34
35
|
}
|
|
@@ -64,6 +65,9 @@ function invalidateMarkerCandidateBasis2(db, sessionId) {
|
|
|
64
65
|
if (revision !== undefined)
|
|
65
66
|
ownWriteRevisions.set(key, revision + 1);
|
|
66
67
|
}
|
|
68
|
+
function discardMarkerCandidateBasis2(db, sessionId) {
|
|
69
|
+
candidates.get(db)?.delete(sessionId);
|
|
70
|
+
}
|
|
67
71
|
function readMarkerCandidateBasis2(db, sessionId, readConnection = db) {
|
|
68
72
|
const basis = candidates.get(db)?.get(sessionId);
|
|
69
73
|
if (basis) {
|
|
@@ -94,7 +98,7 @@ function prepareMarkerCandidateBasis2(db, sessionId, options = {}) {
|
|
|
94
98
|
reportWorkerUnavailable(entry, "file missing");
|
|
95
99
|
return Promise.resolve(false);
|
|
96
100
|
}
|
|
97
|
-
const preparation = runCandidateWorker(path, sessionId, options).then((snapshot) => {
|
|
101
|
+
const preparation = runCandidateWorker(path, sessionId, options.references !== false, options).then((snapshot) => {
|
|
98
102
|
if (!snapshot)
|
|
99
103
|
return false;
|
|
100
104
|
const basis = {
|
|
@@ -124,7 +128,7 @@ function prepareMarkerCandidateBasis2(db, sessionId, options = {}) {
|
|
|
124
128
|
function markerWorkerEntry() {
|
|
125
129
|
return new URL(new URL(import.meta.url).pathname.endsWith(".ts") ? "./compaction-marker-candidates-worker.ts" : "./compaction-marker-candidates-worker.js", import.meta.url);
|
|
126
130
|
}
|
|
127
|
-
function runCandidateWorker(path, sessionId, options) {
|
|
131
|
+
function runCandidateWorker(path, sessionId, references, options) {
|
|
128
132
|
if (!exitRegistered) {
|
|
129
133
|
exitRegistered = true;
|
|
130
134
|
const controller = new AbortController;
|
|
@@ -164,10 +168,14 @@ function runCandidateWorker(path, sessionId, options) {
|
|
|
164
168
|
timer.unref?.();
|
|
165
169
|
};
|
|
166
170
|
try {
|
|
167
|
-
|
|
171
|
+
const pooled = !options.entry || options.shareWorker === true;
|
|
172
|
+
worker = inRootAsyncContext2(() => pooled ? reuseWorker(entry, { workerData: { path, sessionId, references } }) : new Worker(entry, { workerData: { path, sessionId, references } }));
|
|
168
173
|
workers.add(worker);
|
|
169
174
|
worker.unref();
|
|
170
|
-
|
|
175
|
+
if (pooled)
|
|
176
|
+
worker.once("online", () => deadline(options.acceptMs ?? 2000));
|
|
177
|
+
else
|
|
178
|
+
deadline(options.acceptMs ?? 2000);
|
|
171
179
|
worker.on("message", (reply) => {
|
|
172
180
|
if (reply.kind === "accepted")
|
|
173
181
|
deadline(options.resultMs ?? 600000);
|
|
@@ -205,20 +213,64 @@ function scanMarkerSummaryCandidates(db, sessionId) {
|
|
|
205
213
|
db.exec("ROLLBACK");
|
|
206
214
|
}
|
|
207
215
|
}
|
|
208
|
-
function scanMarkerCandidateSnapshot2(db, sessionId) {
|
|
216
|
+
function scanMarkerCandidateSnapshot2(db, sessionId, references = true) {
|
|
209
217
|
const ownsSnapshot = !db.inTransaction;
|
|
210
218
|
if (ownsSnapshot)
|
|
211
219
|
db.exec("BEGIN");
|
|
212
220
|
try {
|
|
213
221
|
const ids = scanMarkerSummaryCandidates(db, sessionId);
|
|
214
|
-
const frontier = db
|
|
215
|
-
if (
|
|
216
|
-
|
|
217
|
-
return {
|
|
222
|
+
const frontier = readMarkerFrontier(db, "message");
|
|
223
|
+
if (!references)
|
|
224
|
+
return { ids, frontier };
|
|
225
|
+
return {
|
|
226
|
+
ids,
|
|
227
|
+
frontier,
|
|
228
|
+
references: {
|
|
229
|
+
partIds: readMarkerReferenceRows2(db, sessionId, "part").map((row) => row.id),
|
|
230
|
+
partFrontiers: readMarkerFrontiers2(db, "part")
|
|
231
|
+
}
|
|
232
|
+
};
|
|
218
233
|
} finally {
|
|
219
234
|
if (ownsSnapshot)
|
|
220
235
|
db.exec("ROLLBACK");
|
|
221
236
|
}
|
|
222
237
|
}
|
|
238
|
+
function readMarkerFrontier(db, table) {
|
|
239
|
+
const frontier = db.prepare(`SELECT rowid,id FROM ${table} ORDER BY rowid DESC LIMIT 1`).all()[0] ?? null;
|
|
240
|
+
if (frontier && !Number.isSafeInteger(frontier.rowid))
|
|
241
|
+
throw new Error(`marker ${table} frontier rowid is not a safe integer`);
|
|
242
|
+
return frontier;
|
|
243
|
+
}
|
|
244
|
+
var MARKER_FRONTIER_CANDIDATES = 3;
|
|
245
|
+
function readMarkerFrontiers2(db, table, count = MARKER_FRONTIER_CANDIDATES) {
|
|
246
|
+
const frontiers = db.prepare(`SELECT rowid,id FROM ${table} ORDER BY rowid DESC LIMIT ?`).all(count);
|
|
247
|
+
if (frontiers.some((frontier) => !Number.isSafeInteger(frontier.rowid)))
|
|
248
|
+
throw new Error(`marker ${table} frontier rowid is not a safe integer`);
|
|
249
|
+
return frontiers;
|
|
250
|
+
}
|
|
251
|
+
var MARKER_REFERENCE_FRONTIER_SQL = (table) => `SELECT rowid FROM ${table} WHERE id = ?`;
|
|
252
|
+
function certifiedMarkerReferenceFloor2(db, table, frontiers) {
|
|
253
|
+
if (frontiers.length === 0)
|
|
254
|
+
return 0;
|
|
255
|
+
const probe = db.prepare(MARKER_REFERENCE_FRONTIER_SQL(table));
|
|
256
|
+
for (const frontier of [...frontiers].sort((a, b) => b.rowid - a.rowid)) {
|
|
257
|
+
const current = probe.all(frontier.id);
|
|
258
|
+
if (current[0]?.rowid === frontier.rowid)
|
|
259
|
+
return frontier.rowid;
|
|
260
|
+
}
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
var MARKER_TAIL_REFERENCE_COLUMNS = `id,
|
|
264
|
+
CASE WHEN data LIKE '%tail_start_id%' THEN json_extract(data, '$.tail_start_id') END AS direct,
|
|
265
|
+
CASE WHEN data LIKE '%tail_start_id%' THEN json_extract(data, '$.compaction.tail_start_id') END AS nested`;
|
|
266
|
+
function readMarkerReferenceRows2(db, sessionId, table, afterRowid) {
|
|
267
|
+
return db.prepare(`SELECT ${MARKER_TAIL_REFERENCE_COLUMNS} FROM ${table}
|
|
268
|
+
WHERE ${afterRowid === undefined ? "session_id = ?" : "rowid > ? AND +session_id = ?"}
|
|
269
|
+
AND ${table === "part" ? "data LIKE '%compaction%' AND json_valid(data) AND json_extract(data, '$.type') = 'compaction'" : "(data LIKE '%compaction%' OR data LIKE '%tail_start_id%') AND json_valid(data) AND (json_type(data, '$.compaction') IS NOT NULL OR json_type(data, '$.tail_start_id') IS NOT NULL)"}`).all(...afterRowid === undefined ? [sessionId] : [afterRowid, sessionId]);
|
|
270
|
+
}
|
|
271
|
+
function readKnownMarkerReferenceRows2(db, sessionId, table, ids) {
|
|
272
|
+
const byId = db.prepare(`SELECT ${MARKER_TAIL_REFERENCE_COLUMNS} FROM ${table} WHERE id = ? AND session_id = ?`);
|
|
273
|
+
return ids.flatMap((id) => byId.all(id, sessionId));
|
|
274
|
+
}
|
|
223
275
|
|
|
224
|
-
export { isMarkerCandidateBasisCurrent2, invalidateMarkerCandidateBasis2, readMarkerCandidateBasis2, prepareMarkerCandidateBasis2, scanMarkerCandidateSnapshot2 };
|
|
276
|
+
export { isMarkerCandidateBasisCurrent2, invalidateMarkerCandidateBasis2, discardMarkerCandidateBasis2, readMarkerCandidateBasis2, prepareMarkerCandidateBasis2, scanMarkerCandidateSnapshot2, readMarkerFrontiers2, certifiedMarkerReferenceFloor2, readMarkerReferenceRows2, readKnownMarkerReferenceRows2 };
|