Add archive component: ZIP/tar/gzip extract and create#20
Draft
Copilot wants to merge 3 commits into
Draft
Conversation
Agent-Logs-Url: https://github.com/yoshuawuyts/components/sessions/eb5699bc-490d-4e04-b912-34d6cfac1fb8 Co-authored-by: yoshuawuyts <2467194+yoshuawuyts@users.noreply.github.com>
Agent-Logs-Url: https://github.com/yoshuawuyts/components/sessions/eb5699bc-490d-4e04-b912-34d6cfac1fb8 Co-authored-by: yoshuawuyts <2467194+yoshuawuyts@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add wasm component for archive creation and extraction functionality
Add archive component: ZIP/tar/gzip extract and create
May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New Wasm component for archive creation and extraction operating entirely on byte arrays — no filesystem I/O.
WIT interface (
wit/world.wit)record file-entry { name: string, data: list<u8>, permissions: option<u32>, // Unix mode bits } export extract: func(input: list<u8>) -> result<list<file-entry>, string>; export create-zip: func(files: list<file-entry>) -> result<list<u8>, string>; export create-tar-gz: func(files: list<file-entry>) -> result<list<u8>, string>;Implementation
extract— auto-detects format from magic bytes: ZIP (PK\x03\x04), gzip (\x1F\x8B), fallback to tar. Gzip payloads that contain a POSIX/GNU tar archive are extracted transparently as tar.gz.create-zip—zipcrate pinned to>=2.3to avoid the path-canonicalization CVE present in>=1.3,<2.3. Unix permissions round-trip.create-tar-gz—tar+flate2with the pure-Rustminiz_oxidebackend. Permissions preserved; entries without permissions default to0o644.Other
justfileandREADME.mdupdated to includearchive.