@cortexkit/opencode-magic-context 0.49.91 → 0.49.93
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 +3 -3
- package/dist/chunk-embedding-write-worker.js +2 -2
- package/dist/{conflict-warning-hook-kbq6ppjf.js → conflict-warning-hook-exf96bpt.js} +3 -3
- package/dist/{context-6qq5e1ry.js → context-jpxthqxg.js} +98 -77
- package/dist/{embedding-backfill-w0yq71q2.js → embedding-backfill-6wzc4p2n.js} +4 -4
- package/dist/embedding-worker.js +2 -2
- package/dist/features/magic-context/memory/embedding-local.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-worker-client.d.ts +3 -0
- package/dist/features/magic-context/memory/embedding-worker-client.d.ts.map +1 -1
- package/dist/features/magic-context/overflow-detection.d.ts +7 -1
- package/dist/features/magic-context/overflow-detection.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-persisted.d.ts +13 -3
- package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -1
- package/dist/features/magic-context/transform-decision-log.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-parser.d.ts +2 -0
- package/dist/hooks/magic-context/compartment-parser.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-types.d.ts +5 -5
- package/dist/hooks/magic-context/compartment-runner-types.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-validation.d.ts +3 -0
- package/dist/hooks/magic-context/compartment-runner-validation.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-trigger.d.ts +2 -1
- package/dist/hooks/magic-context/compartment-trigger.d.ts.map +1 -1
- package/dist/hooks/magic-context/event-handler.d.ts +4 -0
- package/dist/hooks/magic-context/event-handler.d.ts.map +1 -1
- package/dist/hooks/magic-context/event-resolvers.d.ts +5 -0
- package/dist/hooks/magic-context/event-resolvers.d.ts.map +1 -1
- package/dist/hooks/magic-context/historian-drain-gate.d.ts +15 -0
- package/dist/hooks/magic-context/historian-drain-gate.d.ts.map +1 -1
- package/dist/hooks/magic-context/historian-prompt.generated.d.ts +1 -1
- package/dist/hooks/magic-context/historian-prompt.generated.d.ts.map +1 -1
- package/dist/hooks/magic-context/historian-publish-stage-logger.d.ts +5 -0
- package/dist/hooks/magic-context/historian-publish-stage-logger.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/lkg-measured-request.d.ts +1 -0
- package/dist/hooks/magic-context/lkg-measured-request.d.ts.map +1 -1
- package/dist/hooks/magic-context/lkg-persist.d.ts.map +1 -1
- package/dist/hooks/magic-context/lkg-replay.d.ts +1 -0
- package/dist/hooks/magic-context/lkg-replay.d.ts.map +1 -1
- package/dist/hooks/magic-context/provider-overflow-notice.d.ts +8 -0
- package/dist/hooks/magic-context/provider-overflow-notice.d.ts.map +1 -0
- package/dist/hooks/magic-context/read-session-db.d.ts +2 -0
- package/dist/hooks/magic-context/read-session-db.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts +5 -0
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/{index-czz0w2c4.js → index-01h7tqe3.js} +11 -0
- package/dist/{index-r6r2eh90.js → index-1kem0xxx.js} +4 -4
- package/dist/{index-f25ha337.js → index-5zrzg8r1.js} +1 -1
- package/dist/{index-6zewd2n5.js → index-9ffntwyr.js} +1 -1
- package/dist/{index-mq97qmb8.js → index-dr6bd4c8.js} +3 -3
- package/dist/{index-83qd3n7s.js → index-et39x9k3.js} +1 -1
- package/dist/{index-nmkv8yvs.js → index-fpjnjxyx.js} +2 -2
- package/dist/{index-ran2b3fn.js → index-g5c67kay.js} +75 -67
- package/dist/{index-7rgnh11t.js → index-g6y2wk32.js} +5 -5
- package/dist/{index-e8my7q6m.js → index-g9qtxv87.js} +8 -8
- package/dist/{index-5wgdbj2h.js → index-gqfy38m9.js} +2 -2
- package/dist/{index-3yw525kb.js → index-hee64h6k.js} +6 -6
- package/dist/{index-xn9efn18.js → index-hes3k87g.js} +12 -5
- package/dist/{index-sr8dmp7p.js → index-j2w79s9r.js} +76 -6
- package/dist/{index-qna2ra0s.js → index-jba6ny4m.js} +27 -3
- package/dist/{index-dva352qe.js → index-kty5k23y.js} +1 -1
- package/dist/{index-ywgv1xcb.js → index-mjy2k9jr.js} +1 -1
- package/dist/{index-3n376ann.js → index-n9kd68vc.js} +2 -2
- package/dist/{index-capcna4r.js → index-pnawfv4e.js} +1 -1
- package/dist/{index-6t7jvp76.js → index-rz47hf2m.js} +3 -3
- package/dist/{index-x40zr813.js → index-sp5pvs95.js} +9 -1
- package/dist/{index-ydhymf0b.js → index-ttdk2w0z.js} +3 -3
- package/dist/{index-gqhebzxx.js → index-xr1t0fxb.js} +90 -25
- package/dist/{index-m6vhxsce.js → index-y2vshk67.js} +92 -70
- package/dist/{index-6nqz8hsz.js → index-y915t3ey.js} +1 -1
- package/dist/{index-wfahebsc.js → index-yqha238s.js} +47 -26
- package/dist/{index-febyth5n.js → index-za1yx1m4.js} +1375 -1310
- package/dist/index.js +83 -46
- package/dist/{message-index-bounded-wvnp6fcp.js → message-index-bounded-vjrnptar.js} +5 -5
- package/dist/migration-worker.js +2 -2
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/{project-embedding-registry-8je0xg18.js → project-embedding-registry-m8zcmrsg.js} +3 -3
- package/dist/raw-ordinal-warmup-worker.js +4 -4
- package/dist/{read-session-chunk-j4hjc1pk.js → read-session-chunk-zkzdc0e5.js} +4 -4
- package/dist/{recomp-orchestrator-ps1c8c5h.js → recomp-orchestrator-qb2hymj5.js} +17 -17
- package/dist/{render-nfj7280n.js → render-34p0kek8.js} +11 -11
- package/dist/{search-archive-1etwnve4.js → search-archive-08ppk0q5.js} +6 -6
- package/dist/{search-3r8b0jfa.js → search-e9bb9hpx.js} +13 -13
- package/dist/{send-session-notification-gzxz88vq.js → send-session-notification-0779tyd9.js} +2 -2
- package/dist/{storage-tags-nh2ftqhx.js → storage-tags-gk7gjkqt.js} +2 -2
- package/dist/{store-reader-a2v34xnh.js → store-reader-qbq6q4v0.js} +1 -1
- package/dist/{store-019k3ek7.js → store-yr443ye8.js} +2 -2
- package/dist/{transform-postprocess-phase-tqp968w4.js → transform-postprocess-phase-neds90e3.js} +18 -18
- package/dist/v2/auto-search-worker.js +3 -3
- package/dist/v2/chunk-embedding-write-worker.js +2 -2
- package/dist/v2/{context-d57v8c10.js → context-ctsd80vc.js} +168 -121
- package/dist/v2/{embedding-backfill-95m72gxa.js → embedding-backfill-40g0anxh.js} +4 -4
- package/dist/v2/embedding-worker.js +2 -2
- package/dist/v2/fold/host-media.d.ts.map +1 -1
- package/dist/v2/fold/native-replay.d.ts +1 -0
- package/dist/v2/fold/native-replay.d.ts.map +1 -1
- package/dist/v2/fold/restore.d.ts +15 -0
- package/dist/v2/fold/restore.d.ts.map +1 -1
- package/dist/v2/hidden-child-native.d.ts.map +1 -1
- package/dist/v2/hidden-run-holder.d.ts +4 -4
- package/dist/v2/hooks/overflow-recovery.d.ts +6 -0
- package/dist/v2/hooks/overflow-recovery.d.ts.map +1 -1
- package/dist/v2/{message-index-bounded-2nhbwry6.js → message-index-bounded-1vew9c37.js} +5 -5
- package/dist/v2/migration-worker.js +2 -2
- package/dist/v2/{project-embedding-registry-fcxf4qht.js → project-embedding-registry-je5jam7y.js} +3 -3
- package/dist/v2/raw-ordinal-warmup-worker.js +4 -4
- package/dist/v2/{read-session-chunk-jrrhwxgx.js → read-session-chunk-09sre4xv.js} +4 -4
- package/dist/v2/{recomp-orchestrator-n79hdd7n.js → recomp-orchestrator-mgcty3we.js} +17 -17
- package/dist/v2/{render-7emcjdt1.js → render-ygcmyn9x.js} +11 -11
- package/dist/v2/{search-archive-fpjbmxcx.js → search-archive-nrsqqmk5.js} +6 -6
- package/dist/v2/{search-vz2cpgr0.js → search-gmye6n25.js} +12 -12
- package/dist/v2/{send-session-notification-zazaxxpf.js → send-session-notification-v69y04f5.js} +2 -2
- package/dist/v2/{server-vsqmkvxc.js → server-00adcfjd.js} +1 -1
- package/dist/v2/{server-kwsqytwj.js → server-2xm0gxke.js} +1 -1
- package/dist/v2/{server-r4816kwv.js → server-4ecpanyn.js} +47 -26
- package/dist/v2/{server-7e89a2kf.js → server-6chcnnhq.js} +12 -5
- package/dist/v2/{server-hgfd6c3e.js → server-6x40bnb7.js} +2 -2
- package/dist/v2/{server-vfa7byfa.js → server-bnkc9kph.js} +5 -5
- package/dist/v2/{server-n431vzn5.js → server-btgnkr9z.js} +2 -2
- package/dist/v2/{server-4axv6kq6.js → server-cvp9w5gs.js} +1375 -1310
- package/dist/v2/{server-4bfk1sky.js → server-dgsjamm4.js} +3 -3
- package/dist/v2/{server-rz6g5xne.js → server-e6xneh68.js} +1 -1
- package/dist/v2/{server-q2ap5cty.js → server-g53asaqt.js} +3 -3
- package/dist/v2/{server-6250cxzs.js → server-gs2251jr.js} +1 -1
- package/dist/v2/{server-8r32etq0.js → server-jkj1dq6j.js} +27 -3
- package/dist/v2/{server-b4efn08m.js → server-k1xc2bw1.js} +1 -1
- package/dist/v2/{server-3z8rhacq.js → server-myp4pc6x.js} +7 -7
- package/dist/v2/{server-72k2r3kt.js → server-pcarsvj2.js} +2 -2
- package/dist/v2/{server-0h875f56.js → server-rkj44mez.js} +76 -6
- package/dist/v2/{server-8ps3717t.js → server-vc5fta6s.js} +3 -3
- package/dist/v2/{server-j9cm1czj.js → server-vtgeyhq6.js} +11 -0
- package/dist/v2/{server-xmgvy3cq.js → server-x69fqsvz.js} +1 -1
- package/dist/v2/{server-q104czn6.js → server-z9czv2vb.js} +90 -25
- package/dist/v2/server.js +4 -4
- package/dist/v2/{storage-tags-t0f9njdp.js → storage-tags-nccqr0kr.js} +2 -2
- package/dist/v2/{store-q3ef5rvz.js → store-enef5jcn.js} +2 -2
- package/dist/v2/{store-reader-wc01y2rc.js → store-reader-jbaqv1yp.js} +1 -1
- package/dist/v2/store-reader.d.ts +16 -0
- package/dist/v2/store-reader.d.ts.map +1 -1
- package/dist/v2/{v2-archive-reader-9p84yzk5.js → v2-archive-reader-7vmng8q7.js} +1 -1
- package/dist/v2/{wrapup-orchestrator-acebazx8.js → wrapup-orchestrator-7r4y0bf6.js} +17 -17
- package/dist/{v2-archive-reader-w1bbaqe8.js → v2-archive-reader-7s90gfax.js} +1 -1
- package/dist/{wrapup-orchestrator-fwbe0mvm.js → wrapup-orchestrator-m2p89973.js} +18 -18
- package/package.json +1 -1
- package/src/config/schema/magic-context.ts +1 -1
- package/src/shared/models-dev-cache.test.ts +15 -0
- /package/dist/v2/{server-3ap5dmhc.js → server-5hwf5c7r.js} +0 -0
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
getPendingPiCompactionMarkerState,
|
|
59
59
|
logPiCompactionMarkerClear,
|
|
60
60
|
isPrefixBoundThinkingModel
|
|
61
|
-
} from "./server-
|
|
61
|
+
} from "./server-z9czv2vb.js";
|
|
62
62
|
import {
|
|
63
63
|
BoundedSessionMap,
|
|
64
64
|
getTableColumnNames,
|
|
@@ -71,11 +71,11 @@ import {
|
|
|
71
71
|
} from "./server-qntmqaca.js";
|
|
72
72
|
import {
|
|
73
73
|
withReadOnlySessionDb
|
|
74
|
-
} from "./server-
|
|
74
|
+
} from "./server-5hwf5c7r.js";
|
|
75
75
|
import {
|
|
76
76
|
layoutLkgPrefix,
|
|
77
77
|
assembleLkgPrefix
|
|
78
|
-
} from "./server-
|
|
78
|
+
} from "./server-jkj1dq6j.js";
|
|
79
79
|
import {
|
|
80
80
|
ensurePrivateStorageDirectorySync,
|
|
81
81
|
writeStorageFileSync,
|
|
@@ -86,7 +86,7 @@ import {
|
|
|
86
86
|
import {
|
|
87
87
|
gaDatabasePath2,
|
|
88
88
|
V2StoreReader2
|
|
89
|
-
} from "./server-
|
|
89
|
+
} from "./server-vtgeyhq6.js";
|
|
90
90
|
import {
|
|
91
91
|
markHostInstructionRow,
|
|
92
92
|
hostInstructionRowID,
|
|
@@ -1805,7 +1805,7 @@ function noteCapturedLkgRequest(args) {
|
|
|
1805
1805
|
captures.set(args.sessionId, {
|
|
1806
1806
|
request,
|
|
1807
1807
|
slot: identity(args.slot),
|
|
1808
|
-
prefixCount: JSON.parse(args.slot.jsonPrefix).length,
|
|
1808
|
+
prefixCount: args.prefixCount ?? JSON.parse(args.slot.jsonPrefix).length,
|
|
1809
1809
|
envelope: envelope(request.modelKey, args.systemPromptTokens, args.agentName, args.sessionId)
|
|
1810
1810
|
});
|
|
1811
1811
|
}
|
|
@@ -1967,22 +1967,32 @@ function rememberFingerprint(db, sessionId, fingerprint) {
|
|
|
1967
1967
|
}
|
|
1968
1968
|
saved.set(sessionId, fingerprint);
|
|
1969
1969
|
}
|
|
1970
|
-
function
|
|
1971
|
-
return
|
|
1972
|
-
slot.
|
|
1973
|
-
slot.
|
|
1974
|
-
slot.
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1970
|
+
function serializeSlotMetadata(slot) {
|
|
1971
|
+
return {
|
|
1972
|
+
inputIdSeq: JSON.stringify(slot.piOutputEntryIds ? { version: 1, inputIds: slot.inputIdSeq, piOutputEntryIds: slot.piOutputEntryIds } : slot.inputIdSeq),
|
|
1973
|
+
inputContentDigests: JSON.stringify(slot.inputContentDigests),
|
|
1974
|
+
inputContentSignatures: slot.inputContentSignatures ? JSON.stringify(slot.inputContentSignatures) : null
|
|
1975
|
+
};
|
|
1976
|
+
}
|
|
1977
|
+
function slotFingerprint(slot, metadata = serializeSlotMetadata(slot)) {
|
|
1978
|
+
return createHash5("sha256").update([
|
|
1979
|
+
JSON.stringify([
|
|
1980
|
+
slot.jsonPrefix,
|
|
1981
|
+
slot.lastInputMessageId,
|
|
1982
|
+
slot.modelKey,
|
|
1983
|
+
slot.providerKey,
|
|
1984
|
+
slot.rowVersion,
|
|
1985
|
+
slot.captureSequence
|
|
1986
|
+
]),
|
|
1987
|
+
metadata.inputIdSeq,
|
|
1988
|
+
metadata.inputContentDigests,
|
|
1989
|
+
metadata.inputContentSignatures ?? "null"
|
|
1990
|
+
].join(`
|
|
1991
|
+
`)).digest("hex");
|
|
1983
1992
|
}
|
|
1984
1993
|
function persistLkgSlot(db, sessionId, slot, publishMetadata) {
|
|
1985
|
-
const
|
|
1994
|
+
const metadata = serializeSlotMetadata(slot);
|
|
1995
|
+
const fingerprint = slotFingerprint(slot, metadata);
|
|
1986
1996
|
if (!publishMetadata && persistedFingerprints.get(db)?.get(sessionId) === fingerprint) {
|
|
1987
1997
|
const durable = loadPersistedLkgSlot(db, sessionId);
|
|
1988
1998
|
if (durable && slotFingerprint(durable) === fingerprint)
|
|
@@ -1990,9 +2000,6 @@ function persistLkgSlot(db, sessionId, slot, publishMetadata) {
|
|
|
1990
2000
|
}
|
|
1991
2001
|
const layout = layoutLkgPrefix(slot.jsonPrefix);
|
|
1992
2002
|
try {
|
|
1993
|
-
const inputIdSeq = JSON.stringify(slot.piOutputEntryIds ? { version: 1, inputIds: slot.inputIdSeq, piOutputEntryIds: slot.piOutputEntryIds } : slot.inputIdSeq);
|
|
1994
|
-
const inputContentDigests = JSON.stringify(slot.inputContentDigests);
|
|
1995
|
-
const inputContentSignatures = slot.inputContentSignatures ? JSON.stringify(slot.inputContentSignatures) : null;
|
|
1996
2003
|
db.transaction(() => {
|
|
1997
2004
|
const storedHashes = new Map;
|
|
1998
2005
|
for (const row of db.prepare("SELECT chunk, hash FROM lkg_slot_chunks WHERE session_id = ?").all(sessionId)) {
|
|
@@ -2024,7 +2031,7 @@ function persistLkgSlot(db, sessionId, slot, publishMetadata) {
|
|
|
2024
2031
|
provider_key = excluded.provider_key,
|
|
2025
2032
|
captured_at = excluded.captured_at,
|
|
2026
2033
|
row_version = excluded.row_version,
|
|
2027
|
-
capture_sequence = excluded.capture_sequence`).run(sessionId, layout.chars, layout.chunks.length, layout.hash, inputIdSeq, inputContentDigests, inputContentSignatures, slot.lastInputMessageId, slot.modelKey, slot.providerKey, slot.capturedAt, slot.rowVersion ?? null, slot.captureSequence ?? null);
|
|
2034
|
+
capture_sequence = excluded.capture_sequence`).run(sessionId, layout.chars, layout.chunks.length, layout.hash, metadata.inputIdSeq, metadata.inputContentDigests, metadata.inputContentSignatures, slot.lastInputMessageId, slot.modelKey, slot.providerKey, slot.capturedAt, slot.rowVersion ?? null, slot.captureSequence ?? null);
|
|
2028
2035
|
publishMetadata?.();
|
|
2029
2036
|
}).immediate();
|
|
2030
2037
|
rememberFingerprint(db, sessionId, fingerprint);
|
|
@@ -2431,6 +2438,13 @@ function outputMessageIsPostAnchor(message, inputIndexById, anchorIndex, systemI
|
|
|
2431
2438
|
const linkedIndex = inputIndexById.get(linked);
|
|
2432
2439
|
return linkedIndex === undefined ? null : linkedIndex > anchorIndex;
|
|
2433
2440
|
}
|
|
2441
|
+
function canCountWithoutToJSON(value) {
|
|
2442
|
+
try {
|
|
2443
|
+
return !("toJSON" in value);
|
|
2444
|
+
} catch {
|
|
2445
|
+
return false;
|
|
2446
|
+
}
|
|
2447
|
+
}
|
|
2434
2448
|
function buildLkgPrefix(input, output, completeOutput = false) {
|
|
2435
2449
|
const projected = asEntryProjection(input);
|
|
2436
2450
|
let anchorIndex = completeOutput && projected.length > 0 ? projected.length - 1 : findLkgAnchor(projected);
|
|
@@ -2480,14 +2494,18 @@ function buildLkgPrefix(input, output, completeOutput = false) {
|
|
|
2480
2494
|
if (inputContentDigests.some((digest) => digest === null))
|
|
2481
2495
|
return null;
|
|
2482
2496
|
const prefix = [];
|
|
2497
|
+
let canCountFromArray = canCountWithoutToJSON(prefix);
|
|
2483
2498
|
for (const message of output) {
|
|
2484
2499
|
const postAnchor = completeOutput ? false : outputMessageIsPostAnchor(message, inputIndexById, anchorIndex, systemIndices);
|
|
2485
2500
|
if (postAnchor === null)
|
|
2486
2501
|
return null;
|
|
2487
2502
|
if (isRetiredInstructionRow(message.info) && messageRole(message) === "system" && messageParts(message).length === 0)
|
|
2488
2503
|
continue;
|
|
2489
|
-
if (!postAnchor)
|
|
2490
|
-
|
|
2504
|
+
if (!postAnchor) {
|
|
2505
|
+
const visible = providerVisibleMessage(message);
|
|
2506
|
+
canCountFromArray &&= canCountWithoutToJSON(visible);
|
|
2507
|
+
prefix.push(visible);
|
|
2508
|
+
}
|
|
2491
2509
|
}
|
|
2492
2510
|
let jsonPrefix;
|
|
2493
2511
|
try {
|
|
@@ -2497,12 +2515,14 @@ function buildLkgPrefix(input, output, completeOutput = false) {
|
|
|
2497
2515
|
} catch {
|
|
2498
2516
|
return null;
|
|
2499
2517
|
}
|
|
2518
|
+
canCountFromArray &&= canCountWithoutToJSON(prefix);
|
|
2500
2519
|
return {
|
|
2501
2520
|
anchorIndex,
|
|
2502
2521
|
anchorMessageId,
|
|
2503
2522
|
inputIdSeq: validIds.slice(0, anchorIndex + 1),
|
|
2504
2523
|
inputContentDigests,
|
|
2505
|
-
jsonPrefix
|
|
2524
|
+
jsonPrefix,
|
|
2525
|
+
prefixCount: canCountFromArray ? prefix.length : undefined
|
|
2506
2526
|
};
|
|
2507
2527
|
}
|
|
2508
2528
|
function captureLkgSlot(args) {
|
|
@@ -2524,6 +2544,7 @@ function captureLkgSlot(args) {
|
|
|
2524
2544
|
noteCapturedLkgRequest({
|
|
2525
2545
|
sessionId: args.sessionId,
|
|
2526
2546
|
slot,
|
|
2547
|
+
prefixCount: built.prefixCount,
|
|
2527
2548
|
request: built.anchorIndex === args.input.length - 1 ? claimLkgRequestIdentity(args.sessionId) : undefined,
|
|
2528
2549
|
systemPromptTokens: args.systemPromptTokens ?? 0,
|
|
2529
2550
|
agentName: args.agentName
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DEFAULT_LOCAL_EMBEDDING_MODEL
|
|
3
|
-
} from "./server-
|
|
3
|
+
} from "./server-e6xneh68.js";
|
|
4
4
|
import {
|
|
5
5
|
getHarness2
|
|
6
6
|
} from "./server-pavzsdc6.js";
|
|
@@ -795,6 +795,11 @@ async function prepareNativeOnnxTelemetry() {
|
|
|
795
795
|
}
|
|
796
796
|
|
|
797
797
|
// src/features/magic-context/memory/embedding-worker-client.ts
|
|
798
|
+
class EmbeddingRequestAbortedError extends Error {
|
|
799
|
+
constructor() {
|
|
800
|
+
super("embedding request aborted");
|
|
801
|
+
}
|
|
802
|
+
}
|
|
798
803
|
var warnedWindowsTelemetry = false;
|
|
799
804
|
var EMBEDDING_WORKER_STOP_GRACE_MS = 5000;
|
|
800
805
|
var EMBEDDING_WORKER_FORCED_EXIT_WAIT_MS = 2000;
|
|
@@ -968,7 +973,7 @@ class EmbeddingWorkerClient {
|
|
|
968
973
|
}
|
|
969
974
|
async request(texts, signal) {
|
|
970
975
|
if (signal?.aborted)
|
|
971
|
-
|
|
976
|
+
throw new EmbeddingRequestAbortedError;
|
|
972
977
|
this.activeRequests++;
|
|
973
978
|
this.clearIdleTimer();
|
|
974
979
|
try {
|
|
@@ -998,7 +1003,7 @@ class EmbeddingWorkerClient {
|
|
|
998
1003
|
if (this.disposed)
|
|
999
1004
|
throw new Error("embedding worker disposed");
|
|
1000
1005
|
if (signal?.aborted)
|
|
1001
|
-
throw new
|
|
1006
|
+
throw new EmbeddingRequestAbortedError;
|
|
1002
1007
|
return new Promise((resolve, reject) => {
|
|
1003
1008
|
const id = this.nextId++;
|
|
1004
1009
|
const timer = setTimeout(() => {
|
|
@@ -1008,7 +1013,7 @@ class EmbeddingWorkerClient {
|
|
|
1008
1013
|
clearTimeout(timer);
|
|
1009
1014
|
this.pending.delete(id);
|
|
1010
1015
|
signal?.removeEventListener("abort", abort);
|
|
1011
|
-
reject(new
|
|
1016
|
+
reject(new EmbeddingRequestAbortedError);
|
|
1012
1017
|
if (this.pending.size === 0) {
|
|
1013
1018
|
worker.unref();
|
|
1014
1019
|
if (!(worker instanceof Worker))
|
|
@@ -1729,7 +1734,9 @@ class LocalEmbeddingProvider {
|
|
|
1729
1734
|
this.recordWorkerReply(reply);
|
|
1730
1735
|
return reply.vectors ?? texts.map(() => null);
|
|
1731
1736
|
} catch (error) {
|
|
1732
|
-
|
|
1737
|
+
if (!(signal?.aborted && error instanceof EmbeddingRequestAbortedError)) {
|
|
1738
|
+
this.recordWorkerFailure(error);
|
|
1739
|
+
}
|
|
1733
1740
|
return texts.map(() => null);
|
|
1734
1741
|
}
|
|
1735
1742
|
}
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
} from "./server-qb3s0mnc.js";
|
|
4
4
|
import {
|
|
5
5
|
getTagById2
|
|
6
|
-
} from "./server-
|
|
6
|
+
} from "./server-z9czv2vb.js";
|
|
7
7
|
import {
|
|
8
8
|
expandToolPart,
|
|
9
9
|
visitRawSessionMessages2,
|
|
10
10
|
readRawSessionMessageById2
|
|
11
|
-
} from "./server-
|
|
11
|
+
} from "./server-dgsjamm4.js";
|
|
12
12
|
|
|
13
13
|
// src/tools/ctx-expand/render.ts
|
|
14
14
|
import { createHash } from "node:crypto";
|
|
@@ -137,11 +137,11 @@ async function serveV2ArchiveReads2(port, openConnections) {
|
|
|
137
137
|
{ createV2RecoveryAttachments }
|
|
138
138
|
] = await Promise.all([
|
|
139
139
|
import("./sqlite-zdgm52sv.js"),
|
|
140
|
-
import("./store-reader-
|
|
141
|
-
import("./store-
|
|
142
|
-
import("./read-session-chunk-
|
|
143
|
-
import("./render-
|
|
144
|
-
import("./search-archive-
|
|
140
|
+
import("./store-reader-jbaqv1yp.js"),
|
|
141
|
+
import("./store-enef5jcn.js"),
|
|
142
|
+
import("./read-session-chunk-09sre4xv.js"),
|
|
143
|
+
import("./render-ygcmyn9x.js"),
|
|
144
|
+
import("./search-archive-nrsqqmk5.js"),
|
|
145
145
|
import("./expand-attachments-h33jbgyz.js")
|
|
146
146
|
]);
|
|
147
147
|
const pool = new V2StoreReaderPool;
|
|
@@ -65,7 +65,7 @@ import {
|
|
|
65
65
|
hasPendingMigrations,
|
|
66
66
|
getMainThreadMigrationBodyCount,
|
|
67
67
|
runMigrations
|
|
68
|
-
} from "./server-
|
|
68
|
+
} from "./server-jkj1dq6j.js";
|
|
69
69
|
import {
|
|
70
70
|
ensureColumn,
|
|
71
71
|
setDatabase,
|
|
@@ -1084,7 +1084,7 @@ function finishDatabaseOpen(db, dbPath, explicitDbPath, latestSupportedVersion)
|
|
|
1084
1084
|
state.running = startMessageFtsRowidMapBackfill2(db, signal).then(async () => {
|
|
1085
1085
|
if (signal.aborted || !readsOpenCodeStore)
|
|
1086
1086
|
return;
|
|
1087
|
-
const { readRawSessionMessagePage, readRawSessionMessages } = await importPluginModule(() => import("./read-session-chunk-
|
|
1087
|
+
const { readRawSessionMessagePage, readRawSessionMessages } = await importPluginModule(() => import("./read-session-chunk-09sre4xv.js"));
|
|
1088
1088
|
const { startMessageTimeBackfill } = await importPluginModule(() => import("./message-time-backfill-ynb3vg6r.js"));
|
|
1089
1089
|
if (signal.aborted)
|
|
1090
1090
|
return;
|