diff --git a/README.md b/README.md index 79afd75..f4f2298 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,13 @@ traversal, backslashes, control characters, and percent-encoded path segments. Generated output paths must stay within the current working directory. Screenshots append a timestamp to the requested filename and report the actual path written, so repeated captures do not reuse cache-prone filenames. +Captures reject non-JPEG/PNG responses and detected framing or decoding errors. +JPEG scan completion and restart order are checked before saving. +Captures accept up to 64 MiB of compressed data and 8,847,360 pixels (including +3840×2160 UHD and 4096×2160 DCI 4K); JPEG decoding has a 256 MiB memory limit. +PNG width and height are each limited to 8192 to bound decoder row allocations; +decompression is bounded by the declared pixel dimensions. Original image +bytes are preserved. Detected image errors use the normal capture retry path. ## Library Use diff --git a/docs/DISTRIBUTION.md b/docs/DISTRIBUTION.md index b79b956..283337e 100644 --- a/docs/DISTRIBUTION.md +++ b/docs/DISTRIBUTION.md @@ -48,6 +48,15 @@ The published dependencies pin Effect, platform-node, and platform-node-shared t the same prerelease. Keep those pins aligned: a consumer does not inherit this repository’s pnpm overrides, and a newer shared runtime can be incompatible. +The build bundles pinned `jpeg-js` with the patch maintained under `patches/` +so ordinary npm consumers receive the same decoder. The patch +caps single-component decoding at the remaining MCU count so valid final partial +restart intervals decode, and makes strict decoding reject scans that end before +the declared MCUs are complete. Keep the decoder bundled: ordinary npm consumers do +not inherit pnpm patches. Remove the patch only when a pinned upstream release +passes the partial-interval and early-end-marker regressions and installed-package +proof. Bundled third-party notices are in [Third-Party Notices](THIRD-PARTY-NOTICES.md). + ## Release Smoke After a release, confirm the tag and package are visible: diff --git a/docs/THIRD-PARTY-NOTICES.md b/docs/THIRD-PARTY-NOTICES.md new file mode 100644 index 0000000..2fff23a --- /dev/null +++ b/docs/THIRD-PARTY-NOTICES.md @@ -0,0 +1,127 @@ +# Third-Party Notices + +The build bundles jpeg-js 0.4.4. Its decoder is modified to stop each restart +interval at the remaining MCU count and reject incomplete scans in strict mode. +The source patch is maintained under `patches/` for reproducible builds. + +## jpeg-js + +Copyright (c) 2014, Eugene Ware +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of Eugene Ware nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY EUGENE WARE ''AS IS'' AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL EUGENE WARE BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +## JPEG encoder + +Copyright (c) 2008, Adobe Systems Incorporated +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +- Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +- Neither the name of Adobe Systems Incorporated nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +## JPEG decoder + +Copyright 2011 notmasteryet + +Licensed under the Apache License, Version 2.0, reproduced below. + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of this License; and + +You must cause any modified files to carry prominent notices stating that You changed the files; and + +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS diff --git a/package.json b/package.json index fcd9998..f26b322 100644 --- a/package.json +++ b/package.json @@ -63,13 +63,16 @@ "@effect/platform-node-shared": "4.0.0-beta.107", "effect": "4.0.0-beta.107", "jszip": "^3.10.1", + "pngjs": "7.0.0", "roku-deploy": "3.18.2" }, "devDependencies": { "@effect/vitest": "4.0.0-beta.107", "@types/node": "^26.1.2", + "@types/pngjs": "6.0.5", "@uinaf/skillcheck": "0.4.0", "@vitest/coverage-v8": "catalog:", + "jpeg-js": "0.4.4", "typescript": "^7.0.2", "vite": "catalog:", "vite-plus": "catalog:", diff --git a/patches/jpeg-js@0.4.4.patch b/patches/jpeg-js@0.4.4.patch new file mode 100644 index 0000000..c0657c7 --- /dev/null +++ b/patches/jpeg-js@0.4.4.patch @@ -0,0 +1,29 @@ +diff --git a/lib/decoder.js b/lib/decoder.js +index 1982481806e5fe29bd38cb008297f35731ade20b..1495850c0dca29b49c4aeffa91a2826341baf0d4 100644 +--- a/lib/decoder.js ++++ b/lib/decoder.js +@@ -1,3 +1,4 @@ ++/*! Modified for rokit: bound final restart intervals and reject incomplete strict scans. */ + /* -*- tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- / + /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ + /* +@@ -302,7 +303,7 @@ var JpegImage = (function jpegImage() { + + if (componentsLength == 1) { + component = components[0]; +- for (n = 0; n < resetInterval; n++) { ++ for (n = 0; n < resetInterval && mcu < mcuExpected; n++) { + decodeBlock(component, decodeFn, mcu); + mcu++; + } +@@ -351,6 +352,10 @@ var JpegImage = (function jpegImage() { + break; + } + ++ if (mcu < mcuExpected && !opts.tolerantDecoding) { ++ throw new Error("incomplete JPEG scan"); ++ } ++ + return offset - startOffset; + } + diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cfde0cb..e809e03 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -119,6 +119,9 @@ overrides: vite: npm:@voidzero-dev/vite-plus-core@0.2.9 vitest: 4.1.10 +patchedDependencies: + jpeg-js@0.4.4: 912afc7ca433991bc4fdb62ba2569b5c73dfb29454942b95efe8961b279474e6 + importers: .: @@ -135,6 +138,9 @@ importers: jszip: specifier: ^3.10.1 version: 3.10.1 + pngjs: + specifier: 7.0.0 + version: 7.0.0 roku-deploy: specifier: 3.18.2 version: 3.18.2 @@ -145,12 +151,18 @@ importers: '@types/node': specifier: ^26.1.2 version: 26.2.0 + '@types/pngjs': + specifier: 6.0.5 + version: 6.0.5 '@uinaf/skillcheck': specifier: 0.4.0 - version: 0.4.0(@anthropic-ai/sdk@0.115.0(zod@4.4.3))(@aws-sdk/credential-provider-node@3.972.80)(@modelcontextprotocol/sdk@1.30.0(supports-color@7.2.0)(zod@4.4.3))(@smithy/signature-v4@5.7.2)(@types/json-schema@7.0.15)(@types/node@26.2.0)(pg@8.23.0)(playwright-core@1.62.1)(socks@2.8.9)(zod@4.4.3) + version: 0.4.0(@anthropic-ai/sdk@0.115.0(zod@4.4.3))(@aws-sdk/credential-provider-node@3.972.80)(@modelcontextprotocol/sdk@1.30.0(supports-color@7.2.0)(zod@4.4.3))(@smithy/signature-v4@5.7.2)(@types/json-schema@7.0.15)(@types/node@26.2.0)(pg@8.23.0)(playwright-core@1.62.1)(socks@2.8.9)(supports-color@7.2.0)(zod@4.4.3) '@vitest/coverage-v8': specifier: 'catalog:' version: 4.1.10(@vitest/browser@4.1.10)(vitest@4.1.10) + jpeg-js: + specifier: 0.4.4 + version: 0.4.4(patch_hash=912afc7ca433991bc4fdb62ba2569b5c73dfb29454942b95efe8961b279474e6) typescript: specifier: ^7.0.2 version: 7.0.2 @@ -2157,6 +2169,9 @@ packages: '@types/pegjs@0.10.6': resolution: {integrity: sha512-eLYXDbZWXh2uxf+w8sXS8d6KSoXTswfps6fvCUuVAGN8eRpfe7h9eSRydxiSJvo9Bf+GzifsDOr9TMQlmJdmkw==} + '@types/pngjs@6.0.5': + resolution: {integrity: sha512-0k5eKfrA83JOZPppLtS2C7OUtyNAl2wKNxfyYl9Q5g9lPkgBl/9hNyAu6HuEH2J4XmIv2znEpkDd0SaZVxW6iQ==} + '@types/retry@0.12.0': resolution: {integrity: sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==} @@ -3724,6 +3739,9 @@ packages: jose@6.2.9: resolution: {integrity: sha512-XrchZOFZUl/T3vTwRe8XK+cJrGtMF4th1ARnDfwbBXFKThGhlsxEE4Zu03AD/bjJSt/9jT/mxrOCkJWOg77aPA==} + jpeg-js@0.4.4: + resolution: {integrity: sha512-WZzeDOEtTOBK4Mdsar0IqEU5sMr3vSV2RqkAIzUEV2BHnUfKGyswWFPFwK5EeDo93K3FohSHbLAjj0s1Wzd+dg==} + js-base64@3.9.3: resolution: {integrity: sha512-uwYQp+VJ38FVvtim6qNbit6e9uT6dwWQ4Y1+H9TxhW5hcHjpHwoxlR0nMpqUmIFOmu4VqMxwdJA88gIVuZJQ/g==} @@ -5554,25 +5572,25 @@ snapshots: '@aws/lambda-invoke-store@0.3.0': optional: true - '@azure-rest/core-client@1.4.0': + '@azure-rest/core-client@1.4.0(supports-color@7.2.0)': dependencies: '@azure/abort-controller': 2.2.0 - '@azure/core-auth': 1.11.0 - '@azure/core-rest-pipeline': 1.25.0 + '@azure/core-auth': 1.11.0(supports-color@7.2.0) + '@azure/core-rest-pipeline': 1.25.0(supports-color@7.2.0) '@azure/core-tracing': 1.4.0 - '@azure/core-util': 1.14.0 + '@azure/core-util': 1.14.0(supports-color@7.2.0) tslib: 2.8.1 transitivePeerDependencies: - supports-color optional: true - '@azure-rest/core-client@2.8.0': + '@azure-rest/core-client@2.8.0(supports-color@7.2.0)': dependencies: '@azure/abort-controller': 2.2.0 - '@azure/core-auth': 1.11.0 - '@azure/core-rest-pipeline': 1.25.0 + '@azure/core-auth': 1.11.0(supports-color@7.2.0) + '@azure/core-rest-pipeline': 1.25.0(supports-color@7.2.0) '@azure/core-tracing': 1.4.0 - '@typespec/ts-http-runtime': 0.3.8 + '@typespec/ts-http-runtime': 0.3.8(supports-color@7.2.0) tslib: 2.8.1 transitivePeerDependencies: - supports-color @@ -5583,19 +5601,19 @@ snapshots: tslib: 2.8.1 optional: true - '@azure/ai-projects@2.4.0(@aws-sdk/credential-provider-node@3.972.80)(@smithy/signature-v4@5.7.2)(ws@8.21.3)(zod@4.4.3)': + '@azure/ai-projects@2.4.0(@aws-sdk/credential-provider-node@3.972.80)(@smithy/signature-v4@5.7.2)(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3)': dependencies: - '@azure-rest/core-client': 2.8.0 + '@azure-rest/core-client': 2.8.0(supports-color@7.2.0) '@azure/abort-controller': 2.2.0 - '@azure/core-auth': 1.11.0 - '@azure/core-lro': 3.4.0 + '@azure/core-auth': 1.11.0(supports-color@7.2.0) + '@azure/core-lro': 3.4.0(supports-color@7.2.0) '@azure/core-paging': 1.7.0 - '@azure/core-rest-pipeline': 1.25.0 + '@azure/core-rest-pipeline': 1.25.0(supports-color@7.2.0) '@azure/core-sse': 2.4.0 - '@azure/core-util': 1.14.0 - '@azure/identity': 4.13.2 - '@azure/logger': 1.4.0 - '@azure/storage-blob': 12.33.0 + '@azure/core-util': 1.14.0(supports-color@7.2.0) + '@azure/identity': 4.13.2(supports-color@7.2.0) + '@azure/logger': 1.4.0(supports-color@7.2.0) + '@azure/storage-blob': 12.33.0(supports-color@7.2.0) '@opentelemetry/api': 1.9.1 openai: 6.49.0(@aws-sdk/credential-provider-node@3.972.80)(@smithy/signature-v4@5.7.2)(ws@8.21.3)(zod@4.4.3) tslib: 2.8.1 @@ -5608,50 +5626,50 @@ snapshots: - zod optional: true - '@azure/core-auth@1.11.0': + '@azure/core-auth@1.11.0(supports-color@7.2.0)': dependencies: '@azure/abort-controller': 2.2.0 - '@azure/core-util': 1.14.0 + '@azure/core-util': 1.14.0(supports-color@7.2.0) tslib: 2.8.1 transitivePeerDependencies: - supports-color optional: true - '@azure/core-client@1.11.0': + '@azure/core-client@1.11.0(supports-color@7.2.0)': dependencies: '@azure/abort-controller': 2.2.0 - '@azure/core-auth': 1.11.0 - '@azure/core-rest-pipeline': 1.25.0 + '@azure/core-auth': 1.11.0(supports-color@7.2.0) + '@azure/core-rest-pipeline': 1.25.0(supports-color@7.2.0) '@azure/core-tracing': 1.4.0 - '@azure/core-util': 1.14.0 - '@azure/logger': 1.4.0 + '@azure/core-util': 1.14.0(supports-color@7.2.0) + '@azure/logger': 1.4.0(supports-color@7.2.0) tslib: 2.8.1 transitivePeerDependencies: - supports-color optional: true - '@azure/core-http-compat@2.5.0(@azure/core-client@1.11.0)(@azure/core-rest-pipeline@1.25.0)': + '@azure/core-http-compat@2.5.0(@azure/core-client@1.11.0(supports-color@7.2.0))(@azure/core-rest-pipeline@1.25.0(supports-color@7.2.0))': dependencies: '@azure/abort-controller': 2.2.0 - '@azure/core-client': 1.11.0 - '@azure/core-rest-pipeline': 1.25.0 + '@azure/core-client': 1.11.0(supports-color@7.2.0) + '@azure/core-rest-pipeline': 1.25.0(supports-color@7.2.0) optional: true - '@azure/core-lro@2.7.2': + '@azure/core-lro@2.7.2(supports-color@7.2.0)': dependencies: '@azure/abort-controller': 2.2.0 - '@azure/core-util': 1.14.0 - '@azure/logger': 1.4.0 + '@azure/core-util': 1.14.0(supports-color@7.2.0) + '@azure/logger': 1.4.0(supports-color@7.2.0) tslib: 2.8.1 transitivePeerDependencies: - supports-color optional: true - '@azure/core-lro@3.4.0': + '@azure/core-lro@3.4.0(supports-color@7.2.0)': dependencies: '@azure/abort-controller': 2.2.0 - '@azure/core-util': 1.14.0 - '@azure/logger': 1.4.0 + '@azure/core-util': 1.14.0(supports-color@7.2.0) + '@azure/logger': 1.4.0(supports-color@7.2.0) tslib: 2.8.1 transitivePeerDependencies: - supports-color @@ -5665,14 +5683,14 @@ snapshots: '@azure/core-process@1.0.0': optional: true - '@azure/core-rest-pipeline@1.25.0': + '@azure/core-rest-pipeline@1.25.0(supports-color@7.2.0)': dependencies: '@azure/abort-controller': 2.2.0 - '@azure/core-auth': 1.11.0 + '@azure/core-auth': 1.11.0(supports-color@7.2.0) '@azure/core-tracing': 1.4.0 - '@azure/core-util': 1.14.0 - '@azure/logger': 1.4.0 - '@typespec/ts-http-runtime': 0.3.8 + '@azure/core-util': 1.14.0(supports-color@7.2.0) + '@azure/logger': 1.4.0(supports-color@7.2.0) + '@typespec/ts-http-runtime': 0.3.8(supports-color@7.2.0) tslib: 2.8.1 transitivePeerDependencies: - supports-color @@ -5688,10 +5706,10 @@ snapshots: tslib: 2.8.1 optional: true - '@azure/core-util@1.14.0': + '@azure/core-util@1.14.0(supports-color@7.2.0)': dependencies: '@azure/abort-controller': 2.2.0 - '@typespec/ts-http-runtime': 0.3.8 + '@typespec/ts-http-runtime': 0.3.8(supports-color@7.2.0) tslib: 2.8.1 transitivePeerDependencies: - supports-color @@ -5703,16 +5721,16 @@ snapshots: tslib: 2.8.1 optional: true - '@azure/identity@4.13.2': + '@azure/identity@4.13.2(supports-color@7.2.0)': dependencies: '@azure/abort-controller': 2.2.0 - '@azure/core-auth': 1.11.0 - '@azure/core-client': 1.11.0 + '@azure/core-auth': 1.11.0(supports-color@7.2.0) + '@azure/core-client': 1.11.0(supports-color@7.2.0) '@azure/core-process': 1.0.0 - '@azure/core-rest-pipeline': 1.25.0 + '@azure/core-rest-pipeline': 1.25.0(supports-color@7.2.0) '@azure/core-tracing': 1.4.0 - '@azure/core-util': 1.14.0 - '@azure/logger': 1.4.0 + '@azure/core-util': 1.14.0(supports-color@7.2.0) + '@azure/logger': 1.4.0(supports-color@7.2.0) '@azure/msal-browser': 5.18.0 '@azure/msal-node': 5.5.0 open: 10.2.0 @@ -5721,9 +5739,9 @@ snapshots: - supports-color optional: true - '@azure/logger@1.4.0': + '@azure/logger@1.4.0(supports-color@7.2.0)': dependencies: - '@typespec/ts-http-runtime': 0.3.8 + '@typespec/ts-http-runtime': 0.3.8(supports-color@7.2.0) tslib: 2.8.1 transitivePeerDependencies: - supports-color @@ -5743,48 +5761,48 @@ snapshots: jsonwebtoken: 9.0.3 optional: true - '@azure/openai-assistants@1.0.0-beta.6': + '@azure/openai-assistants@1.0.0-beta.6(supports-color@7.2.0)': dependencies: - '@azure-rest/core-client': 1.4.0 - '@azure/core-auth': 1.11.0 - '@azure/core-client': 1.11.0 - '@azure/core-rest-pipeline': 1.25.0 - '@azure/core-util': 1.14.0 - '@azure/logger': 1.4.0 + '@azure-rest/core-client': 1.4.0(supports-color@7.2.0) + '@azure/core-auth': 1.11.0(supports-color@7.2.0) + '@azure/core-client': 1.11.0(supports-color@7.2.0) + '@azure/core-rest-pipeline': 1.25.0(supports-color@7.2.0) + '@azure/core-util': 1.14.0(supports-color@7.2.0) + '@azure/logger': 1.4.0(supports-color@7.2.0) tslib: 2.8.1 transitivePeerDependencies: - supports-color optional: true - '@azure/storage-blob@12.33.0': + '@azure/storage-blob@12.33.0(supports-color@7.2.0)': dependencies: '@azure/abort-controller': 2.2.0 - '@azure/core-auth': 1.11.0 - '@azure/core-client': 1.11.0 - '@azure/core-http-compat': 2.5.0(@azure/core-client@1.11.0)(@azure/core-rest-pipeline@1.25.0) - '@azure/core-lro': 2.7.2 + '@azure/core-auth': 1.11.0(supports-color@7.2.0) + '@azure/core-client': 1.11.0(supports-color@7.2.0) + '@azure/core-http-compat': 2.5.0(@azure/core-client@1.11.0(supports-color@7.2.0))(@azure/core-rest-pipeline@1.25.0(supports-color@7.2.0)) + '@azure/core-lro': 2.7.2(supports-color@7.2.0) '@azure/core-paging': 1.7.0 - '@azure/core-rest-pipeline': 1.25.0 + '@azure/core-rest-pipeline': 1.25.0(supports-color@7.2.0) '@azure/core-tracing': 1.4.0 - '@azure/core-util': 1.14.0 + '@azure/core-util': 1.14.0(supports-color@7.2.0) '@azure/core-xml': 1.6.0 - '@azure/logger': 1.4.0 - '@azure/storage-common': 12.5.0(@azure/core-client@1.11.0) + '@azure/logger': 1.4.0(supports-color@7.2.0) + '@azure/storage-common': 12.5.0(@azure/core-client@1.11.0(supports-color@7.2.0))(supports-color@7.2.0) events: 3.3.0 tslib: 2.8.1 transitivePeerDependencies: - supports-color optional: true - '@azure/storage-common@12.5.0(@azure/core-client@1.11.0)': + '@azure/storage-common@12.5.0(@azure/core-client@1.11.0(supports-color@7.2.0))(supports-color@7.2.0)': dependencies: '@azure/abort-controller': 2.2.0 - '@azure/core-auth': 1.11.0 - '@azure/core-http-compat': 2.5.0(@azure/core-client@1.11.0)(@azure/core-rest-pipeline@1.25.0) - '@azure/core-rest-pipeline': 1.25.0 + '@azure/core-auth': 1.11.0(supports-color@7.2.0) + '@azure/core-http-compat': 2.5.0(@azure/core-client@1.11.0(supports-color@7.2.0))(@azure/core-rest-pipeline@1.25.0(supports-color@7.2.0)) + '@azure/core-rest-pipeline': 1.25.0(supports-color@7.2.0) '@azure/core-tracing': 1.4.0 - '@azure/core-util': 1.14.0 - '@azure/logger': 1.4.0 + '@azure/core-util': 1.14.0(supports-color@7.2.0) + '@azure/logger': 1.4.0(supports-color@7.2.0) events: 3.3.0 tslib: 2.8.1 transitivePeerDependencies: @@ -5951,9 +5969,9 @@ snapshots: robot3: 0.4.1 optional: true - '@googleapis/sheets@13.0.2': + '@googleapis/sheets@13.0.2(supports-color@7.2.0)': dependencies: - googleapis-common: 8.0.3 + googleapis-common: 8.0.3(supports-color@7.2.0) transitivePeerDependencies: - supports-color optional: true @@ -5977,10 +5995,10 @@ snapshots: sharp: 0.34.5 optional: true - '@ibm-cloud/watsonx-ai@1.7.16': + '@ibm-cloud/watsonx-ai@1.7.16(supports-color@7.2.0)': dependencies: form-data: 4.0.6 - ibm-cloud-sdk-core: 5.6.0 + ibm-cloud-sdk-core: 5.6.0(supports-color@7.2.0) transitivePeerDependencies: - supports-color optional: true @@ -6283,7 +6301,7 @@ snapshots: '@keyv/serialize@1.1.1': {} - '@kwsites/file-exists@1.1.1': + '@kwsites/file-exists@1.1.1(supports-color@7.2.0)': dependencies: debug: 4.4.3(supports-color@7.2.0) transitivePeerDependencies: @@ -6379,7 +6397,7 @@ snapshots: eventsource: 3.0.7 eventsource-parser: 3.1.1 express: 5.2.1(supports-color@7.2.0) - express-rate-limit: 8.6.2(express@5.2.1)(supports-color@7.2.0) + express-rate-limit: 8.6.2(express@5.2.1(supports-color@7.2.0))(supports-color@7.2.0) hono: 4.13.3 jose: 6.2.9 json-schema-typed: 8.0.2 @@ -6476,7 +6494,7 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.20.1 - '@openai/agents-core@0.11.8(@aws-sdk/credential-provider-node@3.972.80)(@smithy/signature-v4@5.7.2)(ws@8.21.3)(zod@4.4.3)': + '@openai/agents-core@0.11.8(@aws-sdk/credential-provider-node@3.972.80)(@smithy/signature-v4@5.7.2)(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3)': dependencies: debug: 4.4.3(supports-color@7.2.0) openai: 6.49.0(@aws-sdk/credential-provider-node@3.972.80)(@smithy/signature-v4@5.7.2)(ws@8.21.3)(zod@4.4.3) @@ -6492,9 +6510,9 @@ snapshots: - ws optional: true - '@openai/agents-openai@0.11.8(@aws-sdk/credential-provider-node@3.972.80)(@smithy/signature-v4@5.7.2)(ws@8.21.3)(zod@4.4.3)': + '@openai/agents-openai@0.11.8(@aws-sdk/credential-provider-node@3.972.80)(@smithy/signature-v4@5.7.2)(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3)': dependencies: - '@openai/agents-core': 0.11.8(@aws-sdk/credential-provider-node@3.972.80)(@smithy/signature-v4@5.7.2)(ws@8.21.3)(zod@4.4.3) + '@openai/agents-core': 0.11.8(@aws-sdk/credential-provider-node@3.972.80)(@smithy/signature-v4@5.7.2)(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3) debug: 4.4.3(supports-color@7.2.0) openai: 6.49.0(@aws-sdk/credential-provider-node@3.972.80)(@smithy/signature-v4@5.7.2)(ws@8.21.3)(zod@4.4.3) zod: 4.4.3 @@ -6507,9 +6525,9 @@ snapshots: - ws optional: true - '@openai/agents-realtime@0.11.8(@aws-sdk/credential-provider-node@3.972.80)(@smithy/signature-v4@5.7.2)(zod@4.4.3)': + '@openai/agents-realtime@0.11.8(@aws-sdk/credential-provider-node@3.972.80)(@smithy/signature-v4@5.7.2)(supports-color@7.2.0)(zod@4.4.3)': dependencies: - '@openai/agents-core': 0.11.8(@aws-sdk/credential-provider-node@3.972.80)(@smithy/signature-v4@5.7.2)(ws@8.21.3)(zod@4.4.3) + '@openai/agents-core': 0.11.8(@aws-sdk/credential-provider-node@3.972.80)(@smithy/signature-v4@5.7.2)(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3) '@types/ws': 8.18.1 debug: 4.4.3(supports-color@7.2.0) ws: 8.21.3 @@ -6524,11 +6542,11 @@ snapshots: - utf-8-validate optional: true - '@openai/agents@0.11.8(@aws-sdk/credential-provider-node@3.972.80)(@smithy/signature-v4@5.7.2)(ws@8.21.3)(zod@4.4.3)': + '@openai/agents@0.11.8(@aws-sdk/credential-provider-node@3.972.80)(@smithy/signature-v4@5.7.2)(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3)': dependencies: - '@openai/agents-core': 0.11.8(@aws-sdk/credential-provider-node@3.972.80)(@smithy/signature-v4@5.7.2)(ws@8.21.3)(zod@4.4.3) - '@openai/agents-openai': 0.11.8(@aws-sdk/credential-provider-node@3.972.80)(@smithy/signature-v4@5.7.2)(ws@8.21.3)(zod@4.4.3) - '@openai/agents-realtime': 0.11.8(@aws-sdk/credential-provider-node@3.972.80)(@smithy/signature-v4@5.7.2)(zod@4.4.3) + '@openai/agents-core': 0.11.8(@aws-sdk/credential-provider-node@3.972.80)(@smithy/signature-v4@5.7.2)(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3) + '@openai/agents-openai': 0.11.8(@aws-sdk/credential-provider-node@3.972.80)(@smithy/signature-v4@5.7.2)(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3) + '@openai/agents-realtime': 0.11.8(@aws-sdk/credential-provider-node@3.972.80)(@smithy/signature-v4@5.7.2)(supports-color@7.2.0)(zod@4.4.3) debug: 4.4.3(supports-color@7.2.0) openai: 6.49.0(@aws-sdk/credential-provider-node@3.972.80)(@smithy/signature-v4@5.7.2)(ws@8.21.3)(zod@4.4.3) zod: 4.4.3 @@ -7067,7 +7085,7 @@ snapshots: dependencies: '@testing-library/dom': 10.4.1 - '@tokenizer/inflate@0.4.1': + '@tokenizer/inflate@0.4.1(supports-color@7.2.0)': dependencies: debug: 4.4.3(supports-color@7.2.0) token-types: 6.1.2 @@ -7115,6 +7133,10 @@ snapshots: '@types/pegjs@0.10.6': optional: true + '@types/pngjs@6.0.5': + dependencies: + '@types/node': 26.2.0 + '@types/retry@0.12.0': optional: true @@ -7195,20 +7217,20 @@ snapshots: '@typescript/typescript-win32-x64@7.0.2': optional: true - '@typespec/ts-http-runtime@0.3.8': + '@typespec/ts-http-runtime@0.3.8(supports-color@7.2.0)': dependencies: - http-proxy-agent: 7.0.2 - https-proxy-agent: 7.0.6 + http-proxy-agent: 7.0.2(supports-color@7.2.0) + https-proxy-agent: 7.0.6(supports-color@7.2.0) tslib: 2.8.1 transitivePeerDependencies: - supports-color optional: true - '@uinaf/skillcheck@0.4.0(@anthropic-ai/sdk@0.115.0(zod@4.4.3))(@aws-sdk/credential-provider-node@3.972.80)(@modelcontextprotocol/sdk@1.30.0(supports-color@7.2.0)(zod@4.4.3))(@smithy/signature-v4@5.7.2)(@types/json-schema@7.0.15)(@types/node@26.2.0)(pg@8.23.0)(playwright-core@1.62.1)(socks@2.8.9)(zod@4.4.3)': + '@uinaf/skillcheck@0.4.0(@anthropic-ai/sdk@0.115.0(zod@4.4.3))(@aws-sdk/credential-provider-node@3.972.80)(@modelcontextprotocol/sdk@1.30.0(supports-color@7.2.0)(zod@4.4.3))(@smithy/signature-v4@5.7.2)(@types/json-schema@7.0.15)(@types/node@26.2.0)(pg@8.23.0)(playwright-core@1.62.1)(socks@2.8.9)(supports-color@7.2.0)(zod@4.4.3)': dependencies: '@anthropic-ai/claude-agent-sdk': 0.3.235(@anthropic-ai/sdk@0.115.0(zod@4.4.3))(@modelcontextprotocol/sdk@1.30.0(supports-color@7.2.0)(zod@4.4.3))(zod@4.4.3) '@openai/codex-sdk': 0.147.0 - promptfoo: 0.122.0(@aws-sdk/credential-provider-node@3.972.80)(@smithy/signature-v4@5.7.2)(@types/json-schema@7.0.15)(@types/node@26.2.0)(pg@8.23.0)(playwright-core@1.62.1)(socks@2.8.9) + promptfoo: 0.122.0(@aws-sdk/credential-provider-node@3.972.80)(@smithy/signature-v4@5.7.2)(@types/json-schema@7.0.15)(@types/node@26.2.0)(pg@8.23.0)(playwright-core@1.62.1)(socks@2.8.9)(supports-color@7.2.0) transitivePeerDependencies: - '@anthropic-ai/sdk' - '@aws-sdk/client-rds-data' @@ -7485,7 +7507,7 @@ snapshots: afinn-165@2.0.2: optional: true - agent-base@6.0.2: + agent-base@6.0.2(supports-color@7.2.0): dependencies: debug: 4.4.3(supports-color@7.2.0) transitivePeerDependencies: @@ -7568,11 +7590,11 @@ snapshots: asynckit@0.4.0: optional: true - axios@1.18.0(debug@4.3.4): + axios@1.18.0(debug@4.3.4(supports-color@7.2.0))(supports-color@7.2.0): dependencies: - follow-redirects: 1.16.0(debug@4.3.4) + follow-redirects: 1.16.0(debug@4.3.4(supports-color@7.2.0)) form-data: 4.0.6 - https-proxy-agent: 5.0.1 + https-proxy-agent: 5.0.1(supports-color@7.2.0) proxy-from-env: 2.1.0 transitivePeerDependencies: - debug @@ -7753,11 +7775,11 @@ snapshots: dependencies: mime-db: 1.54.0 - compression@1.8.1: + compression@1.8.1(supports-color@7.2.0): dependencies: bytes: 3.1.2 compressible: 2.0.18 - debug: 2.6.9 + debug: 2.6.9(supports-color@7.2.0) negotiator: 0.6.4 on-headers: 1.1.0 safe-buffer: 5.2.1 @@ -7803,13 +7825,17 @@ snapshots: debounce@3.0.0: {} - debug@2.6.9: + debug@2.6.9(supports-color@7.2.0): dependencies: ms: 2.0.0 + optionalDependencies: + supports-color: 7.2.0 - debug@4.3.4: + debug@4.3.4(supports-color@7.2.0): dependencies: ms: 2.1.2 + optionalDependencies: + supports-color: 7.2.0 optional: true debug@4.4.3(supports-color@7.2.0): @@ -7919,7 +7945,7 @@ snapshots: encodeurl@2.0.0: {} - engine.io-client@6.6.6: + engine.io-client@6.6.6(supports-color@7.2.0): dependencies: '@socket.io/component-emitter': 3.1.2 debug: 4.4.3(supports-color@7.2.0) @@ -7933,7 +7959,7 @@ snapshots: engine.io-parser@5.2.3: {} - engine.io@6.6.9: + engine.io@6.6.9(supports-color@7.2.0): dependencies: '@types/cors': 2.8.19 '@types/node': 26.2.0 @@ -8069,7 +8095,7 @@ snapshots: expect-type@1.4.0: {} - express-rate-limit@8.6.2(express@5.2.1)(supports-color@7.2.0): + express-rate-limit@8.6.2(express@5.2.1(supports-color@7.2.0))(supports-color@7.2.0): dependencies: debug: 4.4.3(supports-color@7.2.0) express: 5.2.1(supports-color@7.2.0) @@ -8182,9 +8208,9 @@ snapshots: dependencies: is-unicode-supported: 2.1.0 - file-type@21.3.2: + file-type@21.3.2(supports-color@7.2.0): dependencies: - '@tokenizer/inflate': 0.4.1 + '@tokenizer/inflate': 0.4.1(supports-color@7.2.0) strtok3: 10.3.5 token-types: 6.1.2 uint8array-extras: 1.5.0 @@ -8212,9 +8238,9 @@ snapshots: fn.name@1.1.0: {} - follow-redirects@1.16.0(debug@4.3.4): + follow-redirects@1.16.0(debug@4.3.4(supports-color@7.2.0)): optionalDependencies: - debug: 4.3.4 + debug: 4.3.4(supports-color@7.2.0) optional: true foreground-child@3.3.1: @@ -8255,36 +8281,36 @@ snapshots: function-bind@1.1.2: {} - gaxios@7.1.3: + gaxios@7.1.3(supports-color@7.2.0): dependencies: extend: 3.0.2 - https-proxy-agent: 7.0.6 + https-proxy-agent: 7.0.6(supports-color@7.2.0) node-fetch: 3.3.2 rimraf: 5.0.10 transitivePeerDependencies: - supports-color - gaxios@7.3.1: + gaxios@7.3.1(supports-color@7.2.0): dependencies: extend: 3.0.2 - https-proxy-agent: 7.0.6 + https-proxy-agent: 7.0.6(supports-color@7.2.0) node-fetch: 3.3.2 transitivePeerDependencies: - supports-color optional: true - gcp-metadata@8.1.2: + gcp-metadata@8.1.2(supports-color@7.2.0): dependencies: - gaxios: 7.3.1 + gaxios: 7.3.1(supports-color@7.2.0) google-logging-utils: 1.1.3 json-bigint: 1.0.0 transitivePeerDependencies: - supports-color optional: true - gcp-metadata@8.1.4: + gcp-metadata@8.1.4(supports-color@7.2.0): dependencies: - gaxios: 7.1.3 + gaxios: 7.1.3(supports-color@7.2.0) google-logging-utils: 1.1.3 json-bigint: 1.0.0 transitivePeerDependencies: @@ -8315,7 +8341,7 @@ snapshots: '@sec-ant/readable-stream': 0.4.1 is-stream: 4.0.1 - get-uri@8.0.1: + get-uri@8.0.1(supports-color@7.2.0): dependencies: basic-ftp: 5.3.1 data-uri-to-buffer: 8.0.0 @@ -8358,25 +8384,25 @@ snapshots: gopd: 1.2.0 optional: true - google-auth-library@10.5.0: + google-auth-library@10.5.0(supports-color@7.2.0): dependencies: base64-js: 1.5.1 ecdsa-sig-formatter: 1.0.11 - gaxios: 7.1.3 - gcp-metadata: 8.1.4 + gaxios: 7.1.3(supports-color@7.2.0) + gcp-metadata: 8.1.4(supports-color@7.2.0) google-logging-utils: 1.1.3 - gtoken: 8.0.0 + gtoken: 8.0.0(supports-color@7.2.0) jws: 4.0.1 transitivePeerDependencies: - supports-color optional: true - google-auth-library@10.9.1: + google-auth-library@10.9.1(supports-color@7.2.0): dependencies: base64-js: 1.5.1 ecdsa-sig-formatter: 1.0.11 - gaxios: 7.3.1 - gcp-metadata: 8.1.2 + gaxios: 7.3.1(supports-color@7.2.0) + gcp-metadata: 8.1.2(supports-color@7.2.0) google-logging-utils: 1.1.3 jws: 4.0.1 transitivePeerDependencies: @@ -8385,11 +8411,11 @@ snapshots: google-logging-utils@1.1.3: {} - googleapis-common@8.0.3: + googleapis-common@8.0.3(supports-color@7.2.0): dependencies: extend: 3.0.2 - gaxios: 7.1.3 - google-auth-library: 10.5.0 + gaxios: 7.1.3(supports-color@7.2.0) + google-auth-library: 10.5.0(supports-color@7.2.0) google-logging-utils: 1.1.3 qs: 6.15.3 url-template: 2.0.8 @@ -8401,9 +8427,9 @@ snapshots: graceful-fs@4.2.11: {} - gtoken@8.0.0: + gtoken@8.0.0(supports-color@7.2.0): dependencies: - gaxios: 7.1.3 + gaxios: 7.1.3(supports-color@7.2.0) jws: 4.0.1 transitivePeerDependencies: - supports-color @@ -8450,7 +8476,7 @@ snapshots: statuses: 2.0.2 toidentifier: 1.0.1 - http-proxy-agent@7.0.2: + http-proxy-agent@7.0.2(supports-color@7.2.0): dependencies: agent-base: 7.1.4 debug: 4.4.3(supports-color@7.2.0) @@ -8458,7 +8484,7 @@ snapshots: - supports-color optional: true - http-proxy-agent@9.1.0: + http-proxy-agent@9.1.0(supports-color@7.2.0): dependencies: agent-base: 9.0.0 debug: 4.4.3(supports-color@7.2.0) @@ -8469,22 +8495,22 @@ snapshots: http-z@8.1.1: {} - https-proxy-agent@5.0.1: + https-proxy-agent@5.0.1(supports-color@7.2.0): dependencies: - agent-base: 6.0.2 + agent-base: 6.0.2(supports-color@7.2.0) debug: 4.4.3(supports-color@7.2.0) transitivePeerDependencies: - supports-color optional: true - https-proxy-agent@7.0.6: + https-proxy-agent@7.0.6(supports-color@7.2.0): dependencies: agent-base: 7.1.4 debug: 4.4.3(supports-color@7.2.0) transitivePeerDependencies: - supports-color - https-proxy-agent@9.1.0: + https-proxy-agent@9.1.0(supports-color@7.2.0): dependencies: agent-base: 9.0.0 debug: 4.4.3(supports-color@7.2.0) @@ -8495,23 +8521,23 @@ snapshots: human-signals@8.0.1: {} - ibm-cloud-sdk-core@5.6.0: + ibm-cloud-sdk-core@5.6.0(supports-color@7.2.0): dependencies: '@types/debug': 4.1.12 '@types/node': 18.19.80 '@types/tough-cookie': 4.0.0 - axios: 1.18.0(debug@4.3.4) + axios: 1.18.0(debug@4.3.4(supports-color@7.2.0))(supports-color@7.2.0) camelcase: 6.3.0 - debug: 4.3.4 + debug: 4.3.4(supports-color@7.2.0) dotenv: 16.4.5 extend: 3.0.2 - file-type: 21.3.2 + file-type: 21.3.2(supports-color@7.2.0) form-data: 4.0.6 isstream: 0.1.2 jsonwebtoken: 9.0.3 load-esm: 1.0.3 mime-types: 2.1.35 - retry-axios: 2.6.0(axios@1.18.0(debug@4.3.4)) + retry-axios: 2.6.0(axios@1.18.0(debug@4.3.4(supports-color@7.2.0))(supports-color@7.2.0)) tough-cookie: 4.1.3 transitivePeerDependencies: - supports-color @@ -8631,6 +8657,8 @@ snapshots: jose@6.2.9: {} + jpeg-js@0.4.4(patch_hash=912afc7ca433991bc4fdb62ba2569b5c73dfb29454942b95efe8961b279474e6): {} + js-base64@3.9.3: {} js-rouge@3.2.0: {} @@ -8924,21 +8952,21 @@ snapshots: whatwg-url: 14.2.0 optional: true - mongodb@7.5.0(gcp-metadata@8.1.4)(socks@2.8.9): + mongodb@7.5.0(gcp-metadata@8.1.4(supports-color@7.2.0))(socks@2.8.9): dependencies: '@mongodb-js/saslprep': 1.4.13 bson: 7.3.2 mongodb-connection-string-url: 7.0.2 optionalDependencies: - gcp-metadata: 8.1.4 + gcp-metadata: 8.1.4(supports-color@7.2.0) socks: 2.8.9 optional: true - mongoose@9.9.3(gcp-metadata@8.1.4)(socks@2.8.9): + mongoose@9.9.3(gcp-metadata@8.1.4(supports-color@7.2.0))(socks@2.8.9): dependencies: '@standard-schema/spec': 1.1.0 kareem: 3.3.0 - mongodb: 7.5.0(gcp-metadata@8.1.4)(socks@2.8.9) + mongodb: 7.5.0(gcp-metadata@8.1.4(supports-color@7.2.0))(socks@2.8.9) mpath: 0.9.0 mquery: 6.0.0 ms: 2.1.3 @@ -8991,14 +9019,14 @@ snapshots: nanoid@3.3.18: {} - natural@8.1.1(@opentelemetry/api@1.9.1)(gcp-metadata@8.1.4)(socks@2.8.9): + natural@8.1.1(@opentelemetry/api@1.9.1)(gcp-metadata@8.1.4(supports-color@7.2.0))(socks@2.8.9): dependencies: afinn-165: 2.0.2 afinn-165-financialmarketnews: 3.0.0 apparatus: 0.0.10 dotenv: 17.4.2 memjs: 1.3.2 - mongoose: 9.9.3(gcp-metadata@8.1.4)(socks@2.8.9) + mongoose: 9.9.3(gcp-metadata@8.1.4(supports-color@7.2.0))(socks@2.8.9) pg: 8.23.0 redis: 5.12.1(@opentelemetry/api@1.9.1) safe-stable-stringify: 2.5.0 @@ -9235,16 +9263,16 @@ snapshots: p-finally: 1.0.0 optional: true - pac-proxy-agent@9.1.0: + pac-proxy-agent@9.1.0(supports-color@7.2.0): dependencies: agent-base: 9.0.0 debug: 4.4.3(supports-color@7.2.0) - get-uri: 8.0.1 - http-proxy-agent: 9.1.0 - https-proxy-agent: 9.1.0 + get-uri: 8.0.1(supports-color@7.2.0) + http-proxy-agent: 9.1.0(supports-color@7.2.0) + https-proxy-agent: 9.1.0(supports-color@7.2.0) pac-resolver: 9.0.1(quickjs-wasi@2.2.0) quickjs-wasi: 2.2.0 - socks-proxy-agent: 10.1.0 + socks-proxy-agent: 10.1.0(supports-color@7.2.0) transitivePeerDependencies: - kerberos - supports-color @@ -9362,7 +9390,7 @@ snapshots: playwright-core@1.62.1: optional: true - playwright-extra@4.3.6(playwright-core@1.62.1)(playwright@1.62.1): + playwright-extra@4.3.6(playwright-core@1.62.1)(playwright@1.62.1)(supports-color@7.2.0): dependencies: debug: 4.4.3(supports-color@7.2.0) optionalDependencies: @@ -9419,7 +9447,7 @@ snapshots: promise-limit@2.7.0: {} - promptfoo@0.122.0(@aws-sdk/credential-provider-node@3.972.80)(@smithy/signature-v4@5.7.2)(@types/json-schema@7.0.15)(@types/node@26.2.0)(pg@8.23.0)(playwright-core@1.62.1)(socks@2.8.9): + promptfoo@0.122.0(@aws-sdk/credential-provider-node@3.972.80)(@smithy/signature-v4@5.7.2)(@types/json-schema@7.0.15)(@types/node@26.2.0)(pg@8.23.0)(playwright-core@1.62.1)(socks@2.8.9)(supports-color@7.2.0): dependencies: '@anthropic-ai/sdk': 0.115.0(zod@4.4.3) '@apidevtools/json-schema-ref-parser': 15.5.2(@types/json-schema@7.0.15) @@ -9451,7 +9479,7 @@ snapshots: cli-progress: 3.12.0 cli-table3: 0.6.5 commander: 14.0.3 - compression: 1.8.1 + compression: 1.8.1(supports-color@7.2.0) cors: 2.8.6 csv-parse: 7.0.2 csv-stringify: 6.8.3 @@ -9466,7 +9494,7 @@ snapshots: fast-safe-stringify: 2.1.1 fast-xml-parser: 5.11.0 fastest-levenshtein: 1.0.16 - gcp-metadata: 8.1.4 + gcp-metadata: 8.1.4(supports-color@7.2.0) glob: 13.0.6 http-z: 8.1.1 istextorbinary: 9.5.0 @@ -9485,16 +9513,16 @@ snapshots: parse5: 8.0.1 posthog-node: 5.24.17 protobufjs: 8.7.2 - proxy-agent: 8.0.2 + proxy-agent: 8.0.2(supports-color@7.2.0) proxy-from-env: 2.1.0 python-shell: 5.0.0 rfdc: 1.4.1 rxjs: 7.8.2 saxes: 6.0.0 semver: 7.8.5 - simple-git: 3.36.0 - socket.io: 4.8.3 - socket.io-client: 4.8.3 + simple-git: 3.36.0(supports-color@7.2.0) + socket.io: 4.8.3(supports-color@7.2.0) + socket.io-client: 4.8.3(supports-color@7.2.0) text-extensions: 3.1.0 tsx: 4.23.12 undici: 7.29.0 @@ -9508,18 +9536,18 @@ snapshots: '@aws-sdk/client-s3': 3.1113.0 '@aws-sdk/client-sagemaker-runtime': 3.1113.0 '@aws-sdk/credential-provider-sso': 3.973.13 - '@azure/ai-projects': 2.4.0(@aws-sdk/credential-provider-node@3.972.80)(@smithy/signature-v4@5.7.2)(ws@8.21.3)(zod@4.4.3) - '@azure/identity': 4.13.2 + '@azure/ai-projects': 2.4.0(@aws-sdk/credential-provider-node@3.972.80)(@smithy/signature-v4@5.7.2)(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3) + '@azure/identity': 4.13.2(supports-color@7.2.0) '@azure/msal-node': 5.5.0 - '@azure/openai-assistants': 1.0.0-beta.6 - '@azure/storage-blob': 12.33.0 + '@azure/openai-assistants': 1.0.0-beta.6(supports-color@7.2.0) + '@azure/storage-blob': 12.33.0(supports-color@7.2.0) '@fal-ai/client': 1.10.1 - '@googleapis/sheets': 13.0.2 + '@googleapis/sheets': 13.0.2(supports-color@7.2.0) '@huggingface/transformers': 4.2.0 - '@ibm-cloud/watsonx-ai': 1.7.16 + '@ibm-cloud/watsonx-ai': 1.7.16(supports-color@7.2.0) '@langfuse/client': 5.10.1(@opentelemetry/api@1.9.1) '@modelcontextprotocol/sdk': 1.30.0(supports-color@7.2.0)(zod@4.4.3) - '@openai/agents': 0.11.8(@aws-sdk/credential-provider-node@3.972.80)(@smithy/signature-v4@5.7.2)(ws@8.21.3)(zod@4.4.3) + '@openai/agents': 0.11.8(@aws-sdk/credential-provider-node@3.972.80)(@smithy/signature-v4@5.7.2)(supports-color@7.2.0)(ws@8.21.3)(zod@4.4.3) '@openai/codex-sdk': 0.144.6 '@opencode-ai/sdk': 1.18.18 '@playwright/browser-chromium': 1.62.1 @@ -9532,16 +9560,16 @@ snapshots: '@swc/core-linux-x64-gnu': 1.16.0 '@swc/core-linux-x64-musl': 1.16.0 '@swc/core-win32-x64-msvc': 1.16.0 - google-auth-library: 10.9.1 + google-auth-library: 10.9.1(supports-color@7.2.0) hono: 4.13.3 - ibm-cloud-sdk-core: 5.6.0 + ibm-cloud-sdk-core: 5.6.0(supports-color@7.2.0) jks-js: 1.1.7 - natural: 8.1.1(@opentelemetry/api@1.9.1)(gcp-metadata@8.1.4)(socks@2.8.9) + natural: 8.1.1(@opentelemetry/api@1.9.1)(gcp-metadata@8.1.4(supports-color@7.2.0))(socks@2.8.9) node-sql-parser: 5.4.0 pdf-parse: 2.4.5 pem: 1.14.8 playwright: 1.62.1 - playwright-extra: 4.3.6(playwright-core@1.62.1)(playwright@1.62.1) + playwright-extra: 4.3.6(playwright-core@1.62.1)(playwright@1.62.1)(supports-color@7.2.0) read-excel-file: 9.3.10 sharp: 0.35.3(@types/node@26.2.0) transitivePeerDependencies: @@ -9619,16 +9647,16 @@ snapshots: proxy-agent-negotiate@1.1.0: {} - proxy-agent@8.0.2: + proxy-agent@8.0.2(supports-color@7.2.0): dependencies: agent-base: 9.0.0 debug: 4.4.3(supports-color@7.2.0) - http-proxy-agent: 9.1.0 - https-proxy-agent: 9.1.0 + http-proxy-agent: 9.1.0(supports-color@7.2.0) + https-proxy-agent: 9.1.0(supports-color@7.2.0) lru-cache: 7.18.3 - pac-proxy-agent: 9.1.0 + pac-proxy-agent: 9.1.0(supports-color@7.2.0) proxy-from-env: 2.1.0 - socks-proxy-agent: 10.1.0 + socks-proxy-agent: 10.1.0(supports-color@7.2.0) transitivePeerDependencies: - kerberos - supports-color @@ -9724,9 +9752,9 @@ snapshots: onetime: 7.0.0 signal-exit: 4.1.0 - retry-axios@2.6.0(axios@1.18.0(debug@4.3.4)): + retry-axios@2.6.0(axios@1.18.0(debug@4.3.4(supports-color@7.2.0))(supports-color@7.2.0)): dependencies: - axios: 1.18.0(debug@4.3.4) + axios: 1.18.0(debug@4.3.4(supports-color@7.2.0))(supports-color@7.2.0) optional: true retry@0.13.1: @@ -9954,9 +9982,9 @@ snapshots: signal-exit@4.1.0: {} - simple-git@3.36.0: + simple-git@3.36.0(supports-color@7.2.0): dependencies: - '@kwsites/file-exists': 1.1.1 + '@kwsites/file-exists': 1.1.1(supports-color@7.2.0) '@kwsites/promise-deferred': 1.1.1 '@simple-git/args-pathspec': 1.0.3 '@simple-git/argv-parser': 1.1.1 @@ -9972,7 +10000,7 @@ snapshots: smart-buffer@4.2.0: {} - socket.io-adapter@2.5.8: + socket.io-adapter@2.5.8(supports-color@7.2.0): dependencies: debug: 4.4.3(supports-color@7.2.0) ws: 8.21.3 @@ -9981,39 +10009,39 @@ snapshots: - supports-color - utf-8-validate - socket.io-client@4.8.3: + socket.io-client@4.8.3(supports-color@7.2.0): dependencies: '@socket.io/component-emitter': 3.1.2 debug: 4.4.3(supports-color@7.2.0) - engine.io-client: 6.6.6 - socket.io-parser: 4.2.7 + engine.io-client: 6.6.6(supports-color@7.2.0) + socket.io-parser: 4.2.7(supports-color@7.2.0) transitivePeerDependencies: - bufferutil - supports-color - utf-8-validate - socket.io-parser@4.2.7: + socket.io-parser@4.2.7(supports-color@7.2.0): dependencies: '@socket.io/component-emitter': 3.1.2 debug: 4.4.3(supports-color@7.2.0) transitivePeerDependencies: - supports-color - socket.io@4.8.3: + socket.io@4.8.3(supports-color@7.2.0): dependencies: accepts: 1.3.8 base64id: 2.0.0 cors: 2.8.6 debug: 4.4.3(supports-color@7.2.0) - engine.io: 6.6.9 - socket.io-adapter: 2.5.8 - socket.io-parser: 4.2.7 + engine.io: 6.6.9(supports-color@7.2.0) + socket.io-adapter: 2.5.8(supports-color@7.2.0) + socket.io-parser: 4.2.7(supports-color@7.2.0) transitivePeerDependencies: - bufferutil - supports-color - utf-8-validate - socks-proxy-agent@10.1.0: + socks-proxy-agent@10.1.0(supports-color@7.2.0): dependencies: agent-base: 9.0.0 debug: 4.4.3(supports-color@7.2.0) diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 2ef35d5..0d84274 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -35,3 +35,5 @@ peerDependencyRules: allowedVersions: vite: "*" vitest: "*" +patchedDependencies: + jpeg-js@0.4.4: patches/jpeg-js@0.4.4.patch diff --git a/skills/rokit/SKILL.md b/skills/rokit/SKILL.md index 6efd517..82f9bcc 100644 --- a/skills/rokit/SKILL.md +++ b/skills/rokit/SKILL.md @@ -22,7 +22,8 @@ repo. 4. Use `--fields` to keep observations small when only a few values are needed. 5. Screenshot commands append a timestamp to the requested filename. Use the returned JSON `data.path` as the artifact path instead of assuming the input - path was written. + path was written. Non-image responses and detected decoding errors fail + capture. JPEG scan completion and restart order are checked before saving. 6. For live proof, use `rokit snapshot` for a quick state read, `rokit proof ` for review artifacts, or `pnpm live:probe` in the rokit repo for the full generic package/install/launch/input/proof probe. diff --git a/src/response-body.ts b/src/response-body.ts index 0ab23be..c07c4ad 100644 --- a/src/response-body.ts +++ b/src/response-body.ts @@ -3,9 +3,10 @@ import { Effect } from "effect"; export const readResponseBytesEffect = ( response: Response, onError: (error: unknown) => E, + maxBytes = Number.POSITIVE_INFINITY, ): Effect.Effect => Effect.tryPromise({ - try: (signal) => readResponseBytes(response, signal), + try: (signal) => readResponseBytes(response, signal, maxBytes), catch: onError, }); @@ -18,15 +19,22 @@ export const readResponseTextEffect = ( catch: onError, }); -const readResponseBytes = async (response: Response, signal: AbortSignal): Promise => { +const readResponseBytes = async ( + response: Response, + signal: AbortSignal, + maxBytes = Number.POSITIVE_INFINITY, +): Promise => { if (response.body === null) { return new Uint8Array(); } const chunks: Uint8Array[] = []; + let receivedBytes = 0; await response.body.pipeTo( new WritableStream({ write: (chunk) => { + receivedBytes += chunk.byteLength; + if (receivedBytes > maxBytes) throw new Error("response exceeds maximum byte length"); chunks.push(chunk); }, }), diff --git a/src/screenshot-image.ts b/src/screenshot-image.ts new file mode 100644 index 0000000..e7d50ce --- /dev/null +++ b/src/screenshot-image.ts @@ -0,0 +1,138 @@ +import { crc32, inflateSync } from "node:zlib"; +import { decode } from "jpeg-js"; +import { PNG } from "pngjs"; + +// Allow DCI 4K as well as Roku's UHD output without allocating for arbitrary dimensions. +const maxPixels = 4096 * 2160; +export const maxScreenshotBytes = 64 * 1024 * 1024; +const pngSignature = Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]); + +export function validateScreenshotImage(bytes: Uint8Array): void { + const image = Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength); + if (image.subarray(0, 8).equals(pngSignature)) { + validatePng(image); + } else if (image[0] === 0xff && image[1] === 0xd8) { + validateJpegSegments(image); + decode(image, { + tolerantDecoding: false, + maxResolutionInMP: maxPixels / 1_000_000, + maxMemoryUsageInMB: 256, + }); + } else { + throw new Error("screenshot response is not a JPEG or PNG image"); + } +} + +function validatePng(image: Buffer): void { + if ( + image.length < 33 || + image.readUInt32BE(8) !== 13 || + image.toString("ascii", 12, 16) !== "IHDR" + ) { + throw new Error("invalid PNG header"); + } + const width = image.readUInt32BE(16); + const height = image.readUInt32BE(20); + // pngjs retains a Buffer per scanline; pixel count alone does not bound row-object overhead. + if (width === 0 || height === 0 || width > 8192 || height > 8192 || width * height > maxPixels) { + throw new Error("PNG screenshot exceeds supported dimensions"); + } + + const compressed = Buffer.allocUnsafe(image.length); + let compressedLength = 0; + for (let offset = 8; offset < image.length;) { + if (image.length - offset < 12) throw new Error("truncated PNG chunk"); + const length = image.readUInt32BE(offset); + const end = offset + 12 + length; + if (end > image.length) throw new Error("truncated PNG chunk"); + const kind = image.toString("ascii", offset + 4, offset + 8); + if (crc32(image.subarray(offset + 4, end - 4)) !== image.readUInt32BE(end - 4)) { + throw new Error("invalid PNG chunk checksum"); + } + if (kind === "IHDR" && offset !== 8) throw new Error("duplicate PNG header"); + if (kind === "IEND" && length !== 0) throw new Error("invalid PNG end chunk"); + if (kind === "IDAT") { + image.copy(compressed, compressedLength, offset + 8, end - 4); + compressedLength += length; + } + offset = end; + } + // pngjs's interlaced sync decoder has no inflate limit. Bound and verify the + // complete zlib stream first, including its checksum, before decoding pixels. + const pixelFormats: Readonly< + Record + > = { + 0: { channels: 1, depths: [1, 2, 4, 8, 16] }, + 2: { channels: 3, depths: [8, 16] }, + 3: { channels: 1, depths: [1, 2, 4, 8] }, + 4: { channels: 2, depths: [8, 16] }, + 6: { channels: 4, depths: [8, 16] }, + }; + const format = pixelFormats[image[25] ?? -1]; + const depth = image[24]; + if (format === undefined || depth === undefined || !format.depths.includes(depth)) { + throw new Error("invalid PNG pixel format"); + } + const channels = format.channels; + const passes = + image[28] === 1 + ? ([ + [0, 0, 8, 8], + [4, 0, 8, 8], + [0, 4, 4, 8], + [2, 0, 4, 4], + [0, 2, 2, 4], + [1, 0, 2, 2], + [0, 1, 1, 2], + ] as const) + : ([[0, 0, 1, 1]] as const); + let expectedBytes = 0; + for (const [x, y, dx, dy] of passes) { + const columns = Math.max(0, Math.ceil((width - x) / dx)); + const rows = Math.max(0, Math.ceil((height - y) / dy)); + if (columns > 0) expectedBytes += rows * (1 + Math.ceil((columns * channels * depth) / 8)); + } + const inflated = inflateSync(compressed.subarray(0, compressedLength), { + maxOutputLength: expectedBytes, + }); + if (inflated.length !== expectedBytes) throw new Error("invalid PNG pixel data length"); + PNG.sync.read(image, { checkCRC: true }); +} + +function validateJpegSegments(image: Buffer): void { + let entropy = false; + let hasScanData = false; + let restarts = 0; + for (let offset = 2; offset < image.length;) { + if (image[offset++] !== 0xff) { + if (entropy) { + hasScanData = true; + continue; + } + throw new Error("invalid JPEG marker"); + } + while (image[offset] === 0xff) offset += 1; + const marker = image[offset++]; + if (entropy && marker === 0) { + hasScanData = true; + continue; + } + if (entropy && marker !== undefined && marker >= 0xd0 && marker <= 0xd7) { + if (marker !== 0xd0 + (restarts % 8)) throw new Error("invalid JPEG restart sequence"); + restarts += 1; + continue; + } + if (marker === 0xd9) { + if (!hasScanData) throw new Error("JPEG has no image scan data"); + return; + } + if (offset + 2 > image.length) throw new Error("truncated JPEG segment"); + const length = image.readUInt16BE(offset); + if (length < 2 || offset + length > image.length) + throw new Error("invalid JPEG segment length"); + if (marker === 0xda) restarts = 0; + offset += length; + entropy = marker === 0xda; + } + throw new Error("missing JPEG end marker"); +} diff --git a/src/screenshot.ts b/src/screenshot.ts index 3ad22bd..4ac7c69 100644 --- a/src/screenshot.ts +++ b/src/screenshot.ts @@ -4,6 +4,7 @@ import type { PlatformError } from "effect/PlatformError"; import { digestAuthHeaderEffect, parseDigestChallenge } from "./digest-auth.js"; import { readResponseBytesEffect, readResponseTextEffect } from "./response-body.js"; import type { RokuContext } from "./roku-context.js"; +import { maxScreenshotBytes, validateScreenshotImage } from "./screenshot-image.js"; import { abortSignalWithTimeout } from "./timing.js"; export type ScreenshotCaptureOptions = { @@ -138,14 +139,24 @@ const fetchScreenshotImageEffect = Effect.fn("fetchScreenshotImage")(function* ( ); } - return yield* readResponseBytesEffect( + const image = yield* readResponseBytesEffect( response, (error) => new ScreenshotCaptureError({ detail: formatErrorMessage(error), outputPath: url.pathname, }), + maxScreenshotBytes, ); + yield* Effect.try({ + try: () => validateScreenshotImage(image), + catch: (error) => + new ScreenshotCaptureError({ + detail: `invalid screenshot image: ${formatErrorMessage(error)}`, + outputPath: url.pathname, + }), + }); + return image; }); const fetchAuthorizedScreenshotImageEffect = Effect.fn("fetchAuthorizedScreenshotImage")(function* ( diff --git a/test/fixtures/images.ts b/test/fixtures/images.ts new file mode 100644 index 0000000..ab6ee81 --- /dev/null +++ b/test/fixtures/images.ts @@ -0,0 +1,74 @@ +import { encode } from "jpeg-js"; +import { PNG } from "pngjs"; + +const pixels = Buffer.from([255, 0, 0, 255, 0, 255, 0, 255]); +export const jpegImage = encode({ width: 2, height: 1, data: pixels }, 90).data; +const png = new PNG({ width: 2, height: 1 }); +png.data = pixels; +export const pngImage = PNG.sync.write(png); + +// Synthetic 17×17 RGB gradient (x*15, y*15, (x+y)*7), encoded with cjpeg. +// Baseline uses 4:2:0 and -restart 3B (a partial final interval); progressive +// uses 4:2:0 and -restart 1B; grayscale uses -grayscale -restart 1B. +export const baselineRestartJpeg = Buffer.from( + "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIx" + + "wcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy" + + "MjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAARABEDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAw" + + "QFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkK" + + "FhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmq" + + "KjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEB" + + "AQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRob" + + "HBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOE" + + "hYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+P" + + "n6/90ABAAD/9oADAMBAAIRAxEAPwDzPT9C6fJXVafoXT5K6PT9C6fJXVafoXT5KinWHkeebanFf2F/sUV6b/YX+x+l" + + "Fb+2PtP7c8zI0/tXVaf2oorzKZ+L5H0P/9D26iiisBn/2Q==", + "base64", +); +export const progressiveRestartJpeg = Buffer.from( + "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIx" + + "wcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy" + + "MjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wgARCAARABEDASIAAhEBAxEB/8QAFwABAQEBAAAAAAAAAAAAAAAAAAUGA/" + + "/EABgBAAMBAQAAAAAAAAAAAAAAAAACBQME/90ABAAB/9oADAMBAAIQAxAAAAHM1aNVT//Q5NMa1//RrVTni//S24zP" + + "/8QAFhABAQEAAAAAAAAAAAAAAAAAAwAT/9oACAEBAAEFAjC//9Awv//Rwv/SML//0zC//9TC/9U7/9Y7/9e//8QAFh" + + "EBAQEAAAAAAAAAAAAAAAAAAAQU/9oACAEDAQE/AYbn/9Dc/9GF/9J//8QAFhEBAQEAAAAAAAAAAAAAAAAAAAIS/9oA" + + "CAECAQE/AZt//9Db/9GX/9J//8QAFBABAAAAAAAAAAAAAAAAAAAAAP/aAAgBAQAGPwJ//9B//9F//9J//9N//9R//9" + + "V//9Z//9d//8QAFhABAQEAAAAAAAAAAAAAAAAAAGFx/9oACAEBAAE/IYP/0IP/0cP/0oP/04P/1MP/1T//1j//13//" + + "2gAMAwEAAgADAAAAED//0Df/0Q//0g//xAAYEQEAAwEAAAAAAAAAAAAAAAAAITFBcf/aAAgBAwEBPxCiX//Q6f/Rw/" + + "/Sf//EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQIBAT8QH//QP//RP//Sf//EABgQAQEBAQEAAAAAAAAAAAAAAAAx" + + "QRHw/9oACAEBAAE/EIv/0Iv/0X//0ov/04v/1PfH/9XD/9bD/9d//9k=", + "base64", +); +export const grayscaleRestartJpeg = Buffer.from( + "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIx" + + "wcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/wAALCAARABEBAREA/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL" + + "/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJi" + + "coKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ip" + + "qrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/90ABAAB/9oACAEBAAA/APM9P0" + + "Lp8lf/0Od0/QunyV//0av9hf7Ff//SXT9C6fJX/9Pq9P0Lp8lf/9T0P+wv9j9K/9XrNP7V/9b1bT+1f//X9ur/2Q==", + "base64", +); + +// Same synthetic gradient, with -restart 2B to exercise partial final intervals +// in single-component scans (grayscale and progressive AC scans). +export const progressivePartialRestartJpeg = Buffer.from( + "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIx" + + "wcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy" + + "MjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wgARCAARABEDASIAAhEBAxEB/8QAFwABAQEBAAAAAAAAAAAAAAAAAAUGBP" + + "/EABgBAAIDAAAAAAAAAAAAAAAAAAMFAAIE/90ABAAC/9oADAMBAAIQAxAAAAHM1aNWsitMI6//0K1UzpewEdf/xAAW" + + "EAEBAQAAAAAAAAAAAAAAAAADABP/2gAIAQEAAQUCMIwv/9DCML//0TCwv//SOO//07//xAAXEQEBAQEAAAAAAAAAAA" + + "AAAAAEABAU/9oACAEDAQE/AQuu6//QDn//xAAXEQEBAQEAAAAAAAAAAAAAAAACABAS/9oACAECAQE/AS7u/9A5/8QA" + + "FRABAQAAAAAAAAAAAAAAAAAAEAD/2gAIAQEABj8CP//QP//RP//SP//Tv//EABcQAQEBAQAAAAAAAAAAAAAAAABhcR" + + "D/2gAIAQEAAT8hgg//0MIP/9GDD//S4f/Tf//aAAwDAQACAAMAAAAQPN//0Aw//8QAGREAAQUAAAAAAAAAAAAAAAAA" + + "ABAhMUFx/9oACAEDAQE/EIHNH//Qon//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAECAQE/EAf/0B//xAAYEAEBAQ" + + "EBAAAAAAAAAAAAAAAAMUER8P/aAAgBAQABPxCLF//QcX//0Yvvj//Sww//03//2Q==", + "base64", +); +export const grayscalePartialRestartJpeg = Buffer.from( + "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIx" + + "wcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/wAALCAARABEBAREA/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL" + + "/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJi" + + "coKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ip" + + "qrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/90ABAAC/9oACAEBAAA/APM9P0" + + "Lp8ldVp+hdPkr/0Kv9hf7FW9P0Lp8lf//R6vT9C6fJWx/YX+x+lf/S6zT+1dVp/av/0/bq/9k=", + "base64", +); diff --git a/test/response-body.test.ts b/test/response-body.test.ts new file mode 100644 index 0000000..71b9636 --- /dev/null +++ b/test/response-body.test.ts @@ -0,0 +1,30 @@ +import { Effect } from "effect"; +import { describe, expect, it } from "vite-plus/test"; +import { readResponseBytesEffect } from "../src/response-body.js"; + +describe("bounded response bodies", () => { + it("cancels a stream as soon as its byte budget is exceeded", async () => { + let cancelled = false; + const response = new Response( + new ReadableStream({ + pull(controller) { + controller.enqueue(new Uint8Array(3)); + }, + cancel() { + cancelled = true; + }, + }), + ); + await expect(Effect.runPromise(readResponseBytesEffect(response, String, 5))).rejects.toThrow( + "maximum byte length", + ); + expect(cancelled).toBe(true); + }); + + it("accepts a body exactly at its budget", async () => { + const body = new Uint8Array([1, 2, 3]); + await expect( + Effect.runPromise(readResponseBytesEffect(new Response(body), String, body.length)), + ).resolves.toEqual(body); + }); +}); diff --git a/test/roku-capture.test.ts b/test/roku-capture.test.ts index a3454df..7ba48e2 100644 --- a/test/roku-capture.test.ts +++ b/test/roku-capture.test.ts @@ -11,6 +11,8 @@ import { type RokuContext, } from "../src/roku.js"; +import { jpegImage, pngImage } from "./fixtures/images.js"; + const context: RokuContext = { target: "192.0.2.1", timeoutMs: 100, @@ -45,43 +47,84 @@ describe("Roku retry helpers", () => { expect(fetchMock).toHaveBeenCalledTimes(2); }); - it("captures screenshots through a temp path and copies the requested output", async () => { - const root = await mkdtemp(join(tmpdir(), "rokit-capture-test-")); - - try { - const fetchMock = vi - .fn() - .mockResolvedValueOnce( - new Response("", { - headers: { - "WWW-Authenticate": 'Digest qop="auth", realm="rokudev", nonce="nonce"', - }, - status: 401, + it.each([ + ["jpg", jpegImage], + ["png", pngImage], + ] as const)( + "captures %s screenshots through a temp path and copies the requested output", + async (extension, image) => { + const root = await mkdtemp(join(tmpdir(), "rokit-capture-test-")); + + try { + const fetchMock = vi + .fn() + .mockResolvedValueOnce( + new Response("", { + headers: { + "WWW-Authenticate": 'Digest qop="auth", realm="rokudev", nonce="nonce"', + }, + status: 401, + }), + ) + .mockResolvedValueOnce( + new Response( + `screenshot`, + ), + ) + .mockResolvedValueOnce(new Response(Uint8Array.from(image))); + vi.stubGlobal("fetch", fetchMock); + + const outputPath = join(root, "shots", "story.jpg"); + await expect( + captureScreenshot({ ...context, password: "pass" }, outputPath, { + attempts: 1, + tempDirPrefix: "test capture", }), - ) - .mockResolvedValueOnce( - new Response('screenshot'), - ) - .mockResolvedValueOnce(new Response("image")); - vi.stubGlobal("fetch", fetchMock); - - const outputPath = join(root, "shots", "story.jpg"); + ).resolves.toBe(resolve(outputPath)); + await expect(access(outputPath)).resolves.toBeUndefined(); + await expect(readFile(outputPath)).resolves.toEqual(image); + + expect(fetchMock).toHaveBeenCalledTimes(3); + expect(String(fetchMock.mock.calls[0]?.[0])).toBe("http://192.0.2.1/plugin_inspect"); + expect(String(fetchMock.mock.calls[2]?.[0])).toBe( + `http://192.0.2.1/pkgs/dev.${extension}?cache=1&size=1280`, + ); + } finally { + await rm(root, { force: true, recursive: true }); + } + }, + ); + + it("rejects an HTML screenshot response without writing an artifact after bounded retries", async () => { + const root = await mkdtemp(join(tmpdir(), "rokit-invalid-capture-")); + let calls = 0; + vi.stubGlobal( + "fetch", + vi.fn(async () => { + calls += 1; + if (calls % 3 === 1) + return new Response("", { + status: 401, + headers: { "WWW-Authenticate": 'Digest qop="auth", realm="rokudev", nonce="nonce"' }, + }); + if (calls % 3 === 2) return new Response('screenshot'); + return new Response("error page", { + headers: { "Content-Type": "image/jpeg" }, + }); + }), + ); + try { + const outputPath = join(root, "shot.jpg"); await expect( captureScreenshot({ ...context, password: "pass" }, outputPath, { - attempts: 1, - tempDirPrefix: "test capture", + attempts: 2, + retryDelayMs: 1, }), - ).resolves.toBe(resolve(outputPath)); - await expect(access(outputPath)).resolves.toBeUndefined(); - await expect(readFile(outputPath, "utf8")).resolves.toBe("image"); - - expect(fetchMock).toHaveBeenCalledTimes(3); - expect(String(fetchMock.mock.calls[0]?.[0])).toBe("http://192.0.2.1/plugin_inspect"); - expect(String(fetchMock.mock.calls[2]?.[0])).toBe( - "http://192.0.2.1/pkgs/dev.jpg?cache=1&size=1280", - ); + ).rejects.toThrow("invalid screenshot image"); + expect(calls).toBe(6); + await expect(access(outputPath)).rejects.toThrow(); } finally { - await rm(root, { force: true, recursive: true }); + await rm(root, { recursive: true, force: true }); } }); diff --git a/test/screenshot-image.test.ts b/test/screenshot-image.test.ts new file mode 100644 index 0000000..e515c16 --- /dev/null +++ b/test/screenshot-image.test.ts @@ -0,0 +1,199 @@ +import { crc32, deflateSync } from "node:zlib"; +import { describe, expect, it } from "vite-plus/test"; +import { validateScreenshotImage } from "../src/screenshot-image.js"; +import { + baselineRestartJpeg, + progressivePartialRestartJpeg, + grayscalePartialRestartJpeg, + progressiveRestartJpeg, + grayscaleRestartJpeg, + jpegImage, + pngImage, +} from "./fixtures/images.js"; + +function pngChunk(kind: string, data: Buffer): Buffer { + const chunk = Buffer.alloc(data.length + 12); + chunk.writeUInt32BE(data.length); + chunk.write(kind, 4); + data.copy(chunk, 8); + chunk.writeUInt32BE(crc32(chunk.subarray(4, -4)), chunk.length - 4); + return chunk; +} + +function smallPng(rawPixels: Buffer, interlaced = false, width = 1, height = 1): Buffer { + const header = Buffer.from([0, 0, 0, 1, 0, 0, 0, 1, 8, 6, 0, 0, Number(interlaced)]); + header.writeUInt32BE(width, 0); + header.writeUInt32BE(height, 4); + return Buffer.concat([ + pngImage.subarray(0, 8), + pngChunk("IHDR", header), + pngChunk("IDAT", deflateSync(rawPixels)), + pngChunk("IEND", Buffer.alloc(0)), + ]); +} + +function pixelFormatPng(colorType: number, depth: number, channels: number): Buffer { + return Buffer.concat([ + pngImage.subarray(0, 8), + pngChunk("IHDR", Buffer.from([0, 0, 0, 1, 0, 0, 0, 1, depth, colorType, 0, 0, 0])), + ...(colorType === 3 ? [pngChunk("PLTE", Buffer.from([0, 0, 0]))] : []), + pngChunk("IDAT", deflateSync(Buffer.alloc(1 + Math.ceil((depth * channels) / 8)))), + pngChunk("IEND", Buffer.alloc(0)), + ]); +} + +const badCrc = Buffer.from(pngImage); +badCrc[badCrc.length - 1] ^= 1; +const largePng = Buffer.from(pngImage); +largePng.writeUInt32BE(100_000, 16); +const corruptJpeg = Buffer.from(jpegImage); +corruptJpeg[corruptJpeg.indexOf(Buffer.from([0xff, 0xda])) + 2] = 0xff; +const largeJpeg = Buffer.from(jpegImage); +const frameOffset = largeJpeg.indexOf(Buffer.from([0xff, 0xc0])); +largeJpeg.writeUInt16BE(10000, frameOffset + 5); +largeJpeg.writeUInt16BE(10000, frameOffset + 7); +const interlacedPng = smallPng(Buffer.from([0, 255, 0, 0, 255]), true); + +const scanOffset = jpegImage.indexOf(Buffer.from([0xff, 0xda])); +const scanlessJpeg = Buffer.concat([jpegImage.subarray(0, scanOffset), Buffer.from([0xff, 0xd9])]); +const emptyScanJpeg = Buffer.concat([ + jpegImage.subarray(0, scanOffset + 2 + jpegImage.readUInt16BE(scanOffset + 2)), + Buffer.from([0xff, 0xd9]), +]); +// Each copy of the genuine fixture's entropy encodes one complete 8×8 MCU. +function restartJpeg(declaredMcus: number, includedMcus: number): Buffer { + const prefix = Buffer.from(jpegImage.subarray(0, scanOffset)); + prefix.writeUInt16BE(declaredMcus * 8, frameOffset + 7); + const scanEnd = scanOffset + 2 + jpegImage.readUInt16BE(scanOffset + 2); + const entropy = jpegImage.subarray(scanEnd, -2); + return Buffer.concat([ + prefix, + Buffer.from([0xff, 0xdd, 0, 4, 0, 1]), + jpegImage.subarray(scanOffset, scanEnd), + ...Array.from({ length: includedMcus }, (_, index) => + index === 0 + ? entropy + : Buffer.concat([Buffer.from([0xff, 0xd0 + ((index - 1) % 8)]), entropy]), + ), + Buffer.from([0xff, 0xd9]), + ]); +} + +const finalInterval = restartJpeg(2, 2); +const finalIntervalStart = finalInterval.indexOf(Buffer.from([0xff, 0xd0])) + 2; +const missingFinalInterval = Buffer.concat([ + finalInterval.subarray(0, finalIntervalStart), + Buffer.from([0xff, 0xd9]), +]); +const truncatedFinalInterval = Buffer.concat([ + finalInterval.subarray(0, finalIntervalStart + 1), + Buffer.from([0xff, 0xd9]), +]); +const badRestartSequence = restartJpeg(2, 2); +badRestartSequence[badRestartSequence.indexOf(Buffer.from([0xff, 0xd0])) + 1] = 0xd1; +const restartWithoutInterval = restartJpeg(2, 2); +restartWithoutInterval.writeUInt16BE( + 0, + restartWithoutInterval.indexOf(Buffer.from([0xff, 0xdd])) + 4, +); + +const ancillary = pngChunk("tEXt", Buffer.from("note\0synthetic")); +ancillary[ancillary.length - 1] ^= 1; +const ancillaryCrcPng = Buffer.concat([pngImage.subarray(0, 33), ancillary, pngImage.subarray(33)]); +const header = Buffer.from([0, 0, 0, 1, 0, 0, 0, 1, 8, 6, 0, 0, 0]); +const missingZlibChecksumPng = Buffer.concat([ + pngImage.subarray(0, 8), + pngChunk("IHDR", header), + pngChunk("IDAT", deflateSync(Buffer.from([0, 255, 0, 0, 255])).subarray(0, -4)), + pngChunk("IEND", Buffer.alloc(0)), +]); + +describe("screenshot image integrity", () => { + it.each([ + [0, 1, 1], + [0, 2, 1], + [0, 4, 1], + [0, 8, 1], + [0, 16, 1], + [2, 8, 3], + [2, 16, 3], + [3, 1, 1], + [3, 2, 1], + [3, 4, 1], + [3, 8, 1], + [4, 8, 2], + [4, 16, 2], + [6, 8, 4], + [6, 16, 4], + ])("accepts PNG color type %s at depth %s", (colorType, depth, channels) => { + expect(() => validateScreenshotImage(pixelFormatPng(colorType, depth, channels))).not.toThrow(); + }); + + it.each([ + [2, 1, 3], + [2, 2, 3], + [2, 4, 3], + [3, 16, 1], + [4, 1, 2], + [4, 2, 2], + [4, 4, 2], + [6, 1, 4], + [6, 2, 4], + [6, 4, 4], + ])("rejects PNG color type %s at depth %s", (colorType, depth, channels) => { + expect(() => validateScreenshotImage(pixelFormatPng(colorType, depth, channels))).toThrow(); + }); + + it.each([ + jpegImage, + pngImage, + interlacedPng, + smallPng(Buffer.alloc(8192 * 4 + 1), false, 8192, 1), + smallPng(Buffer.alloc(8192 * 5), false, 1, 8192), + restartJpeg(2, 2), + restartJpeg(10, 10), + baselineRestartJpeg, + progressiveRestartJpeg, + grayscaleRestartJpeg, + progressivePartialRestartJpeg, + grayscalePartialRestartJpeg, + ])("decodes a genuine image without changing its bytes", (image) => { + const original = Buffer.from(image); + expect(() => validateScreenshotImage(image)).not.toThrow(); + expect(image).toEqual(original); + }); + + it.each([ + ["empty", Buffer.alloc(0)], + ["HTML", Buffer.from("error")], + ["truncated JPEG", jpegImage.subarray(0, jpegImage.length - 10)], + ["corrupt JPEG segment", corruptJpeg], + ["JPEG without a scan", scanlessJpeg], + ["JPEG early EOI before first restart", restartJpeg(2, 1)], + ["JPEG early EOI after restart", restartJpeg(3, 2)], + ["JPEG missing final interval", missingFinalInterval], + ["JPEG truncated final interval", truncatedFinalInterval], + ["JPEG restart sequence", badRestartSequence], + ["JPEG restart without interval", restartWithoutInterval], + ["JPEG without scan data", emptyScanJpeg], + ["PNG ancillary checksum", ancillaryCrcPng], + ["PNG missing zlib checksum", missingZlibChecksumPng], + ["oversized JPEG", largeJpeg], + ["truncated PNG header", pngImage.subarray(0, 24)], + ["truncated PNG chunk", pngImage.subarray(0, pngImage.length - 5)], + ["PNG checksum", badCrc], + ["PNG duplicate end chunk", Buffer.concat([pngImage, pngChunk("IEND", Buffer.alloc(0))])], + ["PNG over width limit", smallPng(Buffer.alloc(8193 * 4 + 1), false, 8193, 1)], + ["PNG over height limit", smallPng(Buffer.alloc(8193 * 5), false, 1, 8193)], + [ + "PNG nonempty end chunk", + Buffer.concat([pngImage.subarray(0, -12), pngChunk("IEND", Buffer.from([0]))]), + ], + ["oversized PNG", largePng], + ["short PNG pixels", smallPng(Buffer.from([0, 255]))], + ["PNG expansion beyond dimensions", smallPng(Buffer.alloc(1_000_000))], + ["interlaced PNG expansion beyond dimensions", smallPng(Buffer.alloc(1_000_000), true)], + ] as const)("rejects %s", (_label, image) => { + expect(() => validateScreenshotImage(image)).toThrow(); + }); +}); diff --git a/vite.config.ts b/vite.config.ts index 2598f74..5198933 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,6 +1,10 @@ import { defineConfig } from "vite-plus"; export default defineConfig({ + pack: { + // npm consumers do not apply our pnpm decoder patch; ship the patched code. + deps: { alwaysBundle: ["jpeg-js"], onlyBundle: ["jpeg-js"] }, + }, test: { coverage: { // Coverage blind spot: the boot test spawns the packaged dist/rokit.mjs