@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,1023 @@
|
|
|
1
|
+
import { ShellSyntaxError } from "./types.js";
|
|
2
|
+
import { arithmeticEnd, prepareArithmetic } from "./arithmetic.js";
|
|
3
|
+
import { arraySelector, compoundEntry, compoundHead, elementAssignment, getArrayAssignment, scalarAssignmentName, setArrayAssignment, setArraySelector, setQuoteMarker } from "./arrays/syntax.js";
|
|
4
|
+
import { conditionalBinary, conditionalUnary } from "./conditional.js";
|
|
5
|
+
import { shellValueFromBytes, shellValueText } from "../contracts/value.js";
|
|
6
|
+
export class HereDocumentSyntaxError extends Error {
|
|
7
|
+
diagnostic;
|
|
8
|
+
constructor(diagnostic) {
|
|
9
|
+
super(diagnostic);
|
|
10
|
+
this.diagnostic = diagnostic;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
function printedSimpleLines(lists, separators) {
|
|
14
|
+
const printedLines = new Map();
|
|
15
|
+
let line = 1;
|
|
16
|
+
for (let index = 0; index < lists.length; index++) {
|
|
17
|
+
for (const pipeline of lists[index].pipelines)
|
|
18
|
+
for (const command of pipeline.commands) {
|
|
19
|
+
if (command.kind !== "simple" || !command.words.length || command.redirects.some(redirect => redirect.document))
|
|
20
|
+
return {};
|
|
21
|
+
const words = [...command.words, ...command.redirects.map(redirect => redirect.target)];
|
|
22
|
+
if (words.some(word => word.printedNewlines === undefined))
|
|
23
|
+
return {};
|
|
24
|
+
printedLines.set(command, line + command.words[0].printedNewlines);
|
|
25
|
+
for (const word of words)
|
|
26
|
+
line += word.printedNewlines;
|
|
27
|
+
}
|
|
28
|
+
if (index < lists.length - 1 && separators[index])
|
|
29
|
+
line++;
|
|
30
|
+
}
|
|
31
|
+
return { printedLines, printedNewlines: line - 1 };
|
|
32
|
+
}
|
|
33
|
+
class IncompleteShellInput extends Error {
|
|
34
|
+
}
|
|
35
|
+
class Lexer {
|
|
36
|
+
source;
|
|
37
|
+
depth;
|
|
38
|
+
warnings;
|
|
39
|
+
lineOffset;
|
|
40
|
+
byteLocale;
|
|
41
|
+
documentLine;
|
|
42
|
+
partial;
|
|
43
|
+
position = 0;
|
|
44
|
+
printedNewlineReduction = 0;
|
|
45
|
+
unprintedWords = 0;
|
|
46
|
+
delimiterOperator;
|
|
47
|
+
conditional = false;
|
|
48
|
+
conditionalPattern;
|
|
49
|
+
documents = [];
|
|
50
|
+
constructor(source, depth, warnings = [], lineOffset = 0, byteLocale = false, documentLine, partial = false) {
|
|
51
|
+
this.source = source;
|
|
52
|
+
this.depth = depth;
|
|
53
|
+
this.warnings = warnings;
|
|
54
|
+
this.lineOffset = lineOffset;
|
|
55
|
+
this.byteLocale = byteLocale;
|
|
56
|
+
this.documentLine = documentLine;
|
|
57
|
+
this.partial = partial;
|
|
58
|
+
if (depth > 64)
|
|
59
|
+
throw new ShellSyntaxError("Syntax nesting exceeds 64", 0);
|
|
60
|
+
}
|
|
61
|
+
lineAt(position) { return this.lineOffset + this.source.slice(0, position).split("\n").length; }
|
|
62
|
+
error(message, unclosedQuote) {
|
|
63
|
+
throw new ShellSyntaxError(message, this.position, 2, undefined, unclosedQuote);
|
|
64
|
+
}
|
|
65
|
+
next() {
|
|
66
|
+
while (this.position < this.source.length) {
|
|
67
|
+
const current = this.source[this.position];
|
|
68
|
+
if (current === " " || current === "\t" || this.conditional && current === "\n") {
|
|
69
|
+
this.position++;
|
|
70
|
+
}
|
|
71
|
+
else if (current === "\\" && this.source[this.position + 1] === "\n") {
|
|
72
|
+
this.position += 2;
|
|
73
|
+
}
|
|
74
|
+
else if (current === "#") {
|
|
75
|
+
while (this.position < this.source.length && this.source[this.position] !== "\n")
|
|
76
|
+
this.position++;
|
|
77
|
+
}
|
|
78
|
+
else
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
const offset = this.position;
|
|
82
|
+
if (offset === this.source.length) {
|
|
83
|
+
if (this.partial)
|
|
84
|
+
throw new IncompleteShellInput();
|
|
85
|
+
this.readDocuments();
|
|
86
|
+
return { kind: "end", value: "", offset, end: offset };
|
|
87
|
+
}
|
|
88
|
+
let logical = "";
|
|
89
|
+
let cursor = offset;
|
|
90
|
+
const ends = [];
|
|
91
|
+
while (cursor < this.source.length && logical.length < 3) {
|
|
92
|
+
if (this.source.startsWith("\\\n", cursor)) {
|
|
93
|
+
cursor += 2;
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
logical += this.source[cursor++];
|
|
97
|
+
ends.push(cursor);
|
|
98
|
+
}
|
|
99
|
+
const operator = this.conditionalPattern ? undefined : /^(?:;;&|<<<|<<-|&>>|;&|&&|\|\||\|&|>>|>&|<&|>\||<<|;;|&>|[;\n|&()<>])/u.exec(logical)?.[0];
|
|
100
|
+
if (operator) {
|
|
101
|
+
if (["&", "&>>"].includes(operator))
|
|
102
|
+
this.error(`Unsupported operator ${operator}`);
|
|
103
|
+
this.position = ends[operator.length - 1];
|
|
104
|
+
if (operator === "<<" || operator === "<<-")
|
|
105
|
+
this.delimiterOperator = operator;
|
|
106
|
+
if (operator === "\n")
|
|
107
|
+
this.readDocuments();
|
|
108
|
+
return { kind: "operator", value: operator, offset, end: this.position };
|
|
109
|
+
}
|
|
110
|
+
const delimiterOperator = this.delimiterOperator;
|
|
111
|
+
this.delimiterOperator = undefined;
|
|
112
|
+
const word = this.word(undefined, false, delimiterOperator !== undefined);
|
|
113
|
+
if (this.position <= offset)
|
|
114
|
+
this.error("Tokenizer made no progress");
|
|
115
|
+
let document;
|
|
116
|
+
if (delimiterOperator) {
|
|
117
|
+
document = {
|
|
118
|
+
delimiter: word.parts.map((part) => part.kind === "text" ? part.value : "").join(""),
|
|
119
|
+
quoted: word.parts.some((part) => part.quoted), stripTabs: delimiterOperator === "<<-", offset,
|
|
120
|
+
body: "", endLine: this.lineAt(offset), depth: this.depth,
|
|
121
|
+
};
|
|
122
|
+
this.documents.push(document);
|
|
123
|
+
}
|
|
124
|
+
return { kind: "word", value: word.plain ?? "", offset, end: this.position, word: { ...word, spelling: this.source.slice(offset, this.position) }, ...(document ? { document } : {}) };
|
|
125
|
+
}
|
|
126
|
+
readDocuments() {
|
|
127
|
+
for (const document of this.documents.splice(0)) {
|
|
128
|
+
let body = "";
|
|
129
|
+
let terminated = false;
|
|
130
|
+
while (this.position < this.source.length) {
|
|
131
|
+
let line = "";
|
|
132
|
+
while (this.position < this.source.length) {
|
|
133
|
+
const current = this.source[this.position++];
|
|
134
|
+
if (!document.quoted && current === "\\" && this.position < this.source.length) {
|
|
135
|
+
const next = this.source[this.position++];
|
|
136
|
+
if (next !== "\n")
|
|
137
|
+
line += current + next;
|
|
138
|
+
}
|
|
139
|
+
else if (current === "\n")
|
|
140
|
+
break;
|
|
141
|
+
else
|
|
142
|
+
line += current;
|
|
143
|
+
}
|
|
144
|
+
if (line === document.delimiter || (document.stripTabs && line.replace(/^\t+/u, "") === document.delimiter)) {
|
|
145
|
+
terminated = true;
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
body += (document.stripTabs ? line.replace(/^\t+/u, "") : line) + "\n";
|
|
149
|
+
}
|
|
150
|
+
if (!terminated && this.partial)
|
|
151
|
+
throw new IncompleteShellInput();
|
|
152
|
+
if (!terminated)
|
|
153
|
+
this.warnings.push(`here-document at offset ${document.offset} delimited by end-of-file (wanted ${JSON.stringify(document.delimiter)})`);
|
|
154
|
+
document.body = body;
|
|
155
|
+
document.endLine = this.lineAt(Math.max(0, this.position - 1));
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
*documentWords() {
|
|
159
|
+
let text = "";
|
|
160
|
+
while (this.position < this.source.length) {
|
|
161
|
+
const current = this.source[this.position];
|
|
162
|
+
if (current === "$" || current === "`") {
|
|
163
|
+
if (text) {
|
|
164
|
+
yield { offset: 0, parts: [{ kind: "text", value: text, quoted: true }] };
|
|
165
|
+
text = "";
|
|
166
|
+
}
|
|
167
|
+
const offset = this.position;
|
|
168
|
+
const parts = [];
|
|
169
|
+
try {
|
|
170
|
+
this.expansion(parts, true);
|
|
171
|
+
}
|
|
172
|
+
catch (error) {
|
|
173
|
+
if (!(error instanceof ShellSyntaxError) || /nesting|exceeds/u.test(error.reason))
|
|
174
|
+
throw error;
|
|
175
|
+
if (this.source.startsWith("${", offset))
|
|
176
|
+
throw new HereDocumentSyntaxError(`shell: line ${this.documentLine}: ${this.source}: bad substitution\n`);
|
|
177
|
+
if (current === "`")
|
|
178
|
+
throw new HereDocumentSyntaxError(`shell: line ${this.documentLine}: bad substitution: no closing "\`" in ${this.source.slice(offset)}\n`);
|
|
179
|
+
if (this.source.startsWith("$((", offset) && error.reason === "Unterminated arithmetic expression")
|
|
180
|
+
throw new HereDocumentSyntaxError(`shell: line ${this.documentLine}: bad substitution: no closing \`)' in ${this.source}\n`);
|
|
181
|
+
throw new HereDocumentSyntaxError(`shell: line ${this.documentLine}: ${error.message}\n`);
|
|
182
|
+
}
|
|
183
|
+
yield { offset, parts };
|
|
184
|
+
}
|
|
185
|
+
else if (current === "\\" && /[$`\\]/u.test(this.source[this.position + 1] ?? "")) {
|
|
186
|
+
text += this.source[this.position + 1];
|
|
187
|
+
this.position += 2;
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
text += current;
|
|
191
|
+
this.position++;
|
|
192
|
+
}
|
|
193
|
+
if (text.length >= 1024) {
|
|
194
|
+
yield { offset: 0, parts: [{ kind: "text", value: text, quoted: true }] };
|
|
195
|
+
text = "";
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
if (text)
|
|
199
|
+
yield { offset: 0, parts: [{ kind: "text", value: text, quoted: true }] };
|
|
200
|
+
}
|
|
201
|
+
documentSubstitutionError(source, error, backtick = false) {
|
|
202
|
+
const line = this.documentLine + source.slice(0, error.offset).split("\n").length;
|
|
203
|
+
if (error.offset >= source.length) {
|
|
204
|
+
return new HereDocumentSyntaxError(backtick
|
|
205
|
+
? `shell: command substitution: line ${line}: syntax error: unexpected end of file\n`
|
|
206
|
+
: `shell: command substitution: line ${line}: unexpected EOF while looking for matching \`)'\n`);
|
|
207
|
+
}
|
|
208
|
+
const token = /^[;&|()<>]|^[^\s;&|()<>]+/u.exec(source.slice(error.offset))?.[0] ?? "newline";
|
|
209
|
+
const sourceLine = source.split("\n")[source.slice(0, error.offset).split("\n").length - 1] ?? "";
|
|
210
|
+
return new HereDocumentSyntaxError(`shell: command substitution: line ${line}: syntax error near unexpected token \`${token}'\nshell: command substitution: line ${line}: \`${sourceLine}'\n`);
|
|
211
|
+
}
|
|
212
|
+
literalExpansion() {
|
|
213
|
+
const backtick = this.source[this.position] === "`";
|
|
214
|
+
const opening = this.source[this.position + 1];
|
|
215
|
+
if (!backtick && opening !== "(" && opening !== "{")
|
|
216
|
+
return this.source[this.position++];
|
|
217
|
+
let value = backtick ? "`" : `$${opening}`;
|
|
218
|
+
this.position += backtick ? 1 : 2;
|
|
219
|
+
const closers = [backtick ? "`" : opening === "(" ? ")" : "}"];
|
|
220
|
+
let quote = "";
|
|
221
|
+
while (this.position < this.source.length) {
|
|
222
|
+
const current = this.source[this.position++];
|
|
223
|
+
if (current === "\\" && quote !== "'") {
|
|
224
|
+
const next = this.source[this.position++];
|
|
225
|
+
if (next === undefined)
|
|
226
|
+
this.error("Trailing delimiter escape");
|
|
227
|
+
if (next !== "\n")
|
|
228
|
+
value += quote === '"' && !/[$`"\\]/u.test(next) ? current + next : next;
|
|
229
|
+
}
|
|
230
|
+
else if (quote) {
|
|
231
|
+
if (current === quote)
|
|
232
|
+
quote = "";
|
|
233
|
+
else
|
|
234
|
+
value += current;
|
|
235
|
+
}
|
|
236
|
+
else if (current === "'" || current === '"')
|
|
237
|
+
quote = current;
|
|
238
|
+
else {
|
|
239
|
+
value += current;
|
|
240
|
+
if (current === closers.at(-1)) {
|
|
241
|
+
closers.pop();
|
|
242
|
+
if (!closers.length)
|
|
243
|
+
return value;
|
|
244
|
+
}
|
|
245
|
+
else if ((current === "(" && (closers.at(-1) === ")" || this.source[this.position - 2] === "$"))
|
|
246
|
+
|| (current === "{" && (closers.at(-1) === "}" || this.source[this.position - 2] === "$"))) {
|
|
247
|
+
closers.push(current === "(" ? ")" : "}");
|
|
248
|
+
if (closers.length + this.depth > 64)
|
|
249
|
+
this.error("Syntax nesting exceeds 64");
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
this.error("Unterminated delimiter expansion syntax");
|
|
254
|
+
}
|
|
255
|
+
word(terminator, enclosingQuoted = false, literal = false, arithmetic = false) {
|
|
256
|
+
const offset = this.position;
|
|
257
|
+
const reduction = this.printedNewlineReduction;
|
|
258
|
+
const unprinted = this.unprintedWords;
|
|
259
|
+
const parts = [];
|
|
260
|
+
let parentheses = 0;
|
|
261
|
+
let conditionals = 0;
|
|
262
|
+
let patternParentheses = 0;
|
|
263
|
+
let regexBracket = false;
|
|
264
|
+
let regexBracketFirst = false;
|
|
265
|
+
let regexBracketNegation = false;
|
|
266
|
+
let regexClass = "";
|
|
267
|
+
const conditionalPattern = terminator === undefined ? this.conditionalPattern : undefined;
|
|
268
|
+
let plain = true;
|
|
269
|
+
const text = (value, quoted, synthetic = false) => {
|
|
270
|
+
const projection = shellValueText(value);
|
|
271
|
+
if (conditionalPattern === "regex" && regexBracket && quoted && projection.length) {
|
|
272
|
+
regexBracketFirst = false;
|
|
273
|
+
regexBracketNegation = false;
|
|
274
|
+
}
|
|
275
|
+
const previous = parts.at(-1);
|
|
276
|
+
if (previous?.kind === "text" && previous.quoted === quoted && !previous.byteValue && typeof value === "string") {
|
|
277
|
+
previous.value += value;
|
|
278
|
+
if (!synthetic)
|
|
279
|
+
setQuoteMarker(previous, false);
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
const part = { kind: "text", value: projection, quoted, ...(typeof value === "string" ? {} : { byteValue: value }) };
|
|
283
|
+
setQuoteMarker(part, synthetic);
|
|
284
|
+
parts.push(part);
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
while (this.position < this.source.length) {
|
|
288
|
+
const current = this.source[this.position];
|
|
289
|
+
if (conditionalPattern) {
|
|
290
|
+
if (/[ \t\n;]/u.test(current))
|
|
291
|
+
break;
|
|
292
|
+
const bracketMaterial = conditionalPattern === "regex" && (regexBracket || current === "[");
|
|
293
|
+
if (bracketMaterial) {
|
|
294
|
+
if (!regexBracket) {
|
|
295
|
+
regexBracket = true;
|
|
296
|
+
regexBracketFirst = true;
|
|
297
|
+
regexBracketNegation = true;
|
|
298
|
+
}
|
|
299
|
+
else if (regexClass) {
|
|
300
|
+
if (current === "]" && this.source[this.position - 1] === regexClass)
|
|
301
|
+
regexClass = "";
|
|
302
|
+
}
|
|
303
|
+
else if (current === "[" && [":", ".", "="].includes(this.source[this.position + 1] ?? "")) {
|
|
304
|
+
regexClass = this.source[this.position + 1];
|
|
305
|
+
regexBracketFirst = false;
|
|
306
|
+
}
|
|
307
|
+
else if (current === "]" && !regexBracketFirst)
|
|
308
|
+
regexBracket = false;
|
|
309
|
+
else if (current === "^" && regexBracketFirst && regexBracketNegation)
|
|
310
|
+
regexBracketNegation = false;
|
|
311
|
+
else {
|
|
312
|
+
regexBracketFirst = false;
|
|
313
|
+
regexBracketNegation = false;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
else if (current === "(" && (conditionalPattern === "regex" || patternParentheses > 0 || "?*+@!".includes(this.source[this.position - 1] ?? " "))) {
|
|
317
|
+
if (++patternParentheses > 64)
|
|
318
|
+
this.error("Conditional syntax nesting exceeds 64");
|
|
319
|
+
}
|
|
320
|
+
else if (current === ")" && patternParentheses > 0)
|
|
321
|
+
patternParentheses--;
|
|
322
|
+
else if (/[()<>]/u.test(current) || patternParentheses === 0 && (this.source.startsWith("&&", this.position) || this.source.startsWith("||", this.position)))
|
|
323
|
+
break;
|
|
324
|
+
}
|
|
325
|
+
else if (terminator ? terminator.includes(current) && (!arithmetic || current !== ":" || parentheses === 0 && conditionals === 0) : /[ \t\n;|&()<>]/u.test(current))
|
|
326
|
+
break;
|
|
327
|
+
if (current === "$" && this.source[this.position + 1] === "'" && !enclosingQuoted && !literal) {
|
|
328
|
+
plain = false;
|
|
329
|
+
this.unprintedWords++;
|
|
330
|
+
text(this.ansiWord(), true);
|
|
331
|
+
}
|
|
332
|
+
else if (current === "'" && !enclosingQuoted) {
|
|
333
|
+
plain = false;
|
|
334
|
+
const end = this.source.indexOf("'", this.position + 1);
|
|
335
|
+
if (end === -1)
|
|
336
|
+
this.error("Unterminated single quote", { quote: "'", line: this.lineAt(this.position) });
|
|
337
|
+
text(this.source.slice(this.position + 1, end), true);
|
|
338
|
+
this.position = end + 1;
|
|
339
|
+
}
|
|
340
|
+
else if (current === '"') {
|
|
341
|
+
plain = false;
|
|
342
|
+
const quoteLine = this.lineAt(this.position);
|
|
343
|
+
this.position++;
|
|
344
|
+
text("", true, true);
|
|
345
|
+
const quoteParts = parts.length;
|
|
346
|
+
while (this.position < this.source.length && this.source[this.position] !== '"') {
|
|
347
|
+
const inner = this.source[this.position];
|
|
348
|
+
if (!literal && (inner === "$" || inner === "`"))
|
|
349
|
+
this.expansion(parts, true);
|
|
350
|
+
else if (inner === "\\" && /[$`"\\\n]/u.test(this.source[this.position + 1] ?? "")) {
|
|
351
|
+
const escaped = this.source[this.position + 1];
|
|
352
|
+
if (escaped !== "\n")
|
|
353
|
+
text(escaped, true);
|
|
354
|
+
else
|
|
355
|
+
this.printedNewlineReduction++;
|
|
356
|
+
this.position += 2;
|
|
357
|
+
}
|
|
358
|
+
else {
|
|
359
|
+
text(inner, true);
|
|
360
|
+
this.position++;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
if (this.source[this.position] !== '"')
|
|
364
|
+
this.error("Unterminated double quote", { quote: '"', line: quoteLine });
|
|
365
|
+
if (parts.length === quoteParts)
|
|
366
|
+
setQuoteMarker(parts.at(-1), false);
|
|
367
|
+
this.position++;
|
|
368
|
+
}
|
|
369
|
+
else if (current === "\\") {
|
|
370
|
+
if (this.source[this.position + 1] !== "\n")
|
|
371
|
+
plain = false;
|
|
372
|
+
this.position++;
|
|
373
|
+
if (this.position === this.source.length)
|
|
374
|
+
this.error("Trailing escape");
|
|
375
|
+
if (this.source[this.position] !== "\n")
|
|
376
|
+
text(this.source[this.position], true);
|
|
377
|
+
else
|
|
378
|
+
this.printedNewlineReduction++;
|
|
379
|
+
this.position++;
|
|
380
|
+
}
|
|
381
|
+
else if (current === "$" || current === "`") {
|
|
382
|
+
plain = false;
|
|
383
|
+
if (literal) {
|
|
384
|
+
if (current === "$" && ["'", '"'].includes(this.source[this.position + 1] ?? ""))
|
|
385
|
+
this.error("Unsupported shell quoting in here-document delimiter");
|
|
386
|
+
text(this.literalExpansion(), current === "`");
|
|
387
|
+
}
|
|
388
|
+
else
|
|
389
|
+
this.expansion(parts, enclosingQuoted);
|
|
390
|
+
}
|
|
391
|
+
else {
|
|
392
|
+
if (arithmetic) {
|
|
393
|
+
if (current === "(")
|
|
394
|
+
parentheses++;
|
|
395
|
+
else if (current === ")")
|
|
396
|
+
parentheses--;
|
|
397
|
+
else if (current === "?")
|
|
398
|
+
conditionals++;
|
|
399
|
+
else if (current === ":" && conditionals > 0)
|
|
400
|
+
conditionals--;
|
|
401
|
+
}
|
|
402
|
+
text(current, false);
|
|
403
|
+
this.position++;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
if (conditionalPattern === "regex" && patternParentheses > 0)
|
|
407
|
+
this.error("Unterminated conditional regular expression group");
|
|
408
|
+
const printedNewlines = this.source.slice(offset, this.position).split("\n").length - 1 - (this.printedNewlineReduction - reduction);
|
|
409
|
+
return { parts, offset, ...(unprinted === this.unprintedWords ? { printedNewlines } : {}), ...(plain ? { plain: parts.map((part) => part.kind === "text" ? part.value : "").join("") } : {}) };
|
|
410
|
+
}
|
|
411
|
+
ansiWord() {
|
|
412
|
+
const quoteLine = this.lineAt(this.position);
|
|
413
|
+
this.position += 2;
|
|
414
|
+
const bytes = [];
|
|
415
|
+
const encoder = new TextEncoder();
|
|
416
|
+
const escapes = { a: 7, b: 8, e: 27, E: 27, f: 12, n: 10, r: 13, t: 9, v: 11, "\\": 92, "'": 39, '"': 34, "?": 63 };
|
|
417
|
+
while (this.position < this.source.length) {
|
|
418
|
+
const character = String.fromCodePoint(this.source.codePointAt(this.position));
|
|
419
|
+
this.position += character.length;
|
|
420
|
+
if (character === "'") {
|
|
421
|
+
const nul = bytes.indexOf(0);
|
|
422
|
+
const raw = Uint8Array.from(nul < 0 ? bytes : bytes.slice(0, nul));
|
|
423
|
+
try {
|
|
424
|
+
return new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }).decode(raw);
|
|
425
|
+
}
|
|
426
|
+
catch (error) {
|
|
427
|
+
if (!(error instanceof TypeError) || !("code" in error) || error.code !== "ERR_ENCODING_INVALID_ENCODED_DATA")
|
|
428
|
+
throw error;
|
|
429
|
+
return shellValueFromBytes(raw);
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
if (character !== "\\") {
|
|
433
|
+
bytes.push(...encoder.encode(character));
|
|
434
|
+
continue;
|
|
435
|
+
}
|
|
436
|
+
const escape = this.source[this.position++];
|
|
437
|
+
if (escape === undefined)
|
|
438
|
+
this.error("Unterminated ANSI-C quote", { quote: "'", line: quoteLine });
|
|
439
|
+
if (escapes[escape] !== undefined) {
|
|
440
|
+
bytes.push(escapes[escape]);
|
|
441
|
+
continue;
|
|
442
|
+
}
|
|
443
|
+
if (/[0-7]/u.test(escape)) {
|
|
444
|
+
const digits = escape + (/^[0-7]{0,2}/u.exec(this.source.slice(this.position))?.[0] ?? "");
|
|
445
|
+
this.position += digits.length - 1;
|
|
446
|
+
bytes.push(parseInt(digits, 8) & 255);
|
|
447
|
+
}
|
|
448
|
+
else if (["x", "u", "U"].includes(escape)) {
|
|
449
|
+
const maximum = escape === "x" ? 2 : escape === "u" ? 4 : 8;
|
|
450
|
+
const digits = new RegExp(`^[0-9a-fA-F]{1,${maximum}}`, "u").exec(this.source.slice(this.position))?.[0];
|
|
451
|
+
if (!digits) {
|
|
452
|
+
bytes.push(92, escape.charCodeAt(0));
|
|
453
|
+
continue;
|
|
454
|
+
}
|
|
455
|
+
this.position += digits.length;
|
|
456
|
+
const code = parseInt(digits, 16);
|
|
457
|
+
if (escape === "x")
|
|
458
|
+
bytes.push(code);
|
|
459
|
+
else if (this.byteLocale && code > 127) {
|
|
460
|
+
bytes.push(...encoder.encode(`\\${code <= 0xffff ? "u" : "U"}${code.toString(16).toUpperCase().padStart(code <= 0xffff ? 4 : 8, "0")}`));
|
|
461
|
+
}
|
|
462
|
+
else {
|
|
463
|
+
if (code > 0x10ffff || (code >= 0xd800 && code <= 0xdfff))
|
|
464
|
+
this.error("Unsupported non-scalar ANSI-C Unicode escape");
|
|
465
|
+
bytes.push(...encoder.encode(String.fromCodePoint(code)));
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
else if (escape === "c" && this.source[this.position] !== "'" && this.position < this.source.length) {
|
|
469
|
+
const control = this.source[this.position++];
|
|
470
|
+
if (control === "\\" && this.source[this.position] === "\\")
|
|
471
|
+
this.position++;
|
|
472
|
+
bytes.push(control === "?" ? 127 : control.toUpperCase().charCodeAt(0) & 31);
|
|
473
|
+
}
|
|
474
|
+
else
|
|
475
|
+
bytes.push(92, ...encoder.encode(escape));
|
|
476
|
+
}
|
|
477
|
+
this.error("Unterminated ANSI-C quote", { quote: "'", line: quoteLine });
|
|
478
|
+
}
|
|
479
|
+
expansion(parts, quoted) {
|
|
480
|
+
const line = this.documentLine ?? this.lineAt(this.position);
|
|
481
|
+
if (this.source[this.position] === "`") {
|
|
482
|
+
this.position++;
|
|
483
|
+
let source = "";
|
|
484
|
+
while (this.position < this.source.length && this.source[this.position] !== "`") {
|
|
485
|
+
if (this.source[this.position] === "\\" && /[$`\\]/u.test(this.source[this.position + 1] ?? ""))
|
|
486
|
+
this.position++;
|
|
487
|
+
source += this.source[this.position++];
|
|
488
|
+
}
|
|
489
|
+
if (this.source[this.position] !== "`")
|
|
490
|
+
this.error("Unterminated command substitution");
|
|
491
|
+
this.position++;
|
|
492
|
+
try {
|
|
493
|
+
parts.push({ kind: "substitution", script: parseSource(source, this.depth + 1, this.warnings, line - 1, this.byteLocale), line, quoted });
|
|
494
|
+
}
|
|
495
|
+
catch (error) {
|
|
496
|
+
if (this.documentLine === undefined || !(error instanceof ShellSyntaxError) || /nesting|exceeds/u.test(error.reason))
|
|
497
|
+
throw error;
|
|
498
|
+
parts.push({ kind: "failed-substitution", diagnostic: this.documentSubstitutionError(source, error, true).diagnostic, quoted });
|
|
499
|
+
}
|
|
500
|
+
return;
|
|
501
|
+
}
|
|
502
|
+
this.position++;
|
|
503
|
+
if (["$", "!"].includes(this.source[this.position] ?? "") || (!quoted && ["'", '"'].includes(this.source[this.position] ?? "")))
|
|
504
|
+
this.error("Unsupported shell quoting or special parameter");
|
|
505
|
+
if (this.source.startsWith("((", this.position)) {
|
|
506
|
+
const start = this.position + 2;
|
|
507
|
+
const end = arithmeticEnd(this.source, start);
|
|
508
|
+
const source = this.source.slice(start, end);
|
|
509
|
+
parts.push({ kind: "arithmetic", expression: prepareArithmetic(source), source, line, quoted });
|
|
510
|
+
this.position = end + 2;
|
|
511
|
+
}
|
|
512
|
+
else if (this.source[this.position] === "(") {
|
|
513
|
+
const start = this.position + 1;
|
|
514
|
+
let nested;
|
|
515
|
+
let script;
|
|
516
|
+
try {
|
|
517
|
+
nested = new Parser(this.source.slice(start), this.depth + 1, this.warnings, this.lineAt(start) - 1, undefined, this.byteLocale);
|
|
518
|
+
script = nested.script(new Set([")"]));
|
|
519
|
+
}
|
|
520
|
+
catch (error) {
|
|
521
|
+
if (this.documentLine !== undefined && error instanceof ShellSyntaxError && !/nesting|exceeds/u.test(error.reason))
|
|
522
|
+
throw this.documentSubstitutionError(this.source.slice(start), error);
|
|
523
|
+
if (error instanceof ShellSyntaxError && !/Unterminated|nesting|exceeds/u.test(error.reason))
|
|
524
|
+
throw new ShellSyntaxError(error.reason, start + error.offset, 127);
|
|
525
|
+
throw error;
|
|
526
|
+
}
|
|
527
|
+
if (nested.current.value !== ")") {
|
|
528
|
+
if (this.documentLine !== undefined)
|
|
529
|
+
throw this.documentSubstitutionError(this.source.slice(start), new ShellSyntaxError("Unterminated command substitution", nested.current.offset));
|
|
530
|
+
this.error("Unterminated command substitution");
|
|
531
|
+
}
|
|
532
|
+
if (nested.lexer.documents.length)
|
|
533
|
+
this.error("Here-document requires a newline before closing command substitution");
|
|
534
|
+
this.position += nested.current.end + 1;
|
|
535
|
+
if (script.printedNewlines === undefined)
|
|
536
|
+
this.unprintedWords++;
|
|
537
|
+
else
|
|
538
|
+
this.printedNewlineReduction += this.source.slice(start, this.position - 1).split("\n").length - 1 - script.printedNewlines;
|
|
539
|
+
parts.push({ kind: "substitution", script, line, sourceLine: script.line ?? line, quoted });
|
|
540
|
+
}
|
|
541
|
+
else if (this.source[this.position] === "{") {
|
|
542
|
+
this.position++;
|
|
543
|
+
const parameterStart = this.position - 2;
|
|
544
|
+
const length = this.source[this.position] === "#" && /[a-zA-Z_]/u.test(this.source[this.position + 1] ?? "");
|
|
545
|
+
if (length)
|
|
546
|
+
this.position++;
|
|
547
|
+
const name = /^(?:[a-zA-Z_][a-zA-Z_0-9]*|[0-9]+|[?@*#-])/u.exec(this.source.slice(this.position))?.[0];
|
|
548
|
+
if (!name)
|
|
549
|
+
this.error("Unsupported parameter expansion");
|
|
550
|
+
this.position += name.length;
|
|
551
|
+
let selector;
|
|
552
|
+
if (this.source[this.position] === "[") {
|
|
553
|
+
if (!/^[a-zA-Z_][a-zA-Z_0-9]*$/u.test(name))
|
|
554
|
+
this.error("Unsupported indexed-array parameter");
|
|
555
|
+
const start = ++this.position;
|
|
556
|
+
const end = this.source.indexOf("]", start);
|
|
557
|
+
if (end < 0)
|
|
558
|
+
this.error("Unterminated indexed-array subscript");
|
|
559
|
+
selector = arraySelector(this.source.slice(start, end), start);
|
|
560
|
+
this.position = end + 1;
|
|
561
|
+
if (this.source[this.position] !== "}")
|
|
562
|
+
this.error("Unsupported indexed-array operator");
|
|
563
|
+
}
|
|
564
|
+
const operator = /^(?::[-=+?]|##|%%|\/\/|\/[#%]?|[-=+?#%])/u.exec(this.source.slice(this.position))?.[0];
|
|
565
|
+
let alternate;
|
|
566
|
+
let replacement;
|
|
567
|
+
let substring;
|
|
568
|
+
if (operator) {
|
|
569
|
+
if (length)
|
|
570
|
+
this.error("Invalid length expansion");
|
|
571
|
+
this.position += operator.length;
|
|
572
|
+
alternate = this.word(operator.startsWith("/") ? "/}" : "}", quoted && !["#", "##", "%", "%%"].includes(operator) && !operator.startsWith("/"));
|
|
573
|
+
if (operator.startsWith("/") && this.source[this.position] === "/") {
|
|
574
|
+
this.position++;
|
|
575
|
+
replacement = this.word("}");
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
else if (this.source[this.position] === ":") {
|
|
579
|
+
if (length || !/^(?:[a-zA-Z_][a-zA-Z_0-9]*|[0-9]+)$/u.test(name))
|
|
580
|
+
this.error("Unsupported non-scalar substring expansion");
|
|
581
|
+
this.position++;
|
|
582
|
+
const offset = this.word(":}", true, false, true);
|
|
583
|
+
let substringLength;
|
|
584
|
+
if (this.source[this.position] === ":") {
|
|
585
|
+
this.position++;
|
|
586
|
+
substringLength = this.word("}", true, false, true);
|
|
587
|
+
}
|
|
588
|
+
substring = { offset, ...(substringLength ? { length: substringLength } : {}), source: this.source.slice(parameterStart, this.position + 1) };
|
|
589
|
+
}
|
|
590
|
+
if (this.source[this.position] !== "}")
|
|
591
|
+
this.error("Unterminated or unsupported parameter expansion");
|
|
592
|
+
this.position++;
|
|
593
|
+
const part = { kind: "variable", name, quoted, line, ...(length ? { length } : {}), ...(operator ? { operator, alternate: alternate } : {}), ...(replacement ? { replacement } : {}), ...(substring ? { substring } : {}) };
|
|
594
|
+
if (selector)
|
|
595
|
+
setArraySelector(part, selector);
|
|
596
|
+
parts.push(part);
|
|
597
|
+
}
|
|
598
|
+
else {
|
|
599
|
+
const name = /^(?:[a-zA-Z_][a-zA-Z_0-9]*|[?@*#0-9-])/u.exec(this.source.slice(this.position))?.[0];
|
|
600
|
+
if (name) {
|
|
601
|
+
this.position += name.length;
|
|
602
|
+
parts.push({ kind: "variable", name, quoted, line });
|
|
603
|
+
}
|
|
604
|
+
else
|
|
605
|
+
parts.push({ kind: "text", value: "$", quoted });
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
class Parser {
|
|
610
|
+
lexer;
|
|
611
|
+
current;
|
|
612
|
+
lookahead;
|
|
613
|
+
nesting = 0;
|
|
614
|
+
openCommands = [];
|
|
615
|
+
constructor(source, depth, warnings = [], lineOffset = 0, position, byteLocale = false, partial = false) {
|
|
616
|
+
if (position === undefined && depth === 0 && source.includes("\0"))
|
|
617
|
+
throw new ShellSyntaxError("NUL bytes are not valid shell source", source.indexOf("\0"));
|
|
618
|
+
this.lexer = new Lexer(source, depth, warnings, lineOffset, byteLocale, undefined, partial);
|
|
619
|
+
this.lexer.position = position ?? 0;
|
|
620
|
+
this.current = this.lexer.next();
|
|
621
|
+
}
|
|
622
|
+
error(message) {
|
|
623
|
+
const command = this.current.kind === "end" ? this.openCommands.findLast((command) => ["{", "if", "while", "until", "for", "case"].includes(command.name)) : undefined;
|
|
624
|
+
throw new ShellSyntaxError(message, this.current.offset, 2, command);
|
|
625
|
+
}
|
|
626
|
+
advance() {
|
|
627
|
+
const previous = this.current;
|
|
628
|
+
this.current = this.lookahead ?? this.lexer.next();
|
|
629
|
+
this.lookahead = undefined;
|
|
630
|
+
return previous;
|
|
631
|
+
}
|
|
632
|
+
peek() {
|
|
633
|
+
return this.lookahead ??= this.lexer.next();
|
|
634
|
+
}
|
|
635
|
+
is(value) { return this.current.value === value; }
|
|
636
|
+
isEnd() { return this.current.kind === "end"; }
|
|
637
|
+
expect(value) {
|
|
638
|
+
if (!this.is(value))
|
|
639
|
+
this.error(`Expected ${value}`);
|
|
640
|
+
this.advance();
|
|
641
|
+
}
|
|
642
|
+
newlines() { while (this.is("\n"))
|
|
643
|
+
this.advance(); }
|
|
644
|
+
script(stops = new Set(), inputUnit = false) {
|
|
645
|
+
const lists = [];
|
|
646
|
+
const separators = [];
|
|
647
|
+
this.newlines();
|
|
648
|
+
const line = this.lexer.lineAt(this.current.offset);
|
|
649
|
+
while (this.current.kind !== "end" && !stops.has(this.current.value)) {
|
|
650
|
+
const pipelines = [this.pipeline()];
|
|
651
|
+
const operators = [];
|
|
652
|
+
while (this.is("&&") || this.is("||")) {
|
|
653
|
+
operators.push(this.advance().value);
|
|
654
|
+
this.newlines();
|
|
655
|
+
pipelines.push(this.pipeline());
|
|
656
|
+
}
|
|
657
|
+
lists.push({ pipelines, operators });
|
|
658
|
+
separators.push(this.is("\n"));
|
|
659
|
+
if (inputUnit && this.is("\n"))
|
|
660
|
+
break;
|
|
661
|
+
if (this.is(";") || this.is("\n")) {
|
|
662
|
+
this.advance();
|
|
663
|
+
if (inputUnit && this.is("\n"))
|
|
664
|
+
break;
|
|
665
|
+
this.newlines();
|
|
666
|
+
}
|
|
667
|
+
else if (!this.isEnd() && !this.is(")") && !(stops.has(this.current.value) && [";;", ";&", ";;&"].includes(this.current.value)))
|
|
668
|
+
this.error("Expected command separator");
|
|
669
|
+
}
|
|
670
|
+
const printed = printedSimpleLines(lists, separators);
|
|
671
|
+
return { lists, line, ...printed };
|
|
672
|
+
}
|
|
673
|
+
pipeline() {
|
|
674
|
+
const negate = this.is("!");
|
|
675
|
+
if (negate)
|
|
676
|
+
this.advance();
|
|
677
|
+
const commands = [this.command()];
|
|
678
|
+
while (this.is("|") || this.is("|&")) {
|
|
679
|
+
const operator = this.advance();
|
|
680
|
+
if (operator.value === "|&")
|
|
681
|
+
commands.at(-1).redirects.push({
|
|
682
|
+
descriptor: 2, operator: ">&", implicitPipeline: true,
|
|
683
|
+
target: { offset: operator.offset, plain: "1", spelling: "1", parts: [{ kind: "text", value: "1", quoted: false }] },
|
|
684
|
+
});
|
|
685
|
+
this.newlines();
|
|
686
|
+
commands.push(this.command());
|
|
687
|
+
}
|
|
688
|
+
return { commands, negate };
|
|
689
|
+
}
|
|
690
|
+
command() {
|
|
691
|
+
if (++this.nesting + this.lexer.depth > 64)
|
|
692
|
+
this.error("Syntax nesting exceeds 64");
|
|
693
|
+
const line = this.lexer.lineAt(this.current.offset);
|
|
694
|
+
this.openCommands.push({ name: this.current.value, line });
|
|
695
|
+
try {
|
|
696
|
+
const command = this.commandInner();
|
|
697
|
+
return { ...command, line: command.line ?? line };
|
|
698
|
+
}
|
|
699
|
+
finally {
|
|
700
|
+
this.nesting--;
|
|
701
|
+
this.openCommands.pop();
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
commandInner() {
|
|
705
|
+
let command;
|
|
706
|
+
if (this.is("[[")) {
|
|
707
|
+
const start = this.current.end;
|
|
708
|
+
this.lexer.conditional = true;
|
|
709
|
+
this.advance();
|
|
710
|
+
let nodes = 0;
|
|
711
|
+
const grouped = new WeakSet();
|
|
712
|
+
const admit = () => { if (nodes >= 4096)
|
|
713
|
+
this.error("Conditional syntax exceeds 4096 nodes"); nodes++; };
|
|
714
|
+
const operand = () => {
|
|
715
|
+
if (this.current.kind !== "word" || this.is("]]"))
|
|
716
|
+
this.error("Expected conditional operand");
|
|
717
|
+
return this.advance().word;
|
|
718
|
+
};
|
|
719
|
+
const primary = (depth) => {
|
|
720
|
+
if (depth > 64)
|
|
721
|
+
this.error("Conditional syntax nesting exceeds 64");
|
|
722
|
+
if (this.is("!")) {
|
|
723
|
+
admit();
|
|
724
|
+
this.advance();
|
|
725
|
+
const expression = primary(depth + 1);
|
|
726
|
+
return expression.kind === "not" && !grouped.has(expression) ? expression.operand : { kind: "not", operand: expression };
|
|
727
|
+
}
|
|
728
|
+
if (this.is("(")) {
|
|
729
|
+
this.advance();
|
|
730
|
+
const expression = disjunction(depth + 1);
|
|
731
|
+
this.expect(")");
|
|
732
|
+
grouped.add(expression);
|
|
733
|
+
return expression;
|
|
734
|
+
}
|
|
735
|
+
admit();
|
|
736
|
+
const first = operand();
|
|
737
|
+
if (conditionalBinary.has(this.current.value)) {
|
|
738
|
+
const operator = this.current.value;
|
|
739
|
+
this.lexer.conditionalPattern = operator === "=~" ? "regex" : ["=", "==", "!="].includes(operator) ? "pattern" : undefined;
|
|
740
|
+
this.advance();
|
|
741
|
+
this.lexer.conditionalPattern = undefined;
|
|
742
|
+
return { kind: "binary", operator, left: first, right: operand() };
|
|
743
|
+
}
|
|
744
|
+
if (first.plain !== undefined && conditionalUnary.has(first.plain) && this.current.kind === "word" && !this.is("]]"))
|
|
745
|
+
return { kind: "unary", operator: first.plain, operand: operand() };
|
|
746
|
+
return { kind: "nonempty", operand: first };
|
|
747
|
+
};
|
|
748
|
+
const conjunction = (depth) => {
|
|
749
|
+
let expression = primary(depth);
|
|
750
|
+
while (this.is("&&")) {
|
|
751
|
+
admit();
|
|
752
|
+
this.advance();
|
|
753
|
+
expression = { kind: "and", left: expression, right: primary(depth) };
|
|
754
|
+
}
|
|
755
|
+
return expression;
|
|
756
|
+
};
|
|
757
|
+
const disjunction = (depth) => {
|
|
758
|
+
let expression = conjunction(depth);
|
|
759
|
+
while (this.is("||")) {
|
|
760
|
+
admit();
|
|
761
|
+
this.advance();
|
|
762
|
+
expression = { kind: "or", left: expression, right: conjunction(depth) };
|
|
763
|
+
}
|
|
764
|
+
return expression;
|
|
765
|
+
};
|
|
766
|
+
const expression = disjunction(1);
|
|
767
|
+
if (!this.is("]]"))
|
|
768
|
+
this.error("Expected ]]");
|
|
769
|
+
const source = this.lexer.source.slice(start, this.current.offset);
|
|
770
|
+
this.lexer.conditional = false;
|
|
771
|
+
this.advance();
|
|
772
|
+
command = { kind: "conditional", expression, source, redirects: [] };
|
|
773
|
+
}
|
|
774
|
+
else if (this.is("(") && this.lexer.source.startsWith("((", this.current.offset)) {
|
|
775
|
+
const start = this.current.offset + 2;
|
|
776
|
+
const end = arithmeticEnd(this.lexer.source, start);
|
|
777
|
+
const source = this.lexer.source.slice(start, end);
|
|
778
|
+
command = { kind: "arithmetic", expression: prepareArithmetic(source), source, redirects: [] };
|
|
779
|
+
this.lexer.position = end + 2;
|
|
780
|
+
this.lookahead = undefined;
|
|
781
|
+
this.current = this.lexer.next();
|
|
782
|
+
}
|
|
783
|
+
else if (this.is("(") || this.is("{")) {
|
|
784
|
+
const subshell = this.is("(");
|
|
785
|
+
this.advance();
|
|
786
|
+
const body = this.script(new Set([subshell ? ")" : "}"]));
|
|
787
|
+
if (!body.lists.length)
|
|
788
|
+
this.error("Empty compound command");
|
|
789
|
+
this.expect(subshell ? ")" : "}");
|
|
790
|
+
command = { kind: subshell ? "subshell" : "group", body, redirects: [] };
|
|
791
|
+
}
|
|
792
|
+
else if (this.is("if")) {
|
|
793
|
+
this.advance();
|
|
794
|
+
const branches = [];
|
|
795
|
+
while (true) {
|
|
796
|
+
const condition = this.nonemptyScript(new Set(["then"]));
|
|
797
|
+
this.expect("then");
|
|
798
|
+
const body = this.nonemptyScript(new Set(["elif", "else", "fi"]));
|
|
799
|
+
branches.push({ condition, body });
|
|
800
|
+
if (!this.is("elif"))
|
|
801
|
+
break;
|
|
802
|
+
this.advance();
|
|
803
|
+
}
|
|
804
|
+
let otherwise;
|
|
805
|
+
if (this.is("else")) {
|
|
806
|
+
this.advance();
|
|
807
|
+
otherwise = this.nonemptyScript(new Set(["fi"]));
|
|
808
|
+
}
|
|
809
|
+
this.expect("fi");
|
|
810
|
+
command = { kind: "if", branches, ...(otherwise ? { otherwise } : {}), redirects: [] };
|
|
811
|
+
}
|
|
812
|
+
else if (this.is("case")) {
|
|
813
|
+
this.advance();
|
|
814
|
+
if (!this.current.word)
|
|
815
|
+
this.error("Expected case subject");
|
|
816
|
+
const subject = this.advance().word;
|
|
817
|
+
this.newlines();
|
|
818
|
+
this.expect("in");
|
|
819
|
+
this.newlines();
|
|
820
|
+
const clauses = [];
|
|
821
|
+
while (!this.is("esac")) {
|
|
822
|
+
if (this.is("("))
|
|
823
|
+
this.advance();
|
|
824
|
+
const patterns = [];
|
|
825
|
+
while (true) {
|
|
826
|
+
if (!this.current.word)
|
|
827
|
+
this.error("Expected case pattern");
|
|
828
|
+
patterns.push(this.advance().word);
|
|
829
|
+
if (!this.is("|"))
|
|
830
|
+
break;
|
|
831
|
+
this.advance();
|
|
832
|
+
}
|
|
833
|
+
this.expect(")");
|
|
834
|
+
const body = this.script(new Set([";;", ";&", ";;&", "esac"]));
|
|
835
|
+
if (![";;", ";&", ";;&", "esac"].includes(this.current.value))
|
|
836
|
+
this.error("Expected case terminator");
|
|
837
|
+
const terminator = this.current.value;
|
|
838
|
+
clauses.push({ patterns, body, terminator });
|
|
839
|
+
if (terminator === "esac")
|
|
840
|
+
break;
|
|
841
|
+
this.advance();
|
|
842
|
+
this.newlines();
|
|
843
|
+
}
|
|
844
|
+
this.expect("esac");
|
|
845
|
+
command = { kind: "case", subject, clauses, redirects: [] };
|
|
846
|
+
}
|
|
847
|
+
else if (this.is("while") || this.is("until")) {
|
|
848
|
+
const kind = this.advance().value;
|
|
849
|
+
const condition = this.nonemptyScript(new Set(["do"]));
|
|
850
|
+
this.expect("do");
|
|
851
|
+
const body = this.nonemptyScript(new Set(["done"]));
|
|
852
|
+
this.expect("done");
|
|
853
|
+
command = { kind, condition, body, redirects: [] };
|
|
854
|
+
}
|
|
855
|
+
else if (this.is("for")) {
|
|
856
|
+
this.advance();
|
|
857
|
+
const name = this.advance().value;
|
|
858
|
+
if (!/^[a-zA-Z_][a-zA-Z_0-9]*$/u.test(name))
|
|
859
|
+
this.error("Invalid for variable");
|
|
860
|
+
this.newlines();
|
|
861
|
+
let words;
|
|
862
|
+
if (this.is("in")) {
|
|
863
|
+
this.advance();
|
|
864
|
+
words = [];
|
|
865
|
+
while (this.current.kind === "word")
|
|
866
|
+
words.push(this.advance().word);
|
|
867
|
+
}
|
|
868
|
+
if (this.is(";") || this.is("\n"))
|
|
869
|
+
this.advance();
|
|
870
|
+
else if (words)
|
|
871
|
+
this.error("Expected for separator");
|
|
872
|
+
this.newlines();
|
|
873
|
+
this.expect("do");
|
|
874
|
+
const body = this.nonemptyScript(new Set(["done"]));
|
|
875
|
+
this.expect("done");
|
|
876
|
+
command = { kind: "for", name, ...(words ? { words } : {}), body, redirects: [] };
|
|
877
|
+
}
|
|
878
|
+
else if (this.is("function")) {
|
|
879
|
+
this.advance();
|
|
880
|
+
if (this.current.kind !== "word" || !/^[a-zA-Z_][a-zA-Z_0-9]*$/u.test(this.current.value))
|
|
881
|
+
this.error("Invalid function name");
|
|
882
|
+
const name = this.advance().value;
|
|
883
|
+
if (this.is("(")) {
|
|
884
|
+
this.advance();
|
|
885
|
+
this.expect(")");
|
|
886
|
+
}
|
|
887
|
+
this.newlines();
|
|
888
|
+
if (!this.is("{"))
|
|
889
|
+
this.error("Expected brace function body");
|
|
890
|
+
command = { kind: "function", name, body: this.command(), redirects: [] };
|
|
891
|
+
}
|
|
892
|
+
else if (this.current.kind === "word" && !compoundHead(this.current.word) && this.peek().value === "(") {
|
|
893
|
+
const name = this.advance().value;
|
|
894
|
+
if (!/^[a-zA-Z_][a-zA-Z_0-9]*$/u.test(name))
|
|
895
|
+
this.error("Invalid function name");
|
|
896
|
+
this.expect("(");
|
|
897
|
+
this.expect(")");
|
|
898
|
+
this.newlines();
|
|
899
|
+
if (!["{", "(", "if", "case", "while", "until", "for", "[["].includes(this.current.value))
|
|
900
|
+
this.error("Expected function body");
|
|
901
|
+
command = { kind: "function", name, body: this.command(), redirects: [] };
|
|
902
|
+
}
|
|
903
|
+
else {
|
|
904
|
+
if (["!", "then", "else", "elif", "fi", "do", "done", "}", "case", "esac", "select", "function", "[[", "]]"].includes(this.current.value))
|
|
905
|
+
this.error(`Unexpected or unsupported keyword ${this.current.value}`);
|
|
906
|
+
const words = [];
|
|
907
|
+
const redirects = [];
|
|
908
|
+
let line;
|
|
909
|
+
while (true) {
|
|
910
|
+
const wordLine = this.lexer.lineAt(Math.max(this.current.offset, this.current.end - 1));
|
|
911
|
+
const redirect = this.redirect();
|
|
912
|
+
if (redirect) {
|
|
913
|
+
line ??= redirect.line;
|
|
914
|
+
redirects.push(redirect);
|
|
915
|
+
}
|
|
916
|
+
else if (this.current.kind === "word") {
|
|
917
|
+
line ??= wordLine;
|
|
918
|
+
let word = this.advance().word;
|
|
919
|
+
const head = compoundHead(word);
|
|
920
|
+
if (head && this.is("(")) {
|
|
921
|
+
this.advance();
|
|
922
|
+
const entries = [];
|
|
923
|
+
this.newlines();
|
|
924
|
+
while (this.current.kind === "word") {
|
|
925
|
+
entries.push(compoundEntry(this.advance().word));
|
|
926
|
+
this.newlines();
|
|
927
|
+
}
|
|
928
|
+
if (!this.is(")"))
|
|
929
|
+
this.error("Unsupported indexed-array compound assignment");
|
|
930
|
+
const end = this.advance().end;
|
|
931
|
+
word = { offset: word.offset, parts: word.parts, spelling: this.lexer.source.slice(word.offset, end) };
|
|
932
|
+
setArrayAssignment(word, { kind: "compound", ...head, entries });
|
|
933
|
+
}
|
|
934
|
+
else {
|
|
935
|
+
const assignment = words.every(previous => getArrayAssignment(previous) || scalarAssignmentName(previous)) ? elementAssignment(word) : undefined;
|
|
936
|
+
if (assignment)
|
|
937
|
+
setArrayAssignment(word, assignment);
|
|
938
|
+
}
|
|
939
|
+
words.push(word);
|
|
940
|
+
}
|
|
941
|
+
else
|
|
942
|
+
break;
|
|
943
|
+
}
|
|
944
|
+
if (!words.length && !redirects.length)
|
|
945
|
+
this.error("Expected command");
|
|
946
|
+
if (words.some(word => getArrayAssignment(word)) && words.some(word => !getArrayAssignment(word) && !scalarAssignmentName(word)))
|
|
947
|
+
this.error("Indexed-array command prefixes are unsupported");
|
|
948
|
+
return { kind: "simple", words, redirects, ...(line === undefined ? {} : { line }) };
|
|
949
|
+
}
|
|
950
|
+
let redirect;
|
|
951
|
+
while ((redirect = this.redirect()))
|
|
952
|
+
command.redirects.push(redirect);
|
|
953
|
+
return command;
|
|
954
|
+
}
|
|
955
|
+
nonemptyScript(stops) {
|
|
956
|
+
const script = this.script(stops);
|
|
957
|
+
if (!script.lists.length)
|
|
958
|
+
this.error("Expected nonempty compound list");
|
|
959
|
+
return script;
|
|
960
|
+
}
|
|
961
|
+
redirect() {
|
|
962
|
+
let descriptor;
|
|
963
|
+
if (this.current.kind === "word" && /^\d+$/u.test(this.current.value)) {
|
|
964
|
+
const next = this.peek();
|
|
965
|
+
if (/^(?:>|>>|<|<<|<<-|<<<|>&|<&|>\|)$/u.test(next.value) && this.current.end === next.offset)
|
|
966
|
+
descriptor = Number(this.advance().value);
|
|
967
|
+
}
|
|
968
|
+
if (!/^(?:>|>>|<|<<|<<-|<<<|>&|<&|>\||&>)$/u.test(this.current.value) || this.current.kind !== "operator")
|
|
969
|
+
return undefined;
|
|
970
|
+
const operator = this.advance().value;
|
|
971
|
+
descriptor ??= operator.startsWith("<") ? 0 : 1;
|
|
972
|
+
if (!Number.isSafeInteger(descriptor) || descriptor > 255)
|
|
973
|
+
this.error("File descriptor must be between 0 and 255");
|
|
974
|
+
if (!this.current.word)
|
|
975
|
+
this.error("Expected redirect target");
|
|
976
|
+
const target = this.advance();
|
|
977
|
+
return { descriptor, operator, target: target.word, line: this.lexer.lineAt(Math.max(target.offset, target.end - 1)), ...((operator === "<&" || operator === ">&") && this.lexer.source[target.end - 1] === "-" ? { move: true } : {}), ...(target.document ? { document: target.document } : {}) };
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
export function parseShell(source, depth = 0) {
|
|
981
|
+
const warnings = [];
|
|
982
|
+
const script = parseSource(source, depth, warnings);
|
|
983
|
+
return { ...script, ...(warnings.length ? { warnings } : {}) };
|
|
984
|
+
}
|
|
985
|
+
export function* hereDocumentWords(document, line, byteLocale, warnings) {
|
|
986
|
+
if (document.quoted)
|
|
987
|
+
yield { offset: document.offset, parts: [{ kind: "text", value: document.body, quoted: true }] };
|
|
988
|
+
else
|
|
989
|
+
yield* new Lexer(document.body, document.depth, warnings, line - 1, byteLocale, line).documentWords();
|
|
990
|
+
}
|
|
991
|
+
export function parseShellUnit(source, position = 0, byteLocale = false) {
|
|
992
|
+
const warnings = [];
|
|
993
|
+
const parser = new Parser(source, 0, warnings, 0, position, byteLocale);
|
|
994
|
+
const script = parser.script(new Set(), true);
|
|
995
|
+
const next = parser.current.end;
|
|
996
|
+
const nul = source.indexOf("\0", position);
|
|
997
|
+
if (nul >= 0 && nul < next)
|
|
998
|
+
throw new ShellSyntaxError("NUL bytes are not valid shell source", nul);
|
|
999
|
+
return { script: { ...script, ...(warnings.length ? { warnings } : {}) }, next };
|
|
1000
|
+
}
|
|
1001
|
+
export function parseShellInputUnit(source, byteLocale = false) {
|
|
1002
|
+
const warnings = [];
|
|
1003
|
+
try {
|
|
1004
|
+
const parser = new Parser(source, 0, warnings, 0, 0, byteLocale, true);
|
|
1005
|
+
const script = parser.script(new Set(), true);
|
|
1006
|
+
return { script: { ...script, ...(warnings.length ? { warnings } : {}) }, next: parser.current.end };
|
|
1007
|
+
}
|
|
1008
|
+
catch (error) {
|
|
1009
|
+
if (error instanceof IncompleteShellInput)
|
|
1010
|
+
return undefined;
|
|
1011
|
+
if (error instanceof ShellSyntaxError && (/^Unterminated|^Trailing escape/u.test(error.reason) || (error.offset >= source.length && !/Unsupported|unsupported|nesting|exceeds/u.test(error.reason))))
|
|
1012
|
+
return undefined;
|
|
1013
|
+
throw error;
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
function parseSource(source, depth, warnings, lineOffset = 0, byteLocale = false) {
|
|
1017
|
+
const parser = new Parser(source, depth, warnings, lineOffset, undefined, byteLocale);
|
|
1018
|
+
const script = parser.script();
|
|
1019
|
+
if (parser.current.kind !== "end")
|
|
1020
|
+
parser.error("Unexpected token");
|
|
1021
|
+
return script;
|
|
1022
|
+
}
|
|
1023
|
+
//# sourceMappingURL=parser.js.map
|