@smthrs/std 0.0.0-stage → 1.0.0-rc.12

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 (582) hide show
  1. package/CHANGELOG.md +148 -0
  2. package/LICENSE +21 -0
  3. package/README.md +156 -2
  4. package/dist/cjs/ApplyPatch.d.ts +174 -0
  5. package/dist/cjs/ApplyPatch.d.ts.map +1 -0
  6. package/dist/cjs/ApplyPatch.js +309 -0
  7. package/dist/cjs/ApplyPatch.js.map +7 -0
  8. package/dist/cjs/Bash.d.ts +390 -0
  9. package/dist/cjs/Bash.d.ts.map +1 -0
  10. package/dist/cjs/Bash.js +333 -0
  11. package/dist/cjs/Bash.js.map +7 -0
  12. package/dist/cjs/Checkpoints.d.ts +322 -0
  13. package/dist/cjs/Checkpoints.d.ts.map +1 -0
  14. package/dist/cjs/Checkpoints.js +233 -0
  15. package/dist/cjs/Checkpoints.js.map +7 -0
  16. package/dist/cjs/Container.d.ts +132 -0
  17. package/dist/cjs/Container.d.ts.map +1 -0
  18. package/dist/cjs/Container.js +113 -0
  19. package/dist/cjs/Container.js.map +7 -0
  20. package/dist/cjs/Edit.d.ts +203 -0
  21. package/dist/cjs/Edit.d.ts.map +1 -0
  22. package/dist/cjs/Edit.js +258 -0
  23. package/dist/cjs/Edit.js.map +7 -0
  24. package/dist/cjs/ExaWebSearch.d.ts +22 -0
  25. package/dist/cjs/ExaWebSearch.d.ts.map +1 -0
  26. package/dist/cjs/ExaWebSearch.js +138 -0
  27. package/dist/cjs/ExaWebSearch.js.map +7 -0
  28. package/dist/cjs/Explore.d.ts +328 -0
  29. package/dist/cjs/Explore.d.ts.map +1 -0
  30. package/dist/cjs/Explore.js +90 -0
  31. package/dist/cjs/Explore.js.map +7 -0
  32. package/dist/cjs/Fetch.d.ts +130 -0
  33. package/dist/cjs/Fetch.d.ts.map +1 -0
  34. package/dist/cjs/Fetch.js +64 -0
  35. package/dist/cjs/Fetch.js.map +7 -0
  36. package/dist/cjs/Glob.d.ts +204 -0
  37. package/dist/cjs/Glob.d.ts.map +1 -0
  38. package/dist/cjs/Glob.js +94 -0
  39. package/dist/cjs/Glob.js.map +7 -0
  40. package/dist/cjs/Grep.d.ts +347 -0
  41. package/dist/cjs/Grep.d.ts.map +1 -0
  42. package/dist/cjs/Grep.js +181 -0
  43. package/dist/cjs/Grep.js.map +7 -0
  44. package/dist/cjs/HttpPost.d.ts +130 -0
  45. package/dist/cjs/HttpPost.d.ts.map +1 -0
  46. package/dist/cjs/HttpPost.js +72 -0
  47. package/dist/cjs/HttpPost.js.map +7 -0
  48. package/dist/cjs/LanguageServer.d.ts +90 -0
  49. package/dist/cjs/LanguageServer.d.ts.map +1 -0
  50. package/dist/cjs/LanguageServer.js +60 -0
  51. package/dist/cjs/LanguageServer.js.map +7 -0
  52. package/dist/cjs/Ls.d.ts +164 -0
  53. package/dist/cjs/Ls.d.ts.map +1 -0
  54. package/dist/cjs/Ls.js +136 -0
  55. package/dist/cjs/Ls.js.map +7 -0
  56. package/dist/cjs/Lsp.d.ts +125 -0
  57. package/dist/cjs/Lsp.d.ts.map +1 -0
  58. package/dist/cjs/Lsp.js +137 -0
  59. package/dist/cjs/Lsp.js.map +7 -0
  60. package/dist/cjs/Manifest.d.ts +918 -0
  61. package/dist/cjs/Manifest.d.ts.map +1 -0
  62. package/dist/cjs/Manifest.js +144 -0
  63. package/dist/cjs/Manifest.js.map +7 -0
  64. package/dist/cjs/NativeSearch.d.ts +38 -0
  65. package/dist/cjs/NativeSearch.d.ts.map +1 -0
  66. package/dist/cjs/NativeSearch.js +326 -0
  67. package/dist/cjs/NativeSearch.js.map +7 -0
  68. package/dist/cjs/NodeLanguageServer.d.ts +128 -0
  69. package/dist/cjs/NodeLanguageServer.d.ts.map +1 -0
  70. package/dist/cjs/NodeLanguageServer.js +796 -0
  71. package/dist/cjs/NodeLanguageServer.js.map +7 -0
  72. package/dist/cjs/PortableSearch.d.ts +36 -0
  73. package/dist/cjs/PortableSearch.d.ts.map +1 -0
  74. package/dist/cjs/PortableSearch.js +240 -0
  75. package/dist/cjs/PortableSearch.js.map +7 -0
  76. package/dist/cjs/Probe.d.ts +193 -0
  77. package/dist/cjs/Probe.d.ts.map +1 -0
  78. package/dist/cjs/Probe.js +134 -0
  79. package/dist/cjs/Probe.js.map +7 -0
  80. package/dist/cjs/Read.d.ts +189 -0
  81. package/dist/cjs/Read.d.ts.map +1 -0
  82. package/dist/cjs/Read.js +223 -0
  83. package/dist/cjs/Read.js.map +7 -0
  84. package/dist/cjs/Relocate.d.ts +73 -0
  85. package/dist/cjs/Relocate.d.ts.map +1 -0
  86. package/dist/cjs/Relocate.js +72 -0
  87. package/dist/cjs/Relocate.js.map +7 -0
  88. package/dist/cjs/RemoteSearch.d.ts +54 -0
  89. package/dist/cjs/RemoteSearch.d.ts.map +1 -0
  90. package/dist/cjs/RemoteSearch.js +134 -0
  91. package/dist/cjs/RemoteSearch.js.map +7 -0
  92. package/dist/cjs/Search.d.ts +163 -0
  93. package/dist/cjs/Search.d.ts.map +1 -0
  94. package/dist/cjs/Search.js +51 -0
  95. package/dist/cjs/Search.js.map +7 -0
  96. package/dist/cjs/SearchConformance.d.ts +115 -0
  97. package/dist/cjs/SearchConformance.d.ts.map +1 -0
  98. package/dist/cjs/SearchConformance.js +172 -0
  99. package/dist/cjs/SearchConformance.js.map +7 -0
  100. package/dist/cjs/SearchContract.d.ts +114 -0
  101. package/dist/cjs/SearchContract.d.ts.map +1 -0
  102. package/dist/cjs/SearchContract.js +339 -0
  103. package/dist/cjs/SearchContract.js.map +7 -0
  104. package/dist/cjs/ShellCommand.d.ts +164 -0
  105. package/dist/cjs/ShellCommand.d.ts.map +1 -0
  106. package/dist/cjs/ShellCommand.js +102 -0
  107. package/dist/cjs/ShellCommand.js.map +7 -0
  108. package/dist/cjs/StdError.d.ts +55 -0
  109. package/dist/cjs/StdError.d.ts.map +1 -0
  110. package/dist/cjs/StdError.js +74 -0
  111. package/dist/cjs/StdError.js.map +7 -0
  112. package/dist/cjs/TestRun.d.ts +311 -0
  113. package/dist/cjs/TestRun.d.ts.map +1 -0
  114. package/dist/cjs/TestRun.js +228 -0
  115. package/dist/cjs/TestRun.js.map +7 -0
  116. package/dist/cjs/TestRunner.d.ts +102 -0
  117. package/dist/cjs/TestRunner.d.ts.map +1 -0
  118. package/dist/cjs/TestRunner.js +54 -0
  119. package/dist/cjs/TestRunner.js.map +7 -0
  120. package/dist/cjs/TreeFingerprint.d.ts +140 -0
  121. package/dist/cjs/TreeFingerprint.d.ts.map +1 -0
  122. package/dist/cjs/TreeFingerprint.js +87 -0
  123. package/dist/cjs/TreeFingerprint.js.map +7 -0
  124. package/dist/cjs/UpdatePlan.d.ts +152 -0
  125. package/dist/cjs/UpdatePlan.d.ts.map +1 -0
  126. package/dist/cjs/UpdatePlan.js +87 -0
  127. package/dist/cjs/UpdatePlan.js.map +7 -0
  128. package/dist/cjs/WebFetch.d.ts +134 -0
  129. package/dist/cjs/WebFetch.d.ts.map +1 -0
  130. package/dist/cjs/WebFetch.js +140 -0
  131. package/dist/cjs/WebFetch.js.map +7 -0
  132. package/dist/cjs/WebSearch.d.ts +181 -0
  133. package/dist/cjs/WebSearch.d.ts.map +1 -0
  134. package/dist/cjs/WebSearch.js +86 -0
  135. package/dist/cjs/WebSearch.js.map +7 -0
  136. package/dist/cjs/Write.d.ts +147 -0
  137. package/dist/cjs/Write.d.ts.map +1 -0
  138. package/dist/cjs/Write.js +122 -0
  139. package/dist/cjs/Write.js.map +7 -0
  140. package/dist/cjs/index.d.ts +129 -0
  141. package/dist/cjs/index.d.ts.map +1 -0
  142. package/dist/cjs/index.js +101 -0
  143. package/dist/cjs/index.js.map +7 -0
  144. package/dist/cjs/internal/ApplyPatch.d.ts +145 -0
  145. package/dist/cjs/internal/ApplyPatch.d.ts.map +1 -0
  146. package/dist/cjs/internal/ApplyPatch.js +462 -0
  147. package/dist/cjs/internal/ApplyPatch.js.map +7 -0
  148. package/dist/cjs/internal/CodexText.d.ts +73 -0
  149. package/dist/cjs/internal/CodexText.d.ts.map +1 -0
  150. package/dist/cjs/internal/CodexText.js +108 -0
  151. package/dist/cjs/internal/CodexText.js.map +7 -0
  152. package/dist/cjs/internal/Declaration.d.ts +49 -0
  153. package/dist/cjs/internal/Declaration.d.ts.map +1 -0
  154. package/dist/cjs/internal/Declaration.js +46 -0
  155. package/dist/cjs/internal/Declaration.js.map +7 -0
  156. package/dist/cjs/internal/Diagnostics.d.ts +77 -0
  157. package/dist/cjs/internal/Diagnostics.d.ts.map +1 -0
  158. package/dist/cjs/internal/Diagnostics.js +89 -0
  159. package/dist/cjs/internal/Diagnostics.js.map +7 -0
  160. package/dist/cjs/internal/EnvelopePrecheck.d.ts +69 -0
  161. package/dist/cjs/internal/EnvelopePrecheck.d.ts.map +1 -0
  162. package/dist/cjs/internal/EnvelopePrecheck.js +323 -0
  163. package/dist/cjs/internal/EnvelopePrecheck.js.map +7 -0
  164. package/dist/cjs/internal/Exec.d.ts +151 -0
  165. package/dist/cjs/internal/Exec.d.ts.map +1 -0
  166. package/dist/cjs/internal/Exec.js +207 -0
  167. package/dist/cjs/internal/Exec.js.map +7 -0
  168. package/dist/cjs/internal/FileMutation.d.ts +109 -0
  169. package/dist/cjs/internal/FileMutation.d.ts.map +1 -0
  170. package/dist/cjs/internal/FileMutation.js +116 -0
  171. package/dist/cjs/internal/FileMutation.js.map +7 -0
  172. package/dist/cjs/internal/FsFailure.d.ts +38 -0
  173. package/dist/cjs/internal/FsFailure.d.ts.map +1 -0
  174. package/dist/cjs/internal/FsFailure.js +40 -0
  175. package/dist/cjs/internal/FsFailure.js.map +7 -0
  176. package/dist/cjs/internal/GitWorktree.d.ts +108 -0
  177. package/dist/cjs/internal/GitWorktree.d.ts.map +1 -0
  178. package/dist/cjs/internal/GitWorktree.js +276 -0
  179. package/dist/cjs/internal/GitWorktree.js.map +7 -0
  180. package/dist/cjs/internal/Grouping.d.ts +51 -0
  181. package/dist/cjs/internal/Grouping.d.ts.map +1 -0
  182. package/dist/cjs/internal/Grouping.js +83 -0
  183. package/dist/cjs/internal/Grouping.js.map +7 -0
  184. package/dist/cjs/internal/Html.d.ts +20 -0
  185. package/dist/cjs/internal/Html.d.ts.map +1 -0
  186. package/dist/cjs/internal/Html.js +81 -0
  187. package/dist/cjs/internal/Html.js.map +7 -0
  188. package/dist/cjs/internal/Http.d.ts +95 -0
  189. package/dist/cjs/internal/Http.d.ts.map +1 -0
  190. package/dist/cjs/internal/Http.js +153 -0
  191. package/dist/cjs/internal/Http.js.map +7 -0
  192. package/dist/cjs/internal/HttpNetwork.d.ts +27 -0
  193. package/dist/cjs/internal/HttpNetwork.d.ts.map +1 -0
  194. package/dist/cjs/internal/HttpNetwork.js +146 -0
  195. package/dist/cjs/internal/HttpNetwork.js.map +7 -0
  196. package/dist/cjs/internal/Ignore.d.ts +37 -0
  197. package/dist/cjs/internal/Ignore.d.ts.map +1 -0
  198. package/dist/cjs/internal/Ignore.js +100 -0
  199. package/dist/cjs/internal/Ignore.js.map +7 -0
  200. package/dist/cjs/internal/LinearRegex.d.ts +19 -0
  201. package/dist/cjs/internal/LinearRegex.d.ts.map +1 -0
  202. package/dist/cjs/internal/LinearRegex.js +166 -0
  203. package/dist/cjs/internal/LinearRegex.js.map +7 -0
  204. package/dist/cjs/internal/Match.d.ts +85 -0
  205. package/dist/cjs/internal/Match.d.ts.map +1 -0
  206. package/dist/cjs/internal/Match.js +99 -0
  207. package/dist/cjs/internal/Match.js.map +7 -0
  208. package/dist/cjs/internal/Paths.d.ts +23 -0
  209. package/dist/cjs/internal/Paths.d.ts.map +1 -0
  210. package/dist/cjs/internal/Paths.js +52 -0
  211. package/dist/cjs/internal/Paths.js.map +7 -0
  212. package/dist/cjs/internal/Preserve.d.ts +25 -0
  213. package/dist/cjs/internal/Preserve.d.ts.map +1 -0
  214. package/dist/cjs/internal/Preserve.js +88 -0
  215. package/dist/cjs/internal/Preserve.js.map +7 -0
  216. package/dist/cjs/internal/Prune.d.ts +35 -0
  217. package/dist/cjs/internal/Prune.d.ts.map +1 -0
  218. package/dist/cjs/internal/Prune.js +54 -0
  219. package/dist/cjs/internal/Prune.js.map +7 -0
  220. package/dist/cjs/internal/RemoteTree.d.ts +60 -0
  221. package/dist/cjs/internal/RemoteTree.d.ts.map +1 -0
  222. package/dist/cjs/internal/RemoteTree.js +123 -0
  223. package/dist/cjs/internal/RemoteTree.js.map +7 -0
  224. package/dist/cjs/internal/SearchContract.d.ts +63 -0
  225. package/dist/cjs/internal/SearchContract.d.ts.map +1 -0
  226. package/dist/cjs/internal/SearchContract.js +46 -0
  227. package/dist/cjs/internal/SearchContract.js.map +7 -0
  228. package/dist/cjs/internal/Symbols.d.ts +39 -0
  229. package/dist/cjs/internal/Symbols.d.ts.map +1 -0
  230. package/dist/cjs/internal/Symbols.js +59 -0
  231. package/dist/cjs/internal/Symbols.js.map +7 -0
  232. package/dist/cjs/internal/Tar.d.ts +23 -0
  233. package/dist/cjs/internal/Tar.d.ts.map +1 -0
  234. package/dist/cjs/internal/Tar.js +86 -0
  235. package/dist/cjs/internal/Tar.js.map +7 -0
  236. package/dist/cjs/internal/TestReport.d.ts +52 -0
  237. package/dist/cjs/internal/TestReport.d.ts.map +1 -0
  238. package/dist/cjs/internal/TestReport.js +131 -0
  239. package/dist/cjs/internal/TestReport.js.map +7 -0
  240. package/dist/cjs/internal/Text.d.ts +125 -0
  241. package/dist/cjs/internal/Text.d.ts.map +1 -0
  242. package/dist/cjs/internal/Text.js +85 -0
  243. package/dist/cjs/internal/Text.js.map +7 -0
  244. package/dist/cjs/internal/Url.d.ts +13 -0
  245. package/dist/cjs/internal/Url.d.ts.map +1 -0
  246. package/dist/cjs/internal/Url.js +35 -0
  247. package/dist/cjs/internal/Url.js.map +7 -0
  248. package/dist/cjs/internal/Walk.d.ts +72 -0
  249. package/dist/cjs/internal/Walk.d.ts.map +1 -0
  250. package/dist/cjs/internal/Walk.js +108 -0
  251. package/dist/cjs/internal/Walk.js.map +7 -0
  252. package/dist/cjs/package.json +1 -0
  253. package/dist/esm/ApplyPatch.d.ts +174 -0
  254. package/dist/esm/ApplyPatch.d.ts.map +1 -0
  255. package/dist/esm/ApplyPatch.js +346 -0
  256. package/dist/esm/ApplyPatch.js.map +1 -0
  257. package/dist/esm/Bash.d.ts +390 -0
  258. package/dist/esm/Bash.d.ts.map +1 -0
  259. package/dist/esm/Bash.js +514 -0
  260. package/dist/esm/Bash.js.map +1 -0
  261. package/dist/esm/Checkpoints.d.ts +322 -0
  262. package/dist/esm/Checkpoints.d.ts.map +1 -0
  263. package/dist/esm/Checkpoints.js +396 -0
  264. package/dist/esm/Checkpoints.js.map +1 -0
  265. package/dist/esm/Container.d.ts +132 -0
  266. package/dist/esm/Container.d.ts.map +1 -0
  267. package/dist/esm/Container.js +151 -0
  268. package/dist/esm/Container.js.map +1 -0
  269. package/dist/esm/Edit.d.ts +203 -0
  270. package/dist/esm/Edit.d.ts.map +1 -0
  271. package/dist/esm/Edit.js +296 -0
  272. package/dist/esm/Edit.js.map +1 -0
  273. package/dist/esm/ExaWebSearch.d.ts +22 -0
  274. package/dist/esm/ExaWebSearch.d.ts.map +1 -0
  275. package/dist/esm/ExaWebSearch.js +107 -0
  276. package/dist/esm/ExaWebSearch.js.map +1 -0
  277. package/dist/esm/Explore.d.ts +328 -0
  278. package/dist/esm/Explore.d.ts.map +1 -0
  279. package/dist/esm/Explore.js +106 -0
  280. package/dist/esm/Explore.js.map +1 -0
  281. package/dist/esm/Fetch.d.ts +130 -0
  282. package/dist/esm/Fetch.d.ts.map +1 -0
  283. package/dist/esm/Fetch.js +91 -0
  284. package/dist/esm/Fetch.js.map +1 -0
  285. package/dist/esm/Glob.d.ts +204 -0
  286. package/dist/esm/Glob.d.ts.map +1 -0
  287. package/dist/esm/Glob.js +177 -0
  288. package/dist/esm/Glob.js.map +1 -0
  289. package/dist/esm/Grep.d.ts +347 -0
  290. package/dist/esm/Grep.d.ts.map +1 -0
  291. package/dist/esm/Grep.js +289 -0
  292. package/dist/esm/Grep.js.map +1 -0
  293. package/dist/esm/HttpPost.d.ts +130 -0
  294. package/dist/esm/HttpPost.d.ts.map +1 -0
  295. package/dist/esm/HttpPost.js +89 -0
  296. package/dist/esm/HttpPost.js.map +1 -0
  297. package/dist/esm/LanguageServer.d.ts +90 -0
  298. package/dist/esm/LanguageServer.d.ts.map +1 -0
  299. package/dist/esm/LanguageServer.js +57 -0
  300. package/dist/esm/LanguageServer.js.map +1 -0
  301. package/dist/esm/Ls.d.ts +164 -0
  302. package/dist/esm/Ls.d.ts.map +1 -0
  303. package/dist/esm/Ls.js +178 -0
  304. package/dist/esm/Ls.js.map +1 -0
  305. package/dist/esm/Lsp.d.ts +125 -0
  306. package/dist/esm/Lsp.d.ts.map +1 -0
  307. package/dist/esm/Lsp.js +165 -0
  308. package/dist/esm/Lsp.js.map +1 -0
  309. package/dist/esm/Manifest.d.ts +918 -0
  310. package/dist/esm/Manifest.d.ts.map +1 -0
  311. package/dist/esm/Manifest.js +153 -0
  312. package/dist/esm/Manifest.js.map +1 -0
  313. package/dist/esm/NativeSearch.d.ts +38 -0
  314. package/dist/esm/NativeSearch.d.ts.map +1 -0
  315. package/dist/esm/NativeSearch.js +378 -0
  316. package/dist/esm/NativeSearch.js.map +1 -0
  317. package/dist/esm/NodeLanguageServer.d.ts +128 -0
  318. package/dist/esm/NodeLanguageServer.d.ts.map +1 -0
  319. package/dist/esm/NodeLanguageServer.js +843 -0
  320. package/dist/esm/NodeLanguageServer.js.map +1 -0
  321. package/dist/esm/PortableSearch.d.ts +36 -0
  322. package/dist/esm/PortableSearch.d.ts.map +1 -0
  323. package/dist/esm/PortableSearch.js +256 -0
  324. package/dist/esm/PortableSearch.js.map +1 -0
  325. package/dist/esm/Probe.d.ts +193 -0
  326. package/dist/esm/Probe.d.ts.map +1 -0
  327. package/dist/esm/Probe.js +225 -0
  328. package/dist/esm/Probe.js.map +1 -0
  329. package/dist/esm/Read.d.ts +189 -0
  330. package/dist/esm/Read.d.ts.map +1 -0
  331. package/dist/esm/Read.js +300 -0
  332. package/dist/esm/Read.js.map +1 -0
  333. package/dist/esm/Relocate.d.ts +73 -0
  334. package/dist/esm/Relocate.d.ts.map +1 -0
  335. package/dist/esm/Relocate.js +153 -0
  336. package/dist/esm/Relocate.js.map +1 -0
  337. package/dist/esm/RemoteSearch.d.ts +54 -0
  338. package/dist/esm/RemoteSearch.d.ts.map +1 -0
  339. package/dist/esm/RemoteSearch.js +162 -0
  340. package/dist/esm/RemoteSearch.js.map +1 -0
  341. package/dist/esm/Search.d.ts +163 -0
  342. package/dist/esm/Search.d.ts.map +1 -0
  343. package/dist/esm/Search.js +47 -0
  344. package/dist/esm/Search.js.map +1 -0
  345. package/dist/esm/SearchConformance.d.ts +115 -0
  346. package/dist/esm/SearchConformance.d.ts.map +1 -0
  347. package/dist/esm/SearchConformance.js +193 -0
  348. package/dist/esm/SearchConformance.js.map +1 -0
  349. package/dist/esm/SearchContract.d.ts +114 -0
  350. package/dist/esm/SearchContract.d.ts.map +1 -0
  351. package/dist/esm/SearchContract.js +461 -0
  352. package/dist/esm/SearchContract.js.map +1 -0
  353. package/dist/esm/ShellCommand.d.ts +164 -0
  354. package/dist/esm/ShellCommand.d.ts.map +1 -0
  355. package/dist/esm/ShellCommand.js +159 -0
  356. package/dist/esm/ShellCommand.js.map +1 -0
  357. package/dist/esm/StdError.d.ts +55 -0
  358. package/dist/esm/StdError.d.ts.map +1 -0
  359. package/dist/esm/StdError.js +71 -0
  360. package/dist/esm/StdError.js.map +1 -0
  361. package/dist/esm/TestRun.d.ts +311 -0
  362. package/dist/esm/TestRun.d.ts.map +1 -0
  363. package/dist/esm/TestRun.js +316 -0
  364. package/dist/esm/TestRun.js.map +1 -0
  365. package/dist/esm/TestRunner.d.ts +102 -0
  366. package/dist/esm/TestRunner.d.ts.map +1 -0
  367. package/dist/esm/TestRunner.js +68 -0
  368. package/dist/esm/TestRunner.js.map +1 -0
  369. package/dist/esm/TreeFingerprint.d.ts +140 -0
  370. package/dist/esm/TreeFingerprint.d.ts.map +1 -0
  371. package/dist/esm/TreeFingerprint.js +170 -0
  372. package/dist/esm/TreeFingerprint.js.map +1 -0
  373. package/dist/esm/UpdatePlan.d.ts +152 -0
  374. package/dist/esm/UpdatePlan.d.ts.map +1 -0
  375. package/dist/esm/UpdatePlan.js +129 -0
  376. package/dist/esm/UpdatePlan.js.map +1 -0
  377. package/dist/esm/WebFetch.d.ts +134 -0
  378. package/dist/esm/WebFetch.d.ts.map +1 -0
  379. package/dist/esm/WebFetch.js +151 -0
  380. package/dist/esm/WebFetch.js.map +1 -0
  381. package/dist/esm/WebSearch.d.ts +181 -0
  382. package/dist/esm/WebSearch.d.ts.map +1 -0
  383. package/dist/esm/WebSearch.js +134 -0
  384. package/dist/esm/WebSearch.js.map +1 -0
  385. package/dist/esm/Write.d.ts +147 -0
  386. package/dist/esm/Write.d.ts.map +1 -0
  387. package/dist/esm/Write.js +144 -0
  388. package/dist/esm/Write.js.map +1 -0
  389. package/dist/esm/index.d.ts +129 -0
  390. package/dist/esm/index.d.ts.map +1 -0
  391. package/dist/esm/index.js +129 -0
  392. package/dist/esm/index.js.map +1 -0
  393. package/dist/esm/internal/ApplyPatch.d.ts +145 -0
  394. package/dist/esm/internal/ApplyPatch.d.ts.map +1 -0
  395. package/dist/esm/internal/ApplyPatch.js +489 -0
  396. package/dist/esm/internal/ApplyPatch.js.map +1 -0
  397. package/dist/esm/internal/CodexText.d.ts +73 -0
  398. package/dist/esm/internal/CodexText.d.ts.map +1 -0
  399. package/dist/esm/internal/CodexText.js +156 -0
  400. package/dist/esm/internal/CodexText.js.map +1 -0
  401. package/dist/esm/internal/Declaration.d.ts +49 -0
  402. package/dist/esm/internal/Declaration.d.ts.map +1 -0
  403. package/dist/esm/internal/Declaration.js +42 -0
  404. package/dist/esm/internal/Declaration.js.map +1 -0
  405. package/dist/esm/internal/Diagnostics.d.ts +77 -0
  406. package/dist/esm/internal/Diagnostics.d.ts.map +1 -0
  407. package/dist/esm/internal/Diagnostics.js +99 -0
  408. package/dist/esm/internal/Diagnostics.js.map +1 -0
  409. package/dist/esm/internal/EnvelopePrecheck.d.ts +69 -0
  410. package/dist/esm/internal/EnvelopePrecheck.d.ts.map +1 -0
  411. package/dist/esm/internal/EnvelopePrecheck.js +426 -0
  412. package/dist/esm/internal/EnvelopePrecheck.js.map +1 -0
  413. package/dist/esm/internal/Exec.d.ts +151 -0
  414. package/dist/esm/internal/Exec.d.ts.map +1 -0
  415. package/dist/esm/internal/Exec.js +285 -0
  416. package/dist/esm/internal/Exec.js.map +1 -0
  417. package/dist/esm/internal/FileMutation.d.ts +109 -0
  418. package/dist/esm/internal/FileMutation.d.ts.map +1 -0
  419. package/dist/esm/internal/FileMutation.js +123 -0
  420. package/dist/esm/internal/FileMutation.js.map +1 -0
  421. package/dist/esm/internal/FsFailure.d.ts +38 -0
  422. package/dist/esm/internal/FsFailure.d.ts.map +1 -0
  423. package/dist/esm/internal/FsFailure.js +39 -0
  424. package/dist/esm/internal/FsFailure.js.map +1 -0
  425. package/dist/esm/internal/GitWorktree.d.ts +108 -0
  426. package/dist/esm/internal/GitWorktree.d.ts.map +1 -0
  427. package/dist/esm/internal/GitWorktree.js +352 -0
  428. package/dist/esm/internal/GitWorktree.js.map +1 -0
  429. package/dist/esm/internal/Grouping.d.ts +51 -0
  430. package/dist/esm/internal/Grouping.d.ts.map +1 -0
  431. package/dist/esm/internal/Grouping.js +99 -0
  432. package/dist/esm/internal/Grouping.js.map +1 -0
  433. package/dist/esm/internal/Html.d.ts +20 -0
  434. package/dist/esm/internal/Html.d.ts.map +1 -0
  435. package/dist/esm/internal/Html.js +70 -0
  436. package/dist/esm/internal/Html.js.map +1 -0
  437. package/dist/esm/internal/Http.d.ts +95 -0
  438. package/dist/esm/internal/Http.d.ts.map +1 -0
  439. package/dist/esm/internal/Http.js +154 -0
  440. package/dist/esm/internal/Http.js.map +1 -0
  441. package/dist/esm/internal/HttpNetwork.d.ts +27 -0
  442. package/dist/esm/internal/HttpNetwork.d.ts.map +1 -0
  443. package/dist/esm/internal/HttpNetwork.js +114 -0
  444. package/dist/esm/internal/HttpNetwork.js.map +1 -0
  445. package/dist/esm/internal/Ignore.d.ts +37 -0
  446. package/dist/esm/internal/Ignore.d.ts.map +1 -0
  447. package/dist/esm/internal/Ignore.js +128 -0
  448. package/dist/esm/internal/Ignore.js.map +1 -0
  449. package/dist/esm/internal/LinearRegex.d.ts +19 -0
  450. package/dist/esm/internal/LinearRegex.d.ts.map +1 -0
  451. package/dist/esm/internal/LinearRegex.js +176 -0
  452. package/dist/esm/internal/LinearRegex.js.map +1 -0
  453. package/dist/esm/internal/Match.d.ts +85 -0
  454. package/dist/esm/internal/Match.d.ts.map +1 -0
  455. package/dist/esm/internal/Match.js +142 -0
  456. package/dist/esm/internal/Match.js.map +1 -0
  457. package/dist/esm/internal/Paths.d.ts +23 -0
  458. package/dist/esm/internal/Paths.d.ts.map +1 -0
  459. package/dist/esm/internal/Paths.js +40 -0
  460. package/dist/esm/internal/Paths.js.map +1 -0
  461. package/dist/esm/internal/Preserve.d.ts +25 -0
  462. package/dist/esm/internal/Preserve.d.ts.map +1 -0
  463. package/dist/esm/internal/Preserve.js +70 -0
  464. package/dist/esm/internal/Preserve.js.map +1 -0
  465. package/dist/esm/internal/Prune.d.ts +35 -0
  466. package/dist/esm/internal/Prune.d.ts.map +1 -0
  467. package/dist/esm/internal/Prune.js +60 -0
  468. package/dist/esm/internal/Prune.js.map +1 -0
  469. package/dist/esm/internal/RemoteTree.d.ts +60 -0
  470. package/dist/esm/internal/RemoteTree.d.ts.map +1 -0
  471. package/dist/esm/internal/RemoteTree.js +132 -0
  472. package/dist/esm/internal/RemoteTree.js.map +1 -0
  473. package/dist/esm/internal/SearchContract.d.ts +63 -0
  474. package/dist/esm/internal/SearchContract.d.ts.map +1 -0
  475. package/dist/esm/internal/SearchContract.js +66 -0
  476. package/dist/esm/internal/SearchContract.js.map +1 -0
  477. package/dist/esm/internal/Symbols.d.ts +39 -0
  478. package/dist/esm/internal/Symbols.d.ts.map +1 -0
  479. package/dist/esm/internal/Symbols.js +79 -0
  480. package/dist/esm/internal/Symbols.js.map +1 -0
  481. package/dist/esm/internal/Tar.d.ts +23 -0
  482. package/dist/esm/internal/Tar.d.ts.map +1 -0
  483. package/dist/esm/internal/Tar.js +97 -0
  484. package/dist/esm/internal/Tar.js.map +1 -0
  485. package/dist/esm/internal/TestReport.d.ts +52 -0
  486. package/dist/esm/internal/TestReport.d.ts.map +1 -0
  487. package/dist/esm/internal/TestReport.js +172 -0
  488. package/dist/esm/internal/TestReport.js.map +1 -0
  489. package/dist/esm/internal/Text.d.ts +125 -0
  490. package/dist/esm/internal/Text.d.ts.map +1 -0
  491. package/dist/esm/internal/Text.js +141 -0
  492. package/dist/esm/internal/Text.js.map +1 -0
  493. package/dist/esm/internal/Url.d.ts +13 -0
  494. package/dist/esm/internal/Url.d.ts.map +1 -0
  495. package/dist/esm/internal/Url.js +27 -0
  496. package/dist/esm/internal/Url.js.map +1 -0
  497. package/dist/esm/internal/Walk.d.ts +72 -0
  498. package/dist/esm/internal/Walk.d.ts.map +1 -0
  499. package/dist/esm/internal/Walk.js +126 -0
  500. package/dist/esm/internal/Walk.js.map +1 -0
  501. package/docs/README.md +119 -0
  502. package/docs/api.md +499 -0
  503. package/docs/concepts/effects-and-capabilities.md +138 -0
  504. package/docs/concepts/flows-and-handlers.md +115 -0
  505. package/docs/concepts/limits-and-disclosure.md +105 -0
  506. package/docs/concepts/search-contract.md +182 -0
  507. package/docs/guides/bind-the-standard-flows.md +116 -0
  508. package/docs/guides/implement-a-search-peer.md +133 -0
  509. package/docs/guides/pin-a-checkpoint.md +161 -0
  510. package/docs/guides/query-a-language-server.md +257 -0
  511. package/docs/guides/reach-the-network.md +141 -0
  512. package/docs/guides/read-and-edit-a-file.md +240 -0
  513. package/docs/guides/run-a-shell-command.md +236 -0
  514. package/docs/guides/run-the-test-suite.md +154 -0
  515. package/docs/guides/search-a-workspace.md +148 -0
  516. package/docs/installation.md +115 -0
  517. package/docs/quickstart.md +125 -0
  518. package/docs/reference/flows.md +556 -0
  519. package/docs/troubleshooting.md +347 -0
  520. package/package.json +449 -3
  521. package/src/ApplyPatch.ts +458 -0
  522. package/src/Bash.ts +619 -0
  523. package/src/Checkpoints.ts +589 -0
  524. package/src/Container.ts +212 -0
  525. package/src/Edit.ts +366 -0
  526. package/src/ExaWebSearch.ts +145 -0
  527. package/src/Explore.ts +139 -0
  528. package/src/Fetch.ts +117 -0
  529. package/src/Glob.ts +200 -0
  530. package/src/Grep.ts +320 -0
  531. package/src/HttpPost.ts +120 -0
  532. package/src/LanguageServer.ts +110 -0
  533. package/src/Ls.ts +228 -0
  534. package/src/Lsp.ts +184 -0
  535. package/src/Manifest.ts +162 -0
  536. package/src/NativeSearch.ts +457 -0
  537. package/src/NodeLanguageServer.ts +1148 -0
  538. package/src/PortableSearch.ts +284 -0
  539. package/src/Probe.ts +284 -0
  540. package/src/Read.ts +359 -0
  541. package/src/Relocate.ts +166 -0
  542. package/src/RemoteSearch.ts +199 -0
  543. package/src/Search.ts +185 -0
  544. package/src/SearchConformance.ts +288 -0
  545. package/src/SearchContract.ts +489 -0
  546. package/src/ShellCommand.ts +201 -0
  547. package/src/StdError.ts +80 -0
  548. package/src/TestRun.ts +401 -0
  549. package/src/TestRunner.ts +119 -0
  550. package/src/TreeFingerprint.ts +200 -0
  551. package/src/UpdatePlan.ts +171 -0
  552. package/src/WebFetch.ts +194 -0
  553. package/src/WebSearch.ts +165 -0
  554. package/src/Write.ts +195 -0
  555. package/src/index.ts +157 -0
  556. package/src/internal/ApplyPatch.ts +601 -0
  557. package/src/internal/CodexText.ts +182 -0
  558. package/src/internal/Declaration.ts +60 -0
  559. package/src/internal/Diagnostics.ts +134 -0
  560. package/src/internal/EnvelopePrecheck.ts +489 -0
  561. package/src/internal/Exec.ts +427 -0
  562. package/src/internal/FileMutation.ts +231 -0
  563. package/src/internal/FsFailure.ts +51 -0
  564. package/src/internal/GitWorktree.ts +491 -0
  565. package/src/internal/Grouping.ts +106 -0
  566. package/src/internal/Html.ts +87 -0
  567. package/src/internal/Http.ts +209 -0
  568. package/src/internal/HttpNetwork.ts +153 -0
  569. package/src/internal/Ignore.ts +135 -0
  570. package/src/internal/LinearRegex.ts +173 -0
  571. package/src/internal/Match.ts +172 -0
  572. package/src/internal/Paths.ts +42 -0
  573. package/src/internal/Preserve.ts +108 -0
  574. package/src/internal/Prune.ts +62 -0
  575. package/src/internal/RemoteTree.ts +159 -0
  576. package/src/internal/SearchContract.ts +77 -0
  577. package/src/internal/Symbols.ts +88 -0
  578. package/src/internal/Tar.ts +95 -0
  579. package/src/internal/TestReport.ts +194 -0
  580. package/src/internal/Text.ts +185 -0
  581. package/src/internal/Url.ts +23 -0
  582. package/src/internal/Walk.ts +176 -0
