@cortexkit/pi-magic-context 0.49.10 → 0.49.12

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.
Files changed (46) hide show
  1. package/dist/auto-search-worker.js +4 -4
  2. package/dist/{compaction-marker-candidates-n4dphyz4.js → compaction-marker-candidates-k4tqg4jb.js} +2 -2
  3. package/dist/compaction-marker-candidates-worker.js +1 -1
  4. package/dist/embedding-backfill-14tqcfrn.js +20 -0
  5. package/dist/embedding-worker-process.js +1 -1
  6. package/dist/embedding-worker.js +5 -5
  7. package/dist/historian-calibration-extension.js +1 -1
  8. package/dist/{index-ta0ed2nc.js → index-1k729e4f.js} +15 -15
  9. package/dist/{index-g13fb2sj.js → index-3cnarwf8.js} +4 -4
  10. package/dist/{index-729kkhmf.js → index-46q4e104.js} +1 -1
  11. package/dist/{index-9vzkrnrf.js → index-53xdqb3d.js} +30 -26
  12. package/dist/{index-szh001qb.js → index-6dz2ed1v.js} +2 -2
  13. package/dist/{index-gqxsds3q.js → index-6ex901g3.js} +187 -27
  14. package/dist/{index-h160xxaq.js → index-6hex51s9.js} +8 -8
  15. package/dist/{index-gycf3sp7.js → index-7bqrfyny.js} +46 -2
  16. package/dist/{index-6e3yv1jt.js → index-af9nb5db.js} +243 -135
  17. package/dist/{index-3veejgp8.js → index-apgwdby5.js} +1 -1
  18. package/dist/{index-43zqh10z.js → index-d4dt19md.js} +1 -1
  19. package/dist/{index-fdxzpnbj.js → index-djxc8w8c.js} +1 -1
  20. package/dist/{index-x7426vy4.js → index-ed9d2ded.js} +18 -5
  21. package/dist/{index-kh3jt7t9.js → index-f18ec69t.js} +1 -1
  22. package/dist/{index-qc8e13wc.js → index-f6e8jsrh.js} +140 -17
  23. package/dist/{index-4pxydwvg.js → index-g4jf772p.js} +1 -1
  24. package/dist/{index-ns319t8e.js → index-gykw2zhn.js} +16 -11
  25. package/dist/{index-4vj37yw9.js → index-he9s4qsj.js} +16 -6
  26. package/dist/{index-8yjhda46.js → index-j24916mq.js} +3 -3
  27. package/dist/{index-ttxsmaj5.js → index-jrap43gc.js} +1 -1
  28. package/dist/{index-v26j81w6.js → index-xpsht877.js} +5 -5
  29. package/dist/{index-243wh86p.js → index-z5ftst3e.js} +9 -9
  30. package/dist/{index-rkwh9kce.js → index-zapgkmp7.js} +58 -34
  31. package/dist/index.js +453 -240
  32. package/dist/{logger-qg51hmp7.js → logger-dygt96rn.js} +1 -1
  33. package/dist/{message-index-bounded-y1c88n9a.js → message-index-bounded-ws37m1nt.js} +13 -13
  34. package/dist/{message-index-ejaa9may.js → message-index-dfs6k35a.js} +13 -13
  35. package/dist/{message-time-backfill-q9s88zdv.js → message-time-backfill-r2ar1qvk.js} +2 -2
  36. package/dist/migration-worker.js +9 -9
  37. package/dist/{project-embedding-registry-bxawck58.js → project-embedding-registry-ymvne11v.js} +10 -10
  38. package/dist/raw-ordinal-warmup-worker.js +12 -7
  39. package/dist/{read-session-chunk-4094zemt.js → read-session-chunk-83864b37.js} +8 -8
  40. package/dist/{read-session-raw-hm7ptnrh.js → read-session-raw-azkqjgzg.js} +6 -2
  41. package/dist/{safe-notification-target-62ty6rvp.js → safe-notification-target-2rkvkmw8.js} +2 -2
  42. package/dist/{search-hsr95vex.js → search-85e21wb8.js} +19 -19
  43. package/dist/{storage-tags-zh23ynsh.js → storage-tags-zmf30zqp.js} +6 -4
  44. package/dist/subagent-entry.js +22 -22
  45. package/package.json +1 -1
  46. package/dist/embedding-backfill-chva00z3.js +0 -20
