@ractive-ch/tab-mcp-client 0.18.1 → 0.19.0-rc.2

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 (86) hide show
  1. package/CHANGELOG.md +175 -0
  2. package/README.md +360 -68
  3. package/allowed.d.ts +2 -2
  4. package/allowed.js.map +1 -1
  5. package/always-allowed.d.ts +15 -15
  6. package/cdn/allowed.min.js +2 -2
  7. package/cdn/allowed.min.js.map +2 -2
  8. package/cdn/confirm-ba3dkf9p.min.js +4 -0
  9. package/cdn/confirm-ba3dkf9p.min.js.map +10 -0
  10. package/cdn/connect-my0pbqd7.min.js +6 -0
  11. package/cdn/connect-my0pbqd7.min.js.map +12 -0
  12. package/cdn/connection-yf2x9zz2.min.js +17 -0
  13. package/cdn/{connection-0xqwz17v.min.js.map → connection-yf2x9zz2.min.js.map} +5 -5
  14. package/cdn/strings.min.js +4 -0
  15. package/cdn/strings.min.js.map +9 -0
  16. package/cdn/{tab-mcp-client-2vx9mcww.min.js → tab-mcp-client-8r6h3wza.min.js} +9 -8
  17. package/cdn/tab-mcp-client-8r6h3wza.min.js.map +11 -0
  18. package/cdn/tab-mcp-client-nnxcwrxp.min.js +5 -0
  19. package/cdn/tab-mcp-client-nnxcwrxp.min.js.map +11 -0
  20. package/cdn/{tab-mcp-client-5j3brdf3.min.js → tab-mcp-client-q758jr4g.min.js} +4 -4
  21. package/cdn/tab-mcp-client-q758jr4g.min.js.map +10 -0
  22. package/cdn/tab-mcp-client.min.js +3 -3
  23. package/cdn/tab-mcp-client.min.js.map +4 -4
  24. package/cdn/webmcp-84k58gsw.min.js +4 -0
  25. package/cdn/webmcp-84k58gsw.min.js.map +11 -0
  26. package/{confirm-bqfdrx3f.js → confirm-hymzwx3b.js} +7 -5
  27. package/confirm-hymzwx3b.js.map +10 -0
  28. package/confirm.d.ts +2 -2
  29. package/{connect-ztsgybpq.js → connect-fhtjdmf3.js} +75 -37
  30. package/connect-fhtjdmf3.js.map +10 -0
  31. package/connect.d.ts +7 -6
  32. package/{connection-gang7f5x.js → connection-73fbg99k.js} +70 -8
  33. package/connection-73fbg99k.js.map +16 -0
  34. package/connection.d.ts +23 -2
  35. package/dialog.d.ts +19 -9
  36. package/extension.d.ts +373 -0
  37. package/extension.js +415 -0
  38. package/extension.js.map +10 -0
  39. package/handshake.d.ts +82 -0
  40. package/index-00p8b969.js +221 -0
  41. package/index-00p8b969.js.map +11 -0
  42. package/index-1tssct09.js +58 -0
  43. package/index-1tssct09.js.map +11 -0
  44. package/{index-c1c266tm.js → index-7qqhn3zv.js} +28 -110
  45. package/index-7qqhn3zv.js.map +10 -0
  46. package/index-s31xrfa2.js.map +1 -1
  47. package/index.d.ts +1 -1
  48. package/index.js +59 -64
  49. package/index.js.map +4 -4
  50. package/internal.d.ts +2 -0
  51. package/mcp.d.ts +5 -3
  52. package/package.json +11 -2
  53. package/protocol.d.ts +11 -1
  54. package/react.d.ts +11 -4
  55. package/react.js +57 -10
  56. package/react.js.map +5 -4
  57. package/secret.d.ts +1 -1
  58. package/setup.d.ts +4 -1
  59. package/setup.js +3 -2
  60. package/setup.js.map +1 -1
  61. package/strings.d.ts +149 -28
  62. package/strings.js +13 -0
  63. package/strings.js.map +9 -0
  64. package/tab-mcp.d.ts +30 -7
  65. package/text.d.ts +39 -0
  66. package/types.d.ts +76 -17
  67. package/webmcp-d2ec3v3g.js +221 -0
  68. package/webmcp-d2ec3v3g.js.map +11 -0
  69. package/webmcp.d.ts +17 -4
  70. package/cdn/confirm-d722a9eb.min.js +0 -4
  71. package/cdn/confirm-d722a9eb.min.js.map +0 -10
  72. package/cdn/connect-x6ws6wqt.min.js +0 -6
  73. package/cdn/connect-x6ws6wqt.min.js.map +0 -12
  74. package/cdn/connection-0xqwz17v.min.js +0 -17
  75. package/cdn/tab-mcp-client-2vx9mcww.min.js.map +0 -12
  76. package/cdn/tab-mcp-client-5j3brdf3.min.js.map +0 -10
  77. package/cdn/webmcp-khy4f5rj.min.js +0 -4
  78. package/cdn/webmcp-khy4f5rj.min.js.map +0 -10
  79. package/confirm-bqfdrx3f.js.map +0 -10
  80. package/connect-ztsgybpq.js.map +0 -10
  81. package/connection-gang7f5x.js.map +0 -16
  82. package/index-5jyqehpk.js +0 -63
  83. package/index-5jyqehpk.js.map +0 -11
  84. package/index-c1c266tm.js.map +0 -11
  85. package/webmcp-zq1enyz0.js +0 -57
  86. package/webmcp-zq1enyz0.js.map +0 -10
