@cortexkit/opencode-magic-context 0.49.65 → 0.49.67
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-3mfsdp1v.js → context-1acz1d4x.js} +18 -15
- package/dist/features/magic-context/compartment-storage.d.ts +7 -0
- package/dist/features/magic-context/compartment-storage.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-session.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-shared.d.ts +5 -1
- package/dist/features/magic-context/storage-meta-shared.d.ts.map +1 -1
- package/dist/features/magic-context/types.d.ts +2 -0
- package/dist/features/magic-context/types.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook.d.ts +3 -0
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/inject-compartments.d.ts +24 -1
- package/dist/hooks/magic-context/inject-compartments.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/hooks/magic-context/unmanaged-over-window.d.ts +4 -0
- package/dist/hooks/magic-context/unmanaged-over-window.d.ts.map +1 -1
- package/dist/{index-stqmv1mt.js → index-2t9e10mt.js} +72 -21
- package/dist/{index-7dj3s7qq.js → index-2x46rnct.js} +1 -1
- package/dist/{index-71h616be.js → index-3v5mfapn.js} +1 -1
- package/dist/{index-wz0t5e5s.js → index-8a1m48va.js} +3 -3
- package/dist/{index-gwb2wpz7.js → index-fybdhbd4.js} +2 -2
- package/dist/{index-qn27gh4e.js → index-g53qhdrb.js} +1 -1
- package/dist/{index-san8daqa.js → index-gy33sq5h.js} +6 -6
- package/dist/{index-x2hwwzk1.js → index-m47yte97.js} +64 -32
- package/dist/{index-c0k54yhd.js → index-m6cv2hv3.js} +3 -3
- package/dist/{index-g59gpt1j.js → index-nfvyraa3.js} +3 -3
- package/dist/{index-ezr8mr1c.js → index-ngrrs3yb.js} +13 -4
- package/dist/{index-6kgsfb81.js → index-q73yeb83.js} +1 -1
- package/dist/{index-kvfrse61.js → index-t20q6aj6.js} +12 -1
- package/dist/{index-0ab398z2.js → index-xmk2a6pq.js} +2 -2
- package/dist/{index-8596jbnw.js → index-z10dryn5.js} +5 -5
- package/dist/index.js +18 -18
- package/dist/{message-index-bounded-zs7ah2te.js → message-index-bounded-f27039js.js} +3 -3
- package/dist/migration-worker.js +1 -1
- package/dist/plugin/hooks/create-session-hooks.d.ts +6 -0
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/raw-ordinal-warmup-worker.js +4 -4
- package/dist/{read-session-chunk-jf2f8jz8.js → read-session-chunk-4ma2vsva.js} +2 -2
- package/dist/{recomp-orchestrator-nyj8ca0y.js → recomp-orchestrator-p9c4jg9m.js} +7 -7
- package/dist/{render-n46wpv2n.js → render-h16ea0th.js} +6 -6
- package/dist/{search-archive-9k6vsp44.js → search-archive-km2ahm3e.js} +4 -4
- package/dist/{search-s386bwwh.js → search-m9rpnh7m.js} +5 -5
- package/dist/{storage-tags-2r952wqy.js → storage-tags-ktp70q1e.js} +1 -1
- package/dist/{transform-postprocess-phase-8yjcca9t.js → transform-postprocess-phase-120s1ep8.js} +8 -8
- package/dist/v2/auto-search-worker.js +1 -1
- package/dist/v2/chunk-embedding-write-worker.js +1 -1
- package/dist/v2/{context-34sr5ner.js → context-p0z7mrsf.js} +71 -18
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/{message-index-bounded-axbs1s97.js → message-index-bounded-td516y9c.js} +3 -3
- package/dist/v2/migration-worker.js +1 -1
- package/dist/v2/raw-ordinal-warmup-worker.js +4 -4
- package/dist/v2/{read-session-chunk-41cm522x.js → read-session-chunk-6dz32wmh.js} +2 -2
- package/dist/v2/{recomp-orchestrator-r4gqhhaw.js → recomp-orchestrator-ayy7xzm3.js} +6 -6
- package/dist/v2/{render-7v7yx9xb.js → render-gqp4fwqn.js} +6 -6
- package/dist/v2/{search-archive-1yc8bh6y.js → search-archive-qn82j8k0.js} +4 -4
- package/dist/v2/{search-mabwkzw2.js → search-dhekqtfc.js} +4 -4
- package/dist/v2/{server-yxw43z2w.js → server-166m5nrw.js} +13 -4
- package/dist/v2/{server-bh9yzxpz.js → server-34vhmd1d.js} +2 -2
- package/dist/v2/{server-k97r77x3.js → server-77207nf4.js} +2 -2
- package/dist/v2/{server-hcgqsdrh.js → server-jew1m85s.js} +1 -1
- package/dist/v2/{server-9rwm2z2h.js → server-n6hdj0fn.js} +64 -32
- package/dist/v2/{server-8w9b5exq.js → server-q8ta10e5.js} +1 -1
- package/dist/v2/{server-cdddk5d1.js → server-s1a0bwpc.js} +1 -1
- package/dist/v2/{server-anh8gf0w.js → server-s66wvkpf.js} +2 -2
- package/dist/v2/{server-hb5zm7yh.js → server-verzg5w8.js} +12 -1
- package/dist/v2/{server-bnka2vf2.js → server-xwcg55a8.js} +3 -3
- package/dist/v2/server.js +2 -2
- package/dist/v2/{storage-tags-9zs0gc7w.js → storage-tags-qe8r1n9w.js} +1 -1
- package/dist/v2/{v2-archive-reader-pgk140pb.js → v2-archive-reader-tbjwxvc5.js} +1 -1
- package/dist/v2/{wrapup-orchestrator-p0ysz3s9.js → wrapup-orchestrator-ksdzyfby.js} +6 -6
- package/dist/{v2-archive-reader-cv6veqnz.js → v2-archive-reader-j16k987e.js} +1 -1
- package/dist/{wrapup-orchestrator-dxda1svq.js → wrapup-orchestrator-w09bkgmk.js} +8 -8
- package/package.json +1 -1
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
getRawSessionTagKeysThrough2,
|
|
36
36
|
getLegacyProtectedTailStartOrdinal2,
|
|
37
37
|
readSessionChunk2
|
|
38
|
-
} from "./index-
|
|
38
|
+
} from "./index-q73yeb83.js";
|
|
39
39
|
import {
|
|
40
40
|
getHarness2,
|
|
41
41
|
harnessOwnsOpenCodeStore2
|
|
@@ -113,7 +113,7 @@ import {
|
|
|
113
113
|
LATEST_SUPPORTED_VERSION,
|
|
114
114
|
getPersistedSchemaVersion,
|
|
115
115
|
openDatabase
|
|
116
|
-
} from "./index-
|
|
116
|
+
} from "./index-g53qhdrb.js";
|
|
117
117
|
import {
|
|
118
118
|
areRustHistorianSyntheticParts2,
|
|
119
119
|
isStrictGapHealingMessage2,
|
|
@@ -170,6 +170,7 @@ import {
|
|
|
170
170
|
queueM0Mutation,
|
|
171
171
|
getMaxM0MutationId,
|
|
172
172
|
getCompartments,
|
|
173
|
+
getNewestCompartmentIds,
|
|
173
174
|
getLastCompartmentEndMessage,
|
|
174
175
|
getLastCompartmentEndMessageId,
|
|
175
176
|
getCompartmentsByEndMessageId,
|
|
@@ -200,20 +201,21 @@ import {
|
|
|
200
201
|
getProjectState,
|
|
201
202
|
recordSubagentInvocation,
|
|
202
203
|
getLatestHistorianInvocationId
|
|
203
|
-
} from "./index-
|
|
204
|
+
} from "./index-ngrrs3yb.js";
|
|
204
205
|
import {
|
|
205
206
|
clearCompressionDepth,
|
|
206
207
|
clearCompressionDepthRange,
|
|
207
208
|
toMessageIndexSource,
|
|
208
209
|
clearIndexedMessagesInTransaction,
|
|
209
210
|
indexSourcesAfterOrdinal
|
|
210
|
-
} from "./index-
|
|
211
|
+
} from "./index-2x46rnct.js";
|
|
211
212
|
import {
|
|
212
213
|
stripWellFormedLeadingTagPrefix,
|
|
213
214
|
peelLeadingMcTagNotation,
|
|
214
215
|
isRecord,
|
|
215
216
|
escalationBands,
|
|
216
217
|
sessionDecisionCalibration,
|
|
218
|
+
CACHED_TRIM_PARTIAL_SQL,
|
|
217
219
|
ensureSessionMetaRow,
|
|
218
220
|
persistCachedM0,
|
|
219
221
|
clearCachedM0M1,
|
|
@@ -256,7 +258,7 @@ import {
|
|
|
256
258
|
foldShrunkPartTags2,
|
|
257
259
|
getTagNumberByMessageId2,
|
|
258
260
|
getActiveTagsBySession2
|
|
259
|
-
} from "./index-
|
|
261
|
+
} from "./index-t20q6aj6.js";
|
|
260
262
|
import {
|
|
261
263
|
openCodeDbExists,
|
|
262
264
|
withReadOnlySessionDb,
|
|
@@ -10354,13 +10356,13 @@ function cutCoveredPrefix(messages, count, coveredInstructions) {
|
|
|
10354
10356
|
coveredInstructions.push(message);
|
|
10355
10357
|
}
|
|
10356
10358
|
}
|
|
10357
|
-
function prepareCompartmentInjection(db, sessionId, messages, isCacheBusting, coveredInstructions, projectPath, injectionBudgetTokens, temporalAwareness) {
|
|
10359
|
+
function prepareCompartmentInjection(db, sessionId, messages, isCacheBusting, coveredInstructions, projectPath, injectionBudgetTokens, temporalAwareness, frozenBaseline) {
|
|
10358
10360
|
const cached = injectionCache.get(sessionId);
|
|
10359
10361
|
if (cached && cached.db !== db) {
|
|
10360
10362
|
clearInjectionCache(sessionId);
|
|
10361
10363
|
}
|
|
10362
10364
|
const usableCached = cached?.db === db ? cached : undefined;
|
|
10363
|
-
if (!isCacheBusting && usableCached) {
|
|
10365
|
+
if (!isCacheBusting && usableCached && (!frozenBaseline?.hasCachedM0 || (usableCached.kind === "empty" ? frozenBaseline.boundary === null : usableCached.injection.compartmentEndMessageId === (frozenBaseline.boundary ?? "")))) {
|
|
10364
10366
|
if (usableCached.kind === "empty") {
|
|
10365
10367
|
return null;
|
|
10366
10368
|
}
|
|
@@ -10371,7 +10373,7 @@ function prepareCompartmentInjection(db, sessionId, messages, isCacheBusting, co
|
|
|
10371
10373
|
if (prepared.compartmentEndMessageId.length > 0) {
|
|
10372
10374
|
const cutoffIndex = findBoundaryIndex(sessionId, messages, prepared.compartmentEndMessageId);
|
|
10373
10375
|
if (cutoffIndex >= 0) {
|
|
10374
|
-
cutCoveredPrefix(messages, cutoffIndex + (
|
|
10376
|
+
cutCoveredPrefix(messages, cutoffIndex + ((frozenBaseline?.hasCachedM0 ? frozenBaseline.partial : prepared.compartmentEndMessagePartial) ? 0 : 1), coveredInstructions);
|
|
10375
10377
|
} else {
|
|
10376
10378
|
sessionLog2(sessionId, `compartment injection: cached boundary ${prepared.compartmentEndMessageId} not in messages (already trimmed), reusing cache`);
|
|
10377
10379
|
}
|
|
@@ -10457,11 +10459,13 @@ function prepareCompartmentInjection(db, sessionId, messages, isCacheBusting, co
|
|
|
10457
10459
|
const lastEnd = lastCompartment.endMessage;
|
|
10458
10460
|
const lastEndMessageId = newestCompartmentEndId(compartments) ?? "";
|
|
10459
10461
|
let trimEndMessageId = lastEndMessageId;
|
|
10460
|
-
const baseline = readCachedBaselineState(db, sessionId);
|
|
10462
|
+
const baseline = frozenBaseline ?? readCachedBaselineState(db, sessionId);
|
|
10463
|
+
let trimEndMessagePartial = compartments.some((row) => row.endMessageId === lastEndMessageId && row.endBlockIndex != null);
|
|
10461
10464
|
if (!isCacheBusting || baseline.hasCachedM0) {
|
|
10462
10465
|
if (baseline.hasCachedM0) {
|
|
10463
10466
|
if (baseline.boundary) {
|
|
10464
10467
|
trimEndMessageId = baseline.boundary;
|
|
10468
|
+
trimEndMessagePartial = baseline.partial;
|
|
10465
10469
|
} else {
|
|
10466
10470
|
trimEndMessageId = "";
|
|
10467
10471
|
}
|
|
@@ -10489,12 +10493,14 @@ function prepareCompartmentInjection(db, sessionId, messages, isCacheBusting, co
|
|
|
10489
10493
|
let needsFreshMaterialization = false;
|
|
10490
10494
|
let resultEndMessage = lastEnd;
|
|
10491
10495
|
let resultEndMessageId = null;
|
|
10496
|
+
let resultEndMessagePartial = false;
|
|
10492
10497
|
const cutoffIndex = findBoundaryIndex(sessionId, messages, trimEndMessageId);
|
|
10493
10498
|
if (cutoffIndex >= 0) {
|
|
10494
10499
|
clearDegradedRebuild(sessionId);
|
|
10495
|
-
skippedVisibleMessages = cutoffIndex + (
|
|
10500
|
+
skippedVisibleMessages = cutoffIndex + (trimEndMessagePartial ? 0 : 1);
|
|
10496
10501
|
cutCoveredPrefix(messages, skippedVisibleMessages, coveredInstructions);
|
|
10497
10502
|
resultEndMessageId = trimEndMessageId;
|
|
10503
|
+
resultEndMessagePartial = trimEndMessagePartial;
|
|
10498
10504
|
} else {
|
|
10499
10505
|
const degradedCount = noteDegradedRebuild(sessionId);
|
|
10500
10506
|
if (isCacheBusting) {
|
|
@@ -10512,7 +10518,8 @@ function prepareCompartmentInjection(db, sessionId, messages, isCacheBusting, co
|
|
|
10512
10518
|
const reAnchorCompartment = compartments[reAnchorIndex];
|
|
10513
10519
|
const reAnchorCutoff = findBoundaryIndex(sessionId, messages, reAnchorCompartment.endMessageId);
|
|
10514
10520
|
if (reAnchorCutoff >= 0) {
|
|
10515
|
-
|
|
10521
|
+
resultEndMessagePartial = compartments.some((row) => row.endMessageId === reAnchorCompartment.endMessageId && row.endBlockIndex != null);
|
|
10522
|
+
skippedVisibleMessages = reAnchorCutoff + (resultEndMessagePartial ? 0 : 1);
|
|
10516
10523
|
cutCoveredPrefix(messages, skippedVisibleMessages, coveredInstructions);
|
|
10517
10524
|
resultEndMessage = reAnchorCompartment.endMessage;
|
|
10518
10525
|
resultEndMessageId = reAnchorCompartment.endMessageId;
|
|
@@ -10532,6 +10539,7 @@ function prepareCompartmentInjection(db, sessionId, messages, isCacheBusting, co
|
|
|
10532
10539
|
block,
|
|
10533
10540
|
compartmentEndMessage: resultEndMessage,
|
|
10534
10541
|
compartmentEndMessageId: resultEndMessageId,
|
|
10542
|
+
compartmentEndMessagePartial: resultEndMessagePartial,
|
|
10535
10543
|
compartmentCount: compartments.length,
|
|
10536
10544
|
skippedVisibleMessages,
|
|
10537
10545
|
factCount: facts.length,
|
|
@@ -10545,11 +10553,13 @@ function prepareCompartmentInjection(db, sessionId, messages, isCacheBusting, co
|
|
|
10545
10553
|
return result;
|
|
10546
10554
|
}
|
|
10547
10555
|
function readCachedBaselineState(db, sessionId) {
|
|
10548
|
-
const row = db.prepare(
|
|
10556
|
+
const row = db.prepare(`SELECT cached_m0_bytes AS m0, cached_m0_last_baseline_end_message_id AS boundary,
|
|
10557
|
+
${CACHED_TRIM_PARTIAL_SQL} AS partial FROM session_meta WHERE session_id = ?`).get(sessionId);
|
|
10549
10558
|
const boundary = row?.boundary;
|
|
10550
10559
|
return {
|
|
10551
10560
|
hasCachedM0: row?.m0 != null,
|
|
10552
|
-
boundary: boundary && boundary.length > 0 ? boundary : null
|
|
10561
|
+
boundary: boundary && boundary.length > 0 ? boundary : null,
|
|
10562
|
+
partial: row?.partial === 1
|
|
10553
10563
|
};
|
|
10554
10564
|
}
|
|
10555
10565
|
function renderCompartmentInjection(sessionId, messages, prepared) {
|
|
@@ -11532,6 +11542,7 @@ function materializeM0(options) {
|
|
|
11532
11542
|
const steps = new WriteTransactionSteps;
|
|
11533
11543
|
const upgradeIdentity = withCachedM0ToolDefinitionsHash(withCachedM0MemoryIds(encodeCachedM0UpgradeIdentity(snapshotMarkers.upgradeState, snapshotMarkers.compartmentRenderEpoch, snapshotMarkers.muralEnabled, snapshotMarkers.renderBudgetIdentity, snapshotMarkers.memoryRenderEpoch, snapshotMarkers.renderedBudgets ?? null), renderedMemoryIds), snapshotMarkers.toolDefinitionsHash ?? null);
|
|
11534
11544
|
const baselineEndMessageId = lastCompartmentBoundaryId(compartments);
|
|
11545
|
+
const baselineEndPartial = compartments.some((row) => row.endMessageId === baselineEndMessageId && row.endBlockIndex != null);
|
|
11535
11546
|
steps.mark("pre_metadata");
|
|
11536
11547
|
const commitFold = options.onFoldPrepare?.();
|
|
11537
11548
|
steps.mark("pre_onFoldPrepare");
|
|
@@ -11622,6 +11633,8 @@ function materializeM0(options) {
|
|
|
11622
11633
|
logSlowWriteTransaction("opencode_materialize_cache", transactionStartedAt, undefined, performance.now(), steps.durations);
|
|
11623
11634
|
options.state.cachedM0MuralDataUrl = frozenMuralDataUrl;
|
|
11624
11635
|
options.state.cachedM0MuralHash = frozenMuralHash;
|
|
11636
|
+
options.state.cachedM0TrimBoundaryId = baselineEndMessageId;
|
|
11637
|
+
options.state.cachedM0TrimBoundaryPartial = baselineEndPartial;
|
|
11625
11638
|
} catch (error) {
|
|
11626
11639
|
try {
|
|
11627
11640
|
options.db.exec("ROLLBACK");
|
|
@@ -11806,7 +11819,7 @@ function hydrateCachedM0Mural(db, sessionId, state) {
|
|
|
11806
11819
|
state.cachedM0MuralHash = row.cached_m0_mural_hash ?? null;
|
|
11807
11820
|
}
|
|
11808
11821
|
}
|
|
11809
|
-
function readCachedM0M1Row(db, sessionId) {
|
|
11822
|
+
function readCachedM0M1Row(db, sessionId, includePartialBoundary = false) {
|
|
11810
11823
|
return db.prepare(`SELECT cached_m0_bytes, cached_m0_mural_data_url,
|
|
11811
11824
|
cached_m0_mural_hash, cached_m1_bytes,
|
|
11812
11825
|
cached_m0_project_memory_epoch,
|
|
@@ -11825,7 +11838,7 @@ function readCachedM0M1Row(db, sessionId) {
|
|
|
11825
11838
|
cached_m0_model_key,
|
|
11826
11839
|
cached_m0_project_identity,
|
|
11827
11840
|
cached_m0_last_baseline_end_message_id,
|
|
11828
|
-
|
|
11841
|
+
memory_block_ids${includePartialBoundary ? `, ${CACHED_TRIM_PARTIAL_SQL} AS cached_trim_partial` : ""}
|
|
11829
11842
|
FROM session_meta
|
|
11830
11843
|
WHERE session_id = ?`).get(sessionId);
|
|
11831
11844
|
}
|
|
@@ -11884,6 +11897,8 @@ function applyCachedRowToState(state, row) {
|
|
|
11884
11897
|
state.cachedM0MuralDataUrl = row.cached_m0_mural_data_url ?? null;
|
|
11885
11898
|
state.cachedM0MuralHash = row.cached_m0_mural_hash ?? null;
|
|
11886
11899
|
state.cachedM1Bytes = toBuffer(row.cached_m1_bytes);
|
|
11900
|
+
state.cachedM0TrimBoundaryId = row.cached_m0_last_baseline_end_message_id || null;
|
|
11901
|
+
state.cachedM0TrimBoundaryPartial = row.cached_trim_partial === 1;
|
|
11887
11902
|
state.cachedM0ProjectMemoryEpoch = markers.projectMemoryEpoch;
|
|
11888
11903
|
state.cachedM0WorkspaceFingerprint = markers.workspaceFingerprint;
|
|
11889
11904
|
state.cachedM0ProjectUserProfileVersion = markers.projectUserProfileVersion;
|
|
@@ -11917,7 +11932,7 @@ function softRefreshCachedM1(options) {
|
|
|
11917
11932
|
const row = readCachedM0M1Row(options.db, options.sessionId);
|
|
11918
11933
|
if (!row || !cachedRowMatchesState(row, options.state)) {
|
|
11919
11934
|
options.db.exec("ROLLBACK");
|
|
11920
|
-
const sibling = readCachedM0M1Row(options.db, options.sessionId);
|
|
11935
|
+
const sibling = readCachedM0M1Row(options.db, options.sessionId, true);
|
|
11921
11936
|
if (!sibling)
|
|
11922
11937
|
throw new RenderM1InvalidMarkersError(options.sessionId);
|
|
11923
11938
|
applyCachedRowToState(options.state, sibling);
|
|
@@ -11937,6 +11952,7 @@ function softRefreshCachedM1(options) {
|
|
|
11937
11952
|
const m1Bytes = Buffer2.from(rendered.text, "utf8");
|
|
11938
11953
|
const visibleIdsJson = JSON.stringify(visibleMemoryIds);
|
|
11939
11954
|
const baselineEndMessageId = getLastCompartmentEndMessageId(options.db, options.sessionId);
|
|
11955
|
+
const baselineEndPartial = baselineEndMessageId != null && isPartialCompartmentEnd(options.db, options.sessionId, baselineEndMessageId);
|
|
11940
11956
|
steps.mark("m1Render");
|
|
11941
11957
|
options.db.prepare(`UPDATE session_meta
|
|
11942
11958
|
SET cached_m1_bytes = ?,
|
|
@@ -11950,6 +11966,8 @@ function softRefreshCachedM1(options) {
|
|
|
11950
11966
|
steps.mark("commit");
|
|
11951
11967
|
logSlowWriteTransaction("opencode_soft_refresh_cache", transactionStartedAt, undefined, performance.now(), steps.durations);
|
|
11952
11968
|
options.state.cachedM1Bytes = m1Bytes;
|
|
11969
|
+
options.state.cachedM0TrimBoundaryId = baselineEndMessageId;
|
|
11970
|
+
options.state.cachedM0TrimBoundaryPartial = baselineEndPartial;
|
|
11953
11971
|
options.state.cachedM0UpgradeState = withCachedM0MemoryIds(row.cached_m0_upgrade_state, renderedM0Ids);
|
|
11954
11972
|
options.state.snapshotMarkers = markers;
|
|
11955
11973
|
return rendered;
|
|
@@ -12259,13 +12277,14 @@ function trimToPreparedPrefix(options, prepared) {
|
|
|
12259
12277
|
const boundary = prepared.preparedTrimBoundaryId;
|
|
12260
12278
|
let outcome = { status: "not-required" };
|
|
12261
12279
|
if (boundary) {
|
|
12280
|
+
const preserveBoundary = prepared.preparedTrimBoundaryPartial ?? isPartialCompartmentEnd(options.db, options.sessionId, boundary);
|
|
12262
12281
|
const retireDecisions = (messageIds) => {
|
|
12263
12282
|
queueAutoSearchHintDecisionRetirement(options.db, options.sessionId, new Set(messageIds));
|
|
12264
12283
|
};
|
|
12265
12284
|
const trimAtVisibleBoundary = (reanchor) => {
|
|
12266
12285
|
const index = findBoundaryIndex(options.sessionId, messages, boundary);
|
|
12267
12286
|
if (index >= 0) {
|
|
12268
|
-
const cut = index + (
|
|
12287
|
+
const cut = index + (preserveBoundary ? 0 : 1);
|
|
12269
12288
|
const unplaced = messages.slice(0, cut).filter(isHostRenderedSystemMessage);
|
|
12270
12289
|
const removed = messages.splice(0, cut, ...unplaced);
|
|
12271
12290
|
retireDecisions(removed.map((message) => message.info.id).filter((id) => typeof id === "string"));
|
|
@@ -12353,7 +12372,7 @@ function trimToPreparedPrefix(options, prepared) {
|
|
|
12353
12372
|
}
|
|
12354
12373
|
lastSourcePosition = position;
|
|
12355
12374
|
placeUnplaced(position <= boundaryPosition);
|
|
12356
|
-
if (position > boundaryPosition || position === boundaryPosition &&
|
|
12375
|
+
if (position > boundaryPosition || position === boundaryPosition && preserveBoundary)
|
|
12357
12376
|
retained.push(message);
|
|
12358
12377
|
}
|
|
12359
12378
|
placeUnplaced(false);
|
|
@@ -12364,7 +12383,6 @@ function trimToPreparedPrefix(options, prepared) {
|
|
|
12364
12383
|
logBoundaryPrecedesWindow(options, boundary, firstLiveId);
|
|
12365
12384
|
}
|
|
12366
12385
|
options.messages.splice(0, options.messages.length, ...retained);
|
|
12367
|
-
const preserveBoundary = isPartialCompartmentEnd(options.db, options.sessionId, boundary);
|
|
12368
12386
|
retireDecisions(sourceOrder.messageIds.slice(0, boundaryPosition + (preserveBoundary ? 0 : 1)));
|
|
12369
12387
|
outcome = { status: "applied" };
|
|
12370
12388
|
}
|
|
@@ -12379,7 +12397,7 @@ function trimToPreparedPrefix(options, prepared) {
|
|
|
12379
12397
|
return outcome;
|
|
12380
12398
|
}
|
|
12381
12399
|
function prepareCachedM0M1Replay(db, sessionId) {
|
|
12382
|
-
const row = readCachedM0M1Row(db, sessionId);
|
|
12400
|
+
const row = readCachedM0M1Row(db, sessionId, true);
|
|
12383
12401
|
if (!row?.cached_m0_bytes || !row.cached_m1_bytes)
|
|
12384
12402
|
return;
|
|
12385
12403
|
const m0Bytes = toBuffer(row.cached_m0_bytes);
|
|
@@ -12397,7 +12415,8 @@ function prepareCachedM0M1Replay(db, sessionId) {
|
|
|
12397
12415
|
m0Bytes,
|
|
12398
12416
|
m1Text,
|
|
12399
12417
|
preparedMessages,
|
|
12400
|
-
preparedTrimBoundaryId: row.cached_m0_last_baseline_end_message_id
|
|
12418
|
+
preparedTrimBoundaryId: row.cached_m0_last_baseline_end_message_id,
|
|
12419
|
+
preparedTrimBoundaryPartial: row.cached_trim_partial === 1
|
|
12401
12420
|
};
|
|
12402
12421
|
}
|
|
12403
12422
|
function headMessagesForSizing(options, folds = false) {
|
|
@@ -12460,7 +12479,6 @@ function injectM0M1(options) {
|
|
|
12460
12479
|
if (options.state.isSubagent && !options.compactionOff)
|
|
12461
12480
|
return skipped;
|
|
12462
12481
|
const completePairAtEntry = options.state.cachedM0Bytes != null && options.state.cachedM1Bytes != null;
|
|
12463
|
-
let contentionReplayBoundary = options.contentionFallbackPrefix?.preparedTrimBoundaryId ?? null;
|
|
12464
12482
|
const decision = mustMaterialize({
|
|
12465
12483
|
db: options.db,
|
|
12466
12484
|
sessionId: options.sessionId,
|
|
@@ -12498,11 +12516,12 @@ function injectM0M1(options) {
|
|
|
12498
12516
|
if (captured?.m0Bytes && captured.m1Text !== null) {
|
|
12499
12517
|
options.state.cachedM0Bytes = Buffer2.from(captured.m0Bytes);
|
|
12500
12518
|
options.state.cachedM1Bytes = Buffer2.from(captured.m1Text, "utf8");
|
|
12519
|
+
options.state.cachedM0TrimBoundaryId = captured.preparedTrimBoundaryId ?? null;
|
|
12520
|
+
options.state.cachedM0TrimBoundaryPartial = captured.preparedTrimBoundaryPartial;
|
|
12501
12521
|
} else {
|
|
12502
|
-
const persisted = readCachedM0M1Row(options.db, options.sessionId);
|
|
12522
|
+
const persisted = readCachedM0M1Row(options.db, options.sessionId, true);
|
|
12503
12523
|
if (persisted?.cached_m0_bytes && persisted.cached_m1_bytes) {
|
|
12504
12524
|
applyCachedRowToState(options.state, persisted);
|
|
12505
|
-
contentionReplayBoundary = persisted.cached_m0_last_baseline_end_message_id;
|
|
12506
12525
|
}
|
|
12507
12526
|
}
|
|
12508
12527
|
}
|
|
@@ -12567,11 +12586,19 @@ function injectM0M1(options) {
|
|
|
12567
12586
|
const M1_DRIFT_RATIO = 0.15;
|
|
12568
12587
|
const M1_ABSOLUTE_CAP_RATIO = 0.2;
|
|
12569
12588
|
const m1AbsoluteBudget = (options.historyBudgetTokens ?? DEFAULT_HISTORY_BUDGET_TOKENS) * M1_ABSOLUTE_CAP_RATIO;
|
|
12570
|
-
|
|
12571
|
-
|
|
12572
|
-
|
|
12573
|
-
|
|
12574
|
-
|
|
12589
|
+
let driftNeedsRefold = false;
|
|
12590
|
+
if (!rematerialized && !contentionExhausted && m1Recomputed && options.isCacheBustingPass) {
|
|
12591
|
+
driftNeedsRefold = memoryUpdateCount > 40;
|
|
12592
|
+
if (!driftNeedsRefold && m1Text !== M1_EMPTY_PLACEHOLDER) {
|
|
12593
|
+
const m1Tokens = estimateTokens(m1Text);
|
|
12594
|
+
driftNeedsRefold = m1Tokens > m1AbsoluteBudget;
|
|
12595
|
+
if (!driftNeedsRefold) {
|
|
12596
|
+
const m0Tokens = estimateTokens(m0Text);
|
|
12597
|
+
driftNeedsRefold = m0Tokens >= M0_DRIFT_RATIO_FLOOR_TOKENS && m1Tokens > m0Tokens * M1_DRIFT_RATIO;
|
|
12598
|
+
}
|
|
12599
|
+
}
|
|
12600
|
+
}
|
|
12601
|
+
if (driftNeedsRefold) {
|
|
12575
12602
|
try {
|
|
12576
12603
|
const refolded = materializeWithRetry(options);
|
|
12577
12604
|
applyMarkersToState(options.state, refolded.m0Bytes, refolded.snapshotMarkers, refolded.m1Bytes, refolded.renderedMemoryIds);
|
|
@@ -12586,7 +12613,10 @@ function injectM0M1(options) {
|
|
|
12586
12613
|
if (!options.state.cachedM0MuralDataUrl) {
|
|
12587
12614
|
m0Text = stripMemoryMuralBlock(m0Text);
|
|
12588
12615
|
}
|
|
12589
|
-
const
|
|
12616
|
+
const freshContentionFallback = contentionExhausted && freshFallbackRenderedMemoryIds !== null;
|
|
12617
|
+
const persistedBoundary = !options.compactionOff && !freshContentionFallback && !contentionExhausted && options.state.cachedM0TrimBoundaryId === undefined ? readCachedBaselineState(options.db, options.sessionId) : undefined;
|
|
12618
|
+
const preparedTrimBoundaryId = options.compactionOff ? null : freshContentionFallback ? options.db.prepare("SELECT end_message_id FROM compartments WHERE session_id = ? AND sequence <= ? ORDER BY sequence DESC LIMIT 1").get(options.sessionId, options.state.snapshotMarkers.maxCompartmentSeq)?.end_message_id ?? null : options.state.cachedM0TrimBoundaryId !== undefined ? options.state.cachedM0TrimBoundaryId : contentionExhausted ? options.contentionFallbackPrefix?.preparedTrimBoundaryId ?? null : persistedBoundary?.boundary ?? null;
|
|
12619
|
+
const preparedTrimBoundaryPartial = preparedTrimBoundaryId ? freshContentionFallback ? isPartialCompartmentEnd(options.db, options.sessionId, preparedTrimBoundaryId) : options.state.cachedM0TrimBoundaryPartial ?? persistedBoundary?.partial ?? options.contentionFallbackPrefix?.preparedTrimBoundaryPartial ?? true : false;
|
|
12590
12620
|
const preparedMessages = [];
|
|
12591
12621
|
const muralForWire = options.state.cachedM0MuralDataUrl ? {
|
|
12592
12622
|
enabled: true,
|
|
@@ -12600,7 +12630,8 @@ function injectM0M1(options) {
|
|
|
12600
12630
|
prefixTrim = trimToPreparedPrefix(options, {
|
|
12601
12631
|
m0RematerializedThisPass: rematerialized,
|
|
12602
12632
|
materializationContentionRetryExhausted: contentionExhausted,
|
|
12603
|
-
preparedTrimBoundaryId
|
|
12633
|
+
preparedTrimBoundaryId,
|
|
12634
|
+
preparedTrimBoundaryPartial
|
|
12604
12635
|
});
|
|
12605
12636
|
options.messages.unshift(...structuredClone(preparedMessages));
|
|
12606
12637
|
} else
|
|
@@ -12615,6 +12646,7 @@ function injectM0M1(options) {
|
|
|
12615
12646
|
m1Text,
|
|
12616
12647
|
preparedMessages,
|
|
12617
12648
|
preparedTrimBoundaryId,
|
|
12649
|
+
preparedTrimBoundaryPartial,
|
|
12618
12650
|
prefixTrimStatus: prefixTrim.status,
|
|
12619
12651
|
...prefixTrim.refusal ? { prefixTrimRefusal: prefixTrim.refusal } : {}
|
|
12620
12652
|
};
|
|
@@ -18187,7 +18219,7 @@ ${chunkText}`,
|
|
|
18187
18219
|
return;
|
|
18188
18220
|
}
|
|
18189
18221
|
appendCompartments(db, sessionId, persistedCompartments);
|
|
18190
|
-
persistedIds =
|
|
18222
|
+
persistedIds = getNewestCompartmentIds(db, sessionId, persistedCompartments.length);
|
|
18191
18223
|
if (promotionActive && !skipUnanchoredPromotion) {
|
|
18192
18224
|
try {
|
|
18193
18225
|
const promotion = promoteSessionFactsDurable(db, sessionId, promotionProjectIdentity, validatedPass.facts ?? []);
|
|
@@ -67,21 +67,21 @@ import {
|
|
|
67
67
|
import {
|
|
68
68
|
matchedSearchSnippet,
|
|
69
69
|
getIndexedMessageCorpusSize
|
|
70
|
-
} from "./index-
|
|
70
|
+
} from "./index-2x46rnct.js";
|
|
71
71
|
import {
|
|
72
72
|
getMessageIndexEpoch,
|
|
73
73
|
isMessageIndexSearchable,
|
|
74
74
|
withMemoryHintContent,
|
|
75
75
|
autoSearchRelevance,
|
|
76
76
|
recordAutoSearchLane
|
|
77
|
-
} from "./index-
|
|
77
|
+
} from "./index-3v5mfapn.js";
|
|
78
78
|
import {
|
|
79
79
|
MESSAGE_FTS_SESSION_FILTER_SQL,
|
|
80
80
|
withMessageFtsSessionFilter
|
|
81
81
|
} from "./index-52x68mj4.js";
|
|
82
82
|
import {
|
|
83
83
|
isRecord
|
|
84
|
-
} from "./index-
|
|
84
|
+
} from "./index-t20q6aj6.js";
|
|
85
85
|
import {
|
|
86
86
|
resolveWorkspaceShareCategories,
|
|
87
87
|
resolveWorkspaceIdentitySet,
|
|
@@ -139,9 +139,9 @@ async function serveV2ArchiveReads2(port, openConnections) {
|
|
|
139
139
|
import("./sqlite-zdgm52sv.js"),
|
|
140
140
|
import("./store-reader-3eh1s1m8.js"),
|
|
141
141
|
import("./store-h20ny8b8.js"),
|
|
142
|
-
import("./read-session-chunk-
|
|
143
|
-
import("./render-
|
|
144
|
-
import("./search-archive-
|
|
142
|
+
import("./read-session-chunk-4ma2vsva.js"),
|
|
143
|
+
import("./render-h16ea0th.js"),
|
|
144
|
+
import("./search-archive-km2ahm3e.js"),
|
|
145
145
|
import("./expand-attachments-h33jbgyz.js")
|
|
146
146
|
]);
|
|
147
147
|
const pool = new V2StoreReaderPool;
|
|
@@ -42,6 +42,7 @@ import {
|
|
|
42
42
|
providerVisibleMessage,
|
|
43
43
|
MERGED_REASONING_PARTS_PREFIX,
|
|
44
44
|
decodeMergedReasoningParts,
|
|
45
|
+
CACHED_TRIM_PARTIAL_SQL,
|
|
45
46
|
SESSION_META_SELECT_COLUMNS,
|
|
46
47
|
META_COLUMNS,
|
|
47
48
|
BOOLEAN_META_KEYS,
|
|
@@ -67,7 +68,7 @@ import {
|
|
|
67
68
|
getPendingPiCompactionMarkerState,
|
|
68
69
|
logPiCompactionMarkerClear,
|
|
69
70
|
isPrefixBoundThinkingModel
|
|
70
|
-
} from "./index-
|
|
71
|
+
} from "./index-t20q6aj6.js";
|
|
71
72
|
import {
|
|
72
73
|
withReadOnlySessionDb
|
|
73
74
|
} from "./index-x40zr813.js";
|
|
@@ -370,6 +371,10 @@ function getCompartments(db, sessionId) {
|
|
|
370
371
|
FROM compartments WHERE session_id = ? ORDER BY sequence ASC`).all(sessionId).filter(isCompartmentRow);
|
|
371
372
|
return rows.map(toCompartment);
|
|
372
373
|
}
|
|
374
|
+
function getNewestCompartmentIds(db, sessionId, count) {
|
|
375
|
+
const rows = db.prepare("SELECT id FROM compartments WHERE session_id = ? ORDER BY sequence DESC LIMIT ?").all(sessionId, count);
|
|
376
|
+
return rows.reverse().map(({ id }) => id);
|
|
377
|
+
}
|
|
373
378
|
function getLastCompartmentEndMessage(db, sessionId) {
|
|
374
379
|
const row = db.prepare("SELECT MAX(end_message) as max_end FROM compartments WHERE session_id = ? AND rebase_status != 'unresolved'").get(sessionId);
|
|
375
380
|
return row?.max_end ?? -1;
|
|
@@ -1385,6 +1390,7 @@ var SESSION_META_FALLBACK_SELECTS = {
|
|
|
1385
1390
|
last_todo_state: "'' AS last_todo_state",
|
|
1386
1391
|
tool_reclaim_watermark: "0 AS tool_reclaim_watermark",
|
|
1387
1392
|
cached_m0_bytes: "NULL AS cached_m0_bytes",
|
|
1393
|
+
cached_m0_last_baseline_end_message_id: "NULL AS cached_m0_last_baseline_end_message_id",
|
|
1388
1394
|
cached_m0_mural_data_url: "NULL AS cached_m0_mural_data_url",
|
|
1389
1395
|
cached_m0_mural_hash: "NULL AS cached_m0_mural_hash",
|
|
1390
1396
|
cached_m1_bytes: "NULL AS cached_m1_bytes",
|
|
@@ -1413,11 +1419,14 @@ function getSessionMetaSelectColumns(db) {
|
|
|
1413
1419
|
if (cached !== undefined)
|
|
1414
1420
|
return cached;
|
|
1415
1421
|
const existingColumns = new Set(db.prepare("PRAGMA table_info(session_meta)").all().map((column) => column.name));
|
|
1416
|
-
const
|
|
1422
|
+
const columns = SESSION_META_SELECT_COLUMNS.map((column) => {
|
|
1417
1423
|
if (existingColumns.has(column))
|
|
1418
1424
|
return column;
|
|
1419
1425
|
return SESSION_META_FALLBACK_SELECTS[column] ?? `0 AS ${column}`;
|
|
1420
|
-
})
|
|
1426
|
+
});
|
|
1427
|
+
if (existingColumns.has("cached_m0_last_baseline_end_message_id") && getTableColumnNames(db, "compartments").has("end_block_index"))
|
|
1428
|
+
columns.push(`${CACHED_TRIM_PARTIAL_SQL} AS cached_trim_partial`);
|
|
1429
|
+
const projection = columns.join(", ");
|
|
1421
1430
|
sessionMetaSelectColumnsCache.set(db, projection);
|
|
1422
1431
|
return projection;
|
|
1423
1432
|
}
|
|
@@ -5178,4 +5187,4 @@ var ERROR_CLASSES = new Set([
|
|
|
5178
5187
|
"permission_denied",
|
|
5179
5188
|
"unknown"
|
|
5180
5189
|
]);
|
|
5181
|
-
export { advanceSessionActivity, observeSessionActivity, backfillSessionActivity, COMPARTMENT_LEASE_RENEWAL_MS, getCompartmentLeaseBlocker, acquireCompartmentLease, renewCompartmentLease, releaseCompartmentLease, releaseCompartmentLeaseBestEffort, isCompartmentLeaseHeld, isNoContentCompartment, queueM0Mutation, getMaxM0MutationId, getCompartments, getLastCompartmentEndMessage, getLastCompartmentEndMessageId, getCompartmentsByEndMessageId, appendCompartments, buildCompartmentBlock, saveRecompStagingPass, getRecompStaging, clearRecompStaging, getRecompPartialRange, setRecompPartialRange, escapeXmlAttr, escapeXmlContent, getUncoveredCompartmentEndsThrough, isPartialCompartmentEnd, readProjectDocsCanonical, readServerFallbackUsage, providerResponseFailed, isSuccessfulProviderCompletion, LkgRecoveryFenceError, lkgServedArrayDigest, hasCleanLkgRecoveryFence, dirtyLkgRecoveryRevision, ownsLkgDirtyFence, invalidateCleanLkgRecoveryFence, prepareLkgCaptureFence, certifyCommittedLkgCapture, markLkgRecoveryDirty, rememberUnpublishedAutoSearchNoHint, getUnpublishedAutoSearchNoHint, forgetUnpublishedAutoSearchNoHint, registerAutoSearchWork, cancelAutoSearchWork, readSessionMeta, getOrCreateSessionMeta, updateSessionMeta, advanceToolReclaimWatermark, markSessionCleanupPending, retryPendingSessionCleanups, retryPendingRustSessionCleanupsForProject, clearSession, requestPendingMaterialization, pendingMaterializationOrigin, hasPendingMaterializationOrigin, clearPendingMaterialization, clearPendingMaterializationOrigin, recordSystemPromptForRequest, recordHeldHeadForRequest, bindSystemPromptResponse, isHeldHeadForRequest, deferDeliveredSystemRefresh, retirePendingSystemPromptDelivery, lkgProviderInputTotal, beginV2LkgRequest, claimLkgRequestIdentity, currentLkgRequestIdentity, noteCapturedLkgRequest, noteLkgProviderResponse, measuredLkgPrefix, clearLkgMeasuredRequest, saveLkgSlotToDb, clearPersistedLkgSlotStrict, loadPersistedLkgSlot, drainStaleLkgSlots, createDbLkgPersistence, resolveLkgModelKeys, createLkgEntryProjector, captureLkgSlot, validateAnthropicReasoningRuns, validateLkgSeam, replayLkg, coldStartRawServedIndex, coldStartUncapturedReplay, noteUncertifiedNormalLkg, hasProcessLocalLkgProof, lkgDirtyRevision, rememberLkgDirtyRevision, readPersistedLkgUntaggedInputIds, persistLkgUntaggedInputIds, noteLkgRecoveryPrefix, readLkgRecoveryPrefix, noteLkgHealthyPrefix, lkgRecoveryReplayUnproven, lkgRecoveryEntryUnproven, beginServedRequest, noteServedPassPermission, noteServedModel, noteServedReplay, noteServedHostInput, noteServedRefusal, countServedRefusal, dropServedRecord, forgetServedRecord, commitServedRequest, lkgInputIdentity, registerLkgPersistence, beginLkgPass, visitMessageContentFields, contentSnapshotValue, messageContentFields, signatureForFields, exactReusablePrefix, incrementalLkgContentDigests, lkgContentDigest, lkgSlotRejection, captureSlot, getInMemorySlot, getSlot, forgetInMemorySlot, dropSlot, noteEntry, getLkgSlotHeapStats, TOOL_SWEEP_SCOPED_MARKER, useScopedToolSweep, createPreAdoptionToolSweepResolver, copySessionStateForClone, externalHistorianFailureReason, getRecentFailedHistorianRunTimes, recordHistorianRun, summarizeImportance, tallyFactsByCategory, MEMORY_VISIBILITY_MUTATION_CATEGORY, queueMemoryMutation, getMemoryMutationsForRender, getMemoryMutationsForRenderByProjects, getMaxMemoryMutationId, getMaxMemoryMutationIdForProjects, GLOBAL_USER_PROFILE_PROJECT_PATH, getProjectState, bumpProjectUserProfileVersion, saveSourceContent, replaceSourceContent, getSourceContents, recordSubagentInvocation, getLatestHistorianInvocationId };
|
|
5190
|
+
export { advanceSessionActivity, observeSessionActivity, backfillSessionActivity, COMPARTMENT_LEASE_RENEWAL_MS, getCompartmentLeaseBlocker, acquireCompartmentLease, renewCompartmentLease, releaseCompartmentLease, releaseCompartmentLeaseBestEffort, isCompartmentLeaseHeld, isNoContentCompartment, queueM0Mutation, getMaxM0MutationId, getCompartments, getNewestCompartmentIds, getLastCompartmentEndMessage, getLastCompartmentEndMessageId, getCompartmentsByEndMessageId, appendCompartments, buildCompartmentBlock, saveRecompStagingPass, getRecompStaging, clearRecompStaging, getRecompPartialRange, setRecompPartialRange, escapeXmlAttr, escapeXmlContent, getUncoveredCompartmentEndsThrough, isPartialCompartmentEnd, readProjectDocsCanonical, readServerFallbackUsage, providerResponseFailed, isSuccessfulProviderCompletion, LkgRecoveryFenceError, lkgServedArrayDigest, hasCleanLkgRecoveryFence, dirtyLkgRecoveryRevision, ownsLkgDirtyFence, invalidateCleanLkgRecoveryFence, prepareLkgCaptureFence, certifyCommittedLkgCapture, markLkgRecoveryDirty, rememberUnpublishedAutoSearchNoHint, getUnpublishedAutoSearchNoHint, forgetUnpublishedAutoSearchNoHint, registerAutoSearchWork, cancelAutoSearchWork, readSessionMeta, getOrCreateSessionMeta, updateSessionMeta, advanceToolReclaimWatermark, markSessionCleanupPending, retryPendingSessionCleanups, retryPendingRustSessionCleanupsForProject, clearSession, requestPendingMaterialization, pendingMaterializationOrigin, hasPendingMaterializationOrigin, clearPendingMaterialization, clearPendingMaterializationOrigin, recordSystemPromptForRequest, recordHeldHeadForRequest, bindSystemPromptResponse, isHeldHeadForRequest, deferDeliveredSystemRefresh, retirePendingSystemPromptDelivery, lkgProviderInputTotal, beginV2LkgRequest, claimLkgRequestIdentity, currentLkgRequestIdentity, noteCapturedLkgRequest, noteLkgProviderResponse, measuredLkgPrefix, clearLkgMeasuredRequest, saveLkgSlotToDb, clearPersistedLkgSlotStrict, loadPersistedLkgSlot, drainStaleLkgSlots, createDbLkgPersistence, resolveLkgModelKeys, createLkgEntryProjector, captureLkgSlot, validateAnthropicReasoningRuns, validateLkgSeam, replayLkg, coldStartRawServedIndex, coldStartUncapturedReplay, noteUncertifiedNormalLkg, hasProcessLocalLkgProof, lkgDirtyRevision, rememberLkgDirtyRevision, readPersistedLkgUntaggedInputIds, persistLkgUntaggedInputIds, noteLkgRecoveryPrefix, readLkgRecoveryPrefix, noteLkgHealthyPrefix, lkgRecoveryReplayUnproven, lkgRecoveryEntryUnproven, beginServedRequest, noteServedPassPermission, noteServedModel, noteServedReplay, noteServedHostInput, noteServedRefusal, countServedRefusal, dropServedRecord, forgetServedRecord, commitServedRequest, lkgInputIdentity, registerLkgPersistence, beginLkgPass, visitMessageContentFields, contentSnapshotValue, messageContentFields, signatureForFields, exactReusablePrefix, incrementalLkgContentDigests, lkgContentDigest, lkgSlotRejection, captureSlot, getInMemorySlot, getSlot, forgetInMemorySlot, dropSlot, noteEntry, getLkgSlotHeapStats, TOOL_SWEEP_SCOPED_MARKER, useScopedToolSweep, createPreAdoptionToolSweepResolver, copySessionStateForClone, externalHistorianFailureReason, getRecentFailedHistorianRunTimes, recordHistorianRun, summarizeImportance, tallyFactsByCategory, MEMORY_VISIBILITY_MUTATION_CATEGORY, queueMemoryMutation, getMemoryMutationsForRender, getMemoryMutationsForRenderByProjects, getMaxMemoryMutationId, getMaxMemoryMutationIdForProjects, GLOBAL_USER_PROFILE_PROJECT_PATH, getProjectState, bumpProjectUserProfileVersion, saveSourceContent, replaceSourceContent, getSourceContents, recordSubagentInvocation, getLatestHistorianInvocationId };
|
|
@@ -2438,6 +2438,12 @@ function getProtectionWindowForSession(db, sessionId, floor) {
|
|
|
2438
2438
|
|
|
2439
2439
|
// src/features/magic-context/storage-meta-shared.ts
|
|
2440
2440
|
import { Buffer as Buffer2 } from "node:buffer";
|
|
2441
|
+
var CACHED_TRIM_PARTIAL_SQL = `EXISTS (
|
|
2442
|
+
SELECT 1 FROM compartments
|
|
2443
|
+
WHERE compartments.session_id = session_meta.session_id
|
|
2444
|
+
AND compartments.end_message_id = session_meta.cached_m0_last_baseline_end_message_id
|
|
2445
|
+
AND compartments.end_block_index IS NOT NULL
|
|
2446
|
+
)`;
|
|
2441
2447
|
var SESSION_META_SELECT_COLUMNS = [
|
|
2442
2448
|
"session_id",
|
|
2443
2449
|
"last_response_time",
|
|
@@ -2464,6 +2470,7 @@ var SESSION_META_SELECT_COLUMNS = [
|
|
|
2464
2470
|
"cached_m0_mural_data_url",
|
|
2465
2471
|
"cached_m0_mural_hash",
|
|
2466
2472
|
"cached_m1_bytes",
|
|
2473
|
+
"cached_m0_last_baseline_end_message_id",
|
|
2467
2474
|
"cached_m0_project_memory_epoch",
|
|
2468
2475
|
"cached_m0_workspace_fingerprint",
|
|
2469
2476
|
"cached_m0_project_user_profile_version",
|
|
@@ -2623,6 +2630,8 @@ function getDefaultSessionMeta(sessionId) {
|
|
|
2623
2630
|
cachedM0MuralDataUrl: null,
|
|
2624
2631
|
cachedM0MuralHash: null,
|
|
2625
2632
|
cachedM1Bytes: null,
|
|
2633
|
+
cachedM0TrimBoundaryId: null,
|
|
2634
|
+
cachedM0TrimBoundaryPartial: false,
|
|
2626
2635
|
cachedM0ProjectMemoryEpoch: null,
|
|
2627
2636
|
cachedM0WorkspaceFingerprint: null,
|
|
2628
2637
|
cachedM0ProjectUserProfileVersion: null,
|
|
@@ -2700,6 +2709,8 @@ function toSessionMeta(row) {
|
|
|
2700
2709
|
cachedM0MuralDataUrl: stringOrNull(row.cached_m0_mural_data_url),
|
|
2701
2710
|
cachedM0MuralHash: stringOrNull(row.cached_m0_mural_hash),
|
|
2702
2711
|
cachedM1Bytes: toBufferOrNull(row.cached_m1_bytes),
|
|
2712
|
+
cachedM0TrimBoundaryId: row.cached_m0_last_baseline_end_message_id || null,
|
|
2713
|
+
cachedM0TrimBoundaryPartial: row.cached_trim_partial === 1,
|
|
2703
2714
|
cachedM0ProjectMemoryEpoch: numOrNull(row.cached_m0_project_memory_epoch),
|
|
2704
2715
|
cachedM0WorkspaceFingerprint: stringOrNull(row.cached_m0_workspace_fingerprint),
|
|
2705
2716
|
cachedM0ProjectUserProfileVersion: numOrNull(row.cached_m0_project_user_profile_version),
|
|
@@ -8871,4 +8882,4 @@ function deleteToolTagsByOwner(db, sessionId, ownerMsgId) {
|
|
|
8871
8882
|
return getDeleteToolTagsByOwnerStatement(db).all(sessionId, ownerMsgId).length;
|
|
8872
8883
|
}
|
|
8873
8884
|
|
|
8874
|
-
export { protectedToolTagNumbers, protectedToolTokenCount, stripWellFormedLeadingTagPrefix, stripPersistedAssistantText, byteSize, stripTagPrefix, peelLeadingMcTagNotation, prependTag, isThinkingPart, currentReclaimableToolOutputCount, isRecord, contentTagOwnerMessageId, estimateImageTokensFromDataUrl, estimateToolAttachmentImageTokens, providerVisiblePart, providerVisibleMessage, CLEARED_TODO_STATE_JSON, normalizeTodoStateJson, buildSyntheticTodoPart, computeSyntheticCallId, isSyntheticTodoPart, countRealUserMessages, tailHygieneStructuralSignature, sameTailHygieneStructuralSignature, formatTailHygienePrefixMismatch, refreshTailHygieneBaseline, effectiveTailHygiene, assertTailHygieneContentUnchangedIfEnabled, CHANNEL1_SENTINEL, CHANNEL1_FLOOR_TOKENS, isDroppedToolOutput, toolOutputTokens, decideChannel1, evaluateChannel2, formatChannel1Evaluation, formatChannel2Evaluation, buildChannel2Reminder, buildChannel1Reminder, createFinalWireIncompleteLogger, MERGED_REASONING_PARTS_PREFIX, decodeMergedReasoningParts, readFrozenMergedReasoningParts, MAX_EXECUTE_THRESHOLD, escalationBands, HYGIENE_PROVIDER_UNITS_VERSION, sessionDecisionCalibration, transitionSessionHygieneUnits, readEpochFloorSnapshot, getProtectionWindowForSession, SESSION_META_SELECT_COLUMNS, META_COLUMNS, BOOLEAN_META_KEYS, NULL_BIND_META_KEYS, isSessionMetaRow, getDefaultSessionMeta, ensureSessionMetaRow, toSessionMeta, persistCachedM0, clearCachedM0M1, clearCachedM0, withReplayEnvelopeSnapshot, invalidateReplayEnvelopeSnapshot, isRustMarkerAdmissionFenced, setRustMarkerAdmissionFence, ReplayDocumentError, readReplayEnvelope, readReplayDocument, updateReplayDocument, writeReplayDocument, isEmergencyRecoveryArmed, isProviderOverflowReconfirmed, isProviderOverflowFailClosedProven, getEmergencyRecoveryArmedAt, describeProtectedTailDrainBudgetSkip, loadPersistedUsage, loadProtectedTailMeta, markProtectedTailPolicyV3Seeded, recordProtectedTailPublicationFloor, recordProtectedTailNoEligibleHead, resetProtectedTailNoEligibleHead, getWrapupInProgressState, isWrapupInProgress, acquireWrapupInProgress, updateWrapupInProgress, releaseWrapupInProgress, resolveCompactionModeRecord, getCompactionModeRecord, setCompactionModeRecord, getProtectedTailDrainBudgetSkip, reserveProtectedTailDrainTokens, clearEmergencyDrainLatch, recordHistorianDrainFailure, clearHistorianDrainFailure, rollbackProtectedTailDrainReservation, getPersistedReasoningWatermark, setPersistedReasoningWatermark, clearPersistedReasoningWatermark, getEmergencyInputSample, setEmergencyDropSample, clearEmergencyDropSample, getLastNudgeUndropped, setLastNudgeUndropped, getChannel1NudgeState, setChannel1NudgeState, markChannel1PostReduceGracePending, captureChannel1PostReduceGraceBaseline, getChannel2NudgeState, getChannel2NudgeClaim, setChannel2NudgeState, casChannel2NudgeState, claimChannel2NudgeState, casChannel2NudgeClaim, getPersistedNoteNudge, setPersistedNoteNudgeTrigger, setPersistedNoteNudgeTriggerMessageId, getNoteNudgeAnchors, getAutoSearchHintDecisions, deliverNoteNudgeAtomic, appendAutoSearchHintDecision, pruneNoteNudgeAnchors, removeNoteNudgeAnchorByMessageId, queueAutoSearchHintDecisionRetirement, flushAutoSearchHintDecisionRetirement, removeAutoSearchHintDecisionByMessageId, getPersistedTodoPermissionDenied, setPersistedTodoPermissionDenied, getPersistedTodoSyntheticAnchor, setPersistedTodoSyntheticAnchor, clearPersistedTodoSyntheticAnchor, getNoteLastReadAt, setNoteLastReadAt, getHistorianFailureState, incrementHistorianFailure, clearHistorianFailureState, getOverflowState, loadTransformPassStateSnapshot, recordOverflowDetected, recordDetectedContextLimit, clearEmergencyRecovery, clearDetectedContextLimit, getPersistedCompactionMarkerState, getCompactionMarkerPublicationState, compareAndSetCompactionMarkerPublicationState, setPersistedCompactionMarkerState, getDeferredClearedCompactionMarkerState, retireDeferredClearedCompactionMarkerState, parseStrippedPlaceholderState, serializeStrippedPlaceholderState, getStrippedPlaceholderIds, applyStrippedPlaceholderDelta, removeStrippedPlaceholderId, THINKING_BINDING_RECOVERY_FROZEN_PREFIX, THINKING_BINDING_STRIP_ORDER_END_MARKER, thinkingBindingRecoveryFrozenId, COMPACTION_OFF_THINKING_FROZEN_PREFIX, compactionOffThinkingFrozenId, compactionOffFrozenThinkingIds, getThinkingBindingRecoveryTarget, armThinkingBindingRecovery, noteBindingRecoveryAwaitingClear, bindingRecoveryAwaitingClear, retryBindingRecoveryClear, clearThinkingBindingRecoveryIf, getMergedReasoningStrippedIds, addMergedReasoningStrippedIds, getTrailingBlankDecisions, addTrailingBlankDecisions, demoteTrailingBlankKeepDecisions, getStaleReduceStrippedIds, addStaleReduceStrippedIds, getProcessedImageStrippedIds, parseProcessedImageMarkers, serializeProcessedImageMarkers, getProcessedImageMarkers, addProcessedImageStrippedIds, getPendingCompactionMarkerState, getCompactionMarkerHealth, loadPostprocessReplaySnapshot, setPendingCompactionMarkerState, replacePendingCompactionMarkerStateIf, clearPendingCompactionMarkerStateIf, getPendingPiCompactionMarkerState, clearPendingPiCompactionMarkerStateIf, logPiCompactionMarkerClear, getSessionsWithPendingMarker, cachedHeadCoversPendingCompactionMarker, getObservedEpochFloor, resolveEpochFloorForPass, getReasoningRemovalState, addRemovedReasoningIds, markDropLeavesReasoning, detectThinkingBindingMismatch, detectLatestTurnThinkingMismatch, isPrefixBoundThinkingModel, detectOverflow, modelAcceptsEmptyContent, isAnthropicFamilyRoute, neutralizeDroppedReasoningPart, restoreNeutralizedReasoningPart, isNeutralizedReasoningPart, variantChangeBustsProviderCache, makeSentinel, makeWholeMessageSentinel, isSentinel, replaySentinelByMessageIds, isInActiveAnthropicTurn, activeAnthropicTurnStart, hasAnthropicReasoning, markServedShapeRepair, prepareServedShapeRepair, stripSystemInjectedMessages, stripDroppedPlaceholderMessages, replayClearedReasoning, replayStrippedInlineThinking, clearOldReasoning, stripClearedReasoning, captureInlineThinkingRepairs, stripInlineThinking, findReasoningBearingAssistantIds, findLatestAssistantReasoningMutationExemptMessage, snapshotTrailingBlankSourceDecisions, findTrailingBlankDecisionCandidates, applyFrozenTrailingBlankDecisions, stripReasoningFromAssistantIds, findMergedReasoningStripDecisions, stripReasoningFromMergedAssistants, getEmptyImageParts, stripProcessedImages, projectOpencodeReasoningBudgetCutoff, DEFAULT_KEEP_REASONING_TOKENS, resolveKeepReasoningTokens, reasoningStepCost, reasoningBudgetCutoff, reasoningTextAndOpaque, opencodeReasoningBudgetCutoff, describeFinalWireTail, estimatePartImageTokens, openCode2ThinkingPayload, estimateMessageTokens, wireContentBytes, createFinalWireUsageTracker, estimateFinalWireInputTokens, estimateAppendedWireTokens, estimateEmergencyDropReclaimTokens, planEmergencyDrop, measureEmergencyTag, snapshotEmergencyServedMass, tagsSinceReading, emergencyServedMassRemovedSince, queuePendingOp, queuePendingDropForUnchangedTag, getPendingOps, hasPendingDropOps, getPendingOpsCount, clearPendingOps, removePendingOp, updateTagByteSize2, getRecentTagOwnerMessageIds2, getActiveTagTokenAggregate2, AGE_RECLAIM_MIN_TOKENS2, getOldestActiveUnprotectedToolTags2, getActiveToolTagsForAgeReclaim2, getTriggerTagTokenUpperBound2, getActiveTagTokenTotalsByMessage2, updateTagTokenCount2, getPersistedToolTagAccounting2, getAllStatusTagTokenTotalsFlat2, getReasoningTokenEstimatesByMessage2, tryGetReasoningTokenEstimatesByMessage2, getMaxTagNumberByOwnerMessage2, TagOwnerSummaryNotReady2, scanTagOwnerSummary2, cachedTagOwnerRatios2, tagOwnerWarmupState2, scanTagOwnerDelta2, installTagOwnerDelta2, installTagOwnerSummary2, isTagOwnerSummaryReady2, tagTokenCountIsNull2, backfillTagTokenCounts2, insertTag2, updateTagStatus2, markTagDropped2, markWhitespaceAssistantTagInert2, getInertWhitespaceAssistantTags2, getInertWhitespaceAssistantTagsByNumbers2, updateTagDropMode2, updateCavemanDepth2, updateTagMessageId2, hasPiFallbackMessageTags2, findAdoptableFallbackTags2, adoptFallbackTagMessageId2, foldShrunkPartTags2, hasPiFallbackToolOwnerTags2, findPiFallbackToolOwnerTags2, adoptPiFallbackToolOwnerTag2, adoptPiFallbackMessageTag2, markTagsCompactedByMessageIds2, deleteTagsByMessageId2, getMaxTagNumberBySession2, getTagNumberByMessageId2, getAssignableTagNumberByMessageId2, getMinMessageTagNumberForRawId2, deriveTagLoadFloor2, TAG_SELECT_COLUMNS2, getTagsBySession2, getActiveTagsBySession2, getTailHygieneTags2, getDroppedTagsBySession2, getTagsForPendingOperations2, getTagsByNumbers2, getNewestToolTagNumbers2, getDroppedTagsByNumbers2, getMaxDroppedTagNumber2, getTagById2, getTopNBySize2, getToolTagNumberByOwner2, getNullOwnerToolTag2, adoptNullOwnerToolTag2, getCandidateToolOwners2, pickNearestPriorOwner2 };
|
|
8885
|
+
export { protectedToolTagNumbers, protectedToolTokenCount, stripWellFormedLeadingTagPrefix, stripPersistedAssistantText, byteSize, stripTagPrefix, peelLeadingMcTagNotation, prependTag, isThinkingPart, currentReclaimableToolOutputCount, isRecord, contentTagOwnerMessageId, estimateImageTokensFromDataUrl, estimateToolAttachmentImageTokens, providerVisiblePart, providerVisibleMessage, CLEARED_TODO_STATE_JSON, normalizeTodoStateJson, buildSyntheticTodoPart, computeSyntheticCallId, isSyntheticTodoPart, countRealUserMessages, tailHygieneStructuralSignature, sameTailHygieneStructuralSignature, formatTailHygienePrefixMismatch, refreshTailHygieneBaseline, effectiveTailHygiene, assertTailHygieneContentUnchangedIfEnabled, CHANNEL1_SENTINEL, CHANNEL1_FLOOR_TOKENS, isDroppedToolOutput, toolOutputTokens, decideChannel1, evaluateChannel2, formatChannel1Evaluation, formatChannel2Evaluation, buildChannel2Reminder, buildChannel1Reminder, createFinalWireIncompleteLogger, MERGED_REASONING_PARTS_PREFIX, decodeMergedReasoningParts, readFrozenMergedReasoningParts, MAX_EXECUTE_THRESHOLD, escalationBands, HYGIENE_PROVIDER_UNITS_VERSION, sessionDecisionCalibration, transitionSessionHygieneUnits, readEpochFloorSnapshot, getProtectionWindowForSession, CACHED_TRIM_PARTIAL_SQL, SESSION_META_SELECT_COLUMNS, META_COLUMNS, BOOLEAN_META_KEYS, NULL_BIND_META_KEYS, isSessionMetaRow, getDefaultSessionMeta, ensureSessionMetaRow, toSessionMeta, persistCachedM0, clearCachedM0M1, clearCachedM0, withReplayEnvelopeSnapshot, invalidateReplayEnvelopeSnapshot, isRustMarkerAdmissionFenced, setRustMarkerAdmissionFence, ReplayDocumentError, readReplayEnvelope, readReplayDocument, updateReplayDocument, writeReplayDocument, isEmergencyRecoveryArmed, isProviderOverflowReconfirmed, isProviderOverflowFailClosedProven, getEmergencyRecoveryArmedAt, describeProtectedTailDrainBudgetSkip, loadPersistedUsage, loadProtectedTailMeta, markProtectedTailPolicyV3Seeded, recordProtectedTailPublicationFloor, recordProtectedTailNoEligibleHead, resetProtectedTailNoEligibleHead, getWrapupInProgressState, isWrapupInProgress, acquireWrapupInProgress, updateWrapupInProgress, releaseWrapupInProgress, resolveCompactionModeRecord, getCompactionModeRecord, setCompactionModeRecord, getProtectedTailDrainBudgetSkip, reserveProtectedTailDrainTokens, clearEmergencyDrainLatch, recordHistorianDrainFailure, clearHistorianDrainFailure, rollbackProtectedTailDrainReservation, getPersistedReasoningWatermark, setPersistedReasoningWatermark, clearPersistedReasoningWatermark, getEmergencyInputSample, setEmergencyDropSample, clearEmergencyDropSample, getLastNudgeUndropped, setLastNudgeUndropped, getChannel1NudgeState, setChannel1NudgeState, markChannel1PostReduceGracePending, captureChannel1PostReduceGraceBaseline, getChannel2NudgeState, getChannel2NudgeClaim, setChannel2NudgeState, casChannel2NudgeState, claimChannel2NudgeState, casChannel2NudgeClaim, getPersistedNoteNudge, setPersistedNoteNudgeTrigger, setPersistedNoteNudgeTriggerMessageId, getNoteNudgeAnchors, getAutoSearchHintDecisions, deliverNoteNudgeAtomic, appendAutoSearchHintDecision, pruneNoteNudgeAnchors, removeNoteNudgeAnchorByMessageId, queueAutoSearchHintDecisionRetirement, flushAutoSearchHintDecisionRetirement, removeAutoSearchHintDecisionByMessageId, getPersistedTodoPermissionDenied, setPersistedTodoPermissionDenied, getPersistedTodoSyntheticAnchor, setPersistedTodoSyntheticAnchor, clearPersistedTodoSyntheticAnchor, getNoteLastReadAt, setNoteLastReadAt, getHistorianFailureState, incrementHistorianFailure, clearHistorianFailureState, getOverflowState, loadTransformPassStateSnapshot, recordOverflowDetected, recordDetectedContextLimit, clearEmergencyRecovery, clearDetectedContextLimit, getPersistedCompactionMarkerState, getCompactionMarkerPublicationState, compareAndSetCompactionMarkerPublicationState, setPersistedCompactionMarkerState, getDeferredClearedCompactionMarkerState, retireDeferredClearedCompactionMarkerState, parseStrippedPlaceholderState, serializeStrippedPlaceholderState, getStrippedPlaceholderIds, applyStrippedPlaceholderDelta, removeStrippedPlaceholderId, THINKING_BINDING_RECOVERY_FROZEN_PREFIX, THINKING_BINDING_STRIP_ORDER_END_MARKER, thinkingBindingRecoveryFrozenId, COMPACTION_OFF_THINKING_FROZEN_PREFIX, compactionOffThinkingFrozenId, compactionOffFrozenThinkingIds, getThinkingBindingRecoveryTarget, armThinkingBindingRecovery, noteBindingRecoveryAwaitingClear, bindingRecoveryAwaitingClear, retryBindingRecoveryClear, clearThinkingBindingRecoveryIf, getMergedReasoningStrippedIds, addMergedReasoningStrippedIds, getTrailingBlankDecisions, addTrailingBlankDecisions, demoteTrailingBlankKeepDecisions, getStaleReduceStrippedIds, addStaleReduceStrippedIds, getProcessedImageStrippedIds, parseProcessedImageMarkers, serializeProcessedImageMarkers, getProcessedImageMarkers, addProcessedImageStrippedIds, getPendingCompactionMarkerState, getCompactionMarkerHealth, loadPostprocessReplaySnapshot, setPendingCompactionMarkerState, replacePendingCompactionMarkerStateIf, clearPendingCompactionMarkerStateIf, getPendingPiCompactionMarkerState, clearPendingPiCompactionMarkerStateIf, logPiCompactionMarkerClear, getSessionsWithPendingMarker, cachedHeadCoversPendingCompactionMarker, getObservedEpochFloor, resolveEpochFloorForPass, getReasoningRemovalState, addRemovedReasoningIds, markDropLeavesReasoning, detectThinkingBindingMismatch, detectLatestTurnThinkingMismatch, isPrefixBoundThinkingModel, detectOverflow, modelAcceptsEmptyContent, isAnthropicFamilyRoute, neutralizeDroppedReasoningPart, restoreNeutralizedReasoningPart, isNeutralizedReasoningPart, variantChangeBustsProviderCache, makeSentinel, makeWholeMessageSentinel, isSentinel, replaySentinelByMessageIds, isInActiveAnthropicTurn, activeAnthropicTurnStart, hasAnthropicReasoning, markServedShapeRepair, prepareServedShapeRepair, stripSystemInjectedMessages, stripDroppedPlaceholderMessages, replayClearedReasoning, replayStrippedInlineThinking, clearOldReasoning, stripClearedReasoning, captureInlineThinkingRepairs, stripInlineThinking, findReasoningBearingAssistantIds, findLatestAssistantReasoningMutationExemptMessage, snapshotTrailingBlankSourceDecisions, findTrailingBlankDecisionCandidates, applyFrozenTrailingBlankDecisions, stripReasoningFromAssistantIds, findMergedReasoningStripDecisions, stripReasoningFromMergedAssistants, getEmptyImageParts, stripProcessedImages, projectOpencodeReasoningBudgetCutoff, DEFAULT_KEEP_REASONING_TOKENS, resolveKeepReasoningTokens, reasoningStepCost, reasoningBudgetCutoff, reasoningTextAndOpaque, opencodeReasoningBudgetCutoff, describeFinalWireTail, estimatePartImageTokens, openCode2ThinkingPayload, estimateMessageTokens, wireContentBytes, createFinalWireUsageTracker, estimateFinalWireInputTokens, estimateAppendedWireTokens, estimateEmergencyDropReclaimTokens, planEmergencyDrop, measureEmergencyTag, snapshotEmergencyServedMass, tagsSinceReading, emergencyServedMassRemovedSince, queuePendingOp, queuePendingDropForUnchangedTag, getPendingOps, hasPendingDropOps, getPendingOpsCount, clearPendingOps, removePendingOp, updateTagByteSize2, getRecentTagOwnerMessageIds2, getActiveTagTokenAggregate2, AGE_RECLAIM_MIN_TOKENS2, getOldestActiveUnprotectedToolTags2, getActiveToolTagsForAgeReclaim2, getTriggerTagTokenUpperBound2, getActiveTagTokenTotalsByMessage2, updateTagTokenCount2, getPersistedToolTagAccounting2, getAllStatusTagTokenTotalsFlat2, getReasoningTokenEstimatesByMessage2, tryGetReasoningTokenEstimatesByMessage2, getMaxTagNumberByOwnerMessage2, TagOwnerSummaryNotReady2, scanTagOwnerSummary2, cachedTagOwnerRatios2, tagOwnerWarmupState2, scanTagOwnerDelta2, installTagOwnerDelta2, installTagOwnerSummary2, isTagOwnerSummaryReady2, tagTokenCountIsNull2, backfillTagTokenCounts2, insertTag2, updateTagStatus2, markTagDropped2, markWhitespaceAssistantTagInert2, getInertWhitespaceAssistantTags2, getInertWhitespaceAssistantTagsByNumbers2, updateTagDropMode2, updateCavemanDepth2, updateTagMessageId2, hasPiFallbackMessageTags2, findAdoptableFallbackTags2, adoptFallbackTagMessageId2, foldShrunkPartTags2, hasPiFallbackToolOwnerTags2, findPiFallbackToolOwnerTags2, adoptPiFallbackToolOwnerTag2, adoptPiFallbackMessageTag2, markTagsCompactedByMessageIds2, deleteTagsByMessageId2, getMaxTagNumberBySession2, getTagNumberByMessageId2, getAssignableTagNumberByMessageId2, getMinMessageTagNumberForRawId2, deriveTagLoadFloor2, TAG_SELECT_COLUMNS2, getTagsBySession2, getActiveTagsBySession2, getTailHygieneTags2, getDroppedTagsBySession2, getTagsForPendingOperations2, getTagsByNumbers2, getNewestToolTagNumbers2, getDroppedTagsByNumbers2, getMaxDroppedTagNumber2, getTagById2, getTopNBySize2, getToolTagNumberByOwner2, getNullOwnerToolTag2, adoptNullOwnerToolTag2, getCandidateToolOwners2, pickNearestPriorOwner2 };
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
} from "./index-5vsk2cpp.js";
|
|
4
4
|
import {
|
|
5
5
|
getTagById2
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-t20q6aj6.js";
|
|
7
7
|
import {
|
|
8
8
|
expandToolPart,
|
|
9
9
|
visitRawSessionMessages2,
|
|
10
10
|
readRawSessionMessageById2
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-q73yeb83.js";
|
|
12
12
|
|
|
13
13
|
// src/tools/ctx-expand/render.ts
|
|
14
14
|
import { createHash } from "node:crypto";
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
releaseCompartmentLeaseBestEffort,
|
|
9
9
|
getCompartments,
|
|
10
10
|
getLastCompartmentEndMessage
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-ngrrs3yb.js";
|
|
12
12
|
import {
|
|
13
13
|
inRootAsyncContext2
|
|
14
14
|
} from "./index-gzy5w8ya.js";
|
|
@@ -19,10 +19,10 @@ import {
|
|
|
19
19
|
releaseWrapupInProgress,
|
|
20
20
|
getHistorianFailureState,
|
|
21
21
|
clearEmergencyRecovery
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-t20q6aj6.js";
|
|
23
23
|
import {
|
|
24
24
|
prepareRawSessionOrdinals2
|
|
25
|
-
} from "./index-
|
|
25
|
+
} from "./index-q73yeb83.js";
|
|
26
26
|
import {
|
|
27
27
|
pushNotification2
|
|
28
28
|
} from "./index-x8a7jmkh.js";
|
|
@@ -34,14 +34,14 @@ import {
|
|
|
34
34
|
getActiveCompartmentRun,
|
|
35
35
|
markActiveCompartmentRunPublished,
|
|
36
36
|
registerActiveCompartmentRun
|
|
37
|
-
} from "./index-
|
|
37
|
+
} from "./index-m47yte97.js";
|
|
38
38
|
import {
|
|
39
39
|
sendStatusNotification2
|
|
40
40
|
} from "./index-1sq1krqw.js";
|
|
41
41
|
import {
|
|
42
42
|
setRecompStarting2,
|
|
43
43
|
setRecompTerminal2
|
|
44
|
-
} from "./index-
|
|
44
|
+
} from "./index-8a1m48va.js";
|
|
45
45
|
|
|
46
46
|
// src/hooks/magic-context/wrapup-orchestrator.ts
|
|
47
47
|
import * as crypto from "node:crypto";
|