@@ -7,7 +7,7 @@ import {
7
7
  getMagicContextStorageDir,
8
8
  log2,
9
9
  sessionLog2
10
- } from "./index-gycf3sp7.js";
10
+ } from "./index-7bqrfyny.js";
11
11
  import {
12
12
  piModelRefToCanonical,
13
13
  modelRefLookupOrder,
@@ -20,7 +20,7 @@ import {
20
20
  PER_HARNESS_MODEL_KEYS,
21
21
  ConfigProfilesSchema,
22
22
  MagicContextConfigSchema
23
- } from "./index-ta0ed2nc.js";
23
+ } from "./index-1k729e4f.js";
24
24
  import {
25
25
  MERGED_REASONING_PARTS_PREFIX,
26
26
  decodeMergedReasoningParts,
@@ -56,7 +56,7 @@ import {
56
56
  readRawSessionMessageIdOrdinalsForRange2,
57
57
  readRawSessionMessageById2,
58
58
  readSessionChunk2
59
- } from "./index-9vzkrnrf.js";
59
+ } from "./index-53xdqb3d.js";
60
60
  import {
61
61
  isRecord,
62
62
  providerVisibleMessage,
@@ -70,10 +70,10 @@ import {
70
70
  getTagNumberByMessageId2,
71
71
  getTagsBySession2,
72
72
  getTagById2
73
- } from "./index-x7426vy4.js";
73
+ } from "./index-ed9d2ded.js";
74
74
  import {
75
75
  estimateTokens
76
- } from "./index-4pxydwvg.js";
76
+ } from "./index-g4jf772p.js";
77
77
  import {
78
78
  inRootAsyncContext2,
79
79
  Database2,
@@ -84,18 +84,18 @@ import {
84
84
  stableStringify,
85
85
  closeQuietly,
86
86
  getTableColumnNames
87
- } from "./index-ttxsmaj5.js";
87
+ } from "./index-jrap43gc.js";
88
88
  import {
89
89
  resolveOpenCodeDbPath,
90
90
  assertOpenCodeStoreGeneration
91
91
  } from "./index-8976mezv.js";
