@poe-platform/safe-bash 0.1.757 → 0.1.759

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 (59) hide show
  1. package/dist/image-ast/index.browser.js +87 -24
  2. package/dist/image-ast/index.js +87 -24
  3. package/dist/pdf-ast/ast.d.ts +3 -0
  4. package/dist/pdf-ast/index.js +103 -41
  5. package/dist/safe-bash/chunks/{chunk-WNWIBBJZ.js → chunk-AYPUGSOV.js} +7 -1
  6. package/dist/safe-bash/command-chunks/{chunk-F3J5ZLKF.js → chunk-522TDVLS.js} +1 -1
  7. package/dist/safe-bash/command-chunks/{chunk-VFS2MDAB.js → chunk-6YLD37NH.js} +2 -2
  8. package/dist/safe-bash/command-chunks/{chunk-YI3GKJ7Q.js → chunk-766IWMTB.js} +2 -2
  9. package/dist/safe-bash/command-chunks/{chunk-WI35236J.js → chunk-7JA44PVV.js} +1 -1
  10. package/dist/safe-bash/command-chunks/{chunk-H2FQA4OU.js → chunk-BAUGDXLZ.js} +87 -25
  11. package/dist/safe-bash/command-chunks/{chunk-KSH2F6RG.js → chunk-CUFCNL6G.js} +1 -1
  12. package/dist/safe-bash/command-chunks/{chunk-KBBI4CSU.js → chunk-HVEAK3OS.js} +2 -2
  13. package/dist/safe-bash/command-chunks/{chunk-S4MLIYSN.js → chunk-J2NPH7DO.js} +4 -0
  14. package/dist/safe-bash/command-chunks/{chunk-4F6PG2OT.js → chunk-YJWWRCIG.js} +8 -8
  15. package/dist/safe-bash/commands/python/index.browser.js +1 -1
  16. package/dist/safe-bash/commands/python/shell-capability.js +10 -2
  17. package/dist/safe-bash/core.browser.js +1 -1
  18. package/dist/safe-bash-command-column/column.js +3 -3
  19. package/dist/safe-bash-command-column/index.js +3 -3
  20. package/dist/safe-bash-command-column/layout.js +2 -2
  21. package/dist/safe-bash-command-factor/command.js +2 -2
  22. package/dist/safe-bash-command-factor/index.js +2 -2
  23. package/dist/safe-bash-command-ffmpeg/index.js +6300 -6265
  24. package/dist/safe-bash-command-imagemagick/index.js +2 -2
  25. package/dist/safe-bash-command-pandoc/command.js +3 -3
  26. package/dist/safe-bash-command-pandoc/index.js +3 -3
  27. package/dist/safe-bash-command-pdfimages/index.js +87 -24
  28. package/dist/safe-bash-command-pdfinfo/index.js +103 -41
  29. package/dist/safe-bash-command-pdftk/index.js +87 -24
  30. package/dist/safe-bash-command-pdftoppm/index.js +103 -41
  31. package/dist/safe-bash-command-pdftotext/index.js +87 -24
  32. package/dist/safe-bash-command-qpdf/index.js +87 -24
  33. package/dist/safe-bash-command-sips/index.js +2 -2
  34. package/dist/safe-bash-command-soffice/index.js +2 -2
  35. package/dist/safe-bash-command-ssconvert/command-bindings.d.ts +18 -0
  36. package/dist/safe-bash-command-ssconvert/command.d.ts +5 -14
  37. package/dist/safe-bash-command-ssconvert/commands.d.ts +6 -0
  38. package/dist/safe-bash-command-ssconvert/commands.js +871 -0
  39. package/dist/safe-bash-command-ssconvert/core.js +1 -1
  40. package/dist/safe-bash-command-ssconvert/index.js +306 -236
  41. package/dist/safe-bash-command-wkhtmltopdf/index.js +88 -24
  42. package/dist/safe-bash-command-yq/index.js +4 -4
  43. package/dist/safe-bash-compression-engine/files.js +2 -2
  44. package/dist/safe-bash-compression-engine/operand.js +4 -4
  45. package/dist/safe-bash-markdown-engine/commonmark-blocks.js +4 -4
  46. package/dist/safe-bash-markdown-engine/commonmark-inlines.js +4 -4
  47. package/dist/safe-bash-markdown-engine/commonmark-syntax.js +2 -2
  48. package/dist/safe-bash-markdown-engine/gfm-syntax.js +3 -3
  49. package/dist/safe-bash-markdown-engine/index.js +7 -7
  50. package/dist/safe-bash-query-engine/index.js +5 -5
  51. package/dist/safe-bash-query-engine/interpreter.js +4 -4
  52. package/dist/safe-bash-query-engine/query-core.js +5 -5
  53. package/package.json +6 -2
  54. package/third-party/pdf-ast/THIRD_PARTY_NOTICES.md +30 -0
  55. package/dist/safe-bash/command-chunks/{chunk-OQVIJMBY.js → chunk-7HINP7ZK.js} +4 -4
  56. package/dist/safe-bash/command-chunks/{chunk-XAYEDOV5.js → chunk-CG4JSOK2.js} +3 -3
  57. package/dist/safe-bash/command-chunks/{chunk-YIK4ZYQ4.js → chunk-DC52GWRK.js} +9 -9
  58. package/dist/safe-bash/command-chunks/{chunk-TOTZFBDT.js → chunk-TKACIO4X.js} +4 -4
  59. package/dist/safe-bash/command-chunks/{chunk-VTWKS4RM.js → chunk-WF2LSKMI.js} +3 -3