package/CHANGELOG.md CHANGED
@@ -6,6 +6,180 @@ the Git tag `client-v<version>`. The format follows
6
6
  [Semantic Versioning](https://semver.org/). The relay has its own
7
7
  [changelog](https://github.com/ractive/tab-mcp/blob/main/packages/tab-mcp/CHANGELOG.md).
8
8
 
9
+ ## [0.19.0-rc.2][client-0.19.0-rc.2] - 2026-11-21
10
+
11
+ ### Breaking
12
+
13
+ **`newAddress()` is `disconnectAll()`** (DEC-201): since 0.17 the address names the app
14
+ and never changes; the method disconnects every AI app and makes a new secret, as the
15
+ dialogs' "Disconnect all apps" says. Every name that went with it is renamed, with no
16
+ alias. Search your code for the old names:
17
+
18
+ | Old | New |
19
+ |---|---|
20
+ | `TabMcp.newAddress()` | `TabMcp.disconnectAll()` |
21
+ | `addressChanged` (on a rejection of it) | `secretChanged` |
22
+ | `DisconnectReason` `"new_address"` (`statechange` `reason`) | `"disconnect_all"` |
23
+ | `ui.strings.newAddress` | `ui.strings.disconnectAll` |
24
+ | `ui.strings.newAddressNote` | `ui.strings.disconnectAllNote` |
25
+ | `ui.strings.newAddressQuestionOne`, `ui.strings.newAddressQuestionMany` | `ui.strings.disconnectAllQuestion` (plural forms, see "Changed") |
26
+ | `ui.strings.newAddressConfirm` | `ui.strings.disconnectAllConfirm` |
27
+ | `ui.strings.gettingNewAddress` | `ui.strings.disconnectingAll` |
28
+ | `ui.strings.newAddressDone` | `ui.strings.disconnectAllDone` |
29
+ | CSS class `tab-mcp-new-address` (the dialog's and the takeover notice's button) | `tab-mcp-disconnect-all` |
30
+ | CSS class `tab-mcp-new-address-row` | `tab-mcp-disconnect-all-row` |
31
+ | CSS class `tab-mcp-new-address-question` | `tab-mcp-disconnect-all-question` |
32
+ | CSS class `tab-mcp-new-address-confirm` | `tab-mcp-disconnect-all-confirm` |
33
+
34
+ What the method does is unchanged, and so is the protocol (`hello.revokeAll`,
35
+ `grants.revokeAll`). A page's own texts under an old key are no longer used, as any
36
+ unknown key. The type check does not catch `addressChanged` where it is read behind a
37
+ cast, as from a caught error (`(error as { addressChanged?: unknown })`): search for it
38
+ by name.
39
+
40
+ ### Added
41
+
42
+ - **Translated texts in one step** (DEC-208): `ui.strings` is the one table for every
43
+ text the library shows a person, given once on `TabMcp` (or `<TabMcpProvider>`): the
44
+ dialogs, their setup steps and now also `ConnectButton` of `./react`. Partial tables
45
+ keep English for every missing key. New entry **`@ractive-ch/tab-mcp-client/strings`**
46
+ (and `cdn/strings.min.js`): `STRINGS`, the English table, typed, so a translation
47
+ typed as `DialogStrings` names every key it lacks or misspells in the type check;
48
+ `pickStrings(tables, languages?)`, which loads the page's own table for the user's
49
+ languages (`navigator.languages`: the same tag, else the same script, region or the
50
+ language alone), English when they prefer it or nothing matches, and never rejects (a
51
+ table that does not load gives English, with a warning);
52
+ `withEnglish(strings)`, the full table for a page's own UI; the type `PluralText`.
53
+ `setupInstructions(serverName, address, strings?)` takes the table too. New keys:
54
+ `allowEverythingUntilReloadNote`, `setupClaudeApp`, `setupClaude`, `setupChatGpt`,
55
+ `setupRun`, `setupClaudeCode`, `setupClaudeCodeNote`, `setupCodex`, `setupCodexNote`,
56
+ `buttonReconnecting`, `buttonConnected`. A table with texts but no `lang` counts as
57
+ English and the console says so once. See [Translating](README.md#translating). The
58
+ core grows by 10 bytes gzipped (6270 B). The React entry keeps `ConnectButton`'s few
59
+ English texts inline and does not load the table: what a React page loads first grows
60
+ by about 0.5 KB gzipped (13.2 KB, 13.0 KB before), the entry itself to 3.1 KB.
61
+ - **The page and the tab-mcp browser extension know of each other** (`webmcp: true`,
62
+ DEC-207): a plain handshake over DOM events (`tab-mcp-page`, `tab-mcp-extension`) with
63
+ the extension from its next release.
64
+ - **No second question.** Right before the extension runs a tool that the user
65
+ allowed there (asked, or its "Always allow"), it vouches for that call: the tool,
66
+ the exact arguments and the AI app. The next WebMCP call of that tool with equal
67
+ arguments within 2 seconds runs without the page's question and without
68
+ `onConfirm`; a vouch is used once, and any other call is asked as before. A vouch
69
+ the extension withdraws (its call ended, or never reached the page) is dropped.
70
+ - **`trustExtension: false`** keeps asking every WebMCP call (a site that insists on
71
+ its own question).
72
+ - **`extension` and the event `extensionchange`** (also in the React snapshot): while
73
+ the extension serves the page, `{ name, version, apps, whileInFront }`, with the AI
74
+ apps connected through it (`name`, `host`); `undefined` otherwise.
75
+ - **A vouched call's caller** is `{ kind: "webmcp", via: "tab-mcp-extension", name,
76
+ host }` in `execute`, `toolcall` and `toolcallend` (`WebMcpClient` has the new
77
+ optional fields).
78
+ - The connect dialog says first which AI apps are connected through the extension
79
+ ("… while this tab is in front."), texts `viaExtension` and `viaExtensionInFront`
80
+ (plural forms); the rest stays.
81
+ - The page tells the extension the library's version, the app id and the AI apps
82
+ connected to it directly (at most 64), and marks `<html data-tab-mcp-handshake>`.
83
+ - In the WebMCP mirror's chunk: the core grows by 9 bytes gzipped.
84
+ - **`pairingUntil` and the event `pairinguntil`** (identity binding, DEC-202): until when
85
+ a sign-in pairs the page (an ISO time on the page's clock: the `expiresInMs` of the
86
+ relay's new `pairing.open`, counted from its arrival, so a page clock that differs
87
+ from the relay's does not matter). Also in the React bindings' snapshot. `undefined`
88
+ while pairing is off, from each `startPairing()` until the relay answers, after the
89
+ session ended (`disconnect()`, `disconnectAll()`, a refusal), and with relays up to
90
+ 0.12.1, which do not send it.
91
+ - Dialog texts `signInUntil`, `signInTimeUp` and `continuePairing`.
92
+ - **`@ractive-ch/tab-mcp-client/extension`** (DEC-206): for a browser extension that is a
93
+ tab-mcp page itself, filling in its own pairing code on the relay's pairing page after
94
+ asking its user, as the tab-mcp browser extension does (DEC-203). The content script's
95
+ part (`runPairingPage`), the worker's rules as one state machine (`CodeFiller`: the
96
+ origin check, also after the page's hello and after the answer, one question per page
97
+ load, the one more fill for the same tab and request, what withdraws a question),
98
+ which code to fill in (`takeCode`, `pairingCodes`), the relay's patterns and the
99
+ messages. The extension supplies how its user is asked, its setting, the permission
100
+ prompt and the content script's registration. An entry of its own, out of the core,
101
+ with no `chrome` types; a content script bundles less than 1 KB gzipped of it. See
102
+ [For browser extensions](README.md#for-browser-extensions). In detail:
103
+ - `new CodeFiller(host, { retry: false })` turns the one more fill off: the same
104
+ request's page back after a fill is asked about like any other page, so nothing is
105
+ filled in without a yes of its own. On by default.
106
+ - `takeCode` takes the same code sent again (the relay's answer to `startPairing()`
107
+ while pairing is on) as the next one only if its expiry now leaves `minLeftMs`, so
108
+ "`startPairing()` before `takeCode`" never fills in a code about to change.
109
+ - `code(signal, context)` and `failed(why, context)` get `context: FillContext`,
110
+ `{ tabId, client: { name, host } }`, the page's tab and AI app as `ask` gets them.
111
+ - `release()` is called when no fill needs pairing held any more: the AI app
112
+ connected, or a fill ended without sending its code (withdrawn, the page went, no
113
+ code) and no other fill is under way or waits for the relay's check.
114
+ - `runPairingPage` with a `page` (a test's) marks that page's document as run, not
115
+ the global: two pages in one test are independent.
116
+
117
+ ### Changed
118
+
119
+ - **Texts: English only, plural forms and lists by `Intl`** (DEC-208). The package
120
+ ships English only. The keys that made grammar by hand are gone, with no alias: a
121
+ page's own text under an old key is no longer used, as any unknown key.
122
+
123
+ | Old | New |
124
+ |---|---|
125
+ | `ui.strings.and` | none: lists are joined by `Intl.ListFormat` in the texts' `lang` |
126
+ | `ui.strings.waitingOne`, `waitingMany` | `waiting` |
127
+ | `ui.strings.connectedOne`, `connectedMany` | `connected` |
128
+ | `ui.strings.connectedNextOne`, `connectedNextMany` | `connectedNext` |
129
+ | `ui.strings.disconnectAllQuestionOne`, `disconnectAllQuestionMany` | `disconnectAllQuestion` |
130
+ | `ui.strings.runsWithoutAsking` | none: the switches are headed by `alwaysAllow` ("Always allow"), or `allowUntilReload` when nothing is kept |
131
+ | `ui.strings.dir` (default `"ltr"`) | optional, no default: the direction of `lang` where the browser knows it, else `"ltr"` |
132
+
133
+ The new keys hold one form per plural category of the language
134
+ (`{ one: "…", other: "…" }` in English, chosen by `Intl.PluralRules`), with `{n}` for
135
+ the count.
136
+ - **One wording for one thing** (DEC-208; the glossary is `kb/design/wording.md`), also
137
+ in the texts of the tab-mcp browser extension and the relay:
138
+
139
+ | Key | Was | Now |
140
+ |---|---|---|
141
+ | `allow` | Allow | Allow once |
142
+ | `codeSentence` | When asked, enter the code {code} | When asked, type the code {code} |
143
+ | `codeNote` | A new code appears every 2 minutes and after each use. | The code changes every 2 minutes and after each use. |
144
+ | `connectAnother` | Connect another app | Connect another AI app |
145
+ | `connectedHeading` | Connected | Connected AI apps |
146
+ | `disconnectAllConfirm` | Disconnect all | Disconnect all apps (the button that asked) |
147
+ | `disconnectAllNote`, `disconnectAllQuestion` | … connect again with a new code / and enter a new code | … connect again (with identity binding there is no code) |
148
+ | `disconnectNote` | To disconnect an app, … | To disconnect an AI app, … |
149
+ | `disconnectFailed` | Could not disconnect the app. … | Could not disconnect the AI app. … |
150
+ | `allowEverything`, `allowEverythingApp` | Allow everything, no questions asked (, for {app}) | Always allow everything (for {app}) |
151
+ | `allowEverythingNote` | … and ones that delete or overwrite. | … and ones that delete or overwrite, until you disconnect {app}. |
152
+ | `closeNote` | Closing this stops the code. To connect later, … | Closing this ends the code. To connect an AI app later, … |
153
+ | `replaced` | … now reach that tab … copied what this page keeps to connect … again with a new code. | … now use that tab … copied this page's saved connection … again. |
154
+ | `ConnectButton` | Connection lost, retrying… | Connection lost. Reconnecting… |
155
+
156
+ What an AI app reads: a refused call is "The user did not allow this call." (was "The
157
+ user declined"), and a call cancelled while the user was asked "The call was
158
+ cancelled." (was "The user declined", though the user did nothing).
159
+ - **With identity binding the connect dialog counts for 10 minutes** (DEC-202): the
160
+ relay pairs a sign-in with the page only until 10 minutes after the dialog opened. The
161
+ dialog says until when ("Your AI app can connect until 14:32.") and, once the time is
162
+ up (checked again when the tab comes back to the front), "The time to connect your AI
163
+ app is up. To connect it now, continue." with a Continue button that starts the 10
164
+ minutes again; with an app connected, "Connect another AI app" shows that sentence next
165
+ to Continue. Nothing starts them again by itself: on an `oidc` session a reconnect
166
+ the library makes by itself does not send `pairing.start` again once the user's start
167
+ was sent, answered or not (`pairingUntil` is then the time of the reconnect, so the
168
+ dialog shows Continue). `connect()` from a click while reconnecting ("Connect again")
169
+ does send it, and a session that pairs by code gets it after every reconnect, as
170
+ before. `startPairing()` now sends `pairing.start` on each call while connected, also
171
+ when pairing is on already; call it only when the user acts. With a relay up to
172
+ 0.12.1 the dialog counts as long as it is open, as before, but after a reconnect it
173
+ shows Continue. Libraries up to 0.18.1 send `pairing.start` after every reconnect, so
174
+ for their pages each reconnect starts another 10 minutes: this release is needed for
175
+ the limit to be complete.
176
+ - The takeover notice says "If you did not open this page in another tab or window of
177
+ this browser" (was "in another tab or browser"): a page in another browser has a
178
+ secret of its own and cannot take this one's place.
179
+ - The listeners that make a reconnect try at once when the tab comes back to the front
180
+ or the browser is online again, and the wait for the relay's answer to `revoke()` and
181
+ `signOut()`, are in the lazy chunk, which keeps the core within its size limit.
182
+
9
183
  ## [0.18.1][client-0.18.1] - 2026-11-20
10
184
 
11
185
  ### Fixed
@@ -907,6 +1081,7 @@ First alpha of the browser library, on the npm dist-tag `alpha`.
907
1081
  `<script type="module">` under `@ractive-ch/tab-mcp-client/cdn`.
908
1082
  - The connect dialog shows the pairing code from the relay.
909
1083
 
1084
+ [client-0.19.0-rc.2]: https://github.com/ractive/tab-mcp/releases/tag/client-v0.19.0-rc.2
910
1085
  [client-0.18.1]: https://github.com/ractive/tab-mcp/releases/tag/client-v0.18.1
911
1086
  [client-0.18.0]: https://github.com/ractive/tab-mcp/releases/tag/client-v0.18.0
912
1087
  [client-0.17.0]: https://github.com/ractive/tab-mcp/releases/tag/client-v0.17.0