@smthrs/std 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 (555) hide show
  1. package/CHANGELOG.md +130 -0
  2. package/LICENSE +21 -0
  3. package/README.md +152 -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 +380 -0
  9. package/dist/cjs/Bash.d.ts.map +1 -0
  10. package/dist/cjs/Bash.js +332 -0
  11. package/dist/cjs/Bash.js.map +7 -0
  12. package/dist/cjs/Checkpoints.d.ts +279 -0
  13. package/dist/cjs/Checkpoints.d.ts.map +1 -0
  14. package/dist/cjs/Checkpoints.js +145 -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 +24 -0
  73. package/dist/cjs/PortableSearch.d.ts.map +1 -0
  74. package/dist/cjs/PortableSearch.js +233 -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/Search.d.ts +163 -0
  89. package/dist/cjs/Search.d.ts.map +1 -0
  90. package/dist/cjs/Search.js +51 -0
  91. package/dist/cjs/Search.js.map +7 -0
  92. package/dist/cjs/SearchConformance.d.ts +115 -0
  93. package/dist/cjs/SearchConformance.d.ts.map +1 -0
  94. package/dist/cjs/SearchConformance.js +172 -0
  95. package/dist/cjs/SearchConformance.js.map +7 -0
  96. package/dist/cjs/SearchContract.d.ts +114 -0
  97. package/dist/cjs/SearchContract.d.ts.map +1 -0
  98. package/dist/cjs/SearchContract.js +339 -0
  99. package/dist/cjs/SearchContract.js.map +7 -0
  100. package/dist/cjs/ShellCommand.d.ts +164 -0
  101. package/dist/cjs/ShellCommand.d.ts.map +1 -0
  102. package/dist/cjs/ShellCommand.js +102 -0
  103. package/dist/cjs/ShellCommand.js.map +7 -0
  104. package/dist/cjs/StdError.d.ts +55 -0
  105. package/dist/cjs/StdError.d.ts.map +1 -0
  106. package/dist/cjs/StdError.js +74 -0
  107. package/dist/cjs/StdError.js.map +7 -0
  108. package/dist/cjs/TestRun.d.ts +311 -0
  109. package/dist/cjs/TestRun.d.ts.map +1 -0
  110. package/dist/cjs/TestRun.js +228 -0
  111. package/dist/cjs/TestRun.js.map +7 -0
  112. package/dist/cjs/TestRunner.d.ts +102 -0
  113. package/dist/cjs/TestRunner.d.ts.map +1 -0
  114. package/dist/cjs/TestRunner.js +54 -0
  115. package/dist/cjs/TestRunner.js.map +7 -0
  116. package/dist/cjs/TreeFingerprint.d.ts +140 -0
  117. package/dist/cjs/TreeFingerprint.d.ts.map +1 -0
  118. package/dist/cjs/TreeFingerprint.js +87 -0
  119. package/dist/cjs/TreeFingerprint.js.map +7 -0
  120. package/dist/cjs/UpdatePlan.d.ts +152 -0
  121. package/dist/cjs/UpdatePlan.d.ts.map +1 -0
  122. package/dist/cjs/UpdatePlan.js +87 -0
  123. package/dist/cjs/UpdatePlan.js.map +7 -0
  124. package/dist/cjs/WebFetch.d.ts +134 -0
  125. package/dist/cjs/WebFetch.d.ts.map +1 -0
  126. package/dist/cjs/WebFetch.js +140 -0
  127. package/dist/cjs/WebFetch.js.map +7 -0
  128. package/dist/cjs/WebSearch.d.ts +181 -0
  129. package/dist/cjs/WebSearch.d.ts.map +1 -0
  130. package/dist/cjs/WebSearch.js +86 -0
  131. package/dist/cjs/WebSearch.js.map +7 -0
  132. package/dist/cjs/Write.d.ts +147 -0
  133. package/dist/cjs/Write.d.ts.map +1 -0
  134. package/dist/cjs/Write.js +122 -0
  135. package/dist/cjs/Write.js.map +7 -0
  136. package/dist/cjs/index.d.ts +127 -0
  137. package/dist/cjs/index.d.ts.map +1 -0
  138. package/dist/cjs/index.js +99 -0
  139. package/dist/cjs/index.js.map +7 -0
  140. package/dist/cjs/internal/ApplyPatch.d.ts +145 -0
  141. package/dist/cjs/internal/ApplyPatch.d.ts.map +1 -0
  142. package/dist/cjs/internal/ApplyPatch.js +462 -0
  143. package/dist/cjs/internal/ApplyPatch.js.map +7 -0
  144. package/dist/cjs/internal/CodexText.d.ts +73 -0
  145. package/dist/cjs/internal/CodexText.d.ts.map +1 -0
  146. package/dist/cjs/internal/CodexText.js +108 -0
  147. package/dist/cjs/internal/CodexText.js.map +7 -0
  148. package/dist/cjs/internal/Declaration.d.ts +49 -0
  149. package/dist/cjs/internal/Declaration.d.ts.map +1 -0
  150. package/dist/cjs/internal/Declaration.js +46 -0
  151. package/dist/cjs/internal/Declaration.js.map +7 -0
  152. package/dist/cjs/internal/Diagnostics.d.ts +77 -0
  153. package/dist/cjs/internal/Diagnostics.d.ts.map +1 -0
  154. package/dist/cjs/internal/Diagnostics.js +89 -0
  155. package/dist/cjs/internal/Diagnostics.js.map +7 -0
  156. package/dist/cjs/internal/EnvelopePrecheck.d.ts +67 -0
  157. package/dist/cjs/internal/EnvelopePrecheck.d.ts.map +1 -0
  158. package/dist/cjs/internal/EnvelopePrecheck.js +124 -0
  159. package/dist/cjs/internal/EnvelopePrecheck.js.map +7 -0
  160. package/dist/cjs/internal/Exec.d.ts +139 -0
  161. package/dist/cjs/internal/Exec.d.ts.map +1 -0
  162. package/dist/cjs/internal/Exec.js +158 -0
  163. package/dist/cjs/internal/Exec.js.map +7 -0
  164. package/dist/cjs/internal/FileMutation.d.ts +109 -0
  165. package/dist/cjs/internal/FileMutation.d.ts.map +1 -0
  166. package/dist/cjs/internal/FileMutation.js +116 -0
  167. package/dist/cjs/internal/FileMutation.js.map +7 -0
  168. package/dist/cjs/internal/FsFailure.d.ts +38 -0
  169. package/dist/cjs/internal/FsFailure.d.ts.map +1 -0
  170. package/dist/cjs/internal/FsFailure.js +40 -0
  171. package/dist/cjs/internal/FsFailure.js.map +7 -0
  172. package/dist/cjs/internal/GitWorktree.d.ts +108 -0
  173. package/dist/cjs/internal/GitWorktree.d.ts.map +1 -0
  174. package/dist/cjs/internal/GitWorktree.js +276 -0
  175. package/dist/cjs/internal/GitWorktree.js.map +7 -0
  176. package/dist/cjs/internal/Grouping.d.ts +51 -0
  177. package/dist/cjs/internal/Grouping.d.ts.map +1 -0
  178. package/dist/cjs/internal/Grouping.js +83 -0
  179. package/dist/cjs/internal/Grouping.js.map +7 -0
  180. package/dist/cjs/internal/Html.d.ts +20 -0
  181. package/dist/cjs/internal/Html.d.ts.map +1 -0
  182. package/dist/cjs/internal/Html.js +81 -0
  183. package/dist/cjs/internal/Html.js.map +7 -0
  184. package/dist/cjs/internal/Http.d.ts +95 -0
  185. package/dist/cjs/internal/Http.d.ts.map +1 -0
  186. package/dist/cjs/internal/Http.js +153 -0
  187. package/dist/cjs/internal/Http.js.map +7 -0
  188. package/dist/cjs/internal/HttpNetwork.d.ts +27 -0
  189. package/dist/cjs/internal/HttpNetwork.d.ts.map +1 -0
  190. package/dist/cjs/internal/HttpNetwork.js +146 -0
  191. package/dist/cjs/internal/HttpNetwork.js.map +7 -0
  192. package/dist/cjs/internal/Ignore.d.ts +37 -0
  193. package/dist/cjs/internal/Ignore.d.ts.map +1 -0
  194. package/dist/cjs/internal/Ignore.js +100 -0
  195. package/dist/cjs/internal/Ignore.js.map +7 -0
  196. package/dist/cjs/internal/LinearRegex.d.ts +19 -0
  197. package/dist/cjs/internal/LinearRegex.d.ts.map +1 -0
  198. package/dist/cjs/internal/LinearRegex.js +166 -0
  199. package/dist/cjs/internal/LinearRegex.js.map +7 -0
  200. package/dist/cjs/internal/Match.d.ts +85 -0
  201. package/dist/cjs/internal/Match.d.ts.map +1 -0
  202. package/dist/cjs/internal/Match.js +99 -0
  203. package/dist/cjs/internal/Match.js.map +7 -0
  204. package/dist/cjs/internal/Paths.d.ts +23 -0
  205. package/dist/cjs/internal/Paths.d.ts.map +1 -0
  206. package/dist/cjs/internal/Paths.js +52 -0
  207. package/dist/cjs/internal/Paths.js.map +7 -0
  208. package/dist/cjs/internal/Preserve.d.ts +25 -0
  209. package/dist/cjs/internal/Preserve.d.ts.map +1 -0
  210. package/dist/cjs/internal/Preserve.js +88 -0
  211. package/dist/cjs/internal/Preserve.js.map +7 -0
  212. package/dist/cjs/internal/Prune.d.ts +35 -0
  213. package/dist/cjs/internal/Prune.d.ts.map +1 -0
  214. package/dist/cjs/internal/Prune.js +54 -0
  215. package/dist/cjs/internal/Prune.js.map +7 -0
  216. package/dist/cjs/internal/SearchContract.d.ts +63 -0
  217. package/dist/cjs/internal/SearchContract.d.ts.map +1 -0
  218. package/dist/cjs/internal/SearchContract.js +46 -0
  219. package/dist/cjs/internal/SearchContract.js.map +7 -0
  220. package/dist/cjs/internal/Symbols.d.ts +39 -0
  221. package/dist/cjs/internal/Symbols.d.ts.map +1 -0
  222. package/dist/cjs/internal/Symbols.js +59 -0
  223. package/dist/cjs/internal/Symbols.js.map +7 -0
  224. package/dist/cjs/internal/TestReport.d.ts +52 -0
  225. package/dist/cjs/internal/TestReport.d.ts.map +1 -0
  226. package/dist/cjs/internal/TestReport.js +131 -0
  227. package/dist/cjs/internal/TestReport.js.map +7 -0
  228. package/dist/cjs/internal/Text.d.ts +114 -0
  229. package/dist/cjs/internal/Text.d.ts.map +1 -0
  230. package/dist/cjs/internal/Text.js +82 -0
  231. package/dist/cjs/internal/Text.js.map +7 -0
  232. package/dist/cjs/internal/Url.d.ts +13 -0
  233. package/dist/cjs/internal/Url.d.ts.map +1 -0
  234. package/dist/cjs/internal/Url.js +35 -0
  235. package/dist/cjs/internal/Url.js.map +7 -0
  236. package/dist/cjs/internal/Walk.d.ts +72 -0
  237. package/dist/cjs/internal/Walk.d.ts.map +1 -0
  238. package/dist/cjs/internal/Walk.js +108 -0
  239. package/dist/cjs/internal/Walk.js.map +7 -0
  240. package/dist/cjs/package.json +1 -0
  241. package/dist/esm/ApplyPatch.d.ts +174 -0
  242. package/dist/esm/ApplyPatch.d.ts.map +1 -0
  243. package/dist/esm/ApplyPatch.js +346 -0
  244. package/dist/esm/ApplyPatch.js.map +1 -0
  245. package/dist/esm/Bash.d.ts +380 -0
  246. package/dist/esm/Bash.d.ts.map +1 -0
  247. package/dist/esm/Bash.js +505 -0
  248. package/dist/esm/Bash.js.map +1 -0
  249. package/dist/esm/Checkpoints.d.ts +279 -0
  250. package/dist/esm/Checkpoints.d.ts.map +1 -0
  251. package/dist/esm/Checkpoints.js +298 -0
  252. package/dist/esm/Checkpoints.js.map +1 -0
  253. package/dist/esm/Container.d.ts +132 -0
  254. package/dist/esm/Container.d.ts.map +1 -0
  255. package/dist/esm/Container.js +151 -0
  256. package/dist/esm/Container.js.map +1 -0
  257. package/dist/esm/Edit.d.ts +203 -0
  258. package/dist/esm/Edit.d.ts.map +1 -0
  259. package/dist/esm/Edit.js +296 -0
  260. package/dist/esm/Edit.js.map +1 -0
  261. package/dist/esm/ExaWebSearch.d.ts +22 -0
  262. package/dist/esm/ExaWebSearch.d.ts.map +1 -0
  263. package/dist/esm/ExaWebSearch.js +107 -0
  264. package/dist/esm/ExaWebSearch.js.map +1 -0
  265. package/dist/esm/Explore.d.ts +328 -0
  266. package/dist/esm/Explore.d.ts.map +1 -0
  267. package/dist/esm/Explore.js +106 -0
  268. package/dist/esm/Explore.js.map +1 -0
  269. package/dist/esm/Fetch.d.ts +130 -0
  270. package/dist/esm/Fetch.d.ts.map +1 -0
  271. package/dist/esm/Fetch.js +91 -0
  272. package/dist/esm/Fetch.js.map +1 -0
  273. package/dist/esm/Glob.d.ts +204 -0
  274. package/dist/esm/Glob.d.ts.map +1 -0
  275. package/dist/esm/Glob.js +177 -0
  276. package/dist/esm/Glob.js.map +1 -0
  277. package/dist/esm/Grep.d.ts +347 -0
  278. package/dist/esm/Grep.d.ts.map +1 -0
  279. package/dist/esm/Grep.js +289 -0
  280. package/dist/esm/Grep.js.map +1 -0
  281. package/dist/esm/HttpPost.d.ts +130 -0
  282. package/dist/esm/HttpPost.d.ts.map +1 -0
  283. package/dist/esm/HttpPost.js +89 -0
  284. package/dist/esm/HttpPost.js.map +1 -0
  285. package/dist/esm/LanguageServer.d.ts +90 -0
  286. package/dist/esm/LanguageServer.d.ts.map +1 -0
  287. package/dist/esm/LanguageServer.js +57 -0
  288. package/dist/esm/LanguageServer.js.map +1 -0
  289. package/dist/esm/Ls.d.ts +164 -0
  290. package/dist/esm/Ls.d.ts.map +1 -0
  291. package/dist/esm/Ls.js +178 -0
  292. package/dist/esm/Ls.js.map +1 -0
  293. package/dist/esm/Lsp.d.ts +125 -0
  294. package/dist/esm/Lsp.d.ts.map +1 -0
  295. package/dist/esm/Lsp.js +165 -0
  296. package/dist/esm/Lsp.js.map +1 -0
  297. package/dist/esm/Manifest.d.ts +918 -0
  298. package/dist/esm/Manifest.d.ts.map +1 -0
  299. package/dist/esm/Manifest.js +153 -0
  300. package/dist/esm/Manifest.js.map +1 -0
  301. package/dist/esm/NativeSearch.d.ts +38 -0
  302. package/dist/esm/NativeSearch.d.ts.map +1 -0
  303. package/dist/esm/NativeSearch.js +378 -0
  304. package/dist/esm/NativeSearch.js.map +1 -0
  305. package/dist/esm/NodeLanguageServer.d.ts +128 -0
  306. package/dist/esm/NodeLanguageServer.d.ts.map +1 -0
  307. package/dist/esm/NodeLanguageServer.js +843 -0
  308. package/dist/esm/NodeLanguageServer.js.map +1 -0
  309. package/dist/esm/PortableSearch.d.ts +24 -0
  310. package/dist/esm/PortableSearch.d.ts.map +1 -0
  311. package/dist/esm/PortableSearch.js +240 -0
  312. package/dist/esm/PortableSearch.js.map +1 -0
  313. package/dist/esm/Probe.d.ts +193 -0
  314. package/dist/esm/Probe.d.ts.map +1 -0
  315. package/dist/esm/Probe.js +225 -0
  316. package/dist/esm/Probe.js.map +1 -0
  317. package/dist/esm/Read.d.ts +189 -0
  318. package/dist/esm/Read.d.ts.map +1 -0
  319. package/dist/esm/Read.js +300 -0
  320. package/dist/esm/Read.js.map +1 -0
  321. package/dist/esm/Relocate.d.ts +73 -0
  322. package/dist/esm/Relocate.d.ts.map +1 -0
  323. package/dist/esm/Relocate.js +153 -0
  324. package/dist/esm/Relocate.js.map +1 -0
  325. package/dist/esm/Search.d.ts +163 -0
  326. package/dist/esm/Search.d.ts.map +1 -0
  327. package/dist/esm/Search.js +47 -0
  328. package/dist/esm/Search.js.map +1 -0
  329. package/dist/esm/SearchConformance.d.ts +115 -0
  330. package/dist/esm/SearchConformance.d.ts.map +1 -0
  331. package/dist/esm/SearchConformance.js +193 -0
  332. package/dist/esm/SearchConformance.js.map +1 -0
  333. package/dist/esm/SearchContract.d.ts +114 -0
  334. package/dist/esm/SearchContract.d.ts.map +1 -0
  335. package/dist/esm/SearchContract.js +461 -0
  336. package/dist/esm/SearchContract.js.map +1 -0
  337. package/dist/esm/ShellCommand.d.ts +164 -0
  338. package/dist/esm/ShellCommand.d.ts.map +1 -0
  339. package/dist/esm/ShellCommand.js +159 -0
  340. package/dist/esm/ShellCommand.js.map +1 -0
  341. package/dist/esm/StdError.d.ts +55 -0
  342. package/dist/esm/StdError.d.ts.map +1 -0
  343. package/dist/esm/StdError.js +71 -0
  344. package/dist/esm/StdError.js.map +1 -0
  345. package/dist/esm/TestRun.d.ts +311 -0
  346. package/dist/esm/TestRun.d.ts.map +1 -0
  347. package/dist/esm/TestRun.js +316 -0
  348. package/dist/esm/TestRun.js.map +1 -0
  349. package/dist/esm/TestRunner.d.ts +102 -0
  350. package/dist/esm/TestRunner.d.ts.map +1 -0
  351. package/dist/esm/TestRunner.js +68 -0
  352. package/dist/esm/TestRunner.js.map +1 -0
  353. package/dist/esm/TreeFingerprint.d.ts +140 -0
  354. package/dist/esm/TreeFingerprint.d.ts.map +1 -0
  355. package/dist/esm/TreeFingerprint.js +170 -0
  356. package/dist/esm/TreeFingerprint.js.map +1 -0
  357. package/dist/esm/UpdatePlan.d.ts +152 -0
  358. package/dist/esm/UpdatePlan.d.ts.map +1 -0
  359. package/dist/esm/UpdatePlan.js +129 -0
  360. package/dist/esm/UpdatePlan.js.map +1 -0
  361. package/dist/esm/WebFetch.d.ts +134 -0
  362. package/dist/esm/WebFetch.d.ts.map +1 -0
  363. package/dist/esm/WebFetch.js +151 -0
  364. package/dist/esm/WebFetch.js.map +1 -0
  365. package/dist/esm/WebSearch.d.ts +181 -0
  366. package/dist/esm/WebSearch.d.ts.map +1 -0
  367. package/dist/esm/WebSearch.js +134 -0
  368. package/dist/esm/WebSearch.js.map +1 -0
  369. package/dist/esm/Write.d.ts +147 -0
  370. package/dist/esm/Write.d.ts.map +1 -0
  371. package/dist/esm/Write.js +144 -0
  372. package/dist/esm/Write.js.map +1 -0
  373. package/dist/esm/index.d.ts +127 -0
  374. package/dist/esm/index.d.ts.map +1 -0
  375. package/dist/esm/index.js +127 -0
  376. package/dist/esm/index.js.map +1 -0
  377. package/dist/esm/internal/ApplyPatch.d.ts +145 -0
  378. package/dist/esm/internal/ApplyPatch.d.ts.map +1 -0
  379. package/dist/esm/internal/ApplyPatch.js +489 -0
  380. package/dist/esm/internal/ApplyPatch.js.map +1 -0
  381. package/dist/esm/internal/CodexText.d.ts +73 -0
  382. package/dist/esm/internal/CodexText.d.ts.map +1 -0
  383. package/dist/esm/internal/CodexText.js +156 -0
  384. package/dist/esm/internal/CodexText.js.map +1 -0
  385. package/dist/esm/internal/Declaration.d.ts +49 -0
  386. package/dist/esm/internal/Declaration.d.ts.map +1 -0
  387. package/dist/esm/internal/Declaration.js +42 -0
  388. package/dist/esm/internal/Declaration.js.map +1 -0
  389. package/dist/esm/internal/Diagnostics.d.ts +77 -0
  390. package/dist/esm/internal/Diagnostics.d.ts.map +1 -0
  391. package/dist/esm/internal/Diagnostics.js +99 -0
  392. package/dist/esm/internal/Diagnostics.js.map +1 -0
  393. package/dist/esm/internal/EnvelopePrecheck.d.ts +67 -0
  394. package/dist/esm/internal/EnvelopePrecheck.d.ts.map +1 -0
  395. package/dist/esm/internal/EnvelopePrecheck.js +167 -0
  396. package/dist/esm/internal/EnvelopePrecheck.js.map +1 -0
  397. package/dist/esm/internal/Exec.d.ts +139 -0
  398. package/dist/esm/internal/Exec.d.ts.map +1 -0
  399. package/dist/esm/internal/Exec.js +193 -0
  400. package/dist/esm/internal/Exec.js.map +1 -0
  401. package/dist/esm/internal/FileMutation.d.ts +109 -0
  402. package/dist/esm/internal/FileMutation.d.ts.map +1 -0
  403. package/dist/esm/internal/FileMutation.js +123 -0
  404. package/dist/esm/internal/FileMutation.js.map +1 -0
  405. package/dist/esm/internal/FsFailure.d.ts +38 -0
  406. package/dist/esm/internal/FsFailure.d.ts.map +1 -0
  407. package/dist/esm/internal/FsFailure.js +39 -0
  408. package/dist/esm/internal/FsFailure.js.map +1 -0
  409. package/dist/esm/internal/GitWorktree.d.ts +108 -0
  410. package/dist/esm/internal/GitWorktree.d.ts.map +1 -0
  411. package/dist/esm/internal/GitWorktree.js +352 -0
  412. package/dist/esm/internal/GitWorktree.js.map +1 -0
  413. package/dist/esm/internal/Grouping.d.ts +51 -0
  414. package/dist/esm/internal/Grouping.d.ts.map +1 -0
  415. package/dist/esm/internal/Grouping.js +99 -0
  416. package/dist/esm/internal/Grouping.js.map +1 -0
  417. package/dist/esm/internal/Html.d.ts +20 -0
  418. package/dist/esm/internal/Html.d.ts.map +1 -0
  419. package/dist/esm/internal/Html.js +70 -0
  420. package/dist/esm/internal/Html.js.map +1 -0
  421. package/dist/esm/internal/Http.d.ts +95 -0
  422. package/dist/esm/internal/Http.d.ts.map +1 -0
  423. package/dist/esm/internal/Http.js +154 -0
  424. package/dist/esm/internal/Http.js.map +1 -0
  425. package/dist/esm/internal/HttpNetwork.d.ts +27 -0
  426. package/dist/esm/internal/HttpNetwork.d.ts.map +1 -0
  427. package/dist/esm/internal/HttpNetwork.js +114 -0
  428. package/dist/esm/internal/HttpNetwork.js.map +1 -0
  429. package/dist/esm/internal/Ignore.d.ts +37 -0
  430. package/dist/esm/internal/Ignore.d.ts.map +1 -0
  431. package/dist/esm/internal/Ignore.js +128 -0
  432. package/dist/esm/internal/Ignore.js.map +1 -0
  433. package/dist/esm/internal/LinearRegex.d.ts +19 -0
  434. package/dist/esm/internal/LinearRegex.d.ts.map +1 -0
  435. package/dist/esm/internal/LinearRegex.js +176 -0
  436. package/dist/esm/internal/LinearRegex.js.map +1 -0
  437. package/dist/esm/internal/Match.d.ts +85 -0
  438. package/dist/esm/internal/Match.d.ts.map +1 -0
  439. package/dist/esm/internal/Match.js +142 -0
  440. package/dist/esm/internal/Match.js.map +1 -0
  441. package/dist/esm/internal/Paths.d.ts +23 -0
  442. package/dist/esm/internal/Paths.d.ts.map +1 -0
  443. package/dist/esm/internal/Paths.js +40 -0
  444. package/dist/esm/internal/Paths.js.map +1 -0
  445. package/dist/esm/internal/Preserve.d.ts +25 -0
  446. package/dist/esm/internal/Preserve.d.ts.map +1 -0
  447. package/dist/esm/internal/Preserve.js +70 -0
  448. package/dist/esm/internal/Preserve.js.map +1 -0
  449. package/dist/esm/internal/Prune.d.ts +35 -0
  450. package/dist/esm/internal/Prune.d.ts.map +1 -0
  451. package/dist/esm/internal/Prune.js +60 -0
  452. package/dist/esm/internal/Prune.js.map +1 -0
  453. package/dist/esm/internal/SearchContract.d.ts +63 -0
  454. package/dist/esm/internal/SearchContract.d.ts.map +1 -0
  455. package/dist/esm/internal/SearchContract.js +66 -0
  456. package/dist/esm/internal/SearchContract.js.map +1 -0
  457. package/dist/esm/internal/Symbols.d.ts +39 -0
  458. package/dist/esm/internal/Symbols.d.ts.map +1 -0
  459. package/dist/esm/internal/Symbols.js +79 -0
  460. package/dist/esm/internal/Symbols.js.map +1 -0
  461. package/dist/esm/internal/TestReport.d.ts +52 -0
  462. package/dist/esm/internal/TestReport.d.ts.map +1 -0
  463. package/dist/esm/internal/TestReport.js +172 -0
  464. package/dist/esm/internal/TestReport.js.map +1 -0
  465. package/dist/esm/internal/Text.d.ts +114 -0
  466. package/dist/esm/internal/Text.d.ts.map +1 -0
  467. package/dist/esm/internal/Text.js +130 -0
  468. package/dist/esm/internal/Text.js.map +1 -0
  469. package/dist/esm/internal/Url.d.ts +13 -0
  470. package/dist/esm/internal/Url.d.ts.map +1 -0
  471. package/dist/esm/internal/Url.js +27 -0
  472. package/dist/esm/internal/Url.js.map +1 -0
  473. package/dist/esm/internal/Walk.d.ts +72 -0
  474. package/dist/esm/internal/Walk.d.ts.map +1 -0
  475. package/dist/esm/internal/Walk.js +126 -0
  476. package/dist/esm/internal/Walk.js.map +1 -0
  477. package/docs/README.md +117 -0
  478. package/docs/api.md +472 -0
  479. package/docs/concepts/effects-and-capabilities.md +136 -0
  480. package/docs/concepts/flows-and-handlers.md +115 -0
  481. package/docs/concepts/limits-and-disclosure.md +102 -0
  482. package/docs/concepts/search-contract.md +182 -0
  483. package/docs/guides/bind-the-standard-flows.md +114 -0
  484. package/docs/guides/implement-a-search-peer.md +133 -0
  485. package/docs/guides/pin-a-checkpoint.md +141 -0
  486. package/docs/guides/query-a-language-server.md +257 -0
  487. package/docs/guides/reach-the-network.md +141 -0
  488. package/docs/guides/read-and-edit-a-file.md +240 -0
  489. package/docs/guides/run-a-shell-command.md +215 -0
  490. package/docs/guides/run-the-test-suite.md +154 -0
  491. package/docs/guides/search-a-workspace.md +148 -0
  492. package/docs/installation.md +111 -0
  493. package/docs/quickstart.md +125 -0
  494. package/docs/reference/flows.md +556 -0
  495. package/docs/troubleshooting.md +322 -0
  496. package/package.json +439 -3
  497. package/src/ApplyPatch.ts +458 -0
  498. package/src/Bash.ts +607 -0
  499. package/src/Checkpoints.ts +422 -0
  500. package/src/Container.ts +212 -0
  501. package/src/Edit.ts +366 -0
  502. package/src/ExaWebSearch.ts +145 -0
  503. package/src/Explore.ts +139 -0
  504. package/src/Fetch.ts +117 -0
  505. package/src/Glob.ts +200 -0
  506. package/src/Grep.ts +320 -0
  507. package/src/HttpPost.ts +120 -0
  508. package/src/LanguageServer.ts +110 -0
  509. package/src/Ls.ts +228 -0
  510. package/src/Lsp.ts +184 -0
  511. package/src/Manifest.ts +162 -0
  512. package/src/NativeSearch.ts +457 -0
  513. package/src/NodeLanguageServer.ts +1148 -0
  514. package/src/PortableSearch.ts +264 -0
  515. package/src/Probe.ts +284 -0
  516. package/src/Read.ts +359 -0
  517. package/src/Relocate.ts +166 -0
  518. package/src/Search.ts +185 -0
  519. package/src/SearchConformance.ts +288 -0
  520. package/src/SearchContract.ts +489 -0
  521. package/src/ShellCommand.ts +201 -0
  522. package/src/StdError.ts +80 -0
  523. package/src/TestRun.ts +401 -0
  524. package/src/TestRunner.ts +119 -0
  525. package/src/TreeFingerprint.ts +200 -0
  526. package/src/UpdatePlan.ts +171 -0
  527. package/src/WebFetch.ts +194 -0
  528. package/src/WebSearch.ts +165 -0
  529. package/src/Write.ts +195 -0
  530. package/src/index.ts +154 -0
  531. package/src/internal/ApplyPatch.ts +601 -0
  532. package/src/internal/CodexText.ts +182 -0
  533. package/src/internal/Declaration.ts +60 -0
  534. package/src/internal/Diagnostics.ts +134 -0
  535. package/src/internal/EnvelopePrecheck.ts +233 -0
  536. package/src/internal/Exec.ts +314 -0
  537. package/src/internal/FileMutation.ts +231 -0
  538. package/src/internal/FsFailure.ts +51 -0
  539. package/src/internal/GitWorktree.ts +491 -0
  540. package/src/internal/Grouping.ts +106 -0
  541. package/src/internal/Html.ts +87 -0
  542. package/src/internal/Http.ts +209 -0
  543. package/src/internal/HttpNetwork.ts +153 -0
  544. package/src/internal/Ignore.ts +135 -0
  545. package/src/internal/LinearRegex.ts +173 -0
  546. package/src/internal/Match.ts +172 -0
  547. package/src/internal/Paths.ts +42 -0
  548. package/src/internal/Preserve.ts +108 -0
  549. package/src/internal/Prune.ts +62 -0
  550. package/src/internal/SearchContract.ts +77 -0
  551. package/src/internal/Symbols.ts +88 -0
  552. package/src/internal/TestReport.ts +194 -0
  553. package/src/internal/Text.ts +170 -0
  554. package/src/internal/Url.ts +23 -0
  555. package/src/internal/Walk.ts +176 -0
