@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.
Files changed (59) hide show
  1. package/dist/auto-search-worker.js +53 -10
  2. package/dist/chunk-embedding-write-worker.js +29 -22
  3. package/dist/{compaction-marker-candidates-wjzqbspm.js → compaction-marker-candidates-fnm47jat.js} +3 -3
  4. package/dist/compaction-marker-candidates-worker.js +2 -2
  5. package/dist/compartment-chunk-embedding-81qesfjs.js +64 -0
  6. package/dist/embedding-backfill-56e871c6.js +24 -0
  7. package/dist/embedding-worker-process.js +2 -2
  8. package/dist/embedding-worker.js +5 -5
  9. package/dist/historian-calibration-extension.js +1 -1
  10. package/dist/index-54wmg4rj.js +82 -0
  11. package/dist/{index-xnch62s6.js → index-5n5zxs8e.js} +314 -127
  12. package/dist/{index-gdjv1nnd.js → index-5vgt1zeh.js} +6 -7
  13. package/dist/{index-qpq6w67c.js → index-6kb2xpw7.js} +2 -2
  14. package/dist/{index-d43hmn31.js → index-af9t637y.js} +68 -16
  15. package/dist/{index-z2rkv0mb.js → index-b8am7tns.js} +4 -4
  16. package/dist/{index-rhprywn6.js → index-bttctq07.js} +23 -5
  17. package/dist/{index-e1rza8gp.js → index-dzem6gn9.js} +1 -1
  18. package/dist/{index-2mmy81qt.js → index-e19qtjj0.js} +468 -18
  19. package/dist/{index-7bqrfyny.js → index-fgs78jyd.js} +12 -15
  20. package/dist/{index-d4dt19md.js → index-hqw0rt9k.js} +1 -1
  21. package/dist/{index-rrwv9y2k.js → index-hws5f0z9.js} +1 -1
  22. package/dist/{index-f18ec69t.js → index-jn44h81p.js} +1 -1
  23. package/dist/{index-xxn1tpnv.js → index-jt0g3hn0.js} +45 -28
  24. package/dist/{index-d8gc0112.js → index-jxjr7kz9.js} +3 -3
  25. package/dist/{index-4bv5bttd.js → index-kqb3d8bs.js} +9 -5
  26. package/dist/{index-gp928w10.js → index-mtvvhcw4.js} +10 -10
  27. package/dist/{index-1kcfwk9c.js → index-my0dn413.js} +1 -1
  28. package/dist/{index-apgwdby5.js → index-n4wyxcgr.js} +1 -1
  29. package/dist/{index-g7p75667.js → index-p63nwn5v.js} +2 -2
  30. package/dist/{index-svgkv4g2.js → index-qerzchrs.js} +2 -2
  31. package/dist/{index-vktahpdj.js → index-rfyvax95.js} +9 -3
  32. package/dist/{index-yygsh681.js → index-rgfb753z.js} +3 -3
  33. package/dist/{index-d21pdr8v.js → index-tb3d9trm.js} +2 -2
  34. package/dist/{index-vmcgew7x.js → index-v2epyzbm.js} +75 -57
  35. package/dist/{index-fvjthct0.js → index-vdy273xw.js} +107 -20
  36. package/dist/{index-jrap43gc.js → index-w1avzkdt.js} +1 -1
  37. package/dist/{index-r9f4f6s1.js → index-zhwwp8zz.js} +64 -8
  38. package/dist/index.js +1119 -247
  39. package/dist/{logger-dygt96rn.js → logger-shetp43v.js} +1 -1
  40. package/dist/{message-fts-rowid-map-cvpy2dmb.js → message-fts-rowid-map-bpexnsdj.js} +6 -5
  41. package/dist/{message-index-bounded-g9hgresf.js → message-index-bounded-d4r3weh0.js} +14 -13
  42. package/dist/{message-index-74qdqmq7.js → message-index-mvag9crh.js} +14 -13
  43. package/dist/{message-time-backfill-ssshbdy8.js → message-time-backfill-kc10yrcj.js} +3 -3
  44. package/dist/migration-worker.js +12 -11
  45. package/dist/{project-embedding-registry-vf1ncptn.js → project-embedding-registry-cfrg952x.js} +13 -12
  46. package/dist/raw-ordinal-warmup-worker.js +136 -101
  47. package/dist/{read-session-chunk-chepqmw5.js → read-session-chunk-7g4zvpd8.js} +9 -8
  48. package/dist/{read-session-raw-9s3xn7fc.js → read-session-raw-0fsjh10f.js} +4 -3
  49. package/dist/{safe-notification-target-2rkvkmw8.js → safe-notification-target-zcpchea6.js} +2 -2
  50. package/dist/search-archive-qbhp7e89.js +21 -0
  51. package/dist/{search-6ztbx25v.js → search-hp4g3g9v.js} +22 -21
  52. package/dist/{sqlite-fsp0sf3r.js → sqlite-d67n6dtr.js} +1 -1
  53. package/dist/{storage-memory-yxxc5v4n.js → storage-memory-9g882j7a.js} +2 -2
  54. package/dist/{storage-tags-1kets0q8.js → storage-tags-m2qcp1g2.js} +7 -5
  55. package/dist/subagent-entry.js +26 -25
  56. package/dist/tag-snapshot-worker-pi.js +66 -55
  57. package/package.json +1 -1
  58. package/dist/embedding-backfill-vwag34t0.js +0 -23
  59. 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-rhprywn6.js";
