@poe-platform/safe-bash 0.1.710 → 0.1.712

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 (60) hide show
  1. package/README.md +21 -1
  2. package/dist/safe-bash/commands/fmt/index.d.ts +2 -0
  3. package/dist/safe-bash/commands/fmt/index.d.ts.map +1 -0
  4. package/dist/safe-bash/commands/fmt/index.js +2 -0
  5. package/dist/safe-bash/commands/fmt/index.js.map +1 -0
  6. package/dist/safe-bash/commands/fmt.d.ts +1 -2
  7. package/dist/safe-bash/commands/fmt.d.ts.map +1 -1
  8. package/dist/safe-bash/commands/fmt.js +1 -838
  9. package/dist/safe-bash/commands/fmt.js.map +1 -1
  10. package/dist/safe-bash/commands/time-env/printenv.d.ts +1 -1
  11. package/dist/safe-bash/commands/time-env/printenv.d.ts.map +1 -1
  12. package/dist/safe-bash/commands/time-env/sleep.d.ts +1 -1
  13. package/dist/safe-bash/commands/time-env/sleep.d.ts.map +1 -1
  14. package/dist/safe-bash/core.browser.js +155 -2099
  15. package/dist/safe-bash/core.browser.js.map +3 -3
  16. package/dist/safe-bash/playwright/private-target-transport.d.ts.map +1 -1
  17. package/dist/safe-bash/playwright/private-target-transport.js +18 -2
  18. package/dist/safe-bash/playwright/private-target-transport.js.map +1 -1
  19. package/dist/safe-bash/playwright/profile.d.ts +3 -1
  20. package/dist/safe-bash/playwright/profile.d.ts.map +1 -1
  21. package/dist/safe-bash/playwright/profile.js +3 -3
  22. package/dist/safe-bash/playwright/profile.js.map +1 -1
  23. package/dist/safe-bash-command-exiftool/index.js +1401 -6
  24. package/dist/safe-bash-command-exiftool/index.js.map +7 -0
  25. package/dist/safe-bash-command-fmt/arguments.d.ts +8 -0
  26. package/dist/safe-bash-command-fmt/command.d.ts +20 -0
  27. package/dist/safe-bash-command-fmt/contracts.d.ts +42 -0
  28. package/dist/safe-bash-command-fmt/engine.d.ts +20 -0
  29. package/dist/safe-bash-command-fmt/index.d.ts +5 -0
  30. package/dist/safe-bash-command-fmt/index.js +2419 -0
  31. package/dist/safe-bash-command-fmt/index.js.map +7 -0
  32. package/dist/safe-bash-command-fmt/sdk.d.ts +15 -0
  33. package/dist/safe-bash-command-wkhtmltopdf/index.js +1458 -7
  34. package/dist/safe-bash-command-wkhtmltopdf/index.js.map +7 -0
  35. package/dist/safe-bash-contracts/index.d.ts +8 -0
  36. package/dist/safe-bash-contracts/index.js +8 -0
  37. package/dist/safe-playwright-cloudflare/browser-run-code.js +15 -1
  38. package/package.json +6 -2
  39. package/dist/safe-bash-command-exiftool/argfiles.js +0 -163
  40. package/dist/safe-bash-command-exiftool/arguments.js +0 -128
  41. package/dist/safe-bash-command-exiftool/command.js +0 -324
  42. package/dist/safe-bash-command-exiftool/csv.js +0 -78
  43. package/dist/safe-bash-command-exiftool/paths.js +0 -18
  44. package/dist/safe-bash-command-exiftool/png.js +0 -308
  45. package/dist/safe-bash-command-exiftool/publication.js +0 -80
  46. package/dist/safe-bash-command-exiftool/registry.js +0 -14
  47. package/dist/safe-bash-command-exiftool/resources.js +0 -29
  48. package/dist/safe-bash-command-exiftool/scalar.js +0 -103
  49. package/dist/safe-bash-command-exiftool/sdk.js +0 -113
  50. package/dist/safe-bash-command-exiftool/shifts.js +0 -29
  51. package/dist/safe-bash-command-wkhtmltopdf/command.js +0 -373
  52. package/dist/safe-bash-command-wkhtmltopdf/engine.js +0 -99
  53. package/dist/safe-bash-command-wkhtmltopdf/errors.js +0 -11
  54. package/dist/safe-bash-command-wkhtmltopdf/limits.js +0 -69
  55. package/dist/safe-bash-command-wkhtmltopdf/outcome.js +0 -38
  56. package/dist/safe-bash-command-wkhtmltopdf/parser.js +0 -146
  57. package/dist/safe-bash-command-wkhtmltopdf/resources.js +0 -284
  58. package/dist/safe-bash-command-wkhtmltopdf/settings.js +0 -35
  59. package/dist/safe-bash-command-wkhtmltopdf/switches.js +0 -127
  60. package/dist/safe-bash-command-wkhtmltopdf/values.js +0 -66
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["errors.js", "limits.js", "settings.js", "values.js", "switches.js", "parser.js", "command.js", "engine.js", "outcome.js", "resources.js"],
4
+ "sourcesContent": ["export class WkhtmltopdfError extends Error {\n code;\n option;\n exitCode = 1;\n constructor(code, message, option) {\n super(message);\n this.code = code;\n this.option = option;\n this.name = \"WkhtmltopdfError\";\n }\n}\n", "import { WkhtmltopdfError } from \"./errors.js\";\n// Admission counts input UTF-8 bytes without allocating an encoded copy.\n// maxWork covers scans, option dispatch and cloned retained settings/entries.\nexport class ParseBudget {\n options;\n work = 0;\n bytes = 0;\n objects = 0;\n limits;\n constructor(options) {\n this.options = options;\n this.checkCancellation();\n this.limits = {\n maxArguments: options.limits?.maxArguments,\n maxTextBytes: options.limits?.maxTextBytes,\n maxObjects: options.limits?.maxObjects,\n maxWork: options.limits?.maxWork,\n };\n for (const value of Object.values(this.limits)) {\n if (!Number.isSafeInteger(value) || value < 1) {\n throw new WkhtmltopdfError(\"INVALID_VALUE\", \"Parser limits must be positive safe integers\");\n }\n }\n }\n checkCancellation() {\n if (this.options.signal?.aborted)\n throw this.options.signal.reason;\n }\n step(amount = 1) {\n this.checkCancellation();\n if (amount > this.limits.maxWork - this.work) {\n throw new WkhtmltopdfError(\"LIMIT_EXCEEDED\", \"Parser work limit exceeded\");\n }\n this.work += amount;\n }\n admitArguments(count) {\n this.step();\n if (count > this.limits.maxArguments) {\n throw new WkhtmltopdfError(\"LIMIT_EXCEEDED\", \"Parser argument limit exceeded\");\n }\n }\n admitText(text) {\n for (let i = 0; i < text.length; i++) {\n this.step();\n const code = text.charCodeAt(i);\n let size = code < 128 ? 1 : code < 2048 ? 2 : 3;\n if (code >= 0xd800 && code <= 0xdbff) {\n const next = text.charCodeAt(i + 1);\n if (next >= 0xdc00 && next <= 0xdfff) {\n size = 4;\n i++;\n this.step();\n }\n }\n if (size > this.limits.maxTextBytes - this.bytes) {\n throw new WkhtmltopdfError(\"LIMIT_EXCEEDED\", \"Parser text byte limit exceeded\");\n }\n this.bytes += size;\n if (code === 0)\n throw new WkhtmltopdfError(\"INVALID_VALUE\", \"NUL is not admitted in CLI text\");\n }\n }\n admitObject(replacementCount) {\n this.step(64 + replacementCount * 2);\n if (++this.objects > this.limits.maxObjects) {\n throw new WkhtmltopdfError(\"LIMIT_EXCEEDED\", \"Parser object limit exceeded\");\n }\n }\n}\n", "export function createGlobalSettings() {\n return {\n logLevel: \"info\", orientation: \"Portrait\", pageSize: \"A4\", dpi: 96,\n copies: 1, collate: true, outline: true, outlineDepth: 4,\n imageDPI: 600, imageQuality: 94, useCompression: true,\n colorMode: \"color\", resolution: \"high\", documentTitle: \"\",\n marginTop: { value: -1, unit: \"mm\" },\n marginBottom: { value: -1, unit: \"mm\" },\n marginLeft: { value: 10, unit: \"mm\" },\n marginRight: { value: 10, unit: \"mm\" },\n pageHeight: { value: -1, unit: \"mm\" },\n pageWidth: { value: -1, unit: \"mm\" },\n pageOffset: 0, resolveRelativeLinks: true, viewportSize: \"\",\n readArgsFromStdin: false, action: \"\",\n };\n}\nexport function createPageSettings() {\n return {\n header: { fontSize: 12, fontName: \"Arial\", left: \"\", right: \"\", center: \"\", line: false, htmlUrl: \"\", spacing: 0 },\n footer: { fontSize: 12, fontName: \"Arial\", left: \"\", right: \"\", center: \"\", line: false, htmlUrl: \"\", spacing: 0 },\n toc: { useDottedLines: true, captionText: \"Table of Contents\", forwardLinks: true, backLinks: false, indentation: \"1em\", fontScale: Math.fround(0.8) },\n web: { background: true, loadImages: true, enableJavascript: true, enableIntelligentShrinking: true, minimumFontSize: -1, defaultEncoding: \"\", enablePlugins: false },\n load: { jsdelay: 200, zoomFactor: 1, blockLocalFileAccess: true, stopSlowScripts: true, loadErrorHandling: \"abort\", mediaLoadErrorHandling: \"ignore\", printMediaType: false },\n includeInOutline: true, pagesCount: true, produceForms: false,\n useLocalLinks: true, useExternalLinks: true,\n replacements: [],\n };\n}\nexport function clonePageSettings(settings) {\n return {\n ...settings, header: { ...settings.header }, footer: { ...settings.footer },\n toc: { ...settings.toc }, web: { ...settings.web }, load: { ...settings.load },\n replacements: settings.replacements.map(([key, value]) => [key, value]),\n };\n}\n", "import { WkhtmltopdfError } from \"./errors.js\";\nexport function integer(text, min, max) {\n const value = text.trim();\n let index = value[0] === \"+\" || value[0] === \"-\" ? 1 : 0;\n if (index === value.length)\n throw new WkhtmltopdfError(\"INVALID_VALUE\", \"Expected an integer\");\n for (; index < value.length; index++) {\n if (value[index] < \"0\" || value[index] > \"9\") {\n throw new WkhtmltopdfError(\"INVALID_VALUE\", \"Expected a decimal integer\");\n }\n }\n const result = Number(value);\n if (!Number.isSafeInteger(result) || result < min || result > max) {\n throw new WkhtmltopdfError(\"INVALID_VALUE\", \"Integer is outside the admitted range\");\n }\n return result;\n}\nexport function float32(text, positive) {\n const value = text.trim();\n let digits = 0;\n for (const character of value) {\n if (character >= \"0\" && character <= \"9\")\n digits++;\n else if (!\"+-.eE\".includes(character)) {\n throw new WkhtmltopdfError(\"INVALID_VALUE\", \"Expected a decimal float\");\n }\n }\n const result = Math.fround(Number(value));\n if (!digits || !Number.isFinite(result) || (positive ? result <= 0 : result < 0)) {\n throw new WkhtmltopdfError(\"INVALID_VALUE\", \"Float is outside the admitted finite binary32 range\");\n }\n return result;\n}\nexport function choice(text, values) {\n const result = values.find(value => value.toLowerCase() === text.toLowerCase());\n if (result === undefined)\n throw new WkhtmltopdfError(\"INVALID_VALUE\", \"Unknown enumerated value\");\n return result;\n}\nexport function length(text) {\n let index = 0;\n while (text[index] !== undefined && text[index] >= \"0\" && text[index] <= \"9\")\n index++;\n if (text[index] === \".\")\n index++;\n while (text[index] !== undefined && text[index] >= \"0\" && text[index] <= \"9\")\n index++;\n const number = text.slice(0, index);\n const value = Number(number);\n if (!number || number === \".\" || !Number.isFinite(value)) {\n throw new WkhtmltopdfError(\"INVALID_VALUE\", \"Expected an unsigned finite length\");\n }\n const units = {\n \"\": [\"mm\", 1], mm: [\"mm\", 1], millimeter: [\"mm\", 1],\n cm: [\"mm\", 10], centimeter: [\"mm\", 10], m: [\"mm\", 1000], meter: [\"mm\", 1000],\n in: [\"in\", 1], inch: [\"in\", 1], pt: [\"pt\", 1], point: [\"pt\", 1],\n px: [\"px\", 1], pixel: [\"px\", 1], pc: [\"pc\", 1], pica: [\"pc\", 1],\n didot: [\"didot\", 1], cicero: [\"cicero\", 1],\n };\n const suffix = text.slice(index).toLowerCase();\n const entry = Object.hasOwn(units, suffix) ? units[suffix] : undefined;\n if (!entry || !Number.isFinite(value * entry[1])) {\n throw new WkhtmltopdfError(\"INVALID_VALUE\", \"Unknown or overflowing length unit\");\n }\n return { value: value * entry[1], unit: entry[0] };\n}\n", "import { integer, float32, length, choice } from \"./values.js\";\n// Source-derived inventory; parser admission does not qualify renderer support.\nconst declarations = [\n { name: \"--help\", short: \"h\", scope: \"global\", arity: 0, qtPatched: false, disposition: \"static\", apply: (_g, _p, _a) => { _g.action = \"help\"; } },\n { name: \"--version\", short: \"V\", scope: \"global\", arity: 0, qtPatched: false, disposition: \"static\", apply: (_g, _p, _a) => { _g.action = \"version\"; } },\n { name: \"--license\", short: \"\", scope: \"global\", arity: 0, qtPatched: false, disposition: \"static\", apply: (_g, _p, _a) => { _g.action = \"license\"; } },\n { name: \"--extended-help\", short: \"H\", scope: \"global\", arity: 0, qtPatched: false, disposition: \"static\", apply: (_g, _p, _a) => { _g.action = \"extended-help\"; } },\n { name: \"--manpage\", short: \"\", scope: \"global\", arity: 0, qtPatched: false, disposition: \"static\", apply: (_g, _p, _a) => { _g.action = \"manpage\"; } },\n { name: \"--htmldoc\", short: \"\", scope: \"global\", arity: 0, qtPatched: false, disposition: \"static\", apply: (_g, _p, _a) => { _g.action = \"htmldoc\"; } },\n { name: \"--readme\", short: \"\", scope: \"global\", arity: 0, qtPatched: false, disposition: \"static\", apply: (_g, _p, _a) => { _g.action = \"readme\"; } },\n { name: \"--quiet\", short: \"q\", scope: \"global\", arity: 0, qtPatched: false, disposition: \"static\", apply: (_g, _p, _a) => { _g.logLevel = \"none\"; } },\n { name: \"--log-level\", short: \"\", scope: \"global\", arity: 1, qtPatched: false, disposition: \"static\", apply: (_g, _p, _a) => { _g.logLevel = choice(_a[0], [\"none\", \"error\", \"warn\", \"info\", \"debug\"]); } },\n { name: \"--no-collate\", short: \"\", scope: \"global\", arity: 0, qtPatched: false, disposition: \"static\", apply: (_g, _p, _a) => { _g.collate = false; } },\n { name: \"--collate\", short: \"\", scope: \"global\", arity: 0, qtPatched: false, disposition: \"static\", apply: (_g, _p, _a) => { _g.collate = true; } },\n { name: \"--copies\", short: \"\", scope: \"global\", arity: 1, qtPatched: false, disposition: \"static\", apply: (_g, _p, _a) => { _g.copies = integer(_a[0], 1, 2147483647); } },\n { name: \"--orientation\", short: \"O\", scope: \"global\", arity: 1, qtPatched: false, disposition: \"static\", apply: (_g, _p, _a) => { _g.orientation = choice(_a[0], [\"Portrait\", \"Landscape\"]); } },\n { name: \"--page-size\", short: \"s\", scope: \"global\", arity: 1, qtPatched: false, disposition: \"static\", apply: (_g, _p, _a) => { _g.pageSize = choice(_a[0], [\"A0\", \"A1\", \"A2\", \"A3\", \"A4\", \"A5\", \"A6\", \"A7\", \"A8\", \"A9\", \"B0\", \"B1\", \"B2\", \"B3\", \"B4\", \"B5\", \"B6\", \"B7\", \"B8\", \"B9\", \"B10\", \"C5E\", \"Comm10E\", \"DLE\", \"Executive\", \"Folio\", \"Ledger\", \"Legal\", \"Letter\", \"Tabloid\"]); } },\n { name: \"--grayscale\", short: \"g\", scope: \"global\", arity: 0, qtPatched: false, disposition: \"static\", apply: (_g, _p, _a) => { _g.colorMode = \"grayscale\"; } },\n { name: \"--lowquality\", short: \"l\", scope: \"global\", arity: 0, qtPatched: false, disposition: \"static\", apply: (_g, _p, _a) => { _g.resolution = \"screen\"; } },\n { name: \"--title\", short: \"\", scope: \"global\", arity: 1, qtPatched: false, disposition: \"static\", apply: (_g, _p, _a) => { _g.documentTitle = _a[0]; } },\n { name: \"--read-args-from-stdin\", short: \"\", scope: \"global\", arity: 0, qtPatched: false, disposition: \"static\", apply: (_g, _p, _a) => { _g.readArgsFromStdin = true; } },\n { name: \"--margin-bottom\", short: \"B\", scope: \"global\", arity: 1, qtPatched: false, disposition: \"static\", apply: (_g, _p, _a) => { _g.marginBottom = length(_a[0]); } },\n { name: \"--margin-left\", short: \"L\", scope: \"global\", arity: 1, qtPatched: false, disposition: \"static\", apply: (_g, _p, _a) => { _g.marginLeft = length(_a[0]); } },\n { name: \"--margin-right\", short: \"R\", scope: \"global\", arity: 1, qtPatched: false, disposition: \"static\", apply: (_g, _p, _a) => { _g.marginRight = length(_a[0]); } },\n { name: \"--margin-top\", short: \"T\", scope: \"global\", arity: 1, qtPatched: false, disposition: \"static\", apply: (_g, _p, _a) => { _g.marginTop = length(_a[0]); } },\n { name: \"--dpi\", short: \"d\", scope: \"global\", arity: 1, qtPatched: false, disposition: \"static\", apply: (_g, _p, _a) => { _g.dpi = integer(_a[0], 1, 2147483647); } },\n { name: \"--page-height\", short: \"\", scope: \"global\", arity: 1, qtPatched: false, disposition: \"static\", apply: (_g, _p, _a) => { _g.pageHeight = length(_a[0]); } },\n { name: \"--page-width\", short: \"\", scope: \"global\", arity: 1, qtPatched: false, disposition: \"static\", apply: (_g, _p, _a) => { _g.pageWidth = length(_a[0]); } },\n { name: \"--cookie-jar\", short: \"\", scope: \"global\", arity: 1, qtPatched: false, disposition: \"resource\" },\n { name: \"--image-quality\", short: \"\", scope: \"global\", arity: 1, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _g.imageQuality = integer(_a[0], 0, 100); } },\n { name: \"--image-dpi\", short: \"\", scope: \"global\", arity: 1, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _g.imageDPI = integer(_a[0], 1, 2147483647); } },\n { name: \"--no-pdf-compression\", short: \"\", scope: \"global\", arity: 0, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _g.useCompression = false; } },\n { name: \"--use-xserver\", short: \"\", scope: \"global\", arity: 0, qtPatched: true, disposition: \"excluded\" },\n { name: \"--outline\", short: \"\", scope: \"global\", arity: 0, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _g.outline = true; } },\n { name: \"--no-outline\", short: \"\", scope: \"global\", arity: 0, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _g.outline = false; } },\n { name: \"--outline-depth\", short: \"\", scope: \"global\", arity: 1, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _g.outlineDepth = integer(_a[0], 0, 2147483647); } },\n { name: \"--dump-outline\", short: \"\", scope: \"global\", arity: 1, qtPatched: true, disposition: \"resource\" },\n { name: \"--dump-default-toc-xsl\", short: \"\", scope: \"global\", arity: 0, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _g.action = \"dump-default-toc-xsl\"; } },\n { name: \"--default-header\", short: \"\", scope: \"page\", arity: 0, qtPatched: true, disposition: \"static\", apply: (_g, _p) => { _p.header.left = \"[webpage]\"; _p.header.right = \"[page]/[topage]\"; _p.header.line = true; _g.marginTop = { value: 20, unit: \"mm\" }; } },\n { name: \"--viewport-size\", short: \"\", scope: \"page\", arity: 1, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _g.viewportSize = _a[0]; } },\n { name: \"--enable-plugins\", short: \"\", scope: \"page\", arity: 0, qtPatched: false, disposition: \"excluded\" },\n { name: \"--disable-plugins\", short: \"\", scope: \"page\", arity: 0, qtPatched: false, disposition: \"static\", apply: (_g, _p, _a) => { _p.web.enablePlugins = false; } },\n { name: \"--minimum-font-size\", short: \"\", scope: \"page\", arity: 1, qtPatched: false, disposition: \"static\", apply: (_g, _p, _a) => { _p.web.minimumFontSize = integer(_a[0], 1, 2147483647); } },\n { name: \"--user-style-sheet\", short: \"\", scope: \"page\", arity: 1, qtPatched: false, disposition: \"resource\" },\n { name: \"--no-images\", short: \"\", scope: \"page\", arity: 0, qtPatched: false, disposition: \"static\", apply: (_g, _p, _a) => { _p.web.loadImages = false; } },\n { name: \"--images\", short: \"\", scope: \"page\", arity: 0, qtPatched: false, disposition: \"static\", apply: (_g, _p, _a) => { _p.web.loadImages = true; } },\n { name: \"--disable-javascript\", short: \"n\", scope: \"page\", arity: 0, qtPatched: false, disposition: \"static\", apply: (_g, _p, _a) => { _p.web.enableJavascript = false; } },\n { name: \"--enable-javascript\", short: \"\", scope: \"page\", arity: 0, qtPatched: false, disposition: \"harness\" },\n { name: \"--encoding\", short: \"\", scope: \"page\", arity: 1, qtPatched: false, disposition: \"static\", apply: (_g, _p, _a) => { _p.web.defaultEncoding = _a[0]; } },\n { name: \"--no-background\", short: \"\", scope: \"page\", arity: 0, qtPatched: false, disposition: \"static\", apply: (_g, _p, _a) => { _p.web.background = false; } },\n { name: \"--background\", short: \"\", scope: \"page\", arity: 0, qtPatched: false, disposition: \"static\", apply: (_g, _p, _a) => { _p.web.background = true; } },\n { name: \"--include-in-outline\", short: \"\", scope: \"page\", arity: 0, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _p.includeInOutline = true; } },\n { name: \"--exclude-from-outline\", short: \"\", scope: \"page\", arity: 0, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _p.includeInOutline = false; } },\n { name: \"--disable-smart-shrinking\", short: \"\", scope: \"page\", arity: 0, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _p.web.enableIntelligentShrinking = false; } },\n { name: \"--enable-smart-shrinking\", short: \"\", scope: \"page\", arity: 0, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _p.web.enableIntelligentShrinking = true; } },\n { name: \"--print-media-type\", short: \"\", scope: \"page\", arity: 0, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _p.load.printMediaType = true; } },\n { name: \"--no-print-media-type\", short: \"\", scope: \"page\", arity: 0, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _p.load.printMediaType = false; } },\n { name: \"--enable-forms\", short: \"\", scope: \"page\", arity: 0, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _p.produceForms = true; } },\n { name: \"--disable-forms\", short: \"\", scope: \"page\", arity: 0, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _p.produceForms = false; } },\n { name: \"--disable-internal-links\", short: \"\", scope: \"page\", arity: 0, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _p.useLocalLinks = false; } },\n { name: \"--enable-internal-links\", short: \"\", scope: \"page\", arity: 0, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _p.useLocalLinks = true; } },\n { name: \"--disable-external-links\", short: \"\", scope: \"page\", arity: 0, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _p.useExternalLinks = false; } },\n { name: \"--enable-external-links\", short: \"\", scope: \"page\", arity: 0, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _p.useExternalLinks = true; } },\n { name: \"--resolve-relative-links\", short: \"\", scope: \"page\", arity: 0, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _g.resolveRelativeLinks = true; } },\n { name: \"--keep-relative-links\", short: \"\", scope: \"page\", arity: 0, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _g.resolveRelativeLinks = false; } },\n { name: \"--enable-toc-back-links\", short: \"\", scope: \"page\", arity: 0, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _p.toc.backLinks = true; } },\n { name: \"--disable-toc-back-links\", short: \"\", scope: \"page\", arity: 0, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _p.toc.backLinks = false; } },\n { name: \"--proxy\", short: \"p\", scope: \"page\", arity: 1, qtPatched: false, disposition: \"resource\" },\n { name: \"--proxy-hostname-lookup\", short: \"\", scope: \"page\", arity: 0, qtPatched: false, disposition: \"resource\" },\n { name: \"--bypass-proxy-for\", short: \"\", scope: \"page\", arity: 1, qtPatched: false, disposition: \"resource\" },\n { name: \"--username\", short: \"\", scope: \"page\", arity: 1, qtPatched: false, disposition: \"resource\" },\n { name: \"--password\", short: \"\", scope: \"page\", arity: 1, qtPatched: false, disposition: \"resource\" },\n { name: \"--ssl-key-path\", short: \"\", scope: \"page\", arity: 1, qtPatched: false, disposition: \"resource\" },\n { name: \"--ssl-key-password\", short: \"\", scope: \"page\", arity: 1, qtPatched: false, disposition: \"resource\" },\n { name: \"--ssl-crt-path\", short: \"\", scope: \"page\", arity: 1, qtPatched: false, disposition: \"resource\" },\n { name: \"--load-error-handling\", short: \"\", scope: \"page\", arity: 1, qtPatched: false, disposition: \"static\", apply: (_g, _p, _a) => { _p.load.loadErrorHandling = choice(_a[0], [\"abort\", \"skip\", \"ignore\"]); } },\n { name: \"--load-media-error-handling\", short: \"\", scope: \"page\", arity: 1, qtPatched: false, disposition: \"static\", apply: (_g, _p, _a) => { _p.load.mediaLoadErrorHandling = choice(_a[0], [\"abort\", \"skip\", \"ignore\"]); } },\n { name: \"--custom-header\", short: \"\", scope: \"page\", arity: 2, qtPatched: false, disposition: \"resource\" },\n { name: \"--custom-header-propagation\", short: \"\", scope: \"page\", arity: 0, qtPatched: false, disposition: \"resource\" },\n { name: \"--no-custom-header-propagation\", short: \"\", scope: \"page\", arity: 0, qtPatched: false, disposition: \"resource\" },\n { name: \"--javascript-delay\", short: \"\", scope: \"page\", arity: 1, qtPatched: false, disposition: \"harness\" },\n { name: \"--window-status\", short: \"\", scope: \"page\", arity: 1, qtPatched: false, disposition: \"harness\" },\n { name: \"--zoom\", short: \"\", scope: \"page\", arity: 1, qtPatched: false, disposition: \"static\", apply: (_g, _p, _a) => { _p.load.zoomFactor = float32(_a[0], true); } },\n { name: \"--cookie\", short: \"\", scope: \"page\", arity: 2, qtPatched: false, disposition: \"resource\" },\n { name: \"--post\", short: \"\", scope: \"page\", arity: 2, qtPatched: false, disposition: \"resource\" },\n { name: \"--post-file\", short: \"\", scope: \"page\", arity: 2, qtPatched: false, disposition: \"resource\" },\n { name: \"--disable-local-file-access\", short: \"\", scope: \"page\", arity: 0, qtPatched: false, disposition: \"static\", apply: (_g, _p, _a) => { _p.load.blockLocalFileAccess = true; } },\n { name: \"--enable-local-file-access\", short: \"\", scope: \"page\", arity: 0, qtPatched: false, disposition: \"resource\" },\n { name: \"--allow\", short: \"\", scope: \"page\", arity: 1, qtPatched: false, disposition: \"resource\" },\n { name: \"--cache-dir\", short: \"\", scope: \"page\", arity: 1, qtPatched: false, disposition: \"resource\" },\n { name: \"--debug-javascript\", short: \"\", scope: \"page\", arity: 0, qtPatched: false, disposition: \"harness\" },\n { name: \"--no-debug-javascript\", short: \"\", scope: \"page\", arity: 0, qtPatched: false, disposition: \"harness\" },\n { name: \"--stop-slow-scripts\", short: \"\", scope: \"page\", arity: 0, qtPatched: false, disposition: \"harness\" },\n { name: \"--no-stop-slow-scripts\", short: \"\", scope: \"page\", arity: 0, qtPatched: false, disposition: \"harness\" },\n { name: \"--run-script\", short: \"\", scope: \"page\", arity: 1, qtPatched: false, disposition: \"harness\" },\n { name: \"--checkbox-svg\", short: \"\", scope: \"page\", arity: 1, qtPatched: false, disposition: \"resource\" },\n { name: \"--checkbox-checked-svg\", short: \"\", scope: \"page\", arity: 1, qtPatched: false, disposition: \"resource\" },\n { name: \"--radiobutton-svg\", short: \"\", scope: \"page\", arity: 1, qtPatched: false, disposition: \"resource\" },\n { name: \"--radiobutton-checked-svg\", short: \"\", scope: \"page\", arity: 1, qtPatched: false, disposition: \"resource\" },\n { name: \"--page-offset\", short: \"\", scope: \"page\", arity: 1, qtPatched: false, disposition: \"static\", apply: (_g, _p, _a) => { _g.pageOffset = integer(_a[0], -2147483648, 2147483647); } },\n { name: \"--footer-center\", short: \"\", scope: \"page\", arity: 1, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _p.footer.center = _a[0]; } },\n { name: \"--footer-font-name\", short: \"\", scope: \"page\", arity: 1, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _p.footer.fontName = _a[0]; } },\n { name: \"--footer-font-size\", short: \"\", scope: \"page\", arity: 1, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _p.footer.fontSize = integer(_a[0], 1, 2147483647); } },\n { name: \"--footer-left\", short: \"\", scope: \"page\", arity: 1, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _p.footer.left = _a[0]; } },\n { name: \"--footer-line\", short: \"\", scope: \"page\", arity: 0, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _p.footer.line = true; } },\n { name: \"--no-footer-line\", short: \"\", scope: \"page\", arity: 0, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _p.footer.line = false; } },\n { name: \"--footer-right\", short: \"\", scope: \"page\", arity: 1, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _p.footer.right = _a[0]; } },\n { name: \"--footer-spacing\", short: \"\", scope: \"page\", arity: 1, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _p.footer.spacing = float32(_a[0], false); } },\n { name: \"--footer-html\", short: \"\", scope: \"page\", arity: 1, qtPatched: true, disposition: \"resource\" },\n { name: \"--header-center\", short: \"\", scope: \"page\", arity: 1, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _p.header.center = _a[0]; } },\n { name: \"--header-font-name\", short: \"\", scope: \"page\", arity: 1, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _p.header.fontName = _a[0]; } },\n { name: \"--header-font-size\", short: \"\", scope: \"page\", arity: 1, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _p.header.fontSize = integer(_a[0], 1, 2147483647); } },\n { name: \"--header-left\", short: \"\", scope: \"page\", arity: 1, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _p.header.left = _a[0]; } },\n { name: \"--header-line\", short: \"\", scope: \"page\", arity: 0, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _p.header.line = true; } },\n { name: \"--no-header-line\", short: \"\", scope: \"page\", arity: 0, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _p.header.line = false; } },\n { name: \"--header-right\", short: \"\", scope: \"page\", arity: 1, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _p.header.right = _a[0]; } },\n { name: \"--header-spacing\", short: \"\", scope: \"page\", arity: 1, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _p.header.spacing = float32(_a[0], false); } },\n { name: \"--header-html\", short: \"\", scope: \"page\", arity: 1, qtPatched: true, disposition: \"resource\" },\n { name: \"--replace\", short: \"\", scope: \"page\", arity: 2, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _p.replacements.push([_a[0], _a[1]]); } },\n { name: \"--xsl-style-sheet\", short: \"\", scope: \"toc\", arity: 1, qtPatched: true, disposition: \"resource\" },\n { name: \"--toc-header-text\", short: \"\", scope: \"toc\", arity: 1, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _p.toc.captionText = _a[0]; } },\n { name: \"--disable-toc-links\", short: \"\", scope: \"toc\", arity: 0, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _p.toc.forwardLinks = false; } },\n { name: \"--disable-dotted-lines\", short: \"\", scope: \"toc\", arity: 0, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _p.toc.useDottedLines = false; } },\n { name: \"--toc-text-size-shrink\", short: \"\", scope: \"toc\", arity: 1, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _p.toc.fontScale = float32(_a[0], true); } },\n { name: \"--toc-level-indentation\", short: \"\", scope: \"toc\", arity: 1, qtPatched: true, disposition: \"static\", apply: (_g, _p, _a) => { _p.toc.indentation = _a[0]; } },\n];\nexport const switches = Object.freeze(declarations.map(entry => Object.freeze(entry)));\n", "import { WkhtmltopdfError } from \"./errors.js\";\nimport { ParseBudget } from \"./limits.js\";\nimport { clonePageSettings, createGlobalSettings, createPageSettings } from \"./settings.js\";\nimport { switches } from \"./switches.js\";\nconst longOptions = new Map(switches.map(entry => [entry.name, entry]));\nconst shortOptions = new Map(switches.filter(entry => entry.short).map(entry => [entry.short, entry]));\n/** Literal Unicode SDK argv, excluding argv[0]. No execution or resource acquisition. */\nexport function parseInvocation(argv, options) {\n const budget = new ParseBudget(options);\n budget.admitArguments(argv.length);\n for (const arg of argv)\n budget.admitText(arg);\n budget.step(64);\n const global = createGlobalSettings();\n const defaults = createPageSettings();\n const objects = [];\n let index = 0;\n let literal = false;\n const parseOptions = (settings, scope) => {\n if (literal)\n return;\n while (index < (scope === \"leading\" ? argv.length : argv.length - 1)) {\n const token = argv[index];\n if (!token.startsWith(\"-\") || token === \"-\")\n break;\n budget.step();\n if (token === \"--\" && options.endOfOptions) {\n index++;\n literal = true;\n break;\n }\n if (token === \"--\" || token.startsWith(\"--0\")) {\n throw new WkhtmltopdfError(\"UNQUALIFIED_QUIRK\", \"Pinned default-mode sentinel is unqualified and not admitted\", token);\n }\n index++;\n const names = token.startsWith(\"--\") ? [token] : token.slice(1);\n for (const name of names) {\n budget.step();\n const entry = token.startsWith(\"--\") ? longOptions.get(name) : shortOptions.get(name);\n if (!entry)\n throw new WkhtmltopdfError(\"UNKNOWN_OPTION\", \"Unknown switch\", token);\n const allowed = entry.scope === \"page\" || (entry.scope === \"global\" ? scope === \"leading\" : scope === \"toc\");\n if (!allowed)\n throw new WkhtmltopdfError(\"OPTION_LOCATION\", \"Switch is in an incorrect object scope\", entry.name);\n if (entry.arity > argv.length - index) {\n throw new WkhtmltopdfError(\"MISSING_OPERAND\", \"Switch is missing an operand\", entry.name);\n }\n if (entry.disposition !== \"static\") {\n throw new WkhtmltopdfError(\"UNSUPPORTED_CAPABILITY\", `Switch requires unavailable ${entry.disposition} capability`, entry.name);\n }\n budget.step(entry.arity + 1);\n const operands = argv.slice(index, index + entry.arity);\n index += entry.arity;\n try {\n entry.apply(global, settings, operands);\n }\n catch (error) {\n if (error instanceof WkhtmltopdfError)\n throw new WkhtmltopdfError(error.code, error.message, entry.name);\n throw error;\n }\n if (global.action)\n return;\n }\n }\n };\n parseOptions(defaults, \"leading\");\n if (global.action)\n return { mode: \"information\", global, pageDefaults: defaults, objects, output: null };\n if (global.readArgsFromStdin && !options.batchJob)\n return { mode: \"batch\", global, pageDefaults: defaults, objects, output: null };\n while (index < argv.length - 1) {\n budget.admitObject(defaults.replacements.length);\n const settings = clonePageSettings(defaults);\n let kind = \"page\";\n const token = argv[index++];\n let input = token;\n if (token === \"toc\") {\n kind = \"toc\";\n input = null;\n }\n else if (token === \"cover\" || token === \"page\") {\n kind = token;\n if (index >= argv.length - 1) {\n throw new WkhtmltopdfError(\"MISSING_OBJECT\", \"Object requires an input and a final output\");\n }\n input = argv[index++];\n }\n parseOptions(settings, kind === \"toc\" ? \"toc\" : \"page\");\n if (kind === \"cover\") {\n for (const furniture of [settings.header, settings.footer]) {\n furniture.left = furniture.right = furniture.center = furniture.htmlUrl = \"\";\n furniture.line = false;\n }\n settings.includeInOutline = false;\n }\n objects.push({ kind, input, settings });\n }\n if (!objects.length || index !== argv.length - 1) {\n throw new WkhtmltopdfError(\"MISSING_OBJECT\", \"Expected at least one input object and exactly one output\");\n }\n const margins = [global.marginTop, global.marginBottom, global.marginLeft, global.marginRight];\n if (margins.some(margin => margin.unit !== global.marginLeft.unit)) {\n throw new WkhtmltopdfError(\"MARGIN_UNITS\", \"All margins must use the same normalized unit\");\n }\n return { mode: \"conversion\", global, pageDefaults: defaults, objects, output: argv[index] };\n}\n/** Pinned batch state tokenizer; no shell evaluation, expansion or quote errors. */\nexport function tokenizeBatchLine(line, options) {\n const budget = new ParseBudget(options);\n budget.admitText(line);\n const tokens = [];\n let token = \"\";\n let quote = \"\";\n let escaped = false;\n const emit = () => {\n if (!token)\n return;\n budget.admitArguments(tokens.length + 1);\n tokens.push(token);\n token = \"\";\n };\n for (const character of line) {\n budget.step();\n if (escaped) {\n token += character;\n escaped = false;\n }\n else if (character === \"\\\\\")\n escaped = true;\n else if (quote) {\n if (character === quote)\n quote = \"\";\n else\n token += character;\n }\n else if (character === \"'\" || character === '\"')\n quote = character;\n else if (\" \\t\\r\\n\".includes(character))\n emit();\n else\n token += character;\n }\n emit();\n return tokens;\n}\n", "import { commandRuntimeIdentity, getCommandArguments } from \"safe-bash-contracts/command\";\nimport { readBytes, writeBytes } from \"safe-bash-contracts/io\";\nimport { shellValueByteLength } from \"safe-bash-contracts/value\";\nimport { FsError } from \"safe-bash-contracts/errors\";\nimport { createOutputOperation } from \"safe-bash-contracts/output\";\nimport { basename, compareEntries, dirname, resolvePath } from \"@poe-code/safe-fs/core\";\nimport { WkhtmltopdfError } from \"./errors.js\";\nimport { requireRendererFeatures } from \"./engine.js\";\nimport { ParseBudget } from \"./limits.js\";\nimport { conversionOutcome } from \"./outcome.js\";\nimport { parseInvocation, tokenizeBatchLine } from \"./parser.js\";\nimport { withResources } from \"./resources.js\";\nexport const wkhtmltopdfLimits = Object.freeze({\n parse: Object.freeze({ maxArguments: 1024, maxTextBytes: 65536, maxObjects: 64, maxWork: 1048576 }),\n resources: Object.freeze({ maxInputBytes: 16777216, maxDecodedBytes: 16777216, maxRetainedBytes: 33554432, maxWork: 67108864, maxResources: 128 }),\n maxOutputBytes: 16777216, maxOutputChunks: 65536, maxBatchJobs: 128,\n});\nconst encoder = new TextEncoder();\nconst decoder = new TextDecoder(\"utf-8\", { fatal: true, ignoreBOM: true });\nconst typedArrayPrototype = Object.getPrototypeOf(Uint8Array.prototype);\nconst byteType = Object.getOwnPropertyDescriptor(typedArrayPrototype, Symbol.toStringTag).get;\nconst byteLength = Object.getOwnPropertyDescriptor(typedArrayPrototype, \"byteLength\").get;\n/** The SDK uses exactly the CLI's literal argument model, signals and destinations. */\nexport async function runWkhtmltopdf(context, options) {\n context.signal.throwIfAborted();\n const controller = new AbortController();\n const signal = controller.signal;\n let opening;\n let closing;\n let cleanupPromise;\n let resourceRun;\n let stdout;\n let stderr;\n const retire = () => {\n if (!opening)\n return Promise.resolve();\n closing ??= opening.then(document => document.close(), () => { });\n return closing;\n };\n const onAbort = () => controller.abort(context.signal.reason);\n const cleanup = () => {\n cleanupPromise ??= (async () => {\n controller.abort(new WkhtmltopdfError(\"INVALID_VALUE\", \"Invocation has ended\"));\n context.signal.removeEventListener(\"abort\", onAbort);\n const drained = await Promise.allSettled([\n retire(), resourceRun?.then(() => { }, () => { }), stdout?.close(), stderr?.close(),\n ]);\n const failures = drained.filter(value => value.status === \"rejected\").map(value => value.reason);\n if (failures.length)\n throw new AggregateError(failures, \"Invocation cleanup failed\");\n })();\n return cleanupPromise;\n };\n // Registration precedes argv copies, input opens, renderer acquisition and output.\n context.registerCleanup?.(cleanup);\n let primary = false;\n let failure;\n let result;\n try {\n context.signal.addEventListener(\"abort\", onAbort, { once: true });\n if (context.signal.aborted)\n onAbort();\n signal.throwIfAborted();\n stdout = createOutputOperation({ signal, registerCleanup: callback => context.registerCleanup?.(callback) }, context.stdout);\n stderr = createOutputOperation({ signal, registerCleanup: callback => context.registerCleanup?.(callback) }, context.stderr);\n const limits = Object.freeze({\n ...options.limits, parse: Object.freeze({ ...options.limits.parse }), resources: Object.freeze({ ...options.limits.resources }),\n });\n for (const value of [limits.maxOutputBytes, limits.maxOutputChunks, limits.maxBatchJobs]) {\n if (!Number.isSafeInteger(value) || value < 1)\n throw new WkhtmltopdfError(\"INVALID_VALUE\", \"Command limits must be positive safe integers\");\n }\n for (const key of [\"maxInputBytes\", \"maxDecodedBytes\", \"maxRetainedBytes\", \"maxWork\", \"maxResources\"]) {\n if (!Number.isSafeInteger(limits.resources[key]) || limits.resources[key] < 1) {\n throw new WkhtmltopdfError(\"INVALID_VALUE\", \"Resource limits must be positive safe integers\");\n }\n }\n // Admit text/argument bounds before materializing carrier byte copies.\n const admission = new ParseBudget({ limits: limits.parse, signal });\n admission.admitArguments(context.args.length);\n for (const arg of context.args)\n admission.admitText(arg);\n const carrier = context.argumentValues === undefined ? undefined : getCommandArguments(context);\n const argv = [];\n let argumentBytes = 0;\n for (let index = 0; index < context.args.length; index++) {\n signal.throwIfAborted();\n if (carrier === undefined || typeof carrier.values[index] === \"string\") {\n argv.push(context.args[index]);\n continue;\n }\n const bytes = carrier.bytes(index);\n if (bytes.byteLength > limits.parse.maxTextBytes - argumentBytes)\n throw new WkhtmltopdfError(\"LIMIT_EXCEEDED\", \"CLI argument byte limit exceeded\");\n argumentBytes += bytes.byteLength;\n try {\n argv.push(decoder.decode(bytes));\n }\n catch {\n throw new WkhtmltopdfError(\"INVALID_VALUE\", \"CLI arguments must be valid UTF-8\");\n }\n }\n const parse = (args, batchJob = false) => parseInvocation(args, { limits: limits.parse, signal, endOfOptions: true, batchJob });\n const initial = parse(argv);\n if (initial.mode === \"information\") {\n let text;\n if (initial.global.action === \"help\" || initial.global.action === \"extended-help\") {\n text = \"Usage: wkhtmltopdf [options] [page|cover input|toc]... output\\nStatic first-party renderer requires an explicit binding. Input/output '-' use stdin/stdout.\\n\";\n }\n else if (initial.global.action === \"version\") {\n text = \"wkhtmltopdf safe static adapter (source 024b2b2bb459dd904d15b911d04c6df4ff2c9031; Qt compatibility unqualified)\\n\";\n }\n else\n throw new WkhtmltopdfError(\"UNSUPPORTED_CAPABILITY\", \"Information action is unavailable in the static profile\", initial.global.action);\n if (shellValueByteLength(text) > limits.maxOutputBytes) {\n throw new WkhtmltopdfError(\"LIMIT_EXCEEDED\", \"Information output byte limit exceeded\");\n }\n await writeBytes(stdout.output, encoder.encode(text), signal);\n result = { kind: \"information\", exitCode: 0 };\n }\n else {\n const renderer = options.renderer;\n if (!renderer)\n throw new WkhtmltopdfError(\"UNSUPPORTED_CAPABILITY\", \"A qualified first-party static renderer binding is required\");\n requireRendererFeatures(renderer.profile, []);\n let outputBytes = 0;\n let outputChunks = 0;\n let jobs = 0;\n let inputBytes = 0;\n let currentInputs = [];\n let produced;\n // Capture the drain promise before synchronous host opens can call cleanup.\n resourceRun = Promise.resolve().then(() => withResources({\n limits: limits.resources, signal,\n vfs: async (reference, readSignal) => {\n if (reference === \"vfs:output\") {\n if (!produced)\n throw new WkhtmltopdfError(\"INVALID_VALUE\", \"No renderer output is active\");\n const document = produced;\n return {\n chunks: (async function* () {\n for await (const chunk of document.chunks) {\n readSignal.throwIfAborted();\n if (byteType.call(chunk) !== \"Uint8Array\")\n throw new WkhtmltopdfError(\"INVALID_VALUE\", \"Renderer must produce byte chunks\");\n const length = byteLength.call(chunk);\n if (++outputChunks > limits.maxOutputChunks || length > limits.maxOutputBytes - outputBytes) {\n throw new WkhtmltopdfError(\"LIMIT_EXCEEDED\", \"PDF output stage limit exceeded\");\n }\n outputBytes += length;\n yield chunk;\n }\n })(),\n close: retire,\n };\n }\n const index = Number(reference.slice(\"vfs:input/\".length));\n const input = currentInputs[index];\n if (input === undefined)\n throw new WkhtmltopdfError(\"INVALID_VALUE\", \"Unknown invocation input identity\");\n if (input === \"-\")\n return {\n chunks: (async function* () {\n for await (const chunk of readBytes(context.stdin, readSignal)) {\n inputBytes += byteLength.call(chunk);\n context.inputBudget?.check(inputBytes);\n yield chunk;\n }\n })(),\n async close() { },\n };\n if (!context.fs.openReadFile)\n throw new WkhtmltopdfError(\"UNSUPPORTED_CAPABILITY\", \"VFS requires bounded read handles\");\n const handle = await context.fs.openReadFile(resolvePath(context.cwd, input), { signal: readSignal });\n let position = 0;\n return {\n chunks: (async function* () {\n for (;;) {\n readSignal.throwIfAborted();\n const chunk = await handle.read(position, Math.min(65536, limits.resources.maxInputBytes, limits.resources.maxDecodedBytes, limits.resources.maxRetainedBytes, Math.max(1, context.inputBudget?.maxBytes ?? limits.resources.maxInputBytes)), { signal: readSignal });\n if (byteType.call(chunk) !== \"Uint8Array\")\n throw new WkhtmltopdfError(\"INVALID_VALUE\", \"VFS must produce byte chunks\");\n const length = byteLength.call(chunk);\n if (!length)\n return;\n inputBytes += length;\n context.inputBudget?.check(inputBytes);\n position += length;\n yield chunk;\n }\n })(),\n close: () => handle.close(),\n };\n },\n }, async (resources) => {\n const convert = async (job, batch) => {\n if (++jobs > limits.maxBatchJobs)\n throw new WkhtmltopdfError(\"LIMIT_EXCEEDED\", \"Batch job limit exceeded\");\n currentInputs = job.objects.map(object => {\n if (object.input === null)\n throw new WkhtmltopdfError(\"UNSUPPORTED_CAPABILITY\", \"TOC requires a qualified outline/XSLT engine\");\n if (batch && object.input === \"-\")\n throw new WkhtmltopdfError(\"UNSUPPORTED_CAPABILITY\", \"Batch conversion cannot share stdin with HTML input\");\n return object.input;\n });\n let destination;\n if (job.output !== \"-\") {\n if (!context.fs.writeFileConditional) {\n throw new WkhtmltopdfError(\"UNSUPPORTED_CAPABILITY\", \"VFS requires conditional file publication\");\n }\n const requested = resolvePath(context.cwd, job.output);\n const parentPath = await context.fs.realpath(dirname(requested), { signal });\n const path = resolvePath(parentPath, basename(requested));\n const parent = await context.fs.stat(parentPath, { signal });\n let expected = null;\n try {\n expected = await context.fs.lstat(path, { signal });\n }\n catch (error) {\n if (!(error instanceof FsError && error.code === \"ENOENT\"))\n throw error;\n }\n // Refuse final symlinks rather than granting authority over their target.\n if (expected !== null && expected.type !== \"file\") {\n throw new WkhtmltopdfError(\"INVALID_VALUE\", \"Output must be a regular VFS file or absent\");\n }\n for (let index = 0; index < currentInputs.length; index++) {\n const input = currentInputs[index];\n if (input === \"-\")\n continue;\n const source = await context.fs.realpath(resolvePath(context.cwd, input), { signal });\n currentInputs[index] = source;\n if (source === path || (expected !== null &&\n await compareEntries(context.fs, source, context.fs, path, { signal }) !== \"distinct\")) {\n throw new WkhtmltopdfError(\"INVALID_VALUE\", \"Input and output VFS identities must be distinct\");\n }\n }\n destination = { path, condition: { parent, expected, signal } };\n }\n const inputs = [];\n for (let index = 0; index < currentInputs.length; index++)\n inputs.push(await resources.load(\"vfs:input/\" + index));\n signal.throwIfAborted();\n opening = Promise.resolve().then(() => {\n signal.throwIfAborted();\n return renderer.open({ job, inputs, signal, limits });\n });\n closing = undefined;\n const document = await opening;\n produced = document;\n signal.throwIfAborted();\n const outcome = conversionOutcome({\n mode: batch ? \"batch\" : \"single\", success: document.success, errorCode: document.errorCode,\n ...(document.networkErrorName === undefined ? {} : { networkErrorName: document.networkErrorName }),\n });\n let pdf;\n if (outcome.exitCode === 0) {\n // The same ledger covers retained HTML, copied PDF chunks, assembly and work.\n pdf = await resources.load(\"vfs:output\");\n }\n await retire();\n opening = undefined;\n closing = undefined;\n produced = undefined;\n signal.throwIfAborted();\n if (outcome.exitCode === 0) {\n if (job.output === \"-\")\n await writeBytes(stdout.output, pdf, signal);\n else\n await context.fs.writeFileConditional(destination.path, pdf, destination.condition);\n }\n else\n await diagnostic({ ...context, stderr: stderr.output }, outcome, signal);\n return outcome;\n };\n let outcome = { exitCode: 0, diagnostic: null };\n if (initial.mode === \"batch\") {\n // Shared resource accounting bounds batch text as well as every job input.\n currentInputs = [\"-\"];\n const bytes = await resources.load(\"vfs:input/0\");\n let text;\n try {\n text = decoder.decode(bytes);\n }\n catch {\n throw new WkhtmltopdfError(\"INVALID_VALUE\", \"Batch input must be valid UTF-8\");\n }\n let start = 0;\n for (let end = 0; end <= text.length; end++) {\n signal.throwIfAborted();\n if (end !== text.length && text[end] !== \"\\n\")\n continue;\n if (end === text.length && start === end)\n break;\n const args = tokenizeBatchLine(text.slice(start, end), { limits: limits.parse, signal });\n const job = parse([...argv, ...args], true);\n if (job.mode !== \"conversion\")\n throw new WkhtmltopdfError(\"UNSUPPORTED_CAPABILITY\", \"Batch lines must describe conversion jobs\");\n outcome = await convert(job, true);\n if (outcome.exitCode !== 0)\n break;\n start = end + 1;\n }\n }\n else\n outcome = await convert(initial, false);\n return { kind: \"conversion\", exitCode: outcome.exitCode, jobs, outcome, usage: resources.usage };\n }));\n result = await resourceRun;\n }\n }\n catch (error) {\n if (context.signal.aborted) {\n primary = true;\n failure = context.signal.reason;\n }\n else if (signal.aborted) {\n primary = true;\n failure = signal.reason;\n }\n else if (error instanceof WkhtmltopdfError || error instanceof FsError) {\n try {\n const option = error instanceof WkhtmltopdfError ? error.option : undefined;\n await writeBytes(stderr.output, encoder.encode(`wkhtmltopdf: ${error.code}${option ? ` (${option})` : \"\"}: ${error.message}\\n`), signal);\n result = { kind: \"rejected\", exitCode: 1, code: error.code };\n }\n catch (writeError) {\n primary = true;\n failure = writeError;\n }\n }\n else {\n primary = true;\n failure = error;\n }\n }\n finally {\n try {\n await cleanup();\n }\n catch (error) {\n if (primary)\n failure = new AggregateError([failure, error], \"Invocation and cleanup failed\");\n else {\n primary = true;\n failure = error;\n }\n }\n }\n if (primary)\n throw failure;\n return result;\n}\nasync function diagnostic(context, outcome, signal) {\n const value = outcome.diagnostic;\n if (!value)\n return;\n const message = value.kind === \"http\" ? `Exit with code ${outcome.exitCode} due to http error: ${value.code} ${value.description}` :\n value.kind === \"network\" ? `Exit with code 1 due to network error: ${value.name ?? \"UnqualifiedNetworkError\"}` : \"Exit with code 1, due to unknown error.\";\n await writeBytes(context.stderr, encoder.encode(message + \"\\n\"), signal);\n}\nexport function createWkhtmltopdfCommand(options = { limits: wkhtmltopdfLimits }) {\n return Object.freeze({\n name: \"wkhtmltopdf\", runtimeIdentity: commandRuntimeIdentity,\n description: \"Bounded static HTML-to-PDF adapter with an explicit first-party renderer\",\n execute: (context) => runWkhtmltopdf(context, options),\n });\n}\nexport const wkhtmltopdfCommand = createWkhtmltopdfCommand();\nexport function wkhtmltopdfCommands(options = { limits: wkhtmltopdfLimits }) {\n const command = createWkhtmltopdfCommand(options);\n return { name: \"wkhtmltopdf-commands\", setup(host) { host.commands.register(command); } };\n}\n", "import { WkhtmltopdfError } from \"./errors.js\";\nconst rendererFeatures = [\n \"html5\", \"computed-css\", \"selectors\", \"css-units\", \"block-inline\", \"font-shaping\",\n \"lists\", \"images\", \"table-spans\", \"pagination\", \"break-rules\", \"widows-orphans\",\n \"positioning\", \"page-furniture\", \"flex\", \"grid\",\n];\n/** Admission only. Never substitutes another layout mode for an absent feature. */\nexport function requireRendererFeatures(profile, required) {\n if (typeof profile.id !== \"string\" || !profile.id || profile.id.length > 128 ||\n profile.features.length > rendererFeatures.length || required.length > rendererFeatures.length) {\n throw new WkhtmltopdfError(\"INVALID_VALUE\", \"Expected a bounded renderer profile and feature requirements\");\n }\n for (const feature of [...profile.features, ...required]) {\n if (!rendererFeatures.includes(feature)) {\n throw new WkhtmltopdfError(\"INVALID_VALUE\", \"Unknown renderer feature\");\n }\n }\n for (const feature of required) {\n if (!profile.features.includes(feature)) {\n throw new WkhtmltopdfError(\"UNSUPPORTED_CAPABILITY\", `Renderer profile ${profile.id} does not support ${feature}`);\n }\n }\n}\n/**\n * Pure final-layout accounting, not HTML layout or PDF emission. Admission completes\n * before retaining output records. No resources are acquired or cleanup hooks needed.\n */\nexport function planPageSequence(objects, options) {\n const checkCancellation = () => { if (options.signal?.aborted)\n throw options.signal.reason; };\n checkCancellation();\n const { maxObjects, maxPhysicalPages, maxWork } = options.limits;\n for (const value of [maxObjects, maxPhysicalPages, maxWork, options.copies]) {\n if (!Number.isSafeInteger(value) || value < 1) {\n throw new WkhtmltopdfError(\"INVALID_VALUE\", \"Page sequence limits and copies must be positive safe integers\");\n }\n }\n if (typeof options.collate !== \"boolean\" || !Number.isInteger(options.pageOffset) ||\n options.pageOffset < -2147483648 || options.pageOffset > 2147483647) {\n throw new WkhtmltopdfError(\"INVALID_VALUE\", \"Expected boolean collate and int32 page offset\");\n }\n if (objects.length > maxObjects || objects.length > maxWork) {\n throw new WkhtmltopdfError(\"LIMIT_EXCEEDED\", \"Page sequence object/work limit exceeded\");\n }\n let outlineTotal = 0;\n let logicalTotal = 0;\n // Division prevents multiplication overflow during copies admission.\n const sourcePageLimit = Math.floor(Math.min(maxPhysicalPages, maxWork - objects.length) / options.copies);\n for (const object of objects) {\n checkCancellation();\n if (!Number.isSafeInteger(object.physicalPages) || object.physicalPages < 0 || typeof object.pagesCount !== \"boolean\") {\n throw new WkhtmltopdfError(\"INVALID_VALUE\", \"Expected a nonnegative safe page count and boolean pagesCount\");\n }\n if (object.physicalPages > sourcePageLimit - outlineTotal) {\n throw new WkhtmltopdfError(\"LIMIT_EXCEEDED\", \"Page sequence physical-page/work limit exceeded\");\n }\n outlineTotal += object.physicalPages;\n if (object.pagesCount)\n logicalTotal += object.physicalPages;\n }\n if (!Number.isSafeInteger(logicalTotal + Math.abs(options.pageOffset) + 1)) {\n throw new WkhtmltopdfError(\"LIMIT_EXCEEDED\", \"Logical page number exceeds checked precision\");\n }\n const passes = options.collate ? options.copies : 1;\n if (outlineTotal > 0) {\n const remainingWork = maxWork - objects.length - outlineTotal * options.copies;\n if (objects.length > Math.floor(remainingWork / passes)) {\n throw new WkhtmltopdfError(\"LIMIT_EXCEEDED\", \"Page sequence repeated traversal work limit exceeded\");\n }\n }\n const pages = [];\n const emit = (objectIndex, pageIndex, copyIndex, logicalPage, outlinePage) => {\n checkCancellation();\n pages.push({ objectIndex, pageIndex, copyIndex, outputPage: pages.length + 1, logicalPage, outlinePage });\n };\n // Empty documents must not loop copies times without charging output work.\n if (outlineTotal === 0)\n return { pages, logicalTotal, outlineTotal };\n for (let pass = 0; pass < passes; pass++) {\n let logicalPage = 1 + options.pageOffset;\n let outlinePage = 1;\n for (let objectIndex = 0; objectIndex < objects.length; objectIndex++) {\n checkCancellation();\n const object = objects[objectIndex];\n for (let pageIndex = 0; pageIndex < object.physicalPages; pageIndex++) {\n if (options.collate)\n emit(objectIndex, pageIndex, pass, logicalPage, outlinePage);\n else\n for (let copyIndex = 0; copyIndex < options.copies; copyIndex++) {\n emit(objectIndex, pageIndex, copyIndex, logicalPage, outlinePage);\n }\n if (object.pagesCount)\n logicalPage++;\n outlinePage++;\n }\n }\n }\n return { pages, logicalTotal, outlineTotal };\n}\n", "import { WkhtmltopdfError } from \"./errors.js\";\nconst httpDescriptions = {\n 400: \"Bad Request\", 401: \"Unauthorized\", 402: \"Payment Required\",\n 403: \"Forbidden\", 404: \"Page not found\", 405: \"Method Not Allowed\",\n 500: \"Internal Server Error\", 501: \"Not Implemented\",\n 503: \"Service Unavailable\", 505: \"HTTP Version Not Supported\",\n};\n/** Pure source-defined status mapping; no renderer or native profile qualification. */\nexport function conversionOutcome(completion) {\n const { mode, success, errorCode, networkErrorName } = completion;\n if ((mode !== \"single\" && mode !== \"batch\") || typeof success !== \"boolean\" ||\n !Number.isInteger(errorCode) || errorCode < 0 || errorCode > 2147483647) {\n throw new WkhtmltopdfError(\"INVALID_VALUE\", \"Expected a conversion mode, boolean success and nonnegative int32 loader code\");\n }\n if (networkErrorName !== undefined) {\n if (typeof networkErrorName !== \"string\" || !networkErrorName.length || networkErrorName.length > 128) {\n throw new WkhtmltopdfError(\"INVALID_VALUE\", \"Network enum name must contain 1\u2013128 ASCII identifier characters\");\n }\n for (const character of networkErrorName) {\n if (!(character >= \"a\" && character <= \"z\") && !(character >= \"A\" && character <= \"Z\") &&\n !(character >= \"0\" && character <= \"9\") && character !== \"_\") {\n throw new WkhtmltopdfError(\"INVALID_VALUE\", \"Network enum name must contain ASCII identifier characters\");\n }\n }\n }\n if (mode === \"batch\")\n return { exitCode: success ? 0 : 1, diagnostic: null };\n if (errorCode >= 1000) {\n return { exitCode: 1, diagnostic: { kind: \"network\", code: errorCode - 1000, name: networkErrorName ?? null } };\n }\n if (errorCode !== 0) {\n return {\n exitCode: errorCode === 404 ? 2 : errorCode === 401 ? 3 : 1,\n diagnostic: { kind: \"http\", code: errorCode, description: httpDescriptions[errorCode] ?? \"\" },\n };\n }\n return { exitCode: success ? 0 : 1, diagnostic: success ? null : { kind: \"unknown\" } };\n}\n", "import { WkhtmltopdfError } from \"./errors.js\";\nconst alphabet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n// Intrinsic access checks typed-array slots across realms without consulting\n// producer-owned properties, tags or iterators (including Buffer subclasses).\nconst typedArrayPrototype = Object.getPrototypeOf(Uint8Array.prototype);\nconst byteLengthGetter = Object.getOwnPropertyDescriptor(typedArrayPrototype, \"byteLength\").get;\nconst byteTypeGetter = Object.getOwnPropertyDescriptor(typedArrayPrototype, Symbol.toStringTag).get;\nconst copyBytes = Uint8Array.prototype.set;\n/** One bounded invocation. Returned byte arrays are caller-owned, never borrowed. */\nexport async function withResources(options, run) {\n const limits = { ...options.limits };\n for (const key of [\"maxInputBytes\", \"maxDecodedBytes\", \"maxRetainedBytes\", \"maxWork\", \"maxResources\"]) {\n if (!Number.isSafeInteger(limits[key]) || limits[key] < 1) {\n throw new WkhtmltopdfError(\"INVALID_VALUE\", \"Resource limits must be positive safe integers\");\n }\n }\n const { vfs, fonts, network } = options;\n const controller = new AbortController();\n const signal = controller.signal;\n const sourceSignal = options.signal;\n const abort = () => controller.abort(sourceSignal.reason);\n sourceSignal.addEventListener(\"abort\", abort, { once: true });\n if (sourceSignal.aborted)\n abort();\n const usage = { inputBytes: 0, decodedBytes: 0, retainedBytes: 0, work: 0, resources: 0 };\n let active = true;\n let busy = false;\n const pending = new Set();\n const check = () => {\n if (signal.aborted)\n throw signal.reason;\n if (!active)\n throw new WkhtmltopdfError(\"INVALID_VALUE\", \"Resource invocation has ended\");\n };\n const charge = (key, amount, limit) => {\n check();\n if (amount > limit - usage[key])\n throw new WkhtmltopdfError(\"LIMIT_EXCEEDED\", `Resource ${key} limit exceeded`);\n usage[key] += amount;\n };\n const work = (amount = 1) => charge(\"work\", amount, limits.maxWork);\n const admitText = (reference) => {\n for (let i = 0; i < reference.length; i++) {\n work();\n const c = reference.charCodeAt(i);\n let size = c < 128 ? 1 : c < 2048 ? 2 : 3;\n if (c >= 0xd800 && c <= 0xdbff && reference.charCodeAt(i + 1) >= 0xdc00 && reference.charCodeAt(i + 1) <= 0xdfff) {\n size = 4;\n i++;\n work();\n }\n charge(\"inputBytes\", size, limits.maxInputBytes);\n if (c === 0)\n throw new WkhtmltopdfError(\"INVALID_VALUE\", \"NUL resource reference\");\n }\n };\n const retain = (size) => {\n charge(\"decodedBytes\", size, limits.maxDecodedBytes);\n charge(\"retainedBytes\", size, limits.maxRetainedBytes);\n };\n const data = (reference) => {\n const comma = reference.indexOf(\",\");\n if (comma < 0)\n throw new WkhtmltopdfError(\"INVALID_VALUE\", \"Data URL requires a comma\");\n const base64 = reference.slice(5, comma).toLowerCase().endsWith(\";base64\");\n const start = comma + 1;\n let size = 0;\n const invalid = () => { throw new WkhtmltopdfError(\"INVALID_VALUE\", \"Malformed data URL byte encoding\"); };\n const hex = (c) => {\n const code = c.charCodeAt(0);\n if (code >= 48 && code <= 57)\n return code - 48;\n if (code >= 65 && code <= 70)\n return code - 55;\n if (code >= 97 && code <= 102)\n return code - 87;\n return invalid();\n };\n if (base64) {\n const length = reference.length - start;\n if (length % 4 !== 0)\n invalid();\n for (let i = start; i < reference.length; i += 4) {\n work(4);\n const a = alphabet.indexOf(reference[i]);\n const b = alphabet.indexOf(reference[i + 1]);\n const c = alphabet.indexOf(reference[i + 2]);\n const d = alphabet.indexOf(reference[i + 3]);\n if (a < 0 || b < 0)\n invalid();\n if (reference[i + 2] === \"=\") {\n if (reference[i + 3] !== \"=\" || i + 4 !== reference.length || (b & 15) !== 0)\n invalid();\n size++;\n }\n else if (reference[i + 3] === \"=\") {\n if (c < 0 || i + 4 !== reference.length || (c & 3) !== 0)\n invalid();\n size += 2;\n }\n else {\n if (c < 0 || d < 0)\n invalid();\n size += 3;\n }\n }\n }\n else {\n for (let i = start; i < reference.length; i++) {\n work();\n const code = reference.charCodeAt(i);\n if (code > 127 || code <= 32)\n invalid();\n if (reference[i] === \"%\") {\n if (i + 2 >= reference.length)\n invalid();\n hex(reference[i + 1]);\n hex(reference[i + 2]);\n i += 2;\n work(2);\n }\n size++;\n }\n }\n work(size);\n retain(size);\n const result = new Uint8Array(size);\n let offset = 0;\n if (base64) {\n for (let i = start; i < reference.length; i += 4) {\n const a = alphabet.indexOf(reference[i]);\n const b = alphabet.indexOf(reference[i + 1]);\n const c = alphabet.indexOf(reference[i + 2]);\n const d = alphabet.indexOf(reference[i + 3]);\n result[offset++] = (a << 2) | (b >> 4);\n if (c >= 0)\n result[offset++] = (b << 4) | (c >> 2);\n if (d >= 0)\n result[offset++] = (c << 6) | d;\n }\n }\n else {\n for (let i = start; i < reference.length; i++) {\n result[offset++] = reference[i] === \"%\"\n ? (hex(reference[++i]) << 4) | hex(reference[++i]) : reference.charCodeAt(i);\n }\n }\n return result;\n };\n const read = async (reference, open) => {\n const lease = await open(reference, signal);\n let temporary = 0;\n const chunks = [];\n let primary = false;\n let failure;\n let result;\n try {\n check();\n const iterator = lease.chunks[Symbol.asyncIterator]();\n for (;;) {\n work();\n let abortRead;\n let next;\n try {\n next = await new Promise((resolve, reject) => {\n abortRead = () => reject(signal.reason);\n signal.addEventListener(\"abort\", abortRead, { once: true });\n if (signal.aborted)\n abortRead();\n Promise.resolve().then(() => { check(); return iterator.next(); }).then(resolve, reject);\n });\n }\n finally {\n if (abortRead)\n signal.removeEventListener(\"abort\", abortRead);\n }\n check();\n if (next.done)\n break;\n if (byteTypeGetter.call(next.value) !== \"Uint8Array\") {\n throw new WkhtmltopdfError(\"INVALID_VALUE\", \"Expected resource byte chunks\");\n }\n const size = byteLengthGetter.call(next.value);\n charge(\"inputBytes\", size, limits.maxInputBytes);\n work(size);\n retain(size);\n temporary += size;\n if (size) {\n const chunk = new Uint8Array(size);\n copyBytes.call(chunk, next.value);\n chunks.push(chunk);\n }\n }\n work(temporary);\n charge(\"retainedBytes\", temporary, limits.maxRetainedBytes);\n result = new Uint8Array(temporary);\n let offset = 0;\n for (const chunk of chunks) {\n result.set(chunk, offset);\n offset += chunk.length;\n }\n }\n catch (error) {\n primary = true;\n failure = error;\n }\n finally {\n usage.retainedBytes -= temporary;\n try {\n await lease.close();\n check();\n }\n catch (error) {\n if (!primary) {\n primary = true;\n failure = error;\n }\n }\n }\n if (primary) {\n if (result)\n usage.retainedBytes -= result.byteLength;\n throw failure;\n }\n return result;\n };\n const load = (reference, font, base) => {\n const operation = (async () => {\n check();\n if (busy)\n throw new WkhtmltopdfError(\"INVALID_VALUE\", \"Resource reads must be sequential\");\n busy = true;\n try {\n charge(\"resources\", 1, limits.maxResources);\n admitText(reference);\n if (base !== undefined) {\n admitText(base);\n try {\n reference = new URL(reference, base).href;\n }\n catch {\n throw new WkhtmltopdfError(\"INVALID_VALUE\", \"Invalid resource URL or base\");\n }\n // Count the normalized representation too, including Unicode escaping.\n admitText(reference);\n }\n if (!font) {\n work(reference.length);\n const fragment = reference.indexOf(\"#\");\n if (fragment >= 0)\n reference = reference.slice(0, fragment);\n }\n if (!font && reference.startsWith(\"data:\"))\n return data(reference);\n const open = font ? fonts : reference.startsWith(\"vfs:\") ? vfs :\n reference.startsWith(\"https:\") || reference.startsWith(\"http:\") ? network : undefined;\n if (!open)\n throw new WkhtmltopdfError(\"UNSUPPORTED_CAPABILITY\", \"Resource requires an explicitly supplied capability\");\n return await read(reference, open);\n }\n finally {\n busy = false;\n }\n })();\n pending.add(operation);\n void operation.then(() => pending.delete(operation), () => pending.delete(operation));\n return operation;\n };\n try {\n check();\n const result = await run({ load: (reference, base) => load(reference, false, base), font: name => load(name, true), get usage() { return { ...usage }; } });\n check();\n if (pending.size)\n throw new WkhtmltopdfError(\"INVALID_VALUE\", \"Resource reads must finish before the invocation ends\");\n return result;\n }\n finally {\n active = false;\n controller.abort(new WkhtmltopdfError(\"INVALID_VALUE\", \"Resource invocation has ended\"));\n await Promise.allSettled(pending);\n sourceSignal.removeEventListener(\"abort\", abort);\n usage.retainedBytes = 0;\n }\n}\n"],
5
+ "mappings": ";AAAO,IAAM,mBAAN,cAA+B,MAAM;AAAA,EACxC;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,YAAY,MAAM,SAAS,QAAQ;AAC/B,UAAM,OAAO;AACb,SAAK,OAAO;AACZ,SAAK,SAAS;AACd,SAAK,OAAO;AAAA,EAChB;AACJ;;;ACPO,IAAM,cAAN,MAAkB;AAAA,EACrB;AAAA,EACA,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,UAAU;AAAA,EACV;AAAA,EACA,YAAY,SAAS;AACjB,SAAK,UAAU;AACf,SAAK,kBAAkB;AACvB,SAAK,SAAS;AAAA,MACV,cAAc,QAAQ,QAAQ;AAAA,MAC9B,cAAc,QAAQ,QAAQ;AAAA,MAC9B,YAAY,QAAQ,QAAQ;AAAA,MAC5B,SAAS,QAAQ,QAA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ome"]
7
+ }
@@ -0,0 +1,8 @@
1
+ export * from "./command.js";
2
+ export * from "./value.js";
3
+ export * from "./plugin.js";
4
+ export * from "./io.js";
5
+ export * from "./output.js";
6
+ export * from "./filesystem.js";
7
+ export * from "./errors.js";
8
+ export * from "./command-requirements.js";
@@ -0,0 +1,8 @@
1
+ export * from "./command.js";
2
+ export * from "./value.js";
3
+ export * from "./plugin.js";
4
+ export * from "./io.js";
5
+ export * from "./output.js";
6
+ export * from "./filesystem.js";
7
+ export * from "./errors.js";
8
+ export * from "./command-requirements.js";
@@ -114,7 +114,21 @@ async function prepareAndRun(options, input, signal, setRelay, fail) {
114
114
  target.browserContextId !== metadata.contextId);
