@cortexkit/pi-magic-context 0.49.84 → 0.49.85

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 (32) hide show
  1. package/dist/auto-search-worker.js +3 -3
  2. package/dist/chunk-embedding-write-worker.js +5 -4
  3. package/dist/{embedding-backfill-yh10bmx5.js → embedding-backfill-7a01ns95.js} +6 -5
  4. package/dist/embedding-worker.js +14 -27
  5. package/dist/{index-e0zdn1p3.js → index-53fgdt6n.js} +1 -1
  6. package/dist/{index-47g3pgzk.js → index-7v0z62ek.js} +6 -6
  7. package/dist/{index-xz5b9t4g.js → index-7yz95h83.js} +38 -736
  8. package/dist/index-8x8wtn3t.js +1083 -0
  9. package/dist/{index-hna2sxy8.js → index-94z1xzmr.js} +3 -3
  10. package/dist/{index-0apatd37.js → index-bjr11ay6.js} +24 -26
  11. package/dist/{index-gdy08gn6.js → index-ex9te7tc.js} +1 -1
  12. package/dist/{index-qxwed9sk.js → index-fd57gfnn.js} +4 -4
  13. package/dist/{index-nmmge3j6.js → index-gbc29ysq.js} +1 -1
  14. package/dist/{index-txcs0vnj.js → index-rqdjb6j3.js} +461 -273
  15. package/dist/{index-k8xz22jc.js → index-sqp84q6s.js} +1 -1
  16. package/dist/{index-a7kcxjc4.js → index-ty0tvxhm.js} +25 -18
  17. package/dist/{index-3g1wy4z9.js → index-wy6h2wn2.js} +22 -10
  18. package/dist/index.js +61 -57
  19. package/dist/migration-worker.js +5 -4
  20. package/dist/{project-embedding-registry-3sss39rx.js → project-embedding-registry-agkd7egh.js} +7 -4
  21. package/dist/raw-ordinal-warmup-worker.js +2 -2
  22. package/dist/{render-05gdzxc2.js → render-rphfegr8.js} +7 -6
  23. package/dist/{search-archive-32pv4687.js → search-archive-7p43e77j.js} +1 -1
  24. package/dist/{search-dh4ryftv.js → search-pwafh0v5.js} +9 -8
  25. package/dist/{store-mmd2tmm1.js → store-ekaexkvc.js} +1 -1
  26. package/dist/{store-reader-ypd6m0ke.js → store-reader-vwphd51b.js} +1 -1
  27. package/dist/subagent-entry.js +17 -17
  28. package/dist/tag-snapshot-worker-pi.js +5 -4
  29. package/dist/{v2-archive-reader-1ny52akc.js → v2-archive-reader-qc4c9wrp.js} +1 -1
  30. package/package.json +1 -1
  31. package/dist/index-81nthk8j.js +0 -193
  32. /package/dist/{index-2zre7sck.js → index-ddfjg278.js} +0 -0
@@ -3,7 +3,7 @@ import {
3
3
  RAW_MESSAGE_TYPES2,
4
4
  V2StoreReaderPool2,
5
5
  V2StoreReader2
6
- } from "./index-2zre7sck.js";
6
+ } from "./index-ddfjg278.js";
7
7
  import"./index-n0zjvs3h.js";
8
8
  import"./index-2qtx0q6h.js";
9
9
  export {
@@ -8,21 +8,24 @@ import {
8
8
  log2
9
9
  } from "./index-tm11k42a.js";
10
10
  import"./index-dnp1jjar.js";
11
+ import {
12
+ setStoragePrivatePermissionEnforcement
13
+ } from "./index-8x8wtn3t.js";
11
14
  import {
12
15
  resolveProjectIdentityForSession
13
- } from "./index-hna2sxy8.js";
16
+ } from "./index-94z1xzmr.js";
14
17
  import"./index-2qtx0q6h.js";
18
+ import"./index-fapenpch.js";
15
19
  import {
16
20
  openDatabase
17
- } from "./index-xz5b9t4g.js";
18
- import"./index-fapenpch.js";
21
+ } from "./index-7yz95h83.js";
19
22
  import"./index-3bb24eb6.js";
20
23
  import"./index-8sqebjzk.js";
21
24
  import"./index-wfqysrwq.js";
22
25
  import"./index-x2n261wp.js";
