@smthrs/harness 0.0.0-stage → 1.0.0-rc.3

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 +987 -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 +1143 -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,289 @@
1
+ /**
2
+ * The executable-flow binding contract.
3
+ *
4
+ * A cell's only authority is `ctx.call(flow, input)`, so *every* capability an
5
+ * agent can reach — a standard filesystem flow, a memory flow, an incoming MCP
6
+ * tool, a durable child agent — has to arrive as an ordinary flow declaration
7
+ * plus the code that runs it. This module is the smallest contract that pairs
8
+ * the two.
9
+ *
10
+ * Three types carry the whole idea:
11
+ *
12
+ * - a {@link Binding} is one flow declaration, its projected
13
+ * `Descriptor.FlowDescriptor`, and a runner that decodes cell input through
14
+ * the flow's input schema, executes the handler, and validates the handler's
15
+ * output back into serializable JSON;
16
+ * - a {@link Source} produces bindings, possibly effectfully, so a lazily
17
+ * connected server or a plugin can contribute without being resolved at
18
+ * import time;
19
+ * - a {@link Catalog} is the deterministic composition of sources, and it
20
+ * refuses duplicate executable names rather than letting one descriptor be
21
+ * dispatched to another implementation.
22
+ *
23
+ * This is deliberately *not* a second registry. The descriptors a catalog
24
+ * projects are ordinary `FlowDescriptor`s, and {@link registry} composes them
25
+ * onto an existing `Registry.Registry` behind that same contract — with the
26
+ * file-discovered entries winning, so discovery precedence is untouched.
27
+ *
28
+ * The failure split is the one `EngineLike.call` declares. A refusal the agent
29
+ * could plausibly correct — malformed input, a flow that failed, output that is
30
+ * not serializable — becomes a `failure` {@link Cell.CallResult} the cell
31
+ * observes as a resolved `{ ok: false, error }` envelope. The cell branches on
32
+ * `.ok === false` and `.error.code` to recover; ordinary failures do not throw.
33
+ * Anything the cell must never swallow, such as a permission requirement, an
34
+ * abort, or a suspension, stays in the typed error channel. An interruption
35
+ * is never caught at all.
36
+ *
37
+ * Governing design: `../docs/concepts.md#durable-cell-loop` and
38
+ * `../docs/concepts.md#flow-registry`.
39
+ *
40
+ * @since 0.1.0
41
+ */
42
+ import type * as Effects from "@smthrs/core/Effects";
43
+ import * as Descriptor from "@smthrs/registry/Descriptor";
44
+ import * as Registry from "@smthrs/registry/Registry";
45
+ import type { Context, Schema as SchemaTypes } from "effect";
46
+ import { Effect, Option, Result, Schema } from "effect";
47
+ import type * as Cell from "./Cell.ts";
48
+ import { CallResult } from "./Cell.ts";
49
+ import { HarnessError } from "./HarnessError.ts";
50
+ /**
51
+ * The declaration half of a binding.
52
+ *
53
+ * Schema and metadata record accepted by bindings and registry admission.
54
+ *
55
+ * @category models
56
+ * @since 0.1.0
57
+ * @slop
58
+ */
59
+ export interface Declared {
60
+ readonly name?: string | undefined;
61
+ readonly description?: string | undefined;
62
+ readonly input?: SchemaTypes.Top | undefined;
63
+ readonly output?: SchemaTypes.Top | undefined;
64
+ readonly flows?: ReadonlyArray<string> | undefined;
65
+ readonly model?: string | ReadonlyArray<string> | undefined;
66
+ readonly annotations?: Context.Context<never> | undefined;
67
+ readonly budget?: Descriptor.FlowBudget | undefined;
68
+ readonly deadline?: number | undefined;
69
+ readonly modelInvocable?: boolean | undefined;
70
+ readonly disableModelInvocation?: boolean | undefined;
71
+ readonly capabilities: ReadonlyArray<string>;
72
+ readonly effects: Effects.Declaration | undefined;
73
+ }
74
+ /**
75
+ * The metadata a projected descriptor needs that a flow declaration does not
76
+ * carry.
77
+ *
78
+ * Every default is the conservative one: a binding is model-invocable, has no
79
+ * placement, and is attributed to the `binding` source.
80
+ *
81
+ * @category models
82
+ * @since 0.1.0
83
+ * @slop
84
+ */
85
+ export interface DescriptorOptions {
86
+ /** Overrides the declaration's own name. */
87
+ readonly name?: string | undefined;
88
+ /** The stable locator recorded as the descriptor's body and path. */
89
+ readonly path?: string | undefined;
90
+ /**
91
+ * Content identity of the executable body. `make` derives this from the
92
+ * handler when omitted; direct descriptor projections derive it from the
93
+ * declaration they can observe.
94
+ */
95
+ readonly bodyDigest?: string | undefined;
96
+ readonly modelInvocable?: boolean | undefined;
97
+ readonly placement?: Option.Option<Descriptor.Placement> | undefined;
98
+ readonly provenance?: Descriptor.Provenance | undefined;
99
+ /**
100
+ * The input schema as a JSON Schema document, carried by value.
101
+ *
102
+ * A binding holds the real schema, so recording a `binding://` locator
103
+ * throws away the one description of the call's shape anything downstream
104
+ * could read. {@link make} fills this in, which is what puts a parameter
105
+ * schema beside every flow in `ctx.flows`.
106
+ */
107
+ readonly inputDocument?: Schema.Json | undefined;
108
+ /** The output schema as a JSON Schema document, carried by value. */
109
+ readonly outputDocument?: Schema.Json | undefined;
110
+ /**
111
+ * What a call to this flow does, for a reader of a run.
112
+ *
113
+ * Absent means unknown, and unknown stays unknown: a reader that is given
114
+ * nothing says nothing rather than guessing from the flow's name. `bash` is
115
+ * the deliberate absence — what a shell call does is in the command.
116
+ */
117
+ readonly activity?: Descriptor.FlowActivity | undefined;
118
+ /**
119
+ * How one recorded call to this flow reads.
120
+ *
121
+ * This is the one authority a run card has for the words beside a call. It
122
+ * grants nothing: {@link Descriptor.declarationDigest} and
123
+ * {@link Descriptor.executionDigest} both exclude it, so declaring it cannot
124
+ * invalidate a reviewed plan, a call identity, or a cached prompt.
125
+ */
126
+ readonly presentation?: Descriptor.CallPresentation | undefined;
127
+ }
128
+ /**
129
+ * Projects an ordinary flow declaration into a registry descriptor.
130
+ *
131
+ * @category conversions
132
+ * @since 0.1.0
133
+ * @slop
134
+ */
135
+ export declare const descriptorOf: (declaration: Declared, options?: DescriptorOptions) => Descriptor.FlowDescriptor;
136
+ /**
137
+ * One flow declaration and the code that runs it.
138
+ *
139
+ * `R` is whatever the handler still needs from the host. A catalog only accepts
140
+ * fully supplied bindings, so a host uses {@link provide} to close `R` with the
141
+ * context it built.
142
+ *
143
+ * @category models
144
+ * @since 0.1.0
145
+ * @slop
146
+ */
147
+ export interface Binding<R = never> {
148
+ readonly descriptor: Descriptor.FlowDescriptor;
149
+ readonly run: (call: Cell.Call) => Effect.Effect<CallResult, HarnessError, R>;
150
+ }
151
+ /**
152
+ * Everything one executable binding declares.
153
+ *
154
+ * @category models
155
+ * @since 0.1.0
156
+ * @slop
157
+ */
158
+ export interface Options<I extends SchemaTypes.Top & SchemaTypes.ConstraintDecoder<unknown, never>, O extends SchemaTypes.Top & SchemaTypes.ConstraintEncoder<unknown, never>, E, R> extends DescriptorOptions {
159
+ /** The ordinary flow declaration. Its schemas are the call's contract. */
160
+ readonly flow: {
161
+ readonly input: I;
162
+ readonly output: O;
163
+ } & Declared;
164
+ /**
165
+ * The runtime implementation, with whatever requirements the host supplies.
166
+ *
167
+ * The decoded input is the whole contract for an ordinary capability. The
168
+ * call is passed as well because a handler that opens a *durable* boundary of
169
+ * its own — a timer, a child run — needs a replay-stable name for it, and
170
+ * `call.identity` is exactly that name: re-executing the cell reaches the
171
+ * same ordinal with the same declaration.
172
+ */
173
+ readonly handler: (input: I["Type"], call: Cell.Call) => Effect.Effect<O["Type"], E, R>;
174
+ /**
175
+ * Opts safe handler-failure details into cell-visible, journaled text.
176
+ * Forward message only for error classes the host authored with model-facing
177
+ * text; never forward messages of transport, SDK, OS, or unknown errors,
178
+ * headers, URLs, or serialized causes.
179
+ * Undefined or a thrown renderer uses the opaque default. Permission errors
180
+ * and existing HarnessErrors bypass this renderer and stay in the error channel.
181
+ * Inspect raw causes in the host handler, redacting before any persistence.
182
+ */
183
+ readonly publicError?: ((error: E) => string | undefined) | undefined;
184
+ /**
185
+ * Whether a handler failure is the flow's own timeout (a command past its
186
+ * limit, or a wait that gave up), and the limit in milliseconds it ran past
187
+ * when the failure says. Undefined for any other failure. The cell reads a
188
+ * timeout as a `timeout` call failure, the code of the call boundary's own
189
+ * limit, and a host that guards timeouts parks the run on it with this
190
+ * limit. Absent, every failure is `flow_failed`.
191
+ */
192
+ readonly timedOut?: ((error: E) => {
193
+ readonly limitMillis?: number | undefined;
194
+ } | undefined) | undefined;
195
+ }
196
+ /**
197
+ * Binds one flow declaration to its runtime implementation.
198
+ *
199
+ * @category constructors
200
+ * @since 0.1.0
201
+ * @slop
202
+ */
203
+ export declare const make: <I extends SchemaTypes.Top & SchemaTypes.ConstraintDecoder<unknown, never>, O extends SchemaTypes.Top & SchemaTypes.ConstraintEncoder<unknown, never>, E, R = never>(options: Options<I, O, E, R>) => Binding<R>;
204
+ /**
205
+ * Supplies a binding's remaining requirements from a context the host built.
206
+ *
207
+ * @category combinators
208
+ * @since 0.1.0
209
+ * @slop
210
+ */
211
+ export declare const provide: <R, R2>(self: Binding<R>, services: Context.Context<R2>) => Binding<Exclude<R, R2>>;
212
+ /**
213
+ * A named producer of executable bindings.
214
+ *
215
+ * Producing bindings is an effect so a source may connect a server, read a
216
+ * manifest, or resolve a credential the first time a host composes it — the
217
+ * lazy lifecycle an incoming MCP wrapper needs, expressed once here instead of
218
+ * as a special case in the controller.
219
+ *
220
+ * @category models
221
+ * @since 0.1.0
222
+ * @slop
223
+ */
224
+ export interface Source {
225
+ readonly name: string;
226
+ readonly bindings: () => Effect.Effect<ReadonlyArray<Binding>, HarnessError>;
227
+ }
228
+ /**
229
+ * Constructs a source over a fixed binding list.
230
+ *
231
+ * @category constructors
232
+ * @since 0.1.0
233
+ * @slop
234
+ */
235
+ export declare const source: (name: string, bindings: ReadonlyArray<Binding>) => Source;
236
+ /**
237
+ * The deterministic composition of every executable binding a host resolved.
238
+ *
239
+ * @category models
240
+ * @since 0.1.0
241
+ * @slop
242
+ */
243
+ export interface Catalog {
244
+ /** Bindings in composition order. */
245
+ readonly entries: ReadonlyArray<Binding>;
246
+ /** The same bindings, keyed by flow name. */
247
+ readonly bindings: ReadonlyMap<string, Binding>;
248
+ /** The descriptors those bindings project, in composition order. */
249
+ readonly descriptors: ReadonlyArray<Descriptor.FlowDescriptor>;
250
+ }
251
+ /**
252
+ * The empty catalog.
253
+ *
254
+ * @category constructors
255
+ * @since 0.1.0
256
+ * @slop
257
+ */
258
+ export declare const empty: () => Catalog;
259
+ /**
260
+ * Composes bindings into a catalog, refusing duplicate names.
261
+ *
262
+ * @category constructors
263
+ * @since 0.1.0
264
+ * @slop
265
+ */
266
+ export declare const catalogResult: (bindings: ReadonlyArray<Binding>) => Result.Result<Catalog, HarnessError>;
267
+ /**
268
+ * Resolves ordered sources into one catalog.
269
+ *
270
+ * @category constructors
271
+ * @since 0.1.0
272
+ * @slop
273
+ */
274
+ export declare const catalog: (sources: ReadonlyArray<Source>) => Effect.Effect<Catalog, HarnessError>;
275
+ /**
276
+ * Discloses a catalog's descriptors through an existing registry.
277
+ *
278
+ * File-discovered entries win: a binding whose name a source already discovered
279
+ * is not disclosed, which is what keeps `flow.ts > flow.mdx > SKILL.md`
280
+ * precedence exactly where discovery put it. The shadowed binding is reported
281
+ * as an ordinary `duplicate_name` warning rather than silently dispatched, and
282
+ * the resolver refuses the shadowed name with a resolved failure envelope.
283
+ *
284
+ * @category constructors
285
+ * @since 0.1.0
286
+ * @slop
287
+ */
288
+ export declare const registry: (base: Registry.Registry, self: Catalog) => Registry.Registry;
289
+ //# sourceMappingURL=FlowBinding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FlowBinding.d.ts","sourceRoot":"","sources":["../../src/FlowBinding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAIH,OAAO,KAAK,KAAK,OAAO,MAAM,sBAAsB,CAAA;AACpD,OAAO,KAAK,UAAU,MAAM,6BAA6B,CAAA;AACzD,OAAO,KAAK,QAAQ,MAAM,2BAA2B,CAAA;AACrD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,QAAQ,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAa,MAAM,QAAQ,CAAA;AAElE,OAAO,KAAK,KAAK,IAAI,MAAM,WAAW,CAAA;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAIhD;;;;;;;;GAQG;AACH,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAClC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACzC,QAAQ,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC,GAAG,GAAG,SAAS,CAAA;IAC5C,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC,GAAG,GAAG,SAAS,CAAA;IAC7C,QAAQ,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,SAAS,CAAA;IAClD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,GAAG,SAAS,CA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AO;IACtB,qCAAqC;IACrC,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,CAAA;IACxC,6CAA6C;IAC7C,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/C,oEAAoE;IACpE,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC,UAAU,CAAC,cAAc,CAAC,CAAA;CAC/D;AAKD;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,QAAO,OAAuB,CAAA;AAehD;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,GACxB,UAAU,aAAa,CAAC,OAAO,CAAC,KAC/B,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,YAAY,CAerC,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,GAClB,SAAS,aAAa,CAAC,MAAM,CAAC,KAC7B,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,YAAY,CAOlC,CAAA;AAEJ;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,QAAQ,GAAI,MAAM,QAAQ,CAAC,QAAQ,EAAE,MAAM,OAAO,KAAG,QAAQ,CAAC,QAoD1E,CAAA"}
@@ -0,0 +1,251 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var FlowBinding_exports = {};
30
+ __export(FlowBinding_exports, {
31
+ catalog: () => catalog,
32
+ catalogResult: () => catalogResult,
33
+ descriptorOf: () => descriptorOf,
34
+ empty: () => empty,
35
+ make: () => make,
36
+ provide: () => provide,
37
+ registry: () => registry,
38
+ source: () => source
39
+ });
40
+ module.exports = __toCommonJS(FlowBinding_exports);
41
+ var Permission = __toESM(require("@smthrs/capability/Permission"), 1);
42
+ var Digest = __toESM(require("@smthrs/core/Digest"), 1);
43
+ var Descriptor = __toESM(require("@smthrs/registry/Descriptor"), 1);
44
+ var Registry = __toESM(require("@smthrs/registry/Registry"), 1);
45
+ var import_effect = require("effect");
46
+ var import_CallLedger = require("./CallLedger.js");
47
+ var import_Cell = require("./Cell.js");
48
+ var import_HarnessError = require("./HarnessError.js");
49
+ var elide = __toESM(require("./internal/elide.js"), 1);
50
+ var import_refusal = require("./internal/refusal.js");
51
+ const declaredEffects = (effects) => ({
52
+ reads: effects?.reads ?? [],
53
+ writes: effects?.writes ?? [],
54
+ mode: effects?.mode ?? "expected",
55
+ onConflict: effects?.onConflict ?? "serialize",
56
+ tier: effects?.tier ?? "irreversible"
57
+ });
58
+ const omittableNullKeys = (schema) => {
59
+ const ast = import_effect.SchemaAST.toEncoded(schema.ast);
60
+ if (ast._tag !== "Objects") return /* @__PURE__ */ new Set();
61
+ return new Set(
62
+ ast.propertySignatures.filter((field) => import_effect.SchemaAST.isOptional(field.type) && !import_effect.Schema.is(import_effect.Schema.make(field.type))(null)).map((field) => field.name)
63
+ );
64
+ };
65
+ const withoutRejectedNulls = (input, keys) => {
66
+ if (typeof input !== "object" || input === null || Array.isArray(input)) return input;
67
+ return Object.fromEntries(Object.entries(input).filter(([key, value]) => value !== null || !keys.has(key)));
68
+ };
69
+ const document = (schema) => {
70
+ try {
71
+ return JSON.parse(JSON.stringify(import_effect.Schema.toJsonSchemaDocument(schema, { onExcessProperty: "error" })));
72
+ } catch {
73
+ return void 0;
74
+ }
75
+ };
76
+ const descriptorOf = (declaration, options = {}) => {
77
+ const name = options.name ?? declaration.name ?? "";
78
+ const path = options.path ?? `binding://${name}`;
79
+ const bodyDigest = options.bodyDigest ?? Digest.digest(Digest.canonical({
80
+ capabilities: declaration.capabilities,
81
+ description: declaration.description ?? "",
82
+ effects: declaration.effects ?? null,
83
+ name
84
+ }));
85
+ return new Descriptor.FlowDescriptor({
86
+ name,
87
+ description: declaration.description ?? "",
88
+ body: new Descriptor.BodyRefModule({ path, contentDigest: bodyDigest }),
89
+ input: options.inputDocument === void 0 ? new Descriptor.SchemaRefModule({ path, field: "input" }) : new Descriptor.SchemaRefInline({ document: options.inputDocument }),
90
+ output: options.outputDocument === void 0 ? new Descriptor.SchemaRefModule({ path, field: "output" }) : new Descriptor.SchemaRefInline({ document: options.outputDocument }),
91
+ model: import_effect.Option.none(),
92
+ flows: [],
93
+ capabilities: declaration.capabilities,
94
+ effects: declaredEffects(declaration.effects),
95
+ placement: options.placement ?? import_effect.Option.none(),
96
+ modelInvocable: options.modelInvocable ?? true,
97
+ // Omitted rather than carried as `undefined`: an absent display field is
98
+ // the absence of the claim, and `Descriptor.FlowDescriptor` encodes an
99
+ // omitted optional field away instead of writing a null nobody declared.
100
+ ...options.activity === void 0 ? {} : { activity: options.activity },
101
+ ...options.presentation === void 0 ? {} : { presentation: options.presentation },
102
+ path,
103
+ frontmatter: {},
104
+ provenance: options.provenance ?? new Descriptor.Provenance({ source: "binding", root: "binding://" })
105
+ });
106
+ };
107
+ const describeFailure = (error) => elide.head(error.message, import_CallLedger.width * 4, "reissue the call to see the whole failure");
108
+ const publicMessage = (error, render) => {
109
+ try {
110
+ const message = render?.(error);
111
+ return typeof message === "string" ? elide.head(message, import_CallLedger.width * 4, "ask the host for the full public failure") : void 0;
112
+ } catch {
113
+ return void 0;
114
+ }
115
+ };
116
+ const escalated = (error) => {
117
+ if (error instanceof import_HarnessError.HarnessError) return error;
118
+ if (error instanceof Permission.PermissionRequired) {
119
+ return new import_HarnessError.HarnessError({ code: "suspended", message: error.message, cause: error });
120
+ }
121
+ if (error instanceof Permission.PermissionDenied) {
122
+ return new import_HarnessError.HarnessError({ code: "suspended", message: error.message, cause: error });
123
+ }
124
+ return void 0;
125
+ };
126
+ const make = (options) => {
127
+ const descriptor = descriptorOf({ ...options.flow, capabilities: [...new Set(options.flow.capabilities)].sort() }, {
128
+ ...options,
129
+ bodyDigest: options.bodyDigest ?? Digest.digest(Function.prototype.toString.call(options.handler)),
130
+ ...options.inputDocument === void 0 ? { inputDocument: document(options.flow.input) } : {},
131
+ ...options.outputDocument === void 0 ? { outputDocument: document(options.flow.output) } : {}
132
+ });
133
+ const decodeInput = import_effect.Schema.decodeUnknownResult(options.flow.input);
134
+ const nullKeys = omittableNullKeys(options.flow.input);
135
+ const decodeCall = (input) => {
136
+ const first = decodeInput(input);
137
+ if (first._tag !== "Failure") return first;
138
+ const retried = decodeInput(input === null ? {} : withoutRejectedNulls(input, nullKeys));
139
+ return retried._tag === "Failure" ? first : retried;
140
+ };
141
+ const encodeOutput = import_effect.Schema.encodeUnknownResult(options.flow.output);
142
+ const asJson = import_effect.Schema.decodeUnknownResult(import_effect.Schema.Json);
143
+ return {
144
+ descriptor,
145
+ run: (call) => import_effect.Effect.gen(function* () {
146
+ const decoded = decodeCall(call.input);
147
+ if (decoded._tag === "Failure") {
148
+ return (0, import_refusal.refusal)(
149
+ "invalid_input",
150
+ `Flow ${descriptor.name} rejected its input: ${describeFailure(decoded.failure)}. Re-read ctx.flows and reissue the call.`
151
+ );
152
+ }
153
+ const produced = yield* import_effect.Effect.result(options.handler(decoded.success, call));
154
+ if (produced._tag === "Failure") {
155
+ const escalate = escalated(produced.failure);
156
+ if (escalate !== void 0) return yield* import_effect.Effect.fail(escalate);
157
+ const message = publicMessage(produced.failure, options.publicError);
158
+ const rendered = message === void 0 ? `Flow ${descriptor.name} failed.` : `Flow ${descriptor.name} failed: ${message}`;
159
+ const timeout = options.timedOut?.(produced.failure);
160
+ return timeout === void 0 ? (0, import_refusal.refusal)("flow_failed", rendered) : timeout.limitMillis === void 0 ? (0, import_refusal.refusal)("timeout", rendered) : (0, import_refusal.timedOut)(rendered, timeout.limitMillis);
161
+ }
162
+ const encoded = encodeOutput(produced.success);
163
+ if (encoded._tag === "Failure") {
164
+ return (0, import_refusal.refusal)("flow_failed", `Flow ${descriptor.name} produced output its own schema rejects.`);
165
+ }
166
+ const json = asJson(encoded.success);
167
+ if (json._tag === "Failure") {
168
+ return (0, import_refusal.refusal)("flow_failed", `Flow ${descriptor.name} produced output that is not serializable.`);
169
+ }
170
+ return new import_Cell.CallResult({ outcome: "success", value: json.success });
171
+ })
172
+ };
173
+ };
174
+ const provide = (self, services) => ({
175
+ descriptor: self.descriptor,
176
+ run: (call) => import_effect.Effect.provide(self.run(call), services)
177
+ });
178
+ const source = (name, bindings) => ({
179
+ name,
180
+ bindings: () => import_effect.Effect.succeed(bindings)
181
+ });
182
+ const emptyCatalog = { entries: [], bindings: /* @__PURE__ */ new Map(), descriptors: [] };
183
+ const empty = () => emptyCatalog;
184
+ const duplicate = (name) => new import_HarnessError.HarnessError({
185
+ code: "assembly_failed",
186
+ message: `Two executable bindings are named "${name}". A flow name resolves to exactly one implementation; rename one or drop it before composing the host.`
187
+ });
188
+ const unnamed = () => new import_HarnessError.HarnessError({
189
+ code: "assembly_failed",
190
+ message: "An executable binding has no flow name. Give the declaration a name, or pass one to FlowBinding.make."
191
+ });
192
+ const catalogResult = (bindings) => {
193
+ const composed = /* @__PURE__ */ new Map();
194
+ const descriptors = [];
195
+ for (const binding of bindings) {
196
+ const name = binding.descriptor.name;
197
+ if (name.length === 0) return import_effect.Result.fail(unnamed());
198
+ if (composed.has(name)) return import_effect.Result.fail(duplicate(name));
199
+ composed.set(name, binding);
200
+ descriptors.push(binding.descriptor);
201
+ }
202
+ return import_effect.Result.succeed({
203
+ entries: Object.freeze([...bindings]),
204
+ bindings: composed,
205
+ descriptors: Object.freeze(descriptors)
206
+ });
207
+ };
208
+ const catalog = (sources) => import_effect.Effect.gen(function* () {
209
+ const collected = [];
210
+ for (const entry of sources) {
211
+ collected.push(...yield* entry.bindings());
212
+ }
213
+ return yield* import_effect.Effect.fromResult(catalogResult(collected));
214
+ });
215
+ const registry = (base, self) => {
216
+ const added = (entries) => {
217
+ const discovered = new Set(entries.map((entry) => entry.name));
218
+ return self.descriptors.filter((entry) => !discovered.has(entry.name));
219
+ };
220
+ const list = () => import_effect.Effect.map(base.list(), (entries) => [...entries, ...added(entries)]);
221
+ const visible = () => import_effect.Effect.gen(function* () {
222
+ const shown = yield* base.visible();
223
+ const discovered = yield* base.list();
224
+ return [...shown, ...added(discovered).filter((entry) => entry.modelInvocable)];
225
+ });
226
+ const getOption = (name) => import_effect.Effect.flatMap(base.getOption(name), (found) => import_effect.Option.isSome(found) ? import_effect.Effect.succeed(found) : import_effect.Effect.map(base.list(), (entries) => entries.some((entry) => entry.name === name) ? import_effect.Option.none() : import_effect.Option.fromUndefinedOr(self.bindings.get(name)?.descriptor)));
227
+ return Registry.makeNoop({
228
+ list,
229
+ visible,
230
+ getOption,
231
+ get: (name) => import_effect.Effect.flatMap(getOption(name), (found) => import_effect.Option.isSome(found) ? import_effect.Effect.succeed(found.value) : base.get(name)),
232
+ loadBody: base.loadBody,
233
+ runPrompt: base.runPrompt,
234
+ refresh: base.refresh,
235
+ warnings: () => import_effect.Effect.gen(function* () {
236
+ const declared = yield* base.warnings();
237
+ const entries = yield* base.list();
238
+ const discovered = new Set(entries.map((entry) => entry.name));
239
+ const shadowed = self.descriptors.filter((entry) => discovered.has(entry.name)).map(
240
+ (entry) => new Descriptor.DiscoveryWarning({
241
+ code: "duplicate_name",
242
+ path: entry.path,
243
+ name: entry.name,
244
+ message: `Executable binding "${entry.name}" is shadowed by a discovered flow; the discovered entry keeps the name.`
245
+ })
246
+ );
247
+ return [...declared, ...shadowed];
248
+ })
249
+ });
250
+ };
251
+ //# sourceMappingURL=FlowBinding.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/FlowBinding.ts"],
4
+ "sourcesContent": ["/**\n * The executable-flow binding contract.\n *\n * A cell's only authority is `ctx.call(flow, input)`, so *every* capability an\n * agent can reach \u2014 a standard filesystem flow, a memory flow, an incoming MCP\n * tool, a durable child agent \u2014 has to arrive as an ordinary flow declaration\n * plus the code that runs it. This module is the smallest contract that pairs\n * the two.\n *\n * Three types carry the whole idea:\n *\n * - a {@link Binding} is one flow declaration, its projected\n * `Descriptor.FlowDescriptor`, and a runner that decodes cell input through\n * the flow's input schema, executes the handler, and validates the handler's\n * output back into serializable JSON;\n * - a {@link Source} produces bindings, possibly effectfully, so a lazily\n * connected server or a plugin can contribute without being resolved at\n * import time;\n * - a {@link Catalog} is the deterministic composition of sources, and it\n * refuses duplicate executable names rather than letting one descriptor be\n * dispatched to another implementation.\n *\n * This is deliberately *not* a second registry. The descriptors a catalog\n * projects are ordinary `FlowDescriptor`s, and {@link registry} composes them\n * onto an existing `Registry.Registry` behind that same contract \u2014 with the\n * file-discovered entries winning, so discovery precedence is untouched.\n *\n * The failure split is the one `EngineLike.call` declares. A refusal the agent\n * could plausibly correct \u2014 malformed input, a flow that failed, output that is\n * not serializable \u2014 becomes a `failure` {@link Cell.CallResult} the cell\n * observes as a resolved `{ ok: false, error }` envelope. The cell branches on\n * `.ok === false` and `.error.code` to recover; ordinary failures do not throw.\n * Anything the cell must never swallow, such as a permission requirement, an\n * abort, or a suspension, stays in the typed error channel. An interruption\n * is never caught at all.\n *\n * Governing design: `../docs/concepts.md#durable-cell-loop` and\n * `../docs/concepts.md#flow-registry`.\n *\n * @since 0.1.0\n */\n\nimport * as Permission from \"@smthrs/capability/Permission\"\nimport * as Digest from \"@smthrs/core/Digest\"\nimport type * as Effects from \"@smthrs/core/Effects\"\nimport * as Descriptor from \"@smthrs/registry/Descriptor\"\nimport * as Registry from \"@smthrs/registry/Registry\"\nimport type { Context, Schema as SchemaTypes } from \"effect\"\nimport { Effect, Option, Result, Schema, SchemaAST } from \"effect\"\nimport { width as callLedgerWidth } from \"./CallLedger.ts\"\nimport type * as Cell from \"./Cell.ts\"\nimport { CallResult } from \"./Cell.ts\"\nimport { HarnessError } from \"./HarnessError.ts\"\nimport * as elide from \"./internal/elide.ts\"\nimport { refusal, timedOut } from \"./internal/refusal.ts\"\n\n/**\n * The declaration half of a binding.\n *\n * Schema and metadata record accepted by bindings and registry admission.\n *\n * @category models\n * @since 0.1.0\n * @slop\n */\nexport interface Declared {\n readonly name?: string | undefined\n readonly description?: string | undefined\n readonly input?: SchemaTypes.Top | undefined\n readonly output?: SchemaTypes.Top | undefined\n readonly flows?: ReadonlyArray<string> | undefined\n readonly model?: string | ReadonlyArray<string> | undefined\n readonly annotations?: Context.Context<never> | undefined\n readonly budget?: Descriptor.FlowBudget | undefined\n readonly deadline?: number | undefined\n readonly modelInvocable?: boolean | undefined\n readonly disableModelInvocation?: boolean | undefined\n readonly capabilities: ReadonlyArray<string>\n readonly effects: Effects.Declaration | undefined\n}\n\n/**\n * The metadata a projected descriptor needs that a flow declaration does not\n * carry.\n *\n * Every default is the conservative one: a binding is model-invocable, has no\n * placement, and is attributed to the `binding` source.\n *\n * @category models\n * @since 0.1.0\n * @slop\n */\nexport interface DescriptorOptions {\n /** Overrides the declaration's own name. */\n readonly name?: string | undefined\n /** The stable locator recorded as the descriptor's body and path. */\n readonly path?: string | undefined\n /**\n * Content identity of the executable body. `make` derives this from the\n * handler when omitted; direct descriptor projections derive it from the\n * declaration they can observe.\n */\n readonly bodyDigest?: string | undefined\n readonly modelInvocable?: boolean | undefined\n readonly placement?: Option.Option<Descriptor.Placement> | undefined\n readonly provenance?: Descriptor.Provenance | undefined\n /**\n * The input schema as a JSON Schema document, carried by value.\n *\n * A binding holds the real schema, so recording a `binding://` locator\n * throws away the one description of the call's shape anything downstream\n * could read. {@link make} fills this in, which is what puts a parameter\n * schema beside every flow in `ctx.flows`.\n */\n readonly inputDocument?: Schema.Json | undefined\n /** The output schema as a JSON Schema document, carried by value. */\n readonly outputDocument?: Schema.Json | undefined\n /**\n * What a call to this flow does, for a reader of a run.\n *\n * Absent means unknown, and unknown stays unknown: a reader that is given\n * nothing says nothing rather than guessing from the flow's name. `bash` is\n * the deliberate absence \u2014 what a shell call does is in the command.\n */\n readonly activity?: Descriptor.FlowActivity | undefined\n /**\n * How one recorded call to this flow reads.\n *\n * This is the one authority a run card has for the words beside a call. It\n * grants nothing: {@link Descriptor.declarationDigest} and\n * {@link Descriptor.executionDigest} both exclude it, so declaring it cannot\n * invalidate a reviewed plan, a call identity, or a cached prompt.\n */\n readonly presentation?: Descriptor.CallPresentation | undefined\n}\n\n/**\n * The conservative effect declaration used when a flow declares none.\n *\n * `irreversible` is the safe default: it is never content-shared across\n * executions, so a binding that forgot to declare its tier can never replay\n * another run's recorded result.\n */\nconst declaredEffects = (effects: Effects.Declaration | undefined): Descriptor.EffectDeclaration => ({\n reads: effects?.reads ?? [],\n writes: effects?.writes ?? [],\n mode: effects?.mode ?? \"expected\",\n onConflict: effects?.onConflict ?? \"serialize\",\n tier: effects?.tier ?? \"irreversible\"\n})\n\n/** Only declared optional input properties that reject null can be omitted. */\nconst omittableNullKeys = (schema: SchemaTypes.Top): ReadonlySet<PropertyKey> => {\n const ast = SchemaAST.toEncoded(schema.ast)\n if (ast._tag !== \"Objects\") return new Set()\n return new Set(\n ast.propertySignatures\n .filter((field) => SchemaAST.isOptional(field.type) && !Schema.is(Schema.make(field.type))(null))\n .map((field) => field.name)\n )\n}\n\n/** The JSON omission retry is limited to known top-level optional properties. */\nconst withoutRejectedNulls = (input: unknown, keys: ReadonlySet<PropertyKey>): unknown => {\n if (typeof input !== \"object\" || input === null || Array.isArray(input)) return input\n return Object.fromEntries(Object.entries(input).filter(([key, value]) => value !== null || !keys.has(key)))\n}\n\n/**\n * Renders one schema as a JSON Schema document, or `undefined` when it has no\n * JSON Schema form.\n *\n * A schema that cannot be projected is not an error: the descriptor falls\n * back to the locator it always recorded, and only the catalog rendering is\n * poorer for it.\n */\nconst document = (schema: SchemaTypes.Top): Schema.Json | undefined => {\n try {\n return JSON.parse(JSON.stringify(Schema.toJsonSchemaDocument(schema, { onExcessProperty: \"error\" }))) as Schema.Json\n } catch {\n return undefined\n }\n}\n\n/**\n * Projects an ordinary flow declaration into a registry descriptor.\n *\n * @category conversions\n * @since 0.1.0\n * @slop\n */\nexport const descriptorOf = (\n declaration: Declared,\n options: DescriptorOptions = {}\n): Descriptor.FlowDescriptor => {\n const name = options.name ?? declaration.name ?? \"\"\n const path = options.path ?? `binding://${name}`\n const bodyDigest = options.bodyDigest ?? Digest.digest(Digest.canonical({\n capabilities: declaration.capabilities,\n description: declaration.description ?? \"\",\n effects: declaration.effects ?? null,\n name\n }))\n return new Descriptor.FlowDescriptor({\n name,\n description: declaration.description ?? \"\",\n body: new Descriptor.BodyRefModule({ path, contentDigest: bodyDigest }),\n input: options.inputDocument === undefined\n ? new Descriptor.SchemaRefModule({ path, field: \"input\" })\n : new Descriptor.SchemaRefInline({ document: options.inputDocument }),\n output: options.outputDocument === undefined\n ? new Descriptor.SchemaRefModule({ path, field: \"output\" })\n : new Descriptor.SchemaRefInline({ document: options.outputDocument }),\n model: Option.none(),\n flows: [],\n capabilities: declaration.capabilities,\n effects: declaredEffects(declaration.effects),\n placement: options.placement ?? Option.none(),\n modelInvocable: options.modelInvocable ?? true,\n // Omitted rather than carried as `undefined`: an absent display field is\n // the absence of the claim, and `Descriptor.FlowDescriptor` encodes an\n // omitted optional field away instead of writing a null nobody declared.\n ...(options.activity === undefined ? {} : { activity: options.activity }),\n ...(options.presentation === undefined ? {} : { presentation: options.presentation }),\n path,\n frontmatter: {},\n provenance: options.provenance ?? new Descriptor.Provenance({ source: \"binding\", root: \"binding://\" })\n })\n}\n\n/**\n * One flow declaration and the code that runs it.\n *\n * `R` is whatever the handler still needs from the host. A catalog only accepts\n * fully supplied bindings, so a host uses {@link provide} to close `R` with the\n * context it built.\n *\n * @category models\n * @since 0.1.0\n * @slop\n */\nexport interface Binding<R = never> {\n readonly descriptor: Descriptor.FlowDescriptor\n readonly run: (call: Cell.Call) => Effect.Effect<CallResult, HarnessError, R>\n}\n\n/** Bounds a schema rejection before it enters the journal and later frames. */\nconst describeFailure = (error: Schema.SchemaError): string =>\n elide.head(error.message, callLedgerWidth * 4, \"reissue the call to see the whole failure\")\n\n/** Only explicitly public text may cross the host boundary. Renderer failures stay opaque too. */\nconst publicMessage = <E>(error: E, render: ((error: E) => string | undefined) | undefined): string | undefined => {\n try {\n const message = render?.(error)\n return typeof message === \"string\"\n ? elide.head(message, callLedgerWidth * 4, \"ask the host for the full public failure\")\n : undefined\n } catch {\n return undefined\n }\n}\n\n/**\n * Decides whether a handler failure is the cell's business.\n *\n * A permission requirement, a denial, and every harness-level failure are the\n * controller's to act on: parking, escalating, or aborting the run. Returning\n * them as call results would let a cell ignore its own permission park and\n * proceed as though it had authority.\n */\nconst escalated = (error: unknown): HarnessError | undefined => {\n if (error instanceof HarnessError) return error\n if (error instanceof Permission.PermissionRequired) {\n return new HarnessError({ code: \"suspended\", message: error.message, cause: error })\n }\n if (error instanceof Permission.PermissionDenied) {\n return new HarnessError({ code: \"suspended\", message: error.message, cause: error })\n }\n return undefined\n}\n\n/**\n * Everything one executable binding declares.\n *\n * @category models\n * @since 0.1.0\n * @slop\n */\nexport interface Options<\n I extends SchemaTypes.Top & SchemaTypes.ConstraintDecoder<unknown, never>,\n O extends SchemaTypes.Top & SchemaTypes.ConstraintEncoder<unknown, never>,\n E,\n R\n> extends DescriptorOptions {\n /** The ordinary flow declaration. Its schemas are the call's contract. */\n readonly flow: {\n readonly input: I\n readonly output: O\n } & Declared\n /**\n * The runtime implementation, with whatever requirements the host supplies.\n *\n * The decoded input is the whole contract for an ordinary capability. The\n * call is passed as well because a handler that opens a *durable* boundary of\n * its own \u2014 a timer, a child run \u2014 needs a replay-stable name for it, and\n * `call.identity` is exactly that name: re-executing the cell reaches the\n * same ordinal with the same declaration.\n */\n readonly handler: (input: I[\"Type\"], call: Cell.Call) => Effect.Effect<O[\"Type\"], E, R>\n /**\n * Opts safe handler-failure details into cell-visible, journaled text.\n * Forward message only for error classes the host authored with model-facing\n * text; never forward messages of transport, SDK, OS, or unknown errors,\n * headers, URLs, or serialized causes.\n * Undefined or a thrown renderer uses the opaque default. Permission errors\n * and existing HarnessErrors bypass this renderer and stay in the error channel.\n * Inspect raw causes in the host handler, redacting before any persistence.\n */\n readonly publicError?: ((error: E) => string | undefined) | undefined\n /**\n * Whether a handler failure is the flow's own timeout (a command past its\n * limit, or a wait that gave up), and the limit in milliseconds it ran past\n * when the failure says. Undefined for any other failure. The cell reads a\n * timeout as a `timeout` call failure, the code of the call boundary's own\n * limit, and a host that guards timeouts parks the run on it with this\n * limit. Absent, every failure is `flow_failed`.\n */\n readonly timedOut?: ((error: E) => { readonly limitMillis?: number | undefined } | undefined) | undefined\n}\n\n/**\n * Binds one flow declaration to its runtime implementation.\n *\n * @category constructors\n * @since 0.1.0\n * @slop\n */\nexport const make = <\n I extends SchemaTypes.Top & SchemaTypes.ConstraintDecoder<unknown, never>,\n O extends SchemaTypes.Top & SchemaTypes.ConstraintEncoder<unknown, never>,\n E,\n R = never\n>(options: Options<I, O, E, R>): Binding<R> => {\n const descriptor = descriptorOf({ ...options.flow, capabilities: [...new Set(options.flow.capabilities)].sort() }, {\n ...options,\n bodyDigest: options.bodyDigest ?? Digest.digest(Function.prototype.toString.call(options.handler)),\n ...(options.inputDocument === undefined ? { inputDocument: document(options.flow.input) } : {}),\n ...(options.outputDocument === undefined ? { outputDocument: document(options.flow.output) } : {})\n })\n const decodeInput = Schema.decodeUnknownResult(options.flow.input)\n // Retry JSON nulls as omissions only where the encoded struct declares an\n // optional field that rejects null. Other nullable fields must survive even\n // when a sibling caused the original decode to fail. The full input schema\n // still validates the retry, including refinements and transformations.\n const nullKeys = omittableNullKeys(options.flow.input)\n const decodeCall = (input: unknown): ReturnType<typeof decodeInput> => {\n const first = decodeInput(input)\n if (first._tag !== \"Failure\") return first\n // A cell that omits the input (`ctx.call(\"tab.list\")`) sends JSON null.\n // Retry it as `{}`, so an all-optional object schema accepts the call.\n const retried = decodeInput(input === null ? {} : withoutRejectedNulls(input, nullKeys))\n // When the retry fails too, the first attempt's failure is the one worth\n // reporting: it names the key the caller actually wrote.\n return retried._tag === \"Failure\" ? first : retried\n }\n const encodeOutput = Schema.encodeUnknownResult(options.flow.output)\n const asJson = Schema.decodeUnknownResult(Schema.Json)\n return {\n descriptor,\n run: (call) =>\n Effect.gen(function*() {\n const decoded = decodeCall(call.input)\n if (decoded._tag === \"Failure\") {\n return refusal(\n \"invalid_input\",\n `Flow ${descriptor.name} rejected its input: ${\n describeFailure(decoded.failure)\n }. Re-read ctx.flows and reissue the call.`\n )\n }\n const produced = yield* Effect.result(options.handler(decoded.success, call))\n if (produced._tag === \"Failure\") {\n const escalate = escalated(produced.failure)\n if (escalate !== undefined) return yield* Effect.fail(escalate)\n const message = publicMessage(produced.failure, options.publicError)\n const rendered = message === undefined\n ? `Flow ${descriptor.name} failed.`\n : `Flow ${descriptor.name} failed: ${message}`\n const timeout = options.timedOut?.(produced.failure)\n return timeout === undefined\n ? refusal(\"flow_failed\", rendered)\n : timeout.limitMillis === undefined\n ? refusal(\"timeout\", rendered)\n : timedOut(rendered, timeout.limitMillis)\n }\n const encoded = encodeOutput(produced.success)\n if (encoded._tag === \"Failure\") {\n return refusal(\"flow_failed\", `Flow ${descriptor.name} produced output its own schema rejects.`)\n }\n const json = asJson(encoded.success)\n if (json._tag === \"Failure\") {\n return refusal(\"flow_failed\", `Flow ${descriptor.name} produced output that is not serializable.`)\n }\n return new CallResult({ outcome: \"success\", value: json.success })\n })\n }\n}\n\n/**\n * Supplies a binding's remaining requirements from a context the host built.\n *\n * @category combinators\n * @since 0.1.0\n * @slop\n */\nexport const provide = <R, R2>(\n self: Binding<R>,\n services: Context.Context<R2>\n): Binding<Exclude<R, R2>> => ({\n descriptor: self.descriptor,\n run: (call) => Effect.provide(self.run(call), services)\n})\n\n/**\n * A named producer of executable bindings.\n *\n * Producing bindings is an effect so a source may connect a server, read a\n * manifest, or resolve a credential the first time a host composes it \u2014 the\n * lazy lifecycle an incoming MCP wrapper needs, expressed once here instead of\n * as a special case in the controller.\n *\n * @category models\n * @since 0.1.0\n * @slop\n */\nexport interface Source {\n readonly name: string\n readonly bindings: () => Effect.Effect<ReadonlyArray<Binding>, HarnessError>\n}\n\n/**\n * Constructs a source over a fixed binding list.\n *\n * @category constructors\n * @since 0.1.0\n * @slop\n */\nexport const source = (name: string, bindings: ReadonlyArray<Binding>): Source => ({\n name,\n bindings: () => Effect.succeed(bindings)\n})\n\n/**\n * The deterministic composition of every executable binding a host resolved.\n *\n * @category models\n * @since 0.1.0\n * @slop\n */\nexport interface Catalog {\n /** Bindings in composition order. */\n readonly entries: ReadonlyArray<Binding>\n /** The same bindings, keyed by flow name. */\n readonly bindings: ReadonlyMap<string, Binding>\n /** The descriptors those bindings project, in composition order. */\n readonly descriptors: ReadonlyArray<Descriptor.FlowDescriptor>\n}\n\n/** The empty catalog, which resolves nothing and discloses nothing. */\nconst emptyCatalog: Catalog = { entries: [], bindings: new Map(), descriptors: [] }\n\n/**\n * The empty catalog.\n *\n * @category constructors\n * @since 0.1.0\n * @slop\n */\nexport const empty = (): Catalog => emptyCatalog\n\nconst duplicate = (name: string): HarnessError =>\n new HarnessError({\n code: \"assembly_failed\",\n message:\n `Two executable bindings are named \"${name}\". A flow name resolves to exactly one implementation; rename one or drop it before composing the host.`\n })\n\nconst unnamed = (): HarnessError =>\n new HarnessError({\n code: \"assembly_failed\",\n message: \"An executable binding has no flow name. Give the declaration a name, or pass one to FlowBinding.make.\"\n })\n\n/**\n * Composes bindings into a catalog, refusing duplicate names.\n *\n * @category constructors\n * @since 0.1.0\n * @slop\n */\nexport const catalogResult = (\n bindings: ReadonlyArray<Binding>\n): Result.Result<Catalog, HarnessError> => {\n const composed = new Map<string, Binding>()\n const descriptors: Array<Descriptor.FlowDescriptor> = []\n for (const binding of bindings) {\n const name = binding.descriptor.name\n if (name.length === 0) return Result.fail(unnamed())\n if (composed.has(name)) return Result.fail(duplicate(name))\n composed.set(name, binding)\n descriptors.push(binding.descriptor)\n }\n return Result.succeed({\n entries: Object.freeze([...bindings]),\n bindings: composed,\n descriptors: Object.freeze(descriptors)\n })\n}\n\n/**\n * Resolves ordered sources into one catalog.\n *\n * @category constructors\n * @since 0.1.0\n * @slop\n */\nexport const catalog = (\n sources: ReadonlyArray<Source>\n): Effect.Effect<Catalog, HarnessError> =>\n Effect.gen(function*() {\n const collected: Array<Binding> = []\n for (const entry of sources) {\n collected.push(...(yield* entry.bindings()))\n }\n return yield* Effect.fromResult(catalogResult(collected))\n })\n\n/**\n * Discloses a catalog's descriptors through an existing registry.\n *\n * File-discovered entries win: a binding whose name a source already discovered\n * is not disclosed, which is what keeps `flow.ts > flow.mdx > SKILL.md`\n * precedence exactly where discovery put it. The shadowed binding is reported\n * as an ordinary `duplicate_name` warning rather than silently dispatched, and\n * the resolver refuses the shadowed name with a resolved failure envelope.\n *\n * @category constructors\n * @since 0.1.0\n * @slop\n */\nexport const registry = (base: Registry.Registry, self: Catalog): Registry.Registry => {\n const added = (entries: ReadonlyArray<Descriptor.FlowDescriptor>): ReadonlyArray<Descriptor.FlowDescriptor> => {\n const discovered = new Set(entries.map((entry) => entry.name))\n return self.descriptors.filter((entry) => !discovered.has(entry.name))\n }\n const list = () => Effect.map(base.list(), (entries) => [...entries, ...added(entries)])\n // Shadowing is decided against everything discovery found, never against the\n // narrower visible set. A discovered entry that is not model-invocable still\n // owns its name \u2014 resolving it is what `getOption` does \u2014 so deciding\n // visibility against `base.visible()` would disclose a binding the boundary\n // then refuses on every call, and would make `visible()` report a flow\n // `list()` does not contain.\n const visible = () =>\n Effect.gen(function*() {\n const shown = yield* base.visible()\n const discovered = yield* base.list()\n return [...shown, ...added(discovered).filter((entry) => entry.modelInvocable)]\n })\n const getOption = (name: string) =>\n Effect.flatMap(base.getOption(name), (found) =>\n Option.isSome(found)\n ? Effect.succeed(found)\n : Effect.map(base.list(), (entries) =>\n entries.some((entry) => entry.name === name)\n ? Option.none()\n : Option.fromUndefinedOr(self.bindings.get(name)?.descriptor)))\n return Registry.makeNoop({\n list,\n visible,\n getOption,\n get: (name) =>\n Effect.flatMap(getOption(name), (found) => Option.isSome(found) ? Effect.succeed(found.value) : base.get(name)),\n loadBody: base.loadBody,\n runPrompt: base.runPrompt,\n refresh: base.refresh,\n warnings: () =>\n Effect.gen(function*() {\n const declared = yield* base.warnings()\n const entries = yield* base.list()\n const discovered = new Set(entries.map((entry) => entry.name))\n const shadowed = self.descriptors.filter((entry) => discovered.has(entry.name)).map((entry) =>\n new Descriptor.DiscoveryWarning({\n code: \"duplicate_name\",\n path: entry.path,\n name: entry.name,\n message:\n `Executable binding \"${entry.name}\" is shadowed by a discovered flow; the discovered entry keeps the name.`\n })\n )\n return [...declared, ...shadowed]\n })\n })\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA0CA,iBAA4B;AAC5B,aAAwB;AAExB,iBAA4B;AAC5B,eAA0B;AAE1B,oBAA0D;AAC1D,wBAAyC;AAEzC,kBAA2B;AAC3B,0BAA6B;AAC7B,YAAuB;AACvB,qBAAkC;AAyFlC,MAAM,kBAAkB,CAAC,aAA4E;AAAA,EACn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