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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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 +304 -0
  9. package/dist/cjs/Bash.d.ts.map +1 -0
  10. package/dist/cjs/Bash.js +321 -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 +98 -0
  173. package/dist/cjs/internal/GitWorktree.d.ts.map +1 -0
  174. package/dist/cjs/internal/GitWorktree.js +270 -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 +304 -0
  246. package/dist/esm/Bash.d.ts.map +1 -0
  247. package/dist/esm/Bash.js +469 -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 +98 -0
  410. package/dist/esm/internal/GitWorktree.d.ts.map +1 -0
  411. package/dist/esm/internal/GitWorktree.js +345 -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 +549 -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 +473 -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,347 @@
1
+ /**
2
+ * The `grep` flow and its Smithers Ripgrep Subset v1 contract.
3
+ *
4
+ * Supported ripgrep semantics: Rust-style regular expressions restricted to
5
+ * Smithers Ripgrep ASCII v1; `-F` (`fixedStrings`); `-i` (`ignoreCase`) and `-S`
6
+ * (`smartCase`); ordered `-g` include/exclude globs; `-A`, `-B`, and `-C`
7
+ * context; per-file `--max-count`; `--files-with-matches`; `--hidden`; and
8
+ * deterministic path/line ordering. Root and nested .gitignore files apply by
9
+ * default, including outside git repositories. `noIgnore: true` opts out.
10
+ * Parent/global ignore files, .git/info/exclude, .ignore and .rgignore are not
11
+ * read. File-type registries are outside v1, and there is no `types` field to
12
+ * pass. Patterns are capped at 4096 ASCII bytes and counted repetitions at 1000. Invalid UTF-8 is replacement-decoded; NUL-bearing
13
+ * files are skipped and counted, while an explicitly named binary file is a
14
+ * typed failure.
15
+ *
16
+ * Results are match-centric, which is `rg --json`'s own grouping: `limit`
17
+ * counts matches, each match carries the context lines that belong to it, and
18
+ * every context line belongs to exactly one match. A budget that counted rows
19
+ * could spend itself on context and drop the match — astropy-7166 paid three
20
+ * frames for exactly that — so a hit is never droppable to make room for its
21
+ * own surroundings. Truncation is disclosed through `notice`.
22
+ *
23
+ * Each returned hit also carries the definition enclosing it when the file's
24
+ * shape says so plainly, so a read window is computed rather than guessed, and
25
+ * a metacharacter pattern that finds nothing is retried as a literal with
26
+ * `retriedAsLiteral` set. Both are properties of the contract rather than of a
27
+ * peer: they are computed in `internal/Grouping.ts` for both implementations.
28
+ *
29
+ * `globs` accepts exactly the shapes `glob` accepts and reads them the same
30
+ * way: every pattern is matched against each candidate's path *relative to
31
+ * `root`*, a pattern without `/` matches the basename at any depth, and a
32
+ * leading `/` or `./` anchors at the root rather than naming a filesystem
33
+ * absolute path. A `root` that names one file is searched whatever the globs
34
+ * say. Caller globs filter after ignores; they never override them. See `Glob` for the full statement of the rules. A search that matched
35
+ * nothing because a positive glob was unsatisfiable says so through `notice`
36
+ * instead of returning a silent empty result.
37
+ *
38
+ * `filesSearched` counts every file the walk and globs admitted, including the binaries
39
+ * `skippedBinary` reports and any file the process could not open. A walk
40
+ * skips what it cannot read rather than failing the call.
41
+ *
42
+ * Native and in-process implementations are peers behind `Search.Search`.
43
+ * This module declares and validates the call; it performs no host access.
44
+ *
45
+ * @since 1.0.0
46
+ */
47
+ import { Effect, Schema } from "effect";
48
+ import * as Search from "./Search.ts";
49
+ import * as StdError from "./StdError.ts";
50
+ /**
51
+ * The registry name for grep.
52
+ *
53
+ * @category identifiers
54
+ * @since 1.0.0
55
+ */
56
+ export declare const name = "grep";
57
+ /**
58
+ * The model-facing grep description.
59
+ *
60
+ * @category descriptions
61
+ * @since 1.0.0
62
+ */
63
+ export declare const 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.";
64
+ /**
65
+ * Input accepted by {@link flow} and {@link run}.
66
+ *
67
+ * @category schemas
68
+ * @since 1.0.0
69
+ */
70
+ export declare const Input: Schema.Struct<{
71
+ readonly pattern: Schema.String;
72
+ readonly root: Schema.optional<Schema.String>;
73
+ readonly fixedStrings: Schema.optional<Schema.Boolean>;
74
+ readonly ignoreCase: Schema.optional<Schema.Boolean>;
75
+ readonly smartCase: Schema.optional<Schema.Boolean>;
76
+ readonly globs: Schema.optional<Schema.$Array<Schema.String>>;
77
+ readonly beforeContext: Schema.optional<Schema.Int>;
78
+ readonly afterContext: Schema.optional<Schema.Int>;
79
+ readonly context: Schema.optional<Schema.Int>;
80
+ readonly maxCount: Schema.optional<Schema.Int>;
81
+ readonly filesWithMatches: Schema.optional<Schema.Boolean>;
82
+ readonly hidden: Schema.optional<Schema.Boolean>;
83
+ readonly symbols: Schema.optional<Schema.Boolean>;
84
+ readonly noIgnore: Schema.optional<Schema.Boolean>;
85
+ readonly limit: Schema.optional<Schema.Int>;
86
+ }>;
87
+ /**
88
+ * Decoded input accepted by the `grep` flow.
89
+ *
90
+ * @category models
91
+ * @since 1.0.0
92
+ */
93
+ export type Input = typeof Input.Type;
94
+ /**
95
+ * One matching or context line.
96
+ *
97
+ * @category schemas
98
+ * @since 1.0.0
99
+ */
100
+ export declare const ContextLine: Schema.Struct<{
101
+ readonly line: Schema.Int;
102
+ readonly text: Schema.String;
103
+ }>;
104
+ /**
105
+ * The definition a hit sits inside, when the file's shape says so plainly.
106
+ *
107
+ * @category schemas
108
+ * @since 1.0.0
109
+ */
110
+ export declare const Symbol: Schema.Struct<{
111
+ readonly kind: Schema.String;
112
+ readonly name: Schema.String;
113
+ readonly startLine: Schema.Int;
114
+ readonly endLine: Schema.Int;
115
+ }>;
116
+ /**
117
+ * One hit and the context that belongs to it.
118
+ *
119
+ * @category schemas
120
+ * @since 1.0.0
121
+ */
122
+ export declare const Match: Schema.Struct<{
123
+ readonly file: Schema.String;
124
+ readonly line: Schema.Int;
125
+ readonly text: Schema.String;
126
+ readonly before: Schema.$Array<Schema.Struct<{
127
+ readonly line: Schema.Int;
128
+ readonly text: Schema.String;
129
+ }>>;
130
+ readonly after: Schema.$Array<Schema.Struct<{
131
+ readonly line: Schema.Int;
132
+ readonly text: Schema.String;
133
+ }>>;
134
+ readonly symbol: Schema.optional<Schema.Struct<{
135
+ readonly kind: Schema.String;
136
+ readonly name: Schema.String;
137
+ readonly startLine: Schema.Int;
138
+ readonly endLine: Schema.Int;
139
+ }>>;
140
+ }>;
141
+ /**
142
+ * Output produced by {@link run}.
143
+ *
144
+ * @category schemas
145
+ * @since 1.0.0
146
+ */
147
+ export declare const Output: Schema.Struct<{
148
+ readonly matches: Schema.$Array<Schema.Struct<{
149
+ readonly file: Schema.String;
150
+ readonly line: Schema.Int;
151
+ readonly text: Schema.String;
152
+ readonly before: Schema.$Array<Schema.Struct<{
153
+ readonly line: Schema.Int;
154
+ readonly text: Schema.String;
155
+ }>>;
156
+ readonly after: Schema.$Array<Schema.Struct<{
157
+ readonly line: Schema.Int;
158
+ readonly text: Schema.String;
159
+ }>>;
160
+ readonly symbol: Schema.optional<Schema.Struct<{
161
+ readonly kind: Schema.String;
162
+ readonly name: Schema.String;
163
+ readonly startLine: Schema.Int;
164
+ readonly endLine: Schema.Int;
165
+ }>>;
166
+ }>>;
167
+ readonly files: Schema.$Array<Schema.String>;
168
+ readonly filesSearched: Schema.Int;
169
+ readonly skippedBinary: Schema.Int;
170
+ readonly truncated: Schema.Boolean;
171
+ readonly retriedAsLiteral: Schema.optional<Schema.Boolean>;
172
+ readonly notice: Schema.optional<Schema.String>;
173
+ }>;
174
+ /**
175
+ * Decoded output returned by the `grep` flow.
176
+ *
177
+ * @category models
178
+ * @since 1.0.0
179
+ */
180
+ export type Output = typeof Output.Type;
181
+ /**
182
+ * Conservative sealed declaration for all workspace files.
183
+ *
184
+ * @category effects
185
+ * @since 1.0.0
186
+ */
187
+ export declare const effects: import("@smthrs/plan/Effects").Declaration;
188
+ /**
189
+ * Narrows the read declaration to the requested root subtree.
190
+ *
191
+ * @category effects
192
+ * @since 1.0.0
193
+ */
194
+ export declare const effectsFor: (input: {
195
+ readonly root?: string | undefined;
196
+ }) => import("@smthrs/plan/Effects").Declaration;
197
+ /**
198
+ * Capability strings requested by grep.
199
+ *
200
+ * @category capabilities
201
+ * @since 1.0.0
202
+ */
203
+ export declare const capabilities: string[];
204
+ /**
205
+ * Declaration-only grep flow.
206
+ *
207
+ * @category flows
208
+ * @since 1.0.0
209
+ */
210
+ export declare const flow: {
211
+ readonly name: "grep";
212
+ 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.";
213
+ readonly input: Schema.Struct<{
214
+ readonly pattern: Schema.String;
215
+ readonly root: Schema.optional<Schema.String>;
216
+ readonly fixedStrings: Schema.optional<Schema.Boolean>;
217
+ readonly ignoreCase: Schema.optional<Schema.Boolean>;
218
+ readonly smartCase: Schema.optional<Schema.Boolean>;
219
+ readonly globs: Schema.optional<Schema.$Array<Schema.String>>;
220
+ readonly beforeContext: Schema.optional<Schema.Int>;
221
+ readonly afterContext: Schema.optional<Schema.Int>;
222
+ readonly context: Schema.optional<Schema.Int>;
223
+ readonly maxCount: Schema.optional<Schema.Int>;
224
+ readonly filesWithMatches: Schema.optional<Schema.Boolean>;
225
+ readonly hidden: Schema.optional<Schema.Boolean>;
226
+ readonly symbols: Schema.optional<Schema.Boolean>;
227
+ readonly noIgnore: Schema.optional<Schema.Boolean>;
228
+ readonly limit: Schema.optional<Schema.Int>;
229
+ }>;
230
+ readonly output: Schema.Struct<{
231
+ readonly matches: Schema.$Array<Schema.Struct<{
232
+ readonly file: Schema.String;
233
+ readonly line: Schema.Int;
234
+ readonly text: Schema.String;
235
+ readonly before: Schema.$Array<Schema.Struct<{
236
+ readonly line: Schema.Int;
237
+ readonly text: Schema.String;
238
+ }>>;
239
+ readonly after: Schema.$Array<Schema.Struct<{
240
+ readonly line: Schema.Int;
241
+ readonly text: Schema.String;
242
+ }>>;
243
+ readonly symbol: Schema.optional<Schema.Struct<{
244
+ readonly kind: Schema.String;
245
+ readonly name: Schema.String;
246
+ readonly startLine: Schema.Int;
247
+ readonly endLine: Schema.Int;
248
+ }>>;
249
+ }>>;
250
+ readonly files: Schema.$Array<Schema.String>;
251
+ readonly filesSearched: Schema.Int;
252
+ readonly skippedBinary: Schema.Int;
253
+ readonly truncated: Schema.Boolean;
254
+ readonly retriedAsLiteral: Schema.optional<Schema.Boolean>;
255
+ readonly notice: Schema.optional<Schema.String>;
256
+ }>;
257
+ readonly capabilities: string[];
258
+ readonly effects: import("@smthrs/plan/Effects").Declaration;
259
+ };
260
+ /**
261
+ * What a call to this flow does, for a reader of a run.
262
+ *
263
+ * Display metadata only. `@smthrs/registry` `Descriptor.FlowActivity` is the
264
+ * governing vocabulary and `StandardFlows` binds this value onto the flow's
265
+ * descriptor, where the binding site checks it. `declarationDigest` excludes
266
+ * it, so declaring it cannot invalidate a call identity or a cached prompt.
267
+ *
268
+ * @category presentation
269
+ * @since 1.0.0-rc.0
270
+ */
271
+ export declare const activity: "reads";
272
+ /**
273
+ * How one recorded call to this flow reads: the verb for each settlement, the
274
+ * input field that is its subject, and the measured output fields a one-line
275
+ * summary may count.
276
+ *
277
+ * Display metadata only, governed by `@smthrs/registry`
278
+ * `Descriptor.CallPresentation` and checked where `StandardFlows` binds it.
279
+ *
280
+ * @category presentation
281
+ * @since 1.0.0-rc.0
282
+ */
283
+ export declare const presentation: {
284
+ readonly verb: {
285
+ readonly pending: "searching";
286
+ readonly success: "searched";
287
+ readonly failure: "failed to search";
288
+ };
289
+ readonly subject: "pattern";
290
+ readonly result: "matches";
291
+ };
292
+ /**
293
+ * Runs one validated ripgrep-contract call through the selected peer implementation.
294
+ *
295
+ * A pattern full of metacharacters that finds nothing is the most common way a
296
+ * search lies: `sphinx-16612` searched 867 files for a parenthesised name and
297
+ * read `0 of 867` as "this symbol is not used here". The retry costs one more
298
+ * pass over the same tree only in the case that already found nothing, and the
299
+ * result says plainly that the answer came from the literal reading.
300
+ *
301
+ * @category handlers
302
+ * @since 1.0.0
303
+ */
304
+ export declare const run: (input: {
305
+ readonly pattern: string;
306
+ readonly root?: string | undefined;
307
+ readonly limit?: number | undefined;
308
+ readonly context?: number | undefined;
309
+ readonly hidden?: boolean | undefined;
310
+ readonly noIgnore?: boolean | undefined;
311
+ readonly fixedStrings?: boolean | undefined;
312
+ readonly ignoreCase?: boolean | undefined;
313
+ readonly smartCase?: boolean | undefined;
314
+ readonly globs?: readonly string[] | undefined;
315
+ readonly beforeContext?: number | undefined;
316
+ readonly afterContext?: number | undefined;
317
+ readonly maxCount?: number | undefined;
318
+ readonly filesWithMatches?: boolean | undefined;
319
+ readonly symbols?: boolean | undefined;
320
+ }) => Effect.Effect<{
321
+ readonly truncated: boolean;
322
+ readonly matches: readonly {
323
+ readonly line: number;
324
+ readonly text: string;
325
+ readonly file: string;
326
+ readonly after: readonly {
327
+ readonly line: number;
328
+ readonly text: string;
329
+ }[];
330
+ readonly before: readonly {
331
+ readonly line: number;
332
+ readonly text: string;
333
+ }[];
334
+ readonly symbol?: {
335
+ readonly kind: string;
336
+ readonly name: string;
337
+ readonly startLine: number;
338
+ readonly endLine: number;
339
+ } | undefined;
340
+ }[];
341
+ readonly files: readonly string[];
342
+ readonly filesSearched: number;
343
+ readonly skippedBinary: number;
344
+ readonly notice?: string | undefined;
345
+ readonly retriedAsLiteral?: boolean | undefined;
346
+ }, StdError.StdError, Search.Search>;
347
+ //# sourceMappingURL=Grep.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Grep.d.ts","sourceRoot":"","sources":["../../src/Grep.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;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AACH,eAAO,MAAM,YAAY;;;;;;;;CAIf,CAAA;AA4CV;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAiBd,CAAA"}
@@ -0,0 +1,181 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name2 in all)
10
+ __defProp(target, name2, { get: all[name2], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var Grep_exports = {};
30
+ __export(Grep_exports, {
31
+ ContextLine: () => ContextLine,
32
+ Input: () => Input,
33
+ Match: () => Match,
34
+ Output: () => Output,
35
+ Symbol: () => Symbol2,
36
+ activity: () => activity,
37
+ capabilities: () => capabilities,
38
+ description: () => description,
39
+ effects: () => effects,
40
+ effectsFor: () => effectsFor,
41
+ flow: () => flow,
42
+ name: () => name,
43
+ presentation: () => presentation,
44
+ run: () => run
45
+ });
46
+ module.exports = __toCommonJS(Grep_exports);
47
+ var import_effect = require("effect");
48
+ var import_Declaration = require("./internal/Declaration.js");
49
+ var import_SearchContract = require("./internal/SearchContract.js");
50
+ var import_Text = require("./internal/Text.js");
51
+ var Search = __toESM(require("./Search.js"), 1);
52
+ var Contract = __toESM(require("./SearchContract.js"), 1);
53
+ var StdError = __toESM(require("./StdError.js"), 1);
54
+ const name = "grep";
55
+ const 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.";
56
+ const Input = import_effect.Schema.Struct({
57
+ pattern: import_effect.Schema.String.annotate({ description: "Smithers Ripgrep ASCII v1 expression." }),
58
+ root: import_effect.Schema.optional(import_effect.Schema.String).annotate({
59
+ description: "Search root the globs are relative to; defaults to . (the host workspace)."
60
+ }),
61
+ fixedStrings: import_effect.Schema.optional(import_effect.Schema.Boolean).annotate({ description: "Ripgrep -F." }),
62
+ ignoreCase: import_effect.Schema.optional(import_effect.Schema.Boolean).annotate({ description: "Ripgrep -i." }),
63
+ smartCase: import_effect.Schema.optional(import_effect.Schema.Boolean).annotate({ description: "Ripgrep -S." }),
64
+ globs: import_effect.Schema.optional(import_effect.Schema.Array(import_effect.Schema.String)).annotate({
65
+ description: "Ordered ripgrep -g globs, matched against paths relative to root, never absolute paths: a glob without / matches any basename, a leading / anchors at root, and ** crosses directories. Prefix exclusions with !."
66
+ }),
67
+ beforeContext: import_effect.Schema.optional(import_effect.Schema.Int.check(import_effect.Schema.isGreaterThanOrEqualTo(0))).annotate({
68
+ description: "Ripgrep -B."
69
+ }),
70
+ afterContext: import_effect.Schema.optional(import_effect.Schema.Int.check(import_effect.Schema.isGreaterThanOrEqualTo(0))).annotate({
71
+ description: "Ripgrep -A."
72
+ }),
73
+ context: import_effect.Schema.optional(import_effect.Schema.Int.check(import_effect.Schema.isGreaterThanOrEqualTo(0))).annotate({ description: "Ripgrep -C." }),
74
+ maxCount: import_effect.Schema.optional(import_effect.Schema.Int.check(import_effect.Schema.isGreaterThanOrEqualTo(1))).annotate({
75
+ description: "Ripgrep --max-count, per file; at least 1."
76
+ }),
77
+ filesWithMatches: import_effect.Schema.optional(import_effect.Schema.Boolean).annotate({ description: "Ripgrep --files-with-matches." }),
78
+ hidden: import_effect.Schema.optional(import_effect.Schema.Boolean).annotate({ description: "Ripgrep --hidden." }),
79
+ symbols: import_effect.Schema.optional(import_effect.Schema.Boolean).annotate({
80
+ description: "Report the definition enclosing each returned hit; true by default."
81
+ }),
82
+ noIgnore: import_effect.Schema.optional(import_effect.Schema.Boolean).annotate({
83
+ description: "Honor root-scoped .gitignore files by default. Set true to include ignored paths; hidden and fixed directory skips still apply."
84
+ }),
85
+ limit: import_effect.Schema.optional(import_effect.Schema.Int.check(import_effect.Schema.isGreaterThanOrEqualTo(0))).annotate({
86
+ description: `Global result limit, capped at ${import_Text.MAX_GREP_MATCHES}.`
87
+ })
88
+ });
89
+ const ContextLine = import_effect.Schema.Struct({
90
+ line: import_effect.Schema.Int.annotate({ description: "1-based line number" }),
91
+ text: import_effect.Schema.String
92
+ });
93
+ const Symbol2 = import_effect.Schema.Struct({
94
+ kind: import_effect.Schema.String.annotate({ description: "The declaration keyword, such as def or class" }),
95
+ name: import_effect.Schema.String,
96
+ startLine: import_effect.Schema.Int.annotate({ description: "1-based first line of the definition" }),
97
+ endLine: import_effect.Schema.Int.annotate({
98
+ description: "1-based last line of the definition; read this range, do not guess one"
99
+ })
100
+ });
101
+ const Match = import_effect.Schema.Struct({
102
+ file: import_effect.Schema.String,
103
+ line: import_effect.Schema.Int,
104
+ text: import_effect.Schema.String,
105
+ before: import_effect.Schema.Array(ContextLine),
106
+ after: import_effect.Schema.Array(ContextLine),
107
+ symbol: import_effect.Schema.optional(Symbol2)
108
+ });
109
+ const Output = import_effect.Schema.Struct({
110
+ matches: import_effect.Schema.Array(Match),
111
+ files: import_effect.Schema.Array(import_effect.Schema.String),
112
+ filesSearched: import_effect.Schema.Int,
113
+ skippedBinary: import_effect.Schema.Int,
114
+ truncated: import_effect.Schema.Boolean,
115
+ retriedAsLiteral: import_effect.Schema.optional(import_effect.Schema.Boolean).annotate({
116
+ description: "Present when the pattern found nothing as a regex and these results come from re-running it literally"
117
+ }),
118
+ notice: import_effect.Schema.optional(import_effect.Schema.String)
119
+ });
120
+ const effects = (0, import_Declaration.envelope)({ tier: "sealed", mode: "hermetic", reads: ["/**"], writes: [] });
121
+ const effectsFor = (input) => (0, import_Declaration.envelope)({ tier: "sealed", mode: "hermetic", reads: [(0, import_Declaration.rootSubtree)(input.root ?? ".")], writes: [] });
122
+ const capabilities = [(0, import_Declaration.capability)("fs:read", "/**")];
123
+ const flow = { name, description, input: Input, output: Output, capabilities, effects };
124
+ const activity = "reads";
125
+ const presentation = {
126
+ verb: { pending: "searching", success: "searched", failure: "failed to search" },
127
+ subject: "pattern",
128
+ result: "matches"
129
+ };
130
+ const normalize = (input) => {
131
+ if (input.ignoreCase === true && input.smartCase === true) {
132
+ return (0, import_SearchContract.invalidInput)("-i and -S are mutually exclusive");
133
+ }
134
+ if (input.context !== void 0 && (input.beforeContext !== void 0 || input.afterContext !== void 0)) {
135
+ return (0, import_SearchContract.invalidInput)("-C cannot be combined with -A or -B");
136
+ }
137
+ if (input.maxCount !== void 0 && input.maxCount < 1) {
138
+ return (0, import_SearchContract.invalidInput)("--max-count must be at least 1");
139
+ }
140
+ const fixedStrings = input.fixedStrings ?? false;
141
+ const patternError = Contract.validatePattern(input.pattern, fixedStrings);
142
+ if (patternError !== void 0) return patternError;
143
+ for (const glob of input.globs ?? []) {
144
+ const globError = Contract.validateGlob(glob);
145
+ if (globError !== void 0) return globError;
146
+ }
147
+ return {
148
+ pattern: input.pattern,
149
+ root: input.root ?? ".",
150
+ fixedStrings,
151
+ ignoreCase: input.ignoreCase ?? false,
152
+ smartCase: input.smartCase ?? false,
153
+ globs: input.globs ?? [],
154
+ beforeContext: input.context ?? input.beforeContext ?? 0,
155
+ afterContext: input.context ?? input.afterContext ?? 0,
156
+ maxCount: input.maxCount,
157
+ filesWithMatches: input.filesWithMatches ?? false,
158
+ hidden: input.hidden ?? false,
159
+ noIgnore: input.noIgnore ?? false,
160
+ symbols: input.symbols ?? true,
161
+ limit: Math.min(input.limit ?? import_Text.MAX_GREP_MATCHES, import_Text.MAX_GREP_MATCHES)
162
+ };
163
+ };
164
+ const metacharacters = /[\\^$.|?*+()[\]{}]/;
165
+ const empty = (output) => output.matches.length === 0 && output.files.length === 0;
166
+ const run = import_effect.Effect.fn("Grep.run")(function* (input) {
167
+ const normalized = normalize(input);
168
+ if (normalized instanceof StdError.StdError) return yield* import_effect.Effect.fail(normalized);
169
+ const search = yield* Search.Search;
170
+ const result = yield* search.grep(normalized);
171
+ if (normalized.fixedStrings || !empty(result) || !metacharacters.test(normalized.pattern)) return result;
172
+ const literal = yield* search.grep({ ...normalized, fixedStrings: true });
173
+ if (empty(literal)) return result;
174
+ const explanation = `The pattern found nothing as a regular expression and these results come from re-running it literally (fixedStrings: true).`;
175
+ return {
176
+ ...literal,
177
+ retriedAsLiteral: true,
178
+ notice: literal.notice === void 0 ? explanation : `${explanation} ${literal.notice}`
179
+ };
180
+ });
181
+ //# sourceMappingURL=Grep.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/Grep.ts"],
4
+ "sourcesContent": ["/**\n * The `grep` flow and its Smithers Ripgrep Subset v1 contract.\n *\n * Supported ripgrep semantics: Rust-style regular expressions restricted to\n * Smithers Ripgrep ASCII v1; `-F` (`fixedStrings`); `-i` (`ignoreCase`) and `-S`\n * (`smartCase`); ordered `-g` include/exclude globs; `-A`, `-B`, and `-C`\n * context; per-file `--max-count`; `--files-with-matches`; `--hidden`; and\n * deterministic path/line ordering. Root and nested .gitignore files apply by\n * default, including outside git repositories. `noIgnore: true` opts out.\n * Parent/global ignore files, .git/info/exclude, .ignore and .rgignore are not\n * read. File-type registries are outside v1, and there is no `types` field to\n * pass. Patterns are capped at 4096 ASCII bytes and counted repetitions at 1000. Invalid UTF-8 is replacement-decoded; NUL-bearing\n * files are skipped and counted, while an explicitly named binary file is a\n * typed failure.\n *\n * Results are match-centric, which is `rg --json`'s own grouping: `limit`\n * counts matches, each match carries the context lines that belong to it, and\n * every context line belongs to exactly one match. A budget that counted rows\n * could spend itself on context and drop the match \u2014 astropy-7166 paid three\n * frames for exactly that \u2014 so a hit is never droppable to make room for its\n * own surroundings. Truncation is disclosed through `notice`.\n *\n * Each returned hit also carries the definition enclosing it when the file's\n * shape says so plainly, so a read window is computed rather than guessed, and\n * a metacharacter pattern that finds nothing is retried as a literal with\n * `retriedAsLiteral` set. Both are properties of the contract rather than of a\n * peer: they are computed in `internal/Grouping.ts` for both implementations.\n *\n * `globs` accepts exactly the shapes `glob` accepts and reads them the same\n * way: every pattern is matched against each candidate's path *relative to\n * `root`*, a pattern without `/` matches the basename at any depth, and a\n * leading `/` or `./` anchors at the root rather than naming a filesystem\n * absolute path. A `root` that names one file is searched whatever the globs\n * say. Caller globs filter after ignores; they never override them. See `Glob` for the full statement of the rules. A search that matched\n * nothing because a positive glob was unsatisfiable says so through `notice`\n * instead of returning a silent empty result.\n *\n * `filesSearched` counts every file the walk and globs admitted, including the binaries\n * `skippedBinary` reports and any file the process could not open. A walk\n * skips what it cannot read rather than failing the call.\n *\n * Native and in-process implementations are peers behind `Search.Search`.\n * This module declares and validates the call; it performs no host access.\n *\n * @since 1.0.0\n */\n\nimport { Effect, Schema } from \"effect\"\nimport { capability, envelope, rootSubtree } from \"./internal/Declaration.ts\"\nimport { invalidInput } from \"./internal/SearchContract.ts\"\nimport { MAX_GREP_MATCHES } from \"./internal/Text.ts\"\nimport * as Search from \"./Search.ts\"\nimport * as Contract from \"./SearchContract.ts\"\nimport * as StdError from \"./StdError.ts\"\n\n/**\n * The registry name for grep.\n *\n * @category identifiers\n * @since 1.0.0\n */\nexport const name = \"grep\"\n/**\n * The model-facing grep description.\n *\n * @category descriptions\n * @since 1.0.0\n */\nexport const description =\n \"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.\"\n\n/**\n * Input accepted by {@link flow} and {@link run}.\n *\n * @category schemas\n * @since 1.0.0\n */\nexport const Input = Schema.Struct({\n pattern: Schema.String.annotate({ description: \"Smithers Ripgrep ASCII v1 expression.\" }),\n root: Schema.optional(Schema.String).annotate({\n description: \"Search root the globs are relative to; defaults to . (the host workspace).\"\n }),\n fixedStrings: Schema.optional(Schema.Boolean).annotate({ description: \"Ripgrep -F.\" }),\n ignoreCase: Schema.optional(Schema.Boolean).annotate({ description: \"Ripgrep -i.\" }),\n smartCase: Schema.optional(Schema.Boolean).annotate({ description: \"Ripgrep -S.\" }),\n globs: Schema.optional(Schema.Array(Schema.String)).annotate({\n description:\n \"Ordered ripgrep -g globs, matched against paths relative to root, never absolute paths: a glob without / matches any basename, a leading / anchors at root, and ** crosses directories. Prefix exclusions with !.\"\n }),\n beforeContext: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))).annotate({\n description: \"Ripgrep -B.\"\n }),\n afterContext: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))).annotate({\n description: \"Ripgrep -A.\"\n }),\n context: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))).annotate({ description: \"Ripgrep -C.\" }),\n maxCount: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(1))).annotate({\n description: \"Ripgrep --max-count, per file; at least 1.\"\n }),\n filesWithMatches: Schema.optional(Schema.Boolean).annotate({ description: \"Ripgrep --files-with-matches.\" }),\n hidden: Schema.optional(Schema.Boolean).annotate({ description: \"Ripgrep --hidden.\" }),\n symbols: Schema.optional(Schema.Boolean).annotate({\n description: \"Report the definition enclosing each returned hit; true by default.\"\n }),\n noIgnore: Schema.optional(Schema.Boolean).annotate({\n description:\n \"Honor root-scoped .gitignore files by default. Set true to include ignored paths; hidden and fixed directory skips still apply.\"\n }),\n limit: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))).annotate({\n description: `Global result limit, capped at ${MAX_GREP_MATCHES}.`\n })\n})\n\n/**\n * Decoded input accepted by the `grep` flow.\n *\n * @category models\n * @since 1.0.0\n */\nexport type Input = typeof Input.Type\n\n/**\n * One matching or context line.\n *\n * @category schemas\n * @since 1.0.0\n */\nexport const ContextLine = Schema.Struct({\n line: Schema.Int.annotate({ description: \"1-based line number\" }),\n text: Schema.String\n})\n\n/**\n * The definition a hit sits inside, when the file's shape says so plainly.\n *\n * @category schemas\n * @since 1.0.0\n */\nexport const Symbol = Schema.Struct({\n kind: Schema.String.annotate({ description: \"The declaration keyword, such as def or class\" }),\n name: Schema.String,\n startLine: Schema.Int.annotate({ description: \"1-based first line of the definition\" }),\n endLine: Schema.Int.annotate({\n description: \"1-based last line of the definition; read this range, do not guess one\"\n })\n})\n\n/**\n * One hit and the context that belongs to it.\n *\n * @category schemas\n * @since 1.0.0\n */\nexport const Match = Schema.Struct({\n file: Schema.String,\n line: Schema.Int,\n text: Schema.String,\n before: Schema.Array(ContextLine),\n after: Schema.Array(ContextLine),\n symbol: Schema.optional(Symbol)\n})\n\n/**\n * Output produced by {@link run}.\n *\n * @category schemas\n * @since 1.0.0\n */\nexport const Output = Schema.Struct({\n matches: Schema.Array(Match),\n files: Schema.Array(Schema.String),\n filesSearched: Schema.Int,\n skippedBinary: Schema.Int,\n truncated: Schema.Boolean,\n retriedAsLiteral: Schema.optional(Schema.Boolean).annotate({\n description: \"Present when the pattern found nothing as a regex and these results come from re-running it literally\"\n }),\n notice: Schema.optional(Schema.String)\n})\n\n/**\n * Decoded output returned by the `grep` flow.\n *\n * @category models\n * @since 1.0.0\n */\nexport type Output = typeof Output.Type\n\n/**\n * Conservative sealed declaration for all workspace files.\n *\n * @category effects\n * @since 1.0.0\n */\nexport const effects = envelope({ tier: \"sealed\", mode: \"hermetic\", reads: [\"/**\"], writes: [] })\n/**\n * Narrows the read declaration to the requested root subtree.\n *\n * @category effects\n * @since 1.0.0\n */\nexport const effectsFor = (input: { readonly root?: string | undefined }) =>\n envelope({ tier: \"sealed\", mode: \"hermetic\", reads: [rootSubtree(input.root ?? \".\")], writes: [] })\n/**\n * Capability strings requested by grep.\n *\n * @category capabilities\n * @since 1.0.0\n */\nexport const capabilities = [capability(\"fs:read\", \"/**\")]\n/**\n * Declaration-only grep 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 = \"reads\" 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: \"searching\", success: \"searched\", failure: \"failed to search\" },\n subject: \"pattern\",\n result: \"matches\"\n} as const\n\nconst normalize = (input: typeof Input.Type): Search.GrepInput | StdError.StdError => {\n if (input.ignoreCase === true && input.smartCase === true) {\n return invalidInput(\"-i and -S are mutually exclusive\")\n }\n if (input.context !== undefined && (input.beforeContext !== undefined || input.afterContext !== undefined)) {\n return invalidInput(\"-C cannot be combined with -A or -B\")\n }\n // `rg --max-count 0` answers nothing at all, not even the summary the native\n // peer parses, so a cap that admits no match is rejected rather than read\n // differently by each peer.\n if (input.maxCount !== undefined && input.maxCount < 1) {\n return invalidInput(\"--max-count must be at least 1\")\n }\n const fixedStrings = input.fixedStrings ?? false\n const patternError = Contract.validatePattern(input.pattern, fixedStrings)\n if (patternError !== undefined) return patternError\n for (const glob of input.globs ?? []) {\n const globError = Contract.validateGlob(glob)\n if (globError !== undefined) return globError\n }\n return {\n pattern: input.pattern,\n root: input.root ?? \".\",\n fixedStrings,\n ignoreCase: input.ignoreCase ?? false,\n smartCase: input.smartCase ?? false,\n globs: input.globs ?? [],\n beforeContext: input.context ?? input.beforeContext ?? 0,\n afterContext: input.context ?? input.afterContext ?? 0,\n maxCount: input.maxCount,\n filesWithMatches: input.filesWithMatches ?? false,\n hidden: input.hidden ?? false,\n noIgnore: input.noIgnore ?? false,\n symbols: input.symbols ?? true,\n limit: Math.min(input.limit ?? MAX_GREP_MATCHES, MAX_GREP_MATCHES)\n }\n}\n\nconst metacharacters = /[\\\\^$.|?*+()[\\]{}]/\n\nconst empty = (output: typeof Output.Type): boolean => output.matches.length === 0 && output.files.length === 0\n\n/**\n * Runs one validated ripgrep-contract call through the selected peer implementation.\n *\n * A pattern full of metacharacters that finds nothing is the most common way a\n * search lies: `sphinx-16612` searched 867 files for a parenthesised name and\n * read `0 of 867` as \"this symbol is not used here\". The retry costs one more\n * pass over the same tree only in the case that already found nothing, and the\n * result says plainly that the answer came from the literal reading.\n *\n * @category handlers\n * @since 1.0.0\n */\nexport const run = Effect.fn(\"Grep.run\")(function*(\n input: typeof Input.Type\n): Effect.fn.Return<typeof Output.Type, StdError.StdError, Search.Search> {\n const normalized = normalize(input)\n if (normalized instanceof StdError.StdError) return yield* Effect.fail(normalized)\n const search = yield* Search.Search\n const result = yield* search.grep(normalized)\n if (normalized.fixedStrings || !empty(result) || !metacharacters.test(normalized.pattern)) return result\n const literal = yield* search.grep({ ...normalized, fixedStrings: true })\n if (empty(literal)) return result\n const explanation =\n `The pattern found nothing as a regular expression and these results come from re-running it literally (fixedStrings: true).`\n return {\n ...literal,\n retriedAsLiteral: true,\n notice: literal.notice === undefined ? explanation : `${explanation} ${literal.notice}`\n }\n})\n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