@ractive-ch/tab-mcp-client 0.6.0 → 0.8.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/README.md +153 -14
- package/address.d.ts +14 -0
- package/cdn/connection-ssyf3414.min.js +11 -0
- package/cdn/{connection-nygehv52.min.js.map → connection-ssyf3414.min.js.map} +6 -5
- package/cdn/tab-mcp-client.min.js +3 -3
- package/cdn/tab-mcp-client.min.js.map +5 -6
- package/cdn/ui-m7p94t5t.min.js +72 -0
- package/cdn/ui-m7p94t5t.min.js.map +11 -0
- package/{connection-p94fg1r9.js → connection-xtt891qk.js} +116 -7
- package/{connection-p94fg1r9.js.map → connection-xtt891qk.js.map} +6 -5
- package/connection.d.ts +20 -2
- package/index.d.ts +1 -1
- package/index.js +45 -60
- package/index.js.map +5 -6
- package/internal.d.ts +8 -2
- package/package.json +1 -1
- package/protocol.d.ts +2 -0
- package/tab-mcp.d.ts +7 -3
- package/types.d.ts +29 -2
- package/ui-xkw7g2v2.js +660 -0
- package/ui-xkw7g2v2.js.map +11 -0
- package/ui.d.ts +68 -11
- package/version.d.ts +1 -1
- package/cdn/connection-nygehv52.min.js +0 -11
- package/cdn/ui-yknfss9n.min.js +0 -4
- package/cdn/ui-yknfss9n.min.js.map +0 -10
- package/ui-htav9g19.js +0 -430
- package/ui-htav9g19.js.map +0 -10
package/types.d.ts
CHANGED
|
@@ -107,6 +107,14 @@ export interface TabMcpOptions {
|
|
|
107
107
|
* constructor throws a `TypeError` for anything but a number of ms.
|
|
108
108
|
*/
|
|
109
109
|
confirmDelayMs?: number;
|
|
110
|
+
/**
|
|
111
|
+
* Offer "Always allow" in the default confirmation: it lets a tool run
|
|
112
|
+
* without asking for one AI app until the page is reloaded or the app is
|
|
113
|
+
* disconnected. Off by default (DEC-096): the confirmation then shows only
|
|
114
|
+
* "Don't allow" and "Allow", and every call asks. Turn it on only for
|
|
115
|
+
* tools whose calls the user does not need to check one by one.
|
|
116
|
+
*/
|
|
117
|
+
alwaysAllow?: boolean;
|
|
110
118
|
/**
|
|
111
119
|
* Where the address secret lives; default `localStorage`. `null` keeps it
|
|
112
120
|
* only for the page's lifetime (a new address on every visit).
|
|
@@ -253,6 +261,20 @@ export interface DisconnectDetail {
|
|
|
253
261
|
/** The WebSocket close code. */
|
|
254
262
|
code: number;
|
|
255
263
|
}
|
|
264
|
+
/** The `replaced` event: who took over the page's address. */
|
|
265
|
+
export interface ReplacedDetail {
|
|
266
|
+
/**
|
|
267
|
+
* `true`: a tab of the same page in this browser said, just before, that it
|
|
268
|
+
* took over the address; the usual, harmless cause ("Opened in another
|
|
269
|
+
* tab"). `false`: no such tab was heard (or the browser has no
|
|
270
|
+
* `BroadcastChannel`), so it may be a program with a copy of the address
|
|
271
|
+
* secret, and the AI apps paired with the address now talk to it. Offer
|
|
272
|
+
* `newAddress()`, which takes the address back and disconnects them
|
|
273
|
+
* (DEC-095). Script on the page's origin can make a takeover look like a
|
|
274
|
+
* sibling, so `true` is a hint, not a proof.
|
|
275
|
+
*/
|
|
276
|
+
sibling: boolean;
|
|
277
|
+
}
|
|
256
278
|
/** A tool call from an AI app as it starts (the `toolcall` event). */
|
|
257
279
|
export interface ToolCallStart {
|
|
258
280
|
/** Unique in this page; `toolcallend` carries the same id. */
|
|
@@ -287,8 +309,13 @@ export interface TabMcpEventMap {
|
|
|
287
309
|
}>;
|
|
288
310
|
connected: CustomEvent<SessionInfo>;
|
|
289
311
|
disconnected: CustomEvent<DisconnectDetail>;
|
|
290
|
-
/**
|
|
291
|
-
|
|
312
|
+
/**
|
|
313
|
+
* Another tab, or a program with this page's address secret, took over
|
|
314
|
+
* the address. It follows `disconnected` (reason `replaced`), up to a second
|
|
315
|
+
* later while the library listens for a sibling tab. `sibling` says which it
|
|
316
|
+
* probably was.
|
|
317
|
+
*/
|
|
318
|
+
replaced: CustomEvent<ReplacedDetail>;
|
|
292
319
|
/** Something went wrong outside a pending promise (e.g. a relay error message). */
|
|
293
320
|
error: CustomEvent<{
|
|
294
321
|
error: Error;
|