@@ -2604,22 +2604,31 @@ function decodeFlate(bytes, parms, maxDecodedBytes = DEFAULT_MAX_DECODED_BYTES)
2604
2604
  inflated = new BoundedFlateStream(bytes, maxDecodedBytes).getBytes();
2605
2605
  } catch (error) {
2606
2606
  if (error instanceof PdfError && error.code === "E_LIMIT") throw error;
2607
+ const wrapped = bytes[0] === 31 && bytes[1] === 139 || bytes.length >= 2 && (bytes[0] & 15) === 8 && bytes[0] >>> 4 <= 7 && (bytes[0] << 8 | bytes[1]) % 31 === 0;
2607
2608
  const decoder2 = new Inflate({
2608
- raw: !(bytes[0] === 31 && bytes[1] === 139),
2609
+ raw: !wrapped,
2609
2610
  chunkSize: Math.max(1, Math.min(64 * 1024, maxDecodedBytes + 1))
2610
2611
  });
2612
+ const chunks = [];
2611
2613
  let length2 = 0;
2612
2614
  decoder2.onData = (chunk) => {
2613
2615
  length2 += chunk.length;
2614
2616
  if (length2 > maxDecodedBytes) {
2615
2617
  throw new PdfError("E_LIMIT", "FlateDecode output exceeds maximum decoded byte budget");
2616
2618
  }
2617
- decoder2.chunks.push(chunk);
2619
+ chunks.push(chunk);
2618
2620
  };
2619
- if (!decoder2.push(bytes, true) || decoder2.err || !decoder2.ended) {
2621
+ const complete = decoder2.push(bytes, true);
2622
+ const truncated = wrapped && decoder2.err === Z_BUF_ERROR && length2 > 0;
2623
+ if ((!complete || decoder2.err || !decoder2.ended) && !truncated) {
2620
2624
  throw new PdfError("E_CAPABILITY", "Invalid FlateDecode compressed stream");
2621
2625
  }
2622
- inflated = decoder2.result;
2626
+ inflated = new Uint8Array(length2);
2627
+ let offset = 0;
2628
+ for (const chunk of chunks) {
2629
+ inflated.set(chunk, offset);
2630
+ offset += chunk.length;
2631
+ }
2623
2632
  }
2624
2633
  return applyPredictor(inflated, parms);
2625
2634
  }
@@ -4540,7 +4549,7 @@ function decryptCosDocument(doc, state) {
4540
4549
  doc.objects.set(num, { objectNumber: obj.objectNumber, generationNumber: obj.generationNumber, value: decrypted, span: obj.span });
4541
4550
  }
4542
4551
  }