92
92
  import {
93
93
  noteRawSessionSummaryRowWritten2
94
- } from "./index-4vj37yw9.js";
94
+ } from "./index-he9s4qsj.js";
95
95
  import {
96
96
  piHarnessKindFromExecutable,
97
97
  isPidAlive
98
- } from "./index-3veejgp8.js";
98
+ } from "./index-apgwdby5.js";
99
99
  import {
100
100
  BoundedSessionMap,
101
101
  clearLkgFenceProcessState,
@@ -103,20 +103,20 @@ import {
103
103
  clearLkgRecoveryFence,
104
104
  deleteSessionScopedRows,
105
105
  getLastIndexedOrdinal2
106
- } from "./index-h160xxaq.js";
106
+ } from "./index-6hex51s9.js";
107
107
  import {
108
108
  SubcClient,
109
109
  connectionFileExists,
110
110
  SYNAPSE_DEFAULT_MODEL,
111
111
  toSynapseLaneDescriptor,
112
112
  SynapseEmbeddingProvider
113
- } from "./index-szh001qb.js";
113
+ } from "./index-6dz2ed1v.js";
114
114
  import {
115
115
  sameProjectDirectory
116
- } from "./index-fdxzpnbj.js";
116
+ } from "./index-djxc8w8c.js";
117
117
  import {
118
118
  getErrorMessage
119
- } from "./index-243wh86p.js";
119
+ } from "./index-z5ftst3e.js";
120
120
  import {
121
121
  V2_MEMORY_CATEGORIES,
122
122
  CATEGORY_PRIORITY,
@@ -130,13 +130,13 @@ import {
130
130
  expandWorkspaceIdentitySetWithAliases,
131
131
  resolveStoredPathWorkspaceIdentity,
132
132
  storedPathBelongsToWorkspace
133
- } from "./index-g13fb2sj.js";
133
+ } from "./index-3cnarwf8.js";
134
134
  import {
135
135
  directoryHasGitMetadata,
136
136
  resolveProjectIdentityForSession,
137
137
  normalizeStoredProjectPath,
138
138
  storedPathBelongsToIdentity
139
- } from "./index-gqxsds3q.js";
139
+ } from "./index-6ex901g3.js";
140
140
  import {
141
141
  drainBackgroundBatches,
142
142
  markProjectLoadUntrusted2,
@@ -148,7 +148,7 @@ import {
148
148
  unregisterProjectEmbedding2,
149
149
  getProjectEmbeddingSnapshot2,
150
150
  embedTextForProject2
151
- } from "./index-qc8e13wc.js";
151
+ } from "./index-f6e8jsrh.js";
152
152
  import {
153
153
  getNoteByIdInScope,
154
154
  getNotes,
@@ -165,7 +165,7 @@ import {
165
165
  resolveMemoriesByIdsForSearch2,
166
166
  unifiedSearch2,
167
167
  formatSearchResults2
168
- } from "./index-ns319t8e.js";
168
+ } from "./index-gykw2zhn.js";
169
169
  import {
170
170
  computeCueContentHash,
171
171
  getMuralCueState,
@@ -190,13 +190,13 @@ import {
190
190
  isMarkerCandidateBasisCurrent2,
191
191
  invalidateMarkerCandidateBasis2,
192
192
  readMarkerCandidateBasis2
193
- } from "./index-729kkhmf.js";
193
+ } from "./index-46q4e104.js";
194
194
  import {
195
195
  computeNormalizedHash
196
196
  } from "./index-9x1f96r8.js";
197
197
  import {
198
198
  logSlowWriteTransaction
199
- } from "./index-43zqh10z.js";
199
+ } from "./index-d4dt19md.js";
200
200
  import {
201
201
  ensureStorageDirectorySync,
202
202
  writeStorageFileAtomicSync
@@ -4534,6 +4534,21 @@ class V2StoreReader {
4534
4534
  return row ? decode(row) : null;
4535
4535
  });
4536
4536
  }