64
- import"./index-jrap43gc.js";
65
- import"./index-1kcfwk9c.js";
66
- import"./index-rrwv9y2k.js";
67
- import"./index-7bqrfyny.js";
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,
@@ -1,54 +1,55 @@
1
1
  import {
2
2
  TOKEN_BUDGET_TOOL_REFUSAL
3
- } from "./index-r9f4f6s1.js";
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-7bqrfyny.js";
9
+ } from "./index-fgs78jyd.js";
10
10
  import {
11
11
  resolveProjectIdentityForSession
12
- } from "./index-g7p75667.js";
13
- import"./index-rrwv9y2k.js";
14
- import"./index-apgwdby5.js";
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-gp928w10.js";
18
+ } from "./index-mtvvhcw4.js";
19
19
  import"./index-399p688g.js";
20
- import"./index-vktahpdj.js";
21
- import"./index-yygsh681.js";
22
- import"./index-gdjv1nnd.js";
23
- import"./index-jrap43gc.js";
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-1kcfwk9c.js";
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-xxn1tpnv.js";
34
+ } from "./index-jt0g3hn0.js";
34
35
  import"./index-bxmf4dhr.js";
35
- import"./index-d8gc0112.js";
36
- import"./index-xnch62s6.js";
37
- import"./index-2mmy81qt.js";
38
- import"./index-vmcgew7x.js";
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-svgkv4g2.js";
41
+ import"./index-qerzchrs.js";
41
42
  import"./index-yhzhdp3m.js";
42
- import"./index-z2rkv0mb.js";
43
- import"./index-fvjthct0.js";
44
- import"./index-rhprywn6.js";
43
+ import"./index-b8am7tns.js";
44
+ import"./index-vdy273xw.js";
45
+ import"./index-bttctq07.js";
45
46
  import"./index-6x556c2q.js";
46
- import"./index-d43hmn31.js";
47
+ import"./index-af9t637y.js";
47
48
  import"./index-1cvyaw9a.js";
48
- import"./index-d21pdr8v.js";
49
- import"./index-e1rza8gp.js";
50
- import"./index-qpq6w67c.js";
51
- import"./index-d4dt19md.js";
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-rrwv9y2k.js";
4
- import"./index-g7p75667.js";
3
+ } from "./index-hws5f0z9.js";
4
+ import"./index-p63nwn5v.js";
5
5
  import"./index-0h2mkab2.js";
6
- import"./index-7bqrfyny.js";
7
- import"./index-apgwdby5.js";
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-gp928w10.js";
12
+ } from "./index-mtvvhcw4.js";
13
13
  import"./index-399p688g.js";
14
- import"./index-vktahpdj.js";
15
- import"./index-yygsh681.js";
16
- import"./index-gdjv1nnd.js";
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-jrap43gc.js";
22
+ } from "./index-w1avzkdt.js";
20
23
  import"./index-135e8hvg.js";
21
24
  import"./index-8976mezv.js";
22
- import"./index-1kcfwk9c.js";
25
+ import"./index-my0dn413.js";
23
26
  import {
24
27
  normalizeTagSnapshotRow2,
25
28
  TAG_SELECT_COLUMNS2
26
- } from "./index-rhprywn6.js";
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-4bv5bttd.js";
32
- import"./index-d4dt19md.js";
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
- try {
190
- if (request.test?.openDelayMs)
191
- await delay(request.test.openDelayMs);
192
- db = new Database2(request.path, { readonly: true });
193
- opened = true;
194
- db.exec("PRAGMA query_only = ON; PRAGMA busy_timeout = 50; PRAGMA cache_size = -1024");
195
- generationStatement = db.prepare(`SELECT
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
- const version = getPersistedSchemaVersion(db);
199
- persistedVersion = version;
200
- if (version > LATEST_SUPPORTED_VERSION)
201
- throw new UnsupportedSchema(`shared database schema v${version} is newer than this build supports (v${LATEST_SUPPORTED_VERSION}); update and restart this host`);
202
- await stream("tags");
203
- await stream("fallback");
204
- if (request.test?.crash === "before-end")
205
- throw new Error("injected worker crash before completion");
206
- const final = sample(db);
207
- if (final.revision !== generation.revision || final.durable !== generation.durable)
208
- throw new StaleGeneration("session tags changed after final page");
209
- db.close();
210
- db = undefined;
211
- port.postMessage({
212
- ...envelope(),
213
- type: "done",
214
- maxReadTransactionMs,
215
- packetCount,
216
- packetBytes
217
- });
218
- if (request.test?.crash === "after-end")
219
- process.exitCode = 1;
220
- } catch (error) {
221
- port.postMessage({
222
- ...envelope(),
223
- type: "failed",
224
- code: error instanceof StaleGeneration ? "stale" : error instanceof UnsupportedSchema ? "schema" : opened ? "failed" : "open",
225
- persistedVersion,
226
- supportedVersion: LATEST_SUPPORTED_VERSION,
227
- reason: error instanceof Error ? error.message : String(error)
228
- });
229
- } finally {
230
- db?.close();
231
- port.close();
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@cortexkit/pi-magic-context",
3
- "version": "0.49.18",
3
+ "version": "0.49.20",
4
4
  "type": "module",
5
5
  "description": "Pi and OMP coding agent extension for Magic Context — cross-session memory and context management",
6
6
  "main": "dist/index.js",
@@ -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
- };