@ractive-ch/tab-mcp-client 0.16.1 → 0.17.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.
Files changed (33) hide show
  1. package/CHANGELOG.md +849 -0
  2. package/README.md +102 -74
  3. package/address.d.ts +8 -8
  4. package/cdn/{confirm-y30cx7e1.min.js → confirm-mqmvsxg1.min.js} +2 -2
  5. package/cdn/{connect-bbhj2y7w.min.js → connect-c7wn48yp.min.js} +2 -2
  6. package/cdn/{connect-bbhj2y7w.min.js.map → connect-c7wn48yp.min.js.map} +1 -1
  7. package/cdn/{connection-w97tf22a.min.js → connection-0xqwz17v.min.js} +7 -7
  8. package/cdn/{connection-w97tf22a.min.js.map → connection-0xqwz17v.min.js.map} +5 -5
  9. package/cdn/{index-vt5zk9me.min.js → index-t33bb2g4.min.js} +4 -4
  10. package/cdn/{index-vt5zk9me.min.js.map → index-t33bb2g4.min.js.map} +4 -4
  11. package/cdn/tab-mcp-client.min.js +3 -3
  12. package/cdn/tab-mcp-client.min.js.map +4 -4
  13. package/{confirm-fgnjgd08.js → confirm-vj2zbq4w.js} +2 -2
  14. package/{connect-8jpb0k29.js → connect-9pefy0xe.js} +2 -2
  15. package/{connect-8jpb0k29.js.map → connect-9pefy0xe.js.map} +1 -1
  16. package/{connection-g91xjjgm.js → connection-gang7f5x.js} +10 -23
  17. package/{connection-g91xjjgm.js.map → connection-gang7f5x.js.map} +5 -5
  18. package/connection.d.ts +2 -2
  19. package/index-dmh5vm5m.js.map +1 -1
  20. package/{index-jnz7w9xa.js → index-qw8qy5ed.js} +11 -11
  21. package/{index-jnz7w9xa.js.map → index-qw8qy5ed.js.map} +2 -2
  22. package/index.js +24 -26
  23. package/index.js.map +4 -4
  24. package/internal.d.ts +2 -0
  25. package/package.json +1 -1
  26. package/protocol.d.ts +6 -7
  27. package/secret.d.ts +1 -1
  28. package/strings.d.ts +1 -1
  29. package/tab-mcp.d.ts +10 -1
  30. package/types.d.ts +16 -2
  31. package/visible.d.ts +1 -1
  32. /package/cdn/{confirm-y30cx7e1.min.js.map → confirm-mqmvsxg1.min.js.map} +0 -0
  33. /package/{confirm-fgnjgd08.js.map → confirm-vj2zbq4w.js.map} +0 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,849 @@
