@poe-platform/safe-bash 0.1.802 → 0.1.803
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/README.md +4 -2
- package/dist/image-ast/index.browser.js +13 -4
- package/dist/image-ast/index.js +13 -4
- package/dist/safe-bash/chunks/{chunk-KDNSPLII.js → chunk-2LSAMQER.js} +1 -0
- package/dist/safe-bash/chunks/{chunk-NZQXYWA3.js → chunk-5OHX7C2V.js} +0 -1
- package/dist/safe-bash/chunks/{chunk-SHEMU2Z7.js → chunk-B7PIL77G.js} +82 -63
- package/dist/safe-bash/chunks/{chunk-WDLGKIHD.js → chunk-EEEWOYEG.js} +4 -4
- package/dist/safe-bash/chunks/{chunk-GETUOD5D.js → chunk-GDYNCWRV.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-RSTHLAF3.js → chunk-JMMEIDPF.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-44ALJ4QG.js → chunk-PNBBUWSM.js} +71 -55
- package/dist/safe-bash/chunks/{chunk-NQCM3TYR.js → chunk-RYFQ3LZG.js} +73 -44
- package/dist/safe-bash/chunks/chunk-VBTDHOWC.js +55 -0
- package/dist/safe-bash/command-chunks/{chunk-ORYGZYKW.js → chunk-4FEVBOL5.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-VXSLJH7G.js → chunk-6JSIFWYT.js} +26 -6
- package/dist/safe-bash/command-chunks/chunk-A7MU7762.js +200 -0
- package/dist/safe-bash/command-chunks/{chunk-KJIMDLBB.js → chunk-BXCXRYVU.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-F4TEEZTL.js → chunk-CQHP3I66.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-PEF7K3UQ.js → chunk-EARHPPPJ.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-QKFSRZGQ.js → chunk-GFC2NTDG.js} +2 -2
- package/dist/safe-bash/command-chunks/chunk-GIRNFXP3.js +466 -0
- package/dist/safe-bash/command-chunks/{chunk-FPVUD6TH.js → chunk-HDCNKOIX.js} +9 -7
- package/dist/safe-bash/command-chunks/{chunk-MQFIPHIQ.js → chunk-ILX2NOLF.js} +18 -15
- package/dist/safe-bash/command-chunks/{chunk-5E4WAO4O.js → chunk-JD5QNRNO.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-I237SNW5.js → chunk-LFJJQQND.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-W5DNF4JH.js → chunk-LOICUCHG.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-7U7EXOXX.js → chunk-NASVPT6F.js} +2 -1
- package/dist/safe-bash/command-chunks/{chunk-OQKC5ZU2.js → chunk-NKIELG7Y.js} +22 -1
- package/dist/safe-bash/command-chunks/{chunk-WPYIOKE3.js → chunk-PICVQ6B5.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-YOFC45RK.js → chunk-QVOS4YXL.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-VGG2DL5Q.js → chunk-TRR4MYWF.js} +4 -0
- package/dist/safe-bash/command-chunks/{chunk-2JRBIDAD.js → chunk-V4K2JDYU.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-6GWJUQAV.js → chunk-WWIBP2ET.js} +38 -111
- package/dist/safe-bash/command-chunks/chunk-ZDN7MJE6.js +168 -0
- package/dist/safe-bash/commands/bytes/compression/index.js +54 -51
- package/dist/safe-bash/commands/chmod/index.browser.js +14 -0
- package/dist/safe-bash/commands/chmod/index.d.ts +2 -0
- package/dist/safe-bash/commands/chmod/index.js +2 -0
- package/dist/safe-bash/commands/metadata/chmod.d.ts +1 -7
- package/dist/safe-bash/commands/metadata/chmod.js +1 -204
- package/dist/safe-bash/commands/metadata/index.browser.js +1 -5
- package/dist/safe-bash/commands/metadata/internal.d.ts +1 -30
- package/dist/safe-bash/commands/metadata/internal.js +1 -76
- package/dist/safe-bash/commands/metadata/mktemp.d.ts +1 -3
- package/dist/safe-bash/commands/metadata/mktemp.js +1 -202
- package/dist/safe-bash/commands/metadata/stat.d.ts +1 -7
- package/dist/safe-bash/commands/metadata/stat.js +1 -530
- package/dist/safe-bash/commands/mktemp/index.browser.js +13 -0
- package/dist/safe-bash/commands/mktemp/index.d.ts +2 -0
- package/dist/safe-bash/commands/mktemp/index.js +2 -0
- package/dist/safe-bash/commands/node/index.browser.js +2 -2
- package/dist/safe-bash/commands/portable-random.d.ts +1 -1
- package/dist/safe-bash/commands/portable-random.js +1 -12
- package/dist/safe-bash/commands/python/index.browser.js +3 -3
- package/dist/safe-bash/commands/stat/index.browser.js +13 -0
- package/dist/safe-bash/commands/stat/index.d.ts +2 -0
- package/dist/safe-bash/commands/stat/index.js +2 -0
- package/dist/safe-bash/commands/text.js +46 -10
- package/dist/safe-bash/full-core.browser.js +86 -86
- package/dist/safe-bash/jobs.browser.js +2 -2
- package/dist/safe-bash/opt-in/commands/yq/native-work.js +1 -0
- package/dist/safe-bash/optional-host.browser.js +10 -10
- package/dist/safe-bash/plugins/index.browser.js +13 -13
- package/dist/safe-bash/registry-entry.browser.js +16 -16
- package/dist/safe-bash/search.browser.js +14 -14
- package/dist/safe-bash/shell/runtime.d.ts +3 -0
- package/dist/safe-bash/shell/runtime.js +20 -3
- package/dist/safe-bash/shell/types.d.ts +2 -0
- package/dist/safe-bash/shell/worker-limits.js +1 -0
- package/dist/safe-bash/shell-entry.browser.js +12 -12
- package/dist/safe-bash/worker/host.js +1 -1
- package/dist/safe-bash-command-bc/index.js +12 -5
- package/dist/safe-bash-command-bzip2/index.js +4 -3
- package/dist/safe-bash-command-chmod/LICENSE +21 -0
- package/dist/safe-bash-command-chmod/command.d.ts +7 -0
- package/dist/safe-bash-command-chmod/command.js +11 -0
- package/dist/safe-bash-command-chmod/index.d.ts +6 -0
- package/dist/safe-bash-command-chmod/index.js +27 -0
- package/dist/safe-bash-command-exiftool/index.js +5 -5
- package/dist/safe-bash-command-find/find.js +1 -1
- package/dist/safe-bash-command-find/index.js +1 -1
- package/dist/safe-bash-command-fmt/index.js +9 -2
- package/dist/safe-bash-command-gzip/index.js +45 -42
- package/dist/safe-bash-command-imagemagick/index.js +3 -1
- package/dist/safe-bash-command-jq/index.js +1 -1
- package/dist/safe-bash-command-jq/jq.js +1 -1
- package/dist/safe-bash-command-less/index.js +12 -3
- package/dist/safe-bash-command-mktemp/LICENSE +21 -0
- package/dist/safe-bash-command-mktemp/command.d.ts +3 -0
- package/dist/safe-bash-command-mktemp/command.js +9 -0
- package/dist/safe-bash-command-mktemp/index.d.ts +6 -0
- package/dist/safe-bash-command-mktemp/index.js +25 -0
- package/dist/safe-bash-command-od/index.js +6 -2
- package/dist/safe-bash-command-op/index.js +25 -6
- package/dist/safe-bash-command-rg/index.js +1 -1
- package/dist/safe-bash-command-rg/rg-command.js +1 -1
- package/dist/safe-bash-command-sed/index.js +1 -1
- package/dist/safe-bash-command-sed/sed.js +1 -1
- package/dist/safe-bash-command-sips/index.js +13 -5
- package/dist/safe-bash-command-sponge/index.js +10 -3
- package/dist/safe-bash-command-stat/LICENSE +21 -0
- package/dist/safe-bash-command-stat/command.d.ts +7 -0
- package/dist/safe-bash-command-stat/command.js +9 -0
- package/dist/safe-bash-command-stat/index.d.ts +6 -0
- package/dist/safe-bash-command-stat/index.js +25 -0
- package/dist/safe-bash-command-unrtf/index.js +11 -1
- package/dist/safe-bash-command-xxd/index.js +6 -2
- package/dist/safe-bash-command-xz/command.d.ts +1 -1
- package/dist/safe-bash-command-xz/index.js +3 -2
- package/dist/safe-bash-command-yq/index.js +1 -0
- package/dist/safe-bash-command-yq/native-work.js +1 -0
- package/dist/safe-bash-command-yq/query.js +3 -0
- package/dist/safe-bash-compression-engine/bounded-codec.js +3 -3
- package/dist/safe-bash-compression-engine/codec-loader.js +2 -2
- package/dist/safe-bash-compression-engine/files.js +6 -6
- package/dist/safe-bash-compression-engine/index.js +5 -5
- package/dist/safe-bash-compression-engine/operand.js +6 -6
- package/dist/safe-bash-compression-engine/options.js +1 -1
- package/dist/safe-bash-compression-engine/stream.js +5 -5
- package/dist/safe-bash-compression-engine/zstd-decode.js +4 -4
- package/dist/safe-bash-contracts/escaping.js +2 -2
- package/dist/safe-bash-contracts/filesystem-output.js +2 -2
- package/dist/safe-bash-contracts/index.js +2 -2
- package/dist/safe-bash-contracts/io.d.ts +2 -0
- package/dist/safe-bash-contracts/io.js +1 -1
- package/dist/safe-bash-contracts/output.js +2 -2
- package/dist/safe-bash-io-engine/commands/search/requirements.js +1 -1
- package/dist/safe-bash-io-engine/commands/text-programs/shared.js +1 -1
- package/dist/safe-bash-mcp/index.browser.js +11 -1
- package/dist/safe-bash-mcp/index.js +35 -16
- package/dist/safe-bash-metadata-engine/LICENSE +21 -0
- package/dist/safe-bash-metadata-engine/index.d.ts +30 -0
- package/dist/safe-bash-metadata-engine/index.js +82 -0
- package/dist/safe-bash-metadata-engine/random.d.ts +1 -0
- package/dist/safe-bash-metadata-engine/random.js +21 -0
- package/dist/safe-bash-regex-engine/index.js +1 -1
- package/dist/safe-bash-regex-engine/text/regex.js +1 -1
- package/dist/safe-bash-search-engine/ergonomic-regex.js +2 -2
- package/dist/safe-bash-search-engine/glob.js +2 -2
- package/dist/safe-bash-search-engine/grep.js +2 -2
- package/dist/safe-bash-search-engine/matcher.js +2 -2
- package/dist/safe-bash-search-engine/options.d.ts +2 -0
- package/dist/safe-bash-search-engine/options.js +1 -1
- package/dist/safe-bash-search-engine/output.js +1 -1
- package/dist/safe-bash-search-engine/shared.js +2 -2
- package/dist/safe-bash-search-engine/walk.js +3 -3
- package/dist/safe-playwright-cloudflare/browser-snapshot-json.js +2 -2
- package/dist/safe-playwright-cloudflare/browser-snapshot-references.js +1 -1
- package/package.json +31 -5
- package/dist/safe-bash/chunks/chunk-VSAJ4OTM.js +0 -962
- package/dist/safe-bash/chunks/{chunk-BJA5XNP6.js → chunk-A7XEHALN.js} +3 -3
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
unchangedSource,
|
|
5
5
|
verifyOperandDestinations,
|
|
6
6
|
writeFileOperand
|
|
7
|
-
} from "../safe-bash/command-chunks/chunk-
|
|
8
|
-
import "../safe-bash/command-chunks/chunk-
|
|
9
|
-
import "../safe-bash/command-chunks/chunk-
|
|
7
|
+
} from "../safe-bash/command-chunks/chunk-PICVQ6B5.js";
|
|
8
|
+
import "../safe-bash/command-chunks/chunk-V4K2JDYU.js";
|
|
9
|
+
import "../safe-bash/command-chunks/chunk-CQHP3I66.js";
|
|
10
10
|
import "../safe-bash/command-chunks/chunk-Z6UEDK5T.js";
|
|
11
|
-
import "../safe-bash/command-chunks/chunk-
|
|
12
|
-
import "../safe-bash/command-chunks/chunk-
|
|
13
|
-
import "../safe-bash/command-chunks/chunk-
|
|
11
|
+
import "../safe-bash/command-chunks/chunk-LOICUCHG.js";
|
|
12
|
+
import "../safe-bash/command-chunks/chunk-BXCXRYVU.js";
|
|
13
|
+
import "../safe-bash/command-chunks/chunk-JD5QNRNO.js";
|
|
14
14
|
import "../safe-bash/command-chunks/chunk-QE3VAUMI.js";
|
|
15
15
|
import "../safe-bash/command-chunks/chunk-I6YHLFNL.js";
|
|
16
16
|
import "../safe-bash/command-chunks/chunk-2UQSP2CE.js";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DecodedBudget,
|
|
3
3
|
transform
|
|
4
|
-
} from "../safe-bash/command-chunks/chunk-
|
|
5
|
-
import "../safe-bash/command-chunks/chunk-
|
|
4
|
+
} from "../safe-bash/command-chunks/chunk-V4K2JDYU.js";
|
|
5
|
+
import "../safe-bash/command-chunks/chunk-CQHP3I66.js";
|
|
6
6
|
import "../safe-bash/command-chunks/chunk-Z6UEDK5T.js";
|
|
7
7
|
import {
|
|
8
8
|
boundedCodec
|
|
9
|
-
} from "../safe-bash/command-chunks/chunk-
|
|
10
|
-
import "../safe-bash/command-chunks/chunk-
|
|
11
|
-
import "../safe-bash/command-chunks/chunk-
|
|
9
|
+
} from "../safe-bash/command-chunks/chunk-LOICUCHG.js";
|
|
10
|
+
import "../safe-bash/command-chunks/chunk-BXCXRYVU.js";
|
|
11
|
+
import "../safe-bash/command-chunks/chunk-JD5QNRNO.js";
|
|
12
12
|
import "../safe-bash/command-chunks/chunk-QE3VAUMI.js";
|
|
13
13
|
import "../safe-bash/command-chunks/chunk-I6YHLFNL.js";
|
|
14
14
|
import "../safe-bash/command-chunks/chunk-2UQSP2CE.js";
|
|
@@ -2,15 +2,15 @@ import {
|
|
|
2
2
|
sourceBytes,
|
|
3
3
|
unchangedSource,
|
|
4
4
|
writeFileOperand
|
|
5
|
-
} from "../safe-bash/command-chunks/chunk-
|
|
5
|
+
} from "../safe-bash/command-chunks/chunk-PICVQ6B5.js";
|
|
6
6
|
import {
|
|
7
7
|
transform
|
|
8
|
-
} from "../safe-bash/command-chunks/chunk-
|
|
9
|
-
import "../safe-bash/command-chunks/chunk-
|
|
8
|
+
} from "../safe-bash/command-chunks/chunk-V4K2JDYU.js";
|
|
9
|
+
import "../safe-bash/command-chunks/chunk-CQHP3I66.js";
|
|
10
10
|
import "../safe-bash/command-chunks/chunk-Z6UEDK5T.js";
|
|
11
|
-
import "../safe-bash/command-chunks/chunk-
|
|
12
|
-
import "../safe-bash/command-chunks/chunk-
|
|
13
|
-
import "../safe-bash/command-chunks/chunk-
|
|
11
|
+
import "../safe-bash/command-chunks/chunk-LOICUCHG.js";
|
|
12
|
+
import "../safe-bash/command-chunks/chunk-BXCXRYVU.js";
|
|
13
|
+
import "../safe-bash/command-chunks/chunk-JD5QNRNO.js";
|
|
14
14
|
import "../safe-bash/command-chunks/chunk-QE3VAUMI.js";
|
|
15
15
|
import "../safe-bash/command-chunks/chunk-I6YHLFNL.js";
|
|
16
16
|
import "../safe-bash/command-chunks/chunk-2UQSP2CE.js";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
formats,
|
|
4
4
|
parseOptions,
|
|
5
5
|
profiles
|
|
6
|
-
} from "../safe-bash/command-chunks/chunk-
|
|
6
|
+
} from "../safe-bash/command-chunks/chunk-JD5QNRNO.js";
|
|
7
7
|
import "../safe-bash/command-chunks/chunk-QE3VAUMI.js";
|
|
8
8
|
import "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
|
|
9
9
|
export {
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
chunkBytes,
|
|
4
4
|
stagingLimit,
|
|
5
5
|
transform
|
|
6
|
-
} from "../safe-bash/command-chunks/chunk-
|
|
7
|
-
import "../safe-bash/command-chunks/chunk-
|
|
6
|
+
} from "../safe-bash/command-chunks/chunk-V4K2JDYU.js";
|
|
7
|
+
import "../safe-bash/command-chunks/chunk-CQHP3I66.js";
|
|
8
8
|
import "../safe-bash/command-chunks/chunk-Z6UEDK5T.js";
|
|
9
|
-
import "../safe-bash/command-chunks/chunk-
|
|
10
|
-
import "../safe-bash/command-chunks/chunk-
|
|
11
|
-
import "../safe-bash/command-chunks/chunk-
|
|
9
|
+
import "../safe-bash/command-chunks/chunk-LOICUCHG.js";
|
|
10
|
+
import "../safe-bash/command-chunks/chunk-BXCXRYVU.js";
|
|
11
|
+
import "../safe-bash/command-chunks/chunk-JD5QNRNO.js";
|
|
12
12
|
import "../safe-bash/command-chunks/chunk-QE3VAUMI.js";
|
|
13
13
|
import "../safe-bash/command-chunks/chunk-I6YHLFNL.js";
|
|
14
14
|
import "../safe-bash/command-chunks/chunk-2UQSP2CE.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
zstdDecode
|
|
3
|
-
} from "../safe-bash/command-chunks/chunk-
|
|
3
|
+
} from "../safe-bash/command-chunks/chunk-CQHP3I66.js";
|
|
4
4
|
import "../safe-bash/command-chunks/chunk-Z6UEDK5T.js";
|
|
5
|
-
import "../safe-bash/command-chunks/chunk-
|
|
6
|
-
import "../safe-bash/command-chunks/chunk-
|
|
7
|
-
import "../safe-bash/command-chunks/chunk-
|
|
5
|
+
import "../safe-bash/command-chunks/chunk-LOICUCHG.js";
|
|
6
|
+
import "../safe-bash/command-chunks/chunk-BXCXRYVU.js";
|
|
7
|
+
import "../safe-bash/command-chunks/chunk-JD5QNRNO.js";
|
|
8
8
|
import "../safe-bash/command-chunks/chunk-QE3VAUMI.js";
|
|
9
9
|
import "../safe-bash/command-chunks/chunk-I6YHLFNL.js";
|
|
10
10
|
import "../safe-bash/command-chunks/chunk-2UQSP2CE.js";
|
|
@@ -4,10 +4,10 @@ import "../safe-bash/command-chunks/chunk-VM6YNUJE.js";
|
|
|
4
4
|
import "../safe-bash/command-chunks/chunk-UEEPCFWK.js";
|
|
5
5
|
import "../safe-bash/command-chunks/chunk-O5SNTXHH.js";
|
|
6
6
|
import "../safe-bash/command-chunks/chunk-OF4LJSBK.js";
|
|
7
|
-
import "../safe-bash/command-chunks/chunk-
|
|
7
|
+
import "../safe-bash/command-chunks/chunk-QVOS4YXL.js";
|
|
8
8
|
import {
|
|
9
9
|
writeBytes
|
|
10
|
-
} from "../safe-bash/command-chunks/chunk-
|
|
10
|
+
} from "../safe-bash/command-chunks/chunk-6JSIFWYT.js";
|
|
11
11
|
import "../safe-bash/command-chunks/chunk-X475DYQM.js";
|
|
12
12
|
import "../safe-bash/command-chunks/chunk-G5PQV7XW.js";
|
|
13
13
|
import "../safe-bash/command-chunks/chunk-XPT2UGBF.js";
|
|
@@ -10,11 +10,11 @@ import {
|
|
|
10
10
|
} from "../safe-bash/command-chunks/chunk-VM6YNUJE.js";
|
|
11
11
|
import {
|
|
12
12
|
createOutputOperation
|
|
13
|
-
} from "../safe-bash/command-chunks/chunk-
|
|
13
|
+
} from "../safe-bash/command-chunks/chunk-QVOS4YXL.js";
|
|
14
14
|
import {
|
|
15
15
|
createBytePipe,
|
|
16
16
|
outputFailure
|
|
17
|
-
} from "../safe-bash/command-chunks/chunk-
|
|
17
|
+
} from "../safe-bash/command-chunks/chunk-6JSIFWYT.js";
|
|
18
18
|
import {
|
|
19
19
|
FsError
|
|
20
20
|
} from "../safe-bash/command-chunks/chunk-X475DYQM.js";
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
} from "../safe-bash/command-chunks/chunk-OF4LJSBK.js";
|
|
33
33
|
import {
|
|
34
34
|
createOutputOperation
|
|
35
|
-
} from "../safe-bash/command-chunks/chunk-
|
|
35
|
+
} from "../safe-bash/command-chunks/chunk-QVOS4YXL.js";
|
|
36
36
|
import {
|
|
37
37
|
InputByteBudget,
|
|
38
38
|
collectBytes,
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
withInputByteBudget,
|
|
48
48
|
writeBytes,
|
|
49
49
|
writeText
|
|
50
|
-
} from "../safe-bash/command-chunks/chunk-
|
|
50
|
+
} from "../safe-bash/command-chunks/chunk-6JSIFWYT.js";
|
|
51
51
|
import {
|
|
52
52
|
FsError,
|
|
53
53
|
isErrnoCode,
|
|
@@ -52,6 +52,8 @@ export interface PipeWriteEndpoint extends PipeEndpoint {
|
|
|
52
52
|
}
|
|
53
53
|
export interface BytePipeOptions {
|
|
54
54
|
readonly highWaterMark?: number;
|
|
55
|
+
/** Admit each nonempty write before copying or publishing its bytes. */
|
|
56
|
+
readonly admitWrite?: (byteLength: number) => void;
|
|
55
57
|
/** Maximum pending endpoint observations across both ends; defaults to Infinity. */
|
|
56
58
|
readonly maxObservationWaiters?: number;
|
|
57
59
|
readonly signal?: AbortSignal;
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
withInputByteBudget,
|
|
12
12
|
writeBytes,
|
|
13
13
|
writeText
|
|
14
|
-
} from "../safe-bash/command-chunks/chunk-
|
|
14
|
+
} from "../safe-bash/command-chunks/chunk-6JSIFWYT.js";
|
|
15
15
|
import "../safe-bash/command-chunks/chunk-X475DYQM.js";
|
|
16
16
|
import "../safe-bash/command-chunks/chunk-Y2WBSJG6.js";
|
|
17
17
|
import "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createOutputOperation
|
|
3
|
-
} from "../safe-bash/command-chunks/chunk-
|
|
4
|
-
import "../safe-bash/command-chunks/chunk-
|
|
3
|
+
} from "../safe-bash/command-chunks/chunk-QVOS4YXL.js";
|
|
4
|
+
import "../safe-bash/command-chunks/chunk-6JSIFWYT.js";
|
|
5
5
|
import "../safe-bash/command-chunks/chunk-X475DYQM.js";
|
|
6
6
|
import "../safe-bash/command-chunks/chunk-Y2WBSJG6.js";
|
|
7
7
|
import "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
requiredFileInput,
|
|
6
6
|
searchRequirements,
|
|
7
7
|
sedRequirements
|
|
8
|
-
} from "../../../safe-bash/command-chunks/chunk-
|
|
8
|
+
} from "../../../safe-bash/command-chunks/chunk-HDCNKOIX.js";
|
|
9
9
|
import "../../../safe-bash/command-chunks/chunk-XS72HTMA.js";
|
|
10
10
|
import "../../../safe-bash/command-chunks/chunk-PM2PFWPC.js";
|
|
11
11
|
import "../../../safe-bash/command-chunks/chunk-RHKBCQYQ.js";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "../../../safe-bash/command-chunks/chunk-ZMAFOEN7.js";
|
|
5
5
|
import {
|
|
6
6
|
requiredFileInput
|
|
7
|
-
} from "../../../safe-bash/command-chunks/chunk-
|
|
7
|
+
} from "../../../safe-bash/command-chunks/chunk-HDCNKOIX.js";
|
|
8
8
|
import {
|
|
9
9
|
RESOLVED_EXIT_ONE,
|
|
10
10
|
RESOLVED_EXIT_ZERO,
|
|
@@ -8535,6 +8535,7 @@ function compileToolArguments(tool, options = {}) {
|
|
|
8535
8535
|
// src/commands.ts
|
|
8536
8536
|
import {
|
|
8537
8537
|
collectBytes,
|
|
8538
|
+
readBytes,
|
|
8538
8539
|
commandRuntimeIdentity,
|
|
8539
8540
|
createOutputOperation,
|
|
8540
8541
|
getCommandArguments
|
|
@@ -8741,7 +8742,15 @@ async function stdinArguments(context, args, signal, maxBytes) {
|
|
|
8741
8742
|
const inline = meaningful.length === 1 && meaningful[0] === "--raw=-";
|
|
8742
8743
|
const separated = meaningful.length === 2 && meaningful[0] === "--raw" && meaningful[1] === "-";
|
|
8743
8744
|
if (!inline && !separated) return args;
|
|
8744
|
-
const
|
|
8745
|
+
const source = (async function* () {
|
|
8746
|
+
let totalBytes = 0;
|
|
8747
|
+
for await (const chunk of readBytes(context.stdin, signal)) {
|
|
8748
|
+
totalBytes += chunk.byteLength;
|
|
8749
|
+
context.inputBudget?.check(totalBytes);
|
|
8750
|
+
yield chunk;
|
|
8751
|
+
}
|
|
8752
|
+
})();
|
|
8753
|
+
const bytes = await collectBytes(source, { signal, maxBytes });
|
|
8745
8754
|
let json;
|
|
8746
8755
|
try {
|
|
8747
8756
|
json = new TextDecoder("utf-8", { fatal: true }).decode(bytes);
|
|
@@ -8830,6 +8839,7 @@ async function createRemoteMcpCommands(servers, options = {}) {
|
|
|
8830
8839
|
}
|
|
8831
8840
|
} catch (error) {
|
|
8832
8841
|
operation.signal.throwIfAborted();
|
|
8842
|
+
if (typeof error === "object" && error !== null && ("code" in error && error.code === "ERR_BUDGET_EXCEEDED" || "name" in error && error.name === "BudgetExceededError")) throw error;
|
|
8833
8843
|
await emit(errors, `${JSON.stringify({ error: errorDetails(error) })}
|
|
8834
8844
|
`, outputLimit);
|
|
8835
8845
|
return { exitCode: 2 };
|
|
@@ -13801,6 +13801,7 @@ function compileToolArguments(tool, options = {}) {
|
|
|
13801
13801
|
// src/commands.ts
|
|
13802
13802
|
import {
|
|
13803
13803
|
collectBytes,
|
|
13804
|
+
readBytes,
|
|
13804
13805
|
commandRuntimeIdentity,
|
|
13805
13806
|
createOutputOperation,
|
|
13806
13807
|
getCommandArguments
|
|
@@ -14007,7 +14008,15 @@ async function stdinArguments(context, args, signal, maxBytes) {
|
|
|
14007
14008
|
const inline = meaningful.length === 1 && meaningful[0] === "--raw=-";
|
|
14008
14009
|
const separated = meaningful.length === 2 && meaningful[0] === "--raw" && meaningful[1] === "-";
|
|
14009
14010
|
if (!inline && !separated) return args;
|
|
14010
|
-
const
|
|
14011
|
+
const source = (async function* () {
|
|
14012
|
+
let totalBytes = 0;
|
|
14013
|
+
for await (const chunk of readBytes(context.stdin, signal)) {
|
|
14014
|
+
totalBytes += chunk.byteLength;
|
|
14015
|
+
context.inputBudget?.check(totalBytes);
|
|
14016
|
+
yield chunk;
|
|
14017
|
+
}
|
|
14018
|
+
})();
|
|
14019
|
+
const bytes = await collectBytes(source, { signal, maxBytes });
|
|
14011
14020
|
let json;
|
|
14012
14021
|
try {
|
|
14013
14022
|
json = new TextDecoder("utf-8", { fatal: true }).decode(bytes);
|
|
@@ -14096,6 +14105,7 @@ async function createRemoteMcpCommands(servers, options = {}) {
|
|
|
14096
14105
|
}
|
|
14097
14106
|
} catch (error) {
|
|
14098
14107
|
operation.signal.throwIfAborted();
|
|
14108
|
+
if (typeof error === "object" && error !== null && ("code" in error && error.code === "ERR_BUDGET_EXCEEDED" || "name" in error && error.name === "BudgetExceededError")) throw error;
|
|
14099
14109
|
await emit(errors, `${JSON.stringify({ error: errorDetails(error) })}
|
|
14100
14110
|
`, outputLimit);
|
|
14101
14111
|
return { exitCode: 2 };
|
|
@@ -14544,7 +14554,7 @@ async function collectBytes2(source, options) {
|
|
|
14544
14554
|
reserved += bytes;
|
|
14545
14555
|
}
|
|
14546
14556
|
options.signal?.throwIfAborted();
|
|
14547
|
-
for await (const chunk of
|
|
14557
|
+
for await (const chunk of readBytes2(source, options.signal)) {
|
|
14548
14558
|
reserved -= inputBytes;
|
|
14549
14559
|
inputBytes = 0;
|
|
14550
14560
|
if (chunk.byteLength > (options.maxBytes ?? Infinity) - size) {
|
|
@@ -14738,7 +14748,7 @@ var ReadBytesGenerator = class {
|
|
|
14738
14748
|
});
|
|
14739
14749
|
}
|
|
14740
14750
|
};
|
|
14741
|
-
function
|
|
14751
|
+
function readBytes2(source, signal) {
|
|
14742
14752
|
if (signal !== void 0 && source[readBytesSignal] === signal) {
|
|
14743
14753
|
return source;
|
|
14744
14754
|
}
|
|
@@ -16133,6 +16143,7 @@ var FastDirectoryEntriesMap = class {
|
|
|
16133
16143
|
}
|
|
16134
16144
|
_rebuild(newCap) {
|
|
16135
16145
|
this._missKey = "";
|
|
16146
|
+
this._missSlot = -1;
|
|
16136
16147
|
const newTableLen = newCap * 2;
|
|
16137
16148
|
const newMask = newTableLen - 1;
|
|
16138
16149
|
const newTable = newCap <= 16384 ? new Int16Array(newTableLen).fill(-1) : new Int32Array(newTableLen).fill(-1);
|
|
@@ -16172,16 +16183,17 @@ var FastDirectoryEntriesMap = class {
|
|
|
16172
16183
|
this._next = writeIdx;
|
|
16173
16184
|
}
|
|
16174
16185
|
set(k, v) {
|
|
16175
|
-
|
|
16186
|
+
const missSlot = k === this._missKey ? this._missSlot : -1;
|
|
16187
|
+
this._missKey = "";
|
|
16188
|
+
this._missSlot = -1;
|
|
16189
|
+
if (missSlot >= 0 && (this._table[missSlot] === -1 || this._table[missSlot] === -2) && this._next < this._keys.length) {
|
|
16176
16190
|
const entryIdx = this._next++;
|
|
16177
|
-
this._table[
|
|
16191
|
+
this._table[missSlot] = entryIdx;
|
|
16178
16192
|
this._keys[entryIdx] = k;
|
|
16179
16193
|
this._vals[entryIdx] = v;
|
|
16180
16194
|
this.size++;
|
|
16181
|
-
this._missKey = "";
|
|
16182
16195
|
return this;
|
|
16183
16196
|
}
|
|
16184
|
-
this._missKey = "";
|
|
16185
16197
|
if (this._next >= this._keys.length) {
|
|
16186
16198
|
this._rebuild(this.size * 2 <= this._keys.length ? this._keys.length : this._keys.length * 2);
|
|
16187
16199
|
}
|
|
@@ -16213,6 +16225,7 @@ var FastDirectoryEntriesMap = class {
|
|
|
16213
16225
|
}
|
|
16214
16226
|
delete(k) {
|
|
16215
16227
|
this._missKey = "";
|
|
16228
|
+
this._missSlot = -1;
|
|
16216
16229
|
if (this.size === 0)
|
|
16217
16230
|
return false;
|
|
16218
16231
|
let slot = this._hash(k);
|
|
@@ -16239,6 +16252,7 @@ var FastDirectoryEntriesMap = class {
|
|
|
16239
16252
|
}
|
|
16240
16253
|
clear() {
|
|
16241
16254
|
this._missKey = "";
|
|
16255
|
+
this._missSlot = -1;
|
|
16242
16256
|
if (this._next > 0) {
|
|
16243
16257
|
this._table.fill(-1);
|
|
16244
16258
|
for (let i = 0; i < this._next; i++) {
|
|
@@ -16874,6 +16888,7 @@ var MemoryFileSystem = class _MemoryFileSystem {
|
|
|
16874
16888
|
if (alloc.isReleased64()) {
|
|
16875
16889
|
alloc.detachLedger(DUMMY_POOL_LEDGER);
|
|
16876
16890
|
if (this.ledger.hasInfiniteRetained && this.ledger.hasInfiniteFileBytes && sharedAllocationPoolLen < SHARED_POOL_CAPACITY) {
|
|
16891
|
+
alloc.data.fill(0);
|
|
16877
16892
|
sharedAllocationPool[sharedAllocationPoolLen++] = alloc;
|
|
16878
16893
|
} else if (cache.allocations.length < 128) {
|
|
16879
16894
|
cache.allocations.push(alloc);
|
|
@@ -16881,6 +16896,7 @@ var MemoryFileSystem = class _MemoryFileSystem {
|
|
|
16881
16896
|
} else if (alloc.isReleased65536()) {
|
|
16882
16897
|
alloc.detachLedger(DUMMY_POOL_LEDGER);
|
|
16883
16898
|
if (this.ledger.hasInfiniteRetained && this.ledger.hasInfiniteFileBytes && sharedLargeAllocationPoolLen < SHARED_LARGE_POOL_CAPACITY) {
|
|
16899
|
+
alloc.data.fill(0);
|
|
16884
16900
|
sharedLargeAllocationPool[sharedLargeAllocationPoolLen++] = alloc;
|
|
16885
16901
|
}
|
|
16886
16902
|
}
|
|
@@ -16897,6 +16913,7 @@ var MemoryFileSystem = class _MemoryFileSystem {
|
|
|
16897
16913
|
cache.lastFastDirNode = void 0;
|
|
16898
16914
|
}
|
|
16899
16915
|
if (node.entries.size === 0) {
|
|
16916
|
+
node.entries.clear();
|
|
16900
16917
|
if (sharedDirectoryNodePoolLen < SHARED_DIR_POOL_CAPACITY) {
|
|
16901
16918
|
sharedDirectoryNodePool[sharedDirectoryNodePoolLen++] = node;
|
|
16902
16919
|
} else if (cache.directories.length < 32) {
|
|
@@ -16921,11 +16938,13 @@ var MemoryFileSystem = class _MemoryFileSystem {
|
|
|
16921
16938
|
if (previous.isReleased64()) {
|
|
16922
16939
|
previous.detachLedger(DUMMY_POOL_LEDGER);
|
|
16923
16940
|
if (this.ledger.hasInfiniteRetained && this.ledger.hasInfiniteFileBytes && sharedAllocationPoolLen < SHARED_POOL_CAPACITY) {
|
|
16941
|
+
previous.data.fill(0);
|
|
16924
16942
|
sharedAllocationPool[sharedAllocationPoolLen++] = previous;
|
|
16925
16943
|
}
|
|
16926
16944
|
} else if (previous.isReleased65536()) {
|
|
16927
16945
|
previous.detachLedger(DUMMY_POOL_LEDGER);
|
|
16928
16946
|
if (this.ledger.hasInfiniteRetained && this.ledger.hasInfiniteFileBytes && sharedLargeAllocationPoolLen < SHARED_LARGE_POOL_CAPACITY) {
|
|
16947
|
+
previous.data.fill(0);
|
|
16929
16948
|
sharedLargeAllocationPool[sharedLargeAllocationPoolLen++] = previous;
|
|
16930
16949
|
}
|
|
16931
16950
|
}
|
|
@@ -19547,7 +19566,7 @@ var ReadOnlyFileSystem = class _ReadOnlyFileSystem {
|
|
|
19547
19566
|
if (typeof this.#filesystem.readStream !== "function") {
|
|
19548
19567
|
throw new FsError("ENOTSUP", { syscall: "readStream", path: path6 });
|
|
19549
19568
|
}
|
|
19550
|
-
for await (const chunk of
|
|
19569
|
+
for await (const chunk of readBytes2(this.#filesystem.readStream(path6, options), options?.signal)) {
|
|
19551
19570
|
yield new Uint8Array(chunk);
|
|
19552
19571
|
}
|
|
19553
19572
|
}
|
|
@@ -21310,7 +21329,7 @@ var WebDavFileSystem = class {
|
|
|
21310
21329
|
let size = prefix.byteLength;
|
|
21311
21330
|
if (prefix.byteLength)
|
|
21312
21331
|
yield prefix;
|
|
21313
|
-
for await (const chunk of
|
|
21332
|
+
for await (const chunk of readBytes2(source, signal)) {
|
|
21314
21333
|
size += chunk.byteLength;
|
|
21315
21334
|
if (size > limit)
|
|
21316
21335
|
fail("EFBIG", "writeStream", path6, "upload exceeds byte limit");
|
|
@@ -22649,7 +22668,7 @@ var S3FileSystem = class {
|
|
|
22649
22668
|
upload = (async function* () {
|
|
22650
22669
|
let count = 0;
|
|
22651
22670
|
reading = true;
|
|
22652
|
-
for await (const chunk of
|
|
22671
|
+
for await (const chunk of readBytes2(body, signal)) {
|
|
22653
22672
|
if (chunk.length > expected.ContentLength - count)
|
|
22654
22673
|
fail2("EIO", "rename", source, "source body exceeds its enumerated length");
|
|
22655
22674
|
count += chunk.length;
|
|
@@ -22830,7 +22849,7 @@ var S3FileSystem = class {
|
|
|
22830
22849
|
fail2("EIO", "readStream", path6, "response ETag differs from requested snapshot");
|
|
22831
22850
|
if (output.ContentLength !== void 0 && output.ContentLength !== expected)
|
|
22832
22851
|
fail2("EIO", "readStream", path6, "response length differs from requested snapshot");
|
|
22833
|
-
iterator =
|
|
22852
|
+
iterator = readBytes2(output.Body, signal)[Symbol.asyncIterator]();
|
|
22834
22853
|
while (true) {
|
|
22835
22854
|
const result = await iterator.next();
|
|
22836
22855
|
if (result.done)
|
|
@@ -22910,7 +22929,7 @@ var S3FileSystem = class {
|
|
|
22910
22929
|
let finished = false;
|
|
22911
22930
|
const body = (async function* () {
|
|
22912
22931
|
let total = 0;
|
|
22913
|
-
for await (const chunk of
|
|
22932
|
+
for await (const chunk of readBytes2(source, signal)) {
|
|
22914
22933
|
if (chunk.length > this.maxStreamBytes - total)
|
|
22915
22934
|
fail2("EFBIG", "writeStream", path6);
|
|
22916
22935
|
total += chunk.length;
|
|
@@ -23300,10 +23319,10 @@ async function authenticateRemoteMcpServer(value, options) {
|
|
|
23300
23319
|
binding: snapshotConfigurationBindingOptions(options.binding)
|
|
23301
23320
|
};
|
|
23302
23321
|
options.signal?.throwIfAborted();
|
|
23303
|
-
const limits = remoteLimits({ ...options, requestTimeoutMs: options.requestTimeoutMs ??
|
|
23304
|
-
|
|
23305
|
-
|
|
23306
|
-
const signal =
|
|
23322
|
+
const limits = remoteLimits({ ...options, requestTimeoutMs: options.requestTimeoutMs ?? Infinity });
|
|
23323
|
+
const signals = options.signal === void 0 ? [] : [options.signal];
|
|
23324
|
+
if (limits.requestTimeoutMs !== Infinity) signals.push(AbortSignal.timeout(limits.requestTimeoutMs));
|
|
23325
|
+
const signal = AbortSignal.any(signals);
|
|
23307
23326
|
const configuration = parseRemoteMcpConfiguration({ version: 1, servers: [value] }, options.binding);
|
|
23308
23327
|
const browser = options.binding.oauth?.browser === void 0 ? void 0 : { ...options.binding.oauth.browser };
|
|
23309
23328
|
const opener = browser?.openBrowser;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Poe Platform
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type CommandContext, type CommandDefinition, type CommandHandler, type FileType } from "../safe-bash-contracts/index.js";
|
|
2
|
+
export interface MetadataLimits {
|
|
3
|
+
readonly maxEntries: number;
|
|
4
|
+
readonly maxDepth: number;
|
|
5
|
+
readonly maxOutputBytes: number;
|
|
6
|
+
readonly maxArgumentBytes: number;
|
|
7
|
+
readonly maxAttempts: number;
|
|
8
|
+
readonly maxArguments?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface MetadataCommandsOptions {
|
|
11
|
+
readonly replace?: boolean;
|
|
12
|
+
readonly umask?: number;
|
|
13
|
+
readonly limits?: Partial<MetadataLimits>;
|
|
14
|
+
}
|
|
15
|
+
export declare function settings(options?: MetadataCommandsOptions): {
|
|
16
|
+
limits: MetadataLimits;
|
|
17
|
+
umask: number;
|
|
18
|
+
};
|
|
19
|
+
export declare class MetadataBudget {
|
|
20
|
+
readonly context: CommandContext;
|
|
21
|
+
readonly limits: MetadataLimits;
|
|
22
|
+
private entries;
|
|
23
|
+
private outputBytes;
|
|
24
|
+
get remainingEntries(): number;
|
|
25
|
+
constructor(context: CommandContext, limits: MetadataLimits);
|
|
26
|
+
step(depth?: number): Promise<void>;
|
|
27
|
+
output(text: string | Uint8Array): Promise<void>;
|
|
28
|
+
}
|
|
29
|
+
export declare function metadataCommand(name: string, handler: CommandHandler): CommandDefinition;
|
|
30
|
+
export declare function permissionString(mode: number, type: FileType): string;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import {
|
|
2
|
+
init_buffer
|
|
3
|
+
} from "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
|
|
4
|
+
|
|
5
|
+
// packages/safe-bash-metadata-engine/src/index.ts
|
|
6
|
+
init_buffer();
|
|
7
|
+
import { byteLength } from "../safe-bash-io-engine/byte-encoding.js";
|
|
8
|
+
import { yieldTurn } from "../safe-bash-contracts/yield.js";
|
|
9
|
+
import { FsError, writeBytes } from "../safe-bash-contracts/index.js";
|
|
10
|
+
import { diagnostic } from "../safe-bash-io-engine/internal.js";
|
|
11
|
+
import { gnuInformation } from "../safe-bash-io-engine/gnu-information.js";
|
|
12
|
+
function settings(options = {}) {
|
|
13
|
+
const limits = { maxEntries: Infinity, maxDepth: Infinity, maxOutputBytes: Infinity, maxArgumentBytes: Infinity, maxAttempts: Infinity, maxArguments: Infinity, ...options.limits };
|
|
14
|
+
for (const [key, value] of Object.entries(limits)) {
|
|
15
|
+
if (value !== Infinity && (!Number.isSafeInteger(value) || value < (key === "maxDepth" ? 0 : 1))) throw new RangeError(`Invalid metadata limit: ${key}`);
|
|
16
|
+
}
|
|
17
|
+
const umask = options.umask ?? 18;
|
|
18
|
+
if (!Number.isInteger(umask) || umask < 0 || umask > 511) throw new RangeError("Invalid metadata umask");
|
|
19
|
+
return { limits, umask };
|
|
20
|
+
}
|
|
21
|
+
var MetadataBudget = class {
|
|
22
|
+
constructor(context, limits) {
|
|
23
|
+
this.context = context;
|
|
24
|
+
this.limits = limits;
|
|
25
|
+
if (context.args.reduce((size, argument) => size + byteLength(argument), 0) > limits.maxArgumentBytes) throw new FsError("EFBIG", { message: "metadata argument limit exceeded" });
|
|
26
|
+
}
|
|
27
|
+
context;
|
|
28
|
+
limits;
|
|
29
|
+
entries = 0;
|
|
30
|
+
outputBytes = 0;
|
|
31
|
+
get remainingEntries() {
|
|
32
|
+
return this.limits.maxEntries - this.entries;
|
|
33
|
+
}
|
|
34
|
+
async step(depth = 0) {
|
|
35
|
+
this.context.signal.throwIfAborted();
|
|
36
|
+
if (++this.entries > this.limits.maxEntries || depth > this.limits.maxDepth) throw new FsError("EFBIG", { message: "metadata traversal limit exceeded" });
|
|
37
|
+
if (this.entries % 128 === 0) await yieldTurn();
|
|
38
|
+
this.context.signal.throwIfAborted();
|
|
39
|
+
}
|
|
40
|
+
async output(text) {
|
|
41
|
+
const bytes = typeof text === "string" ? new TextEncoder().encode(text) : text;
|
|
42
|
+
if (bytes.byteLength > this.limits.maxOutputBytes - this.outputBytes) throw new FsError("EFBIG", { message: "metadata output limit exceeded" });
|
|
43
|
+
this.outputBytes += bytes.byteLength;
|
|
44
|
+
await writeBytes(this.context.stdout, bytes, this.context.signal);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
function metadataCommand(name, handler) {
|
|
48
|
+
return { name, async execute(context) {
|
|
49
|
+
context.signal.throwIfAborted();
|
|
50
|
+
try {
|
|
51
|
+
const infoPromise = gnuInformation(name, context);
|
|
52
|
+
if (infoPromise) {
|
|
53
|
+
const info = await infoPromise;
|
|
54
|
+
if (info) return info;
|
|
55
|
+
}
|
|
56
|
+
return await handler(context);
|
|
57
|
+
} catch (error) {
|
|
58
|
+
context.signal.throwIfAborted();
|
|
59
|
+
await diagnostic(context, error);
|
|
60
|
+
return { exitCode: 1 };
|
|
61
|
+
}
|
|
62
|
+
} };
|
|
63
|
+
}
|
|
64
|
+
function permissionString(mode, type) {
|
|
65
|
+
let text = type === "directory" ? "d" : type === "symlink" ? "l" : type === "character" ? "c" : "-";
|
|
66
|
+
for (const [read, write, execute, special, lower, upper] of [
|
|
67
|
+
[256, 128, 64, 2048, "s", "S"],
|
|
68
|
+
[32, 16, 8, 1024, "s", "S"],
|
|
69
|
+
[4, 2, 1, 512, "t", "T"]
|
|
70
|
+
]) {
|
|
71
|
+
text += mode & read ? "r" : "-";
|
|
72
|
+
text += mode & write ? "w" : "-";
|
|
73
|
+
text += mode & special ? mode & execute ? lower : upper : mode & execute ? "x" : "-";
|
|
74
|
+
}
|
|
75
|
+
return text;
|
|
76
|
+
}
|
|
77
|
+
export {
|
|
78
|
+
MetadataBudget,
|
|
79
|
+
metadataCommand,
|
|
80
|
+
permissionString,
|
|
81
|
+
settings
|
|
82
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function randomInteger(maximum: number): number;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
init_buffer
|
|
3
|
+
} from "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
|
|
4
|
+
|
|
5
|
+
// packages/safe-bash-metadata-engine/src/random.ts
|
|
6
|
+
init_buffer();
|
|
7
|
+
function randomInteger(maximum) {
|
|
8
|
+
const range = 4294967296;
|
|
9
|
+
if (!Number.isSafeInteger(maximum) || maximum < 1 || maximum > range) {
|
|
10
|
+
throw new RangeError("Random integer maximum must be an integer from 1 to 2^32");
|
|
11
|
+
}
|
|
12
|
+
const limit = Math.floor(range / maximum) * maximum;
|
|
13
|
+
const sample = new Uint32Array(1);
|
|
14
|
+
do {
|
|
15
|
+
globalThis.crypto.getRandomValues(sample);
|
|
16
|
+
} while (sample[0] >= limit);
|
|
17
|
+
return sample[0] % maximum;
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
randomInteger
|
|
21
|
+
};
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
trySubstitutePairSync,
|
|
7
7
|
trySubstitutePairToBufferSync,
|
|
8
8
|
trySubstituteSync
|
|
9
|
-
} from "../safe-bash/command-chunks/chunk-
|
|
9
|
+
} from "../safe-bash/command-chunks/chunk-WWIBP2ET.js";
|
|
10
10
|
import "../safe-bash/command-chunks/chunk-VT6MJBEI.js";
|
|
11
11
|
import {
|
|
12
12
|
RustPatternError,
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
trySubstitutePairSync,
|
|
7
7
|
trySubstitutePairToBufferSync,
|
|
8
8
|
trySubstituteSync
|
|
9
|
-
} from "../../safe-bash/command-chunks/chunk-
|
|
9
|
+
} from "../../safe-bash/command-chunks/chunk-WWIBP2ET.js";
|
|
10
10
|
import "../../safe-bash/command-chunks/chunk-VT6MJBEI.js";
|
|
11
11
|
import "../../safe-bash/command-chunks/chunk-YVNGTIJO.js";
|
|
12
12
|
import "../../safe-bash/command-chunks/chunk-X54L3DBL.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ErgonomicVmMatcher,
|
|
3
3
|
prepareErgonomicRegex
|
|
4
|
-
} from "../safe-bash/command-chunks/chunk-
|
|
5
|
-
import "../safe-bash/command-chunks/chunk-
|
|
4
|
+
} from "../safe-bash/command-chunks/chunk-EARHPPPJ.js";
|
|
5
|
+
import "../safe-bash/command-chunks/chunk-TRR4MYWF.js";
|
|
6
6
|
import "../safe-bash/command-chunks/chunk-AVX5VLX5.js";
|
|
7
7
|
import "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
|
|
8
8
|
export {
|
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
Glob,
|
|
3
3
|
ignoreRules,
|
|
4
4
|
matchGlobs
|
|
5
|
-
} from "../safe-bash/command-chunks/chunk-
|
|
6
|
-
import "../safe-bash/command-chunks/chunk-
|
|
5
|
+
} from "../safe-bash/command-chunks/chunk-LFJJQQND.js";
|
|
6
|
+
import "../safe-bash/command-chunks/chunk-TRR4MYWF.js";
|
|
7
7
|
import "../safe-bash/command-chunks/chunk-AVX5VLX5.js";
|
|
8
8
|
import "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
|
|
9
9
|
export {
|