@cortexkit/pi-magic-context 0.48.0 → 0.49.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.
Files changed (40) hide show
  1. package/dist/auto-search-worker.js +3 -3
  2. package/dist/embedding-backfill-b71dvfs8.js +20 -0
  3. package/dist/embedding-worker.js +4 -4
  4. package/dist/historian-calibration-extension.js +30 -5
  5. package/dist/{index-dkx0b1kt.js → index-041ex0cj.js} +7 -2
  6. package/dist/{index-fp37he9a.js → index-0vrkp1jq.js} +1 -1
  7. package/dist/{index-6pgq5ns2.js → index-1evzceyw.js} +2 -2
  8. package/dist/{index-419bndtm.js → index-21v1kfs7.js} +2 -2
  9. package/dist/{index-wrm4nbj7.js → index-290tzwp1.js} +1 -1
  10. package/dist/{index-72bdc1bd.js → index-3mgf68pn.js} +4 -4
  11. package/dist/{index-hrf13mn3.js → index-3rea6zd9.js} +16 -8
  12. package/dist/{index-0am8a7k1.js → index-904reqtg.js} +4 -4
  13. package/dist/{index-fm3ksh5e.js → index-bejpsj10.js} +4 -4
  14. package/dist/{index-98z1c1r0.js → index-ehybv5nr.js} +109 -35
  15. package/dist/{index-pvm4pd5d.js → index-hwqb3s7f.js} +811 -76
  16. package/dist/{index-5hd7h4rr.js → index-kjd1fj55.js} +39 -31
  17. package/dist/{index-8y5knskr.js → index-mcgehvgw.js} +93 -9
  18. package/dist/{index-603mt6nm.js → index-r024r8da.js} +1 -1
  19. package/dist/{index-9xb0axhc.js → index-r56xgha8.js} +1 -1
  20. package/dist/{index-r7xg4hvw.js → index-t7xfqtg6.js} +8 -8
  21. package/dist/{index-rt5jgzp1.js → index-vakawmbc.js} +160 -25
  22. package/dist/{index-f956htf3.js → index-x3dcnxh0.js} +6 -2
  23. package/dist/{index-544c0e0x.js → index-yarjn32j.js} +7 -7
  24. package/dist/{index-5jp1h0bz.js → index-yzcjxnt2.js} +48 -11
  25. package/dist/{index-zrr5t5a7.js → index-zh1jw8qp.js} +106 -1
  26. package/dist/index.js +1149 -680
  27. package/dist/{logger-v3dsxdnm.js → logger-j6tecd1h.js} +1 -1
  28. package/dist/{message-index-bounded-t7vvty76.js → message-index-bounded-qz5dz2se.js} +11 -11
  29. package/dist/{message-time-backfill-4ndf7hrq.js → message-time-backfill-05ppypkz.js} +2 -2
  30. package/dist/migration-worker.js +8 -8
  31. package/dist/{project-embedding-registry-jy2hmq28.js → project-embedding-registry-ky7wrkr1.js} +9 -9
  32. package/dist/raw-ordinal-warmup-worker.js +4 -4
  33. package/dist/{read-session-chunk-47pjn7fz.js → read-session-chunk-24sd89tf.js} +8 -6
  34. package/dist/{read-session-raw-yn8nawav.js → read-session-raw-npx3920c.js} +5 -3
  35. package/dist/{safe-notification-target-3c1ns931.js → safe-notification-target-vn9kpmv4.js} +2 -2
  36. package/dist/{search-42szfhwp.js → search-jbh28nwy.js} +17 -17
  37. package/dist/{storage-tags-jym5z6yk.js → storage-tags-kjnsqbdb.js} +6 -6
  38. package/dist/subagent-entry.js +20 -19
  39. package/package.json +1 -1
  40. package/dist/embedding-backfill-bnnytehy.js +0 -20