4537
+ messageTimes(sessionID, ids) {
4538
+ const times = new Map;
4539
+ for (let offset = 0;offset < ids.length; offset += 500) {
4540
+ const batch = ids.slice(offset, offset + 500);
4541
+ const rows = this.prepare(`SELECT id, COALESCE(time_created, json_extract(data, '$.time.created')) AS created,
4542
+ json_extract(data, '$.time.completed') AS completed
4543
+ FROM session_message WHERE session_id = ? AND id IN (${batch.map(() => "?").join(",")})`).all(sessionID, ...batch);
4544
+ for (const row of rows)
4545
+ times.set(row.id, {
4546
+ created: typeof row.created === "number" ? row.created : undefined,
4547
+ completed: typeof row.completed === "number" ? row.completed : undefined
4548
+ });
4549
+ }
4550
+ return times;
4551
+ }
4537
4552
  messageExistsById(sessionID, id) {
4538
4553
  return trackDecodeOperation("messageExistsById", () => {
4539
4554
  const rawTypes = RAW_MESSAGE_TYPES.map(() => "?").join(", ");
@@ -5449,6 +5464,9 @@ function requestPendingMaterialization(sessions, sessionId, origin) {
5449
5464
  function pendingMaterializationOrigin(sessions, sessionId) {
5450
5465
  return sessions.has(sessionId) ? origins.get(sessions)?.get(sessionId) ?? "pending_materialization" : "pending_materialization";
5451
5466
  }
5467
+ function hasPendingMaterializationOrigin(sessions, sessionId, origin) {
5468
+ return sessions.has(sessionId) && causes.get(sessions)?.get(sessionId)?.has(origin) === true;
5469
+ }
5452
5470
  function clearPendingMaterialization(sessions, sessionId) {
5453
5471
  sessions.delete(sessionId);
5454
5472
  origins.get(sessions)?.delete(sessionId);
@@ -7970,6 +7988,7 @@ function formatNoteNudge(args) {
7970
7988
  }
7971
7989
 
7972
7990
  // ../plugin/src/shared/prompt-surface-runtime.ts
7991
+ import { createHash as createHash5 } from "node:crypto";
7973
7992
  import { existsSync as existsSync5, readFileSync as readFileSync7, statSync as statSync5 } from "node:fs";
7974
7993
  import { dirname as dirname4, isAbsolute as isAbsolute3, resolve as resolve3 } from "node:path";
7975
7994
 
@@ -8001,6 +8020,9 @@ function promptSurfaceHashMaterial(systemContent, preset = "full") {
8001
8020
  return preset === "full" ? systemContent : `${systemContent}
8002
8021
  \x00magic-context-prompt-surface:${preset}`;
8003
8022
  }
8023
+ function systemPromptFingerprint(systemContent, preset = "full") {
8024
+ return createHash5("md5").update(promptSurfaceHashMaterial(systemContent, preset)).digest("hex");
8025
+ }
8004
8026
  var PROMPT_SURFACE_TOOL_ID_SET = new Set(ACTIVE_TOOL_IDS);
8005
8027
  function resolveUserConfigDirectory(options) {
8006
8028
  if (options.userConfigDirectory)
@@ -8113,7 +8135,7 @@ function createPromptSurfaceGuidanceEpochCache(runtime) {
8113
8135
  }
8114
8136
 
8115
8137
  // src/read-session-pi.ts
8116
- import { createHash as createHash5 } from "node:crypto";
8138
+ import { createHash as createHash6 } from "node:crypto";
8117
8139
  var SYNTH_USER_ID_PREFIX = "synth-user-";
8118
8140
  function resolvePiStableId(msg, index, entryIds, entryIdByRef) {
8119
8141
  if (!msg || typeof msg !== "object")
@@ -8152,7 +8174,7 @@ function piContentFallbackIds(messages, resolveReal) {
8152
8174
  return;
8153
8175
  const m = message;
8154
8176
  const role = typeof m.role === "string" ? m.role : "unknown";
8155
- const digest = createHash5("sha256").update(stableStringify([
8177
+ const digest = createHash6("sha256").update(stableStringify([
8156
8178
  typeof m.responseId === "string" ? m.responseId : null,
8157
8179
  typeof m.timestamp === "number" || typeof m.timestamp === "string" ? m.timestamp : null,
8158
8180
  role,
@@ -9103,7 +9125,7 @@ function compareMemorySelectionPriority(left, right) {
9103
9125
  }
9104
9126
 
9105
9127
  // ../plugin/src/features/magic-context/mural/render-trigger.ts
9106
- import { createHash as createHash6 } from "node:crypto";
9128
+ import { createHash as createHash7 } from "node:crypto";
9107
9129
 
9108
9130
  // ../plugin/src/features/magic-context/mural/mural-selection.ts
9109
9131
  var DEFAULT_MURAL_MEMORY_BUDGET = 8000;
@@ -9792,7 +9814,7 @@ function ensureMuralRendered(db, projectIdentity, budgetTokens = DEFAULT_MURAL_M
9792
9814
  return { ...cached.result };
9793
9815
  }
9794
9816
  const plan = planMuralRender(entries);
9795
- const textHash = createHash6("sha256").update(plan.layout.text).digest("hex");
9817
+ const textHash = createHash7("sha256").update(plan.layout.text).digest("hex");
9796
9818
  if (existing && existing.contentHash === textHash && existing.width === plan.width && existing.height === plan.height) {
9797
9819
  return rememberRender(db, projectIdentity, key, existing.image, {
9798
9820
  hasMural: true,
@@ -9849,14 +9871,14 @@ function resolveMuralWire(db, projectIdentity, modelKey, enabled, budgetTokens =
9849
9871
  }
9850
9872
 
9851
9873
  // ../plugin/src/features/magic-context/compaction-marker.ts
9852
- import { createHash as createHash7 } from "node:crypto";
9874
+ import { createHash as createHash8 } from "node:crypto";
9853
9875
  import { existsSync as existsSync6, statSync as statSync6 } from "node:fs";
9854
9876
  var BASE62_CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
9855
9877
  var ID_PREFIX_HEX_LENGTH = 12;
9856
9878
  var ID_SUFFIX_LENGTH = 14;
9857
9879
  var ID_PREFIX_MASK = (1n << BigInt(ID_PREFIX_HEX_LENGTH * 4)) - 1n;
9858
9880
  function deterministicBase62(seed, length) {
9859
- let value = BigInt(`0x${createHash7("sha256").update(seed).digest("hex")}`);
9881
+ let value = BigInt(`0x${createHash8("sha256").update(seed).digest("hex")}`);
9860
9882
  const chars = Array(length);
9861
9883
  for (let index = length - 1;index >= 0; index -= 1) {
9862
9884
  chars[index] = BASE62_CHARS[Number(value % 62n)];
@@ -11108,7 +11130,7 @@ async function wakePlaneStatus() {
11108
11130
  import { statSync as statSync7 } from "node:fs";
11109
11131
 
11110
11132
  // ../plugin/src/plugin/embedding-bootstrap-helpers.ts
11111
- import { createHash as createHash8 } from "node:crypto";
11133
+ import { createHash as createHash9 } from "node:crypto";
11112
11134
  var EMBEDDING_AFFECTING_KEYS = new Set([
11113
11135
  "embedding.api_key",
11114
11136
  "embedding.endpoint",
@@ -11156,7 +11178,7 @@ var EMBEDDING_WARNING_TERMS = [
11156
11178
  ];
11157
11179
  var loggedFailureSignatures = new Map;
11158
11180
  function sha256Prefix(value, length = 16) {
11159
- return createHash8("sha256").update(value).digest("hex").slice(0, length);
11181
+ return createHash9("sha256").update(value).digest("hex").slice(0, length);
11160
11182
  }
11161
11183
  function warningLooksEmbeddingRelated(message) {
11162
11184
  const lower = message.toLowerCase();
@@ -12408,7 +12430,7 @@ function resolveCtxExpandMode(args, domain) {
12408
12430
  }
12409
12431
 
12410
12432
  // ../plugin/src/tools/ctx-expand/render.ts
12411
- import { createHash as createHash9 } from "node:crypto";
12433
+ import { createHash as createHash10 } from "node:crypto";
12412
12434
  function isRecord3(value) {
12413
12435
  return value !== null && typeof value === "object" && !Array.isArray(value);
12414
12436
  }
@@ -12632,7 +12654,7 @@ function renderItemByTag(db, sessionId, number, textIndexDomain = "part") {
12632
12654
  const index = scoped ? Number(scoped[2]) : 0;
12633
12655
  const piText = message.parts.filter((part) => isRecord3(part) && part.type === "text");
12634
12656
  const part = message.parts[index];
12635
- const matching = derived ? piText.filter((part) => isRecord3(part) && typeof part.text === "string" && createHash9("sha256").update(part.text).digest("hex") === derived[3]) : [];
12657
+ const matching = derived ? piText.filter((part) => isRecord3(part) && typeof part.text === "string" && createHash10("sha256").update(part.text).digest("hex") === derived[3]) : [];
12636
12658
  const selected = derived ? matching[Number(derived[4])] : textIndexDomain === "text" ? piText[index] : part;
12637
12659
  return selected ? renderPartFull(selected) ?? "" : `Tag ${number}'s original text part is no longer in stored history.`;
12638
12660
  }
@@ -14376,14 +14398,15 @@ function writeTray(db, sessionId) {
14376
14398
  function createCtxNoteTool(deps) {
14377
14399
  const resolveProject = deps.resolveProjectIdentity ?? resolveProjectIdentityForSession;
14378
14400
  const parameters = structuredClone(ParamsSchema2);
14379
- if (deps.smartNotesEnabled === false) {
14401
+ const smartNoteSurface = deps.smartNotesEnabled !== false && deps.dreamerEnabled !== false;
14402
+ if (!smartNoteSurface) {
14380
14403
  delete parameters.properties.surface_condition;
14381
14404
  parameters.properties.filter.description = NOTES_FILTER_DESCRIPTION;
14382
14405
  }
14383
14406
  return {
14384
14407
  name: "ctx_note",
14385
14408
  label: "Magic Context: Notes",
14386
- description: deps.smartNotesEnabled === false ? withoutSmartNoteText(CTX_NOTE_DESCRIPTION) : CTX_NOTE_DESCRIPTION,
14409
+ description: smartNoteSurface ? CTX_NOTE_DESCRIPTION : withoutSmartNoteText(CTX_NOTE_DESCRIPTION),
14387
14410
  parameters,
14388
14411
  async execute(_toolCallId, params, _signal, _onUpdate, ctx) {
14389
14412
  params = unwrapImitatedReducedArgs(params, ["action", "content"], {
@@ -15482,13 +15505,14 @@ function registerMagicContextTools(pi, opts) {
15482
15505
  warn: (message) => log2(`[magic-context][pi] config warning: ${message}`)
15483
15506
  });
15484
15507
  const registration = promptSurfaceRuntime.resolveRegistration(opts.promptSurface);
15508
+ const smartNotesAvailable = opts.smartNotesEnabled !== false && opts.dreamerEnabled !== false;
15485
15509
  const surfaceTool = (definition) => {
15486
15510
  const parameters = structuredClone(definition.parameters);
15487
- applyJsonSchemaParameterDescriptions(definition.name, parameters, registration.preset, opts.smartNotesEnabled);
15511
+ applyJsonSchemaParameterDescriptions(definition.name, parameters, registration.preset, smartNotesAvailable ? opts.smartNotesEnabled : false);
15488
15512
  return throwReturnedToolErrors({
15489
15513
  ...definition,
15490
15514
  parameters,
15491
- description: definition.name === "ctx_note" && opts.smartNotesEnabled === false ? withoutSmartNoteText(registration.preset === "light" ? CTX_NOTE_LIGHT_DESCRIPTION : definition.description) : registration.descriptionFor(definition.name, definition.description)
15515
+ description: definition.name === "ctx_note" && !smartNotesAvailable ? withoutSmartNoteText(registration.preset === "light" ? CTX_NOTE_LIGHT_DESCRIPTION : definition.description) : registration.descriptionFor(definition.name, definition.description)
15492
15516
  });
15493
15517
  };
15494
15518
  pi.registerTool(surfaceTool(createCtxSearchTool({
@@ -15517,7 +15541,7 @@ function registerMagicContextTools(pi, opts) {
15517
15541
  if (!opts.sessionScopedToolsDisabled) {
15518
15542
  pi.registerTool(surfaceTool(createCtxNoteTool({
15519
15543
  db: opts.db,
15520
- dreamerEnabled: opts.dreamerEnabled ?? false,
15544
+ dreamerEnabled: opts.dreamerEnabled,
15521
15545
  smartNotesEnabled: opts.smartNotesEnabled,
15522
15546
  resolveDreamerEnabled: opts.resolveDreamerEnabled,
15523
15547
  resolveProjectIdentity
@@ -15541,4 +15565,4 @@ function registerMagicContextTools(pi, opts) {
15541
15565
  }
15542
15566
  }
15543
15567
 
15544
- 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 };
15568
+ 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, hasPendingMaterializationOrigin, 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, systemPromptFingerprint, 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 };