@smthrs/harness 0.0.0-stage → 1.0.0-rc.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 (476) hide show
  1. package/CHANGELOG.md +387 -0
  2. package/LICENSE +21 -0
  3. package/README.md +138 -2
  4. package/dist/cjs/AgentEvent.d.ts +3092 -0
  5. package/dist/cjs/AgentEvent.d.ts.map +1 -0
  6. package/dist/cjs/AgentEvent.js +1116 -0
  7. package/dist/cjs/AgentEvent.js.map +7 -0
  8. package/dist/cjs/CallLedger.d.ts +378 -0
  9. package/dist/cjs/CallLedger.d.ts.map +1 -0
  10. package/dist/cjs/CallLedger.js +240 -0
  11. package/dist/cjs/CallLedger.js.map +7 -0
  12. package/dist/cjs/Cell.d.ts +774 -0
  13. package/dist/cjs/Cell.d.ts.map +1 -0
  14. package/dist/cjs/Cell.js +431 -0
  15. package/dist/cjs/Cell.js.map +7 -0
  16. package/dist/cjs/CellCalls.d.ts +115 -0
  17. package/dist/cjs/CellCalls.d.ts.map +1 -0
  18. package/dist/cjs/CellCalls.js +98 -0
  19. package/dist/cjs/CellCalls.js.map +7 -0
  20. package/dist/cjs/CellHistory.d.ts +102 -0
  21. package/dist/cjs/CellHistory.d.ts.map +1 -0
  22. package/dist/cjs/CellHistory.js +54 -0
  23. package/dist/cjs/CellHistory.js.map +7 -0
  24. package/dist/cjs/CellTurn.d.ts +1071 -0
  25. package/dist/cjs/CellTurn.d.ts.map +1 -0
  26. package/dist/cjs/CellTurn.js +2618 -0
  27. package/dist/cjs/CellTurn.js.map +7 -0
  28. package/dist/cjs/CellValidation.d.ts +94 -0
  29. package/dist/cjs/CellValidation.d.ts.map +1 -0
  30. package/dist/cjs/CellValidation.js +218 -0
  31. package/dist/cjs/CellValidation.js.map +7 -0
  32. package/dist/cjs/Compaction.d.ts +158 -0
  33. package/dist/cjs/Compaction.d.ts.map +1 -0
  34. package/dist/cjs/Compaction.js +189 -0
  35. package/dist/cjs/Compaction.js.map +7 -0
  36. package/dist/cjs/CompletionClaim.d.ts +801 -0
  37. package/dist/cjs/CompletionClaim.d.ts.map +1 -0
  38. package/dist/cjs/CompletionClaim.js +303 -0
  39. package/dist/cjs/CompletionClaim.js.map +7 -0
  40. package/dist/cjs/ContextWindow.d.ts +435 -0
  41. package/dist/cjs/ContextWindow.d.ts.map +1 -0
  42. package/dist/cjs/ContextWindow.js +319 -0
  43. package/dist/cjs/ContextWindow.js.map +7 -0
  44. package/dist/cjs/EngineLike.d.ts +546 -0
  45. package/dist/cjs/EngineLike.d.ts.map +1 -0
  46. package/dist/cjs/EngineLike.js +114 -0
  47. package/dist/cjs/EngineLike.js.map +7 -0
  48. package/dist/cjs/ExternalTranscript.d.ts +349 -0
  49. package/dist/cjs/ExternalTranscript.d.ts.map +1 -0
  50. package/dist/cjs/ExternalTranscript.js +826 -0
  51. package/dist/cjs/ExternalTranscript.js.map +7 -0
  52. package/dist/cjs/FailedCall.d.ts +132 -0
  53. package/dist/cjs/FailedCall.d.ts.map +1 -0
  54. package/dist/cjs/FailedCall.js +53 -0
  55. package/dist/cjs/FailedCall.js.map +7 -0
  56. package/dist/cjs/FlowBinding.d.ts +289 -0
  57. package/dist/cjs/FlowBinding.d.ts.map +1 -0
  58. package/dist/cjs/FlowBinding.js +251 -0
  59. package/dist/cjs/FlowBinding.js.map +7 -0
  60. package/dist/cjs/HarnessError.d.ts +57 -0
  61. package/dist/cjs/HarnessError.d.ts.map +1 -0
  62. package/dist/cjs/HarnessError.js +75 -0
  63. package/dist/cjs/HarnessError.js.map +7 -0
  64. package/dist/cjs/Judgement.d.ts +289 -0
  65. package/dist/cjs/Judgement.d.ts.map +1 -0
  66. package/dist/cjs/Judgement.js +240 -0
  67. package/dist/cjs/Judgement.js.map +7 -0
  68. package/dist/cjs/Monitor.d.ts +374 -0
  69. package/dist/cjs/Monitor.d.ts.map +1 -0
  70. package/dist/cjs/Monitor.js +233 -0
  71. package/dist/cjs/Monitor.js.map +7 -0
  72. package/dist/cjs/NarrowedCheck.d.ts +523 -0
  73. package/dist/cjs/NarrowedCheck.d.ts.map +1 -0
  74. package/dist/cjs/NarrowedCheck.js +263 -0
  75. package/dist/cjs/NarrowedCheck.js.map +7 -0
  76. package/dist/cjs/Notifications.d.ts +42 -0
  77. package/dist/cjs/Notifications.d.ts.map +1 -0
  78. package/dist/cjs/Notifications.js +177 -0
  79. package/dist/cjs/Notifications.js.map +7 -0
  80. package/dist/cjs/Plan.d.ts +127 -0
  81. package/dist/cjs/Plan.d.ts.map +1 -0
  82. package/dist/cjs/Plan.js +77 -0
  83. package/dist/cjs/Plan.js.map +7 -0
  84. package/dist/cjs/QuickJSSandbox.d.ts +151 -0
  85. package/dist/cjs/QuickJSSandbox.d.ts.map +1 -0
  86. package/dist/cjs/QuickJSSandbox.js +987 -0
  87. package/dist/cjs/QuickJSSandbox.js.map +7 -0
  88. package/dist/cjs/Relevance.d.ts +213 -0
  89. package/dist/cjs/Relevance.d.ts.map +1 -0
  90. package/dist/cjs/Relevance.js +183 -0
  91. package/dist/cjs/Relevance.js.map +7 -0
  92. package/dist/cjs/Sandbox.d.ts +637 -0
  93. package/dist/cjs/Sandbox.d.ts.map +1 -0
  94. package/dist/cjs/Sandbox.js +260 -0
  95. package/dist/cjs/Sandbox.js.map +7 -0
  96. package/dist/cjs/Steering.d.ts +464 -0
  97. package/dist/cjs/Steering.d.ts.map +1 -0
  98. package/dist/cjs/Steering.js +153 -0
  99. package/dist/cjs/Steering.js.map +7 -0
  100. package/dist/cjs/StructuredOutput.d.ts +252 -0
  101. package/dist/cjs/StructuredOutput.d.ts.map +1 -0
  102. package/dist/cjs/StructuredOutput.js +266 -0
  103. package/dist/cjs/StructuredOutput.js.map +7 -0
  104. package/dist/cjs/Sufficiency.d.ts +195 -0
  105. package/dist/cjs/Sufficiency.d.ts.map +1 -0
  106. package/dist/cjs/Sufficiency.js +110 -0
  107. package/dist/cjs/Sufficiency.js.map +7 -0
  108. package/dist/cjs/Supervisor.d.ts +719 -0
  109. package/dist/cjs/Supervisor.d.ts.map +1 -0
  110. package/dist/cjs/Supervisor.js +313 -0
  111. package/dist/cjs/Supervisor.js.map +7 -0
  112. package/dist/cjs/Tokens.d.ts +86 -0
  113. package/dist/cjs/Tokens.d.ts.map +1 -0
  114. package/dist/cjs/Tokens.js +72 -0
  115. package/dist/cjs/Tokens.js.map +7 -0
  116. package/dist/cjs/Transcript.d.ts +171 -0
  117. package/dist/cjs/Transcript.d.ts.map +1 -0
  118. package/dist/cjs/Transcript.js +342 -0
  119. package/dist/cjs/Transcript.js.map +7 -0
  120. package/dist/cjs/TruncatedOutput.d.ts +186 -0
  121. package/dist/cjs/TruncatedOutput.d.ts.map +1 -0
  122. package/dist/cjs/TruncatedOutput.js +143 -0
  123. package/dist/cjs/TruncatedOutput.js.map +7 -0
  124. package/dist/cjs/UnmovedTree.d.ts +113 -0
  125. package/dist/cjs/UnmovedTree.d.ts.map +1 -0
  126. package/dist/cjs/UnmovedTree.js +38 -0
  127. package/dist/cjs/UnmovedTree.js.map +7 -0
  128. package/dist/cjs/UnresolvedFailure.d.ts +196 -0
  129. package/dist/cjs/UnresolvedFailure.d.ts.map +1 -0
  130. package/dist/cjs/UnresolvedFailure.js +77 -0
  131. package/dist/cjs/UnresolvedFailure.js.map +7 -0
  132. package/dist/cjs/VacuousVerification.d.ts +237 -0
  133. package/dist/cjs/VacuousVerification.d.ts.map +1 -0
  134. package/dist/cjs/VacuousVerification.js +91 -0
  135. package/dist/cjs/VacuousVerification.js.map +7 -0
  136. package/dist/cjs/VariablesPanel.d.ts +117 -0
  137. package/dist/cjs/VariablesPanel.d.ts.map +1 -0
  138. package/dist/cjs/VariablesPanel.js +108 -0
  139. package/dist/cjs/VariablesPanel.js.map +7 -0
  140. package/dist/cjs/index.d.ts +172 -0
  141. package/dist/cjs/index.d.ts.map +1 -0
  142. package/dist/cjs/index.js +99 -0
  143. package/dist/cjs/index.js.map +7 -0
  144. package/dist/cjs/internal/bytes.d.ts +36 -0
  145. package/dist/cjs/internal/bytes.d.ts.map +1 -0
  146. package/dist/cjs/internal/bytes.js +57 -0
  147. package/dist/cjs/internal/bytes.js.map +7 -0
  148. package/dist/cjs/internal/cellPrompt.d.ts +122 -0
  149. package/dist/cjs/internal/cellPrompt.d.ts.map +1 -0
  150. package/dist/cjs/internal/cellPrompt.js +146 -0
  151. package/dist/cjs/internal/cellPrompt.js.map +7 -0
  152. package/dist/cjs/internal/compactable.d.ts +44 -0
  153. package/dist/cjs/internal/compactable.d.ts.map +1 -0
  154. package/dist/cjs/internal/compactable.js +56 -0
  155. package/dist/cjs/internal/compactable.js.map +7 -0
  156. package/dist/cjs/internal/compactionMarks.d.ts +278 -0
  157. package/dist/cjs/internal/compactionMarks.d.ts.map +1 -0
  158. package/dist/cjs/internal/compactionMarks.js +212 -0
  159. package/dist/cjs/internal/compactionMarks.js.map +7 -0
  160. package/dist/cjs/internal/demandText.d.ts +95 -0
  161. package/dist/cjs/internal/demandText.d.ts.map +1 -0
  162. package/dist/cjs/internal/demandText.js +70 -0
  163. package/dist/cjs/internal/demandText.js.map +7 -0
  164. package/dist/cjs/internal/elide.d.ts +109 -0
  165. package/dist/cjs/internal/elide.d.ts.map +1 -0
  166. package/dist/cjs/internal/elide.js +59 -0
  167. package/dist/cjs/internal/elide.js.map +7 -0
  168. package/dist/cjs/internal/frame.d.ts +463 -0
  169. package/dist/cjs/internal/frame.d.ts.map +1 -0
  170. package/dist/cjs/internal/frame.js +514 -0
  171. package/dist/cjs/internal/frame.js.map +7 -0
  172. package/dist/cjs/internal/nonNegativeSafeInt.d.ts +20 -0
  173. package/dist/cjs/internal/nonNegativeSafeInt.d.ts.map +1 -0
  174. package/dist/cjs/internal/nonNegativeSafeInt.js +29 -0
  175. package/dist/cjs/internal/nonNegativeSafeInt.js.map +7 -0
  176. package/dist/cjs/internal/paidUsage.d.ts +52 -0
  177. package/dist/cjs/internal/paidUsage.d.ts.map +1 -0
  178. package/dist/cjs/internal/paidUsage.js +70 -0
  179. package/dist/cjs/internal/paidUsage.js.map +7 -0
  180. package/dist/cjs/internal/printChannel.d.ts +233 -0
  181. package/dist/cjs/internal/printChannel.d.ts.map +1 -0
  182. package/dist/cjs/internal/printChannel.js +165 -0
  183. package/dist/cjs/internal/printChannel.js.map +7 -0
  184. package/dist/cjs/internal/printsObservation.d.ts +26 -0
  185. package/dist/cjs/internal/printsObservation.d.ts.map +1 -0
  186. package/dist/cjs/internal/printsObservation.js +27 -0
  187. package/dist/cjs/internal/printsObservation.js.map +7 -0
  188. package/dist/cjs/internal/refusal.d.ts +40 -0
  189. package/dist/cjs/internal/refusal.d.ts.map +1 -0
  190. package/dist/cjs/internal/refusal.js +45 -0
  191. package/dist/cjs/internal/refusal.js.map +7 -0
  192. package/dist/cjs/internal/supervision.d.ts +174 -0
  193. package/dist/cjs/internal/supervision.d.ts.map +1 -0
  194. package/dist/cjs/internal/supervision.js +402 -0
  195. package/dist/cjs/internal/supervision.js.map +7 -0
  196. package/dist/cjs/internal/unfinishedWork.d.ts +99 -0
  197. package/dist/cjs/internal/unfinishedWork.d.ts.map +1 -0
  198. package/dist/cjs/internal/unfinishedWork.js +80 -0
  199. package/dist/cjs/internal/unfinishedWork.js.map +7 -0
  200. package/dist/cjs/internal/unobservedCall.d.ts +112 -0
  201. package/dist/cjs/internal/unobservedCall.d.ts.map +1 -0
  202. package/dist/cjs/internal/unobservedCall.js +345 -0
  203. package/dist/cjs/internal/unobservedCall.js.map +7 -0
  204. package/dist/cjs/internal/untrustedData.d.ts +14 -0
  205. package/dist/cjs/internal/untrustedData.d.ts.map +1 -0
  206. package/dist/cjs/internal/untrustedData.js +30 -0
  207. package/dist/cjs/internal/untrustedData.js.map +7 -0
  208. package/dist/cjs/package.json +1 -0
  209. package/dist/esm/AgentEvent.d.ts +3092 -0
  210. package/dist/esm/AgentEvent.d.ts.map +1 -0
  211. package/dist/esm/AgentEvent.js +1610 -0
  212. package/dist/esm/AgentEvent.js.map +1 -0
  213. package/dist/esm/CallLedger.d.ts +378 -0
  214. package/dist/esm/CallLedger.d.ts.map +1 -0
  215. package/dist/esm/CallLedger.js +506 -0
  216. package/dist/esm/CallLedger.js.map +1 -0
  217. package/dist/esm/Cell.d.ts +774 -0
  218. package/dist/esm/Cell.d.ts.map +1 -0
  219. package/dist/esm/Cell.js +772 -0
  220. package/dist/esm/Cell.js.map +1 -0
  221. package/dist/esm/CellCalls.d.ts +115 -0
  222. package/dist/esm/CellCalls.d.ts.map +1 -0
  223. package/dist/esm/CellCalls.js +97 -0
  224. package/dist/esm/CellCalls.js.map +1 -0
  225. package/dist/esm/CellHistory.d.ts +102 -0
  226. package/dist/esm/CellHistory.d.ts.map +1 -0
  227. package/dist/esm/CellHistory.js +91 -0
  228. package/dist/esm/CellHistory.js.map +1 -0
  229. package/dist/esm/CellTurn.d.ts +1071 -0
  230. package/dist/esm/CellTurn.d.ts.map +1 -0
  231. package/dist/esm/CellTurn.js +3410 -0
  232. package/dist/esm/CellTurn.js.map +1 -0
  233. package/dist/esm/CellValidation.d.ts +94 -0
  234. package/dist/esm/CellValidation.d.ts.map +1 -0
  235. package/dist/esm/CellValidation.js +335 -0
  236. package/dist/esm/CellValidation.js.map +1 -0
  237. package/dist/esm/Compaction.d.ts +158 -0
  238. package/dist/esm/Compaction.d.ts.map +1 -0
  239. package/dist/esm/Compaction.js +216 -0
  240. package/dist/esm/Compaction.js.map +1 -0
  241. package/dist/esm/CompletionClaim.d.ts +801 -0
  242. package/dist/esm/CompletionClaim.d.ts.map +1 -0
  243. package/dist/esm/CompletionClaim.js +833 -0
  244. package/dist/esm/CompletionClaim.js.map +1 -0
  245. package/dist/esm/ContextWindow.d.ts +435 -0
  246. package/dist/esm/ContextWindow.d.ts.map +1 -0
  247. package/dist/esm/ContextWindow.js +427 -0
  248. package/dist/esm/ContextWindow.js.map +1 -0
  249. package/dist/esm/EngineLike.d.ts +546 -0
  250. package/dist/esm/EngineLike.d.ts.map +1 -0
  251. package/dist/esm/EngineLike.js +218 -0
  252. package/dist/esm/EngineLike.js.map +1 -0
  253. package/dist/esm/ExternalTranscript.d.ts +349 -0
  254. package/dist/esm/ExternalTranscript.d.ts.map +1 -0
  255. package/dist/esm/ExternalTranscript.js +985 -0
  256. package/dist/esm/ExternalTranscript.js.map +1 -0
  257. package/dist/esm/FailedCall.d.ts +132 -0
  258. package/dist/esm/FailedCall.d.ts.map +1 -0
  259. package/dist/esm/FailedCall.js +131 -0
  260. package/dist/esm/FailedCall.js.map +1 -0
  261. package/dist/esm/FlowBinding.d.ts +289 -0
  262. package/dist/esm/FlowBinding.d.ts.map +1 -0
  263. package/dist/esm/FlowBinding.js +376 -0
  264. package/dist/esm/FlowBinding.js.map +1 -0
  265. package/dist/esm/HarnessError.d.ts +57 -0
  266. package/dist/esm/HarnessError.d.ts.map +1 -0
  267. package/dist/esm/HarnessError.js +85 -0
  268. package/dist/esm/HarnessError.js.map +1 -0
  269. package/dist/esm/Judgement.d.ts +289 -0
  270. package/dist/esm/Judgement.d.ts.map +1 -0
  271. package/dist/esm/Judgement.js +305 -0
  272. package/dist/esm/Judgement.js.map +1 -0
  273. package/dist/esm/Monitor.d.ts +374 -0
  274. package/dist/esm/Monitor.d.ts.map +1 -0
  275. package/dist/esm/Monitor.js +370 -0
  276. package/dist/esm/Monitor.js.map +1 -0
  277. package/dist/esm/NarrowedCheck.d.ts +523 -0
  278. package/dist/esm/NarrowedCheck.d.ts.map +1 -0
  279. package/dist/esm/NarrowedCheck.js +612 -0
  280. package/dist/esm/NarrowedCheck.js.map +1 -0
  281. package/dist/esm/Notifications.d.ts +42 -0
  282. package/dist/esm/Notifications.d.ts.map +1 -0
  283. package/dist/esm/Notifications.js +215 -0
  284. package/dist/esm/Notifications.js.map +1 -0
  285. package/dist/esm/Plan.d.ts +127 -0
  286. package/dist/esm/Plan.d.ts.map +1 -0
  287. package/dist/esm/Plan.js +97 -0
  288. package/dist/esm/Plan.js.map +1 -0
  289. package/dist/esm/QuickJSSandbox.d.ts +151 -0
  290. package/dist/esm/QuickJSSandbox.d.ts.map +1 -0
  291. package/dist/esm/QuickJSSandbox.js +1364 -0
  292. package/dist/esm/QuickJSSandbox.js.map +1 -0
  293. package/dist/esm/Relevance.d.ts +213 -0
  294. package/dist/esm/Relevance.d.ts.map +1 -0
  295. package/dist/esm/Relevance.js +254 -0
  296. package/dist/esm/Relevance.js.map +1 -0
  297. package/dist/esm/Sandbox.d.ts +637 -0
  298. package/dist/esm/Sandbox.d.ts.map +1 -0
  299. package/dist/esm/Sandbox.js +464 -0
  300. package/dist/esm/Sandbox.js.map +1 -0
  301. package/dist/esm/Steering.d.ts +464 -0
  302. package/dist/esm/Steering.d.ts.map +1 -0
  303. package/dist/esm/Steering.js +193 -0
  304. package/dist/esm/Steering.js.map +1 -0
  305. package/dist/esm/StructuredOutput.d.ts +252 -0
  306. package/dist/esm/StructuredOutput.d.ts.map +1 -0
  307. package/dist/esm/StructuredOutput.js +430 -0
  308. package/dist/esm/StructuredOutput.js.map +1 -0
  309. package/dist/esm/Sufficiency.d.ts +195 -0
  310. package/dist/esm/Sufficiency.d.ts.map +1 -0
  311. package/dist/esm/Sufficiency.js +207 -0
  312. package/dist/esm/Sufficiency.js.map +1 -0
  313. package/dist/esm/Supervisor.d.ts +719 -0
  314. package/dist/esm/Supervisor.d.ts.map +1 -0
  315. package/dist/esm/Supervisor.js +575 -0
  316. package/dist/esm/Supervisor.js.map +1 -0
  317. package/dist/esm/Tokens.d.ts +86 -0
  318. package/dist/esm/Tokens.d.ts.map +1 -0
  319. package/dist/esm/Tokens.js +92 -0
  320. package/dist/esm/Tokens.js.map +1 -0
  321. package/dist/esm/Transcript.d.ts +171 -0
  322. package/dist/esm/Transcript.d.ts.map +1 -0
  323. package/dist/esm/Transcript.js +424 -0
  324. package/dist/esm/Transcript.js.map +1 -0
  325. package/dist/esm/TruncatedOutput.d.ts +186 -0
  326. package/dist/esm/TruncatedOutput.d.ts.map +1 -0
  327. package/dist/esm/TruncatedOutput.js +257 -0
  328. package/dist/esm/TruncatedOutput.js.map +1 -0
  329. package/dist/esm/UnmovedTree.d.ts +113 -0
  330. package/dist/esm/UnmovedTree.d.ts.map +1 -0
  331. package/dist/esm/UnmovedTree.js +90 -0
  332. package/dist/esm/UnmovedTree.js.map +1 -0
  333. package/dist/esm/UnresolvedFailure.d.ts +196 -0
  334. package/dist/esm/UnresolvedFailure.d.ts.map +1 -0
  335. package/dist/esm/UnresolvedFailure.js +218 -0
  336. package/dist/esm/UnresolvedFailure.js.map +1 -0
  337. package/dist/esm/VacuousVerification.d.ts +237 -0
  338. package/dist/esm/VacuousVerification.d.ts.map +1 -0
  339. package/dist/esm/VacuousVerification.js +245 -0
  340. package/dist/esm/VacuousVerification.js.map +1 -0
  341. package/dist/esm/VariablesPanel.d.ts +117 -0
  342. package/dist/esm/VariablesPanel.d.ts.map +1 -0
  343. package/dist/esm/VariablesPanel.js +142 -0
  344. package/dist/esm/VariablesPanel.js.map +1 -0
  345. package/dist/esm/index.d.ts +172 -0
  346. package/dist/esm/index.d.ts.map +1 -0
  347. package/dist/esm/index.js +172 -0
  348. package/dist/esm/index.js.map +1 -0
  349. package/dist/esm/internal/bytes.d.ts +36 -0
  350. package/dist/esm/internal/bytes.d.ts.map +1 -0
  351. package/dist/esm/internal/bytes.js +70 -0
  352. package/dist/esm/internal/bytes.js.map +1 -0
  353. package/dist/esm/internal/cellPrompt.d.ts +122 -0
  354. package/dist/esm/internal/cellPrompt.d.ts.map +1 -0
  355. package/dist/esm/internal/cellPrompt.js +276 -0
  356. package/dist/esm/internal/cellPrompt.js.map +1 -0
  357. package/dist/esm/internal/compactable.d.ts +44 -0
  358. package/dist/esm/internal/compactable.d.ts.map +1 -0
  359. package/dist/esm/internal/compactable.js +71 -0
  360. package/dist/esm/internal/compactable.js.map +1 -0
  361. package/dist/esm/internal/compactionMarks.d.ts +278 -0
  362. package/dist/esm/internal/compactionMarks.d.ts.map +1 -0
  363. package/dist/esm/internal/compactionMarks.js +317 -0
  364. package/dist/esm/internal/compactionMarks.js.map +1 -0
  365. package/dist/esm/internal/demandText.d.ts +95 -0
  366. package/dist/esm/internal/demandText.d.ts.map +1 -0
  367. package/dist/esm/internal/demandText.js +128 -0
  368. package/dist/esm/internal/demandText.js.map +1 -0
  369. package/dist/esm/internal/elide.d.ts +109 -0
  370. package/dist/esm/internal/elide.d.ts.map +1 -0
  371. package/dist/esm/internal/elide.js +123 -0
  372. package/dist/esm/internal/elide.js.map +1 -0
  373. package/dist/esm/internal/frame.d.ts +463 -0
  374. package/dist/esm/internal/frame.d.ts.map +1 -0
  375. package/dist/esm/internal/frame.js +861 -0
  376. package/dist/esm/internal/frame.js.map +1 -0
  377. package/dist/esm/internal/nonNegativeSafeInt.d.ts +20 -0
  378. package/dist/esm/internal/nonNegativeSafeInt.d.ts.map +1 -0
  379. package/dist/esm/internal/nonNegativeSafeInt.js +20 -0
  380. package/dist/esm/internal/nonNegativeSafeInt.js.map +1 -0
  381. package/dist/esm/internal/paidUsage.d.ts +52 -0
  382. package/dist/esm/internal/paidUsage.d.ts.map +1 -0
  383. package/dist/esm/internal/paidUsage.js +72 -0
  384. package/dist/esm/internal/paidUsage.js.map +1 -0
  385. package/dist/esm/internal/printChannel.d.ts +233 -0
  386. package/dist/esm/internal/printChannel.d.ts.map +1 -0
  387. package/dist/esm/internal/printChannel.js +376 -0
  388. package/dist/esm/internal/printChannel.js.map +1 -0
  389. package/dist/esm/internal/printsObservation.d.ts +26 -0
  390. package/dist/esm/internal/printsObservation.d.ts.map +1 -0
  391. package/dist/esm/internal/printsObservation.js +29 -0
  392. package/dist/esm/internal/printsObservation.js.map +1 -0
  393. package/dist/esm/internal/refusal.d.ts +40 -0
  394. package/dist/esm/internal/refusal.d.ts.map +1 -0
  395. package/dist/esm/internal/refusal.js +47 -0
  396. package/dist/esm/internal/refusal.js.map +1 -0
  397. package/dist/esm/internal/supervision.d.ts +174 -0
  398. package/dist/esm/internal/supervision.d.ts.map +1 -0
  399. package/dist/esm/internal/supervision.js +485 -0
  400. package/dist/esm/internal/supervision.js.map +1 -0
  401. package/dist/esm/internal/unfinishedWork.d.ts +99 -0
  402. package/dist/esm/internal/unfinishedWork.d.ts.map +1 -0
  403. package/dist/esm/internal/unfinishedWork.js +85 -0
  404. package/dist/esm/internal/unfinishedWork.js.map +1 -0
  405. package/dist/esm/internal/unobservedCall.d.ts +112 -0
  406. package/dist/esm/internal/unobservedCall.d.ts.map +1 -0
  407. package/dist/esm/internal/unobservedCall.js +501 -0
  408. package/dist/esm/internal/unobservedCall.js.map +1 -0
  409. package/dist/esm/internal/untrustedData.d.ts +14 -0
  410. package/dist/esm/internal/untrustedData.d.ts.map +1 -0
  411. package/dist/esm/internal/untrustedData.js +15 -0
  412. package/dist/esm/internal/untrustedData.js.map +1 -0
  413. package/docs/README.md +129 -0
  414. package/docs/api.md +1869 -0
  415. package/docs/concepts.md +238 -0
  416. package/docs/external-transcripts.md +245 -0
  417. package/docs/guides/bind-flows.md +167 -0
  418. package/docs/guides/drive-the-loop.md +265 -0
  419. package/docs/guides/run-cells.md +262 -0
  420. package/docs/guides/workerd.md +144 -0
  421. package/docs/installation.md +69 -0
  422. package/docs/quickstart.md +121 -0
  423. package/docs/reference.md +954 -0
  424. package/docs/troubleshooting.md +177 -0
  425. package/package.json +463 -3
  426. package/src/AgentEvent.ts +1772 -0
  427. package/src/CallLedger.ts +560 -0
  428. package/src/Cell.ts +926 -0
  429. package/src/CellCalls.ts +198 -0
  430. package/src/CellHistory.ts +128 -0
  431. package/src/CellTurn.ts +4450 -0
  432. package/src/CellValidation.ts +382 -0
  433. package/src/Compaction.ts +330 -0
  434. package/src/CompletionClaim.ts +1013 -0
  435. package/src/ContextWindow.ts +669 -0
  436. package/src/EngineLike.ts +614 -0
  437. package/src/ExternalTranscript.ts +1142 -0
  438. package/src/FailedCall.ts +163 -0
  439. package/src/FlowBinding.ts +603 -0
  440. package/src/HarnessError.ts +98 -0
  441. package/src/Judgement.ts +526 -0
  442. package/src/Monitor.ts +579 -0
  443. package/src/NarrowedCheck.ts +694 -0
  444. package/src/Notifications.ts +262 -0
  445. package/src/Plan.ts +113 -0
  446. package/src/QuickJSSandbox.ts +1557 -0
  447. package/src/Relevance.ts +352 -0
  448. package/src/Sandbox.ts +908 -0
  449. package/src/Steering.ts +405 -0
  450. package/src/StructuredOutput.ts +484 -0
  451. package/src/Sufficiency.ts +247 -0
  452. package/src/Supervisor.ts +798 -0
  453. package/src/Tokens.ts +108 -0
  454. package/src/Transcript.ts +513 -0
  455. package/src/TruncatedOutput.ts +297 -0
  456. package/src/UnmovedTree.ts +121 -0
  457. package/src/UnresolvedFailure.ts +240 -0
  458. package/src/VacuousVerification.ts +280 -0
  459. package/src/VariablesPanel.ts +165 -0
  460. package/src/index.ts +204 -0
  461. package/src/internal/bytes.ts +70 -0
  462. package/src/internal/cellPrompt.ts +337 -0
  463. package/src/internal/compactable.ts +76 -0
  464. package/src/internal/compactionMarks.ts +454 -0
  465. package/src/internal/demandText.ts +145 -0
  466. package/src/internal/elide.ts +130 -0
  467. package/src/internal/frame.ts +1178 -0
  468. package/src/internal/nonNegativeSafeInt.ts +24 -0
  469. package/src/internal/paidUsage.ts +90 -0
  470. package/src/internal/printChannel.ts +434 -0
  471. package/src/internal/printsObservation.ts +31 -0
  472. package/src/internal/refusal.ts +53 -0
  473. package/src/internal/supervision.ts +652 -0
  474. package/src/internal/unfinishedWork.ts +123 -0
  475. package/src/internal/unobservedCall.ts +536 -0
  476. package/src/internal/untrustedData.ts +19 -0
