@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 @@
|
|
|
1
|
+
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../../src/commands/regex-execution/worker.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { parentPort } from "node:worker_threads";
|
|
2
|
+
import { compile } from "./matching.js";
|
|
3
|
+
import { matchExpr } from "../expr/bre-worker.js";
|
|
4
|
+
import { ExprMatchError, validateExprRequest } from "./protocol.js";
|
|
5
|
+
if (!parentPort)
|
|
6
|
+
throw new Error("regex worker requires a parent port");
|
|
7
|
+
const port = parentPort;
|
|
8
|
+
let previous = "";
|
|
9
|
+
let matcher;
|
|
10
|
+
port.on("message", (request) => {
|
|
11
|
+
if (request?.descriptor?.kind === "expr-match") {
|
|
12
|
+
let reply;
|
|
13
|
+
try {
|
|
14
|
+
validateExprRequest(request);
|
|
15
|
+
reply = { id: request.id, operation: "expr-match", result: matchExpr(request.descriptor, request.rows[0].bytes) };
|
|
16
|
+
}
|
|
17
|
+
catch (error) {
|
|
18
|
+
if (!(error instanceof ExprMatchError))
|
|
19
|
+
throw error;
|
|
20
|
+
reply = { id: request.id, operation: "expr-match", category: error.category, error: error.message };
|
|
21
|
+
}
|
|
22
|
+
port.postMessage(reply);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const legacy = request;
|
|
26
|
+
let reply;
|
|
27
|
+
try {
|
|
28
|
+
const identity = JSON.stringify(request.descriptor);
|
|
29
|
+
if (identity !== previous || !matcher) {
|
|
30
|
+
matcher = undefined;
|
|
31
|
+
matcher = compile(legacy.descriptor);
|
|
32
|
+
previous = identity;
|
|
33
|
+
}
|
|
34
|
+
const results = request.rows.map((row, index) => {
|
|
35
|
+
const matches = matcher(row, index);
|
|
36
|
+
const ranges = new Float64Array(matches.length * 2);
|
|
37
|
+
for (let index = 0; index < matches.length; index++) {
|
|
38
|
+
ranges[index * 2] = matches[index].start;
|
|
39
|
+
ranges[index * 2 + 1] = matches[index].end;
|
|
40
|
+
}
|
|
41
|
+
return ranges;
|
|
42
|
+
});
|
|
43
|
+
reply = { id: request.id, results };
|
|
44
|
+
port.postMessage(reply, results.map(result => result.buffer));
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
reply = { id: request.id, error: error instanceof Error ? error.message : String(error) };
|
|
48
|
+
port.postMessage(reply);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
port.postMessage({ ready: true });
|
|
52
|
+
//# sourceMappingURL=worker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker.js","sourceRoot":"","sources":["../../../src/commands/regex-execution/worker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAwE,MAAM,eAAe,CAAC;AAE1I,IAAI,CAAC,UAAU;IAAE,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;AACxE,MAAM,IAAI,GAAG,UAAU,CAAC;AACxB,IAAI,QAAQ,GAAG,EAAE,CAAC;AAClB,IAAI,OAA+C,CAAC;AACpD,IAAI,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,OAAmC,EAAE,EAAE;IACzD,IAAI,OAAO,EAAE,UAAU,EAAE,IAAI,KAAK,YAAY,EAAE,CAAC;QAC/C,IAAI,KAAqB,CAAC;QAC1B,IAAI,C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G,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;gBACpD,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,CAAE,CAAC,KAAK,CAAC;gBAC1C,MAAM,CAAC,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,CAAE,CAAC,GAAG,CAAC;YAC9C,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC,CAAC;QACH,KAAK,GAAG,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,OAAO,EAAE,CAAC;QACpC,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IAChE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,KAAK,GAAG,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1F,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;AACH,CAAC,CAAC,CAAC;AACH,IAAI,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type CommandDefinition, type VirtualShellPlugin } from "../../contracts/index.js";
|
|
2
|
+
import { defaultSafeJsLimits, type Invocation } from "./options.js";
|
|
3
|
+
import { SafeJsCommandLimitError, type SafeJsCommandsOptions, type SafeJsModule } from "./types.js";
|
|
4
|
+
export { defaultSafeJsLimits, SafeJsCommandLimitError };
|
|
5
|
+
export type { SafeJsBudgetOptions, SafeJsCommandLimits, SafeJsCommandsOptions, SafeJsHostFunction, SafeJsHostValue, SafeJsModule, SafeJsRunOptions, SafeJsRunResult, SafeJsRuntime } from "./types.js";
|
|
6
|
+
export interface SafeJsCommandDialect {
|
|
7
|
+
readonly name: string;
|
|
8
|
+
readonly description: string;
|
|
9
|
+
readonly help: string;
|
|
10
|
+
readonly invocation: (args: readonly string[]) => Invocation;
|
|
11
|
+
readonly prepare?: (source: string, selected: Invocation, modules: Record<string, SafeJsModule>) => {
|
|
12
|
+
readonly source: string;
|
|
13
|
+
readonly bindings: SafeJsModule;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export declare function createSafeJsCommands<Budget = unknown>(options?: SafeJsCommandsOptions<Budget>, dialect?: SafeJsCommandDialect): readonly CommandDefinition[];
|
|
17
|
+
export declare function safeJsCommands<Budget = unknown>(options?: SafeJsCommandsOptions<Budget>): VirtualShellPlugin;
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/safejs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,iBAAiB,EAAE,KAAK,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAKrH,OAAO,EAAiB,mBAAmB,EAAc,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/F,OAAO,EAAE,uBAAuB,EAAE,KAAK,qBAAqB,EAAE,KAAK,YAAY,EAAsB,MAAM,YAAY,CAAC;AAExH,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,CAAC;AACxD,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,eAAe,EAAE,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAIvM,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,KAAK,UAAU,CAAC;IAC7D,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,KAAK;QAClG,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;KACjC,CAAC;CACH;AAmBD,wBAAgB,oBAAoB,CAAC,MAAM,GAAG,OAAO,EAAE,OAAO,GAAE,qBAAqB,CAAC,MAAM,CAAM,EAAE,OAAO,GAAE,oBAE5G,GAAG,SAAS,iBAAiB,EAAE,CAmG/B;AAED,wBAAgB,cAAc,CAAC,MAAM,GAAG,OAAO,EAAE,OAAO,GAAE,qBAAqB,CAAC,MAAM,CAAM,GAAG,kBAAkB,CAMhH"}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { toByteSource, writeBytes } from "../../contracts/index.js";
|
|
2
|
+
import { makeSafeJsFsModule } from "../../integrations/safejs/index.js";
|
|
3
|
+
import { record, withSignal } from "../../integrations/safejs/values.js";
|
|
4
|
+
import { pathOf, UsageError } from "../internal.js";
|
|
5
|
+
import { GuestInput, GuestOutput } from "./io.js";
|
|
6
|
+
import { commandLimits, defaultSafeJsLimits, invocation } from "./options.js";
|
|
7
|
+
import { SafeJsCommandLimitError } from "./types.js";
|
|
8
|
+
export { defaultSafeJsLimits, SafeJsCommandLimitError };
|
|
9
|
+
const help = "Usage: safejs [-p|--print] [-e SOURCE [--] ARG... | FILE ARG... | - ARG...]\nNo source operand reads SafeJS source from stdin. Inline/file source leaves stdin for guest data.\n-p prints the returned string or JSON value followed by LF; this is not Node.js.\nGuest modules: fs, stdio, command. A host-injected SafeJS runtime is required.\n";
|
|
10
|
+
function errorInfo(error) {
|
|
11
|
+
if (typeof error === "string")
|
|
12
|
+
return { name: "Error", code: "", message: error };
|
|
13
|
+
if (typeof error !== "object" || error === null)
|
|
14
|
+
return { name: "Error", code: "", message: "SafeJS execution failed" };
|
|
15
|
+
const field = (name) => {
|
|
16
|
+
const descriptor = Object.getOwnPropertyDescriptor(error, name);
|
|
17
|
+
return descriptor && "value" in descriptor && typeof descriptor.value === "string" ? descriptor.value : "";
|
|
18
|
+
};
|
|
19
|
+
return { name: field("name"), code: field("code"), message: field("message") || "SafeJS execution failed" };
|
|
20
|
+
}
|
|
21
|
+
function validateRuntime(runtime) {
|
|
22
|
+
if (runtime === undefined)
|
|
23
|
+
return;
|
|
24
|
+
for (const key of ["run", "createBudget", "makeFsModule", "declareHostOperation"]) {
|
|
25
|
+
if (typeof runtime[key] !== "function")
|
|
26
|
+
throw new TypeError(`SafeJS runtime.${key} must be injected`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export function createSafeJsCommands(options = {}, dialect = {
|
|
30
|
+
name: "safejs", description: "Execute an injected SafeJS interpreter against the virtual filesystem", help, invocation,
|
|
31
|
+
}) {
|
|
32
|
+
const limits = commandLimits(options.limits);
|
|
33
|
+
const runtime = options.runtime;
|
|
34
|
+
validateRuntime(runtime);
|
|
35
|
+
return [{ name: dialect.name, description: dialect.description, async execute(context) {
|
|
36
|
+
const deadline = Date.now() + limits.timeoutMs;
|
|
37
|
+
const diagnose = async (message) => {
|
|
38
|
+
const diagnostic = new AbortController();
|
|
39
|
+
const timer = setTimeout(() => diagnostic.abort(), Math.max(1, Math.min(limits.timeoutMs, deadline - Date.now())));
|
|
40
|
+
try {
|
|
41
|
+
await writeBytes(context.stderr, Buffer.from(`${dialect.name}: ${message.slice(0, 4096)}\n`), AbortSignal.any([context.signal, diagnostic.signal]));
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
context.signal.throwIfAborted();
|
|
45
|
+
if (!diagnostic.signal.aborted)
|
|
46
|
+
throw error;
|
|
47
|
+
}
|
|
48
|
+
finally {
|
|
49
|
+
clearTimeout(timer);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
let parsed;
|
|
53
|
+
try {
|
|
54
|
+
parsed = dialect.invocation(context.args);
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
await diagnose(errorInfo(error).message);
|
|
58
|
+
return { exitCode: 2 };
|
|
59
|
+
}
|
|
60
|
+
context.signal.throwIfAborted();
|
|
61
|
+
if (parsed.help) {
|
|
62
|
+
await writeBytes(context.stdout, Buffer.from(dialect.help), context.signal);
|
|
63
|
+
return { exitCode: 0 };
|
|
64
|
+
}
|
|
65
|
+
if (!runtime) {
|
|
66
|
+
await diagnose("runtime not installed; inject run, createBudget, makeFsModule and declareHostOperation");
|
|
67
|
+
return { exitCode: 127 };
|
|
68
|
+
}
|
|
69
|
+
const controller = new AbortController();
|
|
70
|
+
const signal = AbortSignal.any([context.signal, controller.signal]);
|
|
71
|
+
let failure;
|
|
72
|
+
let hasFailure = false;
|
|
73
|
+
const fail = (error) => {
|
|
74
|
+
if (!hasFailure && !controller.signal.aborted) {
|
|
75
|
+
hasFailure = true;
|
|
76
|
+
failure = error;
|
|
77
|
+
queueMicrotask(() => controller.abort(error));
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
const timeout = setTimeout(() => fail(new SafeJsCommandLimitError("timeoutMs")), limits.timeoutMs);
|
|
81
|
+
let input;
|
|
82
|
+
const output = new GuestOutput(context.stdout, context.stderr, limits.maxOutputBytes, signal, fail);
|
|
83
|
+
let exitCode = 0;
|
|
84
|
+
let thrown;
|
|
85
|
+
let failed = false;
|
|
86
|
+
try {
|
|
87
|
+
const fromStdin = parsed.source === undefined && parsed.file === "-";
|
|
88
|
+
let source = parsed.source;
|
|
89
|
+
let filename = parsed.file;
|
|
90
|
+
if (source === undefined) {
|
|
91
|
+
if (!fromStdin)
|
|
92
|
+
filename = pathOf(context, parsed.file);
|
|
93
|
+
const bytes = fromStdin ? context.stdin : context.fs.readStream && context.fs.capabilities.streamingRead !== false
|
|
94
|
+
? context.fs.readStream(filename, { signal, chunkSize: 65536 })
|
|
95
|
+
: toByteSource(await withSignal(signal, () => context.fs.readFile(filename, { signal, maxBytes: limits.maxSourceBytes })));
|
|
96
|
+
const reader = new GuestInput(bytes, limits.maxSourceBytes, signal, fail, "maxSourceBytes");
|
|
97
|
+
try {
|
|
98
|
+
source = await reader.readText();
|
|
99
|
+
}
|
|
100
|
+
finally {
|
|
101
|
+
await reader.close();
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
else if (Buffer.byteLength(source) > limits.maxSourceBytes)
|
|
105
|
+
throw new SafeJsCommandLimitError("maxSourceBytes");
|
|
106
|
+
if (source.startsWith("\uFEFF"))
|
|
107
|
+
source = source.slice(1);
|
|
108
|
+
input = new GuestInput(fromStdin ? toByteSource("") : context.stdin, limits.maxInputBytes, signal, fail);
|
|
109
|
+
const guestInput = input;
|
|
110
|
+
const declare = runtime.declareHostOperation;
|
|
111
|
+
const stdio = {
|
|
112
|
+
readBytes: declare(async (size) => guestInput.readBytes(size), "read-side-effect"),
|
|
113
|
+
readText: declare(async () => guestInput.readText(), "read-side-effect"),
|
|
114
|
+
write: declare(async (text) => output.text(text), "read-side-effect"),
|
|
115
|
+
writeBytes: declare(async (bytes) => output.bytes(bytes), "read-side-effect"),
|
|
116
|
+
error: declare(async (text) => output.text(text, true), "read-side-effect"),
|
|
117
|
+
errorBytes: declare(async (bytes) => output.bytes(bytes, true), "read-side-effect"),
|
|
118
|
+
};
|
|
119
|
+
const env = Object.create(null);
|
|
120
|
+
for (const [key, value] of Object.entries(context.env))
|
|
121
|
+
env[key] = value;
|
|
122
|
+
const command = {
|
|
123
|
+
args: [...parsed.args], cwd: context.cwd, env,
|
|
124
|
+
setExitCode: declare((value) => {
|
|
125
|
+
signal.throwIfAborted();
|
|
126
|
+
if (typeof value !== "number" || !Number.isInteger(value) || value < 0 || value > 255)
|
|
127
|
+
throw new TypeError("exit code must be an integer from 0 through 255");
|
|
128
|
+
exitCode = value;
|
|
129
|
+
}, "read-side-effect"),
|
|
130
|
+
};
|
|
131
|
+
const budget = runtime.createBudget({ maxSteps: limits.maxSteps, deadline,
|
|
132
|
+
maxCallDepth: limits.maxCallDepth, stringLength: limits.stringLength, arrayLength: limits.arrayLength, dataSize: limits.dataSize });
|
|
133
|
+
const modules = { fs: makeSafeJsFsModule(runtime.makeFsModule, context.fs, { cwd: context.cwd, signal }), stdio, command };
|
|
134
|
+
const prepared = dialect.prepare?.(source, { ...parsed, file: filename }, modules);
|
|
135
|
+
const result = record(await withSignal(signal, () => runtime.run(prepared?.source ?? source, {
|
|
136
|
+
budget, filename, modules, signal, ...(prepared ? { bindings: prepared.bindings } : {}),
|
|
137
|
+
sink: { log: (...args) => output.console(args, false), error: (...args) => output.console(args, true) },
|
|
138
|
+
})), "SafeJS run result");
|
|
139
|
+
signal.throwIfAborted();
|
|
140
|
+
if (result.ok !== true && result.ok !== false)
|
|
141
|
+
throw new TypeError("Invalid SafeJS run result.ok");
|
|
142
|
+
if (!result.ok)
|
|
143
|
+
throw result.error;
|
|
144
|
+
if (parsed.print && result.returnValue !== undefined)
|
|
145
|
+
await output.result(result.returnValue);
|
|
146
|
+
await output.drain();
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
thrown = failure ?? error;
|
|
150
|
+
failed = true;
|
|
151
|
+
}
|
|
152
|
+
finally {
|
|
153
|
+
try {
|
|
154
|
+
await output.drain();
|
|
155
|
+
}
|
|
156
|
+
catch (error) {
|
|
157
|
+
thrown = failure ?? error;
|
|
158
|
+
failed = true;
|
|
159
|
+
}
|
|
160
|
+
controller.abort();
|
|
161
|
+
clearTimeout(timeout);
|
|
162
|
+
await input?.close().catch(() => { });
|
|
163
|
+
}
|
|
164
|
+
context.signal.throwIfAborted();
|
|
165
|
+
if (failed) {
|
|
166
|
+
const info = errorInfo(thrown);
|
|
167
|
+
if (!output.stderrFailed)
|
|
168
|
+
await diagnose(info.message);
|
|
169
|
+
return { exitCode: thrown instanceof SafeJsCommandLimitError || info.code === "budgetExceeded" ? 124
|
|
170
|
+
: thrown instanceof UsageError || info.name === "ParseError" ? 2 : 1 };
|
|
171
|
+
}
|
|
172
|
+
return { exitCode };
|
|
173
|
+
} }];
|
|
174
|
+
}
|
|
175
|
+
export function safeJsCommands(options = {}) {
|
|
176
|
+
const definitions = createSafeJsCommands(options);
|
|
177
|
+
return { name: "safejs-commands", setup(host) {
|
|
178
|
+
if (!options.replace && host.commands.has("safejs"))
|
|
179
|
+
throw new Error("Command already registered: safejs");
|
|
180
|
+
for (const definition of definitions)
|
|
181
|
+
host.commands.register(definition, { replace: options.replace ?? false });
|
|
182
|
+
} };
|
|
183
|
+
}
|
|
184
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/safejs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAmD,MAAM,0BAA0B,CAAC;AACrH,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,UAAU,EAAmB,MAAM,cAAc,CAAC;AAC/F,OAAO,EAAE,uBAAuB,EAAqE,MAAM,YAAY,CAAC;AAExH,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,CAAC;AAGxD,MAAM,IAAI,GAAG,oVAAoV,CAAC;AAalW,SAAS,SAAS,CAAC,KAAc;IAC/B,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,EAAE,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CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC3E,CAAC;gBACD,OAAO,EAAE,QAAQ,EAAE,CAAC;YACtB,CAAC,EAAE,CAAC,CAAC;AACP,CAAC;AAED,MAAM,UAAU,cAAc,CAAmB,UAAyC,EAAE;IAC1F,MAAM,WAAW,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAClD,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,CAAC,IAAI;YAC1C,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC;gBAAE,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;YAC3G,KAAK,MAAM,UAAU,IAAI,WAAW;gBAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,UAAU,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,KAAK,EAAE,CAAC,CAAC;QAClH,CAAC,EAAE,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type ByteSink, type ByteSource } from "../../contracts/index.js";
|
|
2
|
+
export declare class GuestInput {
|
|
3
|
+
private readonly limit;
|
|
4
|
+
private readonly signal;
|
|
5
|
+
private readonly fail;
|
|
6
|
+
private readonly resource;
|
|
7
|
+
private readonly iterator;
|
|
8
|
+
private pending;
|
|
9
|
+
private consumed;
|
|
10
|
+
private pulls;
|
|
11
|
+
private queue;
|
|
12
|
+
constructor(source: ByteSource, limit: number, signal: AbortSignal, fail: (error: unknown) => void, resource?: "maxSourceBytes" | "maxInputBytes");
|
|
13
|
+
private take;
|
|
14
|
+
private serialize;
|
|
15
|
+
readBytes(size?: unknown): Promise<number[] | null>;
|
|
16
|
+
readText(): Promise<string>;
|
|
17
|
+
close(): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
export declare class GuestOutput {
|
|
20
|
+
private readonly stdout;
|
|
21
|
+
private readonly stderr;
|
|
22
|
+
private readonly limit;
|
|
23
|
+
private readonly signal;
|
|
24
|
+
private readonly fail;
|
|
25
|
+
private queue;
|
|
26
|
+
private produced;
|
|
27
|
+
stderrFailed: boolean;
|
|
28
|
+
constructor(stdout: ByteSink, stderr: ByteSink, limit: number, signal: AbortSignal, fail: (error: unknown) => void);
|
|
29
|
+
private enqueue;
|
|
30
|
+
text(value: unknown, stderr?: boolean): Promise<void>;
|
|
31
|
+
bytes(value: unknown, stderr?: boolean): Promise<void>;
|
|
32
|
+
console(args: readonly unknown[], stderr: boolean): void;
|
|
33
|
+
result(value: unknown): Promise<void>;
|
|
34
|
+
drain(): Promise<void>;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=io.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"io.d.ts","sourceRoot":"","sources":["../../../src/commands/safejs/io.ts"],"names":[],"mappings":"AACA,OAAO,EAAyB,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAMjG,qBAAa,UAAU;IAMW,OAAO,CAAC,QAAQ,CAAC,KAAK;IAAU,OAAO,CAAC,QAAQ,CAAC,MAAM;IACrF,OAAO,CAAC,QAAQ,CAAC,IAAI;IAA4B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAN5E,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA6B;IACtD,OAAO,CAAC,OAAO,CAAgC;IAC/C,OAAO,CAAC,QAAQ,CAAK;IACrB,OAAO,CAAC,KAAK,CAAK;IAClB,OAAO,CAAC,KAAK,CAAqB;gBACtB,MAAM,EAAE,UAAU,EAAmB,KAAK,EAAE,MAAM,EAAmB,MAAM,EAAE,WAAW,EACjF,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,EAAmB,QAAQ,GAAE,gBAAgB,GAAG,eAAiC;YAGpH,IAAI;IAiBlB,OAAO,CAAC,SAAS;IAKjB,SAAS,CAAC,IAAI,GAAE,OAAmB,GAAG,OAAO,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC;IAI9D,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC;IAOrB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAC7B;AAED,qBAAa,WAAW;IAIV,OAAO,CAAC,QAAQ,CAAC,MAAM;IAAY,OAAO,CAAC,QAAQ,CAAC,MAAM;IAAY,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtG,OAAO,CAAC,QAAQ,CAAC,MAAM;IAAe,OAAO,CAAC,QAAQ,CAAC,IAAI;IAJ7D,OAAO,CAAC,KAAK,CAAqB;IAClC,OAAO,CAAC,QAAQ,CAAK;IACrB,YAAY,UAAS;gBACQ,MAAM,EAAE,QAAQ,EAAmB,MAAM,EAAE,QAAQ,EAAmB,KAAK,EAAE,MAAM,EAC7F,MAAM,EAAE,WAAW,EAAmB,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI;IACvF,OAAO,CAAC,OAAO;IAaf,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAOnD,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAKpD,OAAO,CAAC,IAAI,EAAE,SAAS,OAAO,EAAE,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI;IAGxD,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAG/B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAC7B"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { setImmediate } from "node:timers/promises";
|
|
2
|
+
import { readBytes, writeBytes } from "../../contracts/index.js";
|
|
3
|
+
import { SafeJsCommandLimitError } from "./types.js";
|
|
4
|
+
import { renderOutput } from "./render.js";
|
|
5
|
+
const chunkSize = 64 * 1024;
|
|
6
|
+
export class GuestInput {
|
|
7
|
+
limit;
|
|
8
|
+
signal;
|
|
9
|
+
fail;
|
|
10
|
+
resource;
|
|
11
|
+
iterator;
|
|
12
|
+
pending = new Uint8Array();
|
|
13
|
+
consumed = 0;
|
|
14
|
+
pulls = 0;
|
|
15
|
+
queue = Promise.resolve();
|
|
16
|
+
constructor(source, limit, signal, fail, resource = "maxInputBytes") {
|
|
17
|
+
this.limit = limit;
|
|
18
|
+
this.signal = signal;
|
|
19
|
+
this.fail = fail;
|
|
20
|
+
this.resource = resource;
|
|
21
|
+
this.iterator = readBytes(source, signal);
|
|
22
|
+
}
|
|
23
|
+
async take(size) {
|
|
24
|
+
this.signal.throwIfAborted();
|
|
25
|
+
while (!this.pending.length) {
|
|
26
|
+
if (++this.pulls % 64 === 0)
|
|
27
|
+
await setImmediate(undefined, { signal: this.signal });
|
|
28
|
+
const next = await this.iterator.next();
|
|
29
|
+
if (next.done)
|
|
30
|
+
return undefined;
|
|
31
|
+
this.pending = next.value;
|
|
32
|
+
}
|
|
33
|
+
const length = Math.min(size, this.pending.length);
|
|
34
|
+
if (length > this.limit - this.consumed) {
|
|
35
|
+
const error = new SafeJsCommandLimitError(this.resource);
|
|
36
|
+
this.fail(error);
|
|
37
|
+
throw error;
|
|
38
|
+
}
|
|
39
|
+
const bytes = this.pending.slice(0, length);
|
|
40
|
+
this.pending = this.pending.subarray(length);
|
|
41
|
+
this.consumed += length;
|
|
42
|
+
return bytes;
|
|
43
|
+
}
|
|
44
|
+
serialize(operation) {
|
|
45
|
+
const result = this.queue.then(operation);
|
|
46
|
+
this.queue = result.then(() => { }, () => { });
|
|
47
|
+
return result;
|
|
48
|
+
}
|
|
49
|
+
readBytes(size = chunkSize) {
|
|
50
|
+
if (typeof size !== "number" || !Number.isSafeInteger(size) || size < 1 || size > chunkSize)
|
|
51
|
+
throw new TypeError("readBytes size must be an integer from 1 through 65536");
|
|
52
|
+
return this.serialize(async () => { const bytes = await this.take(size); return bytes === undefined ? null : Array.from(bytes); });
|
|
53
|
+
}
|
|
54
|
+
readText() {
|
|
55
|
+
return this.serialize(async () => {
|
|
56
|
+
const pieces = [];
|
|
57
|
+
for (;;) {
|
|
58
|
+
const chunk = await this.take(chunkSize);
|
|
59
|
+
if (!chunk)
|
|
60
|
+
break;
|
|
61
|
+
pieces.push(chunk);
|
|
62
|
+
}
|
|
63
|
+
return new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }).decode(Buffer.concat(pieces));
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
async close() { await this.iterator.return(undefined); }
|
|
67
|
+
}
|
|
68
|
+
export class GuestOutput {
|
|
69
|
+
stdout;
|
|
70
|
+
stderr;
|
|
71
|
+
limit;
|
|
72
|
+
signal;
|
|
73
|
+
fail;
|
|
74
|
+
queue = Promise.resolve();
|
|
75
|
+
produced = 0;
|
|
76
|
+
stderrFailed = false;
|
|
77
|
+
constructor(stdout, stderr, limit, signal, fail) {
|
|
78
|
+
this.stdout = stdout;
|
|
79
|
+
this.stderr = stderr;
|
|
80
|
+
this.limit = limit;
|
|
81
|
+
this.signal = signal;
|
|
82
|
+
this.fail = fail;
|
|
83
|
+
}
|
|
84
|
+
enqueue(bytes, target) {
|
|
85
|
+
this.signal.throwIfAborted();
|
|
86
|
+
if (bytes.length > this.limit - this.produced) {
|
|
87
|
+
const error = new SafeJsCommandLimitError("maxOutputBytes");
|
|
88
|
+
this.fail(error);
|
|
89
|
+
throw error;
|
|
90
|
+
}
|
|
91
|
+
this.produced += bytes.length;
|
|
92
|
+
const queued = this.queue.then(async () => {
|
|
93
|
+
for (let offset = 0; offset < bytes.length; offset += chunkSize)
|
|
94
|
+
await writeBytes(target, bytes.subarray(offset, offset + chunkSize), this.signal);
|
|
95
|
+
}).catch(error => { if (target === this.stderr)
|
|
96
|
+
this.stderrFailed = true; this.fail(error); throw error; });
|
|
97
|
+
this.queue = queued;
|
|
98
|
+
void queued.catch(() => { });
|
|
99
|
+
return queued;
|
|
100
|
+
}
|
|
101
|
+
text(value, stderr = false) {
|
|
102
|
+
if (typeof value !== "string")
|
|
103
|
+
throw new TypeError("stdio text output requires a string");
|
|
104
|
+
if (Buffer.byteLength(value) > this.limit - this.produced) {
|
|
105
|
+
const error = new SafeJsCommandLimitError("maxOutputBytes");
|
|
106
|
+
this.fail(error);
|
|
107
|
+
throw error;
|
|
108
|
+
}
|
|
109
|
+
return this.enqueue(Buffer.from(value), stderr ? this.stderr : this.stdout);
|
|
110
|
+
}
|
|
111
|
+
bytes(value, stderr = false) {
|
|
112
|
+
if (!Array.isArray(value) || value.length > chunkSize)
|
|
113
|
+
throw new TypeError("stdio byte output requires an array of at most 65536 bytes");
|
|
114
|
+
for (const byte of value)
|
|
115
|
+
if (!Number.isInteger(byte) || byte < 0 || byte > 255)
|
|
116
|
+
throw new TypeError("stdio byte values must be integers from 0 through 255");
|
|
117
|
+
return this.enqueue(Uint8Array.from(value), stderr ? this.stderr : this.stdout);
|
|
118
|
+
}
|
|
119
|
+
console(args, stderr) {
|
|
120
|
+
void this.text(renderOutput(args, this.limit - this.produced, this.fail), stderr);
|
|
121
|
+
}
|
|
122
|
+
result(value) {
|
|
123
|
+
return this.text(renderOutput([value], this.limit - this.produced, this.fail));
|
|
124
|
+
}
|
|
125
|
+
async drain() { await this.queue; }
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=io.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"io.js","sourceRoot":"","sources":["../../../src/commands/safejs/io.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAkC,MAAM,0BAA0B,CAAC;AACjG,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,SAAS,GAAG,EAAE,GAAG,IAAI,CAAC;AAE5B,MAAM,OAAO,UAAU;IAM4B;I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Readonly<SafeJsCommandLimits>;
|
|
3
|
+
export declare function commandLimits(options?: Partial<SafeJsCommandLimits>): SafeJsCommandLimits;
|
|
4
|
+
export interface Invocation {
|
|
5
|
+
readonly source?: string;
|
|
6
|
+
readonly file: string;
|
|
7
|
+
readonly args: readonly string[];
|
|
8
|
+
readonly print: boolean;
|
|
9
|
+
readonly help: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function invocation(args: readonly string[]): Invocation;
|
|
12
|
+
//# sourceMappingURL=options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/commands/safejs/options.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtD,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,mBAAmB,CAI5D,CAAC;AAEH,wBAAgB,aAAa,CAAC,OAAO,GAAE,OAAO,CAAC,mBAAmB,CAAM,GAAG,mBAAmB,CAQ7F;AAED,MAAM,WAAW,UAAU;IAAG,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;CAAE;AAElK,wBAAgB,UAAU,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,UAAU,CAoB9D"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { UsageError } from "../internal.js";
|
|
2
|
+
export const defaultSafeJsLimits = Object.freeze({
|
|
3
|
+
maxSourceBytes: 1024 * 1024, maxInputBytes: 8 * 1024 * 1024, maxOutputBytes: 8 * 1024 * 1024,
|
|
4
|
+
timeoutMs: 5000, maxSteps: 100_000, maxCallDepth: 128, stringLength: 1024 * 1024,
|
|
5
|
+
arrayLength: 100_000, dataSize: 16 * 1024 * 1024,
|
|
6
|
+
});
|
|
7
|
+
export function commandLimits(options = {}) {
|
|
8
|
+
const result = { ...defaultSafeJsLimits, ...options };
|
|
9
|
+
for (const [name, value] of Object.entries(result)) {
|
|
10
|
+
if (!Object.hasOwn(defaultSafeJsLimits, name))
|
|
11
|
+
throw new TypeError(`Unknown SafeJS limit: ${name}`);
|
|
12
|
+
if (!Number.isSafeInteger(value) || value < (name === "timeoutMs" ? 1 : 0))
|
|
13
|
+
throw new RangeError(`Invalid SafeJS limit: ${name}`);
|
|
14
|
+
}
|
|
15
|
+
if (result.timeoutMs > 2_147_483_647)
|
|
16
|
+
throw new RangeError("SafeJS timeoutMs exceeds timer range");
|
|
17
|
+
return Object.freeze(result);
|
|
18
|
+
}
|
|
19
|
+
export function invocation(args) {
|
|
20
|
+
let print = false;
|
|
21
|
+
for (let index = 0; index < args.length; index++) {
|
|
22
|
+
const argument = args[index];
|
|
23
|
+
if (argument === "-h" || argument === "--help")
|
|
24
|
+
return { file: "-", args: [], print, help: true };
|
|
25
|
+
if (argument === "-p" || argument === "--print") {
|
|
26
|
+
print = true;
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
if (argument === "-e" || argument === "--eval" || argument.startsWith("--eval=") || argument.startsWith("-e")) {
|
|
30
|
+
const source = argument.startsWith("--eval=") ? argument.slice(7) : argument.length > 2 && argument !== "--eval" ? argument.slice(2) : args[++index];
|
|
31
|
+
if (source === undefined)
|
|
32
|
+
throw new UsageError(`${argument} requires SafeJS source`);
|
|
33
|
+
const rest = args.slice(index + 1);
|
|
34
|
+
return { source, file: "<safejs -e>", args: rest[0] === "--" ? rest.slice(1) : rest, print, help: false };
|
|
35
|
+
}
|
|
36
|
+
if (argument === "--") {
|
|
37
|
+
const file = args[index + 1] ?? "-";
|
|
38
|
+
return { file, args: args.slice(index + 2), print, help: false };
|
|
39
|
+
}
|
|
40
|
+
if (argument !== "-" && argument.startsWith("-"))
|
|
41
|
+
throw new UsageError(`unrecognized option '${argument}'`);
|
|
42
|
+
return { file: argument, args: args.slice(index + 1), print, help: false };
|
|
43
|
+
}
|
|
44
|
+
return { file: "-", args: [], print, help: false };
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../../src/commands/safejs/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAG5C,MAAM,CAAC,MAAM,mBAAmB,GAAkC,MAAM,CAAC,MAAM,CAAC;IAC9E,cAAc,EAAE,IAAI,GAAG,IAAI,EAAE,aAAa,EAAE,CAAC,GAAG,IAAI,GAAG,IAAI,EAAE,cAAc,EAAE,CAAC,GAAG,IAAI,GAAG,IAAI;IAC5F,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,YAAY,EAAE,IAAI,GAAG,IAAI;IAChF,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI;CACjD,CAAC,CAAC;AAEH,MAAM,UAAU,aAAa,CAAC,UAAwC,EAAE;IACtE,MAAM,MAAM,GAAG,EAAE,GAAG,mBAAmB,EAAE,GAAG,OAAO,EAAE,CAAC;IACtD,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACnD,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,mBAAmB,EAAE,IAAI,CAAC;YAAE,MAAM,IAAI,SAAS,CAAC,yBAAyB,IAAI,EAAE,CAAC,CAAC;QACpG,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAA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