@poe-platform/safe-bash 0.1.771 → 0.1.773

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 (42) hide show
  1. package/dist/image-ast/index.browser.js +2801 -556
  2. package/dist/image-ast/index.js +2801 -556
  3. package/dist/pdf-ast/ast.d.ts +7 -0
  4. package/dist/pdf-ast/content/evaluator.d.ts +1 -0
  5. package/dist/pdf-ast/index.js +2845 -568
  6. package/dist/pdf-ast/render/raster.d.ts +1 -0
  7. package/dist/pdf-ast/vendor/pdfjs-fonts.d.mts +24 -0
  8. package/dist/pdf-ast/vendor/pdfjs-fonts.mjs +2621 -0
  9. package/dist/safe-bash/chunks/{chunk-FSH7QRIC.js → chunk-Z3HX3ZBA.js} +10 -4
  10. package/dist/safe-bash/command-chunks/{chunk-M2XU2YCK.js → chunk-5VXZSNM2.js} +2 -2
  11. package/dist/safe-bash/command-chunks/{chunk-C4AAJTXF.js → chunk-B2MM5DIT.js} +2804 -556
  12. package/dist/safe-bash/command-chunks/{chunk-NBENXODJ.js → chunk-G3NVK25P.js} +1 -1
  13. package/dist/safe-bash/commands/python/host-capabilities.js +15 -6
  14. package/dist/safe-bash/commands/python/index.browser.js +1 -1
  15. package/dist/safe-bash/core.browser.js +39 -39
  16. package/dist/safe-bash/core.d.ts +1 -1
  17. package/dist/safe-bash/plugins/composition.d.ts +2 -0
  18. package/dist/safe-bash/plugins/composition.js +2 -1
  19. package/dist/safe-bash-command-ffmpeg/index.js +10968 -9719
  20. package/dist/safe-bash-command-gh/index.d.ts +1 -0
  21. package/dist/safe-bash-command-gh/index.js +43 -13
  22. package/dist/safe-bash-command-gh/types.d.ts +1 -0
  23. package/dist/safe-bash-command-git/git_rust.wasm +0 -0
  24. package/dist/safe-bash-command-git/index.js +22 -15
  25. package/dist/safe-bash-command-git/wasm.generated.js +1 -1
  26. package/dist/safe-bash-command-imagemagick/index.js +2 -2
  27. package/dist/safe-bash-command-pandoc/command.js +3 -3
  28. package/dist/safe-bash-command-pandoc/index.js +3 -3
  29. package/dist/safe-bash-command-pdfimages/index.js +2800 -510
  30. package/dist/safe-bash-command-pdfinfo/index.js +2842 -568
  31. package/dist/safe-bash-command-pdftk/index.js +2800 -510
  32. package/dist/safe-bash-command-pdftoppm/index.js +2847 -637
  33. package/dist/safe-bash-command-pdftotext/index.js +2800 -510
  34. package/dist/safe-bash-command-qpdf/index.js +2800 -510
  35. package/dist/safe-bash-command-sips/index.js +2 -2
  36. package/dist/safe-bash-command-soffice/index.js +1 -1
  37. package/dist/safe-bash-command-ssconvert/index.js +2811 -566
  38. package/dist/safe-bash-command-wkhtmltopdf/index.js +2833 -510
  39. package/dist/safe-bash-mcp/index.d.ts +8 -2
  40. package/dist/safe-bash-mcp/index.js +13 -6
  41. package/package.json +7 -7
  42. package/third-party/pdf-ast/THIRD_PARTY_NOTICES.md +62 -1
@@ -1431,7 +1431,6 @@ function createPythonHostBridge(capabilities, options) {
1431
1431
  const pull = async (handle) => {
1432
1432
  const stream = streams.get(handle);
1433
1433
  if (!stream) throw new Error("Unknown Python host stream");
1434
- stream.busy = true;
1435
1434
  try {
1436
1435
  const result = await stream.iterator.next();
1437
1436
  assertLive();
@@ -1451,8 +1450,6 @@ function createPythonHostBridge(capabilities, options) {
1451
1450
  } catch (error) {
1452
1451
  if (streams.has(handle)) await release(handle);
1453
1452
  throw error;
1454
- } finally {
1455
- stream.busy = false;
1456
1453
  }
1457
1454
  };
1458
1455
  const request = async (incoming) => {
@@ -1480,9 +1477,12 @@ function createPythonHostBridge(capabilities, options) {
1480
1477
  if (payload.operation === "begin" || payload.operation === "begin-next") {
1481
1478
  let work;
1482
1479
  let child;
1480
+ let reservedStream;
1483
1481
  if (payload.operation === "begin-next") {
1484
1482
  const stream = typeof payload.handle === "number" ? streams.get(payload.handle) : void 0;
1485
1483
  if (!stream || stream.busy) throw new Error("Unknown or busy Python host stream");
1484
+ reservedStream = stream;
1485
+ stream.busy = true;
1486
1486
  child = stream.controller;
1487
1487
  work = () => pull(payload.handle);
1488
1488
  } else {
@@ -1505,6 +1505,7 @@ function createPythonHostBridge(capabilities, options) {
1505
1505
  }).catch((error) => {
1506
1506
  job.failed = pythonHostFailureCode(error);
1507
1507
  }).finally(() => {
1508
+ if (reservedStream) reservedStream.busy = false;
1508
1509
  jobWork.delete(task);
1509
1510
  });
1510
1511
  jobWork.add(task);
@@ -1520,7 +1521,12 @@ function createPythonHostBridge(capabilities, options) {
1520
1521
  await release(handle);
1521
1522
  return null;
1522
1523
  }
1523
- return pull(handle);
1524
+ stream.busy = true;
1525
+ try {
1526
+ return await pull(handle);
1527
+ } finally {
1528
+ stream.busy = false;
1529
+ }
1524
1530
  }
1525
1531
  if (typeof payload.capability !== "string") throw new TypeError("Invalid Python host capability");
1526
1532
  const capability = registry.get(payload.capability);
@@ -48,11 +48,11 @@ import {
48
48
  trimImage,
49
49
  unflattenImage,
50
50
  unpremultiplyRgbaImage
51
- } from "./chunk-NBENXODJ.js";
51
+ } from "./chunk-G3NVK25P.js";
52
52
  import {
53
53
  PdfDocument,
54
54
  encodePng
55
- } from "./chunk-C4AAJTXF.js";
55
+ } from "./chunk-B2MM5DIT.js";
56
56
  import {
57
57
  createLuaFilterCapability
58
58
  } from "./chunk-Y2KHC6TZ.js";