@vitrinka/web 0.3.4 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +118 -0
- package/README.md +93 -6
- package/build/hud.d.ts +4 -1
- package/build/hud.iife.js +46 -9
- package/build/one.iife.js +1 -0
- package/build/protocol/index.d.ts +55 -4
- package/build/protocol/index.js +4 -2
- package/build/recorder/RecorderProvider.js +48 -9
- package/build/recorder/api.d.ts +25 -5
- package/build/recorder/api.js +21 -9
- package/build/recorder/attachments.d.ts +19 -0
- package/build/recorder/attachments.js +31 -0
- package/build/recorder/capture/console.d.ts +2 -0
- package/build/recorder/capture/console.js +22 -2
- package/build/recorder/capture/nav.d.ts +13 -2
- package/build/recorder/capture/nav.js +49 -11
- package/build/recorder/capture/net.d.ts +2 -0
- package/build/recorder/capture/net.js +30 -4
- package/build/recorder/control.d.ts +17 -0
- package/build/recorder/control.js +39 -2
- package/build/recorder/hud/Hud.d.ts +1 -1
- package/build/recorder/hud/Hud.js +113 -30
- package/build/recorder/hud/RecorderPill.js +6 -2
- package/build/recorder/hud/Sheet.d.ts +40 -5
- package/build/recorder/hud/Sheet.js +134 -8
- package/build/recorder/hud/attach.d.ts +26 -0
- package/build/recorder/hud/attach.js +136 -0
- package/build/recorder/hud/chords.d.ts +10 -0
- package/build/recorder/hud/chords.js +34 -0
- package/build/recorder/hud/controller.d.ts +55 -3
- package/build/recorder/hud/controller.js +1 -1
- package/build/recorder/hud/flow.d.ts +22 -1
- package/build/recorder/hud/flow.js +16 -1
- package/build/recorder/hud/host.js +2 -0
- package/build/recorder/hud/icons.d.ts +3 -0
- package/build/recorder/hud/icons.js +7 -0
- package/build/recorder/hud/layer.d.ts +4 -1
- package/build/recorder/hud/layer.js +11 -3
- package/build/recorder/hud/resize.d.ts +83 -0
- package/build/recorder/hud/resize.js +236 -0
- package/build/recorder/hud/styles.d.ts +1 -1
- package/build/recorder/hud/styles.js +38 -1
- package/build/recorder/index.d.ts +1 -0
- package/build/recorder/index.js +1 -0
- package/build/recorder/lead.d.ts +90 -0
- package/build/recorder/lead.js +404 -0
- package/build/recorder/link.d.ts +4 -1
- package/build/recorder/link.js +6 -2
- package/build/recorder/me.d.ts +7 -0
- package/build/recorder/me.js +62 -12
- package/build/recorder/one-iife.d.ts +13 -0
- package/build/recorder/one-iife.js +13 -0
- package/build/recorder/one.d.ts +170 -0
- package/build/recorder/one.js +292 -0
- package/build/recorder/page-controller.js +26 -4
- package/build/recorder/queue.d.ts +33 -3
- package/build/recorder/queue.js +409 -26
- package/build/recorder/report.d.ts +9 -0
- package/build/recorder/report.js +55 -6
- package/build/recorder/session.d.ts +33 -7
- package/build/recorder/session.js +111 -31
- package/build/recorder/state.d.ts +9 -0
- package/build/recorder/state.js +7 -0
- package/build/recorder/storage/blobs.d.ts +32 -0
- package/build/recorder/storage/blobs.js +83 -0
- package/build/recorder/storage/index.js +3 -2
- package/build/recorder/version.d.ts +3 -0
- package/build/recorder/version.js +3 -0
- package/package.json +5 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,123 @@
|
|
|
1
1
|
# @vitrinka/web
|
|
2
2
|
|
|
3
|
+
## 0.5.0
|
|
4
|
+
|
|
5
|
+
- **The page recorder and the Vitrinka extension are one recorder.** A page
|
|
6
|
+
could embed this recorder while the tester's browser ran the extension,
|
|
7
|
+
and the two fought. The extension's shortcuts swallowed the pill's ⌥⇧A/N/P,
|
|
8
|
+
either one could start its own recording, and two pills could show. Now the
|
|
9
|
+
first to start leads and the other becomes its remote: its pill hides, it
|
|
10
|
+
captures nothing (no rrweb, click, nav, console or net lane, no flight
|
|
11
|
+
recorder), and its pause, stop, note and shortcuts act on the leader. Two
|
|
12
|
+
recordings never run at once. The session lands where the leader is
|
|
13
|
+
configured; neither side ever borrows the other's credential.
|
|
14
|
+
- **They speak over the DOM, the one thing their worlds share.** The
|
|
15
|
+
recorder marks the document with `data-vitrinka-page="web/0.5.0"` on
|
|
16
|
+
`<html>`. Whoever records holds `data-vitrinka-lead`, a JSON claim
|
|
17
|
+
(`{v, by, id, state, sessionId, since}`) written only by its holder and
|
|
18
|
+
taken by a synchronous check-and-set before any network call. Actions are
|
|
19
|
+
`window` CustomEvents with a JSON-string `detail`: `vitrinka:hello`,
|
|
20
|
+
`vitrinka:command` (`pause`, `stop`, `note`) and `vitrinka:ack`. Each is
|
|
21
|
+
answered inside its own dispatch, so a page never waits on a timer. A
|
|
22
|
+
holder that no longer answers (an extension reloaded or uninstalled) is
|
|
23
|
+
cleared under its own id. The page writes nothing until its root's effect
|
|
24
|
+
runs, so a server-rendered `<html>` hydrates untouched.
|
|
25
|
+
- **Start is refused while the other side leads.** The pill's Start and
|
|
26
|
+
`__vitrinkaRecorder.start()` check before any network call and reject with
|
|
27
|
+
a `RecorderBusyError` (`code: 'recorder_busy'`, `leader`). The pill shows
|
|
28
|
+
the reason (**Already recording**, the full sentence on hover) until you
|
|
29
|
+
dismiss it, for example "the Vitrinka extension is recording in another tab
|
|
30
|
+
— stop it there first". Any other failed Start now shows **Couldn't start**
|
|
31
|
+
on the pill instead of only reaching the console.
|
|
32
|
+
- **A recording that comes back never preempts.** A session resumed after a
|
|
33
|
+
reload, or joined from another tab, into a document or browser the
|
|
34
|
+
extension leads waits as a follower, capturing nothing. It resumes when the
|
|
35
|
+
extension lets go. Nothing is stopped on your behalf.
|
|
36
|
+
- **Relayed shortcuts keep working.** Chrome hands the extension's command
|
|
37
|
+
chords to its worker, never to the page. The extension relays them as a
|
|
38
|
+
synthetic keydown, and the leading HUD acts on it (`isTrusted: false`
|
|
39
|
+
included). It takes the key with `preventDefault` only, so a host that
|
|
40
|
+
skips `defaultPrevented` keys leaves it alone. A follower's HUD binds no
|
|
41
|
+
chord.
|
|
42
|
+
- `__vitrinkaRecorder.status()` gains `leader` (`'page' | 'extension'`) and
|
|
43
|
+
`following`. While the extension leads, `pause`, `stop` and `note` act on
|
|
44
|
+
it, and a note it can no longer take rejects with "the recording ended
|
|
45
|
+
before the note arrived" instead of landing in a later session.
|
|
46
|
+
- `HudController`: `HudSnapshot.following` hides the HUD as the leader's
|
|
47
|
+
remote. It closes the sheet, menu, link sheet and annotate mode, keeps the
|
|
48
|
+
drafts and their images and keeps the dock spot. `onRemoteStop(run)`
|
|
49
|
+
registers the HUD's Stop flow, which a remote stop runs with no second
|
|
50
|
+
confirm. `faceChanged(face)` reports the inline flow face, so the host
|
|
51
|
+
holds its claim as `saved` while **Saved · Open board** shows. `HudFace`
|
|
52
|
+
is exported from `@vitrinka/web/hud`.
|
|
53
|
+
- **`@vitrinka/web/one.iife.js`** (`build/one.iife.js`) is the protocol as
|
|
54
|
+
one 5 KB script defining `globalThis.VitrinkaOne`, for the extension's
|
|
55
|
+
content scripts. The extension vendors it beside `hud.iife.js` under the
|
|
56
|
+
same pin. The protocol types (`Claim`, `Hello`, `Command`, `Ack`, …) are
|
|
57
|
+
exported from `@vitrinka/web/hud`.
|
|
58
|
+
- An older extension (≤ 0.10) is invisible to the protocol, and both behave
|
|
59
|
+
as before.
|
|
60
|
+
|
|
61
|
+
## 0.4.0
|
|
62
|
+
|
|
63
|
+
- **Notes, annotations and bug reports carry images.** Testers asked to
|
|
64
|
+
attach a reference of "how it should be" while recording. The sheet now
|
|
65
|
+
takes images three ways: the **Attach image** paperclip beside Send,
|
|
66
|
+
an image pasted into the text box (a text paste stays a text paste), and
|
|
67
|
+
image files dropped onto the sheet, which highlights while you drag.
|
|
68
|
+
Thumbnails line up above the footer, each with a **Remove** ×. A note
|
|
69
|
+
carries up to 4 and may have no text; a bug report still needs its
|
|
70
|
+
description. The images survive a cancel like the draft's text. On the
|
|
71
|
+
board they become the tester's own thread message under the note.
|
|
72
|
+
- **Images are re-encoded before they leave the browser.** WebP at 0.85,
|
|
73
|
+
JPEG where the browser cannot write WebP, PNG when JPEG would lose
|
|
74
|
+
transparency. The long edge is at most 2560 px and the file at most
|
|
75
|
+
12 MiB; an animated image keeps its first frame. EXIF and GPS metadata are
|
|
76
|
+
gone. A file that is not an image is refused with the reason in the
|
|
77
|
+
footer's context slot, so the footer never moves.
|
|
78
|
+
- **Only where the server allows it.** The paperclip shows when
|
|
79
|
+
`GET /api/v1/recorder/policy` answers `attachments: true`. A server before
|
|
80
|
+
attachments omits the field, and a workspace can switch them off. The
|
|
81
|
+
recorder then sends notes as before, text only.
|
|
82
|
+
- **Wire.** Each image uploads to `POST /sessions/:id/shot?seq=N` with its
|
|
83
|
+
own Content-Type. An `attachment` event `{name, mime, bytes, w, h}` then
|
|
84
|
+
carries the returned `blobKey`. Its seq is allocated with the note's,
|
|
85
|
+
just below it, and the note lists the image seqs as `attachments`. An idle
|
|
86
|
+
bug report carries its images into its short session the same way. The
|
|
87
|
+
`protocol` module adds `AttachmentPayload`, `NotePayload` and
|
|
88
|
+
`RecorderPolicyResponse`.
|
|
89
|
+
- **A queued image survives a reload.** Its bytes wait in an IndexedDB
|
|
90
|
+
blob journal (`vitrinka.recorder.blobs`) until the server acknowledged its
|
|
91
|
+
event. A reload, or another tab finishing a closed tab's tail, uploads it
|
|
92
|
+
before its event is delivered, and Stop waits for it like the rest of the
|
|
93
|
+
tail. The queue holds at most 64 MiB (200 images) across notes; past that
|
|
94
|
+
the oldest image is dropped with a console warning and its note lands
|
|
95
|
+
without it.
|
|
96
|
+
- `HudController`: `HudSnapshot.canAttach`, `note(text, attachments?)`,
|
|
97
|
+
and `attachments` on `HudAnnotation` and `HudReport`. `HudAttachment` is
|
|
98
|
+
exported from `@vitrinka/web/hud`. A host without `canAttach` gets the text-only
|
|
99
|
+
HUD it had.
|
|
100
|
+
- The HUD's propagation shield also stops `paste` and the drag events, so a
|
|
101
|
+
page's own upload handler never takes an image meant for the sheet.
|
|
102
|
+
- **A roomier sheet you can resize.** The note, annotate and bug-report
|
|
103
|
+
sheet is now 440 px wide at every HUD size (was 288 at size M). Its text
|
|
104
|
+
box grows with the draft up to 20 rows, then scrolls; the footer row keeps
|
|
105
|
+
its layout and the sheet stays beside the pill, inside the viewport. A grip
|
|
106
|
+
on the corner away from the pill (**Resize note**, **Resize annotation**,
|
|
107
|
+
**Resize report**) drags the width (320 to 960 px) and the text box's cap
|
|
108
|
+
live; on a phone's full-width bottom sheet it drags the cap alone. Its
|
|
109
|
+
arrow keys step 16 px (Shift: 64), and Enter or a double-click restores
|
|
110
|
+
the default.
|
|
111
|
+
- **The sheet size is a HUD preference.** `HudPrefs` gains `sheetW` and
|
|
112
|
+
`sheetH` (CSS px, 0 = the default) and `DEFAULT_PREFS` carries 0 for both.
|
|
113
|
+
A resize calls `setPrefs({sheetW, sheetH})` once, on release. The in-page
|
|
114
|
+
recorder applies it at once, keeps it in its storage, and sends it to
|
|
115
|
+
`PATCH /api/v1/recorder/me` in a request of its own. A server that
|
|
116
|
+
predates the fields answers that request 422. The size then stays on the
|
|
117
|
+
device for the page's lifetime, with no retry and no error, and size and
|
|
118
|
+
details still sync. A linked user's server copy wins on load, as for size
|
|
119
|
+
and details. An answer without the fields never resets the device's size.
|
|
120
|
+
|
|
3
121
|
## 0.3.4
|
|
4
122
|
|
|
5
123
|
- **Two tabs no longer collide on event sequence numbers.** Events and rrweb
|
package/README.md
CHANGED
|
@@ -128,7 +128,7 @@ controls**) that unfolds into the tools on hover, focus or tap and folds back
|
|
|
128
128
|
|---|---|---|
|
|
129
129
|
| sync chip | | `synced` · `sending N` · `offline · N` · `ended` — readable without hovering |
|
|
130
130
|
| ⏸ Pause / ▶ Resume | ⌥⇧P (Alt⇧P) | freezes the clock and capture |
|
|
131
|
-
| ✎ Note | ⌥⇧N | the note sheet — Enter sends, ⇧Enter newline, Esc / ✕ / click-outside cancel (the draft
|
|
131
|
+
| ✎ Note | ⌥⇧N | the note sheet — Enter sends, ⇧Enter newline, Esc / ✕ / click-outside cancel (the draft and its images survive a cancel); the pill says **Saved**. Images: see [Attach images](#attach-images) |
|
|
132
132
|
| ⌖ Annotate | ⌥⇧A | click or tap an element, or drag a region (a finger too). While annotating, the page gets no press, move or hover, does not scroll, and selects no text. Then describe it: `board` (an annotation on the board) or `task` (also filed as an intake draft) |
|
|
133
133
|
| ■ Stop | ⌥⇧S | the pill asks **Stop & save?** (Esc / **Keep recording** cancels), shows **Saving…** with progress while the tail drains, then **Saved · Open board** until you dismiss it |
|
|
134
134
|
| ⋯ | | the linked account · **Report a bug** (below) · **Open this board** · **Recent** (this device's last five recordings, each linked to its board) · **Go to vitrinka** · **Size** S/M/L · **Technical details** · **Position** · **Unlink this device** (asks first) |
|
|
@@ -159,11 +159,40 @@ device only. Technical details shows events captured, queue and pending
|
|
|
159
159
|
chunks, the last sync and its state, the server's seq, the session id and
|
|
160
160
|
the recorder version.
|
|
161
161
|
|
|
162
|
+
The note, annotate and bug-report sheet is 440 px wide at every HUD size,
|
|
163
|
+
and its text box grows with what you type up to 20 rows, then scrolls. Drag
|
|
164
|
+
the grip on the sheet's free corner (the one away from the pill) to change
|
|
165
|
+
the width and that cap; on a phone the sheet spans the screen, so its grip
|
|
166
|
+
changes the cap alone. With the grip focused, the arrow keys move it 16 px
|
|
167
|
+
(Shift: 64 px), and Enter or a double-click restores the default. The size is a
|
|
168
|
+
preference too (`sheetW`, `sheetH` in CSS px, 0 = the default). It is sent
|
|
169
|
+
in a PATCH of its own when you let go. A server that predates it answers 422,
|
|
170
|
+
and the size then stays on the device while size and details still sync.
|
|
171
|
+
|
|
162
172
|
The sheet renders inside the topmost open dialog when one exists, so a
|
|
163
173
|
Radix focus trap or a `<dialog>.showModal()` never fights it, and nothing
|
|
164
174
|
you do on the pill reaches the page (a "close on outside click" never fires
|
|
165
175
|
because of the recorder).
|
|
166
176
|
|
|
177
|
+
## With the Vitrinka extension
|
|
178
|
+
|
|
179
|
+
A tester's browser may also run the Vitrinka extension. The two are one
|
|
180
|
+
recorder: whichever starts first leads, and the other becomes its remote.
|
|
181
|
+
While the extension records (this tab or another), the pill hides and this
|
|
182
|
+
recorder captures nothing; its shortcuts and `__vitrinkaRecorder` act on the
|
|
183
|
+
extension's recording. While the pill records, the extension relays its
|
|
184
|
+
⌥⇧A/N/P to the pill. A Start pressed while the other side leads is refused
|
|
185
|
+
before anything is created, and the pill says why until you dismiss it. A
|
|
186
|
+
recording resumed after a reload into a browser the extension leads waits,
|
|
187
|
+
capturing nothing, and resumes when the extension stops. The session lands
|
|
188
|
+
where the leader is configured.
|
|
189
|
+
|
|
190
|
+
They coordinate through two attributes on `<html>`: `data-vitrinka-page`
|
|
191
|
+
(this recorder is mounted) and `data-vitrinka-lead` (who records), plus
|
|
192
|
+
`vitrinka:*` window events. The page writes them from an effect, after
|
|
193
|
+
hydration. The protocol is `src/recorder/one.ts`; `@vitrinka/web/one.iife.js`
|
|
194
|
+
is the same code for the extension.
|
|
195
|
+
|
|
167
196
|
## Report a bug
|
|
168
197
|
|
|
169
198
|
**Report a bug** (⋯ menu) files what led up to a bug — no recording needed.
|
|
@@ -187,8 +216,9 @@ went wrong (required) and offers **Mark on screen** — annotate mode's
|
|
|
187
216
|
element pick or region drag. Send files one short session under the pill's
|
|
188
217
|
credential: title `Bug report: <first line>`, `meta.kind: "report"` and
|
|
189
218
|
`meta.devicePixelRatio`; the buffered events with their original
|
|
190
|
-
timestamps; the rrweb windows as chunks;
|
|
191
|
-
with `task: true` (the marked region, else the
|
|
219
|
+
timestamps; the rrweb windows as chunks; any images you attached; your
|
|
220
|
+
description as an annotation with `task: true` (the marked region, else the
|
|
221
|
+
whole viewport); then done.
|
|
192
222
|
vitrinka renders stills from the clip, pins the annotation on the board and
|
|
193
223
|
files it as an intake draft. The pill says **Sending…**, then **Sent · Open
|
|
194
224
|
board** (it is in Recents too); a failure offers **Retry**, which resumes
|
|
@@ -205,6 +235,32 @@ the running session instead.
|
|
|
205
235
|
Then nothing is captured until a recording starts, and Report a bug is
|
|
206
236
|
offered only during one.
|
|
207
237
|
|
|
238
|
+
## Attach images
|
|
239
|
+
|
|
240
|
+
A note, an annotation and a bug report can carry reference images — "how
|
|
241
|
+
it should be" beside what it does. In the sheet: the **Attach image**
|
|
242
|
+
paperclip beside Send picks them, pasting an image into the text box adds
|
|
243
|
+
it (a text paste stays a text paste), and dropping image files onto the
|
|
244
|
+
sheet adds them (it highlights while you drag). They line up as thumbnails
|
|
245
|
+
above the footer, each with a **Remove** ×. Up to 4 per note; a note with
|
|
246
|
+
images may have no text, a bug report still needs its description. Like
|
|
247
|
+
the text, the images survive a cancel until the next send.
|
|
248
|
+
|
|
249
|
+
Each image is re-encoded in the browser before it is stored or sent: WebP
|
|
250
|
+
at 0.85 (JPEG where the browser cannot write WebP, PNG when JPEG would lose
|
|
251
|
+
transparency), long edge ≤ 2560 px, ≤ 12 MiB, the first frame of an
|
|
252
|
+
animated one. EXIF and GPS metadata never leave the device. A file that is
|
|
253
|
+
not an image, or one still too large, is refused with the reason in the
|
|
254
|
+
sheet's footer.
|
|
255
|
+
|
|
256
|
+
The paperclip shows only when your vitrinka server answers
|
|
257
|
+
`attachments: true` to the policy read (`GET /api/v1/recorder/policy`): a
|
|
258
|
+
server before attachments leaves it out, and a workspace can switch
|
|
259
|
+
attachments off. On the board, each note's images become your own thread
|
|
260
|
+
message under it — image tiles and the lightbox. Images are not masked by a
|
|
261
|
+
`maskAllText` policy: they are your deliberate upload, not captured screen.
|
|
262
|
+
What goes over the wire: [`docs/PROTOCOL.md`](../../docs/PROTOCOL.md#attached-images-web-hud).
|
|
263
|
+
|
|
208
264
|
## Driving it from code
|
|
209
265
|
|
|
210
266
|
`window.__vitrinkaRecorder` — for agents and tests:
|
|
@@ -213,9 +269,14 @@ offered only during one.
|
|
|
213
269
|
await __vitrinkaRecorder.start({ title: 'checkout', tags: ['ai'] });
|
|
214
270
|
__vitrinkaRecorder.note('price flashes on hover');
|
|
215
271
|
const { boardUrl } = await __vitrinkaRecorder.stop();
|
|
216
|
-
__vitrinkaRecorder.status(); // { recording, sessionId, elapsedMs, queued, synced, … }
|
|
272
|
+
__vitrinkaRecorder.status(); // { recording, leader, sessionId, elapsedMs, queued, synced, … }
|
|
217
273
|
```
|
|
218
274
|
|
|
275
|
+
While the extension leads, `status()` says `leader: 'extension'` and
|
|
276
|
+
`following: 'extension'`, and `pause`, `stop` and `note` act on its
|
|
277
|
+
recording. `start()` rejects with a `RecorderBusyError` (`code:
|
|
278
|
+
'recorder_busy'`, exported from `@vitrinka/web/recorder`).
|
|
279
|
+
|
|
219
280
|
## The HUD on its own (`@vitrinka/web/hud`)
|
|
220
281
|
|
|
221
282
|
The HUD is driven only through a `HudController`. The in-page recorder is one
|
|
@@ -234,11 +295,21 @@ const unmount = mountRecorderHud(controller, { title: () => document.title });
|
|
|
234
295
|
`subscribe(fn)` calls back after a change. The snapshot holds `linked`,
|
|
235
296
|
`canUnlink`, `annotating`, `recording` (session, clock, sync), `account`,
|
|
236
297
|
`prefs`, `recents`, `workspaceUrl`, `version` and, optionally,
|
|
237
|
-
`canReport`.
|
|
298
|
+
`canReport` and `canAttach`.
|
|
238
299
|
- Actions: `start`, `togglePause`, `stop` (resolves `{boardUrl?}`, rejects
|
|
239
300
|
while the server is unreachable), `note`, `annotate`, `setAnnotating`,
|
|
240
301
|
`link`, `unlink`, `getMe`, `setPrefs` and `refreshRecents`; optionally
|
|
241
302
|
`holdReport` and `report` — without them the menu has no **Report a bug**.
|
|
303
|
+
- With `canAttach: true` the sheets take images: `note(text, attachments)`,
|
|
304
|
+
`annotate({…, attachments})` and `report({…, attachments})` hand over
|
|
305
|
+
`HudAttachment`s (`{name, blob, w, h}`) the HUD has already re-encoded —
|
|
306
|
+
png, webp or jpeg, ≤ 2560 px, ≤ 12 MiB. Uploading them is the host's job.
|
|
307
|
+
- One recorder with the page's own: `following: 'page' | 'extension'` in
|
|
308
|
+
the snapshot hides the HUD as the leader's remote (sheets and annotate
|
|
309
|
+
mode close, the drafts survive, no shortcut is bound). Optionally,
|
|
310
|
+
`onRemoteStop(run)` registers the HUD's Stop flow for a remote stop (no
|
|
311
|
+
second confirm), and `faceChanged(face)` reports the pill's inline flow
|
|
312
|
+
face so the host can hold its claim while **Saved** shows.
|
|
242
313
|
|
|
243
314
|
The full contract is in `src/recorder/hud/controller.ts`.
|
|
244
315
|
|
|
@@ -250,6 +321,9 @@ same mount as one self-contained script with React bundled in:
|
|
|
250
321
|
<script>const unmount = VitrinkaHud.mount(controller);</script>
|
|
251
322
|
```
|
|
252
323
|
|
|
324
|
+
`@vitrinka/web/one.iife.js` is the page↔extension protocol the same way
|
|
325
|
+
(`globalThis.VitrinkaOne`, no React, about 5 KB).
|
|
326
|
+
|
|
253
327
|
## What is captured, exactly
|
|
254
328
|
|
|
255
329
|
| Lane | Event `kind` | Payload |
|
|
@@ -259,7 +333,8 @@ same mount as one self-contained script with React bundled in:
|
|
|
259
333
|
| navigation | `nav` | `{url, route, spa}` — `url` scrubbed of query/fragment secrets, the start URL included |
|
|
260
334
|
| network | `net` | `{method, url, status, ms, reqHeaders, resHeaders, reqBody, resBody, via}` — redacted, capped at 64 KiB per body; the recorder's own uploads are never recorded |
|
|
261
335
|
| console | `console` | `{level: 'error', text}` |
|
|
262
|
-
| notes | `note` | `{text, route}`; annotations add `{rect, selector, annotate: true, task?}` |
|
|
336
|
+
| notes | `note` | `{text, route}`; annotations add `{rect, selector, annotate: true, task?}`; a note with images adds `attachments: [seq…]` |
|
|
337
|
+
| images | `attachment` | `{name, mime, bytes, w, h}` + `blobKey` — the image itself is uploaded to `/shot?seq=N` first; its seq sits just below its note's |
|
|
263
338
|
|
|
264
339
|
Data goes to your vitrinka server only. Details, the redaction rules and the
|
|
265
340
|
policy fetch: [`docs/PROTOCOL.md`](../../docs/PROTOCOL.md).
|
|
@@ -300,6 +375,18 @@ Pending allocations have a 16 MiB byte budget, 20,000-event count limit and
|
|
|
300
375
|
200-chunk limit; overflow drops the oldest capture with a warning and health
|
|
301
376
|
failure, matching the queue's existing bounded retry behavior.
|
|
302
377
|
|
|
378
|
+
Attached images are too big for `localStorage`: their bytes wait in an
|
|
379
|
+
IndexedDB blob journal (`vitrinka.recorder.blobs`) while the queue keeps
|
|
380
|
+
their metadata. A note and its images take one allocation, so a reload — or
|
|
381
|
+
another tab finishing a closed tab's tail — uploads each queued image to
|
|
382
|
+
`/shot` before its `attachment` event is delivered. Stop waits for them as
|
|
383
|
+
it waits for the rest of the tail. The bytes leave the journal once the
|
|
384
|
+
server acknowledged the image's event, or when its session ends. Without
|
|
385
|
+
IndexedDB the images still upload from the open tab; only the reload
|
|
386
|
+
guarantee is lost, and the recorder says so. The queue holds at most
|
|
387
|
+
64 MiB (200 images) across notes: past that the oldest image is dropped
|
|
388
|
+
with a console warning, and its note lands without it.
|
|
389
|
+
|
|
303
390
|
## Development
|
|
304
391
|
|
|
305
392
|
```bash
|
package/build/hud.d.ts
CHANGED
|
@@ -5,5 +5,8 @@
|
|
|
5
5
|
* defining `globalThis.VitrinkaHud.mount`.
|
|
6
6
|
*/
|
|
7
7
|
export { mountRecorderHud, type MountHudOptions } from './recorder/hud/mount';
|
|
8
|
-
export { DEFAULT_PREFS, type HudAccount, type HudAnnotation, type HudController, type HudLinkCode, type HudLinkFlow, type HudPrefs, type HudRecent, type HudRecentStatus, type HudRecording, type HudRect, type HudReport, type HudSaved, type HudSize, type HudSnapshot, type HudSync, type HudSyncState, } from './recorder/hud/controller';
|
|
8
|
+
export { DEFAULT_PREFS, type HudAccount, type HudAnnotation, type HudAttachment, type HudController, type HudFace, type HudLinkCode, type HudLinkFlow, type HudPrefs, type HudRecent, type HudRecentStatus, type HudRecording, type HudRect, type HudReport, type HudSaved, type HudSize, type HudSnapshot, type HudSync, type HudSyncState, } from './recorder/hud/controller';
|
|
9
9
|
export type { RecorderStorage } from './recorder/storage';
|
|
10
|
+
/** ONE recorder: the protocol the page recorder and the extension speak (`build/one.iife.js` = `globalThis.VitrinkaOne`). */
|
|
11
|
+
export type { Ack, AckCode, Claim, ClaimRoot, ClaimState, Command, CommandOp, CommandReply, Hello, Live, OneEnv, OneParty, OneSelf, } from './recorder/one';
|
|
12
|
+
export type { VitrinkaOneGlobal } from './recorder/one-iife';
|