@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,142 @@
1
+ /**
2
+ * The variables panel: what the realm holds, stated every frame.
3
+ *
4
+ * A run's memory is not a JSON document the cell filed — it is the set of names
5
+ * the realm is holding, and the model can only act on what the prompt says about
6
+ * them. This is what the prompt says.
7
+ *
8
+ * Every line is a name, its type, one *cheap* size, and when it was last bound.
9
+ * Nothing here is serialized whole: a panel that stringified every global would
10
+ * pay the heap for it every frame, and the value the model wants is already
11
+ * under the name the panel prints.
12
+ *
13
+ * Freshness is derived from the cheap size, which is what makes the panel cost
14
+ * nothing. A binding rewritten to a value of the same type and the same size —
15
+ * a 40-character string replaced by a different 40-character string — reads as
16
+ * unchanged and keeps its stamp. That bound is stated rather than hidden: the
17
+ * panel is a roster, and the run's own prints are what say a value moved.
18
+ *
19
+ * @since 0.1.0
20
+ */
21
+ import { Effect, Schema } from "effect";
22
+ import * as CallLedger from "./CallLedger.js";
23
+ import * as elide from "./internal/elide.js";
24
+ import { NonNegativeSafeInt } from "./internal/nonNegativeSafeInt.js";
25
+ /**
26
+ * How many names the panel prints before it starts counting instead.
27
+ *
28
+ * Sixty-four is the same order as `CallLedger` `bound` and well above what a
29
+ * round near par binds: the five golfed instances hold between 6 and 21 names
30
+ * at their last frame. A run past the bound is shown its most recently bound
31
+ * names and told how many older ones it still holds.
32
+ *
33
+ * @category constants
34
+ * @since 0.1.0
35
+ */
36
+ export const bound = 64;
37
+ /**
38
+ * One name the realm holds, with the cheap facts a probe can read off it.
39
+ *
40
+ * `size` is already rendered by the probe — a string's length, an array's
41
+ * length, an object's key count, a function's arity, a number or boolean by
42
+ * value — because the value itself never crosses the realm boundary.
43
+ *
44
+ * @category models
45
+ * @since 0.1.0
46
+ */
47
+ export class Binding extends Schema.Class("flows/harness/VariablesPanel/Binding")({
48
+ name: Schema.String,
49
+ /**
50
+ * The name's JavaScript type, `unset` for a name a throw left unassigned, or
51
+ * `unreadable` for one whose value the probe could not even read — a throwing
52
+ * accessor, a proxy that refuses its own keys. The two are named apart because
53
+ * they say different things: one name holds nothing, the other holds something
54
+ * that will not be looked at.
55
+ */
56
+ type: Schema.String,
57
+ /** One cheap measure of the value, already rendered; empty when there is none. */
58
+ size: Schema.String
59
+ }) {
60
+ }
61
+ /**
62
+ * One name the realm holds, with the frames that first and last bound it.
63
+ *
64
+ * @category models
65
+ * @since 0.1.0
66
+ */
67
+ export class Stamp extends Schema.Class("flows/harness/VariablesPanel/Stamp")({
68
+ name: Schema.String,
69
+ type: Schema.String,
70
+ size: Schema.String,
71
+ /** The frame whose cell last changed the binding's cheap shape. */
72
+ frame: NonNegativeSafeInt,
73
+ /** The frame whose cell first bound the name. */
74
+ since: NonNegativeSafeInt
75
+ }) {
76
+ }
77
+ /**
78
+ * Every name the realm holds, with the frames that bound it.
79
+ *
80
+ * @category models
81
+ * @since 0.1.0
82
+ */
83
+ export const Ledger = Schema.Array(Stamp).pipe(Schema.withConstructorDefault(Effect.succeed([])), Schema.withDecodingDefaultKey(Effect.succeed([])));
84
+ /**
85
+ * Re-stamps the panel against the bindings a frame closed on.
86
+ *
87
+ * A name whose type and size are unchanged keeps both of its frames, so the
88
+ * panel says when a binding last moved rather than that every name was touched
89
+ * again. A name the realm no longer reports is dropped: a `var` global cannot
90
+ * be deleted, so the only way a name leaves the probe's answer is the realm
91
+ * being rebuilt, and a roster that outlived its realm would be a lie.
92
+ *
93
+ * @category combinators
94
+ * @since 0.1.0
95
+ */
96
+ export const stamp = (known, bindings, frame) => {
97
+ const previous = new Map(known.map((entry) => [entry.name, entry]));
98
+ return bindings.map((binding) => {
99
+ const before = previous.get(binding.name);
100
+ if (before === undefined) {
101
+ return new Stamp({ name: binding.name, type: binding.type, size: binding.size, frame, since: frame });
102
+ }
103
+ return before.type === binding.type && before.size === binding.size
104
+ ? before
105
+ : new Stamp({ name: binding.name, type: binding.type, size: binding.size, frame, since: before.since });
106
+ });
107
+ };
108
+ /** Names how a binding stands relative to the frame that just ran. */
109
+ const marked = (entry, frame) => {
110
+ if (entry.since === frame)
111
+ return "new this frame";
112
+ if (entry.frame === frame)
113
+ return "changed this frame";
114
+ const age = frame - entry.frame;
115
+ return `bound at frame ${entry.frame}, ${age} frame${age === 1 ? "" : "s"} ago`;
116
+ };
117
+ /**
118
+ * Renders the panel for one frame's prompt.
119
+ *
120
+ * `frame` is the frame whose cell just ran, which is what `new` and `changed`
121
+ * are relative to.
122
+ *
123
+ * @category conversions
124
+ * @since 0.1.0
125
+ */
126
+ export const render = (options) => {
127
+ if (options.ledger.length === 0) {
128
+ return "Your realm holds no names yet. Anything a cell declares at the top level is still bound in every later cell of this run.";
129
+ }
130
+ const ordered = [...options.ledger].sort((left, right) => left.frame - right.frame);
131
+ const listed = ordered.slice(Math.max(0, ordered.length - bound));
132
+ const uncounted = ordered.length - listed.length;
133
+ const lines = listed.map((entry) => elide.head(`- ${entry.name} (${entry.type}${entry.size === "" ? "" : `, ${entry.size}`}) — ${marked(entry, options.frame)}`, CallLedger.width, "the name is what recalls the value"));
134
+ return [
135
+ `Names your realm holds (${options.ledger.length}), least recently bound first. Read and compute with these instead of fetching them again:`,
136
+ ...lines,
137
+ ...(uncounted > 0
138
+ ? [`- … and ${uncounted} older name${uncounted === 1 ? "" : "s"} not listed here; they are still bound.`]
139
+ : [])
140
+ ].join("\n");
141
+ };
142
+ //# sourceMappingURL=VariablesPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VariablesPanel.js","sourceRoot":"","sources":["../../src/VariablesPanel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACvC,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,KAAK,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AAErE;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,EAAE,CAAA;AAEvB;;;;;;;;;GASG;AACH,MAAM,OAAO,OAAQ,SAAQ,MAAM,CAAC,KAAK,CAAU,sCAAsC,CAAC,CAAC;IACzF,IAAI,EAAE,MAAM,CAAC,MAAM;IACnB;;;;;;OAMG;IACH,IAAI,EAAE,MAAM,CAAC,MAAM;IACnB,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC,MAAM;CACpB,CAAC;CAAG;AAEL;;;;;GAKG;AACH,MAAM,OAAO,KAAM,SAAQ,MAAM,CAAC,KAAK,CAAQ,o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,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAA;IAChD,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CACjC,KAAK,CAAC,IAAI,CACR,KAAK,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,IAAI,EAAE,OAAO,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,EAAE,EAChH,UAAU,CAAC,KAAK,EAChB,oCAAoC,CACrC,CACF,CAAA;IACD,OAAO;QACL,2BAA2B,OAAO,CAAC,MAAM,CAAC,MAAM,4FAA4F;QAC5I,GAAG,KAAK;QACR,GAAG,CAAC,SAAS,GAAG,CAAC;YACf,CAAC,CAAC,CAAC,WAAW,SAAS,cAAc,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,yCAAyC,CAAC;YACzG,CAAC,CAAC,EAAE,CAAC;KACR,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACd,CAAC,CAAA","sourcesContent":["/**\n * The variables panel: what the realm holds, stated every frame.\n *\n * A run's memory is not a JSON document the cell filed — it is the set of names\n * the realm is holding, and the model can only act on what the prompt says about\n * them. This is what the prompt says.\n *\n * Every line is a name, its type, one *cheap* size, and when it was last bound.\n * Nothing here is serialized whole: a panel that stringified every global would\n * pay the heap for it every frame, and the value the model wants is already\n * under the name the panel prints.\n *\n * Freshness is derived from the cheap size, which is what makes the panel cost\n * nothing. A binding rewritten to a value of the same type and the same size —\n * a 40-character string replaced by a different 40-character string — reads as\n * unchanged and keeps its stamp. That bound is stated rather than hidden: the\n * panel is a roster, and the run's own prints are what say a value moved.\n *\n * @since 0.1.0\n */\n\nimport { Effect, Schema } from \"effect\"\nimport * as CallLedger from \"./CallLedger.ts\"\nimport * as elide from \"./internal/elide.ts\"\nimport { NonNegativeSafeInt } from \"./internal/nonNegativeSafeInt.ts\"\n\n/**\n * How many names the panel prints before it starts counting instead.\n *\n * Sixty-four is the same order as `CallLedger` `bound` and well above what a\n * round near par binds: the five golfed instances hold between 6 and 21 names\n * at their last frame. A run past the bound is shown its most recently bound\n * names and told how many older ones it still holds.\n *\n * @category constants\n * @since 0.1.0\n */\nexport const bound = 64\n\n/**\n * One name the realm holds, with the cheap facts a probe can read off it.\n *\n * `size` is already rendered by the probe — a string's length, an array's\n * length, an object's key count, a function's arity, a number or boolean by\n * value — because the value itself never crosses the realm boundary.\n *\n * @category models\n * @since 0.1.0\n */\nexport class Binding extends Schema.Class<Binding>(\"flows/harness/VariablesPanel/Binding\")({\n name: Schema.String,\n /**\n * The name's JavaScript type, `unset` for a name a throw left unassigned, or\n * `unreadable` for one whose value the probe could not even read — a throwing\n * accessor, a proxy that refuses its own keys. The two are named apart because\n * they say different things: one name holds nothing, the other holds something\n * that will not be looked at.\n */\n type: Schema.String,\n /** One cheap measure of the value, already rendered; empty when there is none. */\n size: Schema.String\n}) {}\n\n/**\n * One name the realm holds, with the frames that first and last bound it.\n *\n * @category models\n * @since 0.1.0\n */\nexport class Stamp extends Schema.Class<Stamp>(\"flows/harness/VariablesPanel/Stamp\")({\n name: Schema.String,\n type: Schema.String,\n size: Schema.String,\n /** The frame whose cell last changed the binding's cheap shape. */\n frame: NonNegativeSafeInt,\n /** The frame whose cell first bound the name. */\n since: NonNegativeSafeInt\n}) {}\n\n/**\n * Every name the realm holds, with the frames that bound it.\n *\n * @category models\n * @since 0.1.0\n */\nexport const Ledger = Schema.Array(Stamp).pipe(\n Schema.withConstructorDefault(Effect.succeed<ReadonlyArray<Stamp>>([])),\n Schema.withDecodingDefaultKey(Effect.succeed<ReadonlyArray<Stamp>>([]))\n)\n\n/**\n * Every name the realm holds, with the frames that bound it.\n *\n * @category models\n * @since 0.1.0\n */\nexport type Ledger = typeof Ledger.Type\n\n/**\n * Re-stamps the panel against the bindings a frame closed on.\n *\n * A name whose type and size are unchanged keeps both of its frames, so the\n * panel says when a binding last moved rather than that every name was touched\n * again. A name the realm no longer reports is dropped: a `var` global cannot\n * be deleted, so the only way a name leaves the probe's answer is the realm\n * being rebuilt, and a roster that outlived its realm would be a lie.\n *\n * @category combinators\n * @since 0.1.0\n */\nexport const stamp = (known: Ledger, bindings: ReadonlyArray<Binding>, frame: number): Ledger => {\n const previous = new Map(known.map((entry) => [entry.name, entry] as const))\n return bindings.map((binding) => {\n const before = previous.get(binding.name)\n if (before === undefined) {\n return new Stamp({ name: binding.name, type: binding.type, size: binding.size, frame, since: frame })\n }\n return before.type === binding.type && before.size === binding.size\n ? before\n : new Stamp({ name: binding.name, type: binding.type, size: binding.size, frame, since: before.since })\n })\n}\n\n/** Names how a binding stands relative to the frame that just ran. */\nconst marked = (entry: Stamp, frame: number): string => {\n if (entry.since === frame) return \"new this frame\"\n if (entry.frame === frame) return \"changed this frame\"\n const age = frame - entry.frame\n return `bound at frame ${entry.frame}, ${age} frame${age === 1 ? \"\" : \"s\"} ago`\n}\n\n/**\n * Renders the panel for one frame's prompt.\n *\n * `frame` is the frame whose cell just ran, which is what `new` and `changed`\n * are relative to.\n *\n * @category conversions\n * @since 0.1.0\n */\nexport const render = (options: {\n readonly ledger: Ledger\n readonly frame: number\n}): string => {\n if (options.ledger.length === 0) {\n return \"Your realm holds no names yet. Anything a cell declares at the top level is still bound in every later cell of this run.\"\n }\n const ordered = [...options.ledger].sort((left, right) => left.frame - right.frame)\n const listed = ordered.slice(Math.max(0, ordered.length - bound))\n const uncounted = ordered.length - listed.length\n const lines = listed.map((entry) =>\n elide.head(\n `- ${entry.name} (${entry.type}${entry.size === \"\" ? \"\" : `, ${entry.size}`}) — ${marked(entry, options.frame)}`,\n CallLedger.width,\n \"the name is what recalls the value\"\n )\n )\n return [\n `Names your realm holds (${options.ledger.length}), least recently bound first. Read and compute with these instead of fetching them again:`,\n ...lines,\n ...(uncounted > 0\n ? [`- … and ${uncounted} older name${uncounted === 1 ? \"\" : \"s\"} not listed here; they are still bound.`]\n : [])\n ].join(\"\\n\")\n}\n"]}
@@ -0,0 +1,172 @@
1
+ /**
2
+ * @since 0.1.0
3
+ *
4
+ * `/harness` — built-in agent-loop translation contracts and pure
5
+ * turn helpers.
6
+ */
7
+ /**
8
+ * @category errors
9
+ * @since 0.1.0
10
+ */
11
+ export * as HarnessError from "./HarnessError.ts";
12
+ /**
13
+ * @category events
14
+ * @since 0.1.0
15
+ */
16
+ export * as AgentEvent from "./AgentEvent.ts";
17
+ /**
18
+ * @category controls
19
+ * @since 1.0.0-rc.0
20
+ */
21
+ export * as CompletionClaim from "./CompletionClaim.ts";
22
+ /**
23
+ * @category controls
24
+ * @since 1.0.0-rc.0
25
+ */
26
+ export * as Supervisor from "./Supervisor.ts";
27
+ /**
28
+ * @category controls
29
+ * @since 1.0.0-rc.0
30
+ */
31
+ export * as Monitor from "./Monitor.ts";
32
+ /**
33
+ * @category controls
34
+ * @since 1.0.0-rc.0
35
+ */
36
+ export * as Judgement from "./Judgement.ts";
37
+ /**
38
+ * @category controls
39
+ * @since 1.0.0-rc.0
40
+ */
41
+ export * as Relevance from "./Relevance.ts";
42
+ /**
43
+ * @category models
44
+ * @since 0.1.0
45
+ */
46
+ export * as Plan from "./Plan.ts";
47
+ /**
48
+ * @category services
49
+ * @since 0.1.0
50
+ */
51
+ export * as EngineLike from "./EngineLike.ts";
52
+ /**
53
+ * @category utilities
54
+ * @since 0.1.0
55
+ */
56
+ export * as Tokens from "./Tokens.ts";
57
+ /**
58
+ * @category models
59
+ * @since 0.1.0
60
+ */
61
+ export * as ContextWindow from "./ContextWindow.ts";
62
+ /**
63
+ * @category projections
64
+ * @since 0.1.0
65
+ */
66
+ export * as Transcript from "./Transcript.ts";
67
+ /**
68
+ * @category projections
69
+ * @since 1.0.0-rc.1
70
+ */
71
+ export * as ExternalTranscript from "./ExternalTranscript.ts";
72
+ /**
73
+ * @category compaction
74
+ * @since 0.1.0
75
+ */
76
+ export * as Compaction from "./Compaction.ts";
77
+ /**
78
+ * @category steering
79
+ * @since 0.1.0
80
+ */
81
+ export * as Steering from "./Steering.ts";
82
+ /**
83
+ * @category notifications
84
+ * @since 0.1.0
85
+ */
86
+ export * as Notifications from "./Notifications.ts";
87
+ /**
88
+ * @category models
89
+ * @since 0.1.0
90
+ */
91
+ export * as Cell from "./Cell.ts";
92
+ /**
93
+ * @category services
94
+ * @since 0.1.0
95
+ */
96
+ export * as Sandbox from "./Sandbox.ts";
97
+ /**
98
+ * @category streams
99
+ * @since 0.1.0
100
+ */
101
+ export * as CellTurn from "./CellTurn.ts";
102
+ /**
103
+ * @category services
104
+ * @since 0.1.0
105
+ */
106
+ export * as CellHistory from "./CellHistory.ts";
107
+ /**
108
+ * @category constructors
109
+ * @since 0.1.0
110
+ */
111
+ export * as CellCalls from "./CellCalls.ts";
112
+ /**
113
+ * @category constructors
114
+ * @since 0.1.0
115
+ */
116
+ export * as FlowBinding from "./FlowBinding.ts";
117
+ /**
118
+ * @category decoding
119
+ * @since 0.1.0
120
+ */
121
+ export * as StructuredOutput from "./StructuredOutput.ts";
122
+ /**
123
+ * @category models
124
+ * @since 0.1.0
125
+ */
126
+ export * as TruncatedOutput from "./TruncatedOutput.ts";
127
+ /**
128
+ * @category models
129
+ * @since 0.1.0
130
+ */
131
+ export * as CallLedger from "./CallLedger.ts";
132
+ /**
133
+ * @category models
134
+ * @since 0.1.0
135
+ */
136
+ export * as NarrowedCheck from "./NarrowedCheck.ts";
137
+ /**
138
+ * @category conversions
139
+ * @since 0.1.0
140
+ */
141
+ export * as CellValidation from "./CellValidation.ts";
142
+ /**
143
+ * @category models
144
+ * @since 0.1.0
145
+ */
146
+ export * as UnmovedTree from "./UnmovedTree.ts";
147
+ /**
148
+ * @category models
149
+ * @since 0.1.0
150
+ */
151
+ export * as UnresolvedFailure from "./UnresolvedFailure.ts";
152
+ /**
153
+ * @category models
154
+ * @since 1.0.0-rc.1
155
+ */
156
+ export * as FailedCall from "./FailedCall.ts";
157
+ /**
158
+ * @category models
159
+ * @since 0.1.0
160
+ */
161
+ export * as Sufficiency from "./Sufficiency.ts";
162
+ /**
163
+ * @category models
164
+ * @since 0.1.0
165
+ */
166
+ export * as VacuousVerification from "./VacuousVerification.ts";
167
+ /**
168
+ * @category models
169
+ * @since 0.1.0
170
+ */
171
+ export * as VariablesPanel from "./VariablesPanel.ts";
172
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AAEjD;;;GAGG;AACH,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAE7C;;;GAGG;AACH,OAAO,KAAK,eAAe,MAAM,sBAAsB,CAAA;AAEvD;;;GAGG;AACH,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAE7C;;;GAGG;AACH,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AAEvC;;;GAGG;AACH,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAE3C;;;GAGG;AACH,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAE3C;;;GAGG;AACH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAEjC;;;GAGG;AACH,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAE7C;;;GAGG;AACH,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AAErC;;;GAGG;AACH,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAA;AAEnD;;;GAGG;AACH,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAE7C;;;GAGG;AACH,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAA;AAE7D;;;GAGG;AACH,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAE7C;;;GAGG;AACH,OAAO,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0.1.0
10
+ */
11
+ export * as HarnessError from "./HarnessError.js";
12
+ /**
13
+ * @category events
14
+ * @since 0.1.0
15
+ */
16
+ export * as AgentEvent from "./AgentEvent.js";
17
+ /**
18
+ * @category controls
19
+ * @since 1.0.0-rc.0
20
+ */
21
+ export * as CompletionClaim from "./CompletionClaim.js";
22
+ /**
23
+ * @category controls
24
+ * @since 1.0.0-rc.0
25
+ */
26
+ export * as Supervisor from "./Supervisor.js";
27
+ /**
28
+ * @category controls
29
+ * @since 1.0.0-rc.0
30
+ */
31
+ export * as Monitor from "./Monitor.js";
32
+ /**
33
+ * @category controls
34
+ * @since 1.0.0-rc.0
35
+ */
36
+ export * as Judgement from "./Judgement.js";
37
+ /**
38
+ * @category controls
39
+ * @since 1.0.0-rc.0
40
+ */
41
+ export * as Relevance from "./Relevance.js";
42
+ /**
43
+ * @category models
44
+ * @since 0.1.0
45
+ */
46
+ export * as Plan from "./Plan.js";
47
+ /**
48
+ * @category services
49
+ * @since 0.1.0
50
+ */
51
+ export * as EngineLike from "./EngineLike.js";
52
+ /**
53
+ * @category utilities
54
+ * @since 0.1.0
55
+ */
56
+ export * as Tokens from "./Tokens.js";
57
+ /**
58
+ * @category models
59
+ * @since 0.1.0
60
+ */
61
+ export * as ContextWindow from "./ContextWindow.js";
62
+ /**
63
+ * @category projections
64
+ * @since 0.1.0
65
+ */
66
+ export * as Transcript from "./Transcript.js";
67
+ /**
68
+ * @category projections
69
+ * @since 1.0.0-rc.1
70
+ */
71
+ export * as ExternalTranscript from "./ExternalTranscript.js";
72
+ /**
73
+ * @category compaction
74
+ * @since 0.1.0
75
+ */
76
+ export * as Compaction from "./Compaction.js";
77
+ /**
78
+ * @category steering
79
+ * @since 0.1.0
80
+ */
81
+ export * as Steering from "./Steering.js";
82
+ /**
83
+ * @category notifications
84
+ * @since 0.1.0
85
+ */
86
+ export * as Notifications from "./Notifications.js";
87
+ /**
88
+ * @category models
89
+ * @since 0.1.0
90
+ */
91
+ export * as Cell from "./Cell.js";
92
+ /**
93
+ * @category services
94
+ * @since 0.1.0
95
+ */
96
+ export * as Sandbox from "./Sandbox.js";
97
+ /**
98
+ * @category streams
99
+ * @since 0.1.0
100
+ */
101
+ export * as CellTurn from "./CellTurn.js";
102
+ /**
103
+ * @category services
104
+ * @since 0.1.0
105
+ */
106
+ export * as CellHistory from "./CellHistory.js";
107
+ /**
108
+ * @category constructors
109
+ * @since 0.1.0
110
+ */
111
+ export * as CellCalls from "./CellCalls.js";
112
+ /**
113
+ * @category constructors
114
+ * @since 0.1.0
115
+ */
116
+ export * as FlowBinding from "./FlowBinding.js";
117
+ /**
118
+ * @category decoding
119
+ * @since 0.1.0
120
+ */
121
+ export * as StructuredOutput from "./StructuredOutput.js";
122
+ /**
123
+ * @category models
124
+ * @since 0.1.0
125
+ */
126
+ export * as TruncatedOutput from "./TruncatedOutput.js";
127
+ /**
128
+ * @category models
129
+ * @since 0.1.0
130
+ */
131
+ export * as CallLedger from "./CallLedger.js";
132
+ /**
133
+ * @category models
134
+ * @since 0.1.0
135
+ */
136
+ export * as NarrowedCheck from "./NarrowedCheck.js";
137
+ /**
138
+ * @category conversions
139
+ * @since 0.1.0
140
+ */
141
+ export * as CellValidation from "./CellValidation.js";
142
+ /**
143
+ * @category models
144
+ * @since 0.1.0
145
+ */
146
+ export * as UnmovedTree from "./UnmovedTree.js";
147
+ /**
148
+ * @category models
149
+ * @since 0.1.0
150
+ */
151
+ export * as UnresolvedFailure from "./UnresolvedFailure.js";
152
+ /**
153
+ * @category models
154
+ * @since 1.0.0-rc.1
155
+ */
156
+ export * as FailedCall from "./FailedCall.js";
157
+ /**
158
+ * @category models
159
+ * @since 0.1.0
160
+ */
161
+ export * as Sufficiency from "./Sufficiency.js";
162
+ /**
163
+ * @category models
164
+ * @since 0.1.0
165
+ */
166
+ export * as VacuousVerification from "./VacuousVerification.js";
167
+ /**
168
+ * @category models
169
+ * @since 0.1.0
170
+ */
171
+ export * as VariablesPanel from "./VariablesPanel.js";
172
+ //#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GG;AACH,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAE/C;;;GAGG;AACH,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAE3C;;;GAGG;AACH,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAE/C;;;GAGG;AACH,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAA;AAEzD;;;GAGG;AACH,OAAO,KAAK,eAAe,MAAM,sBAAsB,CAAA;AAEvD;;;GAGG;AACH,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAE7C;;;GAGG;AACH,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAA;AAEnD;;;GAGG;AACH,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAA;AAErD;;;GAGG;AACH,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAE/C;;;GAGG;AACH,OAAO,KAAK,iBAAiB,MAAM,wBAAwB,CAAA;AAE3D;;;GAGG;AACH,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAE7C;;;GAGG;AACH,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAE/C;;;GAGG;AACH,OAAO,KAAK,mBAAmB,MAAM,0BAA0B,CAAA;AAE/D;;;GAGG;AACH,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAA","sourcesContent":["/**\n * @since 0.1.0\n *\n * `/harness` — built-in agent-loop translation contracts and pure\n * turn helpers.\n */\n\n/**\n * @category errors\n * @since 0.1.0\n */\nexport * as HarnessError from \"./HarnessError.ts\"\n\n/**\n * @category events\n * @since 0.1.0\n */\nexport * as AgentEvent from \"./AgentEvent.ts\"\n\n/**\n * @category controls\n * @since 1.0.0-rc.0\n */\nexport * as CompletionClaim from \"./CompletionClaim.ts\"\n\n/**\n * @category controls\n * @since 1.0.0-rc.0\n */\nexport * as Supervisor from \"./Supervisor.ts\"\n\n/**\n * @category controls\n * @since 1.0.0-rc.0\n */\nexport * as Monitor from \"./Monitor.ts\"\n\n/**\n * @category controls\n * @since 1.0.0-rc.0\n */\nexport * as Judgement from \"./Judgement.ts\"\n\n/**\n * @category controls\n * @since 1.0.0-rc.0\n */\nexport * as Relevance from \"./Relevance.ts\"\n\n/**\n * @category models\n * @since 0.1.0\n */\nexport * as Plan from \"./Plan.ts\"\n\n/**\n * @category services\n * @since 0.1.0\n */\nexport * as EngineLike from \"./EngineLike.ts\"\n\n/**\n * @category utilities\n * @since 0.1.0\n */\nexport * as Tokens from \"./Tokens.ts\"\n\n/**\n * @category models\n * @since 0.1.0\n */\nexport * as ContextWindow from \"./ContextWindow.ts\"\n\n/**\n * @category projections\n * @since 0.1.0\n */\nexport * as Transcript from \"./Transcript.ts\"\n\n/**\n * @category projections\n * @since 1.0.0-rc.1\n */\nexport * as ExternalTranscript from \"./ExternalTranscript.ts\"\n\n/**\n * @category compaction\n * @since 0.1.0\n */\nexport * as Compaction from \"./Compaction.ts\"\n\n/**\n * @category steering\n * @since 0.1.0\n */\nexport * as Steering from \"./Steering.ts\"\n\n/**\n * @category notifications\n * @since 0.1.0\n */\nexport * as Notifications from \"./Notifications.ts\"\n\n/**\n * @category models\n * @since 0.1.0\n */\nexport * as Cell from \"./Cell.ts\"\n\n/**\n * @category services\n * @since 0.1.0\n */\nexport * as Sandbox from \"./Sandbox.ts\"\n\n/**\n * @category streams\n * @since 0.1.0\n */\nexport * as CellTurn from \"./CellTurn.ts\"\n\n/**\n * @category services\n * @since 0.1.0\n */\nexport * as CellHistory from \"./CellHistory.ts\"\n\n/**\n * @category constructors\n * @since 0.1.0\n */\nexport * as CellCalls from \"./CellCalls.ts\"\n\n/**\n * @category constructors\n * @since 0.1.0\n */\nexport * as FlowBinding from \"./FlowBinding.ts\"\n\n/**\n * @category decoding\n * @since 0.1.0\n */\nexport * as StructuredOutput from \"./StructuredOutput.ts\"\n\n/**\n * @category models\n * @since 0.1.0\n */\nexport * as TruncatedOutput from \"./TruncatedOutput.ts\"\n\n/**\n * @category models\n * @since 0.1.0\n */\nexport * as CallLedger from \"./CallLedger.ts\"\n\n/**\n * @category models\n * @since 0.1.0\n */\nexport * as NarrowedCheck from \"./NarrowedCheck.ts\"\n\n/**\n * @category conversions\n * @since 0.1.0\n */\nexport * as CellValidation from \"./CellValidation.ts\"\n\n/**\n * @category models\n * @since 0.1.0\n */\nexport * as UnmovedTree from \"./UnmovedTree.ts\"\n\n/**\n * @category models\n * @since 0.1.0\n */\nexport * as UnresolvedFailure from \"./UnresolvedFailure.ts\"\n\n/**\n * @category models\n * @since 1.0.0-rc.1\n */\nexport * as FailedCall from \"./FailedCall.ts\"\n\n/**\n * @category models\n * @since 0.1.0\n */\nexport * as Sufficiency from \"./Sufficiency.ts\"\n\n/**\n * @category models\n * @since 0.1.0\n */\nexport * as VacuousVerification from \"./VacuousVerification.ts\"\n\n/**\n * @category models\n * @since 0.1.0\n */\nexport * as VariablesPanel from \"./VariablesPanel.ts\"\n"]}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * UTF-8 byte measurement and boundary-safe slicing.
3
+ *
4
+ * JavaScript indexes strings in UTF-16 code units, while every bound this
5
+ * harness presents to a model and records in a journal is stated in UTF-8
6
+ * bytes. These helpers keep that unit honest without ever cutting a code point
7
+ * into an invalid string.
8
+ *
9
+ * @since 0.1.0
10
+ * @private
11
+ */
12
+ /**
13
+ * Measures a string in UTF-8 bytes.
14
+ *
15
+ * @category conversions
16
+ * @since 0.1.0
17
+ * @private
18
+ */
19
+ export declare const size: (text: string) => number;
20
+ /**
21
+ * Returns the longest code-point-aligned prefix no wider than `limit` UTF-8 bytes.
22
+ *
23
+ * @category conversions
24
+ * @since 0.1.0
25
+ * @private
26
+ */
27
+ export declare const headSlice: (text: string, limit: number) => string;
28
+ /**
29
+ * Returns the longest code-point-aligned suffix no wider than `limit` UTF-8 bytes.
30
+ *
31
+ * @category conversions
32
+ * @since 0.1.0
33
+ * @private
34
+ */
35
+ export declare const tailSlice: (text: string, limit: number) => string;
36
+ //# sourceMappingURL=bytes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bytes.d.ts","sourceRoot":"","sources":["../../../src/internal/bytes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH;;;;;;GAMG;AACH,eAAO,MAAM,IAAI,GAAI,MAAM,MAAM,KAAG,MAAyC,CAAA;AAE7E;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,KAAG,MAUvD,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,KAAG,MAoBvD,CAAA"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * UTF-8 byte measurement and boundary-safe slicing.
3
+ *
4
+ * JavaScript indexes strings in UTF-16 code units, while every bound this
5
+ * harness presents to a model and records in a journal is stated in UTF-8
6
+ * bytes. These helpers keep that unit honest without ever cutting a code point
7
+ * into an invalid string.
8
+ *
9
+ * @since 0.1.0
10
+ * @private
11
+ */
12
+ const encoder = new TextEncoder();
13
+ /**
14
+ * Measures a string in UTF-8 bytes.
15
+ *
16
+ * @category conversions
17
+ * @since 0.1.0
18
+ * @private
19
+ */
20
+ export const size = (text) => encoder.encode(text).byteLength;
21
+ /**
22
+ * Returns the longest code-point-aligned prefix no wider than `limit` UTF-8 bytes.
23
+ *
24
+ * @category conversions
25
+ * @since 0.1.0
26
+ * @private
27
+ */
28
+ export const headSlice = (text, limit) => {
29
+ let end = 0;
30
+ let used = 0;
31
+ for (const character of text) {
32
+ const next = used + size(character);
33
+ if (next > limit)
34
+ break;
35
+ used = next;
36
+ end = end + character.length;
37
+ }
38
+ return text.slice(0, end);
39
+ };
40
+ /**
41
+ * Returns the longest code-point-aligned suffix no wider than `limit` UTF-8 bytes.
42
+ *
43
+ * @category conversions
44
+ * @since 0.1.0
45
+ * @private
46
+ */
47
+ export const tailSlice = (text, limit) => {
48
+ let start = text.length;
49
+ let used = 0;
50
+ // Inspect only the suffix: a large print must not allocate an array for
51
+ // the discarded prefix or a TextEncoder buffer for each retained character.
52
+ while (start > 0) {
53
+ const last = text.charCodeAt(start - 1);
54
+ let units = 1;
55
+ if (last >= 0xdc00 && last <= 0xdfff && start > 1) {
56
+ const previous = text.charCodeAt(start - 2);
57
+ if (previous >= 0xd800 && previous <= 0xdbff)
58
+ units = 2;
59
+ }
60
+ // Lone surrogates use three UTF-8 bytes, like TextEncoder's replacement.
61
+ const width = units === 2 ? 4 : last < 0x80 ? 1 : last < 0x800 ? 2 : 3;
62
+ const next = used + width;
63
+ if (next > limit)
64
+ break;
65
+ used = next;
66
+ start = start - units;
67
+ }
68
+ return text.slice(start);
69
+ };
70
+ //# sourceMappingURL=bytes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bytes.js","sourceRoot":"","sources":["../../../src/internal/bytes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAA;AAEjC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,UAAU,CAAA;AAE7E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,IAAY,EAAE,KAAa,EAAU,EAAE;IAC/D,IAAI,GAAG,GAAG,CAAC,CAAA;IACX,IAAI,IAAI,GAAG,CAAC,CAAA;IACZ,KAAK,MAAM,SAAS,IAAI,IAAI,EAAE,CAAC;QAC7B,MAAM,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,CAAA;QACnC,IAAI,IAAI,GAAG,KAAK;YAAE,MAAK;QACvB,IAAI,GAAG,IAAI,CAAA;QACX,GAAG,GAAG,GAAG,GAAG,SAAS,CAAC,MAAM,CAAA;IAC9B,CAAC;IACD,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;AAC3B,CAAC,CAAA;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,IAAY,EAAE,KAAa,EAAU,EAAE;IAC/D,IAAI,KAAK,GAAG,IAAI,CAAC,MAAM,CAAA;IACvB,IAAI,IAAI,GAAG,CAAC,CAAA;IACZ,wEAAwE;IACxE,4EAA4E;IAC5E,OAAO,KAAK,GAAG,CAAC,EAAE,CAAC;QACjB,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,GAAG,CAAC,CAAC,CAAA;QACvC,IAAI,KAAK,GAAG,CAAC,CAAA;QACb,IAAI,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;YAClD,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,GAAG,CAAC,CAAC,CAAA;YAC3C,IAAI,QAAQ,IAAI,MAAM,IAAI,QAAQ,IAAI,MAAM;gBAAE,KAAK,GAAG,CAAC,CAAA;QACzD,CAAC;QACD,yEAAyE;QACzE,MAAM,KAAK,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QACtE,MAAM,IAAI,GAAG,IAAI,GAAG,KAAK,CAAA;QACzB,IAAI,IAAI,GAAG,KAAK;YAAE,MAAK;QACvB,IAAI,GAAG,IAAI,CAAA;QACX,KAAK,GAAG,KAAK,GAAG,KAAK,CAAA;IACvB,CAAC;IACD,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;AAC1B,CAAC,CAAA","sourcesContent":["/**\n * UTF-8 byte measurement and boundary-safe slicing.\n *\n * JavaScript indexes strings in UTF-16 code units, while every bound this\n * harness presents to a model and records in a journal is stated in UTF-8\n * bytes. These helpers keep that unit honest without ever cutting a code point\n * into an invalid string.\n *\n * @since 0.1.0\n * @private\n */\n\nconst encoder = new TextEncoder()\n\n/**\n * Measures a string in UTF-8 bytes.\n *\n * @category conversions\n * @since 0.1.0\n * @private\n */\nexport const size = (text: string): number => encoder.encode(text).byteLength\n\n/**\n * Returns the longest code-point-aligned prefix no wider than `limit` UTF-8 bytes.\n *\n * @category conversions\n * @since 0.1.0\n * @private\n */\nexport const headSlice = (text: string, limit: number): string => {\n let end = 0\n let used = 0\n for (const character of text) {\n const next = used + size(character)\n if (next > limit) break\n used = next\n end = end + character.length\n }\n return text.slice(0, end)\n}\n\n/**\n * Returns the longest code-point-aligned suffix no wider than `limit` UTF-8 bytes.\n *\n * @category conversions\n * @since 0.1.0\n * @private\n */\nexport const tailSlice = (text: string, limit: number): string => {\n let start = text.length\n let used = 0\n // Inspect only the suffix: a large print must not allocate an array for\n // the discarded prefix or a TextEncoder buffer for each retained character.\n while (start > 0) {\n const last = text.charCodeAt(start - 1)\n let units = 1\n if (last >= 0xdc00 && last <= 0xdfff && start > 1) {\n const previous = text.charCodeAt(start - 2)\n if (previous >= 0xd800 && previous <= 0xdbff) units = 2\n }\n // Lone surrogates use three UTF-8 bytes, like TextEncoder's replacement.\n const width = units === 2 ? 4 : last < 0x80 ? 1 : last < 0x800 ? 2 : 3\n const next = used + width\n if (next > limit) break\n used = next\n start = start - units\n }\n return text.slice(start)\n}\n"]}