@retaw106/mmc-oc 2.2.1 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (285) hide show
  1. package/dist/cli.js +14 -3
  2. package/dist/config/deprecated-config.d.ts +4 -0
  3. package/dist/config/deprecated-config.d.ts.map +1 -0
  4. package/dist/config/index.d.ts.map +1 -1
  5. package/dist/config/project-security.d.ts +2 -2
  6. package/dist/config/schema/magic-context.d.ts +36 -3
  7. package/dist/config/schema/magic-context.d.ts.map +1 -1
  8. package/dist/config-init.js +14 -3
  9. package/dist/{context-mrvm92n8.js → context-c72brxe5.js} +2410 -1801
  10. package/dist/{derive-budgets-rjjz5f7y.js → derive-budgets-s1p37t2g.js} +2 -2
  11. package/dist/features/magic-context/compaction-marker.d.ts.map +1 -1
  12. package/dist/features/magic-context/historian-failure-reason.d.ts +7 -0
  13. package/dist/features/magic-context/historian-failure-reason.d.ts.map +1 -0
  14. package/dist/features/magic-context/memory-maintainer/launcher.d.ts +13 -4
  15. package/dist/features/magic-context/memory-maintainer/launcher.d.ts.map +1 -1
  16. package/dist/features/magic-context/memory-maintainer/manual-commands.d.ts.map +1 -1
  17. package/dist/features/magic-context/memory-maintainer/model-chain.d.ts +47 -0
  18. package/dist/features/magic-context/memory-maintainer/model-chain.d.ts.map +1 -0
  19. package/dist/features/magic-context/memory-maintainer/oc2-adapter.d.ts +17 -4
  20. package/dist/features/magic-context/memory-maintainer/oc2-adapter.d.ts.map +1 -1
  21. package/dist/features/magic-context/memory-maintainer/pipeline.d.ts +6 -0
  22. package/dist/features/magic-context/memory-maintainer/pipeline.d.ts.map +1 -1
  23. package/dist/features/magic-context/message-index-async.d.ts +21 -3
  24. package/dist/features/magic-context/message-index-async.d.ts.map +1 -1
  25. package/dist/features/magic-context/message-index.d.ts +7 -1
  26. package/dist/features/magic-context/message-index.d.ts.map +1 -1
  27. package/dist/features/magic-context/migrations.d.ts.map +1 -1
  28. package/dist/features/magic-context/pi-content-decisions.d.ts +7 -1
  29. package/dist/features/magic-context/pi-content-decisions.d.ts.map +1 -1
  30. package/dist/features/magic-context/search.d.ts +29 -0
  31. package/dist/features/magic-context/search.d.ts.map +1 -1
  32. package/dist/features/magic-context/storage-clone.d.ts +2 -0
  33. package/dist/features/magic-context/storage-clone.d.ts.map +1 -1
  34. package/dist/features/magic-context/storage-compartment-history-version.d.ts +4 -0
  35. package/dist/features/magic-context/storage-compartment-history-version.d.ts.map +1 -0
  36. package/dist/features/magic-context/storage-db.d.ts +1 -1
  37. package/dist/features/magic-context/storage-db.d.ts.map +1 -1
  38. package/dist/features/magic-context/storage-historian-runs.d.ts.map +1 -1
  39. package/dist/features/magic-context/storage-meta-persisted.d.ts +23 -5
  40. package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -1
  41. package/dist/features/magic-context/storage-meta-session.d.ts +7 -1
  42. package/dist/features/magic-context/storage-meta-session.d.ts.map +1 -1
  43. package/dist/features/magic-context/storage-session-tables.d.ts +5 -1
  44. package/dist/features/magic-context/storage-session-tables.d.ts.map +1 -1
  45. package/dist/features/magic-context/storage-tag-identity-revision.d.ts +50 -0
  46. package/dist/features/magic-context/storage-tag-identity-revision.d.ts.map +1 -0
  47. package/dist/features/magic-context/storage-tags.d.ts +159 -5
  48. package/dist/features/magic-context/storage-tags.d.ts.map +1 -1
  49. package/dist/features/magic-context/tagger.d.ts +2 -0
  50. package/dist/features/magic-context/tagger.d.ts.map +1 -1
  51. package/dist/features/magic-context/transform-decision-log.d.ts +60 -2
  52. package/dist/features/magic-context/transform-decision-log.d.ts.map +1 -1
  53. package/dist/hooks/magic-context/__fixtures__/tail-hygiene-refresh.d.ts +34 -0
  54. package/dist/hooks/magic-context/__fixtures__/tail-hygiene-refresh.d.ts.map +1 -0
  55. package/dist/hooks/magic-context/active-anthropic-turn.d.ts +2 -0
  56. package/dist/hooks/magic-context/active-anthropic-turn.d.ts.map +1 -1
  57. package/dist/hooks/magic-context/apply-operations.d.ts +10 -1
  58. package/dist/hooks/magic-context/apply-operations.d.ts.map +1 -1
  59. package/dist/hooks/magic-context/auto-search-runner.d.ts +2 -2
  60. package/dist/hooks/magic-context/auto-search-runner.d.ts.map +1 -1
  61. package/dist/hooks/magic-context/compartment-runner-types.d.ts +2 -2
  62. package/dist/hooks/magic-context/compartment-runner-types.d.ts.map +1 -1
  63. package/dist/hooks/magic-context/compartment-runner.d.ts +4 -0
  64. package/dist/hooks/magic-context/compartment-runner.d.ts.map +1 -1
  65. package/dist/hooks/magic-context/compartment-trigger-error.d.ts +11 -0
  66. package/dist/hooks/magic-context/compartment-trigger-error.d.ts.map +1 -0
  67. package/dist/hooks/magic-context/compartment-trigger.d.ts +1 -1
  68. package/dist/hooks/magic-context/compartment-trigger.d.ts.map +1 -1
  69. package/dist/hooks/magic-context/ctx-reduce-nudge.d.ts +1 -0
  70. package/dist/hooks/magic-context/ctx-reduce-nudge.d.ts.map +1 -1
  71. package/dist/hooks/magic-context/degraded-pass-refusal.d.ts +2 -0
  72. package/dist/hooks/magic-context/degraded-pass-refusal.d.ts.map +1 -1
  73. package/dist/hooks/magic-context/edit-marker.d.ts +2 -0
  74. package/dist/hooks/magic-context/edit-marker.d.ts.map +1 -1
  75. package/dist/hooks/magic-context/final-wire-token-estimate.d.ts +2 -0
  76. package/dist/hooks/magic-context/final-wire-token-estimate.d.ts.map +1 -1
  77. package/dist/hooks/magic-context/heuristic-cleanup.d.ts.map +1 -1
  78. package/dist/hooks/magic-context/history-boundary-repair.d.ts +11 -2
  79. package/dist/hooks/magic-context/history-boundary-repair.d.ts.map +1 -1
  80. package/dist/hooks/magic-context/hook-handlers.d.ts.map +1 -1
  81. package/dist/hooks/magic-context/lkg-measured-request.d.ts +3 -1
  82. package/dist/hooks/magic-context/lkg-measured-request.d.ts.map +1 -1
  83. package/dist/hooks/magic-context/lkg-persist.d.ts +10 -13
  84. package/dist/hooks/magic-context/lkg-persist.d.ts.map +1 -1
  85. package/dist/hooks/magic-context/lkg-recovery-fence.d.ts +62 -0
  86. package/dist/hooks/magic-context/lkg-recovery-fence.d.ts.map +1 -0
  87. package/dist/hooks/magic-context/lkg-recovery-prefix.d.ts +38 -0
  88. package/dist/hooks/magic-context/lkg-recovery-prefix.d.ts.map +1 -0
  89. package/dist/hooks/magic-context/lkg-replay.d.ts +16 -9
  90. package/dist/hooks/magic-context/lkg-replay.d.ts.map +1 -1
  91. package/dist/hooks/magic-context/lkg-slot.d.ts +141 -2
  92. package/dist/hooks/magic-context/lkg-slot.d.ts.map +1 -1
  93. package/dist/hooks/magic-context/opaque-thinking.d.ts +12 -0
  94. package/dist/hooks/magic-context/opaque-thinking.d.ts.map +1 -0
  95. package/dist/hooks/magic-context/pass-outcome.d.ts +1 -0
  96. package/dist/hooks/magic-context/pass-outcome.d.ts.map +1 -1
  97. package/dist/hooks/magic-context/pending-drop-eligibility.d.ts +14 -0
  98. package/dist/hooks/magic-context/pending-drop-eligibility.d.ts.map +1 -0
  99. package/dist/hooks/magic-context/pending-materialization.d.ts +10 -0
  100. package/dist/hooks/magic-context/pending-materialization.d.ts.map +1 -0
  101. package/dist/hooks/magic-context/postprocess-read-cache.d.ts.map +1 -1
  102. package/dist/hooks/magic-context/provider-visible-parts.d.ts +51 -0
  103. package/dist/hooks/magic-context/provider-visible-parts.d.ts.map +1 -0
  104. package/dist/hooks/magic-context/read-session-chunk.d.ts +22 -1
  105. package/dist/hooks/magic-context/read-session-chunk.d.ts.map +1 -1
  106. package/dist/hooks/magic-context/read-session-db.d.ts +3 -0
  107. package/dist/hooks/magic-context/read-session-db.d.ts.map +1 -1
  108. package/dist/hooks/magic-context/read-session-formatting.d.ts +5 -0
  109. package/dist/hooks/magic-context/read-session-formatting.d.ts.map +1 -1
  110. package/dist/hooks/magic-context/read-session-raw.d.ts +123 -1
  111. package/dist/hooks/magic-context/read-session-raw.d.ts.map +1 -1
  112. package/dist/hooks/magic-context/read-session-true-raw-tokens.d.ts.map +1 -1
  113. package/dist/hooks/magic-context/reasoning-budget.d.ts.map +1 -1
  114. package/dist/hooks/magic-context/render-options.d.ts +19 -0
  115. package/dist/hooks/magic-context/render-options.d.ts.map +1 -0
  116. package/dist/hooks/magic-context/sentinel.d.ts +41 -1
  117. package/dist/hooks/magic-context/sentinel.d.ts.map +1 -1
  118. package/dist/hooks/magic-context/strict-thinking-prefix.d.ts +8 -0
  119. package/dist/hooks/magic-context/strict-thinking-prefix.d.ts.map +1 -0
  120. package/dist/hooks/magic-context/strip-content.d.ts +38 -24
  121. package/dist/hooks/magic-context/strip-content.d.ts.map +1 -1
  122. package/dist/hooks/magic-context/supersession-reclaim.d.ts +5 -3
  123. package/dist/hooks/magic-context/supersession-reclaim.d.ts.map +1 -1
  124. package/dist/hooks/magic-context/system-date-refresh.d.ts +29 -0
  125. package/dist/hooks/magic-context/system-date-refresh.d.ts.map +1 -0
  126. package/dist/hooks/magic-context/system-prompt-dates.d.ts +6 -0
  127. package/dist/hooks/magic-context/system-prompt-dates.d.ts.map +1 -0
  128. package/dist/hooks/magic-context/system-prompt-delivery.d.ts +47 -0
  129. package/dist/hooks/magic-context/system-prompt-delivery.d.ts.map +1 -0
  130. package/dist/hooks/magic-context/system-prompt-hash.d.ts +18 -5
  131. package/dist/hooks/magic-context/system-prompt-hash.d.ts.map +1 -1
  132. package/dist/hooks/magic-context/tag-messages.d.ts +19 -0
  133. package/dist/hooks/magic-context/tag-messages.d.ts.map +1 -1
  134. package/dist/hooks/magic-context/tag-owner-warmup.d.ts +14 -0
  135. package/dist/hooks/magic-context/tag-owner-warmup.d.ts.map +1 -0
  136. package/dist/hooks/magic-context/tail-hygiene-output-count.d.ts +18 -0
  137. package/dist/hooks/magic-context/tail-hygiene-output-count.d.ts.map +1 -0
  138. package/dist/hooks/magic-context/tail-hygiene-walk.d.ts +8 -4
  139. package/dist/hooks/magic-context/tail-hygiene-walk.d.ts.map +1 -1
  140. package/dist/hooks/magic-context/token-count-exact.d.ts +35 -0
  141. package/dist/hooks/magic-context/token-count-exact.d.ts.map +1 -0
  142. package/dist/hooks/magic-context/tool-drop-target.d.ts +2 -0
  143. package/dist/hooks/magic-context/tool-drop-target.d.ts.map +1 -1
  144. package/dist/hooks/magic-context/tool-reclaim.d.ts +5 -2
  145. package/dist/hooks/magic-context/tool-reclaim.d.ts.map +1 -1
  146. package/dist/hooks/magic-context/transform-compartment-phase.d.ts.map +1 -1
  147. package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +9 -0
  148. package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
  149. package/dist/hooks/magic-context/transform.d.ts +21 -11
  150. package/dist/hooks/magic-context/transform.d.ts.map +1 -1
  151. package/dist/hooks/magic-context/unresolved-history-boundary.d.ts +5 -1
  152. package/dist/hooks/magic-context/unresolved-history-boundary.d.ts.map +1 -1
  153. package/dist/{index-g2z2k5m4.js → index-27ddyx39.js} +2 -2
  154. package/dist/{index-btp5tdc8.js → index-48e9znrc.js} +1248 -570
  155. package/dist/{index-5cep2r9n.js → index-5ty9rnbx.js} +60 -258
  156. package/dist/{index-z2g20msd.js → index-azbmnekv.js} +4 -4
  157. package/dist/{index-1j34a56j.js → index-dwh99z66.js} +293 -36
  158. package/dist/{index-qbkzdkk0.js → index-k59af64t.js} +6 -2
  159. package/dist/{index-5b7x80ec.js → index-kahkxcqw.js} +12532 -10348
  160. package/dist/{index-53g38ggt.js → index-kmbme1v1.js} +1 -1
  161. package/dist/{index-amycb7b1.js → index-r7s7d350.js} +3 -3
  162. package/dist/{index-33gprt9g.js → index-yjv8dpht.js} +1 -1
  163. package/dist/index-ykq24x1n.js +1477 -0
  164. package/dist/index.d.ts.map +1 -1
  165. package/dist/index.js +114 -2
  166. package/dist/{message-time-backfill-phrwp2fz.js → message-time-backfill-j96x1sab.js} +3 -3
  167. package/dist/model-resolution-cvyrrcjw.js +8 -0
  168. package/dist/plugin/rpc-handlers.d.ts.map +1 -1
  169. package/dist/{read-session-chunk-2xm4sc4y.js → read-session-chunk-t8bg6wkz.js} +6 -4
  170. package/dist/recomp-orchestrator-k760qy1n.js +21 -0
  171. package/dist/{safe-notification-target-ph3xd1ve.js → safe-notification-target-1jkf0m82.js} +2 -2
  172. package/dist/{send-session-notification-rnc4nrsr.js → send-session-notification-njjf3b4s.js} +5 -5
  173. package/dist/shared/auto-search-lifecycle.d.ts +14 -0
  174. package/dist/shared/auto-search-lifecycle.d.ts.map +1 -1
  175. package/dist/shared/logger.d.ts.map +1 -1
  176. package/dist/shared/model-suggestion-retry.d.ts +21 -0
  177. package/dist/shared/model-suggestion-retry.d.ts.map +1 -1
  178. package/dist/shared/models-dev-cache.d.ts.map +1 -1
  179. package/dist/shared/models-dev-temperature.d.ts +18 -0
  180. package/dist/shared/models-dev-temperature.d.ts.map +1 -0
  181. package/dist/shared/processed-image-eligibility.d.ts +22 -0
  182. package/dist/shared/processed-image-eligibility.d.ts.map +1 -0
  183. package/dist/shared/project-directory-key.d.ts +16 -0
  184. package/dist/shared/project-directory-key.d.ts.map +1 -1
  185. package/dist/shared/prompt-surface-runtime.d.ts +5 -0
  186. package/dist/shared/prompt-surface-runtime.d.ts.map +1 -1
  187. package/dist/shared/reclaim-distance.d.ts +33 -0
  188. package/dist/shared/reclaim-distance.d.ts.map +1 -0
  189. package/dist/shared/recovery-reasoning-prefix.d.ts +9 -0
  190. package/dist/shared/recovery-reasoning-prefix.d.ts.map +1 -0
  191. package/dist/shared/sqlite.d.ts +35 -1
  192. package/dist/shared/sqlite.d.ts.map +1 -1
  193. package/dist/shared/stable-json.d.ts +7 -0
  194. package/dist/shared/stable-json.d.ts.map +1 -1
  195. package/dist/shared/storage-file-mutex.d.ts +9 -0
  196. package/dist/shared/storage-file-mutex.d.ts.map +1 -0
  197. package/dist/shared/storage-permissions.d.ts +6 -0
  198. package/dist/shared/storage-permissions.d.ts.map +1 -1
  199. package/dist/shared/subagent-temperature.d.ts +46 -0
  200. package/dist/shared/subagent-temperature.d.ts.map +1 -0
  201. package/dist/shared/tag-owner-id.d.ts +1 -0
  202. package/dist/shared/tag-owner-id.d.ts.map +1 -1
  203. package/dist/shared/tag-transcript.d.ts +9 -0
  204. package/dist/shared/tag-transcript.d.ts.map +1 -1
  205. package/dist/shared/tail-hygiene-json.d.ts +22 -0
  206. package/dist/shared/tail-hygiene-json.d.ts.map +1 -0
  207. package/dist/shared/user-facing-codes.d.ts +2 -2
  208. package/dist/shared/window-geometry.d.ts +9 -66
  209. package/dist/shared/window-geometry.d.ts.map +1 -1
  210. package/dist/standalone-plugin-marker.d.ts +8 -0
  211. package/dist/standalone-plugin-marker.d.ts.map +1 -0
  212. package/dist/tools/ctx-expand/search-archive.d.ts +4 -0
  213. package/dist/tools/ctx-expand/search-archive.d.ts.map +1 -0
  214. package/dist/tools/ctx-expand/tools.d.ts.map +1 -1
  215. package/dist/tools/ctx-reduce/constants.d.ts +1 -2
  216. package/dist/tools/ctx-reduce/constants.d.ts.map +1 -1
  217. package/dist/tools/ctx-reduce/tools.d.ts +1 -1
  218. package/dist/tools/ctx-reduce/tools.d.ts.map +1 -1
  219. package/dist/v2/hidden-completion.d.ts +20 -1
  220. package/dist/v2/hidden-completion.d.ts.map +1 -1
  221. package/dist/v2/hooks/context.d.ts +1 -1
  222. package/dist/v2/hooks/context.d.ts.map +1 -1
  223. package/dist/v2/hooks/copied-tag-notation.d.ts +19 -0
  224. package/dist/v2/hooks/copied-tag-notation.d.ts.map +1 -0
  225. package/dist/v2/hooks/generate.d.ts +9 -2
  226. package/dist/v2/hooks/generate.d.ts.map +1 -1
  227. package/dist/v2/hooks/hidden-child.d.ts +22 -1
  228. package/dist/v2/hooks/hidden-child.d.ts.map +1 -1
  229. package/dist/v2/hooks/payload.d.ts.map +1 -1
  230. package/dist/v2/hooks/system-prompt-response.d.ts +5 -0
  231. package/dist/v2/hooks/system-prompt-response.d.ts.map +1 -0
  232. package/dist/v2/server.d.ts.map +1 -1
  233. package/dist/v2/server.js +26593 -21940
  234. package/dist/v2/store-reader.d.ts +27 -1
  235. package/dist/v2/store-reader.d.ts.map +1 -1
  236. package/dist/web/main.js +401 -23
  237. package/dist/{wrapup-orchestrator-yknks3ad.js → wrapup-orchestrator-b2gswatj.js} +10 -10
  238. package/package.json +1 -1
  239. package/src/config/deprecated-config.ts +18 -0
  240. package/src/config/index.test.ts +13 -37
  241. package/src/config/index.ts +2 -2
  242. package/src/config/latch-permanence-guard.test.ts +4 -0
  243. package/src/config/project-security.test.ts +17 -0
  244. package/src/config/project-security.ts +3 -3
  245. package/src/config/schema/magic-context.test.ts +50 -0
  246. package/src/config/schema/magic-context.ts +44 -7
  247. package/src/shared/auto-search-lifecycle.ts +43 -0
  248. package/src/shared/logger.ts +10 -2
  249. package/src/shared/model-suggestion-retry.ts +5 -1
  250. package/src/shared/models-dev-cache.ts +1 -7
  251. package/src/shared/models-dev-temperature.ts +107 -0
  252. package/src/shared/processed-image-eligibility.test.ts +68 -0
  253. package/src/shared/processed-image-eligibility.ts +41 -0
  254. package/src/shared/processed-image-position-review.json +20 -0
  255. package/src/shared/processed-image-position-review.test.ts +19 -0
  256. package/src/shared/project-directory-key.ts +20 -0
  257. package/src/shared/prompt-surface-runtime.ts +12 -0
  258. package/src/shared/reclaim-distance.test.ts +111 -0
  259. package/src/shared/reclaim-distance.ts +91 -0
  260. package/src/shared/recovery-reasoning-prefix.test.ts +34 -0
  261. package/src/shared/recovery-reasoning-prefix.ts +35 -0
  262. package/src/shared/root-async-context.probe.mjs +36 -0
  263. package/src/shared/root-async-context.test.ts +49 -0
  264. package/src/shared/sqlite-acquisition-routing.test.ts +4 -3
  265. package/src/shared/sqlite-busy-budget-review.test.ts +291 -0
  266. package/src/shared/sqlite-foreground-wait.test.ts +304 -0
  267. package/src/shared/sqlite-pass-scope.test.ts +4 -4
  268. package/src/shared/sqlite-writer-diagnostics.test.ts +52 -12
  269. package/src/shared/sqlite.ts +428 -46
  270. package/src/shared/stable-json.ts +79 -7
  271. package/src/shared/storage-file-mutex.test.ts +50 -0
  272. package/src/shared/storage-file-mutex.ts +130 -0
  273. package/src/shared/storage-permissions.ts +46 -0
  274. package/src/shared/subagent-temperature.ts +110 -0
  275. package/src/shared/tag-owner-id.ts +13 -0
  276. package/src/shared/tag-transcript.ts +118 -0
  277. package/src/shared/tail-hygiene-json.test.ts +117 -0
  278. package/src/shared/tail-hygiene-json.ts +217 -0
  279. package/src/shared/user-facing-codes.ts +2 -2
  280. package/src/shared/window-geometry.test.ts +102 -236
  281. package/src/shared/window-geometry.ts +23 -413
  282. package/dist/index-ramz5kkm.js +0 -514
  283. package/dist/model-resolution-wazv26n0.js +0 -6
  284. package/dist/recomp-orchestrator-frmwj9hz.js +0 -21
  285. package/src/shared/__fixtures__/window-overlay.v1.json +0 -337
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Lamport's bakery mutex using unique contender files on a local filesystem.
3
+ * Exclusive creation and atomic replacement work on POSIX and Windows. A dead
4
+ * owner is removed by PID/start-time evidence, never by age: a paused live
5
+ * publisher must not lose its lock. Uncertain liveness refuses after the budget.
6
+ * Unique names mean reclaiming a dead ticket cannot unlink a successor's lock.
7
+ */
8
+ export declare function withStorageFileMutex<T>(directory: string, work: () => T, timeoutMs?: number): T;
9
+ //# sourceMappingURL=storage-file-mutex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage-file-mutex.d.ts","sourceRoot":"","sources":["../../src/shared/storage-file-mutex.ts"],"names":[],"mappings":"AAuDA;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,SAAS,SAAO,GAAG,CAAC,CAmE7F"}
@@ -6,6 +6,8 @@ export declare function shouldEnforcePrivateStoragePermissions(): boolean;
6
6
  export declare function __resetStoragePrivatePermissionEnforcementForTests(): void;
