@smthrs/std 0.0.0-stage → 1.0.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +130 -0
- package/LICENSE +21 -0
- package/README.md +152 -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 +380 -0
- package/dist/cjs/Bash.d.ts.map +1 -0
- package/dist/cjs/Bash.js +332 -0
- package/dist/cjs/Bash.js.map +7 -0
- package/dist/cjs/Checkpoints.d.ts +279 -0
- package/dist/cjs/Checkpoints.d.ts.map +1 -0
- package/dist/cjs/Checkpoints.js +145 -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 +24 -0
- package/dist/cjs/PortableSearch.d.ts.map +1 -0
- package/dist/cjs/PortableSearch.js +233 -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/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 +127 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +99 -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 +67 -0
- package/dist/cjs/internal/EnvelopePrecheck.d.ts.map +1 -0
- package/dist/cjs/internal/EnvelopePrecheck.js +124 -0
- package/dist/cjs/internal/EnvelopePrecheck.js.map +7 -0
- package/dist/cjs/internal/Exec.d.ts +139 -0
- package/dist/cjs/internal/Exec.d.ts.map +1 -0
- package/dist/cjs/internal/Exec.js +158 -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/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/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 +114 -0
- package/dist/cjs/internal/Text.d.ts.map +1 -0
- package/dist/cjs/internal/Text.js +82 -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 +380 -0
- package/dist/esm/Bash.d.ts.map +1 -0
- package/dist/esm/Bash.js +505 -0
- package/dist/esm/Bash.js.map +1 -0
- package/dist/esm/Checkpoints.d.ts +279 -0
- package/dist/esm/Checkpoints.d.ts.map +1 -0
- package/dist/esm/Checkpoints.js +298 -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 +24 -0
- package/dist/esm/PortableSearch.d.ts.map +1 -0
- package/dist/esm/PortableSearch.js +240 -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/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 +127 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +127 -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 +67 -0
- package/dist/esm/internal/EnvelopePrecheck.d.ts.map +1 -0
- package/dist/esm/internal/EnvelopePrecheck.js +167 -0
- package/dist/esm/internal/EnvelopePrecheck.js.map +1 -0
- package/dist/esm/internal/Exec.d.ts +139 -0
- package/dist/esm/internal/Exec.d.ts.map +1 -0
- package/dist/esm/internal/Exec.js +193 -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/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/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 +114 -0
- package/dist/esm/internal/Text.d.ts.map +1 -0
- package/dist/esm/internal/Text.js +130 -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 +117 -0
- package/docs/api.md +472 -0
- package/docs/concepts/effects-and-capabilities.md +136 -0
- package/docs/concepts/flows-and-handlers.md +115 -0
- package/docs/concepts/limits-and-disclosure.md +102 -0
- package/docs/concepts/search-contract.md +182 -0
- package/docs/guides/bind-the-standard-flows.md +114 -0
- package/docs/guides/implement-a-search-peer.md +133 -0
- package/docs/guides/pin-a-checkpoint.md +141 -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 +215 -0
- package/docs/guides/run-the-test-suite.md +154 -0
- package/docs/guides/search-a-workspace.md +148 -0
- package/docs/installation.md +111 -0
- package/docs/quickstart.md +125 -0
- package/docs/reference/flows.md +556 -0
- package/docs/troubleshooting.md +322 -0
- package/package.json +439 -3
- package/src/ApplyPatch.ts +458 -0
- package/src/Bash.ts +607 -0
- package/src/Checkpoints.ts +422 -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 +264 -0
- package/src/Probe.ts +284 -0
- package/src/Read.ts +359 -0
- package/src/Relocate.ts +166 -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 +154 -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 +233 -0
- package/src/internal/Exec.ts +314 -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/SearchContract.ts +77 -0
- package/src/internal/Symbols.ts +88 -0
- package/src/internal/TestReport.ts +194 -0
- package/src/internal/Text.ts +170 -0
- package/src/internal/Url.ts +23 -0
- package/src/internal/Walk.ts +176 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# @smthrs/std
|
|
2
|
+
|
|
3
|
+
## [Unreleased]
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- Container commands reject sparse argument arrays and build plans from the
|
|
8
|
+
validated argument snapshot.
|
|
9
|
+
|
|
10
|
+
- `webfetch` uses one timeout budget across requests, redirects, and response
|
|
11
|
+
body reads. It rejects non-finite and non-positive timeouts before dispatch,
|
|
12
|
+
retains the 30-second default, and caps valid timeouts at 120 seconds.
|
|
13
|
+
- `webfetch` owns its redirect loop when composed with the kernel HTTP client,
|
|
14
|
+
reports the final URL, and allows at most ten redirects (eleven requests).
|
|
15
|
+
Each hop remains subject to the kernel's permission check.
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- `webfetch` caps its rendered `content` at the shared 60,000-byte head budget
|
|
20
|
+
and reports the cut through `truncated` and `notice`, matching `fetch` and
|
|
21
|
+
`http-post`. It previously returned up to 5 MiB of text to the model. The
|
|
22
|
+
5 MiB network read limit is unchanged.
|
|
23
|
+
- `bash` measures the tree a containerised command runs in. For an
|
|
24
|
+
`unhermetic` call that names a `container`, the flow runs
|
|
25
|
+
`TreeFingerprint.script` through the container transport in the command's
|
|
26
|
+
working directory before and after the command and reports whether the two
|
|
27
|
+
answers differ as `mutated` on its output: `true` for a tree that changed,
|
|
28
|
+
`false` for one that held still, absent when it could not be measured (no
|
|
29
|
+
transport, no `find` or `stat -c`, a timeout, or a listing past `maxPaths`).
|
|
30
|
+
The host's workspace walk never sees a container's filesystem, so every
|
|
31
|
+
edit an agent made through `docker exec` read as an idle frame: on
|
|
32
|
+
Terminal-Bench 4.0 (2026-09-22) the harness's own read-only cap ended one
|
|
33
|
+
run after twenty-four frames of container writes and its claim judge
|
|
34
|
+
refused another's finished work as never recorded. Two extra `docker exec`
|
|
35
|
+
calls per containerised command, each bounded by the command's own timeout
|
|
36
|
+
and by 60 s.
|
|
37
|
+
|
|
38
|
+
### Added
|
|
39
|
+
|
|
40
|
+
- Added `TreeFingerprint`: the in-container tree measurement `bash` uses, and
|
|
41
|
+
the owner of the prune and suffix lists `@smthrs/agent/WorkspaceObservation`
|
|
42
|
+
now re-exports, so the host walk and the container measurement skip the
|
|
43
|
+
same derived artifacts. `key` (`"mutated"`) is the reserved output key,
|
|
44
|
+
documented beside `Probe.key`.
|
|
45
|
+
|
|
46
|
+
- A batched `classify` call reports how long it took. `Classify.askAll` times
|
|
47
|
+
itself and the batch output carries `latencyMs` beside `results`, the way a
|
|
48
|
+
single verdict already carried the transport's. Without it the only timing a
|
|
49
|
+
caller had was the gap between the call's start and settle events, which the
|
|
50
|
+
harness publishes in one tick, so every batched classify card in the
|
|
51
|
+
OpenCode server read about 1 ms while single-state calls read 319, 264 and
|
|
52
|
+
265 ms. The field is additive: `results` is unchanged.
|
|
53
|
+
|
|
54
|
+
- `Classify` maps evaluator failures with `Classifier.fromEvaluatorError` from
|
|
55
|
+
`@smthrs/model` instead of a private copy.
|
|
56
|
+
|
|
57
|
+
### Added
|
|
58
|
+
|
|
59
|
+
- Added the `classify` flow (`Classify`): typed Jev questions about any JSON state, one state or a batch of up to 64 at 32 KiB each, evaluated eight at a time through the `Evaluator` service of `@smthrs/model`. Answers carry probabilities and a confidence per question; a batch keeps every failure beside its state. `Classify.curated(classifier)` declares a `classify/<id>` flow from any `Classifier.make` declaration, with the classifier's state as input and its digest on the declaration.
|
|
60
|
+
- Added `Classifiers`: the three curated classifiers `triage/relevance`, `check/verdict`, and `edit/risk`, and `Classifiers.all` for a host to bind as a set.
|
|
61
|
+
- `Manifest` registers `classify`; it is part of `Manifest.readOnly` because a `model:call` observes and changes nothing.
|
|
62
|
+
- Every flow module now exports `Input` and `Output` as the decoded TypeScript types beside the schemas. Only `Bash` did, so every other caller wrote `typeof Read.Input.Type`.
|
|
63
|
+
|
|
64
|
+
### Changed
|
|
65
|
+
|
|
66
|
+
- **Breaking.** Every service key, error tag, and class identifier now carries the package name: `@smthrs/std/<Name>`. `StdError` was tagged `flows/std/StdError`, `Checkpoints.Snapshot` was identified as `flows/std/Checkpoints/Snapshot`, and the `Search`, `Container`, `Checkpoints`, `TestRunner`, `WebSearch`, and `LanguageServer` keys were `/std/<Name>`. An `Effect.catchTag` on the old tag no longer matches; catch `"@smthrs/std/StdError"`.
|
|
67
|
+
- **Breaking.** `Checkpoints.unavailable` is now `(id: string) => StdError` and names the checkpoint it was asked for, the same shape as `Container.unavailable`. It was a shared `StdError` value.
|
|
68
|
+
- The `LanguageServer`, `Lsp`, `NodeLanguageServer`, `WebFetch`, `WebSearch`, and `ExaWebSearch` module headers describe the module instead of citing a plan file that does not exist, the barrel header names `@smthrs/std`, and every `@since` stamp reads `1.0.0` instead of the never-released `0.1.0`.
|
|
69
|
+
|
|
70
|
+
- `grep` and `glob` now declare `noIgnore` as the literal `true` rather than a boolean. Ignore files are never consulted in v1, so `noIgnore: false` was accepted by the schema and then refused at runtime; the schema now states what it accepts. A caller reaching `run` without decoding still gets the same `invalid_input` refusal.
|
|
71
|
+
|
|
72
|
+
### Removed
|
|
73
|
+
|
|
74
|
+
- Removed `grep`'s `types` input. File-type registries are not supported in v1, so every non-empty value failed with `invalid_input` while the field cost its description in every model frame.
|
|
75
|
+
|
|
76
|
+
## [1.0.0-rc.0] - 2026-09-01
|
|
77
|
+
|
|
78
|
+
### Added
|
|
79
|
+
|
|
80
|
+
- Added `Manifest.effectsFor`, a frozen name-to-narrowing registry, and the missing `effectsFor` narrowing on `apply_patch`, `shell_command` and `update_plan`, so a host holding a flow name and a decoded input can narrow the envelope instead of serializing against the registry-time worst case.
|
|
81
|
+
- Added `SearchContract` as a public module: `validatePattern`, `validateGlob`, `canonicalGlob`, `matchesGlob`, `includedByGlobs`, `expression` and `unsatisfiableNotice` are what an external `Search` peer must build on, and they were reachable only through the null-mapped `internal/` subpath.
|
|
82
|
+
- Added default wall-clock timeouts to `bash` and `test` (`DEFAULT_TIMEOUT_MS`, ten minutes) and a capture bound to every buffered command, so a hung command no longer hangs the flow forever and a command printing gigabytes costs the bound rather than the whole of what it printed. `<stream>DroppedBytes` now counts what the process produced rather than what survived the display budget.
|
|
83
|
+
- Added package-owned documentation: `docs/api.md` states the limits, the failure codes and the services a host binds, `docs/reference/flows.md` describes every flow's input, output and failures, and `test/Readme.test.ts` fails when `README.md`'s Public API or Limits table, or `docs/api.md`'s module list, no longer matches the barrel. The README's table had named 21 of the 30 exported namespaces, omitting three registry flows a model can call, and stated no limits, no failure codes and no service-binding behaviour.
|
|
84
|
+
- Added a `test` flow bound to the repository's declared runner (`TestRunner`): it answers `{passed, failed[ids], parsed, tail}` read from the runner's own report — pytest, unittest and TAP are recognised — instead of twenty kilobytes of stdout, and `against: "base"` runs the same selection again on the pristine base commit in a detached worktree so `introduced`, `preexisting` and `fixed` come back from one call. The base is the engine's `refs/flows/capture-base`, then HEAD.
|
|
85
|
+
- Added a `Container` transport service, and `script`/`interpreter`/`args`/`stdin`/`container` inputs to `bash`. A script reaches its interpreter on standard input as data, so no caller composes `docker exec c bash -lc '…heredoc…'` again; the argv for a container is built by the injected transport, and a host with none refuses the call by saying so.
|
|
86
|
+
- Added the enclosing definition to every returned `grep` hit where the file's shape says so plainly, so a read window is computed rather than guessed; `symbols: false` turns it off.
|
|
87
|
+
- Added `startLine`/`endLine`/`expect` anchoring to `edit`, so an edit can target the span a prior `read` or `grep` hit reported instead of retyping it.
|
|
88
|
+
- Added `webfetch`, `websearch`, and `lsp` flows with provider-neutral service boundaries.
|
|
89
|
+
- Added one ripgrep-compatible search contract with native `rg` and in-process peer implementations, shared conformance coverage, context lines, case modes, globs, per-file match limits, hidden-file control, and files-with-matches output.
|
|
90
|
+
|
|
91
|
+
### Changed
|
|
92
|
+
|
|
93
|
+
- **Breaking.** `read` now returns raw file text in `content`, with the line numbers in the sibling `startLine`/`endLine` fields, instead of rendering `NNN\t` before every line. An anchor copied out of a read used to carry the gutter, so every `edit` built from a read missed and cells wrote string surgery to strip it. A byte-capped page now also ends on a whole line rather than a fragment that reads like an anchor.
|
|
94
|
+
- **Breaking.** `grep` results are match-centric: `limit` counts matches, each hit carries the `before`/`after` context that belongs to it, every context line belongs to exactly one hit, and a hit can no longer be dropped to make room for context. The flat `{file, line, text, kind}` rows are gone. A metacharacter pattern that finds nothing is retried as a literal, with `retriedAsLiteral` set.
|
|
95
|
+
- **Breaking.** `edit` matches its anchor byte-exactly or fails, and reports the file's real text at the nearest region with its line range. The tolerant apply cascade (trailing whitespace, then collapsed whitespace) is gone from the apply path and survives only as that diagnosis: a match that is not the caller's bytes is an edit nobody inspected, which silently dedented a guard on one instance and corrupted a file on another. `edit` also returns the applied hunk, and `edit`, `write` and `apply_patch` all restore permission bits a host write moved.
|
|
96
|
+
- Documented Bash's `stdoutTruncated`/`stderrTruncated` flags as the wire convention `@smthrs/harness/TruncatedOutput` reads, and stated in each stream's description that a truncated capture is a fragment that must not be written to a file.
|
|
97
|
+
- Allowed hermetic Bash invocations to use the resolved base directory as their working directory without declaring it as a read.
|
|
98
|
+
- Exempted `/dev/*` from the hermetic Bash path scan; process plumbing is not a workspace effect.
|
|
99
|
+
|
|
100
|
+
### Fixed
|
|
101
|
+
|
|
102
|
+
- **Breaking.** Closed three independent bypasses in the hermetic pre-check, each on its own sufficient to defeat it. A newline is now a command boundary, so `rm` on line two of a `script` is checked against `writes` instead of being classified under line one's command, and a leading `env`/`sudo`/`nice`/`xargs` wrapper no longer lends its own read classification to the command it wraps. Every path token and every declared entry is resolved before comparison, so `/work/../outside/secret.txt` is no longer inside `reads: ["/work"]` and `/dev/../etc/passwd` is checked as `/etc/passwd` rather than dropped as process plumbing. A blank entry in `reads`/`writes` no longer grants every absolute path, `"/"` now means the whole filesystem rather than nothing, and both fields reject the empty string at decode time.
|
|
103
|
+
- Refused a container name that is empty or starts with `-`, and terminated the container argv with `--`, so `container: "--privileged"` can no longer be read as an option by `docker exec`.
|
|
104
|
+
- Stopped `Html.decode` from throwing on an out-of-range or surrogate numeric entity, and bounded the element-skipping scan, which took thirty seconds on a two-megabyte page with unclosed `<script>` tags outside every timeout `webfetch` applies.
|
|
105
|
+
- Made `test` report a reading only when the runner's own counts and the failure ids it named agree. A summary-only capture (`2 failed`, or `Ran 2 tests` with `FAILED (failures=2)` and no headers) used to come back `parsed: true` with an empty failure set, which reported every base failure as fixed.
|
|
106
|
+
- Gave the `against: "base"` worktree the shape `Checkpoints` already proved it needs: a stale checkout is discarded first, the checkout's git pointer is relative so a container can read it, and the repository's format is restored. One killed run used to break every later baseline permanently.
|
|
107
|
+
- Escaped `?` in a fixed-string search, so a literal `foo?` no longer matches `fo` and a bare `?` no longer dies as an unhandled defect instead of a typed failure.
|
|
108
|
+
- Counted lines the way `grep` counts them in `read` and `edit`: a file ending in a newline no longer reports one line more than it has, and an empty file reads as an empty page instead of an out-of-range offset.
|
|
109
|
+
- Refused a `file:`, `data:` or credential-bearing URL in `fetch`, `http-post` and `webfetch` through one shared guard, and bounded every HTTP response before decoding.
|
|
110
|
+
- Made `apply_patch` derive every hunk before writing any of it, so a miss on the third hunk leaves the first two unwritten, and named what had been applied when a write itself fails.
|
|
111
|
+
- Made `edit` refuse `expect` under an `oldString` anchor and `replaceAll` under a line span instead of silently ignoring them, and refuse an `endLine` past the end of the file instead of clamping it.
|
|
112
|
+
- Made `edit` and `apply_patch` read bytes and refuse a non-UTF-8 file the way `read` does, instead of rewriting the whole file with replacement characters where the invalid bytes were.
|
|
113
|
+
- Propagated a permission-restoration failure instead of swallowing it, so a write that moved the mode bits and could not put them back is a failure rather than a success.
|
|
114
|
+
- Ordered `ls` by UTF-16 code unit rather than the host's ICU locale, reported a file as `not_a_directory`, and described every entry once before cutting the page, so `offset` addresses the same listing at every page size and a broken symlink no longer fails the whole listing.
|
|
115
|
+
- Turned an Exa HTTP error into a distinguishable failure instead of a successful empty search, and bounded the provider request.
|
|
116
|
+
- Parsed `rg --files` output as NUL-separated, so a legal filename containing a newline is one path rather than two fabricated ones.
|
|
117
|
+
- Reported the truncation notice with the real byte totals, and stopped the cut-repair from eating a replacement character the source itself contained.
|
|
118
|
+
- Classified the invalid-command probe in `test` against the text the caller receives, so its evidence line is always quotable from the returned tail.
|
|
119
|
+
- Anchored the `Probe` recognisers the module documents as whole-line matchers.
|
|
120
|
+
- Bounded the language-server transport: a frame header over 8 KiB and a frame over 8 MiB are refused and resynchronized past, the pending buffer grows by chunks instead of copying itself per chunk, and every outstanding request fails when stdout closes or the child exits.
|
|
121
|
+
- Returned the workspace-wide envelope from `Lsp.effectsFor`, which narrowed reads to the queried file while the server reads the whole project.
|
|
122
|
+
- Dropped the single-in-progress sentence from `update_plan`'s description, which the schema never enforced.
|
|
123
|
+
- Made `edit` report the nearest actual region on a miss, as raw quotable bytes rather than line-number-prefixed text; two benchmark runs burned their whole frame budget on whitespace-guessing loops. Prior art: `reference/opencode` `tool/edit.ts`, where this deviates deliberately by refusing to apply a loose match.
|
|
124
|
+
|
|
125
|
+
- Stopped `grep` and `glob` walks from descending into version-control, dependency, and cache directories; one `.git` descent held a frame for its whole evaluation ceiling.
|
|
126
|
+
|
|
127
|
+
- Reported a directory entry whose metadata cannot be read as a plain entry instead of failing the whole `ls` listing.
|
|
128
|
+
|
|
129
|
+
[Unreleased]: https://github.com/smithersai/smithers/compare/v1.0.0-rc.0...HEAD
|
|
130
|
+
[1.0.0-rc.0]: https://github.com/smithersai/smithers/releases/tag/v1.0.0-rc.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 William Cory and the Smithers Flows contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,153 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @smthrs/std
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Release candidate scope, host requirements and compatibility review are defined in the [library support policy](https://github.com/smithersai/smithers/blob/main/RELEASE_SUPPORT.md).
|
|
4
|
+
|
|
5
|
+
This package declares `effect` as an exact
|
|
6
|
+
`4.0.0-rc.115` peer dependency. Keep the application on that version so
|
|
7
|
+
all Smithers packages share one Effect runtime.
|
|
8
|
+
|
|
9
|
+
**Documentation:** https://std.smithers.sh
|
|
10
|
+
|
|
11
|
+
The standard flows tool library for filesystem, search, HTTP, shell, language-server, and Jev judgment work. Each callable tool is an ordinary `@smthrs/core` flow declaration with explicit capabilities and effects, plus an injectable handler where execution is host-owned.
|
|
12
|
+
|
|
13
|
+
Not on npm yet; see [Installation](https://github.com/smithersai/smithers/blob/main/packages/smithers/flows/flow/docs/installation.md#use-the-libraries).
|
|
14
|
+
|
|
15
|
+
## Public API
|
|
16
|
+
|
|
17
|
+
The root entry point exports these namespaces; each is also importable from `@smthrs/std/<Module>`.
|
|
18
|
+
|
|
19
|
+
| Module | Public exports | Description |
|
|
20
|
+
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
|
|
21
|
+
| `ApplyPatch` | `name`, `description`, `Input`, `Output`, `effects`, `effectsFor`, `capabilities`, `flow`, `run`, `activity`, `presentation`, `paths` | Declares and applies a V4A patch. |
|
|
22
|
+
| `Bash` | `name`, `description`, `DEFAULT_TIMEOUT_MS`, `Input`, `Output`, `effects`, `effectsFor`, `capabilities`, `flow`, `run`, `invocation`, `inTerminal`, `outsideContainer`, `sealed`, `presentation` | Declares and runs bounded shell commands, here or in a registered terminal. |
|
|
23
|
+
| `Checkpoints` | `baseId`, `scratchDirectory`, `configSection`, `Snapshot`, `Materialized`, `Checkpoints`, `make`, `unavailable`, `makeNoop`, `layerNoop`, `GitOptions`, `makeGit`, `layerGit`, `Relocation`, `relocate` | Pins a working tree as a git checkpoint and materializes it again. |
|
|
24
|
+
| `Container` | `Request`, `Plan`, `Container`, `make`, `unavailable`, `makeNoop`, `layerNoop`, `makeCommand`, `layerCommand` | Routes a command into a named container. |
|
|
25
|
+
| `Edit` | `name`, `description`, `Input`, `Output`, `effects`, `effectsFor`, `capabilities`, `flow`, `run`, `activity`, `presentation` | Declares and applies exact text replacements. |
|
|
26
|
+
| `ExaWebSearch` | `layer` | Provides WebSearch through the Exa API and kernel HTTP client. |
|
|
27
|
+
| `Explore` | `name`, `description`, `Input`, `Output`, `effects`, `effectsFor`, `capabilities`, `make`, `flow` | Declares a dynamic exploration flow composed from other standard flows. |
|
|
28
|
+
| `Fetch` | `name`, `description`, `Input`, `Output`, `effects`, `effectsFor`, `capabilities`, `flow`, `run` | Declares and runs raw HTTP GET requests. |
|
|
29
|
+
| `Glob` | `name`, `description`, `Input`, `Output`, `effects`, `effectsFor`, `capabilities`, `flow`, `run`, `activity`, `presentation` | Declares and runs filesystem glob searches. |
|
|
30
|
+
| `Grep` | `name`, `description`, `Input`, `ContextLine`, `Symbol`, `Match`, `Output`, `effects`, `effectsFor`, `capabilities`, `flow`, `run`, `activity`, `presentation` | Declares and runs text searches over files. |
|
|
31
|
+
| `HttpPost` | `name`, `description`, `Input`, `Output`, `effects`, `effectsFor`, `capabilities`, `flow`, `run` | Declares and runs HTTP POST requests. |
|
|
32
|
+
| `LanguageServer` | `Position`, `LanguageServer`, `make`, `makeNoop`, `layerNoop` | Defines the language-server query service. |
|
|
33
|
+
| `Ls` | `name`, `description`, `Input`, `Output`, `effects`, `effectsFor`, `capabilities`, `flow`, `run`, `activity`, `presentation` | Declares and runs directory listings. |
|
|
34
|
+
| `Lsp` | `name`, `description`, `Input`, `Output`, `effects`, `effectsFor`, `capabilities`, `flow`, `run` | Declares and runs ten language-server queries, from hover to diagnostics. |
|
|
35
|
+
| `Manifest` | `flows`, `handlers`, `effectsFor`, `names`, `readOnly` | Exposes frozen flow, handler, and narrowing registries plus the read-only set. |
|
|
36
|
+
| `NativeSearch` | `MAX_CAPTURE_BYTES`, `make`, `layer` | Implements Search through the ripgrep binary. |
|
|
37
|
+
| `NodeLanguageServer` | `Config`, `MAX_QUEUED_FRAMES`, `MAX_PENDING_REQUESTS`, `make`, `makeLazy`, `layer`, `layerLazy` | Implements LanguageServer with Node child processes, routed by extension. |
|
|
38
|
+
| `PortableSearch` | `make`, `layer` | Implements Search by walking the kernel filesystem in process. |
|
|
39
|
+
| `Probe` | `key`, `Reason`, `InvalidProbe`, `Attribution`, `CONFIDENCE_FLOOR`, `MAX_OUTPUT_BYTES`, `posix`, `probeAttribution`, `classify`, `unjudged` | Attributes a non-zero exit to the command or to the tree, with Jev. |
|
|
40
|
+
| `Read` | `name`, `description`, `Input`, `Output`, `effects`, `effectsFor`, `capabilities`, `flow`, `run`, `activity`, `presentation`, `MAX_READ_FILE_BYTES`, `Preconditions`, `ReadSession`, `VersionedFileSystem` | Declares and runs bounded file reads. |
|
|
41
|
+
| `Relocate` | `Relocation`, `relocate` | Rewrites a call's input so the call runs against a materialized checkpoint. |
|
|
42
|
+
| `Search` | `GrepInput`, `GrepLine`, `ContextLine`, `Symbol`, `GrepMatch`, `GrepOutput`, `GlobInput`, `GlobOutput`, `Search`, `make`, `makeNoop`, `layerNoop` | Defines the search service both peers implement. |
|
|
43
|
+
| `SearchConformance` | `GeneratedFile`, `Plan`, `Divergence`, `plan`, `materialize`, `compare`, `report` | Generates a tree and calls, then reports where two Search peers disagree. |
|
|
44
|
+
| `SearchContract` | `validatePattern`, `validateGlob`, `canonicalGlob`, `matchesGlob`, `includedByGlobs`, `expression`, `unsatisfiableNotice`, `isContractRejection` | The shared matcher an external Search peer must build on. |
|
|
45
|
+
| `ShellCommand` | `name`, `description`, `DEFAULT_TIMEOUT_MS`, `MAX_CAPTURE_BYTES`, `DEFAULT_MAX_OUTPUT_TOKENS`, `TIMEOUT_EXIT_CODE`, `Input`, `Output`, `effects`, `effectsFor`, `capabilities`, `flow`, `run` | Declares and runs a Codex-shaped shell command. |
|
|
46
|
+
| `StdError` | `Code`, `StdError` | Defines typed standard-tool failures. |
|
|
47
|
+
| `TestRun` | `name`, `description`, `scratchDirectory`, `DEFAULT_TIMEOUT_MS`, `MAX_CAPTURE_BYTES`, `Input`, `Outcome`, `Output`, `effects`, `effectsFor`, `capabilities`, `flow`, `run`, `activity`, `presentation` | Runs the declared test suite and reads its report. |
|
|
48
|
+
| `TreeFingerprint` | `key`, `defaultPrune`, `defaultIgnoreSuffixes`, `maxPaths`, `Measurement`, `script`, `parse`, `moved` | Measures a container's working directory so `bash` can report a write there. |
|
|
49
|
+
| `TestRunner` | `captureBase`, `Runner`, `TestRunner`, `make`, `makeNoop`, `layer`, `layerNoop` | Declares how the project under test runs its suite. |
|
|
50
|
+
| `UpdatePlan` | `name`, `description`, `StepStatus`, `Plan`, `Input`, `Output`, `effects`, `effectsFor`, `capabilities`, `flow`, `run` | Acknowledges a Codex plan update. |
|
|
51
|
+
| `WebFetch` | `name`, `description`, `Input`, `Output`, `effects`, `effectsFor`, `capabilities`, `flow`, `run` | Declares and runs normalized web-page fetches. |
|
|
52
|
+
| `WebSearch` | `name`, `description`, `Input`, `Result`, `Output`, `effects`, `effectsFor`, `capabilities`, `flow`, `WebSearch`, `make`, `makeNoop`, `layerNoop`, `run` | Declares web search and its injectable provider service. |
|
|
53
|
+
| `Write` | `name`, `description`, `Input`, `Output`, `effects`, `effectsFor`, `capabilities`, `flow`, `run`, `activity`, `presentation` | Declares and runs file writes. |
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
import { Read } from "@smthrs/std"
|
|
57
|
+
import { Effect } from "effect"
|
|
58
|
+
|
|
59
|
+
const program = Read.run({ path: "/workspace/notes.md" }).pipe(
|
|
60
|
+
Effect.map((result) => result.content)
|
|
61
|
+
)
|
|
62
|
+
// Provide the kernel FileSystem and Path layers in the host.
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
`Read.content` preserves source-line bytes, including trailing `\r` in CRLF files, and omits the page's final `\n`. Copy it unchanged into an edit anchor and retain the `\r` bytes in replacement text to keep CRLF endings.
|
|
66
|
+
|
|
67
|
+
`Manifest.flows` is the declaration registry, `Manifest.handlers` contains directly executable handlers, `Manifest.effectsFor` narrows a declaration for one decoded input, and `Manifest.readOnly` is the canonical read-only projection. `@smthrs/std/package.json` is also exported; `internal/*` and nested `*/index` subpaths are blocked.
|
|
68
|
+
|
|
69
|
+
The root entry point is Node-only: `NodeLanguageServer` pulls in `node:url`. The four subpaths `@smthrs/std/Grep`, `@smthrs/std/Glob`, `@smthrs/std/Search` and `@smthrs/std/PortableSearch` are browser-safe, because nothing any of them imports reaches a Node built-in.
|
|
70
|
+
|
|
71
|
+
## Child process environment
|
|
72
|
+
|
|
73
|
+
Commands started by `bash`, `shell_command`, `test`, and the package's internal
|
|
74
|
+
process helpers do not inherit the full Smithers process environment. They
|
|
75
|
+
receive only `PATH`, `HOME`, `USER`, `LANG`, `LC_*`, `TERM`, `TMPDIR`, and
|
|
76
|
+
`SHELL`, plus variables the caller explicitly declares. Credential-shaped
|
|
77
|
+
ambient names such as `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, and `GH_TOKEN` are
|
|
78
|
+
withheld; an explicitly declared name is intentional and is delivered even
|
|
79
|
+
when its name looks sensitive.
|
|
80
|
+
|
|
81
|
+
## Limits
|
|
82
|
+
|
|
83
|
+
Every limit is a display budget disclosed to the caller, never a silent cut. A capped result says so in its own output: `truncated`, `<stream>Truncated`, or a `notice` line naming what was shown and what there was. Rows named by prose are fixed in the package and not exported; the rest are the constants named.
|
|
84
|
+
|
|
85
|
+
| Limit | Value | Applies to |
|
|
86
|
+
| ----------------------------------------- | ----------- | --------------------------------------------------------------- |
|
|
87
|
+
| Default `read` page | 2,000 lines | one `read` call with no `limit` |
|
|
88
|
+
| Displayed line | 2,000 | one displayed line; a clipped line is not an edit anchor |
|
|
89
|
+
| Entries per page | 1,000 | one `ls` or `glob` page |
|
|
90
|
+
| Matches per call | 200 | one `grep` call |
|
|
91
|
+
| Rendered text payload | 60,000 | one rendered text payload (`fetch`, `http-post`, `webfetch`) |
|
|
92
|
+
| Shell stream capture | 30,000 | each captured shell stream |
|
|
93
|
+
| `Bash.DEFAULT_TIMEOUT_MS` | 600,000 | one `bash` call with no `timeoutMs` |
|
|
94
|
+
| `TestRun.DEFAULT_TIMEOUT_MS` | 600,000 | one `test` call with no `timeoutMs` |
|
|
95
|
+
| `TestRun.MAX_CAPTURE_BYTES` | 8,000,000 | the runner output one `test` call holds in memory |
|
|
96
|
+
| `ShellCommand.DEFAULT_TIMEOUT_MS` | 10,000 | one `shell_command` call with no `timeout_ms` |
|
|
97
|
+
| `ShellCommand.MAX_CAPTURE_BYTES` | 8,000,000 | the command output one `shell_command` call holds in memory |
|
|
98
|
+
| `NativeSearch.MAX_CAPTURE_BYTES` | 64 MiB | one `rg` invocation's captured output, refused past the cap |
|
|
99
|
+
| HTTP response bytes | 5 MiB | `fetch`, `http-post` and `webfetch`, refused past the cap |
|
|
100
|
+
| `fetch` / `http-post` timeout | 30 s | total request and body budget; `timeout` seconds, capped at 120 |
|
|
101
|
+
| `webfetch` request timeout | 120 s cap | the request and the body read |
|
|
102
|
+
| Language-server frame | 8 MiB | one JSON-RPC frame, with an 8 KiB header bound |
|
|
103
|
+
| `NodeLanguageServer.MAX_QUEUED_FRAMES` | 256 | frames buffered for one language server's stdin |
|
|
104
|
+
| `NodeLanguageServer.MAX_PENDING_REQUESTS` | 512 | concurrent in-flight JSON-RPC requests to one server |
|
|
105
|
+
|
|
106
|
+
Shell capture is bounded where it is read rather than after: a command that prints gigabytes costs the bound, not the whole of what it printed, and the `<stream>DroppedBytes` fields count what the process actually produced. Every caller-supplied command (`bash`, `test`, `shell_command`) passes a bound. The internal `git` plumbing calls behind `Checkpoints` and `TestRun`'s baseline do not, because a listing read for its content is useless with its head missing. Those fields and the `<stream>Truncated` flags beside them are a wire convention: [`@smthrs/harness`](https://harness.smithers.sh) reads them to refuse a later write of those exact bytes, so check the flag before writing captured output anywhere.
|
|
107
|
+
|
|
108
|
+
## Failures
|
|
109
|
+
|
|
110
|
+
Handlers keep ordinary outcomes in the success channel: a non-zero exit code, an empty match set and a 500 response are all values. `StdError` is reserved for failures a model must see as failures, and its `code` is a closed, stable list carried with the offending `path` where one exists.
|
|
111
|
+
|
|
112
|
+
| Code | Meaning |
|
|
113
|
+
| -------------------------- | ------------------------------------------------------------- |
|
|
114
|
+
| `not_found` | The named path or ref does not exist. |
|
|
115
|
+
| `not_a_file` | A file operation was aimed at something that is not a file. |
|
|
116
|
+
| `not_a_directory` | A directory operation was aimed at something that is not one. |
|
|
117
|
+
| `is_directory` | A read was aimed at a directory. |
|
|
118
|
+
| `binary_file` | The bytes hold a NUL or are not valid UTF-8. |
|
|
119
|
+
| `offset_out_of_range` | The requested page or line span is past the end. |
|
|
120
|
+
| `invalid_pattern` | The search pattern does not compile. |
|
|
121
|
+
| `invalid_input` | The input is self-contradictory or names an unusable value. |
|
|
122
|
+
| `no_match` | The edit anchor or patch context is not in the file. |
|
|
123
|
+
| `not_modified` | The write would leave the file exactly as it was. |
|
|
124
|
+
| `permission_denied` | The host or the capability kernel refused access to the path. |
|
|
125
|
+
| `outside_declared_reads` | A hermetic path token is outside the declared read set. |
|
|
126
|
+
| `outside_declared_writes` | A hermetic path token is outside the declared write set. |
|
|
127
|
+
| `command_failed` | The process could not start, or a host operation failed. |
|
|
128
|
+
| `request_failed` | The HTTP or language-server request failed. |
|
|
129
|
+
| `timeout` | The call exceeded its wall-clock budget. |
|
|
130
|
+
| `rate_limited` | Provider rate limit reached; back off before retrying. |
|
|
131
|
+
| `provider_unavailable` | No host bound the service this flow needs, or it refused. |
|
|
132
|
+
| `unsupported` | The service does not implement this query. |
|
|
133
|
+
| `unsupported_content_type` | The response is not a type this flow renders. |
|
|
134
|
+
| `response_too_large` | The response or file exceeded the byte cap before decoding. |
|
|
135
|
+
|
|
136
|
+
Six services are injected, and a flow whose service a host has not bound gets a `makeNoop` refusal rather than a silent success: `Search` for `grep` and `glob`, `Container` for a containerised `bash` or `test`, `TestRunner` for `test`, `Checkpoints` for agent-side pinning, `WebSearch` for `websearch`, and `LanguageServer` for `lsp`. Refusing loudly is the contract, because a flow that appears to work while doing nothing costs a model the frames it takes to notice.
|
|
137
|
+
|
|
138
|
+
`NativeSearch` and `PortableSearch` are two implementations of one contract. `SearchContract` exports the matcher both build on, so an external peer binding its own `Search` cannot drift on what a pattern means. `SearchConformance` is how a peer proves it: it generates a tree and a batch of calls from a seed, runs them through two implementations, and reports every answer that differs. It found two drifts between the peers shipped here, one in how `maxCount` interacts with context lines and one in how `ignoreCase` and `smartCase` combine.
|
|
139
|
+
|
|
140
|
+
## Hermetic mode is a pre-check, not a sandbox
|
|
141
|
+
|
|
142
|
+
`Bash` retains `mode: "hermetic"` as effect-contract vocabulary, but the handler is not an operating-system sandbox. It performs a fail-closed lexical pre-check of the explicit path tokens in the command against `reads` and `writes`, resolving every token and every declaration to a canonical absolute path before comparing, and treating each physical line of a script as its own command. The host spawner runs the command under its configured confinement. Shell expansion, subprocess access, and paths computed at runtime are not observed, so the check bounds what a caller declared it would do rather than what the process can do. The CLI and native flow hosts supply OS confinement from the grants in force. The lexical check alone cannot prove hermetic execution.
|
|
143
|
+
|
|
144
|
+
## Documentation
|
|
145
|
+
|
|
146
|
+
The full documentation is at [std.smithers.sh](https://std.smithers.sh):
|
|
147
|
+
|
|
148
|
+
- [Quickstart](https://std.smithers.sh/quickstart/): search a tree and read the definition a hit sits in.
|
|
149
|
+
- [Flows and handlers](https://std.smithers.sh/concepts/flows-and-handlers/): the model behind the two halves.
|
|
150
|
+
- [The search contract](https://std.smithers.sh/concepts/search-contract/): Smithers Ripgrep Subset v1 and its two peers.
|
|
151
|
+
- [Flow reference](https://std.smithers.sh/reference/flows/): every flow's input and output fields.
|
|
152
|
+
- [API reference](https://std.smithers.sh/reference/api/): every module and every public export.
|
|
153
|
+
- [Troubleshooting](https://std.smithers.sh/troubleshooting/): the failures this package produces and what to change.
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* apply_patch flow declaration and portable handler.
|
|
3
|
+
*
|
|
4
|
+
* A Codex CLI clone: the V4A patch grammar (`*** Begin Patch` /
|
|
5
|
+
* `*** Add File:` / `*** Update File:` / `*** Delete File:` /
|
|
6
|
+
* `*** End Patch`), the fuzzy context-matching applier, and Codex's error
|
|
7
|
+
* and summary text, expressed as a flow over the kernel filesystem.
|
|
8
|
+
*
|
|
9
|
+
* @since 1.0.0
|
|
10
|
+
*/
|
|
11
|
+
import * as Effect from "effect/Effect";
|
|
12
|
+
import * as FileSystem from "effect/FileSystem";
|
|
13
|
+
import * as Schema from "effect/Schema";
|
|
14
|
+
import * as StdError from "./StdError.ts";
|
|
15
|
+
/**
|
|
16
|
+
* Registry name for the apply_patch flow. Matches the Codex CLI tool name.
|
|
17
|
+
*
|
|
18
|
+
* @category identifiers
|
|
19
|
+
* @since 1.0.0
|
|
20
|
+
*/
|
|
21
|
+
export declare const name = "apply_patch";
|
|
22
|
+
/**
|
|
23
|
+
* Model-facing description of the apply_patch flow. Matches the Codex CLI
|
|
24
|
+
* freeform tool description.
|
|
25
|
+
*
|
|
26
|
+
* @category descriptions
|
|
27
|
+
* @since 1.0.0
|
|
28
|
+
*/
|
|
29
|
+
export declare const description = "The `apply_patch` tool can be used to edit files. This is a FREEFORM tool, so do not wrap the patch in JSON.";
|
|
30
|
+
/**
|
|
31
|
+
* Input schema for the apply_patch flow.
|
|
32
|
+
*
|
|
33
|
+
* Codex delivers the patch as freeform text; the JSON function fallback uses
|
|
34
|
+
* a single `input` field, which is the shape cloned here.
|
|
35
|
+
*
|
|
36
|
+
* @category schemas
|
|
37
|
+
* @since 1.0.0
|
|
38
|
+
*/
|
|
39
|
+
export declare const Input: Schema.Struct<{
|
|
40
|
+
readonly input: Schema.String;
|
|
41
|
+
}>;
|
|
42
|
+
/**
|
|
43
|
+
* Decoded input accepted by the `apply_patch` flow.
|
|
44
|
+
*
|
|
45
|
+
* @category models
|
|
46
|
+
* @since 1.0.0
|
|
47
|
+
*/
|
|
48
|
+
export type Input = typeof Input.Type;
|
|
49
|
+
/**
|
|
50
|
+
* Output schema for the apply_patch flow.
|
|
51
|
+
*
|
|
52
|
+
* @category schemas
|
|
53
|
+
* @since 1.0.0
|
|
54
|
+
*/
|
|
55
|
+
export declare const Output: Schema.Struct<{
|
|
56
|
+
readonly output: Schema.String;
|
|
57
|
+
readonly added: Schema.$Array<Schema.String>;
|
|
58
|
+
readonly modified: Schema.$Array<Schema.String>;
|
|
59
|
+
readonly deleted: Schema.$Array<Schema.String>;
|
|
60
|
+
}>;
|
|
61
|
+
/**
|
|
62
|
+
* Decoded output returned by the `apply_patch` flow.
|
|
63
|
+
*
|
|
64
|
+
* @category models
|
|
65
|
+
* @since 1.0.0
|
|
66
|
+
*/
|
|
67
|
+
export type Output = typeof Output.Type;
|
|
68
|
+
/**
|
|
69
|
+
* Static conservative effect envelope for the apply_patch flow.
|
|
70
|
+
*
|
|
71
|
+
* @category effects
|
|
72
|
+
* @since 1.0.0
|
|
73
|
+
*/
|
|
74
|
+
export declare const effects: import("@smthrs/plan/Effects").Declaration;
|
|
75
|
+
/**
|
|
76
|
+
* Narrows the effect envelope for a decoded invocation.
|
|
77
|
+
*
|
|
78
|
+
* A patch names its files inside its own text rather than in a decoded field,
|
|
79
|
+
* and the parse that finds them is the same parse that can fail, so there is
|
|
80
|
+
* nothing here to narrow before the handler runs: the static envelope is the
|
|
81
|
+
* honest answer.
|
|
82
|
+
*
|
|
83
|
+
* @category effects
|
|
84
|
+
* @since 1.0.0
|
|
85
|
+
*/
|
|
86
|
+
export declare const effectsFor: (_input: typeof Input.Type) => import("@smthrs/plan/Effects").Declaration;
|
|
87
|
+
/**
|
|
88
|
+
* Capabilities required by the apply_patch flow.
|
|
89
|
+
*
|
|
90
|
+
* @category capabilities
|
|
91
|
+
* @since 1.0.0
|
|
92
|
+
*/
|
|
93
|
+
export declare const capabilities: string[];
|
|
94
|
+
/**
|
|
95
|
+
* Declaration-only apply_patch flow.
|
|
96
|
+
*
|
|
97
|
+
* @category flows
|
|
98
|
+
* @since 1.0.0
|
|
99
|
+
*/
|
|
100
|
+
export declare const flow: {
|
|
101
|
+
readonly name: "apply_patch";
|
|
102
|
+
readonly description: "The `apply_patch` tool can be used to edit files. This is a FREEFORM tool, so do not wrap the patch in JSON.";
|
|
103
|
+
readonly input: Schema.Struct<{
|
|
104
|
+
readonly input: Schema.String;
|
|
105
|
+
}>;
|
|
106
|
+
readonly output: Schema.Struct<{
|
|
107
|
+
readonly output: Schema.String;
|
|
108
|
+
readonly added: Schema.$Array<Schema.String>;
|
|
109
|
+
readonly modified: Schema.$Array<Schema.String>;
|
|
110
|
+
readonly deleted: Schema.$Array<Schema.String>;
|
|
111
|
+
}>;
|
|
112
|
+
readonly capabilities: string[];
|
|
113
|
+
readonly effects: import("@smthrs/plan/Effects").Declaration;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* What a call to this flow does, for a reader of a run.
|
|
117
|
+
*
|
|
118
|
+
* Display metadata only. `@smthrs/registry` `Descriptor.FlowActivity` is the
|
|
119
|
+
* governing vocabulary and `StandardFlows` binds this value onto the flow's
|
|
120
|
+
* descriptor, where the binding site checks it. `declarationDigest` excludes
|
|
121
|
+
* it, so declaring it cannot invalidate a call identity or a cached prompt.
|
|
122
|
+
*
|
|
123
|
+
* @category presentation
|
|
124
|
+
* @since 1.0.0-rc.0
|
|
125
|
+
*/
|
|
126
|
+
export declare const activity: "writes";
|
|
127
|
+
/**
|
|
128
|
+
* How one recorded call to this flow reads: the verb for each settlement, the
|
|
129
|
+
* input field that is its subject, and the measured output fields a one-line
|
|
130
|
+
* summary may count.
|
|
131
|
+
*
|
|
132
|
+
* Display metadata only, governed by `@smthrs/registry`
|
|
133
|
+
* `Descriptor.CallPresentation` and checked where `StandardFlows` binds it.
|
|
134
|
+
*
|
|
135
|
+
* @category presentation
|
|
136
|
+
* @since 1.0.0-rc.0
|
|
137
|
+
*/
|
|
138
|
+
export declare const presentation: {
|
|
139
|
+
readonly verb: {
|
|
140
|
+
readonly pending: "patching";
|
|
141
|
+
readonly success: "patched";
|
|
142
|
+
readonly failure: "failed to patch";
|
|
143
|
+
};
|
|
144
|
+
readonly subject: "patch";
|
|
145
|
+
readonly result: "patch";
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* Every path a patch writes, in the order it names them, including a move's
|
|
149
|
+
* destination. The patch is read by the parser {@link run} uses, so a header
|
|
150
|
+
* `run` accepts is never missed.
|
|
151
|
+
*
|
|
152
|
+
* Returns `undefined` when `run` would refuse the patch. A caller asking
|
|
153
|
+
* permission for the call then asks for everything the flow declares.
|
|
154
|
+
*
|
|
155
|
+
* @category parsing
|
|
156
|
+
* @since 1.0.0-rc.1
|
|
157
|
+
*/
|
|
158
|
+
export declare const paths: (patch: string) => ReadonlyArray<string> | undefined;
|
|
159
|
+
/**
|
|
160
|
+
* Parses and applies a V4A patch through the permission-aware kernel
|
|
161
|
+
* filesystem, preserving Codex error text.
|
|
162
|
+
*
|
|
163
|
+
* @category handlers
|
|
164
|
+
* @since 1.0.0
|
|
165
|
+
*/
|
|
166
|
+
export declare const run: (input: {
|
|
167
|
+
readonly input: string;
|
|
168
|
+
}) => Effect.Effect<{
|
|
169
|
+
readonly output: string;
|
|
170
|
+
readonly added: readonly string[];
|
|
171
|
+
readonly modified: readonly string[];
|
|
172
|
+
readonly deleted: readonly string[];
|
|
173
|
+
}, StdError.StdError, import("effect/Path").Path | FileSystem.FileSystem>;
|
|
174
|
+
//# sourceMappingURL=ApplyPatch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApplyPatch.d.ts","sourceRoot":"","sources":["../../src/ApplyPatch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAA;AAE/C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAOvC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AAEzC;;;;;GAKG;AACH,eAAO,MAAM,IAAI,gBAAgB,CAAA;AAEjC;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,iHACwF,CAAA;AAEhH;;;;;;;;GAQG;AACH,eAAO,MAAM,KAAK;;EAEhB,CAAA;AAEF;;;;;GAKG;AACH,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAErC;;;;;GAKG;AACH,eAAO,MAAM,MAAM;;;;;EAOjB,CAAA;AAEF;;;;;GAKG;AACH,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC,IAAI,CAAA;AAEvC;;;;;GAKG;AACH,eAAO,MAAM,OAAO,4CAAuF,CAAA;AAE3G;;;;;;;;;;GAUG;AACH,eAAO,MAAM,UAAU,GAAI,QAAQ,OAAO,KAAK,CAAC,IAAI,+CAAY,CAAA;AAEhE;;;;;GAKG;AACH,eAAO,MAAM,YAAY,UAAgE,CAAA;AAEzF;;;;;GAKG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;CAAsF,CAAA;AAEvG;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ,EAAG,QAAiB,CAAA;AAEzC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY;;;;;;;;CAIf,CAAA;AAEV;;;;;;;;;;GAUG;AACH,eAAO,MAAM,KAAK,GAAI,OAAO,MAAM,KAAG,aAAa,CAAC,MAAM,CAAC,GAAG,SAc7D,CAAA;AAsBD;;;;;;GAMG;AACH,eAAO,MAAM,GAAG;;;;;;;yEA0Pd,CAAA"}
|