@cortexkit/pi-magic-context 0.49.65 → 0.49.66

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 (25) hide show
  1. package/dist/auto-search-worker.js +1 -1
  2. package/dist/chunk-embedding-write-worker.js +1 -1
  3. package/dist/{index-1tkrgcdt.js → index-3e0w4aa3.js} +31 -15
  4. package/dist/{index-98e27fdt.js → index-5vqnvjb2.js} +1 -1
  5. package/dist/{index-67q9cz3f.js → index-msp5k4hv.js} +1 -1
  6. package/dist/{index-8328rak2.js → index-ndc0xtrh.js} +1 -1
  7. package/dist/{index-7vhbmjgv.js → index-pehdap7a.js} +12 -1
  8. package/dist/{index-renfmk50.js → index-pvd2xhwy.js} +1 -1
  9. package/dist/{index-vkcb1cg1.js → index-thj34b3p.js} +3 -3
  10. package/dist/{index-ye6b3dr4.js → index-wdeb9me3.js} +1 -1
  11. package/dist/{index-6vmpw4z3.js → index-wxgfn7h9.js} +11 -9
  12. package/dist/{index-hja11zte.js → index-xrhj81gf.js} +1 -1
  13. package/dist/index.js +39 -18
  14. package/dist/{message-index-bounded-b5vft8jk.js → message-index-bounded-53hv89kz.js} +3 -3
  15. package/dist/migration-worker.js +1 -1
  16. package/dist/raw-ordinal-warmup-worker.js +4 -4
  17. package/dist/{read-session-chunk-nfkemn80.js → read-session-chunk-0bcnmmch.js} +2 -2
  18. package/dist/{render-173bqp1y.js → render-ervyr738.js} +5 -5
  19. package/dist/{search-archive-7snt7cyv.js → search-archive-2bh9j29f.js} +4 -4
  20. package/dist/{search-ea9x8vxk.js → search-btspay8j.js} +4 -4
  21. package/dist/{storage-tags-n8q8jk1b.js → storage-tags-2j1zhtq7.js} +1 -1
  22. package/dist/subagent-entry.js +9 -9
  23. package/dist/tag-snapshot-worker-pi.js +3 -3
  24. package/dist/{v2-archive-reader-5vmwk9y5.js → v2-archive-reader-kxc3cdez.js} +1 -1
  25. package/package.json +1 -1
@@ -31,7 +31,7 @@ serveWorkerJobs(async (initial, port) => {
31
31
  import("./embedding-cache-7rp4gqzr.js"),
32
32
  import("./storage-memory-0ndn65fm.js"),
33
33
  import("./project-embedding-registry-63wsm3a8.js"),
34
- import("./search-ea9x8vxk.js"),
34
+ import("./search-btspay8j.js"),
35
35
  import("./compartment-chunk-embedding-avkyp2df.js"),
36
36
  import("./embedding-activity-ew6dshfd.js"),
37
37
  import("./harness-9872e0ym.js"),
@@ -35,7 +35,7 @@ import"./index-453s1hj6.js";
35
35
  import {
36
36
  LATEST_SUPPORTED_VERSION,
37
37
  enforceSchemaFence
38
- } from "./index-67q9cz3f.js";
38
+ } from "./index-msp5k4hv.js";
39
39
  import"./index-3bb24eb6.js";
40
40
  import"./index-gavj3e6h.js";
41
41
  import"./index-jhmz9tgv.js";
@@ -56,7 +56,7 @@ import {
56
56
  import {
57
57
  piHarnessKindFromExecutable,
58
58
  getErrorMessage
59
- } from "./index-67q9cz3f.js";
59
+ } from "./index-msp5k4hv.js";
60
60
  import {
61
61
  getOrCreateSessionMeta,
62
62
  updateSessionMeta,
@@ -70,10 +70,10 @@ import {
70
70
  renderMessageByOrdinal2,
71
71
  renderVerboseRange2,
72
72
  renderItemByTag2
73
- } from "./index-6vmpw4z3.js";
73
+ } from "./index-wxgfn7h9.js";
74
74
  import {
75
75
  getLastIndexedOrdinal
76
- } from "./index-renfmk50.js";
76
+ } from "./index-pvd2xhwy.js";
77
77
  import {
78
78
  TODO_STATUSES,
79
79
  TODO_PRIORITIES,
@@ -89,7 +89,7 @@ import {
89
89
  getCompactionMarkerPublicationState,
90
90
  compareAndSetCompactionMarkerPublicationState,
91
91
  getDeferredClearedCompactionMarkerState
92
- } from "./index-7vhbmjgv.js";
92
+ } from "./index-pehdap7a.js";
93
93
  import {
94
94
  stableStringify,
95
95
  BoundedSessionMap
@@ -142,7 +142,7 @@ import {
142
142
  resolveMemoriesByIdsForSearch2,
143
143
  unifiedSearch2,
144
144
  formatSearchResults2
145
- } from "./index-8328rak2.js";
145
+ } from "./index-ndc0xtrh.js";
146
146
  import {
147
147
  resolveOpenCodeDbPath,
148
148
  assertOpenCodeStoreGeneration
@@ -151,7 +151,7 @@ import {
151
151
  hasRawMessageProvider2,
152
152
  setRawMessageProvider2,
153
153
  readSessionChunk2
154
- } from "./index-98e27fdt.js";
154
+ } from "./index-5vqnvjb2.js";
155
155
  import {
156
156
  resolveWorkspaceShareCategories,
157
157
  resolveWorkspaceIdentitySet,
@@ -184,7 +184,7 @@ import {
184
184
  } from "./index-3s39a1md.js";
185
185
  import {
186
186
  renderSearchArchive2
187
- } from "./index-hja11zte.js";
187
+ } from "./index-xrhj81gf.js";
188
188
  import {
189
189
  computeNormalizedHash
190
190
  } from "./index-9x1f96r8.js";
@@ -3509,7 +3509,7 @@ function countPiRawMessages(entries, ordinalOffset = 0) {
3509
3509
  }
3510
3510
  return count + Number(pendingTools);
3511
3511
  }