@@ -0,0 +1,132 @@
1
+ /**
2
+ * The host's route into a named container, as an injected transport.
3
+ *
4
+ * A task whose interpreter, dependencies, and test runner live in a container
5
+ * makes every command a nested quoting problem: the agent writes
6
+ * `docker exec c bash -lc 'cd /testbed && python - <<EOF … EOF'`, and one layer
7
+ * of that stack eats a quote. The measured cost across the 45-instance program
8
+ * was twelve failed probes, one instance's single most expensive frame
9
+ * (astropy-8707, which produced a probe that never ran), and a class of failure
10
+ * that turns from a broken probe into a broken *edit* the moment the same
11
+ * quoting reaches a writing command.
12
+ *
13
+ * So the transport is the harness's, not the agent's. A caller names the
14
+ * container and passes its program and payload as data; this service turns that
15
+ * into the argv the host actually spawns. `docker` and `podman` share the CLI
16
+ * {@link makeCommand} builds, and a host with a different route supplies its own
17
+ * {@link make} rather than teaching the agent a new incantation.
18
+ *
19
+ * A host that has no container route provides {@link makeNoop}, whose refusal
20
+ * says so plainly. Nothing here shells out on its own: it only decides an argv,
21
+ * and `bash` spawns it through the same permission-aware spawner as everything
22
+ * else.
23
+ *
24
+ * @since 1.0.0
25
+ */
26
+ import { Context, Effect, Layer } from "effect";
27
+ import * as StdError from "./StdError.ts";
28
+ /**
29
+ * One command to run inside a container.
30
+ *
31
+ * @category models
32
+ * @since 1.0.0
33
+ */
34
+ export interface Request {
35
+ readonly container: string;
36
+ readonly file: string;
37
+ readonly args: ReadonlyArray<string>;
38
+ readonly cwd?: string | undefined;
39
+ readonly env?: Record<string, string> | undefined;
40
+ /** Whether the payload arrives on the program's standard input. */
41
+ readonly stdin: boolean;
42
+ }
43
+ /**
44
+ * The argv the host spawns to satisfy a {@link Request}.
45
+ *
46
+ * @category models
47
+ * @since 1.0.0
48
+ */
49
+ export interface Plan {
50
+ readonly file: string;
51
+ readonly args: ReadonlyArray<string>;
52
+ /** Environment overrides for the transport process, never rendered as argv. */
53
+ readonly env?: Record<string, string> | undefined;
54
+ }
55
+ /**
56
+ * The one container transport contract.
57
+ *
58
+ * @category services
59
+ * @since 1.0.0
60
+ */
61
+ export interface Container {
62
+ readonly exec: (request: Request) => Effect.Effect<Plan, StdError.StdError>;
63
+ }
64
+ /**
65
+ * The {@link Container} service tag.
66
+ *
67
+ * @category services
68
+ * @since 1.0.0
69
+ */
70
+ export declare const Container: Context.Service<Container, Container>;
71
+ /**
72
+ * Builds a container transport from its one operation.
73
+ *
74
+ * @category constructors
75
+ * @since 1.0.0
76
+ */
77
+ export declare const make: (service: Container) => Container;
78
+ /**
79
+ * The refusal a host with no container route answers with.
80
+ *
81
+ * @category errors
82
+ * @since 1.0.0
83
+ */
84
+ export declare const unavailable: (container: string) => StdError.StdError;
85
+ /**
86
+ * Builds the transport for a host with no container route.
87
+ *
88
+ * @category constructors
89
+ * @since 1.0.0
90
+ */
91
+ export declare const makeNoop: () => Container;
92
+ /**
93
+ * Provides {@link makeNoop}.
94
+ *
95
+ * @category layers
96
+ * @since 1.0.0
97
+ */
98
+ export declare const layerNoop: Layer.Layer<Container>;
99
+ /**
100
+ * Builds a transport over a `docker exec`-compatible CLI.
101
+ *
102
+ * `-i` is attached only when the payload arrives on standard input, because a
103
+ * container CLI that holds stdin open for a command that never reads it makes
104
+ * that command hang.
105
+ *
106
+ * Requested environment variables never reach the transport process under
107
+ * their own names. The request's `env` is the caller's, and the transport is a
108
+ * host program: `PATH`, `LD_PRELOAD`, `DOCKER_HOST` or `XDG_CONFIG_HOME` set on
109
+ * it would choose what runs on the host. Each value therefore travels in
110
+ * {@link Plan.env} under `SMITHERS_CONTAINER_ENV_`, is forwarded by that name
111
+ * (`-e SMITHERS_CONTAINER_ENV_KEY`), and a `sh` inside the container renames it
112
+ * to `KEY` before `exec`ing the program. Values stay out of the argv. A name
113
+ * must be a POSIX shell name. A request with `env` therefore requires `sh` in
114
+ * the container; one without `env` runs the program directly, so an image
115
+ * without a shell works only for requests that carry no `env`.
116
+ *
117
+ * @category constructors
118
+ * @since 1.0.0
119
+ */
120
+ export declare const makeCommand: (options?: {
121
+ readonly program?: string | undefined;
122
+ }) => Container;
123
+ /**
124
+ * Provides {@link makeCommand}.
125
+ *
126
+ * @category layers
127
+ * @since 1.0.0
128
+ */
129
+ export declare const layerCommand: (options?: {
130
+ readonly program?: string | undefined;
131
+ }) => Layer.Layer<Container>;
132
+ //# sourceMappingURL=Container.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Container.d.ts","sourceRoot":"","sources":["../../src/Container.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAC/C,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AA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AAC,SAAS,CAAwC,CAAA;AAerF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,WAAW,GAAI,UAAU;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,KAAG,SAuDjF,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GAAI,UAAU;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,KAAG,KAAK,CAAC,KAAK,CAAC,SAAS,CACxD,CAAA"}
@@ -0,0 +1,151 @@
1
+ /**
2
+ * The host's route into a named container, as an injected transport.
3
+ *
4
+ * A task whose interpreter, dependencies, and test runner live in a container
5
+ * makes every command a nested quoting problem: the agent writes
6
+ * `docker exec c bash -lc 'cd /testbed && python - <<EOF … EOF'`, and one layer
7
+ * of that stack eats a quote. The measured cost across the 45-instance program
8
+ * was twelve failed probes, one instance's single most expensive frame
9
+ * (astropy-8707, which produced a probe that never ran), and a class of failure
10
+ * that turns from a broken probe into a broken *edit* the moment the same
11
+ * quoting reaches a writing command.
12
+ *
13
+ * So the transport is the harness's, not the agent's. A caller names the
14
+ * container and passes its program and payload as data; this service turns that
15
+ * into the argv the host actually spawns. `docker` and `podman` share the CLI
16
+ * {@link makeCommand} builds, and a host with a different route supplies its own
17
+ * {@link make} rather than teaching the agent a new incantation.
18
+ *
19
+ * A host that has no container route provides {@link makeNoop}, whose refusal
20
+ * says so plainly. Nothing here shells out on its own: it only decides an argv,
21
+ * and `bash` spawns it through the same permission-aware spawner as everything
22
+ * else.
23
+ *
24
+ * @since 1.0.0
25
+ */
26
+ import { Context, Effect, Layer } from "effect";
27
+ import * as StdError from "./StdError.js";
28
+ /**
29
+ * The {@link Container} service tag.
30
+ *
31
+ * @category services
32
+ * @since 1.0.0
33
+ */
34
+ export const Container = Context.Service("@smthrs/std/Container");
35
+ /**
36
+ * Builds a container transport from its one operation.
37
+ *
38
+ * @category constructors
39
+ * @since 1.0.0
40
+ */
41
+ export const make = (service) => Container.of(service);
42
+ /**
43
+ * The refusal a host with no container route answers with.
44
+ *
45
+ * @category errors
46
+ * @since 1.0.0
47
+ */
48
+ export const unavailable = (container) => new StdError.StdError({
49
+ code: "provider_unavailable",
50
+ message: `This host has no container transport, so it cannot run anything in "${container}". Drop the container field and run the command here, or ask the host to bind one.`
51
+ });
52
+ /**
53
+ * Builds the transport for a host with no container route.
54
+ *
55
+ * @category constructors
56
+ * @since 1.0.0
57
+ */
58
+ export const makeNoop = () => make({ exec: (request) => Effect.fail(unavailable(request.container)) });
59
+ /**
60
+ * Provides {@link makeNoop}.
61
+ *
62
+ * @category layers
63
+ * @since 1.0.0
64
+ */
65
+ export const layerNoop = Layer.succeed(Container, makeNoop());
66
+ /** The names a forwarded environment variable may take: a POSIX shell name. */
67
+ const environmentName = /^[A-Za-z_][A-Za-z0-9_]*$/;
68
+ /** The prefix a forwarded variable carries on the host transport process. */
69
+ const forwardedPrefix = "SMITHERS_CONTAINER_ENV_";
70
+ /** The in-container script that renames each forwarded variable, then runs the program. */
71
+ const rename = (names) => [
72
+ ...names.map((key) => `${key}="$${forwardedPrefix}${key}"; export ${key}; unset ${forwardedPrefix}${key}`),
73
+ `exec "$@"`
74
+ ].join("; ");
75
+ /**
76
+ * Builds a transport over a `docker exec`-compatible CLI.
77
+ *
78
+ * `-i` is attached only when the payload arrives on standard input, because a
79
+ * container CLI that holds stdin open for a command that never reads it makes
80
+ * that command hang.
81
+ *
82
+ * Requested environment variables never reach the transport process under
83
+ * their own names. The request's `env` is the caller's, and the transport is a
84
+ * host program: `PATH`, `LD_PRELOAD`, `DOCKER_HOST` or `XDG_CONFIG_HOME` set on
85
+ * it would choose what runs on the host. Each value therefore travels in
86
+ * {@link Plan.env} under `SMITHERS_CONTAINER_ENV_`, is forwarded by that name
87
+ * (`-e SMITHERS_CONTAINER_ENV_KEY`), and a `sh` inside the container renames it
88
+ * to `KEY` before `exec`ing the program. Values stay out of the argv. A name
89
+ * must be a POSIX shell name. A request with `env` therefore requires `sh` in
90
+ * the container; one without `env` runs the program directly, so an image
91
+ * without a shell works only for requests that carry no `env`.
92
+ *
93
+ * @category constructors
94
+ * @since 1.0.0
95
+ */
96
+ export const makeCommand = (options) => {
97
+ const program = options?.program ?? "docker";
98
+ return make({
99
+ exec: (request) => {
100
+ const env = request.env;
101
+ const entries = Object.entries(env ?? {});
102
+ const names = entries.map(([key]) => key);
103
+ const invalid = names.find((key) => !environmentName.test(key));
104
+ if (invalid !== undefined) {
105
+ return Effect.fail(new StdError.StdError({
106
+ code: "invalid_input",
107
+ message: `Environment variable names must match ${environmentName.source}: ${invalid}`
108
+ }));
109
+ }
110
+ if (request.container === "" || request.container.startsWith("-")) {
111
+ return Effect.fail(new StdError.StdError({
112
+ code: "invalid_input",
113
+ message: `Container name must be non-empty and cannot start with '-': ${request.container}`,
114
+ path: request.container
115
+ }));
116
+ }
117
+ const args = Array.from(request.args);
118
+ if (args.some((arg) => typeof arg !== "string")) {
119
+ return Effect.fail(new StdError.StdError({
120
+ code: "invalid_input",
121
+ message: "Container arguments must be a dense array of strings."
122
+ }));
123
+ }
124
+ return Effect.succeed({
125
+ file: program,
126
+ args: [
127
+ "exec",
128
+ ...(request.stdin ? ["-i"] : []),
129
+ ...(request.cwd === undefined ? [] : ["-w", request.cwd]),
130
+ ...names.flatMap((key) => ["-e", `${forwardedPrefix}${key}`]),
131
+ "--",
132
+ request.container,
133
+ ...(names.length === 0 ? [] : ["sh", "-c", rename(names), "sh"]),
134
+ request.file,
135
+ ...args
136
+ ],
137
+ ...(env === undefined ? {} : {
138
+ env: Object.fromEntries(entries.map(([key, value]) => [`${forwardedPrefix}${key}`, value]))
139
+ })
140
+ });
141
+ }
142
+ });
143
+ };
144
+ /**
145
+ * Provides {@link makeCommand}.
146
+ *
147
+ * @category layers
148
+ * @since 1.0.0
149
+ */
150
+ export const layerCommand = (options) => Layer.succeed(Container, makeCommand(options));
151
+ //# sourceMappingURL=Container.js.map
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AAG,EAAE,MAAM,CAAC,WAAW,CACrB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,eAAe,GAAG,GAAG,EAAE,EAAE,KAAK,CAAC,CAAC,CACnE;iBACF,CAAC;aACH,CAAC,CAAA;QACJ,CAAC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAmD,EAA0B,EAAE,CAC1G,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC,CAAA","sourcesContent":["/**\n * The host's route into a named container, as an injected transport.\n *\n * A task whose interpreter, dependencies, and test runner live in a container\n * makes every command a nested quoting problem: the agent writes\n * `docker exec c bash -lc 'cd /testbed && python - <<EOF … EOF'`, and one layer\n * of that stack eats a quote. The measured cost across the 45-instance program\n * was twelve failed probes, one instance's single most expensive frame\n * (astropy-8707, which produced a probe that never ran), and a class of failure\n * that turns from a broken probe into a broken *edit* the moment the same\n * quoting reaches a writing command.\n *\n * So the transport is the harness's, not the agent's. A caller names the\n * container and passes its program and payload as data; this service turns that\n * into the argv the host actually spawns. `docker` and `podman` share the CLI\n * {@link makeCommand} builds, and a host with a different route supplies its own\n * {@link make} rather than teaching the agent a new incantation.\n *\n * A host that has no container route provides {@link makeNoop}, whose refusal\n * says so plainly. Nothing here shells out on its own: it only decides an argv,\n * and `bash` spawns it through the same permission-aware spawner as everything\n * else.\n *\n * @since 1.0.0\n */\n\nimport { Context, Effect, Layer } from \"effect\"\nimport * as StdError from \"./StdError.ts\"\n\n/**\n * One command to run inside a container.\n *\n * @category models\n * @since 1.0.0\n */\nexport interface Request {\n readonly container: string\n readonly file: string\n readonly args: ReadonlyArray<string>\n readonly cwd?: string | undefined\n readonly env?: Record<string, string> | undefined\n /** Whether the payload arrives on the program's standard input. */\n readonly stdin: boolean\n}\n\n/**\n * The argv the host spawns to satisfy a {@link Request}.\n *\n * @category models\n * @since 1.0.0\n */\nexport interface Plan {\n readonly file: string\n readonly args: ReadonlyArray<string>\n /** Environment overrides for the transport process, never rendered as argv. */\n readonly env?: Record<string, string> | undefined\n}\n\n/**\n * The one container transport contract.\n *\n * @category services\n * @since 1.0.0\n */\nexport interface Container {\n readonly exec: (request: Request) => Effect.Effect<Plan, StdError.StdError>\n}\n\n/**\n * The {@link Container} service tag.\n *\n * @category services\n * @since 1.0.0\n */\nexport const Container: Context.Service<Container, Container> = Context.Service(\"@smthrs/std/Container\")\n\n/**\n * Builds a container transport from its one operation.\n *\n * @category constructors\n * @since 1.0.0\n */\nexport const make = (service: Container): Container => Container.of(service)\n\n/**\n * The refusal a host with no container route answers with.\n *\n * @category errors\n * @since 1.0.0\n */\nexport const unavailable = (container: string): StdError.StdError =>\n new StdError.StdError({\n code: \"provider_unavailable\",\n message:\n `This host has no container transport, so it cannot run anything in \"${container}\". Drop the container field and run the command here, or ask the host to bind one.`\n })\n\n/**\n * Builds the transport for a host with no container route.\n *\n * @category constructors\n * @since 1.0.0\n */\nexport const makeNoop = (): Container => make({ exec: (request) => Effect.fail(unavailable(request.container)) })\n\n/**\n * Provides {@link makeNoop}.\n *\n * @category layers\n * @since 1.0.0\n */\nexport const layerNoop: Layer.Layer<Container> = Layer.succeed(Container, makeNoop())\n\n/** The names a forwarded environment variable may take: a POSIX shell name. */\nconst environmentName = /^[A-Za-z_][A-Za-z0-9_]*$/\n\n/** The prefix a forwarded variable carries on the host transport process. */\nconst forwardedPrefix = \"SMITHERS_CONTAINER_ENV_\"\n\n/** The in-container script that renames each forwarded variable, then runs the program. */\nconst rename = (names: ReadonlyArray<string>): string =>\n [\n ...names.map((key) => `${key}=\"$${forwardedPrefix}${key}\"; export ${key}; unset ${forwardedPrefix}${key}`),\n `exec \"$@\"`\n ].join(\"; \")\n\n/**\n * Builds a transport over a `docker exec`-compatible CLI.\n *\n * `-i` is attached only when the payload arrives on standard input, because a\n * container CLI that holds stdin open for a command that never reads it makes\n * that command hang.\n *\n * Requested environment variables never reach the transport process under\n * their own names. The request's `env` is the caller's, and the transport is a\n * host program: `PATH`, `LD_PRELOAD`, `DOCKER_HOST` or `XDG_CONFIG_HOME` set on\n * it would choose what runs on the host. Each value therefore travels in\n * {@link Plan.env} under `SMITHERS_CONTAINER_ENV_`, is forwarded by that name\n * (`-e SMITHERS_CONTAINER_ENV_KEY`), and a `sh` inside the container renames it\n * to `KEY` before `exec`ing the program. Values stay out of the argv. A name\n * must be a POSIX shell name. A request with `env` therefore requires `sh` in\n * the container; one without `env` runs the program directly, so an image\n * without a shell works only for requests that carry no `env`.\n *\n * @category constructors\n * @since 1.0.0\n */\nexport const makeCommand = (options?: { readonly program?: string | undefined }): Container => {\n const program = options?.program ?? \"docker\"\n return make({\n exec: (request) => {\n const env = request.env\n const entries = Object.entries(env ?? {})\n const names = entries.map(([key]) => key)\n const invalid = names.find((key) => !environmentName.test(key))\n if (invalid !== undefined) {\n return Effect.fail(\n new StdError.StdError({\n code: \"invalid_input\",\n message: `Environment variable names must match ${environmentName.source}: ${invalid}`\n })\n )\n }\n if (request.container === \"\" || request.container.startsWith(\"-\")) {\n return Effect.fail(\n new StdError.StdError({\n code: \"invalid_input\",\n message: `Container name must be non-empty and cannot start with '-': ${request.container}`,\n path: request.container\n })\n )\n }\n const args = Array.from(request.args)\n if (args.some((arg) => typeof arg !== \"string\")) {\n return Effect.fail(\n new StdError.StdError({\n code: \"invalid_input\",\n message: \"Container arguments must be a dense array of strings.\"\n })\n )\n }\n return Effect.succeed({\n file: program,\n args: [\n \"exec\",\n ...(request.stdin ? [\"-i\"] : []),\n ...(request.cwd === undefined ? [] : [\"-w\", request.cwd]),\n ...names.flatMap((key) => [\"-e\", `${forwardedPrefix}${key}`]),\n \"--\",\n request.container,\n ...(names.length === 0 ? [] : [\"sh\", \"-c\", rename(names), \"sh\"]),\n request.file,\n ...args\n ],\n ...(env === undefined ? {} : {\n env: Object.fromEntries(\n entries.map(([key, value]) => [`${forwardedPrefix}${key}`, value])\n )\n })\n })\n }\n })\n}\n\n/**\n * Provides {@link makeCommand}.\n *\n * @category layers\n * @since 1.0.0\n */\nexport const layerCommand = (options?: { readonly program?: string | undefined }): Layer.Layer<Container> =>\n Layer.succeed(Container, makeCommand(options))\n"]}
@@ -0,0 +1,203 @@
1
+ /**
2
+ * Edit flow declaration and portable handler.
3
+ *
4
+ * Three rules, each of them paid for by a measured failure:
5
+ *
6
+ * 1. **Exact or loud.** The anchor matches the file's bytes or the call fails
7
+ * with the file's actual bytes at the nearest region. No fuzzy apply reports
8
+ * success (sympy-15380 corrupted a file that way), and no failure returns a
9
+ * bare `null` (sphinx-7590 abandoned a correct edit twice against one).
10
+ * 2. **Anchors by reference.** A prior `grep` or `read` already located the
11
+ * region; `startLine`/`endLine` re-use that hit instead of retyping the text,
12
+ * and `expect` turns the retyped copy into a checked assertion rather than a
13
+ * search key.
14
+ * 3. **The hunk comes back.** The result carries the applied region as raw text
15
+ * with its line range, so a mis-indented edit costs one glance instead of an
16
+ * investigation (sphinx-7233 lost its verdict to a hunk nobody could see).
17
+ * With a `LanguageServer` bound, the file's errors after the edit come back
18
+ * too.
19
+ *
20
+ * @since 1.0.0
21
+ */
22
+ import * as Effect from "effect/Effect";
23
+ import * as FileSystem from "effect/FileSystem";
24
+ import * as Schema from "effect/Schema";
25
+ import * as StdError from "./StdError.ts";
26
+ /**
27
+ * Registry name for the edit flow.
28
+ *
29
+ * @category identifiers
30
+ * @since 1.0.0
31
+ */
32
+ export declare const name = "edit";
33
+ /**
34
+ * Model-facing description of the edit flow.
35
+ *
36
+ * @category descriptions
37
+ * @since 1.0.0
38
+ */
39
+ export declare const description = "Edit a file by exact text (oldString, unique unless replaceAll) or by an earlier hit's line range (startLine/endLine, optional expect). A miss returns the file's real text; a hit returns the hunk.";
40
+ /**
41
+ * Input schema for the edit flow.
42
+ *
43
+ * @category schemas
44
+ * @since 1.0.0
45
+ */
46
+ export declare const Input: Schema.Struct<{
47
+ readonly path: Schema.String;
48
+ readonly oldString: Schema.optional<Schema.String>;
49
+ readonly startLine: Schema.optional<Schema.Int>;
50
+ readonly endLine: Schema.optional<Schema.Int>;
51
+ readonly expect: Schema.optional<Schema.String>;
52
+ readonly newString: Schema.String;
53
+ readonly replaceAll: Schema.optional<Schema.Boolean>;
54
+ }>;
55
+ /**
56
+ * Decoded input accepted by the `edit` flow.
57
+ *
58
+ * @category models
59
+ * @since 1.0.0
60
+ */
61
+ export type Input = typeof Input.Type;
62
+ /**
63
+ * Output schema for the edit flow.
64
+ *
65
+ * @category schemas
66
+ * @since 1.0.0
67
+ */
68
+ export declare const Output: Schema.Struct<{
69
+ readonly path: Schema.String;
70
+ readonly replacements: Schema.Number;
71
+ readonly startLine: Schema.Number;
72
+ readonly endLine: Schema.Number;
73
+ readonly hunk: Schema.String;
74
+ readonly errors: Schema.optional<Schema.$Array<Schema.Struct<{
75
+ readonly line: Schema.Number;
76
+ readonly character: Schema.Number;
77
+ readonly message: Schema.String;
78
+ }>>>;
79
+ }>;
80
+ /**
81
+ * Decoded output returned by the `edit` flow.
82
+ *
83
+ * @category models
84
+ * @since 1.0.0
85
+ */
86
+ export type Output = typeof Output.Type;
87
+ /**
88
+ * Static conservative effect envelope for the edit flow.
89
+ *
90
+ * @category effects
91
+ * @since 1.0.0
92
+ */
93
+ export declare const effects: import("@smthrs/plan/Effects").Declaration;
94
+ /**
95
+ * Narrows the edit effect envelope to one input path.
96
+ *
97
+ * @category effects
98
+ * @since 1.0.0
99
+ */
100
+ export declare const effectsFor: (input: typeof Input.Type) => import("@smthrs/plan/Effects").Declaration;
101
+ /**
102
+ * Capabilities required by the edit flow.
103
+ *
104
+ * @category capabilities
105
+ * @since 1.0.0
106
+ */
107
+ export declare const capabilities: string[];
108
+ /**
109
+ * Declaration-only edit flow.
110
+ *
111
+ * @category flows
112
+ * @since 1.0.0
113
+ */
114
+ export declare const flow: {
115
+ readonly name: "edit";
116
+ readonly description: "Edit a file by exact text (oldString, unique unless replaceAll) or by an earlier hit's line range (startLine/endLine, optional expect). A miss returns the file's real text; a hit returns the hunk.";
117
+ readonly input: Schema.Struct<{
118
+ readonly path: Schema.String;
119
+ readonly oldString: Schema.optional<Schema.String>;
120
+ readonly startLine: Schema.optional<Schema.Int>;
121
+ readonly endLine: Schema.optional<Schema.Int>;
122
+ readonly expect: Schema.optional<Schema.String>;
123
+ readonly newString: Schema.String;
124
+ readonly replaceAll: Schema.optional<Schema.Boolean>;
125
+ }>;
126
+ readonly output: Schema.Struct<{
127
+ readonly path: Schema.String;
128
+ readonly replacements: Schema.Number;
129
+ readonly startLine: Schema.Number;
130
+ readonly endLine: Schema.Number;
131
+ readonly hunk: Schema.String;
132
+ readonly errors: Schema.optional<Schema.$Array<Schema.Struct<{
133
+ readonly line: Schema.Number;
134
+ readonly character: Schema.Number;
135
+ readonly message: Schema.String;
136
+ }>>>;
137
+ }>;
138
+ readonly capabilities: string[];
139
+ readonly effects: import("@smthrs/plan/Effects").Declaration;
140
+ };
141
+ /**
142
+ * What a call to this flow does, for a reader of a run.
143
+ *
144
+ * Display metadata only. `@smthrs/registry` `Descriptor.FlowActivity` is the
145
+ * governing vocabulary and `StandardFlows` binds this value onto the flow's
146
+ * descriptor, where the binding site checks it. `declarationDigest` excludes
147
+ * it, so declaring it cannot invalidate a call identity or a cached prompt.
148
+ *
149
+ * @category presentation
150
+ * @since 1.0.0-rc.0
151
+ */
152
+ export declare const activity: "writes";
153
+ /**
154
+ * How one recorded call to this flow reads: the verb for each settlement, the
155
+ * input field that is its subject, and the measured output fields a one-line
156
+ * summary may count.
157
+ *
158
+ * Display metadata only, governed by `@smthrs/registry`
159
+ * `Descriptor.CallPresentation` and checked where `StandardFlows` binds it.
160
+ *
161
+ * @category presentation
162
+ * @since 1.0.0-rc.0
163
+ */
164
+ export declare const presentation: {
165
+ readonly verb: {
166
+ readonly pending: "editing";
167
+ readonly success: "edited";
168
+ readonly failure: "failed to edit";
169
+ };
170
+ readonly subject: "path";
171
+ readonly result: "edit";
172
+ };
173
+ /**
174
+ * Applies one exact-anchored edit through the permission-aware kernel filesystem.
175
+ *
176
+ * Every refusal names what the file actually holds. A non-unique match is a
177
+ * refusal rather than a silent first-match edit, and it reports the lines every
178
+ * occurrence sits on so the caller can widen the anchor without re-reading.
179
+ *
180
+ * @category handlers
181
+ * @since 1.0.0
182
+ */
183
+ export declare const run: (input: {
184
+ readonly path: string;
185
+ readonly newString: string;
186
+ readonly replaceAll?: boolean | undefined;
187
+ readonly endLine?: number | undefined;
188
+ readonly oldString?: string | undefined;
189
+ readonly startLine?: number | undefined;
190
+ readonly expect?: string | undefined;
191
+ }) => Effect.Effect<{
192
+ readonly hunk: string;
193
+ readonly path: string;
194
+ readonly endLine: number;
195
+ readonly startLine: number;
196
+ readonly replacements: number;
197
+ readonly errors?: readonly {
198
+ readonly line: number;
199
+ readonly character: number;
200
+ readonly message: string;
201
+ }[] | undefined;
202
+ }, StdError.StdError, FileSystem.FileSystem>;
203
+ //# sourceMappingURL=Edit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Edit.d.ts","sourceRoot":"","sources":["../../src/Edit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAQvC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AAEzC;;;;;GAKG;AACH,eAAO,MAAM,IAAI,SAAS,CAAA;AAE1B;;;;;GAKG;AACH,eAAO,MAAM,WAAW,yMACgL,CAAA;AAExM;;;;;GAKG;AACH,eAAO,MAAM,KAAK;;;;;;;;EAgBhB,CAAA;AAEF;;;;;GAKG;AACH,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAErC;;;;;GAKG;AACH,eAAO,MAAM,MAAM;;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