diff --git a/.env.example b/.env.example deleted file mode 100644 index ebd2621..0000000 --- a/.env.example +++ /dev/null @@ -1,8 +0,0 @@ -# Run bun run dev:setup to create .env.development with a random secret. -TURN_SECRET=replace-with-a-random-secret -TURN_HOST=127.0.0.1 -TURN_PORT=3478 -VITE_ICE_ENDPOINT=/api/ice-servers -VITE_STUN_URL=stun:127.0.0.1:3478 -# Optional: the Default tracker under Connection discovery, e.g. the local container. -# VITE_TRACKER_URL=ws://localhost:8000 diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index d484c1f..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,175 +0,0 @@ -# Changelog - -## [0.0.6] - 2026-10-21 - -### Fixed - -- Cancelling tracker reconnect now settles the pending WebSocket connection - immediately and clears its timeout. Socket send failures are reported cleanly. -- Late answers cannot reach a replacement WebRTC connection while its new offer - is gathering. -- Unauthenticated tracker messages cannot suppress valid offers or evict entries - from the replay cache. -- Rapidly accepting a reconnect proposal twice no longer starts competing key - derivations or leaves setup with an unexpected-message error. -- Tracker integration tests run in a fresh container on every invocation instead - of reusing Docker's cached test results. - -### Added - -- Regression coverage for tracker cancellation and failures, stale answers, - replay handling, retry limits, pairing verification, repeated acceptance and - reconnect lock handoff between browser tabs. - -### Changed - -- Document experimental tracker reconnect setup, privacy, revocation and limits - in the README. - -## [0.0.5] - Development draft - -### Added - -- A connections sidebar with up to 100 named slots. Each row shows its session - status and lets you rename or remove that connection. Switching slots keeps - live sessions and selected files; names and paired devices are saved locally. - On mobile the sidebar collapses and a bar shows the open connection and its - status. -- Remembered devices. Each browser can create an opt-in device identity with a - non-extractable private key. After one manual fingerprint comparison, a - connection pairs with the verified peer; later sessions check fresh mutual - signatures bound to both connection fingerprints. A changed key is replaced - only on explicit choice. Forget a device or delete the identity at any time. - Identity-enabled signaling uses v4; temporary v3 sessions remain available. -- Verified sessions stay open for more files: bounded queues (32 files per - side), sending in both directions, per-file acceptance, progress, and - receipts, queue removal, and incoming-file decline. -- **Disconnect**, which aborts unfinished writes, and Send/Receive navigation - within a live session. The initial receiver can send files without - reconnecting. -- Experimental tracker reconnect for paired devices. Choose a tracker under - **Network settings → Connection discovery**; during a verified session, one - person proposes it and the other confirms it. Setup reports success only - after both browsers saved it, and later sessions compare both copies so a - pairing missing on one side is turned off on the other. Afterwards both press - **Reconnect** instead of exchanging codes. The tracker only relays encrypted - offers and answers; device proofs still authenticate the session. - See the [concept status](docs/webtorrent-reconnect.md#concept-status). -- The hosted-first, serverless [UX roadmap](docs/ux-roadmap.md). - -### Changed - -- Upgrade connection/session framing to v3 with per-file identifiers. Both peers - must update; v2 codes are rejected before connection setup. -- Connection codes are compressed to roughly half their length (`HC1.` plus - Base64url of deflated JSON). Each code states whether it is an offer or an - answer and carries a reference shared by both, so a pasted offer in the - answer field, or an answer to a different code, is rejected with a clear - message while the live offer stays valid. Codes from earlier 0.0.5 drafts are - rejected. -- Replace the receive-storage choice with a single **Accept file** button that - treats every file size the same: stream to Downloads where supported, else - use the native save picker, else buffer up to 64 MiB in memory and hand it - to Downloads automatically on completion. -- A completed memory download stays available via **Save again** until the next - file is accepted, including after Disconnect. - -### Removed - -- The downloadable single-file HTML app (`hellcon-local.html`), its - **Download app for local use** link, and `file://` support. Serve the `dist/` - build over HTTPS or open it on localhost instead. - -## [0.0.4] - 2026-10-16 - -### Added - -- Added streaming downloads for the hosted app using a same-origin service - worker with bounded buffering. Verified real 120 MiB downloads in Chromium - and Brave without the native file picker. -- Worker tests for byte counts, backpressure, cancellation, and single-use URLs, - plus a browser check that verifies actual downloaded file contents. -- Guidance to use desktop Chrome for large files in the downloaded local version. - -### Changed - -- Removed the app-defined 64 GiB file-size cap for streamed and native disk - transfers. Browser, filesystem, available storage, and exact byte-count limits - still apply. The 64 MiB in-memory safety cap remains in place. -- Download receive buttons now show the incoming file size instead of a size cap. -- Streaming completion reports that bytes were handed to the browser; users - should check Downloads for the final save result. -- Local `file://` copies remain independent of hosted helpers and use the native - save picker or the in-memory option. Service-worker downloads are hosted-only. - -## [0.0.3] - 2026-10-09 - -### Added - -- A downloadable single-file HTML app that can be opened directly from disk, - without the website host. Local copies can transfer files through WebRTC. -- A browser check that transfers a file between two `file://` copies. - -### Changed - -- Labeled the download "for local use" and documented that peers may still need - internet access and reachable STUN or TURN servers. -- Disabled the host's managed TURN credential endpoint when running from a local - file; manual TURN settings remain available. - -## [0.0.2] - 2026-10-09 - -### Added - -- Local coturn setup with temporary relay credentials issued per connection and - browser checks for UDP and TCP relay paths. -- Automated axe accessibility checks in both transfer modes and during and - after a file transfer. - -### Changed - -- Migrated the app, development scripts, and tests to TypeScript. TypeScript 6 - keeps Vue type checking and production builds working. -- Show managed relay details in read-only fields while a connection is active. -- Improved button contrast and focus visibility with an orange accent and - slightly larger button text. -- Added a main landmark, skip link, accessible transfer-mode state, and a - heading for fingerprint verification. - -## [0.0.1] - 2026-10-09 - -### Added - -- Mandatory full SHA-256 fingerprint confirmation by both peers before sharing - file metadata or contents. -- Receiver acceptance and direct-to-disk saving in supported browsers. -- Optional TURN relaying, requiring explicit opt-in from both peers. Consent - clears after a connection completes, fails, or is reset or cancelled. -- Protocol regression tests and Chromium, Brave, and Firefox integration checks. - -### Changed - -- Enforced message validation, exact file sizes, and bounded buffering. -- Limited memory downloads to 64 MiB and direct-to-disk transfers to 64 GiB. -- Report transfer completion only after receiver acknowledgment. -- Updated dependencies, including the fix for the `source-map-js` advisory. -- Clarified encryption, hosting trust, connection-code privacy, and deployment - requirements. - -### Fixed - -- Reset failing to restore the ready state. -- Invalid answers unnecessarily destroying valid connection offers. -- Connections and unfinished disk writes surviving cancellation or tab changes. -- Completed Firefox downloads disappearing when Brave disconnected. -- Excess data, duplicate metadata, and malformed messages corrupting transfers - or causing unbounded memory growth. -- ICE gathering silently returning incomplete connection information, and - stalled transfers waiting indefinitely. - -### Compatibility - -- Introduced signaling and transfer protocol v2. Both peers must use the updated - app; connection codes from earlier versions are no longer accepted. -- Files larger than 64 MiB require a receiving browser with direct-to-disk - saving support. diff --git a/README.md b/README.md index 6d680e6..7513b50 100644 --- a/README.md +++ b/README.md @@ -1,364 +1 @@ # HellCon - -Current version: **0.0.6**. See the [changelog](CHANGELOG.md) for release -notes and compatibility changes. - -Browser-to-browser file sharing with Vue 3 and WebRTC. There are no accounts or -server-side file storage. Exchange connection codes through a messenger, or -opt in to experimental tracker reconnect for remembered devices. Manual codes -need no signaling backend. Connections are direct by -default. A TURN relay is used only when both people opt in. - -This is experimental software, not independently audited or battle-tested. -Browser compatibility, network connectivity, and storage availability vary. - -## Connections - -The sidebar lists your connections, starting with **Con 1**, up to 100. Each one -has its own setup and live session. - -- **Open** a connection by clicking its row. The row shows its name and this - tab's session status (not whether the remote device is online). -- **Rename** with the pen. Enter or leaving the field saves; Escape cancels. - An empty name keeps the previous one. -- **Remove** with ✕, then confirm. This ends the connection's sessions in all - open tabs and forgets its remembered device. Downloaded files and your device - identity remain. Removing the last connection leaves a fresh **Con 1**. -- **Add connection** creates another empty slot. - -Switching connections keeps active transfers and selected files alive while the -tab stays open. Closing or reloading the page ends live sessions and discards -selected files; reconnect with fresh codes or a saved tracker pairing. On small -screens, **Show connections** opens the sidebar, and the bar beside it shows the -open connection and its status. - -Names and remembered devices are saved in this browser. Transfer history, file -contents, connection codes, and relay credentials are not. Clearing site data -removes saved connections, identities, and trust. If storage fails, the app says -so and temporary sessions still work. - -## Sharing files - -1. **Create a code.** The person starting picks one or more files, chooses a - STUN provider (PageQuit by default, Google, Cloudflare, custom, or None), and - clicks **Create code**. They send the code privately to the receiver through - an authenticated channel. -2. **Answer it.** The receiver pastes the code and clicks **Accept & create - answer**, then sends the answer back for the sender to paste. Gathering waits - up to 30 seconds and fails rather than exporting incomplete connection - information. -3. **Compare fingerprints.** Both people compare **both full SHA-256 certificate - fingerprints** over a channel they trust for authenticity, such as in person. - Your fingerprint must equal their “Their fingerprint”, and vice versa. Compare - every byte and cancel on any mismatch. Nothing about the files is sent until - both people confirm. A [remembered device](#remembered-devices) can replace - this step on later connections. -4. **Accept the file.** The receiver sees the filename and size and clicks - **Accept file**. Files stream into the browser's download manager through a - same-origin service worker (HTTPS or localhost; Chromium and Brave are tested - with 120 MiB files). Without streaming support, the native save picker is - used. Without either, files up to 64 MiB are buffered in memory and handed to - Downloads on completion (**Save again** repeats this); larger files cannot be - received. Keep the receiving tab open. -5. **Receipt.** The sender waits for the receiver's acknowledgment, sent after - the disk write closes, after all bytes reach the browser's download manager, - or after the memory download is built. A receipt does not prove the download - manager saved the file (check Downloads), nor that a malicious receiver told - the truth. - -Streamed transfers have no app-defined size cap; browser, filesystem, and storage -limits apply, and byte counts must stay below 2^53. Files above 120 MiB have not -been tested end to end. - -### During a session - -Once verified, either person can add files without new codes. Each side queues -up to 32 files, including its active one. Each direction sends one file at a -time, and both directions can run at once. Every file has its own acceptance, -progress, and receipt. **Remove** drops a waiting file from your queue; -**Decline file** rejects an incoming one and lets the sender's queue continue. -Send/Receive chooses who starts before connecting; afterwards it switches between -the sending and receiving sections without reconnecting. - -**Disconnect** ends the session, drops waiting files, and aborts unfinished disk -writes; cancelling a single active file is not supported. A completed memory -download stays available via **Save again** until the next accepted file -replaces it. **Reset** discards it and returns to setup; the connection stays. - -Switching tabs or apps does not end the session, but browsers and mobile systems -may suspend pages. Pending verification or acceptance expires after five -minutes, stalled transfers after one minute; idle verified sessions stay open. - -### Troubleshooting - -- A pasted answer that is invalid, an offer in the answer field, or an answer for - a different code is reported without discarding the live offer. Fix it and - click **Connect** again. -- After a connection closes or fails, use **Reset** and exchange a new offer and - answer. Old codes cannot reopen it. -- If a configured STUN server is unreachable, try None for a local test. For a - local test, use two tabs or windows, and Disconnect before changing roles. -- Expand **Connection diagnostics** to copy the last 80 timed events: candidate - type counts, candidate-pair and DTLS states, selected route types, and ICE - check counters, with snapshots taken before failed pairs disappear. A `?` means - the browser supplied no value, not zero. Addresses, SDP, candidate IDs, - credentials, server URLs, and filenames are excluded. - -Same-machine success does not show cross-device connectivity, and error 701 -alone does not identify a cause. See [the investigation -notes](docs/connection-investigation.md) for the comparison with the first -version. `node scripts/compare-ice.mjs firefox` (or `chromium`) runs a local ICE -experiment with deliberately unusable offer ports and a 20-second answer delay; -add `--normal-candidates` to keep real ports. It is **not a cross-device test**. - -## Remembered devices - -Each connection can remember one device, so later sessions skip the manual -fingerprint comparison. - -1. On both browsers, expand **Remembered device** and choose **Create device - identity**. This also turns on **Use my device identity on this connection**; - each connection has its own opt-in, and new connections start without it. -2. Connect and compare full fingerprints once. Leave **Remember this device for - …** ticked when confirming, and the verified peer is paired with this - connection. The connection's name is the device's name and never leaves - this browser. - -Later sessions check fresh signed proofs bound to both device keys and both -connection fingerprints; file acceptance is still required. A changed or missing -identity falls back to manual comparison and only replaces the paired device if -you tick **Replace the paired device**. **Forget device** unpairs it. One device -can be paired with several connections. - -Identity-enabled codes use signaling **v4**; temporary codes use **v3**. If only -one peer enables identity, the session uses manual comparison without -remembering. Public identities in codes can link sessions. Browser-stored keys -are usable by any code the host serves, so they do not protect against a -malicious host. See [the identity protocol and storage](docs/device-identities.md). - -### Experimental reconnect without codes - -Once both browsers have remembered each other in a verified session: - -1. Under **Network settings → Connection discovery**, choose a custom `wss://` - WebTorrent tracker, or the host's default if one is configured. -2. Click **Set up reconnect**. The other person checks the tracker host and - accepts. Both browsers must save the settings before setup reports success. -3. After disconnecting or reloading, both people open their saved connection and - press **Reconnect**. Fresh device proofs authenticate the session; each file - still requires acceptance. TURN still requires both people to opt in. - -The tracker sees IP addresses, timing and encrypted signaling sizes; codes and -files remain private from it. The pairing key stays in browser storage. Changing -Connection discovery applies to new setups; existing pairings keep their tracker. -**Turn off reconnect** removes the local pairing. The other browser removes its -copy at the next authenticated manual session if the pairings no longer match. - -If reconnect fails, exchange fresh codes. Reconnect attempts started on opposite -sides of UTC midnight need restarting. See the [implementation status and -limits](docs/webtorrent-reconnect.md#concept-status). - -## Privacy and security - -### Connection codes - -Connection codes are **compressed and Base64url-encoded, not encrypted** (`HC1.` -followed by deflated JSON). They contain SDP: candidate addresses, temporary ICE -credentials, and certificate fingerprints. Anyone who sees a code, including the -messaging service, may learn these details. Treat codes as private and do not -publish them. The browser may obscure local addresses, but this app does not -provide anonymity. - -File transfers use protocol **v3**; codes from older builds are rejected before -connecting. - -### STUN and optional TURN - -STUN discovers externally reachable addresses. Its operator sees your public IP -and request metadata but never file contents. Choosing None avoids contacting a -STUN provider; direct connectivity then depends on addresses, routing, browser -policy, and firewalls. A VPN does not guarantee against address disclosure. - -Restrictive NATs or firewalls can block direct connections, and there is no -silent TURN fallback. To permit a relay, both people check **Allow a TURN -relay**, enter their authorized TURN URL, username, and password, and create new -codes. Otherwise TURN URLs and codes with relay candidates are rejected. Enabling -TURN lets the browser use a relay route when needed; it does not force relay-only -routing or hide your IP from the peer, and it cannot control software the other -person runs. - -When a credential endpoint is configured, **Use the configured relay with -temporary credentials** fetches fresh credentials for each connection after -opt-in and shows them read-only. Uncheck it to enter a relay manually. TURN -credentials stay in memory and never enter codes. The relay sees its -authentication exchange, addresses, timing, and traffic volume, but file traffic -remains DTLS-encrypted. Reset, cancel, or a closed connection clears TURN -consent; opt in again for the next relayed connection. - -### Security model and limits - -Data channels use **SCTP over DTLS** for transport confidentiality and integrity. -DTLS authenticates the certificate in the connection description; comparing full -fingerprints over an independently authenticated channel binds that certificate -to the intended peer. Comparing over a channel an attacker can rewrite proves -nothing. - -You must trust your browser, device, and **the JavaScript you load**. A -compromised host or build can steal plaintext or falsify the verification -display. HTTPS protects delivery, not against a malicious host. This code does -not upload files to its host, but that is no guarantee against a host serving -different code. The web host, DNS resolver, and code-exchange service are also -relevant third parties. - -The protocol accepts one ordered, reliable data channel with bounded metadata -and messages, exact declared byte counts, and at most one accepted file per -direction. Monotonic per-direction file IDs bind offers, data, and receipts to -their files; unexpected states, excess data, and duplicate metadata are rejected. -A 1 MiB acknowledged send window and a bounded receive queue limit buffering. -Files are opaque downloads and metadata is never rendered as HTML. Encryption -does not make a file safe to open. These limits reduce, but do not eliminate, -denial-of-service and malicious-peer risks. - -## Self-hosting - -```sh -bun install --frozen-lockfile -bun run build -``` - -Serve the whole `dist/` directory over HTTPS as static files, including -`assets/` and `download/worker.js` (with a JavaScript MIME type). No backend or -third-party helper is needed. Do not expose the Vite dev or preview server; -`bun run preview` is for local inspection only. - -Configure `Content-Security-Policy`, `X-Content-Type-Options: nosniff`, and -`Referrer-Policy: no-referrer`. A baseline CSP for this build: - -```text -default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; -img-src 'self'; connect-src 'self'; object-src 'none'; base-uri 'none'; -frame-ancestors 'none' -``` - -Inline styles are used for progress and Vue visibility. The experimental -tracker reconnect also needs the tracker in `connect-src`, for example -`connect-src 'self' wss://tracker.example`. Custom policies must -permit same-origin workers and frames. Test headers on the actual host; CSP is -defense in depth, not a substitute for trusting the host or a WebRTC egress -filter. `robots.txt` and indexing metadata are crawler requests, not access -control. - -The download worker's scope is `download/` only: it does not control the app -page, cache the app, or proxy other requests. It serves single-use, randomly -named URLs from incoming streams with bounded buffering. Closing or resetting an -unfinished transfer aborts it; interrupted transfers must restart. - -## Development - -Use Bun to install dependencies and Node.js 22.18+ to run scripts and tests. All -code is strict TypeScript; `vue-tsc` checks scripts and templates and runs before -every production build. TypeScript stays on 6.0 until Vue's checker supports -TypeScript 7. Vite 8 supplies the Rolldown bundler and Oxc transforms. Node runs -the TypeScript tests directly, with no test framework or loader. The lockfile -pins dependencies; review updates and advisories before publishing a build. - -```sh -bun install --frozen-lockfile -bun run dev -bun run typecheck -bun run test # unit tests -bun run build -bun run test:browser # Chromium integration and axe checks against dist/ -bun run test:browser --connections # sidebar, persistence, live switching, mobile layout -bun run test:browser --tracker=wss://tracker.example # experimental tracker reconnect -bun run test:download # real hosted downloads up to 120 MiB, no native picker -bun run test:cross-browser # Brave sender → Firefox receiver -bun audit -``` - -Browser checks run against `dist/`, so build first. They use isolated temporary -profiles and a loopback server, and never touch your normal browser settings. - -- `test:browser` and `test:download` need Chromium at `/usr/bin/chromium` - (override with `CHROMIUM_PATH`, e.g. `/usr/bin/brave`). They verify the actual - saved bytes; worker tests cover byte counts, backpressure, single-use URLs, and - cancellation. -- `test:cross-browser` needs `/usr/bin/brave` and `/usr/bin/firefox` (override - with `BRAVE_PATH` and `FIREFOX_PATH`) and checks the received file stays - downloadable after the sender disconnects. Pass `--reverse` for Firefox → - Brave, or `--default-network` for PageQuit STUN instead of None. - -### Local STUN/TURN (Linux) - -Vite stays on the host for hot reload; only coturn runs in Docker. Both bind to -loopback, so test with two tabs on this machine. Nothing starts at boot and the -container has no restart policy. - -```sh -sudo systemctl start docker.service # if not already running -# After joining the docker group, log in again or run: newgrp docker -bun install --frozen-lockfile -bun run dev:setup # creates .env.development without overwriting it -bun run turn:up -bun run dev # open the printed URL in two tabs -``` - -Pick a file in one tab and choose Receive in the other. Check **Allow a TURN -relay** in both, leave **Use the configured relay with temporary credentials** -checked, then exchange codes as usual. Consent clears after each connection. - -```sh -bun run test:turn # real file transfer over forced TURN/UDP -bun run test:turn --tcp # browser-to-TURN over TCP only -docker compose --env-file .env.development logs --tail=50 coturn -bun run turn:down -sudo systemctl stop docker.service docker.socket containerd.service # optional -``` - -The TURN checks start their own Vite server and browsers but need coturn -running. They force relay-only routing, assert relay candidates on both ends, -verify received bytes and receipts, and exercise cancellation and reconnection. -They do not test Internet NATs or a remote firewall. - -`.env.development` holds the private `TURN_SECRET`, server-side -`TURN_HOST`/`TURN_PORT`, and public `VITE_ICE_ENDPOINT`/`VITE_STUN_URL` (see -[.env.example](.env.example)). The secret never enters the client bundle. When -changing the port, update `TURN_PORT` and `VITE_STUN_URL`, rerun `turn:up`, and -restart Vite. Listeners, relay ports 49160–49200, and the pinned image are in -[compose.yaml](compose.yaml). - -The credential endpoint is **development-only** Vite middleware and is not part -of `dist/` or `vite preview`. To use it in production, set `VITE_ICE_ENDPOINT` -and `VITE_STUN_URL` at build time and implement the same JSON endpoint behind -your own access policy; [dev/ice-server.ts](dev/ice-server.ts) has the HMAC -logic. Never expose the development endpoint or the loopback-permitting Compose -setup as a public relay. Credentials expire after one hour and are not renewed -during a transfer. See the [coturn Docker -guide](https://github.com/coturn/coturn/blob/master/docker/coturn/README.md) and -[configuration -reference](https://github.com/coturn/coturn/blob/master/examples/etc/turnserver.conf). - -### Local WebTorrent tracker - -[tracker/Dockerfile](tracker/Dockerfile) and -[compose.tracker.yaml](compose.tracker.yaml) build a locked `bittorrent-tracker` -release on the official Node image: - -```sh -bun run tracker:up # build and start ws://127.0.0.1:8000 -bun run test:tracker # integration checks inside the test image -bun run tracker:down -``` - -See [the tracker README](tracker/README.md) for configuration and VPS use. -The browser supports opt-in [experimental tracker reconnect](#experimental-reconnect-without-codes). -For a local integration check, run `bun run test:browser --tracker=ws://127.0.0.1:8000` -after building the app and starting the tracker. - -## Roadmap - -See [the hosted-first UX roadmap](docs/ux-roadmap.md). - -## License - -MIT — see [LICENSE](LICENSE). diff --git a/bun.lock b/bun.lock deleted file mode 100644 index 6b1e4d9..0000000 --- a/bun.lock +++ /dev/null @@ -1,167 +0,0 @@ -{ - "lockfileVersion": 2, - "configVersion": 1, - "workspaces": { - "": { - "name": "hellcon", - "dependencies": { - "vue": "^3.5.44", - }, - "devDependencies": { - "@types/node": "^26.6.5", - "@vitejs/plugin-vue": "^6.0.10", - "axe-core": "^4.14.0", - "typescript": "~6.0.3", - "vite": "^8.3.4", - "vue-tsc": "^3.3.13", - }, - }, - }, - "packages": { - "@babel/helper-string-parser": ["@babel/helper-string-parser@7.29.7", "", {}, "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw=="], - - "@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@7.29.7", "", {}, "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg=="], - - "@babel/parser": ["@babel/parser@7.29.9", "", { "dependencies": { "@babel/types": "^7.29.8" }, "bin": "./bin/babel-parser.js" }, "sha512-CjXrNHTnvqBVqHgdBysY3vk2T8tpJHb5/RMeHJBTyVa9xgugCB0CJTx/3oO8RV2QRQP391RWpB7D6hLjm8V9uA=="], - - "@babel/types": ["@babel/types@7.29.8", "", { "dependencies": { "@babel/helper-string-parser": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7" } }, "sha512-Vj1jF3cPfxg7OAfoI7QnVKLoILlm2JF9pnVHrX8qx7AHMiYWT+NDAA7jChlNgRS4WTLc/fD1lXLmPixluj+3Gg=="], - - "@jridgewell/sourcemap-codec": ["@jridgewell/sourcemap-codec@1.6.0", "", {}, "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw=="], - - "@oxc-project/types": ["@oxc-project/types@0.154.0", "", {}, "sha512-KYOUGQFlLWR+s4QMV2Q9ko38TZm7EdO87Qm7rvZLqk/webse/cDjtyxKhg/47l0byCbs/k46LT8qc4PKjAikzA=="], - - "@rolldown/binding-android-arm-eabi": ["@rolldown/binding-android-arm-eabi@1.2.14", "", { "os": "android", "cpu": "arm" }, "sha512-aWR+XKH9+rW7m5fWq/5360J3mHycrx/o6xZM2DQFdJnTMdyP7/WzxPjhtLbVWdKo2y612/4U1bWqb3HQhiF7vg=="], - - "@rolldown/binding-android-arm64": ["@rolldown/binding-android-arm64@1.2.14", "", { "os": "android", "cpu": "arm64" }, "sha512-QiVxHofl6A8lQU7WAtOUY4QMVZXohxwz7WJJoeh8NBEUyKfIkMRKhYyq8az/1RypNiIXzNTtiS6KwHz0erxYRQ=="], - - "@rolldown/binding-darwin-arm64": ["@rolldown/binding-darwin-arm64@1.2.14", "", { "os": "darwin", "cpu": "arm64" }, "sha512-lTQOzHuBIooh3jIr5XINQkjPGEuGy+Dsy0meXDr6Sjty0b99kYgGh4uBC/8mJX1T0kC8d6S0aPP1Y+bHkh6aBw=="], - - "@rolldown/binding-darwin-x64": ["@rolldown/binding-darwin-x64@1.2.14", "", { "os": "darwin", "cpu": "x64" }, "sha512-hyMKEGatjmBYCs/Q4sbIcL/GqpFEqsX3wc+HYVQ/85A4rxc1o7rPm4DUI4GV4k/h0ITddwFSGpqQunI14GXjTA=="], - - "@rolldown/binding-freebsd-x64": ["@rolldown/binding-freebsd-x64@1.2.14", "", { "os": "freebsd", "cpu": "x64" }, "sha512-u371GbXoVXrEgP20PwzoGNOdAOqAMhzo19JzzY+V4YmmnC+DTOoqdbMu+O+54emM59Mik/UdrtWgcuEDKWRPKA=="], - - "@rolldown/binding-linux-arm-gnueabihf": ["@rolldown/binding-linux-arm-gnueabihf@1.2.14", "", { "os": "linux", "cpu": "arm" }, "sha512-BqwKsdZQf6EqVWr8fv2MrDYzAvOZ7+NYFSJESRGs87fkseEhs0TU9TXgRJTkZoRRkxTizyEg1LKUXfU3/78uqg=="], - - "@rolldown/binding-linux-arm64-gnu": ["@rolldown/binding-linux-arm64-gnu@1.2.14", "", { "os": "linux", "cpu": "arm64" }, "sha512-SD9kY8M009x/7s57Z1dgUVlP5+uYBgKQK0Tkr1WIWngrtUJmRCW1RJFMY7QDla2khXhmg2i5Io7MUjcmZNZ/KQ=="], - - "@rolldown/binding-linux-arm64-musl": ["@rolldown/binding-linux-arm64-musl@1.2.14", "", { "os": "linux", "cpu": "arm64" }, "sha512-BJ2CL19M6uuWesMgnqJzgxoI+N+eV7b0A9O9vLV42y+gitC41fNa8KElau1tHVzuLWX5GzEuxMPhAO0tQXQMkg=="], - - "@rolldown/binding-linux-ppc64-gnu": ["@rolldown/binding-linux-ppc64-gnu@1.2.14", "", { "os": "linux", "cpu": "ppc64" }, "sha512-4+Kl8daPV8NDHaD7mfCcc1pRM+Qg7ab8DyMm5FG5WoZgv4h2i3KFN1CybYBNbQqmuYm7ftJLvmMI1eHYJ22S/Q=="], - - "@rolldown/binding-linux-s390x-gnu": ["@rolldown/binding-linux-s390x-gnu@1.2.14", "", { "os": "linux", "cpu": "s390x" }, "sha512-V/h8ePq1fKDrmtFMz6xcCN3DKvuvMRrwwD1q0PkBeeo4DpK64biaKvqWGVxqCeYKqeRk7gE7/iKPxLCn08O97A=="], - - "@rolldown/binding-linux-x64-gnu": ["@rolldown/binding-linux-x64-gnu@1.2.14", "", { "os": "linux", "cpu": "x64" }, "sha512-WxalXzgrLVpKC93xfpaJ3gCXUWzeCr+FRCbDVD2mUAy4L6Vo3lNVz0epUEUpxPWJkLNYUwM4OSIikv36OJ9mLg=="], - - "@rolldown/binding-linux-x64-musl": ["@rolldown/binding-linux-x64-musl@1.2.14", "", { "os": "linux", "cpu": "x64" }, "sha512-3G3tnAmTpdk9jO3GQtyHXqeFD2SlecfTws/Y3M2mmj9nMBwwuLT4kur8sZKeu7ENUHSpVO3cIsm5A52LEWWwlg=="], - - "@rolldown/binding-openharmony-arm64": ["@rolldown/binding-openharmony-arm64@1.2.14", "", { "os": "none", "cpu": "arm64" }, "sha512-qyr5XiNGxm2ytx17vvtcJ9nXn6v1gENETi503bJx3OGwZ1tSonj7BosxbMa/xeAfSl5iS9X6KjEWYXLu6v1L7Q=="], - - "@rolldown/binding-win32-arm64-msvc": ["@rolldown/binding-win32-arm64-msvc@1.2.14", "", { "os": "win32", "cpu": "arm64" }, "sha512-oA4o5o0S2yB199YyYXDzKUv1Z56Rc+mgOjwm7Z/vJ9Z8igiDPYvoOuDyo6g7AK/ZaF09nPhDKVnGBcYHO11GXA=="], - - "@rolldown/binding-win32-x64-msvc": ["@rolldown/binding-win32-x64-msvc@1.2.14", "", { "os": "win32", "cpu": "x64" }, "sha512-9mE94bf2GZUaR/fUSXCMpBoWkctu421Mi0ORpm4zqfbkjKep7RxzPFa5etcGs5h+2KApoWBOA/hAJa/7saGgEQ=="], - - "@rolldown/pluginutils": ["@rolldown/pluginutils@1.0.1", "", {}, "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw=="], - - "@types/node": ["@types/node@26.6.5", "", { "dependencies": { "undici-types": "~8.9.0" } }, "sha512-uMzsv9stDdofIZBx4UGh4Z9ZgXnGC9seRDscilBcTHAeOFk67MZg/k9bWVfO+bk4qZmG+l52hRnLwUiH2LnJTg=="], - - "@vitejs/plugin-vue": ["@vitejs/plugin-vue@6.0.10", "", { "dependencies": { "@rolldown/pluginutils": "^1.0.1" }, "peerDependencies": { "vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0", "vue": "^3.2.25 || ^3.6.0-rc.10" } }, "sha512-b80aUQh3n+qEzzZm5oQp3rT2QImeCx58K6eFl/RkJ3d65KW0kTuv5lNsLRVAjbW9YRUpo/wzmvzMgV34bTAItA=="], - - "@volar/language-core": ["@volar/language-core@2.4.28", "", { "dependencies": { "@volar/source-map": "2.4.28" } }, "sha512-w4qhIJ8ZSitgLAkVay6AbcnC7gP3glYM3fYwKV3srj8m494E3xtrCv6E+bWviiK/8hs6e6t1ij1s2Endql7vzQ=="], - - "@volar/source-map": ["@volar/source-map@2.4.28", "", {}, "sha512-yX2BDBqJkRXfKw8my8VarTyjv48QwxdJtvRgUpNE5erCsgEUdI2DsLbpa+rOQVAJYshY99szEcRDmyHbF10ggQ=="], - - "@volar/typescript": ["@volar/typescript@2.4.28", "", { "dependencies": { "@volar/language-core": "2.4.28", "path-browserify": "^1.0.1", "vscode-uri": "^3.0.8" } }, "sha512-Ja6yvWrbis2QtN4ClAKreeUZPVYMARDYZl9LMEv1iQ1QdepB6wn0jTRxA9MftYmYa4DQ4k/DaSZpFPUfxl8giw=="], - - "@vue/compiler-core": ["@vue/compiler-core@3.5.44", "", { "dependencies": { "@babel/parser": "^7.29.9", "@vue/shared": "3.5.44", "entities": "^7.0.1", "estree-walker": "^2.0.2", "source-map-js": "^1.2.2" } }, "sha512-k34nCytbK8PQ1gR2mGROYOw6Pnv/mumqIdrZ3x2tbyXZDWm7ViKGLTfdB+DRrWqEQsLgGJvn0WN9jBif5zCTLQ=="], - - "@vue/compiler-dom": ["@vue/compiler-dom@3.5.44", "", { "dependencies": { "@vue/compiler-core": "3.5.44", "@vue/shared": "3.5.44" } }, "sha512-W5AoBFWdw1lQAKiHowkfgFKFab82oSRT6sGsPfw/q1GRjsy/ZJFLHGhJyBRIFN9APLTUduDH9U2JAiPOIyKuYg=="], - - "@vue/compiler-sfc": ["@vue/compiler-sfc@3.5.44", "", { "dependencies": { "@babel/parser": "^7.29.9", "@vue/compiler-core": "3.5.44", "@vue/compiler-dom": "3.5.44", "@vue/compiler-ssr": "3.5.44", "@vue/shared": "3.5.44", "estree-walker": "^2.0.2", "magic-string": "^0.30.21", "postcss": "^8.5.29", "source-map-js": "^1.2.2" } }, "sha512-dzHmQ4jXTpdr5FjIQUeykVakN/uzqFbUo9/C5ikBFg3a3PeM6uRxeczx1ZbXBML0/zJstEh3ygYipzR5Z7b2Pw=="], - - "@vue/compiler-ssr": ["@vue/compiler-ssr@3.5.44", "", { "dependencies": { "@vue/compiler-dom": "3.5.44", "@vue/shared": "3.5.44" } }, "sha512-xr5gb1JVHlfXJwSlRz1FeP6uxoazdzHuMTVLE7up+4Vrqxk219CvxLPxD9NXBt47yvZW7+p4DXfyp4O1fkByIA=="], - - "@vue/language-core": ["@vue/language-core@3.3.13", "", { "dependencies": { "@volar/language-core": "2.4.28", "@vue/compiler-dom": "^3.5.0", "@vue/shared": "^3.5.0", "alien-signals": "^3.2.1", "muggle-string": "^0.4.1", "path-browserify": "^1.0.1", "picomatch": "^4.0.4" } }, "sha512-axA0Xemn5LuUKuKWob0/kVq7xQ2mJJM6VqA9Exvt35nM9yRC31goWVve/G/Zb2ZCLsXC8FHYjjfXlnshknSCew=="], - - "@vue/reactivity": ["@vue/reactivity@3.5.44", "", { "dependencies": { "@vue/shared": "3.5.44" } }, "sha512-u+QJdKeBBEADkPdevsL+6E12QlYVfBD8Zcw5qjDQKtamI6l14KyqazJMobhCKelhWN5zpyKUiEDoTyHE93cqWw=="], - - "@vue/runtime-core": ["@vue/runtime-core@3.5.44", "", { "dependencies": { "@vue/reactivity": "3.5.44", "@vue/shared": "3.5.44" } }, "sha512-uEa/ndwjhrrhnOfb2p+sZy6zeoamJOISqaLSJGk/8R6nABT1ZldpzcJoPzKj+zHVomVBPcmQYyC2r4LtvDV6CQ=="], - - "@vue/runtime-dom": ["@vue/runtime-dom@3.5.44", "", { "dependencies": { "@vue/reactivity": "3.5.44", "@vue/runtime-core": "3.5.44", "@vue/shared": "3.5.44", "csstype": "^3.2.3" } }, "sha512-3fc4ARcXVhVBaJ3ujWiNZJARD6pkyRcwG+ZYhMzjKtKUp7MAY0HLwr7r3Smep3Li6ZaWT6ewdmx8XqdaD5oNZg=="], - - "@vue/server-renderer": ["@vue/server-renderer@3.5.44", "", { "dependencies": { "@vue/compiler-ssr": "3.5.44", "@vue/runtime-dom": "3.5.44", "@vue/shared": "3.5.44" } }, "sha512-R4S1UoH4h5Frrauv8Z5XE5TxV9oBiUSgWIC4TyVK1FK+RocRnOLwFA5Xcmo2011RlgJp+AbZCnw6afrhlgRuUQ=="], - - "@vue/shared": ["@vue/shared@3.5.44", "", {}, "sha512-H82XLH0DjmSOdbEwO15x3QTo1f5PWEtv237eLpYKc0mqLu+B8hnq16lFWmuBmNurkeiG3wr+oM1FhOll/YVFRg=="], - - "alien-signals": ["alien-signals@3.2.1", "", {}, "sha512-I8FjmltrfnDFoZedi5CG8DghVYNhzb/Ijluz7tCSJH0xpd0484Kowhbb1XDYOxfJpU1p5wnM2X54dA+IfGyD1g=="], - - "axe-core": ["axe-core@4.14.0", "", {}, "sha512-9WTZxEjsZ7b13TH8JPmbV2z8CHbl80/2hm3XPEG4JgNdQLK81IBRXmSxHfMAOkSqQeRxT/0dwNDz2GOm3zzpcQ=="], - - "csstype": ["csstype@3.2.3", "", {}, "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ=="], - - "detect-libc": ["detect-libc@2.1.2", "", {}, "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ=="], - - "entities": ["entities@7.0.1", "", {}, "sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA=="], - - "estree-walker": ["estree-walker@2.0.2", "", {}, "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="], - - "fdir": ["fdir@6.5.0", "", { "peerDependencies": { "picomatch": "^3 || ^4" }, "optionalPeers": ["picomatch"] }, "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg=="], - - "fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="], - - "lightningcss": ["lightningcss@1.33.0", "", { "dependencies": { "detect-libc": "^2.0.3" }, "optionalDependencies": { "lightningcss-android-arm64": "1.33.0", "lightningcss-darwin-arm64": "1.33.0", "lightningcss-darwin-x64": "1.33.0", "lightningcss-freebsd-x64": "1.33.0", "lightningcss-linux-arm-gnueabihf": "1.33.0", "lightningcss-linux-arm64-gnu": "1.33.0", "lightningcss-linux-arm64-musl": "1.33.0", "lightningcss-linux-x64-gnu": "1.33.0", "lightningcss-linux-x64-musl": "1.33.0", "lightningcss-win32-arm64-msvc": "1.33.0", "lightningcss-win32-x64-msvc": "1.33.0" } }, "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA=="], - - "lightningcss-android-arm64": ["lightningcss-android-arm64@1.33.0", "", { "os": "android", "cpu": "arm64" }, "sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg=="], - - "lightningcss-darwin-arm64": ["lightningcss-darwin-arm64@1.33.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg=="], - - "lightningcss-darwin-x64": ["lightningcss-darwin-x64@1.33.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ=="], - - "lightningcss-freebsd-x64": ["lightningcss-freebsd-x64@1.33.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg=="], - - "lightningcss-linux-arm-gnueabihf": ["lightningcss-linux-arm-gnueabihf@1.33.0", "", { "os": "linux", "cpu": "arm" }, "sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ=="], - - "lightningcss-linux-arm64-gnu": ["lightningcss-linux-arm64-gnu@1.33.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg=="], - - "lightningcss-linux-arm64-musl": ["lightningcss-linux-arm64-musl@1.33.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ=="], - - "lightningcss-linux-x64-gnu": ["lightningcss-linux-x64-gnu@1.33.0", "", { "os": "linux", "cpu": "x64" }, "sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg=="], - - "lightningcss-linux-x64-musl": ["lightningcss-linux-x64-musl@1.33.0", "", { "os": "linux", "cpu": "x64" }, "sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw=="], - - "lightningcss-win32-arm64-msvc": ["lightningcss-win32-arm64-msvc@1.33.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA=="], - - "lightningcss-win32-x64-msvc": ["lightningcss-win32-x64-msvc@1.33.0", "", { "os": "win32", "cpu": "x64" }, "sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA=="], - - "magic-string": ["magic-string@0.30.21", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.5" } }, "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ=="], - - "muggle-string": ["muggle-string@0.4.1", "", {}, "sha512-VNTrAak/KhO2i8dqqnqnAHOa3cYBwXEZe9h+D5h/1ZqFSTEFHdM65lR7RoIqq3tBBYavsOXV84NoHXZ0AkPyqQ=="], - - "nanoid": ["nanoid@3.3.20", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ=="], - - "path-browserify": ["path-browserify@1.0.1", "", {}, "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g=="], - - "picocolors": ["picocolors@1.1.1", "", {}, "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="], - - "picomatch": ["picomatch@4.0.7", "", {}, "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA=="], - - "postcss": ["postcss@8.5.30", "", { "dependencies": { "nanoid": "^3.3.20", "picocolors": "^1.1.1", "source-map-js": "^1.2.2" } }, "sha512-zkd+e9S1AQHhmaBKye9zlFHWjOwVgqXl1q3ECYy8561K7qxR2cREf/STLskulBFd78k6AOFeA+ff1TtEzk9bAA=="], - - "rolldown": ["rolldown@1.2.14", "", { "dependencies": { "@oxc-project/types": "=0.154.0", "@rolldown/pluginutils": "^1.0.0" }, "optionalDependencies": { "@rolldown/binding-android-arm-eabi": "1.2.14", "@rolldown/binding-android-arm64": "1.2.14", "@rolldown/binding-darwin-arm64": "1.2.14", "@rolldown/binding-darwin-x64": "1.2.14", "@rolldown/binding-freebsd-x64": "1.2.14", "@rolldown/binding-linux-arm-gnueabihf": "1.2.14", "@rolldown/binding-linux-arm64-gnu": "1.2.14", "@rolldown/binding-linux-arm64-musl": "1.2.14", "@rolldown/binding-linux-ppc64-gnu": "1.2.14", "@rolldown/binding-linux-s390x-gnu": "1.2.14", "@rolldown/binding-linux-x64-gnu": "1.2.14", "@rolldown/binding-linux-x64-musl": "1.2.14", "@rolldown/binding-openharmony-arm64": "1.2.14", "@rolldown/binding-win32-arm64-msvc": "1.2.14", "@rolldown/binding-win32-x64-msvc": "1.2.14" }, "bin": { "rolldown": "./bin/cli.mjs" } }, "sha512-eTBTTqMR6uHKLgcUqpJP8ntzDI6V4LYA8negAMBEI7gkgVvOdrx6VsvS2Ym+83KhOPdLCHWJu0w7UQFJZhHKNw=="], - - "source-map-js": ["source-map-js@1.2.2", "", {}, "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw=="], - - "tinyglobby": ["tinyglobby@0.2.17", "", { "dependencies": { "fdir": "^6.5.0", "picomatch": "^4.0.4" } }, "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g=="], - - "typescript": ["typescript@6.0.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw=="], - - "undici-types": ["undici-types@8.9.0", "", {}, "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg=="], - - "vite": ["vite@8.3.4", "", { "dependencies": { "lightningcss": "^1.33.0", "picomatch": "^4.0.7", "postcss": "^8.5.29", "rolldown": "~1.2.12", "tinyglobby": "^0.2.17" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", "@vitejs/devtools": "^0.7.1", "esbuild": "^0.27.0 || ^0.28.0", "jiti": ">=1.21.0", "less": "^4.0.0", "sass": "^1.70.0", "sass-embedded": "^1.70.0", "stylus": ">=0.54.8", "sugarss": "^5.0.0", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "@vitejs/devtools", "esbuild", "jiti", "less", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-IftLE8phJhdNRIGNEV4JCCvfNScoZQVfcXaN8TQropWGJtOHcu+iAB9pHcuGvmEb/kddw0LBe/jS8ztdC6xdiQ=="], - - "vscode-uri": ["vscode-uri@3.2.0", "", {}, "sha512-m2gXo3bn0G1kT9InzMf07fTbqMbGtyckj3bH5ktLO+1Ssv+yiATZ4dhwaQv9UZWxJh6E9IFGnQyjgWVDWVBDrg=="], - - "vue": ["vue@3.5.44", "", { "dependencies": { "@vue/compiler-dom": "3.5.44", "@vue/compiler-sfc": "3.5.44", "@vue/runtime-dom": "3.5.44", "@vue/server-renderer": "3.5.44", "@vue/shared": "3.5.44" }, "peerDependencies": { "typescript": "*" }, "optionalPeers": ["typescript"] }, "sha512-dvvmaOCG7lAMkJTPqPwWeGMsPS6DIsFsfZDUgBp9V6mHf9b3+/wyVwYR4Es+WV6uJC0FKRxp81Obcq0ZwUcGFQ=="], - - "vue-tsc": ["vue-tsc@3.3.13", "", { "dependencies": { "@volar/typescript": "2.4.28", "@vue/language-core": "3.3.13" }, "peerDependencies": { "typescript": ">=5.0.0" }, "bin": { "vue-tsc": "bin/vue-tsc.js" } }, "sha512-jE4/bXdOMSHVxEGgQCqNllJy+9N3Gx6tfSAsg0yhFK/MAN6eXqISihupnDEKSCt12VVnjN2gI3AqLYcqoh5x/A=="], - } -} diff --git a/compose.tracker.yaml b/compose.tracker.yaml deleted file mode 100644 index c658951..0000000 --- a/compose.tracker.yaml +++ /dev/null @@ -1,28 +0,0 @@ -# Our tracker image, built from the official Node base and pinned upstream npm package. -# Independent of coturn and its development secrets; usable alone on the VPS. -name: hellcon-tracker -services: - tracker: - build: - context: ./tracker - target: runtime - image: hellcon-tracker:local - init: true - restart: "no" - ports: - - "127.0.0.1:${TRACKER_PORT:-8000}:8000" - environment: - ANNOUNCE_INTERVAL_SECONDS: "5" - ALLOWED_ORIGINS: "${TRACKER_ALLOWED_ORIGINS:-}" - TRUSTED_PROXY_IPS: "${TRACKER_TRUSTED_PROXY_IPS:-}" - read_only: true - cap_drop: [ALL] - security_opt: [no-new-privileges:true] - mem_limit: 256m - cpus: 0.5 - pids_limit: 64 - logging: - driver: json-file - options: - max-size: "5m" - max-file: "2" diff --git a/compose.yaml b/compose.yaml deleted file mode 100644 index 8fe95c5..0000000 --- a/compose.yaml +++ /dev/null @@ -1,33 +0,0 @@ -# Linux development only. No boot startup or automatic container restart. -services: - coturn: - image: coturn/coturn:4.18.0-r0-alpine - network_mode: host - restart: "no" - command: - - -n - - --listening-ip=127.0.0.1 - - --relay-ip=127.0.0.1 - - --listening-port=${TURN_PORT:-3478} - - --realm=hellcon.local - - --use-auth-secret - - --static-auth-secret=${TURN_SECRET:?Run bun run dev:setup first} - - --fingerprint - - --min-port=49160 - - --max-port=49200 - - --no-tls - # DTLS is opt-in in coturn 4.18; leave it disabled. - - --no-tcp-relay - - --no-multicast-peers - # Needed for two browsers relaying to each other on this machine. - - --allow-loopback-peers - - --no-cli - - --no-software-attribute - - --log-file=stdout - tmpfs: - - /var/lib/coturn - logging: - driver: json-file - options: - max-size: "5m" - max-file: "2" diff --git a/dev/ice-server.ts b/dev/ice-server.ts deleted file mode 100644 index 845d832..0000000 --- a/dev/ice-server.ts +++ /dev/null @@ -1,35 +0,0 @@ -import type { IncomingMessage } from 'node:http'; -import { createHmac, randomUUID } from 'node:crypto'; - -interface IceResponse { - setHeader(name: string, value: string): unknown; - writeHead(status: number, headers?: Record): unknown; - end(body?: string): unknown; -} - -// Shared by Vite and the browser integration checks. Never imported by the client. -export function iceMiddleware(env: NodeJS.ProcessEnv) { - const secret = env.TURN_SECRET; - if (!secret) throw new Error('TURN_SECRET is required. Run bun run dev:setup first.'); - const host = env.TURN_HOST || '127.0.0.1'; - const port = env.TURN_PORT || '3478'; - return (req: Pick, res: IceResponse, next: () => void) => { - if (req.url?.split('?')[0] !== '/api/ice-servers') return next(); - res.setHeader('Cache-Control', 'no-store'); - if (req.method !== 'GET') { - res.writeHead(405, { Allow: 'GET' }); res.end(); return; - } - if (req.headers['sec-fetch-site'] === 'cross-site' || - (req.headers.origin && req.headers.origin !== `http://${req.headers.host}`)) { - res.writeHead(403); res.end(); return; - } - const expiresAt = Math.floor(Date.now() / 1000) + 3600; - const username = `${expiresAt}:${randomUUID()}`; - const credential = createHmac('sha1', secret).update(username).digest('base64'); - res.setHeader('Content-Type', 'application/json'); - res.end(JSON.stringify({ expiresAt, iceServers: [ - { urls: `stun:${host}:${port}` }, - { urls: [`turn:${host}:${port}?transport=udp`, `turn:${host}:${port}?transport=tcp`], username, credential }, - ] })); - }; -} diff --git a/docs/connection-investigation.md b/docs/connection-investigation.md deleted file mode 100644 index dd3f1d4..0000000 --- a/docs/connection-investigation.md +++ /dev/null @@ -1,120 +0,0 @@ -# First-version comparison - -Compared `d198332` (first commit) with `95e4a87` (current checkout), 2026-10-16. -The checkout was clean and did not contain the diagnostics files mentioned in -the handoff. The preview on port 4174 was not running. - -The user reports the original version works between two physical machines on -different networks. Earlier successful diagnostic logs were both same-machine -tests. The physical-device regression remains **unexplained**; the experiments -below do not reproduce it and do not establish a firewall, DNS or timing cause. - -## Relevant differences - -| Area | First version | Current checkout | Finding | -| --- | --- | --- | --- | -| STUN default | Google | PageQuit (introduced in `1d8e595`) | User also observed failure with Google; 701 is not a sufficient explanation. | -| Gathering | Completes immediately when done, otherwise returns partial SDP after 5 s | Requires completion within 30 s (`752d0cf`) | A real behavior change, but reported failed sessions gathered in 0–0.1 s. No evidence this deadline caused those failures. | -| Signaling | Base64 of SDP | Base64 of a versioned JSON envelope (`752d0cf`) | Both use the gathered `localDescription.sdp`, preserve candidates, and apply decoded SDP directly. Neither implements trickle signaling. | -| Failed peer | UI marks closed; peer stays alive | Session disposes failed peer (`752d0cf`) | Tested keeping it alive; did not recover in the controlled Firefox case. No justification yet to treat this as the root cause. | -| Transfer | Sends metadata/file on channel open | Requires fingerprint confirmation and receiver acceptance | These happen after ICE connects. The reported failures are at ICE setup. | -| Lifecycle | Sender was not closed on component unmount | Both roles close when switching Send/Receive | Browser-tab/app switching has no explicit cancellation handler in either version. | -| TURN | None | Explicit opt-in only | Default remains direct; do not assume another application's successful path was direct. | - -## Controlled experiment - -`scripts/compare-ice.mjs` loads the actual signaling helpers from the first -commit using `git show`, and the current helpers using Node's TypeScript -eraser. It creates independent local peer pairs for three modes: original, -current with the current UI's immediate failed-peer cleanup, and current with -that cleanup disabled. This isolates signaling/lifecycle behavior; it is not a -test of either complete Vue UI and does not simulate a physical network fully. - -All modes use identical ICE configuration. The experiment removes TCP offer -candidates and changes advertised UDP ports to port 9, leaving the real sender -socket alive. This deliberately prevents initial checks to the advertised -sender endpoint; a subsequent sender-initiated check can potentially discover -a usable peer-reflexive candidate. The answer is applied after 20 seconds. -Only times/states and receipt of a fixed probe string are reported, never SDP. - -Observed results on this host: - -| Browser | Original | Current | Current, keep failed peer | -| --- | --- | --- | --- | -| Firefox | Receiver failed at ~5 s; no probe received | Receiver failed at ~5 s; no probe received | Receiver failed at ~5 s; no probe received | -| Chromium | Probe received at ~20.3 s | Probe received at ~20.3 s | Probe received at ~20.3 s | - -A further Firefox run configured a silent loopback UDP socket as STUN -(`--slow-stun`). All modes still completed gathering in under 0.1 s and included -the end-of-candidates marker, so this did **not** exercise the partial-gathering -fallback. All failed alike. Do not claim this tested a genuinely slow STUN path. - -These results rule out the claim that simply retaining a failed peer fixes this -particular controlled case. They do not rule out a lifecycle regression in other -conditions, nor prove that a 20-second answer delay is safe on physical devices. - -## Next discriminating evidence - -Use matching first/current versions on both physical devices, with the same -sender direction, STUN provider and page origin/browser profile. Record whether -the actual receiver obtains the full file. Compare local/remote candidate types, -selected pairs and check counters; the current UI now retains these after -failure. A missing public candidate, an absence of candidate pairs, and checks -sent with no responses are distinct observations, not diagnoses by themselves. - -Do not change firewall rules or shorten user copy/paste time based only on the -same-machine tests. The original/current comparison has not yet identified a -code change that demonstrably explains the user's physical-device failures. - -## Two Brave peers on different networks, subsequent report - -The reported setup is the same two devices/networks used for the first-version -trial. In the new logs both peers gather two host candidates and one srflx -candidate, with no relay. Neither reports a connected state or transfer activity. -The sender's sole live snapshot is immediately after applying the answer: one -in-progress pair, one request sent, and zero responses so far. This is not a -snapshot of the whole failed attempt. Both final snapshots have no candidate -pairs; the browser has already discarded the useful evidence. - -Each log has its own time origin. Sender “answer applied at 25.8 s” cannot be -compared directly with receiver “failed at 15.1 s” to establish whether the answer -was applied before or after receiver failure. A 701 event with a gathered srflx -candidate also does not identify the reason the peer connection failed. - -The v3 UX work changed the signaling envelope version, not candidate gathering or -the SDP applied to the browser. The original default STUN provider was Google; -the current default is PageQuit. Matching that selection is necessary for an -original/current comparison, even with unchanged devices and networks. - -Diagnostics now sample candidate-pair counters at 3, 6, 9 and 12 seconds while ICE -is checking, and include allowlisted DTLS transport states. Sampling stops when -checking ends or the session is disposed. Receiver answer creation also takes a -snapshot. These changes improve evidence collection; they are not a demonstrated -fix for the physical-device connection failure. - -The isolated comparison was also rerun with `/usr/bin/brave`: original, current, -and current-without-immediate-cleanup all delivered the fixed probe at roughly -20.25 seconds after a deliberate 20-second answer delay. In this local test the -receiver did not report checking until the delayed answer was applied on the -sender, unlike the reported physical-device attempt. It does not reproduce that -attempt or establish that its answer-exchange timing is safe. - -## Subsequent successful transfer report - -The next supplied receiver/sender logs show a completed transfer. The receiver -created its answer at 0.1 s, sampled two in-progress pairs with no incoming checks -or responses through 12.0 s, then connected at 13.3 s. The sender applied the -answer at 40.3 s on its own clock and connected by 40.4 s. These are independent -time origins; the initial zero-response samples alone do not establish failure. - -Both final snapshots show one selected, nominated, succeeded srflx/UDP to -srflx/UDP pair, with DTLS connected and no relay candidates. The receiver reports -download storage and transfer done at 36.9 s; the sender reports awaiting-receipt -followed by done at 64.0 s. This establishes successful direct connectivity and -application-level completion for this attempt. The user also confirmed that the downloaded file saved and opened correctly. - -The supplied logs do not identify the browser, STUN provider, or whether any -network/setup settings changed. This success does not identify the cause of the -earlier failures or demonstrate a connectivity fix in the diagnostic changes. -The user identified the accompanying console warnings as stale and unrelated; -they are excluded from this result. diff --git a/docs/device-identities.md b/docs/device-identities.md deleted file mode 100644 index 8725eda..0000000 --- a/docs/device-identities.md +++ /dev/null @@ -1,88 +0,0 @@ -# Remembered-device protocol and storage - -Phase 3 adds optional hosted-browser identities. Temporary sessions still use -manual fingerprint comparison. -This is an application protocol design and implementation review, not an -independent cryptographic audit. - -## Authentication transcript - -A device has an ECDSA P-256 key pair. An identity-enabled connection code -(see `src/lib/codes.ts` for the `HC1.` encoding) uses signaling envelope -version 4 with a public key (65-byte uncompressed point, lowercase hex) and a -fresh 32-byte cryptographically random nonce. Both local -and remote SDP fingerprints continue to be validated as full SHA-256 values. -Temporary codes use version 3. Old builds reject version 4 before connecting. -Current builds accept both; if either participant uses a temporary identity, -both must manually verify fingerprints and no device is remembered. - -When both codes advertise identities, each FileSession ready frame includes an -ECDSA/SHA-256 signature. The signed UTF-8 bytes are JSON.stringify of this ordered -array, with no optional fields: - -``` -["HellCon device proof", 1, 4, role, - offerPublicKey, offerNonce, answerPublicKey, answerNonce, - offerFingerprint, answerFingerprint] -``` - -The role is `offerer` or `answerer`. Fingerprints are uppercase hex bytes separated -by one space. Signatures use Web Crypto's 64-byte P1363 encoding, lowercase hex. -The recipient verifies the other role with the other public key. Both keys, -both fresh nonces, and both DTLS certificate fingerprints are bound to the proof. -Roles and domain/version separation prevent reflection and cross-protocol use; -fresh contributions from both peers prevent replay into a new connection. -The signed fingerprints bind the identity to the encrypted transport. A proof -from another connection cannot authenticate an attacker-controlled DTLS peer. - -Each connection opts in separately and trusts at most one public key, its paired -device. A local user either compares both full fingerprints or connects on a -paired connection. A connection name has no protocol meaning. A matching paired -key permits local verification to proceed automatically, but metadata and file -data stay gated until the peer's fresh signature verifies. Unknown, changed, -missing, or downgraded identities require manual fingerprint comparison. -A changed key never replaces a paired device automatically: replacing it is an -explicit, unticked choice on the verification step. An invalid or missing -signature in a negotiated identity session closes the session. Each file still -requires acceptance. The session receive queue is bounded to 2 MiB while signature -verification is pending and throughout transfers; the existing 1 MiB send windows -remain unchanged. - -A peer key is only saved to a connection after both peers' ready frames pass -verification, and only if the user left **Remember this device** ticked on the -verification step. Manual first pairing therefore authenticates the keys through -the compared transport fingerprints and proofs. Public identities in codes are -linkable; the UI makes this explicit before opt-in. No identities or connection -names are added to diagnostic logs, and connection names are not sent to peers. - -## Storage and recovery - -The `hellcon-devices` IndexedDB store holds one CryptoKey private key and its -public key, shared by all connections. Each record in `hellcon-connections` -holds its own opt-in flag and paired public key. New private keys are -non-extractable; existing stored keys remain usable. -Browser storage does not protect against compromised app code, a hostile host, -or compromised browser: app code can still use a stored key to sign. -New connections are not opted in. Creating an identity opts in the connection it -was created from. Clearing site data loses the identity and pairings; an empty -store never creates trust automatically. Storage errors leave temporary sessions -available. Unreadable identity storage can be explicitly cleared before creating -a new identity and pairing again. Atomic revision checks reject stale identity -writes from other tabs; connection records are read and written in single -transactions. Identity deletion requires explicit consent, keeps paired devices, -and is disabled during a session. Removing a connection forgets its device. -Before each identity-enabled connection, the connection record and identity are -read again from storage. A device forgotten in another tab loses automatic -verification on the next connection, and a replaced local identity is picked up. -A failed refresh stops setup instead of using cached trust. - -There is no central revocation service. Peers must forget a compromised key. - -Review checks: both role directions, substitution of either identity, alteration -of either nonce or fingerprint, forged signatures, replay into fresh contexts, -metadata gating during asynchronous verification, non-extractable private keys, -and persistence/reconnection with real browser CryptoKeys. These -checks do not replace an independent protocol review. - -Web Crypto algorithm and key-storage reference: -https://www.w3.org/TR/WebCryptoAPI/ diff --git a/docs/ux-roadmap.md b/docs/ux-roadmap.md deleted file mode 100644 index e7f0126..0000000 --- a/docs/ux-roadmap.md +++ /dev/null @@ -1,147 +0,0 @@ -# Serverless UX roadmap - -The app runs over HTTPS or on localhost. The current build uses manual signaling. -The next addition is [WebTorrent tracker reconnect](webtorrent-reconnect.md): -a configurable default or custom tracker exchanges encrypted connection codes for -paired devices, without a Trystero dependency. This replaces the custom rendezvous -proposal and the earlier blanket exclusion of a signaling backend. Peer presence, -offline wake-up and silent TURN fallback remain outside scope. An experimental -concept of reconnect works; the sections below describe the rest of the app. - -## Connection workspace — implemented - -The app title and connection list live in a sidebar. The first slot is **Con 1**; -users add subsequent slots explicitly and can rename them. Selecting a slot opens -its setup and transfer controls. Cached workspaces -keep live sessions and file selections intact while navigating between slots. -The sidebar collapses on mobile; network configuration is expandable. - -IndexedDB stores slot names and paired devices. Transfer history, file contents, -and connection codes are not stored. Slot mutations are transactional, and other -tabs refresh their lists after changes. Storage failures show an explicit warning. - -Disconnect and Reset keep the slot. Reloading ends live sessions and requires -fresh codes; a slot's paired device is authenticated by fresh signed proofs, and -setup re-reads it from storage so a device forgotten elsewhere is not trusted. - -## 1. Send another file on a verified connection — implemented first - -Keep the reliable data channel open after a successful receipt. The sender can -choose or drop another file without exchanging codes or confirming fingerprints -again. Require explicit receiver acceptance for each file. Reset counters, -metadata, and storage per file while retaining connection verification. Preserve -a completed memory download until the receiver accepts its replacement or resets. -Keep network settings fixed for the session; relay consent applies to that -connection until disconnect. Reset, disconnect, errors, and tab closure end -the session. Idle completed sessions remain open while both tabs remain available; -a lost connection requires fresh codes. - -The first implementation negotiated repeat support within v2. Phase 2 supersedes -that compatibility path with protocol v3; both peers now need the current build. - -## 2. Multiple files and transfers in either direction — implemented - -Session ownership is independent of the initial Send/Receive setup choice. After -verification, Send/Receive navigates between sections while preserving the session. Both people can select or drop multiple -files and add more while transferring. Each local queue is capped at 32 including -its active outgoing file. - -The arbitration decision is one sequential queue per direction, permitting two -active files total. Simultaneous offers therefore never compete for one global -slot. Monotonic odd/even IDs identify files by originating peer; control frames -and binary chunks carry these IDs. Each file uses the existing bounded window, -receive queue, receipt validation, and storage limits. The receiver accepts or -declines every file separately. Only one incoming memory file is retained. - -Remove affects only a waiting local item. Decline rejects an incoming offer before -acceptance and advances the peer's queue. Disconnect cancels the whole session, -clears queues, and aborts unfinished writes in either direction. Cancellation of -an individual active file is intentionally not provided. Completed memory downloads -survive disconnect until Reset or the next acceptance. - -Protocol v3 rejects old connection codes before setup. Tests cover simultaneous -queues, empty files, separate acceptance, removal, decline, stale IDs/receipts, -queue caps, storage cancellation, and verification gates. Browser checks exercise -both directions, real bytes, accessibility, and streaming downloads. - -## 3. Remember trusted devices — implemented - -The hosted app offers an opt-in device identity, and each connection slot can -remember one paired device. First pairing requires manual fingerprint comparison; -a slot is paired only after successful mutual verification. Later sessions on a -paired slot verify fresh signed proofs bound to both keys, both nonces, both DTLS -fingerprints, and participant roles. Slot names and saved codes never -authenticate a peer. Changed or missing identities require manual comparison and -never replace a paired device automatically. - -Temporary sessions remain the default, and every file still requires acceptance. -Forgetting devices, identity deletion, storage failure -fallback, unreadable-storage recovery, and conflicting-tab write protection are -implemented. Identity-enabled signaling uses v4; -temporary connections retain v3. Browser keys remain accessible to app code. - -Tests cover proof forgery and replay, altered session bindings, metadata gating, -persistence across reload, changed identities, -storage denial/recovery, and protocol-version validation. Design and review notes -are in [the device identity protocol](device-identities.md); this is not an -independent cryptographic audit. - -## 4. Compressed connection codes — implemented - -Offers and answers are compressed `HC1.` codes that state their type and share a -reference, so mixed-up or stale codes are rejected with a specific message. -Shareable invitation links were built on top and removed again: they did not make -real-world connections more reliable. An optional signaling backend is the -intended way to simplify the exchange. - -## 5. Guided connection flow - -Present one primary next action across Choose files → Share code → Connect -→ Verify → Transfer. Collapse completed setup steps, expose advanced network -settings on demand, and keep relay consent explicit. Show session state separately -from file progress. Distinguish connected, awaiting acceptance, saving, completed, -and disconnected. Provide recovery actions tailored to the actual failure. - -Prefer the hosted streaming-download path when supported, retain native disk and -bounded memory fallbacks, and explain browser download completion accurately. -Use accessible focus management, keyboard controls, live status announcements, -and mobile layouts. Validate both first-time and remembered-peer paths, denied -permissions, clipboard/share fallback, browser suspension, and reconnect guidance. - -## Delivery order and gates - -Deliver in the order above, with a build and relevant protocol/browser checks per -phase. Small contextual UI improvements can accompany each phase. Treat identity -authentication and bidirectional framing as explicit design/review milestones. -No new persistent data or backend is needed for phase 1. Deployments are separate -from implementation; this document is the plan for the remaining phases. - -## Later: peer mesh (exploratory, unscheduled) - -Open HellCon tabs could assist each other so the tracker becomes a bootstrap -fallback rather than a requirement. This is an idea, not a commitment. - -**Peer-relayed signaling.** WebRTC only needs a channel for offer, answer and ICE -candidates. If A has verified sessions with B and C, and B and C are paired with -each other, A can forward their reconnect exchange over its data channels. Seal -and authenticate the payloads with the B–C pairing key and bind them to the DTLS -fingerprints, so A acts only as a mailbox and cannot interpose. A relay does not -create trust: introducing unpaired devices still requires manual verification. -Fall back to the pairing's tracker or manual codes when no shared peer is open. - -**Multi-source transfers.** Split a file into pieces hashed under a manifest -signed by the original sender. Any verified peer that holds pieces can serve -them; receivers check every piece against the manifest. Once one complete copy -exists, the sender may leave. Requesting only missing pieces also allows resuming -an interrupted transfer. This stays inside verified HellCon sessions: no public -swarms, no BitTorrent interoperability, and acceptance is still required per file. - -**Limits.** "Online" means an open tab; browsers cannot listen in the background -and service workers cannot hold WebRTC connections, so there is still no presence -or offline wake-up. Relayed signaling does not help NAT traversal; STUN and -explicit TURN consent remain unchanged. The relay sees which of its peers connect -to each other. - -**Preparation.** Keep the tracker reconnect adapter's announce/offer/answer layer -independent of the pairing logic and of its transport, so a data channel can carry -the same sealed exchange later. diff --git a/docs/webtorrent-reconnect.md b/docs/webtorrent-reconnect.md deleted file mode 100644 index 4b1f46c..0000000 --- a/docs/webtorrent-reconnect.md +++ /dev/null @@ -1,348 +0,0 @@ -# WebTorrent tracker reconnect (experimental concept) - -This replaces the custom rendezvous server proposal. HellCon will exchange fresh -connection codes through a configurable WebTorrent-compatible WebSocket tracker, -using a small client adapter built on native browser APIs. Deploy an existing -tracker implementation; do not add Trystero or the WebTorrent file-transfer -client to HellCon. Nostr is outside this plan. - -The [repository-owned tracker container](../tracker/README.md) now provides the -development/deployment foundation, using an official Node base and a locked -upstream package. A first browser implementation exists to prove the concept; -see [Concept status](#concept-status) for what it covers and what is still open. - -Client independence takes priority: anyone can clone, fork, self-host or modify -HellCon and choose their own tracker. The client must work with any compatible -tracker and must not depend on a particular operator or on HellCon-specific -server extensions. Vue remains the only runtime dependency. - -## User experience and scope - -A paired connection gets a **Reconnect** button. Both people open that connection -and press Reconnect; the app negotiates a new WebRTC connection and authenticates -the remembered device. Both pages must be open. Files still require acceptance. -Manual code exchange remains available for initial pairing and recovery. - -Network settings gain an independent **Connection discovery** section: - -- **Manual codes**, **Default tracker**, or **Custom tracker**. -- Custom tracker: one `wss://` URL, including any required path. -- The default URL comes from `VITE_TRACKER_URL`; if unset, offer Manual and Custom. -- Show the selected host and explain that it can observe which clients meet. -- Leave STUN selection and explicit TURN consent as separate controls. -- The selection applies to new pairings; existing pairings keep their stored - trackers. - -There is no public peer directory, background presence, offline wake-up, file -storage, torrent file generation, DHT, or BitTorrent piece transfer. The tracker -only handles discovery and signaling. Reconnecting establishes a new session; -it does not resume an interrupted file transfer. - -The first release contacts one agreed tracker per pairing, but pairings store -and negotiate an ordered tracker list so fallback trackers can be added later -without a storage migration or pairing protocol change. Contacting several -trackers and automatic fallback between operators are deferred. Selecting an -endpoint is not authorization to contact additional public trackers. - -## Pairing and persistence - -After mutual device verification on a manual connection, both users can enable -**Reconnect using this tracker**. This opt-in is separate from remembering a -device and starts unticked. The manual session's offerer proposes the selected -tracker URL; the recipient sees and confirms it before the app stores or -contacts it. - -Add a versioned pairing exchange to the authenticated data channel. Both peers -contribute 32 random bytes. Derive a shared HKDF-SHA-256 base key from the ordered -contributions and a context binding both device keys and connection fingerprints. -Use an unambiguous, versioned encoding and separate derivation labels for each -purpose. Store the base key as a non-extractable CryptoKey. - -The connection record stores the paired key, the local identity public key used -for pairing, the shared key, the agreed ordered list of concrete tracker URLs (one -entry in the first release), and the reconnect -protocol version. Resolve Default to a concrete URL at pairing time: changing a -build default must not silently move existing pairings to another operator. - -Both peers acknowledge the pairing settings over the verified channel before -showing reconnect as configured. An interrupted exchange or storage failure can -leave only one peer configured; show the failure and allow manual setup to repair -the pairing. Do not claim atomic persistence across two browsers. - -Forget device, Remove connection, identity deletion/replacement, or replacement -of the paired device invalidates reconnect credentials. Re-read identity and -pairing state before each attempt and propagate local revocation across tabs. -Clearing browser storage loses pairing. A non-extractable key remains usable by -trusted application code; it does not protect against a compromised app host. - -Changing a pairing's tracker requires coordination. While connected, propose and -confirm the replacement over the authenticated channel. If the old tracker is -unavailable, exchange manual codes to agree on a replacement. A local edit alone -cannot inform an offline peer. - -## Client architecture - -Keep `src/lib/webrtc.ts`, device proofs, and the existing file session as the -transport and authentication foundation. Separate setup lifecycle code from -`TransferPanel.vue` so manual and tracker setup can feed the same session without -duplicating verification, cancellation, TURN consent, or transfer behavior. - -Introduce focused modules for pairing storage/derivation, encrypted signaling, -and the WebSocket tracker adapter. The adapter handles tracker announcements, -offer routing, answers, retries, and cleanup. It never receives file contents. - -Use native `WebSocket`, `RTCPeerConnection`, and Web Crypto. Basic WebTorrent -tracker signaling requires no Nostr-style Schnorr signature library. Preserve -HellCon's P-256 identity proofs; tracker peer IDs are routing identifiers only. -Server-side dependencies are maintained separately from the browser bundle. - -Keep the encrypted signaling exchange independent of the WebSocket transport. -The [peer mesh idea](ux-roadmap.md#later-peer-mesh-exploratory-unscheduled) may -later let an open, verified peer forward the same sealed exchange over a data -channel, leaving the tracker as a fallback. That idea is unscheduled and not part -of this plan. - -## Discovery and encrypted signaling - -Derive a 20-byte discovery identifier from the pairing secret with a dedicated -HKDF label and UTC day. Use it as the tracker's `info_hash`; it identifies a -private pairing, not a file. Derive a separate AES-256-GCM signaling key with a -different label. Near UTC midnight, temporarily join adjacent day identifiers, -deduplicate attempts, and close the unused route. Estimate clock skew from the -`Date` header of a same-origin response where available, and report skew beyond -the expiry tolerance. - -Randomize the 20-byte tracker `peer_id` per reconnect attempt and keep it stable -only for that attempt. The peer that finds the other already registered sends -the offer: announce responses report swarm counts, so the second arrival can -gather a fresh offer immediately. If both offer at once, the offer from the -lower paired device public key wins and the other peer discards its own. Reject -equal identities for this automatic role scheme and leave manual setup available. - -Use the WebSocket tracker's normal `announce`, `offers`, `offer_id`, `answer`, -and `to_peer_id` fields. Encode 20-byte identifiers as the protocol's binary -strings inside JSON, not hex strings. Use constant placeholder transfer counters -where needed; never expose actual filenames or transferred byte counts. - -Carry a versioned encrypted HellCon envelope in the offer/answer `sdp` string, -following the opaque-payload approach used by Trystero. The decrypted envelope -contains the complete HellCon identity-enabled code. Only decrypted and validated -SDP reaches `setRemoteDescription`. This is a HellCon signaling convention over -a tracker protocol, not interoperability with ordinary torrent clients or with -Trystero rooms. - -Each envelope uses a fresh random 96-bit AES-GCM IV. Authenticate the protocol -version, discovery identifier, offer ID, message role, source peer ID, and answer -destination in unambiguously encoded associated data. Include attempt nonces and -an expiry inside the ciphertext; answers must bind the outstanding offer nonce. -Fix the allowed clock skew together with the encoding. -Freeze the exact encoding and publish test vectors before implementation ships. - -Track outstanding offers and bounded duplicate caches. Ignore exact retransmits, -reject mismatched answers, and never reuse an offer from a disposed peer -connection. Expiry and duplicate checks reduce replay; they do not guarantee -that a captured offer is undeliverable after browser reload. Fresh device proofs -bound to both session nonces and fingerprints remain mandatory before releasing -file metadata. Invalid or changed identity ends automatic reconnect; switching -to manual verification requires a deliberate new manual setup. - -## Connection lifecycle and failure handling - -Trackers forward offers only to peers already registered; registration alone -does not guarantee delivery. The first arrival registers without offers and -keeps its registration alive at the tracker interval; the second arrival offers. -If a tracker reports no usable counts, fall back to bounded periodic offers and -gather a fresh offer for each one: never resend an offer whose candidates may -have expired. Configure our tracker for interactive discovery. Respect custom -tracker pacing and show a waiting state rather than assuming immediate matching. - -Limit each slot to one reconnect attempt per browser profile with a Web Locks -(`navigator.locks`) lock; propagate revocation through the existing -`BroadcastChannel`. Bound in-flight negotiations, frame sizes, peer counts and -retry state. Multiple tabs or a third party must not cause unbounded peer -allocation. Do not assume the tracker enforces two clients per room. - -Trackers deliver each offer to a random registered peer, so a third peer in the -swarm can receive an offer meant for the paired device and stall the attempt. -Send at most one offer per counted peer, up to a small cap, and report this as -a failed attempt, not an authentication failure; it denies service but cannot -authenticate as the paired device. - -Use a five-minute total attempt deadline and retain the existing ICE gathering -limit. Validate incoming frames before decrypting or creating peers. Handle -tracker rejection, malformed data, socket loss, an absent peer, stale answers, -and authentication failure with specific errors and a manual-code recovery path. - -After mutual authentication, stop announcing, send a best-effort stopped event, -and close the tracker socket. Cancel, timeout and Reset also dispose timers, -sockets and pending WebRTC peers. Tracker loss after setup does not interrupt -an established transfer. A later reconnect creates fresh signaling state. - -## Compatibility and rollout - -Plan signaling v5 for identity-enabled sessions to negotiate the pairing exchange -and bind that version into device proofs. Temporary manual v3 sessions remain -available. Existing paired v4 slots retain their trusted device key but require -one new manual session on compatible builds to enable tracker reconnect. - -Use an IndexedDB schema migration without dropping names, history or trust. -Clearing reconnect settings must not delete unrelated connection history. -Document version mismatch errors and make the tracker mode's capabilities -explicit; an older HellCon client must not silently skip authentication. - -## Self-hosting and custom endpoints - -Run a pinned release of `webtorrent/bittorrent-tracker` with WebSocket support in -a dedicated container behind the existing HTTPS reverse proxy. Expose a single -`wss://` endpoint; disable UDP/HTTP tracker APIs and public statistics. Keep the -backend port private. Build the image from a pinned package version and -lockfile; the tracker never enters HellCon's `package.json`. Run it from Compose -for local development, as with coturn, and set explicit CPU/memory, connection, -frame-size and request-rate limits in the deployment configuration. - -The reverse proxy alone provides no rate limiting. Where the pinned release lacks -per-IP limits, swarm caps or origin checks, the container runs a small start -script around the tracker library that adds them and trusts forwarded client -addresses only from the proxy. These are operator protections: the client must -not depend on them, and custom trackers without them must still work. - -Configure short announcement intervals and cleanup of stale peers and empty -swarms. Bound the total number of swarms as well as peers per swarm. Disable -payload/debug logging and identifying access logs on the tracker path. Health -checks and aggregate metrics must not expose pairing identifiers or IPs. -Origin checks can restrict normal browser use but cannot authenticate arbitrary -clients or prevent deliberate abuse. - -For Custom, require a valid `wss://` URL without embedded credentials or a fragment; -allow `ws://` loopback only in local development. Do not implement arbitrary -tracker-specific login schemes in the first release. Unsupported authentication -or payload policies produce a clear error. - -To support arbitrary user-selected secure WebSocket endpoints, the hosted build -will need `connect-src 'self' wss:` in place of its current self-only policy. -This deliberately trades a narrower exfiltration boundary for client -independence; document the broader network permission. Self-hosters may retain -an explicit -host allowlist; the UI must explain when their CSP blocks a custom endpoint. - -Public tracker compatibility is a release gate, not a blanket promise. Verify -encrypted offer forwarding, identifier encoding, payload limits, announcement -timing and usage policy against the selected implementation. Record the tested -server version and configuration. No public tracker is bundled without a policy -and availability review. - -## Privacy limits - -The tracker sees connecting IPs, Origin, discovery identifiers, temporary peer -IDs, routing fields, timing and ciphertext sizes. It can associate the clients -it matches. Other clients may also observe or probe discovery identifiers if a -tracker exposes them. An unguessable identifier helps against guessing; the -pairing secret and device proofs protect access even if that identifier leaks. - -Rotating identifiers removes a stable protocol label but does not prevent IP or -timing correlation. No-log configuration reduces retained data; it cannot stop -a malicious operator recording traffic. Self-hosting changes who observes this -metadata. Direct WebRTC traffic also exposes endpoints to network observers. -The feature provides convenient encrypted signaling, not anonymity. - -## Implementation steps and acceptance checks - -1. Prove interoperability with a pinned tracker: two native WebSocket clients - exchange bounded opaque offer/answer payloads in both arrival orders. Confirm - that announce responses count WebSocket peers and that a maximum-size code - fits the frame limit after encryption and encoding. Resolve tracker - restrictions before building the UI. -2. Add pairing negotiation, migration and revocation; test matching derivations, - domain separation, day boundaries, interrupted pairing and storage failures. -3. Add encrypted envelopes and the adapter; test tampering, replay, duplicate - routing, stale answers, third peers, retry bounds and complete cancellation. -4. Integrate discovery settings and Reconnect with the existing setup lifecycle. - Pair two browsers manually, reload both, reconnect without copying codes, - authenticate the saved peer and transfer exact bytes in both directions. -5. Verify Chromium/Firefox combinations, real separate-device networks, explicit - TURN use, tracker outage, endpoint changes, clock skew, cross-tab attempts, - forgotten devices and manual fallback. Local success alone is insufficient. -6. Validate the deployment's TLS, CSP, rate/resource limits, cleanup, log behavior - and upgrade procedure. Update user documentation only when the feature ships. - -Maintenance centers on the pinned tracker and its dependencies, browser/network -behavior, and the small HellCon adapter. Keep a reproducible local tracker fixture -so upgrades can run the same interoperability and reconnect checks. Supporting -additional discovery protocols would add independent maintenance and test paths. - -## Concept status - -Implemented in `src/lib/reconnect.ts` (pairing derivation, discovery identifier, -sealed envelopes), `src/lib/tracker.ts` (WebSocket adapter and attempt logic) and -`TransferPanel.vue`: - -- Setup runs over a verified session whose peer proved the paired device key. - Either person proposes a tracker URL; the peer sees the host and accepts or - declines. Both contribute 32 random bytes; the HKDF context binds both device - keys, both fingerprints of that session and the tracker URL. The proposer - stores first, then the acceptor; each waits for its IndexedDB write, and the - acceptor acknowledges its completed write before the proposer reports success. - A failed write on either side is reported to both people, and the proposer - removes its stored copy again if the acceptor's write failed. The base key is - a non-extractable CryptoKey in the connection record, which Forget device, a - replaced paired device and **Turn off reconnect** clear. A changed local - identity blocks the attempt. -- Every session that authenticates the paired device exchanges a 128-bit check - value derived from the stored pairing (or an empty value without one) over - the encrypted session. On a mismatch, the side holding a pairing turns it off - and says so. This repairs interrupted setups, and **Turn off reconnect** on - one device reaches the other at the next manual session. A match shows the - pairing as set up on both devices. -- **Connection discovery** in Network settings: Manual codes only, Default - tracker (only when `VITE_TRACKER_URL` is set) or Custom tracker. The choice is - a per-browser preference in `localStorage`, stays editable during a session, - and is resolved to a concrete URL when setup is proposed; existing pairings - keep their tracker. -- The discovery identifier is derived per UTC day; envelopes are AES-256-GCM with - a random IV, the role, info_hash, offer ID, source and destination peer IDs - as associated data, and a two-minute lifetime with five minutes' tolerance. - The decrypted code passes the usual `decodeCode` checks, and the peer's - identity key must equal the paired key; fresh device proofs then authenticate - the session as before. -- Roles differ from the plan above: the lower device key always offers and - creates the data channel, so there is no glare. If the other device arrives - second, it announces a sealed, codeless **wake** that makes the initiator - offer at once. Swarm counts from announce responses (which include the - announcing peer) trigger the same. Offers and wakes are spaced 15 seconds apart - and capped at 12; each offer uses a fresh peer connection. Envelopes that do - not open are ignored, so other clients in a swarm cannot disturb it beyond - receiving offers they cannot read. -- One attempt per slot and browser profile via Web Locks, a five-minute - deadline, a 15-second keepalive announce, `stopped` and socket close on - success, cancel, reset, failure and unmount. - -Checked on 2026-10-20 with `node scripts/browser-check.ts --tracker=` against -`wss://tracker.openwebtorrent.com` and `wss://tracker.webtorrent.dev`: pairing -setup, reload of both pages, Reconnect without codes, device proofs and exact -bytes in both directions, both roles. Both trackers report swarm counts, route -binary 20-byte identifiers unchanged and remove peers on `stopped`. -tracker.openwebtorrent.com relayed 56 KB payloads, tracker.webtorrent.dev 12 KB; -typical sealed codes are a few KB. Neither tracker is bundled. - -Still open before this can ship: - -- Firefox and real separate-device networks, tracker outage and cross-tab - behavior (step 5), `connect-src` for the hosted CSP, and the deployment checks. -- Clock-skew detection and a frozen envelope encoding with published test vectors. - -Deliberately not planned for now: - -- Signaling v5. Pairing messages ride the v3 session protocol, so an outdated - peer rejects them; reloading the page updates it. -- Joining adjacent day identifiers around UTC midnight. If one person presses - Reconnect just before UTC midnight and the other just after, they miss each - other until the first presses Reconnect again. -- An interrupted setup is not atomic across two browsers; the check in the - next authenticated session removes a one-sided pairing. - -## References - -- [WebTorrent tracker server and client](https://github.com/webtorrent/bittorrent-tracker) -- [WebSocket request parsing](https://github.com/webtorrent/bittorrent-tracker/blob/master/lib/server/parse-websocket.js) -- [Trystero tracker adapter, for protocol reference](https://github.com/dmotz/trystero/blob/main/packages/torrent/src/index.ts) -- [Existing device authentication](device-identities.md) diff --git a/index.html b/index.html index 9c13e78..eaa8a50 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@ - HellCon — P2P File Share + HellCon
diff --git a/package.json b/package.json index ab85dec..776dcbf 100644 --- a/package.json +++ b/package.json @@ -1,25 +1,14 @@ { "name": "hellcon", "private": true, - "version": "0.0.6", + "version": "0.1.0", "license": "MIT", "type": "module", "scripts": { "dev": "vite", - "dev:setup": "node scripts/dev-setup.ts", - "turn:up": "docker compose --env-file .env.development up -d", - "turn:down": "docker compose --env-file .env.development down", - "tracker:up": "docker compose -f compose.tracker.yaml up -d --build --wait", - "tracker:down": "docker compose -f compose.tracker.yaml down", - "test:tracker": "docker build --target test -t hellcon-tracker:test tracker && docker run --rm hellcon-tracker:test", - "test:turn": "node scripts/browser-check.ts --turn", - "build": "vue-tsc --noEmit && vite build", + "build": "vue-tsc && vite build", "preview": "vite preview", - "test": "node --test tests/*.test.ts", - "test:browser": "node scripts/browser-check.ts", - "test:download": "node scripts/browser-check.ts --stream-download", - "test:cross-browser": "node scripts/cross-browser-check.ts", - "typecheck": "vue-tsc --noEmit" + "typecheck": "vue-tsc" }, "dependencies": { "vue": "^3.5.44" @@ -27,12 +16,12 @@ "devDependencies": { "@types/node": "^26.6.5", "@vitejs/plugin-vue": "^6.0.10", - "axe-core": "^4.14.0", "typescript": "~6.0.3", "vite": "^8.3.4", "vue-tsc": "^3.3.13" }, "engines": { - "node": ">=22.18.0" - } + "node": ">=26.11.1" + }, + "packageManager": "pnpm@12.14.0" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..9903b75 --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,877 @@ +--- +lockfileVersion: '9.0' + +importers: + + .: + configDependencies: {} + packageManagerDependencies: + pnpm: + specifier: 12.14.0 + version: 12.14.0 + +packages: + + '@pnpm/exe.android-arm64@12.14.0': + resolution: {integrity: sha512-+iSh7x21C3A2hqc+Z0ZmbKTcn6YNlzrXM142PsnQH/dLj0DYxFzoBvc6XAnL/yfQ5nnH2ebBiRj/zVxr61fZbQ==} + cpu: [arm64] + os: [android] + + '@pnpm/exe.android-x64@12.14.0': + resolution: {integrity: sha512-qT+0LqEr2wBVaxcG2T8cX/R8SSRz2Rvpp8nRR4fh8tnGUZRch87gFmsHUAoSQh7w6j1h0qTjrA384j4xi8frvw==} + cpu: [x64] + os: [android] + + '@pnpm/exe.darwin-arm64@12.14.0': + resolution: {integrity: sha512-tnrdUB8ecJoehuKKqi1YHCBVl61xtJ9XVGcx5EviC6fWO4DeGI8GtXrjvJxDBM3nuVjJeWistgsUp/N142x4sw==} + cpu: [arm64] + os: [darwin] + + '@pnpm/exe.darwin-x64@12.14.0': + resolution: {integrity: sha512-vlBfGkruqQRsEHTW43cPwpYd7QlbIJ//cvpAdb3bVXkI8SgTPoXhCnc05m+ZNiPrrEkBsX/t7KHw9aXpkzPm3Q==} + cpu: [x64] + os: [darwin] + + '@pnpm/exe.freebsd-x64@12.14.0': + resolution: {integrity: sha512-Qg5rxBrGYl6Tfso+EyygPf84fY1Fzy55E/0or+iuYKtnf0vc0MlHJfVIlT7pBukMRntQHRik7hUi0Z4s7AlJsw==} + cpu: [x64] + os: [freebsd] + + '@pnpm/exe.linux-arm64-musl@12.14.0': + resolution: {integrity: sha512-DRIe4yQkXBGA/PhVJdzlbnllxBdAtnMMvTVLLcGpsK5FvJz9kxD2Hyxtn68ovmNkVX06f6p45cQwfm3wx2jn1A==} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@pnpm/exe.linux-arm64@12.14.0': + resolution: {integrity: sha512-7joGShZ44Nk3WpNU+60JoOPjCXlgxhJAq11S2UiVtwCUDgTer1yTPPfxGW8pxaD6046actYLIYDbZNlubHWs0A==} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@pnpm/exe.linux-ppc64@12.14.0': + resolution: {integrity: sha512-gSoryn7ySdXd//gjgf3MvvA8ZerJayaSbuMZMtAWq4vb2/wlVEgpl0Kvqt54y58TRj533Qjq2txKgnxd4JyoAQ==} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@pnpm/exe.linux-riscv64@12.14.0': + resolution: {integrity: sha512-EMjew1H9WqQ7pL+tYqCPwiuB+0PeCiJRV7fyWeuFw0wwYUajFBjcaPO3IGAVu9sdmJDU+e+HYv/Zey6aKae0Vw==} + cpu: [riscv64] + os: [linux] + libc: [glibc] + + '@pnpm/exe.linux-s390x@12.14.0': + resolution: {integrity: sha512-shYOj/SFoXD35fHe0pWr2JofwSXulC0BnEIXLj2QokDi0EF//AfKsui35yKIkTEl+s2VJybc3PO4iJNhKIj5Qw==} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@pnpm/exe.linux-x64-musl@12.14.0': + resolution: {integrity: sha512-btZiZ2Ot0llKK1ndSfA5i3IRX7/S0VrmzseNH/BJ4c+Cady+S81H6vvU1zByggHMyqQhC8OgxO5PiIY7D9bH0Q==} + cpu: [x64] + os: [linux] + libc: [musl] + + '@pnpm/exe.linux-x64@12.14.0': + resolution: {integrity: sha512-F6K8e/jWxiuEYJaQtRRUG9ynBSTEHa+t7Lf86MKuOO5UA7WVVMbi+oB8nY6iKW++ncWS2yG6T9faXZGxqNsfoQ==} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@pnpm/exe.win32-arm64@12.14.0': + resolution: {integrity: sha512-DOjlkVB6TtTKeAAe0hNZXn5S7YqESmo1Z6SGbR4BZNQ4isRg31XVHjX2RFTbY8gnZq68IwzyLmPqlEjMmYxofg==} + cpu: [arm64] + os: [win32] + + '@pnpm/exe.win32-x64@12.14.0': + resolution: {integrity: sha512-/LSX6mew/sLf08XqcjemuklNKf1K/Ftpgj4//hK/HKzI2dKbmxDB27a/2OaQ5a0O3/3OFzlssXDziZsi+yVBwQ==} + cpu: [x64] + os: [win32] + + pnpm@12.14.0: + resolution: {integrity: sha512-wYum2HmT09Fky16JSPMrLAbuhUSH4GzY2GeBNC+z5btGNDZwNHEehoArqpw3vqkGzhkprQjXCITJfYAd8TOJpg==} + engines: {node: '>=18.*'} + hasBin: true + +snapshots: + + '@pnpm/exe.android-arm64@12.14.0': + optional: true + + '@pnpm/exe.android-x64@12.14.0': + optional: true + + '@pnpm/exe.darwin-arm64@12.14.0': + optional: true + + '@pnpm/exe.darwin-x64@12.14.0': + optional: true + + '@pnpm/exe.freebsd-x64@12.14.0': + optional: true + + '@pnpm/exe.linux-arm64-musl@12.14.0': + optional: true + + '@pnpm/exe.linux-arm64@12.14.0': + optional: true + + '@pnpm/exe.linux-ppc64@12.14.0': + optional: true + + '@pnpm/exe.linux-riscv64@12.14.0': + optional: true + + '@pnpm/exe.linux-s390x@12.14.0': + optional: true + + '@pnpm/exe.linux-x64-musl@12.14.0': + optional: true + + '@pnpm/exe.linux-x64@12.14.0': + optional: true + + '@pnpm/exe.win32-arm64@12.14.0': + optional: true + + '@pnpm/exe.win32-x64@12.14.0': + optional: true + + pnpm@12.14.0: + optionalDependencies: + '@pnpm/exe.android-arm64': 12.14.0 + '@pnpm/exe.android-x64': 12.14.0 + '@pnpm/exe.darwin-arm64': 12.14.0 + '@pnpm/exe.darwin-x64': 12.14.0 + '@pnpm/exe.freebsd-x64': 12.14.0 + '@pnpm/exe.linux-arm64': 12.14.0 + '@pnpm/exe.linux-arm64-musl': 12.14.0 + '@pnpm/exe.linux-ppc64': 12.14.0 + '@pnpm/exe.linux-riscv64': 12.14.0 + '@pnpm/exe.linux-s390x': 12.14.0 + '@pnpm/exe.linux-x64': 12.14.0 + '@pnpm/exe.linux-x64-musl': 12.14.0 + '@pnpm/exe.win32-arm64': 12.14.0 + '@pnpm/exe.win32-x64': 12.14.0 + +--- +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + dependencies: + vue: + specifier: ^3.5.44 + version: 3.5.44(typescript@6.0.3) + devDependencies: + '@types/node': + specifier: ^26.6.5 + version: 26.6.5 + '@vitejs/plugin-vue': + specifier: ^6.0.10 + version: 6.0.10(vite@8.3.4(@types/node@26.6.5))(vue@3.5.44(typescript@6.0.3)) + typescript: + specifier: ~6.0.3 + version: 6.0.3 + vite: + specifier: ^8.3.4 + version: 8.3.4(@types/node@26.6.5) + vue-tsc: + specifier: ^3.3.13 + version: 3.3.13(typescript@6.0.3) + +packages: + + '@babel/helper-string-parser@7.29.7': + resolution: {integrity: sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==} + engines: {node: '>=6.9.0'} + + '@babel/helper-validator-identifier@7.29.7': + resolution: {integrity: sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==} + engines: {node: '>=6.9.0'} + + '@babel/parser@7.29.9': + resolution: {integrity: sha512-CjXrNHTnvqBVqHgdBysY3vk2T8tpJHb5/RMeHJBTyVa9xgugCB0CJTx/3oO8RV2QRQP391RWpB7D6hLjm8V9uA==} + engines: {node: '>=6.0.0'} + hasBin: true + + '@babel/types@7.29.8': + resolution: {integrity: sha512-Vj1jF3cPfxg7OAfoI7QnVKLoILlm2JF9pnVHrX8qx7AHMiYWT+NDAA7jChlNgRS4WTLc/fD1lXLmPixluj+3Gg==} + engines: {node: '>=6.9.0'} + + '@jridgewell/sourcemap-codec@1.6.0': + resolution: {integrity: sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==} + + '@oxc-project/types@0.154.0': + resolution: {integrity: sha512-KYOUGQFlLWR+s4QMV2Q9ko38TZm7EdO87Qm7rvZLqk/webse/cDjtyxKhg/47l0byCbs/k46LT8qc4PKjAikzA==} + + '@rolldown/binding-android-arm-eabi@1.2.14': + resolution: {integrity: sha512-aWR+XKH9+rW7m5fWq/5360J3mHycrx/o6xZM2DQFdJnTMdyP7/WzxPjhtLbVWdKo2y612/4U1bWqb3HQhiF7vg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] + + '@rolldown/binding-android-arm64@1.2.14': + resolution: {integrity: sha512-QiVxHofl6A8lQU7WAtOUY4QMVZXohxwz7WJJoeh8NBEUyKfIkMRKhYyq8az/1RypNiIXzNTtiS6KwHz0erxYRQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@rolldown/binding-darwin-arm64@1.2.14': + resolution: {integrity: sha512-lTQOzHuBIooh3jIr5XINQkjPGEuGy+Dsy0meXDr6Sjty0b99kYgGh4uBC/8mJX1T0kC8d6S0aPP1Y+bHkh6aBw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.2.14': + resolution: {integrity: sha512-hyMKEGatjmBYCs/Q4sbIcL/GqpFEqsX3wc+HYVQ/85A4rxc1o7rPm4DUI4GV4k/h0ITddwFSGpqQunI14GXjTA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-freebsd-x64@1.2.14': + resolution: {integrity: sha512-u371GbXoVXrEgP20PwzoGNOdAOqAMhzo19JzzY+V4YmmnC+DTOoqdbMu+O+54emM59Mik/UdrtWgcuEDKWRPKA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-linux-arm-gnueabihf@1.2.14': + resolution: {integrity: sha512-BqwKsdZQf6EqVWr8fv2MrDYzAvOZ7+NYFSJESRGs87fkseEhs0TU9TXgRJTkZoRRkxTizyEg1LKUXfU3/78uqg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm64-gnu@1.2.14': + resolution: {integrity: sha512-SD9kY8M009x/7s57Z1dgUVlP5+uYBgKQK0Tkr1WIWngrtUJmRCW1RJFMY7QDla2khXhmg2i5Io7MUjcmZNZ/KQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-arm64-musl@1.2.14': + resolution: {integrity: sha512-BJ2CL19M6uuWesMgnqJzgxoI+N+eV7b0A9O9vLV42y+gitC41fNa8KElau1tHVzuLWX5GzEuxMPhAO0tQXQMkg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rolldown/binding-linux-ppc64-gnu@1.2.14': + resolution: {integrity: sha512-4+Kl8daPV8NDHaD7mfCcc1pRM+Qg7ab8DyMm5FG5WoZgv4h2i3KFN1CybYBNbQqmuYm7ftJLvmMI1eHYJ22S/Q==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-s390x-gnu@1.2.14': + resolution: {integrity: sha512-V/h8ePq1fKDrmtFMz6xcCN3DKvuvMRrwwD1q0PkBeeo4DpK64biaKvqWGVxqCeYKqeRk7gE7/iKPxLCn08O97A==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-gnu@1.2.14': + resolution: {integrity: sha512-WxalXzgrLVpKC93xfpaJ3gCXUWzeCr+FRCbDVD2mUAy4L6Vo3lNVz0epUEUpxPWJkLNYUwM4OSIikv36OJ9mLg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-musl@1.2.14': + resolution: {integrity: sha512-3G3tnAmTpdk9jO3GQtyHXqeFD2SlecfTws/Y3M2mmj9nMBwwuLT4kur8sZKeu7ENUHSpVO3cIsm5A52LEWWwlg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@rolldown/binding-openharmony-arm64@1.2.14': + resolution: {integrity: sha512-qyr5XiNGxm2ytx17vvtcJ9nXn6v1gENETi503bJx3OGwZ1tSonj7BosxbMa/xeAfSl5iS9X6KjEWYXLu6v1L7Q==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@rolldown/binding-win32-arm64-msvc@1.2.14': + resolution: {integrity: sha512-oA4o5o0S2yB199YyYXDzKUv1Z56Rc+mgOjwm7Z/vJ9Z8igiDPYvoOuDyo6g7AK/ZaF09nPhDKVnGBcYHO11GXA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.2.14': + resolution: {integrity: sha512-9mE94bf2GZUaR/fUSXCMpBoWkctu421Mi0ORpm4zqfbkjKep7RxzPFa5etcGs5h+2KApoWBOA/hAJa/7saGgEQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@rolldown/pluginutils@1.0.1': + resolution: {integrity: sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==} + + '@types/node@26.6.5': + resolution: {integrity: sha512-uMzsv9stDdofIZBx4UGh4Z9ZgXnGC9seRDscilBcTHAeOFk67MZg/k9bWVfO+bk4qZmG+l52hRnLwUiH2LnJTg==} + + '@vitejs/plugin-vue@6.0.10': + resolution: {integrity: sha512-b80aUQh3n+qEzzZm5oQp3rT2QImeCx58K6eFl/RkJ3d65KW0kTuv5lNsLRVAjbW9YRUpo/wzmvzMgV34bTAItA==} + engines: {node: ^20.19.0 || >=22.12.0} + peerDependencies: + vite: ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 + vue: ^3.2.25 || ^3.6.0-rc.10 + + '@volar/language-core@2.4.28': + resolution: {integrity: sha512-w4qhIJ8ZSitgLAkVay6AbcnC7gP3glYM3fYwKV3srj8m494E3xtrCv6E+bWviiK/8hs6e6t1ij1s2Endql7vzQ==} + + '@volar/source-map@2.4.28': + resolution: {integrity: sha512-yX2BDBqJkRXfKw8my8VarTyjv48QwxdJtvRgUpNE5erCsgEUdI2DsLbpa+rOQVAJYshY99szEcRDmyHbF10ggQ==} + + '@volar/typescript@2.4.28': + resolution: {integrity: sha512-Ja6yvWrbis2QtN4ClAKreeUZPVYMARDYZl9LMEv1iQ1QdepB6wn0jTRxA9MftYmYa4DQ4k/DaSZpFPUfxl8giw==} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + '@vue/compiler-core@3.5.44': + resolution: {integrity: sha512-k34nCytbK8PQ1gR2mGROYOw6Pnv/mumqIdrZ3x2tbyXZDWm7ViKGLTfdB+DRrWqEQsLgGJvn0WN9jBif5zCTLQ==} + + '@vue/compiler-dom@3.5.44': + resolution: {integrity: sha512-W5AoBFWdw1lQAKiHowkfgFKFab82oSRT6sGsPfw/q1GRjsy/ZJFLHGhJyBRIFN9APLTUduDH9U2JAiPOIyKuYg==} + + '@vue/compiler-sfc@3.5.44': + resolution: {integrity: sha512-dzHmQ4jXTpdr5FjIQUeykVakN/uzqFbUo9/C5ikBFg3a3PeM6uRxeczx1ZbXBML0/zJstEh3ygYipzR5Z7b2Pw==} + + '@vue/compiler-ssr@3.5.44': + resolution: {integrity: sha512-xr5gb1JVHlfXJwSlRz1FeP6uxoazdzHuMTVLE7up+4Vrqxk219CvxLPxD9NXBt47yvZW7+p4DXfyp4O1fkByIA==} + + '@vue/language-core@3.3.13': + resolution: {integrity: sha512-axA0Xemn5LuUKuKWob0/kVq7xQ2mJJM6VqA9Exvt35nM9yRC31goWVve/G/Zb2ZCLsXC8FHYjjfXlnshknSCew==} + + '@vue/reactivity@3.5.44': + resolution: {integrity: sha512-u+QJdKeBBEADkPdevsL+6E12QlYVfBD8Zcw5qjDQKtamI6l14KyqazJMobhCKelhWN5zpyKUiEDoTyHE93cqWw==} + + '@vue/runtime-core@3.5.44': + resolution: {integrity: sha512-uEa/ndwjhrrhnOfb2p+sZy6zeoamJOISqaLSJGk/8R6nABT1ZldpzcJoPzKj+zHVomVBPcmQYyC2r4LtvDV6CQ==} + + '@vue/runtime-dom@3.5.44': + resolution: {integrity: sha512-3fc4ARcXVhVBaJ3ujWiNZJARD6pkyRcwG+ZYhMzjKtKUp7MAY0HLwr7r3Smep3Li6ZaWT6ewdmx8XqdaD5oNZg==} + + '@vue/server-renderer@3.5.44': + resolution: {integrity: sha512-R4S1UoH4h5Frrauv8Z5XE5TxV9oBiUSgWIC4TyVK1FK+RocRnOLwFA5Xcmo2011RlgJp+AbZCnw6afrhlgRuUQ==} + + '@vue/shared@3.5.44': + resolution: {integrity: sha512-H82XLH0DjmSOdbEwO15x3QTo1f5PWEtv237eLpYKc0mqLu+B8hnq16lFWmuBmNurkeiG3wr+oM1FhOll/YVFRg==} + + alien-signals@3.2.1: + resolution: {integrity: sha512-I8FjmltrfnDFoZedi5CG8DghVYNhzb/Ijluz7tCSJH0xpd0484Kowhbb1XDYOxfJpU1p5wnM2X54dA+IfGyD1g==} + + csstype@3.2.3: + resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==} + + detect-libc@2.1.2: + resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} + engines: {node: '>=8'} + + entities@7.0.1: + resolution: {integrity: sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==} + engines: {node: '>=0.12'} + + estree-walker@2.0.2: + resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} + + fdir@6.5.0: + resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} + engines: {node: '>=12.0.0'} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + + fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + + lightningcss-android-arm64@1.33.0: + resolution: {integrity: sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [android] + + lightningcss-darwin-arm64@1.33.0: + resolution: {integrity: sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [darwin] + + lightningcss-darwin-x64@1.33.0: + resolution: {integrity: sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [darwin] + + lightningcss-freebsd-x64@1.33.0: + resolution: {integrity: sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [freebsd] + + lightningcss-linux-arm-gnueabihf@1.33.0: + resolution: {integrity: sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm] + os: [linux] + + lightningcss-linux-arm64-gnu@1.33.0: + resolution: {integrity: sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + libc: [glibc] + + lightningcss-linux-arm64-musl@1.33.0: + resolution: {integrity: sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + libc: [musl] + + lightningcss-linux-x64-gnu@1.33.0: + resolution: {integrity: sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + libc: [glibc] + + lightningcss-linux-x64-musl@1.33.0: + resolution: {integrity: sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + libc: [musl] + + lightningcss-win32-arm64-msvc@1.33.0: + resolution: {integrity: sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [win32] + + lightningcss-win32-x64-msvc@1.33.0: + resolution: {integrity: sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [win32] + + lightningcss@1.33.0: + resolution: {integrity: sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==} + engines: {node: '>= 12.0.0'} + + magic-string@0.30.21: + resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} + + muggle-string@0.4.1: + resolution: {integrity: sha512-VNTrAak/KhO2i8dqqnqnAHOa3cYBwXEZe9h+D5h/1ZqFSTEFHdM65lR7RoIqq3tBBYavsOXV84NoHXZ0AkPyqQ==} + + nanoid@3.3.20: + resolution: {integrity: sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + + path-browserify@1.0.1: + resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} + + picocolors@1.1.1: + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + + picomatch@4.0.7: + resolution: {integrity: sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==} + engines: {node: '>=12'} + + postcss@8.5.31: + resolution: {integrity: sha512-YUbWYCgErwnMAVkjUnYa+KlMBzGpHwiIt/DE7f0G33AuX2LH9UcTk6KgWxd3zRU+pN3u/C+Xl3EnMLM4Hea7Sg==} + engines: {node: ^10 || ^12 || >=14} + + rolldown@1.2.14: + resolution: {integrity: sha512-eTBTTqMR6uHKLgcUqpJP8ntzDI6V4LYA8negAMBEI7gkgVvOdrx6VsvS2Ym+83KhOPdLCHWJu0w7UQFJZhHKNw==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + + source-map-js@1.2.2: + resolution: {integrity: sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==} + engines: {node: '>=0.10.0'} + + tinyglobby@0.2.17: + resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==} + engines: {node: '>=12.0.0'} + + typescript@6.0.3: + resolution: {integrity: sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==} + engines: {node: '>=14.17'} + hasBin: true + + undici-types@8.9.0: + resolution: {integrity: sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==} + + vite@8.3.4: + resolution: {integrity: sha512-IftLE8phJhdNRIGNEV4JCCvfNScoZQVfcXaN8TQropWGJtOHcu+iAB9pHcuGvmEb/kddw0LBe/jS8ztdC6xdiQ==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + '@types/node': ^20.19.0 || >=22.12.0 + '@vitejs/devtools': ^0.7.1 + esbuild: ^0.27.0 || ^0.28.0 + jiti: '>=1.21.0' + less: ^4.0.0 + sass: ^1.70.0 + sass-embedded: ^1.70.0 + stylus: '>=0.54.8' + sugarss: ^5.0.0 + terser: ^5.16.0 + tsx: ^4.8.1 + yaml: ^2.4.2 + peerDependenciesMeta: + '@types/node': + optional: true + '@vitejs/devtools': + optional: true + esbuild: + optional: true + jiti: + optional: true + less: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + tsx: + optional: true + yaml: + optional: true + + vscode-uri@3.2.0: + resolution: {integrity: sha512-m2gXo3bn0G1kT9InzMf07fTbqMbGtyckj3bH5ktLO+1Ssv+yiATZ4dhwaQv9UZWxJh6E9IFGnQyjgWVDWVBDrg==} + + vue-tsc@3.3.13: + resolution: {integrity: sha512-jE4/bXdOMSHVxEGgQCqNllJy+9N3Gx6tfSAsg0yhFK/MAN6eXqISihupnDEKSCt12VVnjN2gI3AqLYcqoh5x/A==} + hasBin: true + peerDependencies: + typescript: '>=5.0.0' + + vue@3.5.44: + resolution: {integrity: sha512-dvvmaOCG7lAMkJTPqPwWeGMsPS6DIsFsfZDUgBp9V6mHf9b3+/wyVwYR4Es+WV6uJC0FKRxp81Obcq0ZwUcGFQ==} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + +snapshots: + + '@babel/helper-string-parser@7.29.7': {} + + '@babel/helper-validator-identifier@7.29.7': {} + + '@babel/parser@7.29.9': + dependencies: + '@babel/types': 7.29.8 + + '@babel/types@7.29.8': + dependencies: + '@babel/helper-string-parser': 7.29.7 + '@babel/helper-validator-identifier': 7.29.7 + + '@jridgewell/sourcemap-codec@1.6.0': {} + + '@oxc-project/types@0.154.0': {} + + '@rolldown/binding-android-arm-eabi@1.2.14': + optional: true + + '@rolldown/binding-android-arm64@1.2.14': + optional: true + + '@rolldown/binding-darwin-arm64@1.2.14': + optional: true + + '@rolldown/binding-darwin-x64@1.2.14': + optional: true + + '@rolldown/binding-freebsd-x64@1.2.14': + optional: true + + '@rolldown/binding-linux-arm-gnueabihf@1.2.14': + optional: true + + '@rolldown/binding-linux-arm64-gnu@1.2.14': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.2.14': + optional: true + + '@rolldown/binding-linux-ppc64-gnu@1.2.14': + optional: true + + '@rolldown/binding-linux-s390x-gnu@1.2.14': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.2.14': + optional: true + + '@rolldown/binding-linux-x64-musl@1.2.14': + optional: true + + '@rolldown/binding-openharmony-arm64@1.2.14': + optional: true + + '@rolldown/binding-win32-arm64-msvc@1.2.14': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.2.14': + optional: true + + '@rolldown/pluginutils@1.0.1': {} + + '@types/node@26.6.5': + dependencies: + undici-types: 8.9.0 + + '@vitejs/plugin-vue@6.0.10(vite@8.3.4(@types/node@26.6.5))(vue@3.5.44(typescript@6.0.3))': + dependencies: + '@rolldown/pluginutils': 1.0.1 + vite: 8.3.4(@types/node@26.6.5) + vue: 3.5.44(typescript@6.0.3) + + '@volar/language-core@2.4.28': + dependencies: + '@volar/source-map': 2.4.28 + + '@volar/source-map@2.4.28': {} + + '@volar/typescript@2.4.28(typescript@6.0.3)': + dependencies: + '@volar/language-core': 2.4.28 + path-browserify: 1.0.1 + vscode-uri: 3.2.0 + optionalDependencies: + typescript: 6.0.3 + + '@vue/compiler-core@3.5.44': + dependencies: + '@babel/parser': 7.29.9 + '@vue/shared': 3.5.44 + entities: 7.0.1 + estree-walker: 2.0.2 + source-map-js: 1.2.2 + + '@vue/compiler-dom@3.5.44': + dependencies: + '@vue/compiler-core': 3.5.44 + '@vue/shared': 3.5.44 + + '@vue/compiler-sfc@3.5.44': + dependencies: + '@babel/parser': 7.29.9 + '@vue/compiler-core': 3.5.44 + '@vue/compiler-dom': 3.5.44 + '@vue/compiler-ssr': 3.5.44 + '@vue/shared': 3.5.44 + estree-walker: 2.0.2 + magic-string: 0.30.21 + postcss: 8.5.31 + source-map-js: 1.2.2 + + '@vue/compiler-ssr@3.5.44': + dependencies: + '@vue/compiler-dom': 3.5.44 + '@vue/shared': 3.5.44 + + '@vue/language-core@3.3.13': + dependencies: + '@volar/language-core': 2.4.28 + '@vue/compiler-dom': 3.5.44 + '@vue/shared': 3.5.44 + alien-signals: 3.2.1 + muggle-string: 0.4.1 + path-browserify: 1.0.1 + picomatch: 4.0.7 + + '@vue/reactivity@3.5.44': + dependencies: + '@vue/shared': 3.5.44 + + '@vue/runtime-core@3.5.44': + dependencies: + '@vue/reactivity': 3.5.44 + '@vue/shared': 3.5.44 + + '@vue/runtime-dom@3.5.44': + dependencies: + '@vue/reactivity': 3.5.44 + '@vue/runtime-core': 3.5.44 + '@vue/shared': 3.5.44 + csstype: 3.2.3 + + '@vue/server-renderer@3.5.44': + dependencies: + '@vue/compiler-ssr': 3.5.44 + '@vue/runtime-dom': 3.5.44 + '@vue/shared': 3.5.44 + + '@vue/shared@3.5.44': {} + + alien-signals@3.2.1: {} + + csstype@3.2.3: {} + + detect-libc@2.1.2: {} + + entities@7.0.1: {} + + estree-walker@2.0.2: {} + + fdir@6.5.0(picomatch@4.0.7): + optionalDependencies: + picomatch: 4.0.7 + + fsevents@2.3.3: + optional: true + + lightningcss-android-arm64@1.33.0: + optional: true + + lightningcss-darwin-arm64@1.33.0: + optional: true + + lightningcss-darwin-x64@1.33.0: + optional: true + + lightningcss-freebsd-x64@1.33.0: + optional: true + + lightningcss-linux-arm-gnueabihf@1.33.0: + optional: true + + lightningcss-linux-arm64-gnu@1.33.0: + optional: true + + lightningcss-linux-arm64-musl@1.33.0: + optional: true + + lightningcss-linux-x64-gnu@1.33.0: + optional: true + + lightningcss-linux-x64-musl@1.33.0: + optional: true + + lightningcss-win32-arm64-msvc@1.33.0: + optional: true + + lightningcss-win32-x64-msvc@1.33.0: + optional: true + + lightningcss@1.33.0: + dependencies: + detect-libc: 2.1.2 + optionalDependencies: + lightningcss-android-arm64: 1.33.0 + lightningcss-darwin-arm64: 1.33.0 + lightningcss-darwin-x64: 1.33.0 + lightningcss-freebsd-x64: 1.33.0 + lightningcss-linux-arm-gnueabihf: 1.33.0 + lightningcss-linux-arm64-gnu: 1.33.0 + lightningcss-linux-arm64-musl: 1.33.0 + lightningcss-linux-x64-gnu: 1.33.0 + lightningcss-linux-x64-musl: 1.33.0 + lightningcss-win32-arm64-msvc: 1.33.0 + lightningcss-win32-x64-msvc: 1.33.0 + + magic-string@0.30.21: + dependencies: + '@jridgewell/sourcemap-codec': 1.6.0 + + muggle-string@0.4.1: {} + + nanoid@3.3.20: {} + + path-browserify@1.0.1: {} + + picocolors@1.1.1: {} + + picomatch@4.0.7: {} + + postcss@8.5.31: + dependencies: + nanoid: 3.3.20 + picocolors: 1.1.1 + source-map-js: 1.2.2 + + rolldown@1.2.14: + dependencies: + '@oxc-project/types': 0.154.0 + '@rolldown/pluginutils': 1.0.1 + optionalDependencies: + '@rolldown/binding-android-arm-eabi': 1.2.14 + '@rolldown/binding-android-arm64': 1.2.14 + '@rolldown/binding-darwin-arm64': 1.2.14 + '@rolldown/binding-darwin-x64': 1.2.14 + '@rolldown/binding-freebsd-x64': 1.2.14 + '@rolldown/binding-linux-arm-gnueabihf': 1.2.14 + '@rolldown/binding-linux-arm64-gnu': 1.2.14 + '@rolldown/binding-linux-arm64-musl': 1.2.14 + '@rolldown/binding-linux-ppc64-gnu': 1.2.14 + '@rolldown/binding-linux-s390x-gnu': 1.2.14 + '@rolldown/binding-linux-x64-gnu': 1.2.14 + '@rolldown/binding-linux-x64-musl': 1.2.14 + '@rolldown/binding-openharmony-arm64': 1.2.14 + '@rolldown/binding-win32-arm64-msvc': 1.2.14 + '@rolldown/binding-win32-x64-msvc': 1.2.14 + + source-map-js@1.2.2: {} + + tinyglobby@0.2.17: + dependencies: + fdir: 6.5.0(picomatch@4.0.7) + picomatch: 4.0.7 + + typescript@6.0.3: {} + + undici-types@8.9.0: {} + + vite@8.3.4(@types/node@26.6.5): + dependencies: + lightningcss: 1.33.0 + picomatch: 4.0.7 + postcss: 8.5.31 + rolldown: 1.2.14 + tinyglobby: 0.2.17 + optionalDependencies: + '@types/node': 26.6.5 + fsevents: 2.3.3 + + vscode-uri@3.2.0: {} + + vue-tsc@3.3.13(typescript@6.0.3): + dependencies: + '@volar/typescript': 2.4.28(typescript@6.0.3) + '@vue/language-core': 3.3.13 + typescript: 6.0.3 + + vue@3.5.44(typescript@6.0.3): + dependencies: + '@vue/compiler-dom': 3.5.44 + '@vue/compiler-sfc': 3.5.44 + '@vue/runtime-dom': 3.5.44 + '@vue/server-renderer': 3.5.44 + '@vue/shared': 3.5.44 + optionalDependencies: + typescript: 6.0.3 diff --git a/public/download/worker.js b/public/download/worker.js deleted file mode 100644 index 14a6757..0000000 --- a/public/download/worker.js +++ /dev/null @@ -1,70 +0,0 @@ -/* Only handles single-use download URLs within this directory. No file uploads or cache. */ -const downloads = new Map(); -self.addEventListener('install', () => self.skipWaiting()); -self.addEventListener('activate', event => event.waitUntil(self.clients.claim())); -self.addEventListener('message', event => { - const { type, id, name, size, stream } = event.data || {}; - const port = event.ports[0]; - if (type !== 'download' || !port || !/^[a-f0-9]{32}$/.test(id) || - typeof name !== 'string' || name.length > 255 || /[\r\n/\\]/.test(name) || - !Number.isSafeInteger(size) || size < 0 || - !(stream instanceof ReadableStream) || downloads.has(id)) return; - const reader = stream.getReader(); - let controller, finished = false, received = 0; - const finish = error => { - if (finished) return; - finished = true; - clearTimeout(timer); - downloads.delete(id); - if (error) { - controller?.error(error); - void reader.cancel(error.message).catch(() => {}); - } - port.postMessage({ type: error ? 'error' : 'complete', message: error?.message }); - port.close(); - }; - const timer = setTimeout(() => finish(new Error('Download did not start in time.')), 60000); - const body = new ReadableStream({ - start(value) { controller = value; }, - async pull() { - try { - const { done, value } = await reader.read(); - if (finished) return; - if (done) { - if (received !== size) throw new Error('Incomplete download.'); - controller.close(); finish(); - } else { - if (!(value instanceof Uint8Array) || value.byteLength > 16 * 1024 || received + value.byteLength > size) throw new Error('Invalid download data.'); - received += value.byteLength; - controller.enqueue(value); - } - } catch (error) { finish(error); } - }, - cancel() { finish(new Error('Download canceled in the browser.')); }, - }, { highWaterMark: 0 }); - port.onmessage = event => { - if (event.data?.type === 'abort') finish(new Error('Transfer canceled.')); - }; - downloads.set(id, { body, name, size, timer, port }); - port.postMessage({ type: 'ready', url: new URL(`file-${id}`, self.registration.scope).href }); -}); -self.addEventListener('fetch', event => { - const url = new URL(event.request.url); - const base = new URL(self.registration.scope); - if (url.origin !== base.origin || !url.pathname.startsWith(base.pathname + 'file-')) return; - const id = url.pathname.slice((base.pathname + 'file-').length); - const download = downloads.get(id); - if (event.request.method !== 'GET' || !download) { - event.respondWith(new Response('Download expired.', { status: 404 })); return; - } - downloads.delete(id); - clearTimeout(download.timer); - download.port.postMessage({ type: 'started' }); - event.respondWith(new Response(download.body, { headers: { - 'Content-Type': 'application/octet-stream', - 'Content-Disposition': `attachment; filename*=UTF-8''${encodeURIComponent(download.name.toWellFormed()).replace(/['()*]/g, char => '%' + char.charCodeAt(0).toString(16))}`, - 'Content-Length': String(download.size), - 'Cache-Control': 'no-store', - 'X-Content-Type-Options': 'nosniff', - } })); -}); diff --git a/scripts/browser-check.ts b/scripts/browser-check.ts deleted file mode 100644 index b3a34f3..0000000 --- a/scripts/browser-check.ts +++ /dev/null @@ -1,828 +0,0 @@ -// Dependency-free Chromium integration check. Run after `bun run build`. -import { Readable, Writable } from 'node:stream'; -import { installBrowserContext, forceRelay, relayCandidateTypes, simulateSlowDisk } from './browser-context.ts'; -import { CODE_PREFIX, decodeCode } from '../src/lib/codes.ts'; -import assert from 'node:assert/strict'; -import { spawn } from 'node:child_process'; -import { createServer } from 'node:http'; -import { mkdtemp, mkdir, readFile, rm, stat, writeFile } from 'node:fs/promises'; -import { createReadStream } from 'node:fs'; -import { tmpdir } from 'node:os'; -import { dirname, extname, join, resolve } from 'node:path'; -import { fileURLToPath } from 'node:url'; -const root = resolve(dirname(fileURLToPath(import.meta.url)), '..'); -const axeSource = await readFile(join(root, 'node_modules/axe-core/axe.min.js'), 'utf8'); -const provider = process.argv.includes('--default-network') ? 'pagequit' : 'none'; -const turn = process.argv.includes('--turn'); -const transport = process.argv.includes('--tcp') ? 'tcp' : 'udp'; -const streaming = process.argv.includes('--stream-download'); -const connections = process.argv.includes('--connections'); -// Opt-in: tracker reconnect against a real WebSocket tracker, e.g. --tracker=wss://tracker.example -const trackerUrl = process.argv.find(arg => arg.startsWith('--tracker='))?.slice('--tracker='.length) ?? ''; -const screenshotDirectory = process.env.BROWSER_SCREENSHOT_DIR || (process.argv.includes('--screenshots') ? join(tmpdir(), 'hellcon-layout') : ''); -const vite = turn ? await (await import('vite')).createServer({ server: { middlewareMode: true }, appType: 'spa' }) : null; -const profile = await mkdtemp(join(tmpdir(), 'hellcon-browser-')); -const server = createServer(async (req, res) => { - if (vite) return vite.middlewares(req, res); - try { - const pathname = new URL(req.url ?? '/', 'http://localhost').pathname; - const base = join(root, 'dist'); - const path = resolve(base, '.' + (pathname === '/' ? '/index.html' : pathname)); - if (!path.startsWith(base + '/')) throw new Error('Invalid path'); - const types: Record = { '.js': 'text/javascript', '.css': 'text/css', '.html': 'text/html', '.png': 'image/png', '.svg': 'image/svg+xml' }; - res.setHeader('Content-Type', types[extname(path)] || 'application/octet-stream'); - res.end(await readFile(path)); - } catch { res.statusCode = 404; res.end(); } -}); -await new Promise(resolve => server.listen(0, '127.0.0.1', resolve)); -const address = server.address(); -assert.ok(address && typeof address !== 'string'); -const origin = `http://127.0.0.1:${address.port}`; -const browser = spawn(process.env.CHROMIUM_PATH || '/usr/bin/chromium', [ - '--headless', '--no-sandbox', '--disable-gpu', '--disable-background-networking', - '--no-first-run', '--no-default-browser-check', `--user-data-dir=${profile}`, '--remote-debugging-pipe', 'about:blank', -], { stdio: ['ignore', 'ignore', 'pipe', 'pipe', 'pipe'] }); -interface ProtocolResults { - 'Emulation.setDeviceMetricsOverride': object; - 'Emulation.setFocusEmulationEnabled': object; - 'Page.captureScreenshot': { data: string }; - 'Page.bringToFront': object; - 'Input.dispatchKeyEvent': object; - 'Browser.setDownloadBehavior': object; - 'Target.createTarget': { targetId: string }; - 'Target.attachToTarget': { sessionId: string }; - 'Runtime.enable': object; - 'Page.enable': object; - 'Page.navigate': object; - 'Page.addScriptToEvaluateOnNewDocument': object; - 'Runtime.evaluate': { exceptionDetails?: unknown; result: { value?: unknown } }; -} -interface ProtocolMessage { - id?: number; - method?: string; - params?: { exceptionDetails?: unknown }; - error?: unknown; - result?: unknown; -} -const pipeIn = browser.stdio[3], pipeOut = browser.stdio[4]; -assert.ok(pipeIn instanceof Writable && pipeOut instanceof Readable && browser.stderr); -const commandPipe = pipeIn; -let stderr = '', nextId = 0, buffer = ''; -const pending = new Map void>(); -const browserErrors: unknown[] = []; -browser.stderr.on('data', data => { stderr += data; }); -pipeIn.on('error', () => {}); pipeOut.on('error', () => {}); -pipeOut.on('data', data => { - buffer += data; - let end; - while ((end = buffer.indexOf('\0')) !== -1) { - const message: ProtocolMessage = JSON.parse(buffer.slice(0, end)); buffer = buffer.slice(end + 1); - if (message.id) { pending.get(message.id)?.(message); pending.delete(message.id); } - if (message.method === 'Runtime.exceptionThrown') browserErrors.push(message.params?.exceptionDetails); - } -}); -function call(method: M, params: Record = {}, sessionId?: string): Promise { - return new Promise((resolve, reject) => { - const id = ++nextId; - const timer = setTimeout(() => { pending.delete(id); reject(new Error(`Timed out: ${method}\n${stderr.slice(-1500)}`)); }, 45000); - pending.set(id, message => { clearTimeout(timer); message.error ? reject(new Error(JSON.stringify(message.error))) : resolve(message.result as ProtocolResults[M]); }); - commandPipe.write(JSON.stringify({ id, method, params, ...(sessionId ? { sessionId } : {}) }) + '\0'); - }); -} -async function evaluate(session: string, fn: (...args: Args) => T, ...args: Args): Promise> { - const expression = `(${fn.toString()})(...${JSON.stringify(args)})`; - const result = await call('Runtime.evaluate', { expression, awaitPromise: true, returnByValue: true }, session); - if (result.exceptionDetails) throw new Error(JSON.stringify(result.exceptionDetails)); - // CDP returns the serialized result of this exact callback. - return result.result.value as Awaited; -} -async function wait(session: string, check: () => unknown) { - const expression = `window.__hellcon.wait(${check.toString()})`; - const result = await call('Runtime.evaluate', { expression, awaitPromise: true, returnByValue: true }, session); - if (result.exceptionDetails) throw new Error(JSON.stringify(result.exceptionDetails)); -} -async function page(url = origin) { - const { targetId } = await call('Target.createTarget', { url: 'about:blank' }); - const { sessionId } = await call('Target.attachToTarget', { targetId, flatten: true }); - await call('Runtime.enable', {}, sessionId); - await call('Page.enable', {}, sessionId); - // Background tabs otherwise skip focus/blur events, which the name editor relies on. - await call('Emulation.setFocusEmulationEnabled', { enabled: true }, sessionId); - await call('Page.addScriptToEvaluateOnNewDocument', { source: `(${installBrowserContext.toString()})()` }, sessionId); - // The native picker would block headless runs; simulateSlowDisk installs a test double where needed. - await call('Page.addScriptToEvaluateOnNewDocument', { source: 'window.showSaveFilePicker = undefined;' }, sessionId); - // Without streaming downloads the app falls back to memory, whose bytes the default checks read in-page. - if (!streaming) await call('Page.addScriptToEvaluateOnNewDocument', { source: "Object.defineProperty(navigator, 'serviceWorker', { value: undefined });" }, sessionId); - if (turn) await call('Page.addScriptToEvaluateOnNewDocument', { source: `(${forceRelay.toString()})(${JSON.stringify(transport)})` }, sessionId); - await call('Page.navigate', { url }, sessionId); - for (let n = 0; n < 100; n++) { - try { if (await evaluate(sessionId, (expected: string) => location.href.startsWith(expected) && document.readyState === 'complete', url)) break; } - catch (err) { if (!(err instanceof Error) || !err.message.includes('context')) throw err; } - await new Promise(resolve => setTimeout(resolve, 20)); - } - try { await wait(sessionId, () => !!document.querySelector('#stun-provider')); } - catch (error) { throw new Error(`${url}: ${String(error)}; browser errors: ${JSON.stringify(browserErrors)}`); } - return sessionId; -} -async function checkAccessibility(session: string, mode: string) { - const injected = await call('Runtime.evaluate', { expression: axeSource }, session); - assert.equal(injected.exceptionDetails, undefined, 'axe-core should load in the page'); - const violations = await evaluate(session, async () => { - const axe = (window as unknown as { axe: { run: (context: Document) => Promise<{ violations: Array<{ id: string; nodes: Array<{ target: string[] }> }> }> } }).axe; - const results = await axe.run(document); - return results.violations.map(({ id, nodes }) => ({ id, targets: nodes.map(({ target }) => target) })); - }); - assert.deepEqual(violations, [], `${mode} mode accessibility violations`); -} -const screenshot = async (session: string, name: string) => { - if (!screenshotDirectory) return; - await mkdir(screenshotDirectory, { recursive: true }); - await call('Page.bringToFront', {}, session); - const { data } = await call('Page.captureScreenshot', { format: 'png', captureBeyondViewport: false }, session); - await writeFile(join(screenshotDirectory, name + '.png'), Buffer.from(data, 'base64')); -}; -const dialogText = (session: string) => evaluate(session, () => document.querySelector('dialog[open]')?.textContent ?? ''); -const click = (session: string, label: string) => evaluate(session, (label: string) => window.__hellcon.click(label), label); -const input = (session: string, selector: string, value: string) => evaluate(session, (selector: string, value: string) => window.__hellcon.input(selector, value), selector, value); -const enableTurn = (session: string) => evaluate(session, () => { - const checkbox = window.__hellcon.element('.checkbox input'); - if (!checkbox.checked) checkbox.click(); -}); -async function connect(sender: string, receiver: string, size: number, changedIdentity = false) { - await evaluate(sender, (size: number) => window.__hellcon.chooseFile(size, 'browser-test.bin'), size); - await input(sender, '#stun-provider', provider); - await input(receiver, '#stun-provider', provider); - if (turn) { await enableTurn(sender); await enableTurn(receiver); } - await click(sender, 'Create code'); await wait(sender, () => !!document.querySelector('#output-code')); - const offer = await evaluate(sender, () => window.__hellcon.element('#output-code').value); - assert.ok(offer.startsWith(CODE_PREFIX)); - await input(receiver, '#offer-input', 'invalid-code!'); - await click(receiver, 'Accept & create answer'); - await wait(receiver, () => !!document.querySelector('[role=alert]')); - assert.equal(await evaluate(receiver, () => window.__hellcon.element('#offer-input').disabled), false); - if (turn) await enableTurn(receiver); - await input(receiver, '#offer-input', offer); await click(receiver, 'Accept & create answer'); - await wait(receiver, () => !!document.querySelector('#output-code')); - const answer = await evaluate(receiver, () => window.__hellcon.element('#output-code').value); - await input(sender, '#answer-input', offer); await click(sender, 'Connect'); - await wait(sender, () => document.querySelector('[role=alert]')?.textContent?.includes('not an answer')); - assert.equal(await evaluate(sender, () => window.__hellcon.element('#output-code')?.value), offer); - assert.equal(await evaluate(sender, () => window.__hellcon.element('#answer-input').disabled), false); - await input(sender, '#answer-input', answer); await click(sender, 'Connect'); - await wait(sender, () => !!document.querySelector('.fingerprint')); - const sf = await evaluate(sender, () => [...document.querySelectorAll('.fp-row code')].map(e => e.textContent)); - const rf = await evaluate(receiver, () => [...document.querySelectorAll('.fp-row code')].map(e => e.textContent)); - assert.equal(sf[0], rf[1]); assert.equal(sf[1], rf[0]); assert.equal(sf[0]?.split(' ').length, 32); - assert.equal(await evaluate(receiver, () => !!document.querySelector('.incoming')), false); - if (changedIdentity) { - // The receiver still trusts the unchanged sender and verifies automatically; - // the sender must compare manually and is not offered a silent replacement. - assert.ok(await evaluate(sender, () => document.body.textContent?.includes('Device identity differs from the paired device'))); - assert.equal(await evaluate(sender, () => [...document.querySelectorAll('.fingerprint label')].find(el => el.textContent?.includes('Replace the paired device'))?.querySelector('input')?.checked), false); - await wait(receiver, () => document.body.textContent?.includes('Verification submitted')); - await click(sender, 'Both fingerprints match — confirm'); - } else { - await click(sender, 'Both fingerprints match — confirm'); - await new Promise(resolve => setTimeout(resolve, 100)); - assert.equal(await evaluate(receiver, () => !!document.querySelector('.incoming')), false); - await click(receiver, 'Both fingerprints match — confirm'); - } - await wait(receiver, () => !!document.querySelector('.incoming')); - if (turn) { - for (const session of [sender, receiver]) { - const types = await evaluate(session, relayCandidateTypes); - assert.deepEqual(types, ['relay', 'relay'], 'Both ends must actually use relay candidates'); - } - } -} -async function verifySavedFile(path: string, size: number) { - const deadline = Date.now() + 30000; - while (true) { - try { if ((await stat(path)).size === size) break; } catch {} - if (Date.now() > deadline) throw new Error('Browser did not finish saving the download.'); - await new Promise(resolve => setTimeout(resolve, 100)); - } - let bytes = 0; - for await (const chunk of createReadStream(path)) { - assert.ok((chunk as Buffer).every(byte => byte === 123), 'Downloaded bytes must match'); - bytes += (chunk as Buffer).length; - } - assert.equal(bytes, size); - await rm(path); -} -try { - // Received files land in the throwaway profile instead of the user's Downloads. - const downloads = join(profile, 'downloads'); - await mkdir(downloads); - await call('Browser.setDownloadBehavior', { behavior: 'allow', downloadPath: downloads }); - if (connections) { - const sender = await page(), receiver = await page(origin.replace('127.0.0.1', 'localhost')); - const selectConnection = (session: string, name: string) => evaluate(session, (name: string) => { - const label = [...document.querySelectorAll('.connection-name')].find(item => item.textContent === name); - if (!label) throw new Error('Missing connection: ' + name); - label.click(); - }, name); - await call('Emulation.setDeviceMetricsOverride', { width: 1440, height: 1000, deviceScaleFactor: 1, mobile: false }, sender); - assert.equal(await evaluate(sender, () => document.querySelector('.main-pane h1')?.textContent), 'Con 1'); - assert.deepEqual(await evaluate(sender, () => [...document.querySelectorAll('.config-details')].map(details => [details.querySelector('summary')?.textContent?.trim(), details.open])), [ - ['Remembered device', false], ['Network settings', false], - ], 'Configuration panels start closed'); - await checkAccessibility(sender, 'Connections desktop'); - await screenshot(sender, 'connections-desktop'); - assert.equal(await evaluate(sender, () => !!document.querySelector('.connection-rename-input')), false, 'Names start locked'); - await click(sender, 'Rename Con 1'); - assert.equal(await evaluate(sender, () => document.activeElement?.classList.contains('connection-rename-input')), true, 'The pen focuses the name editor'); - await input(sender, '.connection-rename-input', 'Work laptop'); - await evaluate(sender, () => window.__hellcon.element('.connection-rename-input').blur()); - await wait(sender, () => document.querySelector('.connection-name')?.textContent === 'Work laptop'); - await click(sender, 'Rename Work laptop'); - await input(sender, '.connection-rename-input', ' '); - await evaluate(sender, () => window.__hellcon.element('.connection-rename-input').blur()); - assert.equal(await evaluate(sender, () => document.querySelector('.connection-name')?.textContent), 'Work laptop'); - await click(sender, 'Rename Work laptop'); - await input(sender, '.connection-rename-input', 'Work laptop '); - await call('Input.dispatchKeyEvent', { type: 'keyDown', key: 'Enter', code: 'Enter', windowsVirtualKeyCode: 13 }, sender); - await call('Input.dispatchKeyEvent', { type: 'keyUp', key: 'Enter', code: 'Enter', windowsVirtualKeyCode: 13 }, sender); - assert.equal(await evaluate(sender, () => document.querySelector('.connection-name')?.textContent), 'Work laptop'); - assert.equal(await evaluate(sender, () => !!document.querySelector('.connection-rename-input')), false, 'Enter relocks the name'); - await click(sender, 'Rename Work laptop'); - await input(sender, '.connection-rename-input', 'Cancelled name'); - await call('Input.dispatchKeyEvent', { type: 'keyDown', key: 'Escape', code: 'Escape', windowsVirtualKeyCode: 27 }, sender); - await call('Input.dispatchKeyEvent', { type: 'keyUp', key: 'Escape', code: 'Escape', windowsVirtualKeyCode: 27 }, sender); - assert.equal(await evaluate(sender, () => document.querySelector('.connection-name')?.textContent), 'Work laptop', 'Escape discards the draft'); - assert.equal(await evaluate(sender, () => document.activeElement?.classList.contains('edit-action')), true, 'Escape returns focus to the pen'); - await click(receiver, 'Receive'); - await connect(sender, receiver, 4097); - const fingerprints = await evaluate(sender, () => [...document.querySelectorAll('.fp-row code')].map(item => item.textContent)); - await click(sender, 'Add connection'); - await wait(sender, () => document.querySelector('.main-pane h1')?.textContent === 'Con 2'); - assert.equal(await evaluate(sender, () => !!document.querySelector('.fingerprint')), false); - await click(receiver, 'Accept file'); - await wait(sender, () => document.querySelector('.connection-item .connection-status')?.textContent === 'Connected'); - assert.equal(await evaluate(sender, () => document.querySelector('.connection-nav')?.textContent?.includes('browser-test.bin')), false, 'The sidebar shows connection status instead of filenames'); - assert.equal(await evaluate(sender, () => !!document.querySelector('.activity-panel')), false, 'The workspace has no activity timeline'); - await selectConnection(sender, 'Work laptop'); - await wait(sender, () => document.querySelector('.connection-item.selected .connection-status')?.textContent === 'Connected'); - assert.deepEqual(await evaluate(sender, () => [...document.querySelectorAll('.fp-row code')].map(item => item.textContent)), fingerprints); - await evaluate(sender, () => window.__hellcon.chooseFile(1234, 'after-switch.bin')); - await wait(receiver, () => document.querySelector('.incoming')?.textContent?.includes('after-switch.bin')); - await click(receiver, 'Accept file'); - await wait(sender, () => document.querySelector('.progress[aria-label="Sending progress"]')?.getAttribute('aria-valuenow') === '100'); - const received = await evaluate(receiver, async () => { - const bytes = new Uint8Array(await (await fetch(window.__hellcon.element('a.download').href)).arrayBuffer()); - return { size: bytes.length, valid: bytes.every(byte => byte === 123) }; - }); - assert.deepEqual(received, { size: 1234, valid: true }); - await click(sender, 'Disconnect'); await click(sender, 'Reset'); - assert.equal(await evaluate(sender, () => document.querySelector('.main-pane h1')?.textContent), 'Work laptop', 'Reset keeps the connection slot'); - await checkAccessibility(sender, 'Connections after transfer'); - await screenshot(sender, 'connections-after-transfer'); - await selectConnection(sender, 'Con 2'); - await evaluate(sender, () => window.__hellcon.chooseFile(10, 'draft.bin')); - await selectConnection(sender, 'Work laptop'); await selectConnection(sender, 'Con 2'); - assert.equal(await evaluate(sender, () => [...document.querySelectorAll('.panel li')].some(item => item.textContent?.includes('draft.bin'))), true, 'Selected file state survives slot switching'); - await call('Page.navigate', { url: origin }, sender); - await wait(sender, () => !!document.querySelector('#stun-provider')); - assert.equal(await evaluate(sender, () => document.querySelector('.main-pane h1')?.textContent), 'Work laptop'); - assert.equal(await evaluate(sender, () => document.querySelector('.connection-item.selected .connection-status')?.textContent), 'Ready to connect'); - await selectConnection(sender, 'Con 2'); - assert.equal(await evaluate(sender, () => document.querySelector('#file-input')?.files?.length), 0, 'File contents must not persist after reload'); - console.log('PASS: connections retain names across reload; switching preserves live transfers and drafts; Reset keeps the slot without activity history.'); - - const other = await page(); - await Promise.all([click(sender, 'Add connection'), click(other, 'Add connection')]); - await wait(sender, () => document.querySelectorAll('.connection-link').length === 4); - await wait(other, () => document.querySelectorAll('.connection-link').length === 4); - assert.deepEqual(await evaluate(sender, () => [...document.querySelectorAll('.connection-name')].map(item => item.textContent)), ['Work laptop', 'Con 2', 'Con 3', 'Con 4']); - console.log('PASS: concurrent tabs add distinct connection slots and synchronize their sidebars.'); - - await call('Emulation.setDeviceMetricsOverride', { width: 390, height: 844, deviceScaleFactor: 1, mobile: false }, sender); - await selectConnection(sender, 'Work laptop'); - assert.deepEqual(await evaluate(sender, () => [document.querySelector('.mobile-current-name')?.textContent, document.querySelector('.mobile-current-status')?.textContent]), - ['Work laptop', 'Ready to connect'], 'Mobile shows the open connection and its status'); - await checkAccessibility(sender, 'Connections mobile'); - assert.equal(await evaluate(sender, () => document.documentElement.scrollWidth <= innerWidth), true, 'Mobile workspace must not overflow horizontally'); - await screenshot(sender, 'connections-mobile'); - await click(sender, 'Show connections'); - await click(sender, 'Remove Work laptop'); - await wait(sender, () => !!document.querySelector('dialog[open]')); - await checkAccessibility(sender, 'Removal dialog mobile'); - await screenshot(sender, 'connections-mobile-dialog'); - await click(sender, 'Close dialog'); - await wait(sender, () => !document.querySelector('dialog[open]')); - await checkAccessibility(sender, 'Connections mobile sidebar'); - assert.equal(await evaluate(sender, () => getComputedStyle(window.__hellcon.element('.sidebar')).display), 'flex'); - await screenshot(sender, 'connections-mobile-sidebar'); - await selectConnection(sender, 'Con 2'); - assert.equal(await evaluate(sender, () => getComputedStyle(window.__hellcon.element('.sidebar')).display), 'none'); - console.log('PASS: mobile navigation opens and closes, fits the viewport, and passes accessibility checks.'); - await call('Emulation.setDeviceMetricsOverride', { width: 1440, height: 1000, deviceScaleFactor: 1, mobile: false }, sender); - await selectConnection(sender, 'Work laptop'); - await click(receiver, 'Reset'); - await connect(sender, receiver, 1024); - await selectConnection(sender, 'Con 2'); - await selectConnection(other, 'Work laptop'); - await evaluate(other, () => window.__hellcon.element('.connection-item.selected .remove-action').focus()); - await click(other, 'Remove Work laptop'); - await wait(other, () => !!document.querySelector('dialog[open]')); - assert.equal(await evaluate(other, () => document.activeElement?.textContent?.trim()), 'Keep connection', 'Dialog starts on its non-destructive action'); - await checkAccessibility(other, 'Remove connection confirmation'); - await screenshot(other, 'connections-remove-dialog'); - for (let i = 0; i < 5; i++) { - await call('Input.dispatchKeyEvent', { type: 'keyDown', key: 'Tab', code: 'Tab', windowsVirtualKeyCode: 9 }, other); - await call('Input.dispatchKeyEvent', { type: 'keyUp', key: 'Tab', code: 'Tab', windowsVirtualKeyCode: 9 }, other); - assert.equal(await evaluate(other, () => !!document.querySelector('dialog[open]')?.contains(document.activeElement)), true, 'Tab stays within the modal'); - } - await call('Input.dispatchKeyEvent', { type: 'keyDown', key: 'Escape', code: 'Escape', windowsVirtualKeyCode: 27 }, other); - await call('Input.dispatchKeyEvent', { type: 'keyUp', key: 'Escape', code: 'Escape', windowsVirtualKeyCode: 27 }, other); - await wait(other, () => !document.querySelector('dialog[open]')); - assert.equal(await evaluate(other, () => document.activeElement?.classList.contains('remove-action')), true, 'Dialog restores focus to the opener'); - await click(other, 'Remove Work laptop'); - await click(other, 'Keep connection'); - assert.equal(await evaluate(other, () => document.querySelectorAll('.connection-link').length), 4); - await click(sender, 'Remove Work laptop'); - await wait(sender, () => !!document.querySelector('dialog[open]')); - await click(other, 'Remove Work laptop'); await click(other, 'Remove connection'); - await wait(other, () => document.querySelectorAll('.connection-link').length === 3); - await wait(sender, () => document.querySelectorAll('.connection-link').length === 3); - await wait(sender, () => !document.querySelector('dialog[open]')); - await wait(receiver, () => !document.querySelector('.incoming')); - await call('Page.navigate', { url: origin }, sender); - await wait(sender, () => !!document.querySelector('#stun-provider')); - assert.equal(await evaluate(sender, () => [...document.querySelectorAll('.connection-name')].some(item => item.textContent === 'Work laptop')), false); - for (let count = 3; count > 0; count--) { - const oldName = await evaluate(sender, () => document.querySelector('.main-pane h1')?.textContent); - await click(sender, `Remove ${oldName}`); await click(sender, 'Remove connection'); - await wait(sender, () => !document.querySelector('dialog[open]')); - assert.equal(await evaluate(sender, () => document.querySelectorAll('.connection-link').length), Math.max(1, count - 1)); - assert.notEqual(await evaluate(sender, () => document.querySelector('.main-pane h1')?.textContent), oldName); - } - assert.equal(await evaluate(sender, () => document.querySelector('.main-pane h1')?.textContent), 'Con 1'); - await call('Page.navigate', { url: origin }, sender); - await wait(sender, () => !!document.querySelector('#stun-provider')); - assert.deepEqual(await evaluate(sender, () => [...document.querySelectorAll('.connection-name')].map(item => item.textContent)), ['Con 1']); - console.log('PASS: removal can be cancelled, persists across reload, closes cached sessions in other tabs, and replaces the last slot with a fresh Con 1.'); - await click(sender, 'Add connection'); - await wait(sender, () => document.querySelectorAll('.connection-link').length === 2); - await selectConnection(sender, 'Con 1'); - const spareName = await evaluate(sender, () => document.querySelectorAll('.connection-name')[1]?.textContent); - await click(sender, `Rename ${spareName}`); - await input(sender, '.connection-rename-input', 'Spare device'); - await evaluate(sender, () => window.__hellcon.element('.connection-rename-input').blur()); - await wait(sender, () => [...document.querySelectorAll('.connection-name')].some(item => item.textContent === 'Spare device')); - assert.equal(await evaluate(sender, () => document.querySelector('.main-pane h1')?.textContent), 'Con 1', 'Renaming another row keeps the current connection'); - await click(sender, 'Remove Spare device'); - assert.match(await dialogText(sender), /Remove Spare device\?/); - await click(sender, 'Remove connection'); - await wait(sender, () => document.querySelectorAll('.connection-link').length === 1); - assert.equal(await evaluate(sender, () => document.querySelector('.main-pane h1')?.textContent), 'Con 1', 'Removing another row keeps the current connection'); - assert.equal(await evaluate(sender, () => document.activeElement?.classList.contains('connection-link')), true, 'Focus returns to the remaining connection after removal'); - console.log('PASS: sidebar actions target their own connection without changing the active workspace.'); - await evaluate(sender, async () => { - const db = await new Promise((resolve, reject) => { - const request = indexedDB.open('hellcon-connections', 1); - request.onsuccess = () => resolve(request.result); - request.onerror = () => reject(request.error); - }); - await new Promise((resolve, reject) => { - const tx = db.transaction('connections', 'readwrite'); - const store = tx.objectStore('connections'); - const request = store.getAll(); - request.onsuccess = () => store.put({ ...request.result[0], history: [{ name: 'old-file.bin' }] }); - tx.oncomplete = () => resolve(); - tx.onerror = tx.onabort = () => reject(tx.error); - }); - db.close(); - }); - await call('Page.navigate', { url: origin }, sender); - await wait(sender, () => !!document.querySelector('#stun-provider')); - const oldHistoryRemoved = await evaluate(sender, async () => { - const db = await new Promise((resolve, reject) => { - const request = indexedDB.open('hellcon-connections', 1); - request.onsuccess = () => resolve(request.result); - request.onerror = () => reject(request.error); - }); - const record = await new Promise>((resolve, reject) => { - const request = db.transaction('connections', 'readonly').objectStore('connections').getAll(); - request.onsuccess = () => resolve(request.result[0]); - request.onerror = () => reject(request.error); - }); - db.close(); - return { name: record.name, hasHistory: Object.hasOwn(record, 'history') }; - }); - assert.deepEqual(oldHistoryRemoved, { name: 'Con 1', hasHistory: false }, 'Loading an old slot removes saved transfer history'); - console.log('PASS: legacy transfer history is removed from saved connections on load.'); - assert.deepEqual(browserErrors, []); - } else if (streaming) { - const sender = await page(), receiver = await page(); - await click(receiver, 'Receive'); - for (const size of [0, 1024 * 1024 + 7, 120 * 1024 * 1024]) { - if (size === 0) await connect(sender, receiver, size); - else { - await evaluate(sender, (size: number) => window.__hellcon.chooseFile(size, 'browser-test.bin'), size); - await wait(receiver, () => !!document.querySelector('.incoming')); - } - assert.equal(await evaluate(receiver, () => typeof window.showSaveFilePicker), 'undefined'); - await click(receiver, 'Accept file'); - await wait(sender, () => window.__hellcon.element('[role=status]').textContent?.includes('confirmed the complete file')); - assert.match(await evaluate(receiver, () => window.__hellcon.element('[role=status]').textContent), /Check Downloads/); - await verifySavedFile(join(downloads, 'browser-test.bin'), size); - console.log(`PASS: hosted app streams ${size} bytes to a real browser download without the native save picker; exact file bytes verified.`); - } - assert.deepEqual(browserErrors, []); - } else { - const sender = await page(), receiver = await page(); - if (!turn) { - assert.equal(await evaluate(sender, () => document.querySelector('#stun-provider')?.value), 'pagequit'); - } - await click(receiver, 'Receive'); - await checkAccessibility(sender, 'Send'); - await checkAccessibility(receiver, 'Receive'); - console.log('PASS: axe-core accessibility scan in initial Send and Receive modes.'); - assert.equal(await evaluate(sender, () => window.__hellcon.element('.checkbox input').checked), false); - await connect(sender, receiver, 2 * 1024 * 1024 + 7); - await checkAccessibility(sender, 'Send during transfer'); - await checkAccessibility(receiver, 'Receive before accepting a file'); - await click(receiver, 'Accept file'); - await wait(sender, () => window.__hellcon.element('[role=status]').textContent?.includes('confirmed the complete file')); - await checkAccessibility(sender, 'Send after transfer'); - await checkAccessibility(receiver, 'Receive after transfer'); - console.log('PASS: axe-core accessibility scan during and after transfer.'); - const data = await evaluate(receiver, async () => { - const response = await fetch(window.__hellcon.element('a.download').href); - const bytes = new Uint8Array(await response.arrayBuffer()); - return { length: bytes.length, valid: bytes.every(b => b === 123) }; - }); - assert.deepEqual(data, { length: 2 * 1024 * 1024 + 7, valid: true }); - assert.match(await evaluate(receiver, () => window.__hellcon.element('[role=status]').textContent), /Check Downloads/); - await verifySavedFile(join(downloads, 'browser-test.bin'), 2 * 1024 * 1024 + 7); - await wait(sender, () => window.__hellcon.element('#connection-diagnostics').value.includes('pairs=')); - const diagnostics = await evaluate(sender, () => window.__hellcon.element('#connection-diagnostics').value); - assert.match(diagnostics, /local code: host=\d+/); - assert.match(diagnostics, /remote code: host=\d+/); - assert.match(diagnostics, /requestsSent=/); - assert.match(diagnostics, /transfer done/); - assert.doesNotMatch(diagnostics, /browser-test\.bin|a=candidate:|a=ice-pwd:|a=fingerprint:|\.local\b/); - console.log('PASS: real two-page WebRTC flow; full fingerprints; no metadata before both confirmations; exact file and receipt; memory fallback saves to Downloads automatically.'); - console.log('PASS: invalid offers can be replaced; invalid answers can be corrected without losing the live offer.'); - const originalFingerprints = await evaluate(sender, () => [...document.querySelectorAll('.fp-row code')].map(e => e.textContent)); - for (const size of [0, 4097]) { - const previousDownload = await evaluate(receiver, () => window.__hellcon.element('a.download').href); - await evaluate(sender, (size: number) => window.__hellcon.chooseFile(size, 'another.bin'), size); - await wait(receiver, () => !!document.querySelector('.incoming')); - assert.equal(await evaluate(receiver, () => window.__hellcon.element('a.download').href), previousDownload); - assert.equal(await evaluate(sender, () => window.__hellcon.element('[role=status]').textContent), 'Waiting for the receiver to accept the file…'); - assert.deepEqual(await evaluate(sender, () => [...document.querySelectorAll('.fp-row code')].map(e => e.textContent)), originalFingerprints); - await click(receiver, 'Accept file'); - await wait(sender, () => window.__hellcon.element('[role=status]').textContent?.includes('confirmed the complete file')); - const next = await evaluate(receiver, async () => { - const link = window.__hellcon.element('a.download'); - const bytes = new Uint8Array(await (await fetch(link.href)).arrayBuffer()); - return { name: link.download, length: bytes.length, valid: bytes.every(byte => byte === 123) }; - }); - assert.deepEqual(next, { name: 'another.bin', length: size, valid: true }); - } - console.log('PASS: consecutive files including an empty file reuse fingerprints, require acceptance, and preserve the previous download until acceptance.'); - // Queue two files and send back simultaneously, on the same peer connection. - await evaluate(sender, () => { - const input = window.__hellcon.element('#file-input'); - const files = new DataTransfer(); - for (const name of ['decline-me.bin', 'queued.bin', 'remove-me.bin']) files.items.add(new File([new Uint8Array(1024).fill(123)], name)); - input.files = files.files; input.dispatchEvent(new Event('change', { bubbles: true })); - }); - await evaluate(sender, () => window.__hellcon.element('button[aria-label="Remove remove-me.bin"]').click()); - await click(receiver, 'Send'); - assert.equal(await evaluate(receiver, () => document.activeElement?.getAttribute('aria-labelledby')), 'send-heading'); - await evaluate(receiver, () => window.__hellcon.chooseFile(8193, 'return.bin')); - await click(receiver, 'Receive'); - assert.equal(await evaluate(receiver, () => document.activeElement?.getAttribute('aria-labelledby')), 'receive-heading'); - await click(sender, 'Receive'); - assert.equal(await evaluate(sender, () => document.activeElement?.getAttribute('aria-labelledby')), 'receive-heading'); - await wait(sender, () => !!document.querySelector('.incoming')); - await wait(receiver, () => !!document.querySelector('.incoming')); - await click(receiver, 'Decline file'); - await wait(receiver, () => document.querySelector('.incoming')?.textContent?.includes('queued.bin')); - await click(sender, 'Accept file'); - await click(receiver, 'Accept file'); - await wait(sender, () => document.querySelector('a.download')?.download === 'return.bin'); - await wait(receiver, () => document.querySelector('a.download')?.download === 'queued.bin'); - for (const [session, size] of [[sender, 8193], [receiver, 1024]] as const) { - const received = await evaluate(session, async () => { - const bytes = new Uint8Array(await (await fetch(window.__hellcon.element('a.download').href)).arrayBuffer()); - return { length: bytes.length, valid: bytes.every(byte => byte === 123) }; - }); - assert.deepEqual(received, { length: size, valid: true }); - await checkAccessibility(session, 'Bidirectional session'); - } - assert.equal(await evaluate(sender, () => [...document.querySelectorAll('.tabs button')].every(button => !(button as HTMLButtonElement).disabled)), true); - assert.deepEqual(await evaluate(sender, () => [...document.querySelectorAll('.fp-row code')].map(e => e.textContent)), originalFingerprints); - console.log('PASS: simultaneous bidirectional transfers, multiple-file queue, removal, decline, exact bytes, and live Send/Receive navigation without reconnecting.'); - - await click(sender, 'Reset'); await click(receiver, 'Reset'); - assert.equal(await evaluate(sender, () => window.__hellcon.element('[role=status]').textContent), 'Choose a file to start.'); - assert.equal(await evaluate(receiver, () => window.__hellcon.element('[role=status]').textContent), 'Paste the sender’s connection code to start.'); - console.log('PASS: Reset restores the ready state on both sides.'); - await evaluate(receiver, simulateSlowDisk); - await connect(sender, receiver, 2 * 1024 * 1024); - await click(receiver, 'Accept file'); - await wait(receiver, () => !!window.__hellcon.releaseWrite); - await evaluate(sender, () => window.__hellcon.chooseFile(1024, 'pending-at-disconnect.bin')); - assert.equal(await evaluate(sender, () => !!document.querySelector('ul[aria-label="Files waiting to send"]')), true); - await click(sender, 'Disconnect'); - assert.equal(await evaluate(sender, () => !!document.querySelector('ul[aria-label="Files waiting to send"]')), false); - await wait(receiver, () => window.__hellcon.aborted); - assert.equal(await evaluate(receiver, () => !!document.querySelector('a.download')), false); - await wait(receiver, () => window.__hellcon.element('#connection-diagnostics').value.includes('pairs=')); - assert.match(await evaluate(receiver, () => window.__hellcon.element('#connection-diagnostics').value), /session failed/); - console.log('PASS: privacy-safe candidate/check diagnostics remain available after completion and failure.'); - console.log('PASS: Disconnect closes the connection and aborts the receiver’s pending disk write.'); - await click(sender, 'Reset'); await click(receiver, 'Reset'); - await evaluate(receiver, () => { window.showSaveFilePicker = undefined; }); - await connect(sender, receiver, 2048); - await click(receiver, 'Accept file'); - await wait(sender, () => window.__hellcon.element('[role=status]').textContent?.includes('confirmed the complete file')); - console.log('PASS: fresh code exchange after a failed transfer succeeds without reloading either page.'); - if (!turn) { - const identitySender = await page(); - const receiverOrigin = origin.replace('127.0.0.1', 'localhost'); - const identityReceiver = await page(receiverOrigin); - await click(identityReceiver, 'Receive'); - const pairedKey = (session: string) => evaluate(session, () => document.querySelector('.device-settings code')?.textContent || ''); - // Clears the paired device directly in storage, so this tab is not notified. - const forgetQuietly = (session: string) => evaluate(session, async () => { - const db = await new Promise((resolve, reject) => { const request = indexedDB.open('hellcon-connections', 1); request.onsuccess = () => resolve(request.result); request.onerror = () => reject(request.error); }); - await new Promise((resolve, reject) => { - const tx = db.transaction('connections', 'readwrite'), store = tx.objectStore('connections'), request = store.getAll(); - request.onsuccess = () => { for (const record of request.result) store.put({ ...record, peerKey: '' }); }; - tx.oncomplete = () => resolve(); tx.onabort = () => reject(tx.error); - }); db.close(); - }); - for (const session of [identitySender, identityReceiver]) { - await evaluate(session, () => { const details = [...document.querySelectorAll('details')].find(el => el.querySelector('summary')?.textContent === 'Remembered device'); if (details) details.open = true; }); - await wait(session, () => [...document.querySelectorAll('button')].some(button => button.textContent === 'Create device identity' && !button.disabled)); - await click(session, 'Create device identity'); - await wait(session, () => document.querySelector('#remember-device')?.checked); - } - await connect(identitySender, identityReceiver, 2048); - for (const session of [identitySender, identityReceiver]) { - await wait(session, () => document.body.textContent?.includes('Remembered for Con 1')); - await wait(session, () => !!document.querySelector('.device-settings code')); - } - await checkAccessibility(identitySender, 'remembered identity'); - await click(identityReceiver, 'Accept file'); - await wait(identitySender, () => document.body.textContent?.includes('The receiver confirmed the complete file.')); - await click(identitySender, 'Disconnect'); - await wait(identityReceiver, () => [...document.querySelectorAll('button')].some(button => button.textContent === 'Reset')); - // Reload both pages to exercise persisted CryptoKeys and paired connections. - for (const [session, url] of [[identitySender, origin], [identityReceiver, receiverOrigin]]) { - await call('Page.navigate', { url }, session); - await wait(session, () => !!document.querySelector('#stun-provider')); - } - await click(identityReceiver, 'Receive'); - for (const session of [identitySender, identityReceiver]) { - await wait(session, () => !!document.querySelector('.device-settings code')); - assert.equal(await evaluate(session, () => !!document.querySelector('#remember-device')), false, 'A paired connection shows its device instead of the opt-in'); - await input(session, '#stun-provider', 'none'); - } - await evaluate(identitySender, () => window.__hellcon.chooseFile(4096, 'remembered.bin')); - await click(identitySender, 'Create code'); await wait(identitySender, () => !!document.querySelector('#output-code')); - const offer = await evaluate(identitySender, () => window.__hellcon.element('#output-code').value); - assert.ok((await decodeCode(offer)).identity); - await input(identityReceiver, '#offer-input', offer); await click(identityReceiver, 'Accept & create answer'); - await wait(identityReceiver, () => !!document.querySelector('#output-code')); - const answer = await evaluate(identityReceiver, () => window.__hellcon.element('#output-code').value); - await input(identitySender, '#answer-input', answer); await click(identitySender, 'Connect'); - await wait(identityReceiver, () => !!document.querySelector('.incoming')); - for (const session of [identitySender, identityReceiver]) assert.ok(await evaluate(session, () => document.body.textContent?.includes('Paired device authenticated'))); - await click(identityReceiver, 'Accept file'); - await wait(identitySender, () => document.body.textContent?.includes('The receiver confirmed the complete file.')); - const rememberedBytes = await evaluate(identityReceiver, async () => { const bytes = new Uint8Array(await (await fetch(window.__hellcon.element('a.download').href)).arrayBuffer()); return { length: bytes.length, valid: bytes.every(byte => byte === 123) }; }); - assert.deepEqual(rememberedBytes, { length: 4096, valid: true }); - console.log('PASS: identities and paired connections persist across reload; fresh mutual proofs authenticate the paired device and transfer exact bytes without manual reconfirmation.'); - - const both = [identitySender, identityReceiver]; - // Setup itself never contacts the tracker, so these checks run without one. - assert.ok(await evaluate(identitySender, () => document.body.textContent?.includes('choose a tracker under Network settings'))); - await input(identitySender, '#discovery', 'custom'); - await wait(identitySender, () => !!document.querySelector('#tracker-url')); - await input(identitySender, '#tracker-url', trackerUrl || 'wss://tracker.example/'); - await wait(identitySender, () => [...document.querySelectorAll('button')].some(button => button.textContent === 'Set up reconnect')); - const hasPairing = (session: string) => evaluate(session, () => [...document.querySelectorAll('button')].some(button => button.textContent === 'Turn off reconnect')); - const failStorage = (session: string) => evaluate(session, () => { - const originalOpen = indexedDB.open; - indexedDB.open = () => { - indexedDB.open = originalOpen; - throw new DOMException('Simulated connection storage failure', 'SecurityError'); - }; - }); - // A failed IndexedDB write on either side is reported to both people, and - // the proposer, which stores first, removes its copy when the acceptor fails. - for (const failing of both) { - await failStorage(failing); - await click(identitySender, 'Set up reconnect'); - await wait(identityReceiver, () => document.body.textContent?.includes('proposes reconnecting through')); - await click(identityReceiver, 'Accept'); - for (const session of both) { - await wait(session, () => !!document.querySelector('.reconnect-setup .error')); - assert.equal(await evaluate(session, () => document.body.textContent?.includes('Reconnect is set up')), false); - } - for (const session of both) await wait(session, () => ![...document.querySelectorAll('button')].some(button => button.textContent === 'Turn off reconnect')); - } - console.log('PASS: failed reconnect storage on either side is reported to both peers, and the proposer rolls back its stored pairing.'); - - const setUpReconnect = async () => { - await click(identitySender, 'Set up reconnect'); - await wait(identityReceiver, () => document.body.textContent?.includes('proposes reconnecting through')); - await checkAccessibility(identityReceiver, 'reconnect proposal'); - if (screenshotDirectory) await evaluate(identityReceiver, () => window.__hellcon.element('.reconnect-setup').scrollIntoView({ block: 'center' })); - await screenshot(identityReceiver, 'reconnect-proposal'); - // Two clicks can arrive before Vue rerenders the button. Consent must - // start only one key derivation and send only one acceptance. - await evaluate(identityReceiver, () => { window.__hellcon.click('Accept'); window.__hellcon.click('Accept'); }); - for (const session of both) await wait(session, () => document.body.textContent?.includes('Reconnect is set up on both devices')); - for (const session of both) assert.ok(await hasPairing(session)); - }; - const exchangeCodes = async () => { - await evaluate(identitySender, () => window.__hellcon.chooseFile(1024, 'manual.bin')); - await click(identitySender, 'Create code'); await wait(identitySender, () => !!document.querySelector('#output-code')); - await input(identityReceiver, '#offer-input', await evaluate(identitySender, () => window.__hellcon.element('#output-code').value)); - await click(identityReceiver, 'Accept & create answer'); - await wait(identityReceiver, () => !!document.querySelector('#output-code')); - await input(identitySender, '#answer-input', await evaluate(identityReceiver, () => window.__hellcon.element('#output-code').value)); - await click(identitySender, 'Connect'); - await wait(identityReceiver, () => !!document.querySelector('.incoming')); - await click(identityReceiver, 'Accept file'); - await wait(identitySender, () => document.body.textContent?.includes('The receiver confirmed the complete file.')); - }; - const disconnectBoth = async () => { - await click(identitySender, 'Disconnect'); - await wait(identityReceiver, () => [...document.querySelectorAll('button')].some(button => button.textContent === 'Reset')); - await click(identitySender, 'Reset'); await click(identityReceiver, 'Reset'); - }; - await setUpReconnect(); - // Turning reconnect off on one device is noticed by the other during the - // next authenticated session, which then turns its own copy off as well. - await disconnectBoth(); - await click(identityReceiver, 'Turn off reconnect'); - await wait(identityReceiver, () => ![...document.querySelectorAll('button')].some(button => button.textContent === 'Turn off reconnect')); - assert.ok(await hasPairing(identitySender)); - await exchangeCodes(); - await wait(identitySender, () => document.body.textContent?.includes('no matching reconnect settings')); - await wait(identitySender, () => ![...document.querySelectorAll('button')].some(button => button.textContent === 'Turn off reconnect')); - console.log('PASS: confirmed reconnect setup; a pairing turned off on one device is removed from the other in the next authenticated session.'); - - if (trackerUrl) { - await setUpReconnect(); - if (screenshotDirectory) await evaluate(identitySender, () => window.__hellcon.element('.reconnect-setup').scrollIntoView({ block: 'center' })); - await screenshot(identitySender, 'reconnect-set-up'); - await click(identitySender, 'Disconnect'); - await wait(identityReceiver, () => !document.querySelector('.incoming')); - for (const [session, url] of [[identitySender, origin], [identityReceiver, receiverOrigin]]) { - await call('Page.navigate', { url }, session); - await wait(session, () => !!document.querySelector('#stun-provider')); - } - await click(identityReceiver, 'Receive'); - for (const session of both) { - await input(session, '#stun-provider', 'none'); - await wait(session, () => [...document.querySelectorAll('button')].some(button => button.textContent === 'Reconnect' && !button.disabled)); - } - const competing = await page(); - await wait(competing, () => [...document.querySelectorAll('button')].some(button => button.textContent === 'Reconnect' && !button.disabled)); - await input(competing, '#stun-provider', 'none'); - await click(identitySender, 'Reconnect'); - await wait(identitySender, () => document.body.textContent?.includes('Waiting for your peer on')); - await click(competing, 'Reconnect'); - await wait(competing, () => document.body.textContent?.includes('Another HellCon tab is already reconnecting')); - assert.ok(await evaluate(identitySender, () => document.body.textContent?.includes('Waiting for your peer on'))); - await click(identitySender, 'Cancel connection'); - await click(competing, 'Reset'); await click(competing, 'Reconnect'); - await wait(competing, () => document.body.textContent?.includes('Waiting for your peer on')); - await click(competing, 'Cancel connection'); - await click(identitySender, 'Reconnect'); - await wait(identitySender, () => document.body.textContent?.includes('Waiting for your peer on')); - console.log('PASS: another tab cannot reconnect the same slot; cancellation releases the lock for either tab to retry.'); - await checkAccessibility(identitySender, 'reconnect waiting'); - if (screenshotDirectory) await evaluate(identitySender, () => [...document.querySelectorAll('button')].find(button => button.textContent === 'Reconnect')?.scrollIntoView({ block: 'start' })); - await screenshot(identitySender, 'reconnect-waiting'); - await click(identityReceiver, 'Reconnect'); - for (const session of both) await wait(session, () => document.body.textContent?.includes('Paired device authenticated')); - for (const session of both) await wait(session, () => document.body.textContent?.includes('is set up on both devices')); - assert.equal(await evaluate(identitySender, () => !!document.querySelector('#output-code')), false, 'No code is shown on reconnect'); - for (const [from, to, size] of [[identitySender, identityReceiver, 5000], [identityReceiver, identitySender, 6000]] as const) { - await evaluate(from, (size: number) => window.__hellcon.chooseFile(size, 'reconnected.bin'), size); - await wait(to, () => !!document.querySelector('.incoming button.primary')); - await click(to, 'Accept file'); - await wait(to, () => !!document.querySelector('a.download')); - await wait(from, () => document.body.textContent?.includes('The receiver confirmed the complete file.')); - const bytes = await evaluate(to, async () => { const link = window.__hellcon.element('a.download'); const data = new Uint8Array(await (await fetch(link.href)).arrayBuffer()); return { length: data.length, valid: data.every(byte => byte === 123) }; }); - assert.deepEqual(bytes, { length: size, valid: true }); - } - console.log(`PASS: tracker reconnect through ${new URL(trackerUrl).host}: pairing setup with peer confirmation, reload, Reconnect on both pages without codes, device proofs, exact bytes in both directions.`); - } - - await click(identitySender, 'Disconnect'); - await wait(identityReceiver, () => !document.querySelector('.incoming')); - await click(identitySender, 'Reset'); await click(identityReceiver, 'Reset'); - for (const forgottenSide of [identitySender, identityReceiver]) { - await forgetQuietly(forgottenSide); - assert.ok(await pairedKey(forgottenSide), 'Original tab still shows the stale paired device before connection setup'); - - await evaluate(identitySender, () => window.__hellcon.chooseFile(128, 'forgotten-device.bin')); - await click(identitySender, 'Create code'); await wait(identitySender, () => !!document.querySelector('#output-code')); - const freshOffer = await evaluate(identitySender, () => window.__hellcon.element('#output-code').value); - await input(identityReceiver, '#offer-input', freshOffer); await click(identityReceiver, 'Accept & create answer'); - await wait(identityReceiver, () => !!document.querySelector('#output-code')); - const freshAnswer = await evaluate(identityReceiver, () => window.__hellcon.element('#output-code').value); - await input(identitySender, '#answer-input', freshAnswer); await click(identitySender, 'Connect'); - await wait(forgottenSide, () => document.body.textContent?.includes('New device. Compare both fingerprints manually')); - assert.equal(await pairedKey(forgottenSide), '', 'Connection setup re-reads the forgotten pairing'); - assert.equal(await evaluate(forgottenSide, () => [...document.querySelectorAll('.fingerprint label')].find(el => el.textContent?.includes('Remember this device for Con 1'))?.querySelector('input')?.checked), true); - assert.equal(await evaluate(identityReceiver, () => !!document.querySelector('.incoming')), false, 'Forgotten trust must not release file metadata'); - await click(forgottenSide, 'Both fingerprints match — confirm'); - await wait(identityReceiver, () => !!document.querySelector('.incoming')); - await wait(forgottenSide, () => !!document.querySelector('.device-settings code')); - await click(identityReceiver, 'Accept file'); - await wait(identitySender, () => document.body.textContent?.includes('The receiver confirmed the complete file.')); - await click(identitySender, 'Disconnect'); - await wait(identityReceiver, () => !document.querySelector('.incoming')); - await click(identitySender, 'Reset'); await click(identityReceiver, 'Reset'); - } - console.log('PASS: forgetting a device in another tab removes stale trust before either role reconnects; manual confirmation gates metadata and pairs the connection again.'); - - await evaluate(identitySender, () => { indexedDB.open = () => { throw new DOMException('Storage denied during refresh', 'SecurityError'); }; }); - await evaluate(identitySender, () => window.__hellcon.chooseFile(1, 'storage-failure.bin')); - await click(identitySender, 'Create code'); - await wait(identitySender, () => document.body.textContent?.includes('Storage denied during refresh')); - assert.equal(await evaluate(identitySender, () => !!document.querySelector('#output-code')), false, 'Failed storage refresh must not use cached trust'); - await evaluate(identitySender, () => { Reflect.deleteProperty(indexedDB, 'open'); }); - await click(identitySender, 'Reset'); - console.log('PASS: unreadable storage during connection setup cannot reuse a cached identity or paired device.'); - - const senderPaired = await pairedKey(identitySender); - await evaluate(identityReceiver, () => { - const label = [...document.querySelectorAll('label')].find(el => el.textContent?.includes('Delete this browser’s device identity')); - label?.querySelector('input')?.click(); - }); - await click(identityReceiver, 'Delete device identity'); - await wait(identityReceiver, () => [...document.querySelectorAll('button')].some(button => button.textContent === 'Create device identity')); - await click(identityReceiver, 'Create device identity'); - await wait(identityReceiver, () => !!document.querySelector('.device-settings code')); - await connect(identitySender, identityReceiver, 512, true); - await click(identityReceiver, 'Accept file'); - await wait(identitySender, () => document.body.textContent?.includes('The receiver confirmed the complete file.')); - assert.ok(await evaluate(identitySender, () => document.body.textContent?.includes('This device was not remembered.'))); - assert.equal(await pairedKey(identitySender), senderPaired, 'Changed identity must not replace the paired device automatically'); - console.log('PASS: replaced peer identity requires manual comparison and preserves the paired device.'); - await click(identitySender, 'Disconnect'); - await wait(identityReceiver, () => !document.querySelector('.incoming')); - await click(identitySender, 'Reset'); await click(identityReceiver, 'Reset'); - const stale = await page(); - await wait(stale, () => !!document.querySelector('.device-settings code')); - await click(stale, 'Forget device'); - await wait(stale, () => document.querySelector('#remember-device')?.checked); - await wait(identitySender, () => document.querySelector('#remember-device')?.checked); - console.log('PASS: Forget device keeps the per-connection opt-in and reaches other tabs.'); - await evaluate(stale, async () => { - const db = await new Promise((resolve, reject) => { const request = indexedDB.open('hellcon-devices', 1); request.onsuccess = () => resolve(request.result); request.onerror = () => reject(request.error); }); - await new Promise((resolve, reject) => { - const tx = db.transaction('settings', 'readwrite'), store = tx.objectStore('settings'), request = store.get('state'); - request.onsuccess = () => store.put({ ...request.result, revision: crypto.randomUUID() }, 'state'); - tx.oncomplete = () => resolve(); tx.onabort = () => reject(tx.error); - }); db.close(); - }); - await evaluate(stale, () => [...document.querySelectorAll('label')].find(el => el.textContent?.includes('Delete this browser’s device identity'))?.querySelector('input')?.click()); - await click(stale, 'Delete device identity'); - await wait(stale, () => document.body.textContent?.includes('Device settings changed in another tab')); - await evaluate(stale, async () => { - const db = await new Promise(resolve => { const request = indexedDB.open('hellcon-devices', 1); request.onsuccess = () => resolve(request.result); }); - await new Promise(resolve => { const tx = db.transaction('settings', 'readwrite'); tx.objectStore('settings').put({ identity: { publicKey: 'broken' }, revision: 'broken' }, 'state'); tx.oncomplete = () => resolve(); }); db.close(); - }); - await call('Page.navigate', { url: origin }, stale); - await wait(stale, () => document.body.textContent?.includes('Invalid device identity')); - await evaluate(stale, () => [...document.querySelectorAll('label')].find(label => label.textContent?.includes('Delete unreadable device storage'))?.querySelector('input')?.click()); - await click(stale, 'Clear device storage'); - await wait(stale, () => [...document.querySelectorAll('button')].some(button => button.textContent === 'Create device identity' && !button.disabled)); - console.log('PASS: stale identity edits cannot overwrite newer settings; unreadable storage can be cleared with explicit consent.'); - const denied = await page(); - await call('Page.addScriptToEvaluateOnNewDocument', { source: "indexedDB.open = () => { throw new DOMException('Storage denied', 'SecurityError'); };" }, denied); - await call('Page.navigate', { url: origin }, denied); - await wait(denied, () => document.body.textContent?.includes('Storage denied')); - await evaluate(denied, () => window.__hellcon.chooseFile(1, 'temporary.bin')); - await input(denied, '#stun-provider', 'none'); await click(denied, 'Create code'); - await wait(denied, () => !!document.querySelector('#output-code')); - const temporary = await evaluate(denied, () => window.__hellcon.element('#output-code').value); - assert.equal((await decodeCode(temporary)).identity, undefined); - await click(denied, 'Cancel connection'); - console.log('PASS: denied identity storage still allows temporary v3 connection setup.'); - - } - if (turn) console.log(`PASS: forced TURN over ${transport.toUpperCase()}, relay candidates at both ends, exact file bytes and receipt.`); - assert.deepEqual(browserErrors, []); - } -} finally { - browser.kill(); - await new Promise(resolve => { if (browser.exitCode !== null || browser.signalCode !== null) resolve(); else browser.once('exit', () => resolve()); }); - await new Promise((resolve, reject) => server.close(error => error ? reject(error) : resolve())); - await vite?.close(); - await rm(profile, { recursive: true, force: true, maxRetries: 3 }); -} diff --git a/scripts/browser-context.ts b/scripts/browser-context.ts deleted file mode 100644 index 0c55b21..0000000 --- a/scripts/browser-context.ts +++ /dev/null @@ -1,107 +0,0 @@ -// These functions are serialized into isolated browser pages by the checks. -// Keep their dependencies inside the function or on window.__hellcon. -export function installBrowserContext() { - function element(selector: string): E { - const value = document.querySelector(selector); - if (!value) throw new Error(`Missing element: ${selector}`); - return value; - } - const context = { - element, - peers: [] as RTCPeerConnection[], - aborted: false, - releaseWrite: undefined as (() => void) | undefined, - click(label: string) { - const button = [...document.querySelectorAll('button')].find(button => { - const content = button.cloneNode(true) as HTMLButtonElement; - content.querySelectorAll('[aria-hidden="true"]').forEach(item => item.remove()); - return button.getAttribute('aria-label') === label || content.textContent?.trim() === label; - }); - if (!button || button.disabled) throw new Error(`Unavailable button: ${label}`); - button.click(); - }, - input(selector: string, value: string) { - const input = element(selector); - input.value = value; - input.dispatchEvent(new Event(input.tagName === 'SELECT' ? 'change' : 'input', { bubbles: true })); - }, - chooseFile(size: number, name: string) { - const input = element('#file-input'); - const files = new DataTransfer(); - files.items.add(new File([new Uint8Array(size).fill(123)], name)); - input.files = files.files; - input.dispatchEvent(new Event('change', { bubbles: true })); - }, - async wait(check: () => T | Promise): Promise>> { - const deadline = Date.now() + 36000; - while (Date.now() < deadline) { - const value = await check(); - if (value) return value; - await new Promise(resolve => setTimeout(resolve, 20)); - } - throw new Error('UI condition timed out: ' + document.body.innerText); - }, - }; - window.__hellcon = context; -} - -declare global { - interface Window { - __hellcon: { - element(selector: string): E; - peers: RTCPeerConnection[]; - aborted: boolean; - releaseWrite?: () => void; - click(label: string): void; - input(selector: string, value: string): void; - chooseFile(size: number, name: string): void; - wait(check: () => T | Promise): Promise>>; - }; - } -} - -export function forceRelay(transport: 'udp' | 'tcp') { - const NativePC = window.RTCPeerConnection; - window.RTCPeerConnection = class extends NativePC { - constructor(config?: RTCConfiguration) { - super({ ...config, iceTransportPolicy: 'relay' }); - window.__hellcon.peers.push(this); - } - override setConfiguration(config: RTCConfiguration) { - const iceServers = (config.iceServers ?? []).filter(server => server.username).map(server => ({ - ...server, - urls: (Array.isArray(server.urls) ? server.urls : [server.urls]).filter(url => url.endsWith(`transport=${transport}`)), - })); - super.setConfiguration({ ...config, iceServers, iceTransportPolicy: 'relay' }); - } - }; -} - -export async function relayCandidateTypes() { - for (let attempt = 0; attempt < 50; attempt++) { - const pc = window.__hellcon.peers.at(-1); - if (!pc) throw new Error('No peer connection'); - const stats = await pc.getStats(); - const transport = [...stats.values()].find((entry: RTCStats) => entry.type === 'transport') as RTCTransportStats | undefined; - const pair = transport?.selectedCandidatePairId ? stats.get(transport.selectedCandidatePairId) as RTCIceCandidatePairStats | undefined : undefined; - if (pair) { - const local = stats.get(pair.localCandidateId) as (RTCStats & { candidateType: RTCIceCandidateType }) | undefined; - const remote = stats.get(pair.remoteCandidateId) as (RTCStats & { candidateType: RTCIceCandidateType }) | undefined; - return [local?.candidateType, remote?.candidateType]; - } - await new Promise(resolve => setTimeout(resolve, 100)); - } - throw new Error('No selected ICE candidate pair in WebRTC statistics'); -} - -export function simulateSlowDisk() { - window.__hellcon.aborted = false; - // Only the methods used by the app are implemented by this browser test double. - window.showSaveFilePicker = async () => ({ - createWritable: async () => ({ - write() { return new Promise(resolve => { window.__hellcon.releaseWrite = resolve; }); }, - async close() {}, - async abort() { window.__hellcon.aborted = true; window.__hellcon.releaseWrite?.(); }, - }), - }); -} diff --git a/scripts/compare-ice.mjs b/scripts/compare-ice.mjs deleted file mode 100644 index 8738e57..0000000 --- a/scripts/compare-ice.mjs +++ /dev/null @@ -1,87 +0,0 @@ -import { createServer } from 'node:http'; -import { readFile, mkdtemp, rm } from 'node:fs/promises'; -import { execFileSync, spawn } from 'node:child_process'; -import { stripTypeScriptTypes } from 'node:module'; -import { createSocket } from 'node:dgram'; -import { fileURLToPath } from 'node:url'; -import { join } from 'node:path'; -import { tmpdir } from 'node:os'; -// A controlled ICE experiment, not a cross-device transfer test. Reads the -// original signaling helpers from git without checking out or editing files. -const root = fileURLToPath(new URL('..', import.meta.url)); -const legacy = execFileSync('git', ['show', 'd198332:src/lib/webrtc.js'], { cwd: root, encoding: 'utf8' }); -const current = stripTypeScriptTypes(await readFile(root + '/src/lib/webrtc.ts', 'utf8')); -const validation = stripTypeScriptTypes(await readFile(root + '/src/lib/validation.ts', 'utf8')); -const udp = createSocket('udp4'); -await new Promise(resolve => udp.bind(0, '127.0.0.1', resolve)); -const stunUrl = process.argv.includes('--slow-stun') ? 'stun:127.0.0.1:' + udp.address().port : null; -const rewritePorts = !process.argv.includes('--normal-candidates'); -const browserCode = String.raw` -import * as old from '/old.js'; -import * as current from '/current.js'; -async function run(mode) { - const api = mode === 'original' ? old : current; - const start = performance.now(); - const events = []; - const log = (event) => events.push([Math.round(performance.now()-start),event]); - const {stunUrl,rewritePorts} = await (await fetch('/config')).json(); - const a = api.createPeerConnection(mode === 'original' ? stunUrl : {stunUrl}); - const b = api.createPeerConnection(mode === 'original' ? stunUrl : {stunUrl}); - if(mode !== 'original') { a.setConfiguration(current.iceConfiguration({stunUrl})); b.setConfiguration(current.iceConfiguration({stunUrl})); } - let received = false; - for(const [role,pc] of [['sender',a],['receiver',b]]) { - pc.oniceconnectionstatechange = () => log(role + ' ICE ' + pc.iceConnectionState); - pc.onconnectionstatechange = () => { - log(role + ' PC ' + pc.connectionState); - if(mode === 'current' && pc.connectionState === 'failed') pc.close(); - }; - } - const dc = a.createDataChannel('file'); - dc.onopen = () => { log('sender channel open'); dc.send('exact-file-bytes'); }; - b.ondatachannel = e => { e.channel.onmessage = e => { received = e.data === 'exact-file-bytes'; log('receiver bytes '+received); }; }; - try { - // The original helpers exchange encoded codes; current helpers exchange SDP. - let sdp = mode === 'original' ? api.decodeSignal(await api.createOfferCode(a)) : await api.createOffer(a); - // Deliberately unusable advertised ports: only sender-initiated checks - // after the answer can discover the real sender. No host firewall changes. - if(rewritePorts) sdp = sdp.split('\r\n').filter(l=>!/^a=candidate:.* tcp /i.test(l)).map(l=>{ - if(!l.startsWith('a=candidate:'))return l; - const fields=l.split(' '); fields[5]='9'; return fields.join(' '); - }).join('\r\n'); - log('offer ready; end-of-candidates='+sdp.includes('a=end-of-candidates')); - const answer = mode === 'original' ? await api.createAnswerCode(b, api.encodeSignal(sdp)) : await api.createAnswer(b, sdp); - log('answer ready'); - await new Promise(r=>setTimeout(r,20000)); - log('apply answer'); - await (mode === 'original' ? api.acceptAnswerCode(a,answer) : api.acceptAnswer(a,answer)); - await new Promise(r=>setTimeout(r,12000)); - return {mode,received,events}; - } catch { return {mode,received,events,error:'Signaling failed; raw browser error omitted'}; } - finally {a.close();b.close();} -} -const results = await Promise.all(['original','current','current-keep'].map(run)); -await fetch('/result',{method:'POST',body:JSON.stringify(results)}); -`; -let done; -const finished = new Promise(resolve=>done=resolve); -const server = createServer(async(req,res)=>{ - if(req.url === '/config') { res.setHeader('Content-Type','application/json');res.end(JSON.stringify({stunUrl,rewritePorts}));return; } - if(req.url === '/result') {let body=''; for await(const part of req)body+=part; console.log(body);res.end('ok');done();return;} - res.setHeader('Content-Type',req.url==='/'?'text/html':'text/javascript'); - res.end(({'/':'','/old.js':legacy,'/current.js':current,'/validation.ts':validation,'/run.js':browserCode})[req.url] || ''); -}); -await new Promise(resolve=>server.listen(0,'127.0.0.1',resolve)); -const profile=await mkdtemp(join(tmpdir(), 'hellcon-ice-comparison-')); -const name=process.argv[2] || 'firefox'; -const url='http://127.0.0.1:'+server.address().port; -const args=name==='firefox'?['--headless','--no-remote','--profile',profile,url]:['--headless','--no-sandbox','--disable-gpu','--no-first-run','--user-data-dir='+profile,url]; -const child=spawn('/usr/bin/'+name,args,{stdio:['ignore','ignore','pipe']}); -child.on('error',()=>{console.error('Could not launch browser');process.exitCode=1;done();}); -let errors='';child.stderr.on('data',chunk=>errors+=chunk); -const timer=setTimeout(()=>{console.log('Comparison timed out');process.exitCode=1;done();},85000); -try {await finished;} finally { - clearTimeout(timer);child.kill(); - if(child.pid && child.exitCode===null && child.signalCode===null) await new Promise(resolve=>child.once('exit',resolve)); - server.closeAllConnections();server.close();udp.close(); - await rm(profile,{recursive:true,force:true,maxRetries:3}); -} diff --git a/scripts/cross-browser-check.ts b/scripts/cross-browser-check.ts deleted file mode 100644 index e18e6de..0000000 --- a/scripts/cross-browser-check.ts +++ /dev/null @@ -1,76 +0,0 @@ -// Exercises the built Vue app in separate Brave and Firefox processes. -import { installBrowserContext } from './browser-context.ts'; -import { crossBrowserDriver } from './cross-browser-driver.ts'; -import { isRecord } from '../src/lib/validation.ts'; -import { createServer } from 'node:http'; -import { spawn, type ChildProcess } from 'node:child_process'; -import { readFile, mkdir, mkdtemp, rm, writeFile } from 'node:fs/promises'; -import { dirname, extname, join, resolve } from 'node:path'; -import { fileURLToPath } from 'node:url'; -import { tmpdir } from 'node:os'; -const types: Record = {'.html':'text/html','.js':'text/javascript','.css':'text/css','.png':'image/png'}; -const root = resolve(dirname(fileURLToPath(import.meta.url)), '..'); -const state: Record = {}; -const profiles: string[] = []; -const children: ChildProcess[] = []; -const provider = process.argv.includes('--default-network') ? 'pagequit' : 'none'; -const reversed = process.argv.includes('--reverse'); -const driver = `(${installBrowserContext.toString()})(); (${crossBrowserDriver.toString()})(${JSON.stringify(provider)});`; -let finish: () => void = () => {}; -const result = new Promise(resolve => { finish = resolve; }); -const server = createServer(async (req,res) => { - try { - const pathname=new URL(req.url ?? '/','http://localhost').pathname; - if(pathname==='/.test/driver.js'){res.setHeader('Content-Type','text/javascript');res.end(driver);return;} - if(pathname.startsWith('/.test/')){ - const key=pathname.slice('/.test/'.length); - if(req.method==='POST'){ - let body='';for await(const part of req){body+=part;if(body.length>262144)throw new Error('Too big');} - const previous=state[key]; - state[key]=JSON.parse(body); - if(key.endsWith('Stage'))console.log(key+': '+state[key]); - if(key.endsWith('Diagnostic')&&JSON.stringify(previous)!==JSON.stringify(state[key]))console.log(key+': '+JSON.stringify(state[key])); - if(key.endsWith('Result')){ - console.log(key+': '+JSON.stringify(state[key])); - if(!isRecord(state[key]) || !state[key].ok ||(state.senderResult&&state.receiverResult))finish(); - } - } - res.setHeader('Content-Type','application/json');res.end(JSON.stringify(state[key]??null));return; - } - const base=join(root,'dist');const path=resolve(base,'.'+(pathname==='/'?'/index.html':pathname)); - if(!path.startsWith(base+'/'))throw new Error('Invalid path'); - let body: string | Buffer = await readFile(path); - if(pathname==='/')body=body.toString().replace('',''); - res.setHeader('Content-Type',types[extname(path)]||'application/octet-stream');res.end(body); - }catch{res.statusCode=404;res.end();} -}); -await new Promise(resolve=>server.listen(0,'127.0.0.1',resolve)); -const address = server.address(); -if (!address || typeof address === 'string') throw new Error('Missing server address'); -const origin='http://127.0.0.1:'+address.port; -let timer: ReturnType | undefined; -try{ - for(const name of ['brave','firefox']){ - const profile=await mkdtemp(join(tmpdir(),'hellcon-'+name+'-'));profiles.push(profile); - // Received files are saved automatically; keep them in the throwaway profile instead of the user's Downloads. - const downloads=join(profile,'downloads');await mkdir(downloads); - if(name==='brave'){await mkdir(join(profile,'Default'));await writeFile(join(profile,'Default','Preferences'),JSON.stringify({download:{default_directory:downloads,prompt_for_download:false}}));} - else await writeFile(join(profile,'user.js'),['user_pref("browser.download.folderList", 2);','user_pref("browser.download.dir", '+JSON.stringify(downloads)+');','user_pref("browser.download.useDownloadDir", true);','user_pref("browser.download.always_ask_before_handling_new_types", false);'].join('\n')); - const role=(name==='brave')!==reversed?'sender':'receiver'; - const args=name==='brave'?['--headless','--no-sandbox','--disable-gpu','--no-first-run','--no-default-browser-check','--user-data-dir='+profile,origin+'/?role='+role]:['--headless','--no-remote','--profile',profile,origin+'/?role='+role]; - const child=spawn(process.env[name==='brave'?'BRAVE_PATH':'FIREFOX_PATH']||'/usr/bin/'+name,args,{stdio:['ignore','ignore','pipe']});children.push(child); - let errors='';child.stderr.on('data',chunk=>{errors+=chunk;}); - child.on('error',err=>{console.error(name,err.message);finish();}); - child.on('exit',code=>{if(code){console.error(name+' exited: '+errors.slice(-1500));finish();}}); - } - timer=setTimeout(()=>{console.error('Cross-browser check timed out.', JSON.stringify({sender:state.senderDiagnostic,receiver:state.receiverDiagnostic}));finish();},provider==='none'?15000:90000); - await result; - if(!isRecord(state.senderResult) || !state.senderResult.ok || !isRecord(state.receiverResult) || !state.receiverResult.ok)process.exitCode=1; - else console.log('PASS: '+(reversed?'Firefox → Brave':'Brave → Firefox')+' full UI transfer, fingerprint verification and exact file contents.'); -}finally{ - clearTimeout(timer); - for(const child of children)child.kill(); - await Promise.all(children.map(child=>new Promise(resolve=>{if(child.exitCode!==null||child.signalCode!==null)resolve();else child.once('exit', () => resolve());}))); - server.closeAllConnections();await new Promise((resolve, reject) => server.close(error => error ? reject(error) : resolve())); - for(const profile of profiles)await rm(profile,{recursive:true,force:true,maxRetries:5,retryDelay:200}); -} diff --git a/scripts/cross-browser-driver.ts b/scripts/cross-browser-driver.ts deleted file mode 100644 index 868eb35..0000000 --- a/scripts/cross-browser-driver.ts +++ /dev/null @@ -1,64 +0,0 @@ -import type {} from './browser-context.ts'; - -interface Exchange { - offer: string; - answer: string; - senderFingerprints: string[]; - receiverFingerprints: string[]; - senderResult: { ok: boolean }; -} - -// Serialized by the runner; all runtime dependencies live in this function or window. -export async function crossBrowserDriver(provider: string) { -const role = new URL(location.href).searchParams.get('role'); -if (role !== 'sender' && role !== 'receiver') throw new Error('Invalid role'); -const { click, input, wait, element } = window.__hellcon; -// Use the memory fallback so the received bytes can be checked in-page. -Object.defineProperty(navigator, 'serviceWorker', { value: undefined }); -const pause = (ms: number) => new Promise(resolve => setTimeout(resolve, ms)); -const post = async (key: string, value: unknown) => fetch('/.test/' + key, {method:'POST', headers:{'Content-Type':'application/json'}, body:JSON.stringify(value)}); -const get = async (key: K): Promise => (await fetch('/.test/' + key)).json(); -const stage = async (text: string) => post(role+'Stage', text); -const peers: RTCPeerConnection[] = []; const NativePC = window.RTCPeerConnection; -window.RTCPeerConnection = class extends NativePC { constructor(config?: RTCConfiguration) { super(config); peers.push(this); } }; -setInterval(()=>post(role+'Diagnostic',{status:document.querySelector('[role=status]')?.textContent,error:document.querySelector('[role=alert]')?.textContent,download:!!document.querySelector('a.download')}),2000); -try { - await wait(()=>document.querySelector('#stun-provider')); - if(role==='receiver'){click('Receive');await pause(20);} - if(role==='sender'){ - window.__hellcon.chooseFile(2*1024*1024+7, 'cross-browser.bin'); await pause(20); - } - input('#stun-provider',provider);await pause(20); - if(role==='sender'){ - await stage('creating offer'); click('Create code');await wait(()=>document.querySelector('#output-code')); - await post('offer',element('#output-code').value); - await stage('waiting for answer'); const answer=await wait(()=>get('answer'));input('#answer-input',answer);await pause(20);click('Connect'); - }else{ - await stage('waiting for offer'); const offer=await wait(()=>get('offer'));input('#offer-input',offer);await pause(20); - await stage('creating answer');click('Accept & create answer');await wait(()=>document.querySelector('#output-code')); - await post('answer',element('#output-code').value); - } - await stage('comparing fingerprints');await wait(()=>document.querySelector('.fingerprint')); - const fps=[...document.querySelectorAll('.fp-row code')].map(el=>el.textContent); - await post(role+'Fingerprints',fps); - const other=await wait(()=>get(role === 'sender' ? 'receiverFingerprints' : 'senderFingerprints')); - if(fps[0]!==other[1]||fps[1]!==other[0])throw new Error('Fingerprints do not match'); - click('Both fingerprints match — confirm'); - if(role==='receiver'){ - await stage('waiting for metadata');await wait(()=>document.querySelector('.incoming'));click('Accept file'); - await stage('receiving');await wait(()=>document.querySelector('a.download')); - await wait(()=>get('senderResult')); - await pause(250); - if(!document.querySelector('a.download'))throw new Error('Download was revoked after sender shutdown'); - await stage('checking downloaded bytes'); - const bytes=new Uint8Array(await (await fetch(element('a.download').href)).arrayBuffer()); - if(bytes.length!==2*1024*1024+7||!bytes.every(b=>b===123))throw new Error('File content mismatch'); - }else{ - await stage('waiting for receipt');await wait(()=>element('[role=status]').textContent?.includes('confirmed the complete file')); - click('Disconnect'); - } - await post(role+'Result',{ok:true}); -}catch(error){ - await post(role+'Result',{ok:false,error:error instanceof Error ? error.message : String(error),peers:peers.map(pc=>({connection:pc.connectionState,gathering:pc.iceGatheringState,ice:pc.iceConnectionState,localFingerprints:pc.localDescription?.sdp.match(/^a=fingerprint:.*$/gm),remoteFingerprints:pc.remoteDescription?.sdp.match(/^a=fingerprint:.*$/gm)}))}); -} -} diff --git a/scripts/dev-setup.ts b/scripts/dev-setup.ts deleted file mode 100644 index cf43e94..0000000 --- a/scripts/dev-setup.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { randomBytes } from 'node:crypto'; -import { writeFile } from 'node:fs/promises'; - -try { - await writeFile(new URL('../.env.development', import.meta.url), - `# Local development only; shared by Compose and Vite.\nTURN_SECRET=${randomBytes(32).toString('hex')}\nTURN_HOST=127.0.0.1\nTURN_PORT=3478\nVITE_ICE_ENDPOINT=/api/ice-servers\nVITE_STUN_URL=stun:127.0.0.1:3478\n`, - { flag: 'wx', mode: 0o600 }); - console.log('Created .env.development with a private development TURN secret.'); -} catch (error) { - if (!(error instanceof Error) || !('code' in error) || error.code !== 'EEXIST') throw error; - console.log('.env.development already exists; left unchanged. See .env.example for required settings.'); -} diff --git a/src/App.vue b/src/App.vue index fd09152..60d8a93 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,233 +1,10 @@ diff --git a/src/components/AppDialog.vue b/src/components/AppDialog.vue deleted file mode 100644 index 851508e..0000000 --- a/src/components/AppDialog.vue +++ /dev/null @@ -1,41 +0,0 @@ - - - diff --git a/src/components/ConnectionWorkspace.vue b/src/components/ConnectionWorkspace.vue deleted file mode 100644 index b0b3434..0000000 --- a/src/components/ConnectionWorkspace.vue +++ /dev/null @@ -1,36 +0,0 @@ - - - diff --git a/src/components/DeviceSettings.vue b/src/components/DeviceSettings.vue deleted file mode 100644 index 2fe389e..0000000 --- a/src/components/DeviceSettings.vue +++ /dev/null @@ -1,84 +0,0 @@ - - - diff --git a/src/components/NetworkSettings.vue b/src/components/NetworkSettings.vue deleted file mode 100644 index 617e2c1..0000000 --- a/src/components/NetworkSettings.vue +++ /dev/null @@ -1,51 +0,0 @@ - - - diff --git a/src/components/TransferPanel.vue b/src/components/TransferPanel.vue deleted file mode 100644 index f1f8df6..0000000 --- a/src/components/TransferPanel.vue +++ /dev/null @@ -1,799 +0,0 @@ - - -