@cortexkit/opencode-magic-context 0.49.103 → 0.49.104
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 +5 -5
- package/dist/{context-jk7bgc3s.js → context-7hbmnpe8.js} +11 -11
- package/dist/{embedding-backfill-anty7zdf.js → embedding-backfill-aratv25b.js} +4 -4
- package/dist/{v2/embedding-cache-dveynq4m.js → embedding-cache-fhdkn9nc.js} +3 -1
- package/dist/embedding-worker.js +1 -1
- package/dist/features/magic-context/memory/embedding-cache.d.ts +1 -0
- package/dist/features/magic-context/memory/embedding-cache.d.ts.map +1 -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 +9 -1
- package/dist/features/magic-context/memory/embedding-worker-loop.d.ts.map +1 -1
- package/dist/{index-mes48s7a.js → index-3rp2b482.js} +11 -11
- package/dist/{index-vhx6yph7.js → index-4ba3zp54.js} +2 -2
- package/dist/{index-qbydvfev.js → index-6xg55350.js} +15 -11
- package/dist/{index-jyj9jg9f.js → index-8eke8yh2.js} +2 -2
- package/dist/{index-6t6v8prs.js → index-8gzmeyae.js} +2 -2
- package/dist/{index-42fg6tzz.js → index-8yj4vd7k.js} +4 -4
- package/dist/{index-jg5whyrd.js → index-a9wn0d9h.js} +2 -2
- package/dist/{index-9mxkvdtp.js → index-mwjvjn0p.js} +5 -5
- package/dist/{index-nyjztqyj.js → index-p5ey52j9.js} +32 -5
- package/dist/{index-7jvc0rhh.js → index-sqvkh5d0.js} +3 -3
- package/dist/{index-pw1f07vg.js → index-srpghrje.js} +1 -1
- package/dist/{index-t2h3484a.js → index-tvh3y650.js} +3 -3
- package/dist/index.js +15 -15
- package/dist/{project-embedding-registry-4cv7n37m.js → project-embedding-registry-1n4cexsv.js} +3 -3
- package/dist/{recomp-orchestrator-vg4cxyp7.js → recomp-orchestrator-16rs8aty.js} +8 -8
- package/dist/{search-ygtyb91s.js → search-v9ywqb4f.js} +7 -7
- package/dist/{storage-memory-p91f7b5h.js → storage-memory-24hsvzy8.js} +2 -2
- package/dist/{transform-postprocess-phase-958fmjs5.js → transform-postprocess-phase-yef4mxk3.js} +8 -8
- package/dist/v2/auto-search-worker.js +5 -5
- package/dist/v2/{context-3g3jvxg8.js → context-mk2h2ven.js} +10 -10
- package/dist/v2/{embedding-backfill-ra9gbbs4.js → embedding-backfill-kyn5sv0f.js} +4 -4
- package/dist/{embedding-cache-dveynq4m.js → v2/embedding-cache-fhdkn9nc.js} +3 -1
- package/dist/v2/embedding-worker.js +1 -1
- package/dist/v2/{project-embedding-registry-gdaqb7h0.js → project-embedding-registry-1jv2rxhb.js} +3 -3
- package/dist/v2/{recomp-orchestrator-29m3cc5b.js → recomp-orchestrator-5t2csd46.js} +7 -7
- package/dist/v2/{search-ybyc7vmx.js → search-w9m2fd5c.js} +7 -7
- package/dist/v2/{server-df5scn4q.js → server-3gnpqjez.js} +3 -3
- package/dist/v2/{server-kx5egpt7.js → server-47ajg9xc.js} +4 -4
- package/dist/v2/{server-qbydvfev.js → server-6xg55350.js} +15 -11
- package/dist/v2/{server-r851hxn5.js → server-af51b1zg.js} +5 -5
- package/dist/v2/{server-pqgnjf38.js → server-gkb0y83n.js} +32 -5
- package/dist/v2/{server-pw1f07vg.js → server-srpghrje.js} +1 -1
- package/dist/v2/{server-fagcnt6j.js → server-wmpgvvc4.js} +2 -2
- package/dist/v2/{server-1qxdyz4p.js → server-zsbc0n4v.js} +2 -2
- package/dist/v2/server.js +2 -2
- package/dist/v2/{storage-memory-p91f7b5h.js → storage-memory-24hsvzy8.js} +2 -2
- package/dist/v2/{wrapup-orchestrator-ahkq8a61.js → wrapup-orchestrator-ykgx8hw8.js} +7 -7
- package/dist/{wrapup-orchestrator-gjqaac65.js → wrapup-orchestrator-a9tshrp4.js} +9 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
checkCompactionMarkerConsistency,
|
|
48
48
|
clearInjectionCache,
|
|
49
49
|
clearNoteNudgeTriggerOnly
|
|
50
|
-
} from "./index-
|
|
50
|
+
} from "./index-sqvkh5d0.js";
|
|
51
51
|
import {
|
|
52
52
|
withContentLanguageDirective,
|
|
53
53
|
string,
|
|
@@ -148,7 +148,7 @@ import {
|
|
|
148
148
|
parameterDescriptionsFor,
|
|
149
149
|
MagicContextRpcServer,
|
|
150
150
|
applyHiddenSubagentTemperature
|
|
151
|
-
} from "./index-
|
|
151
|
+
} from "./index-3rp2b482.js";
|
|
152
152
|
import {
|
|
153
153
|
resolveOpenCodeDbPath,
|
|
154
154
|
openCodeDbPathExists,
|
|
@@ -237,7 +237,7 @@ import"./index-gcf2x04k.js";
|
|
|
237
237
|
import {
|
|
238
238
|
getDefaultSubcConnectionFile,
|
|
239
239
|
SubcModuleTransport
|
|
240
|
-
} from "./index-
|
|
240
|
+
} from "./index-mwjvjn0p.js";
|
|
241
241
|
import"./index-qt1qqasc.js";
|
|
242
242
|
import"./index-y5f5yg5a.js";
|
|
243
243
|
import {
|
|
@@ -319,14 +319,14 @@ import"./index-ab86c21b.js";
|
|
|
319
319
|
import {
|
|
320
320
|
pushNotification2
|
|
321
321
|
} from "./index-y14pawe1.js";
|
|
322
|
-
import"./index-
|
|
322
|
+
import"./index-p5ey52j9.js";
|
|
323
323
|
import {
|
|
324
324
|
getEmbeddingCoverageStatus2
|
|
325
|
-
} from "./index-
|
|
326
|
-
import"./index-
|
|
327
|
-
import"./index-
|
|
328
|
-
import"./index-
|
|
329
|
-
import"./index-
|
|
325
|
+
} from "./index-4ba3zp54.js";
|
|
326
|
+
import"./index-6xg55350.js";
|
|
327
|
+
import"./index-8yj4vd7k.js";
|
|
328
|
+
import"./index-8eke8yh2.js";
|
|
329
|
+
import"./index-srpghrje.js";
|
|
330
330
|
import"./index-qxzk5s30.js";
|
|
331
331
|
import {
|
|
332
332
|
recordOpenCodeProvenInputFloor,
|
|
@@ -348,13 +348,13 @@ import {
|
|
|
348
348
|
armBindingRecoverySafely,
|
|
349
349
|
collectForeignTextParts,
|
|
350
350
|
resetDegradedCacheCount2
|
|
351
|
-
} from "./index-
|
|
351
|
+
} from "./index-tvh3y650.js";
|
|
352
352
|
import {
|
|
353
353
|
scheduleClearAndReindex
|
|
354
354
|
} from "./index-4v50y0jr.js";
|
|
355
355
|
import {
|
|
356
356
|
runManagedRecomp2
|
|
357
|
-
} from "./index-
|
|
357
|
+
} from "./index-a9wn0d9h.js";
|
|
358
358
|
import {
|
|
359
359
|
isValidSemver,
|
|
360
360
|
compareSemverCore
|
|
@@ -362,7 +362,7 @@ import {
|
|
|
362
362
|
import"./index-fmsr7v69.js";
|
|
363
363
|
import {
|
|
364
364
|
runManagedWrapup2
|
|
365
|
-
} from "./index-
|
|
365
|
+
} from "./index-8gzmeyae.js";
|
|
366
366
|
import"./index-zh683xh2.js";
|
|
367
367
|
import"./index-6gd9akdt.js";
|
|
368
368
|
import"./index-3nxhxeeg.js";
|
|
@@ -8222,7 +8222,7 @@ var require_src2 = __commonJS(function(exports, module) {
|
|
|
8222
8222
|
// package.json
|
|
8223
8223
|
var package_default = {
|
|
8224
8224
|
name: "@cortexkit/opencode-magic-context",
|
|
8225
|
-
version: "0.49.
|
|
8225
|
+
version: "0.49.104",
|
|
8226
8226
|
type: "module",
|
|
8227
8227
|
description: "OpenCode plugin for Magic Context — cross-session memory and context management",
|
|
8228
8228
|
main: "dist/index.js",
|
|
@@ -11971,7 +11971,7 @@ async function sendOpenCodeRefusal(client, sessionId, message, refusal) {
|
|
|
11971
11971
|
sessionLog2(sessionId, "refusal notice skipped: no terminal viewing the session", refusal.name);
|
|
11972
11972
|
}
|
|
11973
11973
|
if (storageBusy) {
|
|
11974
|
-
const { abortSessionFailClosed } = await importPluginModule(() => import("./transform-postprocess-phase-
|
|
11974
|
+
const { abortSessionFailClosed } = await importPluginModule(() => import("./transform-postprocess-phase-yef4mxk3.js"));
|
|
11975
11975
|
await abortSessionFailClosed(client, sessionId);
|
|
11976
11976
|
}
|
|
11977
11977
|
}
|
|
@@ -12241,7 +12241,7 @@ async function setup(context) {
|
|
|
12241
12241
|
if (claimStorageBackupWarningCheck() && isMagicContextStorageOutsideEngram(storageDir)) {
|
|
12242
12242
|
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.`);
|
|
12243
12243
|
}
|
|
12244
|
-
const { registerContext } = await import("./context-
|
|
12244
|
+
const { registerContext } = await import("./context-7hbmnpe8.js");
|
|
12245
12245
|
setHarness2("opencode2");
|
|
12246
12246
|
bindStaleBuildNotice({}, import.meta.url, "opencode2");
|
|
12247
12247
|
const duties = await registerContext(context);
|
package/dist/{project-embedding-registry-4cv7n37m.js → project-embedding-registry-1n4cexsv.js}
RENAMED
|
@@ -39,11 +39,11 @@ import {
|
|
|
39
39
|
sweepAllRegisteredProjects2,
|
|
40
40
|
_setTestProviderFactoryForProject2,
|
|
41
41
|
_resetProjectEmbeddingRegistryForTests2
|
|
42
|
-
} from "./index-
|
|
43
|
-
import"./index-
|
|
42
|
+
} from "./index-4ba3zp54.js";
|
|
43
|
+
import"./index-6xg55350.js";
|
|
44
44
|
import"./index-2amn2s73.js";
|
|
45
45
|
import"./index-qt1qqasc.js";
|
|
46
|
-
import"./index-
|
|
46
|
+
import"./index-p5ey52j9.js";
|
|
47
47
|
import"./index-r3f85n7y.js";
|
|
48
48
|
import"./index-fd3hkyk1.js";
|
|
49
49
|
import"./index-1vv1ka4a.js";
|
|
@@ -7,15 +7,15 @@ import {
|
|
|
7
7
|
setRecompTerminal2,
|
|
8
8
|
buildRecompDeps2,
|
|
9
9
|
runManagedRecomp2
|
|
10
|
-
} from "./index-
|
|
11
|
-
import"./index-
|
|
10
|
+
} from "./index-a9wn0d9h.js";
|
|
11
|
+
import"./index-sqvkh5d0.js";
|
|
12
12
|
import"./index-qxzk5s30.js";
|
|
13
13
|
import"./index-sd3egckz.js";
|
|
14
|
-
import"./index-
|
|
15
|
-
import"./index-
|
|
16
|
-
import"./index-
|
|
17
|
-
import"./index-
|
|
18
|
-
import"./index-
|
|
14
|
+
import"./index-8yj4vd7k.js";
|
|
15
|
+
import"./index-8eke8yh2.js";
|
|
16
|
+
import"./index-srpghrje.js";
|
|
17
|
+
import"./index-4ba3zp54.js";
|
|
18
|
+
import"./index-6xg55350.js";
|
|
19
19
|
import"./index-4536jdzj.js";
|
|
20
20
|
import"./index-ab86c21b.js";
|
|
21
21
|
import"./index-p8nc9axh.js";
|
|
@@ -31,7 +31,7 @@ import"./index-1zx87sdm.js";
|
|
|
31
31
|
import"./index-vdzd98ry.js";
|
|
32
32
|
import"./index-y14pawe1.js";
|
|
33
33
|
import"./index-y5f5yg5a.js";
|
|
34
|
-
import"./index-
|
|
34
|
+
import"./index-p5ey52j9.js";
|
|
35
35
|
import"./index-r3f85n7y.js";
|
|
36
36
|
import"./index-fd3hkyk1.js";
|
|
37
37
|
import"./index-1vv1ka4a.js";
|
|
@@ -5,14 +5,14 @@ import {
|
|
|
5
5
|
resolveMemoriesByIdsForSearch2,
|
|
6
6
|
unifiedSearch2,
|
|
7
7
|
formatSearchResults2
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-mwjvjn0p.js";
|
|
9
9
|
import"./index-4v50y0jr.js";
|
|
10
10
|
import"./index-6gd9akdt.js";
|
|
11
|
-
import"./index-
|
|
12
|
-
import"./index-
|
|
13
|
-
import"./index-
|
|
14
|
-
import"./index-
|
|
15
|
-
import"./index-
|
|
11
|
+
import"./index-8yj4vd7k.js";
|
|
12
|
+
import"./index-8eke8yh2.js";
|
|
13
|
+
import"./index-srpghrje.js";
|
|
14
|
+
import"./index-4ba3zp54.js";
|
|
15
|
+
import"./index-6xg55350.js";
|
|
16
16
|
import"./index-ab86c21b.js";
|
|
17
17
|
import"./index-p8nc9axh.js";
|
|
18
18
|
import"./index-2amn2s73.js";
|
|
@@ -21,7 +21,7 @@ import"./index-9jqaha1g.js";
|
|
|
21
21
|
import"./index-qzfz2tvk.js";
|
|
22
22
|
import"./index-1zx87sdm.js";
|
|
23
23
|
import"./index-vdzd98ry.js";
|
|
24
|
-
import"./index-
|
|
24
|
+
import"./index-p5ey52j9.js";
|
|
25
25
|
import"./index-r3f85n7y.js";
|
|
26
26
|
import"./index-fd3hkyk1.js";
|
|
27
27
|
import"./index-1vv1ka4a.js";
|
|
@@ -31,8 +31,8 @@ import {
|
|
|
31
31
|
deleteMemory2,
|
|
32
32
|
getMemoryCount2,
|
|
33
33
|
getMemoryCountsByStatus2
|
|
34
|
-
} from "./index-
|
|
35
|
-
import"./index-
|
|
34
|
+
} from "./index-srpghrje.js";
|
|
35
|
+
import"./index-6xg55350.js";
|
|
36
36
|
import"./index-fr0wbhdn.js";
|
|
37
37
|
import"./index-gzy5w8ya.js";
|
|
38
38
|
export {
|
package/dist/{transform-postprocess-phase-958fmjs5.js → transform-postprocess-phase-yef4mxk3.js}
RENAMED
|
@@ -19,16 +19,16 @@ import {
|
|
|
19
19
|
finalizeMessageRepresentation2,
|
|
20
20
|
runPostTransformPhase2,
|
|
21
21
|
checkM0MutationDriftAndSignal2
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-tvh3y650.js";
|
|
23
23
|
import"./index-4v50y0jr.js";
|
|
24
|
-
import"./index-
|
|
24
|
+
import"./index-sqvkh5d0.js";
|
|
25
25
|
import"./index-qxzk5s30.js";
|
|
26
26
|
import"./index-sd3egckz.js";
|
|
27
|
-
import"./index-
|
|
28
|
-
import"./index-
|
|
29
|
-
import"./index-
|
|
30
|
-
import"./index-
|
|
31
|
-
import"./index-
|
|
27
|
+
import"./index-8yj4vd7k.js";
|
|
28
|
+
import"./index-8eke8yh2.js";
|
|
29
|
+
import"./index-srpghrje.js";
|
|
30
|
+
import"./index-4ba3zp54.js";
|
|
31
|
+
import"./index-6xg55350.js";
|
|
32
32
|
import"./index-4536jdzj.js";
|
|
33
33
|
import"./index-ab86c21b.js";
|
|
34
34
|
import"./index-p8nc9axh.js";
|
|
@@ -44,7 +44,7 @@ import"./index-1zx87sdm.js";
|
|
|
44
44
|
import"./index-vdzd98ry.js";
|
|
45
45
|
import"./index-y14pawe1.js";
|
|
46
46
|
import"./index-y5f5yg5a.js";
|
|
47
|
-
import"./index-
|
|
47
|
+
import"./index-p5ey52j9.js";
|
|
48
48
|
import"./index-r3f85n7y.js";
|
|
49
49
|
import"./index-fd3hkyk1.js";
|
|
50
50
|
import"./index-1vv1ka4a.js";
|
|
@@ -27,11 +27,11 @@ serveWorkerJobs(async (initial, port) => {
|
|
|
27
27
|
{ Database, registerSqliteDiagnosticSink },
|
|
28
28
|
{ log }
|
|
29
29
|
] = await Promise.all([
|
|
30
|
-
import("./embedding-backfill-
|
|
31
|
-
import("./embedding-cache-
|
|
32
|
-
import("./storage-memory-
|
|
33
|
-
import("./project-embedding-registry-
|
|
34
|
-
import("./search-
|
|
30
|
+
import("./embedding-backfill-kyn5sv0f.js"),
|
|
31
|
+
import("./embedding-cache-fhdkn9nc.js"),
|
|
32
|
+
import("./storage-memory-24hsvzy8.js"),
|
|
33
|
+
import("./project-embedding-registry-1jv2rxhb.js"),
|
|
34
|
+
import("./search-w9m2fd5c.js"),
|
|
35
35
|
import("./compartment-chunk-embedding-6v74y2r3.js"),
|
|
36
36
|
import("./embedding-activity-g1dhes6g.js"),
|
|
37
37
|
import("./harness-e4avh192.js"),
|
|
@@ -254,7 +254,7 @@ import {
|
|
|
254
254
|
startCompartmentAgent,
|
|
255
255
|
setRecompStarting2,
|
|
256
256
|
setRecompTerminal2
|
|
257
|
-
} from "./server-
|
|
257
|
+
} from "./server-3gnpqjez.js";
|
|
258
258
|
import {
|
|
259
259
|
embedPauseBySession,
|
|
260
260
|
embedRunStateBySession,
|
|
@@ -854,7 +854,7 @@ import {
|
|
|
854
854
|
resolveMemoriesByIdsForSearch2,
|
|
855
855
|
unifiedSearch2,
|
|
856
856
|
formatSearchResults2
|
|
857
|
-
} from "./server-
|
|
857
|
+
} from "./server-af51b1zg.js";
|
|
858
858
|
import {
|
|
859
859
|
startBootDeadline,
|
|
860
860
|
getUnconfirmedMigrationHolders,
|
|
@@ -951,7 +951,7 @@ import {
|
|
|
951
951
|
embedSessionCompartmentChunks2,
|
|
952
952
|
getEmbeddingCoverageStatus2,
|
|
953
953
|
getAutoEmbeddingSessionCoverage2
|
|
954
|
-
} from "./server-
|
|
954
|
+
} from "./server-wmpgvvc4.js";
|
|
955
955
|
import {
|
|
956
956
|
GIT_SWEEP_LEASE_RENEWAL_MS,
|
|
957
957
|
acquireGitSweepLease,
|
|
@@ -966,12 +966,12 @@ import {
|
|
|
966
966
|
saveEmbeddingIfHashMatches,
|
|
967
967
|
invalidateProject2,
|
|
968
968
|
invalidateMemory2
|
|
969
|
-
} from "./server-
|
|
969
|
+
} from "./server-6xg55350.js";
|
|
970
970
|
import {
|
|
971
971
|
getCachedLocalEmbeddingPooling,
|
|
972
972
|
preflightLocalEmbeddingPooling,
|
|
973
973
|
getLocalEmbeddingNativeMemoryStats
|
|
974
|
-
} from "./server-
|
|
974
|
+
} from "./server-gkb0y83n.js";
|
|
975
975
|
import {
|
|
976
976
|
renderUserFacingFailure,
|
|
977
977
|
userFacingFailureCode,
|
|
@@ -991,8 +991,8 @@ import {
|
|
|
991
991
|
readGitFileChangeTimesSince,
|
|
992
992
|
verificationFileExists,
|
|
993
993
|
normalizeVerificationFiles
|
|
994
|
-
} from "./server-
|
|
995
|
-
import"./server-
|
|
994
|
+
} from "./server-47ajg9xc.js";
|
|
995
|
+
import"./server-zsbc0n4v.js";
|
|
996
996
|
import {
|
|
997
997
|
computeCueContentHash,
|
|
998
998
|
hasMuralCueColumns,
|
|
@@ -1019,7 +1019,7 @@ import {
|
|
|
1019
1019
|
archiveMemory2,
|
|
1020
1020
|
getMemoryCount2,
|
|
1021
1021
|
getMemoryCountsByStatus2
|
|
1022
|
-
} from "./server-
|
|
1022
|
+
} from "./server-srpghrje.js";
|
|
1023
1023
|
import {
|
|
1024
1024
|
registerNotificationSink2,
|
|
1025
1025
|
pushLiveNotification2,
|
|
@@ -26918,7 +26918,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
26918
26918
|
const db = readDatabase();
|
|
26919
26919
|
if (!db)
|
|
26920
26920
|
return { ok: false, error: "db unavailable" };
|
|
26921
|
-
const { runManagedRecomp } = await importPluginModule(() => import("./recomp-orchestrator-
|
|
26921
|
+
const { runManagedRecomp } = await importPluginModule(() => import("./recomp-orchestrator-5t2csd46.js"));
|
|
26922
26922
|
const { sendIgnoredMessage } = await importPluginModule(() => import("./send-session-notification-vtnk598k.js"));
|
|
26923
26923
|
log2(`[rpc] recomp requested for session ${sessionId}`);
|
|
26924
26924
|
if (!args.client && !args.hiddenCompletionExecutor) {
|
|
@@ -27003,7 +27003,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
27003
27003
|
const db = readDatabase();
|
|
27004
27004
|
if (!db)
|
|
27005
27005
|
return { ok: false, error: "db unavailable" };
|
|
27006
|
-
const { runManagedWrapup } = await importPluginModule(() => import("./wrapup-orchestrator-
|
|
27006
|
+
const { runManagedWrapup } = await importPluginModule(() => import("./wrapup-orchestrator-ykgx8hw8.js"));
|
|
27007
27007
|
const model = await args.readSelectedSessionModel?.(sessionId) ?? liveSessionState.liveModelBySession.get(sessionId);
|
|
27008
27008
|
const window = resolveOpenCodeWrapupWindow(db, sessionId, model);
|
|
27009
27009
|
if (!window)
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ensureMemoryEmbeddings2
|
|
3
|
-
} from "./server-
|
|
4
|
-
import"./server-
|
|
5
|
-
import"./server-
|
|
3
|
+
} from "./server-zsbc0n4v.js";
|
|
4
|
+
import"./server-wmpgvvc4.js";
|
|
5
|
+
import"./server-6xg55350.js";
|
|
6
6
|
import"./server-2amn2s73.js";
|
|
7
7
|
import"./server-qt1qqasc.js";
|
|
8
|
-
import"./server-
|
|
8
|
+
import"./server-gkb0y83n.js";
|
|
9
9
|
import"./server-arfzfxe8.js";
|
|
10
10
|
import"./server-7c5p0bh1.js";
|
|
11
11
|
import"./server-ghk96d57.js";
|
|
@@ -6,9 +6,11 @@ import {
|
|
|
6
6
|
invalidateProject2,
|
|
7
7
|
invalidateMemory2,
|
|
8
8
|
resetEmbeddingCacheForTests2,
|
|
9
|
+
getEmbeddingCacheSizeForTests2,
|
|
9
10
|
setEmbeddingCacheTtlForTests2
|
|
10
|
-
} from "./
|
|
11
|
+
} from "./server-6xg55350.js";
|
|
11
12
|
export {
|
|
13
|
+
getEmbeddingCacheSizeForTests2 as getEmbeddingCacheSizeForTests,
|
|
12
14
|
getProjectEmbeddings2 as getProjectEmbeddings,
|
|
13
15
|
invalidateMemory2 as invalidateMemory,
|
|
14
16
|
invalidateProject2 as invalidateProject,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
resolveLocalEmbeddingWorkerRuntime,
|
|
19
19
|
getLocalEmbeddingNativeMemoryStats,
|
|
20
20
|
LocalEmbeddingProvider
|
|
21
|
-
} from "./server-
|
|
21
|
+
} from "./server-gkb0y83n.js";
|
|
22
22
|
|
|
23
23
|
// src/features/magic-context/memory/embedding-worker.ts
|
|
24
24
|
import { parentPort, workerData } from "node:worker_threads";
|
package/dist/v2/{project-embedding-registry-gdaqb7h0.js → project-embedding-registry-1jv2rxhb.js}
RENAMED
|
@@ -39,11 +39,11 @@ import {
|
|
|
39
39
|
sweepAllRegisteredProjects2,
|
|
40
40
|
_setTestProviderFactoryForProject2,
|
|
41
41
|
_resetProjectEmbeddingRegistryForTests2
|
|
42
|
-
} from "./server-
|
|
43
|
-
import"./server-
|
|
42
|
+
} from "./server-wmpgvvc4.js";
|
|
43
|
+
import"./server-6xg55350.js";
|
|
44
44
|
import"./server-2amn2s73.js";
|
|
45
45
|
import"./server-qt1qqasc.js";
|
|
46
|
-
import"./server-
|
|
46
|
+
import"./server-gkb0y83n.js";
|
|
47
47
|
import"./server-arfzfxe8.js";
|
|
48
48
|
import"./server-7c5p0bh1.js";
|
|
49
49
|
import"./server-ghk96d57.js";
|
|
@@ -7,13 +7,13 @@ import {
|
|
|
7
7
|
setRecompTerminal2,
|
|
8
8
|
buildRecompDeps2,
|
|
9
9
|
runManagedRecomp2
|
|
10
|
-
} from "./server-
|
|
10
|
+
} from "./server-3gnpqjez.js";
|
|
11
11
|
import"./server-rbxtp4sm.js";
|
|
12
|
-
import"./server-
|
|
13
|
-
import"./server-
|
|
14
|
-
import"./server-
|
|
15
|
-
import"./server-
|
|
16
|
-
import"./server-
|
|
12
|
+
import"./server-47ajg9xc.js";
|
|
13
|
+
import"./server-zsbc0n4v.js";
|
|
14
|
+
import"./server-srpghrje.js";
|
|
15
|
+
import"./server-wmpgvvc4.js";
|
|
16
|
+
import"./server-6xg55350.js";
|
|
17
17
|
import"./server-8f92sd2r.js";
|
|
18
18
|
import"./server-j09jx1n9.js";
|
|
19
19
|
import"./server-qdpd8h27.js";
|
|
@@ -31,7 +31,7 @@ import"./server-0b3ms151.js";
|
|
|
31
31
|
import"./server-d4h86y7v.js";
|
|
32
32
|
import"./server-n5wn7d9b.js";
|
|
33
33
|
import"./server-y14pawe1.js";
|
|
34
|
-
import"./server-
|
|
34
|
+
import"./server-gkb0y83n.js";
|
|
35
35
|
import"./server-arfzfxe8.js";
|
|
36
36
|
import"./server-7c5p0bh1.js";
|
|
37
37
|
import"./server-ghk96d57.js";
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
resolveMemoriesByIdsForSearch2,
|
|
6
6
|
unifiedSearch2,
|
|
7
7
|
formatSearchResults2
|
|
8
|
-
} from "./server-
|
|
8
|
+
} from "./server-af51b1zg.js";
|
|
9
9
|
import"./server-b01a7dhj.js";
|
|
10
|
-
import"./server-
|
|
11
|
-
import"./server-
|
|
12
|
-
import"./server-
|
|
13
|
-
import"./server-
|
|
14
|
-
import"./server-
|
|
10
|
+
import"./server-47ajg9xc.js";
|
|
11
|
+
import"./server-zsbc0n4v.js";
|
|
12
|
+
import"./server-srpghrje.js";
|
|
13
|
+
import"./server-wmpgvvc4.js";
|
|
14
|
+
import"./server-6xg55350.js";
|
|
15
15
|
import"./server-j09jx1n9.js";
|
|
16
16
|
import"./server-qdpd8h27.js";
|
|
17
17
|
import"./server-2amn2s73.js";
|
|
@@ -20,7 +20,7 @@ import"./server-x22jtpna.js";
|
|
|
20
20
|
import"./server-9ms9b75c.js";
|
|
21
21
|
import"./server-1zx87sdm.js";
|
|
22
22
|
import"./server-vgy98kcd.js";
|
|
23
|
-
import"./server-
|
|
23
|
+
import"./server-gkb0y83n.js";
|
|
24
24
|
import"./server-arfzfxe8.js";
|
|
25
25
|
import"./server-7c5p0bh1.js";
|
|
26
26
|
import"./server-ghk96d57.js";
|
|
@@ -248,7 +248,7 @@ import {
|
|
|
248
248
|
getProjectChunkEmbeddingModelId2,
|
|
249
249
|
getProjectEmbeddingMaxInputTokens2,
|
|
250
250
|
embedItemsWindowBounded2
|
|
251
|
-
} from "./server-
|
|
251
|
+
} from "./server-wmpgvvc4.js";
|
|
252
252
|
import {
|
|
253
253
|
V2_MEMORY_CATEGORIES,
|
|
254
254
|
CATEGORY_PRIORITY,
|
|
@@ -259,7 +259,7 @@ import {
|
|
|
259
259
|
userFacingFailureCode,
|
|
260
260
|
promoteSessionFactsDurable,
|
|
261
261
|
embedPromotedFacts
|
|
262
|
-
} from "./server-
|
|
262
|
+
} from "./server-47ajg9xc.js";
|
|
263
263
|
import {
|
|
264
264
|
computeCueContentHash,
|
|
265
265
|
getMuralCueState,
|
|
@@ -267,7 +267,7 @@ import {
|
|
|
267
267
|
getMemoriesByProject2,
|
|
268
268
|
getMemoriesByProjects2,
|
|
269
269
|
getMaxMemoryIdForProjects2
|
|
270
|
-
} from "./server-
|
|
270
|
+
} from "./server-srpghrje.js";
|
|
271
271
|
import {
|
|
272
272
|
getSchemaFenceRejection,
|
|
273
273
|
LATEST_SUPPORTED_VERSION,
|
|
@@ -15,14 +15,14 @@ import {
|
|
|
15
15
|
} from "./server-b5eg9ct6.js";
|
|
16
16
|
import {
|
|
17
17
|
LocalEmbeddingProvider
|
|
18
|
-
} from "./server-
|
|
18
|
+
} from "./server-gkb0y83n.js";
|
|
19
19
|
import {
|
|
20
20
|
OpenAICompatibleEmbeddingProvider,
|
|
21
21
|
embedTextForProject2
|
|
22
|
-
} from "./server-
|
|
22
|
+
} from "./server-wmpgvvc4.js";
|
|
23
23
|
import {
|
|
24
24
|
saveEmbeddingIfHashMatches
|
|
25
|
-
} from "./server-
|
|
25
|
+
} from "./server-6xg55350.js";
|
|
26
26
|
import {
|
|
27
27
|
getMemorySelectColumns2,
|
|
28
28
|
isMemoryRow2,
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
buildWorkspaceMemorySqlFilter2,
|
|
33
33
|
getMemoryById2,
|
|
34
34
|
updateMemorySeenCount2
|
|
35
|
-
} from "./server-
|
|
35
|
+
} from "./server-srpghrje.js";
|
|
36
36
|
import {
|
|
37
37
|
computeNormalizedHash
|
|
38
38
|
} from "./server-2bvekkfy.js";
|
|
@@ -111,16 +111,15 @@ function maintainKeptWorkerMemoryEmbeddings2(db) {
|
|
|
111
111
|
function cacheKey(projectPath, modelId) {
|
|
112
112
|
return `${projectPath}\x00${modelId}`;
|
|
113
113
|
}
|
|
114
|
-
function
|
|
115
|
-
const entry
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
if (entry.expiresAt <= Date.now()) {
|
|
120
|
-
projectEmbeddingCache.delete(cacheKey(projectPath, modelId));
|
|
121
|
-
return null;
|
|
114
|
+
function pruneExpiredProjectEmbeddings(now) {
|
|
115
|
+
for (const [key, entry] of projectEmbeddingCache) {
|
|
116
|
+
if (entry.expiresAt <= now)
|
|
117
|
+
projectEmbeddingCache.delete(key);
|
|
122
118
|
}
|
|
123
|
-
|
|
119
|
+
}
|
|
120
|
+
function getValidCacheEntry(projectPath, modelId) {
|
|
121
|
+
pruneExpiredProjectEmbeddings(Date.now());
|
|
122
|
+
return projectEmbeddingCache.get(cacheKey(projectPath, modelId)) ?? null;
|
|
124
123
|
}
|
|
125
124
|
function getProjectEmbeddings2(db, projectPath, modelId) {
|
|
126
125
|
const kept = keptWorkerCaches.get(db);
|
|
@@ -140,9 +139,11 @@ function getProjectEmbeddings2(db, projectPath, modelId) {
|
|
|
140
139
|
return cached.embeddings;
|
|
141
140
|
}
|
|
142
141
|
const embeddings = loadAllEmbeddings(db, projectPath, modelId);
|
|
142
|
+
const now = Date.now();
|
|
143
|
+
pruneExpiredProjectEmbeddings(now);
|
|
143
144
|
projectEmbeddingCache.set(cacheKey(projectPath, modelId), {
|
|
144
145
|
embeddings,
|
|
145
|
-
expiresAt:
|
|
146
|
+
expiresAt: now + embeddingCacheTtlMs
|
|
146
147
|
});
|
|
147
148
|
return embeddings;
|
|
148
149
|
}
|
|
@@ -172,8 +173,11 @@ function resetEmbeddingCacheForTests2() {
|
|
|
172
173
|
projectEmbeddingCache.clear();
|
|
173
174
|
embeddingCacheTtlMs = DEFAULT_EMBEDDING_CACHE_TTL_MS;
|
|
174
175
|
}
|
|
176
|
+
function getEmbeddingCacheSizeForTests2() {
|
|
177
|
+
return projectEmbeddingCache.size;
|
|
178
|
+
}
|
|
175
179
|
function setEmbeddingCacheTtlForTests2(ttlMs) {
|
|
176
180
|
embeddingCacheTtlMs = Math.max(0, Math.floor(ttlMs));
|
|
177
181
|
}
|
|
178
182
|
|
|
179
|
-
export { saveEmbeddingIfHashMatches, EMBEDDABLE_MEMORIES_FOR_PROJECT, getMemoryEmbedCoverage, keepWorkerMemoryEmbeddings2, maintainKeptWorkerMemoryEmbeddings2, getProjectEmbeddings2, peekProjectEmbeddings2, invalidateProject2, invalidateMemory2, resetEmbeddingCacheForTests2, setEmbeddingCacheTtlForTests2 };
|
|
183
|
+
export { saveEmbeddingIfHashMatches, EMBEDDABLE_MEMORIES_FOR_PROJECT, getMemoryEmbedCoverage, keepWorkerMemoryEmbeddings2, maintainKeptWorkerMemoryEmbeddings2, getProjectEmbeddings2, peekProjectEmbeddings2, invalidateProject2, invalidateMemory2, resetEmbeddingCacheForTests2, getEmbeddingCacheSizeForTests2, setEmbeddingCacheTtlForTests2 };
|
|
@@ -57,13 +57,13 @@ import {
|
|
|
57
57
|
enqueueShadowEmbeddingItems2,
|
|
58
58
|
getProjectEmbeddingSnapshot2,
|
|
59
59
|
embedItemsForProject2
|
|
60
|
-
} from "./server-
|
|
60
|
+
} from "./server-wmpgvvc4.js";
|
|
61
61
|
import {
|
|
62
62
|
recordEmbeddingMeasurement
|
|
63
63
|
} from "./server-2amn2s73.js";
|
|
64
64
|
import {
|
|
65
65
|
getProjectEmbeddings2
|
|
66
|
-
} from "./server-
|
|
66
|
+
} from "./server-6xg55350.js";
|
|
67
67
|
import {
|
|
68
68
|
USER_FACING_FAILURES,
|
|
69
69
|
cosineSimilarity,
|
|
@@ -73,16 +73,16 @@ import {
|
|
|
73
73
|
sanitizeFtsQuery,
|
|
74
74
|
searchMemoriesFTS,
|
|
75
75
|
searchMemoriesFTSUnion
|
|
76
|
-
} from "./server-
|
|
76
|
+
} from "./server-47ajg9xc.js";
|
|
77
77
|
import {
|
|
78
78
|
ModuleMemoryAuthorityError2,
|
|
79
79
|
getMemoriesByProject2,
|
|
80
80
|
getMemoriesByProjects2,
|
|
81
81
|
updateMemoryRetrievalCount2
|
|
82
|
-
} from "./server-
|
|
82
|
+
} from "./server-srpghrje.js";
|
|
83
83
|
import {
|
|
84
84
|
ensureMemoryEmbeddings2
|
|
85
|
-
} from "./server-
|
|
85
|
+
} from "./server-zsbc0n4v.js";
|
|
86
86
|
import {
|
|
87
87
|
MESSAGE_FTS_SESSION_FILTER_SQL,
|
|
88
88
|
withMessageFtsSessionFilter,
|
|
@@ -684,14 +684,20 @@ function isEmbeddingWorkerStopNotice(message) {
|
|
|
684
684
|
function serveEmbeddingWorker(port, model, options) {
|
|
685
685
|
const now = options.now ?? (() => performance.now());
|
|
686
686
|
let queue = Promise.resolve();
|
|
687
|
+
const requests = new Map;
|
|
687
688
|
let stopping = false;
|
|
688
689
|
let busySince = null;
|
|
689
690
|
const refuse = (id) => port.postMessage({ id, loaded: false, error: EMBEDDING_WORKER_STOPPING_ERROR });
|
|
691
|
+
const acknowledgeCancel = (id) => port.postMessage({ id, loaded: false });
|
|
690
692
|
const handle = async (request) => {
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
busySince = now();
|
|
693
|
+
const { id } = request;
|
|
694
|
+
const cancelled = () => requests.get(id) === true;
|
|
694
695
|
try {
|
|
696
|
+
if (stopping)
|
|
697
|
+
return refuse(id);
|
|
698
|
+
if (cancelled())
|
|
699
|
+
return acknowledgeCancel(id);
|
|
700
|
+
busySince = now();
|
|
695
701
|
const loaded = await model.initialize();
|
|
696
702
|
let vectors;
|
|
697
703
|
if (loaded && request.texts) {
|
|
@@ -701,19 +707,26 @@ function serveEmbeddingWorker(port, model, options) {
|
|
|
701
707
|
await new Promise((resolve) => setImmediate(resolve));
|
|
702
708
|
if (stopping)
|
|
703
709
|
throw new Error(EMBEDDING_WORKER_STOPPING_ERROR);
|
|
710
|
+
if (cancelled())
|
|
711
|
+
return acknowledgeCancel(id);
|
|
704
712
|
vectors.push(...await model.embedBatch(request.texts.slice(offset, offset + options.batchSize)));
|
|
705
713
|
}
|
|
706
714
|
}
|
|
715
|
+
if (cancelled())
|
|
716
|
+
return acknowledgeCancel(id);
|
|
707
717
|
port.postMessage({
|
|
708
|
-
id
|
|
718
|
+
id,
|
|
709
719
|
loaded,
|
|
710
720
|
vectors,
|
|
711
721
|
failure: model.getLastFailureReason(),
|
|
712
722
|
stats: options.stats?.()
|
|
713
723
|
}, vectors?.flatMap((vector) => vector ? [vector.buffer] : []) ?? []);
|
|
714
724
|
} catch (error) {
|
|
715
|
-
|
|
725
|
+
if (cancelled())
|
|
726
|
+
return acknowledgeCancel(id);
|
|
727
|
+
port.postMessage({ id, loaded: false, error: String(error) });
|
|
716
728
|
} finally {
|
|
729
|
+
requests.delete(id);
|
|
717
730
|
busySince = null;
|
|
718
731
|
}
|
|
719
732
|
};
|
|
@@ -743,9 +756,16 @@ function serveEmbeddingWorker(port, model, options) {
|
|
|
743
756
|
stop();
|
|
744
757
|
return;
|
|
745
758
|
}
|
|
759
|
+
const cancel = message?.cancel;
|
|
760
|
+
if (typeof cancel === "number") {
|
|
761
|
+
if (requests.has(cancel))
|
|
762
|
+
requests.set(cancel, true);
|
|
763
|
+
return;
|
|
764
|
+
}
|
|
746
765
|
const request = message;
|
|
747
766
|
if (stopping)
|
|
748
767
|
return refuse(request.id);
|
|
768
|
+
requests.set(request.id, false);
|
|
749
769
|
queue = queue.then(() => handle(request));
|
|
750
770
|
});
|
|
751
771
|
}
|
|
@@ -1014,6 +1034,13 @@ class EmbeddingWorkerClient {
|
|
|
1014
1034
|
this.pending.delete(id);
|
|
1015
1035
|
signal?.removeEventListener("abort", abort);
|
|
1016
1036
|
reject(new EmbeddingRequestAbortedError);
|
|
1037
|
+
const request = { cancel: id };
|
|
1038
|
+
try {
|
|
1039
|
+
if (worker instanceof Worker)
|
|
1040
|
+
worker.postMessage(request);
|
|
1041
|
+
else if (worker.connected)
|
|
1042
|
+
worker.send(request, () => {});
|
|
1043
|
+
} catch {}
|
|
1017
1044
|
if (this.pending.size === 0) {
|
|
1018
1045
|
worker.unref();
|
|
1019
1046
|
if (!(worker instanceof Worker))
|