@poe-platform/safe-bash 0.1.0
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/LICENSE +21 -0
- package/README.md +300 -0
- package/dist/safe-bash/browser.d.ts +13 -0
- package/dist/safe-bash/browser.d.ts.map +1 -0
- package/dist/safe-bash/browser.js +14478 -0
- package/dist/safe-bash/browser.js.map +7 -0
- package/dist/safe-bash/commands/apply-patch/apply.d.ts +6 -0
- package/dist/safe-bash/commands/apply-patch/apply.d.ts.map +1 -0
- package/dist/safe-bash/commands/apply-patch/apply.js +273 -0
- package/dist/safe-bash/commands/apply-patch/apply.js.map +1 -0
- package/dist/safe-bash/commands/apply-patch/index.d.ts +7 -0
- package/dist/safe-bash/commands/apply-patch/index.d.ts.map +1 -0
- package/dist/safe-bash/commands/apply-patch/index.js +23 -0
- package/dist/safe-bash/commands/apply-patch/index.js.map +1 -0
- package/dist/safe-bash/commands/apply-patch/matcher.d.ts +4 -0
- package/dist/safe-bash/commands/apply-patch/matcher.d.ts.map +1 -0
- package/dist/safe-bash/commands/apply-patch/matcher.js +164 -0
- package/dist/safe-bash/commands/apply-patch/matcher.js.map +1 -0
- package/dist/safe-bash/commands/apply-patch/options.d.ts +22 -0
- package/dist/safe-bash/commands/apply-patch/options.d.ts.map +1 -0
- package/dist/safe-bash/commands/apply-patch/options.js +34 -0
- package/dist/safe-bash/commands/apply-patch/options.js.map +1 -0
- package/dist/safe-bash/commands/apply-patch/parser.d.ts +22 -0
- package/dist/safe-bash/commands/apply-patch/parser.d.ts.map +1 -0
- package/dist/safe-bash/commands/apply-patch/parser.js +164 -0
- package/dist/safe-bash/commands/apply-patch/parser.js.map +1 -0
- package/dist/safe-bash/commands/apply-patch/shared.d.ts +40 -0
- package/dist/safe-bash/commands/apply-patch/shared.d.ts.map +1 -0
- package/dist/safe-bash/commands/apply-patch/shared.js +248 -0
- package/dist/safe-bash/commands/apply-patch/shared.js.map +1 -0
- package/dist/safe-bash/commands/archive/create.d.ts +17 -0
- package/dist/safe-bash/commands/archive/create.d.ts.map +1 -0
- package/dist/safe-bash/commands/archive/create.js +168 -0
- package/dist/safe-bash/commands/archive/create.js.map +1 -0
- package/dist/safe-bash/commands/archive/extract.d.ts +5 -0
- package/dist/safe-bash/commands/archive/extract.d.ts.map +1 -0
- package/dist/safe-bash/commands/archive/extract.js +343 -0
- package/dist/safe-bash/commands/archive/extract.js.map +1 -0
- package/dist/safe-bash/commands/archive/format.d.ts +33 -0
- package/dist/safe-bash/commands/archive/format.d.ts.map +1 -0
- package/dist/safe-bash/commands/archive/format.js +225 -0
- package/dist/safe-bash/commands/archive/format.js.map +1 -0
- package/dist/safe-bash/commands/archive/index.d.ts +8 -0
- package/dist/safe-bash/commands/archive/index.d.ts.map +1 -0
- package/dist/safe-bash/commands/archive/index.js +70 -0
- package/dist/safe-bash/commands/archive/index.js.map +1 -0
- package/dist/safe-bash/commands/archive/internal.d.ts +48 -0
- package/dist/safe-bash/commands/archive/internal.d.ts.map +1 -0
- package/dist/safe-bash/commands/archive/internal.js +183 -0
- package/dist/safe-bash/commands/archive/internal.js.map +1 -0
- package/dist/safe-bash/commands/archive/options.d.ts +26 -0
- package/dist/safe-bash/commands/archive/options.d.ts.map +1 -0
- package/dist/safe-bash/commands/archive/options.js +265 -0
- package/dist/safe-bash/commands/archive/options.js.map +1 -0
- package/dist/safe-bash/commands/archive/stream.d.ts +18 -0
- package/dist/safe-bash/commands/archive/stream.d.ts.map +1 -0
- package/dist/safe-bash/commands/archive/stream.js +108 -0
- package/dist/safe-bash/commands/archive/stream.js.map +1 -0
- package/dist/safe-bash/commands/basic.d.ts +3 -0
- package/dist/safe-bash/commands/basic.d.ts.map +1 -0
- package/dist/safe-bash/commands/basic.js +208 -0
- package/dist/safe-bash/commands/basic.js.map +1 -0
- package/dist/safe-bash/commands/bytes/checksums/index.d.ts +3 -0
- package/dist/safe-bash/commands/bytes/checksums/index.d.ts.map +1 -0
- package/dist/safe-bash/commands/bytes/checksums/index.js +334 -0
- package/dist/safe-bash/commands/bytes/checksums/index.js.map +1 -0
- package/dist/safe-bash/commands/bytes/compression/files.d.ts +13 -0
- package/dist/safe-bash/commands/bytes/compression/files.d.ts.map +1 -0
- package/dist/safe-bash/commands/bytes/compression/files.js +213 -0
- package/dist/safe-bash/commands/bytes/compression/files.js.map +1 -0
- package/dist/safe-bash/commands/bytes/compression/gunzip.d.ts +3 -0
- package/dist/safe-bash/commands/bytes/compression/gunzip.d.ts.map +1 -0
- package/dist/safe-bash/commands/bytes/compression/gunzip.js +191 -0
- package/dist/safe-bash/commands/bytes/compression/gunzip.js.map +1 -0
- package/dist/safe-bash/commands/bytes/compression/index.d.ts +3 -0
- package/dist/safe-bash/commands/bytes/compression/index.d.ts.map +1 -0
- package/dist/safe-bash/commands/bytes/compression/index.js +46 -0
- package/dist/safe-bash/commands/bytes/compression/index.js.map +1 -0
- package/dist/safe-bash/commands/bytes/compression/options.d.ts +12 -0
- package/dist/safe-bash/commands/bytes/compression/options.d.ts.map +1 -0
- package/dist/safe-bash/commands/bytes/compression/options.js +58 -0
- package/dist/safe-bash/commands/bytes/compression/options.js.map +1 -0
- package/dist/safe-bash/commands/bytes/compression/stream.d.ts +6 -0
- package/dist/safe-bash/commands/bytes/compression/stream.d.ts.map +1 -0
- package/dist/safe-bash/commands/bytes/compression/stream.js +94 -0
- package/dist/safe-bash/commands/bytes/compression/stream.js.map +1 -0
- package/dist/safe-bash/commands/bytes/encoding/base.d.ts +3 -0
- package/dist/safe-bash/commands/bytes/encoding/base.d.ts.map +1 -0
- package/dist/safe-bash/commands/bytes/encoding/base.js +120 -0
- package/dist/safe-bash/commands/bytes/encoding/base.js.map +1 -0
- package/dist/safe-bash/commands/bytes/encoding/index.d.ts +3 -0
- package/dist/safe-bash/commands/bytes/encoding/index.d.ts.map +1 -0
- package/dist/safe-bash/commands/bytes/encoding/index.js +7 -0
- package/dist/safe-bash/commands/bytes/encoding/index.js.map +1 -0
- package/dist/safe-bash/commands/bytes/encoding/od.d.ts +3 -0
- package/dist/safe-bash/commands/bytes/encoding/od.d.ts.map +1 -0
- package/dist/safe-bash/commands/bytes/encoding/od.js +135 -0
- package/dist/safe-bash/commands/bytes/encoding/od.js.map +1 -0
- package/dist/safe-bash/commands/bytes/encoding/shared.d.ts +10 -0
- package/dist/safe-bash/commands/bytes/encoding/shared.d.ts.map +1 -0
- package/dist/safe-bash/commands/bytes/encoding/shared.js +107 -0
- package/dist/safe-bash/commands/bytes/encoding/shared.js.map +1 -0
- package/dist/safe-bash/commands/bytes/encoding/xxd.d.ts +3 -0
- package/dist/safe-bash/commands/bytes/encoding/xxd.d.ts.map +1 -0
- package/dist/safe-bash/commands/bytes/encoding/xxd.js +153 -0
- package/dist/safe-bash/commands/bytes/encoding/xxd.js.map +1 -0
- package/dist/safe-bash/commands/bytes/index.d.ts +7 -0
- package/dist/safe-bash/commands/bytes/index.d.ts.map +1 -0
- package/dist/safe-bash/commands/bytes/index.js +22 -0
- package/dist/safe-bash/commands/bytes/index.js.map +1 -0
- package/dist/safe-bash/commands/column/column.d.ts +4 -0
- package/dist/safe-bash/commands/column/column.d.ts.map +1 -0
- package/dist/safe-bash/commands/column/column.js +141 -0
- package/dist/safe-bash/commands/column/column.js.map +1 -0
- package/dist/safe-bash/commands/column/display.d.ts +11 -0
- package/dist/safe-bash/commands/column/display.d.ts.map +1 -0
- package/dist/safe-bash/commands/column/display.js +74 -0
- package/dist/safe-bash/commands/column/display.js.map +1 -0
- package/dist/safe-bash/commands/column/index.d.ts +7 -0
- package/dist/safe-bash/commands/column/index.d.ts.map +1 -0
- package/dist/safe-bash/commands/column/index.js +18 -0
- package/dist/safe-bash/commands/column/index.js.map +1 -0
- package/dist/safe-bash/commands/column/internal.d.ts +35 -0
- package/dist/safe-bash/commands/column/internal.d.ts.map +1 -0
- package/dist/safe-bash/commands/column/internal.js +193 -0
- package/dist/safe-bash/commands/column/internal.js.map +1 -0
- package/dist/safe-bash/commands/column/options.d.ts +34 -0
- package/dist/safe-bash/commands/column/options.d.ts.map +1 -0
- package/dist/safe-bash/commands/column/options.js +141 -0
- package/dist/safe-bash/commands/column/options.js.map +1 -0
- package/dist/safe-bash/commands/column/table.d.ts +4 -0
- package/dist/safe-bash/commands/column/table.d.ts.map +1 -0
- package/dist/safe-bash/commands/column/table.js +87 -0
- package/dist/safe-bash/commands/column/table.js.map +1 -0
- package/dist/safe-bash/commands/copy-identity.d.ts +4 -0
- package/dist/safe-bash/commands/copy-identity.d.ts.map +1 -0
- package/dist/safe-bash/commands/copy-identity.js +46 -0
- package/dist/safe-bash/commands/copy-identity.js.map +1 -0
- package/dist/safe-bash/commands/diff-patch/diff-format.d.ts +9 -0
- package/dist/safe-bash/commands/diff-patch/diff-format.d.ts.map +1 -0
- package/dist/safe-bash/commands/diff-patch/diff-format.js +155 -0
- package/dist/safe-bash/commands/diff-patch/diff-format.js.map +1 -0
- package/dist/safe-bash/commands/diff-patch/diff.d.ts +3 -0
- package/dist/safe-bash/commands/diff-patch/diff.d.ts.map +1 -0
- package/dist/safe-bash/commands/diff-patch/diff.js +291 -0
- package/dist/safe-bash/commands/diff-patch/diff.js.map +1 -0
- package/dist/safe-bash/commands/diff-patch/index.d.ts +6 -0
- package/dist/safe-bash/commands/diff-patch/index.d.ts.map +1 -0
- package/dist/safe-bash/commands/diff-patch/index.js +21 -0
- package/dist/safe-bash/commands/diff-patch/index.js.map +1 -0
- package/dist/safe-bash/commands/diff-patch/patch-envelope.d.ts +3 -0
- package/dist/safe-bash/commands/diff-patch/patch-envelope.d.ts.map +1 -0
- package/dist/safe-bash/commands/diff-patch/patch-envelope.js +56 -0
- package/dist/safe-bash/commands/diff-patch/patch-envelope.js.map +1 -0
- package/dist/safe-bash/commands/diff-patch/patch-formats.d.ts +8 -0
- package/dist/safe-bash/commands/diff-patch/patch-formats.d.ts.map +1 -0
- package/dist/safe-bash/commands/diff-patch/patch-formats.js +247 -0
- package/dist/safe-bash/commands/diff-patch/patch-formats.js.map +1 -0
- package/dist/safe-bash/commands/diff-patch/patch-gnu-paths.d.ts +34 -0
- package/dist/safe-bash/commands/diff-patch/patch-gnu-paths.d.ts.map +1 -0
- package/dist/safe-bash/commands/diff-patch/patch-gnu-paths.js +215 -0
- package/dist/safe-bash/commands/diff-patch/patch-gnu-paths.js.map +1 -0
- package/dist/safe-bash/commands/diff-patch/patch-gnu-reject.d.ts +4 -0
- package/dist/safe-bash/commands/diff-patch/patch-gnu-reject.d.ts.map +1 -0
- package/dist/safe-bash/commands/diff-patch/patch-gnu-reject.js +89 -0
- package/dist/safe-bash/commands/diff-patch/patch-gnu-reject.js.map +1 -0
- package/dist/safe-bash/commands/diff-patch/patch-path.d.ts +4 -0
- package/dist/safe-bash/commands/diff-patch/patch-path.d.ts.map +1 -0
- package/dist/safe-bash/commands/diff-patch/patch-path.js +95 -0
- package/dist/safe-bash/commands/diff-patch/patch-path.js.map +1 -0
- package/dist/safe-bash/commands/diff-patch/patch.d.ts +3 -0
- package/dist/safe-bash/commands/diff-patch/patch.d.ts.map +1 -0
- package/dist/safe-bash/commands/diff-patch/patch.js +389 -0
- package/dist/safe-bash/commands/diff-patch/patch.js.map +1 -0
- package/dist/safe-bash/commands/diff-patch/shared.d.ts +42 -0
- package/dist/safe-bash/commands/diff-patch/shared.d.ts.map +1 -0
- package/dist/safe-bash/commands/diff-patch/shared.js +177 -0
- package/dist/safe-bash/commands/diff-patch/shared.js.map +1 -0
- package/dist/safe-bash/commands/diff-patch/unified.d.ts +50 -0
- package/dist/safe-bash/commands/diff-patch/unified.d.ts.map +1 -0
- package/dist/safe-bash/commands/diff-patch/unified.js +263 -0
- package/dist/safe-bash/commands/diff-patch/unified.js.map +1 -0
- package/dist/safe-bash/commands/du/arguments.d.ts +17 -0
- package/dist/safe-bash/commands/du/arguments.d.ts.map +1 -0
- package/dist/safe-bash/commands/du/arguments.js +164 -0
- package/dist/safe-bash/commands/du/arguments.js.map +1 -0
- package/dist/safe-bash/commands/du/budget.d.ts +37 -0
- package/dist/safe-bash/commands/du/budget.d.ts.map +1 -0
- package/dist/safe-bash/commands/du/budget.js +127 -0
- package/dist/safe-bash/commands/du/budget.js.map +1 -0
- package/dist/safe-bash/commands/du/du.d.ts +4 -0
- package/dist/safe-bash/commands/du/du.d.ts.map +1 -0
- package/dist/safe-bash/commands/du/du.js +205 -0
- package/dist/safe-bash/commands/du/du.js.map +1 -0
- package/dist/safe-bash/commands/du/format.d.ts +10 -0
- package/dist/safe-bash/commands/du/format.d.ts.map +1 -0
- package/dist/safe-bash/commands/du/format.js +54 -0
- package/dist/safe-bash/commands/du/format.js.map +1 -0
- package/dist/safe-bash/commands/du/index.d.ts +7 -0
- package/dist/safe-bash/commands/du/index.d.ts.map +1 -0
- package/dist/safe-bash/commands/du/index.js +19 -0
- package/dist/safe-bash/commands/du/index.js.map +1 -0
- package/dist/safe-bash/commands/du/options.d.ts +17 -0
- package/dist/safe-bash/commands/du/options.d.ts.map +1 -0
- package/dist/safe-bash/commands/du/options.js +14 -0
- package/dist/safe-bash/commands/du/options.js.map +1 -0
- package/dist/safe-bash/commands/env-split.d.ts +8 -0
- package/dist/safe-bash/commands/env-split.d.ts.map +1 -0
- package/dist/safe-bash/commands/env-split.js +343 -0
- package/dist/safe-bash/commands/env-split.js.map +1 -0
- package/dist/safe-bash/commands/execution.d.ts +4 -0
- package/dist/safe-bash/commands/execution.d.ts.map +1 -0
- package/dist/safe-bash/commands/execution.js +230 -0
- package/dist/safe-bash/commands/execution.js.map +1 -0
- package/dist/safe-bash/commands/expr/bre-worker.d.ts +3 -0
- package/dist/safe-bash/commands/expr/bre-worker.d.ts.map +1 -0
- package/dist/safe-bash/commands/expr/bre-worker.js +445 -0
- package/dist/safe-bash/commands/expr/bre-worker.js.map +1 -0
- package/dist/safe-bash/commands/expr/evaluate.d.ts +15 -0
- package/dist/safe-bash/commands/expr/evaluate.d.ts.map +1 -0
- package/dist/safe-bash/commands/expr/evaluate.js +150 -0
- package/dist/safe-bash/commands/expr/evaluate.js.map +1 -0
- package/dist/safe-bash/commands/expr/index.d.ts +7 -0
- package/dist/safe-bash/commands/expr/index.d.ts.map +1 -0
- package/dist/safe-bash/commands/expr/index.js +86 -0
- package/dist/safe-bash/commands/expr/index.js.map +1 -0
- package/dist/safe-bash/commands/expr/internal.d.ts +45 -0
- package/dist/safe-bash/commands/expr/internal.d.ts.map +1 -0
- package/dist/safe-bash/commands/expr/internal.js +145 -0
- package/dist/safe-bash/commands/expr/internal.js.map +1 -0
- package/dist/safe-bash/commands/expr/syntax.d.ts +4 -0
- package/dist/safe-bash/commands/expr/syntax.d.ts.map +1 -0
- package/dist/safe-bash/commands/expr/syntax.js +120 -0
- package/dist/safe-bash/commands/expr/syntax.js.map +1 -0
- package/dist/safe-bash/commands/file/classify.d.ts +8 -0
- package/dist/safe-bash/commands/file/classify.d.ts.map +1 -0
- package/dist/safe-bash/commands/file/classify.js +125 -0
- package/dist/safe-bash/commands/file/classify.js.map +1 -0
- package/dist/safe-bash/commands/file/index.d.ts +7 -0
- package/dist/safe-bash/commands/file/index.d.ts.map +1 -0
- package/dist/safe-bash/commands/file/index.js +257 -0
- package/dist/safe-bash/commands/file/index.js.map +1 -0
- package/dist/safe-bash/commands/file/shared.d.ts +48 -0
- package/dist/safe-bash/commands/file/shared.d.ts.map +1 -0
- package/dist/safe-bash/commands/file/shared.js +166 -0
- package/dist/safe-bash/commands/file/shared.js.map +1 -0
- package/dist/safe-bash/commands/filesystem.d.ts +3 -0
- package/dist/safe-bash/commands/filesystem.d.ts.map +1 -0
- package/dist/safe-bash/commands/filesystem.js +427 -0
- package/dist/safe-bash/commands/filesystem.js.map +1 -0
- package/dist/safe-bash/commands/find.d.ts +3 -0
- package/dist/safe-bash/commands/find.d.ts.map +1 -0
- package/dist/safe-bash/commands/find.js +238 -0
- package/dist/safe-bash/commands/find.js.map +1 -0
- package/dist/safe-bash/commands/git/arguments.d.ts +17 -0
- package/dist/safe-bash/commands/git/arguments.d.ts.map +1 -0
- package/dist/safe-bash/commands/git/arguments.js +150 -0
- package/dist/safe-bash/commands/git/arguments.js.map +1 -0
- package/dist/safe-bash/commands/git/codec.d.ts +8 -0
- package/dist/safe-bash/commands/git/codec.d.ts.map +1 -0
- package/dist/safe-bash/commands/git/codec.js +225 -0
- package/dist/safe-bash/commands/git/codec.js.map +1 -0
- package/dist/safe-bash/commands/git/config.d.ts +8 -0
- package/dist/safe-bash/commands/git/config.d.ts.map +1 -0
- package/dist/safe-bash/commands/git/config.js +100 -0
- package/dist/safe-bash/commands/git/config.js.map +1 -0
- package/dist/safe-bash/commands/git/crc.d.ts +3 -0
- package/dist/safe-bash/commands/git/crc.d.ts.map +1 -0
- package/dist/safe-bash/commands/git/crc.js +14 -0
- package/dist/safe-bash/commands/git/crc.js.map +1 -0
- package/dist/safe-bash/commands/git/delta.d.ts +4 -0
- package/dist/safe-bash/commands/git/delta.d.ts.map +1 -0
- package/dist/safe-bash/commands/git/delta.js +62 -0
- package/dist/safe-bash/commands/git/delta.js.map +1 -0
- package/dist/safe-bash/commands/git/diff.d.ts +9 -0
- package/dist/safe-bash/commands/git/diff.d.ts.map +1 -0
- package/dist/safe-bash/commands/git/diff.js +131 -0
- package/dist/safe-bash/commands/git/diff.js.map +1 -0
- package/dist/safe-bash/commands/git/ignore.d.ts +22 -0
- package/dist/safe-bash/commands/git/ignore.d.ts.map +1 -0
- package/dist/safe-bash/commands/git/ignore.js +153 -0
- package/dist/safe-bash/commands/git/ignore.js.map +1 -0
- package/dist/safe-bash/commands/git/index.d.ts +7 -0
- package/dist/safe-bash/commands/git/index.d.ts.map +1 -0
- package/dist/safe-bash/commands/git/index.js +66 -0
- package/dist/safe-bash/commands/git/index.js.map +1 -0
- package/dist/safe-bash/commands/git/io.d.ts +46 -0
- package/dist/safe-bash/commands/git/io.d.ts.map +1 -0
- package/dist/safe-bash/commands/git/io.js +388 -0
- package/dist/safe-bash/commands/git/io.js.map +1 -0
- package/dist/safe-bash/commands/git/limits.d.ts +39 -0
- package/dist/safe-bash/commands/git/limits.d.ts.map +1 -0
- package/dist/safe-bash/commands/git/limits.js +43 -0
- package/dist/safe-bash/commands/git/limits.js.map +1 -0
- package/dist/safe-bash/commands/git/pack.d.ts +14 -0
- package/dist/safe-bash/commands/git/pack.d.ts.map +1 -0
- package/dist/safe-bash/commands/git/pack.js +273 -0
- package/dist/safe-bash/commands/git/pack.js.map +1 -0
- package/dist/safe-bash/commands/git/queries.d.ts +6 -0
- package/dist/safe-bash/commands/git/queries.d.ts.map +1 -0
- package/dist/safe-bash/commands/git/queries.js +292 -0
- package/dist/safe-bash/commands/git/queries.js.map +1 -0
- package/dist/safe-bash/commands/git/repository.d.ts +49 -0
- package/dist/safe-bash/commands/git/repository.d.ts.map +1 -0
- package/dist/safe-bash/commands/git/repository.js +473 -0
- package/dist/safe-bash/commands/git/repository.js.map +1 -0
- package/dist/safe-bash/commands/grep-aliases/index.d.ts +11 -0
- package/dist/safe-bash/commands/grep-aliases/index.d.ts.map +1 -0
- package/dist/safe-bash/commands/grep-aliases/index.js +52 -0
- package/dist/safe-bash/commands/grep-aliases/index.js.map +1 -0
- package/dist/safe-bash/commands/grep.d.ts +4 -0
- package/dist/safe-bash/commands/grep.d.ts.map +1 -0
- package/dist/safe-bash/commands/grep.js +112 -0
- package/dist/safe-bash/commands/grep.js.map +1 -0
- package/dist/safe-bash/commands/html-to-markdown/budget.d.ts +34 -0
- package/dist/safe-bash/commands/html-to-markdown/budget.d.ts.map +1 -0
- package/dist/safe-bash/commands/html-to-markdown/budget.js +94 -0
- package/dist/safe-bash/commands/html-to-markdown/budget.js.map +1 -0
- package/dist/safe-bash/commands/html-to-markdown/entities.d.ts +5 -0
- package/dist/safe-bash/commands/html-to-markdown/entities.d.ts.map +1 -0
- package/dist/safe-bash/commands/html-to-markdown/entities.js +126 -0
- package/dist/safe-bash/commands/html-to-markdown/entities.js.map +1 -0
- package/dist/safe-bash/commands/html-to-markdown/index.d.ts +7 -0
- package/dist/safe-bash/commands/html-to-markdown/index.d.ts.map +1 -0
- package/dist/safe-bash/commands/html-to-markdown/index.js +91 -0
- package/dist/safe-bash/commands/html-to-markdown/index.js.map +1 -0
- package/dist/safe-bash/commands/html-to-markdown/input.d.ts +18 -0
- package/dist/safe-bash/commands/html-to-markdown/input.d.ts.map +1 -0
- package/dist/safe-bash/commands/html-to-markdown/input.js +118 -0
- package/dist/safe-bash/commands/html-to-markdown/input.js.map +1 -0
- package/dist/safe-bash/commands/html-to-markdown/options.d.ts +28 -0
- package/dist/safe-bash/commands/html-to-markdown/options.d.ts.map +1 -0
- package/dist/safe-bash/commands/html-to-markdown/options.js +56 -0
- package/dist/safe-bash/commands/html-to-markdown/options.js.map +1 -0
- package/dist/safe-bash/commands/html-to-markdown/parser.d.ts +31 -0
- package/dist/safe-bash/commands/html-to-markdown/parser.d.ts.map +1 -0
- package/dist/safe-bash/commands/html-to-markdown/parser.js +293 -0
- package/dist/safe-bash/commands/html-to-markdown/parser.js.map +1 -0
- package/dist/safe-bash/commands/html-to-markdown/render.d.ts +25 -0
- package/dist/safe-bash/commands/html-to-markdown/render.d.ts.map +1 -0
- package/dist/safe-bash/commands/html-to-markdown/render.js +445 -0
- package/dist/safe-bash/commands/html-to-markdown/render.js.map +1 -0
- package/dist/safe-bash/commands/html-to-markdown/text.d.ts +5 -0
- package/dist/safe-bash/commands/html-to-markdown/text.d.ts.map +1 -0
- package/dist/safe-bash/commands/html-to-markdown/text.js +51 -0
- package/dist/safe-bash/commands/html-to-markdown/text.js.map +1 -0
- package/dist/safe-bash/commands/index.d.ts +10 -0
- package/dist/safe-bash/commands/index.d.ts.map +1 -0
- package/dist/safe-bash/commands/index.js +45 -0
- package/dist/safe-bash/commands/index.js.map +1 -0
- package/dist/safe-bash/commands/internal.d.ts +38 -0
- package/dist/safe-bash/commands/internal.d.ts.map +1 -0
- package/dist/safe-bash/commands/internal.js +328 -0
- package/dist/safe-bash/commands/internal.js.map +1 -0
- package/dist/safe-bash/commands/metadata/chmod.d.ts +3 -0
- package/dist/safe-bash/commands/metadata/chmod.d.ts.map +1 -0
- package/dist/safe-bash/commands/metadata/chmod.js +144 -0
- package/dist/safe-bash/commands/metadata/chmod.js.map +1 -0
- package/dist/safe-bash/commands/metadata/index.d.ts +6 -0
- package/dist/safe-bash/commands/metadata/index.d.ts.map +1 -0
- package/dist/safe-bash/commands/metadata/index.js +20 -0
- package/dist/safe-bash/commands/metadata/index.js.map +1 -0
- package/dist/safe-bash/commands/metadata/internal.d.ts +29 -0
- package/dist/safe-bash/commands/metadata/internal.d.ts.map +1 -0
- package/dist/safe-bash/commands/metadata/internal.js +67 -0
- package/dist/safe-bash/commands/metadata/internal.js.map +1 -0
- package/dist/safe-bash/commands/metadata/mktemp.d.ts +3 -0
- package/dist/safe-bash/commands/metadata/mktemp.d.ts.map +1 -0
- package/dist/safe-bash/commands/metadata/mktemp.js +142 -0
- package/dist/safe-bash/commands/metadata/mktemp.js.map +1 -0
- package/dist/safe-bash/commands/metadata/stat.d.ts +3 -0
- package/dist/safe-bash/commands/metadata/stat.d.ts.map +1 -0
- package/dist/safe-bash/commands/metadata/stat.js +245 -0
- package/dist/safe-bash/commands/metadata/stat.js.map +1 -0
- package/dist/safe-bash/commands/move.d.ts +10 -0
- package/dist/safe-bash/commands/move.d.ts.map +1 -0
- package/dist/safe-bash/commands/move.js +161 -0
- package/dist/safe-bash/commands/move.js.map +1 -0
- package/dist/safe-bash/commands/network/args.d.ts +37 -0
- package/dist/safe-bash/commands/network/args.d.ts.map +1 -0
- package/dist/safe-bash/commands/network/args.js +228 -0
- package/dist/safe-bash/commands/network/args.js.map +1 -0
- package/dist/safe-bash/commands/network/body.d.ts +10 -0
- package/dist/safe-bash/commands/network/body.d.ts.map +1 -0
- package/dist/safe-bash/commands/network/body.js +188 -0
- package/dist/safe-bash/commands/network/body.js.map +1 -0
- package/dist/safe-bash/commands/network/curl.d.ts +4 -0
- package/dist/safe-bash/commands/network/curl.d.ts.map +1 -0
- package/dist/safe-bash/commands/network/curl.js +404 -0
- package/dist/safe-bash/commands/network/curl.js.map +1 -0
- package/dist/safe-bash/commands/network/index.d.ts +10 -0
- package/dist/safe-bash/commands/network/index.d.ts.map +1 -0
- package/dist/safe-bash/commands/network/index.js +22 -0
- package/dist/safe-bash/commands/network/index.js.map +1 -0
- package/dist/safe-bash/commands/network/output.d.ts +7 -0
- package/dist/safe-bash/commands/network/output.d.ts.map +1 -0
- package/dist/safe-bash/commands/network/output.js +93 -0
- package/dist/safe-bash/commands/network/output.js.map +1 -0
- package/dist/safe-bash/commands/network/shared.d.ts +10 -0
- package/dist/safe-bash/commands/network/shared.d.ts.map +1 -0
- package/dist/safe-bash/commands/network/shared.js +52 -0
- package/dist/safe-bash/commands/network/shared.js.map +1 -0
- package/dist/safe-bash/commands/network/transport.d.ts +7 -0
- package/dist/safe-bash/commands/network/transport.d.ts.map +1 -0
- package/dist/safe-bash/commands/network/transport.js +81 -0
- package/dist/safe-bash/commands/network/transport.js.map +1 -0
- package/dist/safe-bash/commands/network/types.d.ts +49 -0
- package/dist/safe-bash/commands/network/types.d.ts.map +1 -0
- package/dist/safe-bash/commands/network/types.js +19 -0
- package/dist/safe-bash/commands/network/types.js.map +1 -0
- package/dist/safe-bash/commands/node/admission.d.ts +8 -0
- package/dist/safe-bash/commands/node/admission.d.ts.map +1 -0
- package/dist/safe-bash/commands/node/admission.js +557 -0
- package/dist/safe-bash/commands/node/admission.js.map +1 -0
- package/dist/safe-bash/commands/node/channel.d.ts +31 -0
- package/dist/safe-bash/commands/node/channel.d.ts.map +1 -0
- package/dist/safe-bash/commands/node/channel.js +58 -0
- package/dist/safe-bash/commands/node/channel.js.map +1 -0
- package/dist/safe-bash/commands/node/cli.d.ts +9 -0
- package/dist/safe-bash/commands/node/cli.d.ts.map +1 -0
- package/dist/safe-bash/commands/node/cli.js +55 -0
- package/dist/safe-bash/commands/node/cli.js.map +1 -0
- package/dist/safe-bash/commands/node/diagnostics.d.ts +8 -0
- package/dist/safe-bash/commands/node/diagnostics.d.ts.map +1 -0
- package/dist/safe-bash/commands/node/diagnostics.js +48 -0
- package/dist/safe-bash/commands/node/diagnostics.js.map +1 -0
- package/dist/safe-bash/commands/node/host.d.ts +30 -0
- package/dist/safe-bash/commands/node/host.d.ts.map +1 -0
- package/dist/safe-bash/commands/node/host.js +411 -0
- package/dist/safe-bash/commands/node/host.js.map +1 -0
- package/dist/safe-bash/commands/node/index.d.ts +15 -0
- package/dist/safe-bash/commands/node/index.d.ts.map +1 -0
- package/dist/safe-bash/commands/node/index.js +212 -0
- package/dist/safe-bash/commands/node/index.js.map +1 -0
- package/dist/safe-bash/commands/node/lifecycle.d.ts +29 -0
- package/dist/safe-bash/commands/node/lifecycle.d.ts.map +1 -0
- package/dist/safe-bash/commands/node/lifecycle.js +205 -0
- package/dist/safe-bash/commands/node/lifecycle.js.map +1 -0
- package/dist/safe-bash/commands/node/lower.d.ts +3 -0
- package/dist/safe-bash/commands/node/lower.d.ts.map +1 -0
- package/dist/safe-bash/commands/node/lower.js +407 -0
- package/dist/safe-bash/commands/node/lower.js.map +1 -0
- package/dist/safe-bash/commands/node/program.d.ts +3 -0
- package/dist/safe-bash/commands/node/program.d.ts.map +1 -0
- package/dist/safe-bash/commands/node/program.js +216 -0
- package/dist/safe-bash/commands/node/program.js.map +1 -0
- package/dist/safe-bash/commands/node/rules.d.ts +2 -0
- package/dist/safe-bash/commands/node/rules.d.ts.map +1 -0
- package/dist/safe-bash/commands/node/rules.js +134 -0
- package/dist/safe-bash/commands/node/rules.js.map +1 -0
- package/dist/safe-bash/commands/node/safejs.d.ts +4 -0
- package/dist/safe-bash/commands/node/safejs.d.ts.map +1 -0
- package/dist/safe-bash/commands/node/safejs.js +79 -0
- package/dist/safe-bash/commands/node/safejs.js.map +1 -0
- package/dist/safe-bash/commands/node/types.d.ts +143 -0
- package/dist/safe-bash/commands/node/types.d.ts.map +1 -0
- package/dist/safe-bash/commands/node/types.js +16 -0
- package/dist/safe-bash/commands/node/types.js.map +1 -0
- package/dist/safe-bash/commands/node/values.d.ts +13 -0
- package/dist/safe-bash/commands/node/values.d.ts.map +1 -0
- package/dist/safe-bash/commands/node/values.js +128 -0
- package/dist/safe-bash/commands/node/values.js.map +1 -0
- package/dist/safe-bash/commands/node/worker-main.d.ts +2 -0
- package/dist/safe-bash/commands/node/worker-main.d.ts.map +1 -0
- package/dist/safe-bash/commands/node/worker-main.js +179 -0
- package/dist/safe-bash/commands/node/worker-main.js.map +1 -0
- package/dist/safe-bash/commands/node/worker-provider.d.ts +4 -0
- package/dist/safe-bash/commands/node/worker-provider.d.ts.map +1 -0
- package/dist/safe-bash/commands/node/worker-provider.js +355 -0
- package/dist/safe-bash/commands/node/worker-provider.js.map +1 -0
- package/dist/safe-bash/commands/node/worker-types.d.ts +30 -0
- package/dist/safe-bash/commands/node/worker-types.d.ts.map +1 -0
- package/dist/safe-bash/commands/node/worker-types.js +2 -0
- package/dist/safe-bash/commands/node/worker-types.js.map +1 -0
- package/dist/safe-bash/commands/predicates.d.ts +3 -0
- package/dist/safe-bash/commands/predicates.d.ts.map +1 -0
- package/dist/safe-bash/commands/predicates.js +151 -0
- package/dist/safe-bash/commands/predicates.js.map +1 -0
- package/dist/safe-bash/commands/regex-execution/client.d.ts +70 -0
- package/dist/safe-bash/commands/regex-execution/client.d.ts.map +1 -0
- package/dist/safe-bash/commands/regex-execution/client.js +385 -0
- package/dist/safe-bash/commands/regex-execution/client.js.map +1 -0
- package/dist/safe-bash/commands/regex-execution/ere/errors.d.ts +22 -0
- package/dist/safe-bash/commands/regex-execution/ere/errors.d.ts.map +1 -0
- package/dist/safe-bash/commands/regex-execution/ere/errors.js +37 -0
- package/dist/safe-bash/commands/regex-execution/ere/errors.js.map +1 -0
- package/dist/safe-bash/commands/regex-execution/ere/limits.d.ts +14 -0
- package/dist/safe-bash/commands/regex-execution/ere/limits.d.ts.map +1 -0
- package/dist/safe-bash/commands/regex-execution/ere/limits.js +87 -0
- package/dist/safe-bash/commands/regex-execution/ere/limits.js.map +1 -0
- package/dist/safe-bash/commands/regex-execution/ere/matcher.d.ts +4 -0
- package/dist/safe-bash/commands/regex-execution/ere/matcher.d.ts.map +1 -0
- package/dist/safe-bash/commands/regex-execution/ere/matcher.js +202 -0
- package/dist/safe-bash/commands/regex-execution/ere/matcher.js.map +1 -0
- package/dist/safe-bash/commands/regex-execution/ere/syntax.d.ts +6 -0
- package/dist/safe-bash/commands/regex-execution/ere/syntax.d.ts.map +1 -0
- package/dist/safe-bash/commands/regex-execution/ere/syntax.js +291 -0
- package/dist/safe-bash/commands/regex-execution/ere/syntax.js.map +1 -0
- package/dist/safe-bash/commands/regex-execution/ere/transport/accounting.d.ts +54 -0
- package/dist/safe-bash/commands/regex-execution/ere/transport/accounting.d.ts.map +1 -0
- package/dist/safe-bash/commands/regex-execution/ere/transport/accounting.js +175 -0
- package/dist/safe-bash/commands/regex-execution/ere/transport/accounting.js.map +1 -0
- package/dist/safe-bash/commands/regex-execution/ere/transport/owner.d.ts +15 -0
- package/dist/safe-bash/commands/regex-execution/ere/transport/owner.d.ts.map +1 -0
- package/dist/safe-bash/commands/regex-execution/ere/transport/owner.js +253 -0
- package/dist/safe-bash/commands/regex-execution/ere/transport/owner.js.map +1 -0
- package/dist/safe-bash/commands/regex-execution/ere/transport/protocol.d.ts +68 -0
- package/dist/safe-bash/commands/regex-execution/ere/transport/protocol.d.ts.map +1 -0
- package/dist/safe-bash/commands/regex-execution/ere/transport/protocol.js +35 -0
- package/dist/safe-bash/commands/regex-execution/ere/transport/protocol.js.map +1 -0
- package/dist/safe-bash/commands/regex-execution/ere/transport/root.d.ts +15 -0
- package/dist/safe-bash/commands/regex-execution/ere/transport/root.d.ts.map +1 -0
- package/dist/safe-bash/commands/regex-execution/ere/transport/root.js +372 -0
- package/dist/safe-bash/commands/regex-execution/ere/transport/root.js.map +1 -0
- package/dist/safe-bash/commands/regex-execution/ere/transport/validation.d.ts +22 -0
- package/dist/safe-bash/commands/regex-execution/ere/transport/validation.d.ts.map +1 -0
- package/dist/safe-bash/commands/regex-execution/ere/transport/validation.js +286 -0
- package/dist/safe-bash/commands/regex-execution/ere/transport/validation.js.map +1 -0
- package/dist/safe-bash/commands/regex-execution/ere/transport/wire-engine.d.ts +3 -0
- package/dist/safe-bash/commands/regex-execution/ere/transport/wire-engine.d.ts.map +1 -0
- package/dist/safe-bash/commands/regex-execution/ere/transport/wire-engine.js +47 -0
- package/dist/safe-bash/commands/regex-execution/ere/transport/wire-engine.js.map +1 -0
- package/dist/safe-bash/commands/regex-execution/ere/transport/worker-entry.d.ts +2 -0
- package/dist/safe-bash/commands/regex-execution/ere/transport/worker-entry.d.ts.map +1 -0
- package/dist/safe-bash/commands/regex-execution/ere/transport/worker-entry.js +32 -0
- package/dist/safe-bash/commands/regex-execution/ere/transport/worker-entry.js.map +1 -0
- package/dist/safe-bash/commands/regex-execution/ere/types.d.ts +56 -0
- package/dist/safe-bash/commands/regex-execution/ere/types.d.ts.map +1 -0
- package/dist/safe-bash/commands/regex-execution/ere/types.js +2 -0
- package/dist/safe-bash/commands/regex-execution/ere/types.js.map +1 -0
- package/dist/safe-bash/commands/regex-execution/matching.d.ts +3 -0
- package/dist/safe-bash/commands/regex-execution/matching.d.ts.map +1 -0
- package/dist/safe-bash/commands/regex-execution/matching.js +321 -0
- package/dist/safe-bash/commands/regex-execution/matching.js.map +1 -0
- package/dist/safe-bash/commands/regex-execution/protocol.d.ts +116 -0
- package/dist/safe-bash/commands/regex-execution/protocol.d.ts.map +1 -0
- package/dist/safe-bash/commands/regex-execution/protocol.js +159 -0
- package/dist/safe-bash/commands/regex-execution/protocol.js.map +1 -0
- package/dist/safe-bash/commands/regex-execution/worker.d.ts +2 -0
- package/dist/safe-bash/commands/regex-execution/worker.d.ts.map +1 -0
- package/dist/safe-bash/commands/regex-execution/worker.js +52 -0
- package/dist/safe-bash/commands/regex-execution/worker.js.map +1 -0
- package/dist/safe-bash/commands/safejs/index.d.ts +18 -0
- package/dist/safe-bash/commands/safejs/index.d.ts.map +1 -0
- package/dist/safe-bash/commands/safejs/index.js +184 -0
- package/dist/safe-bash/commands/safejs/index.js.map +1 -0
- package/dist/safe-bash/commands/safejs/io.d.ts +36 -0
- package/dist/safe-bash/commands/safejs/io.d.ts.map +1 -0
- package/dist/safe-bash/commands/safejs/io.js +127 -0
- package/dist/safe-bash/commands/safejs/io.js.map +1 -0
- package/dist/safe-bash/commands/safejs/options.d.ts +12 -0
- package/dist/safe-bash/commands/safejs/options.d.ts.map +1 -0
- package/dist/safe-bash/commands/safejs/options.js +46 -0
- package/dist/safe-bash/commands/safejs/options.js.map +1 -0
- package/dist/safe-bash/commands/safejs/render.d.ts +2 -0
- package/dist/safe-bash/commands/safejs/render.d.ts.map +1 -0
- package/dist/safe-bash/commands/safejs/render.js +100 -0
- package/dist/safe-bash/commands/safejs/render.js.map +1 -0
- package/dist/safe-bash/commands/safejs/types.d.ts +64 -0
- package/dist/safe-bash/commands/safejs/types.d.ts.map +1 -0
- package/dist/safe-bash/commands/safejs/types.js +10 -0
- package/dist/safe-bash/commands/safejs/types.js.map +1 -0
- package/dist/safe-bash/commands/search/glob.d.ts +21 -0
- package/dist/safe-bash/commands/search/glob.d.ts.map +1 -0
- package/dist/safe-bash/commands/search/glob.js +79 -0
- package/dist/safe-bash/commands/search/glob.js.map +1 -0
- package/dist/safe-bash/commands/search/index.d.ts +6 -0
- package/dist/safe-bash/commands/search/index.d.ts.map +1 -0
- package/dist/safe-bash/commands/search/index.js +20 -0
- package/dist/safe-bash/commands/search/index.js.map +1 -0
- package/dist/safe-bash/commands/search/matcher.d.ts +12 -0
- package/dist/safe-bash/commands/search/matcher.d.ts.map +1 -0
- package/dist/safe-bash/commands/search/matcher.js +24 -0
- package/dist/safe-bash/commands/search/matcher.js.map +1 -0
- package/dist/safe-bash/commands/search/options.d.ts +56 -0
- package/dist/safe-bash/commands/search/options.d.ts.map +1 -0
- package/dist/safe-bash/commands/search/options.js +307 -0
- package/dist/safe-bash/commands/search/options.js.map +1 -0
- package/dist/safe-bash/commands/search/output.d.ts +37 -0
- package/dist/safe-bash/commands/search/output.d.ts.map +1 -0
- package/dist/safe-bash/commands/search/output.js +63 -0
- package/dist/safe-bash/commands/search/output.js.map +1 -0
- package/dist/safe-bash/commands/search/rg.d.ts +4 -0
- package/dist/safe-bash/commands/search/rg.d.ts.map +1 -0
- package/dist/safe-bash/commands/search/rg.js +219 -0
- package/dist/safe-bash/commands/search/rg.js.map +1 -0
- package/dist/safe-bash/commands/search/shared.d.ts +37 -0
- package/dist/safe-bash/commands/search/shared.d.ts.map +1 -0
- package/dist/safe-bash/commands/search/shared.js +111 -0
- package/dist/safe-bash/commands/search/shared.js.map +1 -0
- package/dist/safe-bash/commands/search/walk.d.ts +28 -0
- package/dist/safe-bash/commands/search/walk.d.ts.map +1 -0
- package/dist/safe-bash/commands/search/walk.js +201 -0
- package/dist/safe-bash/commands/search/walk.js.map +1 -0
- package/dist/safe-bash/commands/split/index.d.ts +6 -0
- package/dist/safe-bash/commands/split/index.d.ts.map +1 -0
- package/dist/safe-bash/commands/split/index.js +18 -0
- package/dist/safe-bash/commands/split/index.js.map +1 -0
- package/dist/safe-bash/commands/split/io.d.ts +28 -0
- package/dist/safe-bash/commands/split/io.d.ts.map +1 -0
- package/dist/safe-bash/commands/split/io.js +101 -0
- package/dist/safe-bash/commands/split/io.js.map +1 -0
- package/dist/safe-bash/commands/split/names.d.ts +11 -0
- package/dist/safe-bash/commands/split/names.d.ts.map +1 -0
- package/dist/safe-bash/commands/split/names.js +42 -0
- package/dist/safe-bash/commands/split/names.js.map +1 -0
- package/dist/safe-bash/commands/split/options.d.ts +28 -0
- package/dist/safe-bash/commands/split/options.d.ts.map +1 -0
- package/dist/safe-bash/commands/split/options.js +130 -0
- package/dist/safe-bash/commands/split/options.js.map +1 -0
- package/dist/safe-bash/commands/split/outputs.d.ts +19 -0
- package/dist/safe-bash/commands/split/outputs.d.ts.map +1 -0
- package/dist/safe-bash/commands/split/outputs.js +105 -0
- package/dist/safe-bash/commands/split/outputs.js.map +1 -0
- package/dist/safe-bash/commands/split/split.d.ts +4 -0
- package/dist/safe-bash/commands/split/split.d.ts.map +1 -0
- package/dist/safe-bash/commands/split/split.js +146 -0
- package/dist/safe-bash/commands/split/split.js.map +1 -0
- package/dist/safe-bash/commands/stream-format/index.d.ts +6 -0
- package/dist/safe-bash/commands/stream-format/index.d.ts.map +1 -0
- package/dist/safe-bash/commands/stream-format/index.js +22 -0
- package/dist/safe-bash/commands/stream-format/index.js.map +1 -0
- package/dist/safe-bash/commands/stream-format/nl.d.ts +4 -0
- package/dist/safe-bash/commands/stream-format/nl.d.ts.map +1 -0
- package/dist/safe-bash/commands/stream-format/nl.js +96 -0
- package/dist/safe-bash/commands/stream-format/nl.js.map +1 -0
- package/dist/safe-bash/commands/stream-format/rev.d.ts +4 -0
- package/dist/safe-bash/commands/stream-format/rev.d.ts.map +1 -0
- package/dist/safe-bash/commands/stream-format/rev.js +65 -0
- package/dist/safe-bash/commands/stream-format/rev.js.map +1 -0
- package/dist/safe-bash/commands/stream-format/seq.d.ts +4 -0
- package/dist/safe-bash/commands/stream-format/seq.d.ts.map +1 -0
- package/dist/safe-bash/commands/stream-format/seq.js +249 -0
- package/dist/safe-bash/commands/stream-format/seq.js.map +1 -0
- package/dist/safe-bash/commands/stream-format/shared.d.ts +49 -0
- package/dist/safe-bash/commands/stream-format/shared.d.ts.map +1 -0
- package/dist/safe-bash/commands/stream-format/shared.js +209 -0
- package/dist/safe-bash/commands/stream-format/shared.js.map +1 -0
- package/dist/safe-bash/commands/stream-format/unexpand.d.ts +4 -0
- package/dist/safe-bash/commands/stream-format/unexpand.d.ts.map +1 -0
- package/dist/safe-bash/commands/stream-format/unexpand.js +130 -0
- package/dist/safe-bash/commands/stream-format/unexpand.js.map +1 -0
- package/dist/safe-bash/commands/stream-inspection/expand.d.ts +4 -0
- package/dist/safe-bash/commands/stream-inspection/expand.d.ts.map +1 -0
- package/dist/safe-bash/commands/stream-inspection/expand.js +100 -0
- package/dist/safe-bash/commands/stream-inspection/expand.js.map +1 -0
- package/dist/safe-bash/commands/stream-inspection/fold.d.ts +4 -0
- package/dist/safe-bash/commands/stream-inspection/fold.d.ts.map +1 -0
- package/dist/safe-bash/commands/stream-inspection/fold.js +55 -0
- package/dist/safe-bash/commands/stream-inspection/fold.js.map +1 -0
- package/dist/safe-bash/commands/stream-inspection/index.d.ts +6 -0
- package/dist/safe-bash/commands/stream-inspection/index.d.ts.map +1 -0
- package/dist/safe-bash/commands/stream-inspection/index.js +22 -0
- package/dist/safe-bash/commands/stream-inspection/index.js.map +1 -0
- package/dist/safe-bash/commands/stream-inspection/numeric-options.d.ts +5 -0
- package/dist/safe-bash/commands/stream-inspection/numeric-options.d.ts.map +1 -0
- package/dist/safe-bash/commands/stream-inspection/numeric-options.js +53 -0
- package/dist/safe-bash/commands/stream-inspection/numeric-options.js.map +1 -0
- package/dist/safe-bash/commands/stream-inspection/shared.d.ts +55 -0
- package/dist/safe-bash/commands/stream-inspection/shared.d.ts.map +1 -0
- package/dist/safe-bash/commands/stream-inspection/shared.js +202 -0
- package/dist/safe-bash/commands/stream-inspection/shared.js.map +1 -0
- package/dist/safe-bash/commands/stream-inspection/strings.d.ts +4 -0
- package/dist/safe-bash/commands/stream-inspection/strings.d.ts.map +1 -0
- package/dist/safe-bash/commands/stream-inspection/strings.js +54 -0
- package/dist/safe-bash/commands/stream-inspection/strings.js.map +1 -0
- package/dist/safe-bash/commands/stream-inspection/tac.d.ts +4 -0
- package/dist/safe-bash/commands/stream-inspection/tac.d.ts.map +1 -0
- package/dist/safe-bash/commands/stream-inspection/tac.js +54 -0
- package/dist/safe-bash/commands/stream-inspection/tac.js.map +1 -0
- package/dist/safe-bash/commands/streams.d.ts +3 -0
- package/dist/safe-bash/commands/streams.d.ts.map +1 -0
- package/dist/safe-bash/commands/streams.js +477 -0
- package/dist/safe-bash/commands/streams.js.map +1 -0
- package/dist/safe-bash/commands/structured/index.d.ts +7 -0
- package/dist/safe-bash/commands/structured/index.d.ts.map +1 -0
- package/dist/safe-bash/commands/structured/index.js +21 -0
- package/dist/safe-bash/commands/structured/index.js.map +1 -0
- package/dist/safe-bash/commands/structured/input.d.ts +18 -0
- package/dist/safe-bash/commands/structured/input.d.ts.map +1 -0
- package/dist/safe-bash/commands/structured/input.js +438 -0
- package/dist/safe-bash/commands/structured/input.js.map +1 -0
- package/dist/safe-bash/commands/structured/interpreter.d.ts +21 -0
- package/dist/safe-bash/commands/structured/interpreter.d.ts.map +1 -0
- package/dist/safe-bash/commands/structured/interpreter.js +644 -0
- package/dist/safe-bash/commands/structured/interpreter.js.map +1 -0
- package/dist/safe-bash/commands/structured/jq.d.ts +4 -0
- package/dist/safe-bash/commands/structured/jq.d.ts.map +1 -0
- package/dist/safe-bash/commands/structured/jq.js +278 -0
- package/dist/safe-bash/commands/structured/jq.js.map +1 -0
- package/dist/safe-bash/commands/structured/limits.d.ts +61 -0
- package/dist/safe-bash/commands/structured/limits.d.ts.map +1 -0
- package/dist/safe-bash/commands/structured/limits.js +162 -0
- package/dist/safe-bash/commands/structured/limits.js.map +1 -0
- package/dist/safe-bash/commands/structured/numbers.d.ts +17 -0
- package/dist/safe-bash/commands/structured/numbers.d.ts.map +1 -0
- package/dist/safe-bash/commands/structured/numbers.js +143 -0
- package/dist/safe-bash/commands/structured/numbers.js.map +1 -0
- package/dist/safe-bash/commands/structured/parser.d.ts +54 -0
- package/dist/safe-bash/commands/structured/parser.d.ts.map +1 -0
- package/dist/safe-bash/commands/structured/parser.js +320 -0
- package/dist/safe-bash/commands/structured/parser.js.map +1 -0
- package/dist/safe-bash/commands/structured/split.d.ts +3 -0
- package/dist/safe-bash/commands/structured/split.d.ts.map +1 -0
- package/dist/safe-bash/commands/structured/split.js +65 -0
- package/dist/safe-bash/commands/structured/split.js.map +1 -0
- package/dist/safe-bash/commands/structured/values.d.ts +12 -0
- package/dist/safe-bash/commands/structured/values.d.ts.map +1 -0
- package/dist/safe-bash/commands/structured/values.js +213 -0
- package/dist/safe-bash/commands/structured/values.js.map +1 -0
- package/dist/safe-bash/commands/table-text/comm.d.ts +4 -0
- package/dist/safe-bash/commands/table-text/comm.d.ts.map +1 -0
- package/dist/safe-bash/commands/table-text/comm.js +101 -0
- package/dist/safe-bash/commands/table-text/comm.js.map +1 -0
- package/dist/safe-bash/commands/table-text/index.d.ts +6 -0
- package/dist/safe-bash/commands/table-text/index.d.ts.map +1 -0
- package/dist/safe-bash/commands/table-text/index.js +21 -0
- package/dist/safe-bash/commands/table-text/index.js.map +1 -0
- package/dist/safe-bash/commands/table-text/internal.d.ts +73 -0
- package/dist/safe-bash/commands/table-text/internal.d.ts.map +1 -0
- package/dist/safe-bash/commands/table-text/internal.js +223 -0
- package/dist/safe-bash/commands/table-text/internal.js.map +1 -0
- package/dist/safe-bash/commands/table-text/join.d.ts +4 -0
- package/dist/safe-bash/commands/table-text/join.d.ts.map +1 -0
- package/dist/safe-bash/commands/table-text/join.js +252 -0
- package/dist/safe-bash/commands/table-text/join.js.map +1 -0
- package/dist/safe-bash/commands/table-text/paste.d.ts +4 -0
- package/dist/safe-bash/commands/table-text/paste.d.ts.map +1 -0
- package/dist/safe-bash/commands/table-text/paste.js +125 -0
- package/dist/safe-bash/commands/table-text/paste.js.map +1 -0
- package/dist/safe-bash/commands/text-programs/awk-runtime.d.ts +45 -0
- package/dist/safe-bash/commands/text-programs/awk-runtime.d.ts.map +1 -0
- package/dist/safe-bash/commands/text-programs/awk-runtime.js +679 -0
- package/dist/safe-bash/commands/text-programs/awk-runtime.js.map +1 -0
- package/dist/safe-bash/commands/text-programs/awk-syntax.d.ts +141 -0
- package/dist/safe-bash/commands/text-programs/awk-syntax.d.ts.map +1 -0
- package/dist/safe-bash/commands/text-programs/awk-syntax.js +495 -0
- package/dist/safe-bash/commands/text-programs/awk-syntax.js.map +1 -0
- package/dist/safe-bash/commands/text-programs/awk-values.d.ts +29 -0
- package/dist/safe-bash/commands/text-programs/awk-values.d.ts.map +1 -0
- package/dist/safe-bash/commands/text-programs/awk-values.js +155 -0
- package/dist/safe-bash/commands/text-programs/awk-values.js.map +1 -0
- package/dist/safe-bash/commands/text-programs/awk.d.ts +4 -0
- package/dist/safe-bash/commands/text-programs/awk.d.ts.map +1 -0
- package/dist/safe-bash/commands/text-programs/awk.js +45 -0
- package/dist/safe-bash/commands/text-programs/awk.js.map +1 -0
- package/dist/safe-bash/commands/text-programs/index.d.ts +6 -0
- package/dist/safe-bash/commands/text-programs/index.d.ts.map +1 -0
- package/dist/safe-bash/commands/text-programs/index.js +21 -0
- package/dist/safe-bash/commands/text-programs/index.js.map +1 -0
- package/dist/safe-bash/commands/text-programs/regex.d.ts +19 -0
- package/dist/safe-bash/commands/text-programs/regex.d.ts.map +1 -0
- package/dist/safe-bash/commands/text-programs/regex.js +387 -0
- package/dist/safe-bash/commands/text-programs/regex.js.map +1 -0
- package/dist/safe-bash/commands/text-programs/sed.d.ts +4 -0
- package/dist/safe-bash/commands/text-programs/sed.d.ts.map +1 -0
- package/dist/safe-bash/commands/text-programs/sed.js +602 -0
- package/dist/safe-bash/commands/text-programs/sed.js.map +1 -0
- package/dist/safe-bash/commands/text-programs/shared.d.ts +33 -0
- package/dist/safe-bash/commands/text-programs/shared.d.ts.map +1 -0
- package/dist/safe-bash/commands/text-programs/shared.js +102 -0
- package/dist/safe-bash/commands/text-programs/shared.js.map +1 -0
- package/dist/safe-bash/commands/text.d.ts +3 -0
- package/dist/safe-bash/commands/text.d.ts.map +1 -0
- package/dist/safe-bash/commands/text.js +428 -0
- package/dist/safe-bash/commands/text.js.map +1 -0
- package/dist/safe-bash/commands/time-env/calendar.d.ts +30 -0
- package/dist/safe-bash/commands/time-env/calendar.d.ts.map +1 -0
- package/dist/safe-bash/commands/time-env/calendar.js +184 -0
- package/dist/safe-bash/commands/time-env/calendar.js.map +1 -0
- package/dist/safe-bash/commands/time-env/date.d.ts +3 -0
- package/dist/safe-bash/commands/time-env/date.d.ts.map +1 -0
- package/dist/safe-bash/commands/time-env/date.js +149 -0
- package/dist/safe-bash/commands/time-env/date.js.map +1 -0
- package/dist/safe-bash/commands/time-env/format.d.ts +4 -0
- package/dist/safe-bash/commands/time-env/format.d.ts.map +1 -0
- package/dist/safe-bash/commands/time-env/format.js +247 -0
- package/dist/safe-bash/commands/time-env/format.js.map +1 -0
- package/dist/safe-bash/commands/time-env/index.d.ts +6 -0
- package/dist/safe-bash/commands/time-env/index.d.ts.map +1 -0
- package/dist/safe-bash/commands/time-env/index.js +21 -0
- package/dist/safe-bash/commands/time-env/index.js.map +1 -0
- package/dist/safe-bash/commands/time-env/printenv.d.ts +3 -0
- package/dist/safe-bash/commands/time-env/printenv.d.ts.map +1 -0
- package/dist/safe-bash/commands/time-env/printenv.js +59 -0
- package/dist/safe-bash/commands/time-env/printenv.js.map +1 -0
- package/dist/safe-bash/commands/time-env/shared.d.ts +38 -0
- package/dist/safe-bash/commands/time-env/shared.d.ts.map +1 -0
- package/dist/safe-bash/commands/time-env/shared.js +68 -0
- package/dist/safe-bash/commands/time-env/shared.js.map +1 -0
- package/dist/safe-bash/commands/time-env/sleep.d.ts +3 -0
- package/dist/safe-bash/commands/time-env/sleep.d.ts.map +1 -0
- package/dist/safe-bash/commands/time-env/sleep.js +150 -0
- package/dist/safe-bash/commands/time-env/sleep.js.map +1 -0
- package/dist/safe-bash/commands/timeout/duration.d.ts +10 -0
- package/dist/safe-bash/commands/timeout/duration.d.ts.map +1 -0
- package/dist/safe-bash/commands/timeout/duration.js +82 -0
- package/dist/safe-bash/commands/timeout/duration.js.map +1 -0
- package/dist/safe-bash/commands/timeout/index.d.ts +18 -0
- package/dist/safe-bash/commands/timeout/index.d.ts.map +1 -0
- package/dist/safe-bash/commands/timeout/index.js +218 -0
- package/dist/safe-bash/commands/timeout/index.js.map +1 -0
- package/dist/safe-bash/commands/timeout/scheduler.d.ts +17 -0
- package/dist/safe-bash/commands/timeout/scheduler.d.ts.map +1 -0
- package/dist/safe-bash/commands/timeout/scheduler.js +110 -0
- package/dist/safe-bash/commands/timeout/scheduler.js.map +1 -0
- package/dist/safe-bash/commands/tree/arguments.d.ts +24 -0
- package/dist/safe-bash/commands/tree/arguments.d.ts.map +1 -0
- package/dist/safe-bash/commands/tree/arguments.js +125 -0
- package/dist/safe-bash/commands/tree/arguments.js.map +1 -0
- package/dist/safe-bash/commands/tree/charset.d.ts +5 -0
- package/dist/safe-bash/commands/tree/charset.d.ts.map +1 -0
- package/dist/safe-bash/commands/tree/charset.js +36 -0
- package/dist/safe-bash/commands/tree/charset.js.map +1 -0
- package/dist/safe-bash/commands/tree/index.d.ts +7 -0
- package/dist/safe-bash/commands/tree/index.d.ts.map +1 -0
- package/dist/safe-bash/commands/tree/index.js +19 -0
- package/dist/safe-bash/commands/tree/index.js.map +1 -0
- package/dist/safe-bash/commands/tree/io.d.ts +28 -0
- package/dist/safe-bash/commands/tree/io.d.ts.map +1 -0
- package/dist/safe-bash/commands/tree/io.js +95 -0
- package/dist/safe-bash/commands/tree/io.js.map +1 -0
- package/dist/safe-bash/commands/tree/options.d.ts +17 -0
- package/dist/safe-bash/commands/tree/options.d.ts.map +1 -0
- package/dist/safe-bash/commands/tree/options.js +14 -0
- package/dist/safe-bash/commands/tree/options.js.map +1 -0
- package/dist/safe-bash/commands/tree/pattern.d.ts +10 -0
- package/dist/safe-bash/commands/tree/pattern.d.ts.map +1 -0
- package/dist/safe-bash/commands/tree/pattern.js +90 -0
- package/dist/safe-bash/commands/tree/pattern.js.map +1 -0
- package/dist/safe-bash/commands/tree/tree.d.ts +4 -0
- package/dist/safe-bash/commands/tree/tree.d.ts.map +1 -0
- package/dist/safe-bash/commands/tree/tree.js +242 -0
- package/dist/safe-bash/commands/tree/tree.js.map +1 -0
- package/dist/safe-bash/commands/which/index.d.ts +7 -0
- package/dist/safe-bash/commands/which/index.d.ts.map +1 -0
- package/dist/safe-bash/commands/which/index.js +22 -0
- package/dist/safe-bash/commands/which/index.js.map +1 -0
- package/dist/safe-bash/commands/which/options.d.ts +15 -0
- package/dist/safe-bash/commands/which/options.d.ts.map +1 -0
- package/dist/safe-bash/commands/which/options.js +24 -0
- package/dist/safe-bash/commands/which/options.js.map +1 -0
- package/dist/safe-bash/commands/which/which.d.ts +4 -0
- package/dist/safe-bash/commands/which/which.d.ts.map +1 -0
- package/dist/safe-bash/commands/which/which.js +284 -0
- package/dist/safe-bash/commands/which/which.js.map +1 -0
- package/dist/safe-bash/contracts/command.d.ts +67 -0
- package/dist/safe-bash/contracts/command.d.ts.map +1 -0
- package/dist/safe-bash/contracts/command.js +209 -0
- package/dist/safe-bash/contracts/command.js.map +1 -0
- package/dist/safe-bash/contracts/errors.d.ts +3 -0
- package/dist/safe-bash/contracts/errors.d.ts.map +1 -0
- package/dist/safe-bash/contracts/errors.js +2 -0
- package/dist/safe-bash/contracts/errors.js.map +1 -0
- package/dist/safe-bash/contracts/filesystem.d.ts +3 -0
- package/dist/safe-bash/contracts/filesystem.d.ts.map +1 -0
- package/dist/safe-bash/contracts/filesystem.js +2 -0
- package/dist/safe-bash/contracts/filesystem.js.map +1 -0
- package/dist/safe-bash/contracts/index.d.ts +8 -0
- package/dist/safe-bash/contracts/index.d.ts.map +1 -0
- package/dist/safe-bash/contracts/index.js +8 -0
- package/dist/safe-bash/contracts/index.js.map +1 -0
- package/dist/safe-bash/contracts/io.d.ts +26 -0
- package/dist/safe-bash/contracts/io.d.ts.map +1 -0
- package/dist/safe-bash/contracts/io.js +154 -0
- package/dist/safe-bash/contracts/io.js.map +1 -0
- package/dist/safe-bash/contracts/output.d.ts +12 -0
- package/dist/safe-bash/contracts/output.d.ts.map +1 -0
- package/dist/safe-bash/contracts/output.js +126 -0
- package/dist/safe-bash/contracts/output.js.map +1 -0
- package/dist/safe-bash/contracts/path.d.ts +2 -0
- package/dist/safe-bash/contracts/path.d.ts.map +1 -0
- package/dist/safe-bash/contracts/path.js +2 -0
- package/dist/safe-bash/contracts/path.js.map +1 -0
- package/dist/safe-bash/contracts/plugin.d.ts +16 -0
- package/dist/safe-bash/contracts/plugin.d.ts.map +1 -0
- package/dist/safe-bash/contracts/plugin.js +47 -0
- package/dist/safe-bash/contracts/plugin.js.map +1 -0
- package/dist/safe-bash/contracts/value.d.ts +21 -0
- package/dist/safe-bash/contracts/value.d.ts.map +1 -0
- package/dist/safe-bash/contracts/value.js +203 -0
- package/dist/safe-bash/contracts/value.js.map +1 -0
- package/dist/safe-bash/fs/memory/index.d.ts +2 -0
- package/dist/safe-bash/fs/memory/index.d.ts.map +1 -0
- package/dist/safe-bash/fs/memory/index.js +2 -0
- package/dist/safe-bash/fs/memory/index.js.map +1 -0
- package/dist/safe-bash/fs/mount/index.d.ts +3 -0
- package/dist/safe-bash/fs/mount/index.d.ts.map +1 -0
- package/dist/safe-bash/fs/mount/index.js +2 -0
- package/dist/safe-bash/fs/mount/index.js.map +1 -0
- package/dist/safe-bash/fs/overlay/index.d.ts +3 -0
- package/dist/safe-bash/fs/overlay/index.d.ts.map +1 -0
- package/dist/safe-bash/fs/overlay/index.js +2 -0
- package/dist/safe-bash/fs/overlay/index.js.map +1 -0
- package/dist/safe-bash/fs/readonly/index.d.ts +2 -0
- package/dist/safe-bash/fs/readonly/index.d.ts.map +1 -0
- package/dist/safe-bash/fs/readonly/index.js +2 -0
- package/dist/safe-bash/fs/readonly/index.js.map +1 -0
- package/dist/safe-bash/fs/real/index.d.ts +3 -0
- package/dist/safe-bash/fs/real/index.d.ts.map +1 -0
- package/dist/safe-bash/fs/real/index.js +2 -0
- package/dist/safe-bash/fs/real/index.js.map +1 -0
- package/dist/safe-bash/fs/s3/http/index.d.ts +3 -0
- package/dist/safe-bash/fs/s3/http/index.d.ts.map +1 -0
- package/dist/safe-bash/fs/s3/http/index.js +2 -0
- package/dist/safe-bash/fs/s3/http/index.js.map +1 -0
- package/dist/safe-bash/fs/s3/index.d.ts +3 -0
- package/dist/safe-bash/fs/s3/index.d.ts.map +1 -0
- package/dist/safe-bash/fs/s3/index.js +2 -0
- package/dist/safe-bash/fs/s3/index.js.map +1 -0
- package/dist/safe-bash/fs/webdav/index.d.ts +3 -0
- package/dist/safe-bash/fs/webdav/index.d.ts.map +1 -0
- package/dist/safe-bash/fs/webdav/index.js +2 -0
- package/dist/safe-bash/fs/webdav/index.js.map +1 -0
- package/dist/safe-bash/index.d.ts +40 -0
- package/dist/safe-bash/index.d.ts.map +1 -0
- package/dist/safe-bash/index.js +39 -0
- package/dist/safe-bash/index.js.map +1 -0
- package/dist/safe-bash/integrations/safejs/filesystem.d.ts +7 -0
- package/dist/safe-bash/integrations/safejs/filesystem.d.ts.map +1 -0
- package/dist/safe-bash/integrations/safejs/filesystem.js +5 -0
- package/dist/safe-bash/integrations/safejs/filesystem.js.map +1 -0
- package/dist/safe-bash/integrations/safejs/index.d.ts +5 -0
- package/dist/safe-bash/integrations/safejs/index.d.ts.map +1 -0
- package/dist/safe-bash/integrations/safejs/index.js +3 -0
- package/dist/safe-bash/integrations/safejs/index.js.map +1 -0
- package/dist/safe-bash/integrations/safejs/shell.d.ts +31 -0
- package/dist/safe-bash/integrations/safejs/shell.d.ts.map +1 -0
- package/dist/safe-bash/integrations/safejs/shell.js +53 -0
- package/dist/safe-bash/integrations/safejs/shell.js.map +1 -0
- package/dist/safe-bash/integrations/safejs/values.d.ts +8 -0
- package/dist/safe-bash/integrations/safejs/values.d.ts.map +1 -0
- package/dist/safe-bash/integrations/safejs/values.js +71 -0
- package/dist/safe-bash/integrations/safejs/values.js.map +1 -0
- package/dist/safe-bash/plugins/index.d.ts +50 -0
- package/dist/safe-bash/plugins/index.d.ts.map +1 -0
- package/dist/safe-bash/plugins/index.js +63 -0
- package/dist/safe-bash/plugins/index.js.map +1 -0
- package/dist/safe-bash/shell/arithmetic-parameters.d.ts +14 -0
- package/dist/safe-bash/shell/arithmetic-parameters.d.ts.map +1 -0
- package/dist/safe-bash/shell/arithmetic-parameters.js +156 -0
- package/dist/safe-bash/shell/arithmetic-parameters.js.map +1 -0
- package/dist/safe-bash/shell/arithmetic.d.ts +35 -0
- package/dist/safe-bash/shell/arithmetic.d.ts.map +1 -0
- package/dist/safe-bash/shell/arithmetic.js +265 -0
- package/dist/safe-bash/shell/arithmetic.js.map +1 -0
- package/dist/safe-bash/shell/arrays/bindings.d.ts +83 -0
- package/dist/safe-bash/shell/arrays/bindings.d.ts.map +1 -0
- package/dist/safe-bash/shell/arrays/bindings.js +284 -0
- package/dist/safe-bash/shell/arrays/bindings.js.map +1 -0
- package/dist/safe-bash/shell/arrays/ledger.d.ts +73 -0
- package/dist/safe-bash/shell/arrays/ledger.d.ts.map +1 -0
- package/dist/safe-bash/shell/arrays/ledger.js +270 -0
- package/dist/safe-bash/shell/arrays/ledger.js.map +1 -0
- package/dist/safe-bash/shell/arrays/state.d.ts +75 -0
- package/dist/safe-bash/shell/arrays/state.d.ts.map +1 -0
- package/dist/safe-bash/shell/arrays/state.js +444 -0
- package/dist/safe-bash/shell/arrays/state.js.map +1 -0
- package/dist/safe-bash/shell/arrays/syntax.d.ts +47 -0
- package/dist/safe-bash/shell/arrays/syntax.d.ts.map +1 -0
- package/dist/safe-bash/shell/arrays/syntax.js +122 -0
- package/dist/safe-bash/shell/arrays/syntax.js.map +1 -0
- package/dist/safe-bash/shell/cancellation.d.ts +129 -0
- package/dist/safe-bash/shell/cancellation.d.ts.map +1 -0
- package/dist/safe-bash/shell/cancellation.js +703 -0
- package/dist/safe-bash/shell/cancellation.js.map +1 -0
- package/dist/safe-bash/shell/cleanup.d.ts +19 -0
- package/dist/safe-bash/shell/cleanup.d.ts.map +1 -0
- package/dist/safe-bash/shell/cleanup.js +83 -0
- package/dist/safe-bash/shell/cleanup.js.map +1 -0
- package/dist/safe-bash/shell/conditional.d.ts +48 -0
- package/dist/safe-bash/shell/conditional.d.ts.map +1 -0
- package/dist/safe-bash/shell/conditional.js +218 -0
- package/dist/safe-bash/shell/conditional.js.map +1 -0
- package/dist/safe-bash/shell/display.d.ts +3 -0
- package/dist/safe-bash/shell/display.d.ts.map +1 -0
- package/dist/safe-bash/shell/display.js +57 -0
- package/dist/safe-bash/shell/display.js.map +1 -0
- package/dist/safe-bash/shell/getopts.d.ts +46 -0
- package/dist/safe-bash/shell/getopts.d.ts.map +1 -0
- package/dist/safe-bash/shell/getopts.js +215 -0
- package/dist/safe-bash/shell/getopts.js.map +1 -0
- package/dist/safe-bash/shell/index.d.ts +5 -0
- package/dist/safe-bash/shell/index.d.ts.map +1 -0
- package/dist/safe-bash/shell/index.js +4 -0
- package/dist/safe-bash/shell/index.js.map +1 -0
- package/dist/safe-bash/shell/input.d.ts +26 -0
- package/dist/safe-bash/shell/input.d.ts.map +1 -0
- package/dist/safe-bash/shell/input.js +323 -0
- package/dist/safe-bash/shell/input.js.map +1 -0
- package/dist/safe-bash/shell/locale.d.ts +2 -0
- package/dist/safe-bash/shell/locale.d.ts.map +1 -0
- package/dist/safe-bash/shell/locale.js +5 -0
- package/dist/safe-bash/shell/locale.js.map +1 -0
- package/dist/safe-bash/shell/parser.d.ts +149 -0
- package/dist/safe-bash/shell/parser.d.ts.map +1 -0
- package/dist/safe-bash/shell/parser.js +1023 -0
- package/dist/safe-bash/shell/parser.js.map +1 -0
- package/dist/safe-bash/shell/pattern.d.ts +9 -0
- package/dist/safe-bash/shell/pattern.d.ts.map +1 -0
- package/dist/safe-bash/shell/pattern.js +134 -0
- package/dist/safe-bash/shell/pattern.js.map +1 -0
- package/dist/safe-bash/shell/pipestatus.d.ts +6 -0
- package/dist/safe-bash/shell/pipestatus.d.ts.map +1 -0
- package/dist/safe-bash/shell/pipestatus.js +82 -0
- package/dist/safe-bash/shell/pipestatus.js.map +1 -0
- package/dist/safe-bash/shell/runtime.d.ts +282 -0
- package/dist/safe-bash/shell/runtime.d.ts.map +1 -0
- package/dist/safe-bash/shell/runtime.js +5400 -0
- package/dist/safe-bash/shell/runtime.js.map +1 -0
- package/dist/safe-bash/shell/shell.d.ts +15 -0
- package/dist/safe-bash/shell/shell.d.ts.map +1 -0
- package/dist/safe-bash/shell/shell.js +355 -0
- package/dist/safe-bash/shell/shell.js.map +1 -0
- package/dist/safe-bash/shell/types.d.ts +76 -0
- package/dist/safe-bash/shell/types.d.ts.map +1 -0
- package/dist/safe-bash/shell/types.js +25 -0
- package/dist/safe-bash/shell/types.js.map +1 -0
- package/dist/safe-bash/shell/value-state.d.ts +57 -0
- package/dist/safe-bash/shell/value-state.d.ts.map +1 -0
- package/dist/safe-bash/shell/value-state.js +275 -0
- package/dist/safe-bash/shell/value-state.js.map +1 -0
- package/package.json +143 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { setImmediate } from "node:timers/promises";
|
|
2
|
+
import { EreProfileLimitError, EreUsageUnknownError } from "./errors.js";
|
|
3
|
+
const resources = Object.freeze([
|
|
4
|
+
"patternBytes", "subjectBytes", "work", "states", "allocationUnits", "captureBytes", "captureSlots",
|
|
5
|
+
]);
|
|
6
|
+
function integer(value) {
|
|
7
|
+
if (!Number.isSafeInteger(value) || value < 0)
|
|
8
|
+
throw new TypeError("ERE bounds must be nonnegative safe integers");
|
|
9
|
+
}
|
|
10
|
+
function multiply(value, factor, ceiling) {
|
|
11
|
+
return value > Math.floor(ceiling / factor) ? ceiling : value * factor;
|
|
12
|
+
}
|
|
13
|
+
export function deriveEreLimits(bounds) {
|
|
14
|
+
integer(bounds.maxExpansionBytes);
|
|
15
|
+
integer(bounds.maxExpansionFields);
|
|
16
|
+
const bytes = bounds.maxExpansionBytes;
|
|
17
|
+
const fields = bounds.maxExpansionFields;
|
|
18
|
+
const byteUnits = multiply(bytes, 8, 4_000_000);
|
|
19
|
+
const fieldUnits = multiply(fields, 128, 4_000_000);
|
|
20
|
+
return Object.freeze({
|
|
21
|
+
patternBytes: Math.min(bytes, 65_536),
|
|
22
|
+
subjectBytes: Math.min(bytes, 1_048_576),
|
|
23
|
+
work: multiply(bytes, 32, 50_000_000),
|
|
24
|
+
states: multiply(fields, 8, 65_536),
|
|
25
|
+
allocationUnits: byteUnits >= 4_000_000 - fieldUnits ? 4_000_000 : byteUnits + fieldUnits,
|
|
26
|
+
captureBytes: bytes,
|
|
27
|
+
captureSlots: fields,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
export class EreLedger {
|
|
31
|
+
limits;
|
|
32
|
+
#usage = {
|
|
33
|
+
patternBytes: 0, subjectBytes: 0, work: 0, states: 0, allocationUnits: 0, captureBytes: 0, captureSlots: 0,
|
|
34
|
+
};
|
|
35
|
+
#poison;
|
|
36
|
+
#lastYield = 0;
|
|
37
|
+
constructor(bounds, lowering = {}) {
|
|
38
|
+
const limits = { ...deriveEreLimits(bounds) };
|
|
39
|
+
for (const resource of Object.keys(lowering)) {
|
|
40
|
+
if (!resources.includes(resource))
|
|
41
|
+
throw new TypeError("unknown ERE limit");
|
|
42
|
+
const key = resource;
|
|
43
|
+
const value = lowering[key];
|
|
44
|
+
if (value === undefined)
|
|
45
|
+
throw new TypeError("undefined ERE limit");
|
|
46
|
+
integer(value);
|
|
47
|
+
if (value > limits[key])
|
|
48
|
+
throw new RangeError("ERE limits may only be lowered");
|
|
49
|
+
limits[key] = value;
|
|
50
|
+
}
|
|
51
|
+
this.limits = Object.freeze(limits);
|
|
52
|
+
}
|
|
53
|
+
get usage() { return Object.freeze({ ...this.#usage }); }
|
|
54
|
+
check(signal) {
|
|
55
|
+
if (signal?.aborted)
|
|
56
|
+
throw signal.reason;
|
|
57
|
+
if (this.#poison)
|
|
58
|
+
throw this.#poison;
|
|
59
|
+
}
|
|
60
|
+
charge(resource, amount, signal) {
|
|
61
|
+
this.check(signal);
|
|
62
|
+
integer(amount);
|
|
63
|
+
if (amount > this.limits[resource] - this.#usage[resource]) {
|
|
64
|
+
throw new EreProfileLimitError(resource, this.limits[resource]);
|
|
65
|
+
}
|
|
66
|
+
this.#usage[resource] += amount;
|
|
67
|
+
}
|
|
68
|
+
admitInput(resource, length, signal) {
|
|
69
|
+
this.check(signal);
|
|
70
|
+
integer(length);
|
|
71
|
+
if (length > this.limits[resource])
|
|
72
|
+
throw new EreProfileLimitError(resource, this.limits[resource]);
|
|
73
|
+
this.#usage[resource] = Math.max(this.#usage[resource], length);
|
|
74
|
+
}
|
|
75
|
+
async checkpoint(signal) {
|
|
76
|
+
this.check(signal);
|
|
77
|
+
if (this.#usage.work - this.#lastYield >= 256) {
|
|
78
|
+
this.#lastYield = this.#usage.work;
|
|
79
|
+
await setImmediate();
|
|
80
|
+
this.check(signal);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
markUnknownUsage(reason) {
|
|
84
|
+
this.#poison ??= new EreUsageUnknownError(reason);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=limits.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limits.js","sourceRoot":"","sources":["../../../../src/commands/regex-execution/ere/limits.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGzE,MAAM,SAAS,GAA2B,MAAM,CAAC,MAAM,CAAC;IACtD,cAAc,EAAE,cAAc,EAAE,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE,cAAc,EAAE,cAAc;CACpG,CAAC,CAAC;AAEH,SAAS,OAAO,CAAC,KAAa;IAC5B,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,8CAA8C,CAAC,CAAC;AACrH,CAAC;AAED,SAAS,QAAQ,CAAC,KAAa,EAAE,MAAc,EAAE,OAAe;IAC9D,OAAO,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,GAAG,MAAM,CAAC;AACzE,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,MAA0B;IACxD,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;IAClC,OAAO,CAAC,MAAM,CAAC,kBAAkB,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AC,MAAM,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC;IAClC,CAAC;IAED,UAAU,CAAC,QAAyC,EAAE,MAAc,EAAE,MAAoB;QACxF,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACnB,OAAO,CAAC,MAAM,CAAC,CAAC;QAChB,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;YAAE,MAAM,IAAI,oBAAoB,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;QACpG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC;IAClE,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,MAAoB;QACnC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACnB,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,UAAU,IAAI,GAAG,EAAE,CAAC;YAC9C,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;YACnC,MAAM,YAAY,EAAE,CAAC;YACrB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACrB,CAAC;IACH,CAAC;IAED,gBAAgB,CAAC,MAAe;QAC9B,IAAI,CAAC,OAAO,KAAK,IAAI,oBAAoB,CAAC,MAAM,CAAC,CAAC;IACpD,CAAC;CACF"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { EreLedger } from "./limits.js";
|
|
2
|
+
import type { EreProgram, EreResult } from "./types.js";
|
|
3
|
+
export declare function matchEre(program: EreProgram, subject: string, ledger: EreLedger, signal?: AbortSignal): Promise<EreResult>;
|
|
4
|
+
//# sourceMappingURL=matcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matcher.d.ts","sourceRoot":"","sources":["../../../../src/commands/regex-execution/ere/matcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,KAAK,EAAW,UAAU,EAAE,SAAS,EAAW,MAAM,YAAY,CAAC;AAyF1E,wBAAsB,QAAQ,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC,CAmHhI"}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { EreLedger } from "./limits.js";
|
|
2
|
+
import { admitAscii, resolveEreProgram } from "./syntax.js";
|
|
3
|
+
function spanOrder(left, right) {
|
|
4
|
+
if (left === null)
|
|
5
|
+
return right === null ? 0 : -1;
|
|
6
|
+
if (right === null)
|
|
7
|
+
return 1;
|
|
8
|
+
const length = left.end - left.start - (right.end - right.start);
|
|
9
|
+
return length === 0 ? right.start - left.start : length;
|
|
10
|
+
}
|
|
11
|
+
async function historyOrder(left, right, ledger, signal) {
|
|
12
|
+
const leftCount = left?.count ?? 0;
|
|
13
|
+
const rightCount = right?.count ?? 0;
|
|
14
|
+
for (let ordinal = 1; ordinal <= Math.min(leftCount, rightCount); ordinal++) {
|
|
15
|
+
ledger.charge("work", 1, signal);
|
|
16
|
+
await ledger.checkpoint(signal);
|
|
17
|
+
let leftEntry = left;
|
|
18
|
+
let rightEntry = right;
|
|
19
|
+
for (let remaining = leftCount; remaining > ordinal; remaining--) {
|
|
20
|
+
ledger.charge("work", 1, signal);
|
|
21
|
+
await ledger.checkpoint(signal);
|
|
22
|
+
leftEntry = leftEntry.previous;
|
|
23
|
+
}
|
|
24
|
+
for (let remaining = rightCount; remaining > ordinal; remaining--) {
|
|
25
|
+
ledger.charge("work", 1, signal);
|
|
26
|
+
await ledger.checkpoint(signal);
|
|
27
|
+
rightEntry = rightEntry.previous;
|
|
28
|
+
}
|
|
29
|
+
const compared = spanOrder(leftEntry.span, rightEntry.span);
|
|
30
|
+
if (compared !== 0)
|
|
31
|
+
return compared;
|
|
32
|
+
}
|
|
33
|
+
return leftCount - rightCount;
|
|
34
|
+
}
|
|
35
|
+
async function preferred(candidate, incumbent, ledger, signal) {
|
|
36
|
+
if (candidate.position !== incumbent.position)
|
|
37
|
+
return candidate.position > incumbent.position;
|
|
38
|
+
for (let group = 1; group < candidate.captures.length; group++) {
|
|
39
|
+
ledger.charge("work", 1, signal);
|
|
40
|
+
const compared = await historyOrder(candidate.histories[group], incumbent.histories[group], ledger, signal);
|
|
41
|
+
if (compared !== 0)
|
|
42
|
+
return compared > 0;
|
|
43
|
+
}
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
async function resetDescendants(node, previous, ledger, signal) {
|
|
47
|
+
ledger.charge("allocationUnits", previous.length + 3, signal);
|
|
48
|
+
const captures = previous.slice();
|
|
49
|
+
const pending = [node];
|
|
50
|
+
while (pending.length > 0) {
|
|
51
|
+
ledger.charge("work", 1, signal);
|
|
52
|
+
await ledger.checkpoint(signal);
|
|
53
|
+
const current = pending.pop();
|
|
54
|
+
if (current.kind === "group")
|
|
55
|
+
captures[current.index] = null;
|
|
56
|
+
if (current.kind === "group" || current.kind === "repeat") {
|
|
57
|
+
if (current.child.captured) {
|
|
58
|
+
ledger.charge("allocationUnits", 1, signal);
|
|
59
|
+
pending.push(current.child);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
else if (current.kind === "sequence" || current.kind === "alternative") {
|
|
63
|
+
for (const child of current.children) {
|
|
64
|
+
ledger.charge("work", 1, signal);
|
|
65
|
+
await ledger.checkpoint(signal);
|
|
66
|
+
if (child.captured) {
|
|
67
|
+
ledger.charge("allocationUnits", 1, signal);
|
|
68
|
+
pending.push(child);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return captures;
|
|
74
|
+
}
|
|
75
|
+
export async function matchEre(program, subject, ledger, signal) {
|
|
76
|
+
ledger.check(signal);
|
|
77
|
+
const root = resolveEreProgram(program, ledger);
|
|
78
|
+
ledger.admitInput("subjectBytes", subject.length, signal);
|
|
79
|
+
await admitAscii(subject, ledger, signal);
|
|
80
|
+
const width = program.groups + 1;
|
|
81
|
+
ledger.charge("allocationUnits", width * 2 + 1, signal);
|
|
82
|
+
const emptyCaptures = Object.freeze(new Array(width).fill(null));
|
|
83
|
+
const emptyHistories = Object.freeze(new Array(width).fill(null));
|
|
84
|
+
const pending = [];
|
|
85
|
+
const task = (create) => {
|
|
86
|
+
ledger.charge("allocationUnits", 5, signal);
|
|
87
|
+
return create();
|
|
88
|
+
};
|
|
89
|
+
const push = (position, next, captures, histories) => {
|
|
90
|
+
ledger.charge("states", 1, signal);
|
|
91
|
+
ledger.charge("allocationUnits", 5, signal);
|
|
92
|
+
pending.push({ position, task: next, captures, histories });
|
|
93
|
+
};
|
|
94
|
+
for (let start = 0; start <= subject.length; start++) {
|
|
95
|
+
push(start, task(() => ({ kind: "node", node: root, next: null })), emptyCaptures, emptyHistories);
|
|
96
|
+
let best;
|
|
97
|
+
while (pending.length > 0) {
|
|
98
|
+
ledger.charge("work", 1, signal);
|
|
99
|
+
await ledger.checkpoint(signal);
|
|
100
|
+
const state = pending.pop();
|
|
101
|
+
const current = state.task;
|
|
102
|
+
if (current === null) {
|
|
103
|
+
if (!best || await preferred(state, best, ledger, signal))
|
|
104
|
+
best = state;
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
if (current.kind === "close") {
|
|
108
|
+
ledger.charge("allocationUnits", width * 2 + 6, signal);
|
|
109
|
+
const span = Object.freeze({ start: current.start, end: state.position });
|
|
110
|
+
const captures = state.captures.slice();
|
|
111
|
+
captures[current.group] = span;
|
|
112
|
+
const histories = state.histories.slice();
|
|
113
|
+
const previous = histories[current.group];
|
|
114
|
+
histories[current.group] = { span, previous, count: (previous?.count ?? 0) + 1 };
|
|
115
|
+
push(state.position, current.next, captures, histories);
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
if (current.kind === "repeat") {
|
|
119
|
+
const { node, count } = current;
|
|
120
|
+
if (count >= node.min)
|
|
121
|
+
push(state.position, current.next, state.captures, state.histories);
|
|
122
|
+
const noProgress = count > 0 && state.position === current.previous;
|
|
123
|
+
if (count < node.max && (!noProgress || count < node.min)) {
|
|
124
|
+
const repeat = task(() => ({ kind: "repeat", node, count: count + 1, previous: state.position, next: current.next }));
|
|
125
|
+
push(state.position, task(() => ({ kind: "node", node: node.child, next: repeat })), state.captures, state.histories);
|
|
126
|
+
}
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
const node = current.node;
|
|
130
|
+
switch (node.kind) {
|
|
131
|
+
case "empty":
|
|
132
|
+
push(state.position, current.next, state.captures, state.histories);
|
|
133
|
+
break;
|
|
134
|
+
case "start":
|
|
135
|
+
if (state.position === 0)
|
|
136
|
+
push(state.position, current.next, state.captures, state.histories);
|
|
137
|
+
break;
|
|
138
|
+
case "end":
|
|
139
|
+
if (state.position === subject.length)
|
|
140
|
+
push(state.position, current.next, state.captures, state.histories);
|
|
141
|
+
break;
|
|
142
|
+
case "dot":
|
|
143
|
+
case "literal":
|
|
144
|
+
case "set": {
|
|
145
|
+
const code = subject.charCodeAt(state.position);
|
|
146
|
+
if (state.position < subject.length && (node.kind === "dot" || node.kind === "literal" && node.code === code || node.kind === "set" && node.members[code])) {
|
|
147
|
+
push(state.position + 1, current.next, state.captures, state.histories);
|
|
148
|
+
}
|
|
149
|
+
break;
|
|
150
|
+
}
|
|
151
|
+
case "sequence": {
|
|
152
|
+
let next = current.next;
|
|
153
|
+
for (let index = node.children.length - 1; index >= 0; index--) {
|
|
154
|
+
ledger.charge("work", 1, signal);
|
|
155
|
+
await ledger.checkpoint(signal);
|
|
156
|
+
const following = next;
|
|
157
|
+
next = task(() => ({ kind: "node", node: node.children[index], next: following }));
|
|
158
|
+
}
|
|
159
|
+
push(state.position, next, state.captures, state.histories);
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
case "alternative":
|
|
163
|
+
for (let index = node.children.length - 1; index >= 0; index--) {
|
|
164
|
+
ledger.charge("work", 1, signal);
|
|
165
|
+
await ledger.checkpoint(signal);
|
|
166
|
+
push(state.position, task(() => ({ kind: "node", node: node.children[index], next: current.next })), state.captures, state.histories);
|
|
167
|
+
}
|
|
168
|
+
break;
|
|
169
|
+
case "group": {
|
|
170
|
+
const captures = node.child.captured ? await resetDescendants(node.child, state.captures, ledger, signal) : state.captures;
|
|
171
|
+
const close = task(() => ({ kind: "close", group: node.index, start: state.position, next: current.next }));
|
|
172
|
+
push(state.position, task(() => ({ kind: "node", node: node.child, next: close })), captures, state.histories);
|
|
173
|
+
break;
|
|
174
|
+
}
|
|
175
|
+
case "repeat":
|
|
176
|
+
push(state.position, task(() => ({ kind: "repeat", node, count: 0, previous: -1, next: current.next })), state.captures, state.histories);
|
|
177
|
+
break;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
if (best) {
|
|
181
|
+
ledger.charge("captureSlots", width, signal);
|
|
182
|
+
let bytes = best.position - start;
|
|
183
|
+
for (let group = 1; group < width; group++) {
|
|
184
|
+
ledger.charge("work", 1, signal);
|
|
185
|
+
const span = best.captures[group];
|
|
186
|
+
if (span)
|
|
187
|
+
bytes += span.end - span.start;
|
|
188
|
+
}
|
|
189
|
+
ledger.charge("captureBytes", bytes, signal);
|
|
190
|
+
ledger.charge("allocationUnits", width * 2 + bytes + 4, signal);
|
|
191
|
+
const captures = best.captures.slice();
|
|
192
|
+
captures[0] = Object.freeze({ start, end: best.position });
|
|
193
|
+
const values = captures.map(span => span === null ? "" : subject.slice(span.start, span.end));
|
|
194
|
+
ledger.check(signal);
|
|
195
|
+
return Object.freeze({ matched: true, captures: Object.freeze(captures), values: Object.freeze(values) });
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
ledger.charge("allocationUnits", 3, signal);
|
|
199
|
+
ledger.check(signal);
|
|
200
|
+
return Object.freeze({ matched: false, captures: Object.freeze([]), values: Object.freeze([]) });
|
|
201
|
+
}
|
|
202
|
+
//# sourceMappingURL=matcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matcher.js","sourceRoot":"","sources":["../../../../src/commands/regex-execution/ere/matcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAqB5D,SAAS,SAAS,CAAC,IAAoB,EAAE,KAAqB;IAC5D,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAClD,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,CAAC,CAAC;IAC7B,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,GAAG,CAAC,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;IACjE,OAAO,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;AAC1D,CAAC;AAED,KAAK,UAAU,YAAY,CAAC,IAAoB,EAAE,KAAqB,EAAE,MAAiB,EAAE,MAAoB;IAC9G,MAAM,SAAS,GAAG,IAAI,EAAE,KAAK,IAAI,CAAC,CAAC;IACnC,MAAM,UAAU,GAAG,KAAK,EAAE,KAAK,IAAI,CAAC,CAAC;IACrC,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,OAAO,EAAE,EAAE,CAAC;QAC5E,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;QACjC,MAAM,MA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"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { EreLedger } from "./limits.js";
|
|
2
|
+
import type { EreFragment, EreNode, EreProgram } from "./types.js";
|
|
3
|
+
export declare function admitAscii(text: string, ledger: EreLedger, signal?: AbortSignal): Promise<void>;
|
|
4
|
+
export declare function compileEre(input: string | readonly EreFragment[], ledger: EreLedger, signal?: AbortSignal): Promise<EreProgram>;
|
|
5
|
+
export declare function resolveEreProgram(program: EreProgram, ledger: EreLedger): EreNode;
|
|
6
|
+
//# sourceMappingURL=syntax.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"syntax.d.ts","sourceRoot":"","sources":["../../../../src/commands/regex-execution/ere/syntax.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AA2BnE,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAOrG;AA4MD,wBAAsB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,WAAW,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CAUrI;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,GAAG,OAAO,CAIjF"}
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import { EreSyntaxError, EreUnsupportedError } from "./errors.js";
|
|
2
|
+
import { EreLedger } from "./limits.js";
|
|
3
|
+
const programs = new WeakMap();
|
|
4
|
+
const special = "\\.^$[]()|*+?{}";
|
|
5
|
+
const classes = new Set(["alnum", "alpha", "blank", "cntrl", "digit", "graph", "lower", "print", "punct", "space", "upper", "xdigit"]);
|
|
6
|
+
function classMember(name, code) {
|
|
7
|
+
const upper = code >= 65 && code <= 90;
|
|
8
|
+
const lower = code >= 97 && code <= 122;
|
|
9
|
+
const digit = code >= 48 && code <= 57;
|
|
10
|
+
switch (name) {
|
|
11
|
+
case "alnum": return upper || lower || digit;
|
|
12
|
+
case "alpha": return upper || lower;
|
|
13
|
+
case "blank": return code === 9 || code === 32;
|
|
14
|
+
case "cntrl": return code < 32 || code === 127;
|
|
15
|
+
case "digit": return digit;
|
|
16
|
+
case "graph": return code >= 33 && code <= 126;
|
|
17
|
+
case "lower": return lower;
|
|
18
|
+
case "print": return code >= 32 && code <= 126;
|
|
19
|
+
case "punct": return code >= 33 && code <= 126 && !upper && !lower && !digit;
|
|
20
|
+
case "space": return code === 32 || code >= 9 && code <= 13;
|
|
21
|
+
case "upper": return upper;
|
|
22
|
+
case "xdigit": return digit || code >= 65 && code <= 70 || code >= 97 && code <= 102;
|
|
23
|
+
default: return false;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export async function admitAscii(text, ledger, signal) {
|
|
27
|
+
for (let offset = 0; offset < text.length; offset++) {
|
|
28
|
+
ledger.charge("work", 1, signal);
|
|
29
|
+
const code = text.charCodeAt(offset);
|
|
30
|
+
if (code === 0 || code > 127)
|
|
31
|
+
throw new EreUnsupportedError("only non-NUL ASCII in the C/POSIX profile", offset);
|
|
32
|
+
await ledger.checkpoint(signal);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
async function flatten(input, ledger, signal) {
|
|
36
|
+
if (typeof input === "string") {
|
|
37
|
+
ledger.admitInput("patternBytes", input.length, signal);
|
|
38
|
+
await admitAscii(input, ledger, signal);
|
|
39
|
+
return { pattern: input, quoted: null };
|
|
40
|
+
}
|
|
41
|
+
let size = 0;
|
|
42
|
+
for (const fragment of input) {
|
|
43
|
+
if (typeof fragment.text !== "string" || typeof fragment.literal !== "boolean")
|
|
44
|
+
throw new TypeError("invalid ERE fragment");
|
|
45
|
+
ledger.charge("work", 1, signal);
|
|
46
|
+
await ledger.checkpoint(signal);
|
|
47
|
+
ledger.admitInput("patternBytes", fragment.text.length, signal);
|
|
48
|
+
await admitAscii(fragment.text, ledger, signal);
|
|
49
|
+
if (fragment.text.length > ledger.limits.patternBytes - size)
|
|
50
|
+
ledger.admitInput("patternBytes", ledger.limits.patternBytes + 1, signal);
|
|
51
|
+
size += fragment.text.length;
|
|
52
|
+
ledger.admitInput("patternBytes", size, signal);
|
|
53
|
+
}
|
|
54
|
+
ledger.charge("allocationUnits", size * 2 + input.length + 2, signal);
|
|
55
|
+
const output = [];
|
|
56
|
+
const quoted = [];
|
|
57
|
+
for (const fragment of input) {
|
|
58
|
+
for (let offset = 0; offset < fragment.text.length; offset++) {
|
|
59
|
+
ledger.charge("work", 1, signal);
|
|
60
|
+
await ledger.checkpoint(signal);
|
|
61
|
+
quoted.push(fragment.literal);
|
|
62
|
+
}
|
|
63
|
+
output.push(fragment.text);
|
|
64
|
+
await ledger.checkpoint(signal);
|
|
65
|
+
}
|
|
66
|
+
return { pattern: output.join(""), quoted: Object.freeze(quoted) };
|
|
67
|
+
}
|
|
68
|
+
class Parser {
|
|
69
|
+
pattern;
|
|
70
|
+
quoted;
|
|
71
|
+
ledger;
|
|
72
|
+
signal;
|
|
73
|
+
offset = 0;
|
|
74
|
+
groups = 0;
|
|
75
|
+
nodes = 0;
|
|
76
|
+
constructor(pattern, quoted, ledger, signal) {
|
|
77
|
+
this.pattern = pattern;
|
|
78
|
+
this.quoted = quoted;
|
|
79
|
+
this.ledger = ledger;
|
|
80
|
+
this.signal = signal;
|
|
81
|
+
}
|
|
82
|
+
at(character, offset = this.offset) { return !this.quoted?.[offset] && this.pattern[offset] === character; }
|
|
83
|
+
node(create) {
|
|
84
|
+
if (this.nodes >= 4096)
|
|
85
|
+
throw new EreUnsupportedError("4096-node grammar ceiling", this.offset);
|
|
86
|
+
this.ledger.charge("allocationUnits", 8, this.signal);
|
|
87
|
+
this.nodes++;
|
|
88
|
+
return Object.freeze(create());
|
|
89
|
+
}
|
|
90
|
+
async expression(depth) {
|
|
91
|
+
if (depth > 64)
|
|
92
|
+
throw new EreUnsupportedError("64-level grammar ceiling", this.offset);
|
|
93
|
+
this.ledger.charge("allocationUnits", 1, this.signal);
|
|
94
|
+
const alternatives = [];
|
|
95
|
+
while (true) {
|
|
96
|
+
const child = await this.sequence(depth);
|
|
97
|
+
this.ledger.charge("allocationUnits", 1, this.signal);
|
|
98
|
+
alternatives.push(child);
|
|
99
|
+
if (!this.at("|"))
|
|
100
|
+
break;
|
|
101
|
+
this.offset++;
|
|
102
|
+
}
|
|
103
|
+
if (alternatives.length === 1)
|
|
104
|
+
return alternatives[0];
|
|
105
|
+
this.ledger.charge("work", alternatives.length * 2, this.signal);
|
|
106
|
+
await this.ledger.checkpoint(this.signal);
|
|
107
|
+
return this.node(() => ({ kind: "alternative", children: Object.freeze(alternatives), nullable: alternatives.some(value => value.nullable), captured: alternatives.some(value => value.captured) }));
|
|
108
|
+
}
|
|
109
|
+
async sequence(depth) {
|
|
110
|
+
this.ledger.charge("allocationUnits", 1, this.signal);
|
|
111
|
+
const children = [];
|
|
112
|
+
while (this.offset < this.pattern.length && !this.at("|") && !this.at(")")) {
|
|
113
|
+
this.ledger.charge("work", 1, this.signal);
|
|
114
|
+
await this.ledger.checkpoint(this.signal);
|
|
115
|
+
let child = await this.atom(depth);
|
|
116
|
+
const operator = this.quoted?.[this.offset] ? undefined : this.pattern[this.offset];
|
|
117
|
+
if (operator === "*" || operator === "+" || operator === "?" || operator === "{") {
|
|
118
|
+
const begin = this.offset++;
|
|
119
|
+
let min = operator === "+" ? 1 : 0;
|
|
120
|
+
let max = operator === "?" ? 1 : Infinity;
|
|
121
|
+
if (operator === "{") {
|
|
122
|
+
min = await this.count();
|
|
123
|
+
max = min;
|
|
124
|
+
if (this.at(",")) {
|
|
125
|
+
this.offset++;
|
|
126
|
+
max = this.at("}") ? Infinity : await this.count();
|
|
127
|
+
}
|
|
128
|
+
if (!this.at("}") || max < min)
|
|
129
|
+
throw new EreSyntaxError("invalid interval", begin);
|
|
130
|
+
this.offset++;
|
|
131
|
+
}
|
|
132
|
+
if (child.kind === "start" || child.kind === "end")
|
|
133
|
+
throw new EreUnsupportedError("repeated anchor", begin);
|
|
134
|
+
if (child.nullable && child.captured && max > 1)
|
|
135
|
+
throw new EreUnsupportedError("nullable captured repetition", begin);
|
|
136
|
+
const repeated = child;
|
|
137
|
+
child = this.node(() => ({ kind: "repeat", child: repeated, min, max, nullable: min === 0 || repeated.nullable, captured: repeated.captured }));
|
|
138
|
+
const next = this.quoted?.[this.offset] ? undefined : this.pattern[this.offset];
|
|
139
|
+
if (next === "*" || next === "+" || next === "?" || next === "{")
|
|
140
|
+
throw new EreUnsupportedError("stacked repetition", this.offset);
|
|
141
|
+
}
|
|
142
|
+
this.ledger.charge("allocationUnits", 1, this.signal);
|
|
143
|
+
children.push(child);
|
|
144
|
+
}
|
|
145
|
+
if (children.length === 0)
|
|
146
|
+
return this.node(() => ({ kind: "empty", nullable: true, captured: false }));
|
|
147
|
+
if (children.length === 1)
|
|
148
|
+
return children[0];
|
|
149
|
+
this.ledger.charge("work", children.length * 2, this.signal);
|
|
150
|
+
await this.ledger.checkpoint(this.signal);
|
|
151
|
+
return this.node(() => ({ kind: "sequence", children: Object.freeze(children), nullable: children.every(value => value.nullable), captured: children.some(value => value.captured) }));
|
|
152
|
+
}
|
|
153
|
+
async count() {
|
|
154
|
+
const begin = this.offset;
|
|
155
|
+
let value = 0;
|
|
156
|
+
while (!this.quoted?.[this.offset] && this.pattern[this.offset] !== undefined && this.pattern[this.offset] >= "0" && this.pattern[this.offset] <= "9") {
|
|
157
|
+
this.ledger.charge("work", 1, this.signal);
|
|
158
|
+
await this.ledger.checkpoint(this.signal);
|
|
159
|
+
value = value * 10 + this.pattern.charCodeAt(this.offset++) - 48;
|
|
160
|
+
if (value > 255)
|
|
161
|
+
throw new EreUnsupportedError("interval counts exceed 255", begin);
|
|
162
|
+
}
|
|
163
|
+
if (begin === this.offset)
|
|
164
|
+
throw new EreSyntaxError("missing interval count", begin);
|
|
165
|
+
return value;
|
|
166
|
+
}
|
|
167
|
+
async atom(depth) {
|
|
168
|
+
const begin = this.offset;
|
|
169
|
+
const character = this.pattern[this.offset++];
|
|
170
|
+
if (this.quoted?.[begin])
|
|
171
|
+
return this.node(() => ({ kind: "literal", code: character.charCodeAt(0), nullable: false, captured: false }));
|
|
172
|
+
if (character === "(") {
|
|
173
|
+
if (this.at("?"))
|
|
174
|
+
throw new EreUnsupportedError("extended group syntax", begin);
|
|
175
|
+
if (this.groups >= 32)
|
|
176
|
+
throw new EreUnsupportedError("32-group grammar ceiling", begin);
|
|
177
|
+
const index = ++this.groups;
|
|
178
|
+
const child = await this.expression(depth + 1);
|
|
179
|
+
if (!this.at(")"))
|
|
180
|
+
throw new EreSyntaxError("unclosed group", begin);
|
|
181
|
+
this.offset++;
|
|
182
|
+
return this.node(() => ({ kind: "group", index, child, nullable: child.nullable, captured: true }));
|
|
183
|
+
}
|
|
184
|
+
if (character === "[")
|
|
185
|
+
return this.set(begin);
|
|
186
|
+
if (character === "\\") {
|
|
187
|
+
const escaped = this.pattern[this.offset++];
|
|
188
|
+
if (escaped === undefined)
|
|
189
|
+
throw new EreSyntaxError("trailing escape", begin);
|
|
190
|
+
if (!special.includes(escaped))
|
|
191
|
+
throw new EreUnsupportedError("backreference or escape extension", begin);
|
|
192
|
+
return this.node(() => ({ kind: "literal", code: escaped.charCodeAt(0), nullable: false, captured: false }));
|
|
193
|
+
}
|
|
194
|
+
if (character === "*" || character === "+" || character === "?" || character === "{")
|
|
195
|
+
throw new EreSyntaxError("repetition without operand", begin);
|
|
196
|
+
if (character === ".")
|
|
197
|
+
return this.node(() => ({ kind: "dot", nullable: false, captured: false }));
|
|
198
|
+
if (character === "^")
|
|
199
|
+
return this.node(() => ({ kind: "start", nullable: true, captured: false }));
|
|
200
|
+
if (character === "$")
|
|
201
|
+
return this.node(() => ({ kind: "end", nullable: true, captured: false }));
|
|
202
|
+
return this.node(() => ({ kind: "literal", code: character.charCodeAt(0), nullable: false, captured: false }));
|
|
203
|
+
}
|
|
204
|
+
async set(begin) {
|
|
205
|
+
this.ledger.charge("allocationUnits", 128, this.signal);
|
|
206
|
+
const members = new Array(128).fill(false);
|
|
207
|
+
const negate = this.at("^");
|
|
208
|
+
if (negate)
|
|
209
|
+
this.offset++;
|
|
210
|
+
let first = true;
|
|
211
|
+
while (this.offset < this.pattern.length) {
|
|
212
|
+
this.ledger.charge("work", 1, this.signal);
|
|
213
|
+
await this.ledger.checkpoint(this.signal);
|
|
214
|
+
if (this.at("]") && !first) {
|
|
215
|
+
this.offset++;
|
|
216
|
+
if (negate)
|
|
217
|
+
for (let code = 1; code < 128; code++) {
|
|
218
|
+
this.ledger.charge("work", 1, this.signal);
|
|
219
|
+
await this.ledger.checkpoint(this.signal);
|
|
220
|
+
members[code] = !members[code];
|
|
221
|
+
}
|
|
222
|
+
return this.node(() => ({ kind: "set", members: Object.freeze(members), nullable: false, captured: false }));
|
|
223
|
+
}
|
|
224
|
+
first = false;
|
|
225
|
+
if (this.at("[") && (this.at(".", this.offset + 1) || this.at("=", this.offset + 1))) {
|
|
226
|
+
throw new EreUnsupportedError("collating or equivalence element", this.offset);
|
|
227
|
+
}
|
|
228
|
+
if (this.at("[") && this.at(":", this.offset + 1)) {
|
|
229
|
+
const classBegin = this.offset;
|
|
230
|
+
this.offset += 2;
|
|
231
|
+
let name = "";
|
|
232
|
+
while (this.offset < this.pattern.length && !this.at(":")) {
|
|
233
|
+
this.ledger.charge("work", 1, this.signal);
|
|
234
|
+
await this.ledger.checkpoint(this.signal);
|
|
235
|
+
if (name.length >= 6)
|
|
236
|
+
throw new EreSyntaxError("unknown character class", classBegin);
|
|
237
|
+
name += this.pattern[this.offset++];
|
|
238
|
+
}
|
|
239
|
+
if (!this.at(":") || !this.at("]", this.offset + 1) || !classes.has(name))
|
|
240
|
+
throw new EreSyntaxError("unknown character class", classBegin);
|
|
241
|
+
this.offset += 2;
|
|
242
|
+
for (let code = 1; code < 128; code++) {
|
|
243
|
+
this.ledger.charge("work", 1, this.signal);
|
|
244
|
+
await this.ledger.checkpoint(this.signal);
|
|
245
|
+
if (classMember(name, code))
|
|
246
|
+
members[code] = true;
|
|
247
|
+
}
|
|
248
|
+
if (this.at("-") && !this.at("]", this.offset + 1))
|
|
249
|
+
throw new EreSyntaxError("class cannot be a range endpoint", this.offset);
|
|
250
|
+
}
|
|
251
|
+
else {
|
|
252
|
+
const lower = this.pattern.charCodeAt(this.offset++);
|
|
253
|
+
if (this.at("-") && !this.at("]", this.offset + 1) && this.pattern[this.offset + 1] !== undefined) {
|
|
254
|
+
this.offset++;
|
|
255
|
+
if (this.at("["))
|
|
256
|
+
throw new EreSyntaxError("nonliteral range endpoint", this.offset);
|
|
257
|
+
const upper = this.pattern.charCodeAt(this.offset++);
|
|
258
|
+
if (lower > upper)
|
|
259
|
+
throw new EreSyntaxError("descending range", this.offset - 3);
|
|
260
|
+
for (let code = lower; code <= upper; code++) {
|
|
261
|
+
this.ledger.charge("work", 1, this.signal);
|
|
262
|
+
await this.ledger.checkpoint(this.signal);
|
|
263
|
+
members[code] = true;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
else
|
|
267
|
+
members[lower] = true;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
throw new EreSyntaxError("unclosed bracket expression", begin);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
export async function compileEre(input, ledger, signal) {
|
|
274
|
+
ledger.check(signal);
|
|
275
|
+
const { pattern, quoted } = await flatten(input, ledger, signal);
|
|
276
|
+
const parser = new Parser(pattern, quoted, ledger, signal);
|
|
277
|
+
const root = await parser.expression(0);
|
|
278
|
+
if (parser.offset !== pattern.length)
|
|
279
|
+
throw new EreSyntaxError("unmatched closing group", parser.offset);
|
|
280
|
+
ledger.charge("allocationUnits", 3, signal);
|
|
281
|
+
const program = Object.freeze({ pattern, groups: parser.groups });
|
|
282
|
+
programs.set(program, { root, ledger });
|
|
283
|
+
return program;
|
|
284
|
+
}
|
|
285
|
+
export function resolveEreProgram(program, ledger) {
|
|
286
|
+
const entry = programs.get(program);
|
|
287
|
+
if (!entry || entry.ledger !== ledger)
|
|
288
|
+
throw new TypeError("ERE program is not bound to this invocation ledger");
|
|
289
|
+
return entry.root;
|
|
290
|
+
}
|
|
291
|
+
//# sourceMappingURL=syntax.js.map
|