@ractive-ch/tab-mcp-client 0.15.0 → 0.16.1

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 (59) hide show
  1. package/README.md +481 -148
  2. package/always-allowed.d.ts +25 -6
  3. package/cdn/confirm-y30cx7e1.min.js +4 -0
  4. package/cdn/confirm-y30cx7e1.min.js.map +10 -0
  5. package/cdn/connect-bbhj2y7w.min.js +6 -0
  6. package/cdn/connect-bbhj2y7w.min.js.map +12 -0
  7. package/cdn/connection-w97tf22a.min.js +17 -0
  8. package/cdn/connection-w97tf22a.min.js.map +22 -0
  9. package/cdn/index-vt5zk9me.min.js +91 -0
  10. package/cdn/index-vt5zk9me.min.js.map +13 -0
  11. package/cdn/tab-mcp-client.min.js +3 -3
  12. package/cdn/tab-mcp-client.min.js.map +6 -7
  13. package/cdn/webmcp-khy4f5rj.min.js +4 -0
  14. package/cdn/webmcp-khy4f5rj.min.js.map +10 -0
  15. package/confirm-fgnjgd08.js +263 -0
  16. package/confirm-fgnjgd08.js.map +10 -0
  17. package/confirm.d.ts +54 -0
  18. package/connect-8jpb0k29.js +484 -0
  19. package/connect-8jpb0k29.js.map +10 -0
  20. package/connect.d.ts +40 -0
  21. package/{connection-g6wk37yd.js → connection-g91xjjgm.js} +252 -126
  22. package/connection-g91xjjgm.js.map +16 -0
  23. package/connection.d.ts +7 -4
  24. package/dialog.d.ts +83 -0
  25. package/{index-nmn1j689.js → index-5jyqehpk.js} +14 -10
  26. package/index-5jyqehpk.js.map +11 -0
  27. package/index-jnz7w9xa.js +392 -0
  28. package/index-jnz7w9xa.js.map +12 -0
  29. package/index.d.ts +1 -1
  30. package/index.js +234 -263
  31. package/index.js.map +6 -7
  32. package/internal.d.ts +2 -0
  33. package/mapping.d.ts +37 -4
  34. package/mcp.d.ts +28 -8
  35. package/package.json +1 -1
  36. package/protocol.d.ts +8 -0
  37. package/react.d.ts +8 -10
  38. package/react.js +18 -14
  39. package/react.js.map +3 -3
  40. package/registry.d.ts +12 -5
  41. package/secret.d.ts +5 -2
  42. package/serve.d.ts +26 -4
  43. package/setup.d.ts +15 -25
  44. package/setup.js +1 -1
  45. package/strings.d.ts +107 -0
  46. package/tab-mcp.d.ts +63 -35
  47. package/types.d.ts +146 -68
  48. package/webmcp-zq1enyz0.js +57 -0
  49. package/webmcp-zq1enyz0.js.map +10 -0
  50. package/webmcp.d.ts +13 -24
  51. package/cdn/connection-hgt931xk.min.js +0 -12
  52. package/cdn/connection-hgt931xk.min.js.map +0 -22
  53. package/cdn/ui-2nv84ry7.min.js +0 -86
  54. package/cdn/ui-2nv84ry7.min.js.map +0 -14
  55. package/connection-g6wk37yd.js.map +0 -16
  56. package/index-nmn1j689.js.map +0 -11
  57. package/ui-04mwfxm9.js +0 -783
  58. package/ui-04mwfxm9.js.map +0 -11
  59. package/ui.d.ts +0 -83
