@cortexkit/pi-magic-context 0.49.63 → 0.49.64

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-w4sqw9mf.js → index-67q9cz3f.js} +1 -1
  4. package/dist/{index-418za765.js → index-691zz6f4.js} +7 -7
  5. package/dist/{index-zgsemyph.js → index-6vmpw4z3.js} +3 -3
  6. package/dist/{index-8gvbskcm.js → index-7vhbmjgv.js} +87 -44
  7. package/dist/{index-5hhhxck7.js → index-8328rak2.js} +1 -1
  8. package/dist/{index-xan5mt5f.js → index-98e27fdt.js} +1 -1
  9. package/dist/{index-f4n7tnsf.js → index-hja11zte.js} +1 -1
  10. package/dist/{index-m6kszx0e.js → index-renfmk50.js} +1 -1
  11. package/dist/{index-9cqfbdgb.js → index-vkcb1cg1.js} +3 -3
  12. package/dist/{index-fz4gexgk.js → index-ye6b3dr4.js} +1 -1
  13. package/dist/index.js +486 -281
  14. package/dist/{message-index-bounded-behq385r.js → message-index-bounded-b5vft8jk.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-ksh32zfv.js → read-session-chunk-nfkemn80.js} +2 -2
  18. package/dist/{render-2qed2svq.js → render-173bqp1y.js} +5 -5
  19. package/dist/{search-archive-qqj7j1w1.js → search-archive-7snt7cyv.js} +4 -4
  20. package/dist/{search-vmw1xbqx.js → search-ea9x8vxk.js} +4 -4
  21. package/dist/{storage-tags-s0m7e39a.js → storage-tags-n8q8jk1b.js} +3 -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-cc7sx6dk.js → v2-archive-reader-5vmwk9y5.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-vmw1xbqx.js"),
34
+ import("./search-ea9x8vxk.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-w4sqw9mf.js";
38
+ } from "./index-67q9cz3f.js";
39
39
  import"./index-3bb24eb6.js";
40
40
  import"./index-gavj3e6h.js";
41
41
  import"./index-jhmz9tgv.js";
@@ -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-ksh32zfv.js"));
1790
+ const { readRawSessionMessagePage, readRawSessionMessages } = await importPluginModule(() => import("./read-session-chunk-nfkemn80.js"));
1791
1791
  const { startMessageTimeBackfill } = await importPluginModule(() => import("./message-time-backfill-8zwv9byv.js"));
1792
1792
  if (signal.aborted)
1793
1793
  return;
@@ -56,7 +56,7 @@ import {
56
56
  import {
57
57
  piHarnessKindFromExecutable,
58
58
  getErrorMessage
59
- } from "./index-w4sqw9mf.js";
59
+ } from "./index-67q9cz3f.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-zgsemyph.js";
73
+ } from "./index-6vmpw4z3.js";
74
74
  import {
75
75
  getLastIndexedOrdinal
76
- } from "./index-m6kszx0e.js";
76
+ } from "./index-renfmk50.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-8gvbskcm.js";
92
+ } from "./index-7vhbmjgv.js";
93
93
  import {
94
94
  stableStringify,
95
95
  BoundedSessionMap
@@ -141,7 +141,7 @@ import {
141
141
  resolveMemoriesByIdsForSearch2,
142
142
  unifiedSearch2,
143
143
  formatSearchResults2
144
- } from "./index-5hhhxck7.js";
144
+ } from "./index-8328rak2.js";
145
145
  import {
146
146
  resolveOpenCodeDbPath,
147
147
  assertOpenCodeStoreGeneration
@@ -150,7 +150,7 @@ import {
150
150
  hasRawMessageProvider2,
151
151
  setRawMessageProvider2,
152
152
  readSessionChunk2
153
- } from "./index-xan5mt5f.js";
153
+ } from "./index-98e27fdt.js";
154
154
  import {
155
155
  resolveWorkspaceShareCategories,
156
156
  resolveWorkspaceIdentitySet,
@@ -182,7 +182,7 @@ import {
182
182
  } from "./index-3s39a1md.js";
183
183
  import {
184
184
  renderSearchArchive2
185
- } from "./index-f4n7tnsf.js";
185
+ } from "./index-hja11zte.js";
186
186
  import {
187
187
  computeNormalizedHash
188
188
  } from "./index-9x1f96r8.js";