1
+ # Changelog of @ractive-ch/tab-mcp-client
2
+
3
+ All notable changes to the browser library `@ractive-ch/tab-mcp-client`, released with
4
+ the Git tag `client-v<version>`. The format follows
5
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions follow
6
+ [Semantic Versioning](https://semver.org/). The relay has its own
7
+ [changelog](https://github.com/ractive/tab-mcp/blob/main/packages/tab-mcp/CHANGELOG.md).
8
+
9
+ ## [0.17.0][client-0.17.0] - 2026-11-19
10
+
11
+ ### Breaking
12
+
13
+ For relays with one fixed MCP address per app, `https://<relay>/s/<app>/mcp` (the relay
14
+ release after 0.11.0; DEC-196). Relays up to 0.11.0 are not supported, and that relay
15
+ release refuses clients before this one.
16
+
17
+ - **The address names the app, not the tab.** `session.address` is
18
+ `https://<relay>/s/<app>/mcp`, the same for every page of the app and every visitor;
19
+ the pairing code alone says which page an AI app is paired with. Every address from
20
+ before is gone: users add the new one to their AI apps and pair again.
21
+ - **`hello` carries `app: { id, name? }`**, which the relay requires. The `page` field
22
+ is no longer sent, and the `/tab` URL has no `?a=<address id>`.
23
+ - **`newAddress()` no longer changes the address.** It still takes the page back,
24
+ revokes every grant and makes a new secret, and `addressChanged` on its rejection
25
+ still says whether the secret changed. The dialogs call it "Disconnect all apps"
26
+ (was "New address"); every AI app then connects again at the same address with a new
27
+ code. The keys of `ui.strings` are unchanged (`newAddress`, `newAddressNote`,
28
+ `newAddressQuestionOne`, `newAddressQuestionMany`, `newAddressConfirm`,
29
+ `gettingNewAddress`, `newAddressDone`, `closeNote`, `replaced`); their English texts
30
+ changed. A page with its own texts for them should say the same.
31
+ - **`PairingCodeReason` has no `"locked"`.** The relay's codes have no attempts of their
32
+ own any more: `reason` is `start`, `used` or `expired`.
33
+
34
+ ### Added
35
+
36
+ - The option `app`: the app id, the `<app>` of the address. 1 to 32 characters of `a-z`,
37
+ `0-9` and `-`, not starting or ending with `-`; anything else is a `TypeError`.
38
+ Without it the id is made from `server.name`: lower case, letters without their marks,
39
+ each run of other characters as one `-`, at most 32 characters ("Bücher" gives
40
+ `bucher`). A `server.name` that leaves nothing, with `relay` set, is a `TypeError`
41
+ that says to set `app`. A relay may reserve an app id for certain origins; a page of
42
+ another origin that names it is refused (`connect()` rejects with reason `policy`).
43
+ The relay knows a page by its app id and its secret together, so a page that changes
44
+ its app id is a new page to the relay, and its AI apps pair again.
45
+
46
+ ### Changed
47
+
48
+ - The pairing code is 8 letters, shown as the relay sends it: `XXXX-XXXX`.
49
+ - The storage key of the secret is unchanged (`tab-mcp:secret:<relay origin>:<server.name>`
50
+ or `storageKey`).
51
+
52
+ ### Removed
53
+
54
+ - Close code 4009 (`address_mismatch`) is no longer known: relays do not send it.
55
+
56
+ ## [0.16.2][client-0.16.2] - 2026-11-14
57
+
58
+ ### Removed
59
+
60
+ - The copy of an address secret from the key of 0.4 and older
61
+ (`tab-mcp:secret:<relay origin>`, DEC-083): the library reads only
62
+ `tab-mcp:secret:<relay origin>:<server.name>` (or `storageKey`). A visitor whose last
63
+ visit to a page was while the page ran client 0.4 or older gets a new address there
64
+ and pairs their AI apps again; anyone whose page has loaded client 0.5 or later since
65
+ keeps their address. The core is 73 bytes smaller (6143 B gzipped).
66
+
67
+ ## [0.16.1][client-0.16.1] - 2026-11-13
68
+
69
+ ### Fixed
70
+
71
+ - With several `revoke()` calls pending, a refusal by the relay rejects only the one it
72
+ answers: relays from 0.10.2 name the message (`for`) and the grant (`grantId`) in
73
+ their `error`, which the library compares. Before, any `store_unavailable` or
74
+ `unknown_id` rejected every pending `revoke()` and `signOut()`, as it still does with
75
+ older relays.
76
+ - A grant the relay no longer knows (`unknown_id` for a `revoke()` of it: it expired)
77
+ leaves `grants`, with `grantschange`, and its `revoke()` resolves. Before, it stayed
78
+ listed and could not be disconnected. Grants that expire while the page is connected
79
+ leave `grants` too, through relay 0.10.2's `grant.removed` `expired`.
80
+ - In `tools/list`, a consequential tool's description no longer ends with "The page may
81
+ ask the user to allow each call, usually in the page's browser tab." when an
82
+ `onConfirm` answers: the page's, or for the calls of a served port its own. Such a
83
+ question may be anywhere (a side panel, the site's chat). 0.16.0 added the sentence
84
+ for every consequential tool.
85
+
86
+ ### Changed
87
+
88
+ - `revoke()` and `signOut()` reject with a `NetworkError` when the session ends after
89
+ the message was sent and before the relay answered (the relay may have done it), and
90
+ keep the `InvalidStateError` for a page that is not connected (nothing was sent). Both
91
+ were an `InvalidStateError`. Migration: code that checks `name === "InvalidStateError"`
92
+ for a lost session checks `"NetworkError"`.
93
+ - A rejection of `newAddress()` has `addressChanged`: `false` when the old address could
94
+ not be taken back (kept, with its grants), `true` when the address changed and only
95
+ connecting with the new one failed.
96
+ - The WebMCP mirror is a chunk of its own, loaded by a `TabMcp` made with `webmcp: true`
97
+ in a browser with native WebMCP; the core went from 6400 to 6082 B gzipped. Each
98
+ `TabMcp` still reads `document.modelContext` through `Document.prototype`'s getter when
99
+ it is made. The tools are registered natively once the chunk has loaded, a little
100
+ later than before.
101
+ - The README says exactly when `statechange` has a `reason`: on the change from
102
+ `connected`, and when `disconnect()` or `newAddress()` ends connecting or
103
+ reconnecting; not on later reconnect attempts (`reconnecting.reason` has it), a failed
104
+ `connect()` or the `disconnected` after a refusal (the `error` before it says why).
105
+ The behaviour is unchanged.
106
+
107
+ ## [0.16.0][client-0.16.0] - 2026-11-13
108
+
109
+ ### Breaking
110
+
111
+ The API before 1.0 (iteration 38). Each item says what to change.
112
+
113
+ - **`ConnectionState` has `"reconnecting"`, and the `reconnecting` event is gone.** While
114
+ the library connects again by itself, `state` is `reconnecting` (also during an
115
+ attempt, which used to be `connecting`); `statechange` fires for each attempt it
116
+ schedules, and the property `reconnecting` still says which attempt is next and when.
117
+ Migration: replace `addEventListener("reconnecting", …)` with `statechange` and
118
+ `mcp.state === "reconnecting"`; replace `mcp.reconnecting !== undefined` tests of the
119
+ state with `mcp.state === "reconnecting"`. A refusal that stops reconnecting comes as
120
+ `error` (with `state` already `disconnected`) just before the `statechange` to
121
+ `disconnected`, where it came before `reconnecting: null`.
122
+ - **The `connected` and `disconnected` events are gone; `statechange` carries the reason.**
123
+ `statechange` has `{ state, reason? }`: `reason` (a `DisconnectReason`) on the change
124
+ from `connected`, to `disconnected` or, when the connection broke, to `reconnecting`,
125
+ and when `disconnect()` or `newAddress()` ends connecting or reconnecting.
126
+ The close code is not reported any more; `DisconnectDetail` is gone, `StateChangeDetail`
127
+ is new. Migration: `connected` → `statechange` with `state === "connected"` and
128
+ `mcp.session`; `disconnected` → `statechange` with `e.detail.reason !== undefined`
129
+ (for example `reason === "user"` after `disconnect()`).
130
+ - **Every event detail is an object, and `undefined` stands for nothing.**
131
+ `pairingcode` has `{ pairingCode }` (was the code or `null`); `identitychange` has
132
+ `{ identity, identityMessage }` (was `{ state, message? }`). Migration:
133
+ `e.detail?.code` → `e.detail.pairingCode?.code`; `e.detail === null` →
134
+ `e.detail.pairingCode === undefined`; `e.detail.state` → `e.detail.identity`.
135
+ - **`revoke(grantId)` returns a promise** that resolves once the relay removed the grant
136
+ (at once for a grant not in `grants`) and rejects with an `InvalidStateError` while not
137
+ connected, when the session ends first, and with the relay's error when it refuses
138
+ (`code` `store_unavailable` or `unknown_id`), or with a `TimeoutError` when the relay has
139
+ not answered within 15 s. It returned `false` when it could not send. Migration: `mcp.revoke(id).catch(showProblem)` instead of checking the boolean.
140
+ - **`signOut()` returns a promise** that resolves once the relay removed the grants, and
141
+ rejects with an `InvalidStateError` while not connected to a relay that pairs by
142
+ sign-in, with the relay's `store_unavailable`, and with a `TimeoutError` after 15 s;
143
+ `identity` is cleared in any case. It returned whether it was sent.
144
+ Migration: `mcp.signOut().catch(() => {})` in a logout that does not wait.
145
+ - **`refreshIdentity()` resolves with the new `identity`** (`"bound"`, `"refused"` or
146
+ `"none"`) instead of `true`/`false`, and rejects with an `InvalidStateError` while not
147
+ connected and a `TypeError` without `identityAssertion` (it resolved `false`). Migration:
148
+ `(await mcp.refreshIdentity()) === "bound"`.
149
+ - **`newAddress()` resolves with nothing** (`Promise<void>`); it resolved with the new
150
+ session or `undefined`. Migration: read `mcp.session` after it.
151
+ - **`confirmInPage(request, { document })`** takes the document like
152
+ `showConnectDialog`; without it, the global document as before. Nothing to change for
153
+ pages that use the global one.
154
+ - **The options `confirmDelayMs`, `identityTimeoutMs` and `reconnect.delaysMs` are gone**;
155
+ the waits are fixed (750 ms, 15 s, about 5, 10, 20, 40, then 60 s). `reconnect` is a
156
+ boolean; `ReconnectOptions` is gone. Migration: remove them; `reconnect: { … }` becomes
157
+ `reconnect: true` (the default) or `false`.
158
+ - **The properties `address`, `appName` and `pairing` are gone.** Migration:
159
+ `mcp.address` → `mcp.session?.address`; `mcp.appName` → `mcp.session?.appName` (the
160
+ name the relay shows, which is the page's own unless the relay configures one); keep
161
+ your own flag for whether you called `startPairing()`.
162
+ - **"Always allow" is "Allow until reload"**, left of Allow, with the note "X will run for
163
+ <app> without asking, with any arguments, until you reload this page or disconnect
164
+ <app>". The option is still `alwaysAllow`. Migration: tests and guides that look for
165
+ the button's text.
166
+ - **React: `useTool(tool, options?)`**, without `deps`, which only registered the same tool
167
+ again. `connectLabel` is no longer exported, `TabMcpSnapshot` has no `address`, and
168
+ `ConnectButton`'s `data-state` is the state itself. Migration: `useTool(tool, [a], opts)`
169
+ → `useTool(tool, opts)`; `state.address` → `state.session?.address`; a label of your
170
+ own as `children` instead of `connectLabel`.
171
+ - **The setup steps are shorter.** ChatGPT's entry has no note (the Mac app's steps are in
172
+ the guide), and Codex's note no longer explains how to turn the feature off. Migration:
173
+ none for pages; an extension or page that tests the texts of `setupInstructions`
174
+ adjusts them.
175
+ - **The dialogs' chunk is split** into the confirmation and the connect dialog (with a
176
+ shared chunk), so a page without a relay loads no connect dialog. Code that imported the
177
+ UI chunk's internals from a built file (`ui-<hash>.js`) points at `confirm-<hash>.js`
178
+ (`confirmInPage(mcp, request, document, { alwaysAllow, ui })`) instead.
179
+ - **Styling: only the dialog classes and the button kinds are documented** (`.tab-mcp-dialog`,
180
+ `.tab-mcp-connect`, `.tab-mcp-confirm`, `.tab-mcp-replaced`, `.tab-mcp-primary`,
181
+ `.tab-mcp-danger`, `.tab-mcp-copy`); override with two classes. The check mark of a
182
+ connected app is drawn by the stylesheet, not an inline `svg`. A Copy button's name is
183
+ what it shows while it says "Copied" or "Press Ctrl+C", and that is what is announced
184
+ ("Copied", not "Address copied").
185
+ - **`RegisterToolOptions.webmcp` is gone; `callers` replaces it** (iteration 40). `callers`
186
+ lists who sees a tool: `"relay"`, `"local"` (a served port), `"webmcp"`; by default all
187
+ of them, and WebMCP gets a consequential tool only when `"webmcp"` is listed, as with
188
+ `webmcp: true` before. Migration: `{ webmcp: true }` → `{ callers: ["relay", "local",
189
+ "webmcp"] }` (or only the callers that should see it); `{ webmcp: false }` →
190
+ `{ callers: ["relay", "local"] }`; also in React's `useTool(tool, options)`. A
191
+ `callers` that is not a list of those three, and the old `webmcp` option (which would otherwise be ignored, and an ignored `webmcp: false` would put the tool into WebMCP), throw a `TypeError`. `TabMcpOptions.webmcp`
192
+ stays: it turns WebMCP on.
193
+
194
+ ### Added
195
+
196
+ - `ui: { strings }`: every text of the dialogs in one table (`DialogStrings`, keys and
197
+ English texts in `src/strings.ts`), replaceable key by key, with `lang` and `dir`.
198
+ - `ui: { setup: { guide, instructions } }`: the connect dialog's guide link (or none) and
199
+ its steps per AI app.
200
+ - The connect dialog lists the tools that run without asking under each app, with "Ask
201
+ again"; a tool registered again unchanged keeps its entry (React's `useTool`), one whose
202
+ title or description changed is asked again.
203
+ - A Disconnect in the connect dialog that the relay could not save says so ("The relay
204
+ could not save this. Try again.").
205
+ - The React provider disconnects its instance a moment after it unmounts, unless the
206
+ effect ran again: under StrictMode a child's `connect({ resume: true })` is no longer
207
+ cancelled ("The connection was cancelled").
208
+ - The connect dialog names every connected app in its confirmation ("A and B are
209
+ connected"), not only those that paired while it was open.
210
+ - `Tool.outputSchema` (the WebMCP draft of 12 November 2026 has it): an object schema of
211
+ the result, listed in `tools/list` and passed on to WebMCP.
212
+ - `RegisterToolOptions.exposedTo` is passed on to the native WebMCP registration of a
213
+ mirrored tool; it was accepted and ignored.
214
+ - `serve(port, { onConfirm })`: approves the consequential calls of that port in place of
215
+ the page's `onConfirm` and the library's dialog, for example as a question in the
216
+ site's own chat in the user's language; relay and WebMCP calls keep the page's. Same
217
+ answers as `onConfirm`; `request.signal` aborts when the call is cancelled, times out
218
+ or the serve closes. The question is never sent over the port. The README recommends it
219
+ for a site's own assistant instead of answering `true` for `kind === "local"`.
220
+ - `serve(port, { requestTimeoutMs })`: a time limit per request on the page's side, 300 s
221
+ by default as in `createTunnelFetch` (below 2^31 ms; a `subscriptions/listen` stream is
222
+ not limited). On expiry the call is aborted and ends as `cancelled`, a later answer is
223
+ dropped, and the other end gets the JSON-RPC error `-31002`.
224
+ - `RegisterToolOptions.callers` (`ToolCaller[]`): which callers see a tool, `"relay"`,
225
+ `"local"` and `"webmcp"`. `tools/list` and `notifications/tools/list_changed` are per
226
+ caller, and a call of a tool the caller does not see is answered as for an unknown tool.
227
+ - Every result of a tool marked `untrustedContentHint` carries
228
+ `_meta["ch.ractive.tab-mcp/annotations"]: { untrustedContentHint: true }`, through the
229
+ relay and through a port, next to the tool's own `_meta` (MCP has no such hint; in
230
+ `tools/list` it stays `openWorldHint` plus the original in `_meta`).
231
+ - README: a tested backend recipe for a site's own assistant (the MCP SDK's client pinned
232
+ to 2026-07-28 next to an agent framework, the tools as function tools, untrusted results
233
+ delimited), and page context in a read-only tool such as `get_page_context`.
234
+
235
+ ### Changed
236
+
237
+ - WebMCP: a mirrored tool that returns nothing resolves as `"Done."` (the browser cannot
238
+ serialize `undefined`, so the agent saw a failed call); an MCP result goes out as its
239
+ `structuredContent`, else as its text with other blocks (images) named as left out,
240
+ instead of the JSON of the whole result with base64 images.
241
+ - WebMCP: tools marked only with MCP's `destructiveHint` are left out of WebMCP unless
242
+ their `callers` list `"webmcp"`, like `consequentialHint`, and a mirrored one is
243
+ registered natively with `consequentialHint: true`.
244
+ - A call that is cancelled (the AI app gave up, the serve closed, its time ran out) ends
245
+ at once, with `toolcallend` outcome `cancelled`, also when the confirmation (an own
246
+ `onConfirm`) or `execute` does not heed the signal; what they answer later is dropped.
247
+ Before, the call ended only when they settled.
248
+ - WebMCP: each `TabMcp` reads the native `document.modelContext` when it is made (through
249
+ `Document.prototype`'s getter, as before), not when the library loads, so an
250
+ origin-trial token added by a script counts for a `TabMcp` made after it. A failed
251
+ native registration is no longer tried a second time.
252
+ - `registerTool` with an already aborted signal rejects with the signal's reason, as the
253
+ WebMCP draft does; it resolved without registering.
254
+ - `registerTool` rejects with a `TypeError` when a hint (`consequentialHint`,
255
+ `readOnlyHint`, any `…Hint`, `debugging`) or the `webmcp` option is not a boolean. Until
256
+ now such a hint was dropped, so `consequentialHint: "true"` registered a tool that ran
257
+ without asking. Other annotation keys that are not booleans are still ignored.
258
+ - Only an MCP result passes through as one: an object whose `content` is an array of MCP
259
+ content blocks (`type` `text`, `image`, `audio`, `resource_link` or `resource`, with the
260
+ fields that type needs, such as a string `text` or `data` and `mimeType`). Any other
261
+ value with a `content` array (a ProseMirror document, `{ title, content: [...] }`, also
262
+ with an empty `content`) is sent as JSON text with `structuredContent`, like other
263
+ objects. A passed-through
264
+ result keeps its own `_meta`. `structuredContent` is the parsed JSON text, so a `Date`
265
+ or `URL` (whose JSON is a string) has none.
266
+ - The confirmation: one dialog at a time per document; the others wait, and the shown one
267
+ says how many. Each dialog starts its Allow delay when it is shown, and again when
268
+ another dialog of the page closes over it, so the second click of a double click cannot
269
+ approve the next call. When the arguments overflow their box (now up to
270
+ `min(50vh, 24rem)`, `--tab-mcp-arguments-height`), Allow and Allow until reload wait until
271
+ the box has been scrolled to its end, and the dialog says so. Before the delay has run
272
+ out, Enter or Space on a button and Escape are ignored, so typing meant for the page
273
+ cannot refuse a call either. The dialog is described by its question (and short
274
+ arguments) for screen readers; each Disconnect button is named for its app.
275
+ - The dialogs' elements inherit the dialog's colour, buttons reset `width`,
276
+ `text-transform` and `letter-spacing`, and the dialogs set `pointer-events: auto`, so
277
+ a page's `p { color: … }`, a classless framework's buttons or Radix's
278
+ `body { pointer-events: none }` no longer change or block them.
279
+ - `serve` also ends when the port fires `close` (the other end went away), where the
280
+ browser has that event: Bun does; Chrome only with the `MessagePortCloseEvent` Blink
281
+ feature. Elsewhere, close the serve yourself as before.
282
+ - `newAddress()` always takes the old address back first: it connects with the stored
283
+ secret and `hello.revokeAll`, so the relay revokes every grant of the address, whether
284
+ the page was connected or not and whether it was taken over or not. Before, a page
285
+ that was not connected only made a new secret, and the old address kept its grants.
286
+ It rejects, and keeps the old secret, when the address cannot be taken back (relay
287
+ unreachable, taken over again first). A page that never had a secret makes one without
288
+ connecting. A second call while it runs returns the same promise; `connect()` waits
289
+ for it. Relays of 0.4 and older cannot take an address back: `newAddress()` rejects
290
+ there with `reason` `"policy"` (it sent `grants.revokeAll` and waited for every grant).
291
+ - `grants` is empty (with `grantschange`) after `newAddress()`.
292
+ - A refusal that stops reconnecting always emits `error`, also when a `connect()` of the
293
+ page waited on that attempt.
294
+ - Close codes 1001, 1011, 1012 and 1013 (a proxy in front of a restarting relay) mean
295
+ `shutdown`, so the page reconnects. The reconnect waits vary by up to 20 %.
296
+ - `hello` sends an empty page title: the relay never read it.
297
+ - Tabs of a page tell each other which address they claimed, so a tab on another address,
298
+ or one that claimed while this tab was still connecting, no longer makes a takeover
299
+ read as "Opened in another tab".
300
+ - The library no longer answers a relay message it cannot read with `error`.
301
+ - The connect dialog says in plain words why it could not connect or why the page was
302
+ disconnected ("Could not connect. Check your internet connection.", "The session
303
+ ended.", "Not connected." for a call without a user action) and offers "Connect again"
304
+ (`.tab-mcp-retry`); the error itself goes to the console. While the library reconnects
305
+ by itself, it says "Connection lost. Reconnecting…". Before, it showed the relay's
306
+ message after "Could not connect:" and had no way to connect again.
307
+ - With identity binding, the connect dialog shows the address only once the relay
308
+ accepted the page's sign-in, and says otherwise "Checking your sign-in…", "Sign in to
309
+ this page first." or that the sign-in was not accepted, with `identityMessage`.
310
+ - The connect dialog: "How do I add it?" comes right below the address, before the code;
311
+ "New address" moved from beside Copy to the end of the setup
312
+ (`.tab-mcp-new-address-row`), with a line on what it does.
313
+ - The setup steps (`./setup` and the dialog) end with the step that starts the sign-in:
314
+ `/mcp` and Authenticate for Claude Code, `codex mcp login <name>` as the third line of
315
+ Codex's command.
316
+ - A refused Copy says on the button what to do ("Press Ctrl+C", "Press ⌘C" on Apple
317
+ devices, "Selected" on a touch screen) instead of only telling screen readers.
318
+ "Copied" goes back to "Copy" after 2 seconds.
319
+ - While a confirmation is open in a hidden tab, the tab's title starts with "Allow? – ".
320
+ In `tools/list`, the description of a consequential tool ends with "The page may ask
321
+ the user to allow each call, usually in the page's browser tab."
322
+ - The dialogs carry `lang="en"` and `dir="ltr"`, so a screen reader on a page in another
323
+ language reads them with an English voice and a right-to-left page does not mirror
324
+ them.
325
+
326
+ ### Removed
327
+
328
+ - `<html data-tab-mcp-webmcp="…">`: the library no longer lists the tools it mirrors
329
+ into WebMCP on the page's root element. It was made for tab-mcp for Chrome, which has
330
+ not read it since its own review fixes. The library has no replacement for the list: a
331
+ name that could not be registered natively is still reported by a console warning, and
332
+ `toolcall` events with `client.kind === "webmcp"` say that an agent in the browser has
333
+ called a tool, not that the tools are mirrored.
334
+
335
+ ### Fixed
336
+
337
+ - The connect dialog's code row no longer overflows at 320 px: below 30rem, the code's
338
+ Copy goes under the code.
339
+
340
+ - The schema check at registration no longer reads `default`, `examples`, `const` and
341
+ `enum` values or property names as keywords: `examples: [{ pattern: "*.ts" }]` was
342
+ refused as an invalid regular expression. A malformed `%` escape in a `$ref` is a
343
+ `TypeError`, not a `URIError`.
344
+ - A tool result larger than the relay's `maxBodyBytes` is answered as an error result
345
+ that gives both sizes, and `toolcallend` says `error`; before, `toolcallend` said `ok`
346
+ and the AI app got a transport error (`-31006`) for a tool that ran. A result that is
347
+ not JSON now also ends with `toolcallend` `error`.
348
+ - Reconnecting no longer stops for good when a `statechange` listener calls `connect()`
349
+ after a failed attempt.
350
+
351
+ ## [0.15.0][client-0.15.0] - 2026-11-13
352
+
353
+ ### Added
354
+
355
+ - `mcp.serve(port, { client })` serves the page's tools over a message port, without a
356
+ relay: for a site's own assistant, e.g. a chat in an iframe whose backend runs the MCP
357
+ client. The port carries the relay's `http.*` messages as plain objects (a
358
+ `MessagePort` fits, or an object of your own with `postMessage` and `onmessage`). It
359
+ resolves with `{ close() }`, takes a `signal`, and may be called for several ports,
360
+ next to a relay connection and `webmcp: true`. Closing it tells the other end (`bye`). A port is a key to the tools: hand it
361
+ only to a frame whose origin you checked (README, "Your own assistant on the page";
362
+ threat model A15).
363
+ - `@ractive-ch/tab-mcp-client/tunnel`: `createTunnelFetch({ send })` is the other end, a
364
+ `fetch` for an MCP client such as the MCP SDK's
365
+ (`new StreamableHTTPClientTransport(url, { fetch })`). It needs only `Request`,
366
+ `Response` and web streams (Bun, Node, a browser frame) and shares no code with the
367
+ page's library. A timeout (`requestTimeoutMs`, 300 s), a closed tunnel and an invalid
368
+ answer are JSON-RPC errors with the relay's codes (`-31002`, `-31003`, `-31007`) at
369
+ HTTP 200; only an aborted `signal` rejects.
370
+ - `relay` is optional. Without it the page offers its tools only through `serve` and
371
+ WebMCP: `connect()`, `showConnectDialog()` and `newAddress()` reject with a `TypeError`,
372
+ no address secret is read or written, and React's `ConnectButton` renders nothing. New
373
+ getter `mcp.hasRelay`.
374
+ - New types `LocalClient`, `ServeOptions`, `ServeHandle`, `TunnelPort`.
375
+
376
+ ### Changed
377
+
378
+ - `ToolCallClient` has a new member, `{ kind: "local", id, name? }`: the caller of a port
379
+ served with `serve`, as the page named it. Code that switches over every `kind`, or
380
+ treats every caller that is not `"webmcp"` as a relay's AI app (reading `host` or
381
+ `grantId`), needs a case for it. It only occurs in pages that call `serve`. The
382
+ library's confirmation names it "<name> (this site's assistant)" and never offers
383
+ "Always allow" for it.
384
+ - `TabMcpOptions.relay` and the `relay` prop of `TabMcpProvider` are optional in the
385
+ types; `ConnectButton` may return `null`.
386
+
387
+ ## [0.14.0][client-0.14.0] - 2026-11-12
388
+
389
+ ### Added
390
+
391
+ - `onConfirm` may return (or resolve with) `"unanswered"` besides `true` and `false`: the
392
+ user was asked and did not answer, e.g. a question of the page's own that timed out.
393
+ The AI app then reads "The user was asked and did not answer." instead of "The user
394
+ declined", and an agent in the browser (`webmcp: true`) gets `{ error: "The user did not
395
+ answer whether <tool> may run." }`. New type `ConfirmAnswer`. Before, every answer but
396
+ `true` read as a refusal. A throw from `onConfirm` is still a refusal.
397
+
398
+ ### Changed
399
+
400
+ - `ToolCallOutcome` (the `toolcallend` event) has a new member, `unanswered`. Code that
401
+ switches over every outcome needs a case for it.
402
+
403
+ ## [0.13.1][client-0.13.1] - 2026-11-12
404
+
405
+ ### Changed
406
+
407
+ - A WebMCP call (`webmcp: true`) that fails resolves with `{ error: "<message>" }`
408
+ instead of rejecting: invalid arguments, "Don't allow" (`The user did not allow <tool>
409
+ to run.`), a tool that is gone, an error thrown by `execute` and an `isError` result.
410
+ Chrome 156 hands the agent every rejection as a bare `UnknownError`, so it could not
411
+ tell why a call failed or what to change. Two cases still reject: a call the browser
412
+ cancelled (`AbortError`), and a call when the library's lazily loaded part cannot be
413
+ loaded (a new deploy while the page stays open, the network; reloading the page fixes
414
+ it). `toolcallend` and calls through the relay are unchanged (DEC-120).
415
+
416
+ ## [0.13.0][client-0.13.0] - 2026-11-12
417
+
418
+ ### Added
419
+
420
+ - `webmcp: true` (`TabMcpOptions`): the tools are also registered with the browser's own
421
+ WebMCP (`document.modelContext.registerTool()`) where it has it, so that agents in the
422
+ browser (built into it, or an extension) can call them. Off by default. When turned on,
423
+ this changes what the page exposes: any agent in the browser can call the mirrored
424
+ tools, without pairing and without an identity. Consequential tools are left out
425
+ unless registered with `{ webmcp: true }` (`RegisterToolOptions.webmcp`, also the third
426
+ argument of `useTool`); `{ webmcp: false }` keeps a tool out. A WebMCP call gets the
427
+ same argument check, confirmation and `toolcall`/`toolcallend` events as an AI app's,
428
+ never "Always allow". Only the native object is used (through `Document.prototype`'s
429
+ getter, not a polyfill's own `document.modelContext`); a failed native registration
430
+ only warns in the console. `<html data-tab-mcp-webmcp>` lists the mirrored names for
431
+ tab-mcp for Chrome (DEC-115, DEC-119).
432
+
433
+ ### Changed
434
+
435
+ - `client` in `execute`'s options, `ConfirmRequest` and the `toolcall`/`toolcallend`
436
+ events is a union with a `kind`: `RelayClient` (`kind: "relay"`, with `grantId`, `id`,
437
+ `host` and `name` as before) or `WebMcpClient` (`kind: "webmcp"`, nothing more). Code
438
+ that reads `client.host` or `client.name` without checking `client.kind` first no
439
+ longer type-checks; at run time, calls through the relay carry the same fields as
440
+ before plus `kind`.
441
+ - `confirmInPage` treats a client without `kind: "relay"` as a caller in the browser: no
442
+ "Always allow", offered or applied. A page that calls it with a client object it builds
443
+ itself (for example for its own local MCP endpoint) has to add `kind: "relay"` to keep
444
+ "Always allow".
445
+
446
+ ## [0.12.1][client-0.12.1] - 2026-11-11
447
+
448
+ ### Fixed
449
+
450
+ - The npm build no longer carries Bun's chunk preload map. A page that bundles the
451
+ library again (Vite, webpack, Bun) got `<link rel="modulepreload">` requests for the
452
+ library's own chunk names (`./index-<hash>.js`) when the connect dialog loaded; they do
453
+ not exist in the page's build, so each one was a 404 and a console error. The CDN build
454
+ keeps the map: its chunks are served beside it.
455
+
456
+ ## [0.12.0][client-0.12.0] - 2026-11-11
457
+
458
+ ### Added
459
+
460
+ - `@ractive-ch/tab-mcp-client/setup`: `setupInstructions(serverName, address)`, the connect
461
+ dialog's steps per AI app (Claude, ChatGPT, Claude Code, Codex) as data (`id`, `app`,
462
+ `text`, `command`, `note`; types `SetupInstruction`, `SetupNotePart`), and `SETUP_GUIDE`,
463
+ the guide's address, for pages and extensions that show the steps in their own UI. An
464
+ entry of its own, out of the core; tab-mcp for Chrome uses it (DEC-118).
465
+ - `@ractive-ch/tab-mcp-client/visible`: `escapeInvisible(text)`, the escaping the
466
+ confirmation dialog uses for the arguments and the AI app's name, for pages (and tab-mcp
467
+ for Chrome) that ask in their own UI. An entry of its own, not in the core.
468
+
469
+ ### Changed
470
+
471
+ - The confirmation dialog also escapes C0 controls and DEL (but tab and line feed), lone
472
+ surrogates, every space but the plain one (U+00A0, U+2007, U+3000…) and the Braille
473
+ blank (U+2800) in the arguments and the AI app's name.
474
+ - The CDN build bundles `@cfworker/json-schema` 4.1.6 (was 4.1.4); the dependency is
475
+ pinned to it.
476
+
477
+ ## [0.11.0][client-0.11.0] - 2026-11-09
478
+
479
+ ### Added
480
+
481
+ - The connect dialog confirms a connected AI app at the top: a check mark, "Claude
482
+ (claude.ai) is connected" and what to do next, also announced to screen readers. It
483
+ shows the same when it opens while an app is connected. New styling hooks:
484
+ `--tab-mcp-success`, `.tab-mcp-success` (with `.tab-mcp-success-icon`,
485
+ `.tab-mcp-success-title`, `.tab-mcp-success-next`), `.tab-mcp-setup-toggle`,
486
+ `.tab-mcp-setup` and `.tab-mcp-code-used`.
487
+ - `PairingCode.reason` (`start`, `used`, `locked`, `expired`, type `PairingCodeReason`):
488
+ why the relay sent the code, when it says so. A missing or unknown reason is left out.
489
+
490
+ ### Changed
491
+
492
+ - Once an app is connected, the connect dialog's address, code and help are behind
493
+ "Connect another app", closed, and Done is its primary button (also when the dialog
494
+ opens while an app is connected; before, Done showed only after an app paired in it).
495
+ - After a code is entered, the dialog shows "Code used. Waiting for your AI app…" in its
496
+ place for up to 10 seconds instead of the next code, until the app connects. Only when
497
+ the relay says the code was used (see `PairingCode.reason`); codes from older relays
498
+ show at once, as before.
499
+
500
+ ### Fixed
501
+
502
+ - The confirmation shows more characters as `\uXXXX` escapes: controls (C0 and C1 but
503
+ tab and line feed), every space but U+0020 (U+00A0, U+2007, U+3000…), the Braille blank
504
+ U+2800 and lone surrogates, beside the format, default-ignorable (variation selectors,
505
+ U+034F, the Hangul fillers), private-use and unassigned characters it escaped before.
506
+ - The connect dialog no longer flickers when an app connects: it no longer shows the next
507
+ code before the app is connected, nor rebuilds its list of apps (a focused Disconnect
508
+ keeps the focus) or, on a reconnect with the same address, its help.
509
+ - The connect dialog names an app that holds two grants (paired twice) once, in its
510
+ confirmation and in the New address question.
511
+
512
+ ## [0.10.0][client-0.10.0] - 2026-11-01
513
+
514
+ ### Added
515
+
516
+ - `Tool<Input>` types `execute`'s input; `registerTool` and `useTool` infer it or take it
517
+ explicitly. Without it, `input` stays a `Record<string, unknown>`.
518
+ - README: tools that change `useState` state, the user-action rule next to
519
+ `ConnectButton`, its label function, and end-to-end tests with
520
+ `@ractive-ch/tab-mcp/testing`.
521
+
522
+ ### Changed
523
+
524
+ - `ConnectButton`'s default label says "Connection lost, retrying…" once three reconnect
525
+ attempts have failed, instead of "Reconnecting…" for as long as it tries.
526
+
527
+ ### Fixed
528
+
529
+ - The dialogs set `margin: auto`, so they stay centred on pages whose CSS reset sets
530
+ `margin: 0` on every element (Tailwind's preflight).
531
+
532
+ ### Removed
533
+
534
+ - `connecting.md` from the package: the guide's only source is now
535
+ https://ractive.ch/tab-mcp/connect/.
536
+
537
+ ### Changed
538
+
539
+ - The CDN build bundles `@cfworker/json-schema` 4.1.4 (was 4.1.1); the dependency is
540
+ pinned to it.
541
+
542
+ ## [0.9.1][client-0.9.1] - 2026-10-26
543
+
544
+ ### Changed
545
+
546
+ - The connect dialog's "How do I add it?" is a bordered, bold row across the dialog,
547
+ not a line of plain text, so it is easier to find.
548
+ - The help's guide link goes to https://ractive.ch/tab-mcp/connect/, not GitHub. The
549
+ package ships the guide as `connecting.md`.
550
+
551
+ ## [0.9.0][client-0.9.0] - 2026-10-25
552
+
553
+ ### Added
554
+
555
+ - `server.icons` (MCP `Icon`: `src`, `mimeType`, `sizes`, `theme`), sent in
556
+ `serverInfo` for the AI app's connector list (DEC-105). Without it, the page's
557
+ `<link rel="icon">` and `<link rel="apple-touch-icon">` are sent; `[]` sends none.
558
+ At most 8: `http(s):` URLs, or raster `data:` URIs up to 16 KiB (no inline SVG); only
559
+ in `server/discover`. In the connection chunk: the core does not grow.
560
+ - The connect dialog's help links to the new guide
561
+ [connecting an AI app](https://github.com/ractive/tab-mcp/blob/main/docs/connecting.md).
562
+
563
+ ### Changed
564
+
565
+ - The dialog's ChatGPT line: chatgpt.com's Plugins, and the Mac app's MCP servers (which
566
+ are Codex's and need its `mcp_2026_07_28` feature). Developer mode is gone.
567
+
568
+ ## [0.8.0][client-0.8.0] - 2026-10-25
569
+
570
+ ### Changed
571
+
572
+ - **Visible change: "Always allow" is opt-in** (DEC-096). The default confirmation now
573
+ shows only "Don't allow" and "Allow", so every call of a consequential tool asks.
574
+ `alwaysAllow: true` on `TabMcp` (or `TabMcpProvider`) brings "Always allow" back.
575
+ It lifted the only brake at run time for a tool until a reload, which is what a prompt
576
+ injection needs.
577
+ - `replaced` carries `detail: { sibling }` (was `null`): `true` when a tab of the same
578
+ page in this browser said on a `BroadcastChannel` that the relay accepted its session
579
+ for the address, `false` when none did (or without `BroadcastChannel`), which may be a
580
+ program with a copy of the address secret (DEC-095). The channel carries neither the
581
+ secret nor the address. Listeners that ignore the detail work as before.
582
+ - **Order of events when replaced:** the session ends at the relay's `bye`;
583
+ `disconnected` (reason `replaced`) comes at once, and `replaced` after it, up to a
584
+ second later while the library waits to hear from a sibling tab. Before, `replaced`
585
+ came first.
586
+ - `newAddress()` after `replaced` (from the event, during that second, or later) takes
587
+ the address back first: it connects with the old secret and `hello.revokeAll`, so the
588
+ relay revokes the AI apps that talk to whoever took it over in the same step, and
589
+ makes the new address only once the relay confirmed it (no grants left). Taken over
590
+ again before that, it rejects (`reason: "replaced"`), keeps the old secret, and a retry
591
+ takes it back again. Against a relay of 0.4 or older, which ignores the field, it sends
592
+ `grants.revokeAll` and waits until every grant is gone. It no longer needs a fresh user
593
+ action for the reconnect when the page was connected.
594
+ - The tools allowed with "Always allow" are kept in the lazily loaded UI chunk, which
595
+ makes the core smaller.
596
+
597
+ ### Added
598
+
599
+ - The default UI says when the page loses its address, once the page has opened the
600
+ connect dialog: "Opened in another tab" after a sibling tab, otherwise a warning that
601
+ another tab or program took over this page, with "New address" (the dialog
602
+ `.tab-mcp-replaced`). The connect dialog closes then.
603
+ - The WebSocket URL carries the address id: `wss://<relay>/tab?a=<id>`, never the
604
+ secret. The library computes the id from the secret with Web Crypto before it opens
605
+ the socket, so a load balancer in front of several relay instances can route the page
606
+ by it (see self-hosting, "Running several instances"). Where Web Crypto is missing (a
607
+ page on plain `http:` other than localhost) the URL has no id, which a single relay
608
+ accepts. The hashing is in the lazily loaded chunk; the core is unchanged.
609
+ - Close code 4009 (`address_mismatch`: the URL's id is not the secret's) is reported as
610
+ `policy` and not retried.
611
+
612
+ ## [0.7.0][client-0.7.0] - 2026-10-25
613
+
614
+ ### Changed
615
+
616
+ - The default dialogs have a designed look: the title, then the one next step as the
617
+ primary button (Copy the address; Done once an app is connected; "Don't allow" in the
618
+ confirmation), the pairing code large in its own box, the steps per AI app one below
619
+ the other, Disconnect buttons marked, visible
620
+ focus rings, and the arguments wrapped (also long words) and scrolling. The look comes
621
+ from a constructed stylesheet (no CSP exception), uses
622
+ system colours and the page's `color-scheme` (light and dark), fits 360 px, and does
623
+ not animate when the user prefers reduced motion. A new code or "Copied" moves nothing.
624
+ - More custom properties (`--tab-mcp-muted`, `--tab-mcp-surface`, `--tab-mcp-accent`,
625
+ `--tab-mcp-accent-text`, `--tab-mcp-danger`, `--tab-mcp-focus`, `--tab-mcp-shadow`,
626
+ `--tab-mcp-backdrop`, `--tab-mcp-arguments-height`) and class names on the buttons
627
+ (`.tab-mcp-primary`, `.tab-mcp-danger`, `.tab-mcp-deny`, `.tab-mcp-allow`,
628
+ `.tab-mcp-always`, `.tab-mcp-disconnect`, `.tab-mcp-copy`), all listed in the README.
629
+ Each rule has the specificity of one class, and the rules for hover, focus, disabled
630
+ and the primary and danger buttons have one class and two elements. So the page's rules
631
+ for elements, and for an element in a state (`button:hover`, `button:focus`,
632
+ `button:disabled`), do not change those rules. A page rule with two classes
633
+ (`.tab-mcp-dialog .tab-mcp-primary`) does.
634
+ Until now most values were inline styles that only the custom properties could change.
635
+ - The help ("How do I add it?") shows each command as a block with its own Copy, and has
636
+ steps for Codex: `codex features enable mcp_2026_07_28`, which Codex 0.163 needs for the
637
+ relay's MCP revision (for all its MCP servers; `codex features disable mcp_2026_07_28`
638
+ turns it off), then `codex mcp add <name> --url <address>`. The commands for Claude Code
639
+ and Codex name the server by a label made from the page's `server.name` (was always
640
+ `tools`). The label is safe in every shell without quoting: lower case, letters without
641
+ marks, each run of other characters as `-`, no `-` at either end, at most 40 characters,
642
+ `tools` if empty. The help shows commands only for an address made of plain URL
643
+ characters, and plain steps otherwise.
644
+ - The connect dialog says what each Copy did in a polite live region ("Address copied",
645
+ "Code copied", "Claude Code command copied", or "Selected: copy it with Ctrl+C or ⌘C" when
646
+ the clipboard is not available).
647
+ - The pairing code is `2em` by default (was `1.5em`), the default border is the text
648
+ colour at 22 % (was `GrayText`), the default radius `0.75rem` (was `0.5rem`).
649
+
650
+ ## [0.6.0][client-0.6.0] - 2026-10-24
651
+
652
+ ### Fixed
653
+
654
+ - The confirmation's "Allow" and "Always allow" can be clicked only once the page has been
655
+ visible and focused for `confirmDelayMs` with the dialog open. Until now the 750 ms ran
656
+ from when the dialog opened, usually in a tab in the background, so the click that
657
+ brought the tab forward could approve the call. Leaving the page disables both again;
658
+ coming back starts the wait again (DEC-087).
659
+ - The confirmation shows characters that are invisible or change the text direction
660
+ (U+202E, U+2066-2069, zero-width characters, tags, private-use and unassigned code
661
+ points, C1 controls) in the arguments as `\uXXXX` escapes, so an AI app cannot make
662
+ `"evil‮moc.elpmaxe@ecila"` read as another address. The text is still JSON for the
663
+ same arguments, and the tool gets them unchanged. The names of the AI app and the tool
664
+ are isolated left to right (`<bdi dir="ltr">`) (DEC-087).
665
+ - A tool result with a key `invalid` is passed through as a result; it was sent as a
666
+ JSON-RPC error `-32602` while `toolcallend` said `ok`.
667
+ - A schema that passes `registerTool` but that the validator cannot use (a `$ref` next to a
668
+ nested `$id`) no longer makes every call fail with `-32603` and a `toolcall` without its
669
+ `toolcallend`. Once `connect()` has loaded the validator, it compiles each schema at
670
+ registration: `registerTool` rejects such a schema with a `TypeError`, and a tool
671
+ registered before `connect()` with one is unregistered and reported in the event `error`.
672
+ Every `toolcall` now has its `toolcallend` (DEC-086).
673
+ - A consequential tool that is unregistered (or replaced under the same name) while the
674
+ user is asked no longer runs when the user allows it: the AI app gets the error result
675
+ "The tool is no longer available".
676
+ - `showConnectDialog()` while its dialog is open (a double click on the button) opens no
677
+ second dialog; the call resolves when the open one closes. Two dialogs shared one
678
+ pairing, so closing either stopped the code of both. A call for another `document` while
679
+ the dialog is open rejects with an `InvalidStateError`.
680
+ - `confirmDelayMs: NaN` turned the delay off. The constructor now throws a `TypeError` for
681
+ a `confirmDelayMs` or `identityTimeoutMs` that is not a number of milliseconds (finite,
682
+ 0 or more, below 2^31).
683
+ - `identityTimeoutMs` now counts from when `identityAssertion` is asked, so an assertion
684
+ that never comes no longer leaves `identity` at `pending` for good.
685
+
686
+ ### Changed
687
+
688
+ - `grants` (and the `grants` of the event `grantschange`) is a frozen array of frozen
689
+ grants, the same array until the grants change. Pages that changed it in place get a
690
+ `TypeError` in strict mode.
691
+ - The core grows to 5.4 KB gzipped (DEC-086).
692
+
693
+ ## [0.5.1][client-0.5.1] - 2026-10-23
694
+
695
+ ### Fixed
696
+
697
+ - When the relay refuses an attempt the library made by itself while reconnecting (from
698
+ its timer, or the tab coming back to the front), the event `error` now says why, just
699
+ before `reconnecting` turns `null`. Until now the page only saw `null` and could not
700
+ tell a refusal from a stop. An attempt made by the page's own `connect()` still
701
+ rejects its promise and emits no `error`.
702
+
703
+ ## [0.5.0][client-0.5.0] - 2026-10-23
704
+
705
+ ### Changed
706
+
707
+ - The address secret's default storage key is `tab-mcp:secret:<relay origin>:<server.name>`
708
+ instead of `tab-mcp:secret:<relay origin>`, so two pages of one site with different
709
+ server names no longer share an address by accident (the name is URI-encoded in the
710
+ key; renaming `server.name` changes the address). A secret under the old key is copied
711
+ to the new one once, so an existing page keeps its address; on a site with several pages
712
+ the first one to connect keeps it and the others get new addresses. The old key stays,
713
+ for pages still on 0.4 and for a rollback, and a `<old key>#moved` marker records that
714
+ it was taken. An explicit `storageKey` is used as given, without a copy. The core grows
715
+ to 5.1 KB gzipped (DEC-083).
716
+
717
+ ## [0.4.0][client-0.4.0] - 2026-10-23
718
+
719
+ ### Added
720
+
721
+ - Identity binding with relays that pair by `oidc`: the option `identityAssertion`, a
722
+ function that returns a tab assertion from your web app's backend for the signed-in
723
+ user and the page's address (or `null` when nobody is signed in). The library asks it
724
+ after every connect and sends the assertion to the relay. `refreshIdentity()` asks
725
+ again (after a sign-in without a page load), `signOut()` tells the relay the user
726
+ signed out, which ends every AI connection of the page at once. `identity` and the
727
+ event `identitychange` say whether the relay accepted the page's user; only the answer
728
+ to the newest assertion counts, and `identityTimeoutMs` (15 s) ends the wait.
729
+ - `SessionInfo.pairing` (`code` or `oidc`). With `oidc` the connect dialog shows no code
730
+ but "sign in with the account you use on this page".
731
+ - React bindings for single-page apps: `@ractive-ch/tab-mcp-client/react` with
732
+ `TabMcpProvider`, `useTabMcp()`, `useTabMcpState()` (state, address, grants, pairing
733
+ code, identity, reconnecting, tools; renders only on change), `useTool(tool, deps?)`
734
+ (registers while mounted, survives StrictMode, the latest `execute` without registering
735
+ again), `useToolCalls({ limit })` and `ConnectButton`. React 18.3 or 19 is an optional
736
+ peer dependency; the module starts with `"use client"`; not in the CDN build.
737
+ - Reconnecting: after the connection broke (reason `network`, `heartbeat` or `shutdown`)
738
+ the library connects again after 5, 10, 20 and 40 s, then every 60 s, and at once when
739
+ the tab comes back to the front or the network returns. The property and event
740
+ `reconnecting` report it; the option `reconnect` (`false`, or `{ delaysMs }`) changes
741
+ it. A reconnect asks `identityAssertion` again like a fresh connect. An attempt the
742
+ relay refuses (not merely unreachable) stops reconnecting.
743
+ - `identityMessage`: why the relay refused the page's identity, while `identity` is
744
+ `refused`.
745
+ - `confirmInPage(request)`: the library's own confirmation dialog, for an `onConfirm`
746
+ that hands some calls to it.
747
+
748
+ ### Changed
749
+
750
+ - The library now reconnects by itself by default (see above). Pages that reconnected in
751
+ their own `disconnected` listener keep working (the library then does not schedule its
752
+ own attempt) but can drop that code; `reconnect: false` keeps the old behaviour.
753
+
754
+ ## [0.3.0][client-0.3.0] - 2026-10-23
755
+
756
+ ### Added
757
+
758
+ - A Copy button next to the pairing code in the connect dialog, like the address's Copy
759
+ ("Copied" once copied). It copies the code shown at the time, and is back to "Copy"
760
+ when a new code appears. The code is plain, selectable text (one click selects it).
761
+
762
+ ### Changed
763
+
764
+ - The connect dialog has no prominent button under the code until an AI app connects:
765
+ only a small Close at the bottom (and Escape), next to a note that closing stops the
766
+ code while the address stays the same, and that the page can show it again. Once an
767
+ app connects in the dialog, a "Done" button replaces it. Pages and tests that click
768
+ "Close" after pairing should click "Done".
769
+ - The connect dialog opens with the focus on the address's Copy instead of Close. The
770
+ two Copy buttons are labelled "Copy address" and "Copy code" for assistive technology.
771
+
772
+ ## [0.2.0][client-0.2.0] - 2026-10-20
773
+
774
+ ### Added
775
+
776
+ - "Always allow" in the default confirmation. That tool then runs without asking for that
777
+ AI app until the page is reloaded or the app is disconnected. Like "Allow", it stays
778
+ disabled for a moment after the dialog opens. A custom `onConfirm` is asked every time,
779
+ as before.
780
+ - The events `toolcall` and `toolcallend`: every call of a known tool by an AI app as it
781
+ starts (id, tool, arguments, AI app) and as it ends (outcome `ok`, `error`, `declined`
782
+ or `cancelled`, the result, the duration). For an activity log in the page.
783
+
784
+ ## [0.1.0][client-0.1.0] - 2026-10-20
785
+
786
+ The first stable release, on the npm dist-tag `latest`; install without `@alpha`.
787
+
788
+ ### Added
789
+
790
+ - "New address" in the connect dialog. It calls `newAddress()`, which disconnects every
791
+ connected AI app and makes a new address. While apps are connected, the dialog first
792
+ names them and asks.
793
+ - The connect dialog notes that a new pairing code appears every 2 minutes and after each
794
+ use, and announces each newly connected AI app.
795
+
796
+ ### Changed
797
+
798
+ - The default dialog says "AI app" instead of "AI tool": its title is now "Connect your
799
+ AI app". Pages that quote the old wording should follow.
800
+ - `appName` must be 1-64 characters without control characters, as the relay requires
801
+ (before, only the length was checked).
802
+ - README: how to get a relay, pairing, consequential tools and your own UI. Cursor is no
803
+ longer named among the AI apps, because it cannot connect yet.
804
+
805
+ ## [0.1.0-alpha.1][client-0.1.0-alpha.1] - 2026-10-20
806
+
807
+ No changes to the library. Published through the release workflow (trusted publishing)
808
+ to validate it; the release step now reads `npm view` output from npm 11 and 12 alike.
809
+
810
+ ## [0.1.0-alpha.0][client-0.1.0-alpha.0] - 2026-10-19
811
+
812
+ First alpha of the browser library, on the npm dist-tag `alpha`.
813
+
814
+ ### Added
815
+
816
+ - `TabMcp`: register tools WebMCP-style (`registerTool` with JSON Schema input, annotations
817
+ and an abort signal), connect to a tab-mcp relay and answer MCP requests in the page.
818
+ - A small core; `connect()` loads the connection and the dialogs on demand.
819
+ - Default dialogs: "Connect your AI tool" with the address and connected apps, and a
820
+ confirmation for consequential tools.
821
+ - ESM build for bundlers with type declarations, and a self-contained build for
822
+ `<script type="module">` under `@ractive-ch/tab-mcp-client/cdn`.
823
+ - The connect dialog shows the pairing code from the relay.
824
+
825
+ [client-0.17.0]: https://github.com/ractive/tab-mcp/releases/tag/client-v0.17.0
826
+ [client-0.16.2]: https://github.com/ractive/tab-mcp/releases/tag/client-v0.16.2
827
+ [client-0.16.1]: https://github.com/ractive/tab-mcp/releases/tag/client-v0.16.1
828
+ [client-0.16.0]: https://github.com/ractive/tab-mcp/releases/tag/client-v0.16.0
829
+ [client-0.15.0]: https://github.com/ractive/tab-mcp/releases/tag/client-v0.15.0
830
+ [client-0.14.0]: https://github.com/ractive/tab-mcp/releases/tag/client-v0.14.0
831
+ [client-0.13.1]: https://github.com/ractive/tab-mcp/releases/tag/client-v0.13.1
832
+ [client-0.13.0]: https://github.com/ractive/tab-mcp/releases/tag/client-v0.13.0
833
+ [client-0.12.1]: https://github.com/ractive/tab-mcp/releases/tag/client-v0.12.1
834
+ [client-0.12.0]: https://github.com/ractive/tab-mcp/releases/tag/client-v0.12.0
835
+ [client-0.11.0]: https://github.com/ractive/tab-mcp/releases/tag/client-v0.11.0
836
+ [client-0.10.0]: https://github.com/ractive/tab-mcp/releases/tag/client-v0.10.0
837
+ [client-0.9.1]: https://github.com/ractive/tab-mcp/releases/tag/client-v0.9.1
838
+ [client-0.9.0]: https://github.com/ractive/tab-mcp/releases/tag/client-v0.9.0
839
+ [client-0.8.0]: https://github.com/ractive/tab-mcp/releases/tag/client-v0.8.0
840
+ [client-0.7.0]: https://github.com/ractive/tab-mcp/releases/tag/client-v0.7.0
841
+ [client-0.6.0]: https://github.com/ractive/tab-mcp/releases/tag/client-v0.6.0
842
+ [client-0.5.1]: https://github.com/ractive/tab-mcp/releases/tag/client-v0.5.1
843
+ [client-0.5.0]: https://github.com/ractive/tab-mcp/releases/tag/client-v0.5.0
844
+ [client-0.4.0]: https://github.com/ractive/tab-mcp/releases/tag/client-v0.4.0
845
+ [client-0.3.0]: https://github.com/ractive/tab-mcp/releases/tag/client-v0.3.0
846
+ [client-0.2.0]: https://github.com/ractive/tab-mcp/releases/tag/client-v0.2.0
847
+ [client-0.1.0]: https://github.com/ractive/tab-mcp/releases/tag/client-v0.1.0
848
+ [client-0.1.0-alpha.1]: https://github.com/ractive/tab-mcp/releases/tag/client-v0.1.0-alpha.1
849
+ [client-0.1.0-alpha.0]: https://github.com/ractive/tab-mcp/releases/tag/client-v0.1.0-alpha.0