Shared clipboard: wire protocol, host backends (pf-clipboard) + macOS client #4
Reference in New Issue
Block a user
Delete Branch "feat/shared-clipboard-v2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Port of the stranded
feat/shared-clipboardwork (authored 2026-07-12 on home-worker-5, pre-W6 base) onto current main, reshaped for the W6 crate decomposition. Design:punktfunk-planning/design/clipboard-and-file-transfer.md.Commits
CLIP_CANCELLED_CODE0x60 → 0x70 (main's pairing-rejection close block claimed 0x60–0x67),Negotiated.host_capscoexists with main's tuple plumbing (needed acrossready_txforpunktfunk_connection_host_caps).pf-clipboardsubsystem crate (the pf-inject/pf-capture pattern) instead of growingpunktfunk-hostback out; the old ~340-linepunktfunk1.rsintegration re-implemented against thenative.rs/control.rs/handshake.rssplit.libc::fully-qualified (pipe2/poll/fcntl); caught by the Linux leg.Opt-in default OFF (
PUNKTFUNK_CLIPBOARD).Verification — all green at
da057877-D warnings, tests, C-ABI harness, header-freshness gate)clipboard_control_and_fetch_decline_over_session— real QUIC client↔host: cap advertise → ClipState ack → fetch decline)-D warningsclean underx86_64-pc-windows-msvc(windows-host.ymlhas no PR trigger — checked out-of-band)Draft until: on-glass smoke against a real compositor + the macOS client (in progress on this branch).
🤖 Generated with Claude Code
The portable shared-clipboard plane in punktfunk-core, all behind the `quic` feature (design/clipboard-and-file-transfer.md §3): - Control messages 0x40–0x44 (ClipControl / ClipOffer / ClipFetch...) and the HOST_CAP_CLIPBOARD capability bit, negotiated in the Welcome caps. - Per-transfer QUIC bi-streams ("PKFs" magic) for lazy fetch of offered content, with ClipFetchHdr status/size framing (quic::clipstream). - The §3.5 portable wire-MIME vocabulary (text/plain;utf-8, text/html, text/rtf, image/png) shared by both ends. - Client-side clipboard task (client.rs) + C ABI surface bumped to v8 (abi.rs, regenerated include/punktfunk_core.h). - Loopback transport tests (quic::tests). No OS clipboard integration yet — that is the host backends (Phase 1/3) and the macOS client (Phase 1). Ported from feat/shared-clipboard (af3a7d8c, pre-W6 base) onto current main; three deliberate deviations from the original commit: - ABI v6 → v8: main took v6 (reanchor gate) and v7 (typed connect rejection) in the meantime; the clipboard C surface re-lands as v8. - CLIP_CANCELLED_CODE 0x60 → 0x70: main's pairing-rejection close codes claimed the 0x60–0x67 block; the vocabularies stay disjoint on purpose. - Negotiated.host_caps coexists with main's 6-tuple host_caps plumbing: main needs the worker-local copy for gamepad snapshots, the clipboard path needs it across ready_tx to build the NativeClient handle (punktfunk_connection_host_caps). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>WIP: Shared clipboard: wire protocol + host backends (pf-clipboard)to Shared clipboard: wire protocol, host backends (pf-clipboard) + macOS client