@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,774 @@
1
+ /**
2
+ * The cell contract.
3
+ *
4
+ * A Smithers frame is `model -> generated cell -> realm evaluation ->
5
+ * individually durable flow calls -> next transition`. This module owns the
6
+ * serializable half of that sentence: the cell source the model emits, the
7
+ * transition the cell settled, the typed outcomes a cell may settle with, and
8
+ * the identity carried by every flow call made inside one.
9
+ *
10
+ * Nothing here executes anything. Execution is `Sandbox`; durability is
11
+ * `EngineLike.call`; the loop is `CellTurn`.
12
+ *
13
+ * A cell does not *return* its transition. The realm is a REPL that outlives
14
+ * the cell, so a cell states its intent by calling `ctx.done` or `ctx.park` and
15
+ * `Sandbox.replTransition` builds the value; there is no returned object to
16
+ * decode.
17
+ *
18
+ * Governing design: `../docs/concepts.md#durable-cell-loop`,
19
+ * `../docs/concepts.md#repl-realm` and
20
+ * `../docs/concepts.md#agent-cell-context`.
21
+ *
22
+ * @since 0.1.0
23
+ */
24
+ import * as Descriptor from "@smthrs/registry/Descriptor";
25
+ import { Effect, Result, Schema } from "effect";
26
+ import { HarnessError } from "./HarnessError.ts";
27
+ /**
28
+ * The source language a cell is written in.
29
+ *
30
+ * Both shipped bindings run a `typescript` cell by erasing its type-only
31
+ * syntax — never by emitting new runtime behaviour, so a construct that needs
32
+ * JavaScript emit is a `compile_failed` rejection rather than a silent
33
+ * transform. A binding that cannot compile at all rejects with
34
+ * `unsupported_language`; neither shipped binding needs to.
35
+ *
36
+ * @category models
37
+ * @since 0.1.0
38
+ * @slop
39
+ */
40
+ export declare const Language: Schema.Literals<readonly ["javascript", "typescript"]>;
41
+ /**
42
+ * The source language a cell is written in.
43
+ *
44
+ * @category models
45
+ * @since 0.1.0
46
+ * @slop
47
+ */
48
+ export type Language = typeof Language.Type;
49
+ declare const Source_base: Schema.Class<Source, Schema.Struct<{
50
+ readonly language: Schema.Literals<readonly ["javascript", "typescript"]>;
51
+ readonly text: Schema.String;
52
+ readonly digest: Schema.String;
53
+ }>, {}>;
54
+ /**
55
+ * One unit of agent-authored source and its stable content digest.
56
+ *
57
+ * The digest is part of every call identity produced inside the cell, so
58
+ * editing one character of the source re-keys every boundary within it.
59
+ *
60
+ * @category models
61
+ * @since 0.1.0
62
+ * @slop
63
+ */
64
+ export declare class Source extends Source_base {
65
+ }
66
+ /**
67
+ * Computes the stable digest of cell source.
68
+ *
69
+ * @category constructors
70
+ * @since 0.1.0
71
+ * @slop
72
+ */
73
+ export declare const digestOf: (language: Language, text: string) => string;
74
+ /**
75
+ * Constructs cell source with its computed digest.
76
+ *
77
+ * @category constructors
78
+ * @since 0.1.0
79
+ * @slop
80
+ */
81
+ export declare const source: (text: string, language?: Language) => Source;
82
+ declare const Continue_base: Schema.Class<Continue, Schema.TaggedStruct<"continue", {
83
+ /**
84
+ * Why this frame changed nothing, when the controller demanded that it
85
+ * either mutate or say why not.
86
+ *
87
+ * The field exists because prose in the prompt did not stop a run from
88
+ * reading for its whole budget: a benchmark instance spent 100 frames and
89
+ * 132 calls without one edit attempt and then claimed the fix was
90
+ * implemented. A justification is the typed way out of the read-only cap —
91
+ * it is recorded, it buys a bounded grace, and it does not reset the
92
+ * counter that eventually stops the run. A cell writes one by calling
93
+ * `ctx.justify`.
94
+ */
95
+ readonly justification: Schema.optional<Schema.String>;
96
+ }>, {}>;
97
+ /**
98
+ * The cell's turn ended without settling the run.
99
+ *
100
+ * A REPL cell that calls neither `ctx.done` nor `ctx.park` gets another frame,
101
+ * and this is what that frame is journaled as. The only thing it carries is a
102
+ * justification; all other bookkeeping belongs to the realm.
103
+ *
104
+ * @category models
105
+ * @since 0.1.0
106
+ * @slop
107
+ */
108
+ export declare class Continue extends Continue_base {
109
+ }
110
+ declare const Complete_base: Schema.Class<Complete, Schema.TaggedStruct<"complete", {
111
+ readonly output: Schema.String;
112
+ readonly value: Schema.optional<Schema.Codec<Schema.Json, Schema.Json, never, never>>;
113
+ }>, {}>;
114
+ /**
115
+ * The cell declares the task finished and supplies its final output.
116
+ *
117
+ * A completion carries no self-reported proof. The run's evidence is the calls
118
+ * it actually made — every one journaled as `cell-call-settled` with its real
119
+ * input and result — and a field in which the model restates which of them
120
+ * proved the work would be a claim about a check rather than the check.
121
+ *
122
+ * @category models
123
+ * @since 0.1.0
124
+ * @slop
125
+ */
126
+ export declare class Complete extends Complete_base {
127
+ }
128
+ declare const Park_base: Schema.Class<Park, Schema.TaggedStruct<"park", {
129
+ readonly reason: Schema.Literals<readonly ["waiting-input", "waiting-event", "waiting-quota"]>;
130
+ readonly message: Schema.String;
131
+ }>, {}>;
132
+ /**
133
+ * The cell asks the controller to park the run durably.
134
+ *
135
+ * @category models
136
+ * @since 0.1.0
137
+ * @slop
138
+ */
139
+ export declare class Park extends Park_base {
140
+ }
141
+ /**
142
+ * The serializable decision one cell returns.
143
+ *
144
+ * @category models
145
+ * @since 0.1.0
146
+ * @slop
147
+ */
148
+ export declare const Transition: Schema.toTaggedUnion<"_tag", readonly [typeof Continue, typeof Complete, typeof Park]>;
149
+ /**
150
+ * The serializable decision one cell returns.
151
+ *
152
+ * @category models
153
+ * @since 0.1.0
154
+ * @slop
155
+ */
156
+ export type Transition = typeof Transition.Type;
157
+ /**
158
+ * Renders a projected value as the text one context entry carries.
159
+ *
160
+ * A string is itself. Everything else is canonical JSON, which is the whole of
161
+ * the "render structs as JSON, always" rule: a structured value reaches the
162
+ * next model turn as the value it is.
163
+ *
164
+ * @category conversions
165
+ * @since 0.1.0
166
+ * @slop
167
+ */
168
+ export declare const renderText: (value: Schema.Json) => string;
169
+ /**
170
+ * Stable reasons a cell failed to produce a transition.
171
+ *
172
+ * Every one of these is a durable observation the model may correct on a later
173
+ * frame; none of them is a harness crash.
174
+ *
175
+ * `imports_forbidden` names module syntax the cell itself uses, which
176
+ * `Sandbox.compile` finds by parsing. A quoted mention of an import is data:
177
+ * cells routinely carry a `bash` command whose heredoc imports a Python module,
178
+ * and those cells run.
179
+ *
180
+ * @category models
181
+ * @since 0.1.0
182
+ * @slop
183
+ */
184
+ export declare const RejectionCode: Schema.Literals<readonly ["no_cell", "output_truncated", "imports_forbidden", "compile_failed", "invalid_transition", "unsupported_language", "limit_exceeded", "stalled"]>;
185
+ /**
186
+ * Stable reasons a cell failed to produce a transition.
187
+ *
188
+ * @category models
189
+ * @since 0.1.0
190
+ * @slop
191
+ */
192
+ export type RejectionCode = typeof RejectionCode.Type;
193
+ declare const Settled_base: Schema.Class<Settled, Schema.TaggedStruct<"settled", {
194
+ readonly transition: Schema.toTaggedUnion<"_tag", readonly [typeof Continue, typeof Complete, typeof Park]>;
195
+ }>, {}>;
196
+ /**
197
+ * The cell ran and returned a well-formed transition.
198
+ *
199
+ * @category models
200
+ * @since 0.1.0
201
+ * @slop
202
+ */
203
+ export declare class Settled extends Settled_base {
204
+ }
205
+ declare const Raised_base: Schema.Class<Raised, Schema.TaggedStruct<"raised", {
206
+ readonly name: Schema.String;
207
+ readonly message: Schema.String;
208
+ }>, {}>;
209
+ /**
210
+ * The cell ran and threw. The thrown value is projected into stable text so it
211
+ * survives the journal and the next frame's context.
212
+ *
213
+ * @category models
214
+ * @since 0.1.0
215
+ * @slop
216
+ */
217
+ export declare class Raised extends Raised_base {
218
+ }
219
+ declare const Rejected_base: Schema.Class<Rejected, Schema.TaggedStruct<"rejected", {
220
+ readonly code: Schema.Literals<readonly ["no_cell", "output_truncated", "imports_forbidden", "compile_failed", "invalid_transition", "unsupported_language", "limit_exceeded", "stalled"]>;
221
+ readonly message: Schema.String;
222
+ /** The spent resource when `code` is `limit_exceeded`. */
223
+ readonly reason: Schema.optional<Schema.Literals<readonly ["heap"]>>;
224
+ }>, {}>;
225
+ /**
226
+ * The cell never ran, or ran and returned something that is not a transition.
227
+ *
228
+ * @category models
229
+ * @since 0.1.0
230
+ * @slop
231
+ */
232
+ export declare class Rejected extends Rejected_base {
233
+ }
234
+ /**
235
+ * Everything one cell evaluation may settle with.
236
+ *
237
+ * @category models
238
+ * @since 0.1.0
239
+ * @slop
240
+ */
241
+ export declare const Outcome: Schema.toTaggedUnion<"_tag", readonly [typeof Settled, typeof Raised, typeof Rejected]>;
242
+ /**
243
+ * Everything one cell evaluation may settle with.
244
+ *
245
+ * @category models
246
+ * @since 0.1.0
247
+ * @slop
248
+ */
249
+ export type Outcome = typeof Outcome.Type;
250
+ declare const FlowProjection_base: Schema.Class<FlowProjection, Schema.Struct<{
251
+ readonly name: Schema.String;
252
+ readonly description: Schema.String;
253
+ readonly capabilities: Schema.$Array<Schema.String>;
254
+ readonly tier: Schema.Literals<readonly ["sealed", "compensable", "irreversible"]>;
255
+ readonly placement: Schema.Option<Schema.Literals<readonly ["client", "local", "sandbox", "remote"]>>;
256
+ /**
257
+ * The call's input schema, as a JSON Schema document, when the descriptor
258
+ * carries one by value.
259
+ *
260
+ * Without it a cell can only guess an input shape from prose, and every
261
+ * guess costs a whole frame: a rejected call is one model turn, so learning
262
+ * `bash` takes `{ command, mode, reads, writes }` cost four turns of pure
263
+ * trial and error before any work began.
264
+ */
265
+ readonly input: Schema.withDecodingDefaultKey<Schema.withConstructorDefault<Schema.Option<Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never>;
266
+ }>, {}>;
267
+ /**
268
+ * The read-only projection of one callable flow handed to a cell.
269
+ *
270
+ * This is exactly what `ctx.flows` exposes: enough for the model to choose a
271
+ * call and for the cell to reason about it, and nothing that carries authority.
272
+ *
273
+ * @category models
274
+ * @since 0.1.0
275
+ * @slop
276
+ */
277
+ export declare class FlowProjection extends FlowProjection_base {
278
+ }
279
+ /**
280
+ * Projects a discovered descriptor into the cell-visible catalog entry.
281
+ *
282
+ * @category conversions
283
+ * @since 0.1.0
284
+ * @slop
285
+ */
286
+ export declare const project: (descriptor: Descriptor.FlowDescriptor) => FlowProjection;
287
+ /**
288
+ * Why one flow call failed, as a closed set a cell may branch on.
289
+ *
290
+ * Every member is a refusal or a budget the harness itself owns, plus one for
291
+ * everything a flow reports about its own work. Add a member; never repurpose
292
+ * one — a cell reads these, and so does a grader counting failure classes in a
293
+ * journal.
294
+ *
295
+ * @category models
296
+ * @since 0.1.0
297
+ * @slop
298
+ */
299
+ export declare const CallFailureCode: Schema.Literals<readonly ["unknown_flow", "capability_refused", "truncated_write", "declaration_changed", "invalid_input", "unimplemented", "timeout", "run_completed", "checkpoint_unavailable", "checkpoint_exhausted", "checkpoint_readonly", "checkpoint_unsupported", "flow_failed", "flow_withheld"]>;
300
+ /**
301
+ * Why one flow call failed.
302
+ *
303
+ * @category models
304
+ * @since 0.1.0
305
+ * @slop
306
+ */
307
+ export type CallFailureCode = typeof CallFailureCode.Type;
308
+ /**
309
+ * The code a failure carries when nothing classified it.
310
+ *
311
+ * @category constants
312
+ * @since 0.1.0
313
+ * @slop
314
+ */
315
+ export declare const defaultCallFailureCode: CallFailureCode;
316
+ /**
317
+ * The one action that recovers each failure class, stated to the cell.
318
+ *
319
+ * A code says what happened; the hint says what to do next, in the same frame.
320
+ * They are here rather than at each raising site so the same class always reads
321
+ * the same way whichever boundary refused.
322
+ *
323
+ * @category constants
324
+ * @since 0.1.0
325
+ * @slop
326
+ */
327
+ export declare const callFailureHint: Readonly<Record<CallFailureCode, string>>;
328
+ /**
329
+ * Which version of the live tree a sealed call reads; see `Call.epoch`.
330
+ *
331
+ * @category models
332
+ * @since 1.0.0-rc.1
333
+ */
334
+ export declare const TreeEpoch: Schema.Struct<{
335
+ /** Earlier frames of this run that changed the workspace. */
336
+ readonly frames: Schema.Int;
337
+ /** Calls of this frame that may write, issued before this one. */
338
+ readonly calls: Schema.Int;
339
+ /** Digest of those calls, chained in issue order: which writes, not only how many. */
340
+ readonly writes: Schema.optional<Schema.String>;
341
+ /** Digest of the whole-tree measurement the frame opened on. */
342
+ readonly tree: Schema.optional<Schema.String>;
343
+ /** The run, when no whole-tree measurement exists: the reading is reused only inside it. */
344
+ readonly session: Schema.optional<Schema.String>;
345
+ /** The frame, beside `session`: an unmeasured tree may change during a model wait. */
346
+ readonly frame: Schema.optional<Schema.Int>;
347
+ }>;
348
+ /**
349
+ * Which version of the live tree a sealed call reads; see `Call.epoch`.
350
+ *
351
+ * @category models
352
+ * @since 1.0.0-rc.1
353
+ */
354
+ export type TreeEpoch = typeof TreeEpoch.Type;
355
+ /**
356
+ * The tree a frame's sealed readings stand on: a measured digest, or the run and frame.
357
+ *
358
+ * @category models
359
+ * @since 1.0.0-rc.1
360
+ */
361
+ export type LiveTree = {
362
+ readonly tree: string;
363
+ } | {
364
+ readonly session: string;
365
+ readonly frame: number;
366
+ };
367
+ declare const CallIdentity_base: Schema.Class<CallIdentity, Schema.Struct<{
368
+ /** The durable session/lineage the frame belongs to. */
369
+ readonly session: Schema.String;
370
+ /** The controller frame that produced the cell. */
371
+ readonly frame: Schema.Int;
372
+ /** The digest of the cell source being executed. */
373
+ readonly cell: Schema.String;
374
+ /** The zero-based execution ordinal of this call within the cell. */
375
+ readonly ordinal: Schema.Int;
376
+ /** The digest of the resolved flow declaration being invoked. */
377
+ readonly declaration: Schema.String;
378
+ /** The resolved layer set in effect at the boundary. */
379
+ readonly layers: Schema.$Array<Schema.String>;
380
+ }>, {}>;
381
+ /**
382
+ * The complete identity of one flow call made inside one cell.
383
+ *
384
+ * Identity is what makes a mid-cell crash replayable. Re-executing the cell
385
+ * source reaches the same lexical call in the same order with the same
386
+ * declaration, so the boundary keys identically and replays; anything that
387
+ * differs — a new frame, an edited cell, a different resolved layer set — keys
388
+ * differently and executes.
389
+ *
390
+ * @category models
391
+ * @since 0.1.0
392
+ * @slop
393
+ */
394
+ export declare class CallIdentity extends CallIdentity_base {
395
+ }
396
+ /**
397
+ * Computes the declaration digest folded into a call identity.
398
+ *
399
+ * Re-exported from `@smthrs/registry`, which owns `FlowDescriptor` and
400
+ * therefore owns what one declaration hashes to. It is the same number
401
+ * `@smthrs/chain` keys its catalog entries with, so a declaration has one
402
+ * identity across the boundary rather than one per package.
403
+ *
404
+ * @category constructors
405
+ * @since 0.1.0
406
+ * @slop
407
+ */
408
+ export declare const declarationDigest: (descriptor: Descriptor.FlowDescriptor) => string;
409
+ declare const Call_base: Schema.Class<Call, Schema.Struct<{
410
+ readonly flowName: Schema.String;
411
+ readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
412
+ readonly capabilities: Schema.$Array<Schema.String>;
413
+ readonly effects: Schema.Struct<{
414
+ readonly reads: Schema.$Array<Schema.String>;
415
+ readonly writes: Schema.$Array<Schema.String>;
416
+ readonly mode: Schema.Literals<readonly ["hermetic", "expected"]>;
417
+ readonly onConflict: Schema.Literals<readonly ["serialize", "lane", "fail"]>;
418
+ readonly tier: Schema.Literals<readonly ["sealed", "compensable", "irreversible"]>;
419
+ }>;
420
+ readonly placement: Schema.Option<Schema.Literals<readonly ["client", "local", "sandbox", "remote"]>>;
421
+ readonly identity: typeof CallIdentity;
422
+ /**
423
+ * The checkpoint this call runs against, when the cell named one.
424
+ *
425
+ * Absent is the ordinary case and means the live workspace. Present names a
426
+ * tree the run already pinned, and the host materializes that tree somewhere
427
+ * of its own choosing and runs the call there. It is journaled on the call
428
+ * because it is the difference between a reading of the tree as it is and a
429
+ * reading of the tree as it was, and a grader that cannot tell those apart
430
+ * cannot grade a fails-before proof at all.
431
+ */
432
+ readonly at: Schema.optional<Schema.String>;
433
+ /**
434
+ * Which version of the live tree a sealed reading is taken against.
435
+ *
436
+ * A sealed call is content-addressed on what it asked, and "the same path
437
+ * against the tree as it stands" is the same question only until something
438
+ * has written to the tree. Without this, the second of two identical reads
439
+ * around a write replays the first's answer and a run reports the pre-edit
440
+ * text after its own edit. `frames` is the run's frame clock — the count of
441
+ * earlier frames that changed the workspace, measured where the host can
442
+ * measure — and `calls` is how many calls of this frame that may write
443
+ * were issued before this one, with `writes` chaining what they asked, so
444
+ * two runs that wrote differently read different questions. All are derived
445
+ * from the journaled call
446
+ * sequence, so a replayed frame derives the same epoch and replays.
447
+ *
448
+ * The counters restart with every run, so they cannot tell a later run's
449
+ * read from an earlier run's across an edit made between them. `tree` is
450
+ * the digest of a journaled measurement taken after the model wait, which
451
+ * can; without a whole measurement, `session` and `frame` keep the reading
452
+ * to the frame that took it.
453
+ *
454
+ * Absent on every call that is not a sealed reading of the live tree: a
455
+ * checkpoint is immutable, and a non-sealed call already keys on its ordinal.
456
+ */
457
+ readonly epoch: Schema.optional<Schema.Struct<{
458
+ /** Earlier frames of this run that changed the workspace. */
459
+ readonly frames: Schema.Int;
460
+ /** Calls of this frame that may write, issued before this one. */
461
+ readonly calls: Schema.Int;
462
+ /** Digest of those calls, chained in issue order: which writes, not only how many. */
463
+ readonly writes: Schema.optional<Schema.String>;
464
+ /** Digest of the whole-tree measurement the frame opened on. */
465
+ readonly tree: Schema.optional<Schema.String>;
466
+ /** The run, when no whole-tree measurement exists: the reading is reused only inside it. */
467
+ readonly session: Schema.optional<Schema.String>;
468
+ /** The frame, beside `session`: an unmeasured tree may change during a model wait. */
469
+ readonly frame: Schema.optional<Schema.Int>;
470
+ }>>;
471
+ /**
472
+ * What the resolved declaration says a call to this flow does.
473
+ *
474
+ * Carried on the call rather than looked up later, because the reader of a
475
+ * run is not the host that resolved it: a card reading a journal months
476
+ * afterwards holds the record and nothing else, and a flow name is not a
477
+ * meaning. Absent is unknown, and unknown stays unknown.
478
+ */
479
+ readonly activity: Schema.optional<Schema.Literals<readonly ["reads", "writes", "checks", "tests", "other"]>>;
480
+ /**
481
+ * How the resolved declaration says one recorded call to this flow reads.
482
+ *
483
+ * Display authority only. Neither this field nor `activity` enters a key:
484
+ * {@link callMaterial} and the durable call key name the fields they hash,
485
+ * and both digests in `@smthrs/registry` exclude these two, so enriching a
486
+ * declaration with them can neither replay nor re-approve anything.
487
+ */
488
+ readonly presentation: Schema.optional<Schema.Struct<{
489
+ readonly verb: Schema.Struct<{
490
+ readonly pending: Schema.String;
491
+ readonly success: Schema.String;
492
+ readonly failure: Schema.String;
493
+ }>;
494
+ readonly subject: Schema.Literals<readonly ["path", "command", "patch", "selection", "pattern", "none"]>;
495
+ readonly result: Schema.Literals<readonly ["text", "read", "write", "edit", "patch", "tests", "command", "matches", "paths", "entries", "none"]>;
496
+ }>>;
497
+ }>, {}>;
498
+ /**
499
+ * One flow call requested from inside a cell.
500
+ *
501
+ * @category models
502
+ * @since 0.1.0
503
+ * @slop
504
+ */
505
+ export declare class Call extends Call_base {
506
+ }
507
+ /**
508
+ * Builds the call one resolved declaration and one cell invocation make.
509
+ *
510
+ * A constructor rather than an object literal at the boundary: what a call
511
+ * carries about its declaration is a contract two producers project into a
512
+ * journal (`AgentSession.trace` and the native `CallFact`), and a reader can
513
+ * only be as complete as this. A field copied from a descriptor onto a call
514
+ * belongs here, where the copy is stated once.
515
+ *
516
+ * @category constructors
517
+ * @since 1.0.0-rc.0
518
+ */
519
+ export declare const callOf: (descriptor: Descriptor.FlowDescriptor, options: {
520
+ readonly input: Schema.Json;
521
+ readonly identity: CallIdentity;
522
+ /** The checkpoint the cell named, when it named one. */
523
+ readonly at?: string | undefined;
524
+ /** The live tree's version, for a sealed reading taken after a write. */
525
+ readonly epoch?: TreeEpoch | undefined;
526
+ }) => Call;
527
+ /**
528
+ * The display projection one recorded call carries for whoever reads it back.
529
+ *
530
+ * `undefined` when the declaration claimed neither field, so the record stays
531
+ * byte-identical to the one an undeclared flow produces and a reader's
532
+ * compatibility table still applies to it. The name travels with the fields so
533
+ * a reader can refuse metadata that belongs to a different flow.
534
+ *
535
+ * @category projections
536
+ * @since 1.0.0-rc.0
537
+ */
538
+ export declare const displayDescriptor: (call: Call) => Schema.Json | undefined;
539
+ /**
540
+ * The id naming the tree a run opened on, pinned for free and always present.
541
+ *
542
+ * The dominant use of a checkpoint is a fails-before proof, and the frame that
543
+ * wants one is almost never the frame that could have foreseen it: by the time
544
+ * a run knows which command reproduces the bug it has usually already edited.
545
+ * So this id exists without anybody minting it. A host resolves it to whatever
546
+ * it recorded as the run's opening tree — for the SWE-bench rig, the
547
+ * `refs/flows/capture-base` commit its own setup wrote — and a host with no
548
+ * such record answers `checkpoint_unavailable` like any other.
549
+ *
550
+ * @category constants
551
+ * @since 0.1.0
552
+ */
553
+ export declare const baseCheckpoint = "base";
554
+ /**
555
+ * Builds the handle a cell holds for one checkpoint.
556
+ *
557
+ * @category constructors
558
+ * @since 0.1.0
559
+ */
560
+ export declare const checkpoint: (id: string) => Schema.Json;
561
+ /**
562
+ * Reads the checkpoint id out of whatever a cell passed as `at`.
563
+ *
564
+ * `undefined` means "that was not a checkpoint", which the boundary answers as
565
+ * an ordinary `invalid_input` failure rather than by guessing. It is
566
+ * deliberately strict: a handle is the only thing that names a tree, and a
567
+ * string that happens to look like an id would let a cell address a snapshot
568
+ * the run never took.
569
+ *
570
+ * @category conversions
571
+ * @since 0.1.0
572
+ */
573
+ export declare const checkpointOf: (value: Schema.Json) => string | undefined;
574
+ declare const CallResult_base: Schema.Class<CallResult, Schema.Struct<{
575
+ readonly outcome: Schema.Literals<readonly ["success", "failure"]>;
576
+ readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
577
+ readonly message: Schema.optional<Schema.String>;
578
+ /**
579
+ * Why a failed call failed, from the closed set the cell may branch on.
580
+ *
581
+ * Prose is what a boundary says; a code is what a program reads. Without one
582
+ * the only way for a cell to tell "that flow does not exist" from "that
583
+ * command timed out" was to match the message, so cells did not tell them
584
+ * apart at all. Absent means {@link defaultCallFailureCode}, which is what a
585
+ * flow's own failure gets: the flow said why in `message` and the harness
586
+ * does not classify it.
587
+ */
588
+ readonly code: Schema.optional<Schema.Literals<readonly ["unknown_flow", "capability_refused", "truncated_write", "declaration_changed", "invalid_input", "unimplemented", "timeout", "run_completed", "checkpoint_unavailable", "checkpoint_exhausted", "checkpoint_readonly", "checkpoint_unsupported", "flow_failed", "flow_withheld"]>>;
589
+ }>, {}>;
590
+ /**
591
+ * The settled outcome of one flow call.
592
+ *
593
+ * A `failure` resolves in the cell as a `{ ok: false, error }` envelope that
594
+ * it may inspect and recover from; it does not throw and is never a harness
595
+ * failure. Anything the cell cannot see, such as a permission park or an abort,
596
+ * travels in the effect's error channel instead.
597
+ *
598
+ * @category models
599
+ * @since 0.1.0
600
+ * @slop
601
+ */
602
+ export declare class CallResult extends CallResult_base {
603
+ constructor(props: CallResultVariant, options?: Schema.MakeOptions);
604
+ }
605
+ /**
606
+ * A successful call cannot carry a failure code. The wire field names remain
607
+ * the same as current CallResult records.
608
+ *
609
+ * @category schemas
610
+ * @since 1.0.0-rc.0
611
+ */
612
+ export declare const CallSuccess: Schema.Struct<{
613
+ readonly outcome: Schema.Literal<"success">;
614
+ readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
615
+ readonly message: Schema.optional<Schema.String>;
616
+ readonly code: Schema.optionalKey<Schema.Never>;
617
+ }>;
618
+ /**
619
+ * A failed call, with the existing absent-code meaning of flow_failed.
620
+ *
621
+ * @category schemas
622
+ * @since 1.0.0-rc.0
623
+ */
624
+ export declare const CallFailure: Schema.Struct<{
625
+ readonly outcome: Schema.Literal<"failure">;
626
+ readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
627
+ readonly message: Schema.optional<Schema.String>;
628
+ readonly code: Schema.optional<Schema.Literals<readonly ["unknown_flow", "capability_refused", "truncated_write", "declaration_changed", "invalid_input", "unimplemented", "timeout", "run_completed", "checkpoint_unavailable", "checkpoint_exhausted", "checkpoint_readonly", "checkpoint_unsupported", "flow_failed", "flow_withheld"]>>;
629
+ }>;
630
+ /**
631
+ * Discriminated result at a decoded persistence or host boundary.
632
+ *
633
+ * @category schemas
634
+ * @since 1.0.0-rc.0
635
+ */
636
+ export declare const CallResultVariant: Schema.Union<readonly [Schema.Struct<{
637
+ readonly outcome: Schema.Literal<"success">;
638
+ readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
639
+ readonly message: Schema.optional<Schema.String>;
640
+ readonly code: Schema.optionalKey<Schema.Never>;
641
+ }>, Schema.Struct<{
642
+ readonly outcome: Schema.Literal<"failure">;
643
+ readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
644
+ readonly message: Schema.optional<Schema.String>;
645
+ readonly code: Schema.optional<Schema.Literals<readonly ["unknown_flow", "capability_refused", "truncated_write", "declaration_changed", "invalid_input", "unimplemented", "timeout", "run_completed", "checkpoint_unavailable", "checkpoint_exhausted", "checkpoint_readonly", "checkpoint_unsupported", "flow_failed", "flow_withheld"]>>;
646
+ }>]>;
647
+ /**
648
+ * Discriminated result at a decoded persistence or host boundary.
649
+ *
650
+ * @category models
651
+ * @since 1.0.0-rc.0
652
+ */
653
+ export type CallResultVariant = typeof CallResultVariant.Type;
654
+ /**
655
+ * Decode a host or persisted result before the cell can observe it.
656
+ *
657
+ * @category decoders
658
+ * @since 1.0.0-rc.0
659
+ */
660
+ export declare const decodeCallResult: (value: unknown) => Effect.Effect<{
661
+ readonly value: Schema.Json;
662
+ readonly outcome: "success";
663
+ readonly code?: never;
664
+ readonly message?: string | undefined;
665
+ } | {
666
+ readonly value: Schema.Json;
667
+ readonly outcome: "failure";
668
+ readonly code?: "invalid_input" | "timeout" | "unknown_flow" | "capability_refused" | "truncated_write" | "declaration_changed" | "unimplemented" | "run_completed" | "checkpoint_unavailable" | "checkpoint_exhausted" | "checkpoint_readonly" | "checkpoint_unsupported" | "flow_failed" | "flow_withheld" | undefined;
669
+ readonly message?: string | undefined;
670
+ }, HarnessError, never>;
671
+ /**
672
+ * Refuse contradictory or incomplete recorded evaluation outcomes.
673
+ *
674
+ * @category decoders
675
+ * @since 1.0.0-rc.0
676
+ */
677
+ export declare const decodeOutcome: (value: unknown) => Effect.Effect<Settled | Raised | Rejected, HarnessError, never>;
678
+ /**
679
+ * Refuse contradictory or incomplete recorded transitions.
680
+ *
681
+ * @category decoders
682
+ * @since 1.0.0-rc.0
683
+ */
684
+ export declare const decodeTransition: (value: unknown) => Effect.Effect<Continue | Complete | Park, HarnessError, never>;
685
+ /**
686
+ * The failure envelope a cell observes when a flow call does not succeed.
687
+ *
688
+ * A failed call **resolves** with this value; it does not throw. That is the
689
+ * whole of change 8: an unrecoverable rejection turned every failed call into a
690
+ * lost frame, because the recovery branch the model had already written sat
691
+ * behind the throw and never ran, and every sibling call the cell had already
692
+ * paid for went with it. `psf__requests-2317` lost two settled greps and a
693
+ * probe to one call against a directory that did not exist; `django-14351`
694
+ * spent ~$0.46 on the same class across five frames.
695
+ *
696
+ * The shape is fixed and small — `{ ok: false, error: { code, message, hint } }`
697
+ * — because a cell branches on `.ok` and reads `.error.code`. A successful call
698
+ * still resolves with the flow's own value, unwrapped, so the ordinary
699
+ * `result.stdout` shape a cell is trained on is unchanged.
700
+ *
701
+ * @category conversions
702
+ * @since 0.1.0
703
+ * @slop
704
+ */
705
+ export declare const callFailure: (result: CallResult) => Schema.Json;
706
+ /**
707
+ * One reply's cell program, and how many fenced blocks it was written in.
708
+ *
709
+ * `blocks` is journaled rather than derived later because it is the only
710
+ * record of how the model chose to lay its frame out, and a reply written as
711
+ * several blocks is exactly the reply the old extraction discarded.
712
+ *
713
+ * @category models
714
+ * @since 0.1.0
715
+ * @slop
716
+ */
717
+ export interface Extracted {
718
+ readonly source: Source;
719
+ /** How many fenced cell blocks the reply carried, repeats included. */
720
+ readonly blocks: number;
721
+ }
722
+ /**
723
+ * Extracts the cell program one model settlement emitted.
724
+ *
725
+ * Every fenced block tagged as a cell is kept, in reply order, and the blocks
726
+ * are joined with newlines into one global async script in the persistent
727
+ * realm. Top-level `await` is supported; top-level `return` is invalid. Blocks
728
+ * execute in order. The first `ctx.done` or `ctx.park` that records an intent
729
+ * seals the frame; later `ctx.done` and `ctx.park` calls do nothing. Ordinary
730
+ * JavaScript in later blocks continues running, but later `ctx.call` and
731
+ * `ctx.checkpoint` calls resolve with a `run_completed` failure envelope
732
+ * without dispatching host work.
733
+ *
734
+ * Keeping only the *last* block is what this replaces, and the cost of that
735
+ * rule was measured: on one graded instance the model wrote a near-par program
736
+ * as seven blocks in a single reply — recon, probe, edit-plus-diagnostics,
737
+ * suite, rehydrate, guarded replay, completion — and the harness executed block
738
+ * seven, the imagined completion, against a tree where blocks one through six
739
+ * had never run. Empty patch, run over in two frames. Multi-block replies were
740
+ * 2 of 91 replies in that wave: rare, and instance-deciding when they land.
741
+ *
742
+ * A byte-identical repeat of a block is dropped rather than concatenated. Both
743
+ * multi-block replies in that wave are in the journals, and the second one is a
744
+ * model that emitted the same block twice: joining the duplicate would declare
745
+ * its names twice and turn a frame that runs today into a `compile_failed`. A
746
+ * repeat is the model restating one program, never a second step — a second
747
+ * step that genuinely re-runs the same code would still have to differ
748
+ * somewhere, if only in what it does with the result.
749
+ *
750
+ * Distinct blocks are joined as they were written, so a value bound in one is
751
+ * bound for the ones after it. One program therefore means one set of
752
+ * declarations, and two blocks that both declare the same name are a
753
+ * `SyntaxError` the compiler reports — a durable observation the next frame can
754
+ * fix, unlike silently running one block of seven, which is not observable at
755
+ * all. The contract states the rule so a model that batches writes blocks that
756
+ * compose, and `CellTurn` names the block count when such a program fails to
757
+ * compile.
758
+ *
759
+ * The program is `typescript` when any block declared a typed fence, because
760
+ * both bindings run TypeScript by erasing type-only syntax and erasure is
761
+ * harmless to a plain-JavaScript block.
762
+ *
763
+ * Extraction reads text and never judges syntax. Whether the source uses module
764
+ * syntax is a question about JavaScript, and it is answered by parsing the cell
765
+ * in `Sandbox.compile`, which is also where an `imports_forbidden` rejection is
766
+ * raised.
767
+ *
768
+ * @category conversions
769
+ * @since 0.1.0
770
+ * @slop
771
+ */
772
+ export declare const extract: (text: string) => Result.Result<Extracted, Rejected>;
773
+ export {};
774
+ //# sourceMappingURL=Cell.d.ts.map