@poe-platform/safe-bash 0.1.760 → 0.1.761
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/image-ast/index.browser.js +48 -6
- package/dist/image-ast/index.js +48 -6
- package/dist/pdf-ast/index.js +50 -6
- package/dist/safe-bash/command-chunks/{chunk-MC4XXPQJ.js → chunk-6VX5ZQL5.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-UCI6ZQFB.js → chunk-GR725WRX.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-S3SCPBHC.js → chunk-OSMLVM7P.js} +53 -6
- package/dist/safe-bash/commands/htmlq/index.d.ts +1 -1
- package/dist/safe-bash/commands/htmlq/index.js +4 -1
- package/dist/safe-bash/core.browser.js +3 -2
- package/dist/safe-bash/shell/runtime.js +1 -1
- package/dist/safe-bash-command-ffmpeg/index.js +207 -175
- package/dist/safe-bash-command-git/LICENSE +21 -0
- package/dist/safe-bash-command-imagemagick/index.js +2 -2
- package/dist/safe-bash-command-pandoc/command.js +3 -3
- package/dist/safe-bash-command-pandoc/index.js +3 -3
- package/dist/safe-bash-command-pdfimages/index.js +48 -6
- package/dist/safe-bash-command-pdfinfo/index.js +48 -6
- package/dist/safe-bash-command-pdftk/index.js +48 -6
- package/dist/safe-bash-command-pdftoppm/index.js +48 -6
- package/dist/safe-bash-command-pdftotext/index.js +48 -6
- package/dist/safe-bash-command-qpdf/index.js +48 -6
- package/dist/safe-bash-command-sips/index.js +2 -2
- package/dist/safe-bash-command-soffice/index.js +1 -1
- package/dist/safe-bash-command-ssconvert/index.js +48 -6
- package/dist/safe-bash-command-wkhtmltopdf/index.js +48 -6
- package/package.json +2 -2
- package/third-party/pdf-ast/THIRD_PARTY_NOTICES.md +22 -0
- package/third-party/pdf-ast/licenses/AGG-2.3.txt +7 -0
- package/third-party/pdf-ast/licenses/MIT.txt +21 -0
|
@@ -13928,6 +13928,39 @@ function createTrueTypeFontHandle(truetype) {
|
|
|
13928
13928
|
}
|
|
13929
13929
|
};
|
|
13930
13930
|
}
|
|
13931
|
+
function flattenCubic(x1, y1, x2, y2, x3, y3, x4, y4) {
|
|
13932
|
+
const points = [[x1, y1]];
|
|
13933
|
+
const subdivide = (ax, ay, bx, by, cx, cy, dx, dy, level) => {
|
|
13934
|
+
if (level > 16) return;
|
|
13935
|
+
const abx = (ax + bx) / 2, aby = (ay + by) / 2;
|
|
13936
|
+
const bcx = (bx + cx) / 2, bcy = (by + cy) / 2;
|
|
13937
|
+
const cdx = (cx + dx) / 2, cdy = (cy + dy) / 2;
|
|
13938
|
+
const abcx = (abx + bcx) / 2, abcy = (aby + bcy) / 2;
|
|
13939
|
+
const bcdx = (bcx + cdx) / 2, bcdy = (bcy + cdy) / 2;
|
|
13940
|
+
const midx = (abcx + bcdx) / 2, midy = (abcy + bcdy) / 2;
|
|
13941
|
+
const chordX = dx - ax, chordY = dy - ay;
|
|
13942
|
+
const d2 = Math.abs((bx - dx) * chordY - (by - dy) * chordX);
|
|
13943
|
+
const d3 = Math.abs((cx - dx) * chordY - (cy - dy) * chordX);
|
|
13944
|
+
const significant2 = d2 > 1e-30, significant3 = d3 > 1e-30;
|
|
13945
|
+
if (!significant2 && !significant3) {
|
|
13946
|
+
if (Math.abs(ax + cx - 2 * bx) + Math.abs(ay + cy - 2 * by) + Math.abs(bx + dx - 2 * cx) + Math.abs(by + dy - 2 * cy) <= 4) {
|
|
13947
|
+
points.push([midx, midy]);
|
|
13948
|
+
return;
|
|
13949
|
+
}
|
|
13950
|
+
} else {
|
|
13951
|
+
const distance = (significant2 ? d2 : 0) + (significant3 ? d3 : 0);
|
|
13952
|
+
if (distance * distance <= 0.25 * (chordX * chordX + chordY * chordY)) {
|
|
13953
|
+
points.push([bcx, bcy]);
|
|
13954
|
+
return;
|
|
13955
|
+
}
|
|
13956
|
+
}
|
|
13957
|
+
subdivide(ax, ay, abx, aby, abcx, abcy, midx, midy, level + 1);
|
|
13958
|
+
subdivide(midx, midy, bcdx, bcdy, cdx, cdy, dx, dy, level + 1);
|
|
13959
|
+
};
|
|
13960
|
+
subdivide(x1, y1, x2, y2, x3, y3, x4, y4, 0);
|
|
13961
|
+
points.push([x4, y4]);
|
|
13962
|
+
return points;
|
|
13963
|
+
}
|
|
13931
13964
|
function decodePng(pngBytes) {
|
|
13932
13965
|
if (pngBytes.length < 24 || pngBytes[0] !== 137 || pngBytes[1] !== 80 || pngBytes[2] !== 78 || pngBytes[3] !== 71) {
|
|
13933
13966
|
throw new Error("Invalid PNG signature");
|
|
@@ -14379,14 +14412,11 @@ function segmentsToScreenEdges(segments, pageHeight, scale, closeSubpaths = fals
|
|
|
14379
14412
|
const [p1x, p1y] = toScreen(seg.x1, seg.y1);
|
|
14380
14413
|
const [p2x, p2y] = toScreen(seg.x2, seg.y2);
|
|
14381
14414
|
const [p3x, p3y] = toScreen(seg.x, seg.y);
|
|
14382
|
-
const
|
|
14415
|
+
const points = flattenCubic(curX, curY, p1x, p1y, p2x, p2y, p3x, p3y);
|
|
14383
14416
|
let px = curX;
|
|
14384
14417
|
let py = curY;
|
|
14385
|
-
for (let
|
|
14386
|
-
const
|
|
14387
|
-
const mt = 1 - t;
|
|
14388
|
-
const qx = mt * mt * mt * curX + 3 * mt * mt * t * p1x + 3 * mt * t * t * p2x + t * t * t * p3x;
|
|
14389
|
-
const qy = mt * mt * mt * curY + 3 * mt * mt * t * p1y + 3 * mt * t * t * p2y + t * t * t * p3y;
|
|
14418
|
+
for (let i = 1; i < points.length; i++) {
|
|
14419
|
+
const [qx, qy] = points[i];
|
|
14390
14420
|
edges.push({ x0: px, y0: py, x1: qx, y1: qy });
|
|
14391
14421
|
px = qx;
|
|
14392
14422
|
py = qy;
|
|
@@ -43302,3 +43332,15 @@ export {
|
|
|
43302
43332
|
* Copyright 2017 Mozilla Foundation. Licensed under Apache-2.0.
|
|
43303
43333
|
* See licenses/PDFJS-APACHE-2.0.txt and THIRD_PARTY_NOTICES.md.
|
|
43304
43334
|
*/
|
|
43335
|
+
/*!
|
|
43336
|
+
* Anti-Grain Geometry - Version 2.3
|
|
43337
|
+
* Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
|
|
43338
|
+
*
|
|
43339
|
+
* Permission to copy, use, modify, sell and distribute this software
|
|
43340
|
+
* is granted provided this copyright notice appears in all copies.
|
|
43341
|
+
* This software is provided "as is" without express or implied
|
|
43342
|
+
* warranty, and with no claim as to its suitability for any purpose.
|
|
43343
|
+
*
|
|
43344
|
+
* Adapted from PDFium third_party/agg23/agg_curves.cpp, curve4_div.
|
|
43345
|
+
* See THIRD_PARTY_NOTICES.md for the pinned revision and adaptations.
|
|
43346
|
+
*/
|
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.761",
|
|
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.
|
|
844
|
+
"@poe-platform/safe-fs": "0.1.761",
|
|
845
845
|
"pdf-lib": "1.17.1",
|
|
846
846
|
"@noble/hashes": "2.4.0",
|
|
847
847
|
"pako": "3.0.1",
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
# pdf-ast licensing
|
|
2
|
+
|
|
3
|
+
Original code is MIT-licensed; see `licenses/MIT.txt`. The bundled and adapted
|
|
4
|
+
components below retain their respective terms and notices.
|
|
5
|
+
|
|
1
6
|
# Mozilla PDF.js
|
|
2
7
|
|
|
3
8
|
The numeric recovery and malformed-command handling in `src/cos/lexer.ts`, and
|
|
@@ -193,6 +198,23 @@ operationsFilter` case (7200 black and 12800 white pixels) and the unchanged
|
|
|
193
198
|
`clippath.pdf` fixture. Other local cases cover curves, reversed rectangles,
|
|
194
199
|
transforms, save/restore, text/image intersections, and issue17069's signature.
|
|
195
200
|
|
|
201
|
+
# PDFium / Anti-Grain Geometry curve subdivision
|
|
202
|
+
|
|
203
|
+
`src/render/cubic.ts` adapts `curve4_div` from PDFium revision
|
|
204
|
+
`a84323421e94f484faca52dd9d027934eba42ab8`, file
|
|
205
|
+
`third_party/agg23/agg_curves.cpp` (Anti-Grain Geometry 2.3).
|
|
206
|
+
Copyright (C) 2002–2005 Maxim Shemanarev. Permission terms are retained in the
|
|
207
|
+
source and `licenses/AGG-2.3.txt`.
|
|
208
|
+
|
|
209
|
+
The TypeScript adapter uses double-precision numbers and arrays, merges the
|
|
210
|
+
equivalent one/two-control-point distance cases, and keeps the upstream
|
|
211
|
+
half-pixel flatness, collinearity handling, and recursion limit of 16.
|
|
212
|
+
`src/render/cubic-flattening.test.ts` compares against points generated by
|
|
213
|
+
compiling the unchanged upstream C++ algorithm with a minimal vector-storage
|
|
214
|
+
adapter; other cases use independently rendered PDF.js pixels.
|
|
215
|
+
|
|
216
|
+
Source: https://github.com/chromium/pdfium/blob/a84323421e94f484faca52dd9d027934eba42ab8/third_party/agg23/agg_curves.cpp
|
|
217
|
+
|
|
196
218
|
|
|
197
219
|
# SVG labels
|
|
198
220
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Anti-Grain Geometry - Version 2.3
|
|
2
|
+
Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
|
|
3
|
+
|
|
4
|
+
Permission to copy, use, modify, sell and distribute this software
|
|
5
|
+
is granted provided this copyright notice appears in all copies.
|
|
6
|
+
This software is provided "as is" without express or implied
|
|
7
|
+
warranty, and with no claim as to its suitability for any purpose.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Poe Platform
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|