@poe-platform/safe-bash 0.1.763 → 0.1.765

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 (32) hide show
  1. package/dist/image-ast/index.browser.js +321 -162
  2. package/dist/image-ast/index.js +321 -162
  3. package/dist/pdf-ast/ast.d.ts +2 -0
  4. package/dist/pdf-ast/index.js +340 -173
  5. package/dist/safe-bash/chunks/{chunk-CRQDMBQA.js → chunk-FSH7QRIC.js} +10 -1
  6. package/dist/safe-bash/command-chunks/{chunk-4XHONGIU.js → chunk-DT4MFWV4.js} +2 -2
  7. package/dist/safe-bash/command-chunks/{chunk-S3G2B4OX.js → chunk-KO4PXCNL.js} +324 -162
  8. package/dist/safe-bash/command-chunks/{chunk-S5EX6UP5.js → chunk-SVL6HYQL.js} +1 -1
  9. package/dist/safe-bash/commands/python/index.browser.js +1 -1
  10. package/dist/safe-bash/commands/python/llm-module.js +3 -1
  11. package/dist/safe-bash/commands/python/shell-module.js +7 -0
  12. package/dist/safe-bash/core.browser.js +32 -12
  13. package/dist/safe-bash/shell/runtime.js +43 -11
  14. package/dist/safe-bash-command-ffmpeg/index.js +5800 -5693
  15. package/dist/safe-bash-command-imagemagick/index.js +2 -2
  16. package/dist/safe-bash-command-pandoc/command.js +3 -3
  17. package/dist/safe-bash-command-pandoc/index.js +3 -3
  18. package/dist/safe-bash-command-pdfimages/index.js +321 -162
  19. package/dist/safe-bash-command-pdfinfo/index.js +338 -173
  20. package/dist/safe-bash-command-pdftk/index.js +321 -162
  21. package/dist/safe-bash-command-pdftoppm/index.js +338 -173
  22. package/dist/safe-bash-command-pdftotext/index.js +321 -162
  23. package/dist/safe-bash-command-qpdf/index.js +321 -162
  24. package/dist/safe-bash-command-sips/index.js +2 -2
  25. package/dist/safe-bash-command-soffice/index.js +1 -1
  26. package/dist/safe-bash-command-ssconvert/index.js +373 -169
  27. package/dist/safe-bash-command-wkhtmltopdf/index.js +322 -162
  28. package/dist/safe-playwright-cloudflare/browser-snapshot-labels.d.ts +14 -0
  29. package/dist/safe-playwright-cloudflare/browser-snapshot-labels.js +62 -0
  30. package/dist/safe-playwright-cloudflare/browser-snapshot-scheduler.js +8 -1
  31. package/package.json +2 -2
  32. package/third-party/pdf-ast/THIRD_PARTY_NOTICES.md +24 -0
@@ -1,3 +1,4 @@
1
+ import { installSnapshotLabelCache } from './browser-snapshot-labels.js';
1
2
  /** Serialize native frame capture before cold utility scripts become CDP payloads.
2
3
  * The pinned provider recurses only after this callback returns, so descendants
3
4
  * do not retain a parent slot. Native traversal, retries and refs stay intact. */
@@ -54,7 +55,13 @@ export function createBrowserSnapshotScheduler() {
54
55
  }
55
56
  function snapshotAction(progress, frame, action) {
56
57
  return function (continuePolling) {
57
- return schedule(progress, frame, () => action.call(this, continuePolling));
58
+ return schedule(progress, frame, async () => {
59
+ const context = await progress.race(frame._utilityContext());
60
+ const injected = await progress.race(context.injectedScript());
61
+ await progress.race(injected.evaluate(installSnapshotLabelCache));
62
+ progress.signal.throwIfAborted();
63
+ return action.call(this, continuePolling);
64
+ });
58
65
  };
59
66
  }
60
67
  function prepareFrame(frame) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poe-platform/safe-bash",
3
- "version": "0.1.763",
3
+ "version": "0.1.765",
4
4
  "description": "Extensible virtual shell with pluggable filesystems and streaming commands",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -841,7 +841,7 @@
841
841
  "access": "public"
842
842
  },
843
843
  "dependencies": {
844
- "@poe-platform/safe-fs": "0.1.763",
844
+ "@poe-platform/safe-fs": "0.1.765",
845
845
  "pdf-lib": "1.17.1",
846
846
  "@noble/hashes": "2.4.0",
847
847
  "pako": "3.0.1",
@@ -215,6 +215,30 @@ adapter; other cases use independently rendered PDF.js pixels.
215
215
 
216
216
  Source: https://github.com/chromium/pdfium/blob/a84323421e94f484faca52dd9d027934eba42ab8/third_party/agg23/agg_curves.cpp
217
217
 
218
+ `src/render/stroke.ts` adapts the cap, join, miter and arc calculations from
219
+ `third_party/agg23/agg_math_stroke.h`, with forward/backward contour assembly
220
+ from `agg_vcgen_stroke.cpp`, at the same PDFium revision and under the same AGG
221
+ permission terms. The adapter uses double-precision arrays, PDFium's
222
+ `miter_join_revert` bevel fallback, and a one-million-vertex expansion limit.
223
+ Local dash splitting preserves joins across vertices and closed seams, resets
224
+ phase per subpath, and handles odd arrays and zero-length round dots.
225
+ `src/render/stroke-joins.test.ts` checks native cap/join vectors plus independent
226
+ PDF.js pixels; Poppler also confirms the final zero-length dash is omitted.
227
+ The native harness calls unchanged upstream math routines with minimal support
228
+ headers and local contour assembly; it is not the full upstream generator.
229
+
230
+ Source: https://github.com/chromium/pdfium/blob/a84323421e94f484faca52dd9d027934eba42ab8/third_party/agg23/agg_math_stroke.h
231
+
232
+ Stroke preparation in `src/render/raster.ts` adapts PDF.js
233
+ `CanvasGraphics.getScaleForStroking` and `rescaleAndStroke` from
234
+ `src/display/canvas.js` at revision `91041fb94d6744bc2a5bccd9aad28d617faa8195`
235
+ (Mozilla Foundation, Apache-2.0). It preserves paint-time user coordinates for
236
+ width/dashes, applies the per-axis minimum device thickness, and uses PDF.js's
237
+ larger-factor dash correction when the minimum rescales the axes differently.
238
+ The TypeScript adaptation uses arrays rather than Canvas/DOMMatrix objects,
239
+ shares preparation between bitmap and SVG, and suppresses singular strokes.
240
+ Tests compare independent PDF.js pixels, including identical embedded CFF text.
241
+
218
242
 
219
243
  # SVG labels
220
244