@cortexkit/opencode-magic-context 0.34.1 → 0.34.2
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/features/magic-context/dreamer/storage-task-schedule.d.ts +9 -5
- package/dist/features/magic-context/dreamer/storage-task-schedule.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-executor.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-gates.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/verify-gate.d.ts +8 -2
- package/dist/features/magic-context/dreamer/verify-gate.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/verify.d.ts +2 -0
- package/dist/features/magic-context/dreamer/verify.d.ts.map +1 -1
- package/dist/features/magic-context/fail-closed-block.d.ts +2 -0
- package/dist/features/magic-context/fail-closed-block.d.ts.map +1 -1
- package/dist/features/magic-context/memory/storage-memory.d.ts.map +1 -1
- package/dist/features/magic-context/migrations.d.ts.map +1 -1
- package/dist/features/magic-context/mural/compress-cues.d.ts +7 -3
- package/dist/features/magic-context/mural/compress-cues.d.ts.map +1 -1
- package/dist/features/magic-context/mural/cue-validation.d.ts +7 -7
- package/dist/features/magic-context/mural/cue-validation.d.ts.map +1 -1
- package/dist/features/magic-context/mural/storage-mural-cues.d.ts +13 -3
- package/dist/features/magic-context/mural/storage-mural-cues.d.ts.map +1 -1
- package/dist/features/magic-context/storage-db.d.ts +21 -3
- package/dist/features/magic-context/storage-db.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-persisted.d.ts +1 -0
- package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -1
- package/dist/hooks/magic-context/event-handler.d.ts +1 -0
- package/dist/hooks/magic-context/event-handler.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/rust-mode-transform.d.ts +16 -0
- package/dist/hooks/magic-context/rust-mode-transform.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-context-state.d.ts +1 -0
- package/dist/hooks/magic-context/transform-context-state.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts +1 -0
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/{index-x8spt5wy.js → index-z70pxrq1.js} +126 -25
- package/dist/index.js +217 -34
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/{recomp-orchestrator-k72ejkkh.js → recomp-orchestrator-6cd3nrt7.js} +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/transform.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AAGxE,OAAO,EACH,KAAK,eAAe,EAYvB,MAAM,sCAAsC,CAAC;AAgB9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAMlE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AA+BxD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAoB1D,OAAO,EAA2B,KAAK,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AA0B3F,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAgDnE,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAOnF;AAkDD;;;;GAIG;AACH,wBAAgB,8BAA8B,CAC1C,SAAS,EAAE,MAAM,GAClB,GAAG,CAAC,MAAM,EAAE;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAEzD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CACnC,QAAQ,EAAE,MAAM,EAChB,gBAAgB,E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E,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;CAAE,EACrF,oBAAoB,CAAC,EAAE,MAAM,GAC9B,MAAM,GAAG,SAAS,CAqCpB"}
|
|
@@ -390,6 +390,7 @@ import {
|
|
|
390
390
|
mkdtempSync,
|
|
391
391
|
readdirSync,
|
|
392
392
|
readFileSync as readFileSync2,
|
|
393
|
+
statSync as statSync2,
|
|
393
394
|
unlinkSync
|
|
394
395
|
} from "node:fs";
|
|
395
396
|
import { basename, dirname, join as join3 } from "node:path";
|
|
@@ -4656,6 +4657,15 @@ var MIGRATIONS = [
|
|
|
4656
4657
|
ensureColumn(db, "session_meta", "detected_context_limit_provenance", "TEXT NOT NULL DEFAULT 'unknown'");
|
|
4657
4658
|
}
|
|
4658
4659
|
}
|
|
4660
|
+
},
|
|
4661
|
+
{
|
|
4662
|
+
version: 75,
|
|
4663
|
+
description: "persist mural cue validation rejection latches",
|
|
4664
|
+
up(db) {
|
|
4665
|
+
if (!tableExists2(db, "memories"))
|
|
4666
|
+
return;
|
|
4667
|
+
ensureColumn(db, "memories", "mural_cue_rejection_count", "INTEGER NOT NULL DEFAULT 0");
|
|
4668
|
+
}
|
|
4659
4669
|
}
|
|
4660
4670
|
];
|
|
4661
4671
|
var LATEST_MIGRATION_VERSION = MIGRATIONS.reduce((max, m) => Math.max(max, m.version), 0);
|
|
@@ -5147,7 +5157,7 @@ function getSchemaFenceRejection() {
|
|
|
5147
5157
|
function getMigrationOnOpenRefusal() {
|
|
5148
5158
|
return lastMigrationOnOpenRefusal;
|
|
5149
5159
|
}
|
|
5150
|
-
var LATEST_SUPPORTED_VERSION =
|
|
5160
|
+
var LATEST_SUPPORTED_VERSION = 75;
|
|
5151
5161
|
var PERMISSIONS_ENFORCEABLE = process.platform !== "win32";
|
|
5152
5162
|
var defaultStoragePermissionFs = { chmodSync, mkdirSync };
|
|
5153
5163
|
var storagePermissionFs = defaultStoragePermissionFs;
|
|
@@ -5269,24 +5279,65 @@ function enforceSchemaFence(db, dbPath, latestSupportedVersion) {
|
|
|
5269
5279
|
log(`[magic-context] storage fatal: refusing to open ${dbPath}; upstream migration lane v${persistedVersion} is newer than this binary supports (max v${latestSupportedVersion}). A pinned or stale plugin is likely sharing this database with a newer instance; update or unpin Magic Context with 'npx @cortexkit/magic-context@latest doctor --force', then restart.`);
|
|
5270
5280
|
return false;
|
|
5271
5281
|
}
|
|
5272
|
-
function unreadableDiscovery(path2) {
|
|
5282
|
+
function unreadableDiscovery(path2, arm) {
|
|
5273
5283
|
return {
|
|
5274
5284
|
state: "unreadable",
|
|
5275
5285
|
serverPids: [],
|
|
5276
5286
|
staleFiles: [],
|
|
5277
|
-
unreadableFile: path2
|
|
5287
|
+
unreadableFile: path2,
|
|
5288
|
+
unreadableArm: arm
|
|
5278
5289
|
};
|
|
5279
5290
|
}
|
|
5291
|
+
var RPC_DISCOVERY_PARSE_GRACE_MS = 10 * 60 * 1000;
|
|
5292
|
+
var defaultRpcDiscoveryFs = {
|
|
5293
|
+
readdirSync: (path2, options) => options?.withFileTypes ? readdirSync(path2, { withFileTypes: true }) : readdirSync(path2),
|
|
5294
|
+
readFileSync: (path2, encoding) => String(readFileSync2(path2, encoding)),
|
|
5295
|
+
statSync: (path2) => ({ mtimeMs: statSync2(path2).mtimeMs }),
|
|
5296
|
+
unlinkSync: (path2) => unlinkSync(path2)
|
|
5297
|
+
};
|
|
5298
|
+
var rpcDiscoveryFs = defaultRpcDiscoveryFs;
|
|
5299
|
+
function invalidDiscoveryReason(raw) {
|
|
5300
|
+
const trimmed = raw.trim();
|
|
5301
|
+
if (trimmed.startsWith("{")) {
|
|
5302
|
+
try {
|
|
5303
|
+
const parsed = JSON.parse(trimmed);
|
|
5304
|
+
if ("pid" in parsed) {
|
|
5305
|
+
const pid = Number(parsed.pid);
|
|
5306
|
+
if (!Number.isInteger(pid) || pid <= 0)
|
|
5307
|
+
return "invalid-pid";
|
|
5308
|
+
}
|
|
5309
|
+
} catch {}
|
|
5310
|
+
}
|
|
5311
|
+
return "parse-invalid";
|
|
5312
|
+
}
|
|
5313
|
+
function classifyJunkDiscovery(portFile, raw, staleFiles) {
|
|
5314
|
+
let mtimeMs;
|
|
5315
|
+
try {
|
|
5316
|
+
mtimeMs = rpcDiscoveryFs.statSync(portFile).mtimeMs;
|
|
5317
|
+
} catch (error) {
|
|
5318
|
+
if (error.code === "ENOENT")
|
|
5319
|
+
return null;
|
|
5320
|
+
return unreadableDiscovery(portFile, "io");
|
|
5321
|
+
}
|
|
5322
|
+
const ageMs = Date.now() - mtimeMs;
|
|
5323
|
+
if (!Number.isFinite(ageMs) || ageMs < RPC_DISCOVERY_PARSE_GRACE_MS) {
|
|
5324
|
+
return unreadableDiscovery(portFile, "parse");
|
|
5325
|
+
}
|
|
5326
|
+
staleFiles.push(portFile);
|
|
5327
|
+
const reason = invalidDiscoveryReason(raw);
|
|
5328
|
+
log(`[magic-context] removing stale RPC discovery file ${portFile}: ${reason} record older than 10 minutes`);
|
|
5329
|
+
return null;
|
|
5330
|
+
}
|
|
5280
5331
|
function inspectRpcServerDiscovery(storageDir) {
|
|
5281
5332
|
const rpcRoot = join3(storageDir, "rpc");
|
|
5282
5333
|
let projectEntries;
|
|
5283
5334
|
try {
|
|
5284
|
-
projectEntries = readdirSync(rpcRoot, { withFileTypes: true });
|
|
5335
|
+
projectEntries = rpcDiscoveryFs.readdirSync(rpcRoot, { withFileTypes: true });
|
|
5285
5336
|
} catch (error) {
|
|
5286
5337
|
if (error.code === "ENOENT") {
|
|
5287
5338
|
return { state: "absent", serverPids: [], staleFiles: [] };
|
|
5288
5339
|
}
|
|
5289
|
-
return unreadableDiscovery(rpcRoot);
|
|
5340
|
+
return unreadableDiscovery(rpcRoot, "io");
|
|
5290
5341
|
}
|
|
5291
5342
|
const portFiles = [];
|
|
5292
5343
|
for (const projectEntry of projectEntries) {
|
|
@@ -5295,9 +5346,11 @@ function inspectRpcServerDiscovery(storageDir) {
|
|
|
5295
5346
|
const projectDir = join3(rpcRoot, projectEntry.name);
|
|
5296
5347
|
let entries;
|
|
5297
5348
|
try {
|
|
5298
|
-
entries = readdirSync(projectDir);
|
|
5299
|
-
} catch {
|
|
5300
|
-
|
|
5349
|
+
entries = rpcDiscoveryFs.readdirSync(projectDir);
|
|
5350
|
+
} catch (error) {
|
|
5351
|
+
if (error.code === "ENOENT")
|
|
5352
|
+
continue;
|
|
5353
|
+
return unreadableDiscovery(projectDir, "io");
|
|
5301
5354
|
}
|
|
5302
5355
|
for (const entry of entries) {
|
|
5303
5356
|
if (entry === "port" || entry.startsWith("port-") && entry.endsWith(".json")) {
|
|
@@ -5313,15 +5366,21 @@ function inspectRpcServerDiscovery(storageDir) {
|
|
|
5313
5366
|
for (const portFile of portFiles) {
|
|
5314
5367
|
let raw;
|
|
5315
5368
|
try {
|
|
5316
|
-
raw =
|
|
5317
|
-
} catch {
|
|
5318
|
-
|
|
5369
|
+
raw = rpcDiscoveryFs.readFileSync(portFile, "utf8");
|
|
5370
|
+
} catch (error) {
|
|
5371
|
+
if (error.code === "ENOENT")
|
|
5372
|
+
continue;
|
|
5373
|
+
return unreadableDiscovery(portFile, "io");
|
|
5319
5374
|
}
|
|
5320
5375
|
const filename = basename(portFile);
|
|
5321
5376
|
const pidFromName = /^port-(\d+)/.exec(filename)?.[1];
|
|
5322
|
-
const
|
|
5377
|
+
const fallbackPid = pidFromName ? Number(pidFromName) : 0;
|
|
5378
|
+
const record = parseRpcPortFile(raw, fallbackPid);
|
|
5323
5379
|
if (!record || !Number.isInteger(record.pid) || record.pid <= 0) {
|
|
5324
|
-
|
|
5380
|
+
const junk = classifyJunkDiscovery(portFile, raw, staleFiles);
|
|
5381
|
+
if (junk)
|
|
5382
|
+
return junk;
|
|
5383
|
+
continue;
|
|
5325
5384
|
}
|
|
5326
5385
|
if (isPidAlive(record.pid) && isPidIdentityPlausible(record))
|
|
5327
5386
|
pids.add(record.pid);
|
|
@@ -5330,9 +5389,9 @@ function inspectRpcServerDiscovery(storageDir) {
|
|
|
5330
5389
|
}
|
|
5331
5390
|
for (const staleFile of staleFiles) {
|
|
5332
5391
|
try {
|
|
5333
|
-
unlinkSync(staleFile);
|
|
5392
|
+
rpcDiscoveryFs.unlinkSync(staleFile);
|
|
5334
5393
|
} catch {
|
|
5335
|
-
return unreadableDiscovery(staleFile);
|
|
5394
|
+
return unreadableDiscovery(staleFile, "io");
|
|
5336
5395
|
}
|
|
5337
5396
|
}
|
|
5338
5397
|
const serverPids = [...pids].sort((a, b) => a - b);
|
|
@@ -5356,10 +5415,14 @@ function enforceMigrationOnOpenGuard(db, dbPath, dbDir, latestSupportedVersion)
|
|
|
5356
5415
|
persistedVersion,
|
|
5357
5416
|
supportedVersion: latestSupportedVersion,
|
|
5358
5417
|
serverPids: discovery.serverPids,
|
|
5359
|
-
...discovery.unreadableFile ? { unreadableFile: discovery.unreadableFile } : {}
|
|
5418
|
+
...discovery.unreadableFile ? { unreadableFile: discovery.unreadableFile } : {},
|
|
5419
|
+
...discovery.unreadableArm ? { unreadableArm: discovery.unreadableArm } : {}
|
|
5360
5420
|
};
|
|
5361
5421
|
if (discovery.state === "unreadable") {
|
|
5362
|
-
|
|
5422
|
+
const unreadableFile = discovery.unreadableFile ?? "<unknown>";
|
|
5423
|
+
const arm = discovery.unreadableArm ?? "io";
|
|
5424
|
+
const recovery = arm === "io" ? `If no OpenCode server is running, it is safe to delete ${unreadableFile} and retry.` : `Retry after the file is older than the ten-minute grace window, or stop OpenCode before deleting it.`;
|
|
5425
|
+
log(`[magic-context] storage fatal: refusing to migrate ${dbPath} from upstream migration v${persistedVersion} to v${latestSupportedVersion} because RPC discovery file ${unreadableFile} is uncertain (${arm} arm), so the absence of a live OpenCode server cannot be proven. ${recovery}`);
|
|
5363
5426
|
} else {
|
|
5364
5427
|
log(`[magic-context] storage fatal: refusing to migrate ${dbPath} from upstream migration v${persistedVersion} to v${latestSupportedVersion} while live OpenCode server PID(s) ${discovery.serverPids.join(", ")} may still use the old plugin build. Restart OpenCode, then retry this process.`);
|
|
5365
5428
|
}
|
|
@@ -5653,6 +5716,7 @@ function initializeDatabase(db) {
|
|
|
5653
5716
|
mural_cue TEXT,
|
|
5654
5717
|
mural_cue_hash TEXT,
|
|
5655
5718
|
mural_cue_at INTEGER,
|
|
5719
|
+
mural_cue_rejection_count INTEGER NOT NULL DEFAULT 0,
|
|
5656
5720
|
UNIQUE(project_path, category, normalized_hash)
|
|
5657
5721
|
);
|
|
5658
5722
|
|
|
@@ -6676,7 +6740,7 @@ function probeChildSpawnFence(db) {
|
|
|
6676
6740
|
}
|
|
6677
6741
|
// src/features/magic-context/project-docs-hash.ts
|
|
6678
6742
|
import { createHash as createHash6 } from "node:crypto";
|
|
6679
|
-
import { lstatSync, readFileSync as readFileSync3, statSync as
|
|
6743
|
+
import { lstatSync, readFileSync as readFileSync3, statSync as statSync3 } from "node:fs";
|
|
6680
6744
|
import path2 from "node:path";
|
|
6681
6745
|
var PROJECT_DOC_FILES = ["ARCHITECTURE.md", "STRUCTURE.md"];
|
|
6682
6746
|
var PROJECT_DOCS_DELIMITER = `
|
|
@@ -6707,7 +6771,7 @@ function fingerprintFile(filePath) {
|
|
|
6707
6771
|
}
|
|
6708
6772
|
function readDirectoryMtimeMs(projectDirectory) {
|
|
6709
6773
|
try {
|
|
6710
|
-
return
|
|
6774
|
+
return statSync3(projectDirectory).mtimeMs;
|
|
6711
6775
|
} catch {
|
|
6712
6776
|
return 0;
|
|
6713
6777
|
}
|
|
@@ -7074,6 +7138,7 @@ function escalationBands(effectiveThresholdPercentage) {
|
|
|
7074
7138
|
|
|
7075
7139
|
// src/features/magic-context/storage-meta-persisted.ts
|
|
7076
7140
|
var emergencyRecoveryArmedSessions = new Set;
|
|
7141
|
+
var emergencyRecoveryArmedAtBySession = new Map;
|
|
7077
7142
|
var providerOverflowReconfirmedSessions = new Set;
|
|
7078
7143
|
function isEmergencyRecoveryArmed(sessionId) {
|
|
7079
7144
|
return emergencyRecoveryArmedSessions.has(sessionId);
|
|
@@ -7081,6 +7146,9 @@ function isEmergencyRecoveryArmed(sessionId) {
|
|
|
7081
7146
|
function isProviderOverflowReconfirmed(sessionId) {
|
|
7082
7147
|
return providerOverflowReconfirmedSessions.has(sessionId);
|
|
7083
7148
|
}
|
|
7149
|
+
function getEmergencyRecoveryArmedAt(sessionId) {
|
|
7150
|
+
return emergencyRecoveryArmedAtBySession.get(sessionId) ?? null;
|
|
7151
|
+
}
|
|
7084
7152
|
var CAS_RETRY_LIMIT = 5;
|
|
7085
7153
|
var AUTO_SEARCH_NO_HINT_REASONS = new Set([
|
|
7086
7154
|
"below-threshold",
|
|
@@ -7942,6 +8010,7 @@ function getOverflowState(db, sessionId, modelKey) {
|
|
|
7942
8010
|
}
|
|
7943
8011
|
function recordOverflowDetected(db, sessionId, reportedLimit, modelKey, origin = "provider_overflow", provenance = "unknown") {
|
|
7944
8012
|
emergencyRecoveryArmedSessions.add(sessionId);
|
|
8013
|
+
emergencyRecoveryArmedAtBySession.set(sessionId, Date.now());
|
|
7945
8014
|
db.transaction(() => {
|
|
7946
8015
|
ensureSessionMetaRow(db, sessionId);
|
|
7947
8016
|
const prior = db.prepare("SELECT needs_emergency_recovery FROM session_meta WHERE session_id = ?").get(sessionId);
|
|
@@ -7973,6 +8042,7 @@ function clearEmergencyRecovery(db, sessionId) {
|
|
|
7973
8042
|
}
|
|
7974
8043
|
})();
|
|
7975
8044
|
emergencyRecoveryArmedSessions.delete(sessionId);
|
|
8045
|
+
emergencyRecoveryArmedAtBySession.delete(sessionId);
|
|
7976
8046
|
providerOverflowReconfirmedSessions.delete(sessionId);
|
|
7977
8047
|
}
|
|
7978
8048
|
function clearDetectedContextLimit(db, sessionId) {
|
|
@@ -9837,6 +9907,7 @@ function computeCueContentHash(content) {
|
|
|
9837
9907
|
return createHash8("sha256").update(content).digest("hex");
|
|
9838
9908
|
}
|
|
9839
9909
|
var muralCueColumnCache = new WeakMap;
|
|
9910
|
+
var muralCueRejectionColumnCache = new WeakMap;
|
|
9840
9911
|
function hasMuralCueColumns(db) {
|
|
9841
9912
|
const cached = muralCueColumnCache.get(db);
|
|
9842
9913
|
if (cached !== undefined)
|
|
@@ -9846,6 +9917,15 @@ function hasMuralCueColumns(db) {
|
|
|
9846
9917
|
muralCueColumnCache.set(db, present);
|
|
9847
9918
|
return present;
|
|
9848
9919
|
}
|
|
9920
|
+
function hasMuralCueRejectionCountColumn(db) {
|
|
9921
|
+
const cached = muralCueRejectionColumnCache.get(db);
|
|
9922
|
+
if (cached !== undefined)
|
|
9923
|
+
return cached;
|
|
9924
|
+
const columns = db.prepare("PRAGMA table_info(memories)").all();
|
|
9925
|
+
const present = columns.some((column) => column.name === "mural_cue_rejection_count");
|
|
9926
|
+
muralCueRejectionColumnCache.set(db, present);
|
|
9927
|
+
return present;
|
|
9928
|
+
}
|
|
9849
9929
|
function getMuralCueState(db, memoryIds) {
|
|
9850
9930
|
const out = new Map;
|
|
9851
9931
|
if (!hasMuralCueColumns(db))
|
|
@@ -9854,9 +9934,14 @@ function getMuralCueState(db, memoryIds) {
|
|
|
9854
9934
|
if (ids.length === 0)
|
|
9855
9935
|
return out;
|
|
9856
9936
|
const placeholders3 = ids.map(() => "?").join(", ");
|
|
9857
|
-
const
|
|
9937
|
+
const rejectionCountColumn = hasMuralCueRejectionCountColumn(db) ? "COALESCE(mural_cue_rejection_count, 0) AS mural_cue_rejection_count" : "0 AS mural_cue_rejection_count";
|
|
9938
|
+
const rows = db.prepare(`SELECT id, mural_cue, mural_cue_hash, ${rejectionCountColumn} FROM memories WHERE id IN (${placeholders3})`).all(...ids);
|
|
9858
9939
|
for (const row of rows) {
|
|
9859
|
-
out.set(row.id, {
|
|
9940
|
+
out.set(row.id, {
|
|
9941
|
+
cue: row.mural_cue ?? null,
|
|
9942
|
+
hash: row.mural_cue_hash ?? null,
|
|
9943
|
+
...row.mural_cue_rejection_count > 0 ? { rejectionCount: row.mural_cue_rejection_count } : {}
|
|
9944
|
+
});
|
|
9860
9945
|
}
|
|
9861
9946
|
return out;
|
|
9862
9947
|
}
|
|
@@ -9873,8 +9958,24 @@ function setMuralCue(db, projectPath, id, cue, contentHash) {
|
|
|
9873
9958
|
if (!owned) {
|
|
9874
9959
|
throw new Error(`Memory ${id} does not belong to project ${projectPath}`);
|
|
9875
9960
|
}
|
|
9876
|
-
|
|
9961
|
+
const rejectionReset = hasMuralCueRejectionCountColumn(db) ? ", mural_cue_rejection_count = 0" : "";
|
|
9962
|
+
db.prepare(`UPDATE memories SET mural_cue = ?, mural_cue_hash = ?, mural_cue_at = ?${rejectionReset} WHERE id = ? AND project_path = ?`).run(cue, contentHash, Date.now(), id, projectPath);
|
|
9963
|
+
});
|
|
9964
|
+
}
|
|
9965
|
+
function recordMuralCueRejection(db, projectPath, id, contentHash) {
|
|
9966
|
+
if (!hasMuralCueColumns(db) || !hasMuralCueRejectionCountColumn(db))
|
|
9967
|
+
return 0;
|
|
9968
|
+
let count = 0;
|
|
9969
|
+
withPrivilegedWriter(db, () => {
|
|
9970
|
+
const owned = db.prepare("SELECT 1 FROM memories WHERE id = ? AND project_path = ?").get(id, projectPath);
|
|
9971
|
+
if (!owned) {
|
|
9972
|
+
throw new Error(`Memory ${id} does not belong to project ${projectPath}`);
|
|
9973
|
+
}
|
|
9974
|
+
const row = db.prepare("SELECT mural_cue_hash, mural_cue_rejection_count FROM memories WHERE id = ?").get(id);
|
|
9975
|
+
count = row?.mural_cue_hash === contentHash ? (row.mural_cue_rejection_count ?? 0) + 1 : 1;
|
|
9976
|
+
db.prepare("UPDATE memories SET mural_cue = NULL, mural_cue_hash = ?, mural_cue_at = ?, mural_cue_rejection_count = ? WHERE id = ? AND project_path = ?").run(contentHash, Date.now(), count, id, projectPath);
|
|
9877
9977
|
});
|
|
9978
|
+
return count;
|
|
9878
9979
|
}
|
|
9879
9980
|
|
|
9880
9981
|
// src/features/magic-context/memory/storage-memory-embeddings.ts
|
|
@@ -31952,7 +32053,7 @@ function getMemoryVerifications(db, memoryIds) {
|
|
|
31952
32053
|
}
|
|
31953
32054
|
// src/features/magic-context/memory/verification-paths.ts
|
|
31954
32055
|
import { execFile } from "node:child_process";
|
|
31955
|
-
import { existsSync as existsSync4, realpathSync as realpathSync2, statSync as
|
|
32056
|
+
import { existsSync as existsSync4, realpathSync as realpathSync2, statSync as statSync4 } from "node:fs";
|
|
31956
32057
|
import path3 from "node:path";
|
|
31957
32058
|
import { promisify } from "node:util";
|
|
31958
32059
|
var execFileAsync = promisify(execFile);
|
|
@@ -32094,7 +32195,7 @@ async function normalizeVerificationFiles(args) {
|
|
|
32094
32195
|
}
|
|
32095
32196
|
if (existsSync4(candidate)) {
|
|
32096
32197
|
try {
|
|
32097
|
-
if (
|
|
32198
|
+
if (statSync4(candidate).isDirectory()) {
|
|
32098
32199
|
warnings.push(`Skipped verification path "${value}" because it is a directory.`);
|
|
32099
32200
|
continue;
|
|
32100
32201
|
}
|
|
@@ -42088,4 +42189,4 @@ async function runUpgradeMemoryMigration(ctx, sessionId, migrationDirectory) {
|
|
|
42088
42189
|
}
|
|
42089
42190
|
}
|
|
42090
42191
|
|
|
42091
|
-
export { withContentLanguageDirective, buildPrimaryLanguageDirective, exports_external, DEFAULT_PROTECTED_TAGS, parseCron, nextOccurrence, nextDueAtMs, DEFAULT_EXECUTE_THRESHOLD_PERCENTAGE, DEFAULT_HISTORIAN_TIMEOUT_MS, DEFAULT_LOCAL_EMBEDDING_MODEL, MagicContextConfigSchema, getOpenCodeDbPath, removeMcOwnedCompactionMarkers, ProjectIdentityError, resolveProjectIdentityStrict, takeDubiousOwnershipProjectIdentityWarning, resolveProjectIdentity, resolveProjectIdentityForSession, normalizeStoredProjectPath, storedPathBelongsToIdentity, recordSessionProjectIdentity, beginBootQuietPeriod, bootQuietRemainingMs, scheduleAfterBootQuiet, rpcPortDir, rpcPortFilePath, isPidAlive, parseRpcPortFile, registerModuleNoteEvaluationBridge, getModuleNoteEvaluationBridge, getContextStoreUuid, ensureContextStoreUuid, getAuthorityManagedMarker, reconcileAuthorityProject, checksumAuthoritySeedRows, prepareAuthority, drainAuthority, getMirrorCursor, applyMirrorPage, pullMemoryMirrorOnce, V2_MEMORY_CATEGORIES, CATEGORY_PRIORITY, resolveWorkspaceShareCategories, resolveWorkspaceIdentitySet, expandWorkspaceIdentitySetWithAliases, resolveStoredPathWorkspaceIdentity, storedPathBelongsToWorkspace, sourceNameForMemory, computeWorkspaceEpochFingerprint, recordToolDefinition, getMeasuredToolDefinitionTokens, getSchemaFenceRejection, getMigrationOnOpenRefusal, LATEST_SUPPORTED_VERSION, getDatabasePath, getPersistedSchemaVersion, setSqlitePragmaConfig, runSqliteOptimize, openDatabase, openDatabaseAsync, isDatabasePersisted, getDatabasePersistenceError, COMPARTMENT_LEASE_RENEWAL_MS, acquireCompartmentLease, renewCompartmentLease, releaseCompartmentLease, getCompartments, getLastCompartmentEndMessage, getLastCompartmentEndMessageId, clearRecompStaging, recordEmbeddingMeasurement, getMaxM0MutationId, queueMemoryMutation, getMemoryMutationsForRenderByProjects, getMaxMemoryMutationIdForProjects, MAX_EXECUTE_THRESHOLD, escalationBands, isEmergencyRecoveryArmed, isProviderOverflowReconfirmed, loadPersistedUsage, loadProtectedTailMeta, resetProtectedTailNoEligibleHead, getWrapupInProgressState, acquireWrapupInProgress, updateWrapupInProgress, releaseWrapupInProgress, resolveCompactionModeRecord, getCompactionModeRecord, setCompactionModeRecord, getPersistedReasoningWatermark, setPersistedReasoningWatermark, clearPersistedReasoningWatermark, getEmergencyInputSample, setEmergencyDropSample, clearEmergencyDropSample, getLastNudgeUndropped, setLastNudgeUndropped, getLastNudgeLevel, setLastNudgeLevel, resetLastNudgeCycle, resetLastNudgeCycleIfTailShrank, getChannel2NudgeState, getChannel2NudgeClaim, setChannel2NudgeState, casChannel2NudgeState, claimChannel2NudgeState, casChannel2NudgeClaim, getPersistedNoteNudge, getNoteNudgeAnchors, getAutoSearchHintDecisions, appendAutoSearchHintDecision, pruneNoteNudgeAnchors, pruneAutoSearchHintDecisions, removeNoteNudgeAnchorByMessageId, removeAutoSearchHintDecisionByMessageId, getPersistedTodoPermissionDenied, setPersistedTodoPermissionDenied, getPersistedTodoSyntheticAnchor, setPersistedTodoSyntheticAnchor, clearPersistedTodoSyntheticAnchor, setNoteLastReadAt, getHistorianFailureState, clearHistorianFailureState, getOverflowState, recordOverflowDetected, recordDetectedContextLimit, clearEmergencyRecovery, clearDetectedContextLimit, getPersistedCompactionMarkerState, setPersistedCompactionMarkerState, getStrippedPlaceholderIds, applyStrippedPlaceholderDelta, removeStrippedPlaceholderId, getStaleReduceStrippedIds, addStaleReduceStrippedIds, getProcessedImageStrippedIds, addProcessedImageStrippedIds, getPendingCompactionMarkerState, clearPendingCompactionMarkerStateIf, peekDeferredExecutePending, setDeferredExecutePendingIfAbsent, clearDeferredExecutePendingIfMatches, getSessionsWithPendingMarker, setSessionWorkMetrics, getNotes, addNote, getSessionNotes, getPendingSmartNotes, getReadySmartNotes, updateNote, dismissNote, markNoteReady, markNoteChecked, queuePendingOp, getPendingOps, clearPendingOps, removePendingOp, PRIMER_CANDIDATE_TTL_MS, PRIMER_CANDIDATE_MAX_AGE_MS, primerOccurrenceKey, primerOccurrenceUtcDay, updatePrimerCandidateEmbedding, getPrimerCandidatesByIds, getPrimerCandidatesForPromotion, countPrimerCandidatesForProject, getActivePrimers, createPrimer, updatePrimerSupport, updatePrimerAnswer, GLOBAL_USER_PROFILE_PROJECT_PATH, getProjectState, bumpProjectMemoryEpoch, bumpProjectUserProfileVersion, saveSourceContent, replaceSourceContent, getSourceContents, getActiveTagTokenAggregate, AGE_RECLAIM_MIN_TOKENS, getOldestActiveUnprotectedToolTags, getActiveToolTagsForAgeReclaim, getTriggerTagTokenUpperBound, getActiveTagTokenTotalsByMessage, tagTokenCountIsNull, backfillTagTokenCounts, insertTag, updateTagStatus, updateTagDropMode, updateCavemanDepth, updateTagMessageId, deleteTagsByMessageId, getMaxTagNumberBySession, getTagNumberByMessageId, deriveTagLoadFloor, getTagsBySession, getActiveTagsBySession, getDroppedTagsBySession, getTagsByNumbers, getMaxDroppedTagNumber, getToolTagNumberByOwner, getNullOwnerToolTag, adoptNullOwnerToolTag, getCandidateToolOwners, pickNearestPriorOwner, createChildSessionWithFence, detectOverflow, promptSyncWithValidatedOutputRetry, normalizeSDKResponse, extractLatestAssistantText, hasLengthCappedOutput, setKeepSubagents, shouldKeepSubagents, recordChildInvocation, COMPARTMENT_AGENT_SYSTEM_PROMPT, HISTORIAN_EDITOR_SYSTEM_PROMPT, COMPARTMENT_STRUCTURAL_SYSTEM_PROMPT, Priority, AdmissionClass, StaleRouteHandleError, SocketClosedError, SocketTimeoutError, SubcClient, isConsumerReconnectTransient, getCompartmentEvents, loadCompartmentChunkEmbeddingsForSearch, cosineSimilarity, SYNAPSE_DEFAULT_MODEL, SynapseEmbeddingProvider, computeNormalizedHash, saveCommitEmbedding, loadProjectCommitEmbeddings, loadUnembeddedCommits, countEmbeddedCommits, upsertCommits, getLatestIndexedCommitTimeMs, enforceProjectCap, GIT_SWEEP_LEASE_RENEWAL_MS, acquireGitSweepLease, renewGitSweepLease, markGitSweepSuccessAndRelease, parkGitSweepNonIndexable, releaseGitSweepLease, saveEmbeddingIfHashMatches, getProjectEmbeddings, peekProjectEmbeddings, invalidateProject, invalidateMemory, markProjectLoadUntrusted, contentSha256, sweepStaleEmbeddingIdentitiesForProject, registerProjectEmbedding, registerProjectShadowEmbedding, getShadowEmbeddingMeasurementCohort, getPrimaryEmbeddingMeasurementCohort, embedShadowTextForProject, enqueueShadowEmbeddingItems, registerProjectInObservationMode, getProjectEmbeddingSnapshot, embedTextForProject, embedBatchForProject, embedItemsForProject, embedUnembeddedMemoriesForProject, drainCommitBacklogForProject, embedSessionCompartmentChunks, getEmbeddingCoverageStatus, isEmbeddingEnabled, embedText, ensureMemoryEmbeddings, computeCueContentHash, hasMuralCueColumns, getMuralCueState, memoryNeedsCue, setMuralCue, hasMemoryShareableColumn, hasMemoryClassifiedAtColumn, getUnclassifiedMemoryIds, ModuleMemoryAuthorityError, insertMemory, insertMemoryIdempotent, getMemoryByHash, getMemoriesByProject, buildWorkspaceMemorySqlFilter, getMemoriesByProjects, getMaxMemoryIdForProjects, readNewMemoriesForM1Union, getMemoryById, getMemoriesByIds, updateMemorySeenCount, updateMemoryRetrievalCount, setMemoryClassification, supersededMemory, mergeMemoryStats, archiveMemory, getMemoryCountsByStatus, sanitizeFtsQuery, searchMemoriesFTS, searchMemoriesFTSUnion, recordMemoryMapping, recordMemoryVerifications, getUnmappedMemoryIds, clearMemoryVerifications, getMemoryVerifications, resolveGitTopLevel, readGitHead, readGitChangedFilesSince, readGitFileChangeTimesSince, verificationFileExists, normalizeVerificationFiles, USER_MEMORY_CANDIDATE_TTL_MS, insertUserMemoryCandidates, getUserMemoryCandidates, deleteUserMemoryCandidates, pruneExpiredUserMemoryCandidates, insertUserMemory, getActiveUserMemories, updateUserMemoryContent, dismissUserMemory, MARKER_SUMMARY_TEXT, applyDeferredCompactionMarker, removeCompactionMarkerForSession, checkCompactionMarkerConsistency, getMural, BoundedSessionMap, extractM0Block, formatDate, injectTemporalMarkers, clearInjectionCache, getVisibleMemoryIds, prepareCompartmentInjection, renderCompartmentInjection, mustMaterialize, trimMemoriesToBudgetV2, renderMemoryBlockV2, injectM0M1, onNoteTrigger, peekNoteNudgeText, markNoteNudgeDelivered, clearNoteNudgeTriggerAndCooldown, resetNoteNudgeCooldownOnly, clearNoteNudgeTriggerOnly, estimateTrueRawMessageTokens, invalidateTrueRawTokenCache, RECOVERY_NO_HEAD_LIMIT, resolveOpenCodeProtectedTailBoundary, resolveWrapupProtectedTailBoundary, getRawHistoryEligibility, hasRunnableCompartmentWindow, recordHighPressureNoEligibleHead, runCompartmentAgent, snapRangeToCompartments, lkgContentDigest, captureSlot, getSlot, dropSlot, noteEntry, getActiveCompartmentRun, markActiveCompartmentRunPublished, registerActiveCompartmentRun, startCompartmentAgent, isRecompFailure, isRecompSkip, isRecompComplete, extractRecompReason, contextualizeUpgradeReason, setRecompStarting, setRecompNote, setRecompTerminal, runManagedRecomp, runManagedUpgrade };
|
|
42192
|
+
export { withContentLanguageDirective, buildPrimaryLanguageDirective, exports_external, DEFAULT_PROTECTED_TAGS, parseCron, nextOccurrence, nextDueAtMs, DEFAULT_EXECUTE_THRESHOLD_PERCENTAGE, DEFAULT_HISTORIAN_TIMEOUT_MS, DEFAULT_LOCAL_EMBEDDING_MODEL, MagicContextConfigSchema, getOpenCodeDbPath, removeMcOwnedCompactionMarkers, ProjectIdentityError, resolveProjectIdentityStrict, takeDubiousOwnershipProjectIdentityWarning, resolveProjectIdentity, resolveProjectIdentityForSession, normalizeStoredProjectPath, storedPathBelongsToIdentity, recordSessionProjectIdentity, beginBootQuietPeriod, bootQuietRemainingMs, scheduleAfterBootQuiet, rpcPortDir, rpcPortFilePath, isPidAlive, parseRpcPortFile, registerModuleNoteEvaluationBridge, getModuleNoteEvaluationBridge, getContextStoreUuid, ensureContextStoreUuid, getAuthorityManagedMarker, reconcileAuthorityProject, checksumAuthoritySeedRows, prepareAuthority, drainAuthority, getMirrorCursor, applyMirrorPage, pullMemoryMirrorOnce, V2_MEMORY_CATEGORIES, CATEGORY_PRIORITY, resolveWorkspaceShareCategories, resolveWorkspaceIdentitySet, expandWorkspaceIdentitySetWithAliases, resolveStoredPathWorkspaceIdentity, storedPathBelongsToWorkspace, sourceNameForMemory, computeWorkspaceEpochFingerprint, recordToolDefinition, getMeasuredToolDefinitionTokens, getSchemaFenceRejection, getMigrationOnOpenRefusal, LATEST_SUPPORTED_VERSION, getDatabasePath, getPersistedSchemaVersion, setSqlitePragmaConfig, runSqliteOptimize, openDatabase, openDatabaseAsync, isDatabasePersisted, getDatabasePersistenceError, COMPARTMENT_LEASE_RENEWAL_MS, acquireCompartmentLease, renewCompartmentLease, releaseCompartmentLease, getCompartments, getLastCompartmentEndMessage, getLastCompartmentEndMessageId, clearRecompStaging, recordEmbeddingMeasurement, getMaxM0MutationId, queueMemoryMutation, getMemoryMutationsForRenderByProjects, getMaxMemoryMutationIdForProjects, MAX_EXECUTE_THRESHOLD, escalationBands, isEmergencyRecoveryArmed, isProviderOverflowReconfirmed, getEmergencyRecoveryArmedAt, loadPersistedUsage, loadProtectedTailMeta, resetProtectedTailNoEligibleHead, getWrapupInProgressState, acquireWrapupInProgress, updateWrapupInProgress, releaseWrapupInProgress, resolveCompactionModeRecord, getCompactionModeRecord, setCompactionModeRecord, getPersistedReasoningWatermark, setPersistedReasoningWatermark, clearPersistedReasoningWatermark, getEmergencyInputSample, setEmergencyDropSample, clearEmergencyDropSample, getLastNudgeUndropped, setLastNudgeUndropped, getLastNudgeLevel, setLastNudgeLevel, resetLastNudgeCycle, resetLastNudgeCycleIfTailShrank, getChannel2NudgeState, getChannel2NudgeClaim, setChannel2NudgeState, casChannel2NudgeState, claimChannel2NudgeState, casChannel2NudgeClaim, getPersistedNoteNudge, getNoteNudgeAnchors, getAutoSearchHintDecisions, appendAutoSearchHintDecision, pruneNoteNudgeAnchors, pruneAutoSearchHintDecisions, removeNoteNudgeAnchorByMessageId, removeAutoSearchHintDecisionByMessageId, getPersistedTodoPermissionDenied, setPersistedTodoPermissionDenied, getPersistedTodoSyntheticAnchor, setPersistedTodoSyntheticAnchor, clearPersistedTodoSyntheticAnchor, setNoteLastReadAt, getHistorianFailureState, clearHistorianFailureState, getOverflowState, recordOverflowDetected, recordDetectedContextLimit, clearEmergencyRecovery, clearDetectedContextLimit, getPersistedCompactionMarkerState, setPersistedCompactionMarkerState, getStrippedPlaceholderIds, applyStrippedPlaceholderDelta, removeStrippedPlaceholderId, getStaleReduceStrippedIds, addStaleReduceStrippedIds, getProcessedImageStrippedIds, addProcessedImageStrippedIds, getPendingCompactionMarkerState, clearPendingCompactionMarkerStateIf, peekDeferredExecutePending, setDeferredExecutePendingIfAbsent, clearDeferredExecutePendingIfMatches, getSessionsWithPendingMarker, setSessionWorkMetrics, getNotes, addNote, getSessionNotes, getPendingSmartNotes, getReadySmartNotes, updateNote, dismissNote, markNoteReady, markNoteChecked, queuePendingOp, getPendingOps, clearPendingOps, removePendingOp, PRIMER_CANDIDATE_TTL_MS, PRIMER_CANDIDATE_MAX_AGE_MS, primerOccurrenceKey, primerOccurrenceUtcDay, updatePrimerCandidateEmbedding, getPrimerCandidatesByIds, getPrimerCandidatesForPromotion, countPrimerCandidatesForProject, getActivePrimers, createPrimer, updatePrimerSupport, updatePrimerAnswer, GLOBAL_USER_PROFILE_PROJECT_PATH, getProjectState, bumpProjectMemoryEpoch, bumpProjectUserProfileVersion, saveSourceContent, replaceSourceContent, getSourceContents, getActiveTagTokenAggregate, AGE_RECLAIM_MIN_TOKENS, getOldestActiveUnprotectedToolTags, getActiveToolTagsForAgeReclaim, getTriggerTagTokenUpperBound, getActiveTagTokenTotalsByMessage, tagTokenCountIsNull, backfillTagTokenCounts, insertTag, updateTagStatus, updateTagDropMode, updateCavemanDepth, updateTagMessageId, deleteTagsByMessageId, getMaxTagNumberBySession, getTagNumberByMessageId, deriveTagLoadFloor, getTagsBySession, getActiveTagsBySession, getDroppedTagsBySession, getTagsByNumbers, getMaxDroppedTagNumber, getToolTagNumberByOwner, getNullOwnerToolTag, adoptNullOwnerToolTag, getCandidateToolOwners, pickNearestPriorOwner, createChildSessionWithFence, detectOverflow, promptSyncWithValidatedOutputRetry, normalizeSDKResponse, extractLatestAssistantText, hasLengthCappedOutput, setKeepSubagents, shouldKeepSubagents, recordChildInvocation, COMPARTMENT_AGENT_SYSTEM_PROMPT, HISTORIAN_EDITOR_SYSTEM_PROMPT, COMPARTMENT_STRUCTURAL_SYSTEM_PROMPT, Priority, AdmissionClass, StaleRouteHandleError, SocketClosedError, SocketTimeoutError, SubcClient, isConsumerReconnectTransient, getCompartmentEvents, loadCompartmentChunkEmbeddingsForSearch, cosineSimilarity, SYNAPSE_DEFAULT_MODEL, SynapseEmbeddingProvider, computeNormalizedHash, saveCommitEmbedding, loadProjectCommitEmbeddings, loadUnembeddedCommits, countEmbeddedCommits, upsertCommits, getLatestIndexedCommitTimeMs, enforceProjectCap, GIT_SWEEP_LEASE_RENEWAL_MS, acquireGitSweepLease, renewGitSweepLease, markGitSweepSuccessAndRelease, parkGitSweepNonIndexable, releaseGitSweepLease, saveEmbeddingIfHashMatches, getProjectEmbeddings, peekProjectEmbeddings, invalidateProject, invalidateMemory, markProjectLoadUntrusted, contentSha256, sweepStaleEmbeddingIdentitiesForProject, registerProjectEmbedding, registerProjectShadowEmbedding, getShadowEmbeddingMeasurementCohort, getPrimaryEmbeddingMeasurementCohort, embedShadowTextForProject, enqueueShadowEmbeddingItems, registerProjectInObservationMode, getProjectEmbeddingSnapshot, embedTextForProject, embedBatchForProject, embedItemsForProject, embedUnembeddedMemoriesForProject, drainCommitBacklogForProject, embedSessionCompartmentChunks, getEmbeddingCoverageStatus, isEmbeddingEnabled, embedText, ensureMemoryEmbeddings, computeCueContentHash, hasMuralCueColumns, getMuralCueState, memoryNeedsCue, setMuralCue, recordMuralCueRejection, hasMemoryShareableColumn, hasMemoryClassifiedAtColumn, getUnclassifiedMemoryIds, ModuleMemoryAuthorityError, insertMemory, insertMemoryIdempotent, getMemoryByHash, getMemoriesByProject, buildWorkspaceMemorySqlFilter, getMemoriesByProjects, getMaxMemoryIdForProjects, readNewMemoriesForM1Union, getMemoryById, getMemoriesByIds, updateMemorySeenCount, updateMemoryRetrievalCount, setMemoryClassification, supersededMemory, mergeMemoryStats, archiveMemory, getMemoryCountsByStatus, sanitizeFtsQuery, searchMemoriesFTS, searchMemoriesFTSUnion, recordMemoryMapping, recordMemoryVerifications, getUnmappedMemoryIds, clearMemoryVerifications, getMemoryVerifications, resolveGitTopLevel, readGitHead, readGitChangedFilesSince, readGitFileChangeTimesSince, verificationFileExists, normalizeVerificationFiles, USER_MEMORY_CANDIDATE_TTL_MS, insertUserMemoryCandidates, getUserMemoryCandidates, deleteUserMemoryCandidates, pruneExpiredUserMemoryCandidates, insertUserMemory, getActiveUserMemories, updateUserMemoryContent, dismissUserMemory, MARKER_SUMMARY_TEXT, applyDeferredCompactionMarker, removeCompactionMarkerForSession, checkCompactionMarkerConsistency, getMural, BoundedSessionMap, extractM0Block, formatDate, injectTemporalMarkers, clearInjectionCache, getVisibleMemoryIds, prepareCompartmentInjection, renderCompartmentInjection, mustMaterialize, trimMemoriesToBudgetV2, renderMemoryBlockV2, injectM0M1, onNoteTrigger, peekNoteNudgeText, markNoteNudgeDelivered, clearNoteNudgeTriggerAndCooldown, resetNoteNudgeCooldownOnly, clearNoteNudgeTriggerOnly, estimateTrueRawMessageTokens, invalidateTrueRawTokenCache, RECOVERY_NO_HEAD_LIMIT, resolveOpenCodeProtectedTailBoundary, resolveWrapupProtectedTailBoundary, getRawHistoryEligibility, hasRunnableCompartmentWindow, recordHighPressureNoEligibleHead, runCompartmentAgent, snapRangeToCompartments, lkgContentDigest, captureSlot, getSlot, dropSlot, noteEntry, getActiveCompartmentRun, markActiveCompartmentRunPublished, registerActiveCompartmentRun, startCompartmentAgent, isRecompFailure, isRecompSkip, isRecompComplete, extractRecompReason, contextualizeUpgradeReason, setRecompStarting, setRecompNote, setRecompTerminal, runManagedRecomp, runManagedUpgrade };
|