@retaw106/mmc-oc 2.1.1 → 2.2.0
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/agents/memory-maintainer.d.ts +9 -0
- package/dist/agents/memory-maintainer.d.ts.map +1 -1
- package/dist/cli.js +0 -1
- package/dist/config/project-security.d.ts +0 -2
- package/dist/config/project-security.d.ts.map +1 -1
- package/dist/config/schema/magic-context.d.ts +0 -5
- package/dist/config/schema/magic-context.d.ts.map +1 -1
- package/dist/config-init.js +0 -1
- package/dist/{context-cx3y8abt.js → context-mrvm92n8.js} +3469 -3134
- package/dist/features/magic-context/memory-maintainer/oc2-adapter.d.ts +0 -6
- package/dist/features/magic-context/memory-maintainer/oc2-adapter.d.ts.map +1 -1
- package/dist/features/magic-context/migrations.d.ts +5 -0
- package/dist/features/magic-context/migrations.d.ts.map +1 -1
- package/dist/features/magic-context/session-project-backfill.d.ts +1 -1
- package/dist/features/magic-context/session-project-backfill.d.ts.map +1 -1
- package/dist/features/magic-context/storage-clone.d.ts.map +1 -1
- package/dist/features/magic-context/storage-db.d.ts +8 -0
- package/dist/features/magic-context/storage-db.d.ts.map +1 -1
- package/dist/features/magic-context/storage-tags.d.ts.map +1 -1
- package/dist/features/magic-context/storage.d.ts +1 -1
- package/dist/features/magic-context/storage.d.ts.map +1 -1
- package/dist/hooks/magic-context/cache-busting-signals.d.ts +6 -3
- package/dist/hooks/magic-context/cache-busting-signals.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts +0 -1
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-recomp.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-trigger.d.ts.map +1 -1
- package/dist/hooks/magic-context/default-protection-pressure.test-support.d.ts +37 -0
- package/dist/hooks/magic-context/default-protection-pressure.test-support.d.ts.map +1 -0
- package/dist/hooks/magic-context/drop-stale-reduce-calls.d.ts +4 -0
- package/dist/hooks/magic-context/drop-stale-reduce-calls.d.ts.map +1 -1
- package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
- package/dist/hooks/magic-context/latest-thinking-recovery.d.ts +61 -0
- package/dist/hooks/magic-context/latest-thinking-recovery.d.ts.map +1 -0
- package/dist/hooks/magic-context/lkg-replay.d.ts +9 -0
- package/dist/hooks/magic-context/lkg-replay.d.ts.map +1 -1
- package/dist/hooks/magic-context/lkg-slot.d.ts +2 -0
- package/dist/hooks/magic-context/lkg-slot.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-chunk.d.ts +8 -1
- package/dist/hooks/magic-context/read-session-chunk.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-true-raw-tokens.d.ts.map +1 -1
- package/dist/hooks/magic-context/strip-content.d.ts +4 -2
- package/dist/hooks/magic-context/strip-content.d.ts.map +1 -1
- package/dist/hooks/magic-context/system-injection-stripper.d.ts +7 -0
- package/dist/hooks/magic-context/system-injection-stripper.d.ts.map +1 -1
- package/dist/hooks/magic-context/tag-messages.d.ts.map +1 -1
- package/dist/hooks/magic-context/tail-hygiene-walk.d.ts.map +1 -1
- package/dist/hooks/magic-context/tool-drop-target.d.ts +5 -0
- package/dist/hooks/magic-context/tool-drop-target.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +23 -7
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts +0 -6
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/{index-wtb9hzk6.js → index-5b7x80ec.js} +126 -44
- package/dist/{index-dr0gepzw.js → index-btp5tdc8.js} +182 -31
- package/dist/{index-n0vnzz6h.js → index-g2z2k5m4.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/plugin/rpc-handlers.d.ts.map +1 -1
- package/dist/{read-session-chunk-82rkqa8j.js → read-session-chunk-2xm4sc4y.js} +1 -1
- package/dist/{recomp-orchestrator-vc5dkzy2.js → recomp-orchestrator-frmwj9hz.js} +3 -3
- package/dist/shared/pi-executable.d.ts +1 -1
- package/dist/shared/pi-executable.d.ts.map +1 -1
- package/dist/shared/prompt-surface-runtime.d.ts +1 -1
- package/dist/shared/subagent-runner.d.ts +22 -1
- package/dist/shared/subagent-runner.d.ts.map +1 -1
- package/dist/tools/light-descriptions.d.ts +1 -1
- package/dist/tools/light-descriptions.d.ts.map +1 -1
- package/dist/tools/parameter-descriptions.d.ts +1 -3
- package/dist/tools/parameter-descriptions.d.ts.map +1 -1
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/hooks/hidden-child.d.ts +15 -2
- package/dist/v2/hooks/hidden-child.d.ts.map +1 -1
- package/dist/v2/hooks/store.d.ts.map +1 -1
- package/dist/v2/server.js +3472 -2907
- package/dist/web/main.js +9 -3
- package/dist/{wrapup-orchestrator-x9xamts2.js → wrapup-orchestrator-yknks3ad.js} +3 -3
- package/package.json +1 -1
- package/src/agents/memory-maintainer.ts +12 -0
- package/src/config/index.test.ts +0 -17
- package/src/config/project-security.test.ts +0 -8
- package/src/config/project-security.ts +0 -9
- package/src/config/protected-tools.test.ts +72 -0
- package/src/config/schema/magic-context.test.ts +0 -6
- package/src/config/schema/magic-context.ts +1 -10
- package/src/shared/fold-render-lock-fence.test.ts +84 -0
- package/src/shared/fold-render-lock-fixtures.test.ts +270 -0
- package/src/shared/pi-executable.ts +3 -3
- package/src/shared/rpc-utils.test.ts +4 -5
- package/src/shared/sqlite-640-review.test.ts +184 -0
- package/src/shared/sqlite-context-pragmas.test.ts +105 -0
- package/src/shared/sqlite-writer-diagnostics.test.ts +136 -0
- package/src/shared/subagent-runner.ts +24 -0
- package/src/shared/tag-transcript.test.ts +55 -0
- package/src/shared/tag-transcript.ts +6 -0
- package/src/shared/write-transaction-attribution.test.ts +4 -0
- package/src/shared/write-transaction-timing.test.ts +39 -0
- package/dist/hooks/magic-context/historian-state-file.d.ts +0 -43
- package/dist/hooks/magic-context/historian-state-file.d.ts.map +0 -1
- package/dist/shared/auto-update-provenance.d.ts +0 -9
- package/dist/shared/auto-update-provenance.d.ts.map +0 -1
- package/src/shared/auto-update-provenance.ts +0 -42
|
@@ -72,7 +72,7 @@ import {
|
|
|
72
72
|
getRawSessionTagKeysThrough2,
|
|
73
73
|
getLegacyProtectedTailStartOrdinal2,
|
|
74
74
|
readSessionChunk2
|
|
75
|
-
} from "./index-
|
|
75
|
+
} from "./index-btp5tdc8.js";
|
|
76
76
|
import {
|
|
77
77
|
piModelRefToCanonical,
|
|
78
78
|
modelRefLookupOrder,
|
|
@@ -125,6 +125,9 @@ var MEMORY_MAINTAINER_B_AGENT = "magic-context-maintainer-b";
|
|
|
125
125
|
var MEMORY_MAINTAINER_A_ALLOWED_TOOLS = [];
|
|
126
126
|
var MEMORY_MAINTAINER_B_ALLOWED_TOOLS = ["read", "grep", "glob"];
|
|
127
127
|
var MEMORY_MAINTAINER_A_STEP_CAP = 4;
|
|
128
|
+
function resolveMaintenanceStepCap(baseSteps, consumedSteps) {
|
|
129
|
+
return Math.max(1, baseSteps - consumedSteps);
|
|
130
|
+
}
|
|
128
131
|
var MEMORY_MAINTAINER_A_SYSTEM_PROMPT = [
|
|
129
132
|
"You are the memory-maintenance stage A screener: a hidden background agent that",
|
|
130
133
|
"value-screens a coding project's long-term memory pool before a separate",
|
|
@@ -1100,12 +1103,12 @@ import { readFileSync as readFileSync2 } from "node:fs";
|
|
|
1100
1103
|
import { join } from "node:path";
|
|
1101
1104
|
|
|
1102
1105
|
// src/shared/pi-executable.ts
|
|
1103
|
-
var PI_IMAGE_NAMES = new Set(["pi", "pi.cmd"]);
|
|
1106
|
+
var PI_IMAGE_NAMES = new Set(["pi", "pi.cmd", "omp", "oh-my-pi"]);
|
|
1104
1107
|
function piHarnessKindFromExecutable(value) {
|
|
1105
1108
|
const executable = (value ?? "").trim().replace(/^['"]|['"]$/g, "").replaceAll("\\", "/").split("/").at(-1)?.toLowerCase().replace(/\.(?:exe|cmd)$/, "");
|
|
1106
1109
|
if (!executable || !PI_IMAGE_NAMES.has(executable))
|
|
1107
1110
|
return;
|
|
1108
|
-
return "pi";
|
|
1111
|
+
return executable === "pi" ? "pi" : "omp";
|
|
1109
1112
|
}
|
|
1110
1113
|
|
|
1111
1114
|
// src/shared/rpc-utils.ts
|
|
@@ -7520,7 +7523,6 @@ var HistorianConfigSchema = AgentMetadataSchema.extend({
|
|
|
7520
7523
|
var MagicContextConfigSchema = object({
|
|
7521
7524
|
enabled: boolean2().default(true).describe("Enable magic context (default: true)"),
|
|
7522
7525
|
allow_home_project: boolean2().default(false).describe("Allow Magic Context sessions launched from the exact canonical home directory. A non-git home uses its deterministic dir: identity; a home repository uses its git: identity. USER-LEVEL ONLY: project config is ignored. The home identity is excluded from registry seed exports, never resolves descendants by containment, and cannot join a workspace."),
|
|
7523
|
-
auto_update: boolean2().optional().describe("DEPRECATED no-op: the automatic update check was removed (the package is private-registry-only, so public npm checks always 404). The key is still accepted so existing configs keep parsing; upgrade via the host's own plugin update channel."),
|
|
7524
7526
|
language: string2().trim().toLowerCase().refine((s) => isValidLanguageCode(s), 'language must be a 2-letter ISO 639-1 code (e.g. "tr", "es", "de")').optional().describe("Output language for Magic Context's generated content and guidance, as a " + '2-letter ISO 639-1 code (e.g. "tr", "es", "de", "ja", "pt"). When set, the ' + "historian and the agent-guidance block instruct the model to " + "write its PROSE in this language while keeping all structural tokens (XML tags, " + "the five memory category names, code identifiers, file paths) in English. " + "USER-LEVEL ONLY (ignored in project config for security). Unset = today's " + "behavior (model mirrors the conversation; English scaffolding). Changing it " + "triggers one cache re-materialization; existing compartments/memories keep their " + "original language until naturally rewritten."),
|
|
7525
7527
|
profile: string2().trim().min(1).optional().describe("Select a named user-owned model profile. A valid project name overrides this user default; an empty string, null, or other non-string project value is ignored with a warning so the user selection still applies. Unknown names warn and use the base configuration."),
|
|
7526
7528
|
profiles: ConfigProfilesSchema.optional().describe("User-level named model profiles. A profile may contain only the flat historian model-resolution fields (model, fallback_models, OpenCode variant, Pi thinking_level). Project configs may select a name but cannot define profiles."),
|
|
@@ -9489,6 +9491,11 @@ var THINKING_BINDING_STRIP_ORDER_END_MARKER = "binding_mismatch_order:end";
|
|
|
9489
9491
|
function thinkingBindingRecoveryFrozenId(messageId) {
|
|
9490
9492
|
return `${THINKING_BINDING_RECOVERY_FROZEN_PREFIX}${messageId}`;
|
|
9491
9493
|
}
|
|
9494
|
+
function getThinkingBindingRecoveryTarget(db, sessionId) {
|
|
9495
|
+
const row = db.prepare("SELECT thinking_binding_recovery_target FROM session_meta WHERE session_id = ?").get(sessionId);
|
|
9496
|
+
const target = row?.thinking_binding_recovery_target;
|
|
9497
|
+
return typeof target === "string" && target.length > 0 ? target : null;
|
|
9498
|
+
}
|
|
9492
9499
|
function clearThinkingBindingRecoveryIf(db, sessionId, expectedTarget) {
|
|
9493
9500
|
const result = db.prepare("UPDATE session_meta SET thinking_binding_recovery_target = '' WHERE session_id = ? AND thinking_binding_recovery_target = ?").run(sessionId, expectedTarget);
|
|
9494
9501
|
return result.changes > 0;
|
|
@@ -9972,6 +9979,55 @@ function lkgContentDigestFromFields(fields) {
|
|
|
9972
9979
|
}
|
|
9973
9980
|
return hash.digest("base64url");
|
|
9974
9981
|
}
|
|
9982
|
+
var digestMemo = new Map;
|
|
9983
|
+
var DIGEST_MEMO_MAX_BYTES = 16 * 1024 * 1024;
|
|
9984
|
+
var digestMemoBytes = 0;
|
|
9985
|
+
function memoizedLkgContentDigestFromFields(id, fields) {
|
|
9986
|
+
const prior = digestMemo.get(id);
|
|
9987
|
+
if (prior && equalContentFields(fields, prior.fields)) {
|
|
9988
|
+
digestMemo.delete(id);
|
|
9989
|
+
digestMemo.set(id, prior);
|
|
9990
|
+
return prior.digest;
|
|
9991
|
+
}
|
|
9992
|
+
const digest = lkgContentDigestFromFields(fields);
|
|
9993
|
+
if (prior) {
|
|
9994
|
+
digestMemo.delete(id);
|
|
9995
|
+
digestMemoBytes -= prior.bytes;
|
|
9996
|
+
}
|
|
9997
|
+
const bytes = 128 + id.length * 2 + fields.reduce((sum, field) => sum + 16 + (typeof field === "string" ? field.length * 2 : 0), 0);
|
|
9998
|
+
if (bytes <= DIGEST_MEMO_MAX_BYTES) {
|
|
9999
|
+
while (digestMemoBytes + bytes > DIGEST_MEMO_MAX_BYTES || digestMemo.size >= 20000) {
|
|
10000
|
+
const oldest = digestMemo.entries().next().value;
|
|
10001
|
+
if (!oldest)
|
|
10002
|
+
break;
|
|
10003
|
+
digestMemo.delete(oldest[0]);
|
|
10004
|
+
digestMemoBytes -= oldest[1].bytes;
|
|
10005
|
+
}
|
|
10006
|
+
digestMemo.set(id, { fields: [...fields], digest, bytes });
|
|
10007
|
+
digestMemoBytes += bytes;
|
|
10008
|
+
}
|
|
10009
|
+
return digest;
|
|
10010
|
+
}
|
|
10011
|
+
function equalContentFields(left, right) {
|
|
10012
|
+
if (left === right)
|
|
10013
|
+
return true;
|
|
10014
|
+
if (left.length !== right.length)
|
|
10015
|
+
return false;
|
|
10016
|
+
for (let index = 0;index < left.length; index += 1) {
|
|
10017
|
+
if (!Object.is(left[index], right[index]))
|
|
10018
|
+
return false;
|
|
10019
|
+
}
|
|
10020
|
+
return true;
|
|
10021
|
+
}
|
|
10022
|
+
function exactReusablePrefix(current, prior) {
|
|
10023
|
+
if (!prior)
|
|
10024
|
+
return 0;
|
|
10025
|
+
let prefix = 0;
|
|
10026
|
+
while (prefix < current.length && prefix < prior.length && current[prefix]?.id === prior[prefix]?.id && equalContentFields(current[prefix]?.fields ?? [], prior[prefix]?.fields ?? [])) {
|
|
10027
|
+
prefix += 1;
|
|
10028
|
+
}
|
|
10029
|
+
return prefix;
|
|
10030
|
+
}
|
|
9975
10031
|
function lkgContentDigest(message) {
|
|
9976
10032
|
const fields = lkgContentFields(message);
|
|
9977
10033
|
return fields ? lkgContentDigestFromFields(fields) : null;
|
|
@@ -10755,6 +10811,13 @@ function getCurrentVersion(db) {
|
|
|
10755
10811
|
function isMigrationApplied(db, version) {
|
|
10756
10812
|
return db.prepare("SELECT 1 FROM schema_migrations WHERE version = ?").get(version) != null;
|
|
10757
10813
|
}
|
|
10814
|
+
function hasPendingMigrations(db) {
|
|
10815
|
+
const bookkeeping = db.prepare("SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = 'schema_migrations'").get();
|
|
10816
|
+
if (bookkeeping == null)
|
|
10817
|
+
return true;
|
|
10818
|
+
const currentVersion = getCurrentVersion(db);
|
|
10819
|
+
return MIGRATIONS.some((candidate) => candidate.version > currentVersion && !isMigrationApplied(db, candidate.version));
|
|
10820
|
+
}
|
|
10758
10821
|
function isSiblingMigrationConflict(db, error, version) {
|
|
10759
10822
|
if (!(error instanceof Error))
|
|
10760
10823
|
return false;
|
|
@@ -11532,7 +11595,7 @@ function finishDatabaseOpen(db, dbPath, explicitDbPath, latestSupportedVersion)
|
|
|
11532
11595
|
startMessageFtsRowidMapBackfill(db).then(async () => {
|
|
11533
11596
|
if (!readsOpenCodeStore)
|
|
11534
11597
|
return;
|
|
11535
|
-
const { readRawSessionMessagePage, readRawSessionMessages } = await import("./read-session-chunk-
|
|
11598
|
+
const { readRawSessionMessagePage, readRawSessionMessages } = await import("./read-session-chunk-2xm4sc4y.js");
|
|
11536
11599
|
const { startMessageTimeBackfill } = await import("./message-time-backfill-phrwp2fz.js");
|
|
11537
11600
|
await startMessageTimeBackfill(db, Object.assign(readRawSessionMessages, {
|
|
11538
11601
|
readPage: readRawSessionMessagePage
|
|
@@ -13052,12 +13115,23 @@ function openDatabase(dbPathOrOptions) {
|
|
|
13052
13115
|
closeQuietly(db);
|
|
13053
13116
|
return null;
|
|
13054
13117
|
}
|
|
13118
|
+
if (options?.allowMigrations === false && hasPendingMigrations(db)) {
|
|
13119
|
+
log(`[magic-context] storage not ready: pending migrations at ${dbPath}; host callers must await the async opener`);
|
|
13120
|
+
closeQuietly(db);
|
|
13121
|
+
return null;
|
|
13122
|
+
}
|
|
13055
13123
|
if (!enforceMigrationOnOpenGuard(db, dbPath, dbDir, latestSupportedVersion)) {
|
|
13056
13124
|
closeQuietly(db);
|
|
13057
13125
|
return null;
|
|
13058
13126
|
}
|
|
13059
13127
|
initializeDatabase(db, busyTimeoutMs);
|
|
13060
|
-
|
|
13128
|
+
if (options?.allowMigrations === false) {
|
|
13129
|
+
if (hasPendingMigrations(db)) {
|
|
13130
|
+
closeQuietly(db);
|
|
13131
|
+
return null;
|
|
13132
|
+
}
|
|
13133
|
+
} else
|
|
13134
|
+
runMigrations(db);
|
|
13061
13135
|
ensureContextStoreUuid(db);
|
|
13062
13136
|
return finishDatabaseOpen(db, dbPath, explicitDbPath, latestSupportedVersion);
|
|
13063
13137
|
} catch (error) {
|
|
@@ -13068,6 +13142,9 @@ function openDatabase(dbPathOrOptions) {
|
|
|
13068
13142
|
throw new Error(`[magic-context] storage unavailable: ${detail}. Magic Context is disabled for this run; check log for details.`);
|
|
13069
13143
|
}
|
|
13070
13144
|
}
|
|
13145
|
+
function openCurrentDatabase(options = {}) {
|
|
13146
|
+
return openDatabase({ ...options, allowMigrations: false });
|
|
13147
|
+
}
|
|
13071
13148
|
async function openDatabaseAsync(dbPathOrOptions) {
|
|
13072
13149
|
const options = typeof dbPathOrOptions === "string" ? { dbPath: dbPathOrOptions } : dbPathOrOptions;
|
|
13073
13150
|
const explicitDbPath = options?.dbPath !== undefined;
|
|
@@ -14638,7 +14715,8 @@ function clampWatermark(value, maxCopiedTag) {
|
|
|
14638
14715
|
}
|
|
14639
14716
|
function copySessionStateForClone(db, sourceSessionId, destinationSessionId, filter) {
|
|
14640
14717
|
return runImmediate(db, () => {
|
|
14641
|
-
|
|
14718
|
+
const hasTemporalDecisions = tableExists2(db, "temporal_decisions");
|
|
14719
|
+
if (countRows(db, "compartments", destinationSessionId) > 0 || countRows(db, "tags", destinationSessionId) > 0 || hasTemporalDecisions && countRows(db, "temporal_decisions", destinationSessionId) > 0 || filter.copySessionNotesAndFacts === true && (tableExists2(db, "notes") && countRows(db, "notes", destinationSessionId) > 0 || tableExists2(db, "session_facts") && countRows(db, "session_facts", destinationSessionId) > 0)) {
|
|
14642
14720
|
return {
|
|
14643
14721
|
kind: "destination-not-empty",
|
|
14644
14722
|
compartmentsCopied: 0,
|
|
@@ -14727,6 +14805,14 @@ function copySessionStateForClone(db, sourceSessionId, destinationSessionId, fil
|
|
|
14727
14805
|
insertPendingOp.run(destinationSessionId, row.tag_id, row.operation, row.queued_at, row.harness);
|
|
14728
14806
|
}
|
|
14729
14807
|
}
|
|
14808
|
+
if (hasTemporalDecisions) {
|
|
14809
|
+
const temporalRows = db.prepare("SELECT message_id,marker FROM temporal_decisions WHERE session_id=?").all(sourceSessionId);
|
|
14810
|
+
const insertTemporal = db.prepare("INSERT INTO temporal_decisions(session_id,message_id,marker) VALUES (?,?,?)");
|
|
14811
|
+
for (const row of temporalRows) {
|
|
14812
|
+
if (filter.includeMessageId(row.message_id))
|
|
14813
|
+
insertTemporal.run(destinationSessionId, mapMessageId(filter, row.message_id), row.marker);
|
|
14814
|
+
}
|
|
14815
|
+
}
|
|
14730
14816
|
const inherited = filter.copySessionNotesAndFacts === true ? copyPiSessionNotesAndFacts(db, sourceSessionId, destinationSessionId, filter) : { notesCopied: 0, factsCopied: 0 };
|
|
14731
14817
|
const meta = db.prepare(`SELECT cleared_reasoning_through_tag, tool_reclaim_watermark,
|
|
14732
14818
|
pi_stable_id_scheme, stripped_placeholder_ids,
|
|
@@ -16428,6 +16514,11 @@ class HiddenCompletionRefusal extends Error {
|
|
|
16428
16514
|
|
|
16429
16515
|
// src/v2/hooks/hidden-child.ts
|
|
16430
16516
|
import { createHash as createHash10 } from "node:crypto";
|
|
16517
|
+
|
|
16518
|
+
// src/shared/subagent-runner.ts
|
|
16519
|
+
var HISTORIAN_STEP_CAP = 4;
|
|
16520
|
+
|
|
16521
|
+
// src/v2/hooks/hidden-child.ts
|
|
16431
16522
|
var HIDDEN_HISTORIAN_AGENT = "historian";
|
|
16432
16523
|
var AGENT_TOOL_ALLOWLIST = {
|
|
16433
16524
|
[HIDDEN_HISTORIAN_AGENT]: [],
|
|
@@ -16435,8 +16526,12 @@ var AGENT_TOOL_ALLOWLIST = {
|
|
|
16435
16526
|
[MEMORY_MAINTAINER_B_AGENT]: MEMORY_MAINTAINER_B_ALLOWED_TOOLS
|
|
16436
16527
|
};
|
|
16437
16528
|
var AGENT_STEP_CAPS = {
|
|
16438
|
-
[MEMORY_MAINTAINER_A_AGENT]: MEMORY_MAINTAINER_A_STEP_CAP
|
|
16529
|
+
[MEMORY_MAINTAINER_A_AGENT]: MEMORY_MAINTAINER_A_STEP_CAP,
|
|
16530
|
+
[HIDDEN_HISTORIAN_AGENT]: HISTORIAN_STEP_CAP
|
|
16439
16531
|
};
|
|
16532
|
+
function resolveHistorianStepCap(maxSteps) {
|
|
16533
|
+
return typeof maxSteps === "number" && Number.isFinite(maxSteps) ? Math.min(maxSteps, HISTORIAN_STEP_CAP) : HISTORIAN_STEP_CAP;
|
|
16534
|
+
}
|
|
16440
16535
|
function hiddenAgentAllowedTools(agent) {
|
|
16441
16536
|
return agent !== undefined && Object.hasOwn(AGENT_TOOL_ALLOWLIST, agent) ? AGENT_TOOL_ALLOWLIST[agent] : undefined;
|
|
16442
16537
|
}
|
|
@@ -16450,7 +16545,7 @@ function hiddenChildPermissions(agent) {
|
|
|
16450
16545
|
}))
|
|
16451
16546
|
];
|
|
16452
16547
|
}
|
|
16453
|
-
async function registerHiddenChildAgents(agent) {
|
|
16548
|
+
async function registerHiddenChildAgents(agent, historianMaxSteps) {
|
|
16454
16549
|
await agent.transform((editor) => {
|
|
16455
16550
|
for (const id of Object.keys(AGENT_TOOL_ALLOWLIST)) {
|
|
16456
16551
|
editor.update(id, (config) => {
|
|
@@ -16461,7 +16556,7 @@ async function registerHiddenChildAgents(agent) {
|
|
|
16461
16556
|
config.request.settings = {};
|
|
16462
16557
|
config.request.headers = {};
|
|
16463
16558
|
config.request.body = {};
|
|
16464
|
-
const stepCap = AGENT_STEP_CAPS[id];
|
|
16559
|
+
const stepCap = id === HIDDEN_HISTORIAN_AGENT ? resolveHistorianStepCap(historianMaxSteps) : AGENT_STEP_CAPS[id];
|
|
16465
16560
|
if (stepCap !== undefined)
|
|
16466
16561
|
config.steps = stepCap;
|
|
16467
16562
|
config.permissions = hiddenChildPermissions(id);
|
|
@@ -16761,7 +16856,7 @@ var CTX_REDUCE_LIGHT_DESCRIPTION = `Stamp an item as no longer needed for the wo
|
|
|
16761
16856
|
var CTX_EXPAND_LIGHT_DESCRIPTION = "Recover one item with tag=N (a §N§ or dropped placeholder number), not a message ordinal; text or one tool call with full input/output. message=N and start/end are whole-message ordinals from history/search, never tag numbers. Recover raw conversation behind a <session-history> heading or around a mmc_search hit: mmc_expand(start, end) returns [N] U:/A: lines (~15K-token cap; oversized ranges return the head and where to continue). verbose=true lists messages with per-part previews to pick one; message=N returns that message in full, including a tool output released with mmc_reduce. Ranges after the last compartment are your live tail, not expandable.";
|
|
16762
16857
|
var CTX_NOTE_LIGHT_DESCRIPTION = 'Session notes are pending intentions: work you intend to return to, with findings attached ("take a note" always qualifies). Not active steps, an executing plan, or restart insurance; a record of how things stand (world-state, a design at a point in time) with nothing you intend to do about it — that goes stale silently; a fact worth keeping is memory, the rest is nothing. First line = title (<80 chars). write saves; read lists rows (note_ids for bodies); update changes one; dismiss retires 1–50. Dismiss a note when its work lands or is abandoned; a queue you never dismiss from stops being read.';
|
|
16763
16858
|
var CTX_MEMORY_LIGHT_DESCRIPTION = "Durable facts about this project, shared with every agent on it and kept for the months this work lasts; active ones are already in <project-memory> as `#id: fact`. Write one standalone fact when it must not have to be found again — a rule, an architecture fact, a constraint, a config value, a naming convention — especially what cost you turns. A pending intention with evidence is mmc_note, not memory. write (content + category); update one id (content; category optional); archive one or more ids (reason optional); merge two or more ids (content); get 1–20 ids in any status.";
|
|
16764
|
-
var CTX_SEARCH_LIGHT_DESCRIPTION = 'Search
|
|
16859
|
+
var CTX_SEARCH_LIGHT_DESCRIPTION = 'Search past context not on your desk: memories not in <project-memory>, compacted conversation, notes. Phrase query as a natural-language question carrying the exact terms you expect ("where is the opencode source code path?", "why did we choose SQLite over postgres?", "how does the historian lease work?") — a keyword stack finds less. Sources (omit for all): memory (rules, conventions), message (compacted conversation; hits carry ordinals for mmc_expand), primer (stored project Q&A), note (parked follow-ups). Memory ids alone (`#7234`) resolve directly. from/to restrict every source to an inclusive UTC date range.';
|
|
16765
16860
|
|
|
16766
16861
|
// src/shared/prompt-surface-runtime.ts
|
|
16767
16862
|
var GUIDANCE_MARKER = "## Magic Context";
|
|
@@ -20364,6 +20459,7 @@ function softRefreshCachedM1(options) {
|
|
|
20364
20459
|
steps.mark("commit");
|
|
20365
20460
|
logSlowWriteTransaction("opencode_soft_refresh_cache", transactionStartedAt, undefined, performance.now(), steps.durations);
|
|
20366
20461
|
options.state.cachedM1Bytes = m1Bytes;
|
|
20462
|
+
options.state.cachedM0UpgradeState = withCachedM0MemoryIds(row.cached_m0_upgrade_state, renderedM0Ids);
|
|
20367
20463
|
options.state.snapshotMarkers = markers;
|
|
20368
20464
|
return rendered;
|
|
20369
20465
|
} catch (error) {
|
|
@@ -21651,28 +21747,6 @@ function insertCompartmentEvents(db, sessionId, events, compartmentIds) {
|
|
|
21651
21747
|
stmt.run(sessionId, compartmentId, ev.kind, ev.atCompartment, JSON.stringify(ev.fields ?? {}), now, harness);
|
|
21652
21748
|
}
|
|
21653
21749
|
}
|
|
21654
|
-
|
|
21655
|
-
// src/hooks/magic-context/historian-publish-stage-logger.ts
|
|
21656
|
-
function startHistorianPublishStage(sessionId, stage, extra) {
|
|
21657
|
-
const suffix = extra ? ` ${extra}` : "";
|
|
21658
|
-
sessionLog(sessionId, `historian publish stage: stage=${stage} status=started elapsed=0.0ms${suffix}`);
|
|
21659
|
-
return performance.now();
|
|
21660
|
-
}
|
|
21661
|
-
function finishHistorianPublishStage(sessionId, stage, startMs, status = "completed", extra) {
|
|
21662
|
-
const elapsed = (performance.now() - startMs).toFixed(1);
|
|
21663
|
-
const suffix = extra ? ` ${extra}` : "";
|
|
21664
|
-
sessionLog(sessionId, `historian publish stage: stage=${stage} status=${status} elapsed=${elapsed}ms${suffix}`);
|
|
21665
|
-
}
|
|
21666
|
-
|
|
21667
|
-
// src/hooks/magic-context/historian-state-file.ts
|
|
21668
|
-
import { mkdirSync, unlinkSync as unlinkSync2, writeFileSync } from "node:fs";
|
|
21669
|
-
function cleanupHistorianStateFile(path) {
|
|
21670
|
-
if (!path)
|
|
21671
|
-
return;
|
|
21672
|
-
try {
|
|
21673
|
-
unlinkSync2(path);
|
|
21674
|
-
} catch {}
|
|
21675
|
-
}
|
|
21676
21750
|
// src/features/magic-context/memory/promotion.ts
|
|
21677
21751
|
function isPromotableCategory(category) {
|
|
21678
21752
|
return PROMOTABLE_CATEGORIES.some((promotableCategory) => promotableCategory === category);
|
|
@@ -23049,7 +23123,7 @@ function queueDropsForCompartmentalizedMessages(db, sessionId, upToMessageIndex,
|
|
|
23049
23123
|
}
|
|
23050
23124
|
|
|
23051
23125
|
// src/hooks/magic-context/compartment-runner-historian.ts
|
|
23052
|
-
import { mkdirSync
|
|
23126
|
+
import { mkdirSync, unlinkSync as unlinkSync2, writeFileSync } from "node:fs";
|
|
23053
23127
|
import { join as join5 } from "node:path";
|
|
23054
23128
|
|
|
23055
23129
|
// src/agents/historian.ts
|
|
@@ -23655,6 +23729,18 @@ function mapParsedCompartmentsToChunk(compartments, chunk, sequenceOffset) {
|
|
|
23655
23729
|
return { ok: true, compartments: mapped };
|
|
23656
23730
|
}
|
|
23657
23731
|
|
|
23732
|
+
// src/hooks/magic-context/historian-publish-stage-logger.ts
|
|
23733
|
+
function startHistorianPublishStage(sessionId, stage, extra) {
|
|
23734
|
+
const suffix = extra ? ` ${extra}` : "";
|
|
23735
|
+
sessionLog(sessionId, `historian publish stage: stage=${stage} status=started elapsed=0.0ms${suffix}`);
|
|
23736
|
+
return performance.now();
|
|
23737
|
+
}
|
|
23738
|
+
function finishHistorianPublishStage(sessionId, stage, startMs, status = "completed", extra) {
|
|
23739
|
+
const elapsed = (performance.now() - startMs).toFixed(1);
|
|
23740
|
+
const suffix = extra ? ` ${extra}` : "";
|
|
23741
|
+
sessionLog(sessionId, `historian publish stage: stage=${stage} status=${status} elapsed=${elapsed}ms${suffix}`);
|
|
23742
|
+
}
|
|
23743
|
+
|
|
23658
23744
|
// src/hooks/magic-context/compartment-runner-validation.ts
|
|
23659
23745
|
var MIN_RECOMP_CHUNK_TOKEN_BUDGET = 20;
|
|
23660
23746
|
var HISTORIAN_BOUNDARY_HEALING_SLACK = 2;
|
|
@@ -24467,7 +24553,7 @@ function cleanupHistorianDump(sessionId, dumpPath) {
|
|
|
24467
24553
|
if (!dumpPath)
|
|
24468
24554
|
return;
|
|
24469
24555
|
try {
|
|
24470
|
-
|
|
24556
|
+
unlinkSync2(dumpPath);
|
|
24471
24557
|
} catch (error) {
|
|
24472
24558
|
sessionLog(sessionId, "compartment agent: failed to remove historian response dump", {
|
|
24473
24559
|
dumpPath,
|
|
@@ -24478,12 +24564,12 @@ function cleanupHistorianDump(sessionId, dumpPath) {
|
|
|
24478
24564
|
function dumpHistorianResponse(sessionId, directory, label, text) {
|
|
24479
24565
|
try {
|
|
24480
24566
|
const dumpDir = historianResponseDumpDir(directory);
|
|
24481
|
-
|
|
24567
|
+
mkdirSync(dumpDir, { recursive: true });
|
|
24482
24568
|
ensureMmcArtifactGitignore(directory);
|
|
24483
24569
|
const safeSessionId = sanitizeDumpName(sessionId);
|
|
24484
24570
|
const safeLabel = sanitizeDumpName(label);
|
|
24485
24571
|
const dumpPath = join5(dumpDir, `${safeSessionId}-${safeLabel}-${Date.now()}.xml`);
|
|
24486
|
-
|
|
24572
|
+
writeFileSync(dumpPath, text, "utf8");
|
|
24487
24573
|
sessionLog(sessionId, "compartment agent: historian response dumped", {
|
|
24488
24574
|
label,
|
|
24489
24575
|
dumpPath
|
|
@@ -26591,7 +26677,6 @@ async function runCompartmentAgent(deps) {
|
|
|
26591
26677
|
let publishCommitted = false;
|
|
26592
26678
|
let retainDrainReservationForRetryThrottle = false;
|
|
26593
26679
|
let issueNotified = false;
|
|
26594
|
-
let stateFilePath;
|
|
26595
26680
|
let drainReservation = null;
|
|
26596
26681
|
const runStartedAt = Date.now();
|
|
26597
26682
|
const invocationBaseline = getLatestHistorianInvocationId(db, sessionId);
|
|
@@ -27008,7 +27093,7 @@ ${chunkText}`,
|
|
|
27008
27093
|
const preparedDrops = prepareCompartmentDrops(db, sessionId, lastCompartmentEnd, compartmentTagKeys, offset);
|
|
27009
27094
|
let published = false;
|
|
27010
27095
|
const transactionStartedAt = startHistorianPublishStage(sessionId, "publish-txn");
|
|
27011
|
-
await beginSqliteWriterAsync(db, "historian-publish");
|
|
27096
|
+
const lockAcquiredAt = await beginSqliteWriterAsync(db, "historian-publish");
|
|
27012
27097
|
try {
|
|
27013
27098
|
if (!isCompartmentLeaseHeld(db, sessionId, holderId)) {
|
|
27014
27099
|
db.exec("ROLLBACK");
|
|
@@ -27061,7 +27146,7 @@ ${chunkText}`,
|
|
|
27061
27146
|
published = true;
|
|
27062
27147
|
publishCommitted = true;
|
|
27063
27148
|
finishHistorianPublishStage(sessionId, "publish-txn", transactionStartedAt, "completed", `compartments=${persistedCompartments.length}`);
|
|
27064
|
-
logSlowWriteTransaction("historian-publish",
|
|
27149
|
+
logSlowWriteTransaction("historian-publish", lockAcquiredAt);
|
|
27065
27150
|
} catch (error) {
|
|
27066
27151
|
finishHistorianPublishStage(sessionId, "publish-txn", transactionStartedAt, "failed");
|
|
27067
27152
|
throw error;
|
|
@@ -27162,7 +27247,6 @@ ${chunkText}`,
|
|
|
27162
27247
|
updateSessionMeta(db, sessionId, { compartmentInProgress: false });
|
|
27163
27248
|
}
|
|
27164
27249
|
recordTelemetry();
|
|
27165
|
-
cleanupHistorianStateFile(stateFilePath);
|
|
27166
27250
|
}
|
|
27167
27251
|
}
|
|
27168
27252
|
|
|
@@ -27243,7 +27327,6 @@ Could not acquire the compartment-state lease for this session.`;
|
|
|
27243
27327
|
logPostPublishFailure(step, error);
|
|
27244
27328
|
}
|
|
27245
27329
|
};
|
|
27246
|
-
let currentStateFilePath;
|
|
27247
27330
|
updateSessionMeta(db, sessionId, { compartmentInProgress: true });
|
|
27248
27331
|
try {
|
|
27249
27332
|
const rawMessageCount = getRawSessionMessageCount2(sessionId);
|
|
@@ -27580,7 +27663,6 @@ Another process acquired the compartment-state lease before recomp could publish
|
|
|
27580
27663
|
${renderUserFacingFailure("recomp_unavailable")}`;
|
|
27581
27664
|
} finally {
|
|
27582
27665
|
updateSessionMeta(db, sessionId, { compartmentInProgress: false });
|
|
27583
|
-
cleanupHistorianStateFile(currentStateFilePath);
|
|
27584
27666
|
}
|
|
27585
27667
|
}
|
|
27586
27668
|
|
|
@@ -28095,4 +28177,4 @@ async function executeContextRecomp(deps, options = {}) {
|
|
|
28095
28177
|
return (await executeContextRecompWithResult(deps, options)).message;
|
|
28096
28178
|
}
|
|
28097
28179
|
|
|
28098
|
-
export { MEMORY_MAINTAINER_A_AGENT, MEMORY_MAINTAINER_B_AGENT, MEMORY_MAINTAINER_A_STEP_CAP, MEMORY_MAINTAINER_A_SYSTEM_PROMPT, MEMORY_MAINTAINER_B_SYSTEM_PROMPT, MEMORY_MAINTAINER_FINALIZE_INSTRUCTION, buildMemoryMaintainerStageAPrompt, buildMemoryMaintainerStageBPrompt, getOpenCodeGlobalConfigDir, getOpenCodeConfigDirs, opencodeUserConfigBasePath, mmcProjectConfigBasePath, buildPrimaryLanguageDirective, resolveModelConfigValue, DEFAULT_EXECUTE_THRESHOLD_PERCENTAGE, PROTECTED_TOKENS_MIN, HISTORIAN_MODEL_RESOLUTION_FIELDS, LEGACY_HARNESS_BLOCK_KEYS, ConfigProfilesSchema, MagicContextConfigSchema, LIVE_RELOAD_CONFIG_PATHS, formatFailClosedBlockingMessage, formatFailClosedBlockingSummary, createFailClosedBlockingError, isFailClosedBlockingError, setHomeProjectPermission, shouldSkipHomeProjectMemory, ProjectIdentityError, takeDubiousOwnershipProjectIdentityWarning, isUserHomeDirectory, describeUnresolvedProjectIdentity, resolveProjectIdentityForSession, normalizeStoredProjectPath, storedPathBelongsToIdentity, V2_MEMORY_CATEGORIES, CATEGORY_PRIORITY, computeNormalizedHash, hasMemoryShareableColumn, hasMemoryClassifiedAtColumn, ModuleMemoryAuthorityError, insertMemory, insertMemoryIdempotent, getMemoryByHash, getMemoriesByProject, getMemoriesByProjects, getMemoryById, getMemoriesByIds, updateMemorySeenCount, updateMemoryRetrievalCount, supersededMemory, mergeMemoryStats, archiveMemory, relaxedFtsQuery, sanitizeFtsQuery, searchMemoriesFTS, searchMemoriesFTSUnion, clearMemoryVerifications, queueMemoryMutation, registerOwnRpcServerInstance, rpcPortDir, rpcPortFilePath, parseRpcPortFile, inspectProcessesAsync, COMPARTMENT_LEASE_RENEWAL_MS, acquireCompartmentLease, renewCompartmentLease, releaseCompartmentLeaseBestEffort, isCompartmentLeaseHeld, queueM0Mutation, getMaxM0MutationId, clearCachedM0M1, getCompartments, getLastCompartmentEndMessage, getLastCompartmentEndMessageId, getAuthorityManagedMarker, getLastIndexedOrdinal, getIndexedMessageIdAtOrdinal, getIndexedMessageCorpusSize, getMessageIndexReconciliationStartOrdinal, isMessageIndexReconciledThrough, clearIndexedMessages, indexMessagesAfterOrdinal, layoutLkgPrefix, assembleLkgPrefix, getTemporalDecisions, observeTemporalDecisions, freezeTemporalDecisions, MAX_EXECUTE_THRESHOLD, escalationBands, MERGED_REASONING_PARTS_PREFIX, readFrozenMergedReasoningParts, HYGIENE_PROVIDER_UNITS_VERSION, sessionDecisionCalibration, transitionSessionHygieneUnits, getProtectionWindowForSession, ReplayDocumentError, readReplayEnvelope, updateReplayDocument, isEmergencyRecoveryArmed, loadPersistedUsage, loadProtectedTailMeta, resetProtectedTailNoEligibleHead, getWrapupInProgressState, acquireWrapupInProgress, updateWrapupInProgress, releaseWrapupInProgress, resolveCompactionModeRecord, getCompactionModeRecord, setCompactionModeRecord, getProtectedTailDrainBudgetSkip, clearPersistedReasoningWatermark, getEmergencyInputSample, setEmergencyDropSample, clearEmergencyDropSample, getLastNudgeUndropped, setLastNudgeUndropped, getChannel1NudgeState, setChannel1NudgeState, markChannel1PostReduceGracePending, captureChannel1PostReduceGraceBaseline, getChannel2NudgeState, setChannel2NudgeState, casChannel2NudgeState, claimChannel2NudgeState, casChannel2NudgeClaim, getAutoSearchHintDecisions, appendAutoSearchHintDecision, pruneAutoSearchHintDecisions, getPersistedTodoPermissionDenied, setPersistedTodoPermissionDenied, getPersistedTodoSyntheticAnchor, setPersistedTodoSyntheticAnchor, clearPersistedTodoSyntheticAnchor, getHistorianFailureState, clearHistorianFailureState, getOverflowState, loadTransformPassStateSnapshot, recordOverflowDetected, recordDetectedContextLimit, clearEmergencyRecovery, clearDetectedContextLimit, getPersistedCompactionMarkerState, setPersistedCompactionMarkerState, getDeferredClearedCompactionMarkerState, retireDeferredClearedCompactionMarkerState, applyStrippedPlaceholderDelta, THINKING_BINDING_RECOVERY_FROZEN_PREFIX, thinkingBindingRecoveryFrozenId, clearThinkingBindingRecoveryIf, getMergedReasoningStrippedIds, addMergedReasoningStrippedIds, getTrailingBlankDecisions, addTrailingBlankDecisions, demoteTrailingBlankKeepDecisions, addStaleReduceStrippedIds, addProcessedImageStrippedIds, getPendingCompactionMarkerState, getCompactionMarkerHealth, loadPostprocessReplaySnapshot, clearPendingCompactionMarkerStateIf, setSessionWorkMetrics, getObservedEpochFloor, resolveEpochFloorForPass, BoundedSessionMap, beginLkgPass, lkgContentDigest, captureSlot, getInMemorySlot, getSlot, dropSlot, noteEntry, getLkgSlotHeapStats, useScopedToolSweep, createPreAdoptionToolSweepResolver, copySessionStateForClone, scheduleAfterBootQuiet, getSchemaFenceRejection, getMigrationOnOpenRefusal, LATEST_SUPPORTED_VERSION, getPersistedSchemaVersion,
|
|
28180
|
+
export { MEMORY_MAINTAINER_A_AGENT, MEMORY_MAINTAINER_B_AGENT, MEMORY_MAINTAINER_A_STEP_CAP, resolveMaintenanceStepCap, MEMORY_MAINTAINER_A_SYSTEM_PROMPT, MEMORY_MAINTAINER_B_SYSTEM_PROMPT, MEMORY_MAINTAINER_FINALIZE_INSTRUCTION, buildMemoryMaintainerStageAPrompt, buildMemoryMaintainerStageBPrompt, getOpenCodeGlobalConfigDir, getOpenCodeConfigDirs, opencodeUserConfigBasePath, mmcProjectConfigBasePath, buildPrimaryLanguageDirective, resolveModelConfigValue, DEFAULT_EXECUTE_THRESHOLD_PERCENTAGE, PROTECTED_TOKENS_MIN, HISTORIAN_MODEL_RESOLUTION_FIELDS, LEGACY_HARNESS_BLOCK_KEYS, ConfigProfilesSchema, MagicContextConfigSchema, LIVE_RELOAD_CONFIG_PATHS, formatFailClosedBlockingMessage, formatFailClosedBlockingSummary, createFailClosedBlockingError, isFailClosedBlockingError, setHomeProjectPermission, shouldSkipHomeProjectMemory, ProjectIdentityError, takeDubiousOwnershipProjectIdentityWarning, isUserHomeDirectory, describeUnresolvedProjectIdentity, resolveProjectIdentityForSession, normalizeStoredProjectPath, storedPathBelongsToIdentity, V2_MEMORY_CATEGORIES, CATEGORY_PRIORITY, computeNormalizedHash, hasMemoryShareableColumn, hasMemoryClassifiedAtColumn, ModuleMemoryAuthorityError, insertMemory, insertMemoryIdempotent, getMemoryByHash, getMemoriesByProject, getMemoriesByProjects, getMemoryById, getMemoriesByIds, updateMemorySeenCount, updateMemoryRetrievalCount, supersededMemory, mergeMemoryStats, archiveMemory, relaxedFtsQuery, sanitizeFtsQuery, searchMemoriesFTS, searchMemoriesFTSUnion, clearMemoryVerifications, queueMemoryMutation, registerOwnRpcServerInstance, rpcPortDir, rpcPortFilePath, parseRpcPortFile, inspectProcessesAsync, COMPARTMENT_LEASE_RENEWAL_MS, acquireCompartmentLease, renewCompartmentLease, releaseCompartmentLeaseBestEffort, isCompartmentLeaseHeld, queueM0Mutation, getMaxM0MutationId, ensureSessionMetaRow, clearCachedM0M1, getCompartments, getLastCompartmentEndMessage, getLastCompartmentEndMessageId, getAuthorityManagedMarker, getLastIndexedOrdinal, getIndexedMessageIdAtOrdinal, getIndexedMessageCorpusSize, getMessageIndexReconciliationStartOrdinal, isMessageIndexReconciledThrough, clearIndexedMessages, indexMessagesAfterOrdinal, layoutLkgPrefix, assembleLkgPrefix, getTemporalDecisions, observeTemporalDecisions, freezeTemporalDecisions, MAX_EXECUTE_THRESHOLD, escalationBands, MERGED_REASONING_PARTS_PREFIX, decodeMergedReasoningParts, readFrozenMergedReasoningParts, HYGIENE_PROVIDER_UNITS_VERSION, sessionDecisionCalibration, transitionSessionHygieneUnits, getProtectionWindowForSession, ReplayDocumentError, readReplayEnvelope, updateReplayDocument, isEmergencyRecoveryArmed, loadPersistedUsage, loadProtectedTailMeta, resetProtectedTailNoEligibleHead, getWrapupInProgressState, acquireWrapupInProgress, updateWrapupInProgress, releaseWrapupInProgress, resolveCompactionModeRecord, getCompactionModeRecord, setCompactionModeRecord, getProtectedTailDrainBudgetSkip, clearPersistedReasoningWatermark, getEmergencyInputSample, setEmergencyDropSample, clearEmergencyDropSample, getLastNudgeUndropped, setLastNudgeUndropped, getChannel1NudgeState, setChannel1NudgeState, markChannel1PostReduceGracePending, captureChannel1PostReduceGraceBaseline, getChannel2NudgeState, setChannel2NudgeState, casChannel2NudgeState, claimChannel2NudgeState, casChannel2NudgeClaim, getAutoSearchHintDecisions, appendAutoSearchHintDecision, pruneAutoSearchHintDecisions, getPersistedTodoPermissionDenied, setPersistedTodoPermissionDenied, getPersistedTodoSyntheticAnchor, setPersistedTodoSyntheticAnchor, clearPersistedTodoSyntheticAnchor, getHistorianFailureState, clearHistorianFailureState, getOverflowState, loadTransformPassStateSnapshot, recordOverflowDetected, recordDetectedContextLimit, clearEmergencyRecovery, clearDetectedContextLimit, getPersistedCompactionMarkerState, setPersistedCompactionMarkerState, getDeferredClearedCompactionMarkerState, retireDeferredClearedCompactionMarkerState, applyStrippedPlaceholderDelta, THINKING_BINDING_RECOVERY_FROZEN_PREFIX, thinkingBindingRecoveryFrozenId, getThinkingBindingRecoveryTarget, clearThinkingBindingRecoveryIf, getMergedReasoningStrippedIds, addMergedReasoningStrippedIds, getTrailingBlankDecisions, addTrailingBlankDecisions, demoteTrailingBlankKeepDecisions, addStaleReduceStrippedIds, addProcessedImageStrippedIds, getPendingCompactionMarkerState, getCompactionMarkerHealth, loadPostprocessReplaySnapshot, clearPendingCompactionMarkerStateIf, setSessionWorkMetrics, getObservedEpochFloor, resolveEpochFloorForPass, BoundedSessionMap, beginLkgPass, lkgContentFields, lkgContentDigestFromFields, memoizedLkgContentDigestFromFields, exactReusablePrefix, lkgContentDigest, captureSlot, getInMemorySlot, getSlot, dropSlot, noteEntry, getLkgSlotHeapStats, TOOL_SWEEP_SCOPED_MARKER, useScopedToolSweep, createPreAdoptionToolSweepResolver, copySessionStateForClone, scheduleAfterBootQuiet, getSchemaFenceRejection, getMigrationOnOpenRefusal, LATEST_SUPPORTED_VERSION, getPersistedSchemaVersion, openCurrentDatabase, openDatabaseAsync, isDatabasePersisted, getDatabasePersistenceError, gaDatabasePath, RAW_MESSAGE_TYPES, V2StoreReaderPool, getOrCreateSessionMeta, updateSessionMeta, advanceToolReclaimWatermark, markSessionCleanupPending, clearSession, getNoteByIdInScope, getNotes, addNote, getSessionNotes, updateNote, dismissNotes, dismissNote, getActivePrimers, saveSourceContent, replaceSourceContent, getSourceContents, resolveWorkspaceShareCategories, resolveWorkspaceIdentitySet, expandWorkspaceIdentitySetWithAliases, resolveStoredPathWorkspaceIdentity, storedPathBelongsToWorkspace, sourceNameForMemory, rebaseSessionCoordinatesAsync, renderUserFacingFailure, userFacingFailureCode, renderCapabilityRefusal, HiddenCompletionRefusal, HIDDEN_HISTORIAN_AGENT, resolveHistorianStepCap, hiddenChildPermissions, registerHiddenChildAgents, HiddenAgentStepLimit, HiddenChildHook, parseProviderModel, toModelEntry, ACTIVE_TOOL_IDS, promptSurfaceHashMaterial, createPromptSurfaceRuntime, createPromptSurfaceGuidanceEpochCache, getOpenCodeDbPath, compareOpenCodeMessagesByCanonicalOrder, removeMcOwnedCompactionMarkers, MARKER_SUMMARY_TEXT, applyDeferredCompactionMarker, HISTORIAN_AGENT, HISTORIAN_RECOMP_AGENT, HISTORIAN_EDITOR_AGENT, runTokenLog, extractM0Block, TEMPORAL_MARKER_REPLAY_PATTERN, collectTemporalCandidates, injectTemporalMarkers, clearInjectionCache, getVisibleMemoryIds, selectHiddenMessagesAtCompactionSeam, prepareCompartmentInjection, renderCompartmentInjection, MaterializeContentionError, mustMaterialize, trimMemoriesToBudgetV2, renderMemoryBlockV2, materializeM0, resetPrefixTrimFallbackState, findHostCompactionWindow, capturePrefixTrimSourceOrder, prepareCachedM0M1Replay, hasCompleteCachedM0M1, injectM0M1, describeBoundaryDiagnostics, RECOVERY_NO_HEAD_LIMIT, deriveProtectedTailTokenTarget, selectPerRunCap, resolveOpenCodeProtectedTailBoundary, resolveWrapupProtectedTailBoundary, getRawHistoryEligibility, hasRunnableCompartmentWindow, recordHighPressureNoEligibleHead, runCompartmentAgent, getActiveCompartmentRun, markActiveCompartmentRunPublished, registerActiveCompartmentRun, startCompartmentAgent, executeContextRecomp };
|