| Filename | Latest commit message | Latest commit date |
|---|---|---|
docs/connect.md and the feature map drop the prototype framing for what the lab does, keep its limits, and note the translated copy and the unsupported-desktop card; the record and browser client READMEs say they are examples, not part of Hex. |
||
| .. | ||
| index.html | ||
| README.md | ||
Browser connect demo
An example page, not part of Hex: a single static page that exercises the
contract in
docs/connect.md: PKCE, the consent dialog, the
one-use audio token and one WAV file, and a microphone recording that runs
while the page checks in. It never reads Hex's discovery file or token.
-
Turn on Labs › Connected apps in Hex, and in its card Allow websites to use Hex.
-
Serve this folder (any static server works), for example from
http://localhost:5173:cd prototypes/browser-connect python3 -m http.server 5173 -
Read Hex's local API port, then paste it into the page:
python3 -c 'import json,os;print(json.load(open(os.path.expanduser("~/Library/Application Support/hex/local-api.json")))["port"])' -
Allow the site first. Press either button once: Hex shows no dialog yet and the page gets
403 website-not-allowed. The page's origin now appears in Hex's Connected apps pane under Asking to connect; press Allow there (or Block to refuse it for good). Hex never shows a dialog after the fact, so ask again from the page. -
Choose a WAV file and press Ask Hex for one transcription. Hex shows its permission window with Deny, Allow Once, and Always Allow, unless this page already has permission. Either approval lets the page transcribe the selected file. Always Allow saves a proof in this origin's local storage; if you clear site data, revoke the permission in Hex › Connected apps before pairing again. Each ask sends the page's favicon (drawn on a canvas, as a PNG
data:URL); Hex shows it beside the address and never fetches it. -
Or press Record with Hex. After the recording dialog, Hex records until you press Stop and get the transcript (or Stop in Hex). The page sends
POST /record/heartbeatevery few seconds; close the tab and Hex stops the microphone within 10 s.
A Deny (or Return, or Escape) cancels: the page gets 403 consent-denied,
and the origin waits 30 seconds before it may prompt again.