@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 @@
1
+ {"version":3,"file":"Edit.js","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;AACvC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,KAAK,WAAW,MAAM,2BAA2B,CAAA;AACxD,OAAO,KAAK,YAAY,MAAM,4BAA4B,CAAA;AAC1D,OAAO,KAAK,SAAS,MAAM,yBAAyB,CAAA;AACpD,OAAO,KAAK,KAAK,MAAM,qBAAqB,CAAA;AAC5C,OAAO,KAAK,QAAQ,MAAM,wBAAwB,CAAA;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AAEzC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAA;AAE1B;;;;;GAKG;AACH,M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AAC,SAAS;YAC5B,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,IAAI,EAAE,OAAO,CAAC,IAAI;SACnB,CAAA;QACD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAA;IAC3B,CAAC,CAAC,CAAC,CAAA;IACH,yEAAyE;IACzE,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,CAAA;IAC/G,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAA;AAC5E,CAAC,CAAC,CAAA","sourcesContent":["/**\n * Edit flow declaration and portable handler.\n *\n * Three rules, each of them paid for by a measured failure:\n *\n * 1. **Exact or loud.** The anchor matches the file's bytes or the call fails\n * with the file's actual bytes at the nearest region. No fuzzy apply reports\n * success (sympy-15380 corrupted a file that way), and no failure returns a\n * bare `null` (sphinx-7590 abandoned a correct edit twice against one).\n * 2. **Anchors by reference.** A prior `grep` or `read` already located the\n * region; `startLine`/`endLine` re-use that hit instead of retyping the text,\n * and `expect` turns the retyped copy into a checked assertion rather than a\n * search key.\n * 3. **The hunk comes back.** The result carries the applied region as raw text\n * with its line range, so a mis-indented edit costs one glance instead of an\n * investigation (sphinx-7233 lost its verdict to a hunk nobody could see).\n * With a `LanguageServer` bound, the file's errors after the edit come back\n * too.\n *\n * @since 1.0.0\n */\n\nimport * as Effect from \"effect/Effect\"\nimport * as FileSystem from \"effect/FileSystem\"\nimport * as Schema from \"effect/Schema\"\nimport { capability, envelope } from \"./internal/Declaration.ts\"\nimport * as Diagnostics from \"./internal/Diagnostics.ts\"\nimport * as FileMutation from \"./internal/FileMutation.ts\"\nimport * as FsFailure from \"./internal/FsFailure.ts\"\nimport * as Match from \"./internal/Match.ts\"\nimport * as Preserve from \"./internal/Preserve.ts\"\nimport { sourceLines } from \"./internal/Text.ts\"\nimport * as StdError from \"./StdError.ts\"\n\n/**\n * Registry name for the edit flow.\n *\n * @category identifiers\n * @since 1.0.0\n */\nexport const name = \"edit\"\n\n/**\n * Model-facing description of the edit flow.\n *\n * @category descriptions\n * @since 1.0.0\n */\nexport const description =\n \"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.\"\n\n/**\n * Input schema for the edit flow.\n *\n * @category schemas\n * @since 1.0.0\n */\nexport const Input = Schema.Struct({\n path: Schema.String.annotate({ description: \"Path of the file to edit\" }),\n oldString: Schema.optional(Schema.String).annotate({\n description: \"Exact text to replace, byte for byte, including surrounding context\"\n }),\n startLine: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(1))).annotate({\n description: \"First 1-based line to replace, from a prior read or grep hit; pair with endLine\"\n }),\n endLine: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(1))).annotate({\n description: \"Last 1-based line to replace, inclusive\"\n }),\n expect: Schema.optional(Schema.String).annotate({\n description: \"What those lines currently hold; the edit fails loudly if they hold anything else\"\n }),\n newString: Schema.String.annotate({ description: \"Replacement text\" }),\n replaceAll: Schema.optional(Schema.Boolean).annotate({ description: \"Replace every occurrence instead of one\" })\n})\n\n/**\n * Decoded input accepted by the `edit` flow.\n *\n * @category models\n * @since 1.0.0\n */\nexport type Input = typeof Input.Type\n\n/**\n * Output schema for the edit flow.\n *\n * @category schemas\n * @since 1.0.0\n */\nexport const Output = Schema.Struct({\n path: Schema.String.annotate({ description: \"Path that was edited\" }),\n replacements: Schema.Number.annotate({ description: \"Number of occurrences replaced\" }),\n startLine: Schema.Number.annotate({ description: \"First 1-based line of the returned hunk\" }),\n endLine: Schema.Number.annotate({ description: \"Last 1-based line of the returned hunk\" }),\n hunk: Schema.String.annotate({\n description: \"The edited region as it now stands, raw and with its exact indentation, plus two lines of context\"\n }),\n errors: Schema.optional(Schema.Array(Diagnostics.Problem)).annotate({\n description: \"Errors the language server reports in the file after the edit; absent when no server answered\"\n })\n})\n\n/**\n * Decoded output returned by the `edit` flow.\n *\n * @category models\n * @since 1.0.0\n */\nexport type Output = typeof Output.Type\n\n/**\n * Static conservative effect envelope for the edit flow.\n *\n * @category effects\n * @since 1.0.0\n */\nexport const effects = envelope({ tier: \"compensable\", mode: \"hermetic\", reads: [\"/**\"], writes: [\"/**\"] })\n\n/**\n * Narrows the edit effect envelope to one input path.\n *\n * @category effects\n * @since 1.0.0\n */\nexport const effectsFor = (input: typeof Input.Type) =>\n envelope({ tier: \"compensable\", mode: \"hermetic\", reads: [input.path], writes: [input.path] })\n\n/**\n * Capabilities required by the edit flow.\n *\n * @category capabilities\n * @since 1.0.0\n */\nexport const capabilities = [capability(\"fs:read\", \"/**\"), capability(\"fs:write\", \"/**\")]\n\n/**\n * Declaration-only edit flow.\n *\n * @category flows\n * @since 1.0.0\n */\nexport const flow = { name, description, input: Input, output: Output, capabilities, effects } as const\n\n/**\n * What a call to this flow does, for a reader of a run.\n *\n * Display metadata only. `@smthrs/registry` `Descriptor.FlowActivity` is the\n * governing vocabulary and `StandardFlows` binds this value onto the flow's\n * descriptor, where the binding site checks it. `declarationDigest` excludes\n * it, so declaring it cannot invalidate a call identity or a cached prompt.\n *\n * @category presentation\n * @since 1.0.0-rc.0\n */\nexport const activity = \"writes\" as const\n\n/**\n * How one recorded call to this flow reads: the verb for each settlement, the\n * input field that is its subject, and the measured output fields a one-line\n * summary may count.\n *\n * Display metadata only, governed by `@smthrs/registry`\n * `Descriptor.CallPresentation` and checked where `StandardFlows` binds it.\n *\n * @category presentation\n * @since 1.0.0-rc.0\n */\nexport const presentation = {\n verb: { pending: \"editing\", success: \"edited\", failure: \"failed to edit\" },\n subject: \"path\",\n result: \"edit\"\n} as const\n\nconst invalid = (path: string, message: string): StdError.StdError =>\n new StdError.StdError({ code: \"invalid_input\", message, path })\n\n/** The failure text for an anchor that is not in the file, with the file's own bytes. */\nconst miss = (path: string, content: string, needle: string, subject: string): StdError.StdError => {\n const region = Match.nearest(content, needle)\n return new StdError.StdError({\n code: \"no_match\",\n message: region === undefined\n ? `${subject} does not occur in ${path}, and no line of it occurs there either — this is the wrong file, or the region is not what you remember. Read it and anchor on what it actually holds.`\n : `${subject} does not occur in ${path}. Lines ${region.startLine}-${region.endLine} actually hold this, raw:\\n${region.text}\\n\\nCopy the lines you meant from that text, or anchor by startLine/endLine instead.`,\n path\n })\n}\n\n/** The byte span of an inclusive 1-based line range, or the failure explaining why not. */\nconst lineSpan = (\n path: string,\n content: string,\n startLine: number,\n endLine: number\n): { readonly start: number; readonly end: number } | StdError.StdError => {\n const lines = sourceLines(content)\n if (endLine < startLine) return invalid(path, `endLine ${endLine} is before startLine ${startLine}`)\n if (startLine > lines.length) {\n return new StdError.StdError({\n code: \"offset_out_of_range\",\n message: `${path} has ${lines.length} lines, so line ${startLine} is outside it`,\n path\n })\n }\n if (endLine > lines.length) {\n return new StdError.StdError({\n code: \"offset_out_of_range\",\n message: `Requested endLine ${endLine}, but ${path} has ${lines.length} lines`,\n path\n })\n }\n const last = endLine\n let start = 0\n for (let index = 0; index < startLine - 1; index++) start += lines[index]!.length + 1\n let end = start\n for (let index = startLine - 1; index < last; index++) end += lines[index]!.length + (index === last - 1 ? 0 : 1)\n return { start, end }\n}\n\n/**\n * Applies one exact-anchored edit through the permission-aware kernel filesystem.\n *\n * Every refusal names what the file actually holds. A non-unique match is a\n * refusal rather than a silent first-match edit, and it reports the lines every\n * occurrence sits on so the caller can widen the anchor without re-reading.\n *\n * @category handlers\n * @since 1.0.0\n */\nexport const run = Effect.fn(\"Edit.run\")(function*(\n input: typeof Input.Type\n): Effect.fn.Return<typeof Output.Type, StdError.StdError, FileSystem.FileSystem> {\n const fileSystem = yield* FileSystem.FileSystem\n const byLines = input.startLine !== undefined || input.endLine !== undefined\n if (input.oldString !== undefined && byLines) {\n return yield* Effect.fail(\n invalid(input.path, \"Anchor by oldString or by startLine/endLine, not by both\")\n )\n }\n if (input.oldString === undefined && !byLines) {\n return yield* Effect.fail(\n invalid(input.path, \"Give either oldString or a startLine/endLine range; use the write flow to create a file\")\n )\n }\n if (byLines && (input.startLine === undefined || input.endLine === undefined)) {\n return yield* Effect.fail(invalid(input.path, \"A line anchor needs both startLine and endLine\"))\n }\n if (input.oldString === \"\") {\n return yield* Effect.fail(\n invalid(input.path, \"oldString must not be empty; use the write flow to create a file\")\n )\n }\n if (input.oldString !== undefined && input.expect !== undefined) {\n return yield* Effect.fail(invalid(input.path, \"expect cannot be used with oldString\"))\n }\n if (byLines && input.replaceAll !== undefined) {\n return yield* Effect.fail(invalid(input.path, \"replaceAll cannot be used with startLine/endLine\"))\n }\n const edited = yield* Effect.scoped(Effect.gen(function*() {\n const mutation = yield* FileMutation.acquire(fileSystem, [input.path])\n const bytes = yield* mutation.read(\n input.path,\n fileSystem.readFile(input.path).pipe(\n Effect.mapError(FsFailure.reading(input.path, `File not found: ${input.path}`))\n )\n )\n if (bytes.includes(0)) {\n return yield* Effect.fail(\n new StdError.StdError({\n code: \"binary_file\",\n message: `Cannot read binary file: ${input.path}`,\n path: input.path\n })\n )\n }\n const content = yield* Effect.try({\n try: () => new TextDecoder(\"utf-8\", { fatal: true }).decode(bytes),\n catch: () =>\n new StdError.StdError({\n code: \"binary_file\",\n message: `File is not valid UTF-8: ${input.path}`,\n path: input.path\n })\n })\n\n const targets: Array<{ readonly start: number; readonly end: number }> = []\n if (input.oldString !== undefined) {\n const located = Match.locate(content, input.oldString)\n if (located.length === 0) return yield* Effect.fail(miss(input.path, content, input.oldString, \"oldString\"))\n if (located.length > 1 && input.replaceAll !== true) {\n const at = located.map((span) => span.startLine).join(\", \")\n return yield* Effect.fail(\n invalid(\n input.path,\n `oldString occurs ${located.length} times in ${input.path}, on lines ${at}; add surrounding context to pick one, anchor by startLine/endLine, or set replaceAll`\n )\n )\n }\n targets.push(...(input.replaceAll === true ? located : [located[0]!]))\n } else {\n const span = lineSpan(input.path, content, input.startLine!, input.endLine!)\n if (span instanceof StdError.StdError) return yield* Effect.fail(span)\n if (input.expect !== undefined && content.slice(span.start, span.end) !== input.expect) {\n return yield* Effect.fail(\n new StdError.StdError({\n code: \"no_match\",\n message:\n `Lines ${input.startLine}-${input.endLine} of ${input.path} do not hold expect. They hold this, raw:\\n${\n content.slice(span.start, span.end)\n }\\n\\nRe-read the file: it moved under the line numbers you anchored on.`,\n path: input.path\n })\n )\n }\n targets.push(span)\n }\n\n let replaced = \"\"\n let cursor = 0\n for (const span of targets) {\n replaced += content.slice(cursor, span.start) + input.newString\n cursor = span.end\n }\n replaced += content.slice(cursor)\n yield* mutation.commit(\n [{\n path: input.path,\n content: new TextEncoder().encode(replaced)\n }],\n Preserve.writeFileString(fileSystem, input.path, replaced).pipe(\n Effect.mapError((error) =>\n error.reason.method === \"chmod\"\n ? new StdError.StdError({\n code: \"command_failed\",\n message: `Could not preserve the mode of ${input.path} before replacement by chmod`,\n path: input.path\n })\n : FsFailure.denied(input.path, () =>\n new StdError.StdError({\n code: \"command_failed\",\n message: `Could not write ${input.path}`,\n path: input.path\n }))(\n error\n )\n )\n )\n )\n // Synced under the file lock, so a later edit's text never reaches the\n // server before this one's.\n const server = yield* Diagnostics.sync(input.path, replaced)\n const first = targets[0]!\n const applied = Match.hunk(replaced, first.start, first.start + input.newString.length)\n const output: typeof Output.Type = {\n path: input.path,\n replacements: targets.length,\n startLine: applied.startLine,\n endLine: applied.endLine,\n hunk: applied.text\n }\n return { output, server }\n }))\n // Without a synced text the server can only describe the file as it was.\n const errors = edited.server === undefined ? undefined : yield* Diagnostics.errorsOf(edited.server, input.path)\n return errors === undefined ? edited.output : { ...edited.output, errors }\n})\n"]}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The Exa provider for the `websearch` flow.
3
+ *
4
+ * {@link layer} binds `WebSearch.WebSearch` to the Exa search API. It reads the
5
+ * API key from a named credential on every search, calls Exa through the
6
+ * permission-checked `HttpClient`, and maps each hit onto `WebSearch.Result`.
7
+ *
8
+ * @since 1.0.0
9
+ */
10
+ import * as Credential from "@smthrs/control/Credential";
11
+ import * as HttpClient from "@smthrs/kernel/HttpClient";
12
+ import { Layer } from "effect";
13
+ import * as WebSearch from "./WebSearch.ts";
14
+ /**
15
+ * Provides {@link WebSearch.WebSearch} backed by the Exa API, reading its
16
+ * key from the named credential.
17
+ *
18
+ * @category layers
19
+ * @since 1.0.0
20
+ */
21
+ export declare const layer: (credentialId: string) => Layer.Layer<WebSearch.WebSearch, never, Credential.Credential | HttpClient.HttpClient>;
22
+ //# sourceMappingURL=ExaWebSearch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExaWebSearch.d.ts","sourceRoot":"","sources":["../../src/ExaWebSearch.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,UAAU,MAAM,4BAA4B,CAAA;AACxD,OAAO,KAAK,UAAU,MAAM,2BAA2B,CAAA;AACvD,OAAO,EAAiB,KAAK,EAAoB,MAAM,QAAQ,CAAA;AAI/D,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAsB3C;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,GAChB,cAAc,MAAM,KACnB,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,SAAS,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU,CAiGrF,CAAA"}
@@ -0,0 +1,107 @@
1
+ /**
2
+ * The Exa provider for the `websearch` flow.
3
+ *
4
+ * {@link layer} binds `WebSearch.WebSearch` to the Exa search API. It reads the
5
+ * API key from a named credential on every search, calls Exa through the
6
+ * permission-checked `HttpClient`, and maps each hit onto `WebSearch.Result`.
7
+ *
8
+ * @since 1.0.0
9
+ */
10
+ import * as Credential from "@smthrs/control/Credential";
11
+ import * as HttpClient from "@smthrs/kernel/HttpClient";
12
+ import { Clock, Effect, Layer, Redacted, Schema } from "effect";
13
+ import * as HttpClientRequest from "effect/http/HttpClientRequest";
14
+ import { header, readBounded } from "./internal/Http.js";
15
+ import * as StdError from "./StdError.js";
16
+ import * as WebSearch from "./WebSearch.js";
17
+ const maxResults = 20;
18
+ const requestTimeoutMs = 30_000;
19
+ const ExaResult = Schema.Struct({
20
+ title: Schema.optional(Schema.String),
21
+ url: Schema.String,
22
+ text: Schema.optional(Schema.String),
23
+ publishedDate: Schema.optional(Schema.String)
24
+ });
25
+ const ExaResponse = Schema.Struct({
26
+ results: Schema.Array(ExaResult)
27
+ });
28
+ const freshnessDays = {
29
+ day: 1,
30
+ week: 7,
31
+ month: 31,
32
+ year: 365
33
+ };
34
+ const failure = (code, message) => new StdError.StdError({ code, message });
35
+ /**
36
+ * Provides {@link WebSearch.WebSearch} backed by the Exa API, reading its
37
+ * key from the named credential.
38
+ *
39
+ * @category layers
40
+ * @since 1.0.0
41
+ */
42
+ export const layer = (credentialId) => Layer.effect(WebSearch.WebSearch, Effect.gen(function* () {
43
+ const credentials = yield* Credential.Credential;
44
+ const http = yield* HttpClient.HttpClient;
45
+ return WebSearch.make({
46
+ search: (input) => Effect.gen(function* () {
47
+ const reference = yield* credentials.get(credentialId).pipe(Effect.mapError(() => new StdError.StdError({
48
+ code: "provider_unavailable",
49
+ message: "Configured Exa credential is unavailable"
50
+ })));
51
+ const secret = yield* credentials.resolve(reference).pipe(Effect.mapError(() => new StdError.StdError({
52
+ code: "provider_unavailable",
53
+ message: "Configured Exa credential cannot be resolved"
54
+ })));
55
+ const now = yield* Clock.currentTimeMillis;
56
+ const request = HttpClientRequest.setHeaders(HttpClientRequest.bodyJsonUnsafe(HttpClientRequest.post("https://api.exa.ai/search"), {
57
+ query: input.query,
58
+ numResults: Math.min(input.numResults ?? 8, maxResults),
59
+ ...(input.freshness === undefined
60
+ ? {}
61
+ : { startPublishedDate: new Date(now - freshnessDays[input.freshness] * 86_400_000).toISOString() })
62
+ }), { "authorization": `Bearer ${Redacted.value(secret)}`, "content-type": "application/json" });
63
+ const response = yield* http.execute(request).pipe(Effect.timeout(requestTimeoutMs), Effect.mapError((error) => error._tag === "TimeoutError"
64
+ ? failure("timeout", "Exa search request timed out")
65
+ : failure("request_failed", "Exa search request failed")));
66
+ const retryAfter = header(response.headers, "retry-after");
67
+ // Successful responses may carry pacing advice too; status decides refusal.
68
+ const refused = response.status < 200 || response.status >= 300;
69
+ if (response.status === 429 || (refused && retryAfter !== undefined)) {
70
+ const delay = retryAfter === undefined
71
+ ? NaN
72
+ : /^\d+$/.test(retryAfter.trim())
73
+ ? Number(retryAfter)
74
+ : Math.max(0, Math.ceil((Date.parse(retryAfter) - (yield* Clock.currentTimeMillis)) / 1_000));
75
+ return yield* Effect.fail(failure("rate_limited", Number.isFinite(delay)
76
+ ? `Exa search was throttled; retry after ${delay} seconds`
77
+ : "Exa search was throttled"));
78
+ }
79
+ if (response.status === 401 || response.status === 403) {
80
+ return yield* Effect.fail(failure("provider_unavailable", "Exa search authentication was rejected"));
81
+ }
82
+ if (response.status >= 500) {
83
+ return yield* Effect.fail(failure("provider_unavailable", `Exa search returned ${response.status}`));
84
+ }
85
+ if (response.status < 200 || response.status >= 300) {
86
+ return yield* Effect.fail(failure("request_failed", `Exa search returned ${response.status}`));
87
+ }
88
+ // Bound the body before decoding: an endpoint must not choose how
89
+ // much of it the host buffers.
90
+ const bytes = yield* readBounded(response.stream, "https://api.exa.ai/search").pipe(Effect.timeout(requestTimeoutMs), Effect.mapError((error) => error._tag === "TimeoutError"
91
+ ? failure("timeout", "Exa search response timed out")
92
+ : error instanceof StdError.StdError && error.code === "response_too_large"
93
+ ? failure("response_too_large", "Exa search response exceeds the 5 MiB limit")
94
+ : failure("request_failed", "Exa search response was invalid")));
95
+ const body = yield* Schema.decodeUnknownEffect(Schema.fromJsonString(ExaResponse))(new TextDecoder().decode(bytes)).pipe(Effect.mapError(() => new StdError.StdError({ code: "request_failed", message: "Exa search response was invalid" })));
96
+ return {
97
+ results: body.results.slice(0, Math.min(input.numResults ?? 8, maxResults)).map((result) => ({
98
+ title: result.title ?? result.url,
99
+ url: result.url,
100
+ snippet: (result.text ?? "").slice(0, 2_000),
101
+ ...(result.publishedDate === undefined ? {} : { publishedAt: result.publishedDate })
102
+ }))
103
+ };
104
+ })
105
+ });
106
+ }));
107
+ //# sourceMappingURL=ExaWebSearch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExaWebSearch.js","sourceRoot":"","sources":["../../src/ExaWebSearch.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,UAAU,MAAM,4BAA4B,CAAA;AACxD,OAAO,KAAK,UAAU,MAAM,2BAA2B,CAAA;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/D,OAAO,KAAK,iBAAiB,MAAM,+BAA+B,CAAA;AAClE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AACzC,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAE3C,MAAM,UAAU,GAAG,EAAE,CAAA;AACrB,MAAM,gBAAgB,GAAG,MAAM,CAAA;AAC/B,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;IACrC,GAAG,EAAE,MAAM,CAAC,MAAM;IAClB,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;IACpC,aAAa,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;CAC9C,CAAC,CAAA;AACF,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC;IAChC,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,SAAS,CA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EAAE,EAAE,CAAC,CAAC;oBAC3F,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,GAAG;oBACjC,GAAG,EAAE,MAAM,CAAC,GAAG;oBACf,OAAO,EAAE,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC;oBAC5C,GAAG,CAAC,MAAM,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,aAAa,EAAE,CAAC;iBACrF,CAAC,CAAC;aACJ,CAAA;QACH,CAAC,CAAC;KACL,CAAC,CAAA;AACJ,CAAC,CAAC,CACH,CAAA","sourcesContent":["/**\n * The Exa provider for the `websearch` flow.\n *\n * {@link layer} binds `WebSearch.WebSearch` to the Exa search API. It reads the\n * API key from a named credential on every search, calls Exa through the\n * permission-checked `HttpClient`, and maps each hit onto `WebSearch.Result`.\n *\n * @since 1.0.0\n */\n\nimport * as Credential from \"@smthrs/control/Credential\"\nimport * as HttpClient from \"@smthrs/kernel/HttpClient\"\nimport { Clock, Effect, Layer, Redacted, Schema } from \"effect\"\nimport * as HttpClientRequest from \"effect/http/HttpClientRequest\"\nimport { header, readBounded } from \"./internal/Http.ts\"\nimport * as StdError from \"./StdError.ts\"\nimport * as WebSearch from \"./WebSearch.ts\"\n\nconst maxResults = 20\nconst requestTimeoutMs = 30_000\nconst ExaResult = Schema.Struct({\n title: Schema.optional(Schema.String),\n url: Schema.String,\n text: Schema.optional(Schema.String),\n publishedDate: Schema.optional(Schema.String)\n})\nconst ExaResponse = Schema.Struct({\n results: Schema.Array(ExaResult)\n})\nconst freshnessDays = {\n day: 1,\n week: 7,\n month: 31,\n year: 365\n} as const\n\nconst failure = (code: StdError.Code, message: string): StdError.StdError => new StdError.StdError({ code, message })\n\n/**\n * Provides {@link WebSearch.WebSearch} backed by the Exa API, reading its\n * key from the named credential.\n *\n * @category layers\n * @since 1.0.0\n */\nexport const layer = (\n credentialId: string\n): Layer.Layer<WebSearch.WebSearch, never, Credential.Credential | HttpClient.HttpClient> =>\n Layer.effect(\n WebSearch.WebSearch,\n Effect.gen(function*() {\n const credentials = yield* Credential.Credential\n const http = yield* HttpClient.HttpClient\n return WebSearch.make({\n search: (input): Effect.Effect<typeof WebSearch.Output.Type, StdError.StdError> =>\n Effect.gen(function*() {\n const reference = yield* credentials.get(credentialId).pipe(Effect.mapError(() =>\n new StdError.StdError({\n code: \"provider_unavailable\",\n message: \"Configured Exa credential is unavailable\"\n })\n ))\n const secret = yield* credentials.resolve(reference).pipe(Effect.mapError(() =>\n new StdError.StdError({\n code: \"provider_unavailable\",\n message: \"Configured Exa credential cannot be resolved\"\n })\n ))\n const now = yield* Clock.currentTimeMillis\n const request = HttpClientRequest.setHeaders(\n HttpClientRequest.bodyJsonUnsafe(HttpClientRequest.post(\"https://api.exa.ai/search\"), {\n query: input.query,\n numResults: Math.min(input.numResults ?? 8, maxResults),\n ...(input.freshness === undefined\n ? {}\n : { startPublishedDate: new Date(now - freshnessDays[input.freshness] * 86_400_000).toISOString() })\n }),\n { \"authorization\": `Bearer ${Redacted.value(secret)}`, \"content-type\": \"application/json\" }\n )\n const response = yield* http.execute(request).pipe(\n Effect.timeout(requestTimeoutMs),\n Effect.mapError((error) =>\n error._tag === \"TimeoutError\"\n ? failure(\"timeout\", \"Exa search request timed out\")\n : failure(\"request_failed\", \"Exa search request failed\")\n )\n )\n const retryAfter = header(response.headers, \"retry-after\")\n // Successful responses may carry pacing advice too; status decides refusal.\n const refused = response.status < 200 || response.status >= 300\n if (response.status === 429 || (refused && retryAfter !== undefined)) {\n const delay = retryAfter === undefined\n ? NaN\n : /^\\d+$/.test(retryAfter.trim())\n ? Number(retryAfter)\n : Math.max(0, Math.ceil((Date.parse(retryAfter) - (yield* Clock.currentTimeMillis)) / 1_000))\n return yield* Effect.fail(\n failure(\n \"rate_limited\",\n Number.isFinite(delay)\n ? `Exa search was throttled; retry after ${delay} seconds`\n : \"Exa search was throttled\"\n )\n )\n }\n if (response.status === 401 || response.status === 403) {\n return yield* Effect.fail(failure(\"provider_unavailable\", \"Exa search authentication was rejected\"))\n }\n if (response.status >= 500) {\n return yield* Effect.fail(failure(\"provider_unavailable\", `Exa search returned ${response.status}`))\n }\n if (response.status < 200 || response.status >= 300) {\n return yield* Effect.fail(failure(\"request_failed\", `Exa search returned ${response.status}`))\n }\n // Bound the body before decoding: an endpoint must not choose how\n // much of it the host buffers.\n const bytes = yield* readBounded(response.stream, \"https://api.exa.ai/search\").pipe(\n Effect.timeout(requestTimeoutMs),\n Effect.mapError((error) =>\n error._tag === \"TimeoutError\"\n ? failure(\"timeout\", \"Exa search response timed out\")\n : error instanceof StdError.StdError && error.code === \"response_too_large\"\n ? failure(\"response_too_large\", \"Exa search response exceeds the 5 MiB limit\")\n : failure(\"request_failed\", \"Exa search response was invalid\")\n )\n )\n const body = yield* Schema.decodeUnknownEffect(Schema.fromJsonString(ExaResponse))(\n new TextDecoder().decode(bytes)\n ).pipe(\n Effect.mapError(() =>\n new StdError.StdError({ code: \"request_failed\", message: \"Exa search response was invalid\" })\n )\n )\n return {\n results: body.results.slice(0, Math.min(input.numResults ?? 8, maxResults)).map((result) => ({\n title: result.title ?? result.url,\n url: result.url,\n snippet: (result.text ?? \"\").slice(0, 2_000),\n ...(result.publishedDate === undefined ? {} : { publishedAt: result.publishedDate })\n }))\n }\n })\n })\n })\n )\n"]}
@@ -0,0 +1,328 @@
1
+ /**
2
+ * Read-only workspace reconnaissance as a dynamic flow.
3
+ *
4
+ * @since 1.0.0
5
+ */
6
+ import * as Schema from "effect/Schema";
7
+ /**
8
+ * Registry name for the explore flow.
9
+ *
10
+ * @category metadata
11
+ * @since 1.0.0
12
+ */
13
+ export declare const name: "explore";
14
+ /**
15
+ * Model-facing description of the explore flow.
16
+ *
17
+ * @category metadata
18
+ * @since 1.0.0
19
+ */
20
+ export declare const description = "Investigate the workspace read-only, cite every finding as file:line, report evidence only, and never propose edits.";
21
+ /**
22
+ * Input accepted by the explore flow.
23
+ *
24
+ * @category schemas
25
+ * @since 1.0.0
26
+ */
27
+ export declare const Input: Schema.Struct<{
28
+ readonly prompt: Schema.String;
29
+ }>;
30
+ /**
31
+ * Decoded input accepted by the `explore` flow.
32
+ *
33
+ * @category models
34
+ * @since 1.0.0
35
+ */
36
+ export type Input = typeof Input.Type;
37
+ /**
38
+ * Output returned by the explore flow.
39
+ *
40
+ * @category schemas
41
+ * @since 1.0.0
42
+ */
43
+ export declare const Output: Schema.Struct<{
44
+ readonly findings: Schema.String;
45
+ }>;
46
+ /**
47
+ * Decoded output returned by the `explore` flow.
48
+ *
49
+ * @category models
50
+ * @since 1.0.0
51
+ */
52
+ export type Output = typeof Output.Type;
53
+ /**
54
+ * Static effect envelope for read-only workspace reconnaissance.
55
+ *
56
+ * @category effects
57
+ * @since 1.0.0
58
+ */
59
+ export declare const effects: import("@smthrs/plan/Effects").Declaration;
60
+ /**
61
+ * Narrows the explore effect declaration for one decoded input.
62
+ *
63
+ * @category effects
64
+ * @since 1.0.0
65
+ */
66
+ export declare const effectsFor: (_input: typeof Input.Type) => import("@smthrs/plan/Effects").Declaration;
67
+ /**
68
+ * Transitive capabilities of the read-only flows available to explore.
69
+ *
70
+ * @category capabilities
71
+ * @since 1.0.0
72
+ */
73
+ export declare const capabilities: ReadonlyArray<string>;
74
+ /**
75
+ * Constructs an explore flow, optionally pinned to a model.
76
+ *
77
+ * Model selection remains optional so the invoking seat can inject its model.
78
+ *
79
+ * @category constructors
80
+ * @since 1.0.0
81
+ */
82
+ export declare const make: (options: {
83
+ readonly model?: string | undefined;
84
+ }) => {
85
+ readonly name: "explore";
86
+ readonly description: "Investigate the workspace read-only, cite every finding as file:line, report evidence only, and never propose edits.";
87
+ readonly input: Schema.Struct<{
88
+ readonly prompt: Schema.String;
89
+ }>;
90
+ readonly output: Schema.Struct<{
91
+ readonly findings: Schema.String;
92
+ }>;
93
+ readonly model: string | undefined;
94
+ readonly flows: readonly [{
95
+ readonly name: "read";
96
+ 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.";
97
+ readonly input: Schema.Struct<{
98
+ readonly path: Schema.String;
99
+ readonly offset: Schema.optional<Schema.Int>;
100
+ readonly limit: Schema.optional<Schema.Int>;
101
+ }>;
102
+ readonly output: Schema.Struct<{
103
+ readonly content: Schema.String;
104
+ readonly startLine: Schema.Number;
105
+ readonly endLine: Schema.Number;
106
+ readonly totalLines: Schema.Number;
107
+ readonly truncated: Schema.Boolean;
108
+ readonly notice: Schema.optional<Schema.String>;
109
+ }>;
110
+ readonly capabilities: string[];
111
+ readonly effects: import("@smthrs/plan/Effects").Declaration;
112
+ }, {
113
+ readonly name: "ls";
114
+ readonly description: "List a directory with directories first, trailing /, and locale-independent UTF-16 code-unit ordering; use 1-based offset and limit to page large listings.";
115
+ readonly input: Schema.Struct<{
116
+ readonly path: Schema.String;
117
+ readonly offset: Schema.optional<Schema.Int>;
118
+ readonly limit: Schema.optional<Schema.Int>;
119
+ }>;
120
+ readonly output: Schema.Struct<{
121
+ readonly entries: Schema.$Array<Schema.Struct<{
122
+ readonly name: Schema.String;
123
+ readonly kind: Schema.Literals<readonly ["file", "directory"]>;
124
+ }>>;
125
+ readonly total: Schema.Number;
126
+ readonly truncated: Schema.Boolean;
127
+ readonly notice: Schema.optional<Schema.String>;
128
+ }>;
129
+ readonly capabilities: string[];
130
+ readonly effects: import("@smthrs/plan/Effects").Declaration;
131
+ }, {
132
+ readonly name: "glob";
133
+ readonly description: "Find files through the Smithers Ripgrep Subset v1 contract.";
134
+ readonly input: Schema.Struct<{
135
+ readonly pattern: Schema.NonEmptyString;
136
+ readonly root: Schema.optional<Schema.String>;
137
+ readonly hidden: Schema.optional<Schema.Boolean>;
138
+ readonly noIgnore: Schema.optional<Schema.Boolean>;
139
+ readonly limit: Schema.optional<Schema.Int>;
140
+ }>;
141
+ readonly output: Schema.Struct<{
142
+ readonly paths: Schema.$Array<Schema.String>;
143
+ readonly total: Schema.Int;
144
+ readonly truncated: Schema.Boolean;
145
+ readonly notice: Schema.optional<Schema.String>;
146
+ }>;
147
+ readonly capabilities: string[];
148
+ readonly effects: import("@smthrs/plan/Effects").Declaration;
149
+ }, {
150
+ readonly name: "grep";
151
+ readonly description: "Search file contents through the Smithers Ripgrep Subset v1 contract. limit counts matches, each carrying its own context and enclosing definition; fixedStrings searches a literal, and one is retried.";
152
+ readonly input: Schema.Struct<{
153
+ readonly pattern: Schema.String;
154
+ readonly root: Schema.optional<Schema.String>;
155
+ readonly fixedStrings: Schema.optional<Schema.Boolean>;
156
+ readonly ignoreCase: Schema.optional<Schema.Boolean>;
157
+ readonly smartCase: Schema.optional<Schema.Boolean>;
158
+ readonly globs: Schema.optional<Schema.$Array<Schema.String>>;
159
+ readonly beforeContext: Schema.optional<Schema.Int>;
160
+ readonly afterContext: Schema.optional<Schema.Int>;
161
+ readonly context: Schema.optional<Schema.Int>;
162
+ readonly maxCount: Schema.optional<Schema.Int>;
163
+ readonly filesWithMatches: Schema.optional<Schema.Boolean>;
164
+ readonly hidden: Schema.optional<Schema.Boolean>;
165
+ readonly symbols: Schema.optional<Schema.Boolean>;
166
+ readonly noIgnore: Schema.optional<Schema.Boolean>;
167
+ readonly limit: Schema.optional<Schema.Int>;
168
+ }>;
169
+ readonly output: Schema.Struct<{
170
+ readonly matches: Schema.$Array<Schema.Struct<{
171
+ readonly file: Schema.String;
172
+ readonly line: Schema.Int;
173
+ readonly text: Schema.String;
174
+ readonly before: Schema.$Array<Schema.Struct<{
175
+ readonly line: Schema.Int;
176
+ readonly text: Schema.String;
177
+ }>>;
178
+ readonly after: Schema.$Array<Schema.Struct<{
179
+ readonly line: Schema.Int;
180
+ readonly text: Schema.String;
181
+ }>>;
182
+ readonly symbol: Schema.optional<Schema.Struct<{
183
+ readonly kind: Schema.String;
184
+ readonly name: Schema.String;
185
+ readonly startLine: Schema.Int;
186
+ readonly endLine: Schema.Int;
187
+ }>>;
188
+ }>>;
189
+ readonly files: Schema.$Array<Schema.String>;
190
+ readonly filesSearched: Schema.Int;
191
+ readonly skippedBinary: Schema.Int;
192
+ readonly truncated: Schema.Boolean;
193
+ readonly retriedAsLiteral: Schema.optional<Schema.Boolean>;
194
+ readonly notice: Schema.optional<Schema.String>;
195
+ }>;
196
+ readonly capabilities: string[];
197
+ readonly effects: import("@smthrs/plan/Effects").Declaration;
198
+ }];
199
+ readonly prompt: "Investigate the workspace read-only, cite every finding as file:line, report evidence only, and never propose edits.";
200
+ readonly capabilities: readonly string[];
201
+ readonly effects: import("@smthrs/plan/Effects").Declaration;
202
+ };
203
+ /**
204
+ * Default explore declaration with seat-selected model injection.
205
+ *
206
+ * @category flows
207
+ * @since 1.0.0
208
+ */
209
+ export declare const flow: {
210
+ readonly name: "explore";
211
+ readonly description: "Investigate the workspace read-only, cite every finding as file:line, report evidence only, and never propose edits.";
212
+ readonly input: Schema.Struct<{
213
+ readonly prompt: Schema.String;
214
+ }>;
215
+ readonly output: Schema.Struct<{
216
+ readonly findings: Schema.String;
217
+ }>;
218
+ readonly model: string | undefined;
219
+ readonly flows: readonly [{
220
+ readonly name: "read";
221
+ 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.";
222
+ readonly input: Schema.Struct<{
223
+ readonly path: Schema.String;
224
+ readonly offset: Schema.optional<Schema.Int>;
225
+ readonly limit: Schema.optional<Schema.Int>;
226
+ }>;
227
+ readonly output: Schema.Struct<{
228
+ readonly content: Schema.String;
229
+ readonly startLine: Schema.Number;
230
+ readonly endLine: Schema.Number;
231
+ readonly totalLines: Schema.Number;
232
+ readonly truncated: Schema.Boolean;
233
+ readonly notice: Schema.optional<Schema.String>;
234
+ }>;
235
+ readonly capabilities: string[];
236
+ readonly effects: import("@smthrs/plan/Effects").Declaration;
237
+ }, {
238
+ readonly name: "ls";
239
+ readonly description: "List a directory with directories first, trailing /, and locale-independent UTF-16 code-unit ordering; use 1-based offset and limit to page large listings.";
240
+ readonly input: Schema.Struct<{
241
+ readonly path: Schema.String;
242
+ readonly offset: Schema.optional<Schema.Int>;
243
+ readonly limit: Schema.optional<Schema.Int>;
244
+ }>;
245
+ readonly output: Schema.Struct<{
246
+ readonly entries: Schema.$Array<Schema.Struct<{
247
+ readonly name: Schema.String;
248
+ readonly kind: Schema.Literals<readonly ["file", "directory"]>;
249
+ }>>;
250
+ readonly total: Schema.Number;
251
+ readonly truncated: Schema.Boolean;
252
+ readonly notice: Schema.optional<Schema.String>;
253
+ }>;
254
+ readonly capabilities: string[];
255
+ readonly effects: import("@smthrs/plan/Effects").Declaration;
256
+ }, {
257
+ readonly name: "glob";
258
+ readonly description: "Find files through the Smithers Ripgrep Subset v1 contract.";
259
+ readonly input: Schema.Struct<{
260
+ readonly pattern: Schema.NonEmptyString;
261
+ readonly root: Schema.optional<Schema.String>;
262
+ readonly hidden: Schema.optional<Schema.Boolean>;
263
+ readonly noIgnore: Schema.optional<Schema.Boolean>;
264
+ readonly limit: Schema.optional<Schema.Int>;
265
+ }>;
266
+ readonly output: Schema.Struct<{
267
+ readonly paths: Schema.$Array<Schema.String>;
268
+ readonly total: Schema.Int;
269
+ readonly truncated: Schema.Boolean;
270
+ readonly notice: Schema.optional<Schema.String>;
271
+ }>;
272
+ readonly capabilities: string[];
273
+ readonly effects: import("@smthrs/plan/Effects").Declaration;
274
+ }, {
275
+ readonly name: "grep";
276
+ readonly description: "Search file contents through the Smithers Ripgrep Subset v1 contract. limit counts matches, each carrying its own context and enclosing definition; fixedStrings searches a literal, and one is retried.";
277
+ readonly input: Schema.Struct<{
278
+ readonly pattern: Schema.String;
279
+ readonly root: Schema.optional<Schema.String>;
280
+ readonly fixedStrings: Schema.optional<Schema.Boolean>;
281
+ readonly ignoreCase: Schema.optional<Schema.Boolean>;
282
+ readonly smartCase: Schema.optional<Schema.Boolean>;
283
+ readonly globs: Schema.optional<Schema.$Array<Schema.String>>;
284
+ readonly beforeContext: Schema.optional<Schema.Int>;
285
+ readonly afterContext: Schema.optional<Schema.Int>;
286
+ readonly context: Schema.optional<Schema.Int>;
287
+ readonly maxCount: Schema.optional<Schema.Int>;
288
+ readonly filesWithMatches: Schema.optional<Schema.Boolean>;
289
+ readonly hidden: Schema.optional<Schema.Boolean>;
290
+ readonly symbols: Schema.optional<Schema.Boolean>;
291
+ readonly noIgnore: Schema.optional<Schema.Boolean>;
292
+ readonly limit: Schema.optional<Schema.Int>;
293
+ }>;
294
+ readonly output: Schema.Struct<{
295
+ readonly matches: Schema.$Array<Schema.Struct<{
296
+ readonly file: Schema.String;
297
+ readonly line: Schema.Int;
298
+ readonly text: Schema.String;
299
+ readonly before: Schema.$Array<Schema.Struct<{
300
+ readonly line: Schema.Int;
301
+ readonly text: Schema.String;
302
+ }>>;
303
+ readonly after: Schema.$Array<Schema.Struct<{
304
+ readonly line: Schema.Int;
305
+ readonly text: Schema.String;
306
+ }>>;
307
+ readonly symbol: Schema.optional<Schema.Struct<{
308
+ readonly kind: Schema.String;
309
+ readonly name: Schema.String;
310
+ readonly startLine: Schema.Int;
311
+ readonly endLine: Schema.Int;
312
+ }>>;
313
+ }>>;
314
+ readonly files: Schema.$Array<Schema.String>;
315
+ readonly filesSearched: Schema.Int;
316
+ readonly skippedBinary: Schema.Int;
317
+ readonly truncated: Schema.Boolean;
318
+ readonly retriedAsLiteral: Schema.optional<Schema.Boolean>;
319
+ readonly notice: Schema.optional<Schema.String>;
320
+ }>;
321
+ readonly capabilities: string[];
322
+ readonly effects: import("@smthrs/plan/Effects").Declaration;
323
+ }];
324
+ readonly prompt: "Investigate the workspace read-only, cite every finding as file:line, report evidence only, and never propose edits.";
325
+ readonly capabilities: readonly string[];
326
+ readonly effects: import("@smthrs/plan/Effects").Declaration;
327
+ };
328
+ //# sourceMappingURL=Explore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Explore.d.ts","sourceRoot":"","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@since 1.0.0
5
+ */
6
+ import * as Schema from "effect/Schema";
7
+ import * as Glob from "./Glob.js";
8
+ import * as Grep from "./Grep.js";
9
+ import { envelope } from "./internal/Declaration.js";
10
+ import * as Ls from "./Ls.js";
11
+ import * as Read from "./Read.js";
12
+ /**
13
+ * Registry name for the explore flow.
14
+ *
15
+ * @category metadata
16
+ * @since 1.0.0
17
+ */
18
+ export const name = "explore";
19
+ /**
20
+ * Model-facing description of the explore flow.
21
+ *
22
+ * @category metadata
23
+ * @since 1.0.0
24
+ */
25
+ export const description = "Investigate the workspace read-only, cite every finding as file:line, report evidence only, and never propose edits.";
26
+ /**
27
+ * Input accepted by the explore flow.
28
+ *
29
+ * @category schemas
30
+ * @since 1.0.0
31
+ */
32
+ export const Input = Schema.Struct({
33
+ prompt: Schema.String.annotate({
34
+ description: "The workspace question to investigate."
35
+ })
36
+ });
37
+ /**
38
+ * Output returned by the explore flow.
39
+ *
40
+ * @category schemas
41
+ * @since 1.0.0
42
+ */
43
+ export const Output = Schema.Struct({
44
+ findings: Schema.String.annotate({
45
+ description: "Evidence-backed findings with file:line citations."
46
+ })
47
+ });
48
+ /**
49
+ * Static effect envelope for read-only workspace reconnaissance.
50
+ *
51
+ * @category effects
52
+ * @since 1.0.0
53
+ */
54
+ export const effects = envelope({
55
+ tier: "sealed",
56
+ mode: "hermetic",
57
+ reads: ["/**"],
58
+ writes: []
59
+ });
60
+ /**
61
+ * Narrows the explore effect declaration for one decoded input.
62
+ *
63
+ * @category effects
64
+ * @since 1.0.0
65
+ */
66
+ export const effectsFor = (_input) => effects;
67
+ const flows = Object.freeze([
68
+ Read.flow,
69
+ Ls.flow,
70
+ Glob.flow,
71
+ Grep.flow
72
+ ]);
73
+ /**
74
+ * Transitive capabilities of the read-only flows available to explore.
75
+ *
76
+ * @category capabilities
77
+ * @since 1.0.0
78
+ */
79
+ export const capabilities = Object.freeze([...new Set(flows.flatMap((flow) => flow.capabilities))].sort());
80
+ /**
81
+ * Constructs an explore flow, optionally pinned to a model.
82
+ *
83
+ * Model selection remains optional so the invoking seat can inject its model.
84
+ *
85
+ * @category constructors
86
+ * @since 1.0.0
87
+ */
88
+ export const make = (options) => ({
89
+ name,
90
+ description,
91
+ input: Input,
92
+ output: Output,
93
+ model: options.model,
94
+ flows,
95
+ prompt: description,
96
+ capabilities,
97
+ effects
98
+ });
99
+ /**
100
+ * Default explore declaration with seat-selected model injection.
101
+ *
102
+ * @category flows
103
+ * @since 1.0.0
104
+ */
105
+ export const flow = make({});
106
+ //# sourceMappingURL=Explore.js.map