@poe-platform/safe-bash 0.1.773 → 0.1.775

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.
Files changed (31) hide show
  1. package/dist/image-ast/index.browser.js +754 -162
  2. package/dist/image-ast/index.js +754 -162
  3. package/dist/pdf-ast/index.js +754 -162
  4. package/dist/pdf-ast/vendor/pdfjs-fonts.d.mts +12 -0
  5. package/dist/pdf-ast/vendor/pdfjs-fonts.mjs +702 -0
  6. package/dist/safe-bash/command-chunks/{chunk-B2MM5DIT.js → chunk-3444RZLY.js} +754 -162
  7. package/dist/safe-bash/command-chunks/{chunk-G3NVK25P.js → chunk-QLYJUVVM.js} +1 -1
  8. package/dist/safe-bash/command-chunks/{chunk-5VXZSNM2.js → chunk-ZY6PMCW5.js} +2 -2
  9. package/dist/safe-bash/core.browser.js +63 -7
  10. package/dist/safe-bash/shell/runtime.js +17 -9
  11. package/dist/safe-bash/shell/sync-posix-regex.d.ts +3 -0
  12. package/dist/safe-bash/shell/sync-posix-regex.js +48 -0
  13. package/dist/safe-bash-command-ffmpeg/index.js +7249 -7039
  14. package/dist/safe-bash-command-gpg/index.js +28 -7
  15. package/dist/safe-bash-command-imagemagick/index.js +2 -2
  16. package/dist/safe-bash-command-openssl/index.js +24 -6
  17. package/dist/safe-bash-command-pandoc/command.js +3 -3
  18. package/dist/safe-bash-command-pandoc/index.js +3 -3
  19. package/dist/safe-bash-command-pdfimages/index.js +754 -162
  20. package/dist/safe-bash-command-pdfinfo/index.js +754 -162
  21. package/dist/safe-bash-command-pdftk/index.js +754 -162
  22. package/dist/safe-bash-command-pdftoppm/index.js +754 -162
  23. package/dist/safe-bash-command-pdftotext/index.js +754 -162
  24. package/dist/safe-bash-command-qpdf/index.js +754 -162
  25. package/dist/safe-bash-command-sips/index.js +2 -2
  26. package/dist/safe-bash-command-soffice/index.js +1 -1
  27. package/dist/safe-bash-command-ssconvert/index.js +754 -162
  28. package/dist/safe-bash-command-ssh/index.js +124 -23
  29. package/dist/safe-bash-command-wkhtmltopdf/index.js +760 -162
  30. package/package.json +2 -2
  31. package/third-party/pdf-ast/THIRD_PARTY_NOTICES.md +29 -0
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  PdfDocument,
3
3
  renderPdfPageToPng
4
- } from "./chunk-B2MM5DIT.js";
4
+ } from "./chunk-3444RZLY.js";
5
5
  import {
6
6
  init_buffer
7
7
  } from "./chunk-HX3SHTCE.js";
@@ -48,11 +48,11 @@ import {
48
48
  trimImage,
49
49
  unflattenImage,
50
50
  unpremultiplyRgbaImage
51
- } from "./chunk-G3NVK25P.js";
51
+ } from "./chunk-QLYJUVVM.js";
52
52
  import {
53
53
  PdfDocument,
54
54
  encodePng
55
- } from "./chunk-B2MM5DIT.js";
55
+ } from "./chunk-3444RZLY.js";
56
56
  import {
57
57
  createLuaFilterCapability
58
58
  } from "./chunk-Y2KHC6TZ.js";
@@ -8240,7 +8240,7 @@ var TR_CHARACTER_CLASSES = (() => {
8240
8240
  })();
8241
8241
  var TR_CONTROLS = { a: 7, b: 8, f: 12, n: 10, r: 13, t: 9, v: 11, "\\": 92 };