@@ -0,0 +1,193 @@
1
+ /**
2
+ * Telling an invalid probe from a failing check.
3
+ *
4
+ * A non-zero exit is a runner's verdict about the code it ran. It is not the
5
+ * runner's verdict about the command it was handed. When an invocation names a
6
+ * test, a file, a module, an environment, or a program that does not exist, the
7
+ * runner never reaches any code and still exits non-zero — and at the tool
8
+ * boundary that is indistinguishable from the bug reproducing. A SWE-bench run
9
+ * lost thirty-nine frames to exactly that: the reproduction named a test method
10
+ * the class does not define, so it read `exitCode: 1` before the edit and
11
+ * `exitCode: 1` after it, and the agent could not tell it had already won.
12
+ *
13
+ * This module names that class. The taxonomy is one idea — *the invocation
14
+ * named something that does not exist* — and {@link Reason} enumerates the five
15
+ * things that something can be. An enumerated answer over prose is a judgment,
16
+ * so Jev makes it: {@link classify} asks the `probe/attribution` classifier
17
+ * whether this exit describes the tree or one of the five, and whether a runner
18
+ * ran anything at all. Nothing here reads the output itself. The judgment used
19
+ * to be nine regexes over runner wording, vetoed by two more over runner
20
+ * tallies, and every phrase they matched is also printed by genuine failures —
21
+ * a bug that *is* an import error, a test that asserts on a shell message — so
22
+ * precision cost recall and both cost maintenance.
23
+ *
24
+ * A zero exit needs no judgment: it belongs to the tree, whatever it printed.
25
+ * A non-zero exit, including 126 or 127, needs attribution. A runner can
26
+ * execute its tests and return either status, so neither proves that the shell
27
+ * refused to launch the check.
28
+ *
29
+ * There is no third path. When the judge does not answer, {@link unjudged}
30
+ * turns its failure into the caller's typed failure: a guess about whether a
31
+ * reproduction reproduced is worth less than nothing, and the caller can say
32
+ * that a result was not judged where it cannot say that a guess was wrong.
33
+ *
34
+ * A flow that can tell the difference reports it under the reserved output key
35
+ * {@link key}. The harness reads that key off an otherwise opaque call result
36
+ * and refuses to count such a result as evidence that anything about the tree
37
+ * changed, which is what stops a broken probe from being cited as a
38
+ * reproduction.
39
+ *
40
+ * @since 1.0.0
41
+ */
42
+ import * as Classifier from "@smthrs/model/Classifier";
43
+ import type * as Evaluator from "@smthrs/model/Evaluator";
44
+ import * as Effect from "effect/Effect";
45
+ import * as Schema from "effect/Schema";
46
+ import * as StdError from "./StdError.ts";
47
+ /**
48
+ * The reserved output key a flow reports an invalid probe under.
49
+ *
50
+ * Stated as a constant because it is a wire contract with the harness rather
51
+ * than a shared type: `@smthrs/harness` reads this key off a `Schema.Json`
52
+ * result and must not depend on the tool library to do it.
53
+ *
54
+ * @category identifiers
55
+ * @since 1.0.0
56
+ */
57
+ export declare const key = "invalidProbe";
58
+ /**
59
+ * What the invocation named that does not exist.
60
+ *
61
+ * Five members, and the classifier offers exactly these five beside `tree`.
62
+ *
63
+ * @category schemas
64
+ * @since 1.0.0
65
+ */
66
+ export declare const Reason: Schema.Literals<readonly ["unknown-command", "unknown-test", "unknown-path", "unknown-module", "unknown-environment"]>;
67
+ /**
68
+ * What the invocation named that does not exist.
69
+ *
70
+ * @category models
71
+ * @since 1.0.0
72
+ */
73
+ export type Reason = typeof Reason.Type;
74
+ /**
75
+ * One command's failure, attributed to the command rather than to the tree.
76
+ *
77
+ * @category schemas
78
+ * @since 1.0.0
79
+ */
80
+ export declare const InvalidProbe: Schema.Struct<{
81
+ readonly reason: Schema.Literals<readonly ["unknown-command", "unknown-test", "unknown-path", "unknown-module", "unknown-environment"]>;
82
+ readonly evidence: Schema.String;
83
+ readonly message: Schema.String;
84
+ }>;
85
+ /**
86
+ * One command's failure, attributed to the command rather than to the tree.
87
+ *
88
+ * @category models
89
+ * @since 1.0.0
90
+ */
91
+ export type InvalidProbe = typeof InvalidProbe.Type;
92
+ /**
93
+ * What one command's exit code was attributed to.
94
+ *
95
+ * `to` is the tree, or the kind of name the command could not resolve, and
96
+ * `invalidProbe` is present in exactly the second case, ready to report under
97
+ * {@link key}. `executed` is the judge's separate reading of whether a runner
98
+ * ran any test, absent when nothing was asked.
99
+ *
100
+ * @category models
101
+ * @since 1.0.0
102
+ */
103
+ export interface Attribution {
104
+ readonly to: "tree" | Reason;
105
+ readonly executed?: boolean;
106
+ readonly invalidProbe?: InvalidProbe;
107
+ }
108
+ /**
109
+ * The confidence an attribution needs before it outranks the tree.
110
+ *
111
+ * Below it the failure is the tree's, which is the reading that leaves the
112
+ * caller the output it would have had anyway. A missed invalid probe costs a
113
+ * reader nothing it had; a false one tells it its reproduction proved nothing.
114
+ *
115
+ * @category constants
116
+ * @since 1.0.0
117
+ */
118
+ export declare const CONFIDENCE_FLOOR = 0.7;
119
+ /**
120
+ * The most output bytes one judgment carries, newest kept.
121
+ *
122
+ * A runner prints its refusal last, and the classifier's whole state is held
123
+ * to 32 KiB.
124
+ *
125
+ * @category constants
126
+ * @since 1.0.0
127
+ */
128
+ export declare const MAX_OUTPUT_BYTES: number;
129
+ /**
130
+ * The standard-flow failure a judge that did not answer is.
131
+ *
132
+ * A handler that cannot say whether a failing command failed about itself has
133
+ * no result to return: reporting the exit code alone is the reading that lost
134
+ * the thirty-nine frames. So the call fails, the code names which way the
135
+ * gateway went wrong, and the message says what is missing and how a host
136
+ * supplies it.
137
+ *
138
+ * @category errors
139
+ * @since 1.0.0
140
+ */
141
+ export declare const unjudged: (error: Classifier.ClassifierError) => StdError.StdError;
142
+ /**
143
+ * What one failed command's exit code describes: the tree, or a name the
144
+ * command could not resolve.
145
+ *
146
+ * No cell calls this classifier. {@link classify} asks it on behalf of the
147
+ * `test` flow, which has the command and its output and has no task to judge
148
+ * them against, so the state is the three facts of the run and the questions
149
+ * carry every criterion themselves. It is declared here rather than in a
150
+ * catalog a host binds: a door for the model to ask this would be a door onto
151
+ * a judgment the flow has already made.
152
+ *
153
+ * @category classifiers
154
+ * @since 1.0.0
155
+ */
156
+ export declare const probeAttribution: Classifier.Classifier<"probe/attribution", Schema.Struct<{
157
+ readonly command: Schema.String;
158
+ readonly exitCode: Schema.Int;
159
+ readonly output: Schema.String;
160
+ }>, {
161
+ readonly attribution: Omit<Evaluator.ChoiceQuestion, "criteria"> & {
162
+ readonly criteria: {
163
+ readonly tree: "the command ran the intended tests and the failure is the code's";
164
+ readonly "unknown-command": "the shell could not find the program it was asked to run";
165
+ readonly "unknown-test": "the test runner could not find the test that was named";
166
+ readonly "unknown-path": "the file or directory that was named does not exist";
167
+ readonly "unknown-module": "the module that was imported does not exist here";
168
+ readonly "unknown-environment": "the runner has no environment by that name";
169
+ };
170
+ };
171
+ readonly executed: Evaluator.BooleanQuestion;
172
+ }>;
173
+ /**
174
+ * Attributes one command result to the tree, or to a name the command could
175
+ * not resolve.
176
+ *
177
+ * A zero exit needs no judgment. Every non-zero exit, including 126 and 127,
178
+ * goes through the attribution classifier: a runner may choose either code
179
+ * after executing tests. An answer under {@link CONFIDENCE_FLOOR} is the tree's
180
+ * failure, reported with the `executed` reading beside it.
181
+ *
182
+ * Pass the text the caller will actually return, so the judgment is made on
183
+ * the output the reader can see.
184
+ *
185
+ * @category classification
186
+ * @since 1.0.0
187
+ */
188
+ export declare const classify: (result: {
189
+ readonly command: string;
190
+ readonly exitCode: number;
191
+ readonly output: string;
192
+ }) => Effect.Effect<Attribution, Classifier.ClassifierError, Evaluator.Evaluator>;
193
+ //# sourceMappingURL=Probe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Probe.d.ts","sourceRoot":"","sources":["../../src/Probe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,KAAK,UAAU,MAAM,0BAA0B,CAAA;AACtD,OAAO,KAAK,KAAK,SAAS,MAAM,yBAAyB,CAAA;AACzD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AAEzC;;;;;;;;;GASG;AACH,eAAO,MAAM,GAAG,iBAAiB,CAAA;AAEjC;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM,wHAMjB,CAAA;AAEF;;;;;GAKG;AACH,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC,IAAI,CAAA;AAEvC;;;;;GAKG;AACH,eAAO,MAAM,YAAY;;;;EAMvB,CAAA;AAEF;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC,IAAI,CAAA;AAEnD;;;;;;;;;;GAUG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAC3B,QAAQ,CAAC,YAAY,CAAC,EAAE,YAAY,CAAA;CACrC;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,MAAM,CAAA;AAEnC;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,QAAY,CAAA;AAuCzC;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,QAAQ,GAAI,OAAO,UAAU,CAAC,eAAe,KAAG,QAAQ,CAAC,QAKlE,CAAA;AAEJ;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;EA4B3B,CAAA;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,QAAQ;sBACD,MAAM;uBACL,MAAM;qBACR,MAAM;iFAiBvB,CAAA"}
@@ -0,0 +1,225 @@
1
+ /**
2
+ * Telling an invalid probe from a failing check.
3
+ *
4
+ * A non-zero exit is a runner's verdict about the code it ran. It is not the
5
+ * runner's verdict about the command it was handed. When an invocation names a
6
+ * test, a file, a module, an environment, or a program that does not exist, the
7
+ * runner never reaches any code and still exits non-zero — and at the tool
8
+ * boundary that is indistinguishable from the bug reproducing. A SWE-bench run
9
+ * lost thirty-nine frames to exactly that: the reproduction named a test method
10
+ * the class does not define, so it read `exitCode: 1` before the edit and
11
+ * `exitCode: 1` after it, and the agent could not tell it had already won.
12
+ *
13
+ * This module names that class. The taxonomy is one idea — *the invocation
14
+ * named something that does not exist* — and {@link Reason} enumerates the five
15
+ * things that something can be. An enumerated answer over prose is a judgment,
16
+ * so Jev makes it: {@link classify} asks the `probe/attribution` classifier
17
+ * whether this exit describes the tree or one of the five, and whether a runner
18
+ * ran anything at all. Nothing here reads the output itself. The judgment used
19
+ * to be nine regexes over runner wording, vetoed by two more over runner
20
+ * tallies, and every phrase they matched is also printed by genuine failures —
21
+ * a bug that *is* an import error, a test that asserts on a shell message — so
22
+ * precision cost recall and both cost maintenance.
23
+ *
24
+ * A zero exit needs no judgment: it belongs to the tree, whatever it printed.
25
+ * A non-zero exit, including 126 or 127, needs attribution. A runner can
26
+ * execute its tests and return either status, so neither proves that the shell
27
+ * refused to launch the check.
28
+ *
29
+ * There is no third path. When the judge does not answer, {@link unjudged}
30
+ * turns its failure into the caller's typed failure: a guess about whether a
31
+ * reproduction reproduced is worth less than nothing, and the caller can say
32
+ * that a result was not judged where it cannot say that a guess was wrong.
33
+ *
34
+ * A flow that can tell the difference reports it under the reserved output key
35
+ * {@link key}. The harness reads that key off an otherwise opaque call result
36
+ * and refuses to count such a result as evidence that anything about the tree
37
+ * changed, which is what stops a broken probe from being cited as a
38
+ * reproduction.
39
+ *
40
+ * @since 1.0.0
41
+ */
42
+ import * as Classifier from "@smthrs/model/Classifier";
43
+ import * as Effect from "effect/Effect";
44
+ import * as Option from "effect/Option";
45
+ import * as Schema from "effect/Schema";
46
+ import { truncateBytes } from "./internal/Text.js";
47
+ import * as StdError from "./StdError.js";
48
+ /**
49
+ * The reserved output key a flow reports an invalid probe under.
50
+ *
51
+ * Stated as a constant because it is a wire contract with the harness rather
52
+ * than a shared type: `@smthrs/harness` reads this key off a `Schema.Json`
53
+ * result and must not depend on the tool library to do it.
54
+ *
55
+ * @category identifiers
56
+ * @since 1.0.0
57
+ */
58
+ export const key = "invalidProbe";
59
+ /**
60
+ * What the invocation named that does not exist.
61
+ *
62
+ * Five members, and the classifier offers exactly these five beside `tree`.
63
+ *
64
+ * @category schemas
65
+ * @since 1.0.0
66
+ */
67
+ export const Reason = Schema.Literals([
68
+ "unknown-command",
69
+ "unknown-test",
70
+ "unknown-path",
71
+ "unknown-module",
72
+ "unknown-environment"
73
+ ]);
74
+ /**
75
+ * One command's failure, attributed to the command rather than to the tree.
76
+ *
77
+ * @category schemas
78
+ * @since 1.0.0
79
+ */
80
+ export const InvalidProbe = Schema.Struct({
81
+ reason: Reason.annotate({ description: "Which kind of name the command could not resolve" }),
82
+ evidence: Schema.String.annotate({
83
+ description: "What this attribution rests on: the shell's own exit code, or the judge's reading and how sure it is"
84
+ }),
85
+ message: Schema.String.annotate({ description: "What the failure does and does not prove, stated for the caller" })
86
+ });
87
+ /**
88
+ * The confidence an attribution needs before it outranks the tree.
89
+ *
90
+ * Below it the failure is the tree's, which is the reading that leaves the
91
+ * caller the output it would have had anyway. A missed invalid probe costs a
92
+ * reader nothing it had; a false one tells it its reproduction proved nothing.
93
+ *
94
+ * @category constants
95
+ * @since 1.0.0
96
+ */
97
+ export const CONFIDENCE_FLOOR = 0.7;
98
+ /**
99
+ * The most output bytes one judgment carries, newest kept.
100
+ *
101
+ * A runner prints its refusal last, and the classifier's whole state is held
102
+ * to 32 KiB.
103
+ *
104
+ * @category constants
105
+ * @since 1.0.0
106
+ */
107
+ export const MAX_OUTPUT_BYTES = 32 * 1024;
108
+ /** What each reason means, in the second half of one sentence. */
109
+ const named = {
110
+ "unknown-command": "the shell could not find the program it was asked to run",
111
+ "unknown-test": "the test runner could not find the test that was named",
112
+ "unknown-path": "the file or directory that was named does not exist",
113
+ "unknown-module": "the module that was imported does not exist here",
114
+ "unknown-environment": "the runner has no environment by that name"
115
+ };
116
+ const explain = (reason) => `This command never ran a check: ${named[reason]}. The non-zero exit describes the command, not the code under test, so it is not a reproduction and reads the same before and after a correct fix. Find the real names, repair the command, and run it again before drawing any conclusion from it.`;
117
+ const invalid = (reason, evidence) => ({
118
+ reason,
119
+ evidence,
120
+ message: explain(reason)
121
+ });
122
+ /** How the judge's own reading is quoted back to the caller. */
123
+ const judged = (reason, confidence, executed) => `the judge read this output as ${reason} at confidence ${confidence.toFixed(2)}${executed ? ", although the runner also reported that it ran tests" : ""}`;
124
+ /** Which typed failure each way the judge can fail to answer is. */
125
+ const unjudgedCode = {
126
+ unconfigured: "provider_unavailable",
127
+ unreachable: "provider_unavailable",
128
+ refused: "provider_unavailable",
129
+ empty: "provider_unavailable",
130
+ timeout: "timeout",
131
+ invalid_answer: "request_failed",
132
+ invalid_question: "request_failed"
133
+ };
134
+ /**
135
+ * The standard-flow failure a judge that did not answer is.
136
+ *
137
+ * A handler that cannot say whether a failing command failed about itself has
138
+ * no result to return: reporting the exit code alone is the reading that lost
139
+ * the thirty-nine frames. So the call fails, the code names which way the
140
+ * gateway went wrong, and the message says what is missing and how a host
141
+ * supplies it.
142
+ *
143
+ * @category errors
144
+ * @since 1.0.0
145
+ */
146
+ export const unjudged = (error) => new StdError.StdError({
147
+ code: unjudgedCode[error.code],
148
+ message: `This result was not judged: the attribution judge answered ${error.code}. ${error.message} Nothing here says whether the non-zero exit is the code's failure or the command's, and a guess at that is worth less than no answer. Connect a subscription seat for the evaluator, then run the command again.`
149
+ });
150
+ /**
151
+ * What one failed command's exit code describes: the tree, or a name the
152
+ * command could not resolve.
153
+ *
154
+ * No cell calls this classifier. {@link classify} asks it on behalf of the
155
+ * `test` flow, which has the command and its output and has no task to judge
156
+ * them against, so the state is the three facts of the run and the questions
157
+ * carry every criterion themselves. It is declared here rather than in a
158
+ * catalog a host binds: a door for the model to ask this would be a door onto
159
+ * a judgment the flow has already made.
160
+ *
161
+ * @category classifiers
162
+ * @since 1.0.0
163
+ */
164
+ export const probeAttribution = Classifier.make("probe/attribution", {
165
+ description: "Judge one failed command: whether it ran the tests it named and failed about the code, or never resolved a name it was given.",
166
+ state: Schema.Struct({
167
+ command: Schema.String.annotate({ description: "The command that ran" }),
168
+ exitCode: Schema.Int.annotate({ description: "Its exit code, which is not zero" }),
169
+ output: Schema.String.annotate({ description: "Its captured stdout and stderr, newest bytes when clipped" })
170
+ }),
171
+ questions: {
172
+ attribution: Classifier.choice({
173
+ instructions: "What does this non-zero exit describe?",
174
+ criteria: {
175
+ tree: "the command ran the intended tests and the failure is the code's",
176
+ "unknown-command": "the shell could not find the program it was asked to run",
177
+ "unknown-test": "the test runner could not find the test that was named",
178
+ "unknown-path": "the file or directory that was named does not exist",
179
+ "unknown-module": "the module that was imported does not exist here",
180
+ "unknown-environment": "the runner has no environment by that name"
181
+ }
182
+ }),
183
+ executed: Classifier.boolean({
184
+ instructions: "Did a test runner actually run tests?",
185
+ criteria: {
186
+ true: "the runner reported its own tally of tests that ran, such as a count of passes or failures",
187
+ false: "nothing in the output reports that any test was executed"
188
+ }
189
+ })
190
+ }
191
+ });
192
+ /**
193
+ * Attributes one command result to the tree, or to a name the command could
194
+ * not resolve.
195
+ *
196
+ * A zero exit needs no judgment. Every non-zero exit, including 126 and 127,
197
+ * goes through the attribution classifier: a runner may choose either code
198
+ * after executing tests. An answer under {@link CONFIDENCE_FLOOR} is the tree's
199
+ * failure, reported with the `executed` reading beside it.
200
+ *
201
+ * Pass the text the caller will actually return, so the judgment is made on
202
+ * the output the reader can see.
203
+ *
204
+ * @category classification
205
+ * @since 1.0.0
206
+ */
207
+ export const classify = Effect.fn("Probe.classify")(function* (result) {
208
+ if (result.exitCode === 0)
209
+ return { to: "tree" };
210
+ const answers = yield* probeAttribution.evaluate({
211
+ command: result.command,
212
+ exitCode: result.exitCode,
213
+ output: truncateBytes(result.output, MAX_OUTPUT_BYTES, { keep: "tail" }).text
214
+ });
215
+ const executed = answers.executed.value;
216
+ const decided = Option.getOrUndefined(Classifier.confident(answers.attribution, CONFIDENCE_FLOOR));
217
+ return decided === undefined || decided === "tree"
218
+ ? { to: "tree", executed }
219
+ : {
220
+ to: decided,
221
+ executed,
222
+ invalidProbe: invalid(decided, judged(decided, answers.attribution.confidence, executed))
223
+ };
224
+ });
225
+ //# sourceMappingURL=Probe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Probe.js","sourceRoot":"","sources":["../../src/Probe.ts"],"names":[],"mappings":"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","sourcesContent":["/**\n * Telling an invalid probe from a failing check.\n *\n * A non-zero exit is a runner's verdict about the code it ran. It is not the\n * runner's verdict about the command it was handed. When an invocation names a\n * test, a file, a module, an environment, or a program that does not exist, the\n * runner never reaches any code and still exits non-zero — and at the tool\n * boundary that is indistinguishable from the bug reproducing. A SWE-bench run\n * lost thirty-nine frames to exactly that: the reproduction named a test method\n * the class does not define, so it read `exitCode: 1` before the edit and\n * `exitCode: 1` after it, and the agent could not tell it had already won.\n *\n * This module names that class. The taxonomy is one idea — *the invocation\n * named something that does not exist* — and {@link Reason} enumerates the five\n * things that something can be. An enumerated answer over prose is a judgment,\n * so Jev makes it: {@link classify} asks the `probe/attribution` classifier\n * whether this exit describes the tree or one of the five, and whether a runner\n * ran anything at all. Nothing here reads the output itself. The judgment used\n * to be nine regexes over runner wording, vetoed by two more over runner\n * tallies, and every phrase they matched is also printed by genuine failures —\n * a bug that *is* an import error, a test that asserts on a shell message — so\n * precision cost recall and both cost maintenance.\n *\n * A zero exit needs no judgment: it belongs to the tree, whatever it printed.\n * A non-zero exit, including 126 or 127, needs attribution. A runner can\n * execute its tests and return either status, so neither proves that the shell\n * refused to launch the check.\n *\n * There is no third path. When the judge does not answer, {@link unjudged}\n * turns its failure into the caller's typed failure: a guess about whether a\n * reproduction reproduced is worth less than nothing, and the caller can say\n * that a result was not judged where it cannot say that a guess was wrong.\n *\n * A flow that can tell the difference reports it under the reserved output key\n * {@link key}. The harness reads that key off an otherwise opaque call result\n * and refuses to count such a result as evidence that anything about the tree\n * changed, which is what stops a broken probe from being cited as a\n * reproduction.\n *\n * @since 1.0.0\n */\n\nimport * as Classifier from \"@smthrs/model/Classifier\"\nimport type * as Evaluator from \"@smthrs/model/Evaluator\"\nimport * as Effect from \"effect/Effect\"\nimport * as Option from \"effect/Option\"\nimport * as Schema from \"effect/Schema\"\nimport { truncateBytes } from \"./internal/Text.ts\"\nimport * as StdError from \"./StdError.ts\"\n\n/**\n * The reserved output key a flow reports an invalid probe under.\n *\n * Stated as a constant because it is a wire contract with the harness rather\n * than a shared type: `@smthrs/harness` reads this key off a `Schema.Json`\n * result and must not depend on the tool library to do it.\n *\n * @category identifiers\n * @since 1.0.0\n */\nexport const key = \"invalidProbe\"\n\n/**\n * What the invocation named that does not exist.\n *\n * Five members, and the classifier offers exactly these five beside `tree`.\n *\n * @category schemas\n * @since 1.0.0\n */\nexport const Reason = Schema.Literals([\n \"unknown-command\",\n \"unknown-test\",\n \"unknown-path\",\n \"unknown-module\",\n \"unknown-environment\"\n])\n\n/**\n * What the invocation named that does not exist.\n *\n * @category models\n * @since 1.0.0\n */\nexport type Reason = typeof Reason.Type\n\n/**\n * One command's failure, attributed to the command rather than to the tree.\n *\n * @category schemas\n * @since 1.0.0\n */\nexport const InvalidProbe = Schema.Struct({\n reason: Reason.annotate({ description: \"Which kind of name the command could not resolve\" }),\n evidence: Schema.String.annotate({\n description: \"What this attribution rests on: the shell's own exit code, or the judge's reading and how sure it is\"\n }),\n message: Schema.String.annotate({ description: \"What the failure does and does not prove, stated for the caller\" })\n})\n\n/**\n * One command's failure, attributed to the command rather than to the tree.\n *\n * @category models\n * @since 1.0.0\n */\nexport type InvalidProbe = typeof InvalidProbe.Type\n\n/**\n * What one command's exit code was attributed to.\n *\n * `to` is the tree, or the kind of name the command could not resolve, and\n * `invalidProbe` is present in exactly the second case, ready to report under\n * {@link key}. `executed` is the judge's separate reading of whether a runner\n * ran any test, absent when nothing was asked.\n *\n * @category models\n * @since 1.0.0\n */\nexport interface Attribution {\n readonly to: \"tree\" | Reason\n readonly executed?: boolean\n readonly invalidProbe?: InvalidProbe\n}\n\n/**\n * The confidence an attribution needs before it outranks the tree.\n *\n * Below it the failure is the tree's, which is the reading that leaves the\n * caller the output it would have had anyway. A missed invalid probe costs a\n * reader nothing it had; a false one tells it its reproduction proved nothing.\n *\n * @category constants\n * @since 1.0.0\n */\nexport const CONFIDENCE_FLOOR = 0.7\n\n/**\n * The most output bytes one judgment carries, newest kept.\n *\n * A runner prints its refusal last, and the classifier's whole state is held\n * to 32 KiB.\n *\n * @category constants\n * @since 1.0.0\n */\nexport const MAX_OUTPUT_BYTES = 32 * 1024\n\n/** What each reason means, in the second half of one sentence. */\nconst named: Record<Reason, string> = {\n \"unknown-command\": \"the shell could not find the program it was asked to run\",\n \"unknown-test\": \"the test runner could not find the test that was named\",\n \"unknown-path\": \"the file or directory that was named does not exist\",\n \"unknown-module\": \"the module that was imported does not exist here\",\n \"unknown-environment\": \"the runner has no environment by that name\"\n}\n\nconst explain = (reason: Reason): string =>\n `This command never ran a check: ${\n named[reason]\n }. The non-zero exit describes the command, not the code under test, so it is not a reproduction and reads the same before and after a correct fix. Find the real names, repair the command, and run it again before drawing any conclusion from it.`\n\nconst invalid = (reason: Reason, evidence: string): InvalidProbe => ({\n reason,\n evidence,\n message: explain(reason)\n})\n\n/** How the judge's own reading is quoted back to the caller. */\nconst judged = (reason: Reason, confidence: number, executed: boolean): string =>\n `the judge read this output as ${reason} at confidence ${confidence.toFixed(2)}${\n executed ? \", although the runner also reported that it ran tests\" : \"\"\n }`\n\n/** Which typed failure each way the judge can fail to answer is. */\nconst unjudgedCode: Record<Evaluator.EvaluatorErrorCode, StdError.Code> = {\n unconfigured: \"provider_unavailable\",\n unreachable: \"provider_unavailable\",\n refused: \"provider_unavailable\",\n empty: \"provider_unavailable\",\n timeout: \"timeout\",\n invalid_answer: \"request_failed\",\n invalid_question: \"request_failed\"\n}\n\n/**\n * The standard-flow failure a judge that did not answer is.\n *\n * A handler that cannot say whether a failing command failed about itself has\n * no result to return: reporting the exit code alone is the reading that lost\n * the thirty-nine frames. So the call fails, the code names which way the\n * gateway went wrong, and the message says what is missing and how a host\n * supplies it.\n *\n * @category errors\n * @since 1.0.0\n */\nexport const unjudged = (error: Classifier.ClassifierError): StdError.StdError =>\n new StdError.StdError({\n code: unjudgedCode[error.code],\n message:\n `This result was not judged: the attribution judge answered ${error.code}. ${error.message} Nothing here says whether the non-zero exit is the code's failure or the command's, and a guess at that is worth less than no answer. Connect a subscription seat for the evaluator, then run the command again.`\n })\n\n/**\n * What one failed command's exit code describes: the tree, or a name the\n * command could not resolve.\n *\n * No cell calls this classifier. {@link classify} asks it on behalf of the\n * `test` flow, which has the command and its output and has no task to judge\n * them against, so the state is the three facts of the run and the questions\n * carry every criterion themselves. It is declared here rather than in a\n * catalog a host binds: a door for the model to ask this would be a door onto\n * a judgment the flow has already made.\n *\n * @category classifiers\n * @since 1.0.0\n */\nexport const probeAttribution = Classifier.make(\"probe/attribution\", {\n description:\n \"Judge one failed command: whether it ran the tests it named and failed about the code, or never resolved a name it was given.\",\n state: Schema.Struct({\n command: Schema.String.annotate({ description: \"The command that ran\" }),\n exitCode: Schema.Int.annotate({ description: \"Its exit code, which is not zero\" }),\n output: Schema.String.annotate({ description: \"Its captured stdout and stderr, newest bytes when clipped\" })\n }),\n questions: {\n attribution: Classifier.choice({\n instructions: \"What does this non-zero exit describe?\",\n criteria: {\n tree: \"the command ran the intended tests and the failure is the code's\",\n \"unknown-command\": \"the shell could not find the program it was asked to run\",\n \"unknown-test\": \"the test runner could not find the test that was named\",\n \"unknown-path\": \"the file or directory that was named does not exist\",\n \"unknown-module\": \"the module that was imported does not exist here\",\n \"unknown-environment\": \"the runner has no environment by that name\"\n }\n }),\n executed: Classifier.boolean({\n instructions: \"Did a test runner actually run tests?\",\n criteria: {\n true: \"the runner reported its own tally of tests that ran, such as a count of passes or failures\",\n false: \"nothing in the output reports that any test was executed\"\n }\n })\n }\n})\n\n/**\n * Attributes one command result to the tree, or to a name the command could\n * not resolve.\n *\n * A zero exit needs no judgment. Every non-zero exit, including 126 and 127,\n * goes through the attribution classifier: a runner may choose either code\n * after executing tests. An answer under {@link CONFIDENCE_FLOOR} is the tree's\n * failure, reported with the `executed` reading beside it.\n *\n * Pass the text the caller will actually return, so the judgment is made on\n * the output the reader can see.\n *\n * @category classification\n * @since 1.0.0\n */\nexport const classify = Effect.fn(\"Probe.classify\")(function*(result: {\n readonly command: string\n readonly exitCode: number\n readonly output: string\n}): Effect.fn.Return<Attribution, Classifier.ClassifierError, Evaluator.Evaluator> {\n if (result.exitCode === 0) return { to: \"tree\" }\n const answers = yield* probeAttribution.evaluate({\n command: result.command,\n exitCode: result.exitCode,\n output: truncateBytes(result.output, MAX_OUTPUT_BYTES, { keep: \"tail\" }).text\n })\n const executed = answers.executed.value\n const decided = Option.getOrUndefined(Classifier.confident(answers.attribution, CONFIDENCE_FLOOR))\n return decided === undefined || decided === \"tree\"\n ? { to: \"tree\", executed }\n : {\n to: decided,\n executed,\n invalidProbe: invalid(decided, judged(decided, answers.attribution.confidence, executed))\n }\n})\n"]}
@@ -0,0 +1,189 @@
1
+ /**
2
+ * Read flow declaration and portable handler.
3
+ *
4
+ * `content` is raw file text. It used to be rendered as `NNN\t<line>`, and that
5
+ * rendering was the single most expensive tool defect measured on the 45-instance
6
+ * SWE-bench trace program: an anchor copied out of a read carried the gutter, so
7
+ * every `edit` built from a read missed, and every cell that wanted a literal
8
+ * line had to strip the prefix in JavaScript first. Two instances (django-13346,
9
+ * django-14351) spent whole frames writing string surgery against text the file
10
+ * does not contain. Line numbers are facts about the page, so they are page
11
+ * fields — `startLine` and `endLine` — and never bytes inside the text.
12
+ *
13
+ * Every line in `content` is a whole line: a page cut short by the byte budget
14
+ * drops its trailing partial line rather than handing back a fragment that looks
15
+ * like an anchor and is not one. CRLF lines retain their trailing CR; only
16
+ * the page's final LF is omitted.
17
+ *
18
+ * @since 1.0.0
19
+ */
20
+ import * as Effect from "effect/Effect";
21
+ import * as FileSystem from "effect/FileSystem";
22
+ import * as Schema from "effect/Schema";
23
+ import * as StdError from "./StdError.ts";
24
+ export { Preconditions, ReadSession, type VersionedFileSystem } from "./internal/FileMutation.ts";
25
+ /**
26
+ * Registry name for the read flow.
27
+ *
28
+ * @category identifiers
29
+ * @since 1.0.0
30
+ */
31
+ export declare const name = "read";
32
+ /**
33
+ * Model-facing description of the read flow.
34
+ *
35
+ * @category descriptions
36
+ * @since 1.0.0
37
+ */
38
+ export declare const description = "Read a text file by 1-based offset and limit. content is RAW file text with no line-number prefixes, so any line of it is an edit anchor as it stands; the numbers are startLine/endLine.";
39
+ /**
40
+ * Input schema for the read flow.
41
+ *
42
+ * @category schemas
43
+ * @since 1.0.0
44
+ */
45
+ export declare const Input: Schema.Struct<{
46
+ readonly path: Schema.String;
47
+ readonly offset: Schema.optional<Schema.Int>;
48
+ readonly limit: Schema.optional<Schema.Int>;
49
+ }>;
50
+ /**
51
+ * Decoded input accepted by the `read` flow.
52
+ *
53
+ * @category models
54
+ * @since 1.0.0
55
+ */
56
+ export type Input = typeof Input.Type;
57
+ /**
58
+ * Output schema for the read flow.
59
+ *
60
+ * @category schemas
61
+ * @since 1.0.0
62
+ */
63
+ export declare const Output: Schema.Struct<{
64
+ readonly content: Schema.String;
65
+ readonly startLine: Schema.Number;
66
+ readonly endLine: Schema.Number;
67
+ readonly totalLines: Schema.Number;
68
+ readonly truncated: Schema.Boolean;
69
+ readonly notice: Schema.optional<Schema.String>;
70
+ }>;
71
+ /**
72
+ * Decoded output returned by the `read` flow.
73
+ *
74
+ * @category models
75
+ * @since 1.0.0
76
+ */
77
+ export type Output = typeof Output.Type;
78
+ /**
79
+ * Static conservative effect envelope for the read flow.
80
+ *
81
+ * @category effects
82
+ * @since 1.0.0
83
+ */
84
+ export declare const effects: import("@smthrs/plan/Effects").Declaration;
85
+ /**
86
+ * Narrows the read effect envelope to one input path.
87
+ *
88
+ * @category effects
89
+ * @since 1.0.0
90
+ */
91
+ export declare const effectsFor: (input: typeof Input.Type) => import("@smthrs/plan/Effects").Declaration;
92
+ /**
93
+ * Capabilities required by the read flow.
94
+ *
95
+ * @category capabilities
96
+ * @since 1.0.0
97
+ */
98
+ export declare const capabilities: string[];
99
+ /**
100
+ * Declaration-only read flow.
101
+ *
102
+ * @category flows
103
+ * @since 1.0.0
104
+ */
105
+ export declare const flow: {
106
+ readonly name: "read";
107
+ readonly description: "Read a text file by 1-based offset and limit. content is RAW file text with no line-number prefixes, so any line of it is an edit anchor as it stands; the numbers are startLine/endLine.";
108
+ readonly input: Schema.Struct<{
109
+ readonly path: Schema.String;
110
+ readonly offset: Schema.optional<Schema.Int>;
111
+ readonly limit: Schema.optional<Schema.Int>;
112
+ }>;
113
+ readonly output: Schema.Struct<{
114
+ readonly content: Schema.String;
115
+ readonly startLine: Schema.Number;
116
+ readonly endLine: Schema.Number;
117
+ readonly totalLines: Schema.Number;
118
+ readonly truncated: Schema.Boolean;
119
+ readonly notice: Schema.optional<Schema.String>;
120
+ }>;
121
+ readonly capabilities: string[];
122
+ readonly effects: import("@smthrs/plan/Effects").Declaration;
123
+ };
124
+ /**
125
+ * What a call to this flow does, for a reader of a run.
126
+ *
127
+ * Display metadata only. `@smthrs/registry` `Descriptor.FlowActivity` is the
128
+ * governing vocabulary and `StandardFlows` binds this value onto the flow's
129
+ * descriptor, where the binding site checks it. `declarationDigest` excludes
130
+ * it, so declaring it cannot invalidate a call identity or a cached prompt.
131
+ *
132
+ * @category presentation
133
+ * @since 1.0.0-rc.0
134
+ */
135
+ export declare const activity: "reads";
136
+ /**
137
+ * How one recorded call to this flow reads: the verb for each settlement, the
138
+ * input field that is its subject, and the measured output fields a one-line
139
+ * summary may count.
140
+ *
141
+ * Display metadata only, governed by `@smthrs/registry`
142
+ * `Descriptor.CallPresentation` and checked where `StandardFlows` binds it.
143
+ *
144
+ * @category presentation
145
+ * @since 1.0.0-rc.0
146
+ */
147
+ export declare const presentation: {
148
+ readonly verb: {
149
+ readonly pending: "reading";
150
+ readonly success: "read";
151
+ readonly failure: "failed to read";
152
+ };
153
+ readonly subject: "path";
154
+ readonly result: "read";
155
+ };
156
+ /**
157
+ * The largest file `read` loads.
158
+ *
159
+ * `read` decodes the whole file to count its lines, so the file is held in
160
+ * memory twice over: its bytes and a UTF-16 string. Past this bound a page
161
+ * read would cost the host gigabytes for a window of a few thousand lines,
162
+ * and past 2 GiB Node cannot load the file at all.
163
+ *
164
+ * @category constants
165
+ * @since 1.0.0
166
+ */
167
+ export declare const MAX_READ_FILE_BYTES: number;
168
+ /**
169
+ * Reads, validates, and renders one page of a UTF-8 text file.
170
+ *
171
+ * The kernel filesystem exposes bytes rather than a guaranteed UTF-8 string,
172
+ * so decoding is deliberately fatal to keep binary input in the typed channel.
173
+ *
174
+ * @category handlers
175
+ * @since 1.0.0
176
+ */
177
+ export declare const run: (input: {
178
+ readonly path: string;
179
+ readonly limit?: number | undefined;
180
+ readonly offset?: number | undefined;
181
+ }) => Effect.Effect<{
182
+ readonly content: string;
183
+ readonly endLine: number;
184
+ readonly startLine: number;
185
+ readonly truncated: boolean;
186
+ readonly totalLines: number;
187
+ readonly notice?: string | undefined;
188
+ }, StdError.StdError, FileSystem.FileSystem>;
189
+ //# sourceMappingURL=Read.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Read.d.ts","sourceRoot":"","sources":["../../src/Read.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAA;AAE/C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAKvC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AAEzC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,KAAK,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AAEjG;;;;;GAKG;AACH,eAAO,MAAM,IAAI,SAAS,CAAA;AAE1B;;;;;GAKG;AACH,eAAO,MAAM,WAAW,8LACqK,CAAA;AAE7L;;;;;GAKG;AACH,eAAO,MAAM,KAAK;;;;EAQhB,CAAA;AAEF;;;;;GAKG;AACH,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAErC;;;;;GAKG;AACH,eAAO,MAAM,MAAM;;;;;;;EAWjB,CAAA;AAEF;;;;;GAKG;AACH,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC,IAAI,CAAA;AAEvC;;;;;GAKG;AACH,eAAO,MAAM,OAAO,4CAKlB,CAAA;AAEF;;;;;GAKG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO,OAAO,KAAK,CAAC,IAAI,+CAM/C,CAAA;AAEJ;;;;;GAKG;AACH,eAAO,MAAM,YAAY,UAAiC,CAAA;AAE1D;;;;;GAKG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;CAAsF,CAAA;AAEvG;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ,EAAG,OAAgB,CAAA;AAExC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY;;;;;;;;CAIf,CAAA;AAaV;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mBAAmB,QAAmB,CAAA;AAuDnD;;;;;;;;GAQG;AACH,eAAO,MAAM,GAAG;;;;;;;;;;;4CAmGd,CAAA"}