@cortexkit/opencode-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.
- package/dist/{announcement-p41dde4h.js → announcement-fnyxaahs.js} +3 -1
- package/dist/auto-search-worker.js +3 -3
- package/dist/chunk-embedding-write-worker.js +5 -4
- package/dist/{context-3sajdysh.js → context-bjfwzbts.js} +27 -26
- package/dist/{derive-budgets-0kcek5ex.js → derive-budgets-90869322.js} +3 -1
- package/dist/{embedding-backfill-k994xdas.js → embedding-backfill-v6sw58m8.js} +7 -5
- package/dist/embedding-worker.js +15 -27
- package/dist/features/magic-context/memory/embedding-worker-boundary.test-support.d.ts +24 -0
- package/dist/features/magic-context/memory/embedding-worker-boundary.test-support.d.ts.map +1 -0
- package/dist/features/magic-context/memory/embedding-worker-client.d.ts +35 -1
- package/dist/features/magic-context/memory/embedding-worker-client.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-worker-loop.d.ts +57 -0
- package/dist/features/magic-context/memory/embedding-worker-loop.d.ts.map +1 -0
- package/dist/features/magic-context/project-embedding-registry.d.ts +6 -1
- package/dist/features/magic-context/project-embedding-registry.d.ts.map +1 -1
- package/dist/features/magic-context/storage-db.d.ts.map +1 -1
- package/dist/hooks/magic-context/lkg-recovery-fence.d.ts.map +1 -1
- package/dist/{index-tvbkemec.js → index-08jfpny9.js} +1 -1
- package/dist/{index-k0jnsjcp.js → index-0rge5rkh.js} +6 -6
- package/dist/{index-0wehkw71.js → index-1pf5qrx4.js} +4 -4
- package/dist/{index-98qy103c.js → index-2kf73btc.js} +1 -1
- package/dist/{index-vpw46557.js → index-3dtzyred.js} +1 -1
- package/dist/{index-bd34njzg.js → index-4ntnt8ee.js} +1 -1
- package/dist/{index-w2wpx7t5.js → index-4w5rx7de.js} +1 -1
- package/dist/{index-xd0ww0ns.js → index-798s7c8s.js} +1 -1
- package/dist/{index-fpqdbb67.js → index-7svecf3m.js} +3 -3
- package/dist/{index-tqnvn9pa.js → index-9fsxmjs6.js} +3 -3
- package/dist/{v2/server-fvnzcnww.js → index-c5tmzym6.js} +192 -11
- package/dist/{index-w8dcjt7f.js → index-k0tb2z28.js} +1 -1
- package/dist/{index-zb4h9nrk.js → index-k50xhjw1.js} +202 -14
- package/dist/{index-qybp04ff.js → index-kqnef2tg.js} +3 -3
- package/dist/{index-szwrpyac.js → index-nny4gm06.js} +1 -1
- package/dist/{index-fgy6hnr3.js → index-pw279hmt.js} +2 -2
- package/dist/{index-xjfan0za.js → index-qvn3q9f1.js} +37 -37
- package/dist/{index-shpyv8gq.js → index-s8ks5nz4.js} +16 -9
- package/dist/{index-cfy5k1pa.js → index-sbr58jaf.js} +5 -5
- package/dist/{index-d028gmgp.js → index-tzbcb8yt.js} +14 -14
- package/dist/{index-skwwbcnv.js → index-w6v4dw5f.js} +24 -24
- package/dist/{index-5wjv4c41.js → index-xccywqdj.js} +15 -15
- package/dist/{index-kthfyf45.js → index-zmqx48vt.js} +3 -3
- package/dist/index.js +33 -33
- package/dist/migration-worker.js +4 -3
- package/dist/{project-embedding-registry-y3z36mjy.js → project-embedding-registry-q80scexh.js} +6 -4
- package/dist/raw-ordinal-warmup-worker.js +2 -2
- package/dist/{recomp-orchestrator-m2s3jpvj.js → recomp-orchestrator-xzs0a455.js} +16 -15
- package/dist/{render-p2j7rn9a.js → render-yqp7q79f.js} +8 -7
- package/dist/{search-archive-hz9xh7nh.js → search-archive-r4h96j2z.js} +2 -2
- package/dist/{search-ksx0f1qd.js → search-ztgy3ya6.js} +12 -10
- package/dist/shared/storage-file-mutex.d.ts.map +1 -1
- package/dist/shared/storage-permissions.d.ts +5 -3
- package/dist/shared/storage-permissions.d.ts.map +1 -1
- package/dist/{store-x0swqb5c.js → store-n4yz3n66.js} +2 -2
- package/dist/{store-reader-tsv1w4vt.js → store-reader-nf8z86n9.js} +1 -1
- package/dist/{transform-postprocess-phase-1wb2rrr1.js → transform-postprocess-phase-39a5hm2a.js} +17 -16
- package/dist/v2/auto-search-worker.js +3 -3
- package/dist/v2/chunk-embedding-write-worker.js +5 -4
- package/dist/v2/{context-at9nje0j.js → context-k2rrqzf4.js} +39 -39
- package/dist/v2/{derive-budgets-xbwcap8k.js → derive-budgets-ecjy1aqh.js} +4 -2
- package/dist/v2/{embedding-backfill-hjvjxp7d.js → embedding-backfill-k8kqnwfq.js} +7 -5
- package/dist/v2/embedding-worker.js +15 -27
- package/dist/v2/migration-worker.js +4 -3
- package/dist/v2/{project-embedding-registry-mzsvyads.js → project-embedding-registry-2jp1antr.js} +6 -4
- package/dist/v2/raw-ordinal-warmup-worker.js +2 -2
- package/dist/v2/{recomp-orchestrator-nhef90gc.js → recomp-orchestrator-jnbxbsc8.js} +17 -16
- package/dist/v2/{render-c9r2g2jv.js → render-fezgh7pa.js} +8 -7
- package/dist/v2/{search-archive-80ckv9kq.js → search-archive-zz1kza50.js} +2 -2
- package/dist/v2/{search-t06js5dc.js → search-h5w7510x.js} +11 -9
- package/dist/v2/{server-4z964n1c.js → server-3p6b0qya.js} +1 -1
- package/dist/v2/{server-3cndh146.js → server-4wwwm2ya.js} +24 -24
- package/dist/v2/{server-mr9rqn0y.js → server-97w51d8n.js} +4 -4
- package/dist/v2/{server-gx1s06dx.js → server-98hsp35q.js} +2 -2
- package/dist/v2/{server-d706s5xn.js → server-b93f0bqh.js} +205 -17
- package/dist/v2/{server-dfesqfv1.js → server-brgandk4.js} +1 -1
- package/dist/v2/{server-w1jfaxas.js → server-cwtehwbb.js} +1 -1
- package/dist/v2/{server-y4favn4d.js → server-e2k9mt86.js} +1 -1
- package/dist/v2/{server-68q80y27.js → server-hn8b7sfe.js} +16 -9
- package/dist/v2/{server-pejjj0nv.js → server-mbkwcwgw.js} +1 -1
- package/dist/v2/{server-ry6rpspz.js → server-n5zr7190.js} +15 -15
- package/dist/v2/{server-210rc0z9.js → server-ps6rz88g.js} +1 -1
- package/dist/{index-fvnzcnww.js → v2/server-r2es6zt7.js} +192 -11
- package/dist/v2/{server-bt546axy.js → server-rz4snd3x.js} +3 -3
- package/dist/v2/{server-3hhakg5a.js → server-s76ty4ws.js} +13 -13
- package/dist/v2/{server-hhw6rzsn.js → server-w7mpvkpj.js} +1 -1
- package/dist/v2/{server-863bwkga.js → server-x77hd658.js} +6 -6
- package/dist/v2/{server-sy98vksf.js → server-xa8fefhw.js} +3 -3
- package/dist/v2/{server-cce6m31c.js → server-ytqps2xa.js} +1 -1
- package/dist/v2/server.js +6 -4
- package/dist/v2/{store-reader-paamf0ac.js → store-reader-2vhx33n6.js} +1 -1
- package/dist/v2/{store-h3s95ywe.js → store-y56y034s.js} +2 -2
- package/dist/v2/{v2-archive-reader-1zzteaa5.js → v2-archive-reader-e2w39c3p.js} +1 -1
- package/dist/v2/{wrapup-orchestrator-9y98qcqz.js → wrapup-orchestrator-mmje3etf.js} +16 -15
- package/dist/{v2-archive-reader-3yjxaj5z.js → v2-archive-reader-8dsngf2j.js} +1 -1
- package/dist/{wrapup-orchestrator-sa3a075a.js → wrapup-orchestrator-sm6pwf3p.js} +17 -16
- package/package.json +1 -1
- package/src/shared/storage-file-mutex-review.test.ts +125 -2
- package/src/shared/storage-file-mutex.ts +17 -8
- package/src/shared/storage-permissions-creators.test.ts +194 -0
- package/src/shared/storage-permissions-startup.test.ts +476 -0
- package/src/shared/storage-permissions.ts +227 -12
- /package/dist/{index-rdh63md0.js → index-1y4y98r1.js} +0 -0
- /package/dist/v2/{server-9nk5h6w6.js → server-qyazxy92.js} +0 -0
|
@@ -61,6 +61,10 @@ import {
|
|
|
61
61
|
parseJsonc,
|
|
62
62
|
detectConfigFile
|
|
63
63
|
} from "./index-sd3egckz.js";
|
|
64
|
+
import {
|
|
65
|
+
ensureStorageDirectorySync,
|
|
66
|
+
writeStorageFileAtomicSync
|
|
67
|
+
} from "./index-c5tmzym6.js";
|
|
64
68
|
import {
|
|
65
69
|
catalogOutputReserve,
|
|
66
70
|
setOutputReserveConfig,
|
|
@@ -70,7 +74,7 @@ import {
|
|
|
70
74
|
deriveTriggerBudget2,
|
|
71
75
|
resolveHistorianProducerLimits2,
|
|
72
76
|
producerSourceLocalBudget2
|
|
73
|
-
} from "./index-
|
|
77
|
+
} from "./index-zmqx48vt.js";
|
|
74
78
|
import {
|
|
75
79
|
withContentLanguageDirective,
|
|
76
80
|
buildPrimaryLanguageDirective,
|
|
@@ -107,13 +111,13 @@ import {
|
|
|
107
111
|
import {
|
|
108
112
|
shouldSkipHomeProjectMemory,
|
|
109
113
|
resolveProjectIdentity
|
|
110
|
-
} from "./index-
|
|
114
|
+
} from "./index-7svecf3m.js";
|
|
111
115
|
import {
|
|
112
116
|
getSchemaFenceRejection,
|
|
113
117
|
LATEST_SUPPORTED_VERSION,
|
|
114
118
|
getPersistedSchemaVersion,
|
|
115
119
|
openDatabase
|
|
116
|
-
} from "./index-
|
|
120
|
+
} from "./index-xccywqdj.js";
|
|
117
121
|
import {
|
|
118
122
|
areRustHistorianSyntheticParts2,
|
|
119
123
|
isStrictGapHealingMessage2,
|
|
@@ -130,7 +134,7 @@ import {
|
|
|
130
134
|
resolveStoredPathWorkspaceIdentity,
|
|
131
135
|
sourceNameForMemory,
|
|
132
136
|
computeWorkspaceEpochFingerprint
|
|
133
|
-
} from "./index-
|
|
137
|
+
} from "./index-4w5rx7de.js";
|
|
134
138
|
import {
|
|
135
139
|
BoundedSessionMap
|
|
136
140
|
} from "./index-jrj95cce.js";
|
|
@@ -202,7 +206,7 @@ import {
|
|
|
202
206
|
getProjectState,
|
|
203
207
|
recordSubagentInvocation,
|
|
204
208
|
getLatestHistorianInvocationId
|
|
205
|
-
} from "./index-
|
|
209
|
+
} from "./index-w6v4dw5f.js";
|
|
206
210
|
import {
|
|
207
211
|
clearCompressionDepth,
|
|
208
212
|
clearCompressionDepthRange,
|
|
@@ -269,7 +273,7 @@ import {
|
|
|
269
273
|
getSessionNotes,
|
|
270
274
|
getReadySmartNotes,
|
|
271
275
|
insertPrimerCandidates
|
|
272
|
-
} from "./index-
|
|
276
|
+
} from "./index-4ntnt8ee.js";
|
|
273
277
|
import {
|
|
274
278
|
pushNotification2
|
|
275
279
|
} from "./index-fzgyvsb1.js";
|
|
@@ -287,13 +291,13 @@ import {
|
|
|
287
291
|
getProjectChunkEmbeddingModelId2,
|
|
288
292
|
getProjectEmbeddingMaxInputTokens2,
|
|
289
293
|
embedItemsWindowBounded2
|
|
290
|
-
} from "./index-
|
|
294
|
+
} from "./index-s8ks5nz4.js";
|
|
291
295
|
import {
|
|
292
296
|
renderUserFacingFailure,
|
|
293
297
|
userFacingFailureCode,
|
|
294
298
|
promoteSessionFactsDurable,
|
|
295
299
|
embedPromotedFacts
|
|
296
|
-
} from "./index-
|
|
300
|
+
} from "./index-pw279hmt.js";
|
|
297
301
|
import {
|
|
298
302
|
isMarkerCandidateBasisCurrent2,
|
|
299
303
|
invalidateMarkerCandidateBasis2,
|
|
@@ -321,9 +325,6 @@ import {
|
|
|
321
325
|
import {
|
|
322
326
|
piModelRefToCanonical
|
|
323
327
|
} from "./index-avwt563y.js";
|
|
324
|
-
import {
|
|
325
|
-
sameProjectDirectory
|
|
326
|
-
} from "./index-knvkbfvh.js";
|
|
327
328
|
import {
|
|
328
329
|
getErrorMessage,
|
|
329
330
|
describeError
|
|
@@ -336,9 +337,8 @@ import {
|
|
|
336
337
|
WriteTransactionSteps
|
|
337
338
|
} from "./index-m0pwswv9.js";
|
|
338
339
|
import {
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
} from "./index-fvnzcnww.js";
|
|
340
|
+
sameProjectDirectory
|
|
341
|
+
} from "./index-knvkbfvh.js";
|
|
342
342
|
|
|
343
343
|
// src/agents/permissions.ts
|
|
344
344
|
function buildAllowOnlyPermission(allowedTools, agentLabel) {
|
|
@@ -75,11 +75,18 @@ import {
|
|
|
75
75
|
import {
|
|
76
76
|
layoutLkgPrefix,
|
|
77
77
|
assembleLkgPrefix
|
|
78
|
-
} from "./index-
|
|
78
|
+
} from "./index-4w5rx7de.js";
|
|
79
|
+
import {
|
|
80
|
+
ensurePrivateStorageDirectorySync,
|
|
81
|
+
writeStorageFileSync,
|
|
82
|
+
writeStorageFileAtomicSync,
|
|
83
|
+
syncStorageDirectorySync,
|
|
84
|
+
writeStorageFileDurableAtomicSync
|
|
85
|
+
} from "./index-c5tmzym6.js";
|
|
79
86
|
import {
|
|
80
87
|
gaDatabasePath2,
|
|
81
88
|
V2StoreReader2
|
|
82
|
-
} from "./index-
|
|
89
|
+
} from "./index-1y4y98r1.js";
|
|
83
90
|
import {
|
|
84
91
|
markHostInstructionRow,
|
|
85
92
|
hostInstructionRowID,
|
|
@@ -93,13 +100,6 @@ import {
|
|
|
93
100
|
import {
|
|
94
101
|
logSlowWriteTransaction
|
|
95
102
|
} from "./index-m0pwswv9.js";
|
|
96
|
-
import {
|
|
97
|
-
ensurePrivateStorageDirectorySync,
|
|
98
|
-
writeStorageFileSync,
|
|
99
|
-
writeStorageFileAtomicSync,
|
|
100
|
-
syncStorageDirectorySync,
|
|
101
|
-
writeStorageFileDurableAtomicSync
|
|
102
|
-
} from "./index-fvnzcnww.js";
|
|
103
103
|
|
|
104
104
|
// src/features/magic-context/session-activity.ts
|
|
105
105
|
var PREFIX = "retrospective_activity:";
|
|
@@ -742,13 +742,13 @@ import { Buffer as Buffer2 } from "node:buffer";
|
|
|
742
742
|
|
|
743
743
|
// src/hooks/magic-context/lkg-recovery-fence.ts
|
|
744
744
|
import { createHash as createHash3, randomUUID as randomUUID2 } from "node:crypto";
|
|
745
|
-
import { lstatSync as lstatSync2,
|
|
746
|
-
import {
|
|
745
|
+
import { lstatSync as lstatSync2, readFileSync as readFileSync3, rmdirSync as rmdirSync2, rmSync as rmSync2 } from "node:fs";
|
|
746
|
+
import { dirname, join as join2 } from "node:path";
|
|
747
747
|
|
|
748
748
|
// src/shared/storage-file-mutex.ts
|
|
749
749
|
import { execFileSync } from "node:child_process";
|
|
750
750
|
import { createHash as createHash2, randomUUID } from "node:crypto";
|
|
751
|
-
import { readdirSync, readFileSync as readFileSync2, rmSync } from "node:fs";
|
|
751
|
+
import { readdirSync, readFileSync as readFileSync2, rmdirSync, rmSync } from "node:fs";
|
|
752
752
|
import { join } from "node:path";
|
|
753
753
|
var ticketChecksum = (name, ticket) => createHash2("sha256").update(JSON.stringify([name, ticket.choosing, ticket.number, ticket.birth])).digest("hex");
|
|
754
754
|
function processBirth(pid) {
|
|
@@ -781,23 +781,23 @@ function processBirth(pid) {
|
|
|
781
781
|
}
|
|
782
782
|
var pause = new Int32Array(new SharedArrayBuffer(4));
|
|
783
783
|
function withStorageFileMutex(directory, work, timeoutMs = 1000) {
|
|
784
|
-
|
|
784
|
+
const deadline = performance.now() + timeoutMs;
|
|
785
785
|
const name = `${process.pid}-${randomUUID()}.lock`;
|
|
786
786
|
const ownPath = join(directory, name);
|
|
787
787
|
const birth = processBirth(process.pid);
|
|
788
788
|
const ticket = { choosing: true, number: 0, birth, checksum: "" };
|
|
789
789
|
const encodedTicket = () => JSON.stringify({ ...ticket, checksum: ticketChecksum(name, ticket) });
|
|
790
|
-
for (
|
|
790
|
+
for (;; ) {
|
|
791
791
|
try {
|
|
792
|
+
ensurePrivateStorageDirectorySync(directory);
|
|
792
793
|
writeStorageFileSync(ownPath, encodedTicket(), { flag: "wx", forcePrivate: true });
|
|
793
794
|
break;
|
|
794
795
|
} catch (error) {
|
|
795
|
-
|
|
796
|
+
const code = error.code;
|
|
797
|
+
if (code !== "ENOENT" && code !== "EEXIST" && code !== "EINVAL" || performance.now() >= deadline)
|
|
796
798
|
throw error;
|
|
797
|
-
ensurePrivateStorageDirectorySync(directory);
|
|
798
799
|
}
|
|
799
800
|
}
|
|
800
|
-
const deadline = performance.now() + timeoutMs;
|
|
801
801
|
const peers = () => {
|
|
802
802
|
const found = [];
|
|
803
803
|
for (const other of readdirSync(directory)) {
|
|
@@ -839,6 +839,9 @@ function withStorageFileMutex(directory, work, timeoutMs = 1000) {
|
|
|
839
839
|
return result;
|
|
840
840
|
} finally {
|
|
841
841
|
rmSync(ownPath, { force: true });
|
|
842
|
+
try {
|
|
843
|
+
rmdirSync(directory);
|
|
844
|
+
} catch {}
|
|
842
845
|
}
|
|
843
846
|
}
|
|
844
847
|
|
|
@@ -925,7 +928,7 @@ function publishRecord(record) {
|
|
|
925
928
|
try {
|
|
926
929
|
if (record.state === "clean")
|
|
927
930
|
observer?.("clean");
|
|
928
|
-
writeStorageFileDurableAtomicSync(lkgRecoveryFencePath(record.sessionId), JSON.stringify({ ...record, checksum: hash(JSON.stringify(payload(record))) }), () => observer?.("temp-synced"));
|
|
931
|
+
writeStorageFileDurableAtomicSync(lkgRecoveryFencePath(record.sessionId), JSON.stringify({ ...record, checksum: hash(JSON.stringify(payload(record))) }), () => observer?.("temp-synced"), `${lkgRecoveryFencePath(record.sessionId)}.tmp`);
|
|
929
932
|
if (record.state === "dirty")
|
|
930
933
|
observer?.("dirty");
|
|
931
934
|
remember(record.sessionId, {
|
|
@@ -936,7 +939,7 @@ function publishRecord(record) {
|
|
|
936
939
|
const visible = read(record.sessionId);
|
|
937
940
|
if (record.state === "clean" && visible?.state === "clean" && visible.revision === record.revision && visible.slotKey === record.slotKey) {
|
|
938
941
|
const dirty = { ...record, state: "dirty" };
|
|
939
|
-
writeStorageFileDurableAtomicSync(lkgRecoveryFencePath(record.sessionId), JSON.stringify({ ...dirty, checksum: hash(JSON.stringify(payload(dirty))) }));
|
|
942
|
+
writeStorageFileDurableAtomicSync(lkgRecoveryFencePath(record.sessionId), JSON.stringify({ ...dirty, checksum: hash(JSON.stringify(payload(dirty))) }), undefined, `${lkgRecoveryFencePath(record.sessionId)}.tmp`);
|
|
940
943
|
}
|
|
941
944
|
remember(record.sessionId, { state: "invalid", record: null });
|
|
942
945
|
throw error;
|
|
@@ -976,10 +979,7 @@ function locked(sessionId, work) {
|
|
|
976
979
|
ioObserver?.("mutex");
|
|
977
980
|
return withStorageFileMutex(`${lkgRecoveryFencePath(sessionId)}.locks`, () => {
|
|
978
981
|
const path = lkgRecoveryFencePath(sessionId);
|
|
979
|
-
|
|
980
|
-
if (name.startsWith(`${basename(path)}.`) && name.endsWith(".tmp"))
|
|
981
|
-
rmSync2(join2(dirname(path), name), { force: true });
|
|
982
|
-
}
|
|
982
|
+
rmSync2(`${path}.tmp`, { force: true });
|
|
983
983
|
return work();
|
|
984
984
|
});
|
|
985
985
|
}
|
|
@@ -1159,7 +1159,7 @@ function clearLkgRecoveryFence(sessionId, remove, shouldClear) {
|
|
|
1159
1159
|
});
|
|
1160
1160
|
} finally {
|
|
1161
1161
|
try {
|
|
1162
|
-
|
|
1162
|
+
rmdirSync2(`${path}.locks`);
|
|
1163
1163
|
} catch {}
|
|
1164
1164
|
}
|
|
1165
1165
|
}
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "./index-gzy5w8ya.js";
|
|
14
14
|
import {
|
|
15
15
|
scheduleAfterBootQuiet
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-7svecf3m.js";
|
|
17
17
|
import {
|
|
18
18
|
getHarness2,
|
|
19
19
|
harnessOwnsOpenCodeStore2
|
|
@@ -39,6 +39,14 @@ import {
|
|
|
39
39
|
import {
|
|
40
40
|
configureContextDatabasePragmas2
|
|
41
41
|
} from "./index-fb3zxn06.js";
|
|
42
|
+
import {
|
|
43
|
+
shouldEnforcePrivateStoragePermissions,
|
|
44
|
+
ensureStorageDirectorySync,
|
|
45
|
+
writeStorageFileSync,
|
|
46
|
+
copyStorageFileSync,
|
|
47
|
+
copyStorageTreeSync,
|
|
48
|
+
tightenStorageTreeSync
|
|
49
|
+
} from "./index-c5tmzym6.js";
|
|
42
50
|
import {
|
|
43
51
|
attachFailClosedBlockingProcessEvidence
|
|
44
52
|
} from "./index-wh9fxds5.js";
|
|
@@ -57,7 +65,7 @@ import {
|
|
|
57
65
|
hasPendingMigrations,
|
|
58
66
|
getMainThreadMigrationBodyCount,
|
|
59
67
|
runMigrations
|
|
60
|
-
} from "./index-
|
|
68
|
+
} from "./index-4w5rx7de.js";
|
|
61
69
|
import {
|
|
62
70
|
installTagIdentityRevisionTrigger,
|
|
63
71
|
ensureColumn,
|
|
@@ -78,14 +86,6 @@ import {
|
|
|
78
86
|
import {
|
|
79
87
|
logSlowWriteTransaction
|
|
80
88
|
} from "./index-m0pwswv9.js";
|
|
81
|
-
import {
|
|
82
|
-
shouldEnforcePrivateStoragePermissions,
|
|
83
|
-
ensureStorageDirectorySync,
|
|
84
|
-
writeStorageFileSync,
|
|
85
|
-
copyStorageFileSync,
|
|
86
|
-
copyStorageTreeSync,
|
|
87
|
-
tightenStorageTreeSync
|
|
88
|
-
} from "./index-fvnzcnww.js";
|
|
89
89
|
|
|
90
90
|
// src/features/magic-context/storage-db.ts
|
|
91
91
|
import {
|
|
@@ -586,8 +586,8 @@ var BOOT_SQLITE_BUSY_TIMEOUT_MS = 5000;
|
|
|
586
586
|
function ensureSecureStorageDir(dir) {
|
|
587
587
|
ensureStorageDirectorySync(dir);
|
|
588
588
|
}
|
|
589
|
-
function tightenStorageTree(
|
|
590
|
-
const { failures } = tightenStorageTreeSync(
|
|
589
|
+
function tightenStorageTree(dbPath) {
|
|
590
|
+
const { failures } = tightenStorageTreeSync(dirname(dbPath), dbPath);
|
|
591
591
|
log2(`[magic-context] storage permission tightening failures=${failures}`);
|
|
592
592
|
}
|
|
593
593
|
function resolveBootBusyTimeoutMs(value) {
|
|
@@ -1047,7 +1047,7 @@ function finishDatabaseOpen(db, dbPath, explicitDbPath, latestSupportedVersion)
|
|
|
1047
1047
|
}
|
|
1048
1048
|
setDatabase(db);
|
|
1049
1049
|
loadToolDefinitionMeasurements(db);
|
|
1050
|
-
tightenStorageTree(
|
|
1050
|
+
tightenStorageTree(dbPath);
|
|
1051
1051
|
databases.set(dbPath, db);
|
|
1052
1052
|
pathByDatabase.set(db, dbPath);
|
|
1053
1053
|
persistenceByDatabase.set(db, true);
|
|
@@ -2347,7 +2347,7 @@ function openDatabase(dbPathOrOptions) {
|
|
|
2347
2347
|
migrateLegacyStorageIfNeeded(dbPath, dbDir);
|
|
2348
2348
|
}
|
|
2349
2349
|
ensureSecureStorageDir(dbDir);
|
|
2350
|
-
tightenStorageTree(
|
|
2350
|
+
tightenStorageTree(dbPath);
|
|
2351
2351
|
if (!existsSync2(dbPath) && shouldEnforcePrivateStoragePermissions()) {
|
|
2352
2352
|
try {
|
|
2353
2353
|
writeStorageFileSync(dbPath, new Uint8Array, { flag: "wx" });
|
|
@@ -2444,7 +2444,7 @@ async function openDatabaseAsync(dbPathOrOptions) {
|
|
|
2444
2444
|
if (!explicitDbPath)
|
|
2445
2445
|
migrateLegacyStorageIfNeeded(dbPath, dbDir);
|
|
2446
2446
|
ensureSecureStorageDir(dbDir);
|
|
2447
|
-
tightenStorageTree(
|
|
2447
|
+
tightenStorageTree(dbPath);
|
|
2448
2448
|
if (!existsSync2(dbPath) && shouldEnforcePrivateStoragePermissions()) {
|
|
2449
2449
|
try {
|
|
2450
2450
|
writeStorageFileSync(dbPath, new Uint8Array, { flag: "wx" });
|
|
@@ -6,6 +6,9 @@ import {
|
|
|
6
6
|
log2,
|
|
7
7
|
sessionLog2
|
|
8
8
|
} from "./index-ywrz4wy2.js";
|
|
9
|
+
import {
|
|
10
|
+
writeStorageFileAtomicSync
|
|
11
|
+
} from "./index-c5tmzym6.js";
|
|
9
12
|
import {
|
|
10
13
|
localBudget,
|
|
11
14
|
calibrationForModelKey
|
|
@@ -13,9 +16,6 @@ import {
|
|
|
13
16
|
import {
|
|
14
17
|
modelRefLookupOrder
|
|
15
18
|
} from "./index-avwt563y.js";
|
|
16
|
-
import {
|
|
17
|
-
writeStorageFileAtomicSync
|
|
18
|
-
} from "./index-fvnzcnww.js";
|
|
19
19
|
|
|
20
20
|
// src/shared/models-dev-cache.ts
|
|
21
21
|
import { readFileSync } from "node:fs";
|
package/dist/index.js
CHANGED
|
@@ -58,8 +58,15 @@ import {
|
|
|
58
58
|
checkCompactionMarkerConsistency,
|
|
59
59
|
clearInjectionCache,
|
|
60
60
|
clearNoteNudgeTriggerOnly
|
|
61
|
-
} from "./index-
|
|
61
|
+
} from "./index-tzbcb8yt.js";
|
|
62
62
|
import"./index-sd3egckz.js";
|
|
63
|
+
import"./index-gqf8r04r.js";
|
|
64
|
+
import {
|
|
65
|
+
setStoragePrivatePermissionEnforcement,
|
|
66
|
+
ensureStorageDirectorySync,
|
|
67
|
+
writeStorageFileSync,
|
|
68
|
+
writeStorageFileAtomicSync
|
|
69
|
+
} from "./index-c5tmzym6.js";
|
|
63
70
|
import {
|
|
64
71
|
hasTrustedAbsoluteWall,
|
|
65
72
|
refreshModelLimitsFromApi,
|
|
@@ -68,7 +75,7 @@ import {
|
|
|
68
75
|
deriveHistorianChunkTokens2,
|
|
69
76
|
resolveKnownHistorianContextLimit2,
|
|
70
77
|
resolveHistorianContextLimit2
|
|
71
|
-
} from "./index-
|
|
78
|
+
} from "./index-zmqx48vt.js";
|
|
72
79
|
import {
|
|
73
80
|
buildDreamTaskRuntimeConfigs2,
|
|
74
81
|
userMemoryCollectionEnabled2,
|
|
@@ -145,7 +152,7 @@ import {
|
|
|
145
152
|
parameterDescriptionsFor,
|
|
146
153
|
MagicContextRpcServer,
|
|
147
154
|
applyHiddenSubagentTemperature
|
|
148
|
-
} from "./index-
|
|
155
|
+
} from "./index-qvn3q9f1.js";
|
|
149
156
|
import {
|
|
150
157
|
resolveOpenCodeDbPath,
|
|
151
158
|
openCodeDbPathExists,
|
|
@@ -172,7 +179,7 @@ import {
|
|
|
172
179
|
beginBootQuietPeriod,
|
|
173
180
|
bootQuietRemainingMs,
|
|
174
181
|
scheduleAfterBootQuiet
|
|
175
|
-
} from "./index-
|
|
182
|
+
} from "./index-7svecf3m.js";
|
|
176
183
|
import {
|
|
177
184
|
BoundedSessionMap,
|
|
178
185
|
deleteTemporalDecision,
|
|
@@ -197,11 +204,10 @@ import {
|
|
|
197
204
|
dropServedRecord,
|
|
198
205
|
registerLkgPersistence,
|
|
199
206
|
dropSlot
|
|
200
|
-
} from "./index-
|
|
207
|
+
} from "./index-w6v4dw5f.js";
|
|
201
208
|
import {
|
|
202
209
|
recordSessionProjectIdentity
|
|
203
|
-
} from "./index-
|
|
204
|
-
import"./index-gqf8r04r.js";
|
|
210
|
+
} from "./index-3dtzyred.js";
|
|
205
211
|
import"./index-fb3zxn06.js";
|
|
206
212
|
import {
|
|
207
213
|
startBootDeadline,
|
|
@@ -212,7 +218,7 @@ import {
|
|
|
212
218
|
openDatabaseAsync,
|
|
213
219
|
isDatabasePersisted,
|
|
214
220
|
getDatabasePersistenceError
|
|
215
|
-
} from "./index-
|
|
221
|
+
} from "./index-xccywqdj.js";
|
|
216
222
|
import {
|
|
217
223
|
registerExitAbort,
|
|
218
224
|
unregisterExitAbort
|
|
@@ -223,7 +229,7 @@ import {
|
|
|
223
229
|
forgetRawSessionOrdinalWatermark2
|
|
224
230
|
} from "./index-q7q6qp1f.js";
|
|
225
231
|
import"./index-s32f8y67.js";
|
|
226
|
-
import"./index-
|
|
232
|
+
import"./index-4w5rx7de.js";
|
|
227
233
|
import"./index-fr0wbhdn.js";
|
|
228
234
|
import {
|
|
229
235
|
preloadTokenizer
|
|
@@ -232,7 +238,7 @@ import"./index-pxnzyvjc.js";
|
|
|
232
238
|
import {
|
|
233
239
|
getDefaultSubcConnectionFile,
|
|
234
240
|
SubcModuleTransport
|
|
235
|
-
} from "./index-
|
|
241
|
+
} from "./index-0rge5rkh.js";
|
|
236
242
|
import"./index-qt1qqasc.js";
|
|
237
243
|
import"./index-e6ncz7a6.js";
|
|
238
244
|
import {
|
|
@@ -296,18 +302,18 @@ import"./index-snbpdpa3.js";
|
|
|
296
302
|
import {
|
|
297
303
|
deleteIndexedMessage
|
|
298
304
|
} from "./index-05bm2ndp.js";
|
|
299
|
-
import"./index-
|
|
300
|
-
import"./index-
|
|
305
|
+
import"./index-1y4y98r1.js";
|
|
306
|
+
import"./index-4ntnt8ee.js";
|
|
301
307
|
import {
|
|
302
308
|
pushNotification2
|
|
303
309
|
} from "./index-fzgyvsb1.js";
|
|
304
|
-
import"./index-
|
|
310
|
+
import"./index-k50xhjw1.js";
|
|
305
311
|
import {
|
|
306
312
|
getEmbeddingCoverageStatus2
|
|
307
|
-
} from "./index-
|
|
313
|
+
} from "./index-s8ks5nz4.js";
|
|
308
314
|
import"./index-4dhv7mqz.js";
|
|
309
|
-
import"./index-
|
|
310
|
-
import"./index-
|
|
315
|
+
import"./index-pw279hmt.js";
|
|
316
|
+
import"./index-k0tb2z28.js";
|
|
311
317
|
import"./index-jjvbk92s.js";
|
|
312
318
|
import"./index-832w615x.js";
|
|
313
319
|
import {
|
|
@@ -319,25 +325,25 @@ import {
|
|
|
319
325
|
armBindingRecoverySafely,
|
|
320
326
|
collectForeignTextParts,
|
|
321
327
|
resetDegradedCacheCount2
|
|
322
|
-
} from "./index-
|
|
328
|
+
} from "./index-sbr58jaf.js";
|
|
323
329
|
import {
|
|
324
330
|
scheduleClearAndReindex
|
|
325
|
-
} from "./index-
|
|
331
|
+
} from "./index-798s7c8s.js";
|
|
326
332
|
import {
|
|
327
333
|
runManagedRecomp2
|
|
328
|
-
} from "./index-
|
|
334
|
+
} from "./index-kqnef2tg.js";
|
|
329
335
|
import {
|
|
330
336
|
isValidSemver,
|
|
331
337
|
compareSemverCore
|
|
332
|
-
} from "./index-
|
|
338
|
+
} from "./index-2kf73btc.js";
|
|
333
339
|
import"./index-fmsr7v69.js";
|
|
334
340
|
import {
|
|
335
341
|
runManagedWrapup2
|
|
336
|
-
} from "./index-
|
|
342
|
+
} from "./index-9fsxmjs6.js";
|
|
337
343
|
import"./index-70cv85b0.js";
|
|
338
344
|
import"./index-52x68mj4.js";
|
|
339
|
-
import"./index-
|
|
340
|
-
import"./index-
|
|
345
|
+
import"./index-1pf5qrx4.js";
|
|
346
|
+
import"./index-nny4gm06.js";
|
|
341
347
|
import {
|
|
342
348
|
isDreamerRunnable,
|
|
343
349
|
isSmartNoteSurfaceAvailable,
|
|
@@ -358,12 +364,6 @@ import {
|
|
|
358
364
|
closeQuietly
|
|
359
365
|
} from "./index-8ajstryz.js";
|
|
360
366
|
import"./index-m0pwswv9.js";
|
|
361
|
-
import {
|
|
362
|
-
setStoragePrivatePermissionEnforcement,
|
|
363
|
-
ensureStorageDirectorySync,
|
|
364
|
-
writeStorageFileSync,
|
|
365
|
-
writeStorageFileAtomicSync
|
|
366
|
-
} from "./index-fvnzcnww.js";
|
|
367
367
|
|
|
368
368
|
// ../../node_modules/.bun/esprima@4.0.1/node_modules/esprima/dist/esprima.js
|
|
369
369
|
var require_esprima = __commonJS(function(exports, module) {
|
|
@@ -8205,7 +8205,7 @@ var require_src2 = __commonJS(function(exports, module) {
|
|
|
8205
8205
|
// package.json
|
|
8206
8206
|
var package_default = {
|
|
8207
8207
|
name: "@cortexkit/opencode-magic-context",
|
|
8208
|
-
version: "0.49.
|
|
8208
|
+
version: "0.49.85",
|
|
8209
8209
|
type: "module",
|
|
8210
8210
|
description: "OpenCode plugin for Magic Context — cross-session memory and context management",
|
|
8211
8211
|
main: "dist/index.js",
|
|
@@ -12085,7 +12085,7 @@ async function setup(context) {
|
|
|
12085
12085
|
if (claimStorageBackupWarningCheck() && isMagicContextStorageOutsideEngram(storageDir)) {
|
|
12086
12086
|
log2(`[magic-context] Magic Context storage is at ${storageDir}, outside the folder Engram backs up (~/.local/share/cortexkit/magic-context). It is not included in CortexKit backups.`);
|
|
12087
12087
|
}
|
|
12088
|
-
const { registerContext } = await import("./context-
|
|
12088
|
+
const { registerContext } = await import("./context-bjfwzbts.js");
|
|
12089
12089
|
setHarness2("opencode2");
|
|
12090
12090
|
bindStaleBuildNotice({}, import.meta.url, "opencode2");
|
|
12091
12091
|
const duties = await registerContext(context);
|
|
@@ -12474,7 +12474,7 @@ var server = async (ctx) => {
|
|
|
12474
12474
|
}
|
|
12475
12475
|
if (pluginConfig.enabled && !conflictResult?.hasConflict) {
|
|
12476
12476
|
setTimeout(() => {
|
|
12477
|
-
importPluginModule(() => import("./announcement-
|
|
12477
|
+
importPluginModule(() => import("./announcement-fnyxaahs.js")).then(({
|
|
12478
12478
|
shouldShowAnnouncement,
|
|
12479
12479
|
ANNOUNCEMENT_VERSION,
|
|
12480
12480
|
ANNOUNCEMENT_FEATURES,
|
|
@@ -12558,7 +12558,7 @@ var server = async (ctx) => {
|
|
|
12558
12558
|
rustReplayParticipant: () => magicContextRuntime.magicContext?.getRustReplayParticipant?.() ?? null,
|
|
12559
12559
|
onStorageBusyRefusal: async (sessionId, message) => {
|
|
12560
12560
|
const { sendStatusNotification } = await importPluginModule(() => import("./send-session-notification-7x518gew.js"));
|
|
12561
|
-
const { abortSessionFailClosed } = await importPluginModule(() => import("./transform-postprocess-phase-
|
|
12561
|
+
const { abortSessionFailClosed } = await importPluginModule(() => import("./transform-postprocess-phase-39a5hm2a.js"));
|
|
12562
12562
|
await sendStatusNotification(ctx.client, sessionId, message, {
|
|
12563
12563
|
toastDurationMs: 15000
|
|
12564
12564
|
});
|
package/dist/migration-worker.js
CHANGED
|
@@ -10,16 +10,17 @@ import {
|
|
|
10
10
|
import"./index-fr0wbhdn.js";
|
|
11
11
|
import {
|
|
12
12
|
runMigrationsWithRetry
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-4w5rx7de.js";
|
|
14
14
|
import"./index-jrj95cce.js";
|
|
15
15
|
import"./index-58e3y90n.js";
|
|
16
|
-
import"./index-fpqdbb67.js";
|
|
17
16
|
import"./index-gqf8r04r.js";
|
|
17
|
+
import"./index-c5tmzym6.js";
|
|
18
|
+
import"./index-7svecf3m.js";
|
|
18
19
|
import"./index-fb3zxn06.js";
|
|
19
20
|
import {
|
|
20
21
|
setSqlitePragmaConfig,
|
|
21
22
|
initializeDatabase
|
|
22
|
-
} from "./index-
|
|
23
|
+
} from "./index-xccywqdj.js";
|
|
23
24
|
import"./index-wh9fxds5.js";
|
|
24
25
|
import"./index-v0p37hm2.js";
|
|
25
26
|
import"./index-96ztjvkn.js";
|
package/dist/{project-embedding-registry-y3z36mjy.js → project-embedding-registry-q80scexh.js}
RENAMED
|
@@ -38,21 +38,23 @@ import {
|
|
|
38
38
|
sweepAllRegisteredProjects2,
|
|
39
39
|
_setTestProviderFactoryForProject2,
|
|
40
40
|
_resetProjectEmbeddingRegistryForTests2
|
|
41
|
-
} from "./index-
|
|
41
|
+
} from "./index-s8ks5nz4.js";
|
|
42
42
|
import"./index-4dhv7mqz.js";
|
|
43
43
|
import"./index-2amn2s73.js";
|
|
44
44
|
import"./index-qt1qqasc.js";
|
|
45
|
-
import"./index-
|
|
45
|
+
import"./index-k50xhjw1.js";
|
|
46
46
|
import"./index-6nqz8hsz.js";
|
|
47
|
-
import"./index-
|
|
47
|
+
import"./index-3dtzyred.js";
|
|
48
48
|
import"./index-snbpdpa3.js";
|
|
49
49
|
import"./index-pxnzyvjc.js";
|
|
50
|
-
import"./index-
|
|
50
|
+
import"./index-7svecf3m.js";
|
|
51
51
|
import"./index-s32f8y67.js";
|
|
52
52
|
import"./index-q7q6qp1f.js";
|
|
53
53
|
import"./index-96ztjvkn.js";
|
|
54
54
|
import"./index-v0p37hm2.js";
|
|
55
55
|
import"./index-m0pwswv9.js";
|
|
56
|
+
import"./index-c5tmzym6.js";
|
|
57
|
+
import"./index-gqf8r04r.js";
|
|
56
58
|
import"./index-5vsk2cpp.js";
|
|
57
59
|
import"./index-gzy5w8ya.js";
|
|
58
60
|
import"./index-ywrz4wy2.js";
|
|
@@ -19,7 +19,7 @@ serveWorkerJobs(async (input, port) => {
|
|
|
19
19
|
await main();
|
|
20
20
|
async function main() {
|
|
21
21
|
if (input.v2ArchiveReader) {
|
|
22
|
-
const { serveV2ArchiveReads } = await import("./v2-archive-reader-
|
|
22
|
+
const { serveV2ArchiveReads } = await import("./v2-archive-reader-8dsngf2j.js");
|
|
23
23
|
await serveV2ArchiveReads(port, openConnections);
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
@@ -51,7 +51,7 @@ serveWorkerJobs(async (input, port) => {
|
|
|
51
51
|
await runMessageFtsRowidMapBackfill(db);
|
|
52
52
|
reply = { kind: "fts-rowid-backfill" };
|
|
53
53
|
} else if (input.searchArchive) {
|
|
54
|
-
const { renderSearchArchive } = await import("./search-archive-
|
|
54
|
+
const { renderSearchArchive } = await import("./search-archive-r4h96j2z.js");
|
|
55
55
|
const { readRawSessionMessageIdOrdinalsForRangeFromDb } = await import("./read-session-raw-3sc9231y.js");
|
|
56
56
|
const archive = input.searchArchive;
|
|
57
57
|
let raw;
|
|
@@ -7,21 +7,21 @@ import {
|
|
|
7
7
|
setRecompTerminal2,
|
|
8
8
|
buildRecompDeps2,
|
|
9
9
|
runManagedRecomp2
|
|
10
|
-
} from "./index-
|
|
11
|
-
import"./index-
|
|
10
|
+
} from "./index-kqnef2tg.js";
|
|
11
|
+
import"./index-tzbcb8yt.js";
|
|
12
12
|
import"./index-832w615x.js";
|
|
13
13
|
import"./index-sd3egckz.js";
|
|
14
|
-
import"./index-
|
|
15
|
-
import"./index-
|
|
14
|
+
import"./index-pw279hmt.js";
|
|
15
|
+
import"./index-k0tb2z28.js";
|
|
16
16
|
import"./index-jjvbk92s.js";
|
|
17
|
-
import"./index-
|
|
17
|
+
import"./index-s8ks5nz4.js";
|
|
18
18
|
import"./index-4dhv7mqz.js";
|
|
19
|
-
import"./index-
|
|
20
|
-
import"./index-
|
|
19
|
+
import"./index-w6v4dw5f.js";
|
|
20
|
+
import"./index-4ntnt8ee.js";
|
|
21
21
|
import"./index-05bm2ndp.js";
|
|
22
22
|
import"./index-2amn2s73.js";
|
|
23
|
-
import"./index-
|
|
24
|
-
import"./index-
|
|
23
|
+
import"./index-1y4y98r1.js";
|
|
24
|
+
import"./index-zmqx48vt.js";
|
|
25
25
|
import"./index-g6hfh4h4.js";
|
|
26
26
|
import"./index-qt1qqasc.js";
|
|
27
27
|
import"./index-7j2zv9nm.js";
|
|
@@ -30,25 +30,26 @@ import"./index-1zx87sdm.js";
|
|
|
30
30
|
import"./index-x40zr813.js";
|
|
31
31
|
import"./index-fzgyvsb1.js";
|
|
32
32
|
import"./index-e6ncz7a6.js";
|
|
33
|
-
import"./index-
|
|
33
|
+
import"./index-k50xhjw1.js";
|
|
34
34
|
import"./index-6nqz8hsz.js";
|
|
35
|
-
import"./index-
|
|
35
|
+
import"./index-3dtzyred.js";
|
|
36
36
|
import"./index-snbpdpa3.js";
|
|
37
37
|
import"./index-pxnzyvjc.js";
|
|
38
|
-
import"./index-
|
|
38
|
+
import"./index-xccywqdj.js";
|
|
39
39
|
import"./index-fb3zxn06.js";
|
|
40
|
-
import"./index-
|
|
40
|
+
import"./index-4w5rx7de.js";
|
|
41
41
|
import"./index-fr0wbhdn.js";
|
|
42
|
-
import"./index-
|
|
42
|
+
import"./index-7svecf3m.js";
|
|
43
43
|
import"./index-s32f8y67.js";
|
|
44
44
|
import"./index-wh9fxds5.js";
|
|
45
|
-
import"./index-gqf8r04r.js";
|
|
46
45
|
import"./index-jrj95cce.js";
|
|
47
46
|
import"./index-q7q6qp1f.js";
|
|
48
47
|
import"./index-96ztjvkn.js";
|
|
49
48
|
import"./index-v0p37hm2.js";
|
|
50
49
|
import"./index-58e3y90n.js";
|
|
51
50
|
import"./index-m0pwswv9.js";
|
|
51
|
+
import"./index-c5tmzym6.js";
|
|
52
|
+
import"./index-gqf8r04r.js";
|
|
52
53
|
import"./index-5vsk2cpp.js";
|
|
53
54
|
import"./index-gzy5w8ya.js";
|
|
54
55
|
import"./index-ywrz4wy2.js";
|