@cortexkit/pi-magic-context 0.49.18 → 0.49.20
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 +53 -10
- package/dist/chunk-embedding-write-worker.js +29 -22
- package/dist/{compaction-marker-candidates-wjzqbspm.js → compaction-marker-candidates-fnm47jat.js} +3 -3
- package/dist/compaction-marker-candidates-worker.js +2 -2
- package/dist/compartment-chunk-embedding-81qesfjs.js +64 -0
- package/dist/embedding-backfill-56e871c6.js +24 -0
- package/dist/embedding-worker-process.js +2 -2
- package/dist/embedding-worker.js +5 -5
- package/dist/historian-calibration-extension.js +1 -1
- package/dist/index-54wmg4rj.js +82 -0
- package/dist/{index-xnch62s6.js → index-5n5zxs8e.js} +314 -127
- package/dist/{index-gdjv1nnd.js → index-5vgt1zeh.js} +6 -7
- package/dist/{index-qpq6w67c.js → index-6kb2xpw7.js} +2 -2
- package/dist/{index-d43hmn31.js → index-af9t637y.js} +68 -16
- package/dist/{index-z2rkv0mb.js → index-b8am7tns.js} +4 -4
- package/dist/{index-rhprywn6.js → index-bttctq07.js} +23 -5
- package/dist/{index-e1rza8gp.js → index-dzem6gn9.js} +1 -1
- package/dist/{index-2mmy81qt.js → index-e19qtjj0.js} +468 -18
- package/dist/{index-7bqrfyny.js → index-fgs78jyd.js} +12 -15
- package/dist/{index-d4dt19md.js → index-hqw0rt9k.js} +1 -1
- package/dist/{index-rrwv9y2k.js → index-hws5f0z9.js} +1 -1
- package/dist/{index-f18ec69t.js → index-jn44h81p.js} +1 -1
- package/dist/{index-xxn1tpnv.js → index-jt0g3hn0.js} +45 -28
- package/dist/{index-d8gc0112.js → index-jxjr7kz9.js} +3 -3
- package/dist/{index-4bv5bttd.js → index-kqb3d8bs.js} +9 -5
- package/dist/{index-gp928w10.js → index-mtvvhcw4.js} +10 -10
- package/dist/{index-1kcfwk9c.js → index-my0dn413.js} +1 -1
- package/dist/{index-apgwdby5.js → index-n4wyxcgr.js} +1 -1
- package/dist/{index-g7p75667.js → index-p63nwn5v.js} +2 -2
- package/dist/{index-svgkv4g2.js → index-qerzchrs.js} +2 -2
- package/dist/{index-vktahpdj.js → index-rfyvax95.js} +9 -3
- package/dist/{index-yygsh681.js → index-rgfb753z.js} +3 -3
- package/dist/{index-d21pdr8v.js → index-tb3d9trm.js} +2 -2
- package/dist/{index-vmcgew7x.js → index-v2epyzbm.js} +75 -57
- package/dist/{index-fvjthct0.js → index-vdy273xw.js} +107 -20
- package/dist/{index-jrap43gc.js → index-w1avzkdt.js} +1 -1
- package/dist/{index-r9f4f6s1.js → index-zhwwp8zz.js} +64 -8
- package/dist/index.js +1119 -247
- package/dist/{logger-dygt96rn.js → logger-shetp43v.js} +1 -1
- package/dist/{message-fts-rowid-map-cvpy2dmb.js → message-fts-rowid-map-bpexnsdj.js} +6 -5
- package/dist/{message-index-bounded-g9hgresf.js → message-index-bounded-d4r3weh0.js} +14 -13
- package/dist/{message-index-74qdqmq7.js → message-index-mvag9crh.js} +14 -13
- package/dist/{message-time-backfill-ssshbdy8.js → message-time-backfill-kc10yrcj.js} +3 -3
- package/dist/migration-worker.js +12 -11
- package/dist/{project-embedding-registry-vf1ncptn.js → project-embedding-registry-cfrg952x.js} +13 -12
- package/dist/raw-ordinal-warmup-worker.js +136 -101
- package/dist/{read-session-chunk-chepqmw5.js → read-session-chunk-7g4zvpd8.js} +9 -8
- package/dist/{read-session-raw-9s3xn7fc.js → read-session-raw-0fsjh10f.js} +4 -3
- package/dist/{safe-notification-target-2rkvkmw8.js → safe-notification-target-zcpchea6.js} +2 -2
- package/dist/search-archive-qbhp7e89.js +21 -0
- package/dist/{search-6ztbx25v.js → search-hp4g3g9v.js} +22 -21
- package/dist/{sqlite-fsp0sf3r.js → sqlite-d67n6dtr.js} +1 -1
- package/dist/{storage-memory-yxxc5v4n.js → storage-memory-9g882j7a.js} +2 -2
- package/dist/{storage-tags-1kets0q8.js → storage-tags-m2qcp1g2.js} +7 -5
- package/dist/subagent-entry.js +26 -25
- package/dist/tag-snapshot-worker-pi.js +66 -55
- package/package.json +1 -1
- package/dist/embedding-backfill-vwag34t0.js +0 -23
- package/dist/search-archive-jg4a1kcx.js +0 -20
|
@@ -48,6 +48,7 @@ import {
|
|
|
48
48
|
TAG_SELECT_COLUMNS2,
|
|
49
49
|
getTagsBySession2,
|
|
50
50
|
getActiveTagsBySession2,
|
|
51
|
+
getTailHygieneTags2,
|
|
51
52
|
getTagsForPendingOperations2,
|
|
52
53
|
getTagsByNumbers2,
|
|
53
54
|
getNewestToolTagNumbers2,
|
|
@@ -60,11 +61,11 @@ import {
|
|
|
60
61
|
adoptNullOwnerToolTag2,
|
|
61
62
|
getCandidateToolOwners2,
|
|
62
63
|
pickNearestPriorOwner2
|
|
63
|
-
} from "./index-
|
|
64
|
-
import"./index-
|
|
65
|
-
import"./index-
|
|
66
|
-
import"./index-
|
|
67
|
-
import"./index-
|
|
64
|
+
} from "./index-bttctq07.js";
|
|
65
|
+
import"./index-w1avzkdt.js";
|
|
66
|
+
import"./index-my0dn413.js";
|
|
67
|
+
import"./index-hws5f0z9.js";
|
|
68
|
+
import"./index-fgs78jyd.js";
|
|
68
69
|
import"./index-0h2mkab2.js";
|
|
69
70
|
export {
|
|
70
71
|
AGE_RECLAIM_MIN_TOKENS2 as AGE_RECLAIM_MIN_TOKENS,
|
|
@@ -106,6 +107,7 @@ export {
|
|
|
106
107
|
getTagsByNumbers2 as getTagsByNumbers,
|
|
107
108
|
getTagsBySession2 as getTagsBySession,
|
|
108
109
|
getTagsForPendingOperations2 as getTagsForPendingOperations,
|
|
110
|
+
getTailHygieneTags2 as getTailHygieneTags,
|
|
109
111
|
getToolTagNumberByOwner2 as getToolTagNumberByOwner,
|
|
110
112
|
getTopNBySize2 as getTopNBySize,
|
|
111
113
|
getTriggerTagTokenUpperBound2 as getTriggerTagTokenUpperBound,
|
package/dist/subagent-entry.js
CHANGED
|
@@ -1,54 +1,55 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TOKEN_BUDGET_TOOL_REFUSAL
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-zhwwp8zz.js";
|
|
4
4
|
import {
|
|
5
5
|
setHarness2
|
|
6
6
|
} from "./index-0h2mkab2.js";
|
|
7
7
|
import {
|
|
8
8
|
log2
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-fgs78jyd.js";
|
|
10
10
|
import {
|
|
11
11
|
resolveProjectIdentityForSession
|
|
12
|
-
} from "./index-
|
|
13
|
-
import"./index-
|
|
14
|
-
import"./index-
|
|
12
|
+
} from "./index-p63nwn5v.js";
|
|
13
|
+
import"./index-hws5f0z9.js";
|
|
14
|
+
import"./index-n4wyxcgr.js";
|
|
15
15
|
import"./index-fapenpch.js";
|
|
16
16
|
import {
|
|
17
17
|
openDatabase
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-mtvvhcw4.js";
|
|
19
19
|
import"./index-399p688g.js";
|
|
20
|
-
import"./index-
|
|
21
|
-
import"./index-
|
|
22
|
-
import"./index-
|
|
23
|
-
import"./index-
|
|
20
|
+
import"./index-54wmg4rj.js";
|
|
21
|
+
import"./index-rfyvax95.js";
|
|
22
|
+
import"./index-rgfb753z.js";
|
|
23
|
+
import"./index-5vgt1zeh.js";
|
|
24
|
+
import"./index-w1avzkdt.js";
|
|
24
25
|
import"./index-135e8hvg.js";
|
|
25
26
|
import"./index-8976mezv.js";
|
|
26
|
-
import"./index-
|
|
27
|
+
import"./index-my0dn413.js";
|
|
27
28
|
import"./index-4knyh1kt.js";
|
|
28
29
|
import {
|
|
29
30
|
loadPiConfig,
|
|
30
31
|
ensureProjectRegisteredFromPiDirectory,
|
|
31
32
|
resolvePiHarnessKind,
|
|
32
33
|
registerMagicContextTools
|
|
33
|
-
} from "./index-
|
|
34
|
+
} from "./index-jt0g3hn0.js";
|
|
34
35
|
import"./index-bxmf4dhr.js";
|
|
35
|
-
import"./index-
|
|
36
|
-
import"./index-
|
|
37
|
-
import"./index-
|
|
38
|
-
import"./index-
|
|
36
|
+
import"./index-jxjr7kz9.js";
|
|
37
|
+
import"./index-5n5zxs8e.js";
|
|
38
|
+
import"./index-e19qtjj0.js";
|
|
39
|
+
import"./index-v2epyzbm.js";
|
|
39
40
|
import"./index-9p40dgkm.js";
|
|
40
|
-
import"./index-
|
|
41
|
+
import"./index-qerzchrs.js";
|
|
41
42
|
import"./index-yhzhdp3m.js";
|
|
42
|
-
import"./index-
|
|
43
|
-
import"./index-
|
|
44
|
-
import"./index-
|
|
43
|
+
import"./index-b8am7tns.js";
|
|
44
|
+
import"./index-vdy273xw.js";
|
|
45
|
+
import"./index-bttctq07.js";
|
|
45
46
|
import"./index-6x556c2q.js";
|
|
46
|
-
import"./index-
|
|
47
|
+
import"./index-af9t637y.js";
|
|
47
48
|
import"./index-1cvyaw9a.js";
|
|
48
|
-
import"./index-
|
|
49
|
-
import"./index-
|
|
50
|
-
import"./index-
|
|
51
|
-
import"./index-
|
|
49
|
+
import"./index-tb3d9trm.js";
|
|
50
|
+
import"./index-dzem6gn9.js";
|
|
51
|
+
import"./index-6kb2xpw7.js";
|
|
52
|
+
import"./index-hqw0rt9k.js";
|
|
52
53
|
import {
|
|
53
54
|
setStoragePrivatePermissionEnforcement
|
|
54
55
|
} from "./index-81nthk8j.js";
|
|
@@ -1,35 +1,38 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Database2
|
|
3
|
-
} from "./index-
|
|
4
|
-
import"./index-
|
|
3
|
+
} from "./index-hws5f0z9.js";
|
|
4
|
+
import"./index-p63nwn5v.js";
|
|
5
5
|
import"./index-0h2mkab2.js";
|
|
6
|
-
import"./index-
|
|
7
|
-
import"./index-
|
|
6
|
+
import"./index-fgs78jyd.js";
|
|
7
|
+
import"./index-n4wyxcgr.js";
|
|
8
8
|
import"./index-fapenpch.js";
|
|
9
9
|
import {
|
|
10
10
|
LATEST_SUPPORTED_VERSION,
|
|
11
11
|
getPersistedSchemaVersion
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-mtvvhcw4.js";
|
|
13
13
|
import"./index-399p688g.js";
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
import {
|
|
15
|
+
exitOnWorkerClose
|
|
16
|
+
} from "./index-54wmg4rj.js";
|
|
17
|
+
import"./index-rfyvax95.js";
|
|
18
|
+
import"./index-rgfb753z.js";
|
|
19
|
+
import"./index-5vgt1zeh.js";
|
|
17
20
|
import {
|
|
18
21
|
tagRevisionKey
|
|
19
|
-
} from "./index-
|
|
22
|
+
} from "./index-w1avzkdt.js";
|
|
20
23
|
import"./index-135e8hvg.js";
|
|
21
24
|
import"./index-8976mezv.js";
|
|
22
|
-
import"./index-
|
|
25
|
+
import"./index-my0dn413.js";
|
|
23
26
|
import {
|
|
24
27
|
normalizeTagSnapshotRow2,
|
|
25
28
|
TAG_SELECT_COLUMNS2
|
|
26
|
-
} from "./index-
|
|
29
|
+
} from "./index-bttctq07.js";
|
|
27
30
|
import {
|
|
28
31
|
encodePiHydrationOperation,
|
|
29
32
|
PI_FALLBACK_ROW_COLUMNS,
|
|
30
33
|
PI_FALLBACK_ROW_PREDICATE
|
|
31
|
-
} from "./index-
|
|
32
|
-
import"./index-
|
|
34
|
+
} from "./index-kqb3d8bs.js";
|
|
35
|
+
import"./index-hqw0rt9k.js";
|
|
33
36
|
|
|
34
37
|
// src/tag-snapshot-worker-pi.ts
|
|
35
38
|
import { setTimeout as delay } from "node:timers/promises";
|
|
@@ -48,6 +51,11 @@ var sampledGeneration = false;
|
|
|
48
51
|
var generationStatement;
|
|
49
52
|
var opened = false;
|
|
50
53
|
var persistedVersion = 0;
|
|
54
|
+
var { closePort } = exitOnWorkerClose(port, () => {
|
|
55
|
+
const connection = db;
|
|
56
|
+
db = undefined;
|
|
57
|
+
connection?.close();
|
|
58
|
+
});
|
|
51
59
|
|
|
52
60
|
class StaleGeneration extends Error {
|
|
53
61
|
}
|
|
@@ -186,47 +194,50 @@ async function stream(kind) {
|
|
|
186
194
|
}
|
|
187
195
|
await send({ ...envelope(), type: "end", stream: kind, rows: rowsSent });
|
|
188
196
|
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
197
|
+
var run = async () => {
|
|
198
|
+
try {
|
|
199
|
+
if (request.test?.openDelayMs)
|
|
200
|
+
await delay(request.test.openDelayMs);
|
|
201
|
+
db = new Database2(request.path, { readonly: true });
|
|
202
|
+
opened = true;
|
|
203
|
+
db.exec("PRAGMA query_only = ON; PRAGMA busy_timeout = 50; PRAGMA cache_size = -1024");
|
|
204
|
+
generationStatement = db.prepare(`SELECT
|
|
196
205
|
COALESCE((SELECT value FROM schema_migrations_meta WHERE key = ?), '0') AS revision,
|
|
197
206
|
COALESCE((SELECT tags_version FROM session_meta WHERE session_id = ?), 0) AS durable`);
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
} catch (error) {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
} finally {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
}
|
|
207
|
+
const version = getPersistedSchemaVersion(db);
|
|
208
|
+
persistedVersion = version;
|
|
209
|
+
if (version > LATEST_SUPPORTED_VERSION)
|
|
210
|
+
throw new UnsupportedSchema(`shared database schema v${version} is newer than this build supports (v${LATEST_SUPPORTED_VERSION}); update and restart this host`);
|
|
211
|
+
await stream("tags");
|
|
212
|
+
await stream("fallback");
|
|
213
|
+
if (request.test?.crash === "before-end")
|
|
214
|
+
throw new Error("injected worker crash before completion");
|
|
215
|
+
const final = sample(db);
|
|
216
|
+
if (final.revision !== generation.revision || final.durable !== generation.durable)
|
|
217
|
+
throw new StaleGeneration("session tags changed after final page");
|
|
218
|
+
db.close();
|
|
219
|
+
db = undefined;
|
|
220
|
+
port.postMessage({
|
|
221
|
+
...envelope(),
|
|
222
|
+
type: "done",
|
|
223
|
+
maxReadTransactionMs,
|
|
224
|
+
packetCount,
|
|
225
|
+
packetBytes
|
|
226
|
+
});
|
|
227
|
+
if (request.test?.crash === "after-end")
|
|
228
|
+
process.exitCode = 1;
|
|
229
|
+
} catch (error) {
|
|
230
|
+
port.postMessage({
|
|
231
|
+
...envelope(),
|
|
232
|
+
type: "failed",
|
|
233
|
+
code: error instanceof StaleGeneration ? "stale" : error instanceof UnsupportedSchema ? "schema" : opened ? "failed" : "open",
|
|
234
|
+
persistedVersion,
|
|
235
|
+
supportedVersion: LATEST_SUPPORTED_VERSION,
|
|
236
|
+
reason: error instanceof Error ? error.message : String(error)
|
|
237
|
+
});
|
|
238
|
+
} finally {
|
|
239
|
+
db?.close();
|
|
240
|
+
closePort();
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
run();
|
package/package.json
CHANGED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ensureMemoryEmbeddings2
|
|
3
|
-
} from "./index-z2rkv0mb.js";
|
|
4
|
-
import"./index-vmcgew7x.js";
|
|
5
|
-
import"./index-9p40dgkm.js";
|
|
6
|
-
import"./index-yhzhdp3m.js";
|
|
7
|
-
import"./index-svgkv4g2.js";
|
|
8
|
-
import"./index-xnch62s6.js";
|
|
9
|
-
import"./index-2mmy81qt.js";
|
|
10
|
-
import"./index-d8gc0112.js";
|
|
11
|
-
import"./index-bxmf4dhr.js";
|
|
12
|
-
import"./index-g7p75667.js";
|
|
13
|
-
import"./index-yygsh681.js";
|
|
14
|
-
import"./index-vktahpdj.js";
|
|
15
|
-
import"./index-399p688g.js";
|
|
16
|
-
import"./index-d4dt19md.js";
|
|
17
|
-
import"./index-1kcfwk9c.js";
|
|
18
|
-
import"./index-rrwv9y2k.js";
|
|
19
|
-
import"./index-7bqrfyny.js";
|
|
20
|
-
import"./index-0h2mkab2.js";
|
|
21
|
-
export {
|
|
22
|
-
ensureMemoryEmbeddings2 as ensureMemoryEmbeddings
|
|
23
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
renderSearchArchive2
|
|
3
|
-
} from "./index-d21pdr8v.js";
|
|
4
|
-
import"./index-1cvyaw9a.js";
|
|
5
|
-
import"./index-r9f4f6s1.js";
|
|
6
|
-
import"./index-rhprywn6.js";
|
|
7
|
-
import"./index-6x556c2q.js";
|
|
8
|
-
import"./index-bxmf4dhr.js";
|
|
9
|
-
import"./index-8976mezv.js";
|
|
10
|
-
import"./index-jrap43gc.js";
|
|
11
|
-
import"./index-vktahpdj.js";
|
|
12
|
-
import"./index-399p688g.js";
|
|
13
|
-
import"./index-d4dt19md.js";
|
|
14
|
-
import"./index-1kcfwk9c.js";
|
|
15
|
-
import"./index-rrwv9y2k.js";
|
|
16
|
-
import"./index-7bqrfyny.js";
|
|
17
|
-
import"./index-0h2mkab2.js";
|
|
18
|
-
export {
|
|
19
|
-
renderSearchArchive2 as renderSearchArchive
|
|
20
|
-
};
|