@@ -7,7 +7,7 @@ import {
7
7
  getMagicContextStorageDir,
8
8
  log2,
9
9
  sessionLog2
10
- } from "./index-f956htf3.js";
10
+ } from "./index-x3dcnxh0.js";
11
11
  import {
12
12
  buildPrimaryLanguageDirective,
13
13
  resolvePromptSurface,
@@ -19,7 +19,7 @@ import {
19
19
  ConfigProfilesSchema,
20
20
  MagicContextConfigSchema,
21
21
  deriveDefaultProtectedTokens
22
- } from "./index-6pgq5ns2.js";
22
+ } from "./index-1evzceyw.js";
23
23
  import {
24
24
  piModelRefToCanonical,
25
25
  modelRefLookupOrder
@@ -36,15 +36,15 @@ import {
36
36
  queuePendingOp,
37
37
  getPendingOps,
38
38
  updateTagStatus2,
39
- getInertWhitespaceAssistantTags2,
39
+ getInertWhitespaceAssistantTagsByNumbers2,
40
40
  getTagNumberByMessageId2,
41
41
  TAG_SELECT_COLUMNS2,
42
42
  getTagsBySession2,
43
43
  getTagById2
44
- } from "./index-5hd7h4rr.js";
44
+ } from "./index-kjd1fj55.js";
45
45
  import {
46
46
  estimateTokens
47
- } from "./index-9xb0axhc.js";
47
+ } from "./index-r56xgha8.js";
48
48
  import {
49
49
  Database2,
50
50
  prepareCachedStatement2,
@@ -55,14 +55,14 @@ import {
55
55
  stableStringify,
56
56
  closeQuietly,
57
57
  getTableColumnNames
58
- } from "./index-8y5knskr.js";
58
+ } from "./index-mcgehvgw.js";
59
59
  import {
60
60
  resolveOpenCodeDbPath,
61
61
  assertOpenCodeStoreGeneration
62
62
  } from "./index-8976mezv.js";
63
63
  import {
64
64
  noteRawSessionSummaryRowWritten2
65
- } from "./index-rt5jgzp1.js";
65
+ } from "./index-vakawmbc.js";
66
66
  import {
67
67
  withReadOnlySessionDb,
68
68
  expandToolPart,
@@ -71,23 +71,23 @@ import {
71
71
  visitRawSessionMessages2,
72
72
  readRawSessionMessageById2,
73
73
  readSessionChunk2
74
- } from "./index-hrf13mn3.js";
74
+ } from "./index-3rea6zd9.js";
75
75
  import {
76
76
  SubcClient,
77
77
  connectionFileExists,
78
78
  SYNAPSE_DEFAULT_MODEL,
79
79
  toSynapseLaneDescriptor,
80
80
  SynapseEmbeddingProvider
81
- } from "./index-419bndtm.js";
81
+ } from "./index-21v1kfs7.js";
82
82
  import {
83
83
  deleteSessionScopedRows,
84
84
  getLastIndexedOrdinal
85
- } from "./index-5jp1h0bz.js";
85
+ } from "./index-yzcjxnt2.js";
86
86
  import {
87
87
  piHarnessKindFromExecutable,
88
88
  isPidAlive,
89
89
  getErrorMessage
90
- } from "./index-r7xg4hvw.js";
90
+ } from "./index-t7xfqtg6.js";
91
91
  import {
92
92
  V2_MEMORY_CATEGORIES,
93
93
  CATEGORY_PRIORITY,
@@ -99,13 +99,14 @@ import {
99
99
  expandWorkspaceIdentitySetWithAliases,
100
100
  resolveStoredPathWorkspaceIdentity,
101
101
  storedPathBelongsToWorkspace
102
- } from "./index-72bdc1bd.js";
102
+ } from "./index-3mgf68pn.js";
103
103
  import {
104
+ sameProjectDirectory,
104
105
  directoryHasGitMetadata,
105
106
  resolveProjectIdentityForSession,
106
107
  normalizeStoredProjectPath,
107
108
  storedPathBelongsToIdentity
108
- } from "./index-dkx0b1kt.js";
109
+ } from "./index-041ex0cj.js";
109
110
  import {
110
111
  markProjectLoadUntrusted2,
111
112
  drainProjectEmbeddingIdentityMaintenance2,
@@ -116,7 +117,7 @@ import {
116
117
  unregisterProjectEmbedding2,
117
118
  getProjectEmbeddingSnapshot2,
118
119
  embedTextForProject2
119
- } from "./index-544c0e0x.js";
120
+ } from "./index-yarjn32j.js";
120
121
  import {
121
122
  getNoteByIdInScope,
122
123
  getNotes,
@@ -132,7 +133,7 @@ import {
132
133
  resolveMemoriesByIdsForSearch2,
133
134
  unifiedSearch2,
134
135
  formatSearchResults2
135
- } from "./index-pvm4pd5d.js";
136
+ } from "./index-hwqb3s7f.js";
136
137
  import {
137
138
  saveEmbedding,
138
139
  invalidateMemory2
@@ -158,7 +159,7 @@ import {
158
159
  } from "./index-9x1f96r8.js";
159
160
  import {
160
161
  logSlowWriteTransaction
161
- } from "./index-fp37he9a.js";
162
+ } from "./index-0vrkp1jq.js";
162
163
  import {
163
164
  ensureStorageDirectorySync,
164
165
  writeStorageFileAtomicSync
@@ -6113,14 +6114,50 @@ function pruneNoteNudgeAnchors(db, sessionId, visibleMessageIds) {
6113
6114
  });
6114
6115
  return pruned;
6115
6116
  }