115
115
  if (foreign.some((target) => target.url !== "about:blank" ||
116
116
  browserContextIds.includes(target.browserContextId ?? "")))
117
- throw new Error("Run-code cannot reconnect another existing browser context");
117
+ throw new Error(
118
+ // Keep the admission census in the message: callers commonly retain only String(error).
119
+ // URL/title content is unnecessary to explain the guard and may contain private data.
120
+ `Run-code cannot reconnect another existing browser context: ${JSON.stringify({
121
+ ownedTargetId: metadata.targetId,
122
+ ownedContextId: metadata.contextId,
123
+ browserContextIds,
124
+ foreignTargets: foreign.map((target) => ({
125
+ targetId: target.targetId,
126
+ contextId: target.browserContextId ?? null,
127
+ type: target.type,
128
+ urlState: target.url === "" ? "empty" : target.url === "about:blank" ? "about:blank" : "other",
129
+ isPrivateContext: browserContextIds.includes(target.browserContextId ?? ""),
130
+ })),
131
+ })}`);
118
132
  await Promise.all(foreign.map((target) => observer.send("Target.closeTarget", { targetId: target.targetId })));
119
133
  const targets = new Map(targetInfos
120
134
  .filter((target) => target.browserContextId === metadata.contextId)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poe-platform/safe-bash",
3
- "version": "0.1.710",
3
+ "version": "0.1.712",
4
4
  "description": "Extensible virtual shell with pluggable filesystems and streaming commands",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -367,6 +367,10 @@
367
367
  "./commands/exiftool": {
368
368
  "types": "./dist/safe-bash/commands/exiftool/index.d.ts",
369
369
  "import": "./dist/safe-bash/commands/exiftool/index.js"
370
+ },
371
+ "./commands/fmt": {
372
+ "types": "./dist/safe-bash/commands/fmt/index.d.ts",
373
+ "import": "./dist/safe-bash/commands/fmt/index.js"
370
374
  }
371
375
  },