8242
8242
  function characterSet(specification, repeatLength, translatingSecond = false) {
8243
- const classes = TR_CHARACTER_CLASSES;
8243
+ const classes2 = TR_CHARACTER_CLASSES;
8244
8244
  const tokens = [];
8245
8245
  const readCharacter = (offset) => {
8246
8246
  if (specification[offset] === "\\") {
@@ -8264,7 +8264,7 @@ function characterSet(specification, repeatLength, translatingSecond = false) {
8264
8264
  const classEnd = specification.startsWith("[:", offset) ? specification.indexOf(":]", offset + 2) : -1;
8265
8265
  if (classEnd !== -1 && specification.indexOf("]", offset + 2) === classEnd + 1) {
8266
8266
  const name2 = specification.slice(offset + 2, classEnd);
8267
- const bytes6 = Object.hasOwn(classes, name2) ? classes[name2] : void 0;
8267
+ const bytes6 = Object.hasOwn(classes2, name2) ? classes2[name2] : void 0;
8268
8268
  if (!bytes6) throw new internal_exports.UsageError(`unknown character class '${name2}'`);
8269
8269
  if (translatingSecond && name2 !== "upper" && name2 !== "lower") {
8270
8270
  throw new diagnostics_exports.PublicDiagnostic("when translating, the only character classes that may appear in string2 are 'upper' and 'lower'");
@@ -49052,6 +49052,55 @@ var ShellInput = class _ShellInput {
49052
49052
  // packages/safe-bash/src/shell/runtime.ts
49053
49053
  init_platform();
49054
49054
 
49055
+ // packages/safe-bash/src/shell/sync-posix-regex.ts
49056
+ init_platform();
49057
+ var classes = {
49058
+ digit: "0-9",
49059
+ alpha: "A-Za-z",
49060
+ alnum: "A-Za-z0-9",
49061
+ upper: "A-Z",
49062
+ lower: "a-z",
49063
+ blank: " \\t",
49064
+ space: " \\t\\r\\n\\v\\f",
49065
+ xdigit: "A-Fa-f0-9",
49066
+ punct: "!-/:-@\\[-`{-~",
49067
+ cntrl: "\\x00-\\x1f\\x7f",
49068
+ graph: "!-~",
49069
+ print: " -~"
49070
+ };
49071
+ function syncPosixRegexSource(source) {
49072
+ let output10 = "";
49073
+ let inBracket = false;
49074
+ let bracketStart = 0;
49075
+ for (let i = 0; i < source.length; i++) {
49076
+ const char = source[i];
49077
+ if (char === "\\") {
49078
+ output10 += source.slice(i, i + 2);
49079
+ i++;
49080
+ continue;
49081
+ }
49082
+ if (inBracket && char === "[" && source[i + 1] === ":") {
49083
+ const end = source.indexOf(":]", i + 2);
49084
+ if (end === -1) return void 0;
49085
+ const name2 = source.slice(i + 2, end);
49086
+ if (!Object.hasOwn(classes, name2)) return void 0;
49087
+ output10 += classes[name2];
49088
+ i = end + 1;
49089
+ continue;
49090
+ }
49091
+ if (char === "[" && !inBracket) {
49092
+ inBracket = true;
49093
+ bracketStart = i + 1 + (source[i + 1] === "^" ? 1 : 0);
49094
+ if (source[bracketStart] === "]") return void 0;
49095
+ } else if (char === "]" && inBracket) {
49096
+ inBracket = false;
49097
+ }
49098
+ if (inBracket && char === "[" && (source[i + 1] === "." || source[i + 1] === "=")) return void 0;
49099
+ output10 += char;
49100
+ }
49101
+ return output10;
49102
+ }
49103
+
49055
49104
  // packages/safe-bash/src/shell/sync-jq-expression.ts
49056
49105
  init_platform();
49057
49106
  function compareSyncJqStrings(left, right) {
@@ -83839,7 +83888,8 @@ ${prefix2} line ${offset + line}: \`${source.split("\n")[line - 1] ?? ""}'
83839
83888
  if (subExprs.length === 0) return void 0;
83840
83889
  const compileSedAddrRe = (patSpec) => {
83841
83890
  if (patSpec.length === 0 || patSpec.includes("[.") || patSpec.includes("[=") || /\\[1-9]/.test(patSpec)) return void 0;
83842
- const normPat = patSpec.replace(/\[:space:\]/g, " ").replace(/\[:digit:\]/g, "0-9").replace(/\[:alpha:\]/g, "a-zA-Z").replace(/\[:alnum:\]/g, "a-zA-Z0-9");
83891
+ const normPat = syncPosixRegexSource(patSpec);
83892
+ if (normPat === void 0) return void 0;
83843
83893
  const jsPat = isExtended ? normPat : normPat.replace(/\\([+?()|])/g, "$1");
83844
83894
  try {
83845
83895
  return new RegExp(jsPat);
@@ -84868,8 +84918,10 @@ ${prefix2} line ${offset + line}: \`${source.split("\n")[line - 1] ?? ""}'
84868
84918
  if (patM) {
84869
84919
  const inv = patM[1] === "!";
84870
84920
  let re;
84921
+ const source = syncPosixRegexSource(patM[2]);
84922
+ if (source === void 0) return void 0;
84871
84923
  try {
84872
- re = new RegExp(patM[2]);
84924
+ re = new RegExp(source);
84873
84925
  } catch {
84874
84926
  return void 0;
84875
84927
  }
@@ -84880,8 +84932,10 @@ ${prefix2} line ${offset + line}: \`${source.split("\n")[line - 1] ?? ""}'
84880
84932
  const fTok = fPatM[1];
84881
84933
  const inv = fPatM[2] === "!~";
84882
84934
  let re;
84935
+ const source = syncPosixRegexSource(fPatM[3]);
84936
+ if (source === void 0) return void 0;
84883
84937
  try {
84884
- re = new RegExp(fPatM[3]);
84938
+ re = new RegExp(source);
84885
84939
  } catch {
84886
84940
  return void 0;
84887
84941
  }
@@ -85486,8 +85540,10 @@ ${prefix2} line ${offset + line}: \`${source.split("\n")[line - 1] ?? ""}'
85486
85540
  const parseSecSpec = (v) => {
85487
85541
  if (v === "a" || v === "t" || v === "n") return { style: v };
85488
85542
  if (v.startsWith("p") && v.length > 1) {
85543
+ const source = syncPosixRegexSource(v.slice(1));
85544
+ if (source === void 0) return void 0;
85489
85545
  try {
85490
- return { style: "p", re: new RegExp(v.slice(1)) };
85546
+ return { style: "p", re: new RegExp(source) };
85491
85547
  } catch {
85492
85548
  return void 0;
85493
85549
  }
@@ -86108,7 +86164,7 @@ ${prefix2} line ${offset + line}: \`${source.split("\n")[line - 1] ?? ""}'
86108
86164
  }
86109
86165
  }
86110
86166
  pushRun();
86111
- if (sep !== void 0) return runs.length === 0 ? [] : [runs.join(sep)];
86167
+ if (sep !== void 0) return runs.length === 0 ? [] : [runs.join(sep) + sep];
86112
86168
  return runs;
86113
86169
  }
86114
86170
  evalSyncColumn(rawLines, opArgs) {
@@ -1,3 +1,4 @@
1
+ import { syncPosixRegexSource } from "./sync-posix-regex.js";
1
2
  import { syncCommandEvaluators } from "../commands/internal.js";
2
3
  import { compareSyncJqStrings, splitSyncJqExpression } from "./sync-jq-expression.js";
3
4
  import { wcDisplayWidth } from "../commands/wc-width.js";
@@ -29671,11 +29672,9 @@ export class Runtime {
29671
29672
  const compileSedAddrRe = (patSpec) => {
29672
29673
  if (patSpec.length === 0 || patSpec.includes("[.") || patSpec.includes("[=") || /\\[1-9]/.test(patSpec))
29673
29674
  return undefined;
29674
- const normPat = patSpec
29675
- .replace(/\[:space:\]/g, " \t")
29676
- .replace(/\[:digit:\]/g, "0-9")
29677
- .replace(/\[:alpha:\]/g, "a-zA-Z")
29678
- .replace(/\[:alnum:\]/g, "a-zA-Z0-9");
29675
+ const normPat = syncPosixRegexSource(patSpec);
29676
+ if (normPat === undefined)
29677
+ return undefined;
29679
29678
  const jsPat = isExtended
29680
29679
  ? normPat
29681
29680
  : normPat.replace(/\\([+?()|])/g, "$1");
@@ -30963,8 +30962,11 @@ export class Runtime {
30963
30962
  if (patM) {
30964
30963
  const inv = patM[1] === "!";
30965
30964
  let re;
30965
+ const source = syncPosixRegexSource(patM[2]);
30966
+ if (source === undefined)
30967
+ return undefined;
30966
30968
  try {
30967
- re = new RegExp(patM[2]);
30969
+ re = new RegExp(source);
30968
30970
  }
30969
30971
  catch {
30970
30972
  return undefined;
@@ -30976,8 +30978,11 @@ export class Runtime {
30976
30978
  const fTok = fPatM[1];
30977
30979
  const inv = fPatM[2] === "!~";
30978
30980
  let re;
30981
+ const source = syncPosixRegexSource(fPatM[3]);
30982
+ if (source === undefined)
30983
+ return undefined;
30979
30984
  try {
30980
- re = new RegExp(fPatM[3]);
30985
+ re = new RegExp(source);
30981
30986
  }
30982
30987
  catch {
30983
30988
  return undefined;
@@ -31706,8 +31711,11 @@ export class Runtime {
31706
31711
  if (v === "a" || v === "t" || v === "n")
31707
31712
  return { style: v };
31708
31713
  if (v.startsWith("p") && v.length > 1) {
31714
+ const source = syncPosixRegexSource(v.slice(1));
31715
+ if (source === undefined)
31716
+ return undefined;
31709
31717
  try {
31710
- return { style: "p", re: new RegExp(v.slice(1)) };
31718
+ return { style: "p", re: new RegExp(source) };
31711
31719
  }
31712
31720
  catch {
31713
31721
  return undefined;
@@ -32486,7 +32494,7 @@ export class Runtime {
32486
32494
  }
32487
32495
  pushRun();
32488
32496
  if (sep !== undefined)
32489
- return runs.length === 0 ? [] : [runs.join(sep)];
32497
+ return runs.length === 0 ? [] : [runs.join(sep) + sep];
32490
32498
  return runs;
32491
32499
  }
32492
32500
  evalSyncColumn(rawLines, opArgs) {
@@ -0,0 +1,3 @@
1
+ /** Translate class tokens only inside bracket expressions; defer unsupported syntax. */
2
+ export declare function syncPosixRegexSource(source: string): string | undefined;
3
+ //# sourceMappingURL=sync-posix-regex.d.ts.map
@@ -0,0 +1,48 @@
1
+ // Character-class fragments for the sync evaluators' ASCII regex profile.
2
+ const classes = {
3
+ digit: "0-9", alpha: "A-Za-z", alnum: "A-Za-z0-9",
4
+ upper: "A-Z", lower: "a-z", blank: " \\t",
5
+ space: " \\t\\r\\n\\v\\f", xdigit: "A-Fa-f0-9",
6
+ punct: "!-/:-@\\[-`{-~", cntrl: "\\x00-\\x1f\\x7f",
7
+ graph: "!-~", print: " -~",
8
+ };
9
+ /** Translate class tokens only inside bracket expressions; defer unsupported syntax. */
10
+ export function syncPosixRegexSource(source) {
11
+ let output = "";
12
+ let inBracket = false;
13
+ let bracketStart = 0;
14
+ for (let i = 0; i < source.length; i++) {
15
+ const char = source[i];
16
+ if (char === "\\") {
17
+ output += source.slice(i, i + 2);
18
+ i++;
19
+ continue;
20
+ }
21
+ if (inBracket && char === "[" && source[i + 1] === ":") {
22
+ const end = source.indexOf(":]", i + 2);
23
+ if (end === -1)
24
+ return undefined;
25
+ const name = source.slice(i + 2, end);
26
+ if (!Object.hasOwn(classes, name))
27
+ return undefined;
28
+ output += classes[name];
29
+ i = end + 1;
30
+ continue;
31
+ }
32
+ if (char === "[" && !inBracket) {
33
+ inBracket = true;
34
+ bracketStart = i + 1 + (source[i + 1] === "^" ? 1 : 0);
35
+ // A leading literal ] requires POSIX bracket parsing rather than JS RegExp.
36
+ if (source[bracketStart] === "]")
37
+ return undefined;
38
+ }
39
+ else if (char === "]" && inBracket) {
40
+ inBracket = false;
41
+ }
42
+ if (inBracket && char === "[" && (source[i + 1] === "." || source[i + 1] === "="))
43
+ return undefined;
44
+ output += char;
45
+ }
46
+ return output;
47
+ }
48
+ //# sourceMappingURL=sync-posix-regex.js.map