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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (476) hide show
  1. package/CHANGELOG.md +387 -0
  2. package/LICENSE +21 -0
  3. package/README.md +138 -2
  4. package/dist/cjs/AgentEvent.d.ts +3092 -0
  5. package/dist/cjs/AgentEvent.d.ts.map +1 -0
  6. package/dist/cjs/AgentEvent.js +1116 -0
  7. package/dist/cjs/AgentEvent.js.map +7 -0
  8. package/dist/cjs/CallLedger.d.ts +378 -0
  9. package/dist/cjs/CallLedger.d.ts.map +1 -0
  10. package/dist/cjs/CallLedger.js +240 -0
  11. package/dist/cjs/CallLedger.js.map +7 -0
  12. package/dist/cjs/Cell.d.ts +774 -0
  13. package/dist/cjs/Cell.d.ts.map +1 -0
  14. package/dist/cjs/Cell.js +431 -0
  15. package/dist/cjs/Cell.js.map +7 -0
  16. package/dist/cjs/CellCalls.d.ts +115 -0
  17. package/dist/cjs/CellCalls.d.ts.map +1 -0
  18. package/dist/cjs/CellCalls.js +98 -0
  19. package/dist/cjs/CellCalls.js.map +7 -0
  20. package/dist/cjs/CellHistory.d.ts +102 -0
  21. package/dist/cjs/CellHistory.d.ts.map +1 -0
  22. package/dist/cjs/CellHistory.js +54 -0
  23. package/dist/cjs/CellHistory.js.map +7 -0
  24. package/dist/cjs/CellTurn.d.ts +1071 -0
  25. package/dist/cjs/CellTurn.d.ts.map +1 -0
  26. package/dist/cjs/CellTurn.js +2618 -0
  27. package/dist/cjs/CellTurn.js.map +7 -0
  28. package/dist/cjs/CellValidation.d.ts +94 -0
  29. package/dist/cjs/CellValidation.d.ts.map +1 -0
  30. package/dist/cjs/CellValidation.js +218 -0
  31. package/dist/cjs/CellValidation.js.map +7 -0
  32. package/dist/cjs/Compaction.d.ts +158 -0
  33. package/dist/cjs/Compaction.d.ts.map +1 -0
  34. package/dist/cjs/Compaction.js +189 -0
  35. package/dist/cjs/Compaction.js.map +7 -0
  36. package/dist/cjs/CompletionClaim.d.ts +801 -0
  37. package/dist/cjs/CompletionClaim.d.ts.map +1 -0
  38. package/dist/cjs/CompletionClaim.js +303 -0
  39. package/dist/cjs/CompletionClaim.js.map +7 -0
  40. package/dist/cjs/ContextWindow.d.ts +435 -0
  41. package/dist/cjs/ContextWindow.d.ts.map +1 -0
  42. package/dist/cjs/ContextWindow.js +319 -0
  43. package/dist/cjs/ContextWindow.js.map +7 -0
  44. package/dist/cjs/EngineLike.d.ts +546 -0
  45. package/dist/cjs/EngineLike.d.ts.map +1 -0
  46. package/dist/cjs/EngineLike.js +114 -0
  47. package/dist/cjs/EngineLike.js.map +7 -0
  48. package/dist/cjs/ExternalTranscript.d.ts +349 -0
  49. package/dist/cjs/ExternalTranscript.d.ts.map +1 -0
  50. package/dist/cjs/ExternalTranscript.js +826 -0
  51. package/dist/cjs/ExternalTranscript.js.map +7 -0
  52. package/dist/cjs/FailedCall.d.ts +132 -0
  53. package/dist/cjs/FailedCall.d.ts.map +1 -0
  54. package/dist/cjs/FailedCall.js +53 -0
  55. package/dist/cjs/FailedCall.js.map +7 -0
  56. package/dist/cjs/FlowBinding.d.ts +289 -0
  57. package/dist/cjs/FlowBinding.d.ts.map +1 -0
  58. package/dist/cjs/FlowBinding.js +251 -0
  59. package/dist/cjs/FlowBinding.js.map +7 -0
  60. package/dist/cjs/HarnessError.d.ts +57 -0
  61. package/dist/cjs/HarnessError.d.ts.map +1 -0
  62. package/dist/cjs/HarnessError.js +75 -0
  63. package/dist/cjs/HarnessError.js.map +7 -0
  64. package/dist/cjs/Judgement.d.ts +289 -0
  65. package/dist/cjs/Judgement.d.ts.map +1 -0
  66. package/dist/cjs/Judgement.js +240 -0
  67. package/dist/cjs/Judgement.js.map +7 -0
  68. package/dist/cjs/Monitor.d.ts +374 -0
  69. package/dist/cjs/Monitor.d.ts.map +1 -0
  70. package/dist/cjs/Monitor.js +233 -0
  71. package/dist/cjs/Monitor.js.map +7 -0
  72. package/dist/cjs/NarrowedCheck.d.ts +523 -0
  73. package/dist/cjs/NarrowedCheck.d.ts.map +1 -0
  74. package/dist/cjs/NarrowedCheck.js +263 -0
  75. package/dist/cjs/NarrowedCheck.js.map +7 -0
  76. package/dist/cjs/Notifications.d.ts +42 -0
  77. package/dist/cjs/Notifications.d.ts.map +1 -0
  78. package/dist/cjs/Notifications.js +177 -0
  79. package/dist/cjs/Notifications.js.map +7 -0
  80. package/dist/cjs/Plan.d.ts +127 -0
  81. package/dist/cjs/Plan.d.ts.map +1 -0
  82. package/dist/cjs/Plan.js +77 -0
  83. package/dist/cjs/Plan.js.map +7 -0
  84. package/dist/cjs/QuickJSSandbox.d.ts +151 -0
  85. package/dist/cjs/QuickJSSandbox.d.ts.map +1 -0
  86. package/dist/cjs/QuickJSSandbox.js +987 -0
  87. package/dist/cjs/QuickJSSandbox.js.map +7 -0
  88. package/dist/cjs/Relevance.d.ts +213 -0
  89. package/dist/cjs/Relevance.d.ts.map +1 -0
  90. package/dist/cjs/Relevance.js +183 -0
  91. package/dist/cjs/Relevance.js.map +7 -0
  92. package/dist/cjs/Sandbox.d.ts +637 -0
  93. package/dist/cjs/Sandbox.d.ts.map +1 -0
  94. package/dist/cjs/Sandbox.js +260 -0
  95. package/dist/cjs/Sandbox.js.map +7 -0
  96. package/dist/cjs/Steering.d.ts +464 -0
  97. package/dist/cjs/Steering.d.ts.map +1 -0
  98. package/dist/cjs/Steering.js +153 -0
  99. package/dist/cjs/Steering.js.map +7 -0
  100. package/dist/cjs/StructuredOutput.d.ts +252 -0
  101. package/dist/cjs/StructuredOutput.d.ts.map +1 -0
  102. package/dist/cjs/StructuredOutput.js +266 -0
  103. package/dist/cjs/StructuredOutput.js.map +7 -0
  104. package/dist/cjs/Sufficiency.d.ts +195 -0
  105. package/dist/cjs/Sufficiency.d.ts.map +1 -0
  106. package/dist/cjs/Sufficiency.js +110 -0
  107. package/dist/cjs/Sufficiency.js.map +7 -0
  108. package/dist/cjs/Supervisor.d.ts +719 -0
  109. package/dist/cjs/Supervisor.d.ts.map +1 -0
  110. package/dist/cjs/Supervisor.js +313 -0
  111. package/dist/cjs/Supervisor.js.map +7 -0
  112. package/dist/cjs/Tokens.d.ts +86 -0
  113. package/dist/cjs/Tokens.d.ts.map +1 -0
  114. package/dist/cjs/Tokens.js +72 -0
  115. package/dist/cjs/Tokens.js.map +7 -0
  116. package/dist/cjs/Transcript.d.ts +171 -0
  117. package/dist/cjs/Transcript.d.ts.map +1 -0
  118. package/dist/cjs/Transcript.js +342 -0
  119. package/dist/cjs/Transcript.js.map +7 -0
  120. package/dist/cjs/TruncatedOutput.d.ts +186 -0
  121. package/dist/cjs/TruncatedOutput.d.ts.map +1 -0
  122. package/dist/cjs/TruncatedOutput.js +143 -0
  123. package/dist/cjs/TruncatedOutput.js.map +7 -0
  124. package/dist/cjs/UnmovedTree.d.ts +113 -0
  125. package/dist/cjs/UnmovedTree.d.ts.map +1 -0
  126. package/dist/cjs/UnmovedTree.js +38 -0
  127. package/dist/cjs/UnmovedTree.js.map +7 -0
  128. package/dist/cjs/UnresolvedFailure.d.ts +196 -0
  129. package/dist/cjs/UnresolvedFailure.d.ts.map +1 -0
  130. package/dist/cjs/UnresolvedFailure.js +77 -0
  131. package/dist/cjs/UnresolvedFailure.js.map +7 -0
  132. package/dist/cjs/VacuousVerification.d.ts +237 -0
  133. package/dist/cjs/VacuousVerification.d.ts.map +1 -0
  134. package/dist/cjs/VacuousVerification.js +91 -0
  135. package/dist/cjs/VacuousVerification.js.map +7 -0
  136. package/dist/cjs/VariablesPanel.d.ts +117 -0
  137. package/dist/cjs/VariablesPanel.d.ts.map +1 -0
  138. package/dist/cjs/VariablesPanel.js +108 -0
  139. package/dist/cjs/VariablesPanel.js.map +7 -0
  140. package/dist/cjs/index.d.ts +172 -0
  141. package/dist/cjs/index.d.ts.map +1 -0
  142. package/dist/cjs/index.js +99 -0
  143. package/dist/cjs/index.js.map +7 -0
  144. package/dist/cjs/internal/bytes.d.ts +36 -0
  145. package/dist/cjs/internal/bytes.d.ts.map +1 -0
  146. package/dist/cjs/internal/bytes.js +57 -0
  147. package/dist/cjs/internal/bytes.js.map +7 -0
  148. package/dist/cjs/internal/cellPrompt.d.ts +122 -0
  149. package/dist/cjs/internal/cellPrompt.d.ts.map +1 -0
  150. package/dist/cjs/internal/cellPrompt.js +146 -0
  151. package/dist/cjs/internal/cellPrompt.js.map +7 -0
  152. package/dist/cjs/internal/compactable.d.ts +44 -0
  153. package/dist/cjs/internal/compactable.d.ts.map +1 -0
  154. package/dist/cjs/internal/compactable.js +56 -0
  155. package/dist/cjs/internal/compactable.js.map +7 -0
  156. package/dist/cjs/internal/compactionMarks.d.ts +278 -0
  157. package/dist/cjs/internal/compactionMarks.d.ts.map +1 -0
  158. package/dist/cjs/internal/compactionMarks.js +212 -0
  159. package/dist/cjs/internal/compactionMarks.js.map +7 -0
  160. package/dist/cjs/internal/demandText.d.ts +95 -0
  161. package/dist/cjs/internal/demandText.d.ts.map +1 -0
  162. package/dist/cjs/internal/demandText.js +70 -0
  163. package/dist/cjs/internal/demandText.js.map +7 -0
  164. package/dist/cjs/internal/elide.d.ts +109 -0
  165. package/dist/cjs/internal/elide.d.ts.map +1 -0
  166. package/dist/cjs/internal/elide.js +59 -0
  167. package/dist/cjs/internal/elide.js.map +7 -0
  168. package/dist/cjs/internal/frame.d.ts +463 -0
  169. package/dist/cjs/internal/frame.d.ts.map +1 -0
  170. package/dist/cjs/internal/frame.js +514 -0
  171. package/dist/cjs/internal/frame.js.map +7 -0
  172. package/dist/cjs/internal/nonNegativeSafeInt.d.ts +20 -0
  173. package/dist/cjs/internal/nonNegativeSafeInt.d.ts.map +1 -0
  174. package/dist/cjs/internal/nonNegativeSafeInt.js +29 -0
  175. package/dist/cjs/internal/nonNegativeSafeInt.js.map +7 -0
  176. package/dist/cjs/internal/paidUsage.d.ts +52 -0
  177. package/dist/cjs/internal/paidUsage.d.ts.map +1 -0
  178. package/dist/cjs/internal/paidUsage.js +70 -0
  179. package/dist/cjs/internal/paidUsage.js.map +7 -0
  180. package/dist/cjs/internal/printChannel.d.ts +233 -0
  181. package/dist/cjs/internal/printChannel.d.ts.map +1 -0
  182. package/dist/cjs/internal/printChannel.js +165 -0
  183. package/dist/cjs/internal/printChannel.js.map +7 -0
  184. package/dist/cjs/internal/printsObservation.d.ts +26 -0
  185. package/dist/cjs/internal/printsObservation.d.ts.map +1 -0
  186. package/dist/cjs/internal/printsObservation.js +27 -0
  187. package/dist/cjs/internal/printsObservation.js.map +7 -0
  188. package/dist/cjs/internal/refusal.d.ts +40 -0
  189. package/dist/cjs/internal/refusal.d.ts.map +1 -0
  190. package/dist/cjs/internal/refusal.js +45 -0
  191. package/dist/cjs/internal/refusal.js.map +7 -0
  192. package/dist/cjs/internal/supervision.d.ts +174 -0
  193. package/dist/cjs/internal/supervision.d.ts.map +1 -0
  194. package/dist/cjs/internal/supervision.js +402 -0
  195. package/dist/cjs/internal/supervision.js.map +7 -0
  196. package/dist/cjs/internal/unfinishedWork.d.ts +99 -0
  197. package/dist/cjs/internal/unfinishedWork.d.ts.map +1 -0
  198. package/dist/cjs/internal/unfinishedWork.js +80 -0
  199. package/dist/cjs/internal/unfinishedWork.js.map +7 -0
  200. package/dist/cjs/internal/unobservedCall.d.ts +112 -0
  201. package/dist/cjs/internal/unobservedCall.d.ts.map +1 -0
  202. package/dist/cjs/internal/unobservedCall.js +345 -0
  203. package/dist/cjs/internal/unobservedCall.js.map +7 -0
  204. package/dist/cjs/internal/untrustedData.d.ts +14 -0
  205. package/dist/cjs/internal/untrustedData.d.ts.map +1 -0
  206. package/dist/cjs/internal/untrustedData.js +30 -0
  207. package/dist/cjs/internal/untrustedData.js.map +7 -0
  208. package/dist/cjs/package.json +1 -0
  209. package/dist/esm/AgentEvent.d.ts +3092 -0
  210. package/dist/esm/AgentEvent.d.ts.map +1 -0
  211. package/dist/esm/AgentEvent.js +1610 -0
  212. package/dist/esm/AgentEvent.js.map +1 -0
  213. package/dist/esm/CallLedger.d.ts +378 -0
  214. package/dist/esm/CallLedger.d.ts.map +1 -0
  215. package/dist/esm/CallLedger.js +506 -0
  216. package/dist/esm/CallLedger.js.map +1 -0
  217. package/dist/esm/Cell.d.ts +774 -0
  218. package/dist/esm/Cell.d.ts.map +1 -0
  219. package/dist/esm/Cell.js +772 -0
  220. package/dist/esm/Cell.js.map +1 -0
  221. package/dist/esm/CellCalls.d.ts +115 -0
  222. package/dist/esm/CellCalls.d.ts.map +1 -0
  223. package/dist/esm/CellCalls.js +97 -0
  224. package/dist/esm/CellCalls.js.map +1 -0
  225. package/dist/esm/CellHistory.d.ts +102 -0
  226. package/dist/esm/CellHistory.d.ts.map +1 -0
  227. package/dist/esm/CellHistory.js +91 -0
  228. package/dist/esm/CellHistory.js.map +1 -0
  229. package/dist/esm/CellTurn.d.ts +1071 -0
  230. package/dist/esm/CellTurn.d.ts.map +1 -0
  231. package/dist/esm/CellTurn.js +3410 -0
  232. package/dist/esm/CellTurn.js.map +1 -0
  233. package/dist/esm/CellValidation.d.ts +94 -0
  234. package/dist/esm/CellValidation.d.ts.map +1 -0
  235. package/dist/esm/CellValidation.js +335 -0
  236. package/dist/esm/CellValidation.js.map +1 -0
  237. package/dist/esm/Compaction.d.ts +158 -0
  238. package/dist/esm/Compaction.d.ts.map +1 -0
  239. package/dist/esm/Compaction.js +216 -0
  240. package/dist/esm/Compaction.js.map +1 -0
  241. package/dist/esm/CompletionClaim.d.ts +801 -0
  242. package/dist/esm/CompletionClaim.d.ts.map +1 -0
  243. package/dist/esm/CompletionClaim.js +833 -0
  244. package/dist/esm/CompletionClaim.js.map +1 -0
  245. package/dist/esm/ContextWindow.d.ts +435 -0
  246. package/dist/esm/ContextWindow.d.ts.map +1 -0
  247. package/dist/esm/ContextWindow.js +427 -0
  248. package/dist/esm/ContextWindow.js.map +1 -0
  249. package/dist/esm/EngineLike.d.ts +546 -0
  250. package/dist/esm/EngineLike.d.ts.map +1 -0
  251. package/dist/esm/EngineLike.js +218 -0
  252. package/dist/esm/EngineLike.js.map +1 -0
  253. package/dist/esm/ExternalTranscript.d.ts +349 -0
  254. package/dist/esm/ExternalTranscript.d.ts.map +1 -0
  255. package/dist/esm/ExternalTranscript.js +985 -0
  256. package/dist/esm/ExternalTranscript.js.map +1 -0
  257. package/dist/esm/FailedCall.d.ts +132 -0
  258. package/dist/esm/FailedCall.d.ts.map +1 -0
  259. package/dist/esm/FailedCall.js +131 -0
  260. package/dist/esm/FailedCall.js.map +1 -0
  261. package/dist/esm/FlowBinding.d.ts +289 -0
  262. package/dist/esm/FlowBinding.d.ts.map +1 -0
  263. package/dist/esm/FlowBinding.js +376 -0
  264. package/dist/esm/FlowBinding.js.map +1 -0
  265. package/dist/esm/HarnessError.d.ts +57 -0
  266. package/dist/esm/HarnessError.d.ts.map +1 -0
  267. package/dist/esm/HarnessError.js +85 -0
  268. package/dist/esm/HarnessError.js.map +1 -0
  269. package/dist/esm/Judgement.d.ts +289 -0
  270. package/dist/esm/Judgement.d.ts.map +1 -0
  271. package/dist/esm/Judgement.js +305 -0
  272. package/dist/esm/Judgement.js.map +1 -0
  273. package/dist/esm/Monitor.d.ts +374 -0
  274. package/dist/esm/Monitor.d.ts.map +1 -0
  275. package/dist/esm/Monitor.js +370 -0
  276. package/dist/esm/Monitor.js.map +1 -0
  277. package/dist/esm/NarrowedCheck.d.ts +523 -0
  278. package/dist/esm/NarrowedCheck.d.ts.map +1 -0
  279. package/dist/esm/NarrowedCheck.js +612 -0
  280. package/dist/esm/NarrowedCheck.js.map +1 -0
  281. package/dist/esm/Notifications.d.ts +42 -0
  282. package/dist/esm/Notifications.d.ts.map +1 -0
  283. package/dist/esm/Notifications.js +215 -0
  284. package/dist/esm/Notifications.js.map +1 -0
  285. package/dist/esm/Plan.d.ts +127 -0
  286. package/dist/esm/Plan.d.ts.map +1 -0
  287. package/dist/esm/Plan.js +97 -0
  288. package/dist/esm/Plan.js.map +1 -0
  289. package/dist/esm/QuickJSSandbox.d.ts +151 -0
  290. package/dist/esm/QuickJSSandbox.d.ts.map +1 -0
  291. package/dist/esm/QuickJSSandbox.js +1364 -0
  292. package/dist/esm/QuickJSSandbox.js.map +1 -0
  293. package/dist/esm/Relevance.d.ts +213 -0
  294. package/dist/esm/Relevance.d.ts.map +1 -0
  295. package/dist/esm/Relevance.js +254 -0
  296. package/dist/esm/Relevance.js.map +1 -0
  297. package/dist/esm/Sandbox.d.ts +637 -0
  298. package/dist/esm/Sandbox.d.ts.map +1 -0
  299. package/dist/esm/Sandbox.js +464 -0
  300. package/dist/esm/Sandbox.js.map +1 -0
  301. package/dist/esm/Steering.d.ts +464 -0
  302. package/dist/esm/Steering.d.ts.map +1 -0
  303. package/dist/esm/Steering.js +193 -0
  304. package/dist/esm/Steering.js.map +1 -0
  305. package/dist/esm/StructuredOutput.d.ts +252 -0
  306. package/dist/esm/StructuredOutput.d.ts.map +1 -0
  307. package/dist/esm/StructuredOutput.js +430 -0
  308. package/dist/esm/StructuredOutput.js.map +1 -0
  309. package/dist/esm/Sufficiency.d.ts +195 -0
  310. package/dist/esm/Sufficiency.d.ts.map +1 -0
  311. package/dist/esm/Sufficiency.js +207 -0
  312. package/dist/esm/Sufficiency.js.map +1 -0
  313. package/dist/esm/Supervisor.d.ts +719 -0
  314. package/dist/esm/Supervisor.d.ts.map +1 -0
  315. package/dist/esm/Supervisor.js +575 -0
  316. package/dist/esm/Supervisor.js.map +1 -0
  317. package/dist/esm/Tokens.d.ts +86 -0
  318. package/dist/esm/Tokens.d.ts.map +1 -0
  319. package/dist/esm/Tokens.js +92 -0
  320. package/dist/esm/Tokens.js.map +1 -0
  321. package/dist/esm/Transcript.d.ts +171 -0
  322. package/dist/esm/Transcript.d.ts.map +1 -0
  323. package/dist/esm/Transcript.js +424 -0
  324. package/dist/esm/Transcript.js.map +1 -0
  325. package/dist/esm/TruncatedOutput.d.ts +186 -0
  326. package/dist/esm/TruncatedOutput.d.ts.map +1 -0
  327. package/dist/esm/TruncatedOutput.js +257 -0
  328. package/dist/esm/TruncatedOutput.js.map +1 -0
  329. package/dist/esm/UnmovedTree.d.ts +113 -0
  330. package/dist/esm/UnmovedTree.d.ts.map +1 -0
  331. package/dist/esm/UnmovedTree.js +90 -0
  332. package/dist/esm/UnmovedTree.js.map +1 -0
  333. package/dist/esm/UnresolvedFailure.d.ts +196 -0
  334. package/dist/esm/UnresolvedFailure.d.ts.map +1 -0
  335. package/dist/esm/UnresolvedFailure.js +218 -0
  336. package/dist/esm/UnresolvedFailure.js.map +1 -0
  337. package/dist/esm/VacuousVerification.d.ts +237 -0
  338. package/dist/esm/VacuousVerification.d.ts.map +1 -0
  339. package/dist/esm/VacuousVerification.js +245 -0
  340. package/dist/esm/VacuousVerification.js.map +1 -0
  341. package/dist/esm/VariablesPanel.d.ts +117 -0
  342. package/dist/esm/VariablesPanel.d.ts.map +1 -0
  343. package/dist/esm/VariablesPanel.js +142 -0
  344. package/dist/esm/VariablesPanel.js.map +1 -0
  345. package/dist/esm/index.d.ts +172 -0
  346. package/dist/esm/index.d.ts.map +1 -0
  347. package/dist/esm/index.js +172 -0
  348. package/dist/esm/index.js.map +1 -0
  349. package/dist/esm/internal/bytes.d.ts +36 -0
  350. package/dist/esm/internal/bytes.d.ts.map +1 -0
  351. package/dist/esm/internal/bytes.js +70 -0
  352. package/dist/esm/internal/bytes.js.map +1 -0
  353. package/dist/esm/internal/cellPrompt.d.ts +122 -0
  354. package/dist/esm/internal/cellPrompt.d.ts.map +1 -0
  355. package/dist/esm/internal/cellPrompt.js +276 -0
  356. package/dist/esm/internal/cellPrompt.js.map +1 -0
  357. package/dist/esm/internal/compactable.d.ts +44 -0
  358. package/dist/esm/internal/compactable.d.ts.map +1 -0
  359. package/dist/esm/internal/compactable.js +71 -0
  360. package/dist/esm/internal/compactable.js.map +1 -0
  361. package/dist/esm/internal/compactionMarks.d.ts +278 -0
  362. package/dist/esm/internal/compactionMarks.d.ts.map +1 -0
  363. package/dist/esm/internal/compactionMarks.js +317 -0
  364. package/dist/esm/internal/compactionMarks.js.map +1 -0
  365. package/dist/esm/internal/demandText.d.ts +95 -0
  366. package/dist/esm/internal/demandText.d.ts.map +1 -0
  367. package/dist/esm/internal/demandText.js +128 -0
  368. package/dist/esm/internal/demandText.js.map +1 -0
  369. package/dist/esm/internal/elide.d.ts +109 -0
  370. package/dist/esm/internal/elide.d.ts.map +1 -0
  371. package/dist/esm/internal/elide.js +123 -0
  372. package/dist/esm/internal/elide.js.map +1 -0
  373. package/dist/esm/internal/frame.d.ts +463 -0
  374. package/dist/esm/internal/frame.d.ts.map +1 -0
  375. package/dist/esm/internal/frame.js +861 -0
  376. package/dist/esm/internal/frame.js.map +1 -0
  377. package/dist/esm/internal/nonNegativeSafeInt.d.ts +20 -0
  378. package/dist/esm/internal/nonNegativeSafeInt.d.ts.map +1 -0
  379. package/dist/esm/internal/nonNegativeSafeInt.js +20 -0
  380. package/dist/esm/internal/nonNegativeSafeInt.js.map +1 -0
  381. package/dist/esm/internal/paidUsage.d.ts +52 -0
  382. package/dist/esm/internal/paidUsage.d.ts.map +1 -0
  383. package/dist/esm/internal/paidUsage.js +72 -0
  384. package/dist/esm/internal/paidUsage.js.map +1 -0
  385. package/dist/esm/internal/printChannel.d.ts +233 -0
  386. package/dist/esm/internal/printChannel.d.ts.map +1 -0
  387. package/dist/esm/internal/printChannel.js +376 -0
  388. package/dist/esm/internal/printChannel.js.map +1 -0
  389. package/dist/esm/internal/printsObservation.d.ts +26 -0
  390. package/dist/esm/internal/printsObservation.d.ts.map +1 -0
  391. package/dist/esm/internal/printsObservation.js +29 -0
  392. package/dist/esm/internal/printsObservation.js.map +1 -0
  393. package/dist/esm/internal/refusal.d.ts +40 -0
  394. package/dist/esm/internal/refusal.d.ts.map +1 -0
  395. package/dist/esm/internal/refusal.js +47 -0
  396. package/dist/esm/internal/refusal.js.map +1 -0
  397. package/dist/esm/internal/supervision.d.ts +174 -0
  398. package/dist/esm/internal/supervision.d.ts.map +1 -0
  399. package/dist/esm/internal/supervision.js +485 -0
  400. package/dist/esm/internal/supervision.js.map +1 -0
  401. package/dist/esm/internal/unfinishedWork.d.ts +99 -0
  402. package/dist/esm/internal/unfinishedWork.d.ts.map +1 -0
  403. package/dist/esm/internal/unfinishedWork.js +85 -0
  404. package/dist/esm/internal/unfinishedWork.js.map +1 -0
  405. package/dist/esm/internal/unobservedCall.d.ts +112 -0
  406. package/dist/esm/internal/unobservedCall.d.ts.map +1 -0
  407. package/dist/esm/internal/unobservedCall.js +501 -0
  408. package/dist/esm/internal/unobservedCall.js.map +1 -0
  409. package/dist/esm/internal/untrustedData.d.ts +14 -0
  410. package/dist/esm/internal/untrustedData.d.ts.map +1 -0
  411. package/dist/esm/internal/untrustedData.js +15 -0
  412. package/dist/esm/internal/untrustedData.js.map +1 -0
  413. package/docs/README.md +129 -0
  414. package/docs/api.md +1869 -0
  415. package/docs/concepts.md +238 -0
  416. package/docs/external-transcripts.md +245 -0
  417. package/docs/guides/bind-flows.md +167 -0
  418. package/docs/guides/drive-the-loop.md +265 -0
  419. package/docs/guides/run-cells.md +262 -0
  420. package/docs/guides/workerd.md +144 -0
  421. package/docs/installation.md +69 -0
  422. package/docs/quickstart.md +121 -0
  423. package/docs/reference.md +954 -0
  424. package/docs/troubleshooting.md +177 -0
  425. package/package.json +463 -3
  426. package/src/AgentEvent.ts +1772 -0
  427. package/src/CallLedger.ts +560 -0
  428. package/src/Cell.ts +926 -0
  429. package/src/CellCalls.ts +198 -0
  430. package/src/CellHistory.ts +128 -0
  431. package/src/CellTurn.ts +4450 -0
  432. package/src/CellValidation.ts +382 -0
  433. package/src/Compaction.ts +330 -0
  434. package/src/CompletionClaim.ts +1013 -0
  435. package/src/ContextWindow.ts +669 -0
  436. package/src/EngineLike.ts +614 -0
  437. package/src/ExternalTranscript.ts +1142 -0
  438. package/src/FailedCall.ts +163 -0
  439. package/src/FlowBinding.ts +603 -0
  440. package/src/HarnessError.ts +98 -0
  441. package/src/Judgement.ts +526 -0
  442. package/src/Monitor.ts +579 -0
  443. package/src/NarrowedCheck.ts +694 -0
  444. package/src/Notifications.ts +262 -0
  445. package/src/Plan.ts +113 -0
  446. package/src/QuickJSSandbox.ts +1557 -0
  447. package/src/Relevance.ts +352 -0
  448. package/src/Sandbox.ts +908 -0
  449. package/src/Steering.ts +405 -0
  450. package/src/StructuredOutput.ts +484 -0
  451. package/src/Sufficiency.ts +247 -0
  452. package/src/Supervisor.ts +798 -0
  453. package/src/Tokens.ts +108 -0
  454. package/src/Transcript.ts +513 -0
  455. package/src/TruncatedOutput.ts +297 -0
  456. package/src/UnmovedTree.ts +121 -0
  457. package/src/UnresolvedFailure.ts +240 -0
  458. package/src/VacuousVerification.ts +280 -0
  459. package/src/VariablesPanel.ts +165 -0
  460. package/src/index.ts +204 -0
  461. package/src/internal/bytes.ts +70 -0
  462. package/src/internal/cellPrompt.ts +337 -0
  463. package/src/internal/compactable.ts +76 -0
  464. package/src/internal/compactionMarks.ts +454 -0
  465. package/src/internal/demandText.ts +145 -0
  466. package/src/internal/elide.ts +130 -0
  467. package/src/internal/frame.ts +1178 -0
  468. package/src/internal/nonNegativeSafeInt.ts +24 -0
  469. package/src/internal/paidUsage.ts +90 -0
  470. package/src/internal/printChannel.ts +434 -0
  471. package/src/internal/printsObservation.ts +31 -0
  472. package/src/internal/refusal.ts +53 -0
  473. package/src/internal/supervision.ts +652 -0
  474. package/src/internal/unfinishedWork.ts +123 -0
  475. package/src/internal/unobservedCall.ts +536 -0
  476. package/src/internal/untrustedData.ts +19 -0
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var demandText_exports = {};
20
+ __export(demandText_exports, {
21
+ claim: () => claim,
22
+ narrowOnly: () => narrowOnly,
23
+ narrowed: () => narrowed,
24
+ readOnly: () => readOnly,
25
+ repeat: () => repeat,
26
+ unmoved: () => unmoved,
27
+ unresolved: () => unresolved
28
+ });
29
+ module.exports = __toCommonJS(demandText_exports);
30
+ const readOnly = (cap, frames) => `Read-only discipline \u2014 ${frames} consecutive frames have made no call that declares a write, and this run's read-only budget is ${cap}. If the current request is already answered, call ctx.done(answer) now. A conversational or read-only answer needs no invented edit or command. If a workspace change is still required, land an edit you can already name the evidence for \u2014 the file, the change, and the check you have watched fail that will now pass. If more evidence is needed, call ctx.justify("<the evidence you are still missing, the exact call that will get it, and what that makes the next frames do differently from these ${frames}>"). Do not write something merely to answer this notice. A restore, a revert, an overwrite from captured output, or any edit whose evidence you cannot name is worse than another read-only frame, because it destroys work this run has already done. A justification is recorded and buys ${cap} quiet frames; it does not reset this counter, and one that names the same next step the last quiet frame named has bought a repeat of that frame. At ${cap * 2} consecutive read-only frames the run stops as a failure, so ${cap * 2 - frames} frames remain to answer the request or make the required change.`;
31
+ const repeat = (frames, cap) => `Repeated observation \u2014 the last ${frames} frames issued only calls this run had already issued, byte for byte, and none of them changed the workspace. You are re-confirming what you already know: a call repeated over an unchanged tree returns what it returned the first time. If you have already made a change, it is real and it is recorded, and looking at it again cannot tell you whether it is the right change \u2014 what is left to establish is the mechanism, not the presence.
32
+
33
+ Spend the next frame on evidence you do not have. Three places hold some, and none of them is the diff:
34
+ - the failing check itself \u2014 what it asserts, the values it asserts about, and the setup that produces them;
35
+ - the history of the symbol you changed \u2014 \`git log -L <start>,<end>:<file>\` over its line range, or \`git blame\` on the line \u2014 which says why it is written the way it is and what it was written to handle;
36
+ - a different site \u2014 the callers of the symbol rather than its definition, which is where a wrong mechanism shows first.
37
+
38
+ If no call you can name would tell you something you do not already know, say which mechanism you now believe is wrong and change that instead. This notice returns after another ${cap} repeated frames.`;
39
+ const unmoved = (opened, closed) => `Unmoved workspace \u2014 the tree you are completing on is the tree this run was handed.
40
+
41
+ - digest the run opened on: ${opened}
42
+ - digest this frame closed on: ${closed}
43
+
44
+ Nothing in this workspace differs from the tree this run opened on, so there is no change behind the completion you wrote. Make the change, or complete again stating that no change is needed and naming what you ran to conclude it \u2014 the calls you made, what they printed, and why that shows the behaviour asked for is already the behaviour this tree has. Both answers are accepted exactly as you write them and nothing re-checks either one; "no change is needed" with its working shown is a finished answer, and the same words with nothing behind them are the completion you just had handed back. Nothing makes the change for you, and what you return next is the answer that stands.`;
45
+ const unresolved = (flow, failed, instead) => `Unanswered failure \u2014 a check you ran over this exact tree reported a failing exit status, and you went back to what it covered with a different command instead of running it again.
46
+
47
+ - the check that failed, over the tree you are completing on: ${flow} ${failed}
48
+ - the reading you took instead: ${flow} ${instead}
49
+
50
+ The second names the same subject as the first, so the run itself treated that subject as still open; the first was never run again, and its result is the one this completion is standing on. Fix what it reported and run it again, byte for byte, and complete once you have seen what it prints; or complete and state in your output why the failures it reported are expected and not yours. Nothing re-runs it for you, and what you return next is the answer that stands.`;
51
+ const narrowed = (flow, broader, narrower) => `Narrowed verification \u2014 your last verification is narrower than a check this run has already run in full, and the workspace has changed since that broader check last ran.
52
+
53
+ - the broader check, last run before your latest change: ${flow} ${broader}
54
+ - the check this frame ran instead: ${flow} ${narrower}
55
+
56
+ The second repeats every term of the first and adds conditions to it, so it reports on a part of what the first covered and says nothing about the rest \u2014 and the rest is exactly where a change breaks something that was passing. Re-run ${flow} with that earlier input, byte for byte, and complete once you have seen what it prints; or complete and state in your output why that check no longer applies to the change you made. Nothing re-runs it for you, and what you return next is the answer that stands.`;
57
+ const narrowOnly = (flow, check, targets) => `Only reading \u2014 the check you are completing on is the only reading this run has of what it names.
58
+
59
+ - the check: ${flow} ${check}
60
+ - what it names: ${targets.join(", ")}
61
+
62
+ Every one of those this run has looked at somewhere else, but no other call it made covers them all, so nothing in this run says what they report on their own. Any term this check carries beyond them \u2014 a filter, a selector, a subset of cases, a flag that stops early \u2014 is a condition you have never taken off, and what a condition hides is exactly where a change breaks something that was passing. Run ${flow} over the same subjects with those conditions removed and complete once you have seen what it prints; or complete and state in your output that it carries no condition and the reading is already whole. Nothing re-runs it for you, and what you return next is the answer that stands.`;
63
+ const claim = () => `Completion review \u2014 reconsider whether your completion answers the current request and whether any claimed actions or results are supported by this run's record.
64
+
65
+ Answer the current request directly, keeping its requested format. A purely conversational answer needs no file edit, command, or verification. Do not add a work report when the person asked only for an answer.
66
+
67
+ If you claim a command or result, use recorded evidence: make an allowed call needed to obtain it, or remove the unsupported claim and say plainly what remains unchecked when relevant. A completion that reports work honestly left undone is not refused for that alone.
68
+
69
+ The next completion is judged again. A repeated claim of work this run never recorded can end the run with no answer.`;
70
+ //# sourceMappingURL=demandText.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/internal/demandText.ts"],
4
+ "sourcesContent": ["/**\n * Canonical renderings of controller interventions recorded in the journal.\n *\n * `CellTurn` uses these strings when it builds the live model window and\n * `Transcript` uses the same functions when it rebuilds that window. Keeping\n * the rendering here makes an intervention event sufficient to reproduce the\n * exact user message it represented.\n *\n * @since 1.0.0-rc.0\n * @private\n */\n\n/**\n * Renders the read-only-discipline intervention.\n *\n * It asks for a decision rather than a token write. An answerable request can\n * complete without inventing work. An unfinished workspace change still needs\n * evidence or a justification for more observation, and destructive\n * writes made only to satisfy the notice are explicitly refused. A\n * justification must name how later frames differ from the quiet ones so the\n * run cannot buy a repeat by restating its plan.\n *\n * @category conversions\n * @since 1.0.0-rc.0\n * @private\n */\nexport const readOnly = (cap: number, frames: number): string =>\n `Read-only discipline \u2014 ${frames} consecutive frames have made no call that declares a write, and this run's read-only budget is ${cap}. If the current request is already answered, call ctx.done(answer) now. A conversational or read-only answer needs no invented edit or command. If a workspace change is still required, land an edit you can already name the evidence for \u2014 the file, the change, and the check you have watched fail that will now pass. If more evidence is needed, call ctx.justify(\"<the evidence you are still missing, the exact call that will get it, and what that makes the next frames do differently from these ${frames}>\"). Do not write something merely to answer this notice. A restore, a revert, an overwrite from captured output, or any edit whose evidence you cannot name is worse than another read-only frame, because it destroys work this run has already done. A justification is recorded and buys ${cap} quiet frames; it does not reset this counter, and one that names the same next step the last quiet frame named has bought a repeat of that frame. At ${\n cap * 2\n } consecutive read-only frames the run stops as a failure, so ${\n cap * 2 - frames\n } frames remain to answer the request or make the required change.`\n\n/**\n * Renders the repeated-observation intervention.\n *\n * This is separate from the read-only demand because a repeating run has\n * often already edited. It redirects the run from re-reading that edit toward\n * mechanism evidence: the failing check, symbol history, or another caller.\n *\n * @category conversions\n * @since 1.0.0-rc.0\n * @private\n */\nexport const repeat = (frames: number, cap: number): string =>\n `Repeated observation \u2014 the last ${frames} frames issued only calls this run had already issued, byte for byte, and none of them changed the workspace. You are re-confirming what you already know: a call repeated over an unchanged tree returns what it returned the first time. If you have already made a change, it is real and it is recorded, and looking at it again cannot tell you whether it is the right change \u2014 what is left to establish is the mechanism, not the presence.\n\nSpend the next frame on evidence you do not have. Three places hold some, and none of them is the diff:\n- the failing check itself \u2014 what it asserts, the values it asserts about, and the setup that produces them;\n- the history of the symbol you changed \u2014 \\`git log -L <start>,<end>:<file>\\` over its line range, or \\`git blame\\` on the line \u2014 which says why it is written the way it is and what it was written to handle;\n- a different site \u2014 the callers of the symbol rather than its definition, which is where a wrong mechanism shows first.\n\nIf no call you can name would tell you something you do not already know, say which mechanism you now believe is wrong and change that instead. This notice returns after another ${cap} repeated frames.`\n\n/**\n * Renders the unchanged-workspace completion intervention.\n *\n * @category conversions\n * @since 1.0.0-rc.0\n * @private\n */\nexport const unmoved = (opened: string, closed: string): string =>\n `Unmoved workspace \u2014 the tree you are completing on is the tree this run was handed.\n\n- digest the run opened on: ${opened}\n- digest this frame closed on: ${closed}\n\nNothing in this workspace differs from the tree this run opened on, so there is no change behind the completion you wrote. Make the change, or complete again stating that no change is needed and naming what you ran to conclude it \u2014 the calls you made, what they printed, and why that shows the behaviour asked for is already the behaviour this tree has. Both answers are accepted exactly as you write them and nothing re-checks either one; \"no change is needed\" with its working shown is a finished answer, and the same words with nothing behind them are the completion you just had handed back. Nothing makes the change for you, and what you return next is the answer that stands.`\n\n/**\n * Renders the unresolved-failure completion intervention.\n *\n * @category conversions\n * @since 1.0.0-rc.0\n * @private\n */\nexport const unresolved = (flow: string, failed: string, instead: string): string =>\n `Unanswered failure \u2014 a check you ran over this exact tree reported a failing exit status, and you went back to what it covered with a different command instead of running it again.\n\n- the check that failed, over the tree you are completing on: ${flow} ${failed}\n- the reading you took instead: ${flow} ${instead}\n\nThe second names the same subject as the first, so the run itself treated that subject as still open; the first was never run again, and its result is the one this completion is standing on. Fix what it reported and run it again, byte for byte, and complete once you have seen what it prints; or complete and state in your output why the failures it reported are expected and not yours. Nothing re-runs it for you, and what you return next is the answer that stands.`\n\n/**\n * Renders the narrowed-check completion intervention.\n *\n * @category conversions\n * @since 1.0.0-rc.0\n * @private\n */\nexport const narrowed = (flow: string, broader: string, narrower: string): string =>\n `Narrowed verification \u2014 your last verification is narrower than a check this run has already run in full, and the workspace has changed since that broader check last ran.\n\n- the broader check, last run before your latest change: ${flow} ${broader}\n- the check this frame ran instead: ${flow} ${narrower}\n\nThe second repeats every term of the first and adds conditions to it, so it reports on a part of what the first covered and says nothing about the rest \u2014 and the rest is exactly where a change breaks something that was passing. Re-run ${flow} with that earlier input, byte for byte, and complete once you have seen what it prints; or complete and state in your output why that check no longer applies to the change you made. Nothing re-runs it for you, and what you return next is the answer that stands.`\n\n/**\n * Renders the only-reading completion intervention.\n *\n * @category conversions\n * @since 1.0.0-rc.0\n * @private\n */\nexport const narrowOnly = (flow: string, check: string, targets: ReadonlyArray<string>): string =>\n `Only reading \u2014 the check you are completing on is the only reading this run has of what it names.\n\n- the check: ${flow} ${check}\n- what it names: ${targets.join(\", \")}\n\nEvery one of those this run has looked at somewhere else, but no other call it made covers them all, so nothing in this run says what they report on their own. Any term this check carries beyond them \u2014 a filter, a selector, a subset of cases, a flag that stops early \u2014 is a condition you have never taken off, and what a condition hides is exactly where a change breaks something that was passing. Run ${flow} over the same subjects with those conditions removed and complete once you have seen what it prints; or complete and state in your output that it carries no condition and the reading is already whole. Nothing re-runs it for you, and what you return next is the answer that stands.`\n\n/**\n * Renders the completion-review intervention.\n *\n * Any of the three completion questions can ask for another frame. A low\n * completeness reading does not establish that the run invented work, so the\n * notice asks for a direct answer and makes evidence conditional on the\n * actions or results that answer actually claims. A conversational answer\n * needs no work report and must retain the person's requested format.\n *\n * The task is not quoted back. It is in the run's prefix on every frame, so a\n * quote would buy nothing and cost the window the run has to answer in, and\n * leaving it out is also what lets this text be rebuilt from the event alone.\n * No probability is quoted either: a number is journal material for a grader,\n * and in front of a model it is a score to negotiate.\n *\n * The text still warns about the narrower refusal: repeated claims of work\n * the record does not carry can end the run. Honest reports of work left\n * undone remain valid answers when that is what the run can report.\n *\n * @category conversions\n * @since 1.0.0-rc.0\n * @private\n */\nexport const claim = (): string =>\n `Completion review \u2014 reconsider whether your completion answers the current request and whether any claimed actions or results are supported by this run's record.\n\nAnswer the current request directly, keeping its requested format. A purely conversational answer needs no file edit, command, or verification. Do not add a work report when the person asked only for an answer.\n\nIf you claim a command or result, use recorded evidence: make an allowed call needed to obtain it, or remove the unsupported claim and say plainly what remains unchecked when relevant. A completion that reports work honestly left undone is not refused for that alone.\n\nThe next completion is judged again. A repeated claim of work this run never recorded can end the run with no answer.`\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA0BO,MAAM,WAAW,CAAC,KAAa,WACpC,+BAA0B,MAAM,mGAAmG,GAAG,ufAAkf,MAAM,gSAAgS,GAAG,yJAC/5B,MAAM,CACR,gEACE,MAAM,IAAI,MACZ;AAaK,MAAM,SAAS,CAAC,QAAgB,QACrC,wCAAmC,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oLAOyI,GAAG;AAShL,MAAM,UAAU,CAAC,QAAgB,WACtC;AAAA;AAAA,8BAE4B,MAAM;AAAA,iCACH,MAAM;AAAA;AAAA;AAWhC,MAAM,aAAa,CAAC,MAAc,QAAgB,YACvD;AAAA;AAAA,gEAE8D,IAAI,IAAI,MAAM;AAAA,kCAC5C,IAAI,IAAI,OAAO;AAAA;AAAA;AAW1C,MAAM,WAAW,CAAC,MAAc,SAAiB,aACtD;AAAA;AAAA,2DAEyD,IAAI,IAAI,OAAO;AAAA,sCACpC,IAAI,IAAI,QAAQ;AAAA;AAAA,kPAEuL,IAAI;AAS1O,MAAM,aAAa,CAAC,MAAc,OAAe,YACtD;AAAA;AAAA,eAEa,IAAI,IAAI,KAAK;AAAA,mBACT,QAAQ,KAAK,IAAI,CAAC;AAAA;AAAA,8ZAE+W,IAAI;AAyBjZ,MAAM,QAAQ,MACnB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,109 @@
1
+ /**
2
+ * Honest shortening.
3
+ *
4
+ * Every place this harness puts bytes in front of a model is bounded, and every
5
+ * one of those bounds used to be spelled the same way: slice, append `…`, move
6
+ * on. A model reading that cannot tell a value that ends in an ellipsis from a
7
+ * value that was cut, cannot tell how much it lost, and — the expensive part —
8
+ * cannot tell how to get the rest back, so it buys the same bytes again. Three
9
+ * of the five most expensive instances of the r90 wave spent real money
10
+ * re-fetching a region the run had already rendered and silently clipped
11
+ * (`pydata__xarray-7229` $0.76, `sphinx-doc__sphinx-8721` $0.36,
12
+ * `pytest-dev__pytest-6197` $0.19).
13
+ *
14
+ * So a shortened value states three things: that it was shortened, how many
15
+ * bytes are missing, and the id that brings them back. The id is a sentence the
16
+ * caller supplies, because only the caller knows whether the thing is a state
17
+ * key (`render`), a settled call (`recall`), or something the model must fetch
18
+ * again.
19
+ *
20
+ * @since 0.1.0
21
+ * @private
22
+ * @slop
23
+ */
24
+ /**
25
+ * The first `limit` UTF-8 bytes of `text`, stopping before a code point that
26
+ * would cross the bound.
27
+ *
28
+ * UTF-8 bytes and UTF-16 indexes do not share boundaries for multibyte text, so
29
+ * a cut may keep fewer bytes than the caller offered. Every bound here is a
30
+ * ceiling: giving bytes back is allowed; taking one is not. Walking by code
31
+ * point also subsumes the surrogate-pair guarantee — no half of an astral
32
+ * character can survive on either side of a cut.
33
+ *
34
+ * @since 0.1.0
35
+ * @private
36
+ * @slop
37
+ */
38
+ export declare const headSlice: (text: string, limit: number) => string;
39
+ /**
40
+ * The last `limit` UTF-8 bytes of `text`, starting on a code-point boundary.
41
+ *
42
+ * @since 0.1.0
43
+ * @private
44
+ * @slop
45
+ */
46
+ export declare const tailSlice: (text: string, limit: number) => string;
47
+ /**
48
+ * Shortens an already-shortened text from the middle, counting against the
49
+ * whole it came from.
50
+ *
51
+ * A value can be bounded twice: once where the host copies it out of the
52
+ * sandbox, and again where the frame apportions its print budget across the
53
+ * statements that share it. Counting the second reduction against what survived
54
+ * the first would report a value as smaller than it is — the exact dishonesty
55
+ * this module exists to abolish — so `whole` is stated by the caller, which is
56
+ * the only place that still knows it, and the notice always names the original
57
+ * size.
58
+ *
59
+ * `text` must be the head and tail of the original, in order: every reduction
60
+ * here keeps both ends, so slicing the ends of a reduced value is the same as
61
+ * slicing the ends of the value it came from.
62
+ *
63
+ * The count is what the two ends actually left behind rather than `whole -
64
+ * limit`, because a cut that stopped before a multibyte code point can keep
65
+ * fewer bytes than the limit allowed and the notice names the real number.
66
+ *
67
+ * @since 0.1.0
68
+ * @private
69
+ * @slop
70
+ */
71
+ export declare const middleFrom: (text: string, whole: number, limit: number, recall: string) => string;
72
+ /**
73
+ * The most one {@link middleFrom} notice can cost, for a value of this size.
74
+ *
75
+ * A caller apportioning one budget across several values has to reserve the
76
+ * notices before it can hand out the rest, or it hands out bytes the notices
77
+ * then take back and something downstream cuts the notice in half. The bound is
78
+ * exact: the dropped count is never larger than the whole, so the notice for a
79
+ * value shortened to nothing is the longest notice that value can produce.
80
+ *
81
+ * @since 0.1.0
82
+ * @private
83
+ * @slop
84
+ */
85
+ export declare const noticeCost: (whole: number, recall: string) => number;
86
+ /**
87
+ * Shortens text from the middle, keeping both ends.
88
+ *
89
+ * The two ends are where a file excerpt, a diff, or a test log identifies
90
+ * itself; the middle is where the repetition is. `recall` is the sentence that
91
+ * says how to see what was dropped.
92
+ *
93
+ * @since 0.1.0
94
+ * @private
95
+ * @slop
96
+ */
97
+ export declare const middle: (text: string, limit: number, recall: string) => string;
98
+ /**
99
+ * Shortens text from the end, keeping the head.
100
+ *
101
+ * Used for the one-line summaries a ledger prints, where the head is the whole
102
+ * of what identifies the line and the tail is detail.
103
+ *
104
+ * @since 0.1.0
105
+ * @private
106
+ * @slop
107
+ */
108
+ export declare const head: (text: string, limit: number, recall: string) => string;
109
+ //# sourceMappingURL=elide.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elide.d.ts","sourceRoot":"","sources":["../../../src/internal/elide.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAIH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,KAAG,MAAsC,CAAA;AAE9F;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,KAAG,MAAsC,CAAA;AAE9F;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,EAAE,OAAO,MAAM,EAAE,QAAQ,MAAM,KAAG,MAQvF,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO,MAAM,EAAE,QAAQ,MAAM,KAAG,MAAsD,CAAA;AAEjH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,MAAM,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,EAAE,QAAQ,MAAM,KAAG,MAClB,CAAA;AAEnD;;;;;;;;;GASG;AACH,eAAO,MAAM,IAAI,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,EAAE,QAAQ,MAAM,KAAG,MAKlE,CAAA"}
@@ -0,0 +1,59 @@
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 elide_exports = {};
30
+ __export(elide_exports, {
31
+ head: () => head,
32
+ headSlice: () => headSlice,
33
+ middle: () => middle,
34
+ middleFrom: () => middleFrom,
35
+ noticeCost: () => noticeCost,
36
+ tailSlice: () => tailSlice
37
+ });
38
+ module.exports = __toCommonJS(elide_exports);
39
+ var bytes = __toESM(require("./bytes.js"), 1);
40
+ const headSlice = (text, limit) => bytes.headSlice(text, limit);
41
+ const tailSlice = (text, limit) => bytes.tailSlice(text, limit);
42
+ const middleFrom = (text, whole, limit, recall) => {
43
+ if (whole <= limit) return text;
44
+ const edge = Math.floor(limit / 2);
45
+ const head2 = headSlice(text, edge);
46
+ const tail = tailSlice(text, edge);
47
+ return `${head2}
48
+ \u2026 ${whole - bytes.size(head2) - bytes.size(tail)} of ${whole} bytes elided from the middle. ${recall} \u2026
49
+ ${tail}`;
50
+ };
51
+ const noticeCost = (whole, recall) => bytes.size(middleFrom("", whole, 0, recall));
52
+ const middle = (text, limit, recall) => middleFrom(text, bytes.size(text), limit, recall);
53
+ const head = (text, limit, recall) => {
54
+ const whole = bytes.size(text);
55
+ if (whole <= limit) return text;
56
+ const kept = headSlice(text, limit);
57
+ return `${kept}\u2026 [+${whole - bytes.size(kept)}b, ${recall}]`;
58
+ };
59
+ //# sourceMappingURL=elide.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/internal/elide.ts"],
4
+ "sourcesContent": ["/**\n * Honest shortening.\n *\n * Every place this harness puts bytes in front of a model is bounded, and every\n * one of those bounds used to be spelled the same way: slice, append `\u2026`, move\n * on. A model reading that cannot tell a value that ends in an ellipsis from a\n * value that was cut, cannot tell how much it lost, and \u2014 the expensive part \u2014\n * cannot tell how to get the rest back, so it buys the same bytes again. Three\n * of the five most expensive instances of the r90 wave spent real money\n * re-fetching a region the run had already rendered and silently clipped\n * (`pydata__xarray-7229` $0.76, `sphinx-doc__sphinx-8721` $0.36,\n * `pytest-dev__pytest-6197` $0.19).\n *\n * So a shortened value states three things: that it was shortened, how many\n * bytes are missing, and the id that brings them back. The id is a sentence the\n * caller supplies, because only the caller knows whether the thing is a state\n * key (`render`), a settled call (`recall`), or something the model must fetch\n * again.\n *\n * @since 0.1.0\n * @private\n * @slop\n */\n\nimport * as bytes from \"./bytes.ts\"\n\n/**\n * The first `limit` UTF-8 bytes of `text`, stopping before a code point that\n * would cross the bound.\n *\n * UTF-8 bytes and UTF-16 indexes do not share boundaries for multibyte text, so\n * a cut may keep fewer bytes than the caller offered. Every bound here is a\n * ceiling: giving bytes back is allowed; taking one is not. Walking by code\n * point also subsumes the surrogate-pair guarantee \u2014 no half of an astral\n * character can survive on either side of a cut.\n *\n * @since 0.1.0\n * @private\n * @slop\n */\nexport const headSlice = (text: string, limit: number): string => bytes.headSlice(text, limit)\n\n/**\n * The last `limit` UTF-8 bytes of `text`, starting on a code-point boundary.\n *\n * @since 0.1.0\n * @private\n * @slop\n */\nexport const tailSlice = (text: string, limit: number): string => bytes.tailSlice(text, limit)\n\n/**\n * Shortens an already-shortened text from the middle, counting against the\n * whole it came from.\n *\n * A value can be bounded twice: once where the host copies it out of the\n * sandbox, and again where the frame apportions its print budget across the\n * statements that share it. Counting the second reduction against what survived\n * the first would report a value as smaller than it is \u2014 the exact dishonesty\n * this module exists to abolish \u2014 so `whole` is stated by the caller, which is\n * the only place that still knows it, and the notice always names the original\n * size.\n *\n * `text` must be the head and tail of the original, in order: every reduction\n * here keeps both ends, so slicing the ends of a reduced value is the same as\n * slicing the ends of the value it came from.\n *\n * The count is what the two ends actually left behind rather than `whole -\n * limit`, because a cut that stopped before a multibyte code point can keep\n * fewer bytes than the limit allowed and the notice names the real number.\n *\n * @since 0.1.0\n * @private\n * @slop\n */\nexport const middleFrom = (text: string, whole: number, limit: number, recall: string): string => {\n if (whole <= limit) return text\n const edge = Math.floor(limit / 2)\n const head = headSlice(text, edge)\n const tail = tailSlice(text, edge)\n return `${head}\\n\u2026 ${\n whole - bytes.size(head) - bytes.size(tail)\n } of ${whole} bytes elided from the middle. ${recall} \u2026\\n${tail}`\n}\n\n/**\n * The most one {@link middleFrom} notice can cost, for a value of this size.\n *\n * A caller apportioning one budget across several values has to reserve the\n * notices before it can hand out the rest, or it hands out bytes the notices\n * then take back and something downstream cuts the notice in half. The bound is\n * exact: the dropped count is never larger than the whole, so the notice for a\n * value shortened to nothing is the longest notice that value can produce.\n *\n * @since 0.1.0\n * @private\n * @slop\n */\nexport const noticeCost = (whole: number, recall: string): number => bytes.size(middleFrom(\"\", whole, 0, recall))\n\n/**\n * Shortens text from the middle, keeping both ends.\n *\n * The two ends are where a file excerpt, a diff, or a test log identifies\n * itself; the middle is where the repetition is. `recall` is the sentence that\n * says how to see what was dropped.\n *\n * @since 0.1.0\n * @private\n * @slop\n */\nexport const middle = (text: string, limit: number, recall: string): string =>\n middleFrom(text, bytes.size(text), limit, recall)\n\n/**\n * Shortens text from the end, keeping the head.\n *\n * Used for the one-line summaries a ledger prints, where the head is the whole\n * of what identifies the line and the tail is detail.\n *\n * @since 0.1.0\n * @private\n * @slop\n */\nexport const head = (text: string, limit: number, recall: string): string => {\n const whole = bytes.size(text)\n if (whole <= limit) return text\n const kept = headSlice(text, limit)\n return `${kept}\u2026 [+${whole - bytes.size(kept)}b, ${recall}]`\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAwBA,YAAuB;AAgBhB,MAAM,YAAY,CAAC,MAAc,UAA0B,MAAM,UAAU,MAAM,KAAK;AAStF,MAAM,YAAY,CAAC,MAAc,UAA0B,MAAM,UAAU,MAAM,KAAK;AA0BtF,MAAM,aAAa,CAAC,MAAc,OAAe,OAAe,WAA2B;AAChG,MAAI,SAAS,MAAO,QAAO;AAC3B,QAAM,OAAO,KAAK,MAAM,QAAQ,CAAC;AACjC,QAAMA,QAAO,UAAU,MAAM,IAAI;AACjC,QAAM,OAAO,UAAU,MAAM,IAAI;AACjC,SAAO,GAAGA,KAAI;AAAA,SACZ,QAAQ,MAAM,KAAKA,KAAI,IAAI,MAAM,KAAK,IAAI,CAC5C,OAAO,KAAK,kCAAkC,MAAM;AAAA,EAAO,IAAI;AACjE;AAeO,MAAM,aAAa,CAAC,OAAe,WAA2B,MAAM,KAAK,WAAW,IAAI,OAAO,GAAG,MAAM,CAAC;AAazG,MAAM,SAAS,CAAC,MAAc,OAAe,WAClD,WAAW,MAAM,MAAM,KAAK,IAAI,GAAG,OAAO,MAAM;AAY3C,MAAM,OAAO,CAAC,MAAc,OAAe,WAA2B;AAC3E,QAAM,QAAQ,MAAM,KAAK,IAAI;AAC7B,MAAI,SAAS,MAAO,QAAO;AAC3B,QAAM,OAAO,UAAU,MAAM,KAAK;AAClC,SAAO,GAAG,IAAI,YAAO,QAAQ,MAAM,KAAK,IAAI,CAAC,MAAM,MAAM;AAC3D;",
6
+ "names": ["head"]
7
+ }