@cortexkit/pi-magic-context 0.49.35 → 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/dist/auto-search-worker.js +163 -160
- package/dist/chunk-embedding-write-worker.js +59 -57
- package/dist/{compaction-marker-candidates-hk2frhac.js → compaction-marker-candidates-9fzqg6y0.js} +4 -2
- package/dist/compaction-marker-candidates-worker.js +24 -23
- package/dist/{compartment-chunk-embedding-5j1d1e3v.js → compartment-chunk-embedding-jpcme6tz.js} +6 -5
- package/dist/{embedding-backfill-jt459ady.js → embedding-backfill-002vyexq.js} +8 -7
- package/dist/{index-399p688g.js → index-8sqebjzk.js} +4 -1
- package/dist/{index-11knwv2h.js → index-a7sj2bam.js} +6 -3
- package/dist/{index-mkh1cm5k.js → index-c1dqxr10.js} +34 -4
- package/dist/{index-rgvqh5x7.js → index-ck8wj35v.js} +1 -1
- package/dist/{index-fzm8fm4z.js → index-dgqjq8sg.js} +143 -64
- package/dist/{index-yg42q9bc.js → index-f6y7mdq9.js} +8 -7
- package/dist/{index-2p691ayw.js → index-f9qet7y8.js} +1 -1
- package/dist/{index-6y6v2wvn.js → index-gxqmh9hq.js} +6 -6
- package/dist/{index-vgfk2xa5.js → index-jbkwszd5.js} +1 -1
- package/dist/{index-8m82cez2.js → index-kj49vs41.js} +2 -2
- package/dist/{index-svqk0701.js → index-mx757f3g.js} +13 -5
- package/dist/index-nypgv96r.js +58 -0
- package/dist/{index-d21rhpbd.js → index-p9jfa33t.js} +5 -5
- package/dist/{index-yhsmjvqa.js → index-pwp6zyx3.js} +12 -1
- package/dist/{index-m68qfjte.js → index-ry84c8dr.js} +1 -1
- package/dist/index-wfqysrwq.js +204 -0
- package/dist/{index-0rvn6vhq.js → index-wwsfevck.js} +6 -3
- package/dist/{index-54wmg4rj.js → index-x2n261wp.js} +16 -14
- package/dist/{index-d0w84hy5.js → index-y90fxz4t.js} +9 -3
- package/dist/{index-a11nmw5t.js → index-z7dktknj.js} +6 -4
- package/dist/index.js +846 -305
- package/dist/{message-fts-rowid-map-aw4xa05a.js → message-fts-rowid-map-hmgyfxxa.js} +5 -4
- package/dist/{message-index-bounded-da34vhs4.js → message-index-bounded-82sergz7.js} +8 -7
- package/dist/migration-worker.js +46 -41
- package/dist/{project-embedding-registry-davzvsz9.js → project-embedding-registry-16pj4vyf.js} +7 -6
- package/dist/raw-ordinal-warmup-worker.js +114 -118
- package/dist/{read-session-chunk-nbcznexm.js → read-session-chunk-jxq427v6.js} +6 -5
- package/dist/{read-session-raw-zb8kpa2y.js → read-session-raw-a9ntjqap.js} +4 -3
- package/dist/{render-d931g2vv.js → render-2wan3bfh.js} +11 -10
- package/dist/{search-atp7g95j.js → search-3p18trsb.js} +12 -11
- package/dist/{search-archive-a76pp30g.js → search-archive-pgrv04gv.js} +8 -7
- package/dist/{storage-tags-jy8b0xsy.js → storage-tags-p9y3bnw7.js} +1 -1
- package/dist/{store-kabezr25.js → store-v60q7dje.js} +1 -2
- package/dist/subagent-entry.js +18 -17
- package/dist/tag-snapshot-worker-pi.js +208 -202
- package/dist/{v2-archive-reader-wcjcfdzq.js → v2-archive-reader-5zpj8hrg.js} +3 -3
- package/package.json +1 -1
|
@@ -5,15 +5,16 @@ import {
|
|
|
5
5
|
startMessageFtsRowidMapBackfill2,
|
|
6
6
|
messageFtsOrdinalRangeIsMapped2,
|
|
7
7
|
deleteUnmappedMessageFtsRows2
|
|
8
|
-
} from "./index-
|
|
9
|
-
import"./index-
|
|
10
|
-
import"./index-
|
|
8
|
+
} from "./index-ck8wj35v.js";
|
|
9
|
+
import"./index-c1dqxr10.js";
|
|
10
|
+
import"./index-wfqysrwq.js";
|
|
11
|
+
import"./index-8sqebjzk.js";
|
|
11
12
|
import"./index-0wtm7g7f.js";
|
|
12
13
|
import"./index-2qtx0q6h.js";
|
|
13
14
|
import"./index-gymgz20n.js";
|
|
14
15
|
import"./index-0h2mkab2.js";
|
|
15
16
|
import"./index-dnp1jjar.js";
|
|
16
|
-
import"./index-
|
|
17
|
+
import"./index-x2n261wp.js";
|
|
17
18
|
export {
|
|
18
19
|
deleteUnmappedMessageFtsRows2 as deleteUnmappedMessageFtsRows,
|
|
19
20
|
messageFtsOrdinalRangeIsMapped2 as messageFtsOrdinalRangeIsMapped,
|
|
@@ -3,18 +3,19 @@ import {
|
|
|
3
3
|
withIndexChunk2,
|
|
4
4
|
yieldIndexChunk2
|
|
5
5
|
} from "./index-2qtx0q6h.js";
|
|
6
|
-
import"./index-
|
|
6
|
+
import"./index-pwp6zyx3.js";
|
|
7
7
|
import"./index-wt7vmyj4.js";
|
|
8
8
|
import"./index-0h2mkab2.js";
|
|
9
9
|
import"./index-gymgz20n.js";
|
|
10
10
|
import"./index-dnp1jjar.js";
|
|
11
11
|
import"./index-yacs388s.js";
|
|
12
12
|
import"./index-ccanzg8p.js";
|
|
13
|
-
import"./index-
|
|
14
|
-
import"./index-
|
|
15
|
-
import"./index-
|
|
13
|
+
import"./index-8sqebjzk.js";
|
|
14
|
+
import"./index-wfqysrwq.js";
|
|
15
|
+
import"./index-x2n261wp.js";
|
|
16
|
+
import"./index-c1dqxr10.js";
|
|
16
17
|
import"./index-n0zjvs3h.js";
|
|
17
|
-
import"./index-
|
|
18
|
+
import"./index-mx757f3g.js";
|
|
18
19
|
import"./index-6x556c2q.js";
|
|
19
20
|
import"./index-c6wbq66z.js";
|
|
20
21
|
import {
|
|
@@ -24,8 +25,8 @@ import {
|
|
|
24
25
|
markMessageIndexDirty,
|
|
25
26
|
getIndexableContent,
|
|
26
27
|
indexSingleMessage
|
|
27
|
-
} from "./index-
|
|
28
|
-
import"./index-
|
|
28
|
+
} from "./index-kj49vs41.js";
|
|
29
|
+
import"./index-ck8wj35v.js";
|
|
29
30
|
import"./index-0wtm7g7f.js";
|
|
30
31
|
|
|
31
32
|
// ../plugin/src/features/magic-context/message-index-bounded.ts
|
package/dist/migration-worker.js
CHANGED
|
@@ -17,55 +17,60 @@ import"./index-6pk49fc3.js";
|
|
|
17
17
|
import {
|
|
18
18
|
setSqlitePragmaConfig,
|
|
19
19
|
initializeDatabase
|
|
20
|
-
} from "./index-
|
|
20
|
+
} from "./index-a7sj2bam.js";
|
|
21
21
|
import"./index-fapenpch.js";
|
|
22
22
|
import"./index-3bb24eb6.js";
|
|
23
|
-
import"./index-
|
|
24
|
-
import"./index-
|
|
25
|
-
import"./index-
|
|
26
|
-
import"./index-
|
|
23
|
+
import"./index-8sqebjzk.js";
|
|
24
|
+
import"./index-wfqysrwq.js";
|
|
25
|
+
import"./index-x2n261wp.js";
|
|
26
|
+
import"./index-c1dqxr10.js";
|
|
27
|
+
import"./index-ck8wj35v.js";
|
|
27
28
|
import"./index-wt7vmyj4.js";
|
|
28
29
|
import"./index-c6wbq66z.js";
|
|
29
30
|
import {
|
|
30
31
|
closeQuietly
|
|
31
32
|
} from "./index-nrzkqte4.js";
|
|
32
33
|
import"./index-0wtm7g7f.js";
|
|
34
|
+
import {
|
|
35
|
+
serveWorkerJobs
|
|
36
|
+
} from "./index-nypgv96r.js";
|
|
33
37
|
|
|
34
38
|
// ../plugin/src/features/magic-context/migration-worker.ts
|
|
35
|
-
|
|
36
|
-
function post(message) {
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
async function main() {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
39
|
+
serveWorkerJobs(async (data, port) => {
|
|
40
|
+
function post(message) {
|
|
41
|
+
port.postMessage(message);
|
|
42
|
+
}
|
|
43
|
+
async function main() {
|
|
44
|
+
setLogLineForwarder2((line) => post({ type: "log", line }));
|
|
45
|
+
setSqlitePragmaConfig(data.sqlitePragmaConfig);
|
|
46
|
+
post({ type: "ready" });
|
|
47
|
+
let db;
|
|
48
|
+
try {
|
|
49
|
+
db = new Database2(data.dbPath);
|
|
50
|
+
initializeDatabase(db, data.busyTimeoutMs);
|
|
51
|
+
await runMigrationsWithRetry(db, {
|
|
52
|
+
sleep: async (delayMs) => {
|
|
53
|
+
post({ type: "lock-wait", waiting: true });
|
|
54
|
+
await new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
55
|
+
post({ type: "lock-wait", waiting: false });
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
const finished = db;
|
|
59
|
+
db = undefined;
|
|
60
|
+
finished.close();
|
|
61
|
+
log2(`[migrations] migration worker connection closed: ${data.dbPath}`);
|
|
62
|
+
post({ type: "done" });
|
|
63
|
+
} catch (error) {
|
|
64
|
+
post({
|
|
65
|
+
type: "failed",
|
|
66
|
+
message: error instanceof Error ? error.message : String(error)
|
|
67
|
+
});
|
|
68
|
+
} finally {
|
|
69
|
+
if (db)
|
|
70
|
+
closeQuietly(db);
|
|
71
|
+
setLogLineForwarder2(null);
|
|
72
|
+
}
|
|
69
73
|
}
|
|
70
|
-
|
|
71
|
-
|
|
74
|
+
await main();
|
|
75
|
+
port.close();
|
|
76
|
+
});
|
package/dist/{project-embedding-registry-davzvsz9.js → project-embedding-registry-16pj4vyf.js}
RENAMED
|
@@ -33,26 +33,27 @@ import {
|
|
|
33
33
|
sweepAllRegisteredProjects2,
|
|
34
34
|
_setTestProviderFactoryForProject2,
|
|
35
35
|
_resetProjectEmbeddingRegistryForTests2
|
|
36
|
-
} from "./index-
|
|
36
|
+
} from "./index-z7dktknj.js";
|
|
37
37
|
import"./index-9p40dgkm.js";
|
|
38
38
|
import"./index-hgd00nas.js";
|
|
39
39
|
import"./index-yhzhdp3m.js";
|
|
40
40
|
import"./index-mp0gh04g.js";
|
|
41
|
-
import"./index-
|
|
41
|
+
import"./index-f9qet7y8.js";
|
|
42
42
|
import"./index-2qqsnh1b.js";
|
|
43
43
|
import"./index-rzfr7wdv.js";
|
|
44
44
|
import"./index-ccanzg8p.js";
|
|
45
45
|
import"./index-6pk49fc3.js";
|
|
46
|
-
import"./index-
|
|
47
|
-
import"./index-
|
|
48
|
-
import"./index-
|
|
46
|
+
import"./index-ck8wj35v.js";
|
|
47
|
+
import"./index-c1dqxr10.js";
|
|
48
|
+
import"./index-wfqysrwq.js";
|
|
49
|
+
import"./index-8sqebjzk.js";
|
|
49
50
|
import"./index-0wtm7g7f.js";
|
|
50
51
|
import"./index-wt7vmyj4.js";
|
|
51
52
|
import"./index-2qtx0q6h.js";
|
|
52
53
|
import"./index-gymgz20n.js";
|
|
53
54
|
import"./index-0h2mkab2.js";
|
|
54
55
|
import"./index-dnp1jjar.js";
|
|
55
|
-
import"./index-
|
|
56
|
+
import"./index-x2n261wp.js";
|
|
56
57
|
export {
|
|
57
58
|
_resetProjectEmbeddingRegistryForTests2 as _resetProjectEmbeddingRegistryForTests,
|
|
58
59
|
_setTestProviderFactoryForProject2 as _setTestProviderFactoryForProject,
|
|
@@ -1,131 +1,127 @@
|
|
|
1
1
|
import {
|
|
2
2
|
exitOnWorkerClose
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-x2n261wp.js";
|
|
4
|
+
import {
|
|
5
|
+
serveWorkerJobs
|
|
6
|
+
} from "./index-nypgv96r.js";
|
|
4
7
|
|
|
5
8
|
// ../plugin/src/hooks/magic-context/raw-ordinal-warmup-worker.ts
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
try {
|
|
16
|
-
connection.close();
|
|
17
|
-
} catch {}
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
main().catch((error) => {
|
|
21
|
-
setTimeout(() => {
|
|
22
|
-
throw error;
|
|
9
|
+
serveWorkerJobs(async (input, port) => {
|
|
10
|
+
port.postMessage({ kind: "accepted" });
|
|
11
|
+
const openConnections = new Set;
|
|
12
|
+
const { closePort } = exitOnWorkerClose(port, () => {
|
|
13
|
+
for (const connection of openConnections) {
|
|
14
|
+
try {
|
|
15
|
+
connection.close();
|
|
16
|
+
} catch {}
|
|
17
|
+
}
|
|
23
18
|
});
|
|
24
|
-
|
|
25
|
-
async function main() {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
const [
|
|
32
|
-
{ Database, registerSqliteDiagnosticSink },
|
|
33
|
-
{ readRawSessionMessageIdsAtOrdinalsFromDb, scanRawSessionSummaryRows },
|
|
34
|
-
{ getHarness, setHarness },
|
|
35
|
-
{ log }
|
|
36
|
-
] = await Promise.all([
|
|
37
|
-
import("./sqlite-v89bj0yy.js"),
|
|
38
|
-
import("./read-session-raw-zb8kpa2y.js"),
|
|
39
|
-
import("./harness-9872e0ym.js"),
|
|
40
|
-
import("./logger-2j70hhz4.js")
|
|
41
|
-
]);
|
|
42
|
-
setHarness(input.harness ?? "opencode");
|
|
43
|
-
registerSqliteDiagnosticSink(log, getHarness);
|
|
44
|
-
let db;
|
|
45
|
-
let reply;
|
|
46
|
-
try {
|
|
47
|
-
if (input.openCancellation && Atomics.load(new Int32Array(input.openCancellation), 0) !== 0) {
|
|
48
|
-
throw new Error("warm-up owner closed before database open");
|
|
19
|
+
await main();
|
|
20
|
+
async function main() {
|
|
21
|
+
if (input.v2ArchiveReader) {
|
|
22
|
+
const { serveV2ArchiveReads } = await import("./v2-archive-reader-5zpj8hrg.js");
|
|
23
|
+
await serveV2ArchiveReads(port, openConnections);
|
|
24
|
+
return;
|
|
49
25
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
26
|
+
const [
|
|
27
|
+
{ Database, registerSqliteDiagnosticSink },
|
|
28
|
+
{ readRawSessionMessageIdsAtOrdinalsFromDb, scanRawSessionSummaryRows },
|
|
29
|
+
{ getHarness, setHarness },
|
|
30
|
+
{ log }
|
|
31
|
+
] = await Promise.all([
|
|
32
|
+
import("./sqlite-v89bj0yy.js"),
|
|
33
|
+
import("./read-session-raw-a9ntjqap.js"),
|
|
34
|
+
import("./harness-9872e0ym.js"),
|
|
35
|
+
import("./logger-2j70hhz4.js")
|
|
36
|
+
]);
|
|
37
|
+
setHarness(input.harness ?? "opencode");
|
|
38
|
+
registerSqliteDiagnosticSink(log, getHarness);
|
|
39
|
+
let db;
|
|
40
|
+
let reply;
|
|
41
|
+
try {
|
|
42
|
+
if (input.openCancellation && Atomics.load(new Int32Array(input.openCancellation), 0) !== 0) {
|
|
43
|
+
throw new Error("warm-up owner closed before database open");
|
|
44
|
+
}
|
|
45
|
+
db = input.indexMessage || input.ftsRowidBackfill ? new Database(input.path) : new Database(input.path, { readonly: true });
|
|
46
|
+
openConnections.add(db);
|
|
47
|
+
db.exec("PRAGMA busy_timeout = 250");
|
|
48
|
+
if (input.ftsRowidBackfill) {
|
|
49
|
+
const { runMessageFtsRowidMapBackfill } = await import("./message-fts-rowid-map-hmgyfxxa.js");
|
|
50
|
+
db.exec("PRAGMA busy_timeout = 0");
|
|
51
|
+
await runMessageFtsRowidMapBackfill(db);
|
|
52
|
+
reply = { kind: "fts-rowid-backfill" };
|
|
53
|
+
} else if (input.searchArchive) {
|
|
54
|
+
const { renderSearchArchive } = await import("./search-archive-pgrv04gv.js");
|
|
55
|
+
const { readRawSessionMessageIdOrdinalsForRangeFromDb } = await import("./read-session-raw-a9ntjqap.js");
|
|
56
|
+
const archive = input.searchArchive;
|
|
57
|
+
let raw;
|
|
58
|
+
try {
|
|
59
|
+
reply = {
|
|
60
|
+
kind: "search-archive",
|
|
61
|
+
text: renderSearchArchive(db, input.sessionId, archive.start, archive.end, archive.tokenBudget, archive.archiveOnly, () => {
|
|
62
|
+
if (!archive.rawPath)
|
|
63
|
+
return new Map(archive.rawIds);
|
|
64
|
+
raw = new Database(archive.rawPath, { readonly: true });
|
|
65
|
+
openConnections.add(raw);
|
|
66
|
+
raw.exec("PRAGMA busy_timeout = 250");
|
|
67
|
+
return readRawSessionMessageIdOrdinalsForRangeFromDb(raw, input.sessionId, archive.start, archive.end);
|
|
68
|
+
})
|
|
69
|
+
};
|
|
70
|
+
} finally {
|
|
71
|
+
if (raw)
|
|
72
|
+
openConnections.delete(raw);
|
|
73
|
+
raw?.close();
|
|
74
|
+
}
|
|
75
|
+
} else if (input.exactOrdinalIds) {
|
|
64
76
|
reply = {
|
|
65
|
-
kind: "
|
|
66
|
-
|
|
67
|
-
if (!archive.rawPath)
|
|
68
|
-
return new Map(archive.rawIds);
|
|
69
|
-
raw = new Database(archive.rawPath, { readonly: true });
|
|
70
|
-
openConnections.add(raw);
|
|
71
|
-
raw.exec("PRAGMA busy_timeout = 250");
|
|
72
|
-
return readRawSessionMessageIdOrdinalsForRangeFromDb(raw, input.sessionId, archive.start, archive.end);
|
|
73
|
-
})
|
|
77
|
+
kind: "exact-ordinal-ids",
|
|
78
|
+
ids: readRawSessionMessageIdsAtOrdinalsFromDb(db, input.sessionId, input.exactOrdinalIds)
|
|
74
79
|
};
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
80
|
+
} else if (input.indexMessage) {
|
|
81
|
+
const { setHarness } = await import("./harness-9872e0ym.js");
|
|
82
|
+
setHarness(input.harness ?? "opencode");
|
|
83
|
+
const [{ indexMessageInShortChunks }, { configureContextDatabasePragmas }] = await Promise.all([
|
|
84
|
+
import("./message-index-bounded-82sergz7.js"),
|
|
85
|
+
import("./sqlite-context-pragmas-gcgch6qz.js")
|
|
86
|
+
]);
|
|
87
|
+
configureContextDatabasePragmas(db);
|
|
88
|
+
const writer = db;
|
|
89
|
+
const message = input.indexMessage;
|
|
90
|
+
const cancellation = input.indexCancellation ? new Int32Array(input.indexCancellation) : undefined;
|
|
91
|
+
const result = await indexMessageInShortChunks(writer, input.sessionId, message, input, () => !cancellation || Atomics.load(cancellation, 0) === 0);
|
|
92
|
+
reply = {
|
|
93
|
+
kind: "indexed",
|
|
94
|
+
inserted: result.inserted,
|
|
95
|
+
measurements: result.measurements
|
|
96
|
+
};
|
|
97
|
+
} else if (input.tagRatio !== undefined) {
|
|
98
|
+
const { scanTagOwnerSummary, scanTagOwnerDelta } = await import("./storage-tags-p9y3bnw7.js");
|
|
99
|
+
const delta = input.tagState ? scanTagOwnerDelta(db, input.sessionId, input.tagState) : null;
|
|
100
|
+
if (delta)
|
|
101
|
+
reply = { kind: "tag-delta", delta };
|
|
102
|
+
else
|
|
103
|
+
reply = {
|
|
104
|
+
kind: "tag-summary",
|
|
105
|
+
summary: scanTagOwnerSummary(db, input.sessionId, input.tagRatio, input.tagRatios)
|
|
106
|
+
};
|
|
107
|
+
} else {
|
|
108
|
+
const scan = scanRawSessionSummaryRows(db, input.sessionId, input.previous);
|
|
109
|
+
reply = { kind: "scan", scan };
|
|
79
110
|
}
|
|
80
|
-
}
|
|
111
|
+
} catch (error) {
|
|
112
|
+
const sqliteError = error;
|
|
81
113
|
reply = {
|
|
82
|
-
kind: "
|
|
83
|
-
|
|
114
|
+
kind: "error",
|
|
115
|
+
error: error instanceof Error ? error.stack ?? error.message : String(error),
|
|
116
|
+
code: typeof sqliteError?.code === "string" ? sqliteError.code : undefined,
|
|
117
|
+
errcode: typeof sqliteError?.errcode === "number" ? sqliteError.errcode : undefined
|
|
84
118
|
};
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
import("./message-index-bounded-da34vhs4.js"),
|
|
90
|
-
import("./sqlite-context-pragmas-gcgch6qz.js")
|
|
91
|
-
]);
|
|
92
|
-
configureContextDatabasePragmas(db);
|
|
93
|
-
const writer = db;
|
|
94
|
-
const message = input.indexMessage;
|
|
95
|
-
const cancellation = input.indexCancellation ? new Int32Array(input.indexCancellation) : undefined;
|
|
96
|
-
const result = await indexMessageInShortChunks(writer, input.sessionId, message, input, () => !cancellation || Atomics.load(cancellation, 0) === 0);
|
|
97
|
-
reply = {
|
|
98
|
-
kind: "indexed",
|
|
99
|
-
inserted: result.inserted,
|
|
100
|
-
measurements: result.measurements
|
|
101
|
-
};
|
|
102
|
-
} else if (input.tagRatio !== undefined) {
|
|
103
|
-
const { scanTagOwnerSummary, scanTagOwnerDelta } = await import("./storage-tags-jy8b0xsy.js");
|
|
104
|
-
const delta = input.tagState ? scanTagOwnerDelta(db, input.sessionId, input.tagState) : null;
|
|
105
|
-
if (delta)
|
|
106
|
-
reply = { kind: "tag-delta", delta };
|
|
107
|
-
else
|
|
108
|
-
reply = {
|
|
109
|
-
kind: "tag-summary",
|
|
110
|
-
summary: scanTagOwnerSummary(db, input.sessionId, input.tagRatio, input.tagRatios)
|
|
111
|
-
};
|
|
112
|
-
} else {
|
|
113
|
-
const scan = scanRawSessionSummaryRows(db, input.sessionId, input.previous);
|
|
114
|
-
reply = { kind: "scan", scan };
|
|
119
|
+
} finally {
|
|
120
|
+
if (db)
|
|
121
|
+
openConnections.delete(db);
|
|
122
|
+
db?.close();
|
|
115
123
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
reply = {
|
|
119
|
-
kind: "error",
|
|
120
|
-
error: error instanceof Error ? error.stack ?? error.message : String(error),
|
|
121
|
-
code: typeof sqliteError?.code === "string" ? sqliteError.code : undefined,
|
|
122
|
-
errcode: typeof sqliteError?.errcode === "number" ? sqliteError.errcode : undefined
|
|
123
|
-
};
|
|
124
|
-
} finally {
|
|
125
|
-
if (db)
|
|
126
|
-
openConnections.delete(db);
|
|
127
|
-
db?.close();
|
|
124
|
+
port.postMessage(reply);
|
|
125
|
+
closePort();
|
|
128
126
|
}
|
|
129
|
-
|
|
130
|
-
closePort();
|
|
131
|
-
}
|
|
127
|
+
});
|
|
@@ -38,14 +38,15 @@ import {
|
|
|
38
38
|
readSessionChunk2,
|
|
39
39
|
getRawSessionMessageIdsThrough2,
|
|
40
40
|
readRawSessionSeedTail2
|
|
41
|
-
} from "./index-
|
|
42
|
-
import"./index-
|
|
41
|
+
} from "./index-mx757f3g.js";
|
|
42
|
+
import"./index-pwp6zyx3.js";
|
|
43
43
|
import"./index-6x556c2q.js";
|
|
44
44
|
import"./index-ccanzg8p.js";
|
|
45
45
|
import"./index-c6wbq66z.js";
|
|
46
46
|
import"./index-yacs388s.js";
|
|
47
|
-
import"./index-
|
|
48
|
-
import"./index-
|
|
47
|
+
import"./index-c1dqxr10.js";
|
|
48
|
+
import"./index-wfqysrwq.js";
|
|
49
|
+
import"./index-8sqebjzk.js";
|
|
49
50
|
import"./index-n0zjvs3h.js";
|
|
50
51
|
import"./index-0wtm7g7f.js";
|
|
51
52
|
import {
|
|
@@ -56,7 +57,7 @@ import"./index-2qtx0q6h.js";
|
|
|
56
57
|
import"./index-gymgz20n.js";
|
|
57
58
|
import"./index-0h2mkab2.js";
|
|
58
59
|
import"./index-dnp1jjar.js";
|
|
59
|
-
import"./index-
|
|
60
|
+
import"./index-x2n261wp.js";
|
|
60
61
|
export {
|
|
61
62
|
RAW_MESSAGE_VISIT_PAGE_SIZE2 as RAW_MESSAGE_VISIT_PAGE_SIZE,
|
|
62
63
|
RAW_SESSION_TAG_KEY_PAGE_SIZE2 as RAW_SESSION_TAG_KEY_PAGE_SIZE,
|
|
@@ -28,13 +28,14 @@ import {
|
|
|
28
28
|
hasRawSessionMessageByIdFromDb2,
|
|
29
29
|
readRawSeedTailFromDb2,
|
|
30
30
|
readRawSessionBoundaryEndpointsFromDb2
|
|
31
|
-
} from "./index-
|
|
32
|
-
import"./index-
|
|
31
|
+
} from "./index-c1dqxr10.js";
|
|
32
|
+
import"./index-wfqysrwq.js";
|
|
33
|
+
import"./index-8sqebjzk.js";
|
|
33
34
|
import"./index-2qtx0q6h.js";
|
|
34
35
|
import"./index-gymgz20n.js";
|
|
35
36
|
import"./index-0h2mkab2.js";
|
|
36
37
|
import"./index-dnp1jjar.js";
|
|
37
|
-
import"./index-
|
|
38
|
+
import"./index-x2n261wp.js";
|
|
38
39
|
export {
|
|
39
40
|
RAW_SUMMARY_TEXT_MAX_CHARS2 as RAW_SUMMARY_TEXT_MAX_CHARS,
|
|
40
41
|
RawOrdinalsNotReady2 as RawOrdinalsNotReady,
|
|
@@ -3,28 +3,29 @@ import {
|
|
|
3
3
|
renderVerboseRange2,
|
|
4
4
|
renderVerboseRangeForTool2,
|
|
5
5
|
renderItemByTag2
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-p9jfa33t.js";
|
|
7
7
|
import"./index-w26zvs1q.js";
|
|
8
|
-
import"./index-
|
|
8
|
+
import"./index-kj49vs41.js";
|
|
9
9
|
import"./index-hgd00nas.js";
|
|
10
10
|
import"./index-ea37qn4x.js";
|
|
11
|
-
import"./index-
|
|
12
|
-
import"./index-
|
|
13
|
-
import"./index-
|
|
11
|
+
import"./index-f9qet7y8.js";
|
|
12
|
+
import"./index-mx757f3g.js";
|
|
13
|
+
import"./index-pwp6zyx3.js";
|
|
14
14
|
import"./index-6x556c2q.js";
|
|
15
15
|
import"./index-rzfr7wdv.js";
|
|
16
16
|
import"./index-ccanzg8p.js";
|
|
17
|
-
import"./index-
|
|
17
|
+
import"./index-a7sj2bam.js";
|
|
18
18
|
import"./index-fapenpch.js";
|
|
19
19
|
import"./index-d107f484.js";
|
|
20
20
|
import"./index-135e8hvg.js";
|
|
21
21
|
import"./index-6pk49fc3.js";
|
|
22
|
-
import"./index-
|
|
22
|
+
import"./index-ck8wj35v.js";
|
|
23
23
|
import"./index-3bb24eb6.js";
|
|
24
24
|
import"./index-c6wbq66z.js";
|
|
25
25
|
import"./index-yacs388s.js";
|
|
26
|
-
import"./index-
|
|
27
|
-
import"./index-
|
|
26
|
+
import"./index-c1dqxr10.js";
|
|
27
|
+
import"./index-wfqysrwq.js";
|
|
28
|
+
import"./index-8sqebjzk.js";
|
|
28
29
|
import"./index-n0zjvs3h.js";
|
|
29
30
|
import"./index-0wtm7g7f.js";
|
|
30
31
|
import"./index-wt7vmyj4.js";
|
|
@@ -32,7 +33,7 @@ import"./index-2qtx0q6h.js";
|
|
|
32
33
|
import"./index-gymgz20n.js";
|
|
33
34
|
import"./index-0h2mkab2.js";
|
|
34
35
|
import"./index-dnp1jjar.js";
|
|
35
|
-
import"./index-
|
|
36
|
+
import"./index-x2n261wp.js";
|
|
36
37
|
export {
|
|
37
38
|
renderItemByTag2 as renderItemByTag,
|
|
38
39
|
renderMessageByOrdinal2 as renderMessageByOrdinal,
|
|
@@ -5,20 +5,20 @@ import {
|
|
|
5
5
|
resolveMemoriesByIdsForSearch2,
|
|
6
6
|
unifiedSearch2,
|
|
7
7
|
formatSearchResults2
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-f6y7mdq9.js";
|
|
9
9
|
import"./index-w26zvs1q.js";
|
|
10
|
-
import"./index-
|
|
10
|
+
import"./index-kj49vs41.js";
|
|
11
11
|
import"./index-1cvyaw9a.js";
|
|
12
|
-
import"./index-
|
|
12
|
+
import"./index-jbkwszd5.js";
|
|
13
13
|
import"./index-29nw7n1r.js";
|
|
14
|
-
import"./index-
|
|
14
|
+
import"./index-z7dktknj.js";
|
|
15
15
|
import"./index-9p40dgkm.js";
|
|
16
16
|
import"./index-hgd00nas.js";
|
|
17
17
|
import"./index-yhzhdp3m.js";
|
|
18
18
|
import"./index-mp0gh04g.js";
|
|
19
|
-
import"./index-
|
|
20
|
-
import"./index-
|
|
21
|
-
import"./index-
|
|
19
|
+
import"./index-f9qet7y8.js";
|
|
20
|
+
import"./index-mx757f3g.js";
|
|
21
|
+
import"./index-pwp6zyx3.js";
|
|
22
22
|
import"./index-6x556c2q.js";
|
|
23
23
|
import"./index-2qqsnh1b.js";
|
|
24
24
|
import"./index-rzfr7wdv.js";
|
|
@@ -26,11 +26,12 @@ import"./index-ccanzg8p.js";
|
|
|
26
26
|
import"./index-d107f484.js";
|
|
27
27
|
import"./index-135e8hvg.js";
|
|
28
28
|
import"./index-6pk49fc3.js";
|
|
29
|
-
import"./index-
|
|
29
|
+
import"./index-ck8wj35v.js";
|
|
30
30
|
import"./index-c6wbq66z.js";
|
|
31
31
|
import"./index-yacs388s.js";
|
|
32
|
-
import"./index-
|
|
33
|
-
import"./index-
|
|
32
|
+
import"./index-c1dqxr10.js";
|
|
33
|
+
import"./index-wfqysrwq.js";
|
|
34
|
+
import"./index-8sqebjzk.js";
|
|
34
35
|
import"./index-n0zjvs3h.js";
|
|
35
36
|
import"./index-0wtm7g7f.js";
|
|
36
37
|
import"./index-wt7vmyj4.js";
|
|
@@ -38,7 +39,7 @@ import"./index-2qtx0q6h.js";
|
|
|
38
39
|
import"./index-gymgz20n.js";
|
|
39
40
|
import"./index-0h2mkab2.js";
|
|
40
41
|
import"./index-dnp1jjar.js";
|
|
41
|
-
import"./index-
|
|
42
|
+
import"./index-x2n261wp.js";
|
|
42
43
|
export {
|
|
43
44
|
createUnifiedSearchDiagnostics2 as createUnifiedSearchDiagnostics,
|
|
44
45
|
formatSearchResults2 as formatSearchResults,
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
renderSearchArchive2
|
|
3
|
-
} from "./index-
|
|
4
|
-
import"./index-
|
|
3
|
+
} from "./index-ry84c8dr.js";
|
|
4
|
+
import"./index-gxqmh9hq.js";
|
|
5
5
|
import"./index-1cvyaw9a.js";
|
|
6
|
-
import"./index-
|
|
7
|
-
import"./index-
|
|
6
|
+
import"./index-mx757f3g.js";
|
|
7
|
+
import"./index-pwp6zyx3.js";
|
|
8
8
|
import"./index-6x556c2q.js";
|
|
9
9
|
import"./index-ccanzg8p.js";
|
|
10
10
|
import"./index-c6wbq66z.js";
|
|
11
11
|
import"./index-yacs388s.js";
|
|
12
|
-
import"./index-
|
|
13
|
-
import"./index-
|
|
12
|
+
import"./index-c1dqxr10.js";
|
|
13
|
+
import"./index-wfqysrwq.js";
|
|
14
|
+
import"./index-8sqebjzk.js";
|
|
14
15
|
import"./index-n0zjvs3h.js";
|
|
15
16
|
import"./index-0wtm7g7f.js";
|
|
16
17
|
import"./index-wt7vmyj4.js";
|
|
@@ -18,7 +19,7 @@ import"./index-2qtx0q6h.js";
|
|
|
18
19
|
import"./index-gymgz20n.js";
|
|
19
20
|
import"./index-0h2mkab2.js";
|
|
20
21
|
import"./index-dnp1jjar.js";
|
|
21
|
-
import"./index-
|
|
22
|
+
import"./index-x2n261wp.js";
|
|
22
23
|
export {
|
|
23
24
|
renderSearchArchive2 as renderSearchArchive
|
|
24
25
|
};
|
|
@@ -205,8 +205,7 @@ ${data.output?.output ?? ""}`
|
|
|
205
205
|
name: part.name,
|
|
206
206
|
providerExecuted: part.executed,
|
|
207
207
|
providerMetadata: (part.executed === true ? sameProvider : reuse) ? metadata(native) : undefined,
|
|
208
|
-
result: state.status === "error" ? { error: state.error, content: toolContent } : single?.type === "text" ? { type: "text", value: single.text } : { type: "content", value: toolContent }
|
|
209
|
-
...state.status === "error" ? { resultType: "error" } : {}
|
|
208
|
+
result: state.status === "error" ? { type: "error", value: { error: state.error, content: toolContent } } : single?.type === "text" ? { type: "text", value: single.text } : { type: "content", value: toolContent }
|
|
210
209
|
};
|
|
211
210
|
if (part.executed === true)
|
|
212
211
|
content.push(result);
|