@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.
- package/CHANGELOG.md +148 -0
- package/LICENSE +21 -0
- package/README.md +156 -2
- package/dist/cjs/ApplyPatch.d.ts +174 -0
- package/dist/cjs/ApplyPatch.d.ts.map +1 -0
- package/dist/cjs/ApplyPatch.js +309 -0
- package/dist/cjs/ApplyPatch.js.map +7 -0
- package/dist/cjs/Bash.d.ts +390 -0
- package/dist/cjs/Bash.d.ts.map +1 -0
- package/dist/cjs/Bash.js +333 -0
- package/dist/cjs/Bash.js.map +7 -0
- package/dist/cjs/Checkpoints.d.ts +322 -0
- package/dist/cjs/Checkpoints.d.ts.map +1 -0
- package/dist/cjs/Checkpoints.js +233 -0
- package/dist/cjs/Checkpoints.js.map +7 -0
- package/dist/cjs/Container.d.ts +132 -0
- package/dist/cjs/Container.d.ts.map +1 -0
- package/dist/cjs/Container.js +113 -0
- package/dist/cjs/Container.js.map +7 -0
- package/dist/cjs/Edit.d.ts +203 -0
- package/dist/cjs/Edit.d.ts.map +1 -0
- package/dist/cjs/Edit.js +258 -0
- package/dist/cjs/Edit.js.map +7 -0
- package/dist/cjs/ExaWebSearch.d.ts +22 -0
- package/dist/cjs/ExaWebSearch.d.ts.map +1 -0
- package/dist/cjs/ExaWebSearch.js +138 -0
- package/dist/cjs/ExaWebSearch.js.map +7 -0
- package/dist/cjs/Explore.d.ts +328 -0
- package/dist/cjs/Explore.d.ts.map +1 -0
- package/dist/cjs/Explore.js +90 -0
- package/dist/cjs/Explore.js.map +7 -0
- package/dist/cjs/Fetch.d.ts +130 -0
- package/dist/cjs/Fetch.d.ts.map +1 -0
- package/dist/cjs/Fetch.js +64 -0
- package/dist/cjs/Fetch.js.map +7 -0
- package/dist/cjs/Glob.d.ts +204 -0
- package/dist/cjs/Glob.d.ts.map +1 -0
- package/dist/cjs/Glob.js +94 -0
- package/dist/cjs/Glob.js.map +7 -0
- package/dist/cjs/Grep.d.ts +347 -0
- package/dist/cjs/Grep.d.ts.map +1 -0
- package/dist/cjs/Grep.js +181 -0
- package/dist/cjs/Grep.js.map +7 -0
- package/dist/cjs/HttpPost.d.ts +130 -0
- package/dist/cjs/HttpPost.d.ts.map +1 -0
- package/dist/cjs/HttpPost.js +72 -0
- package/dist/cjs/HttpPost.js.map +7 -0
- package/dist/cjs/LanguageServer.d.ts +90 -0
- package/dist/cjs/LanguageServer.d.ts.map +1 -0
- package/dist/cjs/LanguageServer.js +60 -0
- package/dist/cjs/LanguageServer.js.map +7 -0
- package/dist/cjs/Ls.d.ts +164 -0
- package/dist/cjs/Ls.d.ts.map +1 -0
- package/dist/cjs/Ls.js +136 -0
- package/dist/cjs/Ls.js.map +7 -0
- package/dist/cjs/Lsp.d.ts +125 -0
- package/dist/cjs/Lsp.d.ts.map +1 -0
- package/dist/cjs/Lsp.js +137 -0
- package/dist/cjs/Lsp.js.map +7 -0
- package/dist/cjs/Manifest.d.ts +918 -0
- package/dist/cjs/Manifest.d.ts.map +1 -0
- package/dist/cjs/Manifest.js +144 -0
- package/dist/cjs/Manifest.js.map +7 -0
- package/dist/cjs/NativeSearch.d.ts +38 -0
- package/dist/cjs/NativeSearch.d.ts.map +1 -0
- package/dist/cjs/NativeSearch.js +326 -0
- package/dist/cjs/NativeSearch.js.map +7 -0
- package/dist/cjs/NodeLanguageServer.d.ts +128 -0
- package/dist/cjs/NodeLanguageServer.d.ts.map +1 -0
- package/dist/cjs/NodeLanguageServer.js +796 -0
- package/dist/cjs/NodeLanguageServer.js.map +7 -0
- package/dist/cjs/PortableSearch.d.ts +36 -0
- package/dist/cjs/PortableSearch.d.ts.map +1 -0
- package/dist/cjs/PortableSearch.js +240 -0
- package/dist/cjs/PortableSearch.js.map +7 -0
- package/dist/cjs/Probe.d.ts +193 -0
- package/dist/cjs/Probe.d.ts.map +1 -0
- package/dist/cjs/Probe.js +134 -0
- package/dist/cjs/Probe.js.map +7 -0
- package/dist/cjs/Read.d.ts +189 -0
- package/dist/cjs/Read.d.ts.map +1 -0
- package/dist/cjs/Read.js +223 -0
- package/dist/cjs/Read.js.map +7 -0
- package/dist/cjs/Relocate.d.ts +73 -0
- package/dist/cjs/Relocate.d.ts.map +1 -0
- package/dist/cjs/Relocate.js +72 -0
- package/dist/cjs/Relocate.js.map +7 -0
- package/dist/cjs/RemoteSearch.d.ts +54 -0
- package/dist/cjs/RemoteSearch.d.ts.map +1 -0
- package/dist/cjs/RemoteSearch.js +134 -0
- package/dist/cjs/RemoteSearch.js.map +7 -0
- package/dist/cjs/Search.d.ts +163 -0
- package/dist/cjs/Search.d.ts.map +1 -0
- package/dist/cjs/Search.js +51 -0
- package/dist/cjs/Search.js.map +7 -0
- package/dist/cjs/SearchConformance.d.ts +115 -0
- package/dist/cjs/SearchConformance.d.ts.map +1 -0
- package/dist/cjs/SearchConformance.js +172 -0
- package/dist/cjs/SearchConformance.js.map +7 -0
- package/dist/cjs/SearchContract.d.ts +114 -0
- package/dist/cjs/SearchContract.d.ts.map +1 -0
- package/dist/cjs/SearchContract.js +339 -0
- package/dist/cjs/SearchContract.js.map +7 -0
- package/dist/cjs/ShellCommand.d.ts +164 -0
- package/dist/cjs/ShellCommand.d.ts.map +1 -0
- package/dist/cjs/ShellCommand.js +102 -0
- package/dist/cjs/ShellCommand.js.map +7 -0
- package/dist/cjs/StdError.d.ts +55 -0
- package/dist/cjs/StdError.d.ts.map +1 -0
- package/dist/cjs/StdError.js +74 -0
- package/dist/cjs/StdError.js.map +7 -0
- package/dist/cjs/TestRun.d.ts +311 -0
- package/dist/cjs/TestRun.d.ts.map +1 -0
- package/dist/cjs/TestRun.js +228 -0
- package/dist/cjs/TestRun.js.map +7 -0
- package/dist/cjs/TestRunner.d.ts +102 -0
- package/dist/cjs/TestRunner.d.ts.map +1 -0
- package/dist/cjs/TestRunner.js +54 -0
- package/dist/cjs/TestRunner.js.map +7 -0
- package/dist/cjs/TreeFingerprint.d.ts +140 -0
- package/dist/cjs/TreeFingerprint.d.ts.map +1 -0
- package/dist/cjs/TreeFingerprint.js +87 -0
- package/dist/cjs/TreeFingerprint.js.map +7 -0
- package/dist/cjs/UpdatePlan.d.ts +152 -0
- package/dist/cjs/UpdatePlan.d.ts.map +1 -0
- package/dist/cjs/UpdatePlan.js +87 -0
- package/dist/cjs/UpdatePlan.js.map +7 -0
- package/dist/cjs/WebFetch.d.ts +134 -0
- package/dist/cjs/WebFetch.d.ts.map +1 -0
- package/dist/cjs/WebFetch.js +140 -0
- package/dist/cjs/WebFetch.js.map +7 -0
- package/dist/cjs/WebSearch.d.ts +181 -0
- package/dist/cjs/WebSearch.d.ts.map +1 -0
- package/dist/cjs/WebSearch.js +86 -0
- package/dist/cjs/WebSearch.js.map +7 -0
- package/dist/cjs/Write.d.ts +147 -0
- package/dist/cjs/Write.d.ts.map +1 -0
- package/dist/cjs/Write.js +122 -0
- package/dist/cjs/Write.js.map +7 -0
- package/dist/cjs/index.d.ts +129 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +101 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/internal/ApplyPatch.d.ts +145 -0
- package/dist/cjs/internal/ApplyPatch.d.ts.map +1 -0
- package/dist/cjs/internal/ApplyPatch.js +462 -0
- package/dist/cjs/internal/ApplyPatch.js.map +7 -0
- package/dist/cjs/internal/CodexText.d.ts +73 -0
- package/dist/cjs/internal/CodexText.d.ts.map +1 -0
- package/dist/cjs/internal/CodexText.js +108 -0
- package/dist/cjs/internal/CodexText.js.map +7 -0
- package/dist/cjs/internal/Declaration.d.ts +49 -0
- package/dist/cjs/internal/Declaration.d.ts.map +1 -0
- package/dist/cjs/internal/Declaration.js +46 -0
- package/dist/cjs/internal/Declaration.js.map +7 -0
- package/dist/cjs/internal/Diagnostics.d.ts +77 -0
- package/dist/cjs/internal/Diagnostics.d.ts.map +1 -0
- package/dist/cjs/internal/Diagnostics.js +89 -0
- package/dist/cjs/internal/Diagnostics.js.map +7 -0
- package/dist/cjs/internal/EnvelopePrecheck.d.ts +69 -0
- package/dist/cjs/internal/EnvelopePrecheck.d.ts.map +1 -0
- package/dist/cjs/internal/EnvelopePrecheck.js +323 -0
- package/dist/cjs/internal/EnvelopePrecheck.js.map +7 -0
- package/dist/cjs/internal/Exec.d.ts +151 -0
- package/dist/cjs/internal/Exec.d.ts.map +1 -0
- package/dist/cjs/internal/Exec.js +207 -0
- package/dist/cjs/internal/Exec.js.map +7 -0
- package/dist/cjs/internal/FileMutation.d.ts +109 -0
- package/dist/cjs/internal/FileMutation.d.ts.map +1 -0
- package/dist/cjs/internal/FileMutation.js +116 -0
- package/dist/cjs/internal/FileMutation.js.map +7 -0
- package/dist/cjs/internal/FsFailure.d.ts +38 -0
- package/dist/cjs/internal/FsFailure.d.ts.map +1 -0
- package/dist/cjs/internal/FsFailure.js +40 -0
- package/dist/cjs/internal/FsFailure.js.map +7 -0
- package/dist/cjs/internal/GitWorktree.d.ts +108 -0
- package/dist/cjs/internal/GitWorktree.d.ts.map +1 -0
- package/dist/cjs/internal/GitWorktree.js +276 -0
- package/dist/cjs/internal/GitWorktree.js.map +7 -0
- package/dist/cjs/internal/Grouping.d.ts +51 -0
- package/dist/cjs/internal/Grouping.d.ts.map +1 -0
- package/dist/cjs/internal/Grouping.js +83 -0
- package/dist/cjs/internal/Grouping.js.map +7 -0
- package/dist/cjs/internal/Html.d.ts +20 -0
- package/dist/cjs/internal/Html.d.ts.map +1 -0
- package/dist/cjs/internal/Html.js +81 -0
- package/dist/cjs/internal/Html.js.map +7 -0
- package/dist/cjs/internal/Http.d.ts +95 -0
- package/dist/cjs/internal/Http.d.ts.map +1 -0
- package/dist/cjs/internal/Http.js +153 -0
- package/dist/cjs/internal/Http.js.map +7 -0
- package/dist/cjs/internal/HttpNetwork.d.ts +27 -0
- package/dist/cjs/internal/HttpNetwork.d.ts.map +1 -0
- package/dist/cjs/internal/HttpNetwork.js +146 -0
- package/dist/cjs/internal/HttpNetwork.js.map +7 -0
- package/dist/cjs/internal/Ignore.d.ts +37 -0
- package/dist/cjs/internal/Ignore.d.ts.map +1 -0
- package/dist/cjs/internal/Ignore.js +100 -0
- package/dist/cjs/internal/Ignore.js.map +7 -0
- package/dist/cjs/internal/LinearRegex.d.ts +19 -0
- package/dist/cjs/internal/LinearRegex.d.ts.map +1 -0
- package/dist/cjs/internal/LinearRegex.js +166 -0
- package/dist/cjs/internal/LinearRegex.js.map +7 -0
- package/dist/cjs/internal/Match.d.ts +85 -0
- package/dist/cjs/internal/Match.d.ts.map +1 -0
- package/dist/cjs/internal/Match.js +99 -0
- package/dist/cjs/internal/Match.js.map +7 -0
- package/dist/cjs/internal/Paths.d.ts +23 -0
- package/dist/cjs/internal/Paths.d.ts.map +1 -0
- package/dist/cjs/internal/Paths.js +52 -0
- package/dist/cjs/internal/Paths.js.map +7 -0
- package/dist/cjs/internal/Preserve.d.ts +25 -0
- package/dist/cjs/internal/Preserve.d.ts.map +1 -0
- package/dist/cjs/internal/Preserve.js +88 -0
- package/dist/cjs/internal/Preserve.js.map +7 -0
- package/dist/cjs/internal/Prune.d.ts +35 -0
- package/dist/cjs/internal/Prune.d.ts.map +1 -0
- package/dist/cjs/internal/Prune.js +54 -0
- package/dist/cjs/internal/Prune.js.map +7 -0
- package/dist/cjs/internal/RemoteTree.d.ts +60 -0
- package/dist/cjs/internal/RemoteTree.d.ts.map +1 -0
- package/dist/cjs/internal/RemoteTree.js +123 -0
- package/dist/cjs/internal/RemoteTree.js.map +7 -0
- package/dist/cjs/internal/SearchContract.d.ts +63 -0
- package/dist/cjs/internal/SearchContract.d.ts.map +1 -0
- package/dist/cjs/internal/SearchContract.js +46 -0
- package/dist/cjs/internal/SearchContract.js.map +7 -0
- package/dist/cjs/internal/Symbols.d.ts +39 -0
- package/dist/cjs/internal/Symbols.d.ts.map +1 -0
- package/dist/cjs/internal/Symbols.js +59 -0
- package/dist/cjs/internal/Symbols.js.map +7 -0
- package/dist/cjs/internal/Tar.d.ts +23 -0
- package/dist/cjs/internal/Tar.d.ts.map +1 -0
- package/dist/cjs/internal/Tar.js +86 -0
- package/dist/cjs/internal/Tar.js.map +7 -0
- package/dist/cjs/internal/TestReport.d.ts +52 -0
- package/dist/cjs/internal/TestReport.d.ts.map +1 -0
- package/dist/cjs/internal/TestReport.js +131 -0
- package/dist/cjs/internal/TestReport.js.map +7 -0
- package/dist/cjs/internal/Text.d.ts +125 -0
- package/dist/cjs/internal/Text.d.ts.map +1 -0
- package/dist/cjs/internal/Text.js +85 -0
- package/dist/cjs/internal/Text.js.map +7 -0
- package/dist/cjs/internal/Url.d.ts +13 -0
- package/dist/cjs/internal/Url.d.ts.map +1 -0
- package/dist/cjs/internal/Url.js +35 -0
- package/dist/cjs/internal/Url.js.map +7 -0
- package/dist/cjs/internal/Walk.d.ts +72 -0
- package/dist/cjs/internal/Walk.d.ts.map +1 -0
- package/dist/cjs/internal/Walk.js +108 -0
- package/dist/cjs/internal/Walk.js.map +7 -0
- package/dist/cjs/package.json +1 -0
- package/dist/esm/ApplyPatch.d.ts +174 -0
- package/dist/esm/ApplyPatch.d.ts.map +1 -0
- package/dist/esm/ApplyPatch.js +346 -0
- package/dist/esm/ApplyPatch.js.map +1 -0
- package/dist/esm/Bash.d.ts +390 -0
- package/dist/esm/Bash.d.ts.map +1 -0
- package/dist/esm/Bash.js +514 -0
- package/dist/esm/Bash.js.map +1 -0
- package/dist/esm/Checkpoints.d.ts +322 -0
- package/dist/esm/Checkpoints.d.ts.map +1 -0
- package/dist/esm/Checkpoints.js +396 -0
- package/dist/esm/Checkpoints.js.map +1 -0
- package/dist/esm/Container.d.ts +132 -0
- package/dist/esm/Container.d.ts.map +1 -0
- package/dist/esm/Container.js +151 -0
- package/dist/esm/Container.js.map +1 -0
- package/dist/esm/Edit.d.ts +203 -0
- package/dist/esm/Edit.d.ts.map +1 -0
- package/dist/esm/Edit.js +296 -0
- package/dist/esm/Edit.js.map +1 -0
- package/dist/esm/ExaWebSearch.d.ts +22 -0
- package/dist/esm/ExaWebSearch.d.ts.map +1 -0
- package/dist/esm/ExaWebSearch.js +107 -0
- package/dist/esm/ExaWebSearch.js.map +1 -0
- package/dist/esm/Explore.d.ts +328 -0
- package/dist/esm/Explore.d.ts.map +1 -0
- package/dist/esm/Explore.js +106 -0
- package/dist/esm/Explore.js.map +1 -0
- package/dist/esm/Fetch.d.ts +130 -0
- package/dist/esm/Fetch.d.ts.map +1 -0
- package/dist/esm/Fetch.js +91 -0
- package/dist/esm/Fetch.js.map +1 -0
- package/dist/esm/Glob.d.ts +204 -0
- package/dist/esm/Glob.d.ts.map +1 -0
- package/dist/esm/Glob.js +177 -0
- package/dist/esm/Glob.js.map +1 -0
- package/dist/esm/Grep.d.ts +347 -0
- package/dist/esm/Grep.d.ts.map +1 -0
- package/dist/esm/Grep.js +289 -0
- package/dist/esm/Grep.js.map +1 -0
- package/dist/esm/HttpPost.d.ts +130 -0
- package/dist/esm/HttpPost.d.ts.map +1 -0
- package/dist/esm/HttpPost.js +89 -0
- package/dist/esm/HttpPost.js.map +1 -0
- package/dist/esm/LanguageServer.d.ts +90 -0
- package/dist/esm/LanguageServer.d.ts.map +1 -0
- package/dist/esm/LanguageServer.js +57 -0
- package/dist/esm/LanguageServer.js.map +1 -0
- package/dist/esm/Ls.d.ts +164 -0
- package/dist/esm/Ls.d.ts.map +1 -0
- package/dist/esm/Ls.js +178 -0
- package/dist/esm/Ls.js.map +1 -0
- package/dist/esm/Lsp.d.ts +125 -0
- package/dist/esm/Lsp.d.ts.map +1 -0
- package/dist/esm/Lsp.js +165 -0
- package/dist/esm/Lsp.js.map +1 -0
- package/dist/esm/Manifest.d.ts +918 -0
- package/dist/esm/Manifest.d.ts.map +1 -0
- package/dist/esm/Manifest.js +153 -0
- package/dist/esm/Manifest.js.map +1 -0
- package/dist/esm/NativeSearch.d.ts +38 -0
- package/dist/esm/NativeSearch.d.ts.map +1 -0
- package/dist/esm/NativeSearch.js +378 -0
- package/dist/esm/NativeSearch.js.map +1 -0
- package/dist/esm/NodeLanguageServer.d.ts +128 -0
- package/dist/esm/NodeLanguageServer.d.ts.map +1 -0
- package/dist/esm/NodeLanguageServer.js +843 -0
- package/dist/esm/NodeLanguageServer.js.map +1 -0
- package/dist/esm/PortableSearch.d.ts +36 -0
- package/dist/esm/PortableSearch.d.ts.map +1 -0
- package/dist/esm/PortableSearch.js +256 -0
- package/dist/esm/PortableSearch.js.map +1 -0
- package/dist/esm/Probe.d.ts +193 -0
- package/dist/esm/Probe.d.ts.map +1 -0
- package/dist/esm/Probe.js +225 -0
- package/dist/esm/Probe.js.map +1 -0
- package/dist/esm/Read.d.ts +189 -0
- package/dist/esm/Read.d.ts.map +1 -0
- package/dist/esm/Read.js +300 -0
- package/dist/esm/Read.js.map +1 -0
- package/dist/esm/Relocate.d.ts +73 -0
- package/dist/esm/Relocate.d.ts.map +1 -0
- package/dist/esm/Relocate.js +153 -0
- package/dist/esm/Relocate.js.map +1 -0
- package/dist/esm/RemoteSearch.d.ts +54 -0
- package/dist/esm/RemoteSearch.d.ts.map +1 -0
- package/dist/esm/RemoteSearch.js +162 -0
- package/dist/esm/RemoteSearch.js.map +1 -0
- package/dist/esm/Search.d.ts +163 -0
- package/dist/esm/Search.d.ts.map +1 -0
- package/dist/esm/Search.js +47 -0
- package/dist/esm/Search.js.map +1 -0
- package/dist/esm/SearchConformance.d.ts +115 -0
- package/dist/esm/SearchConformance.d.ts.map +1 -0
- package/dist/esm/SearchConformance.js +193 -0
- package/dist/esm/SearchConformance.js.map +1 -0
- package/dist/esm/SearchContract.d.ts +114 -0
- package/dist/esm/SearchContract.d.ts.map +1 -0
- package/dist/esm/SearchContract.js +461 -0
- package/dist/esm/SearchContract.js.map +1 -0
- package/dist/esm/ShellCommand.d.ts +164 -0
- package/dist/esm/ShellCommand.d.ts.map +1 -0
- package/dist/esm/ShellCommand.js +159 -0
- package/dist/esm/ShellCommand.js.map +1 -0
- package/dist/esm/StdError.d.ts +55 -0
- package/dist/esm/StdError.d.ts.map +1 -0
- package/dist/esm/StdError.js +71 -0
- package/dist/esm/StdError.js.map +1 -0
- package/dist/esm/TestRun.d.ts +311 -0
- package/dist/esm/TestRun.d.ts.map +1 -0
- package/dist/esm/TestRun.js +316 -0
- package/dist/esm/TestRun.js.map +1 -0
- package/dist/esm/TestRunner.d.ts +102 -0
- package/dist/esm/TestRunner.d.ts.map +1 -0
- package/dist/esm/TestRunner.js +68 -0
- package/dist/esm/TestRunner.js.map +1 -0
- package/dist/esm/TreeFingerprint.d.ts +140 -0
- package/dist/esm/TreeFingerprint.d.ts.map +1 -0
- package/dist/esm/TreeFingerprint.js +170 -0
- package/dist/esm/TreeFingerprint.js.map +1 -0
- package/dist/esm/UpdatePlan.d.ts +152 -0
- package/dist/esm/UpdatePlan.d.ts.map +1 -0
- package/dist/esm/UpdatePlan.js +129 -0
- package/dist/esm/UpdatePlan.js.map +1 -0
- package/dist/esm/WebFetch.d.ts +134 -0
- package/dist/esm/WebFetch.d.ts.map +1 -0
- package/dist/esm/WebFetch.js +151 -0
- package/dist/esm/WebFetch.js.map +1 -0
- package/dist/esm/WebSearch.d.ts +181 -0
- package/dist/esm/WebSearch.d.ts.map +1 -0
- package/dist/esm/WebSearch.js +134 -0
- package/dist/esm/WebSearch.js.map +1 -0
- package/dist/esm/Write.d.ts +147 -0
- package/dist/esm/Write.d.ts.map +1 -0
- package/dist/esm/Write.js +144 -0
- package/dist/esm/Write.js.map +1 -0
- package/dist/esm/index.d.ts +129 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +129 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/internal/ApplyPatch.d.ts +145 -0
- package/dist/esm/internal/ApplyPatch.d.ts.map +1 -0
- package/dist/esm/internal/ApplyPatch.js +489 -0
- package/dist/esm/internal/ApplyPatch.js.map +1 -0
- package/dist/esm/internal/CodexText.d.ts +73 -0
- package/dist/esm/internal/CodexText.d.ts.map +1 -0
- package/dist/esm/internal/CodexText.js +156 -0
- package/dist/esm/internal/CodexText.js.map +1 -0
- package/dist/esm/internal/Declaration.d.ts +49 -0
- package/dist/esm/internal/Declaration.d.ts.map +1 -0
- package/dist/esm/internal/Declaration.js +42 -0
- package/dist/esm/internal/Declaration.js.map +1 -0
- package/dist/esm/internal/Diagnostics.d.ts +77 -0
- package/dist/esm/internal/Diagnostics.d.ts.map +1 -0
- package/dist/esm/internal/Diagnostics.js +99 -0
- package/dist/esm/internal/Diagnostics.js.map +1 -0
- package/dist/esm/internal/EnvelopePrecheck.d.ts +69 -0
- package/dist/esm/internal/EnvelopePrecheck.d.ts.map +1 -0
- package/dist/esm/internal/EnvelopePrecheck.js +426 -0
- package/dist/esm/internal/EnvelopePrecheck.js.map +1 -0
- package/dist/esm/internal/Exec.d.ts +151 -0
- package/dist/esm/internal/Exec.d.ts.map +1 -0
- package/dist/esm/internal/Exec.js +285 -0
- package/dist/esm/internal/Exec.js.map +1 -0
- package/dist/esm/internal/FileMutation.d.ts +109 -0
- package/dist/esm/internal/FileMutation.d.ts.map +1 -0
- package/dist/esm/internal/FileMutation.js +123 -0
- package/dist/esm/internal/FileMutation.js.map +1 -0
- package/dist/esm/internal/FsFailure.d.ts +38 -0
- package/dist/esm/internal/FsFailure.d.ts.map +1 -0
- package/dist/esm/internal/FsFailure.js +39 -0
- package/dist/esm/internal/FsFailure.js.map +1 -0
- package/dist/esm/internal/GitWorktree.d.ts +108 -0
- package/dist/esm/internal/GitWorktree.d.ts.map +1 -0
- package/dist/esm/internal/GitWorktree.js +352 -0
- package/dist/esm/internal/GitWorktree.js.map +1 -0
- package/dist/esm/internal/Grouping.d.ts +51 -0
- package/dist/esm/internal/Grouping.d.ts.map +1 -0
- package/dist/esm/internal/Grouping.js +99 -0
- package/dist/esm/internal/Grouping.js.map +1 -0
- package/dist/esm/internal/Html.d.ts +20 -0
- package/dist/esm/internal/Html.d.ts.map +1 -0
- package/dist/esm/internal/Html.js +70 -0
- package/dist/esm/internal/Html.js.map +1 -0
- package/dist/esm/internal/Http.d.ts +95 -0
- package/dist/esm/internal/Http.d.ts.map +1 -0
- package/dist/esm/internal/Http.js +154 -0
- package/dist/esm/internal/Http.js.map +1 -0
- package/dist/esm/internal/HttpNetwork.d.ts +27 -0
- package/dist/esm/internal/HttpNetwork.d.ts.map +1 -0
- package/dist/esm/internal/HttpNetwork.js +114 -0
- package/dist/esm/internal/HttpNetwork.js.map +1 -0
- package/dist/esm/internal/Ignore.d.ts +37 -0
- package/dist/esm/internal/Ignore.d.ts.map +1 -0
- package/dist/esm/internal/Ignore.js +128 -0
- package/dist/esm/internal/Ignore.js.map +1 -0
- package/dist/esm/internal/LinearRegex.d.ts +19 -0
- package/dist/esm/internal/LinearRegex.d.ts.map +1 -0
- package/dist/esm/internal/LinearRegex.js +176 -0
- package/dist/esm/internal/LinearRegex.js.map +1 -0
- package/dist/esm/internal/Match.d.ts +85 -0
- package/dist/esm/internal/Match.d.ts.map +1 -0
- package/dist/esm/internal/Match.js +142 -0
- package/dist/esm/internal/Match.js.map +1 -0
- package/dist/esm/internal/Paths.d.ts +23 -0
- package/dist/esm/internal/Paths.d.ts.map +1 -0
- package/dist/esm/internal/Paths.js +40 -0
- package/dist/esm/internal/Paths.js.map +1 -0
- package/dist/esm/internal/Preserve.d.ts +25 -0
- package/dist/esm/internal/Preserve.d.ts.map +1 -0
- package/dist/esm/internal/Preserve.js +70 -0
- package/dist/esm/internal/Preserve.js.map +1 -0
- package/dist/esm/internal/Prune.d.ts +35 -0
- package/dist/esm/internal/Prune.d.ts.map +1 -0
- package/dist/esm/internal/Prune.js +60 -0
- package/dist/esm/internal/Prune.js.map +1 -0
- package/dist/esm/internal/RemoteTree.d.ts +60 -0
- package/dist/esm/internal/RemoteTree.d.ts.map +1 -0
- package/dist/esm/internal/RemoteTree.js +132 -0
- package/dist/esm/internal/RemoteTree.js.map +1 -0
- package/dist/esm/internal/SearchContract.d.ts +63 -0
- package/dist/esm/internal/SearchContract.d.ts.map +1 -0
- package/dist/esm/internal/SearchContract.js +66 -0
- package/dist/esm/internal/SearchContract.js.map +1 -0
- package/dist/esm/internal/Symbols.d.ts +39 -0
- package/dist/esm/internal/Symbols.d.ts.map +1 -0
- package/dist/esm/internal/Symbols.js +79 -0
- package/dist/esm/internal/Symbols.js.map +1 -0
- package/dist/esm/internal/Tar.d.ts +23 -0
- package/dist/esm/internal/Tar.d.ts.map +1 -0
- package/dist/esm/internal/Tar.js +97 -0
- package/dist/esm/internal/Tar.js.map +1 -0
- package/dist/esm/internal/TestReport.d.ts +52 -0
- package/dist/esm/internal/TestReport.d.ts.map +1 -0
- package/dist/esm/internal/TestReport.js +172 -0
- package/dist/esm/internal/TestReport.js.map +1 -0
- package/dist/esm/internal/Text.d.ts +125 -0
- package/dist/esm/internal/Text.d.ts.map +1 -0
- package/dist/esm/internal/Text.js +141 -0
- package/dist/esm/internal/Text.js.map +1 -0
- package/dist/esm/internal/Url.d.ts +13 -0
- package/dist/esm/internal/Url.d.ts.map +1 -0
- package/dist/esm/internal/Url.js +27 -0
- package/dist/esm/internal/Url.js.map +1 -0
- package/dist/esm/internal/Walk.d.ts +72 -0
- package/dist/esm/internal/Walk.d.ts.map +1 -0
- package/dist/esm/internal/Walk.js +126 -0
- package/dist/esm/internal/Walk.js.map +1 -0
- package/docs/README.md +119 -0
- package/docs/api.md +499 -0
- package/docs/concepts/effects-and-capabilities.md +138 -0
- package/docs/concepts/flows-and-handlers.md +115 -0
- package/docs/concepts/limits-and-disclosure.md +105 -0
- package/docs/concepts/search-contract.md +182 -0
- package/docs/guides/bind-the-standard-flows.md +116 -0
- package/docs/guides/implement-a-search-peer.md +133 -0
- package/docs/guides/pin-a-checkpoint.md +161 -0
- package/docs/guides/query-a-language-server.md +257 -0
- package/docs/guides/reach-the-network.md +141 -0
- package/docs/guides/read-and-edit-a-file.md +240 -0
- package/docs/guides/run-a-shell-command.md +236 -0
- package/docs/guides/run-the-test-suite.md +154 -0
- package/docs/guides/search-a-workspace.md +148 -0
- package/docs/installation.md +115 -0
- package/docs/quickstart.md +125 -0
- package/docs/reference/flows.md +556 -0
- package/docs/troubleshooting.md +347 -0
- package/package.json +449 -3
- package/src/ApplyPatch.ts +458 -0
- package/src/Bash.ts +619 -0
- package/src/Checkpoints.ts +589 -0
- package/src/Container.ts +212 -0
- package/src/Edit.ts +366 -0
- package/src/ExaWebSearch.ts +145 -0
- package/src/Explore.ts +139 -0
- package/src/Fetch.ts +117 -0
- package/src/Glob.ts +200 -0
- package/src/Grep.ts +320 -0
- package/src/HttpPost.ts +120 -0
- package/src/LanguageServer.ts +110 -0
- package/src/Ls.ts +228 -0
- package/src/Lsp.ts +184 -0
- package/src/Manifest.ts +162 -0
- package/src/NativeSearch.ts +457 -0
- package/src/NodeLanguageServer.ts +1148 -0
- package/src/PortableSearch.ts +284 -0
- package/src/Probe.ts +284 -0
- package/src/Read.ts +359 -0
- package/src/Relocate.ts +166 -0
- package/src/RemoteSearch.ts +199 -0
- package/src/Search.ts +185 -0
- package/src/SearchConformance.ts +288 -0
- package/src/SearchContract.ts +489 -0
- package/src/ShellCommand.ts +201 -0
- package/src/StdError.ts +80 -0
- package/src/TestRun.ts +401 -0
- package/src/TestRunner.ts +119 -0
- package/src/TreeFingerprint.ts +200 -0
- package/src/UpdatePlan.ts +171 -0
- package/src/WebFetch.ts +194 -0
- package/src/WebSearch.ts +165 -0
- package/src/Write.ts +195 -0
- package/src/index.ts +157 -0
- package/src/internal/ApplyPatch.ts +601 -0
- package/src/internal/CodexText.ts +182 -0
- package/src/internal/Declaration.ts +60 -0
- package/src/internal/Diagnostics.ts +134 -0
- package/src/internal/EnvelopePrecheck.ts +489 -0
- package/src/internal/Exec.ts +427 -0
- package/src/internal/FileMutation.ts +231 -0
- package/src/internal/FsFailure.ts +51 -0
- package/src/internal/GitWorktree.ts +491 -0
- package/src/internal/Grouping.ts +106 -0
- package/src/internal/Html.ts +87 -0
- package/src/internal/Http.ts +209 -0
- package/src/internal/HttpNetwork.ts +153 -0
- package/src/internal/Ignore.ts +135 -0
- package/src/internal/LinearRegex.ts +173 -0
- package/src/internal/Match.ts +172 -0
- package/src/internal/Paths.ts +42 -0
- package/src/internal/Preserve.ts +108 -0
- package/src/internal/Prune.ts +62 -0
- package/src/internal/RemoteTree.ts +159 -0
- package/src/internal/SearchContract.ts +77 -0
- package/src/internal/Symbols.ts +88 -0
- package/src/internal/Tar.ts +95 -0
- package/src/internal/TestReport.ts +194 -0
- package/src/internal/Text.ts +185 -0
- package/src/internal/Url.ts +23 -0
- package/src/internal/Walk.ts +176 -0
package/src/Grep.ts
ADDED
|
@@ -0,0 +1,320 @@
|
|
|
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
|
+
|
|
48
|
+
import { Effect, Schema } from "effect"
|
|
49
|
+
import { capability, envelope, rootSubtree } from "./internal/Declaration.ts"
|
|
50
|
+
import { invalidInput } from "./internal/SearchContract.ts"
|
|
51
|
+
import { MAX_GREP_MATCHES } from "./internal/Text.ts"
|
|
52
|
+
import * as Search from "./Search.ts"
|
|
53
|
+
import * as Contract from "./SearchContract.ts"
|
|
54
|
+
import * as StdError from "./StdError.ts"
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The registry name for grep.
|
|
58
|
+
*
|
|
59
|
+
* @category identifiers
|
|
60
|
+
* @since 1.0.0
|
|
61
|
+
*/
|
|
62
|
+
export const name = "grep"
|
|
63
|
+
/**
|
|
64
|
+
* The model-facing grep description.
|
|
65
|
+
*
|
|
66
|
+
* @category descriptions
|
|
67
|
+
* @since 1.0.0
|
|
68
|
+
*/
|
|
69
|
+
export const description =
|
|
70
|
+
"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."
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Input accepted by {@link flow} and {@link run}.
|
|
74
|
+
*
|
|
75
|
+
* @category schemas
|
|
76
|
+
* @since 1.0.0
|
|
77
|
+
*/
|
|
78
|
+
export const Input = Schema.Struct({
|
|
79
|
+
pattern: Schema.String.annotate({ description: "Smithers Ripgrep ASCII v1 expression." }),
|
|
80
|
+
root: Schema.optional(Schema.String).annotate({
|
|
81
|
+
description: "Search root the globs are relative to; defaults to . (the host workspace)."
|
|
82
|
+
}),
|
|
83
|
+
fixedStrings: Schema.optional(Schema.Boolean).annotate({ description: "Ripgrep -F." }),
|
|
84
|
+
ignoreCase: Schema.optional(Schema.Boolean).annotate({ description: "Ripgrep -i." }),
|
|
85
|
+
smartCase: Schema.optional(Schema.Boolean).annotate({ description: "Ripgrep -S." }),
|
|
86
|
+
globs: Schema.optional(Schema.Array(Schema.String)).annotate({
|
|
87
|
+
description:
|
|
88
|
+
"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 !."
|
|
89
|
+
}),
|
|
90
|
+
beforeContext: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))).annotate({
|
|
91
|
+
description: "Ripgrep -B."
|
|
92
|
+
}),
|
|
93
|
+
afterContext: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))).annotate({
|
|
94
|
+
description: "Ripgrep -A."
|
|
95
|
+
}),
|
|
96
|
+
context: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))).annotate({ description: "Ripgrep -C." }),
|
|
97
|
+
maxCount: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(1))).annotate({
|
|
98
|
+
description: "Ripgrep --max-count, per file; at least 1."
|
|
99
|
+
}),
|
|
100
|
+
filesWithMatches: Schema.optional(Schema.Boolean).annotate({ description: "Ripgrep --files-with-matches." }),
|
|
101
|
+
hidden: Schema.optional(Schema.Boolean).annotate({ description: "Ripgrep --hidden." }),
|
|
102
|
+
symbols: Schema.optional(Schema.Boolean).annotate({
|
|
103
|
+
description: "Report the definition enclosing each returned hit; true by default."
|
|
104
|
+
}),
|
|
105
|
+
noIgnore: Schema.optional(Schema.Boolean).annotate({
|
|
106
|
+
description:
|
|
107
|
+
"Honor root-scoped .gitignore files by default. Set true to include ignored paths; hidden and fixed directory skips still apply."
|
|
108
|
+
}),
|
|
109
|
+
limit: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))).annotate({
|
|
110
|
+
description: `Global result limit, capped at ${MAX_GREP_MATCHES}.`
|
|
111
|
+
})
|
|
112
|
+
})
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Decoded input accepted by the `grep` flow.
|
|
116
|
+
*
|
|
117
|
+
* @category models
|
|
118
|
+
* @since 1.0.0
|
|
119
|
+
*/
|
|
120
|
+
export type Input = typeof Input.Type
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* One matching or context line.
|
|
124
|
+
*
|
|
125
|
+
* @category schemas
|
|
126
|
+
* @since 1.0.0
|
|
127
|
+
*/
|
|
128
|
+
export const ContextLine = Schema.Struct({
|
|
129
|
+
line: Schema.Int.annotate({ description: "1-based line number" }),
|
|
130
|
+
text: Schema.String
|
|
131
|
+
})
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* The definition a hit sits inside, when the file's shape says so plainly.
|
|
135
|
+
*
|
|
136
|
+
* @category schemas
|
|
137
|
+
* @since 1.0.0
|
|
138
|
+
*/
|
|
139
|
+
export const Symbol = Schema.Struct({
|
|
140
|
+
kind: Schema.String.annotate({ description: "The declaration keyword, such as def or class" }),
|
|
141
|
+
name: Schema.String,
|
|
142
|
+
startLine: Schema.Int.annotate({ description: "1-based first line of the definition" }),
|
|
143
|
+
endLine: Schema.Int.annotate({
|
|
144
|
+
description: "1-based last line of the definition; read this range, do not guess one"
|
|
145
|
+
})
|
|
146
|
+
})
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* One hit and the context that belongs to it.
|
|
150
|
+
*
|
|
151
|
+
* @category schemas
|
|
152
|
+
* @since 1.0.0
|
|
153
|
+
*/
|
|
154
|
+
export const Match = Schema.Struct({
|
|
155
|
+
file: Schema.String,
|
|
156
|
+
line: Schema.Int,
|
|
157
|
+
text: Schema.String,
|
|
158
|
+
before: Schema.Array(ContextLine),
|
|
159
|
+
after: Schema.Array(ContextLine),
|
|
160
|
+
symbol: Schema.optional(Symbol)
|
|
161
|
+
})
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Output produced by {@link run}.
|
|
165
|
+
*
|
|
166
|
+
* @category schemas
|
|
167
|
+
* @since 1.0.0
|
|
168
|
+
*/
|
|
169
|
+
export const Output = Schema.Struct({
|
|
170
|
+
matches: Schema.Array(Match),
|
|
171
|
+
files: Schema.Array(Schema.String),
|
|
172
|
+
filesSearched: Schema.Int,
|
|
173
|
+
skippedBinary: Schema.Int,
|
|
174
|
+
truncated: Schema.Boolean,
|
|
175
|
+
retriedAsLiteral: Schema.optional(Schema.Boolean).annotate({
|
|
176
|
+
description: "Present when the pattern found nothing as a regex and these results come from re-running it literally"
|
|
177
|
+
}),
|
|
178
|
+
notice: Schema.optional(Schema.String)
|
|
179
|
+
})
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Decoded output returned by the `grep` flow.
|
|
183
|
+
*
|
|
184
|
+
* @category models
|
|
185
|
+
* @since 1.0.0
|
|
186
|
+
*/
|
|
187
|
+
export type Output = typeof Output.Type
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Conservative sealed declaration for all workspace files.
|
|
191
|
+
*
|
|
192
|
+
* @category effects
|
|
193
|
+
* @since 1.0.0
|
|
194
|
+
*/
|
|
195
|
+
export const effects = envelope({ tier: "sealed", mode: "hermetic", reads: ["/**"], writes: [] })
|
|
196
|
+
/**
|
|
197
|
+
* Narrows the read declaration to the requested root subtree.
|
|
198
|
+
*
|
|
199
|
+
* @category effects
|
|
200
|
+
* @since 1.0.0
|
|
201
|
+
*/
|
|
202
|
+
export const effectsFor = (input: { readonly root?: string | undefined }) =>
|
|
203
|
+
envelope({ tier: "sealed", mode: "hermetic", reads: [rootSubtree(input.root ?? ".")], writes: [] })
|
|
204
|
+
/**
|
|
205
|
+
* Capability strings requested by grep.
|
|
206
|
+
*
|
|
207
|
+
* @category capabilities
|
|
208
|
+
* @since 1.0.0
|
|
209
|
+
*/
|
|
210
|
+
export const capabilities = [capability("fs:read", "/**")]
|
|
211
|
+
/**
|
|
212
|
+
* Declaration-only grep flow.
|
|
213
|
+
*
|
|
214
|
+
* @category flows
|
|
215
|
+
* @since 1.0.0
|
|
216
|
+
*/
|
|
217
|
+
export const flow = { name, description, input: Input, output: Output, capabilities, effects } as const
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* What a call to this flow does, for a reader of a run.
|
|
221
|
+
*
|
|
222
|
+
* Display metadata only. `@smthrs/registry` `Descriptor.FlowActivity` is the
|
|
223
|
+
* governing vocabulary and `StandardFlows` binds this value onto the flow's
|
|
224
|
+
* descriptor, where the binding site checks it. `declarationDigest` excludes
|
|
225
|
+
* it, so declaring it cannot invalidate a call identity or a cached prompt.
|
|
226
|
+
*
|
|
227
|
+
* @category presentation
|
|
228
|
+
* @since 1.0.0-rc.0
|
|
229
|
+
*/
|
|
230
|
+
export const activity = "reads" as const
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* How one recorded call to this flow reads: the verb for each settlement, the
|
|
234
|
+
* input field that is its subject, and the measured output fields a one-line
|
|
235
|
+
* summary may count.
|
|
236
|
+
*
|
|
237
|
+
* Display metadata only, governed by `@smthrs/registry`
|
|
238
|
+
* `Descriptor.CallPresentation` and checked where `StandardFlows` binds it.
|
|
239
|
+
*
|
|
240
|
+
* @category presentation
|
|
241
|
+
* @since 1.0.0-rc.0
|
|
242
|
+
*/
|
|
243
|
+
export const presentation = {
|
|
244
|
+
verb: { pending: "searching", success: "searched", failure: "failed to search" },
|
|
245
|
+
subject: "pattern",
|
|
246
|
+
result: "matches"
|
|
247
|
+
} as const
|
|
248
|
+
|
|
249
|
+
const normalize = (input: typeof Input.Type): Search.GrepInput | StdError.StdError => {
|
|
250
|
+
if (input.ignoreCase === true && input.smartCase === true) {
|
|
251
|
+
return invalidInput("-i and -S are mutually exclusive")
|
|
252
|
+
}
|
|
253
|
+
if (input.context !== undefined && (input.beforeContext !== undefined || input.afterContext !== undefined)) {
|
|
254
|
+
return invalidInput("-C cannot be combined with -A or -B")
|
|
255
|
+
}
|
|
256
|
+
// `rg --max-count 0` answers nothing at all, not even the summary the native
|
|
257
|
+
// peer parses, so a cap that admits no match is rejected rather than read
|
|
258
|
+
// differently by each peer.
|
|
259
|
+
if (input.maxCount !== undefined && input.maxCount < 1) {
|
|
260
|
+
return invalidInput("--max-count must be at least 1")
|
|
261
|
+
}
|
|
262
|
+
const fixedStrings = input.fixedStrings ?? false
|
|
263
|
+
const patternError = Contract.validatePattern(input.pattern, fixedStrings)
|
|
264
|
+
if (patternError !== undefined) return patternError
|
|
265
|
+
for (const glob of input.globs ?? []) {
|
|
266
|
+
const globError = Contract.validateGlob(glob)
|
|
267
|
+
if (globError !== undefined) return globError
|
|
268
|
+
}
|
|
269
|
+
return {
|
|
270
|
+
pattern: input.pattern,
|
|
271
|
+
root: input.root ?? ".",
|
|
272
|
+
fixedStrings,
|
|
273
|
+
ignoreCase: input.ignoreCase ?? false,
|
|
274
|
+
smartCase: input.smartCase ?? false,
|
|
275
|
+
globs: input.globs ?? [],
|
|
276
|
+
beforeContext: input.context ?? input.beforeContext ?? 0,
|
|
277
|
+
afterContext: input.context ?? input.afterContext ?? 0,
|
|
278
|
+
maxCount: input.maxCount,
|
|
279
|
+
filesWithMatches: input.filesWithMatches ?? false,
|
|
280
|
+
hidden: input.hidden ?? false,
|
|
281
|
+
noIgnore: input.noIgnore ?? false,
|
|
282
|
+
symbols: input.symbols ?? true,
|
|
283
|
+
limit: Math.min(input.limit ?? MAX_GREP_MATCHES, MAX_GREP_MATCHES)
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
const metacharacters = /[\\^$.|?*+()[\]{}]/
|
|
288
|
+
|
|
289
|
+
const empty = (output: typeof Output.Type): boolean => output.matches.length === 0 && output.files.length === 0
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Runs one validated ripgrep-contract call through the selected peer implementation.
|
|
293
|
+
*
|
|
294
|
+
* A pattern full of metacharacters that finds nothing is the most common way a
|
|
295
|
+
* search lies: `sphinx-16612` searched 867 files for a parenthesised name and
|
|
296
|
+
* read `0 of 867` as "this symbol is not used here". The retry costs one more
|
|
297
|
+
* pass over the same tree only in the case that already found nothing, and the
|
|
298
|
+
* result says plainly that the answer came from the literal reading.
|
|
299
|
+
*
|
|
300
|
+
* @category handlers
|
|
301
|
+
* @since 1.0.0
|
|
302
|
+
*/
|
|
303
|
+
export const run = Effect.fn("Grep.run")(function*(
|
|
304
|
+
input: typeof Input.Type
|
|
305
|
+
): Effect.fn.Return<typeof Output.Type, StdError.StdError, Search.Search> {
|
|
306
|
+
const normalized = normalize(input)
|
|
307
|
+
if (normalized instanceof StdError.StdError) return yield* Effect.fail(normalized)
|
|
308
|
+
const search = yield* Search.Search
|
|
309
|
+
const result = yield* search.grep(normalized)
|
|
310
|
+
if (normalized.fixedStrings || !empty(result) || !metacharacters.test(normalized.pattern)) return result
|
|
311
|
+
const literal = yield* search.grep({ ...normalized, fixedStrings: true })
|
|
312
|
+
if (empty(literal)) return result
|
|
313
|
+
const explanation =
|
|
314
|
+
`The pattern found nothing as a regular expression and these results come from re-running it literally (fixedStrings: true).`
|
|
315
|
+
return {
|
|
316
|
+
...literal,
|
|
317
|
+
retriedAsLiteral: true,
|
|
318
|
+
notice: literal.notice === undefined ? explanation : `${explanation} ${literal.notice}`
|
|
319
|
+
}
|
|
320
|
+
})
|
package/src/HttpPost.ts
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP POST flow declaration and portable handler.
|
|
3
|
+
*
|
|
4
|
+
* @since 1.0.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as Effect from "effect/Effect"
|
|
8
|
+
import * as HttpClientRequest from "effect/http/HttpClientRequest"
|
|
9
|
+
import * as Schema from "effect/Schema"
|
|
10
|
+
import { capability, envelope } from "./internal/Declaration.ts"
|
|
11
|
+
import { execute, Response, Timeout } from "./internal/Http.ts"
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Registry name for the http-post flow.
|
|
15
|
+
*
|
|
16
|
+
* @category identifiers
|
|
17
|
+
* @since 1.0.0
|
|
18
|
+
*/
|
|
19
|
+
export const name = "http-post"
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Model-facing description of the http-post flow.
|
|
23
|
+
*
|
|
24
|
+
* @category descriptions
|
|
25
|
+
* @since 1.0.0
|
|
26
|
+
*/
|
|
27
|
+
export const description =
|
|
28
|
+
"Post a text body to an absolute URL and return the response; this is irreversible because the remote side may already have acted."
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Input schema for the http-post flow.
|
|
32
|
+
*
|
|
33
|
+
* @category schemas
|
|
34
|
+
* @since 1.0.0
|
|
35
|
+
*/
|
|
36
|
+
export const Input = Schema.Struct({
|
|
37
|
+
url: Schema.String.annotate({ description: "Absolute http or https URL to post to" }),
|
|
38
|
+
body: Schema.String.annotate({ description: "Request body sent verbatim" }),
|
|
39
|
+
contentType: Schema.optional(Schema.String).annotate({
|
|
40
|
+
description: "Request content type; defaults to application/json"
|
|
41
|
+
}),
|
|
42
|
+
headers: Schema.optional(Schema.Record(Schema.String, Schema.String)).annotate({
|
|
43
|
+
description: "Additional request headers"
|
|
44
|
+
}),
|
|
45
|
+
timeout: Schema.optional(Timeout).annotate({
|
|
46
|
+
description: "Total request and response body timeout in seconds; defaults to 30, capped at 120"
|
|
47
|
+
})
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Decoded input accepted by the `http-post` flow.
|
|
52
|
+
*
|
|
53
|
+
* @category models
|
|
54
|
+
* @since 1.0.0
|
|
55
|
+
*/
|
|
56
|
+
export type Input = typeof Input.Type
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Output schema for the http-post flow.
|
|
60
|
+
*
|
|
61
|
+
* @category schemas
|
|
62
|
+
* @since 1.0.0
|
|
63
|
+
*/
|
|
64
|
+
export const Output = Response
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Decoded output returned by the `http-post` flow.
|
|
68
|
+
*
|
|
69
|
+
* @category models
|
|
70
|
+
* @since 1.0.0
|
|
71
|
+
*/
|
|
72
|
+
export type Output = typeof Output.Type
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Static effect envelope for the http-post flow.
|
|
76
|
+
*
|
|
77
|
+
* @category effects
|
|
78
|
+
* @since 1.0.0
|
|
79
|
+
*/
|
|
80
|
+
export const effects = envelope({ tier: "irreversible", mode: "expected", reads: [], writes: [] })
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Narrows the http-post effect envelope for one decoded input.
|
|
84
|
+
*
|
|
85
|
+
* Network reach is expressed as a capability rather than a path envelope, so
|
|
86
|
+
* a post has nothing left to narrow.
|
|
87
|
+
*
|
|
88
|
+
* @category effects
|
|
89
|
+
* @since 1.0.0
|
|
90
|
+
*/
|
|
91
|
+
export const effectsFor = (_input: typeof Input.Type) => effects
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Capabilities required by the http-post flow.
|
|
95
|
+
*
|
|
96
|
+
* @category capabilities
|
|
97
|
+
* @since 1.0.0
|
|
98
|
+
*/
|
|
99
|
+
export const capabilities = [capability("net:post", "*")]
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Declaration-only http-post flow.
|
|
103
|
+
*
|
|
104
|
+
* @category flows
|
|
105
|
+
* @since 1.0.0
|
|
106
|
+
*/
|
|
107
|
+
export const flow = { name, description, input: Input, output: Output, capabilities, effects } as const
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Posts a body through the permission-aware kernel HTTP client.
|
|
111
|
+
*
|
|
112
|
+
* @category handlers
|
|
113
|
+
* @since 1.0.0
|
|
114
|
+
*/
|
|
115
|
+
export const run = Effect.fn("HttpPost.run")((input: Input) =>
|
|
116
|
+
execute(input, (url) =>
|
|
117
|
+
HttpClientRequest.post(url).pipe(
|
|
118
|
+
HttpClientRequest.bodyText(input.body, input.contentType ?? "application/json")
|
|
119
|
+
))
|
|
120
|
+
)
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The code-intelligence seam behind the `lsp` flow.
|
|
3
|
+
*
|
|
4
|
+
* A host binds {@link LanguageServer} to a client such as
|
|
5
|
+
* `NodeLanguageServer.layer`. Every method answers one language-server request
|
|
6
|
+
* with the server's own result; {@link layerNoop} answers every request with
|
|
7
|
+
* `unsupported`, for a host that runs no server.
|
|
8
|
+
*
|
|
9
|
+
* @since 1.0.0
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { Context, Effect, Layer } from "effect"
|
|
13
|
+
import * as StdError from "./StdError.ts"
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* A point in a file, addressed the way a language server addresses it.
|
|
17
|
+
*
|
|
18
|
+
* @category models
|
|
19
|
+
* @since 1.0.0
|
|
20
|
+
*/
|
|
21
|
+
export interface Position {
|
|
22
|
+
readonly path: string
|
|
23
|
+
readonly line: number
|
|
24
|
+
readonly character: number
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The code-intelligence seam. Every method answers one language-server
|
|
28
|
+
* request and reports an unavailable server as a typed failure.
|
|
29
|
+
*
|
|
30
|
+
* @category models
|
|
31
|
+
* @since 1.0.0
|
|
32
|
+
*/
|
|
33
|
+
export interface LanguageServer {
|
|
34
|
+
readonly hover: (position: Position) => Effect.Effect<unknown, StdError.StdError>
|
|
35
|
+
readonly definition: (position: Position) => Effect.Effect<unknown, StdError.StdError>
|
|
36
|
+
readonly references: (position: Position) => Effect.Effect<unknown, StdError.StdError>
|
|
37
|
+
readonly implementation: (position: Position) => Effect.Effect<unknown, StdError.StdError>
|
|
38
|
+
readonly documentSymbols: (path: string) => Effect.Effect<unknown, StdError.StdError>
|
|
39
|
+
readonly workspaceSymbols: (query: string) => Effect.Effect<unknown, StdError.StdError>
|
|
40
|
+
readonly prepareCallHierarchy: (position: Position) => Effect.Effect<unknown, StdError.StdError>
|
|
41
|
+
readonly callHierarchyIncoming: (position: Position) => Effect.Effect<unknown, StdError.StdError>
|
|
42
|
+
readonly callHierarchyOutgoing: (position: Position) => Effect.Effect<unknown, StdError.StdError>
|
|
43
|
+
/**
|
|
44
|
+
* The file's diagnostics as a document report, `{ kind: "full", items }`.
|
|
45
|
+
* A server without pull diagnostics answers with what it last published for
|
|
46
|
+
* the latest synced text.
|
|
47
|
+
*/
|
|
48
|
+
readonly diagnostics: (path: string) => Effect.Effect<unknown, StdError.StdError>
|
|
49
|
+
/**
|
|
50
|
+
* Tells the server a file now holds `text`: opens it on first sync and sends
|
|
51
|
+
* the full new text on every later one.
|
|
52
|
+
*/
|
|
53
|
+
readonly sync: (path: string, text: string) => Effect.Effect<void, StdError.StdError>
|
|
54
|
+
/** Tells the server a synced file is gone; a file never synced is a no-op. */
|
|
55
|
+
readonly close: (path: string) => Effect.Effect<void, StdError.StdError>
|
|
56
|
+
/**
|
|
57
|
+
* Re-reads every synced file from disk: sends the text of each that changed
|
|
58
|
+
* and closes each that is gone, so a file something else changed is not
|
|
59
|
+
* left stale on the server.
|
|
60
|
+
*/
|
|
61
|
+
readonly refresh: Effect.Effect<void, StdError.StdError>
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The {@link LanguageServer} service tag.
|
|
65
|
+
*
|
|
66
|
+
* @category services
|
|
67
|
+
* @since 1.0.0
|
|
68
|
+
*/
|
|
69
|
+
export const LanguageServer: Context.Service<LanguageServer, LanguageServer> = Context.Service(
|
|
70
|
+
"@smthrs/std/LanguageServer"
|
|
71
|
+
)
|
|
72
|
+
/**
|
|
73
|
+
* Builds a {@link LanguageServer} from an implementation of its methods.
|
|
74
|
+
*
|
|
75
|
+
* @category constructors
|
|
76
|
+
* @since 1.0.0
|
|
77
|
+
*/
|
|
78
|
+
export const make = (service: LanguageServer): LanguageServer => LanguageServer.of(service)
|
|
79
|
+
const unsupported = (): Effect.Effect<never, StdError.StdError> =>
|
|
80
|
+
Effect.fail(new StdError.StdError({ code: "unsupported", message: "Language server support is unavailable" }))
|
|
81
|
+
/**
|
|
82
|
+
* A {@link LanguageServer} that reports `unsupported` for every request,
|
|
83
|
+
* for an environment with no server configured.
|
|
84
|
+
*
|
|
85
|
+
* @category constructors
|
|
86
|
+
* @since 1.0.0
|
|
87
|
+
*/
|
|
88
|
+
export const makeNoop = (): LanguageServer =>
|
|
89
|
+
make({
|
|
90
|
+
hover: unsupported,
|
|
91
|
+
definition: unsupported,
|
|
92
|
+
references: unsupported,
|
|
93
|
+
implementation: unsupported,
|
|
94
|
+
documentSymbols: unsupported,
|
|
95
|
+
workspaceSymbols: unsupported,
|
|
96
|
+
prepareCallHierarchy: unsupported,
|
|
97
|
+
callHierarchyIncoming: unsupported,
|
|
98
|
+
callHierarchyOutgoing: unsupported,
|
|
99
|
+
diagnostics: unsupported,
|
|
100
|
+
sync: unsupported,
|
|
101
|
+
close: unsupported,
|
|
102
|
+
refresh: unsupported()
|
|
103
|
+
})
|
|
104
|
+
/**
|
|
105
|
+
* Provides {@link makeNoop}.
|
|
106
|
+
*
|
|
107
|
+
* @category layers
|
|
108
|
+
* @since 1.0.0
|
|
109
|
+
*/
|
|
110
|
+
export const layerNoop: Layer.Layer<LanguageServer> = Layer.succeed(LanguageServer, makeNoop())
|