@cortexkit/opencode-magic-context 0.42.3 → 0.42.4

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 (121) hide show
  1. package/README.md +3 -1
  2. package/dist/{announcement-3c1vertn.js → announcement-8mgn61fw.js} +1 -1
  3. package/dist/{conflict-warning-hook-aedp084d.js → conflict-warning-hook-jyj54gbe.js} +4 -4
  4. package/dist/{derive-budgets-s2pgnnm4.js → derive-budgets-v1fkhjjr.js} +2 -2
  5. package/dist/features/magic-context/context-authority.d.ts +13 -0
  6. package/dist/features/magic-context/context-authority.d.ts.map +1 -1
  7. package/dist/features/magic-context/dreamer/classify.d.ts +3 -1
  8. package/dist/features/magic-context/dreamer/classify.d.ts.map +1 -1
  9. package/dist/features/magic-context/dreamer/task-executor.d.ts +6 -2
  10. package/dist/features/magic-context/dreamer/task-executor.d.ts.map +1 -1
  11. package/dist/features/magic-context/dreamer/task-registry.d.ts +3 -0
  12. package/dist/features/magic-context/dreamer/task-registry.d.ts.map +1 -1
  13. package/dist/features/magic-context/mural/compress-cues.d.ts +3 -1
  14. package/dist/features/magic-context/mural/compress-cues.d.ts.map +1 -1
  15. package/dist/features/magic-context/transform-decision-log.d.ts +4 -0
  16. package/dist/features/magic-context/transform-decision-log.d.ts.map +1 -1
  17. package/dist/hooks/magic-context/apply-operations.d.ts +4 -1
  18. package/dist/hooks/magic-context/apply-operations.d.ts.map +1 -1
  19. package/dist/hooks/magic-context/caveman-cleanup.d.ts +4 -0
  20. package/dist/hooks/magic-context/caveman-cleanup.d.ts.map +1 -1
  21. package/dist/hooks/magic-context/compartment-runner-historian.d.ts +5 -2
  22. package/dist/hooks/magic-context/compartment-runner-historian.d.ts.map +1 -1
  23. package/dist/hooks/magic-context/compartment-runner-incremental.d.ts +2 -2
  24. package/dist/hooks/magic-context/compartment-runner-incremental.d.ts.map +1 -1
  25. package/dist/hooks/magic-context/compartment-runner-types.d.ts +61 -2
  26. package/dist/hooks/magic-context/compartment-runner-types.d.ts.map +1 -1
  27. package/dist/hooks/magic-context/compartment-runner.d.ts +2 -2
  28. package/dist/hooks/magic-context/compartment-runner.d.ts.map +1 -1
  29. package/dist/hooks/magic-context/dropped-token-estimate.d.ts +20 -0
  30. package/dist/hooks/magic-context/dropped-token-estimate.d.ts.map +1 -0
  31. package/dist/hooks/magic-context/heuristic-cleanup.d.ts +2 -0
  32. package/dist/hooks/magic-context/heuristic-cleanup.d.ts.map +1 -1
  33. package/dist/hooks/magic-context/hook.d.ts +2 -2
  34. package/dist/hooks/magic-context/hook.d.ts.map +1 -1
  35. package/dist/hooks/magic-context/module-transport.d.ts +4 -1
  36. package/dist/hooks/magic-context/module-transport.d.ts.map +1 -1
  37. package/dist/hooks/magic-context/rust-mode-transform.d.ts +2 -0
  38. package/dist/hooks/magic-context/rust-mode-transform.d.ts.map +1 -1
  39. package/dist/hooks/magic-context/transform-compartment-phase.d.ts +3 -0
  40. package/dist/hooks/magic-context/transform-compartment-phase.d.ts.map +1 -1
  41. package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +8 -0
  42. package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
  43. package/dist/hooks/magic-context/transform.d.ts +21 -0
  44. package/dist/hooks/magic-context/transform.d.ts.map +1 -1
  45. package/dist/{index-sf6x1ga9.js → index-1ar7b3e9.js} +3 -3
  46. package/dist/{index-3fe78beq.js → index-4ftb5hcq.js} +9 -1
  47. package/dist/{index-may8skc8.js → index-bkg2fdj1.js} +15 -1
  48. package/dist/{index-ecz14qke.js → index-d8mgqezq.js} +2 -2
  49. package/dist/{index-xdtge3y2.js → index-f9gem5cr.js} +2 -2
  50. package/dist/{index-wde5446v.js → index-faay035c.js} +196 -56
  51. package/dist/{index-z8552w7e.js → index-jkrqhc7y.js} +1 -1
  52. package/dist/{index-3wzdwt6p.js → index-ntbmt6rq.js} +1 -1
  53. package/dist/{index-gynz8qdc.js → index-p474rw9p.js} +3 -3
  54. package/dist/{index-dkv2dn46.js → index-qp20p2py.js} +1 -1
  55. package/dist/index.d.ts +4 -1
  56. package/dist/index.d.ts.map +1 -1
  57. package/dist/index.js +1441 -126
  58. package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
  59. package/dist/plugin/rpc-handlers.d.ts +18 -0
  60. package/dist/plugin/rpc-handlers.d.ts.map +1 -1
  61. package/dist/plugin/rust-tool-backends.d.ts +3 -1
  62. package/dist/plugin/rust-tool-backends.d.ts.map +1 -1
  63. package/dist/{recomp-orchestrator-447vycpt.js → recomp-orchestrator-c4sa354a.js} +6 -6
  64. package/dist/{safe-notification-target-q9z81zt3.js → safe-notification-target-fepvcbsj.js} +1 -1
  65. package/dist/{send-session-notification-2mzgd3zf.js → send-session-notification-xnypkxpx.js} +3 -3
  66. package/dist/shared/harness.d.ts +2 -1
  67. package/dist/shared/harness.d.ts.map +1 -1
  68. package/dist/shared/model-suggestion-retry.d.ts +5 -1
  69. package/dist/shared/model-suggestion-retry.d.ts.map +1 -1
  70. package/dist/shared/prompt-surface-runtime.d.ts.map +1 -1
  71. package/dist/shared/rpc-types.d.ts +13 -0
  72. package/dist/shared/rpc-types.d.ts.map +1 -1
  73. package/dist/shared/status-detail-text.d.ts.map +1 -1
  74. package/dist/shared/status-summary.d.ts.map +1 -1
  75. package/dist/shared/user-facing-codes.d.ts +10 -0
  76. package/dist/shared/user-facing-codes.d.ts.map +1 -1
  77. package/dist/{storage-meta-session-fkmfhswa.js → storage-meta-session-x3j0q9qy.js} +3 -3
  78. package/dist/{task-config-hnv93r7p.js → task-config-ys0arma5.js} +1 -1
  79. package/dist/tools/ctx-memory/tools.d.ts.map +1 -1
  80. package/dist/tools/ctx-note/tools.d.ts.map +1 -1
  81. package/dist/v2/fold/markers.d.ts +7 -0
  82. package/dist/v2/fold/markers.d.ts.map +1 -0
  83. package/dist/v2/fold/owner.d.ts +40 -0
  84. package/dist/v2/fold/owner.d.ts.map +1 -0
  85. package/dist/v2/fold/restore.d.ts +11 -0
  86. package/dist/v2/fold/restore.d.ts.map +1 -0
  87. package/dist/v2/hidden-completion.d.ts +20 -0
  88. package/dist/v2/hidden-completion.d.ts.map +1 -0
  89. package/dist/v2/hooks/channel2.d.ts +8 -0
  90. package/dist/v2/hooks/channel2.d.ts.map +1 -0
  91. package/dist/v2/hooks/context.d.ts +7 -0
  92. package/dist/v2/hooks/context.d.ts.map +1 -0
  93. package/dist/v2/hooks/dream-trigger.d.ts +19 -0
  94. package/dist/v2/hooks/dream-trigger.d.ts.map +1 -0
  95. package/dist/v2/hooks/payload.d.ts +12 -0
  96. package/dist/v2/hooks/payload.d.ts.map +1 -0
  97. package/dist/v2/hooks/refusal.d.ts +7 -0
  98. package/dist/v2/hooks/refusal.d.ts.map +1 -0
  99. package/dist/v2/hooks/store.d.ts +6 -0
  100. package/dist/v2/hooks/store.d.ts.map +1 -0
  101. package/dist/v2/hooks/types.d.ts +90 -0
  102. package/dist/v2/hooks/types.d.ts.map +1 -0
  103. package/dist/v2/hooks/update-check.d.ts +10 -0
  104. package/dist/v2/hooks/update-check.d.ts.map +1 -0
  105. package/dist/v2/server.d.ts +3 -1
  106. package/dist/v2/server.d.ts.map +1 -1
  107. package/dist/v2/server.js +118582 -4
  108. package/dist/v2/store-reader.d.ts +2 -0
  109. package/dist/v2/store-reader.d.ts.map +1 -1
  110. package/index.js +1 -0
  111. package/package.json +5 -4
  112. package/src/features/magic-context/dreamer/task-registry.ts +19 -0
  113. package/src/shared/harness.ts +2 -1
  114. package/src/shared/model-suggestion-retry.ts +66 -14
  115. package/src/shared/prompt-surface-runtime.ts +5 -1
  116. package/src/shared/rpc-types.ts +13 -0
  117. package/src/shared/status-detail-text.test.ts +26 -0
  118. package/src/shared/status-detail-text.ts +11 -0
  119. package/src/shared/status-summary.ts +2 -0
  120. package/src/shared/user-facing-codes.test.ts +1 -1
  121. package/src/shared/user-facing-codes.ts +10 -0
