@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,546 @@
1
+ /**
2
+ * Narrow engine port consumed by the built-in harness.
3
+ *
4
+ * Governing contracts: `../docs/concepts.md#durable-cell-loop`,
5
+ * `../docs/concepts.md#child-plans-and-the-splice-boundary`, and
6
+ * `../docs/concepts.md#step-keys-and-the-model-layer`.
7
+ *
8
+ * @since 0.1.0
9
+ */
10
+ import type * as KeyMaterial from "@smthrs/core/KeyMaterial";
11
+ import type * as Model from "@smthrs/model/Model";
12
+ import type * as ModelEvent from "@smthrs/model/ModelEvent";
13
+ import type * as ModelRequest from "@smthrs/model/ModelRequest";
14
+ import { Context, Effect, Layer, Option, Schema, Stream } from "effect";
15
+ import type * as AgentEvent from "./AgentEvent.ts";
16
+ import type * as Cell from "./Cell.ts";
17
+ import { HarnessError } from "./HarnessError.ts";
18
+ import type * as Plan from "./Plan.ts";
19
+ /**
20
+ * Stable reasons for parking a harness turn at a safe boundary.
21
+ *
22
+ * @category models
23
+ * @since 0.1.0
24
+ * @slop
25
+ */
26
+ export declare const SuspendReasonCode: Schema.Literals<readonly ["permission-required", "waiting-quota", "waiting-input", "waiting-event", "engine"]>;
27
+ /**
28
+ * Stable reasons for parking a harness turn at a safe boundary.
29
+ *
30
+ * @category models
31
+ * @since 0.1.0
32
+ * @slop
33
+ */
34
+ export type SuspendReasonCode = typeof SuspendReasonCode.Type;
35
+ declare const SuspendReason_base: Schema.Class<SuspendReason, Schema.Struct<{
36
+ readonly code: Schema.Literals<readonly ["permission-required", "waiting-quota", "waiting-input", "waiting-event", "engine"]>;
37
+ readonly message: Schema.String;
38
+ readonly details: Schema.optional<Schema.Codec<Schema.Json, Schema.Json, never, never>>;
39
+ }>, {}>;
40
+ /**
41
+ * A serializable request to park the current engine frame.
42
+ *
43
+ * `details` is a closed JSON value rather than `Schema.Unknown`, for the reason
44
+ * `HarnessError`'s `cause` is a `Schema.Defect`: this value is journaled inside
45
+ * `AgentEvent.Suspended` and served back to whatever resumes the run, so it has
46
+ * to be something the durable exit schema can encode. `Schema.Unknown` accepts
47
+ * a live `Error`, a function, a `BigInt`, a cycle and an accessor, and the
48
+ * controller was in fact attaching a `Permission.PermissionRequired` — a class
49
+ * that extends `Error` — to every permission park. What a park carries is now
50
+ * encoded before it is attached, so the journal holds the same value a resumed
51
+ * run decodes.
52
+ *
53
+ * @category models
54
+ * @since 0.1.0
55
+ * @slop
56
+ */
57
+ export declare class SuspendReason extends SuspendReason_base {
58
+ }
59
+ /**
60
+ * A sealed model request and the complete digest-free material declared by the
61
+ * harness.
62
+ *
63
+ * @category models
64
+ * @since 0.1.0
65
+ * @slop
66
+ */
67
+ export interface SealedModelStep {
68
+ readonly request: ModelRequest.ModelRequest;
69
+ readonly keyMaterial: KeyMaterial.KeyMaterial;
70
+ /**
71
+ * Wall-clock milliseconds one attempt at this step may spend; zero disarms.
72
+ *
73
+ * The budget travels on the step rather than on the engine's construction so
74
+ * the number the controller journals as armed is the number the engine
75
+ * enforces — one value, read from the controller's own state, and no way for
76
+ * a run's record of its discipline to disagree with the discipline it ran
77
+ * under.
78
+ *
79
+ * It is not key material and must never become key material: it says how
80
+ * long the caller will wait, not what the model was asked, and a step keyed
81
+ * on it would miss its cache the moment a host retuned the budget.
82
+ */
83
+ readonly modelCallMs?: number | undefined;
84
+ }
85
+ /**
86
+ * The durable identity of one journaled controller boundary.
87
+ *
88
+ * `boundary` is a deterministic label for the boundary within its frame — a
89
+ * cell digest or a context digest — so re-executing the frame derives the same
90
+ * identity and replays the recorded value instead of performing the read
91
+ * again.
92
+ *
93
+ * @category models
94
+ * @since 0.1.0
95
+ * @slop
96
+ */
97
+ export interface BoundaryIdentity {
98
+ /** The durable session or lineage the boundary belongs to, when the loop has one. */
99
+ readonly session?: string | undefined;
100
+ readonly frame: number;
101
+ readonly boundary: string;
102
+ }
103
+ /**
104
+ * A schema that decodes without services — the only kind a durable store can
105
+ * reconstruct a journaled value with.
106
+ *
107
+ * @category models
108
+ * @since 0.1.0
109
+ * @slop
110
+ */
111
+ export type DurableSchema<A> = Schema.Schema<A> & {
112
+ readonly "DecodingServices": never;
113
+ };
114
+ /**
115
+ * One nondeterministic read the controller must perform exactly once per run.
116
+ *
117
+ * The canonical example is the turn-boundary steering drain: the host queue is
118
+ * the world, and draining it is an effect. Left unjournaled, a resumed run
119
+ * drains an already-drained queue, rebuilds a different context than the
120
+ * original attempt, re-keys every later sealed step, and re-executes
121
+ * irreversible effects. Recorded through {@link EngineLike.record}, the drain
122
+ * replays its recorded value and the resumed run converges on the original
123
+ * attempt.
124
+ *
125
+ * @category models
126
+ * @since 0.1.0
127
+ * @slop
128
+ */
129
+ export interface RecordBoundary<A> {
130
+ readonly name: string;
131
+ readonly identity: BoundaryIdentity;
132
+ readonly success: DurableSchema<A>;
133
+ readonly execute: Effect.Effect<A, HarnessError>;
134
+ /** Exact call whose delivered result this existing cell-call boundary records. */
135
+ readonly call?: Cell.Call | undefined;
136
+ /**
137
+ * The model usage the recorded value says this boundary paid for, such as
138
+ * an evaluator reading taken inside `execute`, one share per model.
139
+ *
140
+ * Read off the recorded value, never off the live call, so a replayed frame
141
+ * reports the same spend the original attempt paid. An implementation that
142
+ * keeps a run budget accounts it once under this boundary's key, on the
143
+ * live pass and on replay alike, pricing each share under its model id, so
144
+ * the next paid call is admitted against it. Declaring it declares the
145
+ * boundary paid: unless it is {@link advisory}, such an implementation
146
+ * admits it before `execute` under the budget's evaluator-reading policy,
147
+ * and a refusal fails or parks the run as a primary call's would.
148
+ * `undefined` or an empty list from it is a boundary that paid for nothing
149
+ * this time.
150
+ */
151
+ usage?(value: A): ReadonlyArray<Paid> | undefined;
152
+ /**
153
+ * A paid boundary whose caller drops its failure, such as the supervisor's
154
+ * reading in its own fiber: it is charged but never admitted, because a
155
+ * refusal there would register a park that no frame honours. The frame's
156
+ * next primary call applies the budget instead.
157
+ */
158
+ readonly advisory?: boolean | undefined;
159
+ }
160
+ /**
161
+ * One model's share of what a recorded boundary paid.
162
+ *
163
+ * @category models
164
+ * @since 1.0.0-rc.1
165
+ */
166
+ export interface Paid {
167
+ readonly usage: ModelEvent.Usage;
168
+ /** The model that was paid, when the reading named it: what prices the share. */
169
+ readonly modelId?: string | undefined;
170
+ }
171
+ declare const Observation_base: Schema.Class<Observation, Schema.Struct<{
172
+ /** A content address of everything the measurement covered, taken together. */
173
+ readonly digest: Schema.String;
174
+ /** How many paths the measurement covered. */
175
+ readonly paths: Schema.Int;
176
+ /** Whether the measurement covered the whole tree it was asked to measure. */
177
+ readonly complete: Schema.withDecodingDefaultKey<Schema.withConstructorDefault<Schema.Boolean>, never>;
178
+ /**
179
+ * How long the measurement took, in milliseconds, so a slow frame can be
180
+ * attributed. Absent from a measurement recorded before it was kept.
181
+ */
182
+ readonly elapsedMs: Schema.optionalKey<Schema.Int>;
183
+ }>, {}>;
184
+ /**
185
+ * One measurement of the workspace the run is changing.
186
+ *
187
+ * The controller never interprets `digest`; it only asks whether two
188
+ * measurements are equal. That is deliberate — the host owns what "the
189
+ * workspace" means (which paths it covers, and what it reads off each one),
190
+ * and the only thing the loop is entitled to conclude is "this is the tree I
191
+ * left" or "this is not". `paths` is carried for the journal, so a reader can
192
+ * tell an observation over 7,000 files from one over an empty root.
193
+ *
194
+ * `complete` is the answer to the one question that makes "this is the tree I
195
+ * left" meaningful. A measurement that stopped at a bound covers a prefix of
196
+ * the workspace, and a prefix cannot say that the rest of it held still — a
197
+ * checkout larger than the host's bound would otherwise report every frame as
198
+ * idle, and the read-only cap would fail a run that had been editing the whole
199
+ * time. A host that does not narrow its own measurement leaves it `true`.
200
+ *
201
+ * @category models
202
+ * @since 0.1.0
203
+ */
204
+ export declare class Observation extends Observation_base {
205
+ }
206
+ declare const Snapshot_base: Schema.Class<Snapshot, Schema.Struct<{
207
+ /** The id the cell holds, and the id a later call names in `at`. */
208
+ readonly id: Schema.String;
209
+ /** What the host recorded, in the host's own vocabulary. */
210
+ readonly ref: Schema.String;
211
+ }>, {}>;
212
+ /**
213
+ * One pinned tree the run can come back to.
214
+ *
215
+ * A checkpoint is a **value**, not a place the run goes: minting one changes
216
+ * nothing about the workspace, and running a call against one leaves the live
217
+ * tree exactly as it stands. That is the whole point. Before this existed, the
218
+ * only way to answer "did this command fail before my change" was to undo the
219
+ * change, and `sympy__sympy-13878` shows what that costs — one byte-identical
220
+ * 4,789-character patch applied five times, four of those applications preceded
221
+ * by `git checkout -- sympy/stats/crv_types.py`, because a clean proof required
222
+ * reverting the very work it was meant to prove.
223
+ *
224
+ * `ref` is the host's own name for what it pinned — a commit id, a snapshot
225
+ * key, whatever the store speaks. The controller never interprets it, exactly
226
+ * as it never interprets {@link Observation.digest}; it is carried so the
227
+ * journal says which tree a checkpointed call ran against and a grader can
228
+ * reconcile the reading against the store by hand.
229
+ *
230
+ * @category models
231
+ * @since 0.1.0
232
+ */
233
+ export declare class Snapshot extends Snapshot_base {
234
+ }
235
+ declare const Binding_base: Schema.Class<Binding, Schema.Struct<{
236
+ /** The configured route's id, as `Route.PreparedRequest.routeId` names it. */
237
+ readonly routeId: Schema.String;
238
+ /** The wire protocol that route speaks, as `Route.PreparedRequest.protocolId` names it. */
239
+ readonly protocolId: Schema.String;
240
+ }>, {}>;
241
+ /**
242
+ * The names of the route one model request resolves to.
243
+ *
244
+ * Names and nothing else. A route is an endpoint, a protocol and the
245
+ * credentials it authorizes with, and only the first two have a name a journal
246
+ * may carry: this is read off the credential-free `Route.PreparedRequest` the
247
+ * sealed step is keyed on, which is built before any secret is signed onto the
248
+ * request. So there is no field here a credential could travel in.
249
+ *
250
+ * @category models
251
+ * @since 1.0.0-rc.0
252
+ */
253
+ export declare class Binding extends Binding_base {
254
+ }
255
+ /**
256
+ * What one model request resolves to on its way out of the host.
257
+ *
258
+ * @category models
259
+ * @since 1.0.0-rc.0
260
+ */
261
+ export interface Resolved {
262
+ /** The request the provider is sent, after any rewrite the host applies. */
263
+ readonly request: ModelRequest.ModelRequest;
264
+ /** The route it goes to, or none where the host names none. */
265
+ readonly binding: Option.Option<Binding>;
266
+ }
267
+ /**
268
+ * A request to pin the workspace as it stands right now.
269
+ *
270
+ * `identity` travels with it so a store *can* namespace what it writes by the
271
+ * run that wrote it: two runs over one workspace mint `id` values from the same
272
+ * frame-and-ordinal counter, so a store that keys on the id alone hands the
273
+ * second run the first run's tree. `@smthrs/std/Checkpoints`'s git store keys
274
+ * on the id alone and is right to: it also materializes at one path per id, as
275
+ * `TestRun`'s baseline worktree does, so two concurrent runs over one workspace
276
+ * collide on the checkout before they collide on the name. One workspace holds
277
+ * one run — that is the assumption the whole workspace layer already makes, and
278
+ * this field is what a store that stops making it would namespace by.
279
+ *
280
+ * @category models
281
+ * @since 0.1.0
282
+ */
283
+ export interface CaptureRequest {
284
+ readonly id: string;
285
+ readonly identity: BoundaryIdentity;
286
+ }
287
+ /**
288
+ * The engine operations required by harness translation.
289
+ *
290
+ * @category services
291
+ * @since 0.1.0
292
+ * @slop
293
+ */
294
+ export interface EngineLike {
295
+ /**
296
+ * Runs one sealed model step.
297
+ *
298
+ * The harness contributes the assembled-context input, resolved layer set,
299
+ * capability envelope, effect tier, placement, and provider-neutral
300
+ * `ModelRequest` as core key material. The step-key contract
301
+ * (`../docs/concepts.md#step-keys-and-the-model-layer`) requires the exact
302
+ * wire request in the key, so route resolution happens before the key is
303
+ * sealed. An implementation MUST therefore resolve the route, run
304
+ * `Route.prepare` (`/model/Route`), and digest the credential-free
305
+ * `PreparedRequest` — canonical body bytes included — together with
306
+ * declared material into the sealed-step key before executing. A provider
307
+ * wire change must produce a new key; credentials are signed on after the
308
+ * digest and never enter it.
309
+ */
310
+ readonly sealStep: (step: SealedModelStep) => Stream.Stream<ModelEvent.ModelEvent, Model.ModelFailure | HarnessError>;
311
+ /** Optionally emits capacity transitions while sealing the same frame. */
312
+ readonly sealStepWithEvents?: (step: SealedModelStep, emit: (event: AgentEvent.AgentEvent) => Effect.Effect<void>) => Stream.Stream<ModelEvent.ModelEvent, Model.ModelFailure | HarnessError>;
313
+ readonly splice: (batch: Plan.Batch) => Stream.Stream<Plan.SpliceEvent, HarnessError>;
314
+ /**
315
+ * Runs one flow call issued from inside a running cell.
316
+ *
317
+ * This is the cell path's whole effectful surface, and it is deliberately
318
+ * one call at a time: a cell derives the second call's input from the first
319
+ * call's result, so there is no batch to hand over. The implementation owns
320
+ * durability — the call is a keyed, journaled activity at the tier the flow
321
+ * declares, keyed by `call.identity` so a settled boundary replays instead of
322
+ * re-running when the cell is re-executed after a crash or a permission park.
323
+ *
324
+ * A flow that fails settles as a `failure` {@link Cell.CallResult}, which the
325
+ * cell observes as a resolved `{ ok: false, error }` envelope, not a throw.
326
+ * It branches on `.ok === false` and `.error.code` to recover; success
327
+ * resolves with the flow's own value, unwrapped. A permission requirement, an
328
+ * abort, or an engine failure travels in the error channel instead, so the
329
+ * cell never sees — and can never swallow — a park.
330
+ */
331
+ readonly call: (call: Cell.Call) => Effect.Effect<Cell.CallResult, HarnessError>;
332
+ /**
333
+ * Decides a call's authority before the per-call clock starts.
334
+ *
335
+ * A person answering an approval is not the flow running slowly, so the
336
+ * controller asks here first and times only {@link call}. `undefined`
337
+ * admits the call; a result is the refusal the cell reads instead, and the
338
+ * call is never issued. A park or an engine failure travels in the error
339
+ * channel, exactly as it does from `call`. An implementation that admits a
340
+ * call does not ask again when that call is issued.
341
+ */
342
+ readonly admit?: (call: Cell.Call) => Effect.Effect<Cell.CallResult | undefined, HarnessError>;
343
+ /**
344
+ * The host's runaway guard for timeouts, when it has one.
345
+ *
346
+ * A tool call or a cell that ran past its time limit is otherwise the cell's
347
+ * to read. A host that guards timeouts parks the run on it instead, for an
348
+ * operator's Continue or Stop, and the controller records nothing for the
349
+ * timed-out operation, so Continue runs it again.
350
+ */
351
+ readonly guard?: Guard;
352
+ /**
353
+ * Journals one nondeterministic controller read as a durable boundary.
354
+ *
355
+ * The controller's state is rebuilt by re-execution, so every read of the
356
+ * world it makes between sealed steps must be recorded: the implementation
357
+ * runs `execute` once, journals the outcome under a run-scoped key derived
358
+ * from `name` and `identity` TOGETHER, and serves the recorded value to any
359
+ * later re-execution of the same frame. A read that bypasses this boundary is
360
+ * a replay divergence — and, downstream of one, duplicate irreversible
361
+ * effects.
362
+ *
363
+ * `(name, identity)` is the key, and both halves are load-bearing: one frame
364
+ * issues several records that share a session, a frame number and a boundary
365
+ * and differ only in what they are for. An implementation that keys on
366
+ * `identity` alone serves one frame's opening workspace measurement as its
367
+ * closing one. The controller also folds each boundary's purpose into
368
+ * `identity.boundary`, so it stays correct under an implementation that reads
369
+ * the contract the other way, but an implementation must key on both.
370
+ */
371
+ readonly record: <A>(boundary: RecordBoundary<A>) => Effect.Effect<A, HarnessError>;
372
+ /**
373
+ * Measures the workspace as it stands right now.
374
+ *
375
+ * This is what makes the loop's mutation accounting honest. Every other
376
+ * signal the controller has about "did this frame change anything" is a
377
+ * *declaration*: a flow's registry envelope, or the write set an invocation
378
+ * claimed. A shell command declares neither — spawning a process is the one
379
+ * call whose effects do not travel through any boundary the harness can
380
+ * read — so a run whose only edits went through `bash` looked, to every
381
+ * control, exactly like a run that did nothing. Comparing two measurements
382
+ * around a frame answers the question from the world instead of from the
383
+ * paperwork.
384
+ *
385
+ * `Option.none()` is the honest answer for a host with no workspace to
386
+ * measure, or none it can measure cheaply. It is not an error and it is not
387
+ * "nothing changed": the controller reads it as "unobserved" and falls back
388
+ * to declared writes, and says in the journal which basis it used.
389
+ *
390
+ * The result is nondeterministic, so the controller journals it through
391
+ * {@link EngineLike.record} rather than calling this on a replayed frame.
392
+ */
393
+ readonly observe: Effect.Effect<Option.Option<Observation>, HarnessError>;
394
+ /**
395
+ * Pins the workspace as it stands right now, under the id the caller gives.
396
+ *
397
+ * This is the sibling of {@link EngineLike.observe} and it is deliberately a
398
+ * different operation: `observe` answers "is this the tree I left", which
399
+ * needs only a digest, while this has to be able to hand the tree back later.
400
+ * The pin happens where the call happens — a cell that mints between two
401
+ * edits gets the tree between those two edits — which is what makes
402
+ * `ctx.checkpoint()` mean anything at the line it is written on.
403
+ *
404
+ * `Option.none()` is the honest answer for a host with no store to pin into,
405
+ * exactly as it is for `observe`. It is not an error: the controller answers
406
+ * the cell with a resolved `checkpoint_unavailable` failure, and the run
407
+ * carries on taking its readings from the live tree.
408
+ *
409
+ * The result is nondeterministic, so the controller journals it through
410
+ * {@link EngineLike.record} rather than calling this on a replayed frame.
411
+ */
412
+ readonly capture: (request: CaptureRequest) => Effect.Effect<Option.Option<Snapshot>, HarnessError>;
413
+ /**
414
+ * Says what one request will actually be asked as, for the record of it.
415
+ *
416
+ * Two things stand between the request the controller builds and the call a
417
+ * provider receives, and both belong to the host: a composition may rewrite
418
+ * the request on its way out, and a route decides where it goes. The record
419
+ * of a model call has to be of the call that was made, so the controller
420
+ * asks here before it seals and journals the answer.
421
+ *
422
+ * Optional, and total where it exists. A host that rewrites nothing and
423
+ * names no route omits it, and the controller records the request it built.
424
+ *
425
+ * `Option.none()` is the honest answer for a request the host cannot say
426
+ * anything true about: its own rewrite failed, or no route accepts what the
427
+ * rewrite produced. The controller then journals no request for that call,
428
+ * because the only request it holds is one no provider would be sent, and a
429
+ * record that presented it as sent would prefill a call that never
430
+ * happened. It is not an error. The resolution that matters is the one
431
+ * {@link EngineLike.sealStep} performs, and that is where the same request
432
+ * fails with its typed error. A host that answers none here MUST fail that
433
+ * sealed step, and with the failure it already met rather than a second run
434
+ * of whatever produced it: a rewrite asked twice may answer twice.
435
+ *
436
+ * Pure in the request and the composition, so it is asked again on a
437
+ * replayed frame rather than journaled: the same request under the same
438
+ * composition resolves the same way, and a composition that has since
439
+ * changed has changed the sealed key too, so the call it describes is a new
440
+ * one.
441
+ */
442
+ readonly resolve?: (request: ModelRequest.ModelRequest) => Effect.Effect<Option.Option<Resolved>>;
443
+ readonly suspend: (reason: SuspendReason) => Effect.Effect<never, HarnessError>;
444
+ }
445
+ /**
446
+ * Context service for the harness engine boundary.
447
+ *
448
+ * @category services
449
+ * @since 0.1.0
450
+ * @slop
451
+ */
452
+ export declare const EngineLike: Context.Service<EngineLike, EngineLike>;
453
+ /**
454
+ * Constructs an engine port from an implementation.
455
+ *
456
+ * @category constructors
457
+ * @since 0.1.0
458
+ * @slop
459
+ */
460
+ export declare const make: (implementation: EngineLike) => EngineLike;
461
+ /**
462
+ * The {@link Guard} subject of one cell call: its session, frame and settled
463
+ * boundary. A host keys what the guard decided for a call (how many times the
464
+ * operator chose Continue) by the subject the controller admits it under.
465
+ *
466
+ * @category constructors
467
+ * @since 1.0.0-rc.1
468
+ */
469
+ export declare const callSubject: (identity: Pick<Cell.CallIdentity, "session" | "frame" | "cell" | "ordinal">) => string;
470
+ /**
471
+ * One operation that ran past its time limit, as the controller reports it to
472
+ * {@link Guard.trip}.
473
+ *
474
+ * `subject` is the operation's replay-stable identity. `limitMillis` is
475
+ * absent when the operation reported its own timeout without its limit.
476
+ *
477
+ * @category models
478
+ * @since 1.0.0-rc.1
479
+ */
480
+ export interface TimedOut {
481
+ readonly source: "tool-call" | "cell";
482
+ readonly subject: string;
483
+ readonly limitMillis?: number | undefined;
484
+ readonly message: string;
485
+ }
486
+ /**
487
+ * A host's runaway guard for tool-call and cell timeouts; see
488
+ * {@link EngineLike.guard}.
489
+ *
490
+ * @category models
491
+ * @since 1.0.0-rc.1
492
+ */
493
+ export interface Guard {
494
+ /**
495
+ * Admits an operation before it runs. A park whose question is still open,
496
+ * or the failure a Stop settles the run with, travels in the error channel.
497
+ * A host re-issues a cell call the operator continued under a key of its
498
+ * own, since the timed-out attempt may have settled durably under the old
499
+ * one (a command's own timeout does).
500
+ */
501
+ readonly admit: (subject: string) => Effect.Effect<void, HarnessError>;
502
+ /**
503
+ * Reports a timeout. Succeeds when this run's timeouts are not guarded, so
504
+ * the caller keeps its timeout; otherwise fails with the park.
505
+ */
506
+ readonly trip: (timeout: TimedOut) => Effect.Effect<void, HarnessError>;
507
+ }
508
+ /**
509
+ * Provides an engine port implementation.
510
+ *
511
+ * @category layers
512
+ * @since 0.1.0
513
+ * @slop
514
+ */
515
+ export declare const layer: (implementation: EngineLike) => Layer.Layer<EngineLike>;
516
+ /**
517
+ * What one request resolves to on this engine.
518
+ *
519
+ * The answer of {@link EngineLike.resolve} where the host gives one, and
520
+ * otherwise the honest default: the request as it was built, going to no route
521
+ * anybody named. Written once, here, because a port that wraps another port
522
+ * needs the same default the controller does. None is the host's own answer
523
+ * and never the default: a port with no `resolve` sends what it was handed.
524
+ *
525
+ * @category conversions
526
+ * @since 1.0.0-rc.0
527
+ */
528
+ export declare const resolve: (engine: EngineLike, request: ModelRequest.ModelRequest) => Effect.Effect<Option.Option<Resolved>>;
529
+ /**
530
+ * Constructs an unavailable engine stub, optionally overriding operations.
531
+ *
532
+ * @category constructors
533
+ * @since 0.1.0
534
+ * @slop
535
+ */
536
+ export declare const makeNoop: (overrides?: Partial<EngineLike>) => EngineLike;
537
+ /**
538
+ * Provides an unavailable engine stub.
539
+ *
540
+ * @category layers
541
+ * @since 0.1.0
542
+ * @slop
543
+ */
544
+ export declare const layerNoop: (overrides?: Partial<EngineLike>) => Layer.Layer<EngineLike>;
545
+ export {};
546
+ //# sourceMappingURL=EngineLike.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EngineLike.d.ts","sourceRoot":"","sources":["../../src/EngineLike.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,KAAK,WAAW,MAAM,0BAA0B,CAAA;AAC5D,OAAO,KAAK,KAAK,KAAK,MAAM,qBAAqB,CAAA;AACjD,OAAO,KAAK,KAAK,UAAU,MAAM,0BAA0B,CAAA;AAC3D,OAAO,KAAK,KAAK,YAAY,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACvE,OAAO,KAAK,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAClD,OAAO,KAAK,KAAK,IAAI,MAAM,WAAW,CAAA;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,KAAK,IAAI,MAAM,WAAW,CAAA;AAEtC;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,gHAM5B,CAAA;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAAC,IAAI,CAAA;;;;;;AAE7D;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,aAAc,SAAQ,kBAIjC;CAAG;AAEL;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAA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