@dornick/mounts-browser
v0.1.0
Published
Browser-API VFS mounts for Dornick — Clipboard, Geolocation, FileSystem Access, WakeLock, IdleDetection, BackgroundSync, ShareTarget, Battery, Online state, Notifications, Web Speech. Each capability-gated.
Readme
@dornick/mounts-browser
Browser-API VFS mounts for Dornick — Clipboard, Geolocation, File System Access, Web Speech, WakeLock, Notifications, online state, battery.
Each mount exposes a Web API as a /host/<name> VFS path the agent reads and writes. Each declares a static available(caps) gate so registering a mount on an unsupported browser is a silent no-op — the model never sees affordances it can't reach.
Install
npm i @dornick/mounts-browserTree-shakable — only mounts you import are bundled.
Use
import { Dornick } from "@dornick/core";
import {
ClipboardMount,
GeolocationMount,
FileSystemMount,
WebSpeechMount,
WakeLockMount,
NotificationMount,
OnlineMount,
BatteryMount,
} from "@dornick/mounts-browser";
const dornick = new Dornick({ config, transport });
// Each mount gates itself on dornick.capabilities under the hood.
// You can safely register them all — unsupported ones become no-ops.
dornick.mount("/host/clipboard", new ClipboardMount());
dornick.mount("/host/geo", new GeolocationMount());
dornick.mount("/host/fs", new FileSystemMount());
dornick.mount("/host/speech", new WebSpeechMount({ lang: "en-US" }));
dornick.mount("/host/wakelock", new WakeLockMount());
dornick.mount("/host/notify", new NotificationMount());
dornick.mount("/host/online", new OnlineMount());
dornick.mount("/host/battery", new BatteryMount());What each mount exposes
| Mount | Path | Operations |
|---|---|---|
| ClipboardMount | text.txt | read + write |
| GeolocationMount | current.json | read |
| FileSystemMount | pick.cmd, root.json, tree/<dir>, file/<path> | write pick.cmd to prompt directory picker; then read |
| WebSpeechMount | transcript.txt, listen.cmd, speak.json | read transcript; write listen.cmd ("start"/"stop"); write speak.json to synthesise |
| WakeLockMount | state.txt | read + write ("acquire"/"release") |
| NotificationMount | send.json | write only |
| OnlineMount | state.txt | read |
| BatteryMount | status.json | read |
Capability gates
| Mount | Gate |
|---|---|
| ClipboardMount | apis.clipboard |
| GeolocationMount | apis.geolocation |
| FileSystemMount | apis.fileSystemAccess |
| WebSpeechMount | apis.webSpeech.recognition or apis.webSpeech.synthesis |
| WakeLockMount | apis.wakeLock |
| NotificationMount | apis.notifications |
| OnlineMount | always available where navigator exists |
| BatteryMount | Chromium-only (navigator.getBattery) |
The integrator can call Mount.available(dornick.capabilities.current) to decide whether to register, or just register all and let the runtime skip the unsupported ones.
See also
License
MIT — © Dipankar Sarkar