23
26
  import"./index-xjhq27z9.js";
24
27
  import"./index-ghp32f9m.js";
25
- import"./index-e0zdn1p3.js";
28
+ import"./index-53fgdt6n.js";
26
29
  import"./index-jhmz9tgv.js";
27
30
  import"./index-135e8hvg.js";
28
31
  import"./index-n0zjvs3h.js";
@@ -34,33 +37,30 @@ import {
34
37
  resolvePiHarnessKind,
35
38
  reportSubagentStartupError,
36
39
  registerMagicContextTools
37
- } from "./index-a7kcxjc4.js";
40
+ } from "./index-ty0tvxhm.js";
38
41
  import"./index-vcegxfwg.js";
39
42
  import"./index-5rcjs14a.js";
40
43
  import"./index-cxczethe.js";
41
- import"./index-txcs0vnj.js";
42
- import"./index-3g1wy4z9.js";
44
+ import"./index-rqdjb6j3.js";
45
+ import"./index-wy6h2wn2.js";
43
46
  import"./index-hgd00nas.js";
44
47
  import"./index-9p40dgkm.js";
45
- import"./index-gdy08gn6.js";
48
+ import"./index-ex9te7tc.js";
46
49
  import"./index-yhzhdp3m.js";
47
- import"./index-47g3pgzk.js";
48
- import"./index-0apatd37.js";
50
+ import"./index-7v0z62ek.js";
51
+ import"./index-bjr11ay6.js";
49
52
  import"./index-0t9xfj3x.js";
50
53
  import"./index-nh4srq1p.js";
51
54
  import"./index-6x556c2q.js";
52
- import"./index-2zre7sck.js";
53
- import"./index-nmmge3j6.js";
55
+ import"./index-ddfjg278.js";
56
+ import"./index-gbc29ysq.js";
54
57
  import"./index-8d2z6503.js";
55
- import"./index-qxwed9sk.js";
58
+ import"./index-fd57gfnn.js";
56
59
  import"./index-fvfq9gva.js";
57
- import"./index-k8xz22jc.js";
60
+ import"./index-sqp84q6s.js";
58
61
  import"./index-29nw7n1r.js";
59
62
  import"./index-3s39a1md.js";
60
63
  import"./index-1ts77n1b.js";
61
- import {
62
- setStoragePrivatePermissionEnforcement
63
- } from "./index-81nthk8j.js";
64
64
 
65
65
  // src/subagent-entry.ts
66
66
  import { readFileSync } from "node:fs";
@@ -1,15 +1,16 @@
1
1
  import {
2
2
  Database2
3
3
  } from "./index-2qtx0q6h.js";
4
- import"./index-hna2sxy8.js";
4
+ import"./index-94z1xzmr.js";
5
5
  import"./index-0h2mkab2.js";
6
6
  import"./index-dnp1jjar.js";
7
7
  import"./index-tm11k42a.js";
8
+ import"./index-8x8wtn3t.js";
9
+ import"./index-fapenpch.js";
8
10
  import {
9
11
  LATEST_SUPPORTED_VERSION,
10
12
  getPersistedSchemaVersion
11
- } from "./index-xz5b9t4g.js";
12
- import"./index-fapenpch.js";
13
+ } from "./index-7yz95h83.js";
13
14
  import"./index-3bb24eb6.js";
14
15
  import"./index-8sqebjzk.js";
15
16
  import"./index-wfqysrwq.js";
@@ -18,7 +19,7 @@ import {
18
19
  } from "./index-x2n261wp.js";
19
20
  import"./index-xjhq27z9.js";
20
21
  import"./index-ghp32f9m.js";
21
- import"./index-e0zdn1p3.js";
22
+ import"./index-53fgdt6n.js";
22
23
  import {
23
24
  tagRevisionKey
24
25
  } from "./index-jhmz9tgv.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  readV2ArchiveOffThread2,
3
3
  serveV2ArchiveReads2
4
- } from "./index-qxwed9sk.js";
4
+ } from "./index-fd57gfnn.js";
5
5
  import"./index-8sqebjzk.js";
6
6
  import"./index-2qtx0q6h.js";
7
7
  import"./index-x2n261wp.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cortexkit/pi-magic-context",