@@ -2,7 +2,7 @@ import {
2
2
  sanitizeDiagnosticText,
3
3
  log,
4
4
  sessionLog
5
- } from "./index-dkv2dn46.js";
5
+ } from "./index-qp20p2py.js";
6
6
  import {
7
7
  logSlowWriteTransaction,
8
8
  ensureSessionMetaRow,
@@ -11,7 +11,7 @@ import {
11
11
  SESSION_SCOPED_TABLES,
12
12
  deleteSessionScopedRows,
13
13
  updateSessionMeta2
14
- } from "./index-sf6x1ga9.js";
14
+ } from "./index-1ar7b3e9.js";
15
15
  import {
16
16
  resolveOpenCodeDbPath,
17
17
  openCodeDbPathExists,
@@ -25,7 +25,7 @@ import {
25
25
  withReadOnlySessionDb,
26
26
  getRawSessionMessageCountFromDb,
27
27
  getMessageTimesFromOpenCodeDb
28
- } from "./index-z8552w7e.js";
28
+ } from "./index-jkrqhc7y.js";
29
29
  import {
30
30
  pushNotification2
31
31
  } from "./index-jdxxq8cz.js";
@@ -42,12 +42,12 @@ import {
42
42
  shouldEnforcePrivateStoragePermissions,
43
43
  modelSupportsVision,
44
44
  deriveTriggerBudget2
45
- } from "./index-xdtge3y2.js";
45
+ } from "./index-f9gem5cr.js";
46
46
  import {
47
47
  getErrorMessage,
48
48
  describeError,
49
49
  sendStatusNotification2
50
- } from "./index-gynz8qdc.js";
50
+ } from "./index-p474rw9p.js";
51
51
  import {
52
52
  piModelRefToCanonical,
53
53
  modelRefLookupOrder
@@ -58,7 +58,7 @@ import {
58
58
  getProjectMagicContextHistorianDir,
59
59
  getMagicContextStorageDir,
60
60
  getLegacyOpenCodeMagicContextStorageDir
61
- } from "./index-3fe78beq.js";
61
+ } from "./index-4ftb5hcq.js";
62
62
 
63
63
  // src/features/magic-context/compartment-lease.ts
64
64
  var COMPARTMENT_LEASE_TTL_MS = 5 * 60 * 1000;
