@dornick/mounts-hardware
v0.1.0
Published
Hardware-API VFS mounts for Dornick — NFC, WebAuthn, Bluetooth, USB, Serial. All capability-gated; safe on browsers that don't support them.
Readme
@dornick/mounts-hardware
Hardware-API VFS mounts for Dornick — NFC, WebAuthn, Bluetooth, USB, Serial.
Niche but high-signal. All capability-gated; on browsers that lack the API the mount becomes a no-op when registered. Safe to ship as opt-in.
Install
npm i @dornick/mounts-hardwareUse
import { Dornick } from "@dornick/core";
import {
NfcMount,
WebAuthnMount,
BluetoothMount,
UsbMount,
SerialMount,
} from "@dornick/mounts-hardware";
const dornick = new Dornick({ config, transport });
dornick.mount("/host/nfc", new NfcMount()); // Android Chrome only
dornick.mount("/host/webauthn", new WebAuthnMount());// broadly available
dornick.mount("/host/bt", new BluetoothMount()); // Chromium only
dornick.mount("/host/usb", new UsbMount()); // Chromium only
dornick.mount("/host/serial", new SerialMount()); // Chromium onlyWhat each mount exposes
NfcMount (apis.nfc)
| Path | Operation |
|---|---|
| scan.cmd | write "start" / "stop" |
| last.json | read the most recent NDEF message decoded |
WebAuthnMount (apis.webauthn)
| Path | Operation |
|---|---|
| register.json | write { challenge, rp, user, ... } → reads the attestation |
| assert.json | write { challenge, rpId, allowCredentials, ... } → reads the assertion |
The integrator generates the challenge server-side and verifies the returned attestation/assertion server-side. Dornick is the conduit.
BluetoothMount (apis.bluetooth)
| Path | Operation |
|---|---|
| devices.json | list previously-granted devices |
| request.cmd | write a filter JSON to invoke requestDevice |
| last.json | the most recently chosen device |
UsbMount (apis.usb)
| Path | Operation |
|---|---|
| devices.json | granted USB devices |
| request.cmd | invoke requestDevice |
| last.json | most recently chosen device |
SerialMount (apis.serial)
| Path | Operation |
|---|---|
| ports.json | granted serial ports |
| request.cmd | invoke requestPort |
Why this is opt-in
The hardware mounts touch privacy-sensitive APIs that prompt the user on first use. They should be activated only by configs that genuinely need them — a KYC flow asking for an ID via NFC, a passkey-anchored fintech onboarding, a USB barcode scanner attached to an admin app.
See also
License
MIT — © Dipankar Sarkar