6116
- function pruneAutoSearchHintDecisions(db, sessionId, visibleMessageIds) {
6117
+ var pendingAutoSearchRetirements = new WeakMap;
6118
+ var AUTO_SEARCH_DECISION_SOFT_LIMIT = 2000;
6119
+ function queueAutoSearchHintDecisionRetirement(db, sessionId, messageIds) {
6120
+ if (messageIds.size === 0)
6121
+ return;
6122
+ let sessions = pendingAutoSearchRetirements.get(db);
6123
+ if (!sessions) {
6124
+ sessions = new Map;
6125
+ pendingAutoSearchRetirements.set(db, sessions);
6126
+ }
6127
+ let retired = sessions.get(sessionId);
6128
+ if (!retired) {
6129
+ retired = new Set;
6130
+ sessions.set(sessionId, retired);
6131
+ }
6132
+ for (const id of messageIds)
6133
+ retired.add(id);
6134
+ }
6135
+ function flushAutoSearchHintDecisionRetirement(db, sessionId, visibleMessageIds) {
6136
+ const sessions = pendingAutoSearchRetirements.get(db);
6137
+ const retired = sessions?.get(sessionId) ?? new Set;
6138
+ const outcome = updateAutoSearchHintRetirement(db, sessionId, retired, visibleMessageIds);
6139
+ if (outcome.ok)
6140
+ sessions?.delete(sessionId);
6141
+ return outcome.pruned;
6142
+ }
6143
+ function updateAutoSearchHintRetirement(db, sessionId, retiredMessageIds, visibleMessageIds) {
6117
6144
  let pruned = 0;
6118
- casUpdateJsonArrayColumn(db, sessionId, "auto_search_hint_decisions", isValidAutoSearchHintDecision, (current) => {
6119
- const next = current.filter((decision) => visibleMessageIds.has(decision.messageId));
6145
+ const ok = casUpdateJsonArrayColumn(db, sessionId, "auto_search_hint_decisions", isValidAutoSearchHintDecision, (current) => {
6146
+ let next = current.filter((decision) => !retiredMessageIds.has(decision.messageId) || visibleMessageIds?.has(decision.messageId));
6147
+ let excess = next.length - AUTO_SEARCH_DECISION_SOFT_LIMIT;
6148
+ if (visibleMessageIds && excess > 0) {
6149
+ next = next.filter((decision) => {
6150
+ if (excess > 0 && decision.decision === "no-hint" && !visibleMessageIds.has(decision.messageId)) {
6151
+ excess--;
6152
+ return false;
6153
+ }
6154
+ return true;
6155
+ });
6156
+ }
6120
6157
  pruned = current.length - next.length;
6121
6158
  return pruned > 0 ? next : null;
6122
- });
6123
- return pruned;
6159
+ }, { ensureRow: false });
6160
+ return { ok, pruned: ok ? pruned : 0 };
6124
6161
  }
6125
6162
  function parsePersistedTodoSyntheticAnchor(result) {
6126
6163
  if (!isPersistedTodoSyntheticAnchorRow(result))
@@ -6669,6 +6706,31 @@ import { Buffer as Buffer3 } from "node:buffer";
6669
6706
 
6670
6707
  // ../plugin/src/shared/auto-search-lifecycle.ts
6671
6708
  var pending = new Map;
6709
+ var unpublishedNoHints = new Map;
6710
+ function rememberUnpublishedAutoSearchNoHint(sessionId, messageId, reason) {
6711
+ let messages = unpublishedNoHints.get(sessionId);
6712
+ if (!messages) {
6713
+ messages = new Map;
6714
+ unpublishedNoHints.set(sessionId, messages);
6715
+ }
6716
+ if (!messages.has(messageId))
6717
+ messages.set(messageId, reason);
6718
+ }
6719
+ function getUnpublishedAutoSearchNoHint(sessionId, messageId) {
6720
+ return unpublishedNoHints.get(sessionId)?.get(messageId);
6721
+ }
6722
+ function forgetUnpublishedAutoSearchNoHint(sessionId, messageId) {
6723
+ const messages = unpublishedNoHints.get(sessionId);
6724
+ messages?.delete(messageId);
6725
+ if (messages?.size === 0)
6726
+ unpublishedNoHints.delete(sessionId);
6727
+ }
6728
+ function clearUnpublishedAutoSearchNoHints(sessionId) {
6729
+ if (sessionId === undefined)
6730
+ unpublishedNoHints.clear();
6731
+ else
6732
+ unpublishedNoHints.delete(sessionId);
6733
+ }
6672
6734
  function registerAutoSearchWork(sessionId) {
6673
6735
  const controller = new AbortController;
6674
6736
  const work = pending.get(sessionId) ?? new Set;
@@ -6949,11 +7011,19 @@ class V2StoreReader {
6949
7011
  const columns = new Set(this.prepare("PRAGMA table_info(session_v2)").all().map((column) => column.name));
6950
7012
  const archived = columns.has("time_archived") ? " AND time_archived IS NULL" : "";
6951
7013
  const order = columns.has("time_updated") ? "time_updated DESC, id DESC" : "id DESC";
6952
- const row = this.prepare(`SELECT id FROM session_v2
6953
- WHERE directory = ? AND parent_id IS NULL${archived}
7014
+ const page = this.prepare(`SELECT id, COALESCE(directory, '') AS directory FROM session_v2
7015
+ WHERE parent_id IS NULL${archived}
6954
7016
  AND COALESCE(json_extract(metadata, '$.magic_context'), '') <> 'hidden-run'
6955
- ORDER BY ${order} LIMIT 1`).get(directory);
6956
- return row?.id;
7017
+ ORDER BY ${order} LIMIT ? OFFSET ?`);
7018
+ const pageSize = 500;
7019
+ for (let offset = 0;; offset += pageSize) {
7020
+ const rows = page.all(pageSize, offset);
7021
+ const match = rows.find((row) => sameProjectDirectory(row.directory, directory));
7022
+ if (match)
7023
+ return match.id;
7024
+ if (rows.length < pageSize)
7025
+ return;
7026
+ }
6957
7027
  }
6958
7028
  rootSessionActivity(sessionIDs) {
6959
7029
  const roots = new Map;
@@ -7377,7 +7447,7 @@ function retryPendingSessionCleanups(db, limit = 200) {
7377
7447
  try {
7378
7448
  withoutSqliteTransformPass2(() => withSqliteBackgroundWriter2(() => {
7379
7449
  db.prepare("UPDATE pending_session_cleanup SET last_attempt_at = ? WHERE session_id = ?").run(Date.now(), row.session_id);
7380
- clearSession(db, row.session_id);
7450
+ clearSession(db, row.session_id, false, true);
7381
7451
  }));
7382
7452
  cleared += 1;
7383
7453
  } catch {
@@ -7403,7 +7473,7 @@ async function retryPendingRustSessionCleanupsForProject(db, projectPath, delete
7403
7473
  try {
7404
7474
  withoutSqliteTransformPass2(() => withSqliteBackgroundWriter2(() => db.prepare("UPDATE pending_session_cleanup SET last_attempt_at = ? WHERE session_id = ?").run(Date.now(), row.session_id)));
7405
7475
  await deleteSession(row.session_id);
7406
- clearSession(db, row.session_id, true);
7476
+ clearSession(db, row.session_id, true, true);
7407
7477
  cleared += 1;
7408
7478
  } catch {
7409
7479
  failedSessionIds.push(row.session_id);
@@ -7411,15 +7481,17 @@ async function retryPendingRustSessionCleanupsForProject(db, projectPath, delete
7411
7481
  }
7412
7482
  return { attempted: rows.length, cleared, failedSessionIds };
7413
7483
  }
7414
- function clearSession(db, sessionId, rustModuleCleanupAcknowledged = false) {
7484
+ function clearSession(db, sessionId, rustModuleCleanupAcknowledged = false, permanentlyDeleted = false) {
7415
7485
  cancelAutoSearchWork(sessionId);
7416
7486
  let transactionStartedAt = 0;
7417
7487
  withoutSqliteTransformPass2(() => withSqliteBackgroundWriter2(() => db.transaction(() => {
7418
7488
  transactionStartedAt = performance.now();
7419
7489
  deleteSessionScopedRows(db, [sessionId], undefined, {
7420
- rustModuleCleanupAcknowledged
7490
+ rustModuleCleanupAcknowledged,
7491
+ preserveTagRevisionTombstones: !permanentlyDeleted
7421
7492
  });
7422
7493
  }).immediate()));
7494
+ clearUnpublishedAutoSearchNoHints(sessionId);
7423
7495
  logSlowWriteTransaction("clear-session", transactionStartedAt);
7424
7496
  }
7425
7497
  // ../plugin/src/hooks/magic-context/embed-session-state.ts
@@ -7969,8 +8041,8 @@ function clearCapturedLkgMeasurement(sessionId) {
7969
8041
  }
7970
8042
 
7971
8043
  // ../plugin/src/hooks/magic-context/lkg-slot.ts
7972
- var LKG_TOTAL_BYTES = 64 * 1024 * 1024;
7973
- var LKG_SINGLE_SLOT_BYTES = 24 * 1024 * 1024;
8044
+ var LKG_SINGLE_SLOT_BYTES = 72 * 1024 * 1024;
8045
+ var LKG_TOTAL_BYTES = 160 * 1024 * 1024;
7974
8046
  var LKG_METADATA_BYTES = 256;
7975
8047
 
7976
8048
  class MagicContextLkgHeapHolder {
@@ -8653,7 +8725,7 @@ function decodePiContentDecision(value) {
8653
8725
  return null;
8654
8726
  try {
8655
8727
  const pair = JSON.parse(value.slice(PREFIX.length));
8656
- if (Array.isArray(pair) && pair.length === 2 && (pair[0] === "reminder-strip" || pair[0] === "seam-temporal-strip" || pair[0] === "tag-identity-repair-once" || pair[0] === "tag-identity-repair-pending" || pair[0] === "tag-identity-recurring") && typeof pair[1] === "string" && pair[1].length > 0)
8728
+ if (Array.isArray(pair) && pair.length === 2 && (pair[0] === "reminder-strip" || pair[0] === "seam-temporal-strip" || pair[0] === "tag-identity-repair-once" || pair[0] === "tag-identity-repair-pending" || pair[0] === "tag-identity-rebuild-failed" || pair[0] === "tag-identity-recurring") && typeof pair[1] === "string" && pair[1].length > 0)
8657
8729
  return [pair[0], pair[1]];
8658
8730
  } catch {}
8659
8731
  return null;
@@ -8685,7 +8757,7 @@ function freezePiContentDecision(db, sessionId, kind, messageId) {
8685
8757
  const ownsMessage = db.prepare("SELECT 1 FROM tags WHERE session_id = ? AND message_id >= ? AND message_id < ? LIMIT 1");
8686
8758
  const kept = current.filter((value) => {
8687
8759
  const decision = decodePiContentDecision(value);
8688
- return !decision || decision[0] === "tag-identity-repair-once" || decision[0] === "tag-identity-repair-pending" || decision[0] === "tag-identity-recurring" || !!(decision[0] === "seam-temporal-strip" ? ownsMessage.get(sessionId, `${decision[1]}:p`, `${decision[1]}:q`) : ownsTag.get(sessionId, decision[1]));
8760
+ return !decision || decision[0] === "tag-identity-repair-once" || decision[0] === "tag-identity-repair-pending" || decision[0] === "tag-identity-rebuild-failed" || decision[0] === "tag-identity-recurring" || !!(decision[0] === "seam-temporal-strip" ? ownsMessage.get(sessionId, `${decision[1]}:p`, `${decision[1]}:q`) : ownsTag.get(sessionId, decision[1]));
8689
8761
  });
8690
8762
  const limit = kind === "tag-identity-recurring" ? PI_CONTENT_DECISION_LIMIT + PI_IDENTITY_RECURRENCE_ALLOWANCE : PI_CONTENT_DECISION_LIMIT;
8691
8763
  if (kept.filter((value) => decodePiContentDecision(value) !== null).length >= limit)
@@ -16233,7 +16305,7 @@ function createCtxReduceTool(deps) {
16233
16305
  ...protectedToolTagNumbers(activeTags, deps.resolveProtectedTools?.(ctx) ?? deps.protectedTools)
16234
16306
  ]);
16235
16307
  const tagStatusMap = new Map(allTags.map((tag) => [tag.tagNumber, tag.status]));
16236
- const inertWhitespaceTagNumbers = new Set(getInertWhitespaceAssistantTags2(deps.db, sessionId).map((tag) => tag.tagNumber));
16308
+ const inertWhitespaceTagNumbers = new Set(getInertWhitespaceAssistantTagsByNumbers2(deps.db, sessionId, dropIds).map((tag) => tag.tagNumber));
16237
16309
  const inertDropIds = [
16238
16310
  ...new Set(dropIds.filter((id) => inertWhitespaceTagNumbers.has(id)))
16239
16311
  ];
@@ -16493,6 +16565,7 @@ function createCtxSearchTool(deps) {
16493
16565
  diagnostics,
16494
16566
  gitRepositoryAvailable: directoryHasGitMetadata(ctx.cwd),
16495
16567
  explicitSearch: true,
16568
+ rerankConnectionFile: deps.rerankConnectionFile,
16496
16569
  ...dateRange
16497
16570
  });
16498
16571
  return {
@@ -17066,6 +17139,7 @@ function registerMagicContextTools(pi, opts) {
17066
17139
  memoryEnabled: opts.memoryEnabled,
17067
17140
  embeddingEnabled: opts.embeddingEnabled,
17068
17141
  gitCommitsEnabled: opts.gitCommitsEnabled,
17142
+ rerankConnectionFile: opts.rerankConnectionFile,
17069
17143
  resolveProjectIdentity
17070
17144
  })));
17071
17145
  if (opts.memoryToolEnabled !== false) {
@@ -17109,4 +17183,4 @@ function registerMagicContextTools(pi, opts) {
17109
17183
  }
17110
17184
  }
17111
17185
 
17112
- export { COMPACTION_ENABLED_PATH, isDreamerRunnable, isCompactionEnabled, formatConfigParseStatusLine, formatConfigParseNotice, claimConfigParseFailuresOnce, parseJsoncRecovering, detectConfigFile, MIN_PLAUSIBLE_CONTEXT_LIMIT, catalogOutputReserve, reloadWindowOverlay, getWindowOverlay, resolveWindowOverlayFacts, deriveWindowGeometry, hasTrustedAbsoluteWall, applyProvenInputFloor, formatWindowDerivationLine, formatWindowSource, isSaneLimit, resolveOutputReserve, getSdkWindowGeometry, getSdkContextLimit, getSdkOutputLimit, getSdkInputLimit, cortexKitUserConfigBasePath, cortexKitProjectConfigBasePath, migrateMagicContextConfigLocations, getProtectedTokensTierOverrides, MAX_EXECUTE_THRESHOLD, escalationBands, decodeMergedReasoningParts, HYGIENE_PROVIDER_UNITS_VERSION, sessionDecisionCalibration, transitionSessionHygieneUnits, computeProtectionWindow, readEpochFloorSnapshot, getProtectionWindowForSession, ensureSessionMetaRow, persistCachedM0, clearCachedM0M1, isRustMarkerAdmissionFenced, ReplayDocumentError, readReplayEnvelope, updateReplayDocument, isProviderOverflowFailClosedProven, describeProtectedTailDrainBudgetSkip, loadProtectedTailMeta, markProtectedTailPolicyV3Seeded, recordProtectedTailPublicationFloor, recordProtectedTailNoEligibleHead, getWrapupInProgressState, isWrapupInProgress, acquireWrapupInProgress, updateWrapupInProgress, releaseWrapupInProgress, resolveCompactionModeRecord, getCompactionModeRecord, setCompactionModeRecord, getProtectedTailDrainBudgetSkip, reserveProtectedTailDrainTokens, clearEmergencyDrainLatch, recordHistorianDrainFailure, clearHistorianDrainFailure, rollbackProtectedTailDrainReservation, clearPersistedReasoningWatermark, getEmergencyInputSample, setEmergencyDropSample, clearEmergencyDropSample, getLastNudgeUndropped, setLastNudgeUndropped, getChannel1NudgeState, setChannel1NudgeState, markChannel1PostReduceGracePending, captureChannel1PostReduceGraceBaseline, getChannel2NudgeState, getChannel2NudgeClaim, setChannel2NudgeState, casChannel2NudgeState, claimChannel2NudgeState, casChannel2NudgeClaim, getPersistedNoteNudge, setPersistedNoteNudgeTrigger, setPersistedNoteNudgeTriggerMessageId, getNoteNudgeAnchors, getAutoSearchHintDecisions, deliverNoteNudgeAtomic, appendAutoSearchHintDecision, pruneNoteNudgeAnchors, pruneAutoSearchHintDecisions, getPersistedTodoSyntheticAnchor, setPersistedTodoSyntheticAnchor, clearPersistedTodoSyntheticAnchor, getNoteLastReadAt, getHistorianFailureState, incrementHistorianFailure, clearHistorianFailureState, getOverflowState, recordOverflowDetected, clearEmergencyRecovery, clearDetectedContextLimit, getStrippedPlaceholderIds, applyStrippedPlaceholderDelta, THINKING_BINDING_RECOVERY_FROZEN_PREFIX, THINKING_BINDING_STRIP_ORDER_END_MARKER, thinkingBindingRecoveryFrozenId, getThinkingBindingRecoveryTarget, armThinkingBindingRecovery, clearThinkingBindingRecoveryIf, getMergedReasoningStrippedIds, addMergedReasoningStrippedIds, getProcessedImageStrippedIds, addProcessedImageStrippedIds, getPendingCompactionMarkerState, getCompactionMarkerHealth, clearPendingCompactionMarkerStateIf, getPendingPiCompactionMarkerState, setPendingPiCompactionMarkerState, clearPendingPiCompactionMarkerStateIf, getSessionsWithPendingPiMarker, setSessionWorkMetrics, getSessionWorkMetrics, resolveEpochFloorForPass, 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, BoundedSessionMap, providerResponseFailed, isSuccessfulProviderCompletion, 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, noteEntry, TOOL_SWEEP_SCOPED_MARKER, encodePiContentDecision, decodePiContentDecision, getPiContentDecisions, freezePiContentDecision, getNativeReplayState, saveNativeToolInputs, addNativeReasoningIds, copySessionStateForClone, countHistorianRuns, recordHistorianRun, summarizeImportance, tallyFactsByCategory, queueMemoryMutation, getMemoryMutationsForRender, getMemoryMutationsForRenderByProjects, getMaxMemoryMutationId, getMaxMemoryMutationIdForProjects, GLOBAL_USER_PROFILE_PROJECT_PATH, getProjectState, bumpProjectUserProfileVersion, saveSourceContent, getSourceContents, recordSubagentInvocation, getLatestHistorianInvocationId, noteTouchedAt, noteNudgePickIndex, formatNoteNudge, promptSurfaceHashMaterial, createPromptSurfaceRuntime, createPromptSurfaceGuidanceEpochCache, SYNTH_USER_ID_PREFIX, resolvePiStableId, resolvePiRealStableId, isPiContentFallbackId, isPiIndexFallbackId, piContentFallbackIds, readPiSessionSnapshot, readPiSessionMessages, readPiSessionMessagePage, findRestartModelSeedFromBranch, iterateEntriesToRawMessageRange, convertEntriesToRawMessages, convertPiAssistantEntryById, convertEntriesToRawMessagePage, countPiRawMessages, USER_MEMORY_CANDIDATE_TTL_MS, insertUserMemoryCandidates, getUserMemoryCandidates, deleteUserMemoryCandidates, pruneExpiredUserMemoryCandidates, insertUserMemory, getActiveUserMemories, updateUserMemoryContent, dismissUserMemory, getTaskScheduleState, getFailingDreamTasks, getSkippedDreamTasks, getMostRecentTaskRunAt, pruneNonCanonicalTaskRows, deleteTaskScheduleRowsForProject, seedTaskScheduleState, writeTaskScheduleState, isRetrospectiveWindowProcessed, recordRetrospectiveWindowProcessed, curateCategoryForMemoryCategory, peekCurateCategoryScope, beginCurateCategoryRun, curateTaskStateAfterSuccess, isDirectiveShapedProjectRule, takeCurateSafetyRefusalCount, wakePlaneStatus, loadPiConfig, loadPiConfigDetailed, unregisterPiProjectEmbeddings, ensureProjectRegisteredFromPiDirectory, resolvePiHarnessDetection, resolvePiHarnessKind, 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, resolvePiOrdinalAlignment, piRawOrdinalOffsetSource, resolvePiOrdinalAlignmentForContext, isPiOrdinalAlignmentUnanchored, clearPiOrdinalAlignmentSession, rememberTodowriteToolCallTodos, parseTodos, setTodoSnapshot, registerTodoOverlay, registerTodoStateLifecycle, syncCtxMemoryToolEnabled, registerMagicContextTools };
17186
+ export { COMPACTION_ENABLED_PATH, isDreamerRunnable, isCompactionEnabled, formatConfigParseStatusLine, formatConfigParseNotice, claimConfigParseFailuresOnce, parseJsoncRecovering, detectConfigFile, MIN_PLAUSIBLE_CONTEXT_LIMIT, catalogOutputReserve, reloadWindowOverlay, getWindowOverlay, resolveWindowOverlayFacts, deriveWindowGeometry, hasTrustedAbsoluteWall, applyProvenInputFloor, formatWindowDerivationLine, formatWindowSource, isSaneLimit, resolveOutputReserve, getSdkWindowGeometry, getSdkContextLimit, getSdkOutputLimit, getSdkInputLimit, cortexKitUserConfigBasePath, cortexKitProjectConfigBasePath, migrateMagicContextConfigLocations, getProtectedTokensTierOverrides, MAX_EXECUTE_THRESHOLD, escalationBands, decodeMergedReasoningParts, HYGIENE_PROVIDER_UNITS_VERSION, sessionDecisionCalibration, transitionSessionHygieneUnits, computeProtectionWindow, readEpochFloorSnapshot, getProtectionWindowForSession, ensureSessionMetaRow, persistCachedM0, clearCachedM0M1, isRustMarkerAdmissionFenced, ReplayDocumentError, readReplayEnvelope, updateReplayDocument, isProviderOverflowFailClosedProven, describeProtectedTailDrainBudgetSkip, loadProtectedTailMeta, markProtectedTailPolicyV3Seeded, recordProtectedTailPublicationFloor, recordProtectedTailNoEligibleHead, getWrapupInProgressState, isWrapupInProgress, acquireWrapupInProgress, updateWrapupInProgress, releaseWrapupInProgress, resolveCompactionModeRecord, getCompactionModeRecord, setCompactionModeRecord, getProtectedTailDrainBudgetSkip, reserveProtectedTailDrainTokens, clearEmergencyDrainLatch, recordHistorianDrainFailure, clearHistorianDrainFailure, rollbackProtectedTailDrainReservation, clearPersistedReasoningWatermark, getEmergencyInputSample, setEmergencyDropSample, clearEmergencyDropSample, getLastNudgeUndropped, setLastNudgeUndropped, getChannel1NudgeState, setChannel1NudgeState, markChannel1PostReduceGracePending, captureChannel1PostReduceGraceBaseline, getChannel2NudgeState, getChannel2NudgeClaim, setChannel2NudgeState, casChannel2NudgeState, claimChannel2NudgeState, casChannel2NudgeClaim, getPersistedNoteNudge, setPersistedNoteNudgeTrigger, setPersistedNoteNudgeTriggerMessageId, getNoteNudgeAnchors, getAutoSearchHintDecisions, deliverNoteNudgeAtomic, appendAutoSearchHintDecision, pruneNoteNudgeAnchors, queueAutoSearchHintDecisionRetirement, flushAutoSearchHintDecisionRetirement, getPersistedTodoSyntheticAnchor, setPersistedTodoSyntheticAnchor, clearPersistedTodoSyntheticAnchor, getNoteLastReadAt, getHistorianFailureState, incrementHistorianFailure, clearHistorianFailureState, getOverflowState, recordOverflowDetected, clearEmergencyRecovery, clearDetectedContextLimit, getStrippedPlaceholderIds, applyStrippedPlaceholderDelta, THINKING_BINDING_RECOVERY_FROZEN_PREFIX, THINKING_BINDING_STRIP_ORDER_END_MARKER, thinkingBindingRecoveryFrozenId, getThinkingBindingRecoveryTarget, armThinkingBindingRecovery, clearThinkingBindingRecoveryIf, getMergedReasoningStrippedIds, addMergedReasoningStrippedIds, getProcessedImageStrippedIds, addProcessedImageStrippedIds, getPendingCompactionMarkerState, getCompactionMarkerHealth, clearPendingCompactionMarkerStateIf, getPendingPiCompactionMarkerState, setPendingPiCompactionMarkerState, clearPendingPiCompactionMarkerStateIf, getSessionsWithPendingPiMarker, setSessionWorkMetrics, getSessionWorkMetrics, resolveEpochFloorForPass, 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, BoundedSessionMap, providerResponseFailed, isSuccessfulProviderCompletion, 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, noteEntry, TOOL_SWEEP_SCOPED_MARKER, encodePiContentDecision, decodePiContentDecision, getPiContentDecisions, freezePiContentDecision, getNativeReplayState, saveNativeToolInputs, addNativeReasoningIds, copySessionStateForClone, countHistorianRuns, recordHistorianRun, summarizeImportance, tallyFactsByCategory, queueMemoryMutation, getMemoryMutationsForRender, getMemoryMutationsForRenderByProjects, getMaxMemoryMutationId, getMaxMemoryMutationIdForProjects, GLOBAL_USER_PROFILE_PROJECT_PATH, getProjectState, bumpProjectUserProfileVersion, saveSourceContent, getSourceContents, recordSubagentInvocation, getLatestHistorianInvocationId, noteTouchedAt, noteNudgePickIndex, formatNoteNudge, promptSurfaceHashMaterial, createPromptSurfaceRuntime, createPromptSurfaceGuidanceEpochCache, SYNTH_USER_ID_PREFIX, resolvePiStableId, resolvePiRealStableId, isPiContentFallbackId, isPiIndexFallbackId, piContentFallbackIds, readPiSessionSnapshot, readPiSessionMessages, readPiSessionMessagePage, findRestartModelSeedFromBranch, iterateEntriesToRawMessageRange, convertEntriesToRawMessages, convertPiAssistantEntryById, convertEntriesToRawMessagePage, countPiRawMessages, USER_MEMORY_CANDIDATE_TTL_MS, insertUserMemoryCandidates, getUserMemoryCandidates, deleteUserMemoryCandidates, pruneExpiredUserMemoryCandidates, insertUserMemory, getActiveUserMemories, updateUserMemoryContent, dismissUserMemory, getTaskScheduleState, getFailingDreamTasks, getSkippedDreamTasks, getMostRecentTaskRunAt, pruneNonCanonicalTaskRows, deleteTaskScheduleRowsForProject, seedTaskScheduleState, writeTaskScheduleState, isRetrospectiveWindowProcessed, recordRetrospectiveWindowProcessed, curateCategoryForMemoryCategory, peekCurateCategoryScope, beginCurateCategoryRun, curateTaskStateAfterSuccess, isDirectiveShapedProjectRule, takeCurateSafetyRefusalCount, wakePlaneStatus, loadPiConfig, loadPiConfigDetailed, unregisterPiProjectEmbeddings, ensureProjectRegisteredFromPiDirectory, resolvePiHarnessDetection, resolvePiHarnessKind, 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, resolvePiOrdinalAlignment, piRawOrdinalOffsetSource, resolvePiOrdinalAlignmentForContext, isPiOrdinalAlignmentUnanchored, clearPiOrdinalAlignmentSession, rememberTodowriteToolCallTodos, parseTodos, setTodoSnapshot, registerTodoOverlay, registerTodoStateLifecycle, syncCtxMemoryToolEnabled, registerMagicContextTools };