@@ -1737,6 +1737,11 @@ async function drainAuthority(args) {
1737
1737
  if (finished.state !== "TS") {
1738
1738
  throw new Error("memory authority drain did not reactivate TypeScript ownership");
1739
1739
  }
1740
+ if (args.domain === "memories") {
1741
+ withPrivilegedWriter(args.db, () => {
1742
+ args.db.prepare("DELETE FROM mirror_live_memory_rows WHERE module_project = ?").run(args.projectPath);
1743
+ });
1744
+ }
1740
1745
  const remaining = await Promise.all(AUTHORITY_DOMAINS.map((domain) => args.module.authorityStatus({
1741
1746
  context_store_uuid: contextStoreUuid,
1742
1747
  project: args.projectPath,
@@ -1779,6 +1784,28 @@ function chunkRowsForFrame(rows) {
1779
1784
  chunks.push(current);
1780
1785
  return chunks;
1781
1786
  }
1787
+ var MEMORY_MIRROR_STALL_THRESHOLD_MS = 40000;
1788
+ function getMemoryMirrorStatus(db, feedHead, nowMs = Date.now()) {
1789
+ const cursorRow = db.prepare("SELECT cursor, updated_at FROM mirror_cursors WHERE domain = 'memories'").get();
1790
+ const liveRow = db.prepare("SELECT COUNT(*) AS count FROM mirror_live_memory_rows").get();
1791
+ const cursor = typeof cursorRow?.cursor === "number" ? cursorRow.cursor : 0;
1792
+ const cursorUpdatedAt = typeof cursorRow?.updated_at === "number" && cursorRow.updated_at > 0 ? cursorRow.updated_at : null;
1793
+ const cursorAgeMs = cursorUpdatedAt === null ? null : Math.max(0, Math.floor(nowMs - cursorUpdatedAt));
1794
+ const liveRows = typeof liveRow?.count === "number" ? liveRow.count : 0;
1795
+ const resolvedFeedHead = typeof feedHead === "number" && Number.isSafeInteger(feedHead) && feedHead >= 0 ? feedHead : null;
1796
+ const pendingRows = resolvedFeedHead === null ? null : Math.max(0, resolvedFeedHead - cursor);
1797
+ const stalled = liveRows > 0 && pendingRows !== null && pendingRows > 0 && cursorAgeMs !== null && cursorAgeMs >= MEMORY_MIRROR_STALL_THRESHOLD_MS;
1798
+ return {
1799
+ cursor,
1800
+ cursorUpdatedAt,
1801
+ cursorAgeMs,
1802
+ liveRows,
1803
+ feedHead: resolvedFeedHead,
1804
+ pendingRows,
1805
+ stalled,
1806
+ code: stalled ? "MC-M01" : null
1807
+ };
1808
+ }
1782
1809
  function getMirrorCursor(db, domain) {
1783
1810
  const row = db.prepare("SELECT cursor FROM mirror_cursors WHERE domain = ?").get(domain);
1784
1811
  return typeof row?.cursor === "number" ? row.cursor : 0;
@@ -2587,7 +2614,7 @@ function pullMemoryMirrorOnce(args) {
2587
2614
  db: args.db,
2588
2615
  module: args.module,
2589
2616
  domain: "memories",
2590
- limit: args.limit,
2617
+ limit: args.limit ?? 1000,
2591
2618
  pageBudget: args.pageBudget ?? TRANSFORM_MEMORY_MIRROR_PAGE_BUDGET
2592
2619
  }).then((result) => ({ ...result, cuePoolVersion: result.cursor })).finally(() => mirrorFlights.delete(args.module));
2593
2620
  mirrorFlights.set(args.module, flight);
@@ -21652,7 +21679,7 @@ function parseModelSuggestion(error) {
21652
21679
  suggestion: suggestionMatch[1].trim()
21653
21680
  };
21654
21681
  }
21655
- async function promptWithTimeout(client, args, timeoutMs, signal) {
21682
+ async function promptWithTimeout(client, args, timeoutMs, signal, transport) {
21656
21683
  if (signal?.aborted) {
21657
21684
  throw new Error("prompt aborted by external signal");
21658
21685
  }
@@ -21661,17 +21688,25 @@ async function promptWithTimeout(client, args, timeoutMs, signal) {
21661
21688
  const onExternalAbort = () => controller.abort();
21662
21689
  signal?.addEventListener("abort", onExternalAbort);
21663
21690
  try {
21664
- await client.session.prompt({
21665
- ...args,
21666
- signal: controller.signal
21667
- });
21691
+ const request = { ...args, signal: controller.signal };
21692
+ if (transport)
21693
+ await transport(request);
21694
+ else {
21695
+ if (!client)
21696
+ throw new Error("Hidden completion transport is unavailable");
21697
+ await client.session.prompt(request);
21698
+ }
21668
21699
  } catch (error) {
21669
21700
  if (signal?.aborted) {
21670
- await abortChildRun(client, args.path.id);
21701
+ if (!transport || transport.childSessionId) {
21702
+ await abortChildRun(client, transport?.childSessionId ?? args.path.id);
21703
+ }
21671
21704
  throw new Error("prompt aborted by external signal");
21672
21705
  }
21673
21706
  if (controller.signal.aborted) {
21674
- await abortChildRun(client, args.path.id);
21707
+ if (!transport || transport.childSessionId) {
21708
+ await abortChildRun(client, transport?.childSessionId ?? args.path.id);
21709
+ }
21675
21710
  throw new Error(`prompt timed out after ${timeoutMs}ms`);
21676
21711
  }
21677
21712
  throw error;
@@ -21681,6 +21716,8 @@ async function promptWithTimeout(client, args, timeoutMs, signal) {
21681
21716
  }
21682
21717
  }
21683
21718
  async function abortChildRun(client, sessionId) {
21719
+ if (!client)
21720
+ return;
21684
21721
  try {
21685
21722
  await Promise.race([
21686
21723
  client.session.abort({ path: { id: sessionId } }),
@@ -21729,7 +21766,7 @@ function classifyPromptFailure(error, phase, externalSignal) {
21729
21766
  }
21730
21767
  return phase === "prompt" || phase === "output" ? "provider_error" : "unknown";
21731
21768
  }
21732
- function throwWithPromptFailure(legacyError, failedAttempts, args, timeoutMs) {
21769
+ function throwWithPromptFailure(legacyError, failedAttempts, args, timeoutMs, transport) {
21733
21770
  const error = legacyError instanceof Error ? legacyError : new Error(extractMessage(legacyError));
21734
21771
  const last = failedAttempts.at(-1);
21735
21772
  const failureClass = last?.failureClass ?? "unknown";
@@ -21740,15 +21777,15 @@ function throwWithPromptFailure(legacyError, failedAttempts, args, timeoutMs) {
21740
21777
  modelsTried: failedAttempts.map((failure) => failure.attempt.label),
21741
21778
  providerError,
21742
21779
  timeoutMs: failureClass === "provider_timeout" ? timeoutMs : null,
21743
- childSessionId: args.path.id || null
21780
+ childSessionId: transport ? transport.childSessionId ?? null : args.path.id || null
21744
21781
  });
21745
21782
  throw error;
21746
21783
  }
21747
- async function attemptOnce(client, args, timeoutMs, signal, callContext, label) {
21784
+ async function attemptOnce(client, args, timeoutMs, signal, callContext, label, transport) {
21748
21785
  const originalBody = { ...args.body };
21749
21786
  const attemptArgs = copyPromptArgs(args, originalBody);
21750
21787
  try {
21751
- await promptWithTimeout(client, attemptArgs, timeoutMs, signal);
21788
+ await promptWithTimeout(client, attemptArgs, timeoutMs, signal, transport);
21752
21789
  return;
21753
21790
  } catch (error) {
21754
21791
  if (isNonRetryable(error, signal))
@@ -21767,7 +21804,7 @@ async function attemptOnce(client, args, timeoutMs, signal, callContext, label)
21767
21804
  providerID: suggestion.providerID,
21768
21805
  modelID: suggestion.suggestion
21769
21806
  }
21770
- }), timeoutMs, signal);
21807
+ }), timeoutMs, signal, transport);
21771
21808
  }
21772
21809
  }
21773
21810
  async function promptSyncWithModelSuggestionRetry(client, args, options = {}) {
@@ -21779,7 +21816,7 @@ async function promptSyncWithModelSuggestionRetry(client, args, options = {}) {
21779
21816
  const explicitPrimaryLabel = baseBody.model?.providerID && baseBody.model.modelID ? `${baseBody.model.providerID}/${baseBody.model.modelID}` : "primary";
21780
21817
  let lastError = null;
21781
21818
  try {
21782
- await attemptOnce(client, baseArgs, timeoutMs, options.signal, callContext, explicitPrimaryLabel);
21819
+ await attemptOnce(client, baseArgs, timeoutMs, options.signal, callContext, explicitPrimaryLabel, options.transport);
21783
21820
  return;
21784
21821
  } catch (error) {
21785
21822
  lastError = error;
@@ -21805,7 +21842,7 @@ async function promptSyncWithModelSuggestionRetry(client, args, options = {}) {
21805
21842
  ...fallback?.qualifier ? { variant: fallback.qualifier } : {}
21806
21843
  });
21807
21844
  try {
21808
- await attemptOnce(client, attemptArgs, timeoutMs, options.signal, callContext, label);
21845
+ await attemptOnce(client, attemptArgs, timeoutMs, options.signal, callContext, label, options.transport);
21809
21846
  log(`[${callContext}] fallback succeeded with ${label} (attempt ${i + 2}/${fallbacks.length + 1})`);
21810
21847
  return;
21811
21848
  } catch (error) {
@@ -21823,7 +21860,7 @@ async function promptSyncWithModelSuggestionRetry(client, args, options = {}) {
21823
21860
  }
21824
21861
  async function attemptAndValidate(client, args, timeoutMs, signal, callContext, attempt, options) {
21825
21862
  try {
21826
- await attemptOnce(client, args, timeoutMs, signal, callContext, attempt.label);
21863
+ await attemptOnce(client, args, timeoutMs, signal, callContext, attempt.label, options.transport);
21827
21864
  } catch (error) {
21828
21865
  throw {
21829
21866
  error,
@@ -21877,10 +21914,10 @@ async function promptSyncWithValidatedOutputRetry(client, args, options) {
21877
21914
  firstError = failure.error;
21878
21915
  lastError = failure.error;
21879
21916
  if (isNonRetryable(failure.error, options.signal)) {
21880
- throwWithPromptFailure(failure.error, failedAttempts, args, timeoutMs);
21917
+ throwWithPromptFailure(failure.error, failedAttempts, args, timeoutMs, options.transport);
21881
21918
  }
21882
21919
  if (fallbacks.length === 0) {
21883
- throwWithPromptFailure(failure.error, failedAttempts, args, timeoutMs);
21920
+ throwWithPromptFailure(failure.error, failedAttempts, args, timeoutMs, options.transport);
21884
21921
  }
21885
21922
  log(`[${callContext}] primary (${explicitPrimaryLabel}) failed validation/prompt: ${shortErr(failure.error)}; trying ${fallbacks.length} fallback(s)`);
21886
21923
  }
@@ -21914,7 +21951,7 @@ async function promptSyncWithValidatedOutputRetry(client, args, options) {
21914
21951
  failedAttempts.push(failure);
21915
21952
  lastError = failure.error;
21916
21953
  if (isNonRetryable(failure.error, options.signal)) {
21917
- throwWithPromptFailure(failure.error, failedAttempts, args, timeoutMs);
21954
+ throwWithPromptFailure(failure.error, failedAttempts, args, timeoutMs, options.transport);
21918
21955
  }
21919
21956
  const remaining = fallbacks.length - i - 1;
21920
21957
  if (remaining > 0) {
@@ -21923,7 +21960,7 @@ async function promptSyncWithValidatedOutputRetry(client, args, options) {
21923
21960
  }
21924
21961
  }
21925
21962
  log(`[${callContext}] all models exhausted; tried: ${failedAttempts.map((failure) => failure.attempt.label).join(", ")}; original error: ${shortErr(firstError)}; last error: ${shortErr(lastError)}`);
21926
- throwWithPromptFailure(firstError ?? lastError ?? new Error("All fallback models failed validation"), failedAttempts, args, timeoutMs);
21963
+ throwWithPromptFailure(firstError ?? lastError ?? new Error("All fallback models failed validation"), failedAttempts, args, timeoutMs, options.transport);
21927
21964
  }
21928
21965
  // src/shared/normalize-sdk-response.ts
21929
21966
  function normalizeSDKResponse(response, fallback, options) {
@@ -22449,7 +22486,7 @@ function resolveUserConfigDirectory(options) {
22449
22486
  if (shared.format !== "none")
22450
22487
  return dirname4(shared.path);
22451
22488
  if (options.harness) {
22452
- const legacy = resolveLegacyConfigSourcesForHarness(options.directory ?? process.cwd(), options.harness === "omp" ? "pi" : options.harness).user.find((source) => existsSync6(source.path));
22489
+ const legacy = resolveLegacyConfigSourcesForHarness(options.directory ?? process.cwd(), options.harness === "omp" ? "pi" : options.harness === "opencode2" ? "opencode" : options.harness).user.find((source) => existsSync6(source.path));
22453
22490
  if (legacy)
22454
22491
  return dirname4(legacy.path);
22455
22492
  }
@@ -24127,6 +24164,16 @@ var USER_FACING_FAILURES = {
24127
24164
  code: "MC-C10",
24128
24165
  sentence: "Magic Context is temporarily unavailable.",
24129
24166
  action: "Retry in a moment."
24167
+ },
24168
+ memory_mirror_stalled: {
24169
+ code: "MC-M01",
24170
+ sentence: "Memory synchronization stopped before the host mirror caught up.",
24171
+ action: "Send another message to resume it, or run `ck doctor drain-authority`."
24172
+ },
24173
+ memory_authority_mismatch: {
24174
+ code: "MC-M02",
24175
+ sentence: "Memory authority is inconsistent between the host and module.",
24176
+ action: "Run `ck doctor drain-authority` before changing Rust mode."
24130
24177
  }
24131
24178
  };
24132
24179
  function renderUserFacingFailure(key, style = "markdown") {
@@ -33024,6 +33071,18 @@ function recordChildInvocation(input) {
33024
33071
  }
33025
33072
  }
33026
33073
 
33074
+ // src/hooks/magic-context/compartment-runner-types.ts
33075
+ class HiddenCompletionRefusal extends Error {
33076
+ code;
33077
+ terminal;
33078
+ constructor(code, message, terminal = false) {
33079
+ super(`${code}: ${message}`);
33080
+ this.code = code;
33081
+ this.terminal = terminal;
33082
+ this.name = "HiddenCompletionRefusal";
33083
+ }
33084
+ }
33085
+
33027
33086
  // src/hooks/magic-context/compartment-runner-mapping.ts
33028
33087
  function tierFieldsOf(c) {
33029
33088
  return {
@@ -33270,6 +33329,61 @@ function historianMessageCreatedAt(message) {
33270
33329
  return 0;
33271
33330
  return typeof message.info.time.created === "number" ? message.info.time.created : 0;
33272
33331
  }
33332
+ function createV1HiddenCompletionExecutor(client, db, directory) {
33333
+ return {
33334
+ capabilities: { tools: true, harness: "opencode" },
33335
+ async open(run) {
33336
+ if (!client)
33337
+ throw new Error("Hidden completion client is unavailable");
33338
+ const response = await createChildSessionWithFence({
33339
+ client,
33340
+ db,
33341
+ parentSessionId: run.parentSessionId,
33342
+ title: run.title,
33343
+ directory: run.directory
33344
+ });
33345
+ const created = normalizeSDKResponse(response, null, {
33346
+ preferResponseOnMissingData: true
33347
+ });
33348
+ const id = typeof created?.id === "string" ? created.id : "";
33349
+ return { id, childSessionId: id || undefined };
33350
+ },
33351
+ async attempt(_handle, request) {
33352
+ if (!client)
33353
+ throw new Error("Hidden completion client is unavailable");
33354
+ await client.session.prompt(request);
33355
+ },
33356
+ async collect(handle, limit) {
33357
+ if (!client)
33358
+ throw new Error("Hidden completion client is unavailable");
33359
+ const response = await client.session.messages({
33360
+ path: { id: handle.id },
33361
+ query: { directory, limit }
33362
+ });
33363
+ const messages = normalizeSDKResponse(response, [], {
33364
+ preferResponseOnMissingData: true
33365
+ });
33366
+ const text = extractLatestAssistantText(messages);
33367
+ return {
33368
+ messages,
33369
+ text,
33370
+ reasoning: text ? null : extractLatestHistorianReasoning(messages),
33371
+ lengthCapped: hasLengthCappedOutput(messages),
33372
+ usage: sumTokensFromChildMessages(messages)
33373
+ };
33374
+ },
33375
+ async close(handle, settlement) {
33376
+ if (!client)
33377
+ return;
33378
+ await teardownChildSession({
33379
+ client,
33380
+ sessionId: handle?.id || null,
33381
+ sessionDirectory: directory,
33382
+ ...settlement
33383
+ });
33384
+ }
33385
+ };
33386
+ }
33273
33387
  async function runValidatedHistorianPass(args) {
33274
33388
  const firstRun = await runHistorianPrompt({
33275
33389
  ...args,
@@ -33278,6 +33392,8 @@ async function runValidatedHistorianPass(args) {
33278
33392
  agentId: args.agentId
33279
33393
  });
33280
33394
  if (!firstRun.ok || !firstRun.result) {
33395
+ if (firstRun.refusal?.terminal)
33396
+ return { ok: false, error: firstRun.error ?? firstRun.refusal.message };
33281
33397
  return runFallbackHistorianPass({
33282
33398
  ...args,
33283
33399
  prompt: args.prompt,
@@ -33307,6 +33423,8 @@ async function runValidatedHistorianPass(args) {
33307
33423
  agentId: args.agentId
33308
33424
  });
33309
33425
  if (!repairRun.ok || !repairRun.result) {
33426
+ if (repairRun.refusal?.terminal)
33427
+ return { ok: false, error: repairRun.error ?? repairRun.refusal.message };
33310
33428
  return runFallbackHistorianPass({
33311
33429
  ...args,
33312
33430
  prompt: repairPrompt,
@@ -33337,11 +33455,14 @@ async function runEditorPassOrFallback(args) {
33337
33455
  sessionLog(args.parentSessionId, "historian two-pass: running editor on draft");
33338
33456
  const editorRun = await runHistorianPrompt({
33339
33457
  client: args.client,
33458
+ hiddenCompletionExecutor: args.hiddenCompletionExecutor,
33340
33459
  db: args.db,
33341
33460
  parentSessionId: args.parentSessionId,
33342
33461
  sessionDirectory: args.sessionDirectory,
33343
33462
  prompt: buildHistorianEditorPrompt(args.draftXml),
33344
33463
  timeoutMs: args.timeoutMs,
33464
+ maxOutputTokens: args.maxOutputTokens,
33465
+ language: args.language,
33345
33466
  dumpLabel: `${args.dumpLabelBase}-editor`,
33346
33467
  agentId: HISTORIAN_EDITOR_AGENT,
33347
33468
  parentInvocationId: args.draftInvocationId ?? null,
@@ -33378,6 +33499,9 @@ async function runHistorianPrompt(args) {
33378
33499
  parentInvocationId
33379
33500
  } = args;
33380
33501
  let agentSessionId = null;
33502
+ let handle = null;
33503
+ let completion;
33504
+ const executor = args.hiddenCompletionExecutor ?? createV1HiddenCompletionExecutor(client, db, sessionDirectory);
33381
33505
  let promptSettled = false;
33382
33506
  let hadUnsettledPrompt = false;
33383
33507
  const startedAt = Date.now();
@@ -33389,26 +33513,41 @@ async function runHistorianPrompt(args) {
33389
33513
  return recordChildInvocation({
33390
33514
  db: openDatabase(),
33391
33515
  parentSessionId,
33392
- harness: "opencode",
33516
+ harness: executor.capabilities.harness,
33393
33517
  subagent: agentId === HISTORIAN_EDITOR_AGENT ? "historian_editor" : subagentKind ?? "historian",
33394
33518
  startedAt,
33395
33519
  status: params.status,
33396
33520
  messages: params.messages,
33521
+ ...completion && !completion.messages ? {
33522
+ tokens: completion.usage,
33523
+ providerId: completion.providerId,
33524
+ modelId: completion.modelId
33525
+ } : {},
33397
33526
  error: params.error,
33398
33527
  parentInvocationId: agentId === HISTORIAN_EDITOR_AGENT ? parentInvocationId ?? null : null
33399
33528
  });
33400
33529
  };
33401
33530
  try {
33402
33531
  sessionLog(parentSessionId, `historian: creating child session (agent=${toModelEntry(modelOverride)?.model ?? `agent:${agentId}`})`);
33403
- const createResponse = await createChildSessionWithFence({
33404
- client,
33405
- db,
33532
+ handle = await executor.open({
33406
33533
  parentSessionId,
33534
+ parentInvocationId,
33535
+ agent: agentId,
33536
+ kind: agentId === HISTORIAN_EDITOR_AGENT ? "historian-editor" : "historian",
33537
+ system: withContentLanguageDirective(agentId === HISTORIAN_EDITOR_AGENT ? HISTORIAN_EDITOR_SYSTEM_PROMPT : COMPARTMENT_AGENT_SYSTEM_PROMPT, args.language),
33538
+ maxOutputTokens: args.maxOutputTokens,
33539
+ model: modelOverride,
33540
+ configuredModels: [
33541
+ ...modelOverride ? [modelOverride] : [],
33542
+ ...fallbackModels ?? []
33543
+ ],
33544
+ timeoutMs: timeoutMs ?? DEFAULT_HISTORIAN_TIMEOUT_MS,
33407
33545
  title: "magic-context-compartment",
33408
- directory: sessionDirectory
33546
+ directory: sessionDirectory,
33547
+ metadata: { dumpLabel, subagentKind }
33409
33548
  });
33410
- const createdSession = normalizeSDKResponse(createResponse, null, { preferResponseOnMissingData: true });
33411
- agentSessionId = typeof createdSession?.id === "string" ? createdSession.id : null;
33549
+ agentSessionId = handle.id || null;
33550
+ const opened = handle;
33412
33551
  if (!agentSessionId) {
33413
33552
  recordInvocation({
33414
33553
  status: "failed",
@@ -33427,6 +33566,7 @@ async function runHistorianPrompt(args) {
33427
33566
  parts: [{ type: "text", text: prompt, synthetic: true }]
33428
33567
  }
33429
33568
  }, {
33569
+ transport: Object.assign((request) => executor.attempt(opened, request), { childSessionId: opened.childSessionId }),
33430
33570
  timeoutMs: timeoutMs ?? DEFAULT_HISTORIAN_TIMEOUT_MS,
33431
33571
  fallbackModels: modelOverride ? undefined : fallbackModels,
33432
33572
  callContext: agentId === HISTORIAN_EDITOR_AGENT ? "historian:editor" : "historian"
@@ -33448,19 +33588,16 @@ async function runHistorianPrompt(args) {
33448
33588
  await sleep(backoffMs);
33449
33589
  }
33450
33590
  }
33451
- const messagesResponse = await client.session.messages({
33452
- path: { id: agentSessionId },
33453
- query: { directory: sessionDirectory, limit: 50 }
33454
- });
33455
- const messages = normalizeSDKResponse(messagesResponse, [], {
33456
- preferResponseOnMissingData: true
33591
+ completion = await executor.collect(handle, 50);
33592
+ const invocationId = recordInvocation({
33593
+ status: "completed",
33594
+ messages: completion.messages
33457
33595
  });
33458
- const invocationId = recordInvocation({ status: "completed", messages });
33459
- const lengthCapped = hasLengthCappedOutput(messages);
33460
- const textResult = extractLatestAssistantText(messages);
33461
- const reasoningResult = textResult ? null : extractLatestHistorianReasoning(messages);
33596
+ const lengthCapped = completion.lengthCapped;
33597
+ const textResult = completion.text;
33598
+ const reasoningResult = textResult ? null : completion.reasoning;
33462
33599
  if (!textResult && reasoningResult && lengthCapped) {
33463
- const outputTokens = sumTokensFromChildMessages(messages).output;
33600
+ const outputTokens = completion.usage.output;
33464
33601
  return {
33465
33602
  ok: false,
33466
33603
  error: `historian output length-capped at ${outputTokens} tokens (all reasoning, no text) — set historian.maxTokens or route historian.model to a low-reasoning lane/variant`,
@@ -33483,13 +33620,11 @@ async function runHistorianPrompt(args) {
33483
33620
  recordInvocation({ status: "failed", error: modelError });
33484
33621
  return {
33485
33622
  ok: false,
33486
- error: `Historian failed while processing this session: ${desc.brief}`
33623
+ error: `Historian failed while processing this session: ${desc.brief}`,
33624
+ ...modelError instanceof HiddenCompletionRefusal ? { refusal: modelError } : {}
33487
33625
  };
33488
33626
  } finally {
33489
- await teardownChildSession({
33490
- client,
33491
- sessionId: agentSessionId,
33492
- sessionDirectory,
33627
+ await executor.close(handle, {
33493
33628
  promptSettled,
33494
33629
  privacySensitive: false,
33495
33630
  context: "historian",
@@ -33531,11 +33666,14 @@ async function runFallbackHistorianPass(args) {
33531
33666
  args.callbacks?.onModelFallback?.(modelId, i + 1, chain.length);
33532
33667
  const fallbackRun = await runHistorianPrompt({
33533
33668
  client: args.client,
33669
+ hiddenCompletionExecutor: args.hiddenCompletionExecutor,
33534
33670
  db: args.db,
33535
33671
  parentSessionId: args.parentSessionId,
33536
33672
  sessionDirectory: args.sessionDirectory,
33537
33673
  prompt: args.prompt,
33538
33674
  timeoutMs: args.timeoutMs,
33675
+ maxOutputTokens: args.maxOutputTokens,
33676
+ language: args.language,
33539
33677
  dumpLabel: `${args.dumpLabelBase}-fallback-${i + 1}`,
33540
33678
  modelOverride,
33541
33679
  agentId: args.agentId
@@ -39362,7 +39500,7 @@ async function runCompartmentAgent(deps) {
39362
39500
  const invocationId = latest != null && (invocationBaseline == null || latest > invocationBaseline) ? latest : null;
39363
39501
  recordHistorianRun(db, {
39364
39502
  sessionId,
39365
- harness: "opencode",
39503
+ harness: deps.hiddenCompletionExecutor?.capabilities.harness ?? "opencode",
39366
39504
  subagentInvocationId: invocationId,
39367
39505
  runKind: telemetry.runKind ?? "incremental",
39368
39506
  status: telemetry.status ?? "failed",
@@ -39586,7 +39724,7 @@ async function runCompartmentAgent(deps) {
39586
39724
  ${chunkText}`,
39587
39725
  memoryEnabled: deps.memoryEnabled !== false
39588
39726
  });
39589
- const parentSessionResponse = await client.session.get({ path: { id: sessionId } }).catch(() => null);
39727
+ const parentSessionResponse = await client?.session.get({ path: { id: sessionId } }).catch(() => null);
39590
39728
  const parentSession = normalizeSDKResponse(parentSessionResponse, null, { preferResponseOnMissingData: true });
39591
39729
  const sessionDirectory = parentSession?.directory ?? directory;
39592
39730
  const maxExistingSequence = priorCompartments.reduce((max, c) => c.sequence > max ? c.sequence : max, -1);
@@ -39594,6 +39732,7 @@ ${chunkText}`,
39594
39732
  retainDrainReservationForRetryThrottle = true;
39595
39733
  const validatedPass = await runValidatedHistorianPass({
39596
39734
  client,
39735
+ hiddenCompletionExecutor: deps.hiddenCompletionExecutor,
39597
39736
  db,
39598
39737
  parentSessionId: sessionId,
39599
39738
  sessionDirectory,
@@ -39603,6 +39742,7 @@ ${chunkText}`,
39603
39742
  sequenceOffset,
39604
39743
  dumpLabelBase: `incremental-${sessionId}-${chunk.startIndex}-${chunk.endIndex}`,
39605
39744
  timeoutMs: historianTimeoutMs,
39745
+ maxOutputTokens: deps.historianMaxOutputTokens,
39606
39746
  model: deps.model,
39607
39747
  fallbackModelId: deps.fallbackModelId,
39608
39748
  fallbackModels: deps.fallbackModels,
@@ -39716,7 +39856,7 @@ ${chunkText}`,
39716
39856
  clearEmergencyRecovery(db, sessionId);
39717
39857
  drainReservation = null;
39718
39858
  if (deferMarkerApplication && lastNewEndMessageId) {
39719
- setPendingCompactionMarkerState(db, sessionId, {
39859
+ (deps.compactionMarkerStrategy?.setPending ?? setPendingCompactionMarkerState)(db, sessionId, {
39720
39860
  ordinal: lastCompartmentEnd,
39721
39861
  endMessageId: lastNewEndMessageId,
39722
39862
  publishedAt: Date.now()
@@ -39739,7 +39879,7 @@ ${chunkText}`,
39739
39879
  if (deferMarkerApplication) {
39740
39880
  deps.onDeferredMarkerPending?.(sessionId);
39741
39881
  } else {
39742
- updateCompactionMarkerAfterPublication(db, sessionId, lastCompartmentEnd, sessionDirectory);
39882
+ (deps.compactionMarkerStrategy?.publish ?? updateCompactionMarkerAfterPublication)(db, sessionId, lastCompartmentEnd, sessionDirectory);
39743
39883
  }
39744
39884
  updateSessionMeta2(db, sessionId, { compartmentInProgress: false });
39745
39885
  completedSuccessfully = true;
@@ -39818,7 +39958,7 @@ ${chunkText}`,
39818
39958
  const stored = insertPrimerCandidates(db, [
39819
39959
  {
39820
39960
  projectPath: promotionProjectIdentity,
39821
- harness: "opencode",
39961
+ harness: deps.hiddenCompletionExecutor?.capabilities.harness ?? "opencode",
39822
39962
  sessionId,
39823
39963
  question: candidate.question,
39824
39964
  sourceCompartmentStart: startC?.startMessage,
@@ -41375,4 +41515,4 @@ async function runUpgradeMemoryMigration(ctx, sessionId, migrationDirectory) {
41375
41515
  }
41376
41516
  }
41377
41517
 
41378
- export { withContentLanguageDirective, buildPrimaryLanguageDirective, setJsoncValue, removeJsoncValue, cortexKitUserConfigBasePath, cortexKitProjectConfigBasePath, resolveLegacyConfigSources, resolveLegacyConfigSourcesForHarness, migrateMagicContextConfigLocations, string, unknown, array, object, union, tuple, record, parseCron, nextOccurrence, nextDueAtMs, promptSurfaceConfigIdentity, resolveModelConfigValue, resolvePromptSurface, resolveModelConfigOrDefault, DEFAULT_EXECUTE_THRESHOLD_PERCENTAGE, DEFAULT_HISTORIAN_TIMEOUT_MS, DEFAULT_LOCAL_EMBEDDING_MODEL, PER_HARNESS_MIGRATION_INVENTORY, PER_HARNESS_MODEL_KEYS, ConfigProfilesSchema, MagicContextConfigSchema, isFailClosedBlockingError, shouldBypassFailClosedBlock, resolveAgentNameFromMessages, createFailClosedController, recordHookInitFailure, clearHookInitFailure, getLastHookInitFailure, ProjectIdentityError, resolveProjectIdentityStrict, takeDubiousOwnershipProjectIdentityWarning, resolveProjectIdentity, directoryHasGitMetadata, resolveProjectIdentityForSession, normalizeStoredProjectPath, storedPathBelongsToIdentity, isLinkedGitWorktree, recordSessionProjectIdentity, beginBootQuietPeriod, bootQuietRemainingMs, scheduleAfterBootQuiet, rpcPortDir, rpcPortFilePath, isPidAlive, parseRpcPortFile, observeAuthorityRouting, registerModuleNoteEvaluationBridge, getModuleNoteEvaluationBridge, getContextStoreUuid, ensureContextStoreUuid, getAuthorityManagedMarker, reconcileAuthorityProject, checksumAuthoritySeedRows, prepareAuthority, drainAuthority, applyMirroredNoteCompileFields, drainMirrorPages, pullMemoryMirrorOnce, V2_MEMORY_CATEGORIES, CATEGORY_PRIORITY, resolveWorkspaceShareCategories, resolveWorkspaceIdentitySet, expandWorkspaceIdentitySetWithAliases, resolveStoredPathWorkspaceIdentity, storedPathBelongsToWorkspace, sourceNameForMemory, computeWorkspaceEpochFingerprint, textMentionsRecentCommit, hasMeaningfulUserText, extractTexts, extractToolCallSummaries, getTokenizerNativeMemoryStats, preloadTokenizer, estimateTokens, normalizeText, getCurrentToolSetHash, recordToolDefinition, getMeasuredToolDefinitionTokens, getSchemaFenceRejection, getMigrationOnOpenRefusal, LATEST_SUPPORTED_VERSION, getDatabasePath, getPersistedSchemaVersion, setSqlitePragmaConfig, runSqliteOptimize, openDatabase, openDatabaseAsync, isDatabasePersisted, getDatabasePersistenceError, COMPARTMENT_AGENT_SYSTEM_PROMPT, HISTORIAN_EDITOR_SYSTEM_PROMPT, COMPARTMENT_STRUCTURAL_SYSTEM_PROMPT, Priority, AdmissionClass, SocketClosedError, SocketTimeoutError, StaleRouteHandleError, SubcClient, isConsumerReconnectTransient, connectionFileExists, isRecord, CTX_REDUCE_KEEP, newestCtxReduceTagNumbers, stripWellFormedLeadingTagPrefix, stripPersistedAssistantText, byteSize, stripTagPrefix, prependTag, isThinkingPart, estimateImageTokensFromDataUrl, normalizeTodoStateJson, buildSyntheticTodoPart, computeSyntheticCallId, isSyntheticTodoPart, countRealUserMessages, tailHygieneStructuralSignature, sameTailHygieneStructuralSignature, refreshTailHygieneBaseline, effectiveTailHygiene, assertTailHygieneContentUnchanged, CHANNEL1_SENTINEL, CHANNEL1_FLOOR_TOKENS, toolOutputTokens, decideChannel1, evaluateChannel2, formatChannel1Evaluation, formatChannel2Evaluation, reclaimableToolOutputCount, buildChannel2Reminder, buildChannel1Reminder, estimateEmergencyDropReclaimTokens, planEmergencyDrop, getRecentTagOwnerMessageIds, AGE_RECLAIM_MIN_TOKENS, getOldestActiveUnprotectedToolTags, getActiveToolTagsForAgeReclaim, getTriggerTagTokenUpperBound, getActiveTagTokenTotalsByMessage, tagTokenCountIsNull, backfillTagTokenCounts, insertTag, updateTagStatus, markWhitespaceAssistantTagInert, getInertWhitespaceAssistantTags, updateTagDropMode, updateCavemanDepth, updateTagMessageId, markTagsCompactedByMessageIds, deleteTagsByMessageId, getMaxTagNumberBySession, getTagNumberByMessageId, getAssignableTagNumberByMessageId, deriveTagLoadFloor, getTagsBySession, getActiveTagsBySession, getTailHygieneTags, getDroppedTagsBySession, getTagsByNumbers, getDroppedTagsByNumbers, getMaxDroppedTagNumber, getTagById, getToolTagNumberByOwner, getNullOwnerToolTag, adoptNullOwnerToolTag, getCandidateToolOwners, pickNearestPriorOwner, isRawCompactionSummaryInfo, extractInMemoryMessageViews, buildInMemoryTailRawMessages, estimateTrueRawMessageTokens, invalidateTrueRawTokenCache, isTextPart, isToolPartWithOutput, isFilePart, buildFileSourceContent, createDroppedInputToolExecuteBeforeHook, isEditTool, partHasCompletedResult, extractToolCallObservation, ToolMutationBatch, createToolDropTarget, setRawMessageProvider, cleanUserText, withRawSessionMessageCache, readRawSessionMessages, primeTailRawMessageCache, primeInMemoryTailRawMessageCache, readRawSessionMessageOrdinalPage, getRawSessionStoredMessageCount, readRawSessionMessagePartsById, readRawSessionMessageOrdinalById, readRawSessionMessageById, readSessionChunk, readRawSessionSeedTail, COMPARTMENT_LEASE_RENEWAL_MS, acquireCompartmentLease, renewCompartmentLease, releaseCompartmentLeaseBestEffort, HAS_COMPARTMENT_CONTENT_SQL, getCompartments, getLastCompartmentEndMessage, getLastCompartmentEndMessageId, clearRecompStaging, getMessageIndexSourceIdentity, isMessageIndexSourceCurrent, getLastIndexedOrdinal, getIndexedMessageCorpusSize, getMessageIndexReconciliationStartOrdinal, isMessageIndexReconciledThrough, deleteIndexedMessage, clearIndexedMessages, indexSingleMessage, indexMessagesAfterOrdinal, sweepOrphanedOpenCodeMessageIndexes, recordEmbeddingMeasurement, getMaxM0MutationId, queueMemoryMutation, getMemoryMutationsForRenderByProjects, getMaxMemoryMutationIdForProjects, MAX_EXECUTE_THRESHOLD, escalationBands, MERGED_REASONING_PARTS_PREFIX, readFrozenMergedReasoningParts, getProtectionWindowForSession, isEmergencyRecoveryArmed, isProviderOverflowReconfirmed, isProviderOverflowFailClosedProven, getEmergencyRecoveryArmedAt, loadPersistedUsage, loadProtectedTailMeta, resetProtectedTailNoEligibleHead, getWrapupInProgressState, acquireWrapupInProgress, updateWrapupInProgress, releaseWrapupInProgress, resolveCompactionModeRecord, getCompactionModeRecord, setCompactionModeRecord, getPersistedReasoningWatermark, setPersistedReasoningWatermark, clearPersistedReasoningWatermark, getEmergencyInputSample, setEmergencyDropSample, clearEmergencyDropSample, getLastNudgeUndropped, setLastNudgeUndropped, getChannel1NudgeState, setChannel1NudgeState, markChannel1PostReduceGracePending, captureChannel1PostReduceGraceBaseline, getChannel2NudgeState, getChannel2NudgeClaim, setChannel2NudgeState, casChannel2NudgeState, claimChannel2NudgeState, casChannel2NudgeClaim, getPersistedNoteNudge, getNoteNudgeAnchors, getAutoSearchHintDecisions, appendAutoSearchHintDecision, pruneNoteNudgeAnchors, pruneAutoSearchHintDecisions, removeNoteNudgeAnchorByMessageId, removeAutoSearchHintDecisionByMessageId, getPersistedTodoPermissionDenied, setPersistedTodoPermissionDenied, getPersistedTodoSyntheticAnchor, setPersistedTodoSyntheticAnchor, clearPersistedTodoSyntheticAnchor, setNoteLastReadAt, getHistorianFailureState, clearHistorianFailureState, getOverflowState, loadTransformPassStateSnapshot, recordOverflowDetected, recordDetectedContextLimit, clearEmergencyRecovery, clearDetectedContextLimit, getPersistedCompactionMarkerState, setPersistedCompactionMarkerState, getDeferredClearedCompactionMarkerState, retireDeferredClearedCompactionMarkerState, getStrippedPlaceholderIds, applyStrippedPlaceholderDelta, removeStrippedPlaceholderId, NEWEST_REASONING_BEARING_ASSISTANT, THINKING_BINDING_RECOVERY_FROZEN_PREFIX, thinkingBindingRecoveryFrozenId, getThinkingBindingRecoveryTarget, armThinkingBindingRecovery, clearThinkingBindingRecoveryIf, getMergedReasoningStrippedIds, addMergedReasoningStrippedIds, getTrailingBlankDecisions, addTrailingBlankDecisions, demoteTrailingBlankKeepDecisions, getStaleReduceStrippedIds, addStaleReduceStrippedIds, getProcessedImageStrippedIds, addProcessedImageStrippedIds, getPendingCompactionMarkerState, loadPostprocessReplaySnapshot, setPendingCompactionMarkerState, clearPendingCompactionMarkerStateIf, getSessionsWithPendingMarker, setSessionWorkMetrics, getObservedEpochFloor, resolveEpochFloorForPass, getNotes, addNote, getSessionNotes, getPendingSmartNotes, getReadySmartNotes, updateNote, dismissNotes, dismissNote, markNoteReady, markNoteChecked, queuePendingOp, getPendingOps, getPendingOpsCount, clearPendingOps, removePendingOp, PRIMER_CANDIDATE_TTL_MS, PRIMER_CANDIDATE_MAX_AGE_MS, primerOccurrenceKey, primerOccurrenceUtcDay, updatePrimerCandidateEmbedding, getPrimerCandidatesByIds, getPrimerCandidatesForPromotion, countPrimerCandidatesForProject, getActivePrimers, createPrimer, updatePrimerSupport, updatePrimerAnswer, GLOBAL_USER_PROFILE_PROJECT_PATH, getProjectState, bumpProjectMemoryEpoch, bumpProjectUserProfileVersion, saveSourceContent, replaceSourceContent, getSourceContents, createChildSessionWithFence, detectThinkingBindingMismatch, isFable51ThinkingBindingModel, detectOverflow, modelBodyField, toModelEntry, getPromptFailureDetail, promptSyncWithValidatedOutputRetry, normalizeSDKResponse, promptSurfaceHashMaterial, createPromptSurfaceRuntime, createPromptSurfaceGuidanceEpochCache, extractLatestAssistantText, hasLengthCappedOutput, setKeepSubagents, teardownChildSession, renderUserFacingFailure, userFacingFailureCode, renderCapabilityRefusal, capabilityRefusalCode, renderDreamFailure, dreamFailureCode, renderEmbeddingFailure, getCompartmentEvents, SYNAPSE_DEFAULT_MODEL, toSynapseLaneDescriptor, formatSynapseLaneDescriptor, SynapseEmbeddingProvider, loadCompartmentChunkEmbeddingsForSearch, cosineSimilarity, computeNormalizedHash, getLocalEmbeddingNativeMemoryStats, saveCommitEmbedding, loadProjectCommitEmbeddings, loadUnembeddedCommits, countEmbeddedCommits, upsertCommits, getLatestIndexedCommitTimeMs, enforceProjectCap, GIT_SWEEP_LEASE_RENEWAL_MS, acquireGitSweepLease, renewGitSweepLease, markGitSweepSuccessAndRelease, parkGitSweepNonIndexable, releaseGitSweepLease, saveEmbeddingIfHashMatches, getProjectEmbeddings, peekProjectEmbeddings, invalidateProject, invalidateMemory, describeShadowBackfillWriteRefusal, markProjectLoadUntrusted, contentSha256, sweepStaleEmbeddingIdentitiesForProject, registerProjectEmbedding, registerProjectShadowEmbedding, getShadowEmbeddingMeasurementCohort, getPrimaryEmbeddingMeasurementCohort, embedShadowTextForProject, enqueueShadowEmbeddingItems, registerProjectInObservationMode, getProjectEmbeddingSnapshot, embedTextForProject, embedBatchForProject, embedItemsForProject, embedUnembeddedMemoriesForProject, drainCommitBacklogForProject, embedSessionCompartmentChunks, getEmbeddingCoverageStatus, isEmbeddingEnabled, embedText, ensureMemoryEmbeddings, computeCueContentHash, hasMuralCueColumns, getMuralCueState, memoryNeedsCue, setMuralCue, recordMuralCueRejection, hasMemoryShareableColumn, hasMemoryClassifiedAtColumn, getUnclassifiedMemoryIds, ModuleMemoryAuthorityError, insertMemory, insertMemoryIdempotent, getMemoryByHash, getMemoriesByProject, buildWorkspaceMemorySqlFilter, getMemoriesByProjects, getMaxMemoryIdForProjects, readNewMemoriesForM1Union, getMemoryById, getMemoriesByIds, updateMemorySeenCount, updateMemoryRetrievalCount, setMemoryClassification, supersededMemory, mergeMemoryStats, archiveMemory, getMemoryCountsByStatus, sanitizeFtsQuery, searchMemoriesFTS, searchMemoriesFTSUnion, recordMemoryMapping, recordMemoryVerifications, getUnmappedMemoryIds, clearMemoryVerifications, getMemoryVerifications, resolveGitTopLevel, readGitHead, readGitChangedFilesSince, readGitFileChangeTimesSince, verificationFileExists, normalizeVerificationFiles, recordChildInvocation, USER_MEMORY_CANDIDATE_TTL_MS, insertUserMemoryCandidates, getUserMemoryCandidates, deleteUserMemoryCandidates, pruneExpiredUserMemoryCandidates, insertUserMemory, getActiveUserMemories, updateUserMemoryContent, dismissUserMemory, getMural, BoundedSessionMap, registerLkgPersistence, beginLkgPass, visitMessageContentFields, messageContentFields, signatureForFields, exactReusablePrefix, incrementalLkgContentDigests, lkgContentDigest, captureSlot, getInMemorySlot, getSlot, dropSlot, noteEntry, getLkgSlotHeapStats, onNoteTrigger, peekNoteNudgeText, markNoteNudgeDelivered, clearNoteNudgeTriggerAndCooldown, resetNoteNudgeCooldownOnly, clearNoteNudgeTriggerOnly, getOpenCodeDbPath, removeMcOwnedCompactionMarkers, MARKER_SUMMARY_TEXT, applyDeferredCompactionMarker, removeCompactionMarkerForSession, checkCompactionMarkerConsistency, modelKeyAcceptsImages, resolveMuralWire, extractM0Block, formatDate, injectTemporalMarkers, clearInjectionCache, getVisibleMemoryIds, selectHiddenMessagesAtCompactionSeam, prepareCompartmentInjection, renderCompartmentInjection, mustMaterialize, trimMemoriesToBudgetV2, renderMemoryBlockV2, prepareCachedM0M1Replay, hasCompleteCachedM0M1, injectM0M1, describeBoundaryDiagnostics, RECOVERY_NO_HEAD_LIMIT, resolveOpenCodeProtectedTailBoundary, resolveWrapupProtectedTailBoundary, getRawHistoryEligibility, hasRunnableCompartmentWindow, recordHighPressureNoEligibleHead, runCompartmentAgent, snapRangeToCompartments, getActiveCompartmentRun, markActiveCompartmentRunPublished, registerActiveCompartmentRun, startCompartmentAgent, setRecompStarting2, setRecompTerminal2, runManagedRecomp2, runManagedUpgrade2 };
41518
+ export { withContentLanguageDirective, buildPrimaryLanguageDirective, setJsoncValue, removeJsoncValue, cortexKitUserConfigBasePath, cortexKitProjectConfigBasePath, resolveLegacyConfigSources, resolveLegacyConfigSourcesForHarness, migrateMagicContextConfigLocations, string, unknown, array, object, union, tuple, record, parseCron, nextOccurrence, nextDueAtMs, promptSurfaceConfigIdentity, resolveModelConfigValue, resolvePromptSurface, resolveModelConfigOrDefault, DEFAULT_EXECUTE_THRESHOLD_PERCENTAGE, DEFAULT_HISTORIAN_TIMEOUT_MS, DEFAULT_LOCAL_EMBEDDING_MODEL, PER_HARNESS_MIGRATION_INVENTORY, PER_HARNESS_MODEL_KEYS, ConfigProfilesSchema, MagicContextConfigSchema, isFailClosedBlockingError, shouldBypassFailClosedBlock, resolveAgentNameFromMessages, createFailClosedController, recordHookInitFailure, clearHookInitFailure, getLastHookInitFailure, ProjectIdentityError, resolveProjectIdentityStrict, takeDubiousOwnershipProjectIdentityWarning, resolveProjectIdentity, directoryHasGitMetadata, resolveProjectIdentityForSession, normalizeStoredProjectPath, storedPathBelongsToIdentity, isLinkedGitWorktree, recordSessionProjectIdentity, beginBootQuietPeriod, bootQuietRemainingMs, scheduleAfterBootQuiet, rpcPortDir, rpcPortFilePath, isPidAlive, parseRpcPortFile, observeAuthorityRouting, registerModuleNoteEvaluationBridge, getModuleNoteEvaluationBridge, getContextStoreUuid, ensureContextStoreUuid, getAuthorityManagedMarker, reconcileAuthorityProject, checksumAuthoritySeedRows, prepareAuthority, drainAuthority, getMemoryMirrorStatus, applyMirroredNoteCompileFields, drainMirrorPages, pullMemoryMirrorOnce, V2_MEMORY_CATEGORIES, CATEGORY_PRIORITY, resolveWorkspaceShareCategories, resolveWorkspaceIdentitySet, expandWorkspaceIdentitySetWithAliases, resolveStoredPathWorkspaceIdentity, storedPathBelongsToWorkspace, sourceNameForMemory, computeWorkspaceEpochFingerprint, textMentionsRecentCommit, hasMeaningfulUserText, extractTexts, extractToolCallSummaries, getTokenizerNativeMemoryStats, preloadTokenizer, estimateTokens, normalizeText, getCurrentToolSetHash, recordToolDefinition, getMeasuredToolDefinitionTokens, getSchemaFenceRejection, getMigrationOnOpenRefusal, LATEST_SUPPORTED_VERSION, getDatabasePath, getPersistedSchemaVersion, setSqlitePragmaConfig, runSqliteOptimize, openDatabase, openDatabaseAsync, isDatabasePersisted, getDatabasePersistenceError, COMPARTMENT_AGENT_SYSTEM_PROMPT, HISTORIAN_EDITOR_SYSTEM_PROMPT, COMPARTMENT_STRUCTURAL_SYSTEM_PROMPT, Priority, AdmissionClass, SocketClosedError, SocketTimeoutError, StaleRouteHandleError, SubcClient, isConsumerReconnectTransient, connectionFileExists, isRecord, CTX_REDUCE_KEEP, newestCtxReduceTagNumbers, stripWellFormedLeadingTagPrefix, stripPersistedAssistantText, byteSize, stripTagPrefix, prependTag, isThinkingPart, estimateImageTokensFromDataUrl, normalizeTodoStateJson, buildSyntheticTodoPart, computeSyntheticCallId, isSyntheticTodoPart, countRealUserMessages, tailHygieneStructuralSignature, sameTailHygieneStructuralSignature, refreshTailHygieneBaseline, effectiveTailHygiene, assertTailHygieneContentUnchanged, CHANNEL1_SENTINEL, CHANNEL1_FLOOR_TOKENS, toolOutputTokens, decideChannel1, evaluateChannel2, formatChannel1Evaluation, formatChannel2Evaluation, reclaimableToolOutputCount, buildChannel2Reminder, buildChannel1Reminder, estimateEmergencyDropReclaimTokens, planEmergencyDrop, getRecentTagOwnerMessageIds, AGE_RECLAIM_MIN_TOKENS, getOldestActiveUnprotectedToolTags, getActiveToolTagsForAgeReclaim, getTriggerTagTokenUpperBound, getActiveTagTokenTotalsByMessage, tagTokenCountIsNull, backfillTagTokenCounts, insertTag, updateTagStatus, markWhitespaceAssistantTagInert, getInertWhitespaceAssistantTags, updateTagDropMode, updateCavemanDepth, updateTagMessageId, markTagsCompactedByMessageIds, deleteTagsByMessageId, getMaxTagNumberBySession, getTagNumberByMessageId, getAssignableTagNumberByMessageId, deriveTagLoadFloor, getTagsBySession, getActiveTagsBySession, getTailHygieneTags, getDroppedTagsBySession, getTagsByNumbers, getDroppedTagsByNumbers, getMaxDroppedTagNumber, getTagById, getToolTagNumberByOwner, getNullOwnerToolTag, adoptNullOwnerToolTag, getCandidateToolOwners, pickNearestPriorOwner, isRawCompactionSummaryInfo, extractInMemoryMessageViews, buildInMemoryTailRawMessages, estimateTrueRawMessageTokens, invalidateTrueRawTokenCache, isTextPart, isToolPartWithOutput, isFilePart, buildFileSourceContent, assertExecutableToolInput, createDroppedInputToolExecuteBeforeHook, isEditTool, partHasCompletedResult, extractToolCallObservation, ToolMutationBatch, createToolDropTarget, setRawMessageProvider, cleanUserText, withRawSessionMessageCache, readRawSessionMessages, primeTailRawMessageCache, primeInMemoryTailRawMessageCache, readRawSessionMessageOrdinalPage, getRawSessionStoredMessageCount, readRawSessionMessagePartsById, readRawSessionMessageOrdinalById, readRawSessionMessageById, readSessionChunk, readRawSessionSeedTail, COMPARTMENT_LEASE_RENEWAL_MS, acquireCompartmentLease, renewCompartmentLease, releaseCompartmentLeaseBestEffort, HAS_COMPARTMENT_CONTENT_SQL, getCompartments, getLastCompartmentEndMessage, getLastCompartmentEndMessageId, clearRecompStaging, getMessageIndexSourceIdentity, isMessageIndexSourceCurrent, getLastIndexedOrdinal, getIndexedMessageCorpusSize, getMessageIndexReconciliationStartOrdinal, isMessageIndexReconciledThrough, deleteIndexedMessage, clearIndexedMessages, indexSingleMessage, indexMessagesAfterOrdinal, sweepOrphanedOpenCodeMessageIndexes, recordEmbeddingMeasurement, getMaxM0MutationId, queueMemoryMutation, getMemoryMutationsForRenderByProjects, getMaxMemoryMutationIdForProjects, MAX_EXECUTE_THRESHOLD, escalationBands, MERGED_REASONING_PARTS_PREFIX, readFrozenMergedReasoningParts, getProtectionWindowForSession, isEmergencyRecoveryArmed, isProviderOverflowReconfirmed, isProviderOverflowFailClosedProven, getEmergencyRecoveryArmedAt, loadPersistedUsage, loadProtectedTailMeta, resetProtectedTailNoEligibleHead, getWrapupInProgressState, acquireWrapupInProgress, updateWrapupInProgress, releaseWrapupInProgress, resolveCompactionModeRecord, getCompactionModeRecord, setCompactionModeRecord, getPersistedReasoningWatermark, setPersistedReasoningWatermark, clearPersistedReasoningWatermark, getEmergencyInputSample, setEmergencyDropSample, clearEmergencyDropSample, getLastNudgeUndropped, setLastNudgeUndropped, getChannel1NudgeState, setChannel1NudgeState, markChannel1PostReduceGracePending, captureChannel1PostReduceGraceBaseline, getChannel2NudgeState, getChannel2NudgeClaim, setChannel2NudgeState, casChannel2NudgeState, claimChannel2NudgeState, casChannel2NudgeClaim, getPersistedNoteNudge, getNoteNudgeAnchors, getAutoSearchHintDecisions, appendAutoSearchHintDecision, pruneNoteNudgeAnchors, pruneAutoSearchHintDecisions, removeNoteNudgeAnchorByMessageId, removeAutoSearchHintDecisionByMessageId, getPersistedTodoPermissionDenied, setPersistedTodoPermissionDenied, getPersistedTodoSyntheticAnchor, setPersistedTodoSyntheticAnchor, clearPersistedTodoSyntheticAnchor, setNoteLastReadAt, getHistorianFailureState, clearHistorianFailureState, getOverflowState, loadTransformPassStateSnapshot, recordOverflowDetected, recordDetectedContextLimit, clearEmergencyRecovery, clearDetectedContextLimit, getPersistedCompactionMarkerState, setPersistedCompactionMarkerState, getDeferredClearedCompactionMarkerState, retireDeferredClearedCompactionMarkerState, getStrippedPlaceholderIds, applyStrippedPlaceholderDelta, removeStrippedPlaceholderId, NEWEST_REASONING_BEARING_ASSISTANT, THINKING_BINDING_RECOVERY_FROZEN_PREFIX, thinkingBindingRecoveryFrozenId, getThinkingBindingRecoveryTarget, armThinkingBindingRecovery, clearThinkingBindingRecoveryIf, getMergedReasoningStrippedIds, addMergedReasoningStrippedIds, getTrailingBlankDecisions, addTrailingBlankDecisions, demoteTrailingBlankKeepDecisions, getStaleReduceStrippedIds, addStaleReduceStrippedIds, getProcessedImageStrippedIds, addProcessedImageStrippedIds, getPendingCompactionMarkerState, loadPostprocessReplaySnapshot, setPendingCompactionMarkerState, clearPendingCompactionMarkerStateIf, getSessionsWithPendingMarker, setSessionWorkMetrics, getObservedEpochFloor, resolveEpochFloorForPass, getNotes, addNote, getSessionNotes, getPendingSmartNotes, getReadySmartNotes, updateNote, dismissNotes, dismissNote, markNoteReady, markNoteChecked, queuePendingOp, getPendingOps, getPendingOpsCount, clearPendingOps, removePendingOp, PRIMER_CANDIDATE_TTL_MS, PRIMER_CANDIDATE_MAX_AGE_MS, primerOccurrenceKey, primerOccurrenceUtcDay, updatePrimerCandidateEmbedding, getPrimerCandidatesByIds, getPrimerCandidatesForPromotion, countPrimerCandidatesForProject, getActivePrimers, createPrimer, updatePrimerSupport, updatePrimerAnswer, GLOBAL_USER_PROFILE_PROJECT_PATH, getProjectState, bumpProjectMemoryEpoch, bumpProjectUserProfileVersion, saveSourceContent, replaceSourceContent, getSourceContents, createChildSessionWithFence, HiddenCompletionRefusal, detectThinkingBindingMismatch, isFable51ThinkingBindingModel, detectOverflow, modelBodyField, toModelEntry, getPromptFailureDetail, promptSyncWithValidatedOutputRetry, normalizeSDKResponse, promptSurfaceHashMaterial, createPromptSurfaceRuntime, createPromptSurfaceGuidanceEpochCache, extractLatestAssistantText, hasLengthCappedOutput, setKeepSubagents, teardownChildSession, renderUserFacingFailure, userFacingFailureCode, renderCapabilityRefusal, capabilityRefusalCode, renderDreamFailure, dreamFailureCode, renderEmbeddingFailure, getCompartmentEvents, SYNAPSE_DEFAULT_MODEL, toSynapseLaneDescriptor, formatSynapseLaneDescriptor, SynapseEmbeddingProvider, loadCompartmentChunkEmbeddingsForSearch, cosineSimilarity, computeNormalizedHash, getLocalEmbeddingNativeMemoryStats, saveCommitEmbedding, loadProjectCommitEmbeddings, loadUnembeddedCommits, countEmbeddedCommits, upsertCommits, getLatestIndexedCommitTimeMs, enforceProjectCap, GIT_SWEEP_LEASE_RENEWAL_MS, acquireGitSweepLease, renewGitSweepLease, markGitSweepSuccessAndRelease, parkGitSweepNonIndexable, releaseGitSweepLease, saveEmbeddingIfHashMatches, getProjectEmbeddings, peekProjectEmbeddings, invalidateProject, invalidateMemory, describeShadowBackfillWriteRefusal, markProjectLoadUntrusted, contentSha256, sweepStaleEmbeddingIdentitiesForProject, registerProjectEmbedding, registerProjectShadowEmbedding, getShadowEmbeddingMeasurementCohort, getPrimaryEmbeddingMeasurementCohort, embedShadowTextForProject, enqueueShadowEmbeddingItems, registerProjectInObservationMode, getProjectEmbeddingSnapshot, embedTextForProject, embedBatchForProject, embedItemsForProject, embedUnembeddedMemoriesForProject, drainCommitBacklogForProject, embedSessionCompartmentChunks, getEmbeddingCoverageStatus, isEmbeddingEnabled, embedText, ensureMemoryEmbeddings, computeCueContentHash, hasMuralCueColumns, getMuralCueState, memoryNeedsCue, setMuralCue, recordMuralCueRejection, hasMemoryShareableColumn, hasMemoryClassifiedAtColumn, getUnclassifiedMemoryIds, ModuleMemoryAuthorityError, insertMemory, insertMemoryIdempotent, getMemoryByHash, getMemoriesByProject, buildWorkspaceMemorySqlFilter, getMemoriesByProjects, getMaxMemoryIdForProjects, readNewMemoriesForM1Union, getMemoryById, getMemoriesByIds, updateMemorySeenCount, updateMemoryRetrievalCount, setMemoryClassification, supersededMemory, mergeMemoryStats, archiveMemory, getMemoryCountsByStatus, sanitizeFtsQuery, searchMemoriesFTS, searchMemoriesFTSUnion, recordMemoryMapping, recordMemoryVerifications, getUnmappedMemoryIds, clearMemoryVerifications, getMemoryVerifications, resolveGitTopLevel, readGitHead, readGitChangedFilesSince, readGitFileChangeTimesSince, verificationFileExists, normalizeVerificationFiles, recordChildInvocation, createV1HiddenCompletionExecutor, USER_MEMORY_CANDIDATE_TTL_MS, insertUserMemoryCandidates, getUserMemoryCandidates, deleteUserMemoryCandidates, pruneExpiredUserMemoryCandidates, insertUserMemory, getActiveUserMemories, updateUserMemoryContent, dismissUserMemory, getMural, BoundedSessionMap, registerLkgPersistence, beginLkgPass, visitMessageContentFields, messageContentFields, signatureForFields, exactReusablePrefix, incrementalLkgContentDigests, lkgContentDigest, captureSlot, getInMemorySlot, getSlot, dropSlot, noteEntry, getLkgSlotHeapStats, onNoteTrigger, peekNoteNudgeText, markNoteNudgeDelivered, clearNoteNudgeTriggerAndCooldown, resetNoteNudgeCooldownOnly, clearNoteNudgeTriggerOnly, getOpenCodeDbPath, removeMcOwnedCompactionMarkers, MARKER_SUMMARY_TEXT, applyDeferredCompactionMarker, removeCompactionMarkerForSession, checkCompactionMarkerConsistency, modelKeyAcceptsImages, resolveMuralWire, extractM0Block, formatDate, injectTemporalMarkers, clearInjectionCache, getVisibleMemoryIds, selectHiddenMessagesAtCompactionSeam, prepareCompartmentInjection, renderCompartmentInjection, mustMaterialize, trimMemoriesToBudgetV2, renderMemoryBlockV2, materializeM0, prepareCachedM0M1Replay, hasCompleteCachedM0M1, injectM0M1, describeBoundaryDiagnostics, RECOVERY_NO_HEAD_LIMIT, resolveOpenCodeProtectedTailBoundary, resolveWrapupProtectedTailBoundary, getRawHistoryEligibility, hasRunnableCompartmentWindow, recordHighPressureNoEligibleHead, runCompartmentAgent, snapRangeToCompartments, getActiveCompartmentRun, markActiveCompartmentRunPublished, registerActiveCompartmentRun, startCompartmentAgent, setRecompStarting2, setRecompTerminal2, runManagedRecomp2, runManagedUpgrade2 };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  log
3
- } from "./index-dkv2dn46.js";
3
+ } from "./index-qp20p2py.js";
4
4
 
5
5
  // src/shared/opencode-db-path.ts
6
6
  import { existsSync, readdirSync, statSync } from "node:fs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getMagicContextStorageDir
3
- } from "./index-3fe78beq.js";
3
+ } from "./index-4ftb5hcq.js";
4
4
 
5
5
  // src/shared/announcement.ts
6
6
  import * as fs from "node:fs";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  sessionLog
3
- } from "./index-dkv2dn46.js";
3
+ } from "./index-qp20p2py.js";
4
4
  import {
5
5
  shouldHoldIgnoredNotification
6
- } from "./index-z8552w7e.js";
6
+ } from "./index-jkrqhc7y.js";
7
7
 
8
8
  // src/shared/error-message.ts
9
9
  function getErrorMessage(error) {
@@ -183,7 +183,7 @@ async function sendIgnoredMessageNow(client, sessionId, text, params, forcePersi
183
183
  holdIgnoredNotification({ client, sessionId, text, params, forcePersist }, "during target checks");
184
184
  return "queued";
185
185
  }
186
- const { waitForSafeNotificationTarget } = await import("./safe-notification-target-q9z81zt3.js");
186
+ const { waitForSafeNotificationTarget } = await import("./safe-notification-target-fepvcbsj.js");
187
187
  if (await waitForSafeNotificationTarget(client, sessionId) === "skip") {
188
188
  sessionLog(sessionId, "notification skipped (session not titled yet)");
189
189
  return "skipped";