@@ -0,0 +1,392 @@
1
+ import {
2
+ escapeInvisible2
3
+ } from "./index-dmh5vm5m.js";
4
+
5
+ // src/always-allowed.ts
6
+ var seen = (tool) => JSON.stringify([tool.title, tool.description]);
7
+
8
+ class AlwaysAllowed {
9
+ #tools = new Map;
10
+ #listeners = new Set;
11
+ has(grantId, tool) {
12
+ const tools = this.#tools.get(grantId);
13
+ const allowed = tools?.get(tool.name)?.seen;
14
+ if (allowed === undefined || allowed === seen(tool)) {
15
+ return allowed !== undefined;
16
+ }
17
+ tools?.delete(tool.name);
18
+ this.#changed();
19
+ return false;
20
+ }
21
+ add(grantId, tool) {
22
+ const tools = this.#tools.get(grantId) ?? new Map;
23
+ tools.set(tool.name, { seen: seen(tool), label: tool.title ?? tool.name });
24
+ this.#tools.set(grantId, tools);
25
+ this.#changed();
26
+ }
27
+ list(grantId) {
28
+ return [...this.#tools.get(grantId)?.values() ?? []].map((t) => t.label);
29
+ }
30
+ forget(grantId) {
31
+ if (this.#tools.delete(grantId))
32
+ this.#changed();
33
+ }
34
+ keepGrants(grantIds) {
35
+ const keep = new Set(grantIds);
36
+ for (const grantId of this.#tools.keys())
37
+ if (!keep.has(grantId))
38
+ this.forget(grantId);
39
+ }
40
+ keepTools(names) {
41
+ const keep = new Set(names);
42
+ let changed = false;
43
+ for (const tools of this.#tools.values()) {
44
+ for (const tool of tools.keys()) {
45
+ if (keep.has(tool))
46
+ continue;
47
+ tools.delete(tool);
48
+ changed = true;
49
+ }
50
+ }
51
+ if (changed)
52
+ this.#changed();
53
+ }
54
+ onChange(listener) {
55
+ this.#listeners.add(listener);
56
+ return () => this.#listeners.delete(listener);
57
+ }
58
+ #changed() {
59
+ for (const listener of [...this.#listeners])
60
+ listener();
61
+ }
62
+ }
63
+ var allowed = new WeakMap;
64
+ function allowedFor(mcp) {
65
+ const kept = allowed.get(mcp);
66
+ if (kept !== undefined)
67
+ return kept;
68
+ const made = new AlwaysAllowed;
69
+ mcp.addEventListener("grantschange", (e) => made.keepGrants(e.detail.grants.map((g) => g.grantId)));
70
+ let tools;
71
+ mcp.addEventListener("toolschange", (e) => {
72
+ if (tools === undefined)
73
+ queueMicrotask(() => {
74
+ if (tools !== undefined)
75
+ made.keepTools(tools);
76
+ tools = undefined;
77
+ });
78
+ tools = e.detail.tools;
79
+ });
80
+ allowed.set(mcp, made);
81
+ return made;
82
+ }
83
+
84
+ // src/strings.ts
85
+ var STRINGS = {
86
+ lang: "en",
87
+ dir: "ltr",
88
+ and: "and",
89
+ confirmTitle: "Allow {tool}?",
90
+ confirmWho: "{client} wants to run {tool}.",
91
+ deny: "Don't allow",
92
+ allow: "Allow",
93
+ allowUntilReload: "Allow until reload",
94
+ allowUntilReloadNote: "Allow until reload: {tool} will run for {client} without asking, with any arguments, until you reload this page or disconnect {client}.",
95
+ argumentsHidden: "The arguments cannot be shown, so this call cannot be allowed.",
96
+ scrollToAllow: "Scroll to the end of the arguments to allow this call.",
97
+ waitingOne: "1 more call is waiting after this one.",
98
+ waitingMany: "{n} more calls are waiting after this one.",
99
+ titlePrefix: "Allow? – ",
100
+ clientWebMcp: "An agent in this browser",
101
+ clientLocal: "{name} (this site's assistant)",
102
+ clientRelay: "{name} ({host})",
103
+ copy: "Copy",
104
+ copied: "Copied",
105
+ pressMac: "Press ⌘C",
106
+ pressOther: "Press Ctrl+C",
107
+ selected: "Selected",
108
+ copyAddress: "Copy address",
109
+ copyCode: "Copy code",
110
+ copyCommand: "Copy {app} command",
111
+ connectTitle: "Connect your AI app",
112
+ connecting: "Connecting…",
113
+ connectAgain: "Connect again",
114
+ reconnecting: "Connection lost. Reconnecting…",
115
+ notConnected: "Not connected.",
116
+ unreachable: "Could not connect. Check your internet connection.",
117
+ rateLimited: "Too many attempts. Wait a minute, then connect again.",
118
+ refused: "The connection was refused.",
119
+ ended: "The session ended.",
120
+ lost: "The connection was lost.",
121
+ closed: "The connection was closed.",
122
+ disconnected: "Disconnected.",
123
+ checkingSignIn: "Checking your sign-in…",
124
+ signInFirst: "Sign in to this page first.",
125
+ signInRefused: "Your sign-in on this page was not accepted.",
126
+ signInRefusedWhy: "Your sign-in on this page was not accepted ({reason}).",
127
+ readyApp: "{app} is ready for your AI app.",
128
+ readyPage: "This page is ready for your AI app.",
129
+ addressLabel: "Add this address to your AI app:",
130
+ help: "How do I add it?",
131
+ guide: "Step by step, and what to do when it fails",
132
+ codeSentence: "When asked, enter the code {code}",
133
+ codeNote: "A new code appears every 2 minutes and after each use.",
134
+ codeUsed: "Code used. Waiting for your AI app…",
135
+ signIn: "When your AI app asks, sign in with the account you use on this page. No code is needed.",
136
+ newAddress: "New address",
137
+ newAddressNote: "Someone else may have this address, or is guessing codes? A new address disconnects every AI app from this one.",
138
+ newAddressQuestionOne: "A new address disconnects {apps}. To use this page again, add the new address to it.",
139
+ newAddressQuestionMany: "A new address disconnects {apps}. To use this page again, add the new address to them.",
140
+ newAddressConfirm: "Disconnect and get new address",
141
+ cancel: "Cancel",
142
+ gettingNewAddress: "Getting a new address…",
143
+ newAddressDone: "This is a new address. Add it to your AI app again.",
144
+ connectedOne: "{apps} is connected",
145
+ connectedMany: "{apps} are connected",
146
+ connectedNextOne: "You can close this now and ask it to use the tools of this page.",
147
+ connectedNextMany: "You can close this now and ask them to use the tools of this page.",
148
+ connectAnother: "Connect another app",
149
+ connectedHeading: "Connected",
150
+ appConnected: "{app} connected",
151
+ disconnect: "Disconnect",
152
+ disconnectApp: "Disconnect {app}",
153
+ disconnectNote: "To disconnect an app, connect this page again first.",
154
+ storeUnavailable: "The relay could not save this. Try again.",
155
+ disconnectFailed: "Could not disconnect the app. Try again.",
156
+ runsWithoutAsking: "Runs without asking: {tools}",
157
+ askAgain: "Ask again",
158
+ askAgainApp: "Ask again before {app} runs a tool",
159
+ closeNote: "Closing this stops the code. The address stays the same: to connect later, open this again from the page.",
160
+ close: "Close",
161
+ done: "Done",
162
+ replacedSiblingTitle: "Opened in another tab",
163
+ replacedSibling: "This page is open in another tab, and your AI apps now use that one. To use them here, connect this page again.",
164
+ replacedTitle: "Another tab or program took over this page",
165
+ replaced: "Your AI apps now reach that tab or program instead of this page. If you did not open this page in another tab or browser, someone may have copied its address. A new address disconnects every AI app from the old one; then add the new address to your AI apps again.",
166
+ takenOverAgain: "It was taken over again before its AI apps were disconnected. Try again.",
167
+ tryAgainOrClose: "{reason} Try again, or close this."
168
+ };
169
+
170
+ // src/dialog.ts
171
+ var counter = 0;
172
+ function nextId() {
173
+ return `tab-mcp-${++counter}`;
174
+ }
175
+ function stringsOf(options) {
176
+ const s = { ...STRINGS };
177
+ for (const [key, value] of Object.entries(options?.strings ?? {}))
178
+ if (typeof value === "string" && key in s)
179
+ s[key] = value;
180
+ return s;
181
+ }
182
+ function format(template, values) {
183
+ return template.replace(/\{(\w+)\}/g, (all, key) => values[key] ?? all);
184
+ }
185
+ function fill(doc, template, values) {
186
+ return template.split(/\{(\w+)\}/).map((part, i) => {
187
+ if (i % 2 === 0)
188
+ return part;
189
+ const value = values[part];
190
+ if (value === undefined)
191
+ return `{${part}}`;
192
+ return typeof value === "string" ? name(doc, value) : value;
193
+ });
194
+ }
195
+ function el(doc, tag, props = {}, ...children) {
196
+ const node = doc.createElement(tag);
197
+ if (props.className !== undefined)
198
+ node.className = props.className;
199
+ if (props.id !== undefined)
200
+ node.id = props.id;
201
+ if (props.text !== undefined)
202
+ node.textContent = props.text;
203
+ node.append(...children);
204
+ return node;
205
+ }
206
+ function button(doc, text, onClick, className, kind) {
207
+ const node = el(doc, "button", { text });
208
+ node.type = "button";
209
+ if (className !== undefined)
210
+ node.classList.add(className);
211
+ if (kind !== undefined)
212
+ node.classList.add(`tab-mcp-${kind}`);
213
+ node.addEventListener("click", onClick);
214
+ return node;
215
+ }
216
+ function name(doc, text) {
217
+ const node = el(doc, "bdi", { text });
218
+ node.dir = "ltr";
219
+ return node;
220
+ }
221
+ var visible = escapeInvisible2;
222
+ function clientLabel(client, s) {
223
+ if ("kind" in client && client.kind === "webmcp")
224
+ return s.clientWebMcp;
225
+ if ("kind" in client && client.kind === "local")
226
+ return format(s.clientLocal, { name: visible(client.name ?? client.id) });
227
+ const host = visible(client.host || client.id);
228
+ return client.name !== undefined && client.name !== "" ? format(s.clientRelay, { name: visible(client.name), host }) : host;
229
+ }
230
+ function listOf(items, s) {
231
+ return items.length < 2 ? items[0] ?? "" : `${items.slice(0, -1).join(", ")} ${s.and} ${items.at(-1)}`;
232
+ }
233
+ var DIALOG_CSS = `.tab-mcp-dialog {
234
+ --_tab-mcp-fg: var(--tab-mcp-color, CanvasText);
235
+ --_tab-mcp-bg: var(--tab-mcp-background, Canvas);
236
+ --_tab-mcp-muted: var(--tab-mcp-muted, color-mix(in srgb, var(--_tab-mcp-fg) 72%, transparent));
237
+ --_tab-mcp-line: color-mix(in srgb, var(--_tab-mcp-fg) 22%, transparent);
238
+ --_tab-mcp-surface: var(--tab-mcp-surface, color-mix(in srgb, var(--_tab-mcp-fg) 6%, transparent));
239
+ --_tab-mcp-danger: var(--tab-mcp-danger, light-dark(#b3261e, #ffb4ab));
240
+ --_tab-mcp-success: var(--tab-mcp-success, light-dark(#1a7f37, #6fdd8b));
241
+ --_tab-mcp-mono: var(--tab-mcp-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
242
+ --_tab-mcp-small-radius: calc(var(--tab-mcp-radius, 0.75rem) * 0.6);
243
+ box-sizing: border-box; margin: auto; width: calc(100% - 2rem); max-width: var(--tab-mcp-max-width, 34rem); max-height: calc(100% - 2rem); overflow: auto;
244
+ font: var(--tab-mcp-font, inherit); line-height: 1.5; color: var(--_tab-mcp-fg); background: var(--_tab-mcp-bg);
245
+ border: var(--tab-mcp-border, 1px solid var(--_tab-mcp-line)); border-radius: var(--tab-mcp-radius, 0.75rem);
246
+ padding: var(--tab-mcp-padding, clamp(1rem, 5vw, 1.5rem)); box-shadow: var(--tab-mcp-shadow, 0 1rem 3rem rgb(0 0 0 / 0.3));
247
+ pointer-events: auto;
248
+ }
249
+ .tab-mcp-dialog::backdrop { background: var(--tab-mcp-backdrop, rgb(0 0 0 / 0.4)); }
250
+ .tab-mcp-dialog:where([open]) { display: flex; flex-direction: column; gap: 1rem; }
251
+ .tab-mcp-dialog:where([open]) > * { flex-shrink: 0; }
252
+ .tab-mcp-dialog :where([hidden]) { display: none !important; }
253
+ html dialog.tab-mcp-dialog:where(:focus) { outline: none; }
254
+ .tab-mcp-dialog :where(*) { box-sizing: border-box; color: inherit; }
255
+ .tab-mcp-dialog :where(h2, h3, p, ul, li, pre) { margin: 0; }
256
+ .tab-mcp-dialog :where(h2) { font-size: var(--tab-mcp-title-size, 1.25em); line-height: 1.3; font-weight: 600; overflow-wrap: anywhere; }
257
+ .tab-mcp-dialog :where(h3) { font-size: 0.875em; font-weight: 600; color: var(--_tab-mcp-muted); margin-bottom: 0.5rem; }
258
+ .tab-mcp-dialog :where(small) { font-size: 0.875em; }
259
+ .tab-mcp-dialog :where(small, .tab-mcp-status, .tab-mcp-description, .tab-mcp-always-note, .tab-mcp-apps-note, .tab-mcp-success-next, .tab-mcp-waiting, .tab-mcp-scroll-note, .tab-mcp-allowed) { color: var(--_tab-mcp-muted); }
260
+ html dialog.tab-mcp-dialog :where(:focus-visible) { outline: 2px solid var(--tab-mcp-focus, var(--_tab-mcp-fg)); outline-offset: 2px; }
261
+ .tab-mcp-dialog :where(button) { font: inherit; font-size: 0.9375em; line-height: 1.25; text-transform: none; letter-spacing: normal; width: auto; min-height: 2.5rem; padding: 0.5rem 1rem; margin: 0; border: 1px solid color-mix(in srgb, currentColor 35%, transparent); border-radius: var(--_tab-mcp-small-radius); background: transparent; color: inherit; cursor: pointer; }
262
+ html dialog.tab-mcp-dialog :where(button:hover:not(:disabled)) { color: inherit; background: color-mix(in srgb, currentColor 8%, transparent); }
263
+ html dialog.tab-mcp-dialog :where(button:disabled) { opacity: 0.45; cursor: not-allowed; }
264
+ html button.tab-mcp-primary { background: var(--tab-mcp-accent, var(--_tab-mcp-fg)); color: var(--tab-mcp-accent-text, var(--_tab-mcp-bg)); border-color: transparent; font-weight: 600; }
265
+ html button.tab-mcp-primary:where(:hover:not(:disabled)) { background: var(--tab-mcp-accent, var(--_tab-mcp-fg)); opacity: 0.85; }
266
+ html button.tab-mcp-danger { color: var(--_tab-mcp-danger); border-color: color-mix(in srgb, currentColor 45%, transparent); }
267
+ .tab-mcp-copy { min-width: 6em; }
268
+ .tab-mcp-close { font-size: 0.875em; }
269
+ .tab-mcp-status { margin-top: -0.5rem; }
270
+ .tab-mcp-description:where(:empty) { display: none; }
271
+ .tab-mcp-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.5rem; }
272
+ .tab-mcp-address { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
273
+ .tab-mcp-address :where(label) { flex-basis: 100%; font-weight: 600; }
274
+ .tab-mcp-address :where(input) { flex: 1 1 12rem; min-width: 0; min-height: 2.5rem; margin: 0; padding: 0.5rem 0.625rem; font: 0.875em var(--_tab-mcp-mono); text-overflow: ellipsis; color: inherit; background: var(--_tab-mcp-surface); border: 1px solid var(--_tab-mcp-line); border-radius: var(--_tab-mcp-small-radius); }
275
+ .tab-mcp-code { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 0.25rem 1rem; padding: 1rem; background: var(--_tab-mcp-surface); border-radius: var(--_tab-mcp-small-radius); }
276
+ .tab-mcp-code > :where(span) { font-weight: 600; }
277
+ .tab-mcp-code :where(br) { display: none; }
278
+ .tab-mcp-code :where(small) { grid-column: 1 / -1; }
279
+ .tab-mcp-code-value { display: block; font: 700 var(--tab-mcp-code-size, 2em) / 1.2 var(--_tab-mcp-mono); letter-spacing: 0.12em; font-variant-numeric: tabular-nums; }
280
+ .tab-mcp-help { border: 1px solid var(--_tab-mcp-line); border-radius: var(--_tab-mcp-small-radius); }
281
+ .tab-mcp-help :where(summary) { padding: 0.75rem 1rem; font-weight: 600; cursor: pointer; }
282
+ .tab-mcp-help > :where(:not(summary)) { margin-inline: 1rem; }
283
+ .tab-mcp-help > :where(:last-child:not(summary)) { margin-bottom: 1rem; }
284
+ .tab-mcp-dialog :where(.tab-mcp-help ul, .tab-mcp-apps ul) { list-style: none; padding: 0; display: grid; gap: 0.5rem; }
285
+ .tab-mcp-help :where(ul) { margin-top: 0.25rem; margin-bottom: 0.75rem; gap: 0.75rem; }
286
+ .tab-mcp-help :where(li) { overflow-wrap: anywhere; }
287
+ .tab-mcp-help :where(strong) { display: block; font-weight: 600; }
288
+ .tab-mcp-command { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: flex-start; gap: 0.5rem; margin-top: 0.375rem; }
289
+ .tab-mcp-command > :where(pre) { flex: 1 1 16rem; min-width: 0; margin: 0; padding: 0.5rem 0.625rem; font: 0.8125em / 1.5 var(--_tab-mcp-mono); white-space: pre-wrap; word-break: break-all; background: var(--_tab-mcp-surface); border: 1px solid var(--_tab-mcp-line); border-radius: var(--_tab-mcp-small-radius); }
290
+ .tab-mcp-command-note { display: block; margin-top: 0.375rem; }
291
+ .tab-mcp-help :where(code) { font: 0.875em var(--_tab-mcp-mono); padding: 0.125em 0.375em; background: var(--_tab-mcp-surface); border-radius: 0.25rem; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
292
+ .tab-mcp-apps :where(li) { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 0.75rem; padding: 0.5rem 0.5rem 0.5rem 0.75rem; border: 1px solid var(--_tab-mcp-line); border-radius: var(--_tab-mcp-small-radius); }
293
+ .tab-mcp-app { flex: 1 1 10rem; min-width: 0; overflow-wrap: anywhere; }
294
+ .tab-mcp-allowed { display: flex; flex-basis: 100%; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 0.875em; overflow-wrap: anywhere; }
295
+ .tab-mcp-apps-note { margin-top: 0.5rem; }
296
+ .tab-mcp-success { display: flex; align-items: center; gap: 0.875rem; padding: 1rem; background: color-mix(in srgb, var(--_tab-mcp-success) 10%, transparent); border: 1px solid color-mix(in srgb, var(--_tab-mcp-success) 45%, transparent); border-radius: var(--_tab-mcp-small-radius); }
297
+ .tab-mcp-success-icon { flex: none; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; font-size: 1.5em; font-weight: 700; line-height: 1; color: var(--_tab-mcp-success); background: color-mix(in srgb, var(--_tab-mcp-success) 16%, transparent); }
298
+ .tab-mcp-success-icon::before { content: "\\2713"; }
299
+ .tab-mcp-success-text { display: grid; gap: 0.125rem; min-width: 0; }
300
+ .tab-mcp-success-title { font-size: 1.125em; line-height: 1.3; font-weight: 600; overflow-wrap: anywhere; }
301
+ .tab-mcp-setup { display: flex; flex-direction: column; gap: 1rem; }
302
+ .tab-mcp-setup-toggle { display: flex; align-items: center; gap: 0.75rem; width: 100%; padding: 0.75rem 1rem; text-align: start; font-weight: 600; border-color: var(--_tab-mcp-line); }
303
+ .tab-mcp-setup-toggle::before { content: ""; flex: none; width: 0.45em; height: 0.45em; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateX(-0.1em) rotate(-45deg); }
304
+ .tab-mcp-setup-toggle:where([aria-expanded="true"])::before { transform: translateY(-0.15em) rotate(45deg); }
305
+ .tab-mcp-code-used { display: flex; align-items: center; min-height: calc(var(--tab-mcp-code-size, 2em) * 1.2); }
306
+ .tab-mcp-new-address-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; }
307
+ .tab-mcp-new-address-row > :where(small) { flex: 1 1 14rem; color: var(--_tab-mcp-muted); }
308
+ .tab-mcp-new-address-question { display: grid; gap: 0.75rem; padding: 1rem; border: 1px solid color-mix(in srgb, var(--_tab-mcp-danger) 50%, transparent); border-radius: var(--_tab-mcp-small-radius); }
309
+ .tab-mcp-connect > :where(.tab-mcp-actions) { gap: 0.75rem; padding-top: 1rem; border-top: 1px solid var(--_tab-mcp-line); }
310
+ .tab-mcp-close-note { flex: 1 1 12rem; }
311
+ .tab-mcp-confirm :where(p bdi) { font-weight: 600; }
312
+ .tab-mcp-arguments { box-sizing: content-box; font: 0.875em / 1.45 var(--_tab-mcp-mono); padding: 0.75rem; background: var(--_tab-mcp-surface); border: 1px solid var(--_tab-mcp-line); border-radius: var(--_tab-mcp-small-radius); }
313
+ .tab-mcp-always-note, .tab-mcp-waiting, .tab-mcp-scroll-note { font-size: 0.875em; }
314
+ @media (max-width: 30rem) { .tab-mcp-actions > :where(button) { flex: 1 1 auto; } .tab-mcp-connect > :where(.tab-mcp-actions) > :where(button) { flex: 0 0 auto; } .tab-mcp-code { grid-template-columns: minmax(0, 1fr); } .tab-mcp-code > :where(button) { justify-self: start; } }
315
+ @media (prefers-reduced-motion: no-preference) { .tab-mcp-dialog:where([open]) { animation: tab-mcp-in 0.15s ease-out; } .tab-mcp-success-icon { animation: tab-mcp-pop 0.4s cubic-bezier(0.3, 1.4, 0.6, 1); } }
316
+ @media (forced-colors: active) { html button.tab-mcp-primary { border-color: ButtonText; } }
317
+ @keyframes tab-mcp-in { from { opacity: 0; transform: translateY(0.5rem); } }
318
+ @keyframes tab-mcp-pop { from { opacity: 0; transform: scale(0.4); } }
319
+ `;
320
+ var sheets = new WeakMap;
321
+ function adoptStyles(doc) {
322
+ try {
323
+ let sheet = sheets.get(doc);
324
+ if (sheet === undefined) {
325
+ const Sheet = doc.defaultView?.CSSStyleSheet;
326
+ if (Sheet === undefined || !Array.isArray(doc.adoptedStyleSheets))
327
+ return;
328
+ sheet = new Sheet;
329
+ sheet.replaceSync(DIALOG_CSS);
330
+ sheets.set(doc, sheet);
331
+ }
332
+ if (!doc.adoptedStyleSheets.includes(sheet))
333
+ doc.adoptedStyleSheets = [...doc.adoptedStyleSheets, sheet];
334
+ } catch {}
335
+ }
336
+ function newDialog(doc, className, s, ...title) {
337
+ const id = nextId();
338
+ const dialog = el(doc, "dialog", {
339
+ className: `tab-mcp-dialog ${className}`
340
+ });
341
+ dialog.setAttribute("aria-labelledby", `${id}-title`);
342
+ dialog.lang = s.lang;
343
+ dialog.dir = s.dir;
344
+ adoptStyles(doc);
345
+ const heading = el(doc, "h2", { id: `${id}-title` }, ...title);
346
+ dialog.append(heading);
347
+ return { dialog, heading, id };
348
+ }
349
+ var COPIED_MS = 2000;
350
+ var SELECTED_MS = 8000;
351
+ function pressToCopy(doc, s) {
352
+ const view = doc.defaultView;
353
+ if (view?.matchMedia?.("(pointer: coarse)").matches === true)
354
+ return s.selected;
355
+ const platform = view?.navigator.platform ?? "";
356
+ return /^(Mac|iP)/.test(platform) ? s.pressMac : s.pressOther;
357
+ }
358
+ function copyButton(doc, s, label, value, select, announce, className, kind) {
359
+ let timer;
360
+ const say = (text, ms) => {
361
+ node.textContent = text;
362
+ node.removeAttribute("aria-label");
363
+ announce(text);
364
+ clearTimeout(timer);
365
+ timer = setTimeout(reset, ms);
366
+ };
367
+ const node = button(doc, s.copy, () => {
368
+ const clipboard = doc.defaultView?.navigator?.clipboard;
369
+ const selected = () => {
370
+ select();
371
+ say(pressToCopy(doc, s), SELECTED_MS);
372
+ };
373
+ if (clipboard !== undefined)
374
+ clipboard.writeText(value()).then(() => say(s.copied, COPIED_MS), selected);
375
+ else
376
+ selected();
377
+ }, className, kind);
378
+ node.classList.add("tab-mcp-copy");
379
+ const reset = () => {
380
+ clearTimeout(timer);
381
+ timer = undefined;
382
+ node.textContent = s.copy;
383
+ node.setAttribute("aria-label", label);
384
+ };
385
+ reset();
386
+ return { button: node, reset };
387
+ }
388
+
389
+ export { allowedFor, nextId, stringsOf, format, fill, el, button, visible, clientLabel, listOf, newDialog, copyButton };
390
+
391
+ //# debugId=F1BE73806BEBC29B64756E2164756E21
392
+ //# sourceMappingURL=index-jnz7w9xa.js.map
@@ -0,0 +1,12 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/always-allowed.ts", "../src/strings.ts", "../src/dialog.ts"],
4
+ "sourcesContent": [
5
+ "/**\n * The tools a user chose \"Allow until reload\" for, per AI app (grant), kept\n * in memory for the page's lifetime. An entry goes when its grant goes, when\n * the user resets it in the connect dialog, or when its tool is gone. A tool\n * registered again as it was (React's `useTool` does that on a remount) keeps\n * it; one whose title or description changed, what the user saw when\n * allowing it, is asked again.\n */\n\nimport type { TabMcp } from \"./tab-mcp.ts\";\nimport type { ConfirmRequest } from \"./types.ts\";\n\ntype ToolSeen = ConfirmRequest[\"tool\"];\n\n/** What the user saw of a tool when allowing it. */\nconst seen = (tool: ToolSeen) => JSON.stringify([tool.title, tool.description]);\n\nexport class AlwaysAllowed {\n\t/** Per grant: the tools by name, with what the user saw of each. */\n\treadonly #tools = new Map<\n\t\tstring,\n\t\tMap<string, { seen: string; label: string }>\n\t>();\n\treadonly #listeners = new Set<() => void>();\n\n\thas(grantId: string, tool: ToolSeen): boolean {\n\t\tconst tools = this.#tools.get(grantId);\n\t\tconst allowed = tools?.get(tool.name)?.seen;\n\t\tif (allowed === undefined || allowed === seen(tool)) {\n\t\t\treturn allowed !== undefined;\n\t\t}\n\t\t// The tool changed since: asked again, and no longer listed.\n\t\ttools?.delete(tool.name);\n\t\tthis.#changed();\n\t\treturn false;\n\t}\n\n\tadd(grantId: string, tool: ToolSeen): void {\n\t\tconst tools = this.#tools.get(grantId) ?? new Map();\n\t\ttools.set(tool.name, { seen: seen(tool), label: tool.title ?? tool.name });\n\t\tthis.#tools.set(grantId, tools);\n\t\tthis.#changed();\n\t}\n\n\t/** The tools allowed for a grant (title, else name), in the order allowed. */\n\tlist(grantId: string): string[] {\n\t\treturn [...(this.#tools.get(grantId)?.values() ?? [])].map((t) => t.label);\n\t}\n\n\t/** Ask again for every tool of a grant. */\n\tforget(grantId: string): void {\n\t\tif (this.#tools.delete(grantId)) this.#changed();\n\t}\n\n\t/** Forget every grant not in `grantIds`. */\n\tkeepGrants(grantIds: Iterable<string>): void {\n\t\tconst keep = new Set(grantIds);\n\t\tfor (const grantId of this.#tools.keys())\n\t\t\tif (!keep.has(grantId)) this.forget(grantId);\n\t}\n\n\t/** Forget every tool not in `names`. */\n\tkeepTools(names: Iterable<string>): void {\n\t\tconst keep = new Set(names);\n\t\tlet changed = false;\n\t\tfor (const tools of this.#tools.values()) {\n\t\t\tfor (const tool of tools.keys()) {\n\t\t\t\tif (keep.has(tool)) continue;\n\t\t\t\ttools.delete(tool);\n\t\t\t\tchanged = true;\n\t\t\t}\n\t\t}\n\t\tif (changed) this.#changed();\n\t}\n\n\t/** Calls `listener` on every change; returns what stops it. */\n\tonChange(listener: () => void): () => void {\n\t\tthis.#listeners.add(listener);\n\t\treturn () => this.#listeners.delete(listener);\n\t}\n\n\t#changed(): void {\n\t\tfor (const listener of [...this.#listeners]) listener();\n\t}\n}\n\n/** The tools allowed until reload, per `TabMcp`. */\nconst allowed = new WeakMap<TabMcp, AlwaysAllowed>();\n\n/**\n * The tools allowed until reload of `mcp`, made on first use. Its grants\n * and tools are followed: a tool's absence counts only after the current\n * task, so that one unregistered and registered again at once (React) keeps\n * its entries.\n */\nexport function allowedFor(mcp: TabMcp): AlwaysAllowed {\n\tconst kept = allowed.get(mcp);\n\tif (kept !== undefined) return kept;\n\tconst made = new AlwaysAllowed();\n\tmcp.addEventListener(\"grantschange\", (e) =>\n\t\tmade.keepGrants(e.detail.grants.map((g) => g.grantId)),\n\t);\n\tlet tools: readonly string[] | undefined;\n\tmcp.addEventListener(\"toolschange\", (e) => {\n\t\tif (tools === undefined)\n\t\t\tqueueMicrotask(() => {\n\t\t\t\tif (tools !== undefined) made.keepTools(tools);\n\t\t\t\ttools = undefined;\n\t\t\t});\n\t\ttools = e.detail.tools;\n\t});\n\tallowed.set(mcp, made);\n\treturn made;\n}\n",
6
+ "/**\n * Every text of the library's dialogs, in one table (CU 5). A page passes\n * its own for some or all keys (`ui: { strings }`); the dialogs use these for\n * the rest. `{name}` is a placeholder the dialog fills in: names of tools\n * and AI apps (isolated, so that they cannot reorder the sentence), the\n * code, counts. Where English needs two forms, there are two keys\n * (`…One` for one, `…Many` for more). `lang` and `dir` are the language and\n * direction of the texts, set on every dialog.\n */\nexport const STRINGS = {\n\tlang: \"en\",\n\tdir: \"ltr\",\n\t/** Between the last two items of a list (\"A, B and C\"). */\n\tand: \"and\",\n\n\t// The confirmation of a consequential tool call.\n\tconfirmTitle: \"Allow {tool}?\",\n\tconfirmWho: \"{client} wants to run {tool}.\",\n\tdeny: \"Don't allow\",\n\tallow: \"Allow\",\n\tallowUntilReload: \"Allow until reload\",\n\tallowUntilReloadNote:\n\t\t\"Allow until reload: {tool} will run for {client} without asking, with any arguments, until you reload this page or disconnect {client}.\",\n\targumentsHidden:\n\t\t\"The arguments cannot be shown, so this call cannot be allowed.\",\n\tscrollToAllow: \"Scroll to the end of the arguments to allow this call.\",\n\twaitingOne: \"1 more call is waiting after this one.\",\n\twaitingMany: \"{n} more calls are waiting after this one.\",\n\t/** Before the page's title while a confirmation waits in a hidden tab. */\n\ttitlePrefix: \"Allow? – \",\n\n\t// How the dialogs name a caller.\n\tclientWebMcp: \"An agent in this browser\",\n\tclientLocal: \"{name} (this site's assistant)\",\n\t/** An AI app through the relay: its name and the host of its client id. */\n\tclientRelay: \"{name} ({host})\",\n\n\t// Copy buttons.\n\tcopy: \"Copy\",\n\tcopied: \"Copied\",\n\t/** On the button after a refused Copy: the text is selected instead. */\n\tpressMac: \"Press ⌘C\",\n\tpressOther: \"Press Ctrl+C\",\n\t/** The same on a touch screen, where there is no key to press. */\n\tselected: \"Selected\",\n\tcopyAddress: \"Copy address\",\n\tcopyCode: \"Copy code\",\n\tcopyCommand: \"Copy {app} command\",\n\n\t// The connect dialog.\n\tconnectTitle: \"Connect your AI app\",\n\tconnecting: \"Connecting…\",\n\tconnectAgain: \"Connect again\",\n\treconnecting: \"Connection lost. Reconnecting…\",\n\tnotConnected: \"Not connected.\",\n\tunreachable: \"Could not connect. Check your internet connection.\",\n\trateLimited: \"Too many attempts. Wait a minute, then connect again.\",\n\trefused: \"The connection was refused.\",\n\tended: \"The session ended.\",\n\tlost: \"The connection was lost.\",\n\tclosed: \"The connection was closed.\",\n\tdisconnected: \"Disconnected.\",\n\tcheckingSignIn: \"Checking your sign-in…\",\n\tsignInFirst: \"Sign in to this page first.\",\n\tsignInRefused: \"Your sign-in on this page was not accepted.\",\n\t/** `{reason}`: the relay's reason, as it gave it. */\n\tsignInRefusedWhy: \"Your sign-in on this page was not accepted ({reason}).\",\n\treadyApp: \"{app} is ready for your AI app.\",\n\treadyPage: \"This page is ready for your AI app.\",\n\taddressLabel: \"Add this address to your AI app:\",\n\thelp: \"How do I add it?\",\n\tguide: \"Step by step, and what to do when it fails\",\n\tcodeSentence: \"When asked, enter the code {code}\",\n\tcodeNote: \"A new code appears every 2 minutes and after each use.\",\n\tcodeUsed: \"Code used. Waiting for your AI app…\",\n\tsignIn:\n\t\t\"When your AI app asks, sign in with the account you use on this page. No code is needed.\",\n\tnewAddress: \"New address\",\n\tnewAddressNote:\n\t\t\"Someone else may have this address, or is guessing codes? A new address disconnects every AI app from this one.\",\n\tnewAddressQuestionOne:\n\t\t\"A new address disconnects {apps}. To use this page again, add the new address to it.\",\n\tnewAddressQuestionMany:\n\t\t\"A new address disconnects {apps}. To use this page again, add the new address to them.\",\n\tnewAddressConfirm: \"Disconnect and get new address\",\n\tcancel: \"Cancel\",\n\tgettingNewAddress: \"Getting a new address…\",\n\tnewAddressDone: \"This is a new address. Add it to your AI app again.\",\n\tconnectedOne: \"{apps} is connected\",\n\tconnectedMany: \"{apps} are connected\",\n\tconnectedNextOne:\n\t\t\"You can close this now and ask it to use the tools of this page.\",\n\tconnectedNextMany:\n\t\t\"You can close this now and ask them to use the tools of this page.\",\n\tconnectAnother: \"Connect another app\",\n\tconnectedHeading: \"Connected\",\n\tappConnected: \"{app} connected\",\n\tdisconnect: \"Disconnect\",\n\tdisconnectApp: \"Disconnect {app}\",\n\tdisconnectNote: \"To disconnect an app, connect this page again first.\",\n\t/** Disconnect failed: the relay could not save it (`store_unavailable`). */\n\tstoreUnavailable: \"The relay could not save this. Try again.\",\n\t/** Disconnect failed for another reason. */\n\tdisconnectFailed: \"Could not disconnect the app. Try again.\",\n\t/** Under a connected app: the tools allowed until reload for it. */\n\trunsWithoutAsking: \"Runs without asking: {tools}\",\n\taskAgain: \"Ask again\",\n\taskAgainApp: \"Ask again before {app} runs a tool\",\n\tcloseNote:\n\t\t\"Closing this stops the code. The address stays the same: to connect later, open this again from the page.\",\n\tclose: \"Close\",\n\tdone: \"Done\",\n\n\t// The notice when another tab or program took over the address.\n\treplacedSiblingTitle: \"Opened in another tab\",\n\treplacedSibling:\n\t\t\"This page is open in another tab, and your AI apps now use that one. To use them here, connect this page again.\",\n\treplacedTitle: \"Another tab or program took over this page\",\n\treplaced:\n\t\t\"Your AI apps now reach that tab or program instead of this page. If you did not open this page in another tab or browser, someone may have copied its address. A new address disconnects every AI app from the old one; then add the new address to your AI apps again.\",\n\ttakenOverAgain:\n\t\t\"It was taken over again before its AI apps were disconnected. Try again.\",\n\t/** `{reason}`: why getting a new address failed, one of the texts above. */\n\ttryAgainOrClose: \"{reason} Try again, or close this.\",\n};\n\n/** The texts of the dialogs: the keys of {@link STRINGS}, each a string. */\nexport type DialogStrings = { [K in keyof typeof STRINGS]: string };\n",
7
+ "/**\n * What the library's dialogs share: the stylesheet, elements, buttons, the\n * texts (`strings.ts`) and how a caller is named. The confirmation\n * (`confirm.ts`) and the connect dialog (`connect.ts`) are chunks of their\n * own, loaded on demand; pages with their own UI use the events and methods\n * of `TabMcp` instead.\n */\n\nimport { type DialogStrings, STRINGS } from \"./strings.ts\";\nimport type { DialogOptions, Grant, ToolCallClient } from \"./types.ts\";\nimport { escapeInvisible } from \"./visible.ts\";\n\nlet counter = 0;\n\n/** A new id for the elements of one dialog. */\nexport function nextId(): string {\n\treturn `tab-mcp-${++counter}`;\n}\n\n/** The texts: the page's own where it gave them, else the English ones. */\nexport function stringsOf(options: DialogOptions | undefined): DialogStrings {\n\tconst s: DialogStrings = { ...STRINGS };\n\t// Only strings: a missing translation (`undefined`) keeps the English text.\n\tfor (const [key, value] of Object.entries(options?.strings ?? {}))\n\t\tif (typeof value === \"string\" && key in s)\n\t\t\ts[key as keyof DialogStrings] = value;\n\treturn s;\n}\n\n/** `template` with its `{name}` placeholders filled in, as text. */\nexport function format(\n\ttemplate: string,\n\tvalues: Record<string, string>,\n): string {\n\treturn template.replace(\n\t\t/\\{(\\w+)\\}/g,\n\t\t(all, key: string) => values[key] ?? all,\n\t);\n}\n\n/**\n * `template` with its `{name}` placeholders filled in, as nodes: a string\n * value is a name, isolated so that it cannot reorder the words around it\n * (and may stand twice); a node is put in as it is.\n */\nexport function fill(\n\tdoc: Document,\n\ttemplate: string,\n\tvalues: Record<string, string | Node>,\n): (Node | string)[] {\n\treturn template.split(/\\{(\\w+)\\}/).map((part, i) => {\n\t\tif (i % 2 === 0) return part;\n\t\tconst value = values[part];\n\t\tif (value === undefined) return `{${part}}`;\n\t\treturn typeof value === \"string\" ? name(doc, value) : value;\n\t});\n}\n\nexport function el<K extends keyof HTMLElementTagNameMap>(\n\tdoc: Document,\n\ttag: K,\n\tprops: { className?: string; text?: string; id?: string } = {},\n\t...children: (Node | string)[]\n): HTMLElementTagNameMap[K] {\n\tconst node = doc.createElement(tag);\n\tif (props.className !== undefined) node.className = props.className;\n\tif (props.id !== undefined) node.id = props.id;\n\tif (props.text !== undefined) node.textContent = props.text;\n\tnode.append(...children);\n\treturn node;\n}\n\n/**\n * A button. `className` is its own class; `kind` marks the one next step\n * (`tab-mcp-primary`) or one that disconnects (`tab-mcp-danger`); without\n * one it is a plain, outlined button.\n */\nexport function button(\n\tdoc: Document,\n\ttext: string,\n\tonClick: () => void,\n\tclassName?: string,\n\tkind?: \"primary\" | \"danger\",\n): HTMLButtonElement {\n\tconst node = el(doc, \"button\", { text });\n\tnode.type = \"button\";\n\tif (className !== undefined) node.classList.add(className);\n\tif (kind !== undefined) node.classList.add(`tab-mcp-${kind}`);\n\tnode.addEventListener(\"click\", onClick);\n\treturn node;\n}\n\n/** A name in a sentence, isolated so that it cannot reorder the words around it. */\nexport function name(doc: Document, text: string): HTMLElement {\n\tconst node = el(doc, \"bdi\", { text });\n\tnode.dir = \"ltr\";\n\treturn node;\n}\n\n/** Invisible, blank and direction characters as `\\uXXXX` (`visible.ts`). */\nexport const visible: (text: string) => string = escapeInvisible;\n\n/**\n * How the dialogs name a caller: an AI app's name and verified host; for\n * the caller of a served port, the name the page gave it and what it is.\n */\nexport function clientLabel(\n\tclient: ToolCallClient | Grant[\"client\"],\n\ts: DialogStrings,\n): string {\n\tif (\"kind\" in client && client.kind === \"webmcp\") return s.clientWebMcp;\n\tif (\"kind\" in client && client.kind === \"local\")\n\t\treturn format(s.clientLocal, { name: visible(client.name ?? client.id) });\n\tconst host = visible(client.host || client.id);\n\treturn client.name !== undefined && client.name !== \"\"\n\t\t? format(s.clientRelay, { name: visible(client.name), host })\n\t\t: host;\n}\n\n/** \"A and B\", \"A, B and C\". */\nexport function listOf(items: string[], s: DialogStrings): string {\n\treturn items.length < 2\n\t\t? (items[0] ?? \"\")\n\t\t: `${items.slice(0, -1).join(\", \")} ${s.and} ${items.at(-1)}`;\n}\n\n/**\n * The look of the dialogs. Every selector has the specificity of one class\n * (the rest is in `:where()`), so rules of the page for elements, such as\n * `button { … }` or a reset's `* { border-width: 0 }`, do not change the\n * dialogs. The rules for states (hover, focus, disabled) and the primary\n * and danger buttons add two elements (`html dialog.…`, `html button.…`),\n * so `button:hover`, `button:focus` or `button:disabled` of the page do not\n * either. A page overrides with two classes, `.tab-mcp-dialog .tab-mcp-x`,\n * which wins over all of them; one class does not. The `--tab-mcp-*`\n * custom properties (on `:root` or on `.tab-mcp-dialog`) change single\n * values; the library only reads them. The defaults use system colours and the\n * page's `color-scheme`, so the dialogs follow its light or dark scheme. The\n * `--_tab-mcp-*` properties are internal. Order matters among equals.\n */\nexport const DIALOG_CSS = `.tab-mcp-dialog {\n--_tab-mcp-fg: var(--tab-mcp-color, CanvasText);\n--_tab-mcp-bg: var(--tab-mcp-background, Canvas);\n--_tab-mcp-muted: var(--tab-mcp-muted, color-mix(in srgb, var(--_tab-mcp-fg) 72%, transparent));\n--_tab-mcp-line: color-mix(in srgb, var(--_tab-mcp-fg) 22%, transparent);\n--_tab-mcp-surface: var(--tab-mcp-surface, color-mix(in srgb, var(--_tab-mcp-fg) 6%, transparent));\n--_tab-mcp-danger: var(--tab-mcp-danger, light-dark(#b3261e, #ffb4ab));\n--_tab-mcp-success: var(--tab-mcp-success, light-dark(#1a7f37, #6fdd8b));\n--_tab-mcp-mono: var(--tab-mcp-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);\n--_tab-mcp-small-radius: calc(var(--tab-mcp-radius, 0.75rem) * 0.6);\nbox-sizing: border-box; margin: auto; width: calc(100% - 2rem); max-width: var(--tab-mcp-max-width, 34rem); max-height: calc(100% - 2rem); overflow: auto;\nfont: var(--tab-mcp-font, inherit); line-height: 1.5; color: var(--_tab-mcp-fg); background: var(--_tab-mcp-bg);\nborder: var(--tab-mcp-border, 1px solid var(--_tab-mcp-line)); border-radius: var(--tab-mcp-radius, 0.75rem);\npadding: var(--tab-mcp-padding, clamp(1rem, 5vw, 1.5rem)); box-shadow: var(--tab-mcp-shadow, 0 1rem 3rem rgb(0 0 0 / 0.3));\npointer-events: auto;\n}\n.tab-mcp-dialog::backdrop { background: var(--tab-mcp-backdrop, rgb(0 0 0 / 0.4)); }\n.tab-mcp-dialog:where([open]) { display: flex; flex-direction: column; gap: 1rem; }\n.tab-mcp-dialog:where([open]) > * { flex-shrink: 0; }\n.tab-mcp-dialog :where([hidden]) { display: none !important; }\nhtml dialog.tab-mcp-dialog:where(:focus) { outline: none; }\n.tab-mcp-dialog :where(*) { box-sizing: border-box; color: inherit; }\n.tab-mcp-dialog :where(h2, h3, p, ul, li, pre) { margin: 0; }\n.tab-mcp-dialog :where(h2) { font-size: var(--tab-mcp-title-size, 1.25em); line-height: 1.3; font-weight: 600; overflow-wrap: anywhere; }\n.tab-mcp-dialog :where(h3) { font-size: 0.875em; font-weight: 600; color: var(--_tab-mcp-muted); margin-bottom: 0.5rem; }\n.tab-mcp-dialog :where(small) { font-size: 0.875em; }\n.tab-mcp-dialog :where(small, .tab-mcp-status, .tab-mcp-description, .tab-mcp-always-note, .tab-mcp-apps-note, .tab-mcp-success-next, .tab-mcp-waiting, .tab-mcp-scroll-note, .tab-mcp-allowed) { color: var(--_tab-mcp-muted); }\nhtml dialog.tab-mcp-dialog :where(:focus-visible) { outline: 2px solid var(--tab-mcp-focus, var(--_tab-mcp-fg)); outline-offset: 2px; }\n.tab-mcp-dialog :where(button) { font: inherit; font-size: 0.9375em; line-height: 1.25; text-transform: none; letter-spacing: normal; width: auto; min-height: 2.5rem; padding: 0.5rem 1rem; margin: 0; border: 1px solid color-mix(in srgb, currentColor 35%, transparent); border-radius: var(--_tab-mcp-small-radius); background: transparent; color: inherit; cursor: pointer; }\nhtml dialog.tab-mcp-dialog :where(button:hover:not(:disabled)) { color: inherit; background: color-mix(in srgb, currentColor 8%, transparent); }\nhtml dialog.tab-mcp-dialog :where(button:disabled) { opacity: 0.45; cursor: not-allowed; }\nhtml button.tab-mcp-primary { background: var(--tab-mcp-accent, var(--_tab-mcp-fg)); color: var(--tab-mcp-accent-text, var(--_tab-mcp-bg)); border-color: transparent; font-weight: 600; }\nhtml button.tab-mcp-primary:where(:hover:not(:disabled)) { background: var(--tab-mcp-accent, var(--_tab-mcp-fg)); opacity: 0.85; }\nhtml button.tab-mcp-danger { color: var(--_tab-mcp-danger); border-color: color-mix(in srgb, currentColor 45%, transparent); }\n.tab-mcp-copy { min-width: 6em; }\n.tab-mcp-close { font-size: 0.875em; }\n.tab-mcp-status { margin-top: -0.5rem; }\n.tab-mcp-description:where(:empty) { display: none; }\n.tab-mcp-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.5rem; }\n.tab-mcp-address { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }\n.tab-mcp-address :where(label) { flex-basis: 100%; font-weight: 600; }\n.tab-mcp-address :where(input) { flex: 1 1 12rem; min-width: 0; min-height: 2.5rem; margin: 0; padding: 0.5rem 0.625rem; font: 0.875em var(--_tab-mcp-mono); text-overflow: ellipsis; color: inherit; background: var(--_tab-mcp-surface); border: 1px solid var(--_tab-mcp-line); border-radius: var(--_tab-mcp-small-radius); }\n.tab-mcp-code { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 0.25rem 1rem; padding: 1rem; background: var(--_tab-mcp-surface); border-radius: var(--_tab-mcp-small-radius); }\n.tab-mcp-code > :where(span) { font-weight: 600; }\n.tab-mcp-code :where(br) { display: none; }\n.tab-mcp-code :where(small) { grid-column: 1 / -1; }\n.tab-mcp-code-value { display: block; font: 700 var(--tab-mcp-code-size, 2em) / 1.2 var(--_tab-mcp-mono); letter-spacing: 0.12em; font-variant-numeric: tabular-nums; }\n.tab-mcp-help { border: 1px solid var(--_tab-mcp-line); border-radius: var(--_tab-mcp-small-radius); }\n.tab-mcp-help :where(summary) { padding: 0.75rem 1rem; font-weight: 600; cursor: pointer; }\n.tab-mcp-help > :where(:not(summary)) { margin-inline: 1rem; }\n.tab-mcp-help > :where(:last-child:not(summary)) { margin-bottom: 1rem; }\n.tab-mcp-dialog :where(.tab-mcp-help ul, .tab-mcp-apps ul) { list-style: none; padding: 0; display: grid; gap: 0.5rem; }\n.tab-mcp-help :where(ul) { margin-top: 0.25rem; margin-bottom: 0.75rem; gap: 0.75rem; }\n.tab-mcp-help :where(li) { overflow-wrap: anywhere; }\n.tab-mcp-help :where(strong) { display: block; font-weight: 600; }\n.tab-mcp-command { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: flex-start; gap: 0.5rem; margin-top: 0.375rem; }\n.tab-mcp-command > :where(pre) { flex: 1 1 16rem; min-width: 0; margin: 0; padding: 0.5rem 0.625rem; font: 0.8125em / 1.5 var(--_tab-mcp-mono); white-space: pre-wrap; word-break: break-all; background: var(--_tab-mcp-surface); border: 1px solid var(--_tab-mcp-line); border-radius: var(--_tab-mcp-small-radius); }\n.tab-mcp-command-note { display: block; margin-top: 0.375rem; }\n.tab-mcp-help :where(code) { font: 0.875em var(--_tab-mcp-mono); padding: 0.125em 0.375em; background: var(--_tab-mcp-surface); border-radius: 0.25rem; -webkit-box-decoration-break: clone; box-decoration-break: clone; }\n.tab-mcp-apps :where(li) { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 0.75rem; padding: 0.5rem 0.5rem 0.5rem 0.75rem; border: 1px solid var(--_tab-mcp-line); border-radius: var(--_tab-mcp-small-radius); }\n.tab-mcp-app { flex: 1 1 10rem; min-width: 0; overflow-wrap: anywhere; }\n.tab-mcp-allowed { display: flex; flex-basis: 100%; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 0.875em; overflow-wrap: anywhere; }\n.tab-mcp-apps-note { margin-top: 0.5rem; }\n.tab-mcp-success { display: flex; align-items: center; gap: 0.875rem; padding: 1rem; background: color-mix(in srgb, var(--_tab-mcp-success) 10%, transparent); border: 1px solid color-mix(in srgb, var(--_tab-mcp-success) 45%, transparent); border-radius: var(--_tab-mcp-small-radius); }\n.tab-mcp-success-icon { flex: none; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; font-size: 1.5em; font-weight: 700; line-height: 1; color: var(--_tab-mcp-success); background: color-mix(in srgb, var(--_tab-mcp-success) 16%, transparent); }\n.tab-mcp-success-icon::before { content: \"\\\\2713\"; }\n.tab-mcp-success-text { display: grid; gap: 0.125rem; min-width: 0; }\n.tab-mcp-success-title { font-size: 1.125em; line-height: 1.3; font-weight: 600; overflow-wrap: anywhere; }\n.tab-mcp-setup { display: flex; flex-direction: column; gap: 1rem; }\n.tab-mcp-setup-toggle { display: flex; align-items: center; gap: 0.75rem; width: 100%; padding: 0.75rem 1rem; text-align: start; font-weight: 600; border-color: var(--_tab-mcp-line); }\n.tab-mcp-setup-toggle::before { content: \"\"; flex: none; width: 0.45em; height: 0.45em; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateX(-0.1em) rotate(-45deg); }\n.tab-mcp-setup-toggle:where([aria-expanded=\"true\"])::before { transform: translateY(-0.15em) rotate(45deg); }\n.tab-mcp-code-used { display: flex; align-items: center; min-height: calc(var(--tab-mcp-code-size, 2em) * 1.2); }\n.tab-mcp-new-address-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; }\n.tab-mcp-new-address-row > :where(small) { flex: 1 1 14rem; color: var(--_tab-mcp-muted); }\n.tab-mcp-new-address-question { display: grid; gap: 0.75rem; padding: 1rem; border: 1px solid color-mix(in srgb, var(--_tab-mcp-danger) 50%, transparent); border-radius: var(--_tab-mcp-small-radius); }\n.tab-mcp-connect > :where(.tab-mcp-actions) { gap: 0.75rem; padding-top: 1rem; border-top: 1px solid var(--_tab-mcp-line); }\n.tab-mcp-close-note { flex: 1 1 12rem; }\n.tab-mcp-confirm :where(p bdi) { font-weight: 600; }\n.tab-mcp-arguments { box-sizing: content-box; font: 0.875em / 1.45 var(--_tab-mcp-mono); padding: 0.75rem; background: var(--_tab-mcp-surface); border: 1px solid var(--_tab-mcp-line); border-radius: var(--_tab-mcp-small-radius); }\n.tab-mcp-always-note, .tab-mcp-waiting, .tab-mcp-scroll-note { font-size: 0.875em; }\n@media (max-width: 30rem) { .tab-mcp-actions > :where(button) { flex: 1 1 auto; } .tab-mcp-connect > :where(.tab-mcp-actions) > :where(button) { flex: 0 0 auto; } .tab-mcp-code { grid-template-columns: minmax(0, 1fr); } .tab-mcp-code > :where(button) { justify-self: start; } }\n@media (prefers-reduced-motion: no-preference) { .tab-mcp-dialog:where([open]) { animation: tab-mcp-in 0.15s ease-out; } .tab-mcp-success-icon { animation: tab-mcp-pop 0.4s cubic-bezier(0.3, 1.4, 0.6, 1); } }\n@media (forced-colors: active) { html button.tab-mcp-primary { border-color: ButtonText; } }\n@keyframes tab-mcp-in { from { opacity: 0; transform: translateY(0.5rem); } }\n@keyframes tab-mcp-pop { from { opacity: 0; transform: scale(0.4); } }\n`;\n\nconst sheets = new WeakMap<Document, CSSStyleSheet>();\n\n/**\n * Adopts `DIALOG_CSS` into the document once, next to the page's own adopted\n * sheets. A constructed stylesheet needs no `style-src` exception under a\n * strict CSP. Where constructed stylesheets are not supported, the dialogs\n * keep the browser's default look and work the same.\n */\nfunction adoptStyles(doc: Document): void {\n\ttry {\n\t\tlet sheet = sheets.get(doc);\n\t\tif (sheet === undefined) {\n\t\t\tconst Sheet = (doc.defaultView as (Window & typeof globalThis) | null)\n\t\t\t\t?.CSSStyleSheet;\n\t\t\tif (Sheet === undefined || !Array.isArray(doc.adoptedStyleSheets)) return;\n\t\t\tsheet = new Sheet();\n\t\t\tsheet.replaceSync(DIALOG_CSS);\n\t\t\tsheets.set(doc, sheet);\n\t\t}\n\t\t// The page may have replaced the list since.\n\t\tif (!doc.adoptedStyleSheets.includes(sheet))\n\t\t\tdoc.adoptedStyleSheets = [...doc.adoptedStyleSheets, sheet];\n\t} catch {\n\t\t// Not supported: the default look.\n\t}\n}\n\n/**\n * A dialog with its heading (`title`, or filled in by the caller). It\n * carries the texts' language and direction (`lang`, `dir` of the\n * strings), whatever the page's: read out with that voice, laid out that way.\n */\nexport function newDialog(\n\tdoc: Document,\n\tclassName: string,\n\ts: DialogStrings,\n\t...title: (Node | string)[]\n): { dialog: HTMLDialogElement; heading: HTMLHeadingElement; id: string } {\n\tconst id = nextId();\n\tconst dialog = el(doc, \"dialog\", {\n\t\tclassName: `tab-mcp-dialog ${className}`,\n\t});\n\tdialog.setAttribute(\"aria-labelledby\", `${id}-title`);\n\tdialog.lang = s.lang;\n\tdialog.dir = s.dir;\n\tadoptStyles(doc);\n\tconst heading = el(doc, \"h2\", { id: `${id}-title` }, ...title);\n\tdialog.append(heading);\n\treturn { dialog, heading, id };\n}\n\n/** How long a Copy button says \"Copied\", and how long it says to press Ctrl+C. */\nexport const COPIED_MS = 2000;\nexport const SELECTED_MS = 8000;\n\n/** What the button says after a refused Copy, by the user's device. */\nfunction pressToCopy(doc: Document, s: DialogStrings): string {\n\tconst view = doc.defaultView;\n\tif (view?.matchMedia?.(\"(pointer: coarse)\").matches === true)\n\t\treturn s.selected;\n\tconst platform = view?.navigator.platform ?? \"\";\n\treturn /^(Mac|iP)/.test(platform) ? s.pressMac : s.pressOther;\n}\n\n/**\n * A Copy button for `value()`, read at click time. Says \"Copied\" for a\n * moment once the clipboard took it; without a clipboard (or when it refuses)\n * `select()` puts the text in the selection and the button says to press\n * Ctrl+C (⌘C on Apple devices). `label` names it for assistive technology\n * (\"Copy code\"), as the dialog has more than one Copy; while it says what\n * happened, that is its name, and `announce` says it too.\n */\nexport function copyButton(\n\tdoc: Document,\n\ts: DialogStrings,\n\tlabel: string,\n\tvalue: () => string,\n\tselect: () => void,\n\tannounce: (text: string) => void,\n\tclassName: string,\n\tkind?: \"primary\",\n): { button: HTMLButtonElement; reset: () => void } {\n\tlet timer: ReturnType<typeof setTimeout> | undefined;\n\tconst say = (text: string, ms: number) => {\n\t\tnode.textContent = text;\n\t\tnode.removeAttribute(\"aria-label\");\n\t\tannounce(text);\n\t\tclearTimeout(timer);\n\t\ttimer = setTimeout(reset, ms);\n\t};\n\tconst node = button(\n\t\tdoc,\n\t\ts.copy,\n\t\t() => {\n\t\t\tconst clipboard = (doc.defaultView?.navigator as Navigator | undefined)\n\t\t\t\t?.clipboard;\n\t\t\tconst selected = () => {\n\t\t\t\tselect();\n\t\t\t\tsay(pressToCopy(doc, s), SELECTED_MS);\n\t\t\t};\n\t\t\tif (clipboard !== undefined)\n\t\t\t\tclipboard\n\t\t\t\t\t.writeText(value())\n\t\t\t\t\t.then(() => say(s.copied, COPIED_MS), selected);\n\t\t\telse selected();\n\t\t},\n\t\tclassName,\n\t\tkind,\n\t);\n\t// The same width for \"Copy\" and \"Copied\": nothing moves.\n\tnode.classList.add(\"tab-mcp-copy\");\n\tconst reset = () => {\n\t\tclearTimeout(timer);\n\t\ttimer = undefined;\n\t\tnode.textContent = s.copy;\n\t\tnode.setAttribute(\"aria-label\", label);\n\t};\n\treset();\n\treturn { button: node, reset };\n}\n"
8
+ ],
9
+ "mappings": ";;;;;AAeA,IAAM,OAAO,CAAC,SAAmB,KAAK,UAAU,CAAC,KAAK,OAAO,KAAK,WAAW,CAAC;AAAA;AAEvE,MAAM,cAAc;AAAA,EAEjB,SAAS,IAAI;AAAA,EAIb,aAAa,IAAI;AAAA,EAE1B,GAAG,CAAC,SAAiB,MAAyB;AAAA,IAC7C,MAAM,QAAQ,KAAK,OAAO,IAAI,OAAO;AAAA,IACrC,MAAM,UAAU,OAAO,IAAI,KAAK,IAAI,GAAG;AAAA,IACvC,IAAI,YAAY,aAAa,YAAY,KAAK,IAAI,GAAG;AAAA,MACpD,OAAO,YAAY;AAAA,IACpB;AAAA,IAEA,OAAO,OAAO,KAAK,IAAI;AAAA,IACvB,KAAK,SAAS;AAAA,IACd,OAAO;AAAA;AAAA,EAGR,GAAG,CAAC,SAAiB,MAAsB;AAAA,IAC1C,MAAM,QAAQ,KAAK,OAAO,IAAI,OAAO,KAAK,IAAI;AAAA,IAC9C,MAAM,IAAI,KAAK,MAAM,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,KAAK,SAAS,KAAK,KAAK,CAAC;AAAA,IACzE,KAAK,OAAO,IAAI,SAAS,KAAK;A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E7B,MAAM,OAAO,OACZ,KACA,EAAE,MACF,MAAM;AAAA,IACL,MAAM,YAAa,IAAI,aAAa,WACjC;AAAA,IACH,MAAM,WAAW,MAAM;AAAA,MACtB,OAAO;AAAA,MACP,IAAI,YAAY,KAAK,CAAC,GAAG,WAAW;AAAA;AAAA,IAErC,IAAI,cAAc;AAAA,MACjB,UACE,UAAU,MAAM,CAAC,EACjB,KAAK,MAAM,IAAI,EAAE,QAAQ,SAAS,GAAG,QAAQ;AAAA,IAChD;AAAA,MAAK,SAAS;AAAA,KAEf,WACA,IACD;AAAA,EAEA,KAAK,UAAU,IAAI,cAAc;AAAA,EACjC,MAAM,QAAQ,MAAM;AAAA,IACnB,aAAa,KAAK;AAAA,IAClB,QAAQ;AAAA,IACR,KAAK,cAAc,EAAE;AAAA,IACrB,KAAK,aAAa,cAAc,KAAK;AAAA;AAAA,EAEtC,MAAM;AAAA,EACN,OAAO,EAAE,QAAQ,MAAM,MAAM;AAAA;",
10
+ "debugId": "F1BE73806BEBC29B64756E2164756E21",
11
+ "names": []
12
+ }
package/index.d.ts CHANGED
@@ -3,5 +3,5 @@
3
3
  * tab-mcp relay. This entry is the small core; `connect()` loads the rest.
4
4
  */
5
5
  export { TabMcp } from "./tab-mcp.js";
6
- export type { ConfirmAnswer, ConfirmHandler, ConfirmRequest, ConnectionState, ConnectOptions, DisconnectDetail, DisconnectReason, Grant, Icon, IdentityAssertionHandler, IdentityAssertionRequest, IdentityState, JsonSchema, Limits, LocalClient, PairingCode, PairingCodeReason, ReconnectingInfo, ReconnectOptions, RegisterToolOptions, RelayClient, ReplacedDetail, SecretStorage, ServeHandle, ServeOptions, ServerInfo, SessionInfo, TabMcpEventMap, TabMcpOptions, Tool, ToolAnnotations, ToolCallClient, ToolCallEnd, ToolCallOutcome, ToolCallResult, ToolCallStart, ToolExecuteOptions, TunnelPort, TunnelPortHandler, WebMcpClient, } from "./types.js";
6
+ export type { ConfirmAnswer, ConfirmHandler, ConfirmRequest, ConnectionState, ConnectOptions, DialogOptions, DialogStrings, DisconnectReason, Grant, Icon, IdentityAssertionHandler, IdentityAssertionRequest, IdentityState, JsonSchema, Limits, LocalClient, PairingCode, PairingCodeReason, ReconnectingInfo, RegisterToolOptions, RelayClient, ReplacedDetail, SecretStorage, ServeHandle, ServeOptions, ServerInfo, SessionInfo, SetupNotePart, SetupStep, StateChangeDetail, TabMcpEventMap, TabMcpOptions, Tool, ToolAnnotations, ToolCallClient, ToolCallEnd, ToolCaller, ToolCallOutcome, ToolCallResult, ToolCallStart, ToolExecuteOptions, TunnelPort, TunnelPortHandler, WebMcpClient, } from "./types.js";
7
7
  export { VERSION } from "./version.js";