@cortexkit/pi-magic-context 0.49.19 → 0.49.21
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 +48 -9
- package/dist/chunk-embedding-write-worker.js +29 -22
- package/dist/{compaction-marker-candidates-wjzqbspm.js → compaction-marker-candidates-p1kqkqhq.js} +3 -3
- package/dist/compaction-marker-candidates-worker.js +2 -2
- package/dist/compartment-chunk-embedding-y01m95c2.js +64 -0
- package/dist/embedding-backfill-2vh6m3bg.js +24 -0
- package/dist/embedding-worker-process.js +2 -2
- package/dist/embedding-worker.js +6 -6
- package/dist/historian-calibration-extension.js +1 -1
- package/dist/{index-e1rza8gp.js → index-29nw7n1r.js} +1 -1
- package/dist/{index-rrwv9y2k.js → index-2qtx0q6h.js} +214 -5
- package/dist/{index-msqrs4nf.js → index-3c3ztwgc.js} +5 -5
- package/dist/index-54wmg4rj.js +82 -0
- package/dist/{index-yygsh681.js → index-579m1751.js} +3 -3
- package/dist/{index-rc1dez8m.js → index-5j6vwg4z.js} +154 -13
- package/dist/{index-qpq6w67c.js → index-6wdwv3a6.js} +2 -2
- package/dist/{index-vktahpdj.js → index-at6py2k3.js} +9 -3
- package/dist/{index-bxmf4dhr.js → index-ccanzg8p.js} +2367 -1243
- package/dist/{index-sqt2haap.js → index-dbgg6hsf.js} +28 -14
- package/dist/{index-7bqrfyny.js → index-fgs78jyd.js} +12 -15
- package/dist/{index-58mj0dzc.js → index-ftvm2acc.js} +181 -46
- package/dist/{index-wveb51es.js → index-gqjxy2p7.js} +74 -9
- package/dist/{index-d8gc0112.js → index-gwxaz0z5.js} +4 -6
- package/dist/{index-d4dt19md.js → index-hqw0rt9k.js} +1 -1
- package/dist/{index-g7p75667.js → index-hxp6q5f8.js} +2 -2
- package/dist/{index-svgkv4g2.js → index-j3pz3a1b.js} +2 -2
- package/dist/{index-f18ec69t.js → index-jn44h81p.js} +1 -1
- package/dist/{index-1kcfwk9c.js → index-my0dn413.js} +1 -1
- package/dist/{index-apgwdby5.js → index-n4wyxcgr.js} +1 -1
- package/dist/{index-rhprywn6.js → index-n8e5e9fp.js} +28 -7
- package/dist/{index-z2rkv0mb.js → index-pe5gz5c4.js} +5 -5
- package/dist/{index-dtp1efvf.js → index-st4gwt64.js} +2 -2
- package/dist/{index-xnch62s6.js → index-vx6f7wff.js} +314 -127
- package/dist/{index-jrap43gc.js → index-w1avzkdt.js} +1 -1
- package/dist/{index-vmcgew7x.js → index-w1twp2kp.js} +78 -58
- package/dist/{index-ek9zvs4f.js → index-w6r3ggnp.js} +57 -27
- package/dist/{index-ym6nh2gk.js → index-wgmhk91m.js} +113 -20
- package/dist/{index-2mmy81qt.js → index-wqpjhx1p.js} +501 -20
- package/dist/index.js +1178 -417
- package/dist/{logger-dygt96rn.js → logger-shetp43v.js} +1 -1
- package/dist/{message-fts-rowid-map-cvpy2dmb.js → message-fts-rowid-map-59y476bk.js} +6 -5
- package/dist/{message-index-rc2x41k4.js → message-index-3snxf11x.js} +15 -14
- package/dist/{message-index-bounded-66saeq5j.js → message-index-bounded-4ngt600v.js} +15 -14
- package/dist/{message-time-backfill-ssshbdy8.js → message-time-backfill-e3r8ddh1.js} +3 -3
- package/dist/migration-worker.js +12 -11
- package/dist/{project-embedding-registry-vf1ncptn.js → project-embedding-registry-hfyzs654.js} +14 -13
- package/dist/raw-ordinal-warmup-worker.js +136 -101
- package/dist/{read-session-chunk-h5bzj91r.js → read-session-chunk-5dmc77q2.js} +10 -9
- package/dist/{read-session-raw-9s3xn7fc.js → read-session-raw-yxv2fv34.js} +4 -3
- package/dist/{safe-notification-target-2rkvkmw8.js → safe-notification-target-zcpchea6.js} +2 -2
- package/dist/search-archive-3daj5ttc.js +21 -0
- package/dist/{search-wh7b9zht.js → search-jhfh3tsj.js} +23 -22
- package/dist/{sqlite-fsp0sf3r.js → sqlite-v89bj0yy.js} +7 -1
- package/dist/{storage-memory-yxxc5v4n.js → storage-memory-0ndn65fm.js} +2 -2
- package/dist/{storage-tags-1kets0q8.js → storage-tags-r48vxthe.js} +7 -5
- package/dist/subagent-entry.js +28 -26
- package/dist/tag-snapshot-worker-pi.js +22 -14
- package/package.json +5 -2
- package/dist/embedding-backfill-vwag34t0.js +0 -23
- package/dist/search-archive-4817pqev.js +0 -20
|
@@ -6,13 +6,14 @@ import {
|
|
|
6
6
|
messageFtsOrdinalRangeIsMapped2,
|
|
7
7
|
getMessageFtsRowidMapBackfillProgress2,
|
|
8
8
|
deleteUnmappedMessageFtsRows2
|
|
9
|
-
} from "./index-
|
|
10
|
-
import"./index-
|
|
9
|
+
} from "./index-579m1751.js";
|
|
10
|
+
import"./index-at6py2k3.js";
|
|
11
11
|
import"./index-399p688g.js";
|
|
12
|
-
import"./index-
|
|
13
|
-
import"./index-
|
|
14
|
-
import"./index-
|
|
12
|
+
import"./index-hqw0rt9k.js";
|
|
13
|
+
import"./index-2qtx0q6h.js";
|
|
14
|
+
import"./index-fgs78jyd.js";
|
|
15
15
|
import"./index-0h2mkab2.js";
|
|
16
|
+
import"./index-54wmg4rj.js";
|
|
16
17
|
export {
|
|
17
18
|
deleteUnmappedMessageFtsRows2 as deleteUnmappedMessageFtsRows,
|
|
18
19
|
getMessageFtsRowidMapBackfillProgress2 as getMessageFtsRowidMapBackfillProgress,
|
|
@@ -17,24 +17,25 @@ import {
|
|
|
17
17
|
indexMessagesAfterOrdinal2,
|
|
18
18
|
indexSourcesAfterOrdinal2,
|
|
19
19
|
sweepOrphanedOpenCodeMessageIndexesCooperatively2
|
|
20
|
-
} from "./index-
|
|
21
|
-
import"./index-
|
|
22
|
-
import"./index-
|
|
23
|
-
import"./index-
|
|
20
|
+
} from "./index-wgmhk91m.js";
|
|
21
|
+
import"./index-vx6f7wff.js";
|
|
22
|
+
import"./index-gqjxy2p7.js";
|
|
23
|
+
import"./index-n8e5e9fp.js";
|
|
24
24
|
import"./index-6x556c2q.js";
|
|
25
|
-
import"./index-
|
|
26
|
-
import"./index-
|
|
27
|
-
import"./index-
|
|
28
|
-
import"./index-
|
|
25
|
+
import"./index-gwxaz0z5.js";
|
|
26
|
+
import"./index-ccanzg8p.js";
|
|
27
|
+
import"./index-n4wyxcgr.js";
|
|
28
|
+
import"./index-579m1751.js";
|
|
29
29
|
import"./index-8976mezv.js";
|
|
30
|
-
import"./index-
|
|
31
|
-
import"./index-
|
|
30
|
+
import"./index-w1avzkdt.js";
|
|
31
|
+
import"./index-at6py2k3.js";
|
|
32
32
|
import"./index-399p688g.js";
|
|
33
|
-
import"./index-
|
|
34
|
-
import"./index-
|
|
35
|
-
import"./index-
|
|
36
|
-
import"./index-
|
|
33
|
+
import"./index-hqw0rt9k.js";
|
|
34
|
+
import"./index-my0dn413.js";
|
|
35
|
+
import"./index-2qtx0q6h.js";
|
|
36
|
+
import"./index-fgs78jyd.js";
|
|
37
37
|
import"./index-0h2mkab2.js";
|
|
38
|
+
import"./index-54wmg4rj.js";
|
|
38
39
|
export {
|
|
39
40
|
MESSAGE_INDEX_MAX_FTS_BYTES2 as MESSAGE_INDEX_MAX_FTS_BYTES,
|
|
40
41
|
clearIndexedMessages2 as clearIndexedMessages,
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
withSqliteBackgroundWriter2,
|
|
3
3
|
withIndexChunk2,
|
|
4
4
|
yieldIndexChunk2
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-2qtx0q6h.js";
|
|
6
6
|
import"./index-0h2mkab2.js";
|
|
7
|
-
import"./index-
|
|
8
|
-
import"./index-
|
|
7
|
+
import"./index-fgs78jyd.js";
|
|
8
|
+
import"./index-n4wyxcgr.js";
|
|
9
9
|
import {
|
|
10
10
|
MESSAGE_INDEX_MAX_FTS_BYTES2,
|
|
11
11
|
messageIndexSkipKey2,
|
|
@@ -13,20 +13,21 @@ import {
|
|
|
13
13
|
markMessageIndexDirty2,
|
|
14
14
|
getIndexableContent2,
|
|
15
15
|
indexSingleMessage2
|
|
16
|
-
} from "./index-
|
|
17
|
-
import"./index-
|
|
18
|
-
import"./index-
|
|
19
|
-
import"./index-
|
|
20
|
-
import"./index-
|
|
16
|
+
} from "./index-wgmhk91m.js";
|
|
17
|
+
import"./index-n8e5e9fp.js";
|
|
18
|
+
import"./index-my0dn413.js";
|
|
19
|
+
import"./index-w1avzkdt.js";
|
|
20
|
+
import"./index-ccanzg8p.js";
|
|
21
21
|
import"./index-399p688g.js";
|
|
22
|
-
import"./index-
|
|
22
|
+
import"./index-54wmg4rj.js";
|
|
23
|
+
import"./index-at6py2k3.js";
|
|
23
24
|
import"./index-8976mezv.js";
|
|
24
|
-
import"./index-
|
|
25
|
+
import"./index-gqjxy2p7.js";
|
|
25
26
|
import"./index-6x556c2q.js";
|
|
26
|
-
import"./index-
|
|
27
|
-
import"./index-
|
|
28
|
-
import"./index-
|
|
29
|
-
import"./index-
|
|
27
|
+
import"./index-579m1751.js";
|
|
28
|
+
import"./index-gwxaz0z5.js";
|
|
29
|
+
import"./index-vx6f7wff.js";
|
|
30
|
+
import"./index-hqw0rt9k.js";
|
|
30
31
|
|
|
31
32
|
// ../plugin/src/features/magic-context/message-index-bounded.ts
|
|
32
33
|
import { createHash } from "node:crypto";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
withSqliteBackgroundWriter2,
|
|
3
3
|
withoutSqliteTransformPass2
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-2qtx0q6h.js";
|
|
5
5
|
import"./index-0h2mkab2.js";
|
|
6
|
-
import"./index-
|
|
6
|
+
import"./index-fgs78jyd.js";
|
|
7
7
|
import {
|
|
8
8
|
logSlowWriteTransaction
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-hqw0rt9k.js";
|
|
10
10
|
|
|
11
11
|
// ../plugin/src/features/magic-context/message-time-backfill.ts
|
|
12
12
|
var MESSAGE_TIME_BACKFILL_BATCH_SIZE = 500;
|
package/dist/migration-worker.js
CHANGED
|
@@ -2,30 +2,31 @@ import"./index-0h2mkab2.js";
|
|
|
2
2
|
import {
|
|
3
3
|
setLogLineForwarder2,
|
|
4
4
|
log2
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-fgs78jyd.js";
|
|
6
6
|
import {
|
|
7
7
|
Database2
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-2qtx0q6h.js";
|
|
9
9
|
import"./index-135e8hvg.js";
|
|
10
10
|
import {
|
|
11
11
|
runMigrationsWithRetry
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-3c3ztwgc.js";
|
|
13
13
|
import {
|
|
14
14
|
closeQuietly
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-w1avzkdt.js";
|
|
16
16
|
import"./index-8976mezv.js";
|
|
17
|
-
import"./index-
|
|
18
|
-
import"./index-
|
|
17
|
+
import"./index-hxp6q5f8.js";
|
|
18
|
+
import"./index-n4wyxcgr.js";
|
|
19
19
|
import"./index-fapenpch.js";
|
|
20
20
|
import {
|
|
21
21
|
setSqlitePragmaConfig,
|
|
22
22
|
initializeDatabase
|
|
23
|
-
} from "./index-
|
|
23
|
+
} from "./index-dbgg6hsf.js";
|
|
24
24
|
import"./index-399p688g.js";
|
|
25
|
-
import"./index-
|
|
26
|
-
import"./index-
|
|
27
|
-
import"./index-
|
|
28
|
-
import"./index-
|
|
25
|
+
import"./index-54wmg4rj.js";
|
|
26
|
+
import"./index-at6py2k3.js";
|
|
27
|
+
import"./index-579m1751.js";
|
|
28
|
+
import"./index-my0dn413.js";
|
|
29
|
+
import"./index-hqw0rt9k.js";
|
|
29
30
|
|
|
30
31
|
// ../plugin/src/features/magic-context/migration-worker.ts
|
|
31
32
|
import { parentPort, workerData } from "node:worker_threads";
|
package/dist/{project-embedding-registry-vf1ncptn.js → project-embedding-registry-hfyzs654.js}
RENAMED
|
@@ -33,23 +33,24 @@ import {
|
|
|
33
33
|
sweepAllRegisteredProjects2,
|
|
34
34
|
_setTestProviderFactoryForProject2,
|
|
35
35
|
_resetProjectEmbeddingRegistryForTests2
|
|
36
|
-
} from "./index-
|
|
36
|
+
} from "./index-w1twp2kp.js";
|
|
37
37
|
import"./index-9p40dgkm.js";
|
|
38
38
|
import"./index-yhzhdp3m.js";
|
|
39
|
-
import"./index-
|
|
40
|
-
import"./index-
|
|
41
|
-
import"./index-
|
|
42
|
-
import"./index-
|
|
43
|
-
import"./index-
|
|
44
|
-
import"./index-
|
|
45
|
-
import"./index-
|
|
46
|
-
import"./index-
|
|
39
|
+
import"./index-j3pz3a1b.js";
|
|
40
|
+
import"./index-vx6f7wff.js";
|
|
41
|
+
import"./index-wqpjhx1p.js";
|
|
42
|
+
import"./index-gwxaz0z5.js";
|
|
43
|
+
import"./index-ccanzg8p.js";
|
|
44
|
+
import"./index-hxp6q5f8.js";
|
|
45
|
+
import"./index-579m1751.js";
|
|
46
|
+
import"./index-at6py2k3.js";
|
|
47
47
|
import"./index-399p688g.js";
|
|
48
|
-
import"./index-
|
|
49
|
-
import"./index-
|
|
50
|
-
import"./index-
|
|
51
|
-
import"./index-
|
|
48
|
+
import"./index-hqw0rt9k.js";
|
|
49
|
+
import"./index-my0dn413.js";
|
|
50
|
+
import"./index-2qtx0q6h.js";
|
|
51
|
+
import"./index-fgs78jyd.js";
|
|
52
52
|
import"./index-0h2mkab2.js";
|
|
53
|
+
import"./index-54wmg4rj.js";
|
|
53
54
|
export {
|
|
54
55
|
_resetProjectEmbeddingRegistryForTests2 as _resetProjectEmbeddingRegistryForTests,
|
|
55
56
|
_setTestProviderFactoryForProject2 as _setTestProviderFactoryForProject,
|
|
@@ -1,114 +1,149 @@
|
|
|
1
|
+
import {
|
|
2
|
+
exitOnWorkerClose
|
|
3
|
+
} from "./index-54wmg4rj.js";
|
|
4
|
+
|
|
1
5
|
// ../plugin/src/hooks/magic-context/raw-ordinal-warmup-worker.ts
|
|
2
6
|
import { parentPort, workerData } from "node:worker_threads";
|
|
3
|
-
|
|
4
|
-
if (!port)
|
|
7
|
+
if (!parentPort)
|
|
5
8
|
throw new Error("raw ordinal warm-up worker requires a parent port");
|
|
9
|
+
var port = parentPort;
|
|
6
10
|
var input = workerData;
|
|
7
11
|
port.postMessage({ kind: "accepted" });
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
{ getHarness, setHarness },
|
|
12
|
-
{ log }
|
|
13
|
-
] = await Promise.all([
|
|
14
|
-
import("./sqlite-fsp0sf3r.js"),
|
|
15
|
-
import("./read-session-raw-9s3xn7fc.js"),
|
|
16
|
-
import("./harness-9872e0ym.js"),
|
|
17
|
-
import("./logger-dygt96rn.js")
|
|
18
|
-
]);
|
|
19
|
-
setHarness(input.harness ?? "opencode");
|
|
20
|
-
registerSqliteDiagnosticSink(log, getHarness);
|
|
21
|
-
var db;
|
|
22
|
-
var reply;
|
|
23
|
-
try {
|
|
24
|
-
if (input.openCancellation && Atomics.load(new Int32Array(input.openCancellation), 0) !== 0) {
|
|
25
|
-
throw new Error("warm-up owner closed before database open");
|
|
26
|
-
}
|
|
27
|
-
db = input.indexMessage || input.orphanSweep || input.ftsRowidBackfill ? new Database(input.path) : new Database(input.path, { readonly: true });
|
|
28
|
-
db.exec("PRAGMA busy_timeout = 250");
|
|
29
|
-
if (input.ftsRowidBackfill) {
|
|
30
|
-
const { runMessageFtsRowidMapBackfill } = await import("./message-fts-rowid-map-cvpy2dmb.js");
|
|
31
|
-
db.exec("PRAGMA busy_timeout = 0");
|
|
32
|
-
await runMessageFtsRowidMapBackfill(db);
|
|
33
|
-
reply = { kind: "fts-rowid-backfill" };
|
|
34
|
-
} else if (input.searchArchive) {
|
|
35
|
-
const { renderSearchArchive } = await import("./search-archive-4817pqev.js");
|
|
36
|
-
const { readRawSessionMessageIdOrdinalsForRangeFromDb } = await import("./read-session-raw-9s3xn7fc.js");
|
|
37
|
-
const archive = input.searchArchive;
|
|
38
|
-
let raw;
|
|
12
|
+
var openConnections = new Set;
|
|
13
|
+
var { closePort } = exitOnWorkerClose(port, () => {
|
|
14
|
+
for (const connection of openConnections) {
|
|
39
15
|
try {
|
|
16
|
+
connection.close();
|
|
17
|
+
} catch {}
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
main().catch((error) => {
|
|
21
|
+
setTimeout(() => {
|
|
22
|
+
throw error;
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
async function main() {
|
|
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-yxv2fv34.js"),
|
|
34
|
+
import("./harness-9872e0ym.js"),
|
|
35
|
+
import("./logger-shetp43v.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.orphanSweep || 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-59y476bk.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-3daj5ttc.js");
|
|
55
|
+
const { readRawSessionMessageIdOrdinalsForRangeFromDb } = await import("./read-session-raw-yxv2fv34.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) {
|
|
76
|
+
reply = {
|
|
77
|
+
kind: "exact-ordinal-ids",
|
|
78
|
+
ids: readRawSessionMessageIdsAtOrdinalsFromDb(db, input.sessionId, input.exactOrdinalIds)
|
|
79
|
+
};
|
|
80
|
+
} else if (input.orphanSweep) {
|
|
81
|
+
const [
|
|
82
|
+
{ setHarness },
|
|
83
|
+
{ sweepOrphanedOpenCodeMessageIndexesCooperatively },
|
|
84
|
+
{ configureContextDatabasePragmas }
|
|
85
|
+
] = await Promise.all([
|
|
86
|
+
import("./harness-9872e0ym.js"),
|
|
87
|
+
import("./message-index-3snxf11x.js"),
|
|
88
|
+
import("./sqlite-context-pragmas-gcgch6qz.js")
|
|
89
|
+
]);
|
|
90
|
+
setHarness(input.harness ?? "opencode");
|
|
91
|
+
configureContextDatabasePragmas(db);
|
|
92
|
+
const sourcePath = input.orphanSweep.sourcePath;
|
|
40
93
|
reply = {
|
|
41
|
-
kind: "
|
|
42
|
-
|
|
43
|
-
if (!
|
|
44
|
-
return
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return
|
|
48
|
-
})
|
|
94
|
+
kind: "orphan-sweep",
|
|
95
|
+
result: await sweepOrphanedOpenCodeMessageIndexesCooperatively(db, () => {
|
|
96
|
+
if (!sourcePath)
|
|
97
|
+
return null;
|
|
98
|
+
const source = new Database(sourcePath, { readonly: true });
|
|
99
|
+
openConnections.add(source);
|
|
100
|
+
return source;
|
|
101
|
+
}, input.orphanSweep.options)
|
|
49
102
|
};
|
|
50
|
-
}
|
|
51
|
-
|
|
103
|
+
} else if (input.indexMessage) {
|
|
104
|
+
const { setHarness } = await import("./harness-9872e0ym.js");
|
|
105
|
+
setHarness(input.harness ?? "opencode");
|
|
106
|
+
const [{ indexMessageInShortChunks }, { configureContextDatabasePragmas }] = await Promise.all([
|
|
107
|
+
import("./message-index-bounded-4ngt600v.js"),
|
|
108
|
+
import("./sqlite-context-pragmas-gcgch6qz.js")
|
|
109
|
+
]);
|
|
110
|
+
configureContextDatabasePragmas(db);
|
|
111
|
+
const writer = db;
|
|
112
|
+
const message = input.indexMessage;
|
|
113
|
+
const cancellation = input.indexCancellation ? new Int32Array(input.indexCancellation) : undefined;
|
|
114
|
+
const result = await indexMessageInShortChunks(writer, input.sessionId, message, input, () => !cancellation || Atomics.load(cancellation, 0) === 0);
|
|
115
|
+
reply = {
|
|
116
|
+
kind: "indexed",
|
|
117
|
+
inserted: result.inserted,
|
|
118
|
+
measurements: result.measurements
|
|
119
|
+
};
|
|
120
|
+
} else if (input.tagRatio !== undefined) {
|
|
121
|
+
const { scanTagOwnerSummary, scanTagOwnerDelta } = await import("./storage-tags-r48vxthe.js");
|
|
122
|
+
const delta = input.tagState ? scanTagOwnerDelta(db, input.sessionId, input.tagState) : null;
|
|
123
|
+
if (delta)
|
|
124
|
+
reply = { kind: "tag-delta", delta };
|
|
125
|
+
else
|
|
126
|
+
reply = {
|
|
127
|
+
kind: "tag-summary",
|
|
128
|
+
summary: scanTagOwnerSummary(db, input.sessionId, input.tagRatio, input.tagRatios)
|
|
129
|
+
};
|
|
130
|
+
} else {
|
|
131
|
+
const scan = scanRawSessionSummaryRows(db, input.sessionId, input.previous);
|
|
132
|
+
reply = { kind: "scan", scan };
|
|
52
133
|
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
kind: "exact-ordinal-ids",
|
|
56
|
-
ids: readRawSessionMessageIdsAtOrdinalsFromDb(db, input.sessionId, input.exactOrdinalIds)
|
|
57
|
-
};
|
|
58
|
-
} else if (input.orphanSweep) {
|
|
59
|
-
const [
|
|
60
|
-
{ setHarness },
|
|
61
|
-
{ sweepOrphanedOpenCodeMessageIndexesCooperatively },
|
|
62
|
-
{ configureContextDatabasePragmas }
|
|
63
|
-
] = await Promise.all([
|
|
64
|
-
import("./harness-9872e0ym.js"),
|
|
65
|
-
import("./message-index-rc2x41k4.js"),
|
|
66
|
-
import("./sqlite-context-pragmas-gcgch6qz.js")
|
|
67
|
-
]);
|
|
68
|
-
setHarness(input.harness ?? "opencode");
|
|
69
|
-
configureContextDatabasePragmas(db);
|
|
70
|
-
const sourcePath = input.orphanSweep.sourcePath;
|
|
134
|
+
} catch (error) {
|
|
135
|
+
const sqliteError = error;
|
|
71
136
|
reply = {
|
|
72
|
-
kind: "
|
|
73
|
-
|
|
137
|
+
kind: "error",
|
|
138
|
+
error: error instanceof Error ? error.stack ?? error.message : String(error),
|
|
139
|
+
code: typeof sqliteError?.code === "string" ? sqliteError.code : undefined,
|
|
140
|
+
errcode: typeof sqliteError?.errcode === "number" ? sqliteError.errcode : undefined
|
|
74
141
|
};
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
import("./message-index-bounded-66saeq5j.js"),
|
|
80
|
-
import("./sqlite-context-pragmas-gcgch6qz.js")
|
|
81
|
-
]);
|
|
82
|
-
configureContextDatabasePragmas(db);
|
|
83
|
-
const writer = db;
|
|
84
|
-
const message = input.indexMessage;
|
|
85
|
-
const cancellation = input.indexCancellation ? new Int32Array(input.indexCancellation) : undefined;
|
|
86
|
-
const result = await indexMessageInShortChunks(writer, input.sessionId, message, input, () => !cancellation || Atomics.load(cancellation, 0) === 0);
|
|
87
|
-
reply = { kind: "indexed", inserted: result.inserted, measurements: result.measurements };
|
|
88
|
-
} else if (input.tagRatio !== undefined) {
|
|
89
|
-
const { scanTagOwnerSummary, scanTagOwnerDelta } = await import("./storage-tags-1kets0q8.js");
|
|
90
|
-
const delta = input.tagState ? scanTagOwnerDelta(db, input.sessionId, input.tagState) : null;
|
|
91
|
-
if (delta)
|
|
92
|
-
reply = { kind: "tag-delta", delta };
|
|
93
|
-
else
|
|
94
|
-
reply = {
|
|
95
|
-
kind: "tag-summary",
|
|
96
|
-
summary: scanTagOwnerSummary(db, input.sessionId, input.tagRatio, input.tagRatios)
|
|
97
|
-
};
|
|
98
|
-
} else {
|
|
99
|
-
const scan = scanRawSessionSummaryRows(db, input.sessionId, input.previous);
|
|
100
|
-
reply = { kind: "scan", scan };
|
|
142
|
+
} finally {
|
|
143
|
+
if (db)
|
|
144
|
+
openConnections.delete(db);
|
|
145
|
+
db?.close();
|
|
101
146
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
reply = {
|
|
105
|
-
kind: "error",
|
|
106
|
-
error: error instanceof Error ? error.stack ?? error.message : String(error),
|
|
107
|
-
code: typeof sqliteError?.code === "string" ? sqliteError.code : undefined,
|
|
108
|
-
errcode: typeof sqliteError?.errcode === "number" ? sqliteError.errcode : undefined
|
|
109
|
-
};
|
|
110
|
-
} finally {
|
|
111
|
-
db?.close();
|
|
147
|
+
port.postMessage(reply);
|
|
148
|
+
closePort();
|
|
112
149
|
}
|
|
113
|
-
port.postMessage(reply);
|
|
114
|
-
port.close();
|
|
@@ -35,22 +35,23 @@ import {
|
|
|
35
35
|
readSessionChunk2,
|
|
36
36
|
getRawSessionMessageIdsThrough2,
|
|
37
37
|
readRawSessionSeedTail2
|
|
38
|
-
} from "./index-
|
|
39
|
-
import"./index-
|
|
38
|
+
} from "./index-gqjxy2p7.js";
|
|
39
|
+
import"./index-n8e5e9fp.js";
|
|
40
40
|
import"./index-6x556c2q.js";
|
|
41
|
-
import"./index-
|
|
41
|
+
import"./index-ccanzg8p.js";
|
|
42
42
|
import"./index-8976mezv.js";
|
|
43
|
-
import"./index-
|
|
44
|
-
import"./index-
|
|
43
|
+
import"./index-w1avzkdt.js";
|
|
44
|
+
import"./index-at6py2k3.js";
|
|
45
45
|
import"./index-399p688g.js";
|
|
46
|
-
import"./index-
|
|
46
|
+
import"./index-hqw0rt9k.js";
|
|
47
47
|
import {
|
|
48
48
|
hasMeaningfulUserText2,
|
|
49
49
|
extractTexts2
|
|
50
|
-
} from "./index-
|
|
51
|
-
import"./index-
|
|
52
|
-
import"./index-
|
|
50
|
+
} from "./index-my0dn413.js";
|
|
51
|
+
import"./index-2qtx0q6h.js";
|
|
52
|
+
import"./index-fgs78jyd.js";
|
|
53
53
|
import"./index-0h2mkab2.js";
|
|
54
|
+
import"./index-54wmg4rj.js";
|
|
54
55
|
export {
|
|
55
56
|
RAW_MESSAGE_VISIT_PAGE_SIZE2 as RAW_MESSAGE_VISIT_PAGE_SIZE,
|
|
56
57
|
RAW_SESSION_TAG_KEY_PAGE_SIZE2 as RAW_SESSION_TAG_KEY_PAGE_SIZE,
|
|
@@ -26,11 +26,12 @@ import {
|
|
|
26
26
|
hasRawSessionMessageByIdFromDb2,
|
|
27
27
|
readRawSeedTailFromDb2,
|
|
28
28
|
readRawSessionBoundaryEndpointsFromDb2
|
|
29
|
-
} from "./index-
|
|
29
|
+
} from "./index-at6py2k3.js";
|
|
30
30
|
import"./index-399p688g.js";
|
|
31
|
-
import"./index-
|
|
32
|
-
import"./index-
|
|
31
|
+
import"./index-2qtx0q6h.js";
|
|
32
|
+
import"./index-fgs78jyd.js";
|
|
33
33
|
import"./index-0h2mkab2.js";
|
|
34
|
+
import"./index-54wmg4rj.js";
|
|
34
35
|
export {
|
|
35
36
|
RAW_SUMMARY_TEXT_MAX_CHARS2 as RAW_SUMMARY_TEXT_MAX_CHARS,
|
|
36
37
|
RawOrdinalsNotReady2 as RawOrdinalsNotReady,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isDefaultSessionTitle2,
|
|
3
3
|
waitForSafeNotificationTarget2
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
4
|
+
} from "./index-jn44h81p.js";
|
|
5
|
+
import"./index-fgs78jyd.js";
|
|
6
6
|
import"./index-0h2mkab2.js";
|
|
7
7
|
export {
|
|
8
8
|
isDefaultSessionTitle2 as isDefaultSessionTitle,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
renderSearchArchive2
|
|
3
|
+
} from "./index-st4gwt64.js";
|
|
4
|
+
import"./index-1cvyaw9a.js";
|
|
5
|
+
import"./index-gqjxy2p7.js";
|
|
6
|
+
import"./index-n8e5e9fp.js";
|
|
7
|
+
import"./index-6x556c2q.js";
|
|
8
|
+
import"./index-ccanzg8p.js";
|
|
9
|
+
import"./index-8976mezv.js";
|
|
10
|
+
import"./index-w1avzkdt.js";
|
|
11
|
+
import"./index-at6py2k3.js";
|
|
12
|
+
import"./index-399p688g.js";
|
|
13
|
+
import"./index-hqw0rt9k.js";
|
|
14
|
+
import"./index-my0dn413.js";
|
|
15
|
+
import"./index-2qtx0q6h.js";
|
|
16
|
+
import"./index-fgs78jyd.js";
|
|
17
|
+
import"./index-0h2mkab2.js";
|
|
18
|
+
import"./index-54wmg4rj.js";
|
|
19
|
+
export {
|
|
20
|
+
renderSearchArchive2 as renderSearchArchive
|
|
21
|
+
};
|
|
@@ -5,36 +5,37 @@ import {
|
|
|
5
5
|
resolveMemoriesByIdsForSearch2,
|
|
6
6
|
unifiedSearch2,
|
|
7
7
|
formatSearchResults2
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-ftvm2acc.js";
|
|
9
9
|
import"./index-1cvyaw9a.js";
|
|
10
|
-
import"./index-
|
|
11
|
-
import"./index-
|
|
12
|
-
import"./index-
|
|
10
|
+
import"./index-wgmhk91m.js";
|
|
11
|
+
import"./index-pe5gz5c4.js";
|
|
12
|
+
import"./index-w1twp2kp.js";
|
|
13
13
|
import"./index-9p40dgkm.js";
|
|
14
|
-
import"./index-
|
|
14
|
+
import"./index-29nw7n1r.js";
|
|
15
15
|
import"./index-yhzhdp3m.js";
|
|
16
|
-
import"./index-
|
|
17
|
-
import"./index-
|
|
18
|
-
import"./index-
|
|
19
|
-
import"./index-
|
|
16
|
+
import"./index-j3pz3a1b.js";
|
|
17
|
+
import"./index-vx6f7wff.js";
|
|
18
|
+
import"./index-gqjxy2p7.js";
|
|
19
|
+
import"./index-n8e5e9fp.js";
|
|
20
20
|
import"./index-6x556c2q.js";
|
|
21
|
-
import"./index-
|
|
22
|
-
import"./index-
|
|
23
|
-
import"./index-
|
|
24
|
-
import"./index-
|
|
25
|
-
import"./index-
|
|
26
|
-
import"./index-
|
|
27
|
-
import"./index-
|
|
21
|
+
import"./index-wqpjhx1p.js";
|
|
22
|
+
import"./index-gwxaz0z5.js";
|
|
23
|
+
import"./index-ccanzg8p.js";
|
|
24
|
+
import"./index-3c3ztwgc.js";
|
|
25
|
+
import"./index-n4wyxcgr.js";
|
|
26
|
+
import"./index-hxp6q5f8.js";
|
|
27
|
+
import"./index-579m1751.js";
|
|
28
28
|
import"./index-135e8hvg.js";
|
|
29
29
|
import"./index-8976mezv.js";
|
|
30
|
-
import"./index-
|
|
31
|
-
import"./index-
|
|
30
|
+
import"./index-w1avzkdt.js";
|
|
31
|
+
import"./index-at6py2k3.js";
|
|
32
32
|
import"./index-399p688g.js";
|
|
33
|
-
import"./index-
|
|
34
|
-
import"./index-
|
|
35
|
-
import"./index-
|
|
36
|
-
import"./index-
|
|
33
|
+
import"./index-hqw0rt9k.js";
|
|
34
|
+
import"./index-my0dn413.js";
|
|
35
|
+
import"./index-2qtx0q6h.js";
|
|
36
|
+
import"./index-fgs78jyd.js";
|
|
37
37
|
import"./index-0h2mkab2.js";
|
|
38
|
+
import"./index-54wmg4rj.js";
|
|
38
39
|
export {
|
|
39
40
|
createUnifiedSearchDiagnostics2 as createUnifiedSearchDiagnostics,
|
|
40
41
|
formatSearchResults2 as formatSearchResults,
|
|
@@ -5,8 +5,11 @@ import {
|
|
|
5
5
|
detectSqliteRuntime2,
|
|
6
6
|
getTagIdentityWriteGeneration2,
|
|
7
7
|
Database2,
|
|
8
|
+
createSqliteTurnDatabase2,
|
|
9
|
+
hasSqliteTurnDeadlineRouting2,
|
|
8
10
|
getSqliteDatabasePath2,
|
|
9
11
|
prepareCachedStatement2,
|
|
12
|
+
withSqliteTurnDeadline2,
|
|
10
13
|
withSqliteBackgroundWriter2,
|
|
11
14
|
withSqliteTransformPass2,
|
|
12
15
|
withoutSqliteTransformPass2,
|
|
@@ -20,15 +23,17 @@ import {
|
|
|
20
23
|
releaseIndexOwner2,
|
|
21
24
|
withIndexChunk2,
|
|
22
25
|
yieldIndexChunk2
|
|
23
|
-
} from "./index-
|
|
26
|
+
} from "./index-2qtx0q6h.js";
|
|
24
27
|
export {
|
|
25
28
|
Database2 as Database,
|
|
26
29
|
assertTransformWrite2 as assertTransformWrite,
|
|
27
30
|
beginSqliteWriterAsync2 as beginSqliteWriterAsync,
|
|
31
|
+
createSqliteTurnDatabase2 as createSqliteTurnDatabase,
|
|
28
32
|
detectSqliteRuntime2 as detectSqliteRuntime,
|
|
29
33
|
getSqliteDatabasePath2 as getSqliteDatabasePath,
|
|
30
34
|
getTagIdentityWriteGeneration2 as getTagIdentityWriteGeneration,
|
|
31
35
|
guardSqliteTransformPass2 as guardSqliteTransformPass,
|
|
36
|
+
hasSqliteTurnDeadlineRouting2 as hasSqliteTurnDeadlineRouting,
|
|
32
37
|
inRootAsyncContext2 as inRootAsyncContext,
|
|
33
38
|
indexCoordinationInput2 as indexCoordinationInput,
|
|
34
39
|
isTransientSqliteError2 as isTransientSqliteError,
|
|
@@ -41,6 +46,7 @@ export {
|
|
|
41
46
|
withPrivilegedWriter2 as withPrivilegedWriter,
|
|
42
47
|
withSqliteBackgroundWriter2 as withSqliteBackgroundWriter,
|
|
43
48
|
withSqliteTransformPass2 as withSqliteTransformPass,
|
|
49
|
+
withSqliteTurnDeadline2 as withSqliteTurnDeadline,
|
|
44
50
|
withoutSqliteTransformPass2 as withoutSqliteTransformPass,
|
|
45
51
|
yieldIndexChunk2 as yieldIndexChunk
|
|
46
52
|
};
|