4543
- function parseNodeFromLexer(lexer, bytes, maxDepth, recoverEmptyObject = false) {
4552
+ function parseNodeFromLexer(lexer, bytes, maxDepth, repair = false) {
4544
4553
  const stack = [];
4545
4554
  while (true) {
4546
4555
  const tok = lexer.nextToken();
@@ -4549,7 +4558,7 @@ function parseNodeFromLexer(lexer, bytes, maxDepth, recoverEmptyObject = false)
4549
4558
  if (!parent) return void 0;
4550
4559
  throw new PdfError("E_PARSE", parent.kind === "array" ? "Unterminated PDF array" : "Unterminated PDF dictionary");
4551
4560
  }
4552
- if (!parent && recoverEmptyObject && tok.kind === "keyword" && tok.value === "endobj") {
4561
+ if (!parent && repair && tok.kind === "keyword" && tok.value === "endobj") {
4553
4562
  return { kind: "null", span: tok.span };
4554
4563
  }
4555
4564
  let node;
@@ -4564,6 +4573,7 @@ function parseNodeFromLexer(lexer, bytes, maxDepth, recoverEmptyObject = false)
4564
4573
  parent.key = { kind: "name", rawBytes: tok.rawBytes, decoded: tok.decoded, span: tok.span };
4565
4574
  continue;
4566
4575
  } else {
4576
+ if (repair) continue;
4567
4577
  throw new PdfError("E_PARSE", `Expected dictionary key /Name, got ${tok.kind}`);
4568
4578
  }
4569
4579
  } else {
@@ -4730,7 +4740,7 @@ function parseHeaderVersion(bytes) {
4730
4740
  }
4731
4741
  return head.slice(idx + 5, idx + 8);
4732
4742
  }
4733
- function parseObjectAtOffset(bytes, offset, maxRecursionDepth, recoverEmptyObject = false) {
4743
+ function parseObjectAtOffset(bytes, offset, maxRecursionDepth, repair = false) {
4734
4744
  const lexer = new CosByteLexer(bytes, offset);
4735
4745
  const objNumTok = lexer.nextToken();
4736
4746
  const genNumTok = lexer.nextToken();
@@ -4738,7 +4748,7 @@ function parseObjectAtOffset(bytes, offset, maxRecursionDepth, recoverEmptyObjec
4738
4748
  if (objNumTok?.kind !== "number" || genNumTok?.kind !== "number" || objKwTok?.kind !== "keyword" || objKwTok.value !== "obj") {
4739
4749
  throw new PdfError("E_PARSE", `Malformed indirect object header at byte offset ${offset}`);
4740
4750
  }
4741
- const value = parseNodeFromLexer(lexer, bytes, maxRecursionDepth, recoverEmptyObject);
4751
+ const value = parseNodeFromLexer(lexer, bytes, maxRecursionDepth, repair);
4742
4752
  if (!value) {
4743
4753
  throw new PdfError("E_PARSE", `Empty indirect object ${objNumTok.value} at offset ${offset}`);
4744
4754
  }
@@ -4927,7 +4937,7 @@ function repairScanCosDocument(bytes, maxObjects, maxRecursionDepth) {
4927
4937
  try {
4928
4938
  const token = lexer.nextToken();
4929
4939
  if (token?.kind === "keyword" && token.value === "trailer") {
4930
- const trailer = parseNodeFromLexer(lexer, bytes, maxRecursionDepth);
4940
+ const trailer = parseNodeFromLexer(lexer, bytes, maxRecursionDepth, true);
4931
4941
  if (trailer?.kind === "dict") trailers.push(trailer);
4932
4942
  pos = lexer.offset;
4933
4943
  continue;
@@ -4983,7 +4993,7 @@ function unpackRecoveredObjects(objects, maxObjects, maxDecompressedBytes, maxRe
4983
4993
  const t = dictGet(obj.value.dict, "Type");
4984
4994
  if (t?.kind === "name" && t.decoded === "ObjStm") {
4985
4995
  try {
4986
- for (const [unpackedNum, unpackedVal] of unpackObjectStream(obj.value, maxDecompressedBytes, maxRecursionDepth).entries()) {
4996
+ for (const [unpackedNum, unpackedVal] of unpackObjectStream(obj.value, maxDecompressedBytes, maxRecursionDepth, true).entries()) {
4987
4997
  if (!objects.has(unpackedNum)) {
4988
4998
  objects.set(unpackedNum, {
4989
4999
  objectNumber: unpackedNum,
@@ -5019,7 +5029,7 @@ function recoveredReferences(objects) {
5019
5029
  }
5020
5030
  return { ...rootRef ? { rootRef } : {}, ...infoRef ? { infoRef } : {} };
5021
5031
  }
5022
- function unpackObjectStream(streamObj, maxDecompressedBytes, maxRecursionDepth) {
5032
+ function unpackObjectStream(streamObj, maxDecompressedBytes, maxRecursionDepth, repair = false) {
5023
5033
  const nNode = dictGet(streamObj.dict, "N");
5024
5034
  const firstNode = dictGet(streamObj.dict, "First");
5025
5035
  if (nNode?.kind !== "number" || firstNode?.kind !== "number") {
@@ -5039,7 +5049,7 @@ function unpackObjectStream(streamObj, maxDecompressedBytes, maxRecursionDepth)
5039
5049
  for (const pair of pairs) {
5040
5050
  try {
5041
5051
  const valLexer = new CosByteLexer(decoded, firstNode.value + pair.relativeOffset);
5042
- const node = parseNodeFromLexer(valLexer, decoded, maxRecursionDepth);
5052
+ const node = parseNodeFromLexer(valLexer, decoded, maxRecursionDepth, repair);
5043
5053
  if (node) {
5044
5054
  result.set(pair.objectNumber, node);
5045
5055
  }
@@ -5222,7 +5232,7 @@ function parseCosDocument(bytes, options = {}) {
5222
5232
  if (!unpacked) {
5223
5233
  const stmObj = objects.get(entry.objectStreamNumber)?.value;
5224
5234
  if (stmObj?.kind === "stream") {
5225
- unpacked = unpackObjectStream(stmObj, maxDecompressedBytes, maxRecursionDepth);
5235
+ unpacked = unpackObjectStream(stmObj, maxDecompressedBytes, maxRecursionDepth, recovery === "repair");
5226
5236
  objStmCache.set(entry.objectStreamNumber, unpacked);
5227
5237
  }
5228
5238
  }
@@ -10469,7 +10479,11 @@ function resolvePageFonts(doc, resourcesDict) {
10469
10479
  let cmap;
10470
10480
  const toUniNode = doc.resolve(dictGet(fObj, "ToUnicode"));
10471
10481
  if (toUniNode?.kind === "stream") {
10472
- cmap = parseToUnicodeCMap(doc.decodeStream(toUniNode));
10482
+ try {
10483
+ cmap = parseToUnicodeCMap(doc.decodeStream(toUniNode));
10484
+ } catch (error) {
10485
+ if (error instanceof PdfError && error.code === "E_LIMIT") throw error;
10486
+ }
10473
10487
  }
10474
10488
  const encNode = doc.resolve(dictGet(fObj, "Encoding"));
10475
10489
  if (encNode?.kind === "dict") {
@@ -10485,7 +10499,7 @@ function resolvePageFonts(doc, resourcesDict) {
10485
10499
  const glyphNames = buildFontEncodingGlyphNamesMap(encNode);
10486
10500
  const widths = /* @__PURE__ */ new Map();
10487
10501
  let defaultWidth = 556;
10488
- const isTwoByteCid = subtype === "Type0" || Boolean(cmap?.isTwoByte);
10502
+ const isTwoByteCid = subtype === "Type0";
10489
10503
  let fontMatrix;
10490
10504
  let charProcs;
10491
10505
  let fontResources;
@@ -11593,8 +11607,12 @@ function evaluateContentStreamToDisplayList(params) {
11593
11607
  const images = [];
11594
11608
  const operations = [];
11595
11609
  const emit = (operation) => {
11596
- const clipPaths = curState().clipPaths;
11597
- if (clipPaths) operation = { ...operation, value: { ...operation.value, clipPaths } };
11610
+ const { clipPaths, clipImages } = curState();
11611
+ if (clipPaths || clipImages) operation = { ...operation, value: {
11612
+ ...operation.value,
11613
+ ...clipPaths ? { clipPaths } : {},
11614
+ ...clipImages ? { clipImages } : {}
11615
+ } };
11598
11616
  operations.push(operation);
11599
11617
  switch (operation.kind) {
11600
11618
  case "path":
@@ -11858,6 +11876,18 @@ function evaluateContentStreamToDisplayList(params) {
11858
11876
  let hasTextClip = false;
11859
11877
  let activeTm = [1, 0, 0, 1, 0, 0];
11860
11878
  let activeTlm = [1, 0, 0, 1, 0, 0];
11879
+ const paintImage = (image, patternMask, resources, activeFonts, depth) => {
11880
+ if (!patternMask) {
11881
+ emit({ kind: "image", value: image });
11882
+ return;
11883
+ }
11884
+ const st = curState();
11885
+ stateStack.push({ ...st, clipImages: [...st.clipImages ?? [], image] });
11886
+ walkNodes([{ kind: "path-op", paint: "f", segments: [
11887
+ { kind: "rect", x: 0, y: 0, width: 1, height: 1 }
11888
+ ] }], void 0, void 0, resources, activeFonts, depth);
11889
+ stateStack.pop();
11890
+ };
11861
11891
  const walkNodes = (nodes, mcid, actualText, activeResources = params.resourcesDict, activeFonts = fonts, depth = 0) => {
11862
11892
  for (const node of nodes) {
11863
11893
  switch (node.kind) {
@@ -12041,7 +12071,8 @@ function evaluateContentStreamToDisplayList(params) {
12041
12071
  st.fillAlpha,
12042
12072
  "PatternShading_" + st.fillPatternName,
12043
12073
  patClip,
12044
- shading?.kind === "stream" ? shading : void 0
12074
+ shading?.kind === "stream" ? shading : void 0,
12075
+ st.blendMode
12045
12076
  );
12046
12077
  if (shImg) {
12047
12078
  emit({ kind: "image", value: shImg });
@@ -12150,18 +12181,20 @@ function evaluateContentStreamToDisplayList(params) {
12150
12181
  const subNode = params.cosDoc.resolve(dictGet(xobjNode.dict, "Subtype"));
12151
12182
  const sub = subNode?.kind === "name" ? subNode.decoded : "";
12152
12183
  if (sub === "Image") {
12184
+ const maskNode = params.cosDoc.resolve(dictGet(xobjNode.dict, "ImageMask"));
12185
+ const patternMask = !!st.fillPatternName && maskNode?.kind === "boolean" && maskNode.value;
12153
12186
  const decoded = decodeXObjectImageToRgba(
12154
12187
  params.cosDoc,
12155
12188
  xobjNode,
12156
12189
  activeResources,
12157
- {
12190
+ patternMask ? { r: 1, g: 1, b: 1, alpha: 1 } : {
12158
12191
  r: st.fillColor.r,
12159
12192
  g: st.fillColor.g,
12160
12193
  b: st.fillColor.b,
12161
12194
  alpha: st.fillAlpha
12162
12195
  }
12163
12196
  );
12164
- emit({ kind: "image", value: {
12197
+ paintImage({
12165
12198
  name: node.name,
12166
12199
  matrix: [...st.ctm],
12167
12200
  width: decoded.width,
@@ -12171,7 +12204,7 @@ function evaluateContentStreamToDisplayList(params) {
12171
12204
  decodedRgba: decoded.rgba,
12172
12205
  ...st.blendMode && st.blendMode !== "Normal" ? { blendMode: st.blendMode } : {},
12173
12206
  ...st.clipRect ? { clipRect: [...st.clipRect] } : {}
12174
- } });
12207
+ }, patternMask, activeResources, activeFonts, depth);
12175
12208
  } else if (sub === "Form" && depth < 8) {
12176
12209
  const formStreamBytes = params.cosDoc.decodeStream(xobjNode);
12177
12210
  const formNodes = parseContentStream(formStreamBytes);
@@ -12227,19 +12260,22 @@ function evaluateContentStreamToDisplayList(params) {
12227
12260
  }
12228
12261
  case "inline-image": {
12229
12262
  const st = curState();
12263
+ const maskEntry = dictGet(node.dict, "ImageMask") ?? dictGet(node.dict, "IM");
12264
+ const maskNode = params.cosDoc ? params.cosDoc.resolve(maskEntry) : maskEntry;
12265
+ const patternMask = !!st.fillPatternName && maskNode?.kind === "boolean" && maskNode.value;
12230
12266
  const decoded = decodeInlineImageNodeToRgba(
12231
12267
  params.cosDoc,
12232
12268
  node.dict,
12233
12269
  node.data,
12234
12270
  activeResources,
12235
- {
12271
+ patternMask ? { r: 1, g: 1, b: 1, alpha: 1 } : {
12236
12272
  r: st.fillColor.r,
12237
12273
  g: st.fillColor.g,
12238
12274
  b: st.fillColor.b,
12239
12275
  alpha: st.fillAlpha
12240
12276
  }
12241
12277
  );
12242
- emit({ kind: "image", value: {
12278
+ paintImage({
12243
12279
  name: "InlineImage",
12244
12280
  matrix: [...st.ctm],
12245
12281
  width: decoded.width,
@@ -12249,7 +12285,7 @@ function evaluateContentStreamToDisplayList(params) {
12249
12285
  decodedRgba: decoded.rgba,
12250
12286
  ...st.blendMode && st.blendMode !== "Normal" ? { blendMode: st.blendMode } : {},
12251
12287
  ...st.clipRect ? { clipRect: [...st.clipRect] } : {}
12252
- } });
12288
+ }, patternMask, activeResources, activeFonts, depth);
12253
12289
  break;
12254
12290
  }
12255
12291
  case "text-object": {
@@ -14502,6 +14538,7 @@ function renderDisplayListToBitmap(displayList, options = {}) {
14502
14538
  const aaVec = options.antialiasVector !== false;
14503
14539
  const aaTxt = options.antialiasText !== false;
14504
14540
  const clipMasks = /* @__PURE__ */ new Map();
14541
+ const imageClipMasks = /* @__PURE__ */ new Map();
14505
14542
  for (const original of paintOperations(displayList)) {
14506
14543
  if (original.kind === "glyph" && (original.value.renderMode === 3 || !original.value.outline && !original.value.unicode.trim())) continue;
14507
14544
  const operation = original.kind === "glyph" ? { kind: "path", value: glyphPaint(original.value) } : original;
@@ -14516,6 +14553,31 @@ function renderDisplayListToBitmap(displayList, options = {}) {
14516
14553
  }
14517
14554
  clipMasks.set(clips, clipMask);
14518
14555
  }
14556
+ const imageClips = original.value.clipImages;
14557
+ if (imageClips) {
14558
+ let imageMask = imageClipMasks.get(imageClips);
14559
+ if (!imageMask) {
14560
+ imageMask = new Uint8Array(width * height * 4).fill(255);
14561
+ for (const image of imageClips) {
14562
+ const layer = renderDisplayListToBitmap({
14563
+ ...displayList,
14564
+ rotation: 0,
14565
+ paths: [],
14566
+ glyphs: [],
14567
+ images: [image],
14568
+ operations: [{ kind: "image", value: image }]
14569
+ }, { scale, transparent: true }).data;
14570
+ for (let i = 3; i < layer.length; i += 4) imageMask[i] = Math.round(imageMask[i] * layer[i] / 255);
14571
+ }
14572
+ imageClipMasks.set(imageClips, imageMask);
14573
+ }
14574
+ if (clipMask) {
14575
+ clipMask = clipMask.slice();
14576
+ for (let i = 3; i < clipMask.length; i += 4) clipMask[i] = Math.round(clipMask[i] * imageMask[i] / 255);
14577
+ } else {
14578
+ clipMask = imageMask;
14579
+ }
14580
+ }
14519
14581
  if (operation.kind === "path") {
14520
14582
  const path = operation.value;
14521
14583
  if (path.fillColor) {
@@ -14874,6 +14936,7 @@ var makeTable;
14874
14936
  var crcTable;
14875
14937
  var crc32;
14876
14938
  var messages_default;
14939
+ var Z_BUF_ERROR;
14877
14940
  var MAX_MEM_LEVEL;
14878
14941
  var HEAP_SIZE;
14879
14942
  var MIN_MATCH;
@@ -15876,6 +15939,7 @@ var init_dist = __esm({
15876
15939
  "-5": "buffer error",
15877
15940
  "-6": "incompatible version"
15878
15941
  };
15942
+ Z_BUF_ERROR = -5;
15879
15943
  MAX_MEM_LEVEL = 9;
15880
15944
  HEAP_SIZE = 573;
15881
15945
  MIN_MATCH = 3;
@@ -9,15 +9,15 @@ import {
9
9
  resolveYqLimits,
10
10
  yqCaps
11
11
  } from "../safe-bash/command-chunks/chunk-LOAD233I.js";
12
+ import {
13
+ YqError,
14
+ fromJqLimit
15
+ } from "../safe-bash/command-chunks/chunk-HACCCNFF.js";
12
16
  import {
13
17
  encodeJson,
14
18
  encodeRaw,
15
19
  encodeYaml
16
20
  } from "../safe-bash/command-chunks/chunk-7DEZJSBF.js";
17
- import {
18
- YqError,
19
- fromJqLimit
20
- } from "../safe-bash/command-chunks/chunk-HACCCNFF.js";
21
21
  import {
22
22
  init_buffer
23
23
  } from "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
@@ -4,7 +4,8 @@ import {
4
4
  unchangedSource,
5
5
  verifyOperandDestinations,
6
6
  writeFileOperand
7
- } from "../safe-bash/command-chunks/chunk-XAYEDOV5.js";
7
+ } from "../safe-bash/command-chunks/chunk-CG4JSOK2.js";
8
+ import "../safe-bash/command-chunks/chunk-LVEHHFOV.js";
8
9
  import "../safe-bash/command-chunks/chunk-E5TEVROY.js";
9
10
  import "../safe-bash/command-chunks/chunk-3ZK5F23O.js";
10
11
  import "../safe-bash/command-chunks/chunk-6NTY42E5.js";
@@ -14,7 +15,6 @@ import "../safe-bash/command-chunks/chunk-KHGQDFQ7.js";
14
15
  import "../safe-bash/command-chunks/chunk-A7L65T2H.js";
15
16
  import "../safe-bash/command-chunks/chunk-2MFNTNK7.js";
16
17
  import "../safe-bash/command-chunks/chunk-Z6SFT6OC.js";
17
- import "../safe-bash/command-chunks/chunk-LVEHHFOV.js";
18
18
  import "../safe-bash/command-chunks/chunk-RDV7UCYZ.js";
19
19
  import "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
20
20
  export {
@@ -2,7 +2,10 @@ import {
2
2
  sourceBytes,
3
3
  unchangedSource,
4
4
  writeFileOperand
5
- } from "../safe-bash/command-chunks/chunk-XAYEDOV5.js";
5
+ } from "../safe-bash/command-chunks/chunk-CG4JSOK2.js";
6
+ import {
7
+ FileOperation
8
+ } from "../safe-bash/command-chunks/chunk-LVEHHFOV.js";
6
9
  import {
7
10
  transform
8
11
  } from "../safe-bash/command-chunks/chunk-E5TEVROY.js";
@@ -14,9 +17,6 @@ import "../safe-bash/command-chunks/chunk-KHGQDFQ7.js";
14
17
  import "../safe-bash/command-chunks/chunk-A7L65T2H.js";
15
18
  import "../safe-bash/command-chunks/chunk-2MFNTNK7.js";
16
19
  import "../safe-bash/command-chunks/chunk-Z6SFT6OC.js";
17
- import {
18
- FileOperation
19
- } from "../safe-bash/command-chunks/chunk-LVEHHFOV.js";
20
20
  import "../safe-bash/command-chunks/chunk-RDV7UCYZ.js";
21
21
  import {
22
22
  init_buffer
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  parseCommonMarkBlocks
3
- } from "../safe-bash/command-chunks/chunk-VFS2MDAB.js";
4
- import "../safe-bash/command-chunks/chunk-F3J5ZLKF.js";
5
- import "../safe-bash/command-chunks/chunk-VTWKS4RM.js";
3
+ } from "../safe-bash/command-chunks/chunk-6YLD37NH.js";
4
+ import "../safe-bash/command-chunks/chunk-522TDVLS.js";
5
+ import "../safe-bash/command-chunks/chunk-WF2LSKMI.js";
6
+ import "../safe-bash/command-chunks/chunk-XC57GYGL.js";
6
7
  import "../safe-bash/command-chunks/chunk-OEE6EKOT.js";
7
8
  import "../safe-bash/command-chunks/chunk-UI6H6YG4.js";
8
- import "../safe-bash/command-chunks/chunk-XC57GYGL.js";
9
9
  import "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
10
10
  export {
11
11
  parseCommonMarkBlocks
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  parseCommonMarkInlines
3
- } from "../safe-bash/command-chunks/chunk-YI3GKJ7Q.js";
4
- import "../safe-bash/command-chunks/chunk-F3J5ZLKF.js";
5
- import "../safe-bash/command-chunks/chunk-VTWKS4RM.js";
3
+ } from "../safe-bash/command-chunks/chunk-766IWMTB.js";
4
+ import "../safe-bash/command-chunks/chunk-522TDVLS.js";
5
+ import "../safe-bash/command-chunks/chunk-WF2LSKMI.js";
6
+ import "../safe-bash/command-chunks/chunk-XC57GYGL.js";
6
7
  import "../safe-bash/command-chunks/chunk-OEE6EKOT.js";
7
8
  import "../safe-bash/command-chunks/chunk-UI6H6YG4.js";
8
- import "../safe-bash/command-chunks/chunk-XC57GYGL.js";
9
9
  import "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
10
10
  export {
11
11
  parseCommonMarkInlines
@@ -10,9 +10,9 @@ import {
10
10
  readLabel,
11
11
  readTitle,
12
12
  whitespace
13
- } from "../safe-bash/command-chunks/chunk-VTWKS4RM.js";
14
- import "../safe-bash/command-chunks/chunk-OEE6EKOT.js";
13
+ } from "../safe-bash/command-chunks/chunk-WF2LSKMI.js";
15
14
  import "../safe-bash/command-chunks/chunk-XC57GYGL.js";
15
+ import "../safe-bash/command-chunks/chunk-OEE6EKOT.js";
16
16
  import "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
17
17
  export {
18
18
  asciiPunctuation,
@@ -2,11 +2,11 @@ import {
2
2
  bareAutolink,
3
3
  filterGfmHtml,
4
4
  pipeRow
5
- } from "../safe-bash/command-chunks/chunk-F3J5ZLKF.js";
6
- import "../safe-bash/command-chunks/chunk-VTWKS4RM.js";
5
+ } from "../safe-bash/command-chunks/chunk-522TDVLS.js";
6
+ import "../safe-bash/command-chunks/chunk-WF2LSKMI.js";
7
+ import "../safe-bash/command-chunks/chunk-XC57GYGL.js";
7
8
  import "../safe-bash/command-chunks/chunk-OEE6EKOT.js";
8
9
  import "../safe-bash/command-chunks/chunk-UI6H6YG4.js";
9
- import "../safe-bash/command-chunks/chunk-XC57GYGL.js";
10
10
  import "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
11
11
  export {
12
12
  bareAutolink,
@@ -1,14 +1,14 @@
1
- import {
2
- parseCommonMarkInlines
3
- } from "../safe-bash/command-chunks/chunk-YI3GKJ7Q.js";
4
1
  import {
5
2
  parseCommonMarkBlocks
6
- } from "../safe-bash/command-chunks/chunk-VFS2MDAB.js";
7
- import "../safe-bash/command-chunks/chunk-F3J5ZLKF.js";
8
- import "../safe-bash/command-chunks/chunk-VTWKS4RM.js";
3
+ } from "../safe-bash/command-chunks/chunk-6YLD37NH.js";
4
+ import {
5
+ parseCommonMarkInlines
6
+ } from "../safe-bash/command-chunks/chunk-766IWMTB.js";
7
+ import "../safe-bash/command-chunks/chunk-522TDVLS.js";
8
+ import "../safe-bash/command-chunks/chunk-WF2LSKMI.js";
9
+ import "../safe-bash/command-chunks/chunk-XC57GYGL.js";
9
10
  import "../safe-bash/command-chunks/chunk-OEE6EKOT.js";
10
11
  import "../safe-bash/command-chunks/chunk-UI6H6YG4.js";
11
- import "../safe-bash/command-chunks/chunk-XC57GYGL.js";
12
12
  import {
13
13
  init_buffer
14
14
  } from "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  YqValueFailure,
3
3
  createYqQuerySession
4
- } from "../safe-bash/command-chunks/chunk-KSH2F6RG.js";
5
- import "../safe-bash/command-chunks/chunk-YIK4ZYQ4.js";
4
+ } from "../safe-bash/command-chunks/chunk-CUFCNL6G.js";
5
+ import "../safe-bash/command-chunks/chunk-DC52GWRK.js";
6
6
  import "../safe-bash/command-chunks/chunk-NSEUBSOD.js";
7
+ import "../safe-bash/command-chunks/chunk-WVWWRMFD.js";
8
+ import "../safe-bash/command-chunks/chunk-Z47EO74H.js";
7
9
  import "../safe-bash/command-chunks/chunk-ACRMXIQC.js";
8
10
  import "../safe-bash/command-chunks/chunk-5PM5TEPM.js";
9
- import "../safe-bash/command-chunks/chunk-WVWWRMFD.js";
10
11
  import "../safe-bash/command-chunks/chunk-GZOUGVVV.js";
11
12
  import "../safe-bash/command-chunks/chunk-SNXWY3KV.js";
12
13
  import "../safe-bash/command-chunks/chunk-TFZEYNMX.js";
13
- import "../safe-bash/command-chunks/chunk-3JS4FOLB.js";
14
- import "../safe-bash/command-chunks/chunk-Z47EO74H.js";
15
14
  import "../safe-bash/command-chunks/chunk-IFUNAM4D.js";
16
15
  import "../safe-bash/command-chunks/chunk-NYUMOVF2.js";
16
+ import "../safe-bash/command-chunks/chunk-3JS4FOLB.js";
17
17
  import "../safe-bash/command-chunks/chunk-BIXN77VL.js";
18
18
  import "../safe-bash/command-chunks/chunk-UPOI7O7Y.js";
19
19
  import "../safe-bash/command-chunks/chunk-744EDSWN.js";
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  Interpreter
3
- } from "../safe-bash/command-chunks/chunk-YIK4ZYQ4.js";
3
+ } from "../safe-bash/command-chunks/chunk-DC52GWRK.js";
4
4
  import "../safe-bash/command-chunks/chunk-NSEUBSOD.js";
5
- import "../safe-bash/command-chunks/chunk-5PM5TEPM.js";
6
5
  import "../safe-bash/command-chunks/chunk-WVWWRMFD.js";
6
+ import "../safe-bash/command-chunks/chunk-Z47EO74H.js";
7
+ import "../safe-bash/command-chunks/chunk-5PM5TEPM.js";
7
8
  import "../safe-bash/command-chunks/chunk-GZOUGVVV.js";
8
9
  import "../safe-bash/command-chunks/chunk-SNXWY3KV.js";
9
10
  import "../safe-bash/command-chunks/chunk-TFZEYNMX.js";
10
- import "../safe-bash/command-chunks/chunk-3JS4FOLB.js";
11
- import "../safe-bash/command-chunks/chunk-Z47EO74H.js";
12
11
  import "../safe-bash/command-chunks/chunk-IFUNAM4D.js";
13
12
  import "../safe-bash/command-chunks/chunk-NYUMOVF2.js";
13
+ import "../safe-bash/command-chunks/chunk-3JS4FOLB.js";
14
14
  import "../safe-bash/command-chunks/chunk-BIXN77VL.js";
15
15
  import "../safe-bash/command-chunks/chunk-UPOI7O7Y.js";
16
16
  import "../safe-bash/command-chunks/chunk-744EDSWN.js";
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  YqValueFailure,
3
3
  createYqQuerySession
4
- } from "../safe-bash/command-chunks/chunk-KSH2F6RG.js";
5
- import "../safe-bash/command-chunks/chunk-YIK4ZYQ4.js";
4
+ } from "../safe-bash/command-chunks/chunk-CUFCNL6G.js";
5
+ import "../safe-bash/command-chunks/chunk-DC52GWRK.js";
6
6
  import "../safe-bash/command-chunks/chunk-NSEUBSOD.js";
7
+ import "../safe-bash/command-chunks/chunk-WVWWRMFD.js";
8
+ import "../safe-bash/command-chunks/chunk-Z47EO74H.js";
7
9
  import "../safe-bash/command-chunks/chunk-ACRMXIQC.js";
8
10
  import "../safe-bash/command-chunks/chunk-5PM5TEPM.js";
9
- import "../safe-bash/command-chunks/chunk-WVWWRMFD.js";
10
11
  import "../safe-bash/command-chunks/chunk-GZOUGVVV.js";
11
12
  import "../safe-bash/command-chunks/chunk-SNXWY3KV.js";
12
13
  import "../safe-bash/command-chunks/chunk-TFZEYNMX.js";
13
- import "../safe-bash/command-chunks/chunk-3JS4FOLB.js";
14
- import "../safe-bash/command-chunks/chunk-Z47EO74H.js";
15
14
  import "../safe-bash/command-chunks/chunk-IFUNAM4D.js";
16
15
  import "../safe-bash/command-chunks/chunk-NYUMOVF2.js";
16
+ import "../safe-bash/command-chunks/chunk-3JS4FOLB.js";
17
17
  import "../safe-bash/command-chunks/chunk-BIXN77VL.js";
18
18
  import "../safe-bash/command-chunks/chunk-UPOI7O7Y.js";
19
19
  import "../safe-bash/command-chunks/chunk-744EDSWN.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poe-platform/safe-bash",
3
- "version": "0.1.757",
3
+ "version": "0.1.759",
4
4
  "description": "Extensible virtual shell with pluggable filesystems and streaming commands",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -36,6 +36,10 @@
36
36
  "types": "./dist/pdf-ast/index.d.ts",
37
37
  "import": "./dist/pdf-ast/index.js"
38
38
  },
39
+ "./ssconvert/commands": {
40
+ "types": "./dist/safe-bash-command-ssconvert/commands.d.ts",
41
+ "import": "./dist/safe-bash-command-ssconvert/commands.js"
42
+ },
39
43
  "./mcp": {
40
44
  "types": "./dist/safe-bash-mcp/index.d.ts",
41
45
  "import": "./dist/safe-bash-mcp/index.js"
@@ -837,7 +841,7 @@
837
841
  "access": "public"
838
842
  },
839
843
  "dependencies": {
840
- "@poe-platform/safe-fs": "0.1.757",
844
+ "@poe-platform/safe-fs": "0.1.759",
841
845
  "pdf-lib": "1.17.1",
842
846
  "@noble/hashes": "2.4.0",
843
847
  "pako": "3.0.1",
@@ -179,6 +179,12 @@ Word-spacing classification follows PDF.js `Font.charsToGlyphs`
179
179
  receives Tw, regardless of its Unicode label. The internal CMap reader preserves
180
180
  that classification without changing the public ToUnicode result shape.
181
181
 
182
+ Simple-font character segmentation also follows `Font.charsToGlyphs`: Type1,
183
+ TrueType, and Type3 strings use single-byte codes even when ToUnicode declares
184
+ a wider codespace. `src/fonts/simple-font-codespace.test.ts` checks that behavior
185
+ and the original upstream issue17069 equality fixture, including TJ fragments,
186
+ word spacing, Unicode labels spanning multiple characters, and save/reopen.
187
+
182
188
 
183
189
  # SVG labels
184
190
 
@@ -223,6 +229,14 @@ additional regressions use the extracted upstream streams listed in
223
229
  1996–2003 Glyph & Cog, LLC, Apache-2.0. The upstream Flate implementation is a
224
230
  JavaScript port of XPDF's implementation.
225
231
 
232
+ `src/cos/pypdf-flate-recovery.test.ts` adapts the printable-byte example from
233
+ pypdf 6.19.0 `tests/test_filters.py::test_decompress`, with truncation results
234
+ checked against `pypdf.filters.decompress`. The bounded pako fallback in
235
+ `src/cos/filters.ts` retains partial zlib/gzip output on incomplete input,
236
+ following pypdf's recovery behavior without its byte-at-a-time decoding loop.
237
+ The original PDF.js issue11549 fixture additionally checks the recovered
238
+ Unicode map against pypdf's decoded bytes. pypdf attribution/license is below.
239
+
226
240
  # PDF standard security handler
227
241
 
228
242
  `src/vendor/pdfjs-fonts.mjs` also includes `src/core/crypto.js`,
@@ -295,3 +309,19 @@ tables and clear the high byte only for F000–F0FF. The TrueType reader records
295
309
  the selected cmap's encoding. Tests in `src/fonts/cid-to-gid.test.ts` cover
296
310
  raw and prefixed symbol codes plus the original issue2948 fixture at the
297
311
  same pinned PDF.js revision documented above.
312
+
313
+ Pattern-painted stencils follow PDF.js `CanvasGraphics._createMaskCanvas`:
314
+ the current pattern is painted in page coordinates through transformed mask
315
+ alpha, rather than coloring the source mask pixels. `stencil-pattern.test.ts`
316
+ ports the original `issue13372` equality fixture and adds memory-only coverage
317
+ for inline masks, rotation, inverted Decode, alpha, one-pixel masks, and tiling.
318
+ The source fixture and hashes are recorded in `src/fixtures/SOURCES.md`.
319
+ The one-pixel gradient expectation is independently verified by Poppler and
320
+ MuPDF; PDF.js's `paintSolidColorImageMask` optimization loses that pattern.
321
+
322
+ Malformed dictionary-key recovery follows PDF.js `Parser.getObj`, skipping
323
+ stray non-Name tokens only in local repair mode. Damaged optional ToUnicode
324
+ streams follow `PartialEvaluator.readToUnicode` error recovery while retaining
325
+ local resource-limit errors. `dictionary-recovery.test.ts` ports the original
326
+ `issue11549` equality fixture and covers ordinary/compressed dictionaries,
327
+ trailer metadata, strict mode, and explicit limits.
@@ -1,3 +1,7 @@
1
+ import {
2
+ factorRecord,
3
+ parseNumber
4
+ } from "./chunk-MYVOHXZB.js";
1
5
  import {
2
6
  Lifecycle,
3
7
  RecordWriter,
@@ -10,10 +14,6 @@ import {
10
14
  quote,
11
15
  settings
12
16
  } from "./chunk-4SYSDBZA.js";
13
- import {
14
- factorRecord,
15
- parseNumber
16
- } from "./chunk-MYVOHXZB.js";
17
17
  import {
18
18
  init_buffer
19
19
  } from "./chunk-HX3SHTCE.js";
@@ -1,3 +1,6 @@
1
+ import {
2
+ FileOperation
3
+ } from "./chunk-LVEHHFOV.js";
1
4
  import {
2
5
  chunkBytes,
3
6
  stagingLimit,
@@ -10,9 +13,6 @@ import {
10
13
  codeOf,
11
14
  pathOf
12
15
  } from "./chunk-A7L65T2H.js";
13
- import {
14
- FileOperation
15
- } from "./chunk-LVEHHFOV.js";
16
16
  import {
17
17
  init_buffer
18
18
  } from "./chunk-HX3SHTCE.js";