372
376
  "repository": {
@@ -378,7 +382,7 @@
378
382
  "access": "public"
379
383
  },
380
384
  "dependencies": {
381
- "@poe-platform/safe-fs": "0.1.710",
385
+ "@poe-platform/safe-fs": "0.1.712",
382
386
  "pako": "3.0.1",
383
387
  "@types/node": "^25.2.2",
384
388
  "@noble/hashes": "2.4.0",
@@ -1,163 +0,0 @@
1
- import { readBytes } from "../safe-bash-contracts/io.js";
2
- import { virtualPath } from "./paths.js";
3
- const escapes = Object.freeze({ a: "\x07", b: "\b", f: "\f", n: "\n", r: "\r", t: "\t", '"': '"', "\\": "\\" });
4
- function whitespace(character) {
5
- return character === " " || character === "\t" || character === "\n" || character === "\r" || character === "\f" || character === "\v";
6
- }
7
- /** Pinned CLI physical-line filtering; neither shell quoting nor code evaluation. */
8
- export function filterArgfileLine(line) {
9
- const cstr = line.startsWith("#[CSTR]");
10
- if (line.startsWith("#") && !cstr)
11
- return undefined;
12
- let start = cstr ? 7 : 0, end = line.length;
13
- if (!cstr)
14
- while (start < end && whitespace(line[start]))
15
- start++;
16
- while (end > start && (line[end - 1] === "\r" || line[end - 1] === "\n"))
17
- end--;
18
- const value = line.slice(start, end);
19
- if (cstr) {
20
- const parts = [];
21
- for (let index = 0; index < value.length; index++) {
22
- const character = value[index];
23
- if (character === "\\" && index + 1 < value.length) {
24
- const next = value[++index];
25
- parts.push(Object.hasOwn(escapes, next) ? escapes[next] : "\\" + next);
26
- }
27
- else
28
- parts.push(character);
29
- }
30
- return parts.join("");
31
- }
32
- if (!value)
33
- return undefined;
34
- if (value[0] !== "-")
35
- return value;
36
- let index = 1;
37
- while (index < value.length) {
38
- const character = value[index];
39
- if (!(character === "-" || character === "_" || character === ":" || (character >= "0" && character <= "9") || (character >= "A" && character <= "Z") || (character >= "a" && character <= "z")))
40
- break;
41
- index++;
42
- }
43
- if (index === 1)
44
- return value;
45
- if (value[index] === "#")
46
- index++;
47
- const nameEnd = index;
48
- while (index < value.length && whitespace(value[index]))
49
- index++;
50
- const operationStart = index;
51
- if (value[index] === "+" || value[index] === "-" || value[index] === "<")
52
- index++;
53
- if (value[index] !== "=")
54
- return value;
55
- index++;
56
- const operationEnd = index;
57
- if (value[index] === " ")
58
- index++;
59
- return value.slice(0, nameEnd) + value.slice(operationStart, operationEnd) + value.slice(index);
60
- }
61
- /** Invocation-local VFS expansion. No executable-directory search or EOF polling. */
62
- export async function expandArgfiles(args, context, publication, resources) {
63
- const frames = [{ args, index: 0 }];
64
- const result = [];
65
- let literal = false;
66
- let takesValue = false;
67
- while (frames.length) {
68
- resources.signal.throwIfAborted();
69
- const frame = frames[frames.length - 1];
70
- if (frame.index >= frame.args.length) {
71
- frames.pop();
72
- continue;
73
- }
74
- const arg = frame.args[frame.index++];
75
- resources.admit("work", arg.length + 1);
76
- const option = arg.toLowerCase();
77
- if (!literal && !takesValue && frame.path && (option === "-config" || option === "-common_args"))
78
- throw new Error("Configuration/common arguments are not allowed in argument files");
79
- if (!literal && !takesValue && option === "-@") {
80
- // Consume the filename from the expanded stream, including parent frames.
81
- while (frames.length && frames[frames.length - 1].index >= frames[frames.length - 1].args.length)
82
- frames.pop();
83
- const owner = frames[frames.length - 1];
84
- if (!owner)
85
- throw new Error("Missing argument for -@");
86
- const input = owner.args[owner.index++];
87
- if (input === "-" || input.includes("\0"))
88
- throw new Error("Argument-file stdin/invalid paths are not supported");
89
- const path = virtualPath(context.cwd, input, resources);
90
- if (frames.some(active => active.path === path))
91
- throw new Error("Argument-file cycle is not supported");
92
- if (frames.length >= 16)
93
- throw new Error("Argument-file nesting limit exceeded");
94
- const stat = await publication.track(() => context.fs.lstat(path, { signal: context.signal }));
95
- if (stat.type !== "file")
96
- throw new Error("Only regular VFS argument files are admitted");
97
- resources.admit("input", stat.size);
98
- resources.admit("decoded", stat.size * 2);
99
- resources.admit("retained", stat.size * 48 + 256);
100
- resources.admit("work", stat.size * 24 + path.length);
101
- const bytes = await publication.track(async () => {
102
- if (!context.fs.readStream) {
103
- const result = await context.fs.readFile(path, { signal: context.signal, maxBytes: stat.size });
104
- context.signal.throwIfAborted();
105
- if (result.length > stat.size)
106
- throw new RangeError("ExifTool argument file grew beyond admitted size");
107
- return result;
108
- }
109
- const chunks = [];
110
- let extent = 0;
111
- for await (const chunk of readBytes(context.fs.readStream(path, { signal: context.signal }), context.signal)) {
112
- if (chunk.length > stat.size - extent)
113
- throw new Error("Argument file grew beyond admitted size");
114
- resources.admit("retained", chunk.length + 128);
115
- resources.admit("work", chunk.length + 1);
116
- chunks.push(new Uint8Array(chunk));
117
- extent += chunk.length;
118
- }
119
- const owned = new Uint8Array(extent);
120
- let offset = 0;
121
- for (const chunk of chunks) {
122
- owned.set(chunk, offset);
123
- offset += chunk.length;
124
- }
125
- return owned;
126
- });
127
- if (bytes.length > stat.size)
128
- throw new Error("Argument file grew beyond admitted size");
129
- let text;
130
- try {
131
- text = new TextDecoder("utf-8", { fatal: true }).decode(bytes);
132
- }
133
- catch {
134
- throw new Error("Only UTF-8 argument files are currently supported");
135
- }
136
- const expanded = [];
137
- let start = 0;
138
- for (let index = 0; index <= text.length; index++) {
139
- if (index !== text.length && text[index] !== "\n")
140
- continue;
141
- const value = filterArgfileLine(text.slice(start, index === text.length ? index : index + 1));
142
- start = index + 1;
143
- if (value !== undefined) {
144
- resources.admit("retained", value.length * 2 + 128);
145
- if (expanded.length >= 4096)
146
- throw new Error("Argument-file argument count exceeded");
147
- expanded.push(value);
148
- }
149
- }
150
- frames.push({ args: expanded, index: 0, path });
151
- continue;
152
- }
153
- if (!literal && !takesValue && arg === "--")
154
- literal = true;
155
- const wasValue = takesValue;
156
- takesValue = !literal && !wasValue && ["-config", "-api", "-o", "-if", "-p", "-stay_open"].includes(option);
157
- resources.admit("retained", arg.length * 2 + 128);
158
- if (result.length >= 4096)
159
- throw new Error("ExifTool argument count exceeded");
160
- result.push(arg);
161
- }
162
- return result;
163
- }