Repository navigation
feat(printing): add PDF document printing with signed retrieval - #1
Merged
Merged
Conversation
Introduce PDF as a document type alongside structured receipts: - protocol: JobDocument union (receipt or PDF reference), PdfSource with HTTPS/loopback URL, SHA-256 and byte length, print settings, and optional document capability fields on printer capabilities - renderer: validate and rasterize PDFs with hayro under size, page, pixel, raster-byte, and deadline limits - spooler: native lp submission on Unix with IPP options; rasterized GDI fallback on Windows - documents: new oppa-documents crate for signed, integrity-checked fetch - agent: fetch-then-claim PDF job processing and local PDF test prints - discovery: CUPS paper and duplex options via lpoptions - desktop: PDF test print, route and paper display - server SDK: verifyDocumentRequest for agent document requests - fixtures, schema, and documentation Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- bump async-trait to 0.1.92, which no longer triggers double_must_use on async trait declarations - use assert_eq!/len checks instead of assert!(..is_empty()) (assert_is_empty) - keep fetch_update in bump_revision with an allow(deprecated) and a note, since its replacement requires Rust 1.95 and the workspace MSRV is 1.85 Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This branch was successfully deployed
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.
Summary
Adds PDF document printing alongside structured receipts.
PrintJob.documentbecomes a union. Receipts keep their exact legacy JSON shape. A PDF is{format: "pdf", source: {type: "url", url, sha256, byteLength}, settings?}. Bytes never travel inside protocol messages. Printer capabilities gain optionaldocumentFormats,paperSizes,customPaperSize, andprintOptions.oppa-documentscrate. The agent fetches with an Ed25519-signed request using its existing credential, refuses redirects, enforces the declared length, and verifies SHA-256 before use. Nothing secret is stored in SQLite.@openprinter/serveraddsverifyDocumentRequest.hayro(pure Rust) validates and rasterizes PDFs under size, page, pixel, raster-byte, and deadline limits. Copies, paper (A4/A5/Letter/Legal/custom mm for labels), orientation, scaling, and page ranges are applied.lpwith IPP options. Windows rasterizes into the existing GDI path. Duplex on Windows fails withdocument.option_unsupported.document.*codes.print-documents,protocol, andjob-deliverypages, plus crate and package READMEs.Known gaps
packages/sdk(cloud client) does not accept PDF documents.@openprinter/protocoland the server SDK before connecting agents from this release. A follow-up change will gate these fields behind protocol version negotiation.oppadesktop crate was not compile-verified for Windows (needs a MinGW toolchain forring). Spooler, discovery, renderer, and Windows print crates pass a Windows target check.media=Custom.WxHmm,scaling=N) are unverified against a live queue.Verification
cargo fmt --all --check,cargo clippy --workspace --all-targets --all-features -- -D warnings,cargo test --workspace(189 passing)pnpm format:check,pnpm lint,pnpm typecheck,pnpm test(protocol 53, sdk 6, server 19, example 1),schema:checkpnpm --filter @oppa/www build🤖 Generated with Claude Code