@@ -0,0 +1,3092 @@
1
+ /**
2
+ * Serializable events emitted by harness adapters.
3
+ *
4
+ * @since 0.1.0
5
+ */
6
+ import * as Permission from "@smthrs/capability/Permission";
7
+ import type * as Classifier from "@smthrs/model/Classifier";
8
+ import * as Evaluator from "@smthrs/model/Evaluator";
9
+ import * as ModelEvent from "@smthrs/model/ModelEvent";
10
+ import * as ModelRequest from "@smthrs/model/ModelRequest";
11
+ import { Context, Effect, Schema } from "effect";
12
+ import * as Cell from "./Cell.ts";
13
+ import * as EngineLike from "./EngineLike.ts";
14
+ /**
15
+ * Observes an event before the controller advances or parks. Durable hosts
16
+ * finish their checkpoint here; stream consumers may lag behind the source.
17
+ * @category services
18
+ * @since 1.0.0-rc.0
19
+ */
20
+ export declare const Observer: Context.Reference<(event: AgentEvent) => Effect.Effect<void>>;
21
+ /**
22
+ * Journals an event into the run whose cell called the current flow. The
23
+ * controller provides it around each flow call, so a flow that asks Jev
24
+ * itself journals its receipts beside the run's own. Outside a run there is
25
+ * no journal, and it does nothing.
26
+ * @category services
27
+ * @since 1.0.0-rc.0
28
+ */
29
+ export declare const Journal: Context.Reference<(event: AgentEvent) => Effect.Effect<void>>;
30
+ /**
31
+ * The kind of a human-provided item a relevance reading may withhold.
32
+ *
33
+ * @category models
34
+ * @since 1.0.0-rc.0
35
+ */
36
+ export declare const RelevanceKind: Schema.Literals<readonly ["flow", "skill", "instruction", "memory"]>;
37
+ /**
38
+ * What a compaction reading did with one replaced message.
39
+ *
40
+ * @category models
41
+ * @since 1.0.0-rc.0
42
+ */
43
+ export declare const CompactionMark: Schema.Literals<readonly ["keep", "squash", "remove"]>;
44
+ /**
45
+ * The invariant that kept a message from being removed, whatever it was marked.
46
+ *
47
+ * @category models
48
+ * @since 1.0.0-rc.0
49
+ */
50
+ export declare const CompactionPin: Schema.Literals<readonly ["summary", "person", "steering", "mutated", "failing", "pair", "budget"]>;
51
+ /**
52
+ * Why a compaction ran: the context `budget` was crossed, or a drained
53
+ * supervisor reading found the run carrying `outdated_context` or
54
+ * `irrelevant_context`.
55
+ *
56
+ * @category models
57
+ * @since 1.0.0-rc.0
58
+ */
59
+ export declare const CompactionCause: Schema.Literals<readonly ["budget", "outdated_context", "irrelevant_context"]>;
60
+ /**
61
+ * What a supervisor monitor watches for.
62
+ *
63
+ * @category models
64
+ * @since 1.0.0-rc.0
65
+ */
66
+ export declare const MonitorKind: Schema.Literals<readonly ["mood", "skill", "lint"]>;
67
+ /**
68
+ * The static stance a run's monitors deliver under.
69
+ *
70
+ * @category models
71
+ * @since 1.0.0-rc.0
72
+ */
73
+ export declare const Stance: Schema.Literals<readonly ["careful", "paranoid"]>;
74
+ /**
75
+ * Why a crossed monitor was not delivered.
76
+ *
77
+ * @category models
78
+ * @since 1.0.0-rc.0
79
+ */
80
+ export declare const Suppression: Schema.Literals<readonly ["streak", "cooldown", "limit", "slot"]>;
81
+ /**
82
+ * Why a reading could not be judged: `unconfigured`, `interrupted`, or the
83
+ * transport's own error code.
84
+ *
85
+ * @category models
86
+ * @since 1.0.0-rc.0
87
+ */
88
+ export declare const UnjudgedReason: Schema.Literals<readonly ["interrupted", "unconfigured", "unreachable", "refused", "empty", "timeout", "invalid_answer", "invalid_question"]>;
89
+ declare const DisciplineArmed_base: Schema.Class<DisciplineArmed, Schema.TaggedStruct<"discipline-armed", {
90
+ readonly eventType: Schema.Literal<"flows.harness.discipline-armed.v1">;
91
+ /** Consecutive read-only frames allowed; zero means the cap is disarmed. */
92
+ readonly readOnlyCap: Schema.Number;
93
+ /** The frame budget the run stops at. */
94
+ readonly maxFrames: Schema.Number;
95
+ /**
96
+ * Whether a human can answer this run.
97
+ *
98
+ * False says nothing is listening: a `park` transition is refused and
99
+ * answered in the frame that returned it, because a run that waits for an
100
+ * answer nobody will give has stopped working with its budget unspent.
101
+ */
102
+ readonly approvalChannel: Schema.Boolean;
103
+ /**
104
+ * Wall-clock milliseconds one model call may spend; zero means disarmed.
105
+ *
106
+ * Every other budget here caps the cell — the calls it makes, the memory and
107
+ * time its code spends, the run's frames. This one caps the step in between,
108
+ * which was the only unbounded thing the loop did.
109
+ */
110
+ readonly modelCallMs: Schema.Number;
111
+ /**
112
+ * Consecutive repeat-observation frames allowed; zero disarms the demand.
113
+ *
114
+ * Armed here for the same reason the read-only cap is: a run that never
115
+ * reaches a control proves nothing about whether the control was armed, and
116
+ * a grader must be able to tell "armed and never needed" from "never armed".
117
+ */
118
+ readonly repeatCap: Schema.Number;
119
+ /**
120
+ * Completions this run may have bounced for narrowed evidence; zero disarms.
121
+ *
122
+ * Journaled with the rest because the demand it governs fires at most once
123
+ * in a run and often not at all, so its absence from a wave says nothing on
124
+ * its own. One is the armed default: the loop names the missing check once,
125
+ * and the answer that comes back is the answer that stands.
126
+ */
127
+ readonly narrowingCap: Schema.Number;
128
+ /**
129
+ * Completions this run may have bounced for an unmoved tree; zero disarms.
130
+ *
131
+ * Journaled for the same reason as the other two completion caps: the demand
132
+ * fires at most once and usually not at all, so a wave that records none must
133
+ * be able to say whether the control was armed and never needed.
134
+ */
135
+ readonly unmovedCap: Schema.Number;
136
+ /**
137
+ * Times one frame may answer its own unparseable cell before ending; zero
138
+ * disarms the answer.
139
+ *
140
+ * Journaled with the rest because a wave that records no
141
+ * `cell-rejected-in-frame` must be able to say whether the answer was armed
142
+ * and never needed or never armed at all.
143
+ */
144
+ readonly revalidations: Schema.withDecodingDefaultKey<Schema.withConstructorDefault<Schema.Number>, never>;
145
+ /**
146
+ * Completions this run may have bounced for a failing check it replaced
147
+ * rather than answered; zero disarms.
148
+ */
149
+ readonly unresolvedCap: Schema.Number;
150
+ /**
151
+ * Completions this run may have bounced for a claim its own record does not
152
+ * support; zero disarms.
153
+ *
154
+ * Journaled with the other completion caps, and it says less than they do on
155
+ * its own: the control it arms is also a no-op wherever no `Evaluator` is
156
+ * bound, so an armed cap and no `claim-demanded` event anywhere in a run
157
+ * means either that nothing was asked or that everything asked came back
158
+ * inside the thresholds. Defaulted so journals written before this control
159
+ * existed decode unchanged. See `CompletionClaim`.
160
+ */
161
+ readonly claimCap: Schema.withDecodingDefaultKey<Schema.withConstructorDefault<Schema.Number>, never>;
162
+ /**
163
+ * Whether a supervisor reading could nudge the run, as journals written
164
+ * before {@link judged} said it. Later writers omit it: `judged` says the
165
+ * same.
166
+ */
167
+ readonly supervisorSteer: Schema.optional<Schema.Boolean>;
168
+ /** Maximum calls per cell, when this binding can enforce one. */
169
+ readonly calls: Schema.optional<Schema.Number>;
170
+ /** Maximum sandbox heap, when this binding can enforce one. */
171
+ readonly memoryBytes: Schema.optional<Schema.Number>;
172
+ /** Maximum interpreter steps, when this binding can enforce one. */
173
+ readonly steps: Schema.optional<Schema.Number>;
174
+ /** Maximum cell-compute time, when this binding can enforce one. */
175
+ readonly timeMs: Schema.optional<Schema.Number>;
176
+ /** Maximum whole-evaluation time, when this binding can enforce one. */
177
+ readonly totalMs: Schema.optional<Schema.Number>;
178
+ /** Maximum wall-clock time for one flow call. */
179
+ readonly callMs: Schema.optional<Schema.Number>;
180
+ /** Whether a judge was bound, so Jev's readings run. Absent before it existed. */
181
+ readonly judged: Schema.optional<Schema.Boolean>;
182
+ /** The relevance gate: the withhold threshold and the item ids never offered to it. */
183
+ readonly relevance: Schema.optional<Schema.Struct<{
184
+ readonly withholdAt: Schema.Number;
185
+ readonly pinned: Schema.$Array<Schema.String>;
186
+ }>>;
187
+ /** The supervisor monitors armed, with their delivery gates. */
188
+ readonly monitors: Schema.optional<Schema.$Array<Schema.Struct<{
189
+ readonly id: Schema.String;
190
+ readonly kind: Schema.Literals<readonly ["mood", "skill", "lint"]>;
191
+ /** The probability at or above which the monitor crosses. */
192
+ readonly at: Schema.Number;
193
+ /** Consecutive crossed readings required before a delivery. */
194
+ readonly consecutive: Schema.Int;
195
+ /** Frames after a delivery during which the monitor is not delivered again. */
196
+ readonly cooldownFrames: Schema.Int;
197
+ /** Deliveries allowed in one run. */
198
+ readonly limit: Schema.Int;
199
+ }>>>;
200
+ /** The static stance the monitors deliver under. */
201
+ readonly stance: Schema.optional<Schema.Literals<readonly ["careful", "paranoid"]>>;
202
+ }>, {}>;
203
+ /**
204
+ * The loop discipline a run was armed with, journaled once when it starts.
205
+ *
206
+ * Arming used to be observable only through the events a disciplined run
207
+ * *reaches*: the read-cap failure proves the cap was armed, and a run that
208
+ * times out before it fires proves nothing — so a grader could not tell "armed
209
+ * but never reached" from "never armed", which is exactly what the 2026-08-19
210
+ * SWE-bench wave could not decide about its django instance. This event is the
211
+ * positive record: it says what was armed, before anything has had a chance to
212
+ * fire.
213
+ *
214
+ * @category events
215
+ * @since 0.1.0
216
+ * @slop
217
+ */
218
+ export declare class DisciplineArmed extends DisciplineArmed_base {
219
+ }
220
+ declare const TurnOpened_base: Schema.Class<TurnOpened, Schema.TaggedStruct<"turn-opened", {
221
+ readonly eventType: Schema.Literal<"flows.harness.turn-opened.v1">;
222
+ readonly seat: Schema.String;
223
+ readonly modelParams: typeof ModelRequest.GenerationParams;
224
+ /**
225
+ * The tool set the turn opened with, which the cell-first controller always
226
+ * opens empty: it declares no provider tools. The field stays on the event
227
+ * so journals written before the provider-tool loop was retired keep
228
+ * decoding, and so a foreign-adapter loop has somewhere to put one.
229
+ */
230
+ readonly activeToolNames: Schema.$Array<Schema.String>;
231
+ readonly contextDigest: Schema.String;
232
+ }>, {}>;
233
+ /**
234
+ * The serializable snapshot fixed when a turn opens.
235
+ *
236
+ * @category events
237
+ * @since 0.1.0
238
+ * @slop
239
+ */
240
+ export declare class TurnOpened extends TurnOpened_base {
241
+ }
242
+ declare const ModelRequested_base: Schema.Class<ModelRequested, Schema.TaggedStruct<"model-requested", {
243
+ readonly eventType: Schema.Literal<"flows.harness.model-requested.v1">;
244
+ /** The run's session, which is the recorded scope of the step that made the call. */
245
+ readonly scope: Schema.String;
246
+ /** The controller's frame number for the turn this call belongs to. */
247
+ readonly frame: Schema.Int;
248
+ /** Which model call of that frame and purpose this is, counting from one. */
249
+ readonly attempt: Schema.Int;
250
+ /** What the call is for: the frame's own turn, or the compaction ahead of it. */
251
+ readonly purpose: Schema.Literals<readonly ["frame", "compaction"]>;
252
+ /** The seat the frame ran on, as `turn-opened` names it. */
253
+ readonly seat: Schema.String;
254
+ /** The route the host resolved, absent where the host names none. */
255
+ readonly binding: Schema.optional<typeof EngineLike.Binding>;
256
+ /** The request the provider is sent, whole: after any rewrite the host applies. */
257
+ readonly request: typeof ModelRequest.ModelRequest;
258
+ }>, {}>;
259
+ /**
260
+ * What one model call was asked, written before the call is made.
261
+ *
262
+ * `model-settled` journals what a call answered and what it cost, and until
263
+ * this event nothing journaled what it was asked: the request existed only in
264
+ * the sealed step's key material, as a digest. A reader that wants to open one
265
+ * step and run it again needs the request itself, so this is the request
266
+ * itself, carried whole here and bounded where it is journaled.
267
+ *
268
+ * It is written when the call is OPENED rather than when it settles, so a call
269
+ * that never settles (a deadline, a refusal, a process that died mid-stream)
270
+ * still leaves what it asked on the record.
271
+ *
272
+ * `scope`, `frame` and `attempt` are the join keys, and they are on the record
273
+ * because position is not one. `scope` is the run's session, which for a
274
+ * module step is the step's recorded scope; `frame` is the controller's own
275
+ * frame number; `attempt` counts the model calls one frame made, from one,
276
+ * and is the same number `cell-rejected-in-frame` names when it refuses that
277
+ * call's answer. A compaction call runs before its frame's `turn-opened`, so a
278
+ * reader counting turns would file it under the frame before; `purpose` and
279
+ * `frame` say where it belongs.
280
+ *
281
+ * Credential-free by construction. The request is the provider-neutral
282
+ * `ModelRequest`, which has no member a credential can occupy, and
283
+ * {@link EngineLike.Binding} carries two names read off the prepared request
284
+ * that exists before any secret is signed on.
285
+ *
286
+ * @category events
287
+ * @since 1.0.0-rc.0
288
+ */
289
+ export declare class ModelRequested extends ModelRequested_base {
290
+ }
291
+ declare const ModelSelected_base: Schema.Class<ModelSelected, Schema.TaggedStruct<"model-selected", {
292
+ readonly eventType: Schema.Literal<"flows.harness.model-selected.v1">;
293
+ readonly seat: Schema.String;
294
+ }>, {}>;
295
+ /**
296
+ * The host selected the seat that will receive this capacity attempt.
297
+ * @category events
298
+ * @since 1.0.0-rc.1
299
+ */
300
+ export declare class ModelSelected extends ModelSelected_base {
301
+ }
302
+ declare const SeatFailedOver_base: Schema.Class<SeatFailedOver, Schema.TaggedStruct<"seat-failed-over", {
303
+ readonly eventType: Schema.Literal<"flows.harness.seat-failed-over.v1">;
304
+ readonly from: Schema.String;
305
+ readonly to: Schema.String;
306
+ readonly code: Schema.Literals<readonly ["invalid_request", "context_overflow", "no_route", "authentication", "rate_limited", "quota_exceeded", "out_of_credit", "content_policy", "provider_internal", "transport", "call_timeout", "invalid_provider_output", "unknown"]>;
307
+ readonly resetAtEpochMillis: Schema.optional<Schema.Number>;
308
+ readonly retryAfterMillis: Schema.optional<Schema.Number>;
309
+ readonly httpStatus: Schema.optional<Schema.Number>;
310
+ readonly quotaScope: Schema.optional<Schema.Literals<readonly ["account", "model"]>>;
311
+ }>, {}>;
312
+ /**
313
+ * A capacity refusal moved the current frame to another seat.
314
+ * @category events
315
+ * @since 1.0.0-rc.1
316
+ */
317
+ export declare class SeatFailedOver extends SeatFailedOver_base {
318
+ }
319
+ declare const ModelParked_base: Schema.Class<ModelParked, Schema.TaggedStruct<"model-parked", {
320
+ readonly eventType: Schema.Literal<"flows.harness.model-parked.v1">;
321
+ readonly seat: Schema.String;
322
+ readonly wakeAt: Schema.Number;
323
+ readonly source: Schema.Literals<readonly ["reset", "retry-after", "default"]>;
324
+ readonly code: Schema.Literals<readonly ["invalid_request", "context_overflow", "no_route", "authentication", "rate_limited", "quota_exceeded", "out_of_credit", "content_policy", "provider_internal", "transport", "call_timeout", "invalid_provider_output", "unknown"]>;
325
+ }>, {}>;
326
+ /**
327
+ * All configured model seats are cooling until this instant.
328
+ * @category events
329
+ * @since 1.0.0-rc.1
330
+ */
331
+ export declare class ModelParked extends ModelParked_base {
332
+ }
333
+ declare const ModelUnparked_base: Schema.Class<ModelUnparked, Schema.TaggedStruct<"model-unparked", {
334
+ readonly eventType: Schema.Literal<"flows.harness.model-unparked.v1">;
335
+ readonly seat: Schema.String;
336
+ readonly at: Schema.Number;
337
+ }>, {}>;
338
+ /**
339
+ * A parked model frame may issue a new request.
340
+ * @category events
341
+ * @since 1.0.0-rc.1
342
+ */
343
+ export declare class ModelUnparked extends ModelUnparked_base {
344
+ }
345
+ declare const ModelDelta_base: Schema.Class<ModelDelta, Schema.TaggedStruct<"model-delta", {
346
+ readonly eventType: Schema.Literal<"flows.harness.model-delta.v1">;
347
+ readonly delta: Schema.Union<readonly [Schema.Struct<{
348
+ readonly type: Schema.Literal<"text-start">;
349
+ readonly id: Schema.String;
350
+ }>, Schema.Struct<{
351
+ readonly type: Schema.Literal<"text-delta">;
352
+ readonly id: Schema.String;
353
+ readonly text: Schema.String;
354
+ }>, Schema.Struct<{
355
+ readonly type: Schema.Literal<"text-end">;
356
+ readonly id: Schema.String;
357
+ }>, Schema.Struct<{
358
+ readonly type: Schema.Literal<"thinking-start">;
359
+ readonly id: Schema.String;
360
+ readonly signature: Schema.optional<Schema.String>;
361
+ }>, Schema.Struct<{
362
+ readonly type: Schema.Literal<"thinking-delta">;
363
+ readonly id: Schema.String;
364
+ readonly text: Schema.String;
365
+ }>, Schema.Struct<{
366
+ readonly type: Schema.Literal<"thinking-end">;
367
+ readonly id: Schema.String;
368
+ }>, Schema.Struct<{
369
+ readonly type: Schema.Literal<"tool-call-start">;
370
+ readonly id: Schema.String;
371
+ readonly name: Schema.String;
372
+ }>, Schema.Struct<{
373
+ readonly type: Schema.Literal<"tool-call-delta">;
374
+ readonly id: Schema.String;
375
+ readonly arguments: Schema.String;
376
+ }>, Schema.Struct<{
377
+ readonly type: Schema.Literal<"tool-call-end">;
378
+ readonly id: Schema.String;
379
+ readonly arguments: Schema.optional<Schema.String>;
380
+ }>, Schema.Struct<{
381
+ readonly type: Schema.Literal<"tool-result">;
382
+ readonly id: Schema.String;
383
+ readonly output: Schema.String;
384
+ readonly isError: Schema.optional<Schema.Boolean>;
385
+ }>, Schema.Struct<{
386
+ readonly type: Schema.Literal<"usage">;
387
+ readonly inputTokens: Schema.optional<Schema.Number>;
388
+ readonly outputTokens: Schema.optional<Schema.Number>;
389
+ readonly reasoningTokens: Schema.optional<Schema.Number>;
390
+ readonly cachedInputTokens: Schema.optional<Schema.Number>;
391
+ readonly cacheWriteTokens: Schema.optional<Schema.Number>;
392
+ readonly totalTokens: Schema.optional<Schema.Number>;
393
+ readonly costUsd: Schema.optional<Schema.Number>;
394
+ }>, Schema.Struct<{
395
+ readonly type: Schema.Literal<"retry">;
396
+ readonly attempt: Schema.Int;
397
+ readonly code: Schema.String;
398
+ readonly delayMillis: Schema.withDecodingDefaultKey<Schema.withConstructorDefault<Schema.Number>, never>;
399
+ }>, Schema.Struct<{
400
+ readonly type: Schema.Literal<"settle">;
401
+ readonly stopReason: Schema.Literals<readonly ["stop", "length", "tool-calls", "content-filter", "error", "aborted", "unknown"]>;
402
+ readonly responseId: Schema.optional<Schema.String>;
403
+ readonly sessionId: Schema.optional<Schema.String>;
404
+ readonly itemIds: Schema.optional<Schema.$Array<Schema.String>>;
405
+ }>]> & {
406
+ readonly discriminants: readonly ["text-start", "text-delta", "text-end", "thinking-start", "thinking-delta", "thinking-end", "tool-call-start", "tool-call-delta", "tool-call-end", "tool-result", "usage", "retry", "settle"];
407
+ readonly cases: {
408
+ "text-start": Schema.Struct<{
409
+ readonly type: Schema.Literal<"text-start">;
410
+ readonly id: Schema.String;
411
+ }>;
412
+ "text-delta": Schema.Struct<{
413
+ readonly type: Schema.Literal<"text-delta">;
414
+ readonly id: Schema.String;
415
+ readonly text: Schema.String;
416
+ }>;
417
+ "text-end": Schema.Struct<{
418
+ readonly type: Schema.Literal<"text-end">;
419
+ readonly id: Schema.String;
420
+ }>;
421
+ "thinking-start": Schema.Struct<{
422
+ readonly type: Schema.Literal<"thinking-start">;
423
+ readonly id: Schema.String;
424
+ readonly signature: Schema.optional<Schema.String>;
425
+ }>;
426
+ "thinking-delta": Schema.Struct<{
427
+ readonly type: Schema.Literal<"thinking-delta">;
428
+ readonly id: Schema.String;
429
+ readonly text: Schema.String;
430
+ }>;
431
+ "thinking-end": Schema.Struct<{
432
+ readonly type: Schema.Literal<"thinking-end">;
433
+ readonly id: Schema.String;
434
+ }>;
435
+ "tool-call-start": Schema.Struct<{
436
+ readonly type: Schema.Literal<"tool-call-start">;
437
+ readonly id: Schema.String;
438
+ readonly name: Schema.String;
439
+ }>;
440
+ "tool-call-delta": Schema.Struct<{
441
+ readonly type: Schema.Literal<"tool-call-delta">;
442
+ readonly id: Schema.String;
443
+ readonly arguments: Schema.String;
444
+ }>;
445
+ "tool-call-end": Schema.Struct<{
446
+ readonly type: Schema.Literal<"tool-call-end">;
447
+ readonly id: Schema.String;
448
+ readonly arguments: Schema.optional<Schema.String>;
449
+ }>;
450
+ "tool-result": Schema.Struct<{
451
+ readonly type: Schema.Literal<"tool-result">;
452
+ readonly id: Schema.String;
453
+ readonly output: Schema.String;
454
+ readonly isError: Schema.optional<Schema.Boolean>;
455
+ }>;
456
+ usage: Schema.Struct<{
457
+ readonly type: Schema.Literal<"usage">;
458
+ readonly inputTokens: Schema.optional<Schema.Number>;
459
+ readonly outputTokens: Schema.optional<Schema.Number>;
460
+ readonly reasoningTokens: Schema.optional<Schema.Number>;
461
+ readonly cachedInputTokens: Schema.optional<Schema.Number>;
462
+ readonly cacheWriteTokens: Schema.optional<Schema.Number>;
463
+ readonly totalTokens: Schema.optional<Schema.Number>;
464
+ readonly costUsd: Schema.optional<Schema.Number>;
465
+ }>;
466
+ retry: Schema.Struct<{
467
+ readonly type: Schema.Literal<"retry">;
468
+ readonly attempt: Schema.Int;
469
+ readonly code: Schema.String;
470
+ readonly delayMillis: Schema.withDecodingDefaultKey<Schema.withConstructorDefault<Schema.Number>, never>;
471
+ }>;
472
+ settle: Schema.Struct<{
473
+ readonly type: Schema.Literal<"settle">;
474
+ readonly stopReason: Schema.Literals<readonly ["stop", "length", "tool-calls", "content-filter", "error", "aborted", "unknown"]>;
475
+ readonly responseId: Schema.optional<Schema.String>;
476
+ readonly sessionId: Schema.optional<Schema.String>;
477
+ readonly itemIds: Schema.optional<Schema.$Array<Schema.String>>;
478
+ }>;
479
+ };
480
+ readonly isAnyOf: <const Keys>(keys: readonly Keys[]) => (value: {
481
+ readonly type: "text-start";
482
+ readonly id: string;
483
+ } | {
484
+ readonly type: "text-delta";
485
+ readonly id: string;
486
+ readonly text: string;
487
+ } | {
488
+ readonly type: "text-end";
489
+ readonly id: string;
490
+ } | {
491
+ readonly id: string;
492
+ readonly type: "thinking-start";
493
+ readonly signature?: string | undefined;
494
+ } | {
495
+ readonly type: "thinking-delta";
496
+ readonly id: string;
497
+ readonly text: string;
498
+ } | {
499
+ readonly type: "thinking-end";
500
+ readonly id: string;
501
+ } | {
502
+ readonly type: "tool-call-start";
503
+ readonly id: string;
504
+ readonly name: string;
505
+ } | {
506
+ readonly type: "tool-call-delta";
507
+ readonly id: string;
508
+ readonly arguments: string;
509
+ } | {
510
+ readonly id: string;
511
+ readonly type: "tool-call-end";
512
+ readonly arguments?: string | undefined;
513
+ } | {
514
+ readonly id: string;
515
+ readonly type: "tool-result";
516
+ readonly output: string;
517
+ readonly isError?: boolean | undefined;
518
+ } | {
519
+ readonly type: "usage";
520
+ readonly inputTokens?: number | undefined;
521
+ readonly outputTokens?: number | undefined;
522
+ readonly reasoningTokens?: number | undefined;
523
+ readonly cachedInputTokens?: number | undefined;
524
+ readonly cacheWriteTokens?: number | undefined;
525
+ readonly totalTokens?: number | undefined;
526
+ readonly costUsd?: number | undefined;
527
+ } | {
528
+ readonly type: "retry";
529
+ readonly attempt: number;
530
+ readonly code: string;
531
+ readonly delayMillis: number;
532
+ } | {
533
+ readonly type: "settle";
534
+ readonly stopReason: "length" | "aborted" | "error" | "stop" | "unknown" | "tool-calls" | "content-filter";
535
+ readonly responseId?: string | undefined;
536
+ readonly itemIds?: readonly string[] | undefined;
537
+ readonly sessionId?: string | undefined;
538
+ }) => value is Extract<{
539
+ readonly type: "text-start";
540
+ readonly id: string;
541
+ }, {
542
+ readonly type: Keys;
543
+ }> | Extract<{
544
+ readonly type: "text-delta";
545
+ readonly id: string;
546
+ readonly text: string;
547
+ }, {
548
+ readonly type: Keys;
549
+ }> | Extract<{
550
+ readonly type: "text-end";
551
+ readonly id: string;
552
+ }, {
553
+ readonly type: Keys;
554
+ }> | Extract<{
555
+ readonly id: string;
556
+ readonly type: "thinking-start";
557
+ readonly signature?: string | undefined;
558
+ }, {
559
+ readonly type: Keys;
560
+ }> | Extract<{
561
+ readonly type: "thinking-delta";
562
+ readonly id: string;
563
+ readonly text: string;
564
+ }, {
565
+ readonly type: Keys;
566
+ }> | Extract<{
567
+ readonly type: "thinking-end";
568
+ readonly id: string;
569
+ }, {
570
+ readonly type: Keys;
571
+ }> | Extract<{
572
+ readonly type: "tool-call-start";
573
+ readonly id: string;
574
+ readonly name: string;
575
+ }, {
576
+ readonly type: Keys;
577
+ }> | Extract<{
578
+ readonly type: "tool-call-delta";
579
+ readonly id: string;
580
+ readonly arguments: string;
581
+ }, {
582
+ readonly type: Keys;
583
+ }> | Extract<{
584
+ readonly id: string;
585
+ readonly type: "tool-call-end";
586
+ readonly arguments?: string | undefined;
587
+ }, {
588
+ readonly type: Keys;
589
+ }> | Extract<{
590
+ readonly id: string;
591
+ readonly type: "tool-result";
592
+ readonly output: string;
593
+ readonly isError?: boolean | undefined;
594
+ }, {
595
+ readonly type: Keys;
596
+ }> | Extract<{
597
+ readonly type: "usage";
598
+ readonly inputTokens?: number | undefined;
599
+ readonly outputTokens?: number | undefined;
600
+ readonly reasoningTokens?: number | undefined;
601
+ readonly cachedInputTokens?: number | undefined;
602
+ readonly cacheWriteTokens?: number | undefined;
603
+ readonly totalTokens?: number | undefined;
604
+ readonly costUsd?: number | undefined;
605
+ }, {
606
+ readonly type: Keys;
607
+ }> | Extract<{
608
+ readonly type: "retry";
609
+ readonly attempt: number;
610
+ readonly code: string;
611
+ readonly delayMillis: number;
612
+ }, {
613
+ readonly type: Keys;
614
+ }> | Extract<{
615
+ readonly type: "settle";
616
+ readonly stopReason: "length" | "aborted" | "error" | "stop" | "unknown" | "tool-calls" | "content-filter";
617
+ readonly responseId?: string | undefined;
618
+ readonly itemIds?: readonly string[] | undefined;
619
+ readonly sessionId?: string | undefined;
620
+ }, {
621
+ readonly type: Keys;
622
+ }>;
623
+ readonly guards: {
624
+ "text-start": (u: unknown) => u is {
625
+ readonly type: "text-start";
626
+ readonly id: string;
627
+ };
628
+ "text-delta": (u: unknown) => u is {
629
+ readonly type: "text-delta";
630
+ readonly id: string;
631
+ readonly text: string;
632
+ };
633
+ "text-end": (u: unknown) => u is {
634
+ readonly type: "text-end";
635
+ readonly id: string;
636
+ };
637
+ "thinking-start": (u: unknown) => u is {
638
+ readonly id: string;
639
+ readonly type: "thinking-start";
640
+ readonly signature?: string | undefined;
641
+ };
642
+ "thinking-delta": (u: unknown) => u is {
643
+ readonly type: "thinking-delta";
644
+ readonly id: string;
645
+ readonly text: string;
646
+ };
647
+ "thinking-end": (u: unknown) => u is {
648
+ readonly type: "thinking-end";
649
+ readonly id: string;
650
+ };
651
+ "tool-call-start": (u: unknown) => u is {
652
+ readonly type: "tool-call-start";
653
+ readonly id: string;
654
+ readonly name: string;
655
+ };
656
+ "tool-call-delta": (u: unknown) => u is {
657
+ readonly type: "tool-call-delta";
658
+ readonly id: string;
659
+ readonly arguments: string;
660
+ };
661
+ "tool-call-end": (u: unknown) => u is {
662
+ readonly id: string;
663
+ readonly type: "tool-call-end";
664
+ readonly arguments?: string | undefined;
665
+ };
666
+ "tool-result": (u: unknown) => u is {
667
+ readonly id: string;
668
+ readonly type: "tool-result";
669
+ readonly output: string;
670
+ readonly isError?: boolean | undefined;
671
+ };
672
+ usage: (u: unknown) => u is {
673
+ readonly type: "usage";
674
+ readonly inputTokens?: number | undefined;
675
+ readonly outputTokens?: number | undefined;
676
+ readonly reasoningTokens?: number | undefined;
677
+ readonly cachedInputTokens?: number | undefined;
678
+ readonly cacheWriteTokens?: number | undefined;
679
+ readonly totalTokens?: number | undefined;
680
+ readonly costUsd?: number | undefined;
681
+ };
682
+ retry: (u: unknown) => u is {
683
+ readonly type: "retry";
684
+ readonly attempt: number;
685
+ readonly code: string;
686
+ readonly delayMillis: number;
687
+ };
688
+ settle: (u: unknown) => u is {
689
+ readonly type: "settle";
690
+ readonly stopReason: "length" | "aborted" | "error" | "stop" | "unknown" | "tool-calls" | "content-filter";
691
+ readonly responseId?: string | undefined;
692
+ readonly itemIds?: readonly string[] | undefined;
693
+ readonly sessionId?: string | undefined;
694
+ };
695
+ };
696
+ readonly match: {
697
+ <Cases extends {
698
+ "text-start": (value: {
699
+ readonly type: "text-start";
700
+ readonly id: string;
701
+ }) => any;
702
+ "text-delta": (value: {
703
+ readonly type: "text-delta";
704
+ readonly id: string;
705
+ readonly text: string;
706
+ }) => any;
707
+ "text-end": (value: {
708
+ readonly type: "text-end";
709
+ readonly id: string;
710
+ }) => any;
711
+ "thinking-start": (value: {
712
+ readonly id: string;
713
+ readonly type: "thinking-start";
714
+ readonly signature?: string | undefined;
715
+ }) => any;
716
+ "thinking-delta": (value: {
717
+ readonly type: "thinking-delta";
718
+ readonly id: string;
719
+ readonly text: string;
720
+ }) => any;
721
+ "thinking-end": (value: {
722
+ readonly type: "thinking-end";
723
+ readonly id: string;
724
+ }) => any;
725
+ "tool-call-start": (value: {
726
+ readonly type: "tool-call-start";
727
+ readonly id: string;
728
+ readonly name: string;
729
+ }) => any;
730
+ "tool-call-delta": (value: {
731
+ readonly type: "tool-call-delta";
732
+ readonly id: string;
733
+ readonly arguments: string;
734
+ }) => any;
735
+ "tool-call-end": (value: {
736
+ readonly id: string;
737
+ readonly type: "tool-call-end";
738
+ readonly arguments?: string | undefined;
739
+ }) => any;
740
+ "tool-result": (value: {
741
+ readonly id: string;
742
+ readonly type: "tool-result";
743
+ readonly output: string;
744
+ readonly isError?: boolean | undefined;
745
+ }) => any;
746
+ usage: (value: {
747
+ readonly type: "usage";
748
+ readonly inputTokens?: number | undefined;
749
+ readonly outputTokens?: number | undefined;
750
+ readonly reasoningTokens?: number | undefined;
751
+ readonly cachedInputTokens?: number | undefined;
752
+ readonly cacheWriteTokens?: number | undefined;
753
+ readonly totalTokens?: number | undefined;
754
+ readonly costUsd?: number | undefined;
755
+ }) => any;
756
+ retry: (value: {
757
+ readonly type: "retry";
758
+ readonly attempt: number;
759
+ readonly code: string;
760
+ readonly delayMillis: number;
761
+ }) => any;
762
+ settle: (value: {
763
+ readonly type: "settle";
764
+ readonly stopReason: "length" | "aborted" | "error" | "stop" | "unknown" | "tool-calls" | "content-filter";
765
+ readonly responseId?: string | undefined;
766
+ readonly itemIds?: readonly string[] | undefined;
767
+ readonly sessionId?: string | undefined;
768
+ }) => any;
769
+ }>(value: {
770
+ readonly type: "text-start";
771
+ readonly id: string;
772
+ } | {
773
+ readonly type: "text-delta";
774
+ readonly id: string;
775
+ readonly text: string;
776
+ } | {
777
+ readonly type: "text-end";
778
+ readonly id: string;
779
+ } | {
780
+ readonly id: string;
781
+ readonly type: "thinking-start";
782
+ readonly signature?: string | undefined;
783
+ } | {
784
+ readonly type: "thinking-delta";
785
+ readonly id: string;
786
+ readonly text: string;
787
+ } | {
788
+ readonly type: "thinking-end";
789
+ readonly id: string;
790
+ } | {
791
+ readonly type: "tool-call-start";
792
+ readonly id: string;
793
+ readonly name: string;
794
+ } | {
795
+ readonly type: "tool-call-delta";
796
+ readonly id: string;
797
+ readonly arguments: string;
798
+ } | {
799
+ readonly id: string;
800
+ readonly type: "tool-call-end";
801
+ readonly arguments?: string | undefined;
802
+ } | {
803
+ readonly id: string;
804
+ readonly type: "tool-result";
805
+ readonly output: string;
806
+ readonly isError?: boolean | undefined;
807
+ } | {
808
+ readonly type: "usage";
809
+ readonly inputTokens?: number | undefined;
810
+ readonly outputTokens?: number | undefined;
811
+ readonly reasoningTokens?: number | undefined;
812
+ readonly cachedInputTokens?: number | undefined;
813
+ readonly cacheWriteTokens?: number | undefined;
814
+ readonly totalTokens?: number | undefined;
815
+ readonly costUsd?: number | undefined;
816
+ } | {
817
+ readonly type: "retry";
818
+ readonly attempt: number;
819
+ readonly code: string;
820
+ readonly delayMillis: number;
821
+ } | {
822
+ readonly type: "settle";
823
+ readonly stopReason: "length" | "aborted" | "error" | "stop" | "unknown" | "tool-calls" | "content-filter";
824
+ readonly responseId?: string | undefined;
825
+ readonly itemIds?: readonly string[] | undefined;
826
+ readonly sessionId?: string | undefined;
827
+ }, cases: Cases): Cases[keyof Cases] extends (value: any) => infer R ? import("effect/Unify").Unify<R> : never;
828
+ <Cases extends {
829
+ "text-start": (value: {
830
+ readonly type: "text-start";
831
+ readonly id: string;
832
+ }) => any;
833
+ "text-delta": (value: {
834
+ readonly type: "text-delta";
835
+ readonly id: string;
836
+ readonly text: string;
837
+ }) => any;
838
+ "text-end": (value: {
839
+ readonly type: "text-end";
840
+ readonly id: string;
841
+ }) => any;
842
+ "thinking-start": (value: {
843
+ readonly id: string;
844
+ readonly type: "thinking-start";
845
+ readonly signature?: string | undefined;
846
+ }) => any;
847
+ "thinking-delta": (value: {
848
+ readonly type: "thinking-delta";
849
+ readonly id: string;
850
+ readonly text: string;
851
+ }) => any;
852
+ "thinking-end": (value: {
853
+ readonly type: "thinking-end";
854
+ readonly id: string;
855
+ }) => any;
856
+ "tool-call-start": (value: {
857
+ readonly type: "tool-call-start";
858
+ readonly id: string;
859
+ readonly name: string;
860
+ }) => any;
861
+ "tool-call-delta": (value: {
862
+ readonly type: "tool-call-delta";
863
+ readonly id: string;
864
+ readonly arguments: string;
865
+ }) => any;
866
+ "tool-call-end": (value: {
867
+ readonly id: string;
868
+ readonly type: "tool-call-end";
869
+ readonly arguments?: string | undefined;
870
+ }) => any;
871
+ "tool-result": (value: {
872
+ readonly id: string;
873
+ readonly type: "tool-result";
874
+ readonly output: string;
875
+ readonly isError?: boolean | undefined;
876
+ }) => any;
877
+ usage: (value: {
878
+ readonly type: "usage";
879
+ readonly inputTokens?: number | undefined;
880
+ readonly outputTokens?: number | undefined;
881
+ readonly reasoningTokens?: number | undefined;
882
+ readonly cachedInputTokens?: number | undefined;
883
+ readonly cacheWriteTokens?: number | undefined;
884
+ readonly totalTokens?: number | undefined;
885
+ readonly costUsd?: number | undefined;
886
+ }) => any;
887
+ retry: (value: {
888
+ readonly type: "retry";
889
+ readonly attempt: number;
890
+ readonly code: string;
891
+ readonly delayMillis: number;
892
+ }) => any;
893
+ settle: (value: {
894
+ readonly type: "settle";
895
+ readonly stopReason: "length" | "aborted" | "error" | "stop" | "unknown" | "tool-calls" | "content-filter";
896
+ readonly responseId?: string | undefined;
897
+ readonly itemIds?: readonly string[] | undefined;
898
+ readonly sessionId?: string | undefined;
899
+ }) => any;
900
+ }>(cases: Cases): (value: {
901
+ readonly type: "text-start";
902
+ readonly id: string;
903
+ } | {
904
+ readonly type: "text-delta";
905
+ readonly id: string;
906
+ readonly text: string;
907
+ } | {
908
+ readonly type: "text-end";
909
+ readonly id: string;
910
+ } | {
911
+ readonly id: string;
912
+ readonly type: "thinking-start";
913
+ readonly signature?: string | undefined;
914
+ } | {
915
+ readonly type: "thinking-delta";
916
+ readonly id: string;
917
+ readonly text: string;
918
+ } | {
919
+ readonly type: "thinking-end";
920
+ readonly id: string;
921
+ } | {
922
+ readonly type: "tool-call-start";
923
+ readonly id: string;
924
+ readonly name: string;
925
+ } | {
926
+ readonly type: "tool-call-delta";
927
+ readonly id: string;
928
+ readonly arguments: string;
929
+ } | {
930
+ readonly id: string;
931
+ readonly type: "tool-call-end";
932
+ readonly arguments?: string | undefined;
933
+ } | {
934
+ readonly id: string;
935
+ readonly type: "tool-result";
936
+ readonly output: string;
937
+ readonly isError?: boolean | undefined;
938
+ } | {
939
+ readonly type: "usage";
940
+ readonly inputTokens?: number | undefined;
941
+ readonly outputTokens?: number | undefined;
942
+ readonly reasoningTokens?: number | undefined;
943
+ readonly cachedInputTokens?: number | undefined;
944
+ readonly cacheWriteTokens?: number | undefined;
945
+ readonly totalTokens?: number | undefined;
946
+ readonly costUsd?: number | undefined;
947
+ } | {
948
+ readonly type: "retry";
949
+ readonly attempt: number;
950
+ readonly code: string;
951
+ readonly delayMillis: number;
952
+ } | {
953
+ readonly type: "settle";
954
+ readonly stopReason: "length" | "aborted" | "error" | "stop" | "unknown" | "tool-calls" | "content-filter";
955
+ readonly responseId?: string | undefined;
956
+ readonly itemIds?: readonly string[] | undefined;
957
+ readonly sessionId?: string | undefined;
958
+ }) => Cases[keyof Cases] extends (value: any) => infer R ? import("effect/Unify").Unify<R> : never;
959
+ };
960
+ readonly matchOrElse: {
961
+ <Cases extends {
962
+ "text-start"?: (value: {
963
+ readonly type: "text-start";
964
+ readonly id: string;
965
+ }) => any;
966
+ "text-delta"?: (value: {
967
+ readonly type: "text-delta";
968
+ readonly id: string;
969
+ readonly text: string;
970
+ }) => any;
971
+ "text-end"?: (value: {
972
+ readonly type: "text-end";
973
+ readonly id: string;
974
+ }) => any;
975
+ "thinking-start"?: (value: {
976
+ readonly id: string;
977
+ readonly type: "thinking-start";
978
+ readonly signature?: string | undefined;
979
+ }) => any;
980
+ "thinking-delta"?: (value: {
981
+ readonly type: "thinking-delta";
982
+ readonly id: string;
983
+ readonly text: string;
984
+ }) => any;
985
+ "thinking-end"?: (value: {
986
+ readonly type: "thinking-end";
987
+ readonly id: string;
988
+ }) => any;
989
+ "tool-call-start"?: (value: {
990
+ readonly type: "tool-call-start";
991
+ readonly id: string;
992
+ readonly name: string;
993
+ }) => any;
994
+ "tool-call-delta"?: (value: {
995
+ readonly type: "tool-call-delta";
996
+ readonly id: string;
997
+ readonly arguments: string;
998
+ }) => any;
999
+ "tool-call-end"?: (value: {
1000
+ readonly id: string;
1001
+ readonly type: "tool-call-end";
1002
+ readonly arguments?: string | undefined;
1003
+ }) => any;
1004
+ "tool-result"?: (value: {
1005
+ readonly id: string;
1006
+ readonly type: "tool-result";
1007
+ readonly output: string;
1008
+ readonly isError?: boolean | undefined;
1009
+ }) => any;
1010
+ usage?: (value: {
1011
+ readonly type: "usage";
1012
+ readonly inputTokens?: number | undefined;
1013
+ readonly outputTokens?: number | undefined;
1014
+ readonly reasoningTokens?: number | undefined;
1015
+ readonly cachedInputTokens?: number | undefined;
1016
+ readonly cacheWriteTokens?: number | undefined;
1017
+ readonly totalTokens?: number | undefined;
1018
+ readonly costUsd?: number | undefined;
1019
+ }) => any;
1020
+ retry?: (value: {
1021
+ readonly type: "retry";
1022
+ readonly attempt: number;
1023
+ readonly code: string;
1024
+ readonly delayMillis: number;
1025
+ }) => any;
1026
+ settle?: (value: {
1027
+ readonly type: "settle";
1028
+ readonly stopReason: "length" | "aborted" | "error" | "stop" | "unknown" | "tool-calls" | "content-filter";
1029
+ readonly responseId?: string | undefined;
1030
+ readonly itemIds?: readonly string[] | undefined;
1031
+ readonly sessionId?: string | undefined;
1032
+ }) => any;
1033
+ } & { [K in Exclude<keyof Cases, "retry" | "tool-result" | "text-start" | "text-delta" | "text-end" | "thinking-start" | "thinking-delta" | "thinking-end" | "tool-call-start" | "tool-call-delta" | "tool-call-end" | "usage" | "settle">]: never; }, OrElse extends (value: Exclude<{
1034
+ readonly type: "text-start";
1035
+ readonly id: string;
1036
+ }, {
1037
+ readonly type: keyof Cases;
1038
+ }> | Exclude<{
1039
+ readonly type: "text-delta";
1040
+ readonly id: string;
1041
+ readonly text: string;
1042
+ }, {
1043
+ readonly type: keyof Cases;
1044
+ }> | Exclude<{
1045
+ readonly type: "text-end";
1046
+ readonly id: string;
1047
+ }, {
1048
+ readonly type: keyof Cases;
1049
+ }> | Exclude<{
1050
+ readonly id: string;
1051
+ readonly type: "thinking-start";
1052
+ readonly signature?: string | undefined;
1053
+ }, {
1054
+ readonly type: keyof Cases;
1055
+ }> | Exclude<{
1056
+ readonly type: "thinking-delta";
1057
+ readonly id: string;
1058
+ readonly text: string;
1059
+ }, {
1060
+ readonly type: keyof Cases;
1061
+ }> | Exclude<{
1062
+ readonly type: "thinking-end";
1063
+ readonly id: string;
1064
+ }, {
1065
+ readonly type: keyof Cases;
1066
+ }> | Exclude<{
1067
+ readonly type: "tool-call-start";
1068
+ readonly id: string;
1069
+ readonly name: string;
1070
+ }, {
1071
+ readonly type: keyof Cases;
1072
+ }> | Exclude<{
1073
+ readonly type: "tool-call-delta";
1074
+ readonly id: string;
1075
+ readonly arguments: string;
1076
+ }, {
1077
+ readonly type: keyof Cases;
1078
+ }> | Exclude<{
1079
+ readonly id: string;
1080
+ readonly type: "tool-call-end";
1081
+ readonly arguments?: string | undefined;
1082
+ }, {
1083
+ readonly type: keyof Cases;
1084
+ }> | Exclude<{
1085
+ readonly id: string;
1086
+ readonly type: "tool-result";
1087
+ readonly output: string;
1088
+ readonly isError?: boolean | undefined;
1089
+ }, {
1090
+ readonly type: keyof Cases;
1091
+ }> | Exclude<{
1092
+ readonly type: "usage";
1093
+ readonly inputTokens?: number | undefined;
1094
+ readonly outputTokens?: number | undefined;
1095
+ readonly reasoningTokens?: number | undefined;
1096
+ readonly cachedInputTokens?: number | undefined;
1097
+ readonly cacheWriteTokens?: number | undefined;
1098
+ readonly totalTokens?: number | undefined;
1099
+ readonly costUsd?: number | undefined;
1100
+ }, {
1101
+ readonly type: keyof Cases;
1102
+ }> | Exclude<{
1103
+ readonly type: "retry";
1104
+ readonly attempt: number;
1105
+ readonly code: string;
1106
+ readonly delayMillis: number;
1107
+ }, {
1108
+ readonly type: keyof Cases;
1109
+ }> | Exclude<{
1110
+ readonly type: "settle";
1111
+ readonly stopReason: "length" | "aborted" | "error" | "stop" | "unknown" | "tool-calls" | "content-filter";
1112
+ readonly responseId?: string | undefined;
1113
+ readonly itemIds?: readonly string[] | undefined;
1114
+ readonly sessionId?: string | undefined;
1115
+ }, {
1116
+ readonly type: keyof Cases;
1117
+ }>) => any>(value: {
1118
+ readonly type: "text-start";
1119
+ readonly id: string;
1120
+ } | {
1121
+ readonly type: "text-delta";
1122
+ readonly id: string;
1123
+ readonly text: string;
1124
+ } | {
1125
+ readonly type: "text-end";
1126
+ readonly id: string;
1127
+ } | {
1128
+ readonly id: string;
1129
+ readonly type: "thinking-start";
1130
+ readonly signature?: string | undefined;
1131
+ } | {
1132
+ readonly type: "thinking-delta";
1133
+ readonly id: string;
1134
+ readonly text: string;
1135
+ } | {
1136
+ readonly type: "thinking-end";
1137
+ readonly id: string;
1138
+ } | {
1139
+ readonly type: "tool-call-start";
1140
+ readonly id: string;
1141
+ readonly name: string;
1142
+ } | {
1143
+ readonly type: "tool-call-delta";
1144
+ readonly id: string;
1145
+ readonly arguments: string;
1146
+ } | {
1147
+ readonly id: string;
1148
+ readonly type: "tool-call-end";
1149
+ readonly arguments?: string | undefined;
1150
+ } | {
1151
+ readonly id: string;
1152
+ readonly type: "tool-result";
1153
+ readonly output: string;
1154
+ readonly isError?: boolean | undefined;
1155
+ } | {
1156
+ readonly type: "usage";
1157
+ readonly inputTokens?: number | undefined;
1158
+ readonly outputTokens?: number | undefined;
1159
+ readonly reasoningTokens?: number | undefined;
1160
+ readonly cachedInputTokens?: number | undefined;
1161
+ readonly cacheWriteTokens?: number | undefined;
1162
+ readonly totalTokens?: number | undefined;
1163
+ readonly costUsd?: number | undefined;
1164
+ } | {
1165
+ readonly type: "retry";
1166
+ readonly attempt: number;
1167
+ readonly code: string;
1168
+ readonly delayMillis: number;
1169
+ } | {
1170
+ readonly type: "settle";
1171
+ readonly stopReason: "length" | "aborted" | "error" | "stop" | "unknown" | "tool-calls" | "content-filter";
1172
+ readonly responseId?: string | undefined;
1173
+ readonly itemIds?: readonly string[] | undefined;
1174
+ readonly sessionId?: string | undefined;
1175
+ }, cases: Cases, orElse: OrElse): import("effect/Unify").Unify<{ [K_1 in keyof Cases]-?: NonNullable<Cases[K_1]> extends (...args: Array<any>) => infer R ? R : never; }[keyof Cases] | ReturnType<OrElse>>;
1176
+ <Cases extends {
1177
+ "text-start"?: (value: {
1178
+ readonly type: "text-start";
1179
+ readonly id: string;
1180
+ }) => any;
1181
+ "text-delta"?: (value: {
1182
+ readonly type: "text-delta";
1183
+ readonly id: string;
1184
+ readonly text: string;
1185
+ }) => any;
1186
+ "text-end"?: (value: {
1187
+ readonly type: "text-end";
1188
+ readonly id: string;
1189
+ }) => any;
1190
+ "thinking-start"?: (value: {
1191
+ readonly id: string;
1192
+ readonly type: "thinking-start";
1193
+ readonly signature?: string | undefined;
1194
+ }) => any;
1195
+ "thinking-delta"?: (value: {
1196
+ readonly type: "thinking-delta";
1197
+ readonly id: string;
1198
+ readonly text: string;
1199
+ }) => any;
1200
+ "thinking-end"?: (value: {
1201
+ readonly type: "thinking-end";
1202
+ readonly id: string;
1203
+ }) => any;
1204
+ "tool-call-start"?: (value: {
1205
+ readonly type: "tool-call-start";
1206
+ readonly id: string;
1207
+ readonly name: string;
1208
+ }) => any;
1209
+ "tool-call-delta"?: (value: {
1210
+ readonly type: "tool-call-delta";
1211
+ readonly id: string;
1212
+ readonly arguments: string;
1213
+ }) => any;
1214
+ "tool-call-end"?: (value: {
1215
+ readonly id: string;
1216
+ readonly type: "tool-call-end";
1217
+ readonly arguments?: string | undefined;
1218
+ }) => any;
1219
+ "tool-result"?: (value: {
1220
+ readonly id: string;
1221
+ readonly type: "tool-result";
1222
+ readonly output: string;
1223
+ readonly isError?: boolean | undefined;
1224
+ }) => any;
1225
+ usage?: (value: {
1226
+ readonly type: "usage";
1227
+ readonly inputTokens?: number | undefined;
1228
+ readonly outputTokens?: number | undefined;
1229
+ readonly reasoningTokens?: number | undefined;
1230
+ readonly cachedInputTokens?: number | undefined;
1231
+ readonly cacheWriteTokens?: number | undefined;
1232
+ readonly totalTokens?: number | undefined;
1233
+ readonly costUsd?: number | undefined;
1234
+ }) => any;
1235
+ retry?: (value: {
1236
+ readonly type: "retry";
1237
+ readonly attempt: number;
1238
+ readonly code: string;
1239
+ readonly delayMillis: number;
1240
+ }) => any;
1241
+ settle?: (value: {
1242
+ readonly type: "settle";
1243
+ readonly stopReason: "length" | "aborted" | "error" | "stop" | "unknown" | "tool-calls" | "content-filter";
1244
+ readonly responseId?: string | undefined;
1245
+ readonly itemIds?: readonly string[] | undefined;
1246
+ readonly sessionId?: string | undefined;
1247
+ }) => any;
1248
+ } & { [K in Exclude<keyof Cases, "retry" | "tool-result" | "text-start" | "text-delta" | "text-end" | "thinking-start" | "thinking-delta" | "thinking-end" | "tool-call-start" | "tool-call-delta" | "tool-call-end" | "usage" | "settle">]: never; }, OrElse extends (value: Exclude<{
1249
+ readonly type: "text-start";
1250
+ readonly id: string;
1251
+ }, {
1252
+ readonly type: keyof Cases;
1253
+ }> | Exclude<{
1254
+ readonly type: "text-delta";
1255
+ readonly id: string;
1256
+ readonly text: string;
1257
+ }, {
1258
+ readonly type: keyof Cases;
1259
+ }> | Exclude<{
1260
+ readonly type: "text-end";
1261
+ readonly id: string;
1262
+ }, {
1263
+ readonly type: keyof Cases;
1264
+ }> | Exclude<{
1265
+ readonly id: string;
1266
+ readonly type: "thinking-start";
1267
+ readonly signature?: string | undefined;
1268
+ }, {
1269
+ readonly type: keyof Cases;
1270
+ }> | Exclude<{
1271
+ readonly type: "thinking-delta";
1272
+ readonly id: string;
1273
+ readonly text: string;
1274
+ }, {
1275
+ readonly type: keyof Cases;
1276
+ }> | Exclude<{
1277
+ readonly type: "thinking-end";
1278
+ readonly id: string;
1279
+ }, {
1280
+ readonly type: keyof Cases;
1281
+ }> | Exclude<{
1282
+ readonly type: "tool-call-start";
1283
+ readonly id: string;
1284
+ readonly name: string;
1285
+ }, {
1286
+ readonly type: keyof Cases;
1287
+ }> | Exclude<{
1288
+ readonly type: "tool-call-delta";
1289
+ readonly id: string;
1290
+ readonly arguments: string;
1291
+ }, {
1292
+ readonly type: keyof Cases;
1293
+ }> | Exclude<{
1294
+ readonly id: string;
1295
+ readonly type: "tool-call-end";
1296
+ readonly arguments?: string | undefined;
1297
+ }, {
1298
+ readonly type: keyof Cases;
1299
+ }> | Exclude<{
1300
+ readonly id: string;
1301
+ readonly type: "tool-result";
1302
+ readonly output: string;
1303
+ readonly isError?: boolean | undefined;
1304
+ }, {
1305
+ readonly type: keyof Cases;
1306
+ }> | Exclude<{
1307
+ readonly type: "usage";
1308
+ readonly inputTokens?: number | undefined;
1309
+ readonly outputTokens?: number | undefined;
1310
+ readonly reasoningTokens?: number | undefined;
1311
+ readonly cachedInputTokens?: number | undefined;
1312
+ readonly cacheWriteTokens?: number | undefined;
1313
+ readonly totalTokens?: number | undefined;
1314
+ readonly costUsd?: number | undefined;
1315
+ }, {
1316
+ readonly type: keyof Cases;
1317
+ }> | Exclude<{
1318
+ readonly type: "retry";
1319
+ readonly attempt: number;
1320
+ readonly code: string;
1321
+ readonly delayMillis: number;
1322
+ }, {
1323
+ readonly type: keyof Cases;
1324
+ }> | Exclude<{
1325
+ readonly type: "settle";
1326
+ readonly stopReason: "length" | "aborted" | "error" | "stop" | "unknown" | "tool-calls" | "content-filter";
1327
+ readonly responseId?: string | undefined;
1328
+ readonly itemIds?: readonly string[] | undefined;
1329
+ readonly sessionId?: string | undefined;
1330
+ }, {
1331
+ readonly type: keyof Cases;
1332
+ }>) => any>(cases: Cases, orElse: OrElse): (value: {
1333
+ readonly type: "text-start";
1334
+ readonly id: string;
1335
+ } | {
1336
+ readonly type: "text-delta";
1337
+ readonly id: string;
1338
+ readonly text: string;
1339
+ } | {
1340
+ readonly type: "text-end";
1341
+ readonly id: string;
1342
+ } | {
1343
+ readonly id: string;
1344
+ readonly type: "thinking-start";
1345
+ readonly signature?: string | undefined;
1346
+ } | {
1347
+ readonly type: "thinking-delta";
1348
+ readonly id: string;
1349
+ readonly text: string;
1350
+ } | {
1351
+ readonly type: "thinking-end";
1352
+ readonly id: string;
1353
+ } | {
1354
+ readonly type: "tool-call-start";
1355
+ readonly id: string;
1356
+ readonly name: string;
1357
+ } | {
1358
+ readonly type: "tool-call-delta";
1359
+ readonly id: string;
1360
+ readonly arguments: string;
1361
+ } | {
1362
+ readonly id: string;
1363
+ readonly type: "tool-call-end";
1364
+ readonly arguments?: string | undefined;
1365
+ } | {
1366
+ readonly id: string;
1367
+ readonly type: "tool-result";
1368
+ readonly output: string;
1369
+ readonly isError?: boolean | undefined;
1370
+ } | {
1371
+ readonly type: "usage";
1372
+ readonly inputTokens?: number | undefined;
1373
+ readonly outputTokens?: number | undefined;
1374
+ readonly reasoningTokens?: number | undefined;
1375
+ readonly cachedInputTokens?: number | undefined;
1376
+ readonly cacheWriteTokens?: number | undefined;
1377
+ readonly totalTokens?: number | undefined;
1378
+ readonly costUsd?: number | undefined;
1379
+ } | {
1380
+ readonly type: "retry";
1381
+ readonly attempt: number;
1382
+ readonly code: string;
1383
+ readonly delayMillis: number;
1384
+ } | {
1385
+ readonly type: "settle";
1386
+ readonly stopReason: "length" | "aborted" | "error" | "stop" | "unknown" | "tool-calls" | "content-filter";
1387
+ readonly responseId?: string | undefined;
1388
+ readonly itemIds?: readonly string[] | undefined;
1389
+ readonly sessionId?: string | undefined;
1390
+ }) => import("effect/Unify").Unify<{ [K_1 in keyof Cases]-?: NonNullable<Cases[K_1]> extends (...args: Array<any>) => infer R ? R : never; }[keyof Cases] | ReturnType<OrElse>>;
1391
+ };
1392
+ } & {
1393
+ TextStart: (input: {
1394
+ readonly type: "text-start";
1395
+ readonly id: string;
1396
+ }, options?: Schema.MakeOptions) => {
1397
+ readonly type: "text-start";
1398
+ readonly id: string;
1399
+ };
1400
+ TextDelta: (input: {
1401
+ readonly type: "text-delta";
1402
+ readonly id: string;
1403
+ readonly text: string;
1404
+ }, options?: Schema.MakeOptions) => {
1405
+ readonly type: "text-delta";
1406
+ readonly id: string;
1407
+ readonly text: string;
1408
+ };
1409
+ TextEnd: (input: {
1410
+ readonly type: "text-end";
1411
+ readonly id: string;
1412
+ }, options?: Schema.MakeOptions) => {
1413
+ readonly type: "text-end";
1414
+ readonly id: string;
1415
+ };
1416
+ ThinkingStart: (input: {
1417
+ readonly id: string;
1418
+ readonly type: "thinking-start";
1419
+ readonly signature?: string | undefined;
1420
+ }, options?: Schema.MakeOptions) => {
1421
+ readonly id: string;
1422
+ readonly type: "thinking-start";
1423
+ readonly signature?: string | undefined;
1424
+ };
1425
+ ThinkingDelta: (input: {
1426
+ readonly type: "thinking-delta";
1427
+ readonly id: string;
1428
+ readonly text: string;
1429
+ }, options?: Schema.MakeOptions) => {
1430
+ readonly type: "thinking-delta";
1431
+ readonly id: string;
1432
+ readonly text: string;
1433
+ };
1434
+ ThinkingEnd: (input: {
1435
+ readonly type: "thinking-end";
1436
+ readonly id: string;
1437
+ }, options?: Schema.MakeOptions) => {
1438
+ readonly type: "thinking-end";
1439
+ readonly id: string;
1440
+ };
1441
+ ToolCallStart: (input: {
1442
+ readonly type: "tool-call-start";
1443
+ readonly id: string;
1444
+ readonly name: string;
1445
+ }, options?: Schema.MakeOptions) => {
1446
+ readonly type: "tool-call-start";
1447
+ readonly id: string;
1448
+ readonly name: string;
1449
+ };
1450
+ ToolCallDelta: (input: {
1451
+ readonly type: "tool-call-delta";
1452
+ readonly id: string;
1453
+ readonly arguments: string;
1454
+ }, options?: Schema.MakeOptions) => {
1455
+ readonly type: "tool-call-delta";
1456
+ readonly id: string;
1457
+ readonly arguments: string;
1458
+ };
1459
+ ToolCallEnd: (input: {
1460
+ readonly id: string;
1461
+ readonly type: "tool-call-end";
1462
+ readonly arguments?: string | undefined;
1463
+ }, options?: Schema.MakeOptions) => {
1464
+ readonly id: string;
1465
+ readonly type: "tool-call-end";
1466
+ readonly arguments?: string | undefined;
1467
+ };
1468
+ ToolResult: (input: {
1469
+ readonly id: string;
1470
+ readonly type: "tool-result";
1471
+ readonly output: string;
1472
+ readonly isError?: boolean | undefined;
1473
+ }, options?: Schema.MakeOptions) => {
1474
+ readonly id: string;
1475
+ readonly type: "tool-result";
1476
+ readonly output: string;
1477
+ readonly isError?: boolean | undefined;
1478
+ };
1479
+ Usage: (input: ModelEvent.Usage) => ModelEvent.UsageEvent;
1480
+ Retry: (input: {
1481
+ readonly code: string;
1482
+ readonly attempt: number;
1483
+ readonly type: "retry";
1484
+ readonly delayMillis?: number;
1485
+ }, options?: Schema.MakeOptions) => {
1486
+ readonly type: "retry";
1487
+ readonly attempt: number;
1488
+ readonly code: string;
1489
+ readonly delayMillis: number;
1490
+ };
1491
+ Settle: (input: {
1492
+ readonly type: "settle";
1493
+ readonly stopReason: "length" | "aborted" | "error" | "stop" | "unknown" | "tool-calls" | "content-filter";
1494
+ readonly responseId?: string | undefined;
1495
+ readonly itemIds?: readonly string[] | undefined;
1496
+ readonly sessionId?: string | undefined;
1497
+ }, options?: Schema.MakeOptions) => {
1498
+ readonly type: "settle";
1499
+ readonly stopReason: "length" | "aborted" | "error" | "stop" | "unknown" | "tool-calls" | "content-filter";
1500
+ readonly responseId?: string | undefined;
1501
+ readonly itemIds?: readonly string[] | undefined;
1502
+ readonly sessionId?: string | undefined;
1503
+ };
1504
+ settledMessage: typeof ModelEvent.settledMessage;
1505
+ };
1506
+ }>, {}>;
1507
+ /**
1508
+ * One provider-neutral model progress event.
1509
+ *
1510
+ * @category events
1511
+ * @since 0.1.0
1512
+ * @slop
1513
+ */
1514
+ export declare class ModelDelta extends ModelDelta_base {
1515
+ }
1516
+ declare const ModelRetried_base: Schema.Class<ModelRetried, Schema.TaggedStruct<"model-retried", {
1517
+ readonly eventType: Schema.Literal<"flows.harness.model-retried.v1">;
1518
+ readonly attempt: Schema.Int;
1519
+ readonly code: Schema.String;
1520
+ /**
1521
+ * Milliseconds the boundary waited before this attempt.
1522
+ *
1523
+ * Every retry of one sealed step is journaled at the moment the step
1524
+ * settles, so the event timestamps cannot show the schedule. This carries
1525
+ * it. Zero is what an unscheduled retry, or a record written before the
1526
+ * field existed, reports.
1527
+ */
1528
+ readonly delayMillis: Schema.withDecodingDefaultKey<Schema.withConstructorDefault<Schema.Number>, never>;
1529
+ }>, {}>;
1530
+ /**
1531
+ * A transport-only model retry taken before the sealed step settled.
1532
+ *
1533
+ * @category events
1534
+ * @since 0.1.0
1535
+ */
1536
+ export declare class ModelRetried extends ModelRetried_base {
1537
+ }
1538
+ declare const ModelSettled_base: Schema.Class<ModelSettled, Schema.TaggedStruct<"model-settled", {
1539
+ readonly eventType: Schema.Literal<"flows.harness.model-settled.v1">;
1540
+ readonly message: typeof ModelRequest.AssistantMessage;
1541
+ readonly usage: Schema.Struct<{
1542
+ readonly inputTokens: Schema.optional<Schema.Number>;
1543
+ readonly outputTokens: Schema.optional<Schema.Number>;
1544
+ readonly reasoningTokens: Schema.optional<Schema.Number>;
1545
+ readonly cachedInputTokens: Schema.optional<Schema.Number>;
1546
+ readonly cacheWriteTokens: Schema.optional<Schema.Number>;
1547
+ readonly totalTokens: Schema.optional<Schema.Number>;
1548
+ readonly costUsd: Schema.optional<Schema.Number>;
1549
+ }> & {
1550
+ make: (input: ModelEvent.Usage) => ModelEvent.Usage;
1551
+ };
1552
+ /**
1553
+ * The call's USD cost: the provider's reported charge, or its usage priced
1554
+ * under the model's rate card. Absent for an unpriced model.
1555
+ */
1556
+ readonly costUsd: Schema.optional<Schema.Number>;
1557
+ /** Where {@link costUsd} came from. */
1558
+ readonly costSource: Schema.optional<Schema.Literals<readonly ["reported", "estimated"]>>;
1559
+ /** The vendor session that answered, for a wrapped CLI seat: `claude --resume <sessionId>`. */
1560
+ readonly sessionId: Schema.optional<Schema.String>;
1561
+ /**
1562
+ * Wall-clock milliseconds the sealed step took, measured on the injected
1563
+ * clock.
1564
+ *
1565
+ * Usage alone answers what a call cost, never how long it took, so a
1566
+ * benchmark could compare tokens per run but not seconds per call — and
1567
+ * speed was the larger half of the gap the first head-to-head measured.
1568
+ * Zero is what an event carries when nothing timed it.
1569
+ */
1570
+ readonly durationMillis: Schema.withDecodingDefaultKey<Schema.withConstructorDefault<Schema.Number>, never>;
1571
+ }>, {}>;
1572
+ /**
1573
+ * The complete recorded model settlement and usage.
1574
+ *
1575
+ * @category events
1576
+ * @since 0.1.0
1577
+ * @slop
1578
+ */
1579
+ export declare class ModelSettled extends ModelSettled_base {
1580
+ }
1581
+ declare const CellProduced_base: Schema.Class<CellProduced, Schema.TaggedStruct<"cell-produced", {
1582
+ readonly eventType: Schema.Literal<"flows.harness.cell-produced.v1">;
1583
+ readonly cell: typeof Cell.Source;
1584
+ /**
1585
+ * How many fenced cell blocks the reply was written in.
1586
+ *
1587
+ * Journaled because it is the only record of how the model laid its frame
1588
+ * out, and because the count above one is the shape whose whole program the
1589
+ * harness used to discard. See `Cell.extract`.
1590
+ */
1591
+ readonly blocks: Schema.withDecodingDefaultKey<Schema.withConstructorDefault<Schema.Int>, never>;
1592
+ }>, {}>;
1593
+ /**
1594
+ * The cell source recovered from one model settlement.
1595
+ *
1596
+ * The source itself is durable evidence: replay re-executes exactly this text,
1597
+ * and every call identity inside the frame folds in its digest.
1598
+ *
1599
+ * @category events
1600
+ * @since 0.1.0
1601
+ * @slop
1602
+ */
1603
+ export declare class CellProduced extends CellProduced_base {
1604
+ }
1605
+ declare const CellRejectedInFrame_base: Schema.Class<CellRejectedInFrame, Schema.TaggedStruct<"cell-rejected-in-frame", {
1606
+ readonly eventType: Schema.Literal<"flows.harness.cell-rejected-in-frame.v1">;
1607
+ /** Which attempt of this frame was refused, counting from one. */
1608
+ readonly attempt: Schema.Int;
1609
+ /** Why the parse refused it. */
1610
+ readonly code: Schema.Literals<readonly ["no_cell", "output_truncated", "imports_forbidden", "compile_failed", "invalid_transition", "unsupported_language", "limit_exceeded", "stalled"]>;
1611
+ /** What the frame told the model, verbatim. */
1612
+ readonly message: Schema.String;
1613
+ }>, {}>;
1614
+ /**
1615
+ * One reply the boundary parse refused, answered inside the frame it arrived
1616
+ * in rather than by ending the frame.
1617
+ *
1618
+ * Journaled because it is spend: a re-prompt is a real model call, cached
1619
+ * prefix or not, and a wave counting cost per frame would otherwise see the
1620
+ * output of an answer it has no record of asking for. It is also the only
1621
+ * measure of whether validating at the boundary is worth what it costs — the
1622
+ * ratio of this event to `cell-settled` rejections says how often one re-ask
1623
+ * recovers a frame.
1624
+ *
1625
+ * @category events
1626
+ * @since 0.1.0
1627
+ * @slop
1628
+ */
1629
+ export declare class CellRejectedInFrame extends CellRejectedInFrame_base {
1630
+ }
1631
+ declare const CellCallStarted_base: Schema.Class<CellCallStarted, Schema.TaggedStruct<"cell-call-started", {
1632
+ readonly eventType: Schema.Literal<"flows.harness.cell-call-started.v1">;
1633
+ readonly call: typeof Cell.Call;
1634
+ }>, {}>;
1635
+ /**
1636
+ * One flow call opened from inside a running cell.
1637
+ *
1638
+ * @category events
1639
+ * @since 0.1.0
1640
+ * @slop
1641
+ */
1642
+ export declare class CellCallStarted extends CellCallStarted_base {
1643
+ }
1644
+ declare const CellCallSettled_base: Schema.Class<CellCallSettled, Schema.TaggedStruct<"cell-call-settled", {
1645
+ readonly eventType: Schema.Literal<"flows.harness.cell-call-settled.v1">;
1646
+ readonly flowName: Schema.String;
1647
+ readonly identity: typeof Cell.CallIdentity;
1648
+ readonly result: typeof Cell.CallResult;
1649
+ }>, {}>;
1650
+ /**
1651
+ * One settled flow call made from inside a running cell.
1652
+ *
1653
+ * @category events
1654
+ * @since 0.1.0
1655
+ * @slop
1656
+ */
1657
+ export declare class CellCallSettled extends CellCallSettled_base {
1658
+ }
1659
+ declare const CellPrinted_base: Schema.Class<CellPrinted, Schema.TaggedStruct<"cell-printed", {
1660
+ readonly eventType: Schema.Literal<"flows.harness.cell-printed.v1">;
1661
+ /** The digest of the cell whose prints these are. */
1662
+ readonly cell: Schema.String;
1663
+ /** The frame's whole print buffer, already bounded; empty when it printed nothing. */
1664
+ readonly text: Schema.String;
1665
+ }>, {}>;
1666
+ /**
1667
+ * What one REPL cell printed, as the next model turn will read it.
1668
+ *
1669
+ * The print buffer is the whole of the context channel in REPL mode, so it is
1670
+ * journaled rather than derived: a transcript projection rebuilds a resumed
1671
+ * run's window from the journal without re-running anything, exactly as it does
1672
+ * for the context a filing cell projected. Bounded before it is emitted, so the
1673
+ * journal carries what the model saw and nothing larger.
1674
+ *
1675
+ * @category events
1676
+ * @since 0.1.0
1677
+ */
1678
+ export declare class CellPrinted extends CellPrinted_base {
1679
+ }
1680
+ declare const CellSettled_base: Schema.Class<CellSettled, Schema.TaggedStruct<"cell-settled", {
1681
+ readonly eventType: Schema.Literal<"flows.harness.cell-settled.v1">;
1682
+ readonly cell: Schema.String;
1683
+ readonly outcome: Schema.toTaggedUnion<"_tag", readonly [typeof Cell.Settled, typeof Cell.Raised, typeof Cell.Rejected]>;
1684
+ /** Absent in journals written before execution frontiers were recorded. */
1685
+ readonly boundary: Schema.optional<Schema.Struct<{
1686
+ readonly terminal: Schema.Literals<readonly ["timeout", "settled"]>;
1687
+ readonly dispatched: Schema.Int;
1688
+ readonly settled: Schema.Int;
1689
+ }>>;
1690
+ }>, {}>;
1691
+ /**
1692
+ * The outcome of executing one cell, whether it settled, threw, or was
1693
+ * rejected before it ran.
1694
+ *
1695
+ * @category events
1696
+ * @since 0.1.0
1697
+ * @slop
1698
+ */
1699
+ export declare class CellSettled extends CellSettled_base {
1700
+ }
1701
+ declare const TransitionApplied_base: Schema.Class<TransitionApplied, Schema.TaggedStruct<"transition-applied", {
1702
+ readonly eventType: Schema.Literal<"flows.harness.transition-applied.v1">;
1703
+ readonly transition: Schema.toTaggedUnion<"_tag", readonly [typeof Cell.Continue, typeof Cell.Complete, typeof Cell.Park]>;
1704
+ }>, {}>;
1705
+ /**
1706
+ * The durable transition the controller applied after a cell settled.
1707
+ *
1708
+ * @category events
1709
+ * @since 0.1.0
1710
+ * @slop
1711
+ */
1712
+ export declare class TransitionApplied extends TransitionApplied_base {
1713
+ }
1714
+ declare const ReadOnlyDemandIssued_base: Schema.Class<ReadOnlyDemandIssued, Schema.TaggedStruct<"read-only-demand-issued", {
1715
+ readonly eventType: Schema.Literal<"flows.harness.read-only-demand-issued.v1">;
1716
+ /** Consecutive read-only frames the run had spent. */
1717
+ readonly streak: Schema.Int;
1718
+ /** The armed threshold that streak reached. */
1719
+ readonly cap: Schema.Int;
1720
+ /** The frame the demand was attached to, which is the one that must answer it. */
1721
+ readonly nextFrame: Schema.Int;
1722
+ }>, {}>;
1723
+ /**
1724
+ * The controller issuing a read-cap intervention to the next frame.
1725
+ *
1726
+ * Kept separately from {@link ReadOnlyDemanded}: this event records the user
1727
+ * message entering the model transcript, while that event records how a later
1728
+ * frame answered it. A crash between those boundaries must retain the demand.
1729
+ *
1730
+ * @category events
1731
+ * @since 1.0.0-rc.0
1732
+ */
1733
+ export declare class ReadOnlyDemandIssued extends ReadOnlyDemandIssued_base {
1734
+ }
1735
+ declare const ReadOnlyDemanded_base: Schema.Class<ReadOnlyDemanded, Schema.TaggedStruct<"read-only-demanded", {
1736
+ readonly eventType: Schema.Literal<"flows.harness.read-only-demanded.v1">;
1737
+ readonly streak: Schema.Int;
1738
+ readonly cap: Schema.Int;
1739
+ readonly nextFrame: Schema.Int;
1740
+ readonly nextAction: Schema.Literals<readonly ["write", "justification", "read-only", "park"]>;
1741
+ }>, {}>;
1742
+ /**
1743
+ * The outcome of the frame immediately following a read-cap intervention.
1744
+ *
1745
+ * @category events
1746
+ * @since 0.1.0
1747
+ */
1748
+ export declare class ReadOnlyDemanded extends ReadOnlyDemanded_base {
1749
+ }
1750
+ declare const RepeatDemanded_base: Schema.Class<RepeatDemanded, Schema.TaggedStruct<"repeat-demanded", {
1751
+ readonly eventType: Schema.Literal<"flows.harness.repeat-demanded.v1">;
1752
+ /** Consecutive repeat-observation frames the run had spent. */
1753
+ readonly frames: Schema.Int;
1754
+ /** The armed threshold that streak reached. */
1755
+ readonly cap: Schema.Int;
1756
+ /** The frame the demand was attached to, which is the one that must answer it. */
1757
+ readonly nextFrame: Schema.Int;
1758
+ }>, {}>;
1759
+ /**
1760
+ * The controller telling a run it has stopped learning anything.
1761
+ *
1762
+ * Written when a run reaches its repeat-observation threshold: consecutive
1763
+ * frames that issued calls, issued none the run had not already issued, and
1764
+ * changed nothing. Both this and {@link ReadOnlyDemandIssued} are written when
1765
+ * their demand is issued; {@link ReadOnlyDemanded} additionally records the
1766
+ * read-cap demand's later answer because that answer is a field on a
1767
+ * transition. A repeat demand is answered by the shape of the next frame's
1768
+ * calls, which the journal already writes one by one.
1769
+ *
1770
+ * @category events
1771
+ * @since 0.1.0
1772
+ */
1773
+ export declare class RepeatDemanded extends RepeatDemanded_base {
1774
+ }
1775
+ declare const NarrowedDemanded_base: Schema.Class<NarrowedDemanded, Schema.TaggedStruct<"narrowed-demanded", {
1776
+ readonly eventType: Schema.Literal<"flows.harness.narrowed-demanded.v1">;
1777
+ /** The flow both checks named. */
1778
+ readonly flow: Schema.String;
1779
+ /** The broader check's input as the run wrote it, clipped. */
1780
+ readonly broader: Schema.String;
1781
+ /** The narrowing check's input as the run wrote it, clipped. */
1782
+ readonly narrower: Schema.String;
1783
+ /** Workspace digest the broader check was last run over. */
1784
+ readonly broaderDigest: Schema.String;
1785
+ /** Workspace digest the completing frame closed on. */
1786
+ readonly currentDigest: Schema.String;
1787
+ /** The frame the demand was attached to, which is the one that must answer it. */
1788
+ readonly nextFrame: Schema.Int;
1789
+ }>, {}>;
1790
+ /**
1791
+ * The controller refusing one completion whose evidence was narrowed.
1792
+ *
1793
+ * Written when a frame returns `complete` while the check it ran is a strict
1794
+ * narrowing of one the run had already run in full, over a tree that has since
1795
+ * changed and never re-run since. Written when the demand is *issued*, like the
1796
+ * repeat demand and unlike the read-cap one, because what answers it is the
1797
+ * shape of the next frame's calls and its output — both of which the journal
1798
+ * already writes.
1799
+ *
1800
+ * The event is the whole audit trail for the bounce. `broader` and `narrower`
1801
+ * quote the two inputs as the run wrote them, and the two digests say which
1802
+ * trees they were measured over, so a grader can decide after the fact whether
1803
+ * the demand was right without replaying anything.
1804
+ *
1805
+ * @category events
1806
+ * @since 0.1.0
1807
+ */
1808
+ export declare class NarrowedDemanded extends NarrowedDemanded_base {
1809
+ }
1810
+ declare const UnmovedDemanded_base: Schema.Class<UnmovedDemanded, Schema.TaggedStruct<"unmoved-demanded", {
1811
+ readonly eventType: Schema.Literal<"flows.harness.unmoved-demanded.v1">;
1812
+ /** Workspace digest the run opened on. */
1813
+ readonly openedDigest: Schema.String;
1814
+ /** Workspace digest the completing frame closed on, equal to the first. */
1815
+ readonly currentDigest: Schema.String;
1816
+ /** The frame the demand was attached to, which is the one that must answer it. */
1817
+ readonly nextFrame: Schema.Int;
1818
+ }>, {}>;
1819
+ /**
1820
+ * The controller refusing one completion with no change behind it.
1821
+ *
1822
+ * Written when a frame returns `complete` while the tree it closed on is
1823
+ * byte-for-byte the tree the run opened on. Written when the demand is
1824
+ * *issued*, like the narrowing demand, because what answers it is the next
1825
+ * frame's own record — an edit that moves the digest, or a second completion
1826
+ * saying no change was needed — and the journal already writes both.
1827
+ *
1828
+ * The two digests are the whole audit trail: a grader can decide after the fact
1829
+ * whether the demand was right by comparing them to the run's
1830
+ * `mutation-observed` record, without replaying anything.
1831
+ *
1832
+ * @category events
1833
+ * @since 0.1.0
1834
+ */
1835
+ export declare class UnmovedDemanded extends UnmovedDemanded_base {
1836
+ }
1837
+ declare const UnresolvedDemanded_base: Schema.Class<UnresolvedDemanded, Schema.TaggedStruct<"unresolved-demanded", {
1838
+ readonly eventType: Schema.Literal<"flows.harness.unresolved-demanded.v1">;
1839
+ /** The flow both checks named. */
1840
+ readonly flow: Schema.String;
1841
+ /** The failing check's input as the run wrote it, clipped. */
1842
+ readonly failed: Schema.String;
1843
+ /** The input of the reading the run took instead, clipped. */
1844
+ readonly instead: Schema.String;
1845
+ /** Workspace digest both checks were recorded over, and the frame closed on. */
1846
+ readonly currentDigest: Schema.String;
1847
+ /** The frame the demand was attached to, which is the one that must answer it. */
1848
+ readonly nextFrame: Schema.Int;
1849
+ }>, {}>;
1850
+ /**
1851
+ * The controller refusing one completion that stepped around a failing check.
1852
+ *
1853
+ * Written when a frame returns `complete` while a check recorded over the same
1854
+ * tree reported a failing exit status, was never re-run, and a later check went
1855
+ * back to the same subject with a different command.
1856
+ *
1857
+ * `failed` and `instead` quote the two inputs as the run wrote them, and
1858
+ * `currentDigest` is the tree both were measured over, so the record says which
1859
+ * reading the completion stands on and which one replaced it.
1860
+ *
1861
+ * @category events
1862
+ * @since 0.1.0
1863
+ */
1864
+ export declare class UnresolvedDemanded extends UnresolvedDemanded_base {
1865
+ }
1866
+ declare const FailedCallDemanded_base: Schema.Class<FailedCallDemanded, Schema.TaggedStruct<"failed-call-demanded", {
1867
+ readonly eventType: Schema.Literal<"flows.harness.failed-call-demanded.v1">;
1868
+ /** The calls the completing frame settled as failures, oldest first. */
1869
+ readonly failures: Schema.$Array<Schema.Struct<{
1870
+ readonly flow: Schema.String;
1871
+ readonly message: Schema.String;
1872
+ }>>;
1873
+ /** The frame the demand was attached to, which is the one that must answer it. */
1874
+ readonly nextFrame: Schema.Int;
1875
+ }>, {}>;
1876
+ /**
1877
+ * The controller handing back a completion its own cell wrote before a call
1878
+ * in that cell failed.
1879
+ *
1880
+ * `failures` quotes each failed call's flow and message as the flow reported
1881
+ * them, so the record says which results the completion was written without.
1882
+ * See `FailedCall`.
1883
+ *
1884
+ * @category events
1885
+ * @since 1.0.0-rc.1
1886
+ */
1887
+ export declare class FailedCallDemanded extends FailedCallDemanded_base {
1888
+ }
1889
+ declare const OutputDemanded_base: Schema.Class<OutputDemanded, Schema.TaggedStruct<"output-demanded", {
1890
+ readonly eventType: Schema.Literal<"flows.harness.output-demanded.v1">;
1891
+ /** The correction handed back with the completion. */
1892
+ readonly note: Schema.String;
1893
+ /** The frame the demand was attached to, which is the one that must answer it. */
1894
+ readonly nextFrame: Schema.Int;
1895
+ }>, {}>;
1896
+ /**
1897
+ * The controller handing back a completion whose output does not fit the
1898
+ * shape the host declared for it.
1899
+ *
1900
+ * `note` is the correction the run was shown, verbatim, so a transcript
1901
+ * rebuilt from the journal holds what the model read. The same session
1902
+ * answers it, with everything its earlier frames bound still in scope.
1903
+ *
1904
+ * @category events
1905
+ * @since 1.0.0-rc.1
1906
+ */
1907
+ export declare class OutputDemanded extends OutputDemanded_base {
1908
+ }
1909
+ declare const UnobservedDemanded_base: Schema.Class<UnobservedDemanded, Schema.TaggedStruct<"unobserved-demanded", {
1910
+ readonly eventType: Schema.Literal<"flows.harness.unobserved-demanded.v1">;
1911
+ /** The calls the completion was written without reading, oldest first. */
1912
+ readonly calls: Schema.$Array<Schema.Struct<{
1913
+ readonly flow: Schema.String;
1914
+ readonly ordinal: Schema.Int;
1915
+ readonly ok: Schema.Boolean;
1916
+ readonly summary: Schema.String;
1917
+ }>>;
1918
+ /** The frame the demand was attached to, which is the one that must answer it. */
1919
+ readonly nextFrame: Schema.Int;
1920
+ }>, {}>;
1921
+ /**
1922
+ * The controller handing back a completion its own cell wrote before reading
1923
+ * the calls it made.
1924
+ *
1925
+ * `calls` names each call the completing frame settled, in ledger order, with
1926
+ * the head of the result the next frame was shown, so the record says which
1927
+ * results the completion was written without.
1928
+ *
1929
+ * @category events
1930
+ * @since 1.0.0-rc.1
1931
+ */
1932
+ export declare class UnobservedDemanded extends UnobservedDemanded_base {
1933
+ }
1934
+ declare const NarrowOnlyDemanded_base: Schema.Class<NarrowOnlyDemanded, Schema.TaggedStruct<"narrow-only-demanded", {
1935
+ readonly eventType: Schema.Literal<"flows.harness.narrow-only-demanded.v1">;
1936
+ /** The flow the check named. */
1937
+ readonly flow: Schema.String;
1938
+ /** The check's input as the run wrote it, clipped. */
1939
+ readonly check: Schema.String;
1940
+ /** The subjects it names, sorted. */
1941
+ readonly targets: Schema.$Array<Schema.String>;
1942
+ /** Workspace digest the completing frame closed on; empty when unmeasured. */
1943
+ readonly currentDigest: Schema.String;
1944
+ /** The frame the demand was attached to, which is the one that must answer it. */
1945
+ readonly nextFrame: Schema.Int;
1946
+ }>, {}>;
1947
+ /**
1948
+ * The controller refusing one completion that holds a single reading.
1949
+ *
1950
+ * Written when a frame returns `complete` while the last check it ran names
1951
+ * subjects no other check of the run covers together, and the run never issued
1952
+ * that exact call before. The sibling of `narrowed-demanded`, from the other
1953
+ * side: that one fires when a broader check exists in the ledger and was not
1954
+ * re-run, this one when no broader check was ever taken.
1955
+ *
1956
+ * `check` quotes the input as the run wrote it and `targets` names the subjects
1957
+ * the demand is about, so a grader can decide after the fact whether the demand
1958
+ * was right without replaying anything.
1959
+ *
1960
+ * @category events
1961
+ * @since 0.1.0
1962
+ */
1963
+ export declare class NarrowOnlyDemanded extends NarrowOnlyDemanded_base {
1964
+ }
1965
+ declare const ClaimDemanded_base: Schema.Class<ClaimDemanded, Schema.TaggedStruct<"claim-demanded", {
1966
+ readonly eventType: Schema.Literal<"flows.harness.claim-demanded.v1">;
1967
+ /** Probability the transport gave to "the task as stated is done"; journaled, decides nothing. */
1968
+ readonly complete: Schema.Number;
1969
+ /** Probability it gave to "the claim asserts what the evidence does not show"; journaled, decides nothing. */
1970
+ readonly overclaims: Schema.Number;
1971
+ /** Probability it gave to "the claim reports a command or a result the evidence does not record"; the one that decides. */
1972
+ readonly invented: Schema.Number;
1973
+ /** Wall-clock milliseconds the evaluation took. */
1974
+ readonly latencyMs: Schema.Int;
1975
+ /** Token usage reported by the evaluator, absent from older journal entries. */
1976
+ readonly usage: Schema.optional<Schema.Struct<{
1977
+ readonly inputTokens: Schema.Number;
1978
+ readonly outputTokens: Schema.Number;
1979
+ readonly modelId: Schema.optional<Schema.String>;
1980
+ }>>;
1981
+ /** Whether this reading handed the completion back. */
1982
+ readonly demanded: Schema.Boolean;
1983
+ /**
1984
+ * Whether this reading ended the run instead of handing the completion back.
1985
+ *
1986
+ * The third of the three ways a reading comes out, and the one that had no
1987
+ * field. `demanded` false meant both "the claim stands" and "the claim is
1988
+ * refused and the run is over", which a projection cannot tell apart, so the
1989
+ * refusal wrote no card and the sentence it refused was nowhere a person
1990
+ * could read. Absent from older journal entries, where it decodes false: a
1991
+ * journal written before this field carries its verdict in the run's
1992
+ * failure, which is where it always was.
1993
+ */
1994
+ readonly refused: Schema.withDecodingDefaultKey<Schema.withConstructorDefault<Schema.Boolean>, never>;
1995
+ /** Workspace digest the completing frame closed on; empty when unmeasured. */
1996
+ readonly currentDigest: Schema.String;
1997
+ /** The frame the demand was attached to, which is the one that must answer it. */
1998
+ readonly nextFrame: Schema.Int;
1999
+ }>, {}>;
2000
+ /**
2001
+ * What Jev read off one completion claim, whether or not it braked.
2002
+ *
2003
+ * The only demand event written on every evaluation rather than only on a
2004
+ * firing, and it is written that way on purpose: the other five demands are
2005
+ * derived from facts a grader can recompute from the journal, and this one is
2006
+ * a model's reading that exists nowhere else. Without the passing readings the
2007
+ * record would answer "how often did it fire" and could never answer "how
2008
+ * often did it agree", which is the only question that says whether arming it
2009
+ * was right. `demanded` is the field that separates them, and it says exactly one
2010
+ * thing: whether this reading handed the completion back for a frame. A
2011
+ * reading comes out three ways, not two. It passes, and cost the run nothing.
2012
+ * It demands, and cost the run a frame. Or it reads against a run with no
2013
+ * bounce left to spend, where `demanded` is false and the run ends on
2014
+ * `CompletionClaim.unproven`: the verdict is in the run's failure, and the two
2015
+ * probabilities here are what a grader re-applies a threshold to either way.
2016
+ *
2017
+ * `complete` and `overclaims` are the transport's probabilities for the
2018
+ * classifier's two questions, verbatim, so a grader can re-apply any
2019
+ * threshold to a whole wave without re-asking. `latencyMs` is what the
2020
+ * evaluation cost in wall clock on the hot path of a completion. No event is
2021
+ * written where the brake is disarmed (`claimCap` of zero), where the
2022
+ * transport failed, or where there was no task and no claim to ask about:
2023
+ * nothing was read, so there is nothing to record. A spent cap is no longer
2024
+ * one of those cases — the reading still happens, and it is the reading that
2025
+ * ends the run. See `CompletionClaim`.
2026
+ *
2027
+ * @category events
2028
+ * @since 1.0.0-rc.0
2029
+ */
2030
+ export declare class ClaimDemanded extends ClaimDemanded_base {
2031
+ }
2032
+ /**
2033
+ * One classifier answer as `decision-settled` journals it, tagged by kind.
2034
+ *
2035
+ * `confidence` is the PROVIDER's number, `Evaluator.Response.confidence`, and
2036
+ * it is absent whenever the provider sent none. It is never the largest
2037
+ * probability wearing the name: `Classifier.confidence` reads 1 for an answer
2038
+ * that carried no distribution at all, so a record that filled the field from
2039
+ * it would report certainty exactly where the provider reported nothing. A
2040
+ * boolean has no such field because its probability is the whole answer.
2041
+ *
2042
+ * @category models
2043
+ * @since 1.0.0-rc.0
2044
+ */
2045
+ export declare const DecisionAnswer: Schema.Union<readonly [Schema.Struct<{
2046
+ readonly kind: Schema.Literal<"boolean">;
2047
+ /** The probability the transport gave to yes. */
2048
+ readonly p: Schema.Number;
2049
+ }>, Schema.Struct<{
2050
+ readonly kind: Schema.Literal<"choice">;
2051
+ /** The option chosen. */
2052
+ readonly value: Schema.String;
2053
+ readonly probabilities: Schema.$Record<Schema.String, Schema.Number>;
2054
+ /** The provider's own number, unchecked: it is theirs to define, and a record must not fail a run. */
2055
+ readonly confidence: Schema.optionalKey<Schema.Number>;
2056
+ }>, Schema.Struct<{
2057
+ readonly kind: Schema.Literal<"score">;
2058
+ /** The score as the transport gave it, interpolated over rung indexes. */
2059
+ readonly value: Schema.Number;
2060
+ /** The label of the nearest rung. */
2061
+ readonly label: Schema.String;
2062
+ readonly probabilities: Schema.$Record<Schema.String, Schema.Number>;
2063
+ /** The provider's own number, unchecked: it is theirs to define, and a record must not fail a run. */
2064
+ readonly confidence: Schema.optionalKey<Schema.Number>;
2065
+ }>]>;
2066
+ /**
2067
+ * The decoded form of {@link DecisionAnswer}.
2068
+ *
2069
+ * @category models
2070
+ * @since 1.0.0-rc.0
2071
+ */
2072
+ export type DecisionAnswer = typeof DecisionAnswer.Type;
2073
+ /**
2074
+ * The answers of one evaluation in the shape {@link DecisionSettled} carries.
2075
+ *
2076
+ * `confidence` is `Evaluator.Response.confidence`, passed through per question
2077
+ * and left out per question: see {@link DecisionAnswer}.
2078
+ *
2079
+ * @category conversions
2080
+ * @since 1.0.0-rc.0
2081
+ */
2082
+ export declare const decisionAnswers: (answers: Readonly<Record<string, Classifier.Answer>>, confidence: Readonly<Record<string, number>> | undefined) => Readonly<Record<string, DecisionAnswer>>;
2083
+ declare const DecisionSettled_base: Schema.Class<DecisionSettled, Schema.TaggedStruct<"decision-settled", {
2084
+ readonly eventType: Schema.Literal<"flows.harness.decision-settled.v1">;
2085
+ /** The run's session, which is the recorded scope of the step that decided. */
2086
+ readonly scope: Schema.String;
2087
+ /** The controller's frame number for the turn the decision was made in. */
2088
+ readonly frame: Schema.Int;
2089
+ /** The classifier's stable id. */
2090
+ readonly classifier: Schema.String;
2091
+ /** `Classifier.digest`: the canonical hash of the id and the questions. */
2092
+ readonly digest: Schema.String;
2093
+ /** The encoded state the questions were asked about, as the transport was sent it. */
2094
+ readonly state: Schema.Codec<Schema.Json, Schema.Json, never, never>;
2095
+ /** The questions as they crossed the wire, keyed by question id. */
2096
+ readonly questions: Schema.$Record<Schema.String, Schema.Union<readonly [typeof Evaluator.BooleanQuestion, typeof Evaluator.ChoiceQuestion, typeof Evaluator.ScoreQuestion]>>;
2097
+ /** One answer per question id, tagged by kind. */
2098
+ readonly answers: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Struct<{
2099
+ readonly kind: Schema.Literal<"boolean">;
2100
+ /** The probability the transport gave to yes. */
2101
+ readonly p: Schema.Number;
2102
+ }>, Schema.Struct<{
2103
+ readonly kind: Schema.Literal<"choice">;
2104
+ /** The option chosen. */
2105
+ readonly value: Schema.String;
2106
+ readonly probabilities: Schema.$Record<Schema.String, Schema.Number>;
2107
+ /** The provider's own number, unchecked: it is theirs to define, and a record must not fail a run. */
2108
+ readonly confidence: Schema.optionalKey<Schema.Number>;
2109
+ }>, Schema.Struct<{
2110
+ readonly kind: Schema.Literal<"score">;
2111
+ /** The score as the transport gave it, interpolated over rung indexes. */
2112
+ readonly value: Schema.Number;
2113
+ /** The label of the nearest rung. */
2114
+ readonly label: Schema.String;
2115
+ readonly probabilities: Schema.$Record<Schema.String, Schema.Number>;
2116
+ /** The provider's own number, unchecked: it is theirs to define, and a record must not fail a run. */
2117
+ readonly confidence: Schema.optionalKey<Schema.Number>;
2118
+ }>]>>;
2119
+ /** Wall-clock milliseconds the evaluation took. */
2120
+ readonly latencyMs: Schema.Int;
2121
+ /** Whether this decision changed what the run did next. */
2122
+ readonly acted: Schema.Boolean;
2123
+ /** Who answered. */
2124
+ readonly decidedBy: Schema.Literals<readonly ["jev", "seat", "human"]>;
2125
+ /** Token usage reported by the evaluator, absent when it supplied none. */
2126
+ readonly usage: Schema.optional<Schema.Struct<{
2127
+ readonly inputTokens: Schema.Number;
2128
+ readonly outputTokens: Schema.Number;
2129
+ readonly modelId: Schema.optional<Schema.String>;
2130
+ }>>;
2131
+ }>, {}>;
2132
+ /**
2133
+ * One decision a classifier made, with everything a reader needs to make it
2134
+ * again: the state it read, the questions it was asked, and what it answered.
2135
+ *
2136
+ * The generalisation of {@link ClaimDemanded}, which stays. That event is three
2137
+ * probabilities and a verdict, and it cannot say what the probabilities were
2138
+ * probabilities OF: the evidence the brake assembled exists nowhere else, so a
2139
+ * reading could be re-thresholded and never re-asked. This one carries the
2140
+ * evidence. It is written beside `claim-demanded` rather than instead of it,
2141
+ * because every projection that counts readings counts that event.
2142
+ *
2143
+ * `classifier` is the declaration's stable id, never its description, and
2144
+ * `digest` is `Classifier.digest`, so a reader can tell a decision made under
2145
+ * questions that have since been reworded from one it can reproduce.
2146
+ * `questions` are the wire shapes the transport was sent.
2147
+ *
2148
+ * `acted` says whether the decision changed what the run did next. For the
2149
+ * completion brake that is a completion handed back or a run ended; a reading
2150
+ * that let the claim stand is `false`, and it is journaled all the same,
2151
+ * because the passing decisions are what say whether asking was right.
2152
+ *
2153
+ * `decidedBy` names who answered: `jev` for the decision-only model behind
2154
+ * `Evaluator`, `seat` for a generation seat asked to judge, `human` for a
2155
+ * person. Only `jev` is written today.
2156
+ *
2157
+ * `scope` and `frame` are the join keys {@link ModelRequested} carries, for the
2158
+ * reason it carries them.
2159
+ *
2160
+ * An emitter must produce the reading inside a recorded boundary, as the
2161
+ * completion brake does, and emit what the record holds. The answers are a
2162
+ * model's and the latency is a clock's, so a replayed frame that asked again
2163
+ * would journal a second, different decision at the same coordinates.
2164
+ *
2165
+ * @category events
2166
+ * @since 1.0.0-rc.0
2167
+ */
2168
+ export declare class DecisionSettled extends DecisionSettled_base {
2169
+ }
2170
+ declare const SupervisorSettled_base: Schema.Class<SupervisorSettled, Schema.TaggedStruct<"supervisor-settled", {
2171
+ readonly eventType: Schema.Literal<"flows.harness.supervisor-settled.v1">;
2172
+ /** The run's session. */
2173
+ readonly scope: Schema.String;
2174
+ /** The frame the snapshot was built from. */
2175
+ readonly frame: Schema.Int;
2176
+ /** Probability the run is repeating itself without converging. */
2177
+ readonly thrashing: Schema.Number;
2178
+ /** Probability the run is still working on the task as stated. */
2179
+ readonly onTarget: Schema.Number;
2180
+ /** Probability the run's evidence is suspect. */
2181
+ readonly suspect: Schema.Number;
2182
+ /** Probability visible earlier context is contradicted by later evidence. */
2183
+ readonly outdatedContext: Schema.optional<Schema.Number>;
2184
+ /** Probability visible earlier context is no longer useful for this task. */
2185
+ readonly irrelevantContext: Schema.optional<Schema.Number>;
2186
+ readonly frustrated: Schema.Literals<readonly ["none", "mild", "strong"]>;
2187
+ readonly anxious: Schema.Literals<readonly ["none", "mild", "strong"]>;
2188
+ readonly scared: Schema.Literals<readonly ["none", "mild", "strong"]>;
2189
+ readonly confused: Schema.Literals<readonly ["none", "mild", "strong"]>;
2190
+ readonly confident: Schema.Literals<readonly ["none", "mild", "strong"]>;
2191
+ /** The one word a person is shown. */
2192
+ readonly needsHelp: Schema.Literals<readonly ["none", "clarification", "permission", "stuck", "risky_action"]>;
2193
+ /** Whether the reading crossed a nudge threshold. */
2194
+ readonly crossed: Schema.Boolean;
2195
+ /** Whether a nudge was handed to the next boundary. */
2196
+ readonly nudged: Schema.Boolean;
2197
+ /**
2198
+ * Whether steering was armed for this reading. `discipline-armed` states it
2199
+ * once, at a run's first frame; a resumed run may be armed differently, and
2200
+ * this is where the journal says what the reading actually ran under.
2201
+ * Absent from readings journaled before it existed.
2202
+ */
2203
+ readonly steer: Schema.optional<Schema.Boolean>;
2204
+ /**
2205
+ * Whether the snapshot had more uncalled skills than `Supervisor.skillLimit`,
2206
+ * so some were not scored. Absent when every one was.
2207
+ */
2208
+ readonly skillsCapped: Schema.optional<Schema.Boolean>;
2209
+ /** Wall-clock milliseconds the evaluation took. */
2210
+ readonly latencyMs: Schema.Int;
2211
+ /** Token usage reported by the evaluator, absent when it supplied none. */
2212
+ readonly usage: Schema.optional<Schema.Struct<{
2213
+ readonly inputTokens: Schema.Number;
2214
+ readonly outputTokens: Schema.Number;
2215
+ readonly modelId: Schema.optional<Schema.String>;
2216
+ }>>;
2217
+ /** Each armed monitor's probability in this reading, and whether it crossed. */
2218
+ readonly monitors: Schema.optional<Schema.$Array<Schema.Struct<{
2219
+ readonly id: Schema.String;
2220
+ readonly kind: Schema.Literals<readonly ["mood", "skill", "lint"]>;
2221
+ readonly p: Schema.Number;
2222
+ readonly crossed: Schema.Boolean;
2223
+ }>>>;
2224
+ }>, {}>;
2225
+ /**
2226
+ * What Jev read off one frame of a running run, whether or not it nudged.
2227
+ *
2228
+ * Written by the supervisor fiber for every snapshot it read, at some time
2229
+ * after the frame it is a reading of closed: the reading is taken off the
2230
+ * cell loop's hot path, so its position among the frame's other events is not
2231
+ * fixed and `scope` and `frame` are its coordinates. `frame` is the frame the
2232
+ * snapshot was built from, not the frame that will read any nudge.
2233
+ *
2234
+ * `thrashing`, `onTarget` and `suspect` are the transport's probabilities
2235
+ * verbatim, so a wave re-applies any threshold without re-asking. The five
2236
+ * levels and `needsHelp` are the transport's words: nothing here is a default
2237
+ * a failed reading fills in, because a failed reading writes
2238
+ * {@link SupervisorUnjudged} and never this. `crossed` says whether the
2239
+ * reading passed a nudge threshold; `nudged` whether a nudge was handed to
2240
+ * the next boundary, which needs the host to have armed steering. The
2241
+ * recalled rows are judged by Relevance and journaled beside this as
2242
+ * `relevance-settled`. `decision-settled` beside this carries the snapshot
2243
+ * and every answer.
2244
+ *
2245
+ * @category events
2246
+ * @since 1.0.0-rc.0
2247
+ */
2248
+ export declare class SupervisorSettled extends SupervisorSettled_base {
2249
+ }
2250
+ declare const SupervisorUnjudged_base: Schema.Class<SupervisorUnjudged, Schema.TaggedStruct<"supervisor-unjudged", {
2251
+ readonly eventType: Schema.Literal<"flows.harness.supervisor-unjudged.v1">;
2252
+ /** The run's session. */
2253
+ readonly scope: Schema.String;
2254
+ /** The frame the snapshot was built from. */
2255
+ readonly frame: Schema.Int;
2256
+ /** `unconfigured`, `interrupted`, or the transport's own error code. */
2257
+ readonly reason: Schema.Literals<readonly ["interrupted", "unconfigured", "unreachable", "refused", "empty", "timeout", "invalid_answer", "invalid_question"]>;
2258
+ /** What went wrong, safe to journal: see `Evaluator.publicMessage`. */
2259
+ readonly detail: Schema.String;
2260
+ /** What each request of the failed reading paid; absent when none was metered. */
2261
+ readonly usage: Schema.optional<Schema.$Array<Schema.Struct<{
2262
+ readonly inputTokens: Schema.Number;
2263
+ readonly outputTokens: Schema.Number;
2264
+ readonly modelId: Schema.optional<Schema.String>;
2265
+ }>>>;
2266
+ }>, {}>;
2267
+ /**
2268
+ * A supervisor snapshot nobody could judge, and why.
2269
+ *
2270
+ * Written instead of {@link SupervisorSettled}, never beside it: no
2271
+ * evaluator on the host, a refusal, a deadline, an answer that does not
2272
+ * decode, a run that ended with the reading in flight. `reason` is
2273
+ * `unconfigured`, `interrupted`, or the transport's own error code. A reading
2274
+ * that fails inserts nothing and reports no level, so a
2275
+ * wave counting calm runs counts only runs Jev read. An `interrupted` reading
2276
+ * was asked and may have cost a call, so a wave counting Jev's cost counts it.
2277
+ *
2278
+ * @category events
2279
+ * @since 1.0.0-rc.0
2280
+ */
2281
+ export declare class SupervisorUnjudged extends SupervisorUnjudged_base {
2282
+ }
2283
+ declare const DecisionUnjudged_base: Schema.Class<DecisionUnjudged, Schema.TaggedStruct<"decision-unjudged", {
2284
+ readonly eventType: Schema.Literal<"flows.harness.decision-unjudged.v1">;
2285
+ /** The run's session. */
2286
+ readonly scope: Schema.String;
2287
+ /** The frame the reading was asked in. */
2288
+ readonly frame: Schema.Int;
2289
+ /** The classifier's stable id. */
2290
+ readonly classifier: Schema.String;
2291
+ /** `unconfigured`, `interrupted`, or the transport's own error code. */
2292
+ readonly reason: Schema.Literals<readonly ["interrupted", "unconfigured", "unreachable", "refused", "empty", "timeout", "invalid_answer", "invalid_question"]>;
2293
+ /** What went wrong, safe to journal: see `Evaluator.publicMessage`. */
2294
+ readonly detail: Schema.String;
2295
+ /** Items the failed reading covered. */
2296
+ readonly items: Schema.Int;
2297
+ /** What each request of the failed reading paid; absent when none was metered. */
2298
+ readonly usage: Schema.optional<Schema.$Array<Schema.Struct<{
2299
+ readonly inputTokens: Schema.Number;
2300
+ readonly outputTokens: Schema.Number;
2301
+ readonly modelId: Schema.optional<Schema.String>;
2302
+ }>>>;
2303
+ }>, {}>;
2304
+ /**
2305
+ * A Jev reading that could not be judged, outside the supervisor.
2306
+ *
2307
+ * Written by a relevance, compaction or routing reading instead of its
2308
+ * settlement. The caller then keeps everything it would have filtered, so the
2309
+ * receipt is what says the filter did not run. `items` is how many items the
2310
+ * failed reading covered.
2311
+ *
2312
+ * @category events
2313
+ * @since 1.0.0-rc.0
2314
+ */
2315
+ export declare class DecisionUnjudged extends DecisionUnjudged_base {
2316
+ }
2317
+ declare const RelevanceSettled_base: Schema.Class<RelevanceSettled, Schema.TaggedStruct<"relevance-settled", {
2318
+ readonly eventType: Schema.Literal<"flows.harness.relevance-settled.v1">;
2319
+ /** The run's session. */
2320
+ readonly scope: Schema.String;
2321
+ /** The frame the reading was asked in. */
2322
+ readonly frame: Schema.Int;
2323
+ /**
2324
+ * `run` for the gate at run start, `supervisor` for recalled memory,
2325
+ * `recall` for a recall the model called.
2326
+ */
2327
+ readonly source: Schema.Literals<readonly ["run", "supervisor", "recall"]>;
2328
+ /** The probability at or above which an item is withheld. */
2329
+ readonly withholdAt: Schema.Number;
2330
+ readonly kept: Schema.$Array<Schema.Struct<{
2331
+ readonly kind: Schema.Literals<readonly ["flow", "skill", "instruction", "memory"]>;
2332
+ readonly id: Schema.String;
2333
+ /** Digest of the item's text; the text itself is never journaled. */
2334
+ readonly digest: Schema.String;
2335
+ /** Probability the item is unnecessary for the task as stated. */
2336
+ readonly p: Schema.Number;
2337
+ }>>;
2338
+ readonly withheld: Schema.$Array<Schema.Struct<{
2339
+ readonly kind: Schema.Literals<readonly ["flow", "skill", "instruction", "memory"]>;
2340
+ readonly id: Schema.String;
2341
+ /** Digest of the item's text; the text itself is never journaled. */
2342
+ readonly digest: Schema.String;
2343
+ /** Probability the item is unnecessary for the task as stated. */
2344
+ readonly p: Schema.Number;
2345
+ }>>;
2346
+ /** Wall-clock milliseconds the evaluation took. */
2347
+ readonly latencyMs: Schema.Int;
2348
+ /** Token usage reported by the evaluator, absent when it supplied none. */
2349
+ readonly usage: Schema.optional<Schema.Struct<{
2350
+ readonly inputTokens: Schema.Number;
2351
+ readonly outputTokens: Schema.Number;
2352
+ readonly modelId: Schema.optional<Schema.String>;
2353
+ }>>;
2354
+ }>, {}>;
2355
+ /**
2356
+ * Which human-provided items a relevance reading kept and which it withheld.
2357
+ *
2358
+ * An item is withheld only at or above `withholdAt`. Ids and digests, never
2359
+ * item text.
2360
+ *
2361
+ * @category events
2362
+ * @since 1.0.0-rc.0
2363
+ */
2364
+ export declare class RelevanceSettled extends RelevanceSettled_base {
2365
+ }
2366
+ declare const RelevanceRestored_base: Schema.Class<RelevanceRestored, Schema.TaggedStruct<"relevance-restored", {
2367
+ readonly eventType: Schema.Literal<"flows.harness.relevance-restored.v1">;
2368
+ /** The run's session. */
2369
+ readonly scope: Schema.String;
2370
+ /** The frame whose call restored it. */
2371
+ readonly frame: Schema.Int;
2372
+ /** The flow restored. */
2373
+ readonly flow: Schema.String;
2374
+ }>, {}>;
2375
+ /**
2376
+ * A withheld flow restored because the run called it by name.
2377
+ *
2378
+ * @category events
2379
+ * @since 1.0.0-rc.0
2380
+ */
2381
+ export declare class RelevanceRestored extends RelevanceRestored_base {
2382
+ }
2383
+ /**
2384
+ * A panel a routed run fans out to: each member seat, with the backups it
2385
+ * fails over to, answers the task, and `merger` merges their answers.
2386
+ *
2387
+ * @category schemas
2388
+ * @since 1.0.0-rc.0
2389
+ */
2390
+ export declare const SeatPanel: Schema.Struct<{
2391
+ readonly seats: Schema.$Array<Schema.Struct<{
2392
+ readonly seat: Schema.String;
2393
+ readonly backups: Schema.$Array<Schema.String>;
2394
+ }>>;
2395
+ readonly merger: Schema.String;
2396
+ }>;
2397
+ declare const SeatRouted_base: Schema.Class<SeatRouted, Schema.TaggedStruct<"seat-routed", {
2398
+ readonly eventType: Schema.Literal<"flows.harness.seat-routed.v1">;
2399
+ /** The run's session. */
2400
+ readonly scope: Schema.String;
2401
+ /** What the flow declared, such as `auto`. */
2402
+ readonly declared: Schema.String;
2403
+ /** The seat chosen. */
2404
+ readonly seat: Schema.String;
2405
+ /** The chosen seat's model. */
2406
+ readonly modelId: Schema.String;
2407
+ /** The system-prompt variant chosen with it, when one was. */
2408
+ readonly variant: Schema.NullOr<Schema.String>;
2409
+ /** The seats offered. */
2410
+ readonly candidates: Schema.$Array<Schema.String>;
2411
+ readonly decidedBy: Schema.Literals<readonly ["jev", "only"]>;
2412
+ /** The provider's own number, absent when it sent none. */
2413
+ readonly confidence: Schema.optional<Schema.Number>;
2414
+ /** Wall-clock milliseconds the routing took. */
2415
+ readonly latencyMs: Schema.Int;
2416
+ /** The seats `seat` fails over to, in order; absent when there are none. */
2417
+ readonly backups: Schema.optionalKey<Schema.$Array<Schema.String>>;
2418
+ /** The panel the task was routed to, whose merger is `seat`; absent for one seat. */
2419
+ readonly panel: Schema.optionalKey<Schema.Struct<{
2420
+ readonly seats: Schema.$Array<Schema.Struct<{
2421
+ readonly seat: Schema.String;
2422
+ readonly backups: Schema.$Array<Schema.String>;
2423
+ }>>;
2424
+ readonly merger: Schema.String;
2425
+ }>>;
2426
+ }>, {}>;
2427
+ /**
2428
+ * The seat a run with no declared model was routed to, and who chose it.
2429
+ *
2430
+ * `decidedBy` is `jev` when Jev answered the routing questions. Rows written
2431
+ * before the routing graph may say `only` and carry the seat choice's
2432
+ * `confidence`.
2433
+ *
2434
+ * @category events
2435
+ * @since 1.0.0-rc.0
2436
+ */
2437
+ export declare class SeatRouted extends SeatRouted_base {
2438
+ }
2439
+ declare const SupervisorMemoryFailed_base: Schema.Class<SupervisorMemoryFailed, Schema.TaggedStruct<"supervisor-memory-failed", {
2440
+ readonly eventType: Schema.Literal<"flows.harness.supervisor-memory-failed.v1">;
2441
+ /** The run's session. */
2442
+ readonly scope: Schema.String;
2443
+ /** The frame whose reading asked; for a `remember`, the run's last frame. */
2444
+ readonly frame: Schema.Int;
2445
+ /** `recall` for a read, `remember` for a write. */
2446
+ readonly operation: Schema.Literals<readonly ["recall", "remember"]>;
2447
+ /** The store's own account of the failure. */
2448
+ readonly detail: Schema.String;
2449
+ }>, {}>;
2450
+ /**
2451
+ * A memory read or write the store refused.
2452
+ *
2453
+ * A `recall` is written by the supervisor fiber beside the reading it belongs
2454
+ * to, never instead of it: a memory fault is not a supervisor fault, and the
2455
+ * reading still settles. A `remember` is written at run end by the transcript
2456
+ * miner, for a fact Jev accepted that the store did not keep, and the run
2457
+ * still ends as it would have. `operation` says which side failed; `detail`
2458
+ * is the store's own account. A wave counts these rather than reading a log, because a
2459
+ * concurrent writer that loses a lock looks exactly like a run that
2460
+ * remembered nothing.
2461
+ *
2462
+ * @category events
2463
+ * @since 1.0.0-rc.0
2464
+ */
2465
+ export declare class SupervisorMemoryFailed extends SupervisorMemoryFailed_base {
2466
+ }
2467
+ declare const SufficiencyObserved_base: Schema.Class<SufficiencyObserved, Schema.TaggedStruct<"sufficiency-observed", {
2468
+ readonly eventType: Schema.Literal<"flows.harness.sufficiency-observed.v1">;
2469
+ /** The flow that ran the failing check. */
2470
+ readonly flow: Schema.String;
2471
+ /** The failing check's input as the run wrote it, clipped. */
2472
+ readonly failed: Schema.String;
2473
+ /** The input of the passing check that answered it, clipped. */
2474
+ readonly passed: Schema.String;
2475
+ /** Mutating frames the run had spent when the failure was recorded. */
2476
+ readonly epoch: Schema.Int;
2477
+ /** The frame the observation was attached to. */
2478
+ readonly nextFrame: Schema.Int;
2479
+ }>, {}>;
2480
+ /**
2481
+ * The controller telling a run that its own evidence is complete.
2482
+ *
2483
+ * The one control that is not a brake, and the only one written for a frame
2484
+ * that has done nothing wrong: the run watched a check fail before it changed
2485
+ * anything and watched the same check, or a broader one, pass after. Written
2486
+ * when the observation is *issued*, at most once per run, because what answers
2487
+ * it is the next frame's transition and the journal already writes that.
2488
+ *
2489
+ * `failed` and `passed` quote the two inputs as the run wrote them, and `epoch`
2490
+ * is the run's count of mutating frames when the failure was recorded, so the
2491
+ * ordering the observation asserts is checkable after the fact. Nothing is
2492
+ * refused and no cap is spent, so there is no cap field to record.
2493
+ *
2494
+ * @category events
2495
+ * @since 0.1.0
2496
+ */
2497
+ export declare class SufficiencyObserved extends SufficiencyObserved_base {
2498
+ }
2499
+ declare const VacuousVerificationObserved_base: Schema.Class<VacuousVerificationObserved, Schema.TaggedStruct<"vacuous-verification-observed", {
2500
+ readonly eventType: Schema.Literal<"flows.harness.vacuous-verification-observed.v1">;
2501
+ /** The flow the stored check named. */
2502
+ readonly flow: Schema.String;
2503
+ /** The stored check's input as the run wrote it, clipped. */
2504
+ readonly check: Schema.String;
2505
+ /** The controller's identity for that call: the digest of its flow and input. */
2506
+ readonly callDigest: Schema.String;
2507
+ /** The frame the observation was attached to. */
2508
+ readonly nextFrame: Schema.Int;
2509
+ }>, {}>;
2510
+ /**
2511
+ * The controller telling a run that its stored proof was already green.
2512
+ *
2513
+ * **Nothing emits this.** `VacuousVerification` is unwired from `CellTurn`;
2514
+ * the event stays declared so the r93 journals that carry it keep decoding and
2515
+ * so a controlled re-measure needs no schema change. See `VacuousVerification`
2516
+ * for the evidence that turned the arm off.
2517
+ *
2518
+ * The second control in this package that is not a brake, and the narrower of
2519
+ * the two: a cell stored `state.verification` naming a call this run had
2520
+ * already watched pass over the tree it was handed, before any frame changed a
2521
+ * byte. Written when the observation is issued, at most once per distinct
2522
+ * verification input, and delivered on the `invalidProbe` channel because it is
2523
+ * the same class of fact — a result that reads identically on a broken tree and
2524
+ * on a fixed one.
2525
+ *
2526
+ * `check` quotes the stored input as the run wrote it, and `callDigest` is the
2527
+ * controller's own identity for that call, so a reader can reconcile the
2528
+ * observation against the run's own `cell-call-settled` rows without replaying
2529
+ * anything. Nothing is refused and no cap is spent, so there is no cap field.
2530
+ *
2531
+ * It is named for what it is -- the digest of `{ flow, input }`, nothing signs
2532
+ * it -- rather than `signature`, the controller's own word for it everywhere
2533
+ * else. The journal redacts by field name, and `signature` names a credential
2534
+ * often enough in this repository (an HMAC over share claims, a grant
2535
+ * envelope, a webhook header) that the rule stays. A field this row exists to
2536
+ * be reconciled by cannot be written as `[REDACTED]`, so the field carries the
2537
+ * honest word and the rule keeps its reach.
2538
+ *
2539
+ * @category events
2540
+ * @since 0.1.0
2541
+ */
2542
+ export declare class VacuousVerificationObserved extends VacuousVerificationObserved_base {
2543
+ }
2544
+ declare const MutationObserved_base: Schema.Class<MutationObserved, Schema.TaggedStruct<"mutation-observed", {
2545
+ readonly eventType: Schema.Literal<"flows.harness.mutation-observed.v1">;
2546
+ /** What the frame had to decide with: a full measurement, a partial one, or paperwork. */
2547
+ readonly basis: Schema.Literals<readonly ["observed", "partial", "declared"]>;
2548
+ /** Whether this frame changed anything: the tree said so, or a call declared it. */
2549
+ readonly mutated: Schema.Boolean;
2550
+ /** Content address of the workspace as the frame left it; empty when unobserved. */
2551
+ readonly digest: Schema.String;
2552
+ /** Paths the closing measurement covered; zero when unobserved. */
2553
+ readonly paths: Schema.Int;
2554
+ /**
2555
+ * Calls this frame made that DECLARED a write, whether or not they landed.
2556
+ *
2557
+ * Journaled beside the observed answer rather than instead of it, because
2558
+ * the gap between the two numbers is the accounting defect itself: a frame
2559
+ * with `declaredWrites: 0` and `mutated: true` is a shell mutation nothing
2560
+ * else in the run can see, and a frame with `declaredWrites: 1` and
2561
+ * `mutated: false` under `observed` is a failed call whose declaration the
2562
+ * measurement contradicted.
2563
+ */
2564
+ readonly declaredWrites: Schema.Int;
2565
+ }>, {}>;
2566
+ /**
2567
+ * What one frame did to the workspace, and how the controller knows.
2568
+ *
2569
+ * Emitted once per frame that ran a cell. It is the frame's own answer to the
2570
+ * question every later audit asks — "did this frame change anything" — written
2571
+ * before any control acts on it, so a run that never trips the cap still leaves
2572
+ * the evidence behind.
2573
+ *
2574
+ * `basis` is the field that keeps the record honest. `observed` means the frame
2575
+ * had two measurements around it that each covered the whole workspace, so the
2576
+ * tree itself could answer. `partial` means a measurement was taken and stopped
2577
+ * at a bound before it covered the tree, so it is set aside: a prefix chosen by
2578
+ * sort order cannot say the files being edited outside it held still, and its
2579
+ * own movement is as likely to be a tool's churn as work. `declared` means the
2580
+ * host measured nothing at all.
2581
+ * Under the last two, `mutated` is only what the frame's calls claimed about
2582
+ * themselves — which is exactly the signal that missed a shell redirect over a
2583
+ * tracked source file.
2584
+ *
2585
+ * `mutated` is the union of the two signals, with one exception. A declaration
2586
+ * by a call that *succeeded* stands even where the measurement cannot see the
2587
+ * path it touched, because the alternative is failing a run that has been
2588
+ * editing all along on the strength of a walk that never looked at its files.
2589
+ * A declaration by a call that *failed* is a claim about what it would have
2590
+ * written, and where `basis` is `observed` and the digest did not move, the
2591
+ * tree has answered that claim: nothing was written, and the frame is not
2592
+ * counted as a write. So `declaredWrites: 1` beside `mutated: false` under
2593
+ * `observed` is a declaration the measurement vetoed, and both numbers stay in
2594
+ * the record.
2595
+ *
2596
+ * @category events
2597
+ * @since 0.1.0
2598
+ */
2599
+ export declare class MutationObserved extends MutationObserved_base {
2600
+ }
2601
+ declare const CheckpointMinted_base: Schema.Class<CheckpointMinted, Schema.TaggedStruct<"checkpoint-minted", {
2602
+ readonly eventType: Schema.Literal<"flows.harness.checkpoint-minted.v1">;
2603
+ /** The handle the cell holds, and what a later call names in its `at`. */
2604
+ readonly id: Schema.String;
2605
+ /** What the host recorded, in the host's own vocabulary. */
2606
+ readonly ref: Schema.String;
2607
+ /** The cell that minted it, and where in that cell. */
2608
+ readonly cell: Schema.String;
2609
+ readonly ordinal: Schema.Int;
2610
+ }>, {}>;
2611
+ /**
2612
+ * One tree this run pinned, and the store's own name for it.
2613
+ *
2614
+ * Journaled at the mint rather than only at its use, because the two are
2615
+ * frames apart by design: a run pins the tree it is about to change and reads
2616
+ * against it later, and a journal that recorded only the reading could not say
2617
+ * which tree it was a reading of. `ref` is the host's vocabulary and the
2618
+ * controller never interprets it; a grader reconciles it against the store by
2619
+ * hand. See `EngineLike` `Snapshot`.
2620
+ *
2621
+ * @category events
2622
+ * @since 0.1.0
2623
+ */
2624
+ export declare class CheckpointMinted extends CheckpointMinted_base {
2625
+ }
2626
+ declare const Suspended_base: Schema.Class<Suspended, Schema.TaggedStruct<"suspended", {
2627
+ readonly eventType: Schema.Literal<"flows.harness.suspended.v1">;
2628
+ readonly reason: typeof EngineLike.SuspendReason;
2629
+ }>, {}>;
2630
+ /**
2631
+ * The durable reason a cell execution parked.
2632
+ *
2633
+ * @category events
2634
+ * @since 0.1.0
2635
+ * @slop
2636
+ */
2637
+ export declare class Suspended extends Suspended_base {
2638
+ }
2639
+ declare const CompactionSettled_base: Schema.Class<CompactionSettled, Schema.TaggedStruct<"compaction-settled", {
2640
+ readonly eventType: Schema.Literal<"flows.harness.compaction-settled.v1">;
2641
+ readonly replacedPrefixDigest: Schema.String;
2642
+ readonly retainedMessageCount: Schema.optional<Schema.Int>;
2643
+ /** Absent when nothing replaced was squashed. */
2644
+ readonly summary: Schema.optional<Schema.Union<readonly [typeof ModelRequest.UserMessage, typeof ModelRequest.AssistantMessage, typeof ModelRequest.ToolMessage]> & {
2645
+ readonly discriminants: readonly ["user", "assistant", "tool"];
2646
+ readonly cases: {
2647
+ user: typeof ModelRequest.UserMessage;
2648
+ assistant: typeof ModelRequest.AssistantMessage;
2649
+ tool: typeof ModelRequest.ToolMessage;
2650
+ };
2651
+ readonly isAnyOf: <const Keys>(keys: readonly Keys[]) => (value: ModelRequest.UserMessage | ModelRequest.AssistantMessage | ModelRequest.ToolMessage) => value is Extract<ModelRequest.UserMessage, {
2652
+ readonly role: Keys;
2653
+ }> | Extract<ModelRequest.AssistantMessage, {
2654
+ readonly role: Keys;
2655
+ }> | Extract<ModelRequest.ToolMessage, {
2656
+ readonly role: Keys;
2657
+ }>;
2658
+ readonly guards: {
2659
+ user: (u: unknown) => u is ModelRequest.UserMessage;
2660
+ assistant: (u: unknown) => u is ModelRequest.AssistantMessage;
2661
+ tool: (u: unknown) => u is ModelRequest.ToolMessage;
2662
+ };
2663
+ readonly match: {
2664
+ <Cases extends {
2665
+ user: (value: ModelRequest.UserMessage) => any;
2666
+ assistant: (value: ModelRequest.AssistantMessage) => any;
2667
+ tool: (value: ModelRequest.ToolMessage) => any;
2668
+ }>(value: ModelRequest.UserMessage | ModelRequest.AssistantMessage | ModelRequest.ToolMessage, cases: Cases): Cases[keyof Cases] extends (value: any) => infer R ? import("effect/Unify").Unify<R> : never;
2669
+ <Cases extends {
2670
+ user: (value: ModelRequest.UserMessage) => any;
2671
+ assistant: (value: ModelRequest.AssistantMessage) => any;
2672
+ tool: (value: ModelRequest.ToolMessage) => any;
2673
+ }>(cases: Cases): (value: ModelRequest.UserMessage | ModelRequest.AssistantMessage | ModelRequest.ToolMessage) => Cases[keyof Cases] extends (value: any) => infer R ? import("effect/Unify").Unify<R> : never;
2674
+ };
2675
+ readonly matchOrElse: {
2676
+ <Cases extends {
2677
+ user?: (value: ModelRequest.UserMessage) => any;
2678
+ assistant?: (value: ModelRequest.AssistantMessage) => any;
2679
+ tool?: (value: ModelRequest.ToolMessage) => any;
2680
+ } & { [K in Exclude<keyof Cases, "user" | "assistant" | "tool">]: never; }, OrElse extends (value: Exclude<ModelRequest.UserMessage, {
2681
+ readonly role: keyof Cases;
2682
+ }> | Exclude<ModelRequest.AssistantMessage, {
2683
+ readonly role: keyof Cases;
2684
+ }> | Exclude<ModelRequest.ToolMessage, {
2685
+ readonly role: keyof Cases;
2686
+ }>) => any>(value: ModelRequest.UserMessage | ModelRequest.AssistantMessage | ModelRequest.ToolMessage, cases: Cases, orElse: OrElse): import("effect/Unify").Unify<{ [K_1 in keyof Cases]-?: NonNullable<Cases[K_1]> extends (...args: Array<any>) => infer R ? R : never; }[keyof Cases] | ReturnType<OrElse>>;
2687
+ <Cases extends {
2688
+ user?: (value: ModelRequest.UserMessage) => any;
2689
+ assistant?: (value: ModelRequest.AssistantMessage) => any;
2690
+ tool?: (value: ModelRequest.ToolMessage) => any;
2691
+ } & { [K in Exclude<keyof Cases, "user" | "assistant" | "tool">]: never; }, OrElse extends (value: Exclude<ModelRequest.UserMessage, {
2692
+ readonly role: keyof Cases;
2693
+ }> | Exclude<ModelRequest.AssistantMessage, {
2694
+ readonly role: keyof Cases;
2695
+ }> | Exclude<ModelRequest.ToolMessage, {
2696
+ readonly role: keyof Cases;
2697
+ }>) => any>(cases: Cases, orElse: OrElse): (value: ModelRequest.UserMessage | ModelRequest.AssistantMessage | ModelRequest.ToolMessage) => import("effect/Unify").Unify<{ [K_1 in keyof Cases]-?: NonNullable<Cases[K_1]> extends (...args: Array<any>) => infer R ? R : never; }[keyof Cases] | ReturnType<OrElse>>;
2698
+ };
2699
+ } & {
2700
+ make: (message: ModelRequest.Message) => ModelRequest.Message;
2701
+ user: (content: string | ModelRequest.TextPart | ReadonlyArray<ModelRequest.TextPart>) => ModelRequest.UserMessage;
2702
+ assistant: (content: string | ModelRequest.AssistantContentPart | ReadonlyArray<ModelRequest.AssistantContentPart>, options?: {
2703
+ readonly stopReason?: ModelRequest.StopReason | undefined;
2704
+ readonly responseId?: string | undefined;
2705
+ readonly itemIds?: ReadonlyArray<string> | undefined;
2706
+ }) => ModelRequest.AssistantMessage;
2707
+ tool: (content: ModelRequest.ToolResultPart | ReadonlyArray<ModelRequest.ToolResultPart>) => ModelRequest.ToolMessage;
2708
+ }>;
2709
+ /** Replaced messages carried over verbatim, after the summary. */
2710
+ readonly kept: Schema.optional<Schema.$Array<Schema.Union<readonly [typeof ModelRequest.UserMessage, typeof ModelRequest.AssistantMessage, typeof ModelRequest.ToolMessage]> & {
2711
+ readonly discriminants: readonly ["user", "assistant", "tool"];
2712
+ readonly cases: {
2713
+ user: typeof ModelRequest.UserMessage;
2714
+ assistant: typeof ModelRequest.AssistantMessage;
2715
+ tool: typeof ModelRequest.ToolMessage;
2716
+ };
2717
+ readonly isAnyOf: <const Keys>(keys: readonly Keys[]) => (value: ModelRequest.UserMessage | ModelRequest.AssistantMessage | ModelRequest.ToolMessage) => value is Extract<ModelRequest.UserMessage, {
2718
+ readonly role: Keys;
2719
+ }> | Extract<ModelRequest.AssistantMessage, {
2720
+ readonly role: Keys;
2721
+ }> | Extract<ModelRequest.ToolMessage, {
2722
+ readonly role: Keys;
2723
+ }>;
2724
+ readonly guards: {
2725
+ user: (u: unknown) => u is ModelRequest.UserMessage;
2726
+ assistant: (u: unknown) => u is ModelRequest.AssistantMessage;
2727
+ tool: (u: unknown) => u is ModelRequest.ToolMessage;
2728
+ };
2729
+ readonly match: {
2730
+ <Cases extends {
2731
+ user: (value: ModelRequest.UserMessage) => any;
2732
+ assistant: (value: ModelRequest.AssistantMessage) => any;
2733
+ tool: (value: ModelRequest.ToolMessage) => any;
2734
+ }>(value: ModelRequest.UserMessage | ModelRequest.AssistantMessage | ModelRequest.ToolMessage, cases: Cases): Cases[keyof Cases] extends (value: any) => infer R ? import("effect/Unify").Unify<R> : never;
2735
+ <Cases extends {
2736
+ user: (value: ModelRequest.UserMessage) => any;
2737
+ assistant: (value: ModelRequest.AssistantMessage) => any;
2738
+ tool: (value: ModelRequest.ToolMessage) => any;
2739
+ }>(cases: Cases): (value: ModelRequest.UserMessage | ModelRequest.AssistantMessage | ModelRequest.ToolMessage) => Cases[keyof Cases] extends (value: any) => infer R ? import("effect/Unify").Unify<R> : never;
2740
+ };
2741
+ readonly matchOrElse: {
2742
+ <Cases extends {
2743
+ user?: (value: ModelRequest.UserMessage) => any;
2744
+ assistant?: (value: ModelRequest.AssistantMessage) => any;
2745
+ tool?: (value: ModelRequest.ToolMessage) => any;
2746
+ } & { [K in Exclude<keyof Cases, "user" | "assistant" | "tool">]: never; }, OrElse extends (value: Exclude<ModelRequest.UserMessage, {
2747
+ readonly role: keyof Cases;
2748
+ }> | Exclude<ModelRequest.AssistantMessage, {
2749
+ readonly role: keyof Cases;
2750
+ }> | Exclude<ModelRequest.ToolMessage, {
2751
+ readonly role: keyof Cases;
2752
+ }>) => any>(value: ModelRequest.UserMessage | ModelRequest.AssistantMessage | ModelRequest.ToolMessage, cases: Cases, orElse: OrElse): import("effect/Unify").Unify<{ [K_1 in keyof Cases]-?: NonNullable<Cases[K_1]> extends (...args: Array<any>) => infer R ? R : never; }[keyof Cases] | ReturnType<OrElse>>;
2753
+ <Cases extends {
2754
+ user?: (value: ModelRequest.UserMessage) => any;
2755
+ assistant?: (value: ModelRequest.AssistantMessage) => any;
2756
+ tool?: (value: ModelRequest.ToolMessage) => any;
2757
+ } & { [K in Exclude<keyof Cases, "user" | "assistant" | "tool">]: never; }, OrElse extends (value: Exclude<ModelRequest.UserMessage, {
2758
+ readonly role: keyof Cases;
2759
+ }> | Exclude<ModelRequest.AssistantMessage, {
2760
+ readonly role: keyof Cases;
2761
+ }> | Exclude<ModelRequest.ToolMessage, {
2762
+ readonly role: keyof Cases;
2763
+ }>) => any>(cases: Cases, orElse: OrElse): (value: ModelRequest.UserMessage | ModelRequest.AssistantMessage | ModelRequest.ToolMessage) => import("effect/Unify").Unify<{ [K_1 in keyof Cases]-?: NonNullable<Cases[K_1]> extends (...args: Array<any>) => infer R ? R : never; }[keyof Cases] | ReturnType<OrElse>>;
2764
+ };
2765
+ } & {
2766
+ make: (message: ModelRequest.Message) => ModelRequest.Message;
2767
+ user: (content: string | ModelRequest.TextPart | ReadonlyArray<ModelRequest.TextPart>) => ModelRequest.UserMessage;
2768
+ assistant: (content: string | ModelRequest.AssistantContentPart | ReadonlyArray<ModelRequest.AssistantContentPart>, options?: {
2769
+ readonly stopReason?: ModelRequest.StopReason | undefined;
2770
+ readonly responseId?: string | undefined;
2771
+ readonly itemIds?: ReadonlyArray<string> | undefined;
2772
+ }) => ModelRequest.AssistantMessage;
2773
+ tool: (content: ModelRequest.ToolResultPart | ReadonlyArray<ModelRequest.ToolResultPart>) => ModelRequest.ToolMessage;
2774
+ }>>;
2775
+ /** What a reading marked each replaced segment, by segment digest. */
2776
+ readonly marks: Schema.optional<Schema.$Array<Schema.Struct<{
2777
+ readonly digest: Schema.String;
2778
+ readonly mark: Schema.Literals<readonly ["keep", "squash", "remove"]>;
2779
+ /** The invariant that overrode a `remove`, when one did. */
2780
+ readonly pinned: Schema.optional<Schema.Literals<readonly ["summary", "person", "steering", "mutated", "failing", "pair", "budget"]>>;
2781
+ }>>>;
2782
+ /** Estimated tokens the removed messages held. */
2783
+ readonly removedTokens: Schema.optional<Schema.Int>;
2784
+ /**
2785
+ * True when a judged run could not mark: its facts do not describe every
2786
+ * transcript segment, as in state written before marks, so every replaced
2787
+ * message was squashed.
2788
+ */
2789
+ readonly unaligned: Schema.optional<Schema.Boolean>;
2790
+ /** Why the compaction ran, budget first. Absent in older journals, which compacted on the budget alone. */
2791
+ readonly causes: Schema.optional<Schema.$Array<Schema.Literals<readonly ["budget", "outdated_context", "irrelevant_context"]>>>;
2792
+ }>, {}>;
2793
+ /**
2794
+ * A sealed compaction summary and the prefix it replaces.
2795
+ *
2796
+ * @category events
2797
+ * @since 0.1.0
2798
+ * @slop
2799
+ */
2800
+ export declare class CompactionSettled extends CompactionSettled_base {
2801
+ }
2802
+ declare const SteeringDrained_base: Schema.Class<SteeringDrained, Schema.TaggedStruct<"steering-drained", {
2803
+ readonly eventType: Schema.Literal<"flows.harness.steering-drained.v1">;
2804
+ /** What the person sent, in admission order. */
2805
+ readonly messages: Schema.$Array<Schema.Union<readonly [typeof ModelRequest.UserMessage, typeof ModelRequest.AssistantMessage, typeof ModelRequest.ToolMessage]> & {
2806
+ readonly discriminants: readonly ["user", "assistant", "tool"];
2807
+ readonly cases: {
2808
+ user: typeof ModelRequest.UserMessage;
2809
+ assistant: typeof ModelRequest.AssistantMessage;
2810
+ tool: typeof ModelRequest.ToolMessage;
2811
+ };
2812
+ readonly isAnyOf: <const Keys>(keys: readonly Keys[]) => (value: ModelRequest.UserMessage | ModelRequest.AssistantMessage | ModelRequest.ToolMessage) => value is Extract<ModelRequest.UserMessage, {
2813
+ readonly role: Keys;
2814
+ }> | Extract<ModelRequest.AssistantMessage, {
2815
+ readonly role: Keys;
2816
+ }> | Extract<ModelRequest.ToolMessage, {
2817
+ readonly role: Keys;
2818
+ }>;
2819
+ readonly guards: {
2820
+ user: (u: unknown) => u is ModelRequest.UserMessage;
2821
+ assistant: (u: unknown) => u is ModelRequest.AssistantMessage;
2822
+ tool: (u: unknown) => u is ModelRequest.ToolMessage;
2823
+ };
2824
+ readonly match: {
2825
+ <Cases extends {
2826
+ user: (value: ModelRequest.UserMessage) => any;
2827
+ assistant: (value: ModelRequest.AssistantMessage) => any;
2828
+ tool: (value: ModelRequest.ToolMessage) => any;
2829
+ }>(value: ModelRequest.UserMessage | ModelRequest.AssistantMessage | ModelRequest.ToolMessage, cases: Cases): Cases[keyof Cases] extends (value: any) => infer R ? import("effect/Unify").Unify<R> : never;
2830
+ <Cases extends {
2831
+ user: (value: ModelRequest.UserMessage) => any;
2832
+ assistant: (value: ModelRequest.AssistantMessage) => any;
2833
+ tool: (value: ModelRequest.ToolMessage) => any;
2834
+ }>(cases: Cases): (value: ModelRequest.UserMessage | ModelRequest.AssistantMessage | ModelRequest.ToolMessage) => Cases[keyof Cases] extends (value: any) => infer R ? import("effect/Unify").Unify<R> : never;
2835
+ };
2836
+ readonly matchOrElse: {
2837
+ <Cases extends {
2838
+ user?: (value: ModelRequest.UserMessage) => any;
2839
+ assistant?: (value: ModelRequest.AssistantMessage) => any;
2840
+ tool?: (value: ModelRequest.ToolMessage) => any;
2841
+ } & { [K in Exclude<keyof Cases, "user" | "assistant" | "tool">]: never; }, OrElse extends (value: Exclude<ModelRequest.UserMessage, {
2842
+ readonly role: keyof Cases;
2843
+ }> | Exclude<ModelRequest.AssistantMessage, {
2844
+ readonly role: keyof Cases;
2845
+ }> | Exclude<ModelRequest.ToolMessage, {
2846
+ readonly role: keyof Cases;
2847
+ }>) => any>(value: ModelRequest.UserMessage | ModelRequest.AssistantMessage | ModelRequest.ToolMessage, cases: Cases, orElse: OrElse): import("effect/Unify").Unify<{ [K_1 in keyof Cases]-?: NonNullable<Cases[K_1]> extends (...args: Array<any>) => infer R ? R : never; }[keyof Cases] | ReturnType<OrElse>>;
2848
+ <Cases extends {
2849
+ user?: (value: ModelRequest.UserMessage) => any;
2850
+ assistant?: (value: ModelRequest.AssistantMessage) => any;
2851
+ tool?: (value: ModelRequest.ToolMessage) => any;
2852
+ } & { [K in Exclude<keyof Cases, "user" | "assistant" | "tool">]: never; }, OrElse extends (value: Exclude<ModelRequest.UserMessage, {
2853
+ readonly role: keyof Cases;
2854
+ }> | Exclude<ModelRequest.AssistantMessage, {
2855
+ readonly role: keyof Cases;
2856
+ }> | Exclude<ModelRequest.ToolMessage, {
2857
+ readonly role: keyof Cases;
2858
+ }>) => any>(cases: Cases, orElse: OrElse): (value: ModelRequest.UserMessage | ModelRequest.AssistantMessage | ModelRequest.ToolMessage) => import("effect/Unify").Unify<{ [K_1 in keyof Cases]-?: NonNullable<Cases[K_1]> extends (...args: Array<any>) => infer R ? R : never; }[keyof Cases] | ReturnType<OrElse>>;
2859
+ };
2860
+ } & {
2861
+ make: (message: ModelRequest.Message) => ModelRequest.Message;
2862
+ user: (content: string | ModelRequest.TextPart | ReadonlyArray<ModelRequest.TextPart>) => ModelRequest.UserMessage;
2863
+ assistant: (content: string | ModelRequest.AssistantContentPart | ReadonlyArray<ModelRequest.AssistantContentPart>, options?: {
2864
+ readonly stopReason?: ModelRequest.StopReason | undefined;
2865
+ readonly responseId?: string | undefined;
2866
+ readonly itemIds?: ReadonlyArray<string> | undefined;
2867
+ }) => ModelRequest.AssistantMessage;
2868
+ tool: (content: ModelRequest.ToolResultPart | ReadonlyArray<ModelRequest.ToolResultPart>) => ModelRequest.ToolMessage;
2869
+ }>;
2870
+ /**
2871
+ * What the run's supervisor delivered at the same boundary: a nudge or a
2872
+ * recalled row. The model reads these above the person's messages; they
2873
+ * never join the task the completion brake or the supervisor reads.
2874
+ */
2875
+ readonly supervisor: Schema.optional<Schema.$Array<Schema.Union<readonly [typeof ModelRequest.UserMessage, typeof ModelRequest.AssistantMessage, typeof ModelRequest.ToolMessage]> & {
2876
+ readonly discriminants: readonly ["user", "assistant", "tool"];
2877
+ readonly cases: {
2878
+ user: typeof ModelRequest.UserMessage;
2879
+ assistant: typeof ModelRequest.AssistantMessage;
2880
+ tool: typeof ModelRequest.ToolMessage;
2881
+ };
2882
+ readonly isAnyOf: <const Keys>(keys: readonly Keys[]) => (value: ModelRequest.UserMessage | ModelRequest.AssistantMessage | ModelRequest.ToolMessage) => value is Extract<ModelRequest.UserMessage, {
2883
+ readonly role: Keys;
2884
+ }> | Extract<ModelRequest.AssistantMessage, {
2885
+ readonly role: Keys;
2886
+ }> | Extract<ModelRequest.ToolMessage, {
2887
+ readonly role: Keys;
2888
+ }>;
2889
+ readonly guards: {
2890
+ user: (u: unknown) => u is ModelRequest.UserMessage;
2891
+ assistant: (u: unknown) => u is ModelRequest.AssistantMessage;
2892
+ tool: (u: unknown) => u is ModelRequest.ToolMessage;
2893
+ };
2894
+ readonly match: {
2895
+ <Cases extends {
2896
+ user: (value: ModelRequest.UserMessage) => any;
2897
+ assistant: (value: ModelRequest.AssistantMessage) => any;
2898
+ tool: (value: ModelRequest.ToolMessage) => any;
2899
+ }>(value: ModelRequest.UserMessage | ModelRequest.AssistantMessage | ModelRequest.ToolMessage, cases: Cases): Cases[keyof Cases] extends (value: any) => infer R ? import("effect/Unify").Unify<R> : never;
2900
+ <Cases extends {
2901
+ user: (value: ModelRequest.UserMessage) => any;
2902
+ assistant: (value: ModelRequest.AssistantMessage) => any;
2903
+ tool: (value: ModelRequest.ToolMessage) => any;
2904
+ }>(cases: Cases): (value: ModelRequest.UserMessage | ModelRequest.AssistantMessage | ModelRequest.ToolMessage) => Cases[keyof Cases] extends (value: any) => infer R ? import("effect/Unify").Unify<R> : never;
2905
+ };
2906
+ readonly matchOrElse: {
2907
+ <Cases extends {
2908
+ user?: (value: ModelRequest.UserMessage) => any;
2909
+ assistant?: (value: ModelRequest.AssistantMessage) => any;
2910
+ tool?: (value: ModelRequest.ToolMessage) => any;
2911
+ } & { [K in Exclude<keyof Cases, "user" | "assistant" | "tool">]: never; }, OrElse extends (value: Exclude<ModelRequest.UserMessage, {
2912
+ readonly role: keyof Cases;
2913
+ }> | Exclude<ModelRequest.AssistantMessage, {
2914
+ readonly role: keyof Cases;
2915
+ }> | Exclude<ModelRequest.ToolMessage, {
2916
+ readonly role: keyof Cases;
2917
+ }>) => any>(value: ModelRequest.UserMessage | ModelRequest.AssistantMessage | ModelRequest.ToolMessage, cases: Cases, orElse: OrElse): import("effect/Unify").Unify<{ [K_1 in keyof Cases]-?: NonNullable<Cases[K_1]> extends (...args: Array<any>) => infer R ? R : never; }[keyof Cases] | ReturnType<OrElse>>;
2918
+ <Cases extends {
2919
+ user?: (value: ModelRequest.UserMessage) => any;
2920
+ assistant?: (value: ModelRequest.AssistantMessage) => any;
2921
+ tool?: (value: ModelRequest.ToolMessage) => any;
2922
+ } & { [K in Exclude<keyof Cases, "user" | "assistant" | "tool">]: never; }, OrElse extends (value: Exclude<ModelRequest.UserMessage, {
2923
+ readonly role: keyof Cases;
2924
+ }> | Exclude<ModelRequest.AssistantMessage, {
2925
+ readonly role: keyof Cases;
2926
+ }> | Exclude<ModelRequest.ToolMessage, {
2927
+ readonly role: keyof Cases;
2928
+ }>) => any>(cases: Cases, orElse: OrElse): (value: ModelRequest.UserMessage | ModelRequest.AssistantMessage | ModelRequest.ToolMessage) => import("effect/Unify").Unify<{ [K_1 in keyof Cases]-?: NonNullable<Cases[K_1]> extends (...args: Array<any>) => infer R ? R : never; }[keyof Cases] | ReturnType<OrElse>>;
2929
+ };
2930
+ } & {
2931
+ make: (message: ModelRequest.Message) => ModelRequest.Message;
2932
+ user: (content: string | ModelRequest.TextPart | ReadonlyArray<ModelRequest.TextPart>) => ModelRequest.UserMessage;
2933
+ assistant: (content: string | ModelRequest.AssistantContentPart | ReadonlyArray<ModelRequest.AssistantContentPart>, options?: {
2934
+ readonly stopReason?: ModelRequest.StopReason | undefined;
2935
+ readonly responseId?: string | undefined;
2936
+ readonly itemIds?: ReadonlyArray<string> | undefined;
2937
+ }) => ModelRequest.AssistantMessage;
2938
+ tool: (content: ModelRequest.ToolResultPart | ReadonlyArray<ModelRequest.ToolResultPart>) => ModelRequest.ToolMessage;
2939
+ }>>;
2940
+ /** The monitor whose delivery `supervisor` carries, when one's does. */
2941
+ readonly monitor: Schema.optional<Schema.String>;
2942
+ /** Crossed monitors not delivered at this boundary, and why. */
2943
+ readonly suppressed: Schema.optional<Schema.$Array<Schema.Struct<{
2944
+ readonly id: Schema.String;
2945
+ readonly reason: Schema.Literals<readonly ["streak", "cooldown", "limit", "slot"]>;
2946
+ }>>>;
2947
+ /** Keys of the memory rows delivered at this boundary. */
2948
+ readonly memory: Schema.optional<Schema.$Array<Schema.String>>;
2949
+ }>, {}>;
2950
+ /**
2951
+ * Steering messages drained at a turn boundary.
2952
+ *
2953
+ * @category events
2954
+ * @since 0.1.0
2955
+ * @slop
2956
+ */
2957
+ export declare class SteeringDrained extends SteeringDrained_base {
2958
+ }
2959
+ declare const TurnClosed_base: Schema.Class<TurnClosed, Schema.TaggedStruct<"turn-closed", {
2960
+ readonly eventType: Schema.Literal<"flows.harness.turn-closed.v1">;
2961
+ readonly stopReason: Schema.Literals<readonly ["stop", "length", "tool-calls", "content-filter", "error", "aborted", "unknown"]>;
2962
+ readonly outcome: Schema.Literals<readonly ["continue", "resolved", "aborted", "suspended"]>;
2963
+ }>, {}>;
2964
+ /**
2965
+ * The terminal decision made at a turn boundary.
2966
+ *
2967
+ * @category events
2968
+ * @since 0.1.0
2969
+ * @slop
2970
+ */
2971
+ export declare class TurnClosed extends TurnClosed_base {
2972
+ }
2973
+ declare const PermissionRequired_base: Schema.Class<PermissionRequired, Schema.TaggedStruct<"permission-required", {
2974
+ readonly eventType: Schema.Literal<"flows.harness.permission-required.v1">;
2975
+ readonly request: typeof Permission.PermissionRequired;
2976
+ }>, {}>;
2977
+ /**
2978
+ * A permission request reported for engine-owned suspension and resolution.
2979
+ *
2980
+ * @category events
2981
+ * @since 0.1.0
2982
+ * @slop
2983
+ */
2984
+ export declare class PermissionRequired extends PermissionRequired_base {
2985
+ }
2986
+ declare const Aborted_base: Schema.Class<Aborted, Schema.TaggedStruct<"aborted", {
2987
+ readonly eventType: Schema.Literal<"flows.harness.aborted.v1">;
2988
+ readonly reason: Schema.String;
2989
+ }>, {}>;
2990
+ /**
2991
+ * A normalized harness abort.
2992
+ *
2993
+ * @category events
2994
+ * @since 0.1.0
2995
+ * @slop
2996
+ */
2997
+ export declare class Aborted extends Aborted_base {
2998
+ }
2999
+ declare const Resolved_base: Schema.Class<Resolved, Schema.TaggedStruct<"resolved", {
3000
+ readonly eventType: Schema.Literal<"flows.harness.resolved.v1">;
3001
+ readonly message: typeof ModelRequest.AssistantMessage;
3002
+ }>, {}>;
3003
+ /**
3004
+ * The final assistant message produced by the harness.
3005
+ *
3006
+ * @category events
3007
+ * @since 0.1.0
3008
+ * @slop
3009
+ */
3010
+ export declare class Resolved extends Resolved_base {
3011
+ }
3012
+ /**
3013
+ * All normalized events emitted by a harness adapter.
3014
+ *
3015
+ * @category events
3016
+ * @since 0.1.0
3017
+ * @slop
3018
+ */
3019
+ export declare const AgentEvent: Schema.toTaggedUnion<"_tag", readonly [typeof DisciplineArmed, typeof TurnOpened, typeof ModelDelta, typeof ModelRequested, typeof ModelSelected, typeof SeatFailedOver, typeof ModelParked, typeof ModelUnparked, typeof ModelRetried, typeof ModelSettled, typeof CellProduced, typeof CellRejectedInFrame, typeof CellCallStarted, typeof CellCallSettled, typeof CellPrinted, typeof CellSettled, typeof TransitionApplied, typeof MutationObserved, typeof CheckpointMinted, typeof ReadOnlyDemandIssued, typeof ReadOnlyDemanded, typeof RepeatDemanded, typeof NarrowedDemanded, typeof NarrowOnlyDemanded, typeof UnmovedDemanded, typeof UnresolvedDemanded, typeof FailedCallDemanded, typeof UnobservedDemanded, typeof OutputDemanded, typeof ClaimDemanded, typeof DecisionSettled, typeof SupervisorSettled, typeof SupervisorUnjudged, typeof SupervisorMemoryFailed, typeof DecisionUnjudged, typeof RelevanceSettled, typeof RelevanceRestored, typeof SeatRouted, typeof SufficiencyObserved, typeof VacuousVerificationObserved, typeof Suspended, typeof CompactionSettled, typeof SteeringDrained, typeof TurnClosed, typeof PermissionRequired, typeof Aborted, typeof Resolved]>;
3020
+ /**
3021
+ * All normalized events emitted by a harness adapter.
3022
+ *
3023
+ * @category events
3024
+ * @since 0.1.0
3025
+ * @slop
3026
+ */
3027
+ export type AgentEvent = typeof AgentEvent.Type;
3028
+ /**
3029
+ * The journal event type of every member of {@link AgentEvent}, by tag.
3030
+ *
3031
+ * One table, because the literal used to be written three times: on the class,
3032
+ * in `CellTurn`'s emitter, and again in `Transcript`'s decoder. A projection
3033
+ * that reads a literal the emitter no longer writes silently returns an empty
3034
+ * transcript, and nothing failed when the two drifted. `CellTurn` and
3035
+ * `Transcript` both read this, and `Contracts.test.ts` pins it against the
3036
+ * union, so an event added without a row here fails a test rather than a run.
3037
+ *
3038
+ * @category events
3039
+ * @since 0.1.0
3040
+ * @slop
3041
+ */
3042
+ export declare const eventType: {
3043
+ readonly aborted: "flows.harness.aborted.v1";
3044
+ readonly cellCallSettled: "flows.harness.cell-call-settled.v1";
3045
+ readonly cellCallStarted: "flows.harness.cell-call-started.v1";
3046
+ readonly cellPrinted: "flows.harness.cell-printed.v1";
3047
+ readonly cellProduced: "flows.harness.cell-produced.v1";
3048
+ readonly cellRejectedInFrame: "flows.harness.cell-rejected-in-frame.v1";
3049
+ readonly cellSettled: "flows.harness.cell-settled.v1";
3050
+ readonly checkpointMinted: "flows.harness.checkpoint-minted.v1";
3051
+ readonly claimDemanded: "flows.harness.claim-demanded.v1";
3052
+ readonly compactionSettled: "flows.harness.compaction-settled.v1";
3053
+ readonly decisionSettled: "flows.harness.decision-settled.v1";
3054
+ readonly decisionUnjudged: "flows.harness.decision-unjudged.v1";
3055
+ readonly disciplineArmed: "flows.harness.discipline-armed.v1";
3056
+ readonly modelDelta: "flows.harness.model-delta.v1";
3057
+ readonly modelRequested: "flows.harness.model-requested.v1";
3058
+ readonly modelSelected: "flows.harness.model-selected.v1";
3059
+ readonly seatFailedOver: "flows.harness.seat-failed-over.v1";
3060
+ readonly modelParked: "flows.harness.model-parked.v1";
3061
+ readonly modelUnparked: "flows.harness.model-unparked.v1";
3062
+ readonly modelRetried: "flows.harness.model-retried.v1";
3063
+ readonly modelSettled: "flows.harness.model-settled.v1";
3064
+ readonly mutationObserved: "flows.harness.mutation-observed.v1";
3065
+ readonly narrowOnlyDemanded: "flows.harness.narrow-only-demanded.v1";
3066
+ readonly narrowedDemanded: "flows.harness.narrowed-demanded.v1";
3067
+ readonly permissionRequired: "flows.harness.permission-required.v1";
3068
+ readonly readOnlyDemandIssued: "flows.harness.read-only-demand-issued.v1";
3069
+ readonly readOnlyDemanded: "flows.harness.read-only-demanded.v1";
3070
+ readonly relevanceRestored: "flows.harness.relevance-restored.v1";
3071
+ readonly relevanceSettled: "flows.harness.relevance-settled.v1";
3072
+ readonly repeatDemanded: "flows.harness.repeat-demanded.v1";
3073
+ readonly resolved: "flows.harness.resolved.v1";
3074
+ readonly seatRouted: "flows.harness.seat-routed.v1";
3075
+ readonly steeringDrained: "flows.harness.steering-drained.v1";
3076
+ readonly sufficiencyObserved: "flows.harness.sufficiency-observed.v1";
3077
+ readonly supervisorSettled: "flows.harness.supervisor-settled.v1";
3078
+ readonly supervisorUnjudged: "flows.harness.supervisor-unjudged.v1";
3079
+ readonly supervisorMemoryFailed: "flows.harness.supervisor-memory-failed.v1";
3080
+ readonly suspended: "flows.harness.suspended.v1";
3081
+ readonly transitionApplied: "flows.harness.transition-applied.v1";
3082
+ readonly turnClosed: "flows.harness.turn-closed.v1";
3083
+ readonly turnOpened: "flows.harness.turn-opened.v1";
3084
+ readonly unmovedDemanded: "flows.harness.unmoved-demanded.v1";
3085
+ readonly unresolvedDemanded: "flows.harness.unresolved-demanded.v1";
3086
+ readonly failedCallDemanded: "flows.harness.failed-call-demanded.v1";
3087
+ readonly unobservedDemanded: "flows.harness.unobserved-demanded.v1";
3088
+ readonly outputDemanded: "flows.harness.output-demanded.v1";
3089
+ readonly vacuousVerificationObserved: "flows.harness.vacuous-verification-observed.v1";
3090
+ };
3091
+ export {};
3092
+ //# sourceMappingURL=AgentEvent.d.ts.map