@cortexkit/opencode-magic-context 0.49.41 → 0.49.42
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 +1 -1
- package/dist/chunk-embedding-write-worker.js +1 -1
- package/dist/{context-3szg46w6.js → context-zf1yj1g0.js} +167 -47
- package/dist/hooks/magic-context/host-served-rows.d.ts +17 -0
- package/dist/hooks/magic-context/host-served-rows.d.ts.map +1 -1
- package/dist/hooks/magic-context/lkg-replay.d.ts +2 -0
- package/dist/hooks/magic-context/lkg-replay.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +2 -0
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts +3 -0
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/{index-j8gv6ajw.js → index-1zv08avf.js} +4 -4
- package/dist/{index-4y35msh5.js → index-29gd1zcx.js} +1 -1
- package/dist/{index-aed5qpyv.js → index-5m2azs6v.js} +3 -3
- package/dist/{index-216tae7b.js → index-adt3jghq.js} +16 -15
- package/dist/{index-bgxpadsx.js → index-ayk4we2k.js} +11 -5
- package/dist/{index-j5qma52p.js → index-fas76dft.js} +2 -2
- package/dist/{index-9z4d2ha0.js → index-gsqz39wk.js} +1 -1
- package/dist/{index-9fgmkfaf.js → index-kfsqk1q7.js} +1 -1
- package/dist/{index-z7etaphs.js → index-n8bsqg7b.js} +4 -4
- package/dist/{index-hb76vdmm.js → index-p2e7j9p1.js} +1 -1
- package/dist/{index-72czy45z.js → index-rdx17j04.js} +36 -8
- package/dist/{v2/server-z9zygwse.js → index-s9x93tfs.js} +32 -1
- package/dist/{index-j105mf16.js → index-xjw9rres.js} +1 -1
- package/dist/{index-q9gamh8e.js → index-xmqj3cf5.js} +5 -5
- package/dist/{index-ryz4pdvf.js → index-z6v8086q.js} +2 -2
- package/dist/{index-tn9drm1a.js → index-zqsp3z0d.js} +1 -1
- package/dist/index.js +17 -17
- package/dist/{message-index-bounded-jqm3ezva.js → message-index-bounded-5mj8p6nq.js} +2 -2
- package/dist/migration-worker.js +1 -1
- package/dist/raw-ordinal-warmup-worker.js +3 -3
- package/dist/{read-session-chunk-26yrrhyz.js → read-session-chunk-k70bhfjm.js} +1 -1
- package/dist/{recomp-orchestrator-7v52khmf.js → recomp-orchestrator-2q4rmerf.js} +6 -6
- package/dist/{render-gqdq6t7f.js → render-36fvvwz6.js} +5 -5
- package/dist/{search-vqkmmy9c.js → search-6v2na3af.js} +4 -4
- package/dist/{search-archive-kfwpk73t.js → search-archive-jwb2ctnq.js} +3 -3
- package/dist/{store-s3eykdjt.js → store-pd1e9hnr.js} +1 -1
- package/dist/{transform-postprocess-phase-6fpgz12m.js → transform-postprocess-phase-0ms3ga4h.js} +7 -7
- package/dist/v2/auto-search-worker.js +1 -1
- package/dist/v2/chunk-embedding-write-worker.js +1 -1
- package/dist/v2/{context-eq5bhf40.js → context-2xr6vbt2.js} +175 -50
- package/dist/v2/fold/code-mode-catalog.d.ts +10 -0
- package/dist/v2/fold/code-mode-catalog.d.ts.map +1 -1
- package/dist/v2/fold/instruction-supersession.d.ts +9 -0
- package/dist/v2/fold/instruction-supersession.d.ts.map +1 -0
- package/dist/v2/fold/native-replay.d.ts.map +1 -1
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/hooks/payload.d.ts +2 -1
- package/dist/v2/hooks/payload.d.ts.map +1 -1
- package/dist/v2/{message-index-bounded-dgd8a2x1.js → message-index-bounded-5341qsqd.js} +2 -2
- package/dist/v2/migration-worker.js +1 -1
- package/dist/v2/raw-ordinal-warmup-worker.js +3 -3
- package/dist/v2/{read-session-chunk-tqnh1ret.js → read-session-chunk-dgmq3ntm.js} +1 -1
- package/dist/v2/{recomp-orchestrator-kep59sph.js → recomp-orchestrator-2vmyhtst.js} +5 -5
- package/dist/v2/{render-yyv8nv4p.js → render-kz0f40ws.js} +5 -5
- package/dist/v2/{search-cb1kdgqw.js → search-a9hwy1sw.js} +3 -3
- package/dist/v2/{search-archive-gagdnrb3.js → search-archive-wajxd01m.js} +3 -3
- package/dist/v2/{server-g3gqq4ac.js → server-09td1wgc.js} +1 -1
- package/dist/v2/{server-dt9b00ja.js → server-3m7p4g9w.js} +1 -1
- package/dist/v2/{server-hewk7z3z.js → server-5ydn39x3.js} +5 -5
- package/dist/v2/{server-t8y64xj7.js → server-7qc9tk6z.js} +36 -8
- package/dist/v2/{server-r4mmc670.js → server-dqs8e4yt.js} +1 -1
- package/dist/v2/{server-jd7vzwn4.js → server-kqrpt2ht.js} +1 -1
- package/dist/v2/{server-qjyp27vf.js → server-p78wdf43.js} +1 -1
- package/dist/v2/{server-2d01821b.js → server-qehn6btp.js} +2 -2
- package/dist/{index-z9zygwse.js → v2/server-s9x93tfs.js} +32 -1
- package/dist/v2/{server-2tp6y1qs.js → server-sfcp13bn.js} +4 -4
- package/dist/v2/{server-6emy0v9a.js → server-ymn9w46x.js} +1 -1
- package/dist/v2/server.js +2 -2
- package/dist/v2/{store-z3qe67cg.js → store-pebs9m52.js} +1 -1
- package/dist/v2/{v2-archive-reader-2rv5dz7k.js → v2-archive-reader-ag6sk771.js} +1 -1
- package/dist/v2/{wrapup-orchestrator-1mgx1nym.js → wrapup-orchestrator-2a077zew.js} +5 -5
- package/dist/{v2-archive-reader-4hz9pnmy.js → v2-archive-reader-chk95syc.js} +1 -1
- package/dist/{wrapup-orchestrator-yy0n9mxy.js → wrapup-orchestrator-rhs675kj.js} +7 -7
- package/package.json +1 -1
|
@@ -209,7 +209,7 @@ import {
|
|
|
209
209
|
startCompartmentAgent,
|
|
210
210
|
setRecompStarting2,
|
|
211
211
|
setRecompTerminal2
|
|
212
|
-
} from "./server-
|
|
212
|
+
} from "./server-5ydn39x3.js";
|
|
213
213
|
import {
|
|
214
214
|
resolveHistorianModel2
|
|
215
215
|
} from "./server-5kym00ag.js";
|
|
@@ -590,7 +590,7 @@ import {
|
|
|
590
590
|
readRawSessionMessageOrdinalById2,
|
|
591
591
|
readSessionChunk2,
|
|
592
592
|
readRawSessionSeedTail2
|
|
593
|
-
} from "./server-
|
|
593
|
+
} from "./server-kqrpt2ht.js";
|
|
594
594
|
import {
|
|
595
595
|
BoundedSessionMap,
|
|
596
596
|
recordToolDefinitionSet,
|
|
@@ -601,7 +601,7 @@ import {
|
|
|
601
601
|
cleanSearchText,
|
|
602
602
|
matchedSearchSnippet,
|
|
603
603
|
getLastIndexedOrdinal
|
|
604
|
-
} from "./server-
|
|
604
|
+
} from "./server-3m7p4g9w.js";
|
|
605
605
|
import"./server-nmyganc8.js";
|
|
606
606
|
import {
|
|
607
607
|
getMessageIndexEpoch,
|
|
@@ -628,7 +628,7 @@ import {
|
|
|
628
628
|
resolveMemoriesByIdsForSearch2,
|
|
629
629
|
unifiedSearch2,
|
|
630
630
|
formatSearchResults2
|
|
631
|
-
} from "./server-
|
|
631
|
+
} from "./server-dqs8e4yt.js";
|
|
632
632
|
import {
|
|
633
633
|
embedPauseBySession,
|
|
634
634
|
embedRunStateBySession,
|
|
@@ -761,7 +761,7 @@ import {
|
|
|
761
761
|
saveSourceContent,
|
|
762
762
|
replaceSourceContent,
|
|
763
763
|
getSourceContents
|
|
764
|
-
} from "./server-
|
|
764
|
+
} from "./server-7qc9tk6z.js";
|
|
765
765
|
import {
|
|
766
766
|
startBootDeadline,
|
|
767
767
|
getUnconfirmedMigrationHolders,
|
|
@@ -777,7 +777,7 @@ import {
|
|
|
777
777
|
openDatabaseAsync,
|
|
778
778
|
isDatabasePersisted,
|
|
779
779
|
getDatabasePersistenceError
|
|
780
|
-
} from "./server-
|
|
780
|
+
} from "./server-09td1wgc.js";
|
|
781
781
|
import {
|
|
782
782
|
V2_MEMORY_CATEGORIES,
|
|
783
783
|
CATEGORY_PRIORITY
|
|
@@ -954,7 +954,7 @@ import {
|
|
|
954
954
|
readV2RawMessagePagesForConversion2,
|
|
955
955
|
createV2RawMessageReader2,
|
|
956
956
|
createV2RawMessageProvider2
|
|
957
|
-
} from "./server-
|
|
957
|
+
} from "./server-ymn9w46x.js";
|
|
958
958
|
import {
|
|
959
959
|
resolvePromptContext2
|
|
960
960
|
} from "./server-fmsr7v69.js";
|
|
@@ -962,20 +962,23 @@ import {
|
|
|
962
962
|
renderMessageByOrdinal2,
|
|
963
963
|
renderVerboseRangeForTool2,
|
|
964
964
|
renderItemByTag2
|
|
965
|
-
} from "./server-
|
|
965
|
+
} from "./server-p78wdf43.js";
|
|
966
966
|
import"./server-kaqs6h31.js";
|
|
967
967
|
import {
|
|
968
968
|
readV2ArchiveOffThread2
|
|
969
|
-
} from "./server-
|
|
969
|
+
} from "./server-sfcp13bn.js";
|
|
970
970
|
import {
|
|
971
971
|
renderSearchArchiveOffThread2
|
|
972
|
-
} from "./server-
|
|
972
|
+
} from "./server-qehn6btp.js";
|
|
973
973
|
import {
|
|
974
|
+
markHostInstructionRow,
|
|
975
|
+
hostInstructionRow,
|
|
976
|
+
markRetiredInstructionRow,
|
|
974
977
|
markCoveredInstructionRow,
|
|
975
978
|
isCoveredInstructionRow,
|
|
976
979
|
takeCoveredInstructionRows,
|
|
977
980
|
cloneKeepingCoveredInstructionMarks
|
|
978
|
-
} from "./server-
|
|
981
|
+
} from "./server-s9x93tfs.js";
|
|
979
982
|
import {
|
|
980
983
|
compareSemverCore
|
|
981
984
|
} from "./server-84w6rvvf.js";
|
|
@@ -1127,7 +1130,7 @@ __export(exports_external, {
|
|
|
1127
1130
|
cuid2: () => cuid22,
|
|
1128
1131
|
custom: () => custom,
|
|
1129
1132
|
date: () => date3,
|
|
1130
|
-
decode: () =>
|
|
1133
|
+
decode: () => decode3,
|
|
1131
1134
|
decodeAsync: () => decodeAsync2,
|
|
1132
1135
|
discriminatedUnion: () => discriminatedUnion,
|
|
1133
1136
|
e164: () => e1642,
|
|
@@ -1488,7 +1491,7 @@ __export(exports_core2, {
|
|
|
1488
1491
|
_xid: () => _xid,
|
|
1489
1492
|
clone: () => clone2,
|
|
1490
1493
|
config: () => config,
|
|
1491
|
-
decode: () =>
|
|
1494
|
+
decode: () => decode2,
|
|
1492
1495
|
decodeAsync: () => decodeAsync,
|
|
1493
1496
|
encode: () => encode,
|
|
1494
1497
|
encodeAsync: () => encodeAsync,
|
|
@@ -10992,6 +10995,11 @@ async function runPostTransformPhase(args) {
|
|
|
10992
10995
|
recordFirstApplicationWireEdit(false);
|
|
10993
10996
|
firstApplicationLocations.set(message, Math.min(firstApplicationLocations.get(message) ?? Infinity, partIndex));
|
|
10994
10997
|
};
|
|
10998
|
+
const hostRowReclaim = args.reclaimHostRows?.(args.sessionId, args.messages, !compactionOff && isCacheBustingPass);
|
|
10999
|
+
for (const message of hostRowReclaim?.edits ?? []) {
|
|
11000
|
+
const index = args.messages.indexOf(message);
|
|
11001
|
+
recordFirstApplicationWireEdit(index < 0 || servesThinkingBlock(args.messages.slice(index + 1), args.resolvedProviderID, args.resolvedModelID));
|
|
11002
|
+
}
|
|
10995
11003
|
let heuristicOrReasoningDidMutate = false;
|
|
10996
11004
|
let heuristicOrReasoningEditBesidesTrim = false;
|
|
10997
11005
|
let droppedCount = 0;
|
|
@@ -11952,6 +11960,7 @@ async function runPostTransformPhase(args) {
|
|
|
11952
11960
|
failPass("proactive-thinking-strip-persistence-failure");
|
|
11953
11961
|
}
|
|
11954
11962
|
}
|
|
11963
|
+
hostRowReclaim?.commit();
|
|
11955
11964
|
let settledDroppedReasoning = 0;
|
|
11956
11965
|
if (!canUseEmptySentinels) {
|
|
11957
11966
|
let mode = "legacy";
|
|
@@ -20490,6 +20499,7 @@ Historian previously failed ${historianFailureState.failureCount} time(s), so Ma
|
|
|
20490
20499
|
sessionId,
|
|
20491
20500
|
db,
|
|
20492
20501
|
messages,
|
|
20502
|
+
reclaimHostRows: deps.reclaimHostRows,
|
|
20493
20503
|
tags: activeTags,
|
|
20494
20504
|
targets,
|
|
20495
20505
|
reasoningByMessage,
|
|
@@ -24320,7 +24330,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
24320
24330
|
const db = readDatabase();
|
|
24321
24331
|
if (!db)
|
|
24322
24332
|
return { ok: false, error: "db unavailable" };
|
|
24323
|
-
const { runManagedRecomp } = await importPluginModule(() => import("./recomp-orchestrator-
|
|
24333
|
+
const { runManagedRecomp } = await importPluginModule(() => import("./recomp-orchestrator-2vmyhtst.js"));
|
|
24324
24334
|
const { sendIgnoredMessage } = await importPluginModule(() => import("./send-session-notification-kxp47tsw.js"));
|
|
24325
24335
|
log2(`[rpc] recomp requested for session ${sessionId}`);
|
|
24326
24336
|
if (!args.client && !args.hiddenCompletionExecutor) {
|
|
@@ -24405,7 +24415,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
24405
24415
|
const db = readDatabase();
|
|
24406
24416
|
if (!db)
|
|
24407
24417
|
return { ok: false, error: "db unavailable" };
|
|
24408
|
-
const { runManagedWrapup } = await importPluginModule(() => import("./wrapup-orchestrator-
|
|
24418
|
+
const { runManagedWrapup } = await importPluginModule(() => import("./wrapup-orchestrator-2a077zew.js"));
|
|
24409
24419
|
const model = liveSessionState.liveModelBySession.get(sessionId);
|
|
24410
24420
|
const contextLimit = model ? resolveContextLimit(model.providerID, model.modelID, { db, sessionID: sessionId }) : 128000;
|
|
24411
24421
|
const ctx = {
|
|
@@ -25538,6 +25548,122 @@ class HostFoldIdle {
|
|
|
25538
25548
|
}
|
|
25539
25549
|
}
|
|
25540
25550
|
|
|
25551
|
+
// src/v2/fold/code-mode-catalog.ts
|
|
25552
|
+
var changed = "The Code Mode tool catalog has changed.";
|
|
25553
|
+
var replacement = `${changed} This catalog supersedes the previous Code Mode tool catalog.`;
|
|
25554
|
+
var codeMode = "core/codemode";
|
|
25555
|
+
var mcp = "core/mcp-guidance";
|
|
25556
|
+
var mcpReplacement = "The available MCP server instructions have changed. This list supersedes the previous one.";
|
|
25557
|
+
var mcpDeltas = [
|
|
25558
|
+
"New MCP server instructions are available in addition to those previously listed:",
|
|
25559
|
+
"The following MCP server instructions have changed. Each entry replaces the previously listed server with the same name:",
|
|
25560
|
+
"Instructions for the following MCP servers are no longer available:"
|
|
25561
|
+
];
|
|
25562
|
+
function sourceState(text, source) {
|
|
25563
|
+
const starts = (prefix) => text.startsWith(prefix) || text.includes(`
|
|
25564
|
+
|
|
25565
|
+
${prefix}`);
|
|
25566
|
+
if (source === codeMode) {
|
|
25567
|
+
if (text.startsWith(`${replacement}
|
|
25568
|
+
|
|
25569
|
+
`)) {
|
|
25570
|
+
const rendered = text.slice(replacement.length + 2);
|
|
25571
|
+
if (rendered.startsWith(`# Code Mode
|
|
25572
|
+
`) || rendered.startsWith("No Code Mode tools are currently available."))
|
|
25573
|
+
return "full";
|
|
25574
|
+
return;
|
|
25575
|
+
}
|
|
25576
|
+
if (text.startsWith(changed))
|
|
25577
|
+
return "delta";
|
|
25578
|
+
if (text.startsWith(`# Code Mode
|
|
25579
|
+
`) || text.startsWith("No Code Mode tools are currently available."))
|
|
25580
|
+
return "full";
|
|
25581
|
+
}
|
|
25582
|
+
if (source === mcp) {
|
|
25583
|
+
if (mcpDeltas.some(starts))
|
|
25584
|
+
return "delta";
|
|
25585
|
+
if ((starts(`${mcpReplacement}
|
|
25586
|
+
<mcp_instructions>
|
|
25587
|
+
`) || starts(`<mcp_instructions>
|
|
25588
|
+
`)) && text.includes("</mcp_instructions>"))
|
|
25589
|
+
return "full";
|
|
25590
|
+
}
|
|
25591
|
+
return;
|
|
25592
|
+
}
|
|
25593
|
+
function supersededInstructionIDs(rows) {
|
|
25594
|
+
const covered = new Set;
|
|
25595
|
+
const retired = new Set;
|
|
25596
|
+
for (let index = rows.length - 1;index >= 0; index--) {
|
|
25597
|
+
const row = rows[index];
|
|
25598
|
+
const metadata = row.data.metadata;
|
|
25599
|
+
const keyed = typeof metadata === "object" && metadata !== null && "instructionSources" in metadata;
|
|
25600
|
+
const keys = keyed ? metadata.instructionSources : undefined;
|
|
25601
|
+
const text = row.data.text ?? "";
|
|
25602
|
+
const sources = keyed ? Array.isArray(keys) && keys.length > 0 && keys.every((key) => typeof key === "string") ? keys : [] : [codeMode, mcp].filter((source) => sourceState(text, source) !== undefined);
|
|
25603
|
+
const states = sources.map((source) => sourceState(text, source));
|
|
25604
|
+
if (sources.length > 0 && sources.every((source, i) => states[i] !== undefined && covered.has(source)))
|
|
25605
|
+
retired.add(row.id);
|
|
25606
|
+
sources.forEach((source, i) => {
|
|
25607
|
+
if (states[i] === "full")
|
|
25608
|
+
covered.add(source);
|
|
25609
|
+
});
|
|
25610
|
+
}
|
|
25611
|
+
return retired;
|
|
25612
|
+
}
|
|
25613
|
+
|
|
25614
|
+
// src/v2/fold/instruction-supersession.ts
|
|
25615
|
+
var namespace = "instructionSupersession";
|
|
25616
|
+
function decode(value) {
|
|
25617
|
+
if (value === undefined)
|
|
25618
|
+
return new Set;
|
|
25619
|
+
if (!Array.isArray(value) || !value.every((id) => typeof id === "string" && id.length > 0))
|
|
25620
|
+
throw new Error("Invalid instruction supersession replay state");
|
|
25621
|
+
return new Set(value);
|
|
25622
|
+
}
|
|
25623
|
+
function retiredLiveInstructionIDs(db, sessionID) {
|
|
25624
|
+
return decode(readReplayEnvelope(db, sessionID)[namespace]);
|
|
25625
|
+
}
|
|
25626
|
+
function reclaimInstructionRows(db, sessionID, messages, permitted, folded = new Set) {
|
|
25627
|
+
const rows = messages.flatMap((message) => {
|
|
25628
|
+
const row = hostInstructionRow(message.info);
|
|
25629
|
+
return row ? [{ message, row }] : [];
|
|
25630
|
+
});
|
|
25631
|
+
const retired = rows.length ? retiredLiveInstructionIDs(db, sessionID) : new Set;
|
|
25632
|
+
const selected = permitted ? supersededInstructionIDs(rows.map(({ row }) => row)) : new Set;
|
|
25633
|
+
const newlyRetired = new Set([...selected].filter((id) => !retired.has(id)));
|
|
25634
|
+
const omitted = new Set([...retired, ...newlyRetired]);
|
|
25635
|
+
const edits = [];
|
|
25636
|
+
for (const { message, row } of rows) {
|
|
25637
|
+
if (!omitted.has(row.id))
|
|
25638
|
+
continue;
|
|
25639
|
+
if (newlyRetired.has(row.id) && message.parts.length > 0)
|
|
25640
|
+
edits.push(message);
|
|
25641
|
+
message.parts = [];
|
|
25642
|
+
}
|
|
25643
|
+
return {
|
|
25644
|
+
edits,
|
|
25645
|
+
commit() {
|
|
25646
|
+
if (newlyRetired.size > 0 && !updateReplayDocument(db, sessionID, (doc) => {
|
|
25647
|
+
const current = decode(doc[namespace]);
|
|
25648
|
+
if ([...newlyRetired].every((id) => current.has(id)))
|
|
25649
|
+
return false;
|
|
25650
|
+
for (const id of folded)
|
|
25651
|
+
current.delete(id);
|
|
25652
|
+
for (const id of newlyRetired)
|
|
25653
|
+
current.add(id);
|
|
25654
|
+
doc.version = 2;
|
|
25655
|
+
doc[namespace] = [...current];
|
|
25656
|
+
return true;
|
|
25657
|
+
}))
|
|
25658
|
+
throw new Error("Cannot persist instruction supersession");
|
|
25659
|
+
for (const { message, row } of rows) {
|
|
25660
|
+
if (omitted.has(row.id))
|
|
25661
|
+
markRetiredInstructionRow(message.info);
|
|
25662
|
+
}
|
|
25663
|
+
}
|
|
25664
|
+
};
|
|
25665
|
+
}
|
|
25666
|
+
|
|
25541
25667
|
// src/v2/fold/manual-baseline.ts
|
|
25542
25668
|
function stageManualBaseline(db, sessionID, render) {
|
|
25543
25669
|
const read = () => db.prepare("SELECT * FROM session_meta WHERE session_id = ?").get(sessionID);
|
|
@@ -26068,7 +26194,7 @@ function rebuildFileContent(value, output, attachments) {
|
|
|
26068
26194
|
rebuilt.unshift({ type: "text", text: output });
|
|
26069
26195
|
return { type: "content", value: rebuilt };
|
|
26070
26196
|
}
|
|
26071
|
-
function adaptPayload(draft, admittedIDs = new Set, messageTimes = new Map, hiddenTimes = false) {
|
|
26197
|
+
function adaptPayload(draft, admittedIDs = new Set, messageTimes = new Map, hiddenTimes = false, instructionRows = new Map) {
|
|
26072
26198
|
const existingHeads = new Map(draft.messages.filter((m) => HEAD_IDS.some((id) => m.id === id)).map((m) => [m.id, m]));
|
|
26073
26199
|
const source = draft.messages.filter((m) => !existingHeads.has(m.id));
|
|
26074
26200
|
const results = new Map;
|
|
@@ -26202,6 +26328,9 @@ function adaptPayload(draft, admittedIDs = new Set, messageTimes = new Map, hidd
|
|
|
26202
26328
|
});
|
|
26203
26329
|
}
|
|
26204
26330
|
originals.set(mapped, message);
|
|
26331
|
+
const instruction = instructionRows.get(nativeRowID(message) ?? "");
|
|
26332
|
+
if (message.role === "system" && instruction)
|
|
26333
|
+
markHostInstructionRow(mapped.info, instruction);
|
|
26205
26334
|
markServedShapeRepair(mapped.info, copiedTagOnly);
|
|
26206
26335
|
if (isCoveredInstructionRow(message))
|
|
26207
26336
|
markCoveredInstructionRow(mapped.info);
|
|
@@ -26351,30 +26480,6 @@ function adaptPayload(draft, admittedIDs = new Set, messageTimes = new Map, hidd
|
|
|
26351
26480
|
};
|
|
26352
26481
|
}
|
|
26353
26482
|
|
|
26354
|
-
// src/v2/fold/code-mode-catalog.ts
|
|
26355
|
-
var changed = "The Code Mode tool catalog has changed.";
|
|
26356
|
-
var replacement = `${changed} This catalog supersedes the previous Code Mode tool catalog.`;
|
|
26357
|
-
function codeModeCatalogKind(data) {
|
|
26358
|
-
const text = data.text ?? "";
|
|
26359
|
-
const metadata = data.metadata;
|
|
26360
|
-
const keyed = typeof metadata === "object" && metadata !== null && "instructionSources" in metadata;
|
|
26361
|
-
if (keyed) {
|
|
26362
|
-
const sources = metadata.instructionSources;
|
|
26363
|
-
if (!Array.isArray(sources) || !sources.includes("core/codemode"))
|
|
26364
|
-
return;
|
|
26365
|
-
if (sources.length !== 1)
|
|
26366
|
-
return text.startsWith(replacement) ? "combined-replacement" : undefined;
|
|
26367
|
-
}
|
|
26368
|
-
if (text.startsWith(replacement))
|
|
26369
|
-
return "replacement";
|
|
26370
|
-
if (text.startsWith(changed))
|
|
26371
|
-
return "incremental";
|
|
26372
|
-
if (keyed || text.startsWith(`# Code Mode
|
|
26373
|
-
`) || text.startsWith("No Code Mode tools are currently available."))
|
|
26374
|
-
return "initial";
|
|
26375
|
-
return;
|
|
26376
|
-
}
|
|
26377
|
-
|
|
26378
26483
|
// src/v2/fold/native-codec.ts
|
|
26379
26484
|
class NativeReplayUnavailable extends Error {
|
|
26380
26485
|
}
|
|
@@ -26763,14 +26868,12 @@ class NativeFoldReplay {
|
|
|
26763
26868
|
throw new NativeReplayUnavailable("Manual compaction has no history boundary");
|
|
26764
26869
|
const instructions = reader.instructionRowsThrough(sessionID, running.seq - 1);
|
|
26765
26870
|
const retiredInstructionIDs = [];
|
|
26766
|
-
|
|
26871
|
+
const superseded = supersededInstructionIDs(instructions);
|
|
26872
|
+
const liveRetired = retiredLiveInstructionIDs(this.storage.db, sessionID);
|
|
26767
26873
|
for (const instruction of [...instructions].reverse()) {
|
|
26768
26874
|
const text = instruction.data.text ?? "";
|
|
26769
|
-
|
|
26770
|
-
if (instruction.seq > floor.after && (catalog && catalog !== "combined-replacement" && newerFullCatalog || text.length > 0 && summary.includes(text)))
|
|
26875
|
+
if (instruction.seq > floor.after && (liveRetired.has(instruction.id) || superseded.has(instruction.id) || text.length > 0 && summary.includes(text)))
|
|
26771
26876
|
retiredInstructionIDs.push(instruction.id);
|
|
26772
|
-
if (catalog === "replacement" || catalog === "combined-replacement")
|
|
26773
|
-
newerFullCatalog = true;
|
|
26774
26877
|
}
|
|
26775
26878
|
return {
|
|
26776
26879
|
floor,
|
|
@@ -27486,11 +27589,20 @@ ${cached}
|
|
|
27486
27589
|
if (await this.admissions?.get(admissionKey(draft.sessionID)) && !await this.readV3(draft.sessionID))
|
|
27487
27590
|
return false;
|
|
27488
27591
|
const running = reader.latestRunningCompaction(draft.sessionID);
|
|
27489
|
-
|
|
27592
|
+
let replay = args.manual?.replay ?? await this.floorState(draft.sessionID, reader, undefined, undefined, true);
|
|
27490
27593
|
if (!running || !replay || replay.blocked) {
|
|
27491
27594
|
this.report(draft.sessionID, "fold refused: no usable host checkpoint boundary");
|
|
27492
27595
|
return false;
|
|
27493
27596
|
}
|
|
27597
|
+
const liveRetired = retiredLiveInstructionIDs(this.storage.db, draft.sessionID);
|
|
27598
|
+
const absentRetired = liveRetired.size === 0 ? [] : reader.instructionRowsThrough(draft.sessionID, reader.latestSequence(draft.sessionID)).filter((row) => liveRetired.has(row.id) && !draft.messages.some((message) => nativeRowID(message) === row.id || message.role === "system" && !nativeRowID(message) && message.content.map((part) => part.text ?? "").join("") === row.data.text)).map((row) => row.id);
|
|
27599
|
+
if (absentRetired.length > 0)
|
|
27600
|
+
replay = {
|
|
27601
|
+
...replay,
|
|
27602
|
+
retiredInstructionIDs: [
|
|
27603
|
+
...new Set([...replay.retiredInstructionIDs ?? [], ...absentRetired])
|
|
27604
|
+
]
|
|
27605
|
+
};
|
|
27494
27606
|
const model = `${draft.model.providerID}/${draft.model.id}`;
|
|
27495
27607
|
if (!args.manual && this.tail(draft.sessionID)?.model !== model)
|
|
27496
27608
|
this.storage.replaceRows(draft.sessionID, reader.latestSequence(draft.sessionID), []);
|
|
@@ -41015,7 +41127,7 @@ var encode = /* @__PURE__ */ _encode($ZodRealError);
|
|
|
41015
41127
|
var _decode = (_Err) => (schema, value, _ctx) => {
|
|
41016
41128
|
return _parse(_Err)(schema, value, _ctx);
|
|
41017
41129
|
};
|
|
41018
|
-
var
|
|
41130
|
+
var decode2 = /* @__PURE__ */ _decode($ZodRealError);
|
|
41019
41131
|
var _encodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
41020
41132
|
const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
|
|
41021
41133
|
return _parseAsync(_Err)(schema, value, ctx);
|
|
@@ -50780,7 +50892,7 @@ var parseAsync2 = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
|
50780
50892
|
var safeParse2 = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
50781
50893
|
var safeParseAsync2 = /* @__PURE__ */ _safeParseAsync(ZodRealError);
|
|
50782
50894
|
var encode2 = /* @__PURE__ */ _encode(ZodRealError);
|
|
50783
|
-
var
|
|
50895
|
+
var decode3 = /* @__PURE__ */ _decode(ZodRealError);
|
|
50784
50896
|
var encodeAsync2 = /* @__PURE__ */ _encodeAsync(ZodRealError);
|
|
50785
50897
|
var decodeAsync2 = /* @__PURE__ */ _decodeAsync(ZodRealError);
|
|
50786
50898
|
var safeEncode2 = /* @__PURE__ */ _safeEncode(ZodRealError);
|
|
@@ -50815,7 +50927,7 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
50815
50927
|
inst.safeParseAsync = async (data, params) => safeParseAsync2(inst, data, params);
|
|
50816
50928
|
inst.spa = inst.safeParseAsync;
|
|
50817
50929
|
inst.encode = (data, params) => encode2(inst, data, params);
|
|
50818
|
-
inst.decode = (data, params) =>
|
|
50930
|
+
inst.decode = (data, params) => decode3(inst, data, params);
|
|
50819
50931
|
inst.encodeAsync = async (data, params) => encodeAsync2(inst, data, params);
|
|
50820
50932
|
inst.decodeAsync = async (data, params) => decodeAsync2(inst, data, params);
|
|
50821
50933
|
inst.safeEncode = (data, params) => safeEncode2(inst, data, params);
|
|
@@ -54277,6 +54389,7 @@ function bindKeptInstructionCoordinates(messages, incoming, reader, sessionID) {
|
|
|
54277
54389
|
pending.push(message);
|
|
54278
54390
|
}
|
|
54279
54391
|
bind();
|
|
54392
|
+
return rows;
|
|
54280
54393
|
}
|
|
54281
54394
|
function controlSuffixKeys(messages, skip) {
|
|
54282
54395
|
const keys = new Map;
|
|
@@ -55318,10 +55431,18 @@ async function registerContext(context) {
|
|
|
55318
55431
|
});
|
|
55319
55432
|
const temporalTimes = config.temporal_awareness === true;
|
|
55320
55433
|
const anchorTimesOnly = !temporalTimes && !rustModeModuleClient;
|
|
55434
|
+
const foldedInstructionIDs = new Map;
|
|
55321
55435
|
const retireInstructionMessages = async (sessionID, reader, messages) => {
|
|
55322
55436
|
const retired = await nativeFoldReplay?.instructionRetirement(sessionID, reader);
|
|
55323
55437
|
if (!retired)
|
|
55324
55438
|
return messages;
|
|
55439
|
+
if (db) {
|
|
55440
|
+
foldedInstructionIDs.set(sessionID, new Set([...retiredLiveInstructionIDs(db, sessionID)].filter((id) => retired({
|
|
55441
|
+
type: "system",
|
|
55442
|
+
id,
|
|
55443
|
+
seq: reader.sequenceForId(sessionID, id) ?? Infinity
|
|
55444
|
+
}))));
|
|
55445
|
+
}
|
|
55325
55446
|
return messages.filter((message) => {
|
|
55326
55447
|
const id = nativeRowID(message);
|
|
55327
55448
|
return message.role !== "system" || !id || !retired({
|
|
@@ -55383,6 +55504,7 @@ async function registerContext(context) {
|
|
|
55383
55504
|
onPassPermission: (sessionID, permission) => {
|
|
55384
55505
|
checkpointPassPermissions.set(sessionID, permission);
|
|
55385
55506
|
},
|
|
55507
|
+
reclaimHostRows: (sessionID, messages, permitted) => reclaimInstructionRows(database, sessionID, messages, permitted, foldedInstructionIDs.get(sessionID)),
|
|
55386
55508
|
compactionOff,
|
|
55387
55509
|
storeGeneration: "v2",
|
|
55388
55510
|
normalizeRestoredAssistantText: (text, providerID) => stripCopiedTagNotation(text, providerID === "anthropic"),
|
|
@@ -55731,6 +55853,7 @@ async function registerContext(context) {
|
|
|
55731
55853
|
transform = initializeTransform(db);
|
|
55732
55854
|
const admitted = new Set;
|
|
55733
55855
|
let messageTimes;
|
|
55856
|
+
let instructionRows = new Map;
|
|
55734
55857
|
const reader = openStoreReader();
|
|
55735
55858
|
let checkpoint;
|
|
55736
55859
|
let submitted;
|
|
@@ -55825,6 +55948,7 @@ async function registerContext(context) {
|
|
|
55825
55948
|
boundaryRepair
|
|
55826
55949
|
}));
|
|
55827
55950
|
}
|
|
55951
|
+
instructionRows = new Map(bindKeptInstructionCoordinates(draft.messages, incoming || undefined, reader, draft.sessionID).map((row) => [row.id, row]));
|
|
55828
55952
|
draft.messages = await retireInstructionMessages(draft.sessionID, reader, draft.messages);
|
|
55829
55953
|
messageTimes = readTimes(reader, draft.messages);
|
|
55830
55954
|
} finally {
|
|
@@ -55843,7 +55967,7 @@ async function registerContext(context) {
|
|
|
55843
55967
|
nativeFoldReplay.invalidate(draft.sessionID, true);
|
|
55844
55968
|
}
|
|
55845
55969
|
}
|
|
55846
|
-
const mapped = adaptPayload(draft, admitted, messageTimes, anchorTimesOnly);
|
|
55970
|
+
const mapped = adaptPayload(draft, admitted, messageTimes, anchorTimesOnly, instructionRows);
|
|
55847
55971
|
bindSystemDateRequestIdentity(mapped, draft);
|
|
55848
55972
|
checkpointPassPermissions.delete(draft.sessionID);
|
|
55849
55973
|
checkpointInputEstimates.delete(draft.sessionID);
|
|
@@ -56018,6 +56142,7 @@ async function registerContext(context) {
|
|
|
56018
56142
|
nativeFoldReplay?.cancelEditedAdmission(draft.sessionID);
|
|
56019
56143
|
checkpointInputEstimates.delete(draft.sessionID);
|
|
56020
56144
|
checkpointPassPermissions.delete(draft.sessionID);
|
|
56145
|
+
foldedInstructionIDs.delete(draft.sessionID);
|
|
56021
56146
|
}
|
|
56022
56147
|
if (!compactionOff)
|
|
56023
56148
|
generateReplay.capture(draft, anchor);
|
|
@@ -1,3 +1,13 @@
|
|
|
1
1
|
import type { MessageData } from "../store-reader";
|
|
2
2
|
export declare function codeModeCatalogKind(data: MessageData): "initial" | "replacement" | "incremental" | "combined-replacement" | undefined;
|
|
3
|
+
/**
|
|
4
|
+
* Rows are atomic on the wire, but supersession belongs to each instruction
|
|
5
|
+
* source. A combined row can disappear only after every source it carries has
|
|
6
|
+
* been fully restated. Deltas never cover their predecessors; unknown sources
|
|
7
|
+
* and unrecognized renderings never authorize removal.
|
|
8
|
+
*/
|
|
9
|
+
export declare function supersededInstructionIDs(rows: readonly {
|
|
10
|
+
id: string;
|
|
11
|
+
data: MessageData;
|
|
12
|
+
}[]): Set<string>;
|
|
3
13
|
//# sourceMappingURL=code-mode-catalog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-mode-catalog.d.ts","sourceRoot":"","sources":["../../../src/v2/fold/code-mode-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"code-mode-catalog.d.ts","sourceRoot":"","sources":["../../../src/v2/fold/code-mode-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AASnD,wBAAgB,mBAAmB,CAC/B,IAAI,EAAE,WAAW,GAClB,SAAS,GAAG,aAAa,GAAG,aAAa,GAAG,sBAAsB,GAAG,SAAS,CAoBhF;AA4CD;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACpC,IAAI,EAAE,SAAS;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,WAAW,CAAA;CAAE,EAAE,GACnD,GAAG,CAAC,MAAM,CAAC,CA0Bb"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type HostRowReclaim } from "../../hooks/magic-context/host-served-rows";
|
|
2
|
+
import type { MessageLike } from "../../hooks/magic-context/tag-messages";
|
|
3
|
+
import type { Database } from "../../shared/sqlite";
|
|
4
|
+
import type { StoreRow } from "../store-reader";
|
|
5
|
+
export declare function retiredLiveInstructionIDs(db: Database, sessionID: string): Set<string>;
|
|
6
|
+
export type SupersessionRow = StoreRow;
|
|
7
|
+
/** Persisted instruction-retirement decisions use store identity, never instruction text. */
|
|
8
|
+
export declare function reclaimInstructionRows(db: Database, sessionID: string, messages: MessageLike[], permitted: boolean, folded?: ReadonlySet<string>): HostRowReclaim;
|
|
9
|
+
//# sourceMappingURL=instruction-supersession.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instruction-supersession.d.ts","sourceRoot":"","sources":["../../../src/v2/fold/instruction-supersession.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,cAAc,EAGtB,MAAM,4CAA4C,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAYhD,wBAAgB,yBAAyB,CAAC,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAEtF;AAED,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC;AAEvC,6FAA6F;AAC7F,wBAAgB,sBAAsB,CAClC,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,WAAW,EAAE,EACvB,SAAS,EAAE,OAAO,EAClB,MAAM,GAAE,WAAW,CAAC,MAAM,CAAa,GACxC,cAAc,CA6ChB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native-replay.d.ts","sourceRoot":"","sources":["../../../src/v2/fold/native-replay.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3E,OAAO,EAEH,KAAK,QAAQ,EAEb,KAAK,aAAa,EACrB,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"native-replay.d.ts","sourceRoot":"","sources":["../../../src/v2/fold/native-replay.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3E,OAAO,EAEH,KAAK,QAAQ,EAEb,KAAK,aAAa,EACrB,MAAM,iBAAiB,CAAC;AAIzB,OAAO,KAAK,EAAE,eAAe,EAAmB,MAAM,gBAAgB,CAAC;AAEvE,OAAO,EAcH,KAAK,aAAa,EAKrB,MAAM,oBAAoB,CAAC;AAuB5B,UAAU,UAAU;IAChB,KAAK,EAAE,cAAc,CAAC;IACtB,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC,CAAC;IACr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AAC5E,wBAAgB,yBAAyB,CACrC,KAAK,EAAE,cAAc,EACrB,OAAO,EAAE,oBAAoB,EAC7B,MAAM,EAAE,mBAAmB,GAAG,SAAS,EACvC,iBAAiB,UAAO,GACzB,IAAI,CAsBN;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,CAqBnE;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,mBAAmB,CACrC,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO,6BAA6B,CAAC,EAAE,SAAS,CAAC,EAC/E,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE,WAAW,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,GAAG,OAAO,CAAC,GACrF,OAAO,CAAC,IAAI,CAAC,CAwCf;AAyBD,wBAAsB,eAAe,CAAC,OAAO,EAAE,SAAS;;eAmlFvD"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { MessageLike } from "../../hooks/magic-context/tag-messages";
|
|
2
|
+
import type { SupersessionRow } from "../fold/instruction-supersession";
|
|
2
3
|
import type { SessionContext } from "./types";
|
|
3
4
|
export declare const HEAD_IDS: readonly ["__magic_context_v2_m0__", "__magic_context_v2_m1__"];
|
|
4
5
|
/** Deep copy that keeps class instances by reference, so a pipeline edit to the copy cannot
|
|
@@ -23,7 +24,7 @@ export declare function adaptPayload(draft: SessionContext, admittedIDs?: Readon
|
|
|
23
24
|
* copy's anchor search, but left out of the content digests and of every
|
|
24
25
|
* copy of the message, as if the message carried no time.
|
|
25
26
|
*/
|
|
26
|
-
hiddenTimes?: boolean): {
|
|
27
|
+
hiddenTimes?: boolean, instructionRows?: ReadonlyMap<string, SupersessionRow>): {
|
|
27
28
|
messages: MessageLike[];
|
|
28
29
|
commit(): void;
|
|
29
30
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../src/v2/hooks/payload.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../src/v2/hooks/payload.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAG1E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAIxE,OAAO,KAAK,EAAE,cAAc,EAAa,MAAM,SAAS,CAAC;AAEzD,eAAO,MAAM,QAAQ,iEAAkE,CAAC;AAiGxF;iFACiF;AACjF,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAEvD;AAED;;;;0EAI0E;AAC1E,wBAAgB,gCAAgC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG;IAAE,IAAI,EAAE,CAAC,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAIxF;AAmID;;;GAGG;AACH,wBAAgB,YAAY,CACxB,KAAK,EAAE,cAAc,EACrB,WAAW,GAAE,WAAW,CAAC,MAAM,CAAa,EAC5C,YAAY,GAAE,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAa;AAC1E;;;;GAIG;AACH,WAAW,UAAQ,EACnB,eAAe,GAAE,WAAW,CAAC,MAAM,EAAE,eAAe,CAAa;;;EAwYpE"}
|
|
@@ -17,7 +17,7 @@ import"./server-1d042x6w.js";
|
|
|
17
17
|
import"./server-tnzbk64q.js";
|
|
18
18
|
import"./server-2ra6pwf3.js";
|
|
19
19
|
import"./server-mfn1yf9d.js";
|
|
20
|
-
import"./server-
|
|
20
|
+
import"./server-kqrpt2ht.js";
|
|
21
21
|
import"./server-xy7w7hrd.js";
|
|
22
22
|
import {
|
|
23
23
|
MESSAGE_INDEX_MAX_FTS_BYTES,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
markMessageIndexDirty,
|
|
27
27
|
getIndexableContent,
|
|
28
28
|
indexSingleMessage
|
|
29
|
-
} from "./server-
|
|
29
|
+
} from "./server-3m7p4g9w.js";
|
|
30
30
|
import"./server-nmyganc8.js";
|
|
31
31
|
import"./server-qmmkhz2z.js";
|
|
32
32
|
|
|
@@ -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-ag6sk771.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-wajxd01m.js");
|
|
55
55
|
const { readRawSessionMessageIdOrdinalsForRangeFromDb } = await import("./read-session-raw-qpp6x9kg.js");
|
|
56
56
|
const archive = input.searchArchive;
|
|
57
57
|
let raw;
|
|
@@ -81,7 +81,7 @@ serveWorkerJobs(async (input, port) => {
|
|
|
81
81
|
const { setHarness } = await import("./harness-e4avh192.js");
|
|
82
82
|
setHarness(input.harness ?? "opencode");
|
|
83
83
|
const [{ indexMessageInShortChunks }, { configureContextDatabasePragmas }] = await Promise.all([
|
|
84
|
-
import("./message-index-bounded-
|
|
84
|
+
import("./message-index-bounded-5341qsqd.js"),
|
|
85
85
|
import("./sqlite-context-pragmas-mv9jqwjh.js")
|
|
86
86
|
]);
|
|
87
87
|
configureContextDatabasePragmas(db);
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
readSessionChunk2,
|
|
39
39
|
getRawSessionMessageIdsThrough2,
|
|
40
40
|
readRawSessionSeedTail2
|
|
41
|
-
} from "./server-
|
|
41
|
+
} from "./server-kqrpt2ht.js";
|
|
42
42
|
import"./server-xfjjbrkt.js";
|
|
43
43
|
import"./server-1zx87sdm.js";
|
|
44
44
|
import"./server-mfn1yf9d.js";
|
|
@@ -7,22 +7,22 @@ import {
|
|
|
7
7
|
setRecompTerminal2,
|
|
8
8
|
buildRecompDeps2,
|
|
9
9
|
runManagedRecomp2
|
|
10
|
-
} from "./server-
|
|
10
|
+
} from "./server-5ydn39x3.js";
|
|
11
11
|
import"./server-dwpgzm0t.js";
|
|
12
12
|
import"./server-nq3cb7be.js";
|
|
13
13
|
import"./server-gkse1wyz.js";
|
|
14
14
|
import"./server-jjvbk92s.js";
|
|
15
15
|
import"./server-7acq7815.js";
|
|
16
16
|
import"./server-4dhv7mqz.js";
|
|
17
|
-
import"./server-
|
|
17
|
+
import"./server-7qc9tk6z.js";
|
|
18
18
|
import"./server-ypf1ap0v.js";
|
|
19
|
-
import"./server-
|
|
19
|
+
import"./server-3m7p4g9w.js";
|
|
20
20
|
import"./server-2amn2s73.js";
|
|
21
21
|
import"./server-ef1mskas.js";
|
|
22
22
|
import"./server-sd8hvzte.js";
|
|
23
23
|
import"./server-bez34e60.js";
|
|
24
24
|
import"./server-qt1qqasc.js";
|
|
25
|
-
import"./server-
|
|
25
|
+
import"./server-kqrpt2ht.js";
|
|
26
26
|
import"./server-xfjjbrkt.js";
|
|
27
27
|
import"./server-1zx87sdm.js";
|
|
28
28
|
import"./server-mfn1yf9d.js";
|
|
@@ -35,7 +35,7 @@ import"./server-7zacmty5.js";
|
|
|
35
35
|
import"./server-dcws5831.js";
|
|
36
36
|
import"./server-cp1a03vc.js";
|
|
37
37
|
import"./server-zzgtgqmd.js";
|
|
38
|
-
import"./server-
|
|
38
|
+
import"./server-09td1wgc.js";
|
|
39
39
|
import"./server-fb3zxn06.js";
|
|
40
40
|
import"./server-3schkz95.js";
|
|
41
41
|
import"./server-fr0wbhdn.js";
|