@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
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Exa provider for the `websearch` flow.
|
|
3
|
+
*
|
|
4
|
+
* {@link layer} binds `WebSearch.WebSearch` to the Exa search API. It reads the
|
|
5
|
+
* API key from a named credential on every search, calls Exa through the
|
|
6
|
+
* permission-checked `HttpClient`, and maps each hit onto `WebSearch.Result`.
|
|
7
|
+
*
|
|
8
|
+
* @since 1.0.0
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import * as Credential from "@smthrs/control/Credential"
|
|
12
|
+
import * as HttpClient from "@smthrs/kernel/HttpClient"
|
|
13
|
+
import { Clock, Effect, Layer, Redacted, Schema } from "effect"
|
|
14
|
+
import * as HttpClientRequest from "effect/http/HttpClientRequest"
|
|
15
|
+
import { header, readBounded } from "./internal/Http.ts"
|
|
16
|
+
import * as StdError from "./StdError.ts"
|
|
17
|
+
import * as WebSearch from "./WebSearch.ts"
|
|
18
|
+
|
|
19
|
+
const maxResults = 20
|
|
20
|
+
const requestTimeoutMs = 30_000
|
|
21
|
+
const ExaResult = Schema.Struct({
|
|
22
|
+
title: Schema.optional(Schema.String),
|
|
23
|
+
url: Schema.String,
|
|
24
|
+
text: Schema.optional(Schema.String),
|
|
25
|
+
publishedDate: Schema.optional(Schema.String)
|
|
26
|
+
})
|
|
27
|
+
const ExaResponse = Schema.Struct({
|
|
28
|
+
results: Schema.Array(ExaResult)
|
|
29
|
+
})
|
|
30
|
+
const freshnessDays = {
|
|
31
|
+
day: 1,
|
|
32
|
+
week: 7,
|
|
33
|
+
month: 31,
|
|
34
|
+
year: 365
|
|
35
|
+
} as const
|
|
36
|
+
|
|
37
|
+
const failure = (code: StdError.Code, message: string): StdError.StdError => new StdError.StdError({ code, message })
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Provides {@link WebSearch.WebSearch} backed by the Exa API, reading its
|
|
41
|
+
* key from the named credential.
|
|
42
|
+
*
|
|
43
|
+
* @category layers
|
|
44
|
+
* @since 1.0.0
|
|
45
|
+
*/
|
|
46
|
+
export const layer = (
|
|
47
|
+
credentialId: string
|
|
48
|
+
): Layer.Layer<WebSearch.WebSearch, never, Credential.Credential | HttpClient.HttpClient> =>
|
|
49
|
+
Layer.effect(
|
|
50
|
+
WebSearch.WebSearch,
|
|
51
|
+
Effect.gen(function*() {
|
|
52
|
+
const credentials = yield* Credential.Credential
|
|
53
|
+
const http = yield* HttpClient.HttpClient
|
|
54
|
+
return WebSearch.make({
|
|
55
|
+
search: (input): Effect.Effect<typeof WebSearch.Output.Type, StdError.StdError> =>
|
|
56
|
+
Effect.gen(function*() {
|
|
57
|
+
const reference = yield* credentials.get(credentialId).pipe(Effect.mapError(() =>
|
|
58
|
+
new StdError.StdError({
|
|
59
|
+
code: "provider_unavailable",
|
|
60
|
+
message: "Configured Exa credential is unavailable"
|
|
61
|
+
})
|
|
62
|
+
))
|
|
63
|
+
const secret = yield* credentials.resolve(reference).pipe(Effect.mapError(() =>
|
|
64
|
+
new StdError.StdError({
|
|
65
|
+
code: "provider_unavailable",
|
|
66
|
+
message: "Configured Exa credential cannot be resolved"
|
|
67
|
+
})
|
|
68
|
+
))
|
|
69
|
+
const now = yield* Clock.currentTimeMillis
|
|
70
|
+
const request = HttpClientRequest.setHeaders(
|
|
71
|
+
HttpClientRequest.bodyJsonUnsafe(HttpClientRequest.post("https://api.exa.ai/search"), {
|
|
72
|
+
query: input.query,
|
|
73
|
+
numResults: Math.min(input.numResults ?? 8, maxResults),
|
|
74
|
+
...(input.freshness === undefined
|
|
75
|
+
? {}
|
|
76
|
+
: { startPublishedDate: new Date(now - freshnessDays[input.freshness] * 86_400_000).toISOString() })
|
|
77
|
+
}),
|
|
78
|
+
{ "authorization": `Bearer ${Redacted.value(secret)}`, "content-type": "application/json" }
|
|
79
|
+
)
|
|
80
|
+
const response = yield* http.execute(request).pipe(
|
|
81
|
+
Effect.timeout(requestTimeoutMs),
|
|
82
|
+
Effect.mapError((error) =>
|
|
83
|
+
error._tag === "TimeoutError"
|
|
84
|
+
? failure("timeout", "Exa search request timed out")
|
|
85
|
+
: failure("request_failed", "Exa search request failed")
|
|
86
|
+
)
|
|
87
|
+
)
|
|
88
|
+
const retryAfter = header(response.headers, "retry-after")
|
|
89
|
+
// Successful responses may carry pacing advice too; status decides refusal.
|
|
90
|
+
const refused = response.status < 200 || response.status >= 300
|
|
91
|
+
if (response.status === 429 || (refused && retryAfter !== undefined)) {
|
|
92
|
+
const delay = retryAfter === undefined
|
|
93
|
+
? NaN
|
|
94
|
+
: /^\d+$/.test(retryAfter.trim())
|
|
95
|
+
? Number(retryAfter)
|
|
96
|
+
: Math.max(0, Math.ceil((Date.parse(retryAfter) - (yield* Clock.currentTimeMillis)) / 1_000))
|
|
97
|
+
return yield* Effect.fail(
|
|
98
|
+
failure(
|
|
99
|
+
"rate_limited",
|
|
100
|
+
Number.isFinite(delay)
|
|
101
|
+
? `Exa search was throttled; retry after ${delay} seconds`
|
|
102
|
+
: "Exa search was throttled"
|
|
103
|
+
)
|
|
104
|
+
)
|
|
105
|
+
}
|
|
106
|
+
if (response.status === 401 || response.status === 403) {
|
|
107
|
+
return yield* Effect.fail(failure("provider_unavailable", "Exa search authentication was rejected"))
|
|
108
|
+
}
|
|
109
|
+
if (response.status >= 500) {
|
|
110
|
+
return yield* Effect.fail(failure("provider_unavailable", `Exa search returned ${response.status}`))
|
|
111
|
+
}
|
|
112
|
+
if (response.status < 200 || response.status >= 300) {
|
|
113
|
+
return yield* Effect.fail(failure("request_failed", `Exa search returned ${response.status}`))
|
|
114
|
+
}
|
|
115
|
+
// Bound the body before decoding: an endpoint must not choose how
|
|
116
|
+
// much of it the host buffers.
|
|
117
|
+
const bytes = yield* readBounded(response.stream, "https://api.exa.ai/search").pipe(
|
|
118
|
+
Effect.timeout(requestTimeoutMs),
|
|
119
|
+
Effect.mapError((error) =>
|
|
120
|
+
error._tag === "TimeoutError"
|
|
121
|
+
? failure("timeout", "Exa search response timed out")
|
|
122
|
+
: error instanceof StdError.StdError && error.code === "response_too_large"
|
|
123
|
+
? failure("response_too_large", "Exa search response exceeds the 5 MiB limit")
|
|
124
|
+
: failure("request_failed", "Exa search response was invalid")
|
|
125
|
+
)
|
|
126
|
+
)
|
|
127
|
+
const body = yield* Schema.decodeUnknownEffect(Schema.fromJsonString(ExaResponse))(
|
|
128
|
+
new TextDecoder().decode(bytes)
|
|
129
|
+
).pipe(
|
|
130
|
+
Effect.mapError(() =>
|
|
131
|
+
new StdError.StdError({ code: "request_failed", message: "Exa search response was invalid" })
|
|
132
|
+
)
|
|
133
|
+
)
|
|
134
|
+
return {
|
|
135
|
+
results: body.results.slice(0, Math.min(input.numResults ?? 8, maxResults)).map((result) => ({
|
|
136
|
+
title: result.title ?? result.url,
|
|
137
|
+
url: result.url,
|
|
138
|
+
snippet: (result.text ?? "").slice(0, 2_000),
|
|
139
|
+
...(result.publishedDate === undefined ? {} : { publishedAt: result.publishedDate })
|
|
140
|
+
}))
|
|
141
|
+
}
|
|
142
|
+
})
|
|
143
|
+
})
|
|
144
|
+
})
|
|
145
|
+
)
|
package/src/Explore.ts
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read-only workspace reconnaissance as a dynamic flow.
|
|
3
|
+
*
|
|
4
|
+
* @since 1.0.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as Schema from "effect/Schema"
|
|
8
|
+
import * as Glob from "./Glob.ts"
|
|
9
|
+
import * as Grep from "./Grep.ts"
|
|
10
|
+
import { envelope } from "./internal/Declaration.ts"
|
|
11
|
+
import * as Ls from "./Ls.ts"
|
|
12
|
+
import * as Read from "./Read.ts"
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Registry name for the explore flow.
|
|
16
|
+
*
|
|
17
|
+
* @category metadata
|
|
18
|
+
* @since 1.0.0
|
|
19
|
+
*/
|
|
20
|
+
export const name = "explore" as const
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Model-facing description of the explore flow.
|
|
24
|
+
*
|
|
25
|
+
* @category metadata
|
|
26
|
+
* @since 1.0.0
|
|
27
|
+
*/
|
|
28
|
+
export const description =
|
|
29
|
+
"Investigate the workspace read-only, cite every finding as file:line, report evidence only, and never propose edits."
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Input accepted by the explore flow.
|
|
33
|
+
*
|
|
34
|
+
* @category schemas
|
|
35
|
+
* @since 1.0.0
|
|
36
|
+
*/
|
|
37
|
+
export const Input = Schema.Struct({
|
|
38
|
+
prompt: Schema.String.annotate({
|
|
39
|
+
description: "The workspace question to investigate."
|
|
40
|
+
})
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Decoded input accepted by the `explore` flow.
|
|
45
|
+
*
|
|
46
|
+
* @category models
|
|
47
|
+
* @since 1.0.0
|
|
48
|
+
*/
|
|
49
|
+
export type Input = typeof Input.Type
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Output returned by the explore flow.
|
|
53
|
+
*
|
|
54
|
+
* @category schemas
|
|
55
|
+
* @since 1.0.0
|
|
56
|
+
*/
|
|
57
|
+
export const Output = Schema.Struct({
|
|
58
|
+
findings: Schema.String.annotate({
|
|
59
|
+
description: "Evidence-backed findings with file:line citations."
|
|
60
|
+
})
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Decoded output returned by the `explore` flow.
|
|
65
|
+
*
|
|
66
|
+
* @category models
|
|
67
|
+
* @since 1.0.0
|
|
68
|
+
*/
|
|
69
|
+
export type Output = typeof Output.Type
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Static effect envelope for read-only workspace reconnaissance.
|
|
73
|
+
*
|
|
74
|
+
* @category effects
|
|
75
|
+
* @since 1.0.0
|
|
76
|
+
*/
|
|
77
|
+
export const effects = envelope({
|
|
78
|
+
tier: "sealed",
|
|
79
|
+
mode: "hermetic",
|
|
80
|
+
reads: ["/**"],
|
|
81
|
+
writes: []
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Narrows the explore effect declaration for one decoded input.
|
|
86
|
+
*
|
|
87
|
+
* @category effects
|
|
88
|
+
* @since 1.0.0
|
|
89
|
+
*/
|
|
90
|
+
export const effectsFor = (_input: typeof Input.Type) => effects
|
|
91
|
+
|
|
92
|
+
const flows = Object.freeze(
|
|
93
|
+
[
|
|
94
|
+
Read.flow,
|
|
95
|
+
Ls.flow,
|
|
96
|
+
Glob.flow,
|
|
97
|
+
Grep.flow
|
|
98
|
+
] as const
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Transitive capabilities of the read-only flows available to explore.
|
|
103
|
+
*
|
|
104
|
+
* @category capabilities
|
|
105
|
+
* @since 1.0.0
|
|
106
|
+
*/
|
|
107
|
+
export const capabilities: ReadonlyArray<string> = Object.freeze(
|
|
108
|
+
[...new Set(flows.flatMap((flow) => flow.capabilities))].sort()
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Constructs an explore flow, optionally pinned to a model.
|
|
113
|
+
*
|
|
114
|
+
* Model selection remains optional so the invoking seat can inject its model.
|
|
115
|
+
*
|
|
116
|
+
* @category constructors
|
|
117
|
+
* @since 1.0.0
|
|
118
|
+
*/
|
|
119
|
+
export const make = (options: {
|
|
120
|
+
readonly model?: string | undefined
|
|
121
|
+
}) => ({
|
|
122
|
+
name,
|
|
123
|
+
description,
|
|
124
|
+
input: Input,
|
|
125
|
+
output: Output,
|
|
126
|
+
model: options.model,
|
|
127
|
+
flows,
|
|
128
|
+
prompt: description,
|
|
129
|
+
capabilities,
|
|
130
|
+
effects
|
|
131
|
+
} as const)
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Default explore declaration with seat-selected model injection.
|
|
135
|
+
*
|
|
136
|
+
* @category flows
|
|
137
|
+
* @since 1.0.0
|
|
138
|
+
*/
|
|
139
|
+
export const flow = make({})
|
package/src/Fetch.ts
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP GET 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 fetch flow.
|
|
15
|
+
*
|
|
16
|
+
* @category identifiers
|
|
17
|
+
* @since 1.0.0
|
|
18
|
+
*/
|
|
19
|
+
export const name = "fetch"
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Model-facing description of the fetch flow.
|
|
23
|
+
*
|
|
24
|
+
* @category descriptions
|
|
25
|
+
* @since 1.0.0
|
|
26
|
+
*/
|
|
27
|
+
export const description =
|
|
28
|
+
"Get an absolute URL and return its status and text body; long bodies are truncated with a notice. Use http-post to send data."
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Input schema for the fetch 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 retrieve" }),
|
|
38
|
+
headers: Schema.optional(Schema.Record(Schema.String, Schema.String)).annotate({
|
|
39
|
+
description: "Additional request headers"
|
|
40
|
+
}),
|
|
41
|
+
timeout: Schema.optional(Timeout).annotate({
|
|
42
|
+
description: "Total request and response body timeout in seconds; defaults to 30, capped at 120"
|
|
43
|
+
})
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Decoded input accepted by the `fetch` flow.
|
|
48
|
+
*
|
|
49
|
+
* @category models
|
|
50
|
+
* @since 1.0.0
|
|
51
|
+
*/
|
|
52
|
+
export type Input = typeof Input.Type
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Output schema for the fetch flow.
|
|
56
|
+
*
|
|
57
|
+
* @category schemas
|
|
58
|
+
* @since 1.0.0
|
|
59
|
+
*/
|
|
60
|
+
export const Output = Response
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Decoded output returned by the `fetch` flow.
|
|
64
|
+
*
|
|
65
|
+
* @category models
|
|
66
|
+
* @since 1.0.0
|
|
67
|
+
*/
|
|
68
|
+
export type Output = typeof Output.Type
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Static effect envelope for the fetch flow.
|
|
72
|
+
*
|
|
73
|
+
* A retrieval leaves no durable state behind, so it is sealed even though it
|
|
74
|
+
* leaves the machine.
|
|
75
|
+
*
|
|
76
|
+
* @category effects
|
|
77
|
+
* @since 1.0.0
|
|
78
|
+
*/
|
|
79
|
+
export const effects = envelope({ tier: "sealed", mode: "expected", reads: [], writes: [] })
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Narrows the fetch effect envelope for one decoded input.
|
|
83
|
+
*
|
|
84
|
+
* Network reach is expressed as a capability rather than a path envelope, so
|
|
85
|
+
* a retrieval has nothing left to narrow.
|
|
86
|
+
*
|
|
87
|
+
* @category effects
|
|
88
|
+
* @since 1.0.0
|
|
89
|
+
*/
|
|
90
|
+
export const effectsFor = (_input: typeof Input.Type) => effects
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Capabilities required by the fetch flow.
|
|
94
|
+
*
|
|
95
|
+
* @category capabilities
|
|
96
|
+
* @since 1.0.0
|
|
97
|
+
*/
|
|
98
|
+
export const capabilities = [capability("net:get", "*")]
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Declaration-only fetch flow.
|
|
102
|
+
*
|
|
103
|
+
* @category flows
|
|
104
|
+
* @since 1.0.0
|
|
105
|
+
*/
|
|
106
|
+
export const flow = { name, description, input: Input, output: Output, capabilities, effects } as const
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Retrieves a URL through the permission-aware kernel HTTP client.
|
|
110
|
+
*
|
|
111
|
+
* Error statuses are ordinary results; only transport, permission, and body
|
|
112
|
+
* decoding failures use the typed error channel.
|
|
113
|
+
*
|
|
114
|
+
* @category handlers
|
|
115
|
+
* @since 1.0.0
|
|
116
|
+
*/
|
|
117
|
+
export const run = Effect.fn("Fetch.run")((input: Input) => execute(input, HttpClientRequest.get))
|
package/src/Glob.ts
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `glob` projection of Smithers Ripgrep Subset v1.
|
|
3
|
+
*
|
|
4
|
+
* It has the same two peer implementations as `grep` and supports the
|
|
5
|
+
* `rg --files -g` pattern subset: `*`, `**`, `?`, and brace alternatives;
|
|
6
|
+
* results are path sorted; hidden files are opt-in; root and nested .gitignore
|
|
7
|
+
* files apply by default (even outside git repositories). `noIgnore: true` opts
|
|
8
|
+
* out. Parent/global ignore files, .git/info/exclude, .ignore and .rgignore
|
|
9
|
+
* are not read. Caller globs filter the remaining files without overriding
|
|
10
|
+
* ignores. An explicitly named ignored or skipped directory is still searched.
|
|
11
|
+
*
|
|
12
|
+
* **Patterns are relative to `root`, never to the filesystem.** A candidate is
|
|
13
|
+
* matched by the path it has *relative to the search root*, so `tests/**\/*.py`
|
|
14
|
+
* — what every caller writing a project-relative pattern means — matches
|
|
15
|
+
* `<root>/tests/admin_views/admin.py`. Three rules follow, and both peers
|
|
16
|
+
* implement all three identically:
|
|
17
|
+
*
|
|
18
|
+
* - A pattern with no `/` matches the **basename** at any depth: `*.py` finds
|
|
19
|
+
* every Python file in the subtree.
|
|
20
|
+
* - A pattern containing `/` is matched against the root-relative path and is
|
|
21
|
+
* anchored at the root: `tests/*.py` matches `<root>/tests/a.py` and not
|
|
22
|
+
* `<root>/src/tests/a.py`.
|
|
23
|
+
* - A leading `/` is the same anchor spelled explicitly, not a filesystem
|
|
24
|
+
* absolute path: `/a.py` matches only `<root>/a.py`, where bare `a.py` would
|
|
25
|
+
* match any `a.py` in the subtree. A leading `./` means the same anchor.
|
|
26
|
+
*
|
|
27
|
+
* `**` crosses directory boundaries, `*` and `?` stay inside one segment, and
|
|
28
|
+
* `?` consumes one UTF-8 byte. Trailing spaces are not part of a pattern:
|
|
29
|
+
* `rg` reads `-g` by gitignore's rules and drops them, so `"a.ts "` finds
|
|
30
|
+
* `a.ts`, and a pattern left blank by that is rejected rather than read as no
|
|
31
|
+
* filter at all.
|
|
32
|
+
*
|
|
33
|
+
* A `root` that names one file is that file. It is reported whatever the
|
|
34
|
+
* pattern says, because `rg` searches a path given on its command line without
|
|
35
|
+
* consulting `-g`, and a walk that reaches one file has nothing to filter.
|
|
36
|
+
*
|
|
37
|
+
* A walk skips what it cannot read — a dangling symlink, a link cycle, a
|
|
38
|
+
* directory the process may not list — and reports everything it did reach.
|
|
39
|
+
* One unreadable entry never fails the call.
|
|
40
|
+
*
|
|
41
|
+
* The consequence worth stating is the one that cost a SWE-bench run 41 of its
|
|
42
|
+
* 43 frames: an *absolute* pattern such as `/home/repo/tests/**` is read as the
|
|
43
|
+
* root-relative path `home/repo/tests/**`, which nothing under a root of
|
|
44
|
+
* `/home/repo` can match. That answer is now never silent — a pattern no file
|
|
45
|
+
* under the root could match reports why through `notice`, so "unsatisfiable"
|
|
46
|
+
* and "searched and found none" stay distinguishable.
|
|
47
|
+
*
|
|
48
|
+
* @since 1.0.0
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
import { Effect, Schema } from "effect"
|
|
52
|
+
import { capability, envelope, rootSubtree } from "./internal/Declaration.ts"
|
|
53
|
+
import { MAX_ENTRIES } from "./internal/Text.ts"
|
|
54
|
+
import * as Search from "./Search.ts"
|
|
55
|
+
import * as Contract from "./SearchContract.ts"
|
|
56
|
+
import type * as StdError from "./StdError.ts"
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* The registry name for glob.
|
|
60
|
+
*
|
|
61
|
+
* @category identifiers
|
|
62
|
+
* @since 1.0.0
|
|
63
|
+
*/
|
|
64
|
+
export const name = "glob"
|
|
65
|
+
/**
|
|
66
|
+
* The model-facing glob description.
|
|
67
|
+
*
|
|
68
|
+
* @category descriptions
|
|
69
|
+
* @since 1.0.0
|
|
70
|
+
*/
|
|
71
|
+
export const description = "Find files through the Smithers Ripgrep Subset v1 contract."
|
|
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.NonEmptyString.annotate({
|
|
80
|
+
description:
|
|
81
|
+
"Ripgrep -g pattern, matched against paths relative to root, never absolute paths: *, ?, {a,b} stay inside one segment, ** crosses directories, a pattern without / matches any basename, and a leading / anchors at root."
|
|
82
|
+
}),
|
|
83
|
+
root: Schema.optional(Schema.String).annotate({
|
|
84
|
+
description: "Search root the pattern is relative to; defaults to . (the host workspace)."
|
|
85
|
+
}),
|
|
86
|
+
hidden: Schema.optional(Schema.Boolean).annotate({ description: "Ripgrep --hidden." }),
|
|
87
|
+
noIgnore: Schema.optional(Schema.Boolean).annotate({
|
|
88
|
+
description:
|
|
89
|
+
"Honor root-scoped .gitignore files by default. Set true to include ignored paths; hidden and fixed directory skips still apply."
|
|
90
|
+
}),
|
|
91
|
+
limit: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))).annotate({
|
|
92
|
+
description: `Maximum paths, capped at ${MAX_ENTRIES}.`
|
|
93
|
+
})
|
|
94
|
+
})
|
|
95
|
+
/**
|
|
96
|
+
* Decoded input accepted by the `glob` flow.
|
|
97
|
+
*
|
|
98
|
+
* @category models
|
|
99
|
+
* @since 1.0.0
|
|
100
|
+
*/
|
|
101
|
+
export type Input = typeof Input.Type
|
|
102
|
+
/**
|
|
103
|
+
* Output produced by {@link run}.
|
|
104
|
+
*
|
|
105
|
+
* @category schemas
|
|
106
|
+
* @since 1.0.0
|
|
107
|
+
*/
|
|
108
|
+
export const Output = Schema.Struct({
|
|
109
|
+
paths: Schema.Array(Schema.String),
|
|
110
|
+
total: Schema.Int,
|
|
111
|
+
truncated: Schema.Boolean,
|
|
112
|
+
notice: Schema.optional(Schema.String)
|
|
113
|
+
})
|
|
114
|
+
/**
|
|
115
|
+
* Decoded output returned by the `glob` flow.
|
|
116
|
+
*
|
|
117
|
+
* @category models
|
|
118
|
+
* @since 1.0.0
|
|
119
|
+
*/
|
|
120
|
+
export type Output = typeof Output.Type
|
|
121
|
+
/**
|
|
122
|
+
* Conservative sealed declaration for all workspace files.
|
|
123
|
+
*
|
|
124
|
+
* @category effects
|
|
125
|
+
* @since 1.0.0
|
|
126
|
+
*/
|
|
127
|
+
export const effects = envelope({ tier: "sealed", mode: "hermetic", reads: ["/**"], writes: [] })
|
|
128
|
+
/**
|
|
129
|
+
* Narrows the read declaration to the requested root subtree.
|
|
130
|
+
*
|
|
131
|
+
* @category effects
|
|
132
|
+
* @since 1.0.0
|
|
133
|
+
*/
|
|
134
|
+
export const effectsFor = (input: { readonly root?: string | undefined }) =>
|
|
135
|
+
envelope({ tier: "sealed", mode: "hermetic", reads: [rootSubtree(input.root ?? ".")], writes: [] })
|
|
136
|
+
/**
|
|
137
|
+
* Capability strings requested by glob.
|
|
138
|
+
*
|
|
139
|
+
* @category capabilities
|
|
140
|
+
* @since 1.0.0
|
|
141
|
+
*/
|
|
142
|
+
export const capabilities = [capability("fs:read", "/**")]
|
|
143
|
+
/**
|
|
144
|
+
* Declaration-only glob flow.
|
|
145
|
+
*
|
|
146
|
+
* @category flows
|
|
147
|
+
* @since 1.0.0
|
|
148
|
+
*/
|
|
149
|
+
export const flow = { name, description, input: Input, output: Output, capabilities, effects } as const
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* What a call to this flow does, for a reader of a run.
|
|
153
|
+
*
|
|
154
|
+
* Display metadata only. `@smthrs/registry` `Descriptor.FlowActivity` is the
|
|
155
|
+
* governing vocabulary and `StandardFlows` binds this value onto the flow's
|
|
156
|
+
* descriptor, where the binding site checks it. `declarationDigest` excludes
|
|
157
|
+
* it, so declaring it cannot invalidate a call identity or a cached prompt.
|
|
158
|
+
*
|
|
159
|
+
* @category presentation
|
|
160
|
+
* @since 1.0.0-rc.0
|
|
161
|
+
*/
|
|
162
|
+
export const activity = "reads" as const
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* How one recorded call to this flow reads: the verb for each settlement, the
|
|
166
|
+
* input field that is its subject, and the measured output fields a one-line
|
|
167
|
+
* summary may count.
|
|
168
|
+
*
|
|
169
|
+
* Display metadata only, governed by `@smthrs/registry`
|
|
170
|
+
* `Descriptor.CallPresentation` and checked where `StandardFlows` binds it.
|
|
171
|
+
*
|
|
172
|
+
* @category presentation
|
|
173
|
+
* @since 1.0.0-rc.0
|
|
174
|
+
*/
|
|
175
|
+
export const presentation = {
|
|
176
|
+
verb: { pending: "listing", success: "listed", failure: "failed to list" },
|
|
177
|
+
subject: "pattern",
|
|
178
|
+
result: "paths"
|
|
179
|
+
} as const
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Runs one `rg --files -g` contract call through the selected peer implementation.
|
|
183
|
+
*
|
|
184
|
+
* @category handlers
|
|
185
|
+
* @since 1.0.0
|
|
186
|
+
*/
|
|
187
|
+
export const run = Effect.fn("Glob.run")(function*(
|
|
188
|
+
input: typeof Input.Type
|
|
189
|
+
): Effect.fn.Return<typeof Output.Type, StdError.StdError, Search.Search> {
|
|
190
|
+
const patternError = Contract.validateGlob(input.pattern)
|
|
191
|
+
if (patternError !== undefined) return yield* Effect.fail(patternError)
|
|
192
|
+
const search = yield* Search.Search
|
|
193
|
+
return yield* search.glob({
|
|
194
|
+
pattern: input.pattern,
|
|
195
|
+
root: input.root ?? ".",
|
|
196
|
+
hidden: input.hidden ?? false,
|
|
197
|
+
noIgnore: input.noIgnore ?? false,
|
|
198
|
+
limit: Math.min(input.limit ?? MAX_ENTRIES, MAX_ENTRIES)
|
|
199
|
+
})
|
|
200
|
+
})
|