3
- "version": "0.49.84",
3
+ "version": "0.49.85",
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,193 +0,0 @@
1
- // ../plugin/src/shared/storage-permissions.ts
2
- import { randomBytes } from "node:crypto";
3
- import {
4
- chmodSync,
5
- closeSync,
6
- createWriteStream,
7
- fsyncSync,
8
- lstatSync,
9
- mkdirSync,
10
- openSync,
11
- readdirSync,
12
- readlinkSync,
13
- readSync,
14
- renameSync,
15
- rmSync,
16
- symlinkSync,
17
- writeFileSync,
18
- writeSync
19
- } from "node:fs";
20
- import { open as openAsync, writeFile as writeFileAsync } from "node:fs/promises";
21
- import { dirname, join } from "node:path";
22
- var enforcePrivateStoragePermissions = true;
23
- function setStoragePrivatePermissionEnforcement(enforce) {
24
- enforcePrivateStoragePermissions = enforce;
25
- }
26
- function shouldEnforcePrivateStoragePermissions() {
27
- return enforcePrivateStoragePermissions;
28
- }
29
- function ensureStorageDirectorySync(directory, forcePrivate = false, recursive = true) {
30
- const privateMode = forcePrivate || shouldEnforcePrivateStoragePermissions();
31
- mkdirSync(directory, {
32
- recursive,
33
- ...privateMode ? { mode: 448 } : {}
34
- });
35
- }
36
- function ensurePrivateStorageDirectorySync(directory) {
37
- ensureStorageDirectorySync(directory, true);
38
- const stat = lstatSync(directory);
39
- if (!stat.isDirectory() || stat.isSymbolicLink())
40
- throw new Error("Private storage directory is not a real directory");
41
- if (process.platform !== "win32")
42
- chmodSync(directory, 448);
43
- }
44
- function writeStorageFileSync(filePath, content, options = {}) {
45
- const { forcePrivate = false, ...writeOptions } = options;
46
- const privateMode = forcePrivate || shouldEnforcePrivateStoragePermissions();
47
- writeFileSync(filePath, content, {
48
- ...writeOptions,
49
- ...privateMode ? { mode: 384 } : {}
50
- });
51
- }
52
- function writeStorageFileAtomicSync(filePath, content, forcePrivate = false) {
53
- ensureStorageDirectorySync(dirname(filePath), forcePrivate);
54
- const tempPath = `${filePath}.${process.pid}.${randomBytes(6).toString("hex")}.tmp`;
55
- try {
56
- writeStorageFileSync(tempPath, content, { flag: "wx", forcePrivate });
57
- renameSync(tempPath, filePath);
58
- } catch (error) {
59
- rmSync(tempPath, { force: true });
60
- throw error;
61
- }
62
- }
63
- function syncStorageDirectorySync(directory) {
64
- const fd = openSync(directory, "r");
65
- try {
66
- fsyncSync(fd);
67
- } finally {
68
- closeSync(fd);
69
- }
70
- }
71
- function writeStorageFileDurableAtomicSync(filePath, content, afterTempSync) {
72
- const directory = dirname(filePath);
73
- ensurePrivateStorageDirectorySync(directory);
74
- const tempPath = `${filePath}.${process.pid}.${randomBytes(12).toString("hex")}.tmp`;
75
- let fd;
76
- try {
77
- fd = openStorageFileSync(tempPath, "wx", true);
78
- writeFileSync(fd, content, "utf8");
79
- fsyncSync(fd);
80
- closeSync(fd);
81
- fd = undefined;
82
- afterTempSync?.();
83
- renameSync(tempPath, filePath);
84
- syncStorageDirectorySync(directory);
85
- syncStorageDirectorySync(dirname(directory));
86
- } finally {
87
- if (fd !== undefined)
88
- closeSync(fd);
89
- rmSync(tempPath, { force: true });
90
- }
91
- }
92
- function copyStorageFileSync(sourcePath, destinationPath, forcePrivate = false) {
93
- ensureStorageDirectorySync(dirname(destinationPath), forcePrivate);
94
- const privateMode = forcePrivate || shouldEnforcePrivateStoragePermissions();
95
- const sourceFd = openSync(sourcePath, "r");
96
- let destinationFd;
97
- try {
98
- destinationFd = openSync(destinationPath, "wx", privateMode ? 384 : 438);
99
- const buffer = Buffer.allocUnsafe(1024 * 1024);
100
- for (;; ) {
101
- const bytesRead = readSync(sourceFd, buffer, 0, buffer.length, null);
102
- if (bytesRead === 0)
103
- break;
104
- let offset = 0;
105
- while (offset < bytesRead) {
106
- offset += writeSync(destinationFd, buffer, offset, bytesRead - offset);
107
- }
108
- }
109
- } catch (error) {
110
- if (destinationFd !== undefined)
111
- rmSync(destinationPath, { force: true });
112
- throw error;
113
- } finally {
114
- closeSync(sourceFd);
115
- if (destinationFd !== undefined)
116
- closeSync(destinationFd);
117
- }
118
- }
119
- function copyStorageTreeSync(sourcePath, destinationPath, forcePrivate = false) {
120
- const stat = lstatSync(sourcePath);
121
- if (stat.isSymbolicLink()) {
122
- ensureStorageDirectorySync(dirname(destinationPath), forcePrivate);
123
- symlinkSync(readlinkSync(sourcePath), destinationPath);
124
- return;
125
- }
126
- if (!stat.isDirectory()) {
127
- copyStorageFileSync(sourcePath, destinationPath, forcePrivate);
128
- return;
129
- }
130
- ensureStorageDirectorySync(destinationPath, forcePrivate);
131
- for (const entry of readdirSync(sourcePath)) {
132
- copyStorageTreeSync(join(sourcePath, entry), join(destinationPath, entry), forcePrivate);
133
- }
134
- }
135
- function openStorageFileSync(filePath, flags, forcePrivate = false) {
136
- ensureStorageDirectorySync(dirname(filePath), forcePrivate);
137
- const privateMode = forcePrivate || shouldEnforcePrivateStoragePermissions();
138
- return openSync(filePath, flags, privateMode ? 384 : 438);
139
- }
140
- async function writeStorageFileAsync(filePath, content, forcePrivate = false) {
141
- const privateMode = forcePrivate || shouldEnforcePrivateStoragePermissions();
142
- ensureStorageDirectorySync(dirname(filePath), privateMode);
143
- await writeFileAsync(filePath, content, privateMode ? { mode: 384 } : undefined);
144
- }
145
- async function writeStorageFileHandleAsync(handle, content) {
146
- await handle.writeFile(content);
147
- }
148
- async function createStorageFileHandleAsync(filePath, flags, forcePrivate = false) {
149
- const privateMode = forcePrivate || shouldEnforcePrivateStoragePermissions();
150
- return openAsync(filePath, flags, privateMode ? 384 : undefined);
151
- }
152
- function tightenStorageTreeSync(root) {
153
- if (!shouldEnforcePrivateStoragePermissions() || process.platform === "win32") {
154
- return { tightened: 0, failures: 0 };
155
- }
156
- let tightened = 0;
157
- let failures = 0;
158
- const visit = (entryPath) => {
159
- let stat;
160
- try {
161
- stat = lstatSync(entryPath);
162
- } catch {
163
- failures++;
164
- return;
165
- }
166
- if (stat.isSymbolicLink())
167
- return;
168
- const mode = stat.isDirectory() ? 448 : 384;
169
- if ((stat.mode & 63) !== 0 || (stat.mode & 511) !== mode) {
170
- try {
171
- chmodSync(entryPath, mode);
172
- tightened++;
173
- } catch {
174
- failures++;
175
- }
176
- }
177
- if (!stat.isDirectory())
178
- return;
179
- let entries;
180
- try {
181
- entries = readdirSync(entryPath);
182
- } catch {
183
- failures++;
184
- return;
185
- }
186
- for (const entry of entries)
187
- visit(join(entryPath, entry));
188
- };
189
- visit(root);
190
- return { tightened, failures };
191
- }
192
-
193
- export { setStoragePrivatePermissionEnforcement, shouldEnforcePrivateStoragePermissions, ensureStorageDirectorySync, ensurePrivateStorageDirectorySync, writeStorageFileSync, writeStorageFileAtomicSync, syncStorageDirectorySync, writeStorageFileDurableAtomicSync, copyStorageFileSync, copyStorageTreeSync, writeStorageFileAsync, writeStorageFileHandleAsync, createStorageFileHandleAsync, tightenStorageTreeSync };
File without changes