7
7
  /** Create storage directories with owner-only permissions at their creation. */
8
8
  export declare function ensureStorageDirectorySync(directory: string, forcePrivate?: boolean, recursive?: boolean): void;
9
+ /** Replay-authorizing files require a private real directory, even after a permissive restore. */
10
+ export declare function ensurePrivateStorageDirectorySync(directory: string): void;
9
11
  /** Create or replace a storage file using a private mode from the first byte. */
10
12
  export declare function writeStorageFileSync(filePath: string, content: string | Uint8Array, options?: {
11
13
  encoding?: BufferEncoding;
@@ -14,6 +16,10 @@ export declare function writeStorageFileSync(filePath: string, content: string |
14
16
  }): void;
15
17
  /** Write a private sibling then atomically publish it without a permissive temp window. */
16
18
  export declare function writeStorageFileAtomicSync(filePath: string, content: string | Uint8Array, forcePrivate?: boolean): void;
19
+ /** Flush the namespace containing a safety-critical sidecar (POSIX only). */
20
+ export declare function syncStorageDirectorySync(directory: string): void;
21
+ /** Publish a safety record only after both its bytes and directory entry are durable. */
22
+ export declare function writeStorageFileDurableAtomicSync(filePath: string, content: string, afterTempSync?: () => void): void;
17
23
  export declare function copyStorageFileSync(sourcePath: string, destinationPath: string, forcePrivate?: boolean): void;
18
24
  export declare function copyStorageTreeSync(sourcePath: string, destinationPath: string, forcePrivate?: boolean): void;
19
25
  export declare function openStorageFileSync(filePath: string, flags: string, forcePrivate?: boolean): number;
@@ -1 +1 @@
1
- {"version":3,"file":"storage-permissions.d.ts","sourceRoot":"","sources":["../../src/shared/storage-permissions.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAiB3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAMnD,wBAAgB,sCAAsC,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAE7E;AAED,wBAAgB,sCAAsC,IAAI,OAAO,CAEhE;AAED,wFAAwF;AACxF,wBAAgB,kDAAkD,IAAI,IAAI,CAEzE;AAED,gFAAgF;AAChF,wBAAgB,0BAA0B,CACtC,SAAS,EAAE,MAAM,EACjB,YAAY,UAAQ,EACpB,SAAS,UAAO,GACjB,IAAI,CAMN;AAED,iFAAiF;AACjF,wBAAgB,oBAAoB,CAChC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,GAAG,U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BN;AAED,wBAAgB,mBAAmB,CAC/B,UAAU,EAAE,MAAM,EAClB,eAAe,EAAE,MAAM,EACvB,YAAY,UAAQ,GACrB,IAAI,CAeN;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,UAAQ,GAAG,MAAM,CAIjG;AAED,wBAAsB,qBAAqB,CACvC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,GAAG,UAAU,EAC5B,YAAY,UAAQ,GACrB,OAAO,CAAC,IAAI,CAAC,CAIf;AAED,wBAAsB,2BAA2B,CAC7C,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC,CAEf;AAED,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,UAAQ,GAAG,WAAW,CAG5F;AAED,wBAAsB,4BAA4B,CAC9C,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,YAAY,UAAQ,uBAIvB;AAED,oFAAoF;AACpF,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAoC5F"}
@@ -0,0 +1,46 @@
1
+ export type TemperatureMetadata = {
2
+ temperature?: boolean;
3
+ capabilities?: {
4
+ temperature?: boolean;
5
+ };
6
+ compat?: {
7
+ supportsTemperature?: boolean;
8
+ supportsSamplingParams?: boolean;
9
+ };
10
+ };
11
+ export declare function temperatureCapability(metadata: unknown): boolean | undefined;
12
+ /**
13
+ * Where a temperature decision came from: the host's own model metadata, the models.dev
14
+ * catalog OpenCode caches on disk, or nothing (which omits temperature).
15
+ */
16
+ export type TemperatureSource = "host" | "catalog" | "none";
17
+ export interface TemperatureDecision {
18
+ supported: boolean | undefined;
19
+ source: TemperatureSource;
20
+ /** The models.dev entry (`provider/model`) when the catalog decided. */
21
+ entry?: string;
22
+ }
23
+ /**
24
+ * Host metadata wins whenever it states a boolean. Only when the host is silent do we
25
+ * consult the cached models.dev catalog, matched by provider and model id.
26
+ */
27
+ export declare function resolveTemperatureCapability(model: string, metadata: unknown): TemperatureDecision;
28
+ export declare function describeTemperatureDecision(model: string, decision: TemperatureDecision): string;
29
+ /** Log each model's decision once per process, and again only if the decision changes. */
30
+ export declare function logTemperatureDecision(model: string, decision: TemperatureDecision, log: (message: string, decision: TemperatureDecision) => void): void;
31
+ /** Only a positive capability permits sampling; reasoning alone is not evidence. */
32
+ export declare function subagentTemperature(model: string, metadata: unknown, temperature: number | undefined, log: (message: string, decision: TemperatureDecision) => void): number | undefined;
33
+ /** OpenCode 1 computes agent sampling before chat.params resolves the final model. */
34
+ export declare function applyHiddenSubagentTemperature(input: {
35
+ agent: string;
36
+ model?: TemperatureMetadata & {
37
+ providerID?: string;
38
+ id?: string;
39
+ };
40
+ }, output: {
41
+ temperature?: number;
42
+ }, log: (message: string) => void): void;
43
+ export declare const __temperatureTest: {
44
+ reset(): void;
45
+ };
46
+ //# sourceMappingURL=subagent-temperature.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subagent-temperature.d.ts","sourceRoot":"","sources":["../../src/shared/subagent-temperature.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,mBAAmB,GAAG;IAC9B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IACzC,MAAM,CAAC,EAAE;QAAE,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAAC,sBAAsB,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CAChF,CAAC;AAIF,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAS5E;AAED;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;AAE5D,M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
  */
13
13
  export declare const TEXT_TAG_IDENTITY_MARKER = ":mc-text-v1:";
14
+ export declare const PI_FALLBACK_PREFIXES_JSON: string;
14
15
  /**
15
16
  * The owning message id of a content tag id. An id with neither suffix is
16
17
  * returned unchanged: it already is the message id.
@@ -1 +1 @@
1
- {"version":3,"file":"tag-owner-id.d.ts","sourceRoot":"","sources":["../../src/shared/tag-owner-id.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,eAAO,MAAM,wBAAwB,iBAAiB,CAAC;AAKvD;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAMlE"}
1
+ {"version":3,"file":"tag-owner-id.d.ts","sourceRoot":"","sources":["../../src/shared/tag-owner-id.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,eAAO,MAAM,wBAAwB,iBAAiB,CAAC;AAKvD,eAAO,MAAM,yBAAyB,QAQrC,CAAC;AAKF;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAMlE"}
@@ -46,6 +46,7 @@
46
46
  */
47
47
  import type { ContextDatabase } from "../features/magic-context/storage";
48
48
  import { type Tagger } from "../features/magic-context/tagger";
49
+ import type { TagEntry } from "../features/magic-context/types";
49
50
  import type { TagTarget } from "../hooks/magic-context/tag-messages";
50
51
  import { TEXT_TAG_IDENTITY_MARKER } from "./tag-owner-id";
51
52
  import type { Transcript } from "./transcript";
@@ -99,5 +100,13 @@ export interface TagTranscriptOptions {
99
100
  export interface TagTranscriptResult {
100
101
  targets: Map<number, TagTarget>;
101
102
  }
103
+ /**
104
+ * Bind durable drops to a saved request without tagging it again. Recovery must
105
+ * not allocate identities, inject prefixes, or write accounting while the store
106
+ * is failing. Reuse the normal targets so persisted modes render identically.
107
+ */
108
+ export declare function buildPersistedDropTargets(transcript: Transcript, tags: readonly TagEntry[], options?: {
109
+ allowReasoningPrefixRewrite?: boolean;
110
+ }): Map<number, TagTarget>;
102
111
  export declare function tagTranscript(sessionId: string, transcript: Transcript, tagger: Tagger, db: ContextDatabase, options?: TagTranscriptOptions): TagTranscriptResult;
103
112
  //# sourceMappingURL=tag-transcript.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tag-transcript.d.ts","sourceRoot":"","sources":["../../src/shared/tag-transcript.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAQzE,OAAO,EAAwB,KAAK,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAWrF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAErE,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAqC,MAAM,cAAc,CAAC;AAGlF,OAAO,EAAE,wBAAwB,EAAE,CAAC;AAEpC,MAAM,WAAW,oBAAoB;IACjC;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;;;;;OAOG;IACH,2BAA2B,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1D;;;;OAIG;IACH,eAAe,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACtC;;;;;OAKG;IACH,2BAA2B,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAClD,wEAAwE;IACxE,uBAAuB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,gFAAgF;IAChF,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACnE,gFAAgF;IAChF,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE;QAAE,I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AAM,CAAC,CAAC;IACtC;;;;;OAKG;IACH,2BAA2B,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAClD,wEAAwE;IACxE,uBAAuB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,gFAAgF;IAChF,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACnE,gFAAgF;IAChF,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACnE,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,CACP,KAAK,EAAE,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,eAAe,EAC1D,SAAS,EAAE,MAAM,KAChB,IAAI,CAAC;CACb;AAED,MAAM,WAAW,mBAAmB;IAChC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CACnC;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CACrC,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,SAAS,QAAQ,EAAE,EACzB,OAAO,GAAE;IAAE,2BAA2B,CAAC,EAAE,OAAO,CAAA;CAAO,GACxD,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAyGxB;AAkGD,wBAAgB,aAAa,CACzB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,eAAe,EACnB,OAAO,GAAE,oBAAyB,GACnC,mBAAmB,CAqXrB"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * A bounded, process-local memo for individual parts and selected tool fields.
3
+ * Detached snapshots catch in-place host edits; reference equality alone cannot.
4
+ * Key collisions between sessions only evict entries, never imply equality.
5
+ */
6
+ export declare class TailHygieneJsonMemo {
7
+ private entries;
8
+ private bytes;
9
+ private passText;
10
+ private passHash;
11
+ beginPass(): void;
12
+ get(key: string, value: unknown, compute: () => string, fingerprint?: boolean): string;
13
+ }
14
+ /**
15
+ * Fingerprint excluded Pi content without retaining its whole JSON string.
16
+ * Match Pi's native JSON replacer: localeCompare key order, omitted undefined
17
+ * object fields, null array holes, and a marker for repeated non-array objects.
18
+ * Unsupported objects and array cycles use the original serializer; serialization
19
+ * errors produce the fingerprint of an empty string, as they did before.
20
+ */
21
+ export declare function piJsonHash(value: unknown, fallback: () => string): string;
22
+ //# sourceMappingURL=tail-hygiene-json.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tail-hygiene-json.d.ts","sourceRoot":"","sources":["../../src/shared/tail-hygiene-json.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,qBAAa,mBAAmB;IAC5B,OAAO,CAAC,OAAO,CAA2E;IAC1F,OAAO,CAAC,KAAK,CAAK;IAClB,OAAO,CAAC,QAAQ,CAAiC;IACjD,OAAO,CAAC,QAAQ,CAAiC;IAEjD,SAAS,IAAI,IAAI;IAKjB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,EAAE,WAAW,UAAQ,GAAG,MAAM;CAkCvF;AA+ED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,GAAG,MAAM,CA2EzE"}
@@ -16,8 +16,8 @@ export declare const USER_FACING_FAILURES: {
16
16
  };
17
17
  readonly history_boundary_unresolved: {
18
18
  readonly code: "MC-H04";
19
- readonly sentence: "This request was not sent: the message that marks where this session's history summary ends is missing from the OpenCode store, and without it the request is larger than the model's context window.";
20
- readonly action: "Run /mmc-recomp to rebuild the history summary.";
19
+ readonly sentence: "This request was not sent: Magic Context could not safely place the history summary boundary in the loaded conversation, and the untrimmed request is larger than the model's context window.";
20
+ readonly action: "Reopen this session in its current project directory, then run /mmc-recomp to rebuild the history summary. A model with a larger context window can also help.";
21
21
  };
22
22
  readonly history_over_window_unmanaged: {
23
23
  readonly code: "MC-H06";
@@ -1,5 +1,4 @@
1
1
  import type { ModelLimit } from "./models-dev-cache";
2
- export declare const WINDOW_OVERLAY_SCHEMA = "fusiform-window-overlay/v1";
3
2
  export declare const PROMPT_WALL_MARGIN = 4096;
4
3
  export declare const PI_OUTPUT_FLOOR = 4096;
5
4
  export declare const OPENCODE_OUTPUT_CAP = 32000;
@@ -14,47 +13,7 @@ export declare const OUTPUT_RESERVE_CAP_RATIO = 0.25;
14
13
  export declare function catalogOutputReserve(window: number, output: number | undefined): number;
15
14
  export type WindowGeometry = "shared_upfront" | "shared_truncating" | "separate";
16
15
  export type WindowReserveSource = "output_catalog" | "output_config" | "wall_margin" | "none";
17
- export type WindowOverlayGrade = "provider_asserted_runtime" | "measured" | "provider_asserted_doc" | "catalog" | "unknown";
18
- export type WindowOverlayUnits = "provider" | "estimate";
19
- export type WindowOverlayBoundary = "Observed" | "Asserted" | "Corrected";
20
- export type WindowOverlayUnknownWhy = "placeholder_output_equals_context" | "placeholder_zero" | "never_measured" | "not_single_valued_at_key" | "retracted";
21
- export type WindowOverlayFactValue = {
22
- kind: "stated";
23
- value: number | string;
24
- } | {
25
- kind: "bracket";
26
- at_least?: number;
27
- below?: number;
28
- } | {
29
- kind: "unknown";
30
- why: WindowOverlayUnknownWhy;
31
- };
32
- export interface WindowOverlayFact {
33
- value: WindowOverlayFactValue;
34
- grade: WindowOverlayGrade;
35
- units: WindowOverlayUnits;
36
- boundary: WindowOverlayBoundary;
37
- source_ref: string;
38
- observed_at: string;
39
- [unknownField: string]: unknown;
40
- }
41
- export interface WindowOverlayCell {
42
- provider_id: string;
43
- model_id: string;
44
- /** Unknown fact keys are retained so a newer producer can coexist with this v1 consumer. */
45
- facts: Record<string, WindowOverlayFact>;
46
- }
47
- export interface WindowOverlay {
48
- schema: typeof WINDOW_OVERLAY_SCHEMA;
49
- generated_at: string;
50
- minted_provider_ids: string[];
51
- cells: WindowOverlayCell[];
52
- }
53
- export interface ResolvedWindowOverlayFacts {
54
- /** Includes facts whose tagged value is explicitly unknown. */
55
- facts: Record<string, WindowOverlayFact>;
56
- }
57
- export type WindowLimitSource = "catalog" | "overlay" | "provider" | "detected";
16
+ export type WindowLimitSource = "catalog" | "provider" | "detected";
58
17
  export interface WindowDerivation {
59
18
  window: number;
60
19
  reserve: number;
@@ -72,34 +31,18 @@ export interface WindowGeometryResult {
72
31
  derivation: WindowDerivation;
73
32
  }
74
33
  export interface DeriveWindowGeometryOptions {
75
- overlay?: ResolvedWindowOverlayFacts;
76
- /** A provider/auth hook has higher precedence than the overlay, field by field. */
34
+ /** Live provider limits override potentially stale catalog metadata, field by field. */
77
35
  providerLimit?: ModelLimit;
78
- /** Resolved user override; higher precedence than catalog, overlay, and geometry defaults. */
36
+ /** Resolved user override; higher precedence than catalog metadata and geometry defaults. */
79
37
  outputReserveOverride?: number;
80
38
  harness?: "opencode" | "pi";
81
39
  /** Detected overflow remains the final downward cap regardless of other sources. */
82
40
  contextCap?: number;
83
41
  log?: (message: string) => void;
84
42
  }
85
- /** Convert the ratified tagged numeric union into the conservative scalar used by derivation. */
86
- export declare function scalarizeFact(value: WindowOverlayFactValue): number | undefined;
87
- export declare function parseWindowOverlay(value: unknown): {
88
- overlay?: WindowOverlay;
89
- badCells: number;
90
- refusal?: string;
91
- };
92
- export declare function defaultWindowOverlayPath(): string;
93
- export declare function readWindowOverlayFile(path: string, log?: (message: string) => void): WindowOverlay | undefined;
94
- /** Set the user-tier overlay path. Undefined restores the Fusiform data-dir default. */
95
- export declare function setWindowOverlayPath(path: string | undefined): void;
96
- /** Start a new overlay snapshot at an explicit plugin/extension reload boundary. */
97
- export declare function reloadWindowOverlay(path: string | undefined): void;
98
- export declare function clearWindowOverlayCacheForTest(): void;
99
- export declare function getWindowOverlay(): WindowOverlay | undefined;
100
- export declare function resolveWindowOverlayFacts(providerID: string, modelID: string, overlay?: WindowOverlay | undefined): ResolvedWindowOverlayFacts | undefined;
101
43
  /** Placeholder filtering is deliberately per output field, never a row-level rejection. */
102
44
  export declare function placeholderFilteredOutput(output: number | undefined, context: number | undefined): number | undefined;
45
+ export declare function clearWindowGeometryLogForTest(): void;
103
46
  export declare function deriveWindowGeometry(providerID: string, modelID: string, catalogLimit: ModelLimit | undefined, options?: DeriveWindowGeometryOptions): WindowGeometryResult | undefined;
104
47
  export interface ProvenInputFloorResult {
105
48
  geometry: WindowGeometryResult;
@@ -111,11 +54,11 @@ export interface ProvenInputFloorResult {
111
54
  export declare function hasTrustedAbsoluteWall(geometry: WindowGeometryResult): boolean;
112
55
  /**
113
56
  * Successful requests can disprove static catalog metadata, but do not widen a
114
- * provider, overlay, or observed-overflow wall here. A provider or overlay wall
115
- * is the configured limit: a reading beyond it is real pressure against that
116
- * limit (the usage handlers count it in full), not proof that the geometry
117
- * should grow. An observed-overflow wall that a larger accepted request
118
- * disproves is cleared by the usage handlers instead.
57
+ * provider or observed-overflow wall here. A provider wall is the configured
58
+ * limit: a reading beyond it is real pressure against that limit (the usage
59
+ * handlers count it in full), not proof that the geometry should grow. An
60
+ * observed-overflow wall that a larger accepted request disproves is cleared by
61
+ * the usage handlers instead.
119
62
  */
120
63
  export declare function applyProvenInputFloor(geometry: WindowGeometryResult, provenInputTokens: number | undefined): ProvenInputFloorResult;
121
64
  export declare function formatWindowDerivationLine(inputTokens: number, result: WindowGeometryResult): string;
@@ -1 +1 @@
1
- {"version":3,"file":"window-geometry.d.ts","sourceRoot":"","sources":["../../src/shared/window-geometry.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,eAAO,MAAM,qBAAqB,+BAA+B,CAAC;AAClE,eAAO,MAAM,kBAAkB,OAAQ,CAAC;AACxC,eAAO,MAAM,eAAe,OAAQ,CAAC;AACrC,eAAO,MAAM,mBAAmB,QAAS,CAAC;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AM,WAAW,sBAAsB;IACnC,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,OAAO,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC;CACvD;AAED,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,oBAAoB,GAAG,OAAO,CAE9E;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACjC,QAAQ,EAAE,oBAAoB,EAC9B,iBAAiB,EAAE,MAAM,GAAG,SAAS,GACtC,sBAAsB,CAwCxB;AAED,wBAAgB,0BAA0B,CACtC,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,oBAAoB,GAC7B,MAAM,CAcR;AAED,uFAAuF;AACvF,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,oBAAoB,GAAG,SAAS,GAAG,MAAM,CAInF;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAQzD"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Announce this plugin in the Map that CortexKit standalone plugins share, so a
3
+ * harness bridge can detect a standalone Magic Context and refuse to run both.
4
+ * Other products' entries are left untouched, and a failure never stops the
5
+ * host from loading the plugin.
6
+ */
7
+ export declare function registerStandalonePluginMarker(version: string): void;
8
+ //# sourceMappingURL=standalone-plugin-marker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"standalone-plugin-marker.d.ts","sourceRoot":"","sources":["../src/standalone-plugin-marker.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAgBpE"}
@@ -0,0 +1,4 @@
1
+ import type { ContextDatabase } from "../../features/magic-context/storage";
2
+ /** Recover indexed text when the host no longer holds the cited messages. */
3
+ export declare function renderSearchArchive(db: ContextDatabase, sessionId: string, start: number, end: number, tokenBudget: number, archiveOnly?: boolean): string | null;
4
+ //# sourceMappingURL=search-archive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-archive.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-expand/search-archive.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAW5E,6EAA6E;AAC7E,wBAAgB,mBAAmB,CAC/B,EAAE,EAAE,eAAe,EACnB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,WAAW,EAAE,MAAM,EACnB,WAAW,UAAQ,GACpB,MAAM,GAAG,IAAI,CAoDf"}
@@ -1 +1 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-expand/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAEhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAE5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAO7E,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAErE,MAAM,WAAW,iBAAiB;IAC9B,EAAE,EAAE,eAAe,CAAC;IACpB,WAAW,CAAC,EAAE,gBAAgB,CAAC;CAClC;AA2ID,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAI5F"}
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-expand/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAEhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAK5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAQ7E,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAErE,MAAM,WAAW,iBAAiB;IAC9B,EAAE,EAAE,eAAe,CAAC;IACpB,WAAW,CAAC,EAAE,gBAAgB,CAAC;CAClC;AA6JD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAI5F"}
@@ -1,4 +1,3 @@
1
1
  export declare const CTX_REDUCE_DESCRIPTION = "Stamp an item on your desk as no longer needed for the work ahead. Not a delete: stamping QUEUES it, the item stays fully readable until Magic Context clears stamped items in one sweep, and the newest tags are protected so stamping recent output is harmless. A cleared item goes to the archive \u2014 a recent one leaves a `[dropped \u00A7N\u00A7]` placeholder, an older one leaves nothing \u2014 and `mmc_expand(tag=N)` is the way back. So the question before stamping is not \"have I finished reading this?\" but \"does this need to stay on my desk for what comes next?\" \u2014 a file you read and will keep editing stays; the grep that found it goes.\n\nStamp: file reads, search results and tool outputs the work ahead no longer needs; build/test output after you acted on it; repeated or redundant dumps; data written to disk; status/log output that only confirmed what you expected; a large block pasted inside a user message once you have used it.\nKeep: user messages (never stamp one for its directive), your own conversation text, unresolved errors, raw evidence you haven't extracted yet, and outputs whose exact wording may still matter.\n\nLook at each tag before stamping it; never blanket-stamp a range like \"1-50\". Many small targeted stamps beat one sweep. `drop` accepts \"3-5\", \"1,2,9\", \"1-5,8,12-15\".";
2
- export declare const CTX_REDUCE_SELF_STAMP_MESSAGE_TEMPLATE = "\u00A7N\u00A7 is an mmc_reduce call; leave those alone, they are cleaned up automatically.";
3
- export declare function ctxReduceSelfStampMessage(tagNumber: number): string;
2
+ export declare function formatCtxReduceReply(stampedCount: number, selfStampCount?: number): string;
4
3
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-reduce/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,qzCAKsI,CAAC;AAE1K,eAAO,MAAM,sCAAsC,+FACmC,CAAC;AAEvF,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEnE"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-reduce/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,qzCAKsI,CAAC;AAE1K,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,MAAM,EAAE,cAAc,SAAI,GAAG,MAAM,CAarF"}
@@ -1,5 +1,5 @@
1
1
  import { type ToolDefinition } from "@opencode-ai/plugin";
2
- import { type ProtectionWindowResult } from "../../features/magic-context/protection-window";
2
+ import type { ProtectionWindowResult } from "../../features/magic-context/protection-window";
3
3
  import type { Database } from "../../shared/sqlite";
4
4
  export { CTX_REDUCE_LIGHT_DESCRIPTION } from "../light-descriptions";
5
5
  export interface CtxReduceToolDeps {
@@ -1 +1 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-reduce/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAEH,KAAK,sBAAsB,EAC9B,MAAM,gDAAgD,CAAC;AAaxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAKpD,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAErE,MAAM,WAAW,iBAAiB;IAC9B,+EAA+E;IAC/E,cAAc,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAClD,EAAE,EAAE,QAAQ,CAAC;IACb;;;;;OAKG;IACH,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,MAAM,KAAK,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;IAClF,mBAAmB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,sBAAsB,CAAC;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;CACpD;AAmLD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAI5F"}
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-reduce/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAChE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAW7F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAKpD,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAErE,MAAM,WAAW,iBAAiB;IAC9B,+EAA+E;IAC/E,cAAc,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAClD,EAAE,EAAE,QAAQ,CAAC;IACb;;;;;OAKG;IACH,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,MAAM,KAAK,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;IAClF,mBAAmB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,sBAAsB,CAAC;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;CACpD;AAkID,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAI5F"}
@@ -31,6 +31,25 @@ export interface V2HiddenCompletionOptions {
31
31
  * (HiddenAgentStepLimit); the executor retires the child when it throws.
32
32
  */
33
33
  resolveStepCap?: (identity: HiddenRunIdentity) => number | undefined;
34
+ /**
35
+ * Keep the store reader pool open for one hidden run; returns its release. The run
36
+ * reads the store from its first attempt until it is closed, so a pool closed in the
37
+ * meantime must wait for it rather than refuse its next read.
38
+ */
39
+ holdStore?: () => () => void;
40
+ /** Maximum time `dispose` waits for cancelled runs to settle. */
41
+ disposeDrainMs?: number;
42
+ }
43
+ /** The OpenCode 2 executor, plus the cancellation its plugin instance runs on dispose. */
44
+ export interface V2HiddenCompletionExecutor extends HiddenCompletionExecutor {
45
+ /**
46
+ * Cancel every hidden run in flight and refuse new ones, with
47
+ * `HIDDEN_RUN_DISPOSED_REASON`. Each in-flight child is interrupted at the host, so
48
+ * the host stops stepping it before this instance's hooks are removed and the
49
+ * instance that replaces it never receives its turns. Waits at most
50
+ * `disposeDrainMs` for the cancelled attempts to settle.
51
+ */
52
+ dispose(): Promise<void>;
34
53
  }
35
54
  /**
36
55
  * A terminal provider or model-resolution failure persisted by the host, as opposed to an unsettled
@@ -53,5 +72,5 @@ export declare const V2_HIDDEN_EXECUTOR_CAPABILITIES: HiddenCompletionExecutor["
53
72
  * first successful open later reaches them without a restart.
54
73
  */
55
74
  export declare function createLateHiddenExecutor(current: () => HiddenCompletionExecutor | undefined): HiddenCompletionExecutor;
56
- export declare function createV2HiddenCompletionExecutor(host: HiddenChildHost, options: V2HiddenCompletionOptions): Promise<HiddenCompletionExecutor>;
75
+ export declare function createV2HiddenCompletionExecutor(host: HiddenChildHost, options: V2HiddenCompletionOptions): Promise<V2HiddenCompletionExecutor>;
57
76
  //# sourceMappingURL=hidden-completion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hidden-completion.d.ts","sourceRoot":"","sources":["../../src/v2/hidden-completion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAER,wBAAwB,EAExB,iBAAiB,EACpB,MAAM,iDAAiD,CAAC;AAQzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAGH,KAAK,eAAe,EAIpB,KAAK,eAAe,EAGvB,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C;IAC7B,iEAAiE;IACjE,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,0FAA0F;AAC1F,MAAM,WAAW,0BAA2B,SAAQ,wBAAwB;IACxE;;;;;;OAMG;IACH,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B;AAyHD;;;;;GAKG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;IAC1C,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;gBAEd,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAO;CAKlE;AA+GD,uEAAuE;AACvE,eAAO,MAAM,+BAA+B,EAAE,wBAAwB,CAAC,cAAc,CAGpF,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACpC,OAAO,EAAE,MAAM,wBAAwB,GAAG,SAAS,GACpD,wBAAwB,CAiB1B;AAED,wBAAsB,gCAAgC,CAClD,IAAI,EAAE,eAAe,EACrB,OAAO,EAAE,yBAAyB,GACnC,OAAO,CAAC,0BAA0B,CAAC,CAsbrC"}
@@ -66,7 +66,7 @@ export declare function createV2ThresholdDeps(config: V2ThresholdConfig): Pick<T
66
66
  * will serve (already spliced back into draft.system).
67
67
  */
68
68
  export declare function applyV2SystemPrompt(systemPrompt: Pick<ReturnType<typeof createSystemPromptHashHandler>, "handler">, draft: Pick<SessionContext, "sessionID" | "model" | "messages" | "system" | "tools">): Promise<string[]>;
69
- export declare function createHostSeams(context: V2Context, readAllForConversion: TransformDeps["hostRawMessages"] & {}, reconciliationSource: NonNullable<TransformDeps["hostMessageReconciliationSource"]>, liveModels: NonNullable<TransformDeps["liveModelBySession"]>): Required<Pick<TransformDeps, "hostRawMessages" | "hostMessageReconciliationSource" | "hostProtectedTailBoundary" | "hostModelFallback" | "getModelKey" | "hostRefusalNotice" | "hostRefuse">>;
69
+ export declare function createHostSeams(context: V2Context, readAllForConversion: TransformDeps["hostRawMessages"] & {}, reconciliationSource: NonNullable<TransformDeps["hostMessageReconciliationSource"]>, liveModels: NonNullable<TransformDeps["liveModelBySession"]>): Required<Pick<TransformDeps, "hostRawMessages" | "hostMessageReconciliationSource" | "hostPrepareRawOrdinals" | "hostProtectedTailBoundary" | "hostModelFallback" | "getModelKey" | "hostRefusalNotice" | "hostRefuse">>;
70
70
  /**
71
71
  * Record why a turn is about to be refused before the model is called.
72
72
  *
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/v2/hooks/context.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAiDxD,OAAO,EACH,KAAK,qBAAqB,EAE7B,MAAM,mDAAmD,CAAC;AA0B3D,OAAO,EAAE,6BAA6B,EAAE,MAAM,8CAA8C,CAAC;AAC7F,OAAO,EAIH,KAAK,aAAa,EACrB,MAAM,qCAAqC,CAAC;AAmB7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAGH,KAAK,oBAAoB,EAC5B,MAAM,qCAAqC,CAAC;AAG7C,OAAO,EACH,KAAK,QAAQ,EAMhB,MAAM,qBAAqB,CAAC;AAkB7B,OAAO,EAAkB,KAAK,aAAa,EAAqB,MAAM,iBAAiB,CAAC;AA2CxF,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAa,MAAM,SAAS,CAAC;AAUpE,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAQlE;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAChC,EAAE,EAAE,QAAQ,EACZ,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,kBAAkB,GAAG,eAAe,CAAC,EACjE,SAAS,EAAE,MAAM,GAClB,qBAAqB,GAAG,SAAS,CAanC;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,uBAAuB,CACzC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,EA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AC,aAAa,CAAC,oBAAoB,CAAC,CAAC,GAC7D,QAAQ,CACP,IAAI,CACA,aAAa,EACX,iBAAiB,GACjB,iCAAiC,GACjC,wBAAwB,GACxB,2BAA2B,GAC3B,mBAAmB,GACnB,aAAa,GACb,mBAAmB,GACnB,YAAY,CACjB,CACJ,CA8BA;AAyBD;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAMhF;AAED,2EAA2E;AAC3E,wBAAgB,aAAa,CACzB,MAAM,EAAE,OAAO,EACf,UAAU,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,GACrC,KAAK,CAAC;IACL,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC/D,CAAC,CAyCD;AAED,4EAA4E;AAC5E,wBAAgB,yBAAyB,CACrC,KAAK,EAAE,cAAc,EACrB,OAAO,EAAE,oBAAoB,EAC7B,MAAM,EAAE,mBAAmB,GAAG,SAAS,GACxC,IAAI,CAUN;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,CAgBnE;AAED,wBAAsB,eAAe,CAAC,OAAO,EAAE,SAAS;;eAwqDvD"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Remove `§N§` tag notation that a model copied into its own reply.
3
+ *
4
+ * OpenCode 1 (`experimental.text.complete`) and Pi (`message_end`) run
5
+ * `stripPersistedAssistantText` on assistant text before the host stores it.
6
+ * OpenCode 2 offers no hook between a finished text part and the write to its
7
+ * store: the runner publishes the text-ended event straight to the bus, and the
8
+ * projector writes it. So OpenCode 2 stores copied tags unchanged, and Magic
9
+ * Context strips them from assistant text when it builds each request instead.
10
+ * Without that, every later request hands the copies back to the model, which
11
+ * reinforces the pattern.
12
+ *
13
+ * Depends only on the text, so the same stored reply gives the same bytes on
14
+ * every pass. Text without a `§` comes back untouched: the shared function also
15
+ * trims surrounding whitespace, and trimming text that holds no tag notation
16
+ * would change the bytes of sessions that never had copies.
17
+ */
18
+ export declare function stripCopiedTagNotation(text: string): string;
19
+ //# sourceMappingURL=copied-tag-notation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copied-tag-notation.d.ts","sourceRoot":"","sources":["../../../src/v2/hooks/copied-tag-notation.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE3D"}
@@ -1,10 +1,17 @@
1
- import type { SessionContext } from "./types";
1
+ import type { SessionContext, V2Message } from "./types";
2
+ interface GenerateReplayAnchor {
3
+ id: string;
4
+ tail: V2Message[];
5
+ }
6
+ /** Preserve the host boundary before Magic Context tags or drops tool results. */
7
+ export declare function generateReplayAnchor(messages: V2Message[]): GenerateReplayAnchor | undefined;
2
8
  /** OpenCode's /btw requests reuse the last main request's system and history.
3
9
  * They never run the turn transform, which executes drops and advances counters. */
4
10
  export declare class V2GenerateReplay {
5
11
  private readonly prefixes;
6
- capture(draft: SessionContext, anchor: string | undefined): void;
12
+ capture(draft: SessionContext, anchor: GenerateReplayAnchor | undefined): void;
7
13
  forget(sessionID: string): void;
8
14
  apply(draft: SessionContext): boolean;
9
15
  }
16
+ export {};
10
17
  //# sourceMappingURL=generate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/v2/hooks/generate.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAa,MAAM,SAAS,CAAC;AAWzD;oFACoF;AACpF,qBAAa,gBAAgB;IACzB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmC;IAE5D,OAAO,CAAC,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;IAYhE,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAI/B,KAAK,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO;CAyBxC"}
1
+ {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/v2/hooks/generate.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzD,UAAU,oBAAoB;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,SAAS,EAAE,CAAC;CACrB;AAED,kFAAkF;AAClF,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,SAAS,EAAE,GAAG,oBAAoB,GAAG,SAAS,CAO5F;AAWD;oFACoF;AACpF,qBAAa,gBAAgB;IACzB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmC;IAE5D,OAAO,CAAC,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,oBAAoB,GAAG,SAAS,GAAG,IAAI;IAgB9E,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAI/B,KAAK,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO;CAmCxC"}
@@ -18,6 +18,21 @@ export declare function resolveHistorianStepCap(maxSteps: number | undefined): n
18
18
  * is always running this plugin's carrier.
19
19
  */
20
20
  export declare function hiddenAgentAllowedTools(agent: string | undefined): readonly string[] | undefined;
21
+ /**
22
+ * Why a hidden run ends when its plugin instance is disposed. OpenCode 2 disposes
23
+ * a plugin instance when it reloads the plugin (`/plugins` then ctrl+u, a
24
+ * rewritten config, a location reinitialising) and loads a fresh instance in the
25
+ * same process. The disposed instance cancels its in-flight hidden runs and the
26
+ * run's error carries this text; the instance that replaces it refuses any turn
27
+ * of such a child with the same text, so both sides of a reload name one cause.
28
+ */
29
+ export declare const HIDDEN_RUN_DISPOSED_REASON = "the Magic Context plugin instance that started this hidden run was disposed (OpenCode reloaded the plugin), so the run was cancelled; the work is retried on a later run";
30
+ /** Record that `sessionID` belonged to a plugin instance that has been disposed. */
31
+ export declare function noteChildOfDisposedInstance(sessionID: string): void;
32
+ /** Whether `sessionID` is a hidden child whose plugin instance was disposed. */
33
+ export declare function isChildOfDisposedInstance(sessionID: string): boolean;
34
+ /** Clears the process-wide record, for tests. */
35
+ export declare function __resetDisposedChildrenForTests(): void;
21
36
  /** One OpenCode 2 permission rule: the action is the tool id, the resource a pattern. */
22
37
  export interface HiddenPermissionRule {
23
38
  action: string;
@@ -127,7 +142,13 @@ export declare class HiddenChildHook {
127
142
  */
128
143
  private refuse;
129
144
  private calibratedParts;
130
- /** Returns false only for an ordinary user session that this bridge does not own. */
145
+ /**
146
+ * Returns false only for an ordinary user session that this bridge does not own.
147
+ *
148
+ * A child whose instance was disposed by a plugin reload is refused with that
149
+ * reason, whatever agent the host reports for it: its instance has cancelled
150
+ * the run, and this instance has no record of the prompt it was sent.
151
+ */
131
152
  apply(draft: SessionContext): boolean;
132
153
  }
133
154
  //# sourceMappingURL=hidden-child.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hidden-child.d.ts","sourceRoot":"","sources":["../../../src/v2/hooks/hidden-child.ts"],"names":[],"mappings":"AAQA,OAAO,EACH,uBAAuB,EACvB,KAAK,iBAAiB,EACzB,MAAM,oDAAoD,CAAC;AAE5D,OAAO,EAAE,uBAAuB,EAAE,CAAC;AAInC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAEtE,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7D,eAAO,MAAM,sBAAsB,cAAc,CAAC;AA0BlD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAI5E;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GA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BAAkB,GAAG,IAAI;IAMlE,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAQpC,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAIhC;;;;;;OAMG;IACH,eAAe,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,GAAG,SAAS;IAmB9F;;;;;;;;;;OAUG;IACH,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAuCxE;;;;OAIG;IACH,OAAO,CAAC,MAAM;IA2Cd,OAAO,CAAC,eAAe;IAWvB;;;;;;OAMG;IACH,KAAK,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO;CAyHxC"}
@@ -1 +1 @@
1
- {"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../src/v2/hooks/payload.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAI1E,OAAO,KAAK,EAAE,cAAc,EAAa,MAAM,SAAS,CAAC;AAEzD,eAAO,MAAM,QAAQ,iEAAkE,CAAC;AA+CxF;iFACiF;AACjF,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAUvD;AAoFD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,EAAE,WAAW,GAAE,WAAW,CAAC,MAAM,CAAa;;;EAmU/F"}
1
+ {"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../src/v2/hooks/payload.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAK1E,OAAO,KAAK,EAAE,cAAc,EAAa,MAAM,SAAS,CAAC;AAEzD,eAAO,MAAM,QAAQ,iEAAkE,CAAC;AAiGxF;iFACiF;AACjF,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAUvD;AA8FD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,EAAE,WAAW,GAAE,WAAW,CAAC,MAAM,CAAa;;;EAyW/F"}
@@ -0,0 +1,5 @@
1
+ import type { V2StoreReader } from "../store-reader";
2
+ /** The newest assistant may belong to a later concurrent run. Bind only the
3
+ * first assistant row after the prepared request's captured store boundary. */
4
+ export declare function bindV2SystemPromptResponse(sessionId: string, reader: Pick<V2StoreReader, "assistantSince">): void;
5
+ //# sourceMappingURL=system-prompt-response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"system-prompt-response.d.ts","sourceRoot":"","sources":["../../../src/v2/hooks/system-prompt-response.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD;+EAC+E;AAC/E,wBAAgB,0BAA0B,CACtC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAC9C,IAAI,CAeN"}
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/v2/server.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,SAAS,CAQ7E;AAED,wBAAsB,KAAK,CAAC,OAAO,EAAE,SAAS,gCAwB7C;;;;;AAED,wBAGE"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/v2/server.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAI/C;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,SAAS,CAQ7E;AAED,wBAAsB,KAAK,CAAC,OAAO,EAAE,SAAS,gCAwB7C;;;;;AAED,wBAGE"}