@cortexkit/pi-magic-context 0.49.5 → 0.49.7
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 +10 -7
- package/dist/{compaction-marker-candidates-cd17s4ys.js → compaction-marker-candidates-tqcq5n00.js} +2 -2
- package/dist/compaction-marker-candidates-worker.js +2 -2
- package/dist/{embedding-backfill-r7n7dj50.js → embedding-backfill-vygvr2x4.js} +6 -6
- package/dist/{index-g1csz24n.js → index-0d8zqccx.js} +3 -3
- package/dist/{index-mzn6t38b.js → index-0eg59y8d.js} +2 -2
- package/dist/{index-9ygacw4e.js → index-0ww9cgfd.js} +4 -4
- package/dist/{index-4gfq5t09.js → index-34zacc0h.js} +1 -1
- package/dist/{index-a1jmtv6r.js → index-6q5mx0cz.js} +8 -7
- package/dist/{index-9n88gmpf.js → index-6vjj0555.js} +1 -1
- package/dist/{index-2apf1afe.js → index-7mm27xdc.js} +1 -1
- package/dist/{index-3cgbv47m.js → index-7ptxvfc5.js} +35 -14
- package/dist/{index-57njcjax.js → index-8jpqq2yk.js} +64 -64
- package/dist/{index-27jh224p.js → index-8ye22z7k.js} +1 -1
- package/dist/{index-xvm5cdyn.js → index-a7fj661j.js} +1 -1
- package/dist/{index-xjqheg7a.js → index-dj784nyr.js} +1 -1
- package/dist/{index-g3600tpw.js → index-dj8hpkz7.js} +1 -1
- package/dist/{index-590pwxvr.js → index-fhv6ydkq.js} +98 -19
- package/dist/{index-g7984a4r.js → index-gqsfhksw.js} +1 -1
- package/dist/{index-gxk9hcd1.js → index-mrsarsbh.js} +160 -25
- package/dist/index.js +979 -321
- package/dist/{message-index-2damq13v.js → message-index-8rxj3cxh.js} +7 -7
- package/dist/{message-index-bounded-0qa5eacp.js → message-index-bounded-e5bv8gzm.js} +7 -7
- package/dist/{message-time-backfill-05ppypkz.js → message-time-backfill-hmekd2jj.js} +1 -1
- package/dist/migration-worker.js +5 -5
- package/dist/{project-embedding-registry-fzc4eb29.js → project-embedding-registry-z5m4eh3d.js} +5 -5
- package/dist/raw-ordinal-warmup-worker.js +17 -15
- package/dist/{read-session-chunk-q05ztqg5.js → read-session-chunk-sp5adk01.js} +6 -4
- package/dist/{read-session-raw-527m0yxx.js → read-session-raw-s14c7nf3.js} +2 -2
- package/dist/{search-5m0jjf29.js → search-hgfaqytc.js} +13 -13
- package/dist/{sqlite-3yye76ht.js → sqlite-f8kh2n10.js} +1 -1
- package/dist/{storage-memory-1z20y55x.js → storage-memory-yf7r98vz.js} +2 -2
- package/dist/{storage-tags-1b2w0wst.js → storage-tags-0xk95neb.js} +2 -2
- package/dist/subagent-entry.js +16 -16
- package/package.json +1 -1
|
@@ -44,14 +44,19 @@ import {
|
|
|
44
44
|
serializeStrippedPlaceholderState,
|
|
45
45
|
THINKING_BINDING_RECOVERY_FROZEN_PREFIX,
|
|
46
46
|
THINKING_BINDING_STRIP_ORDER_END_MARKER,
|
|
47
|
+
parseProcessedImageMarkers,
|
|
48
|
+
serializeProcessedImageMarkers,
|
|
49
|
+
getPendingPiCompactionMarkerState,
|
|
50
|
+
logPiCompactionMarkerClear,
|
|
47
51
|
withReadOnlySessionDb,
|
|
48
52
|
expandToolPart,
|
|
49
53
|
hasRawMessageProvider2,
|
|
50
54
|
setRawMessageProvider2,
|
|
51
55
|
visitRawSessionMessages2,
|
|
56
|
+
readRawSessionMessageIdOrdinalsForRange2,
|
|
52
57
|
readRawSessionMessageById2,
|
|
53
58
|
readSessionChunk2
|
|
54
|
-
} from "./index-
|
|
59
|
+
} from "./index-fhv6ydkq.js";
|
|
55
60
|
import {
|
|
56
61
|
isRecord,
|
|
57
62
|
providerVisibleMessage,
|
|
@@ -65,7 +70,7 @@ import {
|
|
|
65
70
|
getTagNumberByMessageId2,
|
|
66
71
|
getTagsBySession2,
|
|
67
72
|
getTagById2
|
|
68
|
-
} from "./index-
|
|
73
|
+
} from "./index-6vjj0555.js";
|
|
69
74
|
import {
|
|
70
75
|
estimateTokens
|
|
71
76
|
} from "./index-r56xgha8.js";
|
|
@@ -73,7 +78,7 @@ import {
|
|
|
73
78
|
Database2,
|
|
74
79
|
withSqliteBackgroundWriter2,
|
|
75
80
|
withoutSqliteTransformPass2
|
|
76
|
-
} from "./index-
|
|
81
|
+
} from "./index-7ptxvfc5.js";
|
|
77
82
|
import {
|
|
78
83
|
stableStringify,
|
|
79
84
|
closeQuietly,
|
|
@@ -85,7 +90,7 @@ import {
|
|
|
85
90
|
} from "./index-8976mezv.js";
|
|
86
91
|
import {
|
|
87
92
|
noteRawSessionSummaryRowWritten2
|
|
88
|
-
} from "./index-
|
|
93
|
+
} from "./index-7mm27xdc.js";
|
|
89
94
|
import {
|
|
90
95
|
piHarnessKindFromExecutable,
|
|
91
96
|
isPidAlive
|
|
@@ -97,7 +102,7 @@ import {
|
|
|
97
102
|
clearLkgRecoveryFence,
|
|
98
103
|
deleteSessionScopedRows,
|
|
99
104
|
getLastIndexedOrdinal2
|
|
100
|
-
} from "./index-
|
|
105
|
+
} from "./index-0ww9cgfd.js";
|
|
101
106
|
import {
|
|
102
107
|
SubcClient,
|
|
103
108
|
connectionFileExists,
|
|
@@ -107,10 +112,10 @@ import {
|
|
|
107
112
|
} from "./index-21v1kfs7.js";
|
|
108
113
|
import {
|
|
109
114
|
sameProjectDirectory
|
|
110
|
-
} from "./index-
|
|
115
|
+
} from "./index-34zacc0h.js";
|
|
111
116
|
import {
|
|
112
117
|
getErrorMessage
|
|
113
|
-
} from "./index-
|
|
118
|
+
} from "./index-6q5mx0cz.js";
|
|
114
119
|
import {
|
|
115
120
|
V2_MEMORY_CATEGORIES,
|
|
116
121
|
CATEGORY_PRIORITY,
|
|
@@ -124,13 +129,13 @@ import {
|
|
|
124
129
|
expandWorkspaceIdentitySetWithAliases,
|
|
125
130
|
resolveStoredPathWorkspaceIdentity,
|
|
126
131
|
storedPathBelongsToWorkspace
|
|
127
|
-
} from "./index-
|
|
132
|
+
} from "./index-0eg59y8d.js";
|
|
128
133
|
import {
|
|
129
134
|
directoryHasGitMetadata,
|
|
130
135
|
resolveProjectIdentityForSession,
|
|
131
136
|
normalizeStoredProjectPath,
|
|
132
137
|
storedPathBelongsToIdentity
|
|
133
|
-
} from "./index-
|
|
138
|
+
} from "./index-gqsfhksw.js";
|
|
134
139
|
import {
|
|
135
140
|
drainBackgroundBatches,
|
|
136
141
|
markProjectLoadUntrusted2,
|
|
@@ -142,7 +147,7 @@ import {
|
|
|
142
147
|
unregisterProjectEmbedding2,
|
|
143
148
|
getProjectEmbeddingSnapshot2,
|
|
144
149
|
embedTextForProject2
|
|
145
|
-
} from "./index-
|
|
150
|
+
} from "./index-0d8zqccx.js";
|
|
146
151
|
import {
|
|
147
152
|
getNoteByIdInScope,
|
|
148
153
|
getNotes,
|
|
@@ -153,12 +158,13 @@ import {
|
|
|
153
158
|
updateNote,
|
|
154
159
|
dismissNotes,
|
|
155
160
|
dismissNote,
|
|
161
|
+
withMessageFtsSessionFilter,
|
|
156
162
|
createUnifiedSearchDiagnostics2,
|
|
157
163
|
parseIdShapedQuery2,
|
|
158
164
|
resolveMemoriesByIdsForSearch2,
|
|
159
165
|
unifiedSearch2,
|
|
160
166
|
formatSearchResults2
|
|
161
|
-
} from "./index-
|
|
167
|
+
} from "./index-8jpqq2yk.js";
|
|
162
168
|
import {
|
|
163
169
|
computeCueContentHash,
|
|
164
170
|
getMuralCueState,
|
|
@@ -174,7 +180,7 @@ import {
|
|
|
174
180
|
supersededMemory2,
|
|
175
181
|
mergeMemoryStats2,
|
|
176
182
|
archiveMemory2
|
|
177
|
-
} from "./index-
|
|
183
|
+
} from "./index-dj784nyr.js";
|
|
178
184
|
import {
|
|
179
185
|
saveEmbedding,
|
|
180
186
|
invalidateMemory2
|
|
@@ -183,7 +189,7 @@ import {
|
|
|
183
189
|
isMarkerCandidateBasisCurrent2,
|
|
184
190
|
invalidateMarkerCandidateBasis2,
|
|
185
191
|
readMarkerCandidateBasis2
|
|
186
|
-
} from "./index-
|
|
192
|
+
} from "./index-dj8hpkz7.js";
|
|
187
193
|
import {
|
|
188
194
|
computeNormalizedHash
|
|
189
195
|
} from "./index-9x1f96r8.js";
|
|
@@ -4912,13 +4918,17 @@ async function retryPendingRustSessionCleanupsForProject(db, projectPath, delete
|
|
|
4912
4918
|
function clearSession(db, sessionId, rustModuleCleanupAcknowledged = false, permanentlyDeleted = false) {
|
|
4913
4919
|
cancelAutoSearchWork(sessionId);
|
|
4914
4920
|
let transactionStartedAt = 0;
|
|
4921
|
+
let clearedMarker = null;
|
|
4915
4922
|
withoutSqliteTransformPass2(() => withSqliteBackgroundWriter2(() => db.transaction(() => {
|
|
4916
4923
|
transactionStartedAt = performance.now();
|
|
4924
|
+
clearedMarker = getPendingPiCompactionMarkerState(db, sessionId);
|
|
4917
4925
|
deleteSessionScopedRows(db, [sessionId], undefined, {
|
|
4918
4926
|
rustModuleCleanupAcknowledged,
|
|
4919
4927
|
preserveTagRevisionTombstones: !permanentlyDeleted
|
|
4920
4928
|
});
|
|
4921
4929
|
}).immediate()));
|
|
4930
|
+
if (clearedMarker)
|
|
4931
|
+
logPiCompactionMarkerClear(sessionId, clearedMarker, "session-reset");
|
|
4922
4932
|
clearUnpublishedAutoSearchNoHints(sessionId);
|
|
4923
4933
|
logSlowWriteTransaction("clear-session", transactionStartedAt);
|
|
4924
4934
|
}
|
|
@@ -5701,6 +5711,9 @@ function persistLkgSlot(db, sessionId, slot, publishMetadata) {
|
|
|
5701
5711
|
}
|
|
5702
5712
|
const layout = layoutLkgPrefix(slot.jsonPrefix);
|
|
5703
5713
|
try {
|
|
5714
|
+
const inputIdSeq = JSON.stringify(slot.piOutputEntryIds ? { version: 1, inputIds: slot.inputIdSeq, piOutputEntryIds: slot.piOutputEntryIds } : slot.inputIdSeq);
|
|
5715
|
+
const inputContentDigests = JSON.stringify(slot.inputContentDigests);
|
|
5716
|
+
const inputContentSignatures = slot.inputContentSignatures ? JSON.stringify(slot.inputContentSignatures) : null;
|
|
5704
5717
|
db.transaction(() => {
|
|
5705
5718
|
const storedHashes = new Map;
|
|
5706
5719
|
for (const row of db.prepare("SELECT chunk, hash FROM lkg_slot_chunks WHERE session_id = ?").all(sessionId)) {
|
|
@@ -5732,11 +5745,7 @@ function persistLkgSlot(db, sessionId, slot, publishMetadata) {
|
|
|
5732
5745
|
provider_key = excluded.provider_key,
|
|
5733
5746
|
captured_at = excluded.captured_at,
|
|
5734
5747
|
row_version = excluded.row_version,
|
|
5735
|
-
capture_sequence = excluded.capture_sequence`).run(sessionId, layout.chars, layout.chunks.length, layout.hash,
|
|
5736
|
-
version: 1,
|
|
5737
|
-
inputIds: slot.inputIdSeq,
|
|
5738
|
-
piOutputEntryIds: slot.piOutputEntryIds
|
|
5739
|
-
} : slot.inputIdSeq), JSON.stringify(slot.inputContentDigests), slot.inputContentSignatures ? JSON.stringify(slot.inputContentSignatures) : null, slot.lastInputMessageId, slot.modelKey, slot.providerKey, slot.capturedAt, slot.rowVersion ?? null, slot.captureSequence ?? null);
|
|
5748
|
+
capture_sequence = excluded.capture_sequence`).run(sessionId, layout.chars, layout.chunks.length, layout.hash, inputIdSeq, inputContentDigests, inputContentSignatures, slot.lastInputMessageId, slot.modelKey, slot.providerKey, slot.capturedAt, slot.rowVersion ?? null, slot.captureSequence ?? null);
|
|
5740
5749
|
publishMetadata?.();
|
|
5741
5750
|
}).immediate();
|
|
5742
5751
|
rememberFingerprint(db, sessionId, fingerprint);
|
|
@@ -7234,6 +7243,9 @@ function filterIdBlob(raw, filter) {
|
|
|
7234
7243
|
return "";
|
|
7235
7244
|
}
|
|
7236
7245
|
}
|
|
7246
|
+
function filterProcessedImageBlob(raw, filter) {
|
|
7247
|
+
return serializeProcessedImageMarkers(new Map([...parseProcessedImageMarkers(raw)].filter(([id]) => filter.includeMessageId(id)).map(([id, marker]) => [mapMessageId(filter, id) ?? id, marker])));
|
|
7248
|
+
}
|
|
7237
7249
|
function filterStrippedPlaceholderBlob(raw, filter) {
|
|
7238
7250
|
const state = parseStrippedPlaceholderState(raw);
|
|
7239
7251
|
const keep = (ids) => ids.filter((id) => filter.includeMessageId(id)).map((id) => mapMessageId(filter, id) ?? id);
|
|
@@ -7315,7 +7327,8 @@ function clampWatermark(value, maxCopiedTag) {
|
|
|
7315
7327
|
return Math.min(Math.floor(value), maxCopiedTag);
|
|
7316
7328
|
}
|
|
7317
7329
|
function copySessionStateForClone(db, sourceSessionId, destinationSessionId, filter) {
|
|
7318
|
-
|
|
7330
|
+
let clearedMarker = null;
|
|
7331
|
+
const result = runImmediate(db, () => {
|
|
7319
7332
|
const hasTemporalDecisions = tableExists(db, "temporal_decisions");
|
|
7320
7333
|
if (filter.requireEmptyDestinationMeta === true && countRows(db, "session_meta", destinationSessionId) > 0 || countRows(db, "compartments", destinationSessionId) > 0 || countRows(db, "tags", destinationSessionId) > 0 || hasTemporalDecisions && countRows(db, "temporal_decisions", destinationSessionId) > 0 || filter.copySessionNotesAndFacts === true && (tableExists(db, "notes") && countRows(db, "notes", destinationSessionId) > 0 || tableExists(db, "session_facts") && countRows(db, "session_facts", destinationSessionId) > 0)) {
|
|
7321
7334
|
return {
|
|
@@ -7427,6 +7440,8 @@ function copySessionStateForClone(db, sourceSessionId, destinationSessionId, fil
|
|
|
7427
7440
|
FROM session_meta WHERE session_id = ?`).get(sourceSessionId);
|
|
7428
7441
|
const maxCopiedTag = copiedTagNumbers.reduce((max, value) => Math.max(max, value), 0);
|
|
7429
7442
|
const pendingMarker = filter.selectPendingPiMarker(meta?.pending_pi_compaction_marker_state ?? null, copiedCompartments);
|
|
7443
|
+
if (pendingMarker === null)
|
|
7444
|
+
clearedMarker = getPendingPiCompactionMarkerState(db, destinationSessionId);
|
|
7430
7445
|
const todoAnchor = meta?.todo_synthetic_anchor_message_id ?? "";
|
|
7431
7446
|
const migrateTodo = todoAnchor.length > 0 && filter.includeMessageId(todoAnchor);
|
|
7432
7447
|
db.prepare(`INSERT INTO session_meta
|
|
@@ -7453,7 +7468,7 @@ function copySessionStateForClone(db, sourceSessionId, destinationSessionId, fil
|
|
|
7453
7468
|
todo_synthetic_anchor_message_id = excluded.todo_synthetic_anchor_message_id,
|
|
7454
7469
|
todo_synthetic_state_json = excluded.todo_synthetic_state_json,
|
|
7455
7470
|
cached_m0_bytes = NULL,
|
|
7456
|
-
cached_m1_bytes = NULL`).run(destinationSessionId, getHarness2(), maxCopiedTag, clampWatermark(meta?.cleared_reasoning_through_tag ?? null, maxCopiedTag), clampWatermark(meta?.tool_reclaim_watermark ?? null, maxCopiedTag), typeof meta?.pi_stable_id_scheme === "number" && Number.isFinite(meta.pi_stable_id_scheme) ? meta.pi_stable_id_scheme : null, filterStrippedPlaceholderBlob(meta?.stripped_placeholder_ids ?? null, filter), filterIdBlob(meta?.stale_reduce_stripped_ids ?? null, filter),
|
|
7471
|
+
cached_m1_bytes = NULL`).run(destinationSessionId, getHarness2(), maxCopiedTag, clampWatermark(meta?.cleared_reasoning_through_tag ?? null, maxCopiedTag), clampWatermark(meta?.tool_reclaim_watermark ?? null, maxCopiedTag), typeof meta?.pi_stable_id_scheme === "number" && Number.isFinite(meta.pi_stable_id_scheme) ? meta.pi_stable_id_scheme : null, filterStrippedPlaceholderBlob(meta?.stripped_placeholder_ids ?? null, filter), filterIdBlob(meta?.stale_reduce_stripped_ids ?? null, filter), filterProcessedImageBlob(meta?.processed_image_stripped_ids ?? null, filter), clonePiContentDecisions(meta?.merged_reasoning_stripped_ids ?? null, filter), pendingMarker, migrateTodo ? meta?.last_todo_state ?? "" : "", migrateTodo ? meta?.todo_synthetic_call_id ?? "" : "", migrateTodo ? mapMessageId(filter, todoAnchor) ?? "" : "", migrateTodo ? meta?.todo_synthetic_state_json ?? "" : "");
|
|
7457
7472
|
const metaColumnRows = db.prepare("PRAGMA table_info(session_meta)").all();
|
|
7458
7473
|
const metaColumns = new Set(metaColumnRows.map((column) => column.name));
|
|
7459
7474
|
if (metaColumns.has("trailing_blank_decisions")) {
|
|
@@ -7471,6 +7486,9 @@ function copySessionStateForClone(db, sourceSessionId, destinationSessionId, fil
|
|
|
7471
7486
|
pendingMarkerMigrated: pendingMarker !== null
|
|
7472
7487
|
};
|
|
7473
7488
|
});
|
|
7489
|
+
if (clearedMarker)
|
|
7490
|
+
logPiCompactionMarkerClear(destinationSessionId, clearedMarker, "clone-replaced");
|
|
7491
|
+
return result;
|
|
7474
7492
|
}
|
|
7475
7493
|
// ../plugin/src/features/magic-context/historian-failure-reason.ts
|
|
7476
7494
|
var MAX_HISTORIAN_FAILURE_REASON_LENGTH = 512;
|
|
@@ -8262,7 +8280,47 @@ function unreachablePiOrdinalSlot(ordinal) {
|
|
|
8262
8280
|
});
|
|
8263
8281
|
return slot;
|
|
8264
8282
|
}
|
|
8283
|
+
var READ_ENTRY = Symbol("read Pi entry");
|
|
8284
|
+
var END_ENTRIES = Symbol("end Pi entries");
|
|
8265
8285
|
function* iterateEntriesToRawMessageRange(entries, afterOrdinal, limit, finalWatermark, ordinalOffset = 0) {
|
|
8286
|
+
const input = entries[Symbol.iterator]();
|
|
8287
|
+
const converter = convertEntryStream(afterOrdinal, limit, finalWatermark, ordinalOffset);
|
|
8288
|
+
let next;
|
|
8289
|
+
try {
|
|
8290
|
+
while (true) {
|
|
8291
|
+
const step = converter.next(next);
|
|
8292
|
+
if (step.done)
|
|
8293
|
+
return;
|
|
8294
|
+
if (step.value === READ_ENTRY) {
|
|
8295
|
+
const entry = input.next();
|
|
8296
|
+
next = entry.done ? END_ENTRIES : entry.value;
|
|
8297
|
+
} else
|
|
8298
|
+
yield step.value;
|
|
8299
|
+
}
|
|
8300
|
+
} finally {
|
|
8301
|
+
input.return?.();
|
|
8302
|
+
}
|
|
8303
|
+
}
|
|
8304
|
+
async function* iterateAsyncEntriesToRawMessageRange(entries, afterOrdinal, limit, finalWatermark) {
|
|
8305
|
+
const input = entries[Symbol.asyncIterator]();
|
|
8306
|
+
const converter = convertEntryStream(afterOrdinal, limit, finalWatermark, 0);
|
|
8307
|
+
let next;
|
|
8308
|
+
try {
|
|
8309
|
+
while (true) {
|
|
8310
|
+
const step = converter.next(next);
|
|
8311
|
+
if (step.done)
|
|
8312
|
+
return;
|
|
8313
|
+
if (step.value === READ_ENTRY) {
|
|
8314
|
+
const entry = await input.next();
|
|
8315
|
+
next = entry.done ? END_ENTRIES : entry.value;
|
|
8316
|
+
} else
|
|
8317
|
+
yield step.value;
|
|
8318
|
+
}
|
|
8319
|
+
} finally {
|
|
8320
|
+
await input.return?.();
|
|
8321
|
+
}
|
|
8322
|
+
}
|
|
8323
|
+
function* convertEntryStream(afterOrdinal, limit, finalWatermark, ordinalOffset = 0) {
|
|
8266
8324
|
let emitted = 0;
|
|
8267
8325
|
const normalizedAfter = Math.max(0, Math.floor(afterOrdinal));
|
|
8268
8326
|
const normalizedLimit = Math.max(1, Math.floor(limit));
|
|
@@ -8299,7 +8357,10 @@ function* iterateEntriesToRawMessageRange(entries, afterOrdinal, limit, finalWat
|
|
|
8299
8357
|
}
|
|
8300
8358
|
return emitted >= normalizedLimit || nextOrdinal > normalizedWatermark;
|
|
8301
8359
|
};
|
|
8302
|
-
|
|
8360
|
+
while (true) {
|
|
8361
|
+
const entry = yield READ_ENTRY;
|
|
8362
|
+
if (entry === END_ENTRIES)
|
|
8363
|
+
break;
|
|
8303
8364
|
if (!isMessageEntry(entry))
|
|
8304
8365
|
continue;
|
|
8305
8366
|
const msg = entry.message;
|
|
@@ -9788,7 +9849,7 @@ function resolveMuralWire(db, projectIdentity, modelKey, enabled, budgetTokens =
|
|
|
9788
9849
|
|
|
9789
9850
|
// ../plugin/src/features/magic-context/compaction-marker.ts
|
|
9790
9851
|
import { createHash as createHash7 } from "node:crypto";
|
|
9791
|
-
import { existsSync as existsSync6 } from "node:fs";
|
|
9852
|
+
import { existsSync as existsSync6, statSync as statSync6 } from "node:fs";
|
|
9792
9853
|
var BASE62_CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
|
9793
9854
|
var ID_PREFIX_HEX_LENGTH = 12;
|
|
9794
9855
|
var ID_SUFFIX_LENGTH = 14;
|
|
@@ -9823,6 +9884,7 @@ var MARKER_REMOVAL_BUSY_TIMEOUT_MS = 5000;
|
|
|
9823
9884
|
function runMarkerWriteTransaction(db, site, operation) {
|
|
9824
9885
|
if (db.inTransaction)
|
|
9825
9886
|
return db.transaction(operation).immediate();
|
|
9887
|
+
const walBefore = markerWalPages(db);
|
|
9826
9888
|
const startedAt = performance.now();
|
|
9827
9889
|
let acquiredAt;
|
|
9828
9890
|
let workFinishedAt;
|
|
@@ -9846,9 +9908,22 @@ function runMarkerWriteTransaction(db, site, operation) {
|
|
|
9846
9908
|
const endMs = workFinishedAt === undefined ? 0 : finishedAt - workFinishedAt;
|
|
9847
9909
|
try {
|
|
9848
9910
|
log2(`[magic-context] sqlite writer site=${site} db=opencode acquire_ms=${Math.round(acquireMs)} hold_ms=${Math.round(holdMs)} work_ms=${Math.round(workMs)} end_ms=${Math.round(endMs)} outcome=${acquiredAt === undefined ? "not_acquired" : committed ? "committed" : "failed"}`);
|
|
9911
|
+
if (finishedAt - startedAt > 100) {
|
|
9912
|
+
const autoCheckpoint = db.prepare("PRAGMA wal_autocheckpoint").get();
|
|
9913
|
+
log2(`[magic-context] compaction-marker slow writer site=${site} acquire_ms=${acquireMs.toFixed(1)} statements_ms=${workMs.toFixed(1)} ${committed ? "commit" : "rollback"}_ms=${endMs.toFixed(1)} wal_autocheckpoint=${autoCheckpoint.wal_autocheckpoint} wal_pages_before=${walBefore ?? "unknown"} wal_pages_after=${markerWalPages(db) ?? "unknown"}`);
|
|
9914
|
+
}
|
|
9849
9915
|
} catch {}
|
|
9850
9916
|
}
|
|
9851
9917
|
}
|
|
9918
|
+
function markerWalPages(db) {
|
|
9919
|
+
try {
|
|
9920
|
+
const row = db.prepare("PRAGMA page_size").get();
|
|
9921
|
+
const bytes = statSync6(`${getOpenCodeDbPath()}-wal`).size;
|
|
9922
|
+
return Math.max(0, Math.floor((bytes - 32) / (row.page_size + 24)));
|
|
9923
|
+
} catch {
|
|
9924
|
+
return null;
|
|
9925
|
+
}
|
|
9926
|
+
}
|
|
9852
9927
|
var REQUIRED_MESSAGE_COLUMNS = ["id", "session_id", "time_created", "time_updated", "data"];
|
|
9853
9928
|
var REQUIRED_PART_COLUMNS = [
|
|
9854
9929
|
"id",
|
|
@@ -9909,6 +9984,7 @@ function getWritableOpenCodeDb(purpose = "publication") {
|
|
|
9909
9984
|
const timeoutMs = purpose === "removal" ? MARKER_REMOVAL_BUSY_TIMEOUT_MS : MARKER_BUSY_TIMEOUT_MS;
|
|
9910
9985
|
db.exec(`PRAGMA busy_timeout=${timeoutMs}`);
|
|
9911
9986
|
db.exec("PRAGMA journal_mode=WAL");
|
|
9987
|
+
db.exec("PRAGMA wal_autocheckpoint=0");
|
|
9912
9988
|
if (purpose === "removal")
|
|
9913
9989
|
cachedRemovalDb = { path: dbPath, db };
|
|
9914
9990
|
else
|
|
@@ -11028,7 +11104,7 @@ async function wakePlaneStatus() {
|
|
|
11028
11104
|
}
|
|
11029
11105
|
|
|
11030
11106
|
// src/embedding-bootstrap.ts
|
|
11031
|
-
import { statSync as
|
|
11107
|
+
import { statSync as statSync7 } from "node:fs";
|
|
11032
11108
|
|
|
11033
11109
|
// ../plugin/src/plugin/embedding-bootstrap-helpers.ts
|
|
11034
11110
|
import { createHash as createHash8 } from "node:crypto";
|
|
@@ -11740,7 +11816,7 @@ function configCandidatePaths(directory, loadedPaths) {
|
|
|
11740
11816
|
function configFingerprint(paths) {
|
|
11741
11817
|
return paths.map((path) => {
|
|
11742
11818
|
try {
|
|
11743
|
-
const stat =
|
|
11819
|
+
const stat = statSync7(path);
|
|
11744
11820
|
return `${path}:${stat.size}:${stat.mtimeMs}`;
|
|
11745
11821
|
} catch {
|
|
11746
11822
|
return `${path}:missing`;
|
|
@@ -12560,6 +12636,56 @@ function renderItemByTag(db, sessionId, number, textIndexDomain = "part") {
|
|
|
12560
12636
|
return selected ? renderPartFull(selected) ?? "" : `Tag ${number}'s original text part is no longer in stored history.`;
|
|
12561
12637
|
}
|
|
12562
12638
|
|
|
12639
|
+
// ../plugin/src/tools/ctx-expand/search-archive.ts
|
|
12640
|
+
function renderSearchArchive(db, sessionId, start, end, tokenBudget, archiveOnly = false) {
|
|
12641
|
+
return withMessageFtsSessionFilter(db, sessionId, (sessionFirst) => {
|
|
12642
|
+
let rawIds;
|
|
12643
|
+
const rows = db.prepare(sessionFirst ? `SELECT f.message_ordinal AS ordinal, f.message_id AS id, f.role, f.content
|
|
12644
|
+
FROM message_fts_rowid_map AS m
|
|
12645
|
+
JOIN message_history_fts AS f ON f.rowid = m.fts_rowid
|
|
12646
|
+
WHERE m.session_id = ?1 AND m.message_ordinal BETWEEN ?2 AND ?3
|
|
12647
|
+
AND f.session_id = ?1 AND f.message_ordinal BETWEEN ?2 AND ?3
|
|
12648
|
+
ORDER BY m.message_ordinal` : `SELECT message_ordinal AS ordinal, message_id AS id, role, content
|
|
12649
|
+
FROM message_history_fts
|
|
12650
|
+
WHERE session_id = ?1 AND message_ordinal BETWEEN ?2 AND ?3
|
|
12651
|
+
ORDER BY CAST(message_ordinal AS INTEGER)`);
|
|
12652
|
+
const blocks = [];
|
|
12653
|
+
let tokens = 0;
|
|
12654
|
+
let lastOrdinal = start - 1;
|
|
12655
|
+
let truncated = false;
|
|
12656
|
+
for (const row of rows.iterate(sessionId, start, end)) {
|
|
12657
|
+
if (!row.content)
|
|
12658
|
+
continue;
|
|
12659
|
+
if (!archiveOnly) {
|
|
12660
|
+
rawIds ??= readRawSessionMessageIdOrdinalsForRange2(sessionId, start, end);
|
|
12661
|
+
if (rawIds.get(row.id) === row.ordinal)
|
|
12662
|
+
continue;
|
|
12663
|
+
}
|
|
12664
|
+
const block = `[${row.ordinal}] ${row.role === "user" ? "U" : "A"}: ${row.content}`;
|
|
12665
|
+
const cost = estimateTokens(block);
|
|
12666
|
+
if (blocks.length > 0 && tokens + cost > tokenBudget) {
|
|
12667
|
+
truncated = true;
|
|
12668
|
+
break;
|
|
12669
|
+
}
|
|
12670
|
+
blocks.push(block);
|
|
12671
|
+
tokens += cost;
|
|
12672
|
+
lastOrdinal = row.ordinal;
|
|
12673
|
+
}
|
|
12674
|
+
if (blocks.length === 0)
|
|
12675
|
+
return null;
|
|
12676
|
+
const text = [
|
|
12677
|
+
"From the search archive: indexed text only; no surrounding messages or tool output.",
|
|
12678
|
+
"",
|
|
12679
|
+
...blocks
|
|
12680
|
+
];
|
|
12681
|
+
if (truncated) {
|
|
12682
|
+
text.push("", `Truncated at message ${lastOrdinal} (budget: ~${tokenBudget} tokens). Call ctx_expand(start=${lastOrdinal + 1}, end=${end}) for more archived text.`);
|
|
12683
|
+
}
|
|
12684
|
+
return text.join(`
|
|
12685
|
+
`);
|
|
12686
|
+
});
|
|
12687
|
+
}
|
|
12688
|
+
|
|
12563
12689
|
// ../plugin/src/tools/unwrap-imitated-reduced-args.ts
|
|
12564
12690
|
var MAX_DECODED_STRING_LENGTH = 1024 * 1024;
|
|
12565
12691
|
var MAX_DECODED_ARRAY_ITEMS = 100;
|
|
@@ -13004,11 +13130,17 @@ function createCtxExpandTool(deps) {
|
|
|
13004
13130
|
}
|
|
13005
13131
|
const alignment = resolvePiOrdinalAlignmentForContext(deps.db, sessionId, ctx);
|
|
13006
13132
|
if (isPiOrdinalAlignmentUnanchored(alignment)) {
|
|
13133
|
+
const archived = renderSearchArchive(deps.db, sessionId, mode.kind === "message" ? mode.message : mode.start, mode.kind === "message" ? mode.message : mode.end, CTX_EXPAND_TOKEN_BUDGET, true);
|
|
13134
|
+
if (archived)
|
|
13135
|
+
return ok(archived);
|
|
13007
13136
|
return err("This session's history numbering can't be verified right now, so message ordinals can't be expanded. Tags (ctx_expand tag=N) still work.");
|
|
13008
13137
|
}
|
|
13009
13138
|
const lostThrough = alignment.offset;
|
|
13010
13139
|
const firstAvailable = lostThrough + 1;
|
|
13011
13140
|
if (mode.kind === "message") {
|
|
13141
|
+
const archived = renderSearchArchive(deps.db, sessionId, mode.message, mode.message, CTX_EXPAND_TOKEN_BUDGET);
|
|
13142
|
+
if (archived)
|
|
13143
|
+
return ok(archived);
|
|
13012
13144
|
if (mode.message <= lostThrough) {
|
|
13013
13145
|
return ok(`No message at ordinal ${mode.message}: it is no longer in this session's history, which now starts at message ${firstAvailable}.`);
|
|
13014
13146
|
}
|
|
@@ -13021,6 +13153,9 @@ function createCtxExpandTool(deps) {
|
|
|
13021
13153
|
return ok(`Range ${requestedStart}-${end} is entirely within the live tail (after the last compacted message ${lastCompartmentEnd}); those messages are already visible in context.`);
|
|
13022
13154
|
}
|
|
13023
13155
|
const effectiveEnd = lastCompartmentEnd >= 0 ? Math.min(end, lastCompartmentEnd) : end;
|
|
13156
|
+
const archived = renderSearchArchive(deps.db, sessionId, requestedStart, effectiveEnd, CTX_EXPAND_TOKEN_BUDGET);
|
|
13157
|
+
if (archived)
|
|
13158
|
+
return ok(archived);
|
|
13024
13159
|
if (effectiveEnd <= lostThrough) {
|
|
13025
13160
|
return ok(`No messages found in range ${requestedStart}-${effectiveEnd}: those messages are no longer in this session's history, which now starts at message ${firstAvailable}.`);
|
|
13026
13161
|
}
|
|
@@ -15405,4 +15540,4 @@ function registerMagicContextTools(pi, opts) {
|
|
|
15405
15540
|
}
|
|
15406
15541
|
}
|
|
15407
15542
|
|
|
15408
|
-
export { COMPACTION_ENABLED_PATH, isDreamerRunnable, isCompactionEnabled, formatConfigParseStatusLine, formatConfigParseNotice, claimConfigParseFailuresOnce, parseJsoncRecovering, detectConfigFile, MIN_PLAUSIBLE_CONTEXT_LIMIT, catalogOutputReserve, deriveWindowGeometry, hasTrustedAbsoluteWall, applyProvenInputFloor, formatWindowDerivationLine, formatWindowSource, isSaneLimit, resolveOutputReserve, getSdkWindowGeometry, getSdkContextLimit, getSdkOutputLimit, getSdkInputLimit, cortexKitUserConfigBasePath, cortexKitProjectConfigBasePath, migrateMagicContextConfigLocations, getProtectedTokensTierOverrides, rememberUnpublishedAutoSearchNoHint, getUnpublishedAutoSearchNoHint, forgetUnpublishedAutoSearchNoHint, registerAutoSearchWork, cancelAutoSearchWork, readSessionMeta, getOrCreateSessionMeta, updateSessionMeta, advanceToolReclaimWatermark, retryPendingSessionCleanups, retryPendingRustSessionCleanupsForProject, embedPauseBySession, embedRunStateBySession, autoEmbedAttemptedBySession, autoEmbedIdentityBySession, invalidateAutoEmbedSession, getEmbedDrainUiStatus, COMPARTMENT_LEASE_RENEWAL_MS, acquireCompartmentLease, renewCompartmentLease, releaseCompartmentLease, releaseCompartmentLeaseBestEffort, isCompartmentLeaseHeld, isNoContentCompartment, HAS_COMPARTMENT_CONTENT_SQL, queueM0Mutation, getMaxM0MutationId, getCompartments, getLastCompartmentEndMessage, getLastCompartmentEndMessageId, getCompartmentsByEndMessageId, appendCompartments, saveRecompStagingPass, getRecompStaging, clearRecompStaging, getRecompPartialRange, setRecompPartialRange, escapeXmlAttr, escapeXmlContent, getUncoveredCompartmentEndThrough, isPartialCompartmentEnd, readProjectDocsCanonical, providerResponseFailed, isSuccessfulProviderCompletion, requestPendingMaterialization, pendingMaterializationOrigin, clearPendingMaterialization, recordSystemRefreshOwnership, recordSystemPromptForRequest, recordHeldHeadForRequest, bindSystemPromptResponse, acknowledgeSystemPromptDelivery, deferDeliveredSystemRefresh, clearSystemPromptDelivery, saveLkgSlotToDb, loadPersistedLkgSlot, drainStaleLkgSlots, createDbLkgPersistence, replayLkg, registerLkgPersistence, LKG_SNAPSHOT_ARRAY, LKG_SNAPSHOT_OBJECT, LKG_SNAPSHOT_KEY, LKG_SNAPSHOT_STRING, LKG_SNAPSHOT_NUMBER, LKG_SNAPSHOT_BOOLEAN, LKG_SNAPSHOT_NULL, LKG_SNAPSHOT_UNDEFINED, contentSnapshotValue, signatureForFields, lkgContentFields, lkgContentDigestFromFields, isLegacyLkgDigest, legacyLkgDigestFromFields, lkgFieldsMatchDigest, exactReusablePrefix, incrementalLkgContentDigests, lkgSlotRejection, captureSlot, getInMemorySlot, getSlot, dropSlot, TOOL_SWEEP_SCOPED_MARKER, encodePiContentDecision, decodePiContentDecision, getPiContentDecisions, freezePiContentDecision, getNativeReplayState, saveNativeToolInputs, addNativeReasoningIds, copySessionStateForClone, externalHistorianFailureReason, subprocessExitHistorianFailureReason, countHistorianRuns, recordHistorianRun, summarizeImportance, tallyFactsByCategory, queueMemoryMutation, getMemoryMutationsForRender, getMemoryMutationsForRenderByProjects, getMaxMemoryMutationId, getMaxMemoryMutationIdForProjects, GLOBAL_USER_PROFILE_PROJECT_PATH, getProjectState, bumpProjectUserProfileVersion, saveSourceContent, getSourceContents, recordSubagentInvocation, getLatestHistorianInvocationId, noteTouchedAt, noteNudgePickIndex, formatNoteNudge, promptSurfaceHashMaterial, createPromptSurfaceRuntime, createPromptSurfaceGuidanceEpochCache, SYNTH_USER_ID_PREFIX, resolvePiStableId, resolvePiRealStableId, isPiContentFallbackId, isPiIndexFallbackId, piContentFallbackIds, readPiSessionSnapshot, readPiSessionMessages, readPiSessionMessagePage, findRestartModelSeedFromBranch, iterateEntriesToRawMessageRange, convertEntriesToRawMessages, convertPiAssistantEntryById, convertEntriesToRawMessagePage, countPiRawMessages, USER_MEMORY_CANDIDATE_TTL_MS, insertUserMemoryCandidates, getUserMemoryCandidates, deleteUserMemoryCandidates, pruneExpiredUserMemoryCandidates, insertUserMemory, getActiveUserMemories, updateUserMemoryContent, dismissUserMemory, getTaskScheduleState, getFailingDreamTasks, getSkippedDreamTasks, getMostRecentTaskRunAt, pruneNonCanonicalTaskRows, deleteTaskScheduleRowsForProject, seedTaskScheduleState, writeTaskScheduleState, isRetrospectiveWindowProcessed, recordRetrospectiveWindowProcessed, curateCategoryForMemoryCategory, peekCurateCategoryScope, beginCurateCategoryRun, curateTaskStateAfterSuccess, MEMORY_MURAL_BLOCK, buildMagicContextSection, resolveMuralWire, updateCompactionMarkerAfterPublication, COMPARTMENT_RENDER_EPOCH, MEMORY_RENDER_FORMAT_EPOCH, encodeCachedM0UpgradeIdentity, decodeCachedM0UpgradeIdentity, withCachedM0MemoryIds, readCachedM0MemoryIds, renderBudgetIdentityChanged, renderedBudgetSnapshot, renderedBudgetShrinkReason, DEFAULT_HISTORY_BUDGET_TOKENS, renderCompartmentAtTier, renderDecayedCompartments, extractM0Block, TEMPORAL_MARKER_PATTERN, TEMPORAL_MARKER_REPLAY_PATTERN, temporalMarkerPrefix, renderUserProfileContent, clearInjectionCache, getVisibleMemoryIds, orderHistorianMemories, renderHistorianMemoryBlock, DEFAULT_MEMORY_BUDGET_TOKENS, DEFAULT_USER_PROFILE_BUDGET_TOKENS, trimMemoriesToBudgetV2, trimWorkspaceMemoriesToBudgetV2, trimUserMemoriesToBudget, renderMemoryBlockV2, stripMemoryMuralBlock, resetPrefixTrimFallbackState, isDirectiveShapedProjectRule, takeCurateSafetyRefusalCount, wakePlaneStatus, loadPiConfig, loadPiConfigDetailed, unregisterPiProjectEmbeddings, ensureProjectRegisteredFromPiDirectory, resolvePiHarnessDetection, resolvePiHarnessKind, resolvePiOrdinalAlignment, piRawOrdinalOffsetSource, resolvePiOrdinalAlignmentForContext, isPiOrdinalAlignmentUnanchored, clearPiOrdinalAlignmentSession, rememberTodowriteToolCallTodos, parseTodos, setTodoSnapshot, registerTodoOverlay, registerTodoStateLifecycle, syncCtxMemoryToolEnabled, registerMagicContextTools };
|
|
15543
|
+
export { COMPACTION_ENABLED_PATH, isDreamerRunnable, isCompactionEnabled, formatConfigParseStatusLine, formatConfigParseNotice, claimConfigParseFailuresOnce, parseJsoncRecovering, detectConfigFile, MIN_PLAUSIBLE_CONTEXT_LIMIT, catalogOutputReserve, deriveWindowGeometry, hasTrustedAbsoluteWall, applyProvenInputFloor, formatWindowDerivationLine, formatWindowSource, isSaneLimit, resolveOutputReserve, getSdkWindowGeometry, getSdkContextLimit, getSdkOutputLimit, getSdkInputLimit, cortexKitUserConfigBasePath, cortexKitProjectConfigBasePath, migrateMagicContextConfigLocations, getProtectedTokensTierOverrides, rememberUnpublishedAutoSearchNoHint, getUnpublishedAutoSearchNoHint, forgetUnpublishedAutoSearchNoHint, registerAutoSearchWork, cancelAutoSearchWork, readSessionMeta, getOrCreateSessionMeta, updateSessionMeta, advanceToolReclaimWatermark, retryPendingSessionCleanups, retryPendingRustSessionCleanupsForProject, embedPauseBySession, embedRunStateBySession, autoEmbedAttemptedBySession, autoEmbedIdentityBySession, invalidateAutoEmbedSession, getEmbedDrainUiStatus, COMPARTMENT_LEASE_RENEWAL_MS, acquireCompartmentLease, renewCompartmentLease, releaseCompartmentLease, releaseCompartmentLeaseBestEffort, isCompartmentLeaseHeld, isNoContentCompartment, HAS_COMPARTMENT_CONTENT_SQL, queueM0Mutation, getMaxM0MutationId, getCompartments, getLastCompartmentEndMessage, getLastCompartmentEndMessageId, getCompartmentsByEndMessageId, appendCompartments, saveRecompStagingPass, getRecompStaging, clearRecompStaging, getRecompPartialRange, setRecompPartialRange, escapeXmlAttr, escapeXmlContent, getUncoveredCompartmentEndThrough, isPartialCompartmentEnd, readProjectDocsCanonical, providerResponseFailed, isSuccessfulProviderCompletion, requestPendingMaterialization, pendingMaterializationOrigin, clearPendingMaterialization, recordSystemRefreshOwnership, recordSystemPromptForRequest, recordHeldHeadForRequest, bindSystemPromptResponse, acknowledgeSystemPromptDelivery, deferDeliveredSystemRefresh, clearSystemPromptDelivery, saveLkgSlotToDb, loadPersistedLkgSlot, drainStaleLkgSlots, createDbLkgPersistence, replayLkg, registerLkgPersistence, LKG_SNAPSHOT_ARRAY, LKG_SNAPSHOT_OBJECT, LKG_SNAPSHOT_KEY, LKG_SNAPSHOT_STRING, LKG_SNAPSHOT_NUMBER, LKG_SNAPSHOT_BOOLEAN, LKG_SNAPSHOT_NULL, LKG_SNAPSHOT_UNDEFINED, contentSnapshotValue, signatureForFields, lkgContentFields, lkgContentDigestFromFields, isLegacyLkgDigest, legacyLkgDigestFromFields, lkgFieldsMatchDigest, exactReusablePrefix, incrementalLkgContentDigests, lkgSlotRejection, captureSlot, getInMemorySlot, getSlot, dropSlot, TOOL_SWEEP_SCOPED_MARKER, encodePiContentDecision, decodePiContentDecision, getPiContentDecisions, freezePiContentDecision, getNativeReplayState, saveNativeToolInputs, addNativeReasoningIds, copySessionStateForClone, externalHistorianFailureReason, subprocessExitHistorianFailureReason, countHistorianRuns, recordHistorianRun, summarizeImportance, tallyFactsByCategory, queueMemoryMutation, getMemoryMutationsForRender, getMemoryMutationsForRenderByProjects, getMaxMemoryMutationId, getMaxMemoryMutationIdForProjects, GLOBAL_USER_PROFILE_PROJECT_PATH, getProjectState, bumpProjectUserProfileVersion, saveSourceContent, getSourceContents, recordSubagentInvocation, getLatestHistorianInvocationId, noteTouchedAt, noteNudgePickIndex, formatNoteNudge, promptSurfaceHashMaterial, createPromptSurfaceRuntime, createPromptSurfaceGuidanceEpochCache, SYNTH_USER_ID_PREFIX, resolvePiStableId, resolvePiRealStableId, isPiContentFallbackId, isPiIndexFallbackId, piContentFallbackIds, readPiSessionSnapshot, readPiSessionMessages, readPiSessionMessagePage, findRestartModelSeedFromBranch, iterateEntriesToRawMessageRange, iterateAsyncEntriesToRawMessageRange, convertEntriesToRawMessages, convertPiAssistantEntryById, convertEntriesToRawMessagePage, countPiRawMessages, USER_MEMORY_CANDIDATE_TTL_MS, insertUserMemoryCandidates, getUserMemoryCandidates, deleteUserMemoryCandidates, pruneExpiredUserMemoryCandidates, insertUserMemory, getActiveUserMemories, updateUserMemoryContent, dismissUserMemory, getTaskScheduleState, getFailingDreamTasks, getSkippedDreamTasks, getMostRecentTaskRunAt, pruneNonCanonicalTaskRows, deleteTaskScheduleRowsForProject, seedTaskScheduleState, writeTaskScheduleState, isRetrospectiveWindowProcessed, recordRetrospectiveWindowProcessed, curateCategoryForMemoryCategory, peekCurateCategoryScope, beginCurateCategoryRun, curateTaskStateAfterSuccess, MEMORY_MURAL_BLOCK, buildMagicContextSection, resolveMuralWire, updateCompactionMarkerAfterPublication, COMPARTMENT_RENDER_EPOCH, MEMORY_RENDER_FORMAT_EPOCH, encodeCachedM0UpgradeIdentity, decodeCachedM0UpgradeIdentity, withCachedM0MemoryIds, readCachedM0MemoryIds, renderBudgetIdentityChanged, renderedBudgetSnapshot, renderedBudgetShrinkReason, DEFAULT_HISTORY_BUDGET_TOKENS, renderCompartmentAtTier, renderDecayedCompartments, extractM0Block, TEMPORAL_MARKER_PATTERN, TEMPORAL_MARKER_REPLAY_PATTERN, temporalMarkerPrefix, renderUserProfileContent, clearInjectionCache, getVisibleMemoryIds, orderHistorianMemories, renderHistorianMemoryBlock, DEFAULT_MEMORY_BUDGET_TOKENS, DEFAULT_USER_PROFILE_BUDGET_TOKENS, trimMemoriesToBudgetV2, trimWorkspaceMemoriesToBudgetV2, trimUserMemoriesToBudget, renderMemoryBlockV2, stripMemoryMuralBlock, resetPrefixTrimFallbackState, isDirectiveShapedProjectRule, takeCurateSafetyRefusalCount, wakePlaneStatus, loadPiConfig, loadPiConfigDetailed, unregisterPiProjectEmbeddings, ensureProjectRegisteredFromPiDirectory, resolvePiHarnessDetection, resolvePiHarnessKind, resolvePiOrdinalAlignment, piRawOrdinalOffsetSource, resolvePiOrdinalAlignmentForContext, isPiOrdinalAlignmentUnanchored, clearPiOrdinalAlignmentSession, rememberTodowriteToolCallTodos, parseTodos, setTodoSnapshot, registerTodoOverlay, registerTodoStateLifecycle, syncCtxMemoryToolEnabled, registerMagicContextTools };
|