@poe-platform/safe-bash 0.1.840 → 0.1.841
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/dist/audio-ast/binary.d.ts +19 -0
- package/dist/audio-ast/index.d.ts +1 -0
- package/dist/audio-ast/index.js +92 -91
- package/dist/audio-ast/mpeg.d.ts +23 -0
- package/dist/mp4-ast/containers/adapters.d.ts +1 -0
- package/dist/mp4-ast/types.d.ts +4 -0
- package/dist/safe-bash/audio-ast.browser.js +2 -1
- package/dist/safe-bash/audio-ast.js +1 -1
- package/dist/safe-bash/command-chunks/{chunk-45ZH6CNF.js → chunk-BZW25LNV.js} +400 -127
- package/dist/safe-bash/command-chunks/{chunk-YVFQ5I36.js → chunk-CIV3GER2.js} +3458 -3384
- package/dist/safe-bash/command-chunks/{chunk-T5WFJ44Z.js → chunk-YAXP4EHP.js} +19 -10
- package/dist/safe-bash-command-ffmpeg/index.js +28 -19
- package/dist/safe-bash-command-ffprobe/index.js +2 -2
- package/dist/safe-bash-command-ffprobe/media.js +2 -2
- package/dist/safe-bash-command-imagemagick/index.js +16 -3
- package/dist/safe-bash-command-pandoc/command.js +6 -6
- package/dist/safe-bash-command-pandoc/index.js +37 -37
- package/package.json +2 -2
|
@@ -11,8 +11,9 @@ import {
|
|
|
11
11
|
probeOggFlacSource,
|
|
12
12
|
probeOggStreamMetadata,
|
|
13
13
|
scanMp4Frames,
|
|
14
|
-
scanMp4Packets
|
|
15
|
-
|
|
14
|
+
scanMp4Packets,
|
|
15
|
+
wavPacketFrames
|
|
16
|
+
} from "./chunk-BZW25LNV.js";
|
|
16
17
|
|
|
17
18
|
// packages/safe-bash-command-ffprobe/src/probe-text.ts
|
|
18
19
|
import { yieldTurn } from "../../safe-bash-contracts/yield.js";
|
|
@@ -583,7 +584,7 @@ function audioProbeRows(audio, size, parsed, retainedTags = false) {
|
|
|
583
584
|
const firstFrame = audio.nodes.find((node) => node.type === "MPEG");
|
|
584
585
|
const vbr = firstFrame?.fields?.vbr;
|
|
585
586
|
const encodedSamples = Number(firstFrame?.fields?.encodedSamples);
|
|
586
|
-
const mp3Bitrate = vbr?.bytes && encodedSamples ? vbr.bytes * 8 * audio.streams[0].sampleRate / encodedSamples : audio.streams[0].bitrate;
|
|
587
|
+
const mp3Bitrate = vbr?.type === "Info" ? Number(firstFrame?.fields?.bitrate) : vbr?.bytes && encodedSamples ? vbr.bytes * 8 * audio.streams[0].sampleRate / encodedSamples : audio.streams[0].bitrate;
|
|
587
588
|
const formatTags = audio.format === "ogg" ? {} : { ...audio.tags };
|
|
588
589
|
const brands = audio.nodes.find((node) => node.type === "ftyp")?.fields;
|
|
589
590
|
if (brands)
|
|
@@ -602,6 +603,7 @@ function audioProbeRows(audio, size, parsed, retainedTags = false) {
|
|
|
602
603
|
...stream.tags && Object.keys(stream.tags).length ? { tags: stream.tags } : {},
|
|
603
604
|
codec_name: stream.codec === "pcm" ? stream.bitsPerSample === 8 ? "pcm_u8" : `pcm_s${stream.bitsPerSample}le` : stream.codec === "pcm_float" ? `pcm_f${stream.bitsPerSample}le` : stream.codec,
|
|
604
605
|
codec_type: "audio",
|
|
606
|
+
...["pcm", "pcm_float", "mp3", "flac"].includes(stream.codec) ? { sample_fmt: stream.codec === "mp3" ? "fltp" : stream.codec === "pcm_float" ? stream.bitsPerSample === 64 ? "dbl" : "flt" : stream.codec === "pcm" && stream.bitsPerSample === 8 ? "u8" : stream.bitsPerSample <= 16 ? "s16" : "s32" } : {},
|
|
605
607
|
sample_rate: String(stream.sampleRate),
|
|
606
608
|
channels: stream.channels,
|
|
607
609
|
bits_per_sample: stream.codec.startsWith("pcm") ? stream.bitsPerSample ?? 0 : 0,
|
|
@@ -1624,10 +1626,15 @@ function* formatProbeSteps(probe2, opts) {
|
|
|
1624
1626
|
if (typeOrdinal++ !== (parseInt(spec.slice(2), 10) || 0)) return;
|
|
1625
1627
|
} else if ([...spec].every((c) => c >= "0" && c <= "9") && stream.index !== parseInt(spec, 10)) return;
|
|
1626
1628
|
}
|
|
1629
|
+
const recordCount = probe2.format?.format_name === "wav" ? String(Math.ceil(stream.duration_ts / wavPacketFrames(
|
|
1630
|
+
Number(stream.sample_rate),
|
|
1631
|
+
Math.max(1, (stream.channels ?? 1) * (stream.bits_per_sample ?? 16) / 8)
|
|
1632
|
+
))) : stream.nb_frames ?? "0";
|
|
1633
|
+
const { nb_read_frames, nb_read_packets, ...fields } = stream;
|
|
1627
1634
|
return filterObject({
|
|
1628
|
-
...
|
|
1629
|
-
...opts.countFrames ? { nb_read_frames:
|
|
1630
|
-
...opts.countPackets ? { nb_read_packets:
|
|
1635
|
+
...fields,
|
|
1636
|
+
...opts.countFrames ? { nb_read_frames: nb_read_frames ?? recordCount } : {},
|
|
1637
|
+
...opts.countPackets ? { nb_read_packets: nb_read_packets ?? recordCount } : {}
|
|
1631
1638
|
}, "stream", "stream_tags");
|
|
1632
1639
|
};
|
|
1633
1640
|
const finalFormat = includeFormat && probe2.format ? filterObject(probe2.format, "format", "format_tags") : void 0;
|
|
@@ -1817,6 +1824,9 @@ function parseProbeArguments(args) {
|
|
|
1817
1824
|
showFormat = true;
|
|
1818
1825
|
showStreams = true;
|
|
1819
1826
|
}
|
|
1827
|
+
const entryFilter = parseEntryFilter(showEntries);
|
|
1828
|
+
showPackets ||= entryFilter.has("packet");
|
|
1829
|
+
showFrames ||= entryFilter.has("frame");
|
|
1820
1830
|
return {
|
|
1821
1831
|
printFormat,
|
|
1822
1832
|
showFormat,
|
|
@@ -2038,11 +2048,10 @@ function createFfprobeCommand(options = {}) {
|
|
|
2038
2048
|
inputTarget
|
|
2039
2049
|
} = parseProbeArguments(args);
|
|
2040
2050
|
const entryFilter = parseEntryFilter(showEntries);
|
|
2041
|
-
const packetRecords = showPackets || entryFilter.has("packet"), frameRecords = showFrames || entryFilter.has("frame");
|
|
2042
2051
|
const mp4Records = !options.asts ? {
|
|
2043
|
-
packets:
|
|
2044
|
-
frames:
|
|
2045
|
-
metadata: !(
|
|
2052
|
+
packets: showPackets,
|
|
2053
|
+
frames: showFrames,
|
|
2054
|
+
metadata: !(showPackets || showFrames) || showStreams || showFormat || showChapters || countFrames || countPackets || [...entryFilter.keys()].some((section) => section !== "packet" && section !== "frame")
|
|
2046
2055
|
} : void 0;
|
|
2047
2056
|
const packetPlugins = mp4Records ? [registry.findByFormatName("mp4"), registry.findByFormatName("mov")] : [];
|
|
2048
2057
|
let audioInput;
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
sliceMp4,
|
|
21
21
|
srtAst,
|
|
22
22
|
webvttAst
|
|
23
|
-
} from "../safe-bash/command-chunks/chunk-
|
|
23
|
+
} from "../safe-bash/command-chunks/chunk-BZW25LNV.js";
|
|
24
24
|
import "../safe-bash/command-chunks/chunk-65DS4IOB.js";
|
|
25
25
|
|
|
26
26
|
// packages/safe-bash-command-ffmpeg/src/index.ts
|
|
@@ -326,11 +326,11 @@ function evalScaleDim(expr, iw, ih) {
|
|
|
326
326
|
if (clean.startsWith("ih*")) return Math.max(1, Math.round(ih * (parseFloat(clean.slice(3)) || 1)));
|
|
327
327
|
return parseInt(clean, 10) || iw;
|
|
328
328
|
}
|
|
329
|
-
function
|
|
329
|
+
function parseFilterExpression(expression, filter, variables) {
|
|
330
330
|
let offset = 0;
|
|
331
331
|
const source = expression.trim();
|
|
332
332
|
function parse(minPrecedence = 0, depth = 0) {
|
|
333
|
-
if (depth > 64) throw new Error(
|
|
333
|
+
if (depth > 64) throw new Error(`${filter}: expression is too deeply nested`);
|
|
334
334
|
while (source[offset] === " ") offset++;
|
|
335
335
|
let value;
|
|
336
336
|
const first = source[offset];
|
|
@@ -340,10 +340,16 @@ function parseRotateAngle(expression) {
|
|
|
340
340
|
} else if (first === "(") {
|
|
341
341
|
offset++;
|
|
342
342
|
value = parse(0, depth + 1);
|
|
343
|
-
if (source[offset++] !== ")") throw new Error(
|
|
344
|
-
} else if (
|
|
345
|
-
|
|
346
|
-
|
|
343
|
+
if (source[offset++] !== ")") throw new Error(`${filter}: invalid expression`);
|
|
344
|
+
} else if (first && (first >= "a" && first <= "z" || first >= "A" && first <= "Z" || first === "_")) {
|
|
345
|
+
const start = offset++;
|
|
346
|
+
while (offset < source.length) {
|
|
347
|
+
const c = source[offset];
|
|
348
|
+
if (c >= "a" && c <= "z" || c >= "A" && c <= "Z" || c >= "0" && c <= "9" || c === "_") offset++;
|
|
349
|
+
else break;
|
|
350
|
+
}
|
|
351
|
+
const name = source.slice(start, offset);
|
|
352
|
+
value = Object.hasOwn(variables, name) ? variables[name] : NaN;
|
|
347
353
|
} else {
|
|
348
354
|
const start = offset;
|
|
349
355
|
while (offset < source.length) {
|
|
@@ -368,7 +374,7 @@ function parseRotateAngle(expression) {
|
|
|
368
374
|
return value;
|
|
369
375
|
}
|
|
370
376
|
const angle = parse();
|
|
371
|
-
if (offset !== source.length || !Number.isFinite(angle)) throw new Error(
|
|
377
|
+
if (offset !== source.length || !Number.isFinite(angle)) throw new Error(`${filter}: invalid or unsupported expression`);
|
|
372
378
|
return angle;
|
|
373
379
|
}
|
|
374
380
|
var GLYPH_5X7 = {
|
|
@@ -573,11 +579,11 @@ async function applyVideoFilterChain(frames, filterChainStr, budget, subtitleCue
|
|
|
573
579
|
let targetW = evalScaleDim(wSpec, iw, ih);
|
|
574
580
|
let targetH = evalScaleDim(hSpec, iw, ih);
|
|
575
581
|
if (targetW < 0 && targetH > 0) {
|
|
576
|
-
|
|
577
|
-
|
|
582
|
+
const multiple = wSpec.trim() === "-2" ? 2 : 1;
|
|
583
|
+
targetW = Math.max(1, Math.round(iw * targetH / (Math.max(1, ih) * multiple))) * multiple;
|
|
578
584
|
} else if (targetH < 0 && targetW > 0) {
|
|
579
|
-
|
|
580
|
-
|
|
585
|
+
const multiple = hSpec.trim() === "-2" ? 2 : 1;
|
|
586
|
+
targetH = Math.max(1, Math.round(ih * targetW / (Math.max(1, iw) * multiple))) * multiple;
|
|
581
587
|
}
|
|
582
588
|
targetW = Math.max(1, targetW);
|
|
583
589
|
targetH = Math.max(1, targetH);
|
|
@@ -608,13 +614,14 @@ async function applyVideoFilterChain(frames, filterChainStr, budget, subtitleCue
|
|
|
608
614
|
if (!Number.isFinite(cw) || !Number.isFinite(ch) || cw <= 0 || ch <= 0 || cw > iw || ch > ih) {
|
|
609
615
|
throw new Error(`Invalid too big or non positive size for width '${cw}' or height '${ch}'`);
|
|
610
616
|
}
|
|
617
|
+
const variables = { iw, ih, ow: cw, oh: ch, in_w: iw, in_h: ih, out_w: cw, out_h: ch };
|
|
611
618
|
const cx = Math.max(
|
|
612
619
|
0,
|
|
613
|
-
Math.min(iw - cw,
|
|
620
|
+
Math.min(iw - cw, Math.trunc(parseFilterExpression(named.x ?? positional[2] ?? String(Math.floor((iw - cw) / 2)), "crop", variables)))
|
|
614
621
|
);
|
|
615
622
|
const cy = Math.max(
|
|
616
623
|
0,
|
|
617
|
-
Math.min(ih - ch,
|
|
624
|
+
Math.min(ih - ch, Math.trunc(parseFilterExpression(named.y ?? positional[3] ?? String(Math.floor((ih - ch) / 2)), "crop", variables)))
|
|
618
625
|
);
|
|
619
626
|
current = await mapWork(current, async (f) => {
|
|
620
627
|
const cropped = extractImage(makeRgbaImg(f.width, f.height, f.data), {
|
|
@@ -640,8 +647,9 @@ async function applyVideoFilterChain(frames, filterChainStr, budget, subtitleCue
|
|
|
640
647
|
if (pw < iw || ph < ih) {
|
|
641
648
|
throw new Error("Padded dimensions cannot be smaller than input dimensions");
|
|
642
649
|
}
|
|
643
|
-
const
|
|
644
|
-
const
|
|
650
|
+
const variables = { iw, ih, ow: pw, oh: ph, in_w: iw, in_h: ih, out_w: pw, out_h: ph };
|
|
651
|
+
const px = Math.max(0, Math.min(pw - iw, Math.trunc(parseFilterExpression(named.x ?? positional[2] ?? "0", "pad", variables))));
|
|
652
|
+
const py = Math.max(0, Math.min(ph - ih, Math.trunc(parseFilterExpression(named.y ?? positional[3] ?? "0", "pad", variables))));
|
|
645
653
|
const col = parseColorRgba(named.color ?? positional[4] ?? "black");
|
|
646
654
|
current = await mapWork(current, async (f) => {
|
|
647
655
|
const padded = extendImage(makeRgbaImg(f.width, f.height, f.data), {
|
|
@@ -683,7 +691,7 @@ async function applyVideoFilterChain(frames, filterChainStr, budget, subtitleCue
|
|
|
683
691
|
};
|
|
684
692
|
}, signal);
|
|
685
693
|
} else if (name === "rotate") {
|
|
686
|
-
const angle =
|
|
694
|
+
const angle = parseFilterExpression(named.angle ?? named.a ?? (positional[0] || "0"), "rotate", { PI: Math.PI });
|
|
687
695
|
const cos = Math.cos(angle);
|
|
688
696
|
const sin = Math.sin(angle);
|
|
689
697
|
current = await mapWork(current, async (f) => {
|
|
@@ -885,8 +893,6 @@ async function applyVideoFilterChain(frames, filterChainStr, budget, subtitleCue
|
|
|
885
893
|
return out;
|
|
886
894
|
}, signal);
|
|
887
895
|
} else if (name === "drawbox") {
|
|
888
|
-
const bx = parseInt(named.x ?? positional[0] ?? "0", 10) || 0;
|
|
889
|
-
const by = parseInt(named.y ?? positional[1] ?? "0", 10) || 0;
|
|
890
896
|
const bw = parseInt(named.w ?? named.width ?? positional[2] ?? "16", 10) || 16;
|
|
891
897
|
const bh = parseInt(named.h ?? named.height ?? positional[3] ?? "16", 10) || 16;
|
|
892
898
|
const col = parseColorRgba(named.color ?? named.c ?? positional[4] ?? "red");
|
|
@@ -895,6 +901,9 @@ async function applyVideoFilterChain(frames, filterChainStr, budget, subtitleCue
|
|
|
895
901
|
const replace = named.replace === "1";
|
|
896
902
|
current = await mapWork(current, async (f) => {
|
|
897
903
|
let work2 = 0;
|
|
904
|
+
const variables = { iw: f.width, ih: f.height, in_w: f.width, in_h: f.height };
|
|
905
|
+
const bx = Math.trunc(parseFilterExpression(named.x ?? positional[0] ?? "0", "drawbox", variables));
|
|
906
|
+
const by = Math.trunc(parseFilterExpression(named.y ?? positional[1] ?? "0", "drawbox", variables));
|
|
898
907
|
const nextData = new Uint8Array(f.data);
|
|
899
908
|
for (let y = Math.max(0, by); y < Math.min(f.height, by + bh); y++) {
|
|
900
909
|
if (++work2 % 1024 === 0) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createFfprobeCommand
|
|
3
|
-
} from "../safe-bash/command-chunks/chunk-
|
|
3
|
+
} from "../safe-bash/command-chunks/chunk-YAXP4EHP.js";
|
|
4
4
|
import "../safe-bash/command-chunks/chunk-MGBHGZEX.js";
|
|
5
|
-
import "../safe-bash/command-chunks/chunk-
|
|
5
|
+
import "../safe-bash/command-chunks/chunk-BZW25LNV.js";
|
|
6
6
|
import "../safe-bash/command-chunks/chunk-65DS4IOB.js";
|
|
7
7
|
|
|
8
8
|
// packages/safe-bash-command-ffprobe/src/index.ts
|
|
@@ -11,9 +11,9 @@ import {
|
|
|
11
11
|
loadManifestResources,
|
|
12
12
|
resolvePath,
|
|
13
13
|
rethrowRuntimeError
|
|
14
|
-
} from "../safe-bash/command-chunks/chunk-
|
|
14
|
+
} from "../safe-bash/command-chunks/chunk-YAXP4EHP.js";
|
|
15
15
|
import "../safe-bash/command-chunks/chunk-MGBHGZEX.js";
|
|
16
|
-
import "../safe-bash/command-chunks/chunk-
|
|
16
|
+
import "../safe-bash/command-chunks/chunk-BZW25LNV.js";
|
|
17
17
|
import "../safe-bash/command-chunks/chunk-65DS4IOB.js";
|
|
18
18
|
export {
|
|
19
19
|
createFfprobeCommand,
|
|
@@ -2196,10 +2196,21 @@ function magickMorphologyPlan(methodRaw, kernelSpec) {
|
|
|
2196
2196
|
rx = Math.max(1, Math.round(Number(sizePart)));
|
|
2197
2197
|
ry = rx;
|
|
2198
2198
|
}
|
|
2199
|
-
const
|
|
2199
|
+
const shape = (colonIdx < 0 ? kernelSpec : kernelSpec.slice(0, colonIdx)).toLowerCase();
|
|
2200
|
+
const disk = shape === "disk";
|
|
2200
2201
|
const radius = Number(sizePart) || 4.5;
|
|
2201
2202
|
if (disk) ry = Math.max(0, Math.floor(radius));
|
|
2202
|
-
|
|
2203
|
+
if (shape === "octagon" || shape === "diamond" || shape === "plus") {
|
|
2204
|
+
rx = ry = Math.max(1, Math.floor(Number(sizePart) || (shape === "diamond" ? 1 : 2)));
|
|
2205
|
+
}
|
|
2206
|
+
const rows = Array.from({ length: ry * 2 + 1 }, (_, row) => {
|
|
2207
|
+
const dy = Math.abs(row - ry);
|
|
2208
|
+
if (disk) return Math.floor(Math.sqrt(radius * radius - dy * dy));
|
|
2209
|
+
if (shape === "diamond") return rx - dy;
|
|
2210
|
+
if (shape === "plus") return dy === 0 ? rx : 0;
|
|
2211
|
+
if (shape === "octagon") return Math.min(rx, rx + Math.floor(rx / 2) - dy);
|
|
2212
|
+
return rx;
|
|
2213
|
+
});
|
|
2203
2214
|
const filter = (source, mode) => ({ source, mode });
|
|
2204
2215
|
const diff = (a, b) => ({ mode: "diff", a, b });
|
|
2205
2216
|
let steps;
|
|
@@ -4836,6 +4847,7 @@ function inferOutputFormat(spec, fallback = "png") {
|
|
|
4836
4847
|
if (prefixMatch) {
|
|
4837
4848
|
const prefix = prefixMatch[1].toLowerCase();
|
|
4838
4849
|
const rest = prefixMatch[2];
|
|
4850
|
+
if (prefix === "rgba") throw new Error("unsupported output coder 'rgba'");
|
|
4839
4851
|
const fmt = extToImageFormat(prefix);
|
|
4840
4852
|
if (fmt) {
|
|
4841
4853
|
return { format: fmt, path: rest };
|
|
@@ -6704,7 +6716,7 @@ async function tryConvertFilesResult(argv, input, stdinBytes, signal, analysis)
|
|
|
6704
6716
|
await probeImageArguments(argv, input, stdinBytes, signal);
|
|
6705
6717
|
return drainSteps(runConvertCliSteps(argv, /* @__PURE__ */ new Map(), stdinBytes, signal), signal);
|
|
6706
6718
|
}
|
|
6707
|
-
|
|
6719
|
+
let output;
|
|
6708
6720
|
await yieldTurn9(signal);
|
|
6709
6721
|
let state = createDefaultState();
|
|
6710
6722
|
const tokens = argv.slice(0, -1), scopes = [];
|
|
@@ -6721,6 +6733,7 @@ async function tryConvertFilesResult(argv, input, stdinBytes, signal, analysis)
|
|
|
6721
6733
|
});
|
|
6722
6734
|
};
|
|
6723
6735
|
try {
|
|
6736
|
+
output = inferOutputFormat(outSpec, "png");
|
|
6724
6737
|
for (let i = 0; i < tokens.length; i++) {
|
|
6725
6738
|
if (i && i % 64 === 0) await yieldTurn9(signal);
|
|
6726
6739
|
const token = tokens[i];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
dp,
|
|
3
|
+
hO,
|
|
4
4
|
uO
|
|
5
|
-
} from "../safe-bash/command-chunks/chunk-
|
|
5
|
+
} from "../safe-bash/command-chunks/chunk-CIV3GER2.js";
|
|
6
6
|
import "../safe-bash/command-chunks/chunk-7QRIAJEQ.js";
|
|
7
7
|
import "../safe-bash/command-chunks/chunk-VJQ5OWS5.js";
|
|
8
8
|
import "../safe-bash/command-chunks/chunk-IOEUZ4EA.js";
|
|
@@ -15,9 +15,9 @@ import "../safe-bash/command-chunks/chunk-5NKZJEUI.js";
|
|
|
15
15
|
import "../safe-bash/command-chunks/chunk-QIFS4QHZ.js";
|
|
16
16
|
import "../safe-bash/command-chunks/chunk-65DS4IOB.js";
|
|
17
17
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
dp as createPandocCommand,
|
|
19
|
+
uO as createPandocCommands,
|
|
20
|
+
hO as pandocCommands
|
|
21
21
|
};
|
|
22
22
|
/*!
|
|
23
23
|
MIT License
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import {
|
|
2
|
-
$
|
|
2
|
+
$l,
|
|
3
3
|
Cr,
|
|
4
|
-
Dl,
|
|
5
4
|
En,
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
FI,
|
|
6
|
+
FN,
|
|
8
7
|
LN,
|
|
9
|
-
|
|
10
|
-
Nh,
|
|
8
|
+
Lh,
|
|
11
9
|
ON,
|
|
12
10
|
Re,
|
|
13
11
|
Rr,
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
_l,
|
|
13
|
+
_u,
|
|
14
|
+
ap,
|
|
16
15
|
as,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
mc,
|
|
16
|
+
dp,
|
|
17
|
+
eu,
|
|
18
|
+
gc,
|
|
19
|
+
hO,
|
|
22
20
|
np,
|
|
23
|
-
|
|
21
|
+
oA,
|
|
22
|
+
sp,
|
|
23
|
+
tE,
|
|
24
24
|
uO,
|
|
25
25
|
un,
|
|
26
26
|
wc
|
|
27
|
-
} from "../safe-bash/command-chunks/chunk-
|
|
27
|
+
} from "../safe-bash/command-chunks/chunk-CIV3GER2.js";
|
|
28
28
|
import "../safe-bash/command-chunks/chunk-7QRIAJEQ.js";
|
|
29
29
|
import "../safe-bash/command-chunks/chunk-VJQ5OWS5.js";
|
|
30
30
|
import "../safe-bash/command-chunks/chunk-IOEUZ4EA.js";
|
|
@@ -53,7 +53,7 @@ function K(u = {}) {
|
|
|
53
53
|
e2.signal.throwIfAborted();
|
|
54
54
|
let a = new TextEncoder(), f, C;
|
|
55
55
|
try {
|
|
56
|
-
let o =
|
|
56
|
+
let o = _l(e2.args, i);
|
|
57
57
|
if (o !== void 0) f = a.encode(o);
|
|
58
58
|
else {
|
|
59
59
|
let s = e2.fs ? { ...e2.cwd === void 0 ? {} : { cwd: e2.cwd }, stdin: e2.stdin, ...e2.createOutput ? { createOutput: e2.createOutput.bind(e2) } : {}, ...e2.fs.readStream ? { readStream: async function* (t2, r, n) {
|
|
@@ -64,7 +64,7 @@ function K(u = {}) {
|
|
|
64
64
|
if (typeof m != "object" || m === null || !("code" in m) || m.code !== "ENOTSUP" && m.code !== "EOPNOTSUPP") throw m;
|
|
65
65
|
}
|
|
66
66
|
yield await s.readFile(t2, r, n);
|
|
67
|
-
} } : {}, readFile: (t2, r, n) => e2.fs.readFile(O(e2.cwd ?? "/", t2), { signal: r, ...n === void 0 || n === 1 / 0 ? {} : { maxBytes: n } }), writeFile: (t2, r, n) => e2.fs.writeFile(O(e2.cwd ?? "/", t2), r, { signal: n }) } : e2, { options: S, operands: R, destination: d, limits: P } = await
|
|
67
|
+
} } : {}, readFile: (t2, r, n) => e2.fs.readFile(O(e2.cwd ?? "/", t2), { signal: r, ...n === void 0 || n === 1 / 0 ? {} : { maxBytes: n } }), writeFile: (t2, r, n) => e2.fs.writeFile(O(e2.cwd ?? "/", t2), r, { signal: n }) } : e2, { options: S, operands: R, destination: d, limits: P } = await sp(e2.args, s, e2.signal, i), A = (R ?? [{ chunks: e2.stdin }]).map((t2) => ({ ...t2, ...t2.base === void 0 && e2.cwd !== void 0 ? { base: e2.cwd } : {} })), F = { ...i, limits: P, signal: e2.signal, ...e2.fs === void 0 ? {} : { resourceFiles: e2.fs, resources: { resolve: async (t2, r, n) => e2.fs.readFile(`${r ?? e2.cwd ?? "/"}/${t2}`, { ...n === void 0 ? {} : { signal: n } }) } }, ...e2.cwd === void 0 ? {} : { resourceCwd: e2.cwd } }, p, v = d !== void 0 && s.createOutput ? { async write(t2, r) {
|
|
68
68
|
p ??= s.createOutput(d, r ?? e2.signal), (r ?? e2.signal).throwIfAborted(), await p.write(t2, r);
|
|
69
69
|
}, async close(t2) {
|
|
70
70
|
p ??= s.createOutput(d, t2 ?? e2.signal), (t2 ?? e2.signal).throwIfAborted(), await p.close(t2);
|
|
@@ -78,7 +78,7 @@ function K(u = {}) {
|
|
|
78
78
|
}
|
|
79
79
|
}, async close() {
|
|
80
80
|
}, async abort() {
|
|
81
|
-
} }, c = d === void 0 || s.createOutput ? await
|
|
81
|
+
} }, c = d === void 0 || s.createOutput ? await np(A, S, { ...F, output: v }) : await wc(A, S, { ...F, output: { publish: async (t2, r) => s.writeFile(d, t2, r) } });
|
|
82
82
|
for (let t2 of c.diagnostics) await e2.stderr.write(a.encode(`${t2.code}: ${t2.location ? `${t2.location}: ` : ""}${t2.message}
|
|
83
83
|
`)), e2.signal.throwIfAborted();
|
|
84
84
|
if (c.kind === "output") return { exitCode: 0 };
|
|
@@ -114,33 +114,33 @@ export {
|
|
|
114
114
|
En as ExecutionContext,
|
|
115
115
|
t as PandocError,
|
|
116
116
|
export_assertNever as assertNever,
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
117
|
+
wc as convert,
|
|
118
|
+
FN as convertSync,
|
|
119
|
+
np as convertToOutput,
|
|
120
|
+
$l as coreFormats,
|
|
121
121
|
jr as createCiteprocFilterCapability,
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
FI as createExecutionContext,
|
|
123
|
+
gc as createFileOutput,
|
|
124
124
|
Z as createFormatInspectionCommand,
|
|
125
125
|
Re as createFormatRegistry,
|
|
126
|
-
|
|
126
|
+
Lh as createJsonFilterCapability,
|
|
127
127
|
_r as createLuaFilterCapability,
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
dp as createPandocCommand,
|
|
129
|
+
uO as createPandocCommands,
|
|
130
130
|
K as createStandalonePandocCommand,
|
|
131
131
|
as as defaultLimits,
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
132
|
+
ap as evalSyncPandoc,
|
|
133
|
+
tE as formatCapabilities,
|
|
134
|
+
_l as inspectCommand,
|
|
135
135
|
Rr as inspectFormats,
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
136
|
+
oA as normalizeDocument,
|
|
137
|
+
_u as normalizeDocumentCooperatively,
|
|
138
|
+
hO as pandocCommands,
|
|
139
139
|
Cr as parseConversionArgs,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
140
|
+
eu as pdfReader,
|
|
141
|
+
ON as readDocument,
|
|
142
|
+
sp as resolveConversionArgs,
|
|
143
|
+
LN as writeDocument
|
|
144
144
|
};
|
|
145
145
|
/*!
|
|
146
146
|
MIT License
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@poe-platform/safe-bash",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.841",
|
|
4
4
|
"description": "Extensible virtual shell with pluggable filesystems and streaming commands",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -1415,7 +1415,7 @@
|
|
|
1415
1415
|
"access": "public"
|
|
1416
1416
|
},
|
|
1417
1417
|
"dependencies": {
|
|
1418
|
-
"@poe-platform/safe-fs": "0.1.
|
|
1418
|
+
"@poe-platform/safe-fs": "0.1.841",
|
|
1419
1419
|
"pdf-lib": "1.17.1",
|
|
1420
1420
|
"@types/node": "^25.2.2",
|
|
1421
1421
|
"@formatjs/intl-numberformat": "9.4.0",
|