@@ -39,7 +39,7 @@ import {
39
39
  serializeProcessedImageMarkers,
40
40
  getPendingPiCompactionMarkerState,
41
41
  logPiCompactionMarkerClear
42
- } from "./index-8gvbskcm.js";
42
+ } from "./index-7vhbmjgv.js";
43
43
  import {
44
44
  estimateTokens
45
45
  } from "./index-pefn1gt5.js";
@@ -60,13 +60,13 @@ import {
60
60
  import {
61
61
  isPidAlive,
62
62
  readProcessStartTime
63
- } from "./index-w4sqw9mf.js";
63
+ } from "./index-67q9cz3f.js";
64
64
  import {
65
65
  withReadOnlySessionDb,
66
66
  expandToolPart,
67
67
  visitRawSessionMessages2,
68
68
  readRawSessionMessageById2
69
- } from "./index-xan5mt5f.js";
69
+ } from "./index-98e27fdt.js";
70
70
  import {
71
71
  gaDatabasePath2,
72
72
  V2StoreReader2
@@ -33,6 +33,11 @@ import {
33
33
  } from "./index-1ts77n1b.js";
34
34
 
35
35
  // ../plugin/src/features/magic-context/overflow-detection.ts
36
+ var TOKEN_COUNT = String.raw`(?<![\d+_-])(?:\d+(?:[,_ .\u202f]+\d+)*(?=\s*tokens?\b)|\d+(?:[,_ \u202f]+\d+)*)(?!\w|[,_\s.]+\d)`;
37
+ var ESTIMATED_REQUEST = String.raw`\bthis request has an estimated\b`;
38
+ function overflowPattern(strings, ...fragments) {
39
+ return new RegExp(String.raw(strings, ...fragments), "i");
40
+ }
36
41
  var OVERFLOW_PATTERNS = [
37
42
  /prompt is too long/i,
38
43
  /input is too long for requested model/i,
@@ -40,7 +45,7 @@ var OVERFLOW_PATTERNS = [
40
45
  /input token count.*exceeds the maximum/i,
41
46
  /maximum prompt length is \d+/i,
42
47
  /reduce the length of the messages/i,
43
- /maximum context length is \d+ tokens/i,
48
+ overflowPattern`maximum context length is ${TOKEN_COUNT} tokens?\b`,
44
49
  /maximum model length is \d+/i,
45
50
  /exceeds the limit of \d+/i,
46
51
  /exceeds the available context size/i,
@@ -49,48 +54,84 @@ var OVERFLOW_PATTERNS = [
49
54
  /exceeded model token limit/i,
50
55
  /context[_ ]length[_ ]exceeded/i,
51
56
  /request entity too large/i,
52
- /context length is only \d+ tokens/i,
57
+ overflowPattern`context length is only ${TOKEN_COUNT} tokens?\b`,
53
58
  /input length.*exceeds.*context length/i,
54
59
  /\bContextWindowExceededError\b/i,
55
- /\bthe input \(\d+ tokens?\) is longer than the model's context length \(\d+ tokens?\)/i,
60
+ overflowPattern`\bthe input \(${TOKEN_COUNT} tokens?\) is longer than the model's context length \(${TOKEN_COUNT} tokens?\)`,
56
61
  /prompt too long; exceeded (?:max )?context length/i,
57
- /too large for model with \d+ maximum context length/i,
62
+ overflowPattern`too large for model with ${TOKEN_COUNT} maximum context length`,
58
63
  /model_context_window_exceeded/i,
59
64
  /context size has been exceeded/i,
60
65
  /prepared prompt exceeds engine max_context/i,
61
66
  /prompt exceeds (?:the )?.{0,32}\bmax_context\b/i
62
67
  ];
63
68
  var LIMIT_EXTRACTION_PATTERNS = [
64
- { pattern: /maximum prompt length is (\d+)/i, provenance: "prompt_only" },
65
69
  {
66
- pattern: /maximum context length is (\d+) tokens?/i,
70
+ pattern: overflowPattern`maximum prompt length is (${TOKEN_COUNT})`,
71
+ provenance: "prompt_only"
72
+ },
73
+ {
74
+ pattern: overflowPattern`maximum context length is (${TOKEN_COUNT}) tokens?\b`,
75
+ provenance: "combined"
76
+ },
77
+ { pattern: overflowPattern`maximum model length is (${TOKEN_COUNT})`, provenance: "combined" },
78
+ {
79
+ pattern: overflowPattern`context length is only (${TOKEN_COUNT}) tokens?\b`,
80
+ provenance: "combined"
81
+ },
82
+ { pattern: overflowPattern`exceeds the limit of (${TOKEN_COUNT})`, provenance: "unknown" },
83
+ {
84
+ pattern: overflowPattern`too large for model with (${TOKEN_COUNT}) maximum context length`,
67
85
  provenance: "combined"
68
86
  },
69
- { pattern: /maximum model length is (\d+)/i, provenance: "combined" },
70
- { pattern: /context length is only (\d+) tokens?/i, provenance: "combined" },
71
- { pattern: /exceeds the limit of (\d+)/i, provenance: "unknown" },
72
87
  {
73
- pattern: /too large for model with (\d+) maximum context length/i,
88
+ pattern: overflowPattern`context size[^0-9]{0,40}(${TOKEN_COUNT})\s*tokens?\b`,
74
89
  provenance: "combined"
75
90
  },
76
- { pattern: /context size[^0-9]{0,40}(\d{4,})\s*tokens?/i, provenance: "combined" },
77
- { pattern: /exceeds? the context length of (\d+)/i, provenance: "combined" },
78
91
  {
79
- pattern: /\bthe input \(\d+ tokens?\) is longer than the model's context length \((\d+) tokens?\)/i,
92
+ pattern: overflowPattern`exceeds? the context length of (${TOKEN_COUNT})`,
80
93
  provenance: "combined"
81
94
  },
82
95
  {
83
- pattern: />\s*(\d+)\s*(?:tokens?\s*)?(?:maximum|max|limit)\b/i,
96
+ pattern: overflowPattern`\bthe input \(${TOKEN_COUNT} tokens?\) is longer than the model's context length \((${TOKEN_COUNT}) tokens?\)`,
97
+ provenance: "combined"
98
+ },
99
+ {
100
+ pattern: overflowPattern`>\s*(${TOKEN_COUNT})\s*(?:tokens?\s*)?(?:maximum|max|limit)\b`,
84
101
  provenance: "prompt_only"
85
102
  },
86
103
  {
87
- pattern: /maximum number of tokens allowed\s*\(?\s*(\d+)/i,
104
+ pattern: overflowPattern`maximum number of tokens allowed\s*\(?\s*(${TOKEN_COUNT})`,
88
105
  provenance: "prompt_only"
89
106
  },
90
- { pattern: /prepared prompt exceeds engine max_context\s+(\d+)/i, provenance: "unknown" },
91
- { pattern: /prompt exceeds (?:the )?.{0,32}\bmax_context\s+(\d+)/i, provenance: "unknown" },
92
- { pattern: /max(?:imum)?.*context.*?(\d+)/i, provenance: "unknown" }
107
+ {
108
+ pattern: overflowPattern`prepared prompt exceeds engine max_context\s+(${TOKEN_COUNT})`,
109
+ provenance: "unknown"
110
+ },
111
+ {
112
+ pattern: overflowPattern`prompt exceeds (?:the )?.{0,32}\bmax_context\s+(${TOKEN_COUNT})`,
113
+ provenance: "unknown"
114
+ },
115
+ {
116
+ pattern: overflowPattern`\ballows a context of up to (${TOKEN_COUNT}) tokens?\b`,
117
+ provenance: "combined"
118
+ },
119
+ {
120
+ pattern: overflowPattern`(?<!${ESTIMATED_REQUEST}\s+)\bup to (${TOKEN_COUNT}) tokens?\b`,
121
+ provenance: "unknown"
122
+ },
123
+ {
124
+ pattern: overflowPattern`max(?:imum)?.*context(?:(?!${ESTIMATED_REQUEST})[^\d\r\n])*(${TOKEN_COUNT})`,
125
+ provenance: "unknown"
126
+ }
93
127
  ];
128
+ function parseTokenCount(raw) {
129
+ if (raw === undefined || !/^(?:\d+|\d{1,3}([,_ .\u202f])\d{3}(?:\1\d{3})*)$/.test(raw)) {
130
+ return null;
131
+ }
132
+ const value = Number(raw.replace(/[,_ .\u202f]/g, ""));
133
+ return Number.isSafeInteger(value) ? value : null;
134
+ }
94
135
  var MIN_PLAUSIBLE_LIMIT = 1024;
95
136
  var MAX_PLAUSIBLE_LIMIT = 1e7;
96
137
  var THINKING_BINDING_MISMATCH_PATTERN = /bound to a different conversation/i;
@@ -212,24 +253,22 @@ function detectOverflow(error) {
212
253
  matchedPattern: matched?.source
213
254
  };
214
255
  }
256
+ var INPUT_EXTRACTION_PATTERNS = [
257
+ overflowPattern`prompt is too long:\s*(${TOKEN_COUNT})`,
258
+ overflowPattern`input token count\s*\(?\s*(${TOKEN_COUNT})`,
259
+ overflowPattern`input length\s*(${TOKEN_COUNT})`,
260
+ overflowPattern`prompt was\s*(${TOKEN_COUNT})`,
261
+ overflowPattern`messages resulted in\s*(${TOKEN_COUNT})\s*tokens?\b`,
262
+ overflowPattern`\bthe input \((${TOKEN_COUNT}) tokens?\) is longer than the model's context length \(${TOKEN_COUNT} tokens?\)`,
263
+ overflowPattern`\(\s*(${TOKEN_COUNT})\s+in the messages,\s*${TOKEN_COUNT}\s+in the completion\s*\)`,
264
+ overflowPattern`${ESTIMATED_REQUEST}\s+(${TOKEN_COUNT})`
265
+ ];
215
266
  function parseReportedInputTokens(message) {
216
267
  if (!message)
217
268
  return;
218
- const patterns = [
219
- /prompt is too long:\s*(\d+)/i,
220
- /input token count\s*\(?\s*(\d+)/i,
221
- /input length\s*(\d+)/i,
222
- /prompt was\s*(\d+)/i,
223
- /messages resulted in\s*(\d+)\s*tokens?/i,
224
- /\bthe input \((\d+) tokens?\) is longer than the model's context length \(\d+ tokens?\)/i,
225
- /\(\s*(\d+)\s+in the messages,\s*\d+\s+in the completion\s*\)/i
226
- ];
227
- for (const pattern of patterns) {
228
- const raw = message.match(pattern)?.[1];
229
- if (!raw)
230
- continue;
231
- const value = Number.parseInt(raw, 10);
232
- if (Number.isFinite(value) && value > 0)
269
+ for (const pattern of INPUT_EXTRACTION_PATTERNS) {
270
+ const value = parseTokenCount(message.match(pattern)?.[1]);
271
+ if (value !== null && value > 0)
233
272
  return value;
234
273
  }
235
274
  return;
@@ -238,16 +277,8 @@ function parseReportedLimit(message) {
238
277
  if (!message)
239
278
  return;
240
279
  for (const { pattern, provenance } of LIMIT_EXTRACTION_PATTERNS) {
241
- const match = message.match(pattern);
242
- if (!match)
243
- continue;
244
- const raw = match[1];
245
- if (!raw)
246
- continue;
247
- const value = Number.parseInt(raw, 10);
248
- if (!Number.isFinite(value))
249
- continue;
250
- if (value < MIN_PLAUSIBLE_LIMIT || value > MAX_PLAUSIBLE_LIMIT)
280
+ const value = parseTokenCount(message.match(pattern)?.[1]);
281
+ if (value === null || value < MIN_PLAUSIBLE_LIMIT || value > MAX_PLAUSIBLE_LIMIT)
251
282
  continue;
252
283
  return { value, provenance };
253
284
  }
@@ -3461,7 +3492,16 @@ function updateTagInputByteSize2(db, sessionId, tagNumber, newInputByteSize) {
3461
3492
  getUpdateTagInputByteSizeStatement(db).run(newInputByteSize, sessionId, tagNumber);
3462
3493
  }
3463
3494
  var updateTagTokenCountStatements = new WeakMap;
3495
+ var setTagTokenCountStatements = new WeakMap;
3464
3496
  var updateTagInputTokenCountStatements = new WeakMap;
3497
+ function getSetTagTokenCountStatement(db) {
3498
+ let stmt = setTagTokenCountStatements.get(db);
3499
+ if (!stmt) {
3500
+ stmt = db.prepare("UPDATE tags SET token_count = ? WHERE session_id = ? AND tag_number = ?");
3501
+ setTagTokenCountStatements.set(db, stmt);
3502
+ }
3503
+ return stmt;
3504
+ }
3465
3505
  function getUpdateTagTokenCountStatement(db) {
3466
3506
  let stmt = updateTagTokenCountStatements.get(db);
3467
3507
  if (!stmt) {
@@ -3481,6 +3521,9 @@ function getUpdateTagInputTokenCountStatement(db) {
3481
3521
  function updateTagTokenCount2(db, sessionId, tagNumber, newTokenCount) {
3482
3522
  getUpdateTagTokenCountStatement(db).run(newTokenCount, sessionId, tagNumber);
3483
3523
  }
3524
+ function setTagTokenCount2(db, sessionId, tagNumber, tokenCount) {
3525
+ getSetTagTokenCountStatement(db).run(tokenCount, sessionId, tagNumber);
3526
+ }
3484
3527
  function getPersistedToolTagAccounting2(db, sessionId, tagNumber) {
3485
3528
  const row = db.prepare(`SELECT byte_size AS byteSize,
3486
3529
  token_count AS tokenCount,
@@ -6488,4 +6531,4 @@ function resolveEpochFloorForPass(db, sessionId, inputs) {
6488
6531
  return preSnapshotResult(firstObservedMemo, resolvedInputs);
6489
6532
  }
6490
6533
 
6491
- 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, 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 };
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 };
@@ -91,7 +91,7 @@ import {
91
91
  clearIndexedMessages,
92
92
  indexSingleMessage,
93
93
  indexMessagesAfterOrdinal
94
- } from "./index-m6kszx0e.js";
94
+ } from "./index-renfmk50.js";
95
95
  import {
96
96
  MESSAGE_FTS_SESSION_FILTER_SQL,
97
97
  withMessageFtsSessionFilter
@@ -39,7 +39,7 @@ import {
39
39
  providerVisiblePart,
40
40
  getCandidateToolOwners2,
41
41
  pickNearestPriorOwner2
42
- } from "./index-8gvbskcm.js";
42
+ } from "./index-7vhbmjgv.js";
43
43
  import {
44
44
  OMO_INTERNAL_INITIATOR_MARKER,
45
45
  isSystemDirective,
@@ -6,7 +6,7 @@ import {
6
6
  } from "./index-pefn1gt5.js";
7
7
  import {
8
8
  readRawSessionMessageIdOrdinalsForRange2
9
- } from "./index-xan5mt5f.js";
9
+ } from "./index-98e27fdt.js";
10
10
 
11
11
  // ../plugin/src/tools/ctx-expand/search-archive.ts
12
12
  var archiveReadsOnThisThread = 0;
@@ -9,7 +9,7 @@ import {
9
9
  } from "./index-pefn1gt5.js";
10
10
  import {
11
11
  cleanUserText2
12
- } from "./index-xan5mt5f.js";
12
+ } from "./index-98e27fdt.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-ksh32zfv.js"),
143
- import("./render-2qed2svq.js"),
144
- import("./search-archive-qqj7j1w1.js"),
142
+ import("./read-session-chunk-nfkemn80.js"),
143
+ import("./render-173bqp1y.js"),
144
+ import("./search-archive-7snt7cyv.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-8gvbskcm.js";
10
+ } from "./index-7vhbmjgv.js";
11
11
  import {
12
12
  inRootAsyncContext2,
13
13
  getSqliteDatabasePath2,