3512
- function locatePiRawOrdinals(entries, wanted) {
3512
+ function locatePiRawOrdinals(entries, wanted, onLocatedInPrefix) {
3513
3513
  const found = new Map;
3514
3514
  if (wanted.size === 0)
3515
3515
  return found;
@@ -3542,8 +3542,10 @@ function locatePiRawOrdinals(entries, wanted) {
3542
3542
  ordinal++;
3543
3543
  note(entry.id);
3544
3544
  }
3545
- if (found.size === wanted.size)
3545
+ if (found.size === wanted.size) {
3546
+ onLocatedInPrefix?.();
3546
3547
  return found;
3548
+ }
3547
3549
  }
3548
3550
  if (pendingFirstId !== null) {
3549
3551
  ordinal++;
@@ -7663,6 +7665,11 @@ async function reportSubagentStartupError(error) {
7663
7665
  // src/pi-ordinal-alignment.ts
7664
7666
  var ALIGNED = { kind: "aligned", offset: 0 };
7665
7667
  var resolvedByEntries = new WeakMap;
7668
+ function inheritPiOrdinalAlignment(sessionId, previous, appended) {
7669
+ const cached = resolvedByEntries.get(previous)?.get(sessionId);
7670
+ if (cached?.prefixComplete)
7671
+ resolvedByEntries.set(appended, new Map([[sessionId, cached]]));
7672
+ }
7666
7673
  var loggedSignatureBySession = new Map;
7667
7674
  function readAnchorRows(db, sessionId) {
7668
7675
  const rows = db.prepare("SELECT sequence, start_message, end_message, start_message_id, end_message_id FROM compartments WHERE session_id = ? AND rebase_status != 'unresolved' AND end_message_id IS NOT NULL AND end_message_id != '' ORDER BY sequence DESC LIMIT 2").all(sessionId);
@@ -7673,7 +7680,7 @@ function readAnchorRows(db, sessionId) {
7673
7680
  return typeof r.sequence === "number" && typeof r.start_message === "number" && typeof r.end_message === "number" && typeof r.end_message_id === "string" && r.end_message_id.length > 0;
7674
7681
  });
7675
7682
  }
7676
- function deriveAlignment(rows, entries) {
7683
+ function deriveAlignment(rows, entries, onLocatedInPrefix) {
7677
7684
  const [newest, previous] = rows;
7678
7685
  if (!newest)
7679
7686
  return ALIGNED;
@@ -7692,7 +7699,7 @@ function deriveAlignment(rows, entries) {
7692
7699
  stored: previous.end_message
7693
7700
  });
7694
7701
  }
7695
- const located = locatePiRawOrdinals(entries, new Set([newest.end_message_id, ...checks.map((check) => check.id)]));
7702
+ const located = locatePiRawOrdinals(entries, new Set([newest.end_message_id, ...checks.map((check) => check.id)]), onLocatedInPrefix);
7696
7703
  const branchOrdinal = located.get(newest.end_message_id);
7697
7704
  if (branchOrdinal === undefined) {
7698
7705
  return {
@@ -7775,17 +7782,26 @@ function resolvePiOrdinalAlignment(db, sessionId, entries) {
7775
7782
  report(sessionId, unresolved);
7776
7783
  return unresolved;
7777
7784
  }
7778
- const key = rows.map((row) => `${row.sequence}:${row.start_message}:${row.end_message}:${row.start_message_id ?? ""}:${row.end_message_id}`).join("|");
7785
+ const key = JSON.stringify(rows.map((row) => [
7786
+ row.sequence,
7787
+ row.start_message,
7788
+ row.end_message,
7789
+ row.start_message_id,
7790
+ row.end_message_id
7791
+ ]));
7779
7792
  let bySession = resolvedByEntries.get(entries);
7780
7793
  const cached = bySession?.get(sessionId);
7781
7794
  if (cached && cached.key === key)
7782
7795
  return cached.alignment;
7783
- const alignment = deriveAlignment(rows, entries);
7796
+ let prefixComplete = false;
7797
+ const alignment = deriveAlignment(rows, entries, () => {
7798
+ prefixComplete = true;
7799
+ });
7784
7800
  if (!bySession) {
7785
7801
  bySession = new Map;
7786
7802
  resolvedByEntries.set(entries, bySession);
7787
7803
  }
7788
- bySession.set(sessionId, { key, alignment });
7804
+ bySession.set(sessionId, { key, alignment, prefixComplete });
7789
7805
  report(sessionId, alignment);
7790
7806
  return alignment;
7791
7807
  }
@@ -10953,4 +10969,4 @@ function registerMagicContextTools(pi, opts) {
10953
10969
  }
10954
10970
  }
10955
10971
 
10956
- export { COMPACTION_ENABLED_PATH, isDreamerRunnable, isCompactionEnabled, isCommitRetentionPaused, copyCommitRetentionRecovery, formatConfigParseStatusLine, formatConfigParseNotice, claimConfigParseFailuresOnce, parseJsoncRecovering, detectConfigFile, OPENCODE_OUTPUT_CAP, MIN_PLAUSIBLE_CONTEXT_LIMIT, catalogOutputReserve, deriveWindowGeometry, hasTrustedAbsoluteWall, applyProvenInputFloor, formatWindowDerivationLine, formatWindowSource, isSaneLimit, resolveOutputReserve, getSdkWindowGeometry, getSdkContextLimit, getSdkOutputLimit, getSdkInputLimit, cortexKitUserConfigBasePath, cortexKitProjectConfigBasePath, migrateMagicContextConfigLocations, getProtectedTokensTierOverrides, 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, requestToolsFingerprint, classifyRequestToolsChange, requestToolSchemaDigest, 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, resolveWorkspaceRenderContext, sourceNamesForMemories, readM0ProjectMemories, trimMemoriesToBudgetV2, trimWorkspaceMemoriesToBudgetV2, trimUserMemoriesToBudget, renderMemoryBlockV2, stripMemoryMuralBlock, resetPrefixTrimFallbackState, isDirectiveShapedProjectRule, takeCurateSafetyRefusalCount, wakePlaneStatus, loadPiConfig, loadPiConfigDetailed, unregisterPiProjectEmbeddings, ensureProjectRegisteredFromPiDirectory, neutralizeOmpMentions, restoreOmpMentions, resolvePiHarnessDetection, resolvePiHarnessKind, readSubagentStartupError, reportSubagentStartupError, resolvePiOrdinalAlignment, piRawOrdinalOffsetSource, resolvePiOrdinalAlignmentForContext, isPiOrdinalAlignmentUnanchored, clearPiOrdinalAlignmentSession, rememberTodowriteToolCallTodos, parseTodos, setTodoSnapshot, registerTodoOverlay, registerTodoStateLifecycle, syncCtxMemoryToolEnabled, registerMagicContextTools };
10972
+ export { COMPACTION_ENABLED_PATH, isDreamerRunnable, isCompactionEnabled, isCommitRetentionPaused, copyCommitRetentionRecovery, formatConfigParseStatusLine, formatConfigParseNotice, claimConfigParseFailuresOnce, parseJsoncRecovering, detectConfigFile, OPENCODE_OUTPUT_CAP, MIN_PLAUSIBLE_CONTEXT_LIMIT, catalogOutputReserve, deriveWindowGeometry, hasTrustedAbsoluteWall, applyProvenInputFloor, formatWindowDerivationLine, formatWindowSource, isSaneLimit, resolveOutputReserve, getSdkWindowGeometry, getSdkContextLimit, getSdkOutputLimit, getSdkInputLimit, cortexKitUserConfigBasePath, cortexKitProjectConfigBasePath, migrateMagicContextConfigLocations, getProtectedTokensTierOverrides, 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, requestToolsFingerprint, classifyRequestToolsChange, requestToolSchemaDigest, 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, resolveWorkspaceRenderContext, sourceNamesForMemories, readM0ProjectMemories, trimMemoriesToBudgetV2, trimWorkspaceMemoriesToBudgetV2, trimUserMemoriesToBudget, renderMemoryBlockV2, stripMemoryMuralBlock, resetPrefixTrimFallbackState, isDirectiveShapedProjectRule, takeCurateSafetyRefusalCount, wakePlaneStatus, loadPiConfig, loadPiConfigDetailed, unregisterPiProjectEmbeddings, ensureProjectRegisteredFromPiDirectory, neutralizeOmpMentions, restoreOmpMentions, resolvePiHarnessDetection, resolvePiHarnessKind, readSubagentStartupError, reportSubagentStartupError, inheritPiOrdinalAlignment, resolvePiOrdinalAlignment, piRawOrdinalOffsetSource, resolvePiOrdinalAlignmentForContext, isPiOrdinalAlignmentUnanchored, clearPiOrdinalAlignmentSession, rememberTodowriteToolCallTodos, parseTodos, setTodoSnapshot, registerTodoOverlay, registerTodoStateLifecycle, syncCtxMemoryToolEnabled, registerMagicContextTools };
@@ -39,7 +39,7 @@ import {
39
39
  providerVisiblePart,
40
40
  getCandidateToolOwners2,
41
41
  pickNearestPriorOwner2
42
- } from "./index-7vhbmjgv.js";
42
+ } from "./index-pehdap7a.js";
43
43
  import {
44
44
  OMO_INTERNAL_INITIATOR_MARKER,
45
45
  isSystemDirective,
@@ -1787,7 +1787,7 @@ function finishDatabaseOpen(db, dbPath, explicitDbPath, latestSupportedVersion)
1787
1787
  state.running = startMessageFtsRowidMapBackfill2(db, signal).then(async () => {
1788
1788
  if (signal.aborted || !readsOpenCodeStore)
1789
1789
  return;
1790
- const { readRawSessionMessagePage, readRawSessionMessages } = await importPluginModule(() => import("./read-session-chunk-nfkemn80.js"));
1790
+ const { readRawSessionMessagePage, readRawSessionMessages } = await importPluginModule(() => import("./read-session-chunk-0bcnmmch.js"));
1791
1791
  const { startMessageTimeBackfill } = await importPluginModule(() => import("./message-time-backfill-8zwv9byv.js"));
1792
1792
  if (signal.aborted)
1793
1793
  return;
@@ -91,7 +91,7 @@ import {
91
91
  clearIndexedMessages,
92
92
  indexSingleMessage,
93
93
  indexMessagesAfterOrdinal
94
- } from "./index-renfmk50.js";
94
+ } from "./index-pvd2xhwy.js";
95
95
  import {
96
96
  MESSAGE_FTS_SESSION_FILTER_SQL,
97
97
  withMessageFtsSessionFilter
@@ -2072,6 +2072,12 @@ import { AsyncLocalStorage } from "node:async_hooks";
2072
2072
 
2073
2073
  // ../plugin/src/features/magic-context/storage-meta-shared.ts
2074
2074
  import { Buffer as Buffer2 } from "node:buffer";
2075
+ var CACHED_TRIM_PARTIAL_SQL = `EXISTS (
2076
+ SELECT 1 FROM compartments
2077
+ WHERE compartments.session_id = session_meta.session_id
2078
+ AND compartments.end_message_id = session_meta.cached_m0_last_baseline_end_message_id
2079
+ AND compartments.end_block_index IS NOT NULL
2080
+ )`;
2075
2081
  var SESSION_META_SELECT_COLUMNS = [
2076
2082
  "session_id",
2077
2083
  "last_response_time",
@@ -2098,6 +2104,7 @@ var SESSION_META_SELECT_COLUMNS = [
2098
2104
  "cached_m0_mural_data_url",
2099
2105
  "cached_m0_mural_hash",
2100
2106
  "cached_m1_bytes",
2107
+ "cached_m0_last_baseline_end_message_id",
2101
2108
  "cached_m0_project_memory_epoch",
2102
2109
  "cached_m0_workspace_fingerprint",
2103
2110
  "cached_m0_project_user_profile_version",
@@ -2257,6 +2264,8 @@ function getDefaultSessionMeta(sessionId) {
2257
2264
  cachedM0MuralDataUrl: null,
2258
2265
  cachedM0MuralHash: null,
2259
2266
  cachedM1Bytes: null,
2267
+ cachedM0TrimBoundaryId: null,
2268
+ cachedM0TrimBoundaryPartial: false,
2260
2269
  cachedM0ProjectMemoryEpoch: null,
2261
2270
  cachedM0WorkspaceFingerprint: null,
2262
2271
  cachedM0ProjectUserProfileVersion: null,
@@ -2334,6 +2343,8 @@ function toSessionMeta(row) {
2334
2343
  cachedM0MuralDataUrl: stringOrNull(row.cached_m0_mural_data_url),
2335
2344
  cachedM0MuralHash: stringOrNull(row.cached_m0_mural_hash),
2336
2345
  cachedM1Bytes: toBufferOrNull(row.cached_m1_bytes),
2346
+ cachedM0TrimBoundaryId: row.cached_m0_last_baseline_end_message_id || null,
2347
+ cachedM0TrimBoundaryPartial: row.cached_trim_partial === 1,
2337
2348
  cachedM0ProjectMemoryEpoch: numOrNull(row.cached_m0_project_memory_epoch),
2338
2349
  cachedM0WorkspaceFingerprint: stringOrNull(row.cached_m0_workspace_fingerprint),
2339
2350
  cachedM0ProjectUserProfileVersion: numOrNull(row.cached_m0_project_user_profile_version),
@@ -6531,4 +6542,4 @@ function resolveEpochFloorForPass(db, sessionId, inputs) {
6531
6542
  return preSnapshotResult(firstObservedMemo, resolvedInputs);
6532
6543
  }
6533
6544
 
6534
- export { detectThinkingBindingMismatch, detectLatestTurnThinkingMismatch, isPrefixBoundThinkingModel, detectOverflow, MAX_EXECUTE_THRESHOLD, escalationBands, MERGED_REASONING_PARTS_PREFIX, decodeMergedReasoningParts, UNKNOWN_FIT_RATIO, hasMeasuredDecisionCalibration, providerMass, localBudget, calibrationForModelKey, historyLocalBudget, HYGIENE_PROVIDER_UNITS_VERSION, sessionDecisionCalibration, transitionSessionHygieneUnits, adoptedProtectedToolsPolicy, protectedToolTagNumbers, protectedToolTokenCount, stripWellFormedLeadingTagPrefix, stripPersistedAssistantText, byteSize, stripTagPrefix, peelLeadingMcTagNotation, prependTag, rememberCurrentToolOutputCount, currentReclaimableToolOutputCount, isRecord, TEXT_TAG_IDENTITY_MARKER, PI_FALLBACK_PREFIXES_JSON, contentTagOwnerMessageId, TailHygieneJsonMemo, piJsonHash, estimateImageTokensFromDataUrl, providerVisiblePart, providerVisibleMessage, TODO_STATUSES, TODO_PRIORITIES, TITLE_DONE_STATUSES, normalizeTodoStateJson, buildSyntheticTodoPart, stripChannel1ReminderSpans, compareMeasuredTailPrefix, formatTailHygienePrefixMismatch, freezeTailHygieneMeasurement, effectiveTailHygiene, CHANNEL1_SENTINEL, CHANNEL1_FLOOR_TOKENS, decideChannel1, evaluateChannel2, buildChannel2Reminder, buildChannel1Reminder, SESSION_META_SELECT_COLUMNS, META_COLUMNS, BOOLEAN_META_KEYS, NULL_BIND_META_KEYS, isSessionMetaRow, getDefaultSessionMeta, ensureSessionMetaRow, toSessionMeta, persistCachedM0, clearCachedM0M1, isRustMarkerAdmissionFenced, ReplayDocumentError, readReplayEnvelope, readReplayDocument, updateReplayDocument, writeReplayDocument, getReasoningRemovalState, modelAcceptsEmptyContent, isAnthropicFamilyRoute, variantChangeBustsProviderCache, isInActiveAnthropicTurn, activeAnthropicTurnStart, hasAnthropicReasoning, isMarkerOnlyText, findLatestAssistantReasoningMutationExemptMessage, DEFAULT_KEEP_REASONING_TOKENS, resolveKeepReasoningTokens, reasoningStepCost, reasoningBudgetCutoff, reasoningTextAndOpaque, opaqueThinkingCost, estimatePartImageTokens, planEmergencyDrop, measureEmergencyTag, tagsSinceReading, queuePendingOp, queuePendingDropForUnchangedTag, getPendingOps, getPendingOpsCount, clearPendingOps, removePendingOp, updateTagByteSize2, getRecentTagOwnerMessageIds2, getActiveTagTokenAggregate2, AGE_RECLAIM_MIN_TOKENS2, getOldestActiveUnprotectedToolTags2, getActiveToolTagsForAgeReclaim2, getTriggerTagTokenUpperBound2, getActiveTagTokenTotalsByMessage2, updateTagInputByteSize2, updateTagTokenCount2, setTagTokenCount2, getPersistedToolTagAccounting2, getAllStatusTagTokenTotalsFlat2, getReasoningTokenEstimatesByMessage2, tryGetReasoningTokenEstimatesByMessage2, getMaxTagNumberByOwnerMessage2, scanTagOwnerSummary2, scanTagOwnerDelta2, updateTagInputTokenCount2, tagTokenCountIsNull2, backfillTagTokenCounts2, normalizeTagSnapshotRow2, insertTag2, updateTagStatus2, markTagDropped2, getInertWhitespaceAssistantTagsByNumbers2, updateTagDropMode2, updateCavemanDepth2, updateTagMessageId2, hasPiFallbackMessageTags2, findAdoptableFallbackTags2, adoptFallbackTagMessageId2, foldShrunkPartTags2, hasPiFallbackToolOwnerTags2, findPiFallbackToolOwnerTags2, PiTagIdentityConflictError2, getPiMessageTagCandidates2, findPiTagIdentityConflict2, adoptPiFallbackToolOwnerTag2, adoptPiFallbackMessageTag2, markTagsCompactedByMessageIds2, deleteTagsByMessageId2, getMaxTagNumberBySession2, getTagNumberByMessageId2, getAssignableTagNumberByMessageId2, getMinMessageTagNumberForRawId2, deriveTagLoadFloor2, TAG_SELECT_COLUMNS2, getTagsBySession2, getActiveTagsBySession2, getTailHygieneTags2, getTagsForPendingOperations2, getTagsByNumbers2, getNewestToolTagNumbers2, getDroppedTagsByNumbers2, getMaxDroppedTagNumber2, getTagById2, getTopNBySize2, getToolTagNumberByOwner2, getNullOwnerToolTag2, adoptNullOwnerToolTag2, getCandidateToolOwners2, pickNearestPriorOwner2, rowWindowMass, computeProtectionWindow, readEpochFloorSnapshot, getProtectionWindowForSession, isProviderOverflowFailClosedProven, getEmergencyRecoveryArmedAt, describeProtectedTailDrainBudgetSkip, loadPersistedUsage, loadProtectedTailMeta, markProtectedTailPolicyV3Seeded, recordProtectedTailPublicationFloor, recordProtectedTailNoEligibleHead, getWrapupInProgressState, isWrapupInProgress, acquireWrapupInProgress, updateWrapupInProgress, releaseWrapupInProgress, resolveCompactionModeRecord, getCompactionModeRecord, setCompactionModeRecord, EMERGENCY_DRAIN_FAILURE_BACKOFF_MS, 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, setNoteLastReadAt, getHistorianFailureState, incrementHistorianFailure, clearHistorianFailureState, getOverflowState, recordOverflowDetected, clearEmergencyRecovery, clearDetectedContextLimit, getPersistedCompactionMarkerState, getCompactionMarkerPublicationState, compareAndSetCompactionMarkerPublicationState, getDeferredClearedCompactionMarkerState, parseStrippedPlaceholderState, serializeStrippedPlaceholderState, getStrippedPlaceholderIds, applyStrippedPlaceholderDelta, THINKING_BINDING_RECOVERY_FROZEN_PREFIX, THINKING_BINDING_STRIP_ORDER_END_MARKER, thinkingBindingRecoveryFrozenId, COMPACTION_OFF_THINKING_FROZEN_PREFIX, getThinkingBindingRecoveryTarget, armThinkingBindingRecovery, clearThinkingBindingRecoveryIf, getMergedReasoningStrippedIds, addMergedReasoningStrippedIds, getProcessedImageStrippedIds, parseProcessedImageMarkers, serializeProcessedImageMarkers, addProcessedImageStrippedIds, getPendingCompactionMarkerState, getCompactionMarkerHealth, loadPostprocessReplaySnapshot, clearPendingCompactionMarkerStateIf, getPendingPiCompactionMarkerState, setPendingPiCompactionMarkerState, clearPendingPiCompactionMarkerStateIf, logPiCompactionMarkerClear, getSessionsWithPendingPiMarker, setSessionWorkMetrics, getSessionWorkMetrics, resolveEpochFloorForPass };
6545
+ export { detectThinkingBindingMismatch, detectLatestTurnThinkingMismatch, isPrefixBoundThinkingModel, detectOverflow, MAX_EXECUTE_THRESHOLD, escalationBands, MERGED_REASONING_PARTS_PREFIX, decodeMergedReasoningParts, UNKNOWN_FIT_RATIO, hasMeasuredDecisionCalibration, providerMass, localBudget, calibrationForModelKey, historyLocalBudget, HYGIENE_PROVIDER_UNITS_VERSION, sessionDecisionCalibration, transitionSessionHygieneUnits, adoptedProtectedToolsPolicy, protectedToolTagNumbers, protectedToolTokenCount, stripWellFormedLeadingTagPrefix, stripPersistedAssistantText, byteSize, stripTagPrefix, peelLeadingMcTagNotation, prependTag, rememberCurrentToolOutputCount, currentReclaimableToolOutputCount, isRecord, TEXT_TAG_IDENTITY_MARKER, PI_FALLBACK_PREFIXES_JSON, contentTagOwnerMessageId, TailHygieneJsonMemo, piJsonHash, estimateImageTokensFromDataUrl, providerVisiblePart, providerVisibleMessage, TODO_STATUSES, TODO_PRIORITIES, TITLE_DONE_STATUSES, normalizeTodoStateJson, buildSyntheticTodoPart, stripChannel1ReminderSpans, compareMeasuredTailPrefix, formatTailHygienePrefixMismatch, freezeTailHygieneMeasurement, effectiveTailHygiene, CHANNEL1_SENTINEL, CHANNEL1_FLOOR_TOKENS, decideChannel1, evaluateChannel2, buildChannel2Reminder, buildChannel1Reminder, CACHED_TRIM_PARTIAL_SQL, SESSION_META_SELECT_COLUMNS, META_COLUMNS, BOOLEAN_META_KEYS, NULL_BIND_META_KEYS, isSessionMetaRow, getDefaultSessionMeta, ensureSessionMetaRow, toSessionMeta, persistCachedM0, clearCachedM0M1, isRustMarkerAdmissionFenced, ReplayDocumentError, readReplayEnvelope, readReplayDocument, updateReplayDocument, writeReplayDocument, getReasoningRemovalState, modelAcceptsEmptyContent, isAnthropicFamilyRoute, variantChangeBustsProviderCache, isInActiveAnthropicTurn, activeAnthropicTurnStart, hasAnthropicReasoning, isMarkerOnlyText, findLatestAssistantReasoningMutationExemptMessage, DEFAULT_KEEP_REASONING_TOKENS, resolveKeepReasoningTokens, reasoningStepCost, reasoningBudgetCutoff, reasoningTextAndOpaque, opaqueThinkingCost, estimatePartImageTokens, planEmergencyDrop, measureEmergencyTag, tagsSinceReading, queuePendingOp, queuePendingDropForUnchangedTag, getPendingOps, getPendingOpsCount, clearPendingOps, removePendingOp, updateTagByteSize2, getRecentTagOwnerMessageIds2, getActiveTagTokenAggregate2, AGE_RECLAIM_MIN_TOKENS2, getOldestActiveUnprotectedToolTags2, getActiveToolTagsForAgeReclaim2, getTriggerTagTokenUpperBound2, getActiveTagTokenTotalsByMessage2, updateTagInputByteSize2, updateTagTokenCount2, setTagTokenCount2, getPersistedToolTagAccounting2, getAllStatusTagTokenTotalsFlat2, getReasoningTokenEstimatesByMessage2, tryGetReasoningTokenEstimatesByMessage2, getMaxTagNumberByOwnerMessage2, scanTagOwnerSummary2, scanTagOwnerDelta2, updateTagInputTokenCount2, tagTokenCountIsNull2, backfillTagTokenCounts2, normalizeTagSnapshotRow2, insertTag2, updateTagStatus2, markTagDropped2, getInertWhitespaceAssistantTagsByNumbers2, updateTagDropMode2, updateCavemanDepth2, updateTagMessageId2, hasPiFallbackMessageTags2, findAdoptableFallbackTags2, adoptFallbackTagMessageId2, foldShrunkPartTags2, hasPiFallbackToolOwnerTags2, findPiFallbackToolOwnerTags2, PiTagIdentityConflictError2, getPiMessageTagCandidates2, findPiTagIdentityConflict2, adoptPiFallbackToolOwnerTag2, adoptPiFallbackMessageTag2, markTagsCompactedByMessageIds2, deleteTagsByMessageId2, getMaxTagNumberBySession2, getTagNumberByMessageId2, getAssignableTagNumberByMessageId2, getMinMessageTagNumberForRawId2, deriveTagLoadFloor2, TAG_SELECT_COLUMNS2, getTagsBySession2, getActiveTagsBySession2, getTailHygieneTags2, getTagsForPendingOperations2, getTagsByNumbers2, getNewestToolTagNumbers2, getDroppedTagsByNumbers2, getMaxDroppedTagNumber2, getTagById2, getTopNBySize2, getToolTagNumberByOwner2, getNullOwnerToolTag2, adoptNullOwnerToolTag2, getCandidateToolOwners2, pickNearestPriorOwner2, rowWindowMass, computeProtectionWindow, readEpochFloorSnapshot, getProtectionWindowForSession, isProviderOverflowFailClosedProven, getEmergencyRecoveryArmedAt, describeProtectedTailDrainBudgetSkip, loadPersistedUsage, loadProtectedTailMeta, markProtectedTailPolicyV3Seeded, recordProtectedTailPublicationFloor, recordProtectedTailNoEligibleHead, getWrapupInProgressState, isWrapupInProgress, acquireWrapupInProgress, updateWrapupInProgress, releaseWrapupInProgress, resolveCompactionModeRecord, getCompactionModeRecord, setCompactionModeRecord, EMERGENCY_DRAIN_FAILURE_BACKOFF_MS, 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, setNoteLastReadAt, getHistorianFailureState, incrementHistorianFailure, clearHistorianFailureState, getOverflowState, recordOverflowDetected, clearEmergencyRecovery, clearDetectedContextLimit, getPersistedCompactionMarkerState, getCompactionMarkerPublicationState, compareAndSetCompactionMarkerPublicationState, getDeferredClearedCompactionMarkerState, parseStrippedPlaceholderState, serializeStrippedPlaceholderState, getStrippedPlaceholderIds, applyStrippedPlaceholderDelta, THINKING_BINDING_RECOVERY_FROZEN_PREFIX, THINKING_BINDING_STRIP_ORDER_END_MARKER, thinkingBindingRecoveryFrozenId, COMPACTION_OFF_THINKING_FROZEN_PREFIX, getThinkingBindingRecoveryTarget, armThinkingBindingRecovery, clearThinkingBindingRecoveryIf, getMergedReasoningStrippedIds, addMergedReasoningStrippedIds, getProcessedImageStrippedIds, parseProcessedImageMarkers, serializeProcessedImageMarkers, addProcessedImageStrippedIds, getPendingCompactionMarkerState, getCompactionMarkerHealth, loadPostprocessReplaySnapshot, clearPendingCompactionMarkerStateIf, getPendingPiCompactionMarkerState, setPendingPiCompactionMarkerState, clearPendingPiCompactionMarkerStateIf, logPiCompactionMarkerClear, getSessionsWithPendingPiMarker, setSessionWorkMetrics, getSessionWorkMetrics, resolveEpochFloorForPass };
@@ -9,7 +9,7 @@ import {
9
9
  } from "./index-pefn1gt5.js";
10
10
  import {
11
11
  cleanUserText2
12
- } from "./index-98e27fdt.js";
12
+ } from "./index-5vqnvjb2.js";
13
13
  import {
14
14
  recordMessageFtsRowid2,
15
15
  recordIndexedMessageTime2,
@@ -139,9 +139,9 @@ async function serveV2ArchiveReads2(port, openConnections) {
139
139
  import("./sqlite-v89bj0yy.js"),
140
140
  import("./store-reader-mmfw2h48.js"),
141
141
  import("./store-0hhs1db3.js"),
142
- import("./read-session-chunk-nfkemn80.js"),
143
- import("./render-173bqp1y.js"),
144
- import("./search-archive-7snt7cyv.js"),
142
+ import("./read-session-chunk-0bcnmmch.js"),
143
+ import("./render-ervyr738.js"),
144
+ import("./search-archive-2bh9j29f.js"),
145
145
  import("./expand-attachments-8sxeyj26.js")
146
146
  ]);
147
147
  const pool = new V2StoreReaderPool;
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  getTagsBySession2,
9
9
  getTagsByNumbers2
10
- } from "./index-7vhbmjgv.js";
10
+ } from "./index-pehdap7a.js";
11
11
  import {
12
12
  inRootAsyncContext2,
13
13
  getSqliteDatabasePath2,
@@ -16,6 +16,7 @@ import {
16
16
  decodeMergedReasoningParts,
17
17
  isRecord,
18
18
  providerVisibleMessage,
19
+ CACHED_TRIM_PARTIAL_SQL,
19
20
  SESSION_META_SELECT_COLUMNS,
20
21
  META_COLUMNS,
21
22
  BOOLEAN_META_KEYS,
@@ -39,7 +40,7 @@ import {
39
40
  serializeProcessedImageMarkers,
40
41
  getPendingPiCompactionMarkerState,
41
42
  logPiCompactionMarkerClear
42
- } from "./index-7vhbmjgv.js";
43
+ } from "./index-pehdap7a.js";
43
44
  import {
44
45
  estimateTokens
45
46
  } from "./index-pefn1gt5.js";
@@ -60,13 +61,13 @@ import {
60
61
  import {
61
62
  isPidAlive,
62
63
  readProcessStartTime
63
- } from "./index-67q9cz3f.js";
64
+ } from "./index-msp5k4hv.js";
64
65
  import {
65
66
  withReadOnlySessionDb,
66
67
  expandToolPart,
67
68
  visitRawSessionMessages2,
68
69
  readRawSessionMessageById2
69
- } from "./index-98e27fdt.js";
70
+ } from "./index-5vqnvjb2.js";
70
71
  import {
71
72
  gaDatabasePath2,
72
73
  V2StoreReader2
@@ -812,6 +813,7 @@ var SESSION_META_FALLBACK_SELECTS = {
812
813
  last_todo_state: "'' AS last_todo_state",
813
814
  tool_reclaim_watermark: "0 AS tool_reclaim_watermark",
814
815
  cached_m0_bytes: "NULL AS cached_m0_bytes",
816
+ cached_m0_last_baseline_end_message_id: "NULL AS cached_m0_last_baseline_end_message_id",
815
817
  cached_m0_mural_data_url: "NULL AS cached_m0_mural_data_url",
816
818
  cached_m0_mural_hash: "NULL AS cached_m0_mural_hash",
817
819
  cached_m1_bytes: "NULL AS cached_m1_bytes",
@@ -840,11 +842,14 @@ function getSessionMetaSelectColumns(db) {
840
842
  if (cached !== undefined)
841
843
  return cached;
842
844
  const existingColumns = new Set(db.prepare("PRAGMA table_info(session_meta)").all().map((column) => column.name));
843
- const projection = SESSION_META_SELECT_COLUMNS.map((column) => {
845
+ const columns = SESSION_META_SELECT_COLUMNS.map((column) => {
844
846
  if (existingColumns.has(column))
845
847
  return column;
846
848
  return SESSION_META_FALLBACK_SELECTS[column] ?? `0 AS ${column}`;
847
- }).join(", ");
849
+ });
850
+ if (existingColumns.has("cached_m0_last_baseline_end_message_id") && getTableColumnNames(db, "compartments").has("end_block_index"))
851
+ columns.push(`${CACHED_TRIM_PARTIAL_SQL} AS cached_trim_partial`);
852
+ const projection = columns.join(", ");
848
853
  sessionMetaSelectColumnsCache.set(db, projection);
849
854
  return projection;
850
855
  }
@@ -1333,9 +1338,6 @@ function getUncoveredCompartmentEndsThrough(db, sessionId, endOrdinal = Number.M
1333
1338
  successorStartMessage: row.successor_start
1334
1339
  }));
1335
1340
  }
1336
- function isPartialCompartmentEnd(db, sessionId, messageId) {
1337
- return Boolean(db.prepare("SELECT 1 FROM compartments WHERE session_id=? AND end_message_id=? AND end_block_index IS NOT NULL LIMIT 1").get(sessionId, messageId));
1338
- }
1339
1341
  // ../plugin/src/features/magic-context/project-docs-hash.ts
1340
1342
  import { createHash as createHash3 } from "node:crypto";
1341
1343
  import { lstatSync as lstatSync2, readFileSync as readFileSync3, statSync } from "node:fs";
@@ -4701,4 +4703,4 @@ function renderItemByTag2(db, sessionId, number, textIndexDomain = "part", attac
4701
4703
  return selected ? renderPartFull(selected) ?? "" : `Tag ${number}'s original text part is no longer in stored history.`;
4702
4704
  }
4703
4705
 
4704
- export { LkgRecoveryFenceError, clearLkgFenceProcessState, lkgFenceRequiresRebuild, lkgRecoveryFenceUnclean, ownsLkgDirtyFence, invalidateCleanLkgRecoveryFence, markLkgRecoveryDirty, rememberUnpublishedAutoSearchNoHint, getUnpublishedAutoSearchNoHint, forgetUnpublishedAutoSearchNoHint, registerAutoSearchWork, cancelAutoSearchWork, PI_IDENTITY_FOLD_GUARD_LIMIT, readPiIdentityFoldGuards, writePiIdentityFoldGuards, readSessionActivity, observeSessionActivity, backfillSessionActivity, readSessionMeta, getOrCreateSessionMeta, updateSessionMeta, advanceToolReclaimWatermark, retryPendingSessionCleanups, retryPendingRustSessionCleanupsForProject, 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, getUncoveredCompartmentEndsThrough, isPartialCompartmentEnd, readProjectDocsCanonical, providerResponseFailed, isSuccessfulProviderCompletion, requestPendingMaterialization, pendingMaterializationOrigin, hasPendingMaterializationOrigin, clearPendingMaterialization, recordSystemRefreshOwnership, recordSystemPromptForRequest, recordHeldHeadForRequest, bindSystemPromptResponse, acknowledgeSystemPromptDelivery, deferDeliveredSystemRefresh, clearSystemPromptDelivery, saveLkgSlotToDb, loadPersistedLkgSlot, drainStaleLkgSlots, createDbLkgPersistence, replayLkg, beginServedRequest, noteServedPassPermission, noteServedReplay, countServedRefusal, dropServedRecord, commitServedRequest, 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, withNativeReplayWriteBarrier, getNativeReplayState, saveNativeToolInputs, addNativeReasoningIds, copySessionStateForClone, externalHistorianFailureReason, subprocessExitHistorianFailureReason, countHistorianRuns, getRecentFailedHistorianRunTimes, recordHistorianRun, summarizeImportance, tallyFactsByCategory, queueMemoryMutation, getMemoryMutationsForRender, getMemoryMutationsForRenderByProjects, getMaxMemoryMutationId, getMaxMemoryMutationIdForProjects, GLOBAL_USER_PROFILE_PROJECT_PATH, getProjectState, bumpProjectUserProfileVersion, saveSourceContent, getSourceContents, recordSubagentInvocation, getLatestHistorianInvocationId, renderMessageByOrdinal2, renderVerboseRange2, renderVerboseRangeForTool2, renderItemByTag2 };
4706
+ export { LkgRecoveryFenceError, clearLkgFenceProcessState, lkgFenceRequiresRebuild, lkgRecoveryFenceUnclean, ownsLkgDirtyFence, invalidateCleanLkgRecoveryFence, markLkgRecoveryDirty, rememberUnpublishedAutoSearchNoHint, getUnpublishedAutoSearchNoHint, forgetUnpublishedAutoSearchNoHint, registerAutoSearchWork, cancelAutoSearchWork, PI_IDENTITY_FOLD_GUARD_LIMIT, readPiIdentityFoldGuards, writePiIdentityFoldGuards, readSessionActivity, observeSessionActivity, backfillSessionActivity, readSessionMeta, getOrCreateSessionMeta, updateSessionMeta, advanceToolReclaimWatermark, retryPendingSessionCleanups, retryPendingRustSessionCleanupsForProject, 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, getUncoveredCompartmentEndsThrough, readProjectDocsCanonical, providerResponseFailed, isSuccessfulProviderCompletion, requestPendingMaterialization, pendingMaterializationOrigin, hasPendingMaterializationOrigin, clearPendingMaterialization, recordSystemRefreshOwnership, recordSystemPromptForRequest, recordHeldHeadForRequest, bindSystemPromptResponse, acknowledgeSystemPromptDelivery, deferDeliveredSystemRefresh, clearSystemPromptDelivery, saveLkgSlotToDb, loadPersistedLkgSlot, drainStaleLkgSlots, createDbLkgPersistence, replayLkg, beginServedRequest, noteServedPassPermission, noteServedReplay, countServedRefusal, dropServedRecord, commitServedRequest, 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, withNativeReplayWriteBarrier, getNativeReplayState, saveNativeToolInputs, addNativeReasoningIds, copySessionStateForClone, externalHistorianFailureReason, subprocessExitHistorianFailureReason, countHistorianRuns, getRecentFailedHistorianRunTimes, recordHistorianRun, summarizeImportance, tallyFactsByCategory, queueMemoryMutation, getMemoryMutationsForRender, getMemoryMutationsForRenderByProjects, getMaxMemoryMutationId, getMaxMemoryMutationIdForProjects, GLOBAL_USER_PROFILE_PROJECT_PATH, getProjectState, bumpProjectUserProfileVersion, saveSourceContent, getSourceContents, recordSubagentInvocation, getLatestHistorianInvocationId, renderMessageByOrdinal2, renderVerboseRange2, renderVerboseRangeForTool2, renderItemByTag2 };
@@ -6,7 +6,7 @@ import {
6
6
  } from "./index-pefn1gt5.js";
7
7
  import {
8
8
  readRawSessionMessageIdOrdinalsForRange2
9
- } from "./index-98e27fdt.js";
9
+ } from "./index-5vqnvjb2.js";
10
10
 
11
11
  // ../plugin/src/tools/ctx-expand/search-archive.ts
12
12
  var archiveReadsOnThisThread = 0;
package/dist/index.js CHANGED
@@ -145,6 +145,7 @@ import {
145
145
  resolvePiHarnessDetection,
146
146
  resolvePiHarnessKind,
147
147
  readSubagentStartupError,
148
+ inheritPiOrdinalAlignment,
148
149
  resolvePiOrdinalAlignment,
149
150
  piRawOrdinalOffsetSource,
150
151
  resolvePiOrdinalAlignmentForContext,
@@ -157,7 +158,7 @@ import {
157
158
  registerTodoStateLifecycle,
158
159
  syncCtxMemoryToolEnabled,
159
160
  registerMagicContextTools
160
- } from "./index-1tkrgcdt.js";
161
+ } from "./index-3e0w4aa3.js";
161
162
  import"./index-4knyh1kt.js";
162
163
  import {
163
164
  canonicalModelIdentity,
@@ -247,6 +248,7 @@ import {
247
248
  evaluateChannel2,
248
249
  buildChannel2Reminder,
249
250
  buildChannel1Reminder,
251
+ CACHED_TRIM_PARTIAL_SQL,
250
252
  ensureSessionMetaRow,
251
253
  persistCachedM0,
252
254
  clearCachedM0M1,
@@ -407,7 +409,7 @@ import {
407
409
  setSessionWorkMetrics,
408
410
  getSessionWorkMetrics,
409
411
  resolveEpochFloorForPass
410
- } from "./index-7vhbmjgv.js";
412
+ } from "./index-pehdap7a.js";
411
413
  import {
412
414
  textMentionsRecentCommit,
413
415
  hasMeaningfulUserText2,
@@ -458,7 +460,7 @@ import {
458
460
  openCurrentDatabase,
459
461
  openDatabaseAsync,
460
462
  closeDatabase
461
- } from "./index-67q9cz3f.js";
463
+ } from "./index-msp5k4hv.js";
462
464
  import {
463
465
  LkgRecoveryFenceError,
464
466
  clearLkgFenceProcessState,
@@ -507,7 +509,6 @@ import {
507
509
  escapeXmlAttr,
508
510
  escapeXmlContent,
509
511
  getUncoveredCompartmentEndThrough,
510
- isPartialCompartmentEnd,
511
512
  readProjectDocsCanonical,
512
513
  providerResponseFailed,
513
514
  isSuccessfulProviderCompletion,
@@ -585,7 +586,7 @@ import {
585
586
  getSourceContents,
586
587
  recordSubagentInvocation,
587
588
  getLatestHistorianInvocationId
588
- } from "./index-6vmpw4z3.js";
589
+ } from "./index-wxgfn7h9.js";
589
590
  import {
590
591
  resolveOpenCodeDbPath,
591
592
  assertOpenCodeStoreGeneration,
@@ -651,7 +652,7 @@ import {
651
652
  getRawSessionTagKeysThrough2,
652
653
  getLegacyProtectedTailStartOrdinal2,
653
654
  readSessionChunk2
654
- } from "./index-98e27fdt.js";
655
+ } from "./index-5vqnvjb2.js";
655
656
  import"./index-nvh6d3bz.js";
656
657
  import {
657
658
  formatSynapseLaneDescriptor
@@ -691,7 +692,7 @@ import {
691
692
  clearCompressionDepthRange,
692
693
  cleanSearchText,
693
694
  matchedSearchSnippet
694
- } from "./index-renfmk50.js";
695
+ } from "./index-pvd2xhwy.js";
695
696
  import {
696
697
  rememberV1HiddenRun
697
698
  } from "./index-6x556c2q.js";
@@ -820,7 +821,7 @@ import {
820
821
  scheduleClearAndReindex,
821
822
  clearSessionTracking,
822
823
  createAutoSearchDiagnostics
823
- } from "./index-8328rak2.js";
824
+ } from "./index-ndc0xtrh.js";
824
825
  import"./index-3s39a1md.js";
825
826
  import {
826
827
  DREAMER_PRIMER_INVESTIGATOR_ALLOWED_TOOLS,
@@ -849,11 +850,11 @@ import {
849
850
  drainPiTagSnapshotSession,
850
851
  assertPiTagSnapshotReady,
851
852
  ensurePiTagSnapshotReady
852
- } from "./index-ye6b3dr4.js";
853
+ } from "./index-wdeb9me3.js";
853
854
  import"./index-71rg8j43.js";
854
855
  import"./index-8d2z6503.js";
855
- import"./index-vkcb1cg1.js";
856
- import"./index-hja11zte.js";
856
+ import"./index-thj34b3p.js";
857
+ import"./index-xrhj81gf.js";
857
858
  import {
858
859
  __toESM
859
860
  } from "./index-22jkk6wg.js";
@@ -3605,7 +3606,7 @@ function startHostStallProfilerSwitch() {
3605
3606
  // package.json
3606
3607
  var package_default = {
3607
3608
  name: "@cortexkit/pi-magic-context",
3608
- version: "0.49.65",
3609
+ version: "0.49.66",
3609
3610
  type: "module",
3610
3611
  description: "Pi and OMP coding agent extension for Magic Context — cross-session memory and context management",
3611
3612
  main: "dist/index.js",
@@ -35559,6 +35560,7 @@ function getCachedMarkers(db, state, compartmentsForNormalization, metaOverride,
35559
35560
  compartmentRenderEpoch: cachedUpgradeIdentity.compartmentRenderEpoch,
35560
35561
  memoryRenderEpoch: cachedUpgradeIdentity.memoryRenderEpoch,
35561
35562
  lastBaselineEndMessageId: cachedBoundary,
35563
+ lastBaselineEndPartial: cachedRowOverride?.cached_trim_partial === 1,
35562
35564
  systemHash: meta.cachedM0SystemHash ?? "",
35563
35565
  modelKey: meta.cachedM0ModelKey ?? "",
35564
35566
  projectIdentity: meta.cachedM0ProjectIdentity ?? null,
@@ -35571,6 +35573,9 @@ function lastBaselineEndMessageId(compartments) {
35571
35573
  const last = compartments.at(-1);
35572
35574
  return last?.endMessageId && last.endMessageId.length > 0 ? last.endMessageId : null;
35573
35575
  }
35576
+ function isPartialBoundary(compartments, id) {
35577
+ return id !== null && compartments.some((row) => row.endMessageId === id && row.endBlockIndex != null);
35578
+ }
35574
35579
  function readCurrentMarkers(db, state, projectDocsHash) {
35575
35580
  return readCurrentMarkersFromCompartments(db, state, getRenderableCompartmentsPi(db, state), projectDocsHash);
35576
35581
  }
@@ -35595,6 +35600,7 @@ function readCurrentMarkersFromCompartments(db, state, compartments, projectDocs
35595
35600
  compartmentRenderEpoch: COMPARTMENT_RENDER_EPOCH,
35596
35601
  memoryRenderEpoch: MEMORY_RENDER_FORMAT_EPOCH,
35597
35602
  lastBaselineEndMessageId: lastBaselineEndMessageId(compartments),
35603
+ lastBaselineEndPartial: isPartialBoundary(compartments, lastBaselineEndMessageId(compartments)),
35598
35604
  systemHash: (state.hardSignals ?? EMPTY_PI_HARD_SIGNALS).systemHash,
35599
35605
  modelKey: piModelRefToCanonical((state.hardSignals ?? EMPTY_PI_HARD_SIGNALS).modelKey),
35600
35606
  projectIdentity: state.projectIdentity,
@@ -35764,6 +35770,7 @@ function readFrozenM0InputsPi(state, db, docs = readProjectDocsForPiM0(state), m
35764
35770
  compartmentRenderEpoch: COMPARTMENT_RENDER_EPOCH,
35765
35771
  memoryRenderEpoch: MEMORY_RENDER_FORMAT_EPOCH,
35766
35772
  lastBaselineEndMessageId: lastBaselineEndMessageId(compartments),
35773
+ lastBaselineEndPartial: isPartialBoundary(compartments, lastBaselineEndMessageId(compartments)),
35767
35774
  systemHash: (state.hardSignals ?? EMPTY_PI_HARD_SIGNALS).systemHash,
35768
35775
  modelKey: piModelRefToCanonical((state.hardSignals ?? EMPTY_PI_HARD_SIGNALS).modelKey),
35769
35776
  projectIdentity: state.projectIdentity,
@@ -36089,6 +36096,7 @@ function readCachedPiM0M1Row(db, sessionId) {
36089
36096
  cached_m0_model_key,
36090
36097
  cached_m0_project_identity,
36091
36098
  cached_m0_last_baseline_end_message_id,
36099
+ ${CACHED_TRIM_PARTIAL_SQL} AS cached_trim_partial,
36092
36100
  memory_block_ids
36093
36101
  FROM session_meta
36094
36102
  WHERE session_id = ?`).get(sessionId);
@@ -36140,6 +36148,7 @@ function markersFromCachedPiRow(row, compartmentsForNormalization) {
36140
36148
  compartmentRenderEpoch: cachedUpgradeIdentity.compartmentRenderEpoch,
36141
36149
  memoryRenderEpoch: cachedUpgradeIdentity.memoryRenderEpoch,
36142
36150
  lastBaselineEndMessageId: typeof row.cached_m0_last_baseline_end_message_id === "string" && row.cached_m0_last_baseline_end_message_id.length > 0 ? row.cached_m0_last_baseline_end_message_id : null,
36151
+ lastBaselineEndPartial: row.cached_trim_partial === 1,
36143
36152
  systemHash: row.cached_m0_system_hash ?? "",
36144
36153
  modelKey: row.cached_m0_model_key ?? "",
36145
36154
  projectIdentity: row.cached_m0_project_identity ?? null,
@@ -36239,7 +36248,11 @@ function softRefreshCachedM1Pi(args) {
36239
36248
  return {
36240
36249
  m0: decodeCachedM0(row.cached_m0_bytes) ?? "",
36241
36250
  m1: rendered.text,
36242
- markers: { ...markers, lastBaselineEndMessageId: advancedBoundary },
36251
+ markers: {
36252
+ ...markers,
36253
+ lastBaselineEndMessageId: advancedBoundary,
36254
+ lastBaselineEndPartial: latest?.endMessageId ? isPartialBoundary(compartments, advancedBoundary) : markers.lastBaselineEndPartial
36255
+ },
36243
36256
  memoryUpdateCount: rendered.memoryUpdateCount,
36244
36257
  recomputed: true
36245
36258
  };
@@ -36294,7 +36307,7 @@ function replayCompletePiPrefix(db, state, row, compartments, messages, entryIds
36294
36307
  if (!mural)
36295
36308
  m0 = stripMemoryMuralBlock(m0);
36296
36309
  const trimBoundaryId = row.cached_m0_last_baseline_end_message_id;
36297
- const skippedVisibleMessages = trimBoundaryId ? trimPiMessagesToBoundary(messages, entryIds, trimBoundaryId, false, state.sessionId, compartments.some((c) => c.endMessageId === trimBoundaryId && c.endBlockIndex != null), (ids) => queueAutoSearchHintDecisionRetirement(db, state.sessionId, ids)) : 0;
36310
+ const skippedVisibleMessages = trimBoundaryId ? trimPiMessagesToBoundary(messages, entryIds, trimBoundaryId, false, state.sessionId, row.cached_trim_partial === 1, (ids) => queueAutoSearchHintDecisionRetirement(db, state.sessionId, ids)) : 0;
36298
36311
  const head = [];
36299
36312
  prependM0M1Messages(head, m0, m1, mural, messages[0]?.timestamp);
36300
36313
  const insertionIndex = placePiInitialSystemAtHead(messages);
@@ -36315,7 +36328,12 @@ function replayCompletePiPrefix(db, state, row, compartments, messages, entryIds
36315
36328
  syntheticLeadingCount: insertionIndex + 2
36316
36329
  };
36317
36330
  if (state.freezePrefixForPass)
36318
- state.preparedPrefix = { result, messages: head, trimBoundaryId };
36331
+ state.preparedPrefix = {
36332
+ result,
36333
+ messages: head,
36334
+ trimBoundaryId,
36335
+ trimBoundaryPartial: row.cached_trim_partial === 1
36336
+ };
36319
36337
  return result;
36320
36338
  }
36321
36339
  function prepareCachedM0M1PiReplay(state, db, rowOverride) {
@@ -36333,7 +36351,7 @@ function prepareCachedM0M1PiReplay(state, db, rowOverride) {
36333
36351
  function injectM0M1Pi(state, db, piMessages, entryIds, recomputeM1ThisPass = false, passSnapshot) {
36334
36352
  if (state.preparedPrefix) {
36335
36353
  const prepared = state.preparedPrefix;
36336
- const skippedVisibleMessages = prepared.trimBoundaryId ? trimPiMessagesToBoundary(piMessages, entryIds, prepared.trimBoundaryId, false, state.sessionId, isPartialCompartmentEnd(db, state.sessionId, prepared.trimBoundaryId), (ids) => queueAutoSearchHintDecisionRetirement(db, state.sessionId, ids)) : 0;
36354
+ const skippedVisibleMessages = prepared.trimBoundaryId ? trimPiMessagesToBoundary(piMessages, entryIds, prepared.trimBoundaryId, false, state.sessionId, prepared.trimBoundaryPartial, (ids) => queueAutoSearchHintDecisionRetirement(db, state.sessionId, ids)) : 0;
36337
36355
  const head = structuredClone(prepared.messages);
36338
36356
  const timestamp = piMessages[0]?.timestamp;
36339
36357
  if (typeof timestamp === "number") {
@@ -36496,7 +36514,8 @@ function injectM0M1Pi(state, db, piMessages, entryIds, recomputeM1ThisPass = fal
36496
36514
  };
36497
36515
  }
36498
36516
  }
36499
- const skippedVisibleMessages = trimBoundaryId ? trimPiMessagesToBoundary(piMessages, entryIds, trimBoundaryId, false, state.sessionId, isPartialCompartmentEnd(db, state.sessionId, trimBoundaryId), (ids) => queueAutoSearchHintDecisionRetirement(db, state.sessionId, ids)) : 0;
36517
+ const trimBoundaryPartial = markers.lastBaselineEndPartial;
36518
+ const skippedVisibleMessages = trimBoundaryId ? trimPiMessagesToBoundary(piMessages, entryIds, trimBoundaryId, false, state.sessionId, trimBoundaryPartial, (ids) => queueAutoSearchHintDecisionRetirement(db, state.sessionId, ids)) : 0;
36500
36519
  const muralWire = m0.includes("<memory-mural>") ? muralForWire(state.sessionId) : undefined;
36501
36520
  if (!muralWire)
36502
36521
  m0 = stripMemoryMuralBlock(m0);
@@ -36533,7 +36552,8 @@ function injectM0M1Pi(state, db, piMessages, entryIds, recomputeM1ThisPass = fal
36533
36552
  state.preparedPrefix = {
36534
36553
  result,
36535
36554
  messages: structuredClone(piMessages.slice(insertionIndex, insertionIndex + 2)),
36536
- trimBoundaryId
36555
+ trimBoundaryId,
36556
+ trimBoundaryPartial
36537
36557
  };
36538
36558
  return result;
36539
36559
  }
@@ -49233,6 +49253,7 @@ function readPiBranchEntriesForContext(ctx, sessionId) {
49233
49253
  };
49234
49254
  piBranchProjectionBySession.set(sessionId, projection);
49235
49255
  piBranchLookupByProjection.set(entries, cached.lookup);
49256
+ inheritPiOrdinalAlignment(sessionId, cached.entries, entries);
49236
49257
  return entries;
49237
49258
  }
49238
49259
  const entries = cached && cachedAncestorIndex !== undefined ? [...cached.entries.slice(0, cachedAncestorIndex + 1), ...suffix] : suffix;
@@ -3,7 +3,7 @@ import {
3
3
  withIndexChunk2,
4
4
  yieldIndexChunk2
5
5
  } from "./index-2qtx0q6h.js";
6
- import"./index-7vhbmjgv.js";
6
+ import"./index-pehdap7a.js";
7
7
  import"./index-pefn1gt5.js";
8
8
  import"./index-0h2mkab2.js";
9
9
  import"./index-tm11k42a.js";
@@ -15,7 +15,7 @@ import"./index-wfqysrwq.js";
15
15
  import"./index-x2n261wp.js";
16
16
  import"./index-xjhq27z9.js";
17
17
  import"./index-n0zjvs3h.js";
18
- import"./index-98e27fdt.js";
18
+ import"./index-5vqnvjb2.js";
19
19
  import"./index-6x556c2q.js";
20
20
  import {
21
21
  MESSAGE_INDEX_MAX_FTS_BYTES,
@@ -24,7 +24,7 @@ import {
24
24
  markMessageIndexDirty,
25
25
  getIndexableContent,
26
26
  indexSingleMessage
27
- } from "./index-renfmk50.js";
27
+ } from "./index-pvd2xhwy.js";
28
28
  import"./index-ghp32f9m.js";
29
29
  import"./index-1ts77n1b.js";
30
30
 
@@ -17,7 +17,7 @@ import"./index-453s1hj6.js";
17
17
  import {
18
18
  setSqlitePragmaConfig,
19
19
  initializeDatabase
20
- } from "./index-67q9cz3f.js";
20
+ } from "./index-msp5k4hv.js";
21
21
  import"./index-fapenpch.js";
22
22
  import"./index-3bb24eb6.js";
23
23
  import"./index-8sqebjzk.js";
@@ -19,7 +19,7 @@ serveWorkerJobs(async (input, port) => {
19
19
  await main();
20
20
  async function main() {
21
21
  if (input.v2ArchiveReader) {
22
- const { serveV2ArchiveReads } = await import("./v2-archive-reader-5vmwk9y5.js");
22
+ const { serveV2ArchiveReads } = await import("./v2-archive-reader-kxc3cdez.js");
23
23
  await serveV2ArchiveReads(port, openConnections);
24
24
  return;
25
25
  }
@@ -51,7 +51,7 @@ serveWorkerJobs(async (input, port) => {
51
51
  await runMessageFtsRowidMapBackfill(db);
52
52
  reply = { kind: "fts-rowid-backfill" };
53
53
  } else if (input.searchArchive) {
54
- const { renderSearchArchive } = await import("./search-archive-7snt7cyv.js");
54
+ const { renderSearchArchive } = await import("./search-archive-2bh9j29f.js");
55
55
  const { readRawSessionMessageIdOrdinalsForRangeFromDb } = await import("./read-session-raw-0tytrjye.js");
56
56
  const archive = input.searchArchive;
57
57
  let raw;
@@ -81,7 +81,7 @@ serveWorkerJobs(async (input, port) => {
81
81
  const { setHarness } = await import("./harness-9872e0ym.js");
82
82
  setHarness(input.harness ?? "opencode");
83
83
  const [{ indexMessageInShortChunks }, { configureContextDatabasePragmas }] = await Promise.all([
84
- import("./message-index-bounded-b5vft8jk.js"),
84
+ import("./message-index-bounded-53hv89kz.js"),
85
85
  import("./sqlite-context-pragmas-gcgch6qz.js")
86
86
  ]);
87
87
  configureContextDatabasePragmas(db);
@@ -95,7 +95,7 @@ serveWorkerJobs(async (input, port) => {
95
95
  measurements: result.measurements
96
96
  };
97
97
  } else if (input.tagRatio !== undefined) {
98
- const { scanTagOwnerSummary, scanTagOwnerDelta } = await import("./storage-tags-n8q8jk1b.js");
98
+ const { scanTagOwnerSummary, scanTagOwnerDelta } = await import("./storage-tags-2j1zhtq7.js");
99
99
  const delta = input.tagState ? scanTagOwnerDelta(db, input.sessionId, input.tagState) : null;
100
100
  if (delta)
101
101
  reply = { kind: "tag-delta", delta };
@@ -38,8 +38,8 @@ import {
38
38
  readSessionChunk2,
39
39
  getRawSessionMessageIdsThrough2,
40
40
  readRawSessionSeedTail2
41
- } from "./index-98e27fdt.js";
42
- import"./index-7vhbmjgv.js";
41
+ } from "./index-5vqnvjb2.js";
42
+ import"./index-pehdap7a.js";
43
43
  import"./index-6x556c2q.js";
44
44
  import"./index-vcegxfwg.js";
45
45
  import"./index-jhmz9tgv.js";
@@ -3,18 +3,18 @@ import {
3
3
  renderVerboseRange2,
4
4
  renderVerboseRangeForTool2,
5
5
  renderItemByTag2
6
- } from "./index-6vmpw4z3.js";
6
+ } from "./index-wxgfn7h9.js";
7
7
  import"./index-k7a8x7ba.js";
8
- import"./index-renfmk50.js";
8
+ import"./index-pvd2xhwy.js";
9
9
  import"./index-hgd00nas.js";
10
10
  import"./index-nvh6d3bz.js";
11
11
  import"./index-cxczethe.js";
12
- import"./index-98e27fdt.js";
13
- import"./index-7vhbmjgv.js";
12
+ import"./index-5vqnvjb2.js";
13
+ import"./index-pehdap7a.js";
14
14
  import"./index-6x556c2q.js";
15
15
  import"./index-5rcjs14a.js";
16
16
  import"./index-vcegxfwg.js";
17
- import"./index-67q9cz3f.js";
17
+ import"./index-msp5k4hv.js";
18
18
  import"./index-fapenpch.js";
19
19
  import"./index-gavj3e6h.js";
20
20
  import"./index-135e8hvg.js";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  renderSearchArchive2
3
- } from "./index-hja11zte.js";
4
- import"./index-vkcb1cg1.js";
3
+ } from "./index-xrhj81gf.js";
4
+ import"./index-thj34b3p.js";
5
5
  import"./index-8d2z6503.js";
6
- import"./index-98e27fdt.js";
7
- import"./index-7vhbmjgv.js";
6
+ import"./index-5vqnvjb2.js";
7
+ import"./index-pehdap7a.js";
8
8
  import"./index-6x556c2q.js";
9
9
  import"./index-vcegxfwg.js";
10
10
  import"./index-jhmz9tgv.js";
@@ -5,9 +5,9 @@ import {
5
5
  resolveMemoriesByIdsForSearch2,
6
6
  unifiedSearch2,
7
7
  formatSearchResults2
8
- } from "./index-8328rak2.js";
8
+ } from "./index-ndc0xtrh.js";
9
9
  import"./index-k7a8x7ba.js";
10
- import"./index-renfmk50.js";
10
+ import"./index-pvd2xhwy.js";
11
11
  import"./index-8d2z6503.js";
12
12
  import"./index-qdy49kwk.js";
13
13
  import"./index-29nw7n1r.js";
@@ -17,8 +17,8 @@ import"./index-hgd00nas.js";
17
17
  import"./index-yhzhdp3m.js";
18
18
  import"./index-79xfn84y.js";
19
19
  import"./index-cxczethe.js";
20
- import"./index-98e27fdt.js";
21
- import"./index-7vhbmjgv.js";
20
+ import"./index-5vqnvjb2.js";
21
+ import"./index-pehdap7a.js";
22
22
  import"./index-6x556c2q.js";
23
23
  import"./index-txcs0vnj.js";
24
24
  import"./index-5rcjs14a.js";
@@ -62,7 +62,7 @@ import {
62
62
  adoptNullOwnerToolTag2,
63
63
  getCandidateToolOwners2,
64
64
  pickNearestPriorOwner2
65
- } from "./index-7vhbmjgv.js";
65
+ } from "./index-pehdap7a.js";
66
66
  import"./index-vcegxfwg.js";
67
67
  import"./index-jhmz9tgv.js";
68
68
  import"./index-1ts77n1b.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  TOKEN_BUDGET_TOOL_REFUSAL
3
- } from "./index-98e27fdt.js";
3
+ } from "./index-5vqnvjb2.js";
4
4
  import {
5
5
  setHarness2
6
6
  } from "./index-0h2mkab2.js";
@@ -14,7 +14,7 @@ import {
14
14
  import"./index-2qtx0q6h.js";
15
15
  import {
16
16
  openDatabase
17
- } from "./index-67q9cz3f.js";
17
+ } from "./index-msp5k4hv.js";
18
18
  import"./index-fapenpch.js";
19
19
  import"./index-3bb24eb6.js";
20
20
  import"./index-8sqebjzk.js";
@@ -34,7 +34,7 @@ import {
34
34
  resolvePiHarnessKind,
35
35
  reportSubagentStartupError,
36
36
  registerMagicContextTools
37
- } from "./index-1tkrgcdt.js";
37
+ } from "./index-3e0w4aa3.js";
38
38
  import"./index-vcegxfwg.js";
39
39
  import"./index-5rcjs14a.js";
40
40
  import"./index-cxczethe.js";
@@ -45,17 +45,17 @@ import"./index-9p40dgkm.js";
45
45
  import"./index-79xfn84y.js";
46
46
  import"./index-yhzhdp3m.js";
47
47
  import"./index-qdy49kwk.js";
48
- import"./index-6vmpw4z3.js";
49
- import"./index-renfmk50.js";
50
- import"./index-7vhbmjgv.js";
48
+ import"./index-wxgfn7h9.js";
49
+ import"./index-pvd2xhwy.js";
50
+ import"./index-pehdap7a.js";
51
51
  import"./index-6x556c2q.js";
52
52
  import"./index-nvh6d3bz.js";
53
53
  import"./index-k7a8x7ba.js";
54
54
  import"./index-8d2z6503.js";
55
- import"./index-vkcb1cg1.js";
56
- import"./index-hja11zte.js";
55
+ import"./index-thj34b3p.js";
56
+ import"./index-xrhj81gf.js";
57
57
  import"./index-29nw7n1r.js";
58
- import"./index-8328rak2.js";
58
+ import"./index-ndc0xtrh.js";
59
59
  import"./index-3s39a1md.js";
60
60
  import"./index-1ts77n1b.js";
61
61
  import {
@@ -8,7 +8,7 @@ import"./index-tm11k42a.js";
8
8
  import {
9
9
  LATEST_SUPPORTED_VERSION,
10
10
  getPersistedSchemaVersion
11
- } from "./index-67q9cz3f.js";
11
+ } from "./index-msp5k4hv.js";
12
12
  import"./index-fapenpch.js";
13
13
  import"./index-3bb24eb6.js";
14
14
  import"./index-8sqebjzk.js";
@@ -28,14 +28,14 @@ import"./index-pefn1gt5.js";
28
28
  import {
29
29
  normalizeTagSnapshotRow2,
30
30
  TAG_SELECT_COLUMNS2
31
- } from "./index-7vhbmjgv.js";
31
+ } from "./index-pehdap7a.js";
32
32
  import"./index-vcegxfwg.js";
33
33
  import {
34
34
  encodePiHydrationOperation,
35
35
  projectPiPassTag,
36
36
  PI_FALLBACK_ROW_COLUMNS,
37
37
  PI_FALLBACK_ROW_PREDICATE
38
- } from "./index-ye6b3dr4.js";
38
+ } from "./index-wdeb9me3.js";
39
39
  import"./index-1ts77n1b.js";
40
40
  import {
41
41
  serveWorkerJobs
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  readV2ArchiveOffThread2,
3
3
  serveV2ArchiveReads2
4
- } from "./index-vkcb1cg1.js";
4
+ } from "./index-thj34b3p.js";
5
5
  import"./index-8sqebjzk.js";
6
6
  import"./index-2qtx0q6h.js";
7
7
  import"./index-x2n261wp.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cortexkit/pi-magic-context",
3
- "version": "0.49.65",
3
+ "version": "0.49.66",
4
4
  "type": "module",
5
5
  "description": "Pi and OMP coding agent extension for Magic Context — cross-session memory and context management",
6
6
  "main": "dist/index.js",