@ractive-ch/tab-mcp-client 0.18.1 → 0.19.0-rc.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.
- package/CHANGELOG.md +160 -0
- package/README.md +348 -68
- package/allowed.d.ts +2 -2
- package/allowed.js.map +1 -1
- package/always-allowed.d.ts +15 -15
- package/cdn/allowed.min.js +2 -2
- package/cdn/allowed.min.js.map +2 -2
- package/cdn/confirm-ba3dkf9p.min.js +4 -0
- package/cdn/confirm-ba3dkf9p.min.js.map +10 -0
- package/cdn/connect-my0pbqd7.min.js +6 -0
- package/cdn/connect-my0pbqd7.min.js.map +12 -0
- package/cdn/connection-yf2x9zz2.min.js +17 -0
- package/cdn/{connection-0xqwz17v.min.js.map → connection-yf2x9zz2.min.js.map} +5 -5
- package/cdn/strings.min.js +4 -0
- package/cdn/strings.min.js.map +9 -0
- package/cdn/{tab-mcp-client-2vx9mcww.min.js → tab-mcp-client-8r6h3wza.min.js} +9 -8
- package/cdn/tab-mcp-client-8r6h3wza.min.js.map +11 -0
- package/cdn/tab-mcp-client-nnxcwrxp.min.js +5 -0
- package/cdn/tab-mcp-client-nnxcwrxp.min.js.map +11 -0
- package/cdn/{tab-mcp-client-5j3brdf3.min.js → tab-mcp-client-q758jr4g.min.js} +4 -4
- package/cdn/tab-mcp-client-q758jr4g.min.js.map +10 -0
- package/cdn/tab-mcp-client.min.js +3 -3
- package/cdn/tab-mcp-client.min.js.map +4 -4
- package/cdn/webmcp-84k58gsw.min.js +4 -0
- package/cdn/webmcp-84k58gsw.min.js.map +11 -0
- package/{confirm-bqfdrx3f.js → confirm-hymzwx3b.js} +7 -5
- package/confirm-hymzwx3b.js.map +10 -0
- package/confirm.d.ts +2 -2
- package/{connect-ztsgybpq.js → connect-fhtjdmf3.js} +75 -37
- package/connect-fhtjdmf3.js.map +10 -0
- package/connect.d.ts +7 -6
- package/{connection-gang7f5x.js → connection-73fbg99k.js} +70 -8
- package/connection-73fbg99k.js.map +16 -0
- package/connection.d.ts +23 -2
- package/dialog.d.ts +19 -9
- package/extension.d.ts +347 -0
- package/extension.js +394 -0
- package/extension.js.map +10 -0
- package/handshake.d.ts +82 -0
- package/index-00p8b969.js +221 -0
- package/index-00p8b969.js.map +11 -0
- package/index-1tssct09.js +58 -0
- package/index-1tssct09.js.map +11 -0
- package/{index-c1c266tm.js → index-7qqhn3zv.js} +28 -110
- package/index-7qqhn3zv.js.map +10 -0
- package/index-s31xrfa2.js.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +59 -64
- package/index.js.map +4 -4
- package/internal.d.ts +2 -0
- package/mcp.d.ts +5 -3
- package/package.json +11 -2
- package/protocol.d.ts +11 -1
- package/react.d.ts +11 -4
- package/react.js +57 -10
- package/react.js.map +5 -4
- package/secret.d.ts +1 -1
- package/setup.d.ts +4 -1
- package/setup.js +3 -2
- package/setup.js.map +1 -1
- package/strings.d.ts +149 -28
- package/strings.js +13 -0
- package/strings.js.map +9 -0
- package/tab-mcp.d.ts +30 -7
- package/text.d.ts +39 -0
- package/types.d.ts +76 -17
- package/webmcp-d2ec3v3g.js +221 -0
- package/webmcp-d2ec3v3g.js.map +11 -0
- package/webmcp.d.ts +17 -4
- package/cdn/confirm-d722a9eb.min.js +0 -4
- package/cdn/confirm-d722a9eb.min.js.map +0 -10
- package/cdn/connect-x6ws6wqt.min.js +0 -6
- package/cdn/connect-x6ws6wqt.min.js.map +0 -12
- package/cdn/connection-0xqwz17v.min.js +0 -17
- package/cdn/tab-mcp-client-2vx9mcww.min.js.map +0 -12
- package/cdn/tab-mcp-client-5j3brdf3.min.js.map +0 -10
- package/cdn/webmcp-khy4f5rj.min.js +0 -4
- package/cdn/webmcp-khy4f5rj.min.js.map +0 -10
- package/confirm-bqfdrx3f.js.map +0 -10
- package/connect-ztsgybpq.js.map +0 -10
- package/connection-gang7f5x.js.map +0 -16
- package/index-5jyqehpk.js +0 -63
- package/index-5jyqehpk.js.map +0 -11
- package/index-c1c266tm.js.map +0 -11
- package/webmcp-zq1enyz0.js +0 -57
- package/webmcp-zq1enyz0.js.map +0 -10
package/index-5jyqehpk.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
// src/command.ts
|
|
2
|
-
function commandName(name) {
|
|
3
|
-
const label = name.normalize("NFKD").replace(/\p{M}/gu, "").toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/-{2,}/g, "-").replace(/^-+|-+$/g, "").slice(0, 40).replace(/-+$/, "");
|
|
4
|
-
return label === "" ? "tools" : label;
|
|
5
|
-
}
|
|
6
|
-
function commandAddress(address) {
|
|
7
|
-
try {
|
|
8
|
-
const href = new URL(address).href;
|
|
9
|
-
return /^https?:\/\/[A-Za-z0-9.:[\]/_~-]+$/.test(href) ? href : undefined;
|
|
10
|
-
} catch {
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
// src/setup.ts
|
|
16
|
-
var SETUP_GUIDE2 = "https://ractive.ch/tab-mcp/connect/";
|
|
17
|
-
var CODEX_FEATURE = "mcp_2026_07_28";
|
|
18
|
-
function setupInstructions2(serverName, address) {
|
|
19
|
-
const n = commandName(serverName);
|
|
20
|
-
const a = commandAddress(address);
|
|
21
|
-
const run = (command) => a === undefined ? {} : { text: "Run:", command };
|
|
22
|
-
return [
|
|
23
|
-
{
|
|
24
|
-
id: "claude",
|
|
25
|
-
app: "Claude (claude.ai and the desktop app)",
|
|
26
|
-
text: "Settings → Connectors → Add custom connector, then paste the address."
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
id: "chatgpt",
|
|
30
|
-
app: "ChatGPT",
|
|
31
|
-
text: "On chatgpt.com: Plugins, add an MCP server with the address, then Connect. The Mac app needs more steps: see the guide."
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
id: "claude-code",
|
|
35
|
-
app: "Claude Code",
|
|
36
|
-
text: "Add the address with claude mcp add --transport http.",
|
|
37
|
-
...run(`claude mcp add --transport http ${n} ${a}`),
|
|
38
|
-
note: [
|
|
39
|
-
{ text: "Then type " },
|
|
40
|
-
{ code: "/mcp" },
|
|
41
|
-
{ text: " in Claude Code and choose Authenticate." }
|
|
42
|
-
]
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
id: "codex",
|
|
46
|
-
app: "Codex",
|
|
47
|
-
text: `Run codex features enable ${CODEX_FEATURE}, then add the address with codex mcp add --url and sign in with codex mcp login.`,
|
|
48
|
-
...run(`codex features enable ${CODEX_FEATURE}
|
|
49
|
-
codex mcp add ${n} --url ${a}
|
|
50
|
-
codex mcp login ${n}`),
|
|
51
|
-
note: [
|
|
52
|
-
{
|
|
53
|
-
text: "The last line opens the sign-in that asks for the code. Start a new chat in Codex after it connects."
|
|
54
|
-
}
|
|
55
|
-
]
|
|
56
|
-
}
|
|
57
|
-
];
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export { SETUP_GUIDE2, setupInstructions2 };
|
|
61
|
-
|
|
62
|
-
//# debugId=B45ED3D4D77794A664756E2164756E21
|
|
63
|
-
//# sourceMappingURL=index-5jyqehpk.js.map
|
package/index-5jyqehpk.js.map
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/command.ts", "../src/setup.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"/**\n * The server's name and the address as words for the setup commands\n * (`setup.ts`), plain in every shell. Internal: not part of an entry.\n */\n\n/**\n * The server's name as a label that every shell (POSIX shells, PowerShell,\n * cmd.exe) reads as one plain word, so it needs no quoting: letters without\n * their marks (\"Bücher\" → \"bucher\"), lower case, each run of anything but\n * a-z, 0-9, _ and - as one \"-\", no \"-\" at either end (no option), at most 40\n * characters; \"tools\" when nothing is left. The page names its server, but\n * the command runs in the user's shell: nothing of the name may be quoted\n * text (review of PR 34).\n */\nexport function commandName(name: string): string {\n\tconst label = name\n\t\t.normalize(\"NFKD\")\n\t\t.replace(/\\p{M}/gu, \"\")\n\t\t.toLowerCase()\n\t\t.replace(/[^a-z0-9_-]+/g, \"-\")\n\t\t.replace(/-{2,}/g, \"-\")\n\t\t.replace(/^-+|-+$/g, \"\")\n\t\t.slice(0, 40)\n\t\t.replace(/-+$/, \"\");\n\treturn label === \"\" ? \"tools\" : label;\n}\n\n/**\n * The address for a command, only when all of it is plain in every shell\n * (http or https, letters, digits and . : [ ] / _ ~ -); else `undefined`, and\n * the help shows the steps without commands. The relay's addresses are.\n */\nexport function commandAddress(address: string): string | undefined {\n\ttry {\n\t\tconst href = new URL(address).href;\n\t\treturn /^https?:\\/\\/[A-Za-z0-9.:[\\]/_~-]+$/.test(href) ? href : undefined;\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n",
|
|
6
|
-
"/**\n * `@ractive-ch/tab-mcp-client/setup`: how to add a page's address to each AI\n * app, the steps the connect dialog shows under \"How do I add it?\", for pages\n * and extensions that show them in their own UI. Plain data, no DOM. An entry\n * of its own, out of the core (DEC-118).\n */\n\nimport { commandAddress, commandName } from \"./command.ts\";\nimport type { SetupNotePart, SetupStep } from \"./types.ts\";\n\nexport type { SetupNotePart, SetupStep };\n\n/** The guide for every AI app, step by step and what to do when it fails (its source is on ractive.ch). */\nexport const SETUP_GUIDE = \"https://ractive.ch/tab-mcp/connect/\";\n\n/** Codex's feature for MCP 2026-07-28, which the relay speaks; off by default in Codex 0.163. */\nconst CODEX_FEATURE = \"mcp_2026_07_28\";\n\n/**\n * The steps for one AI app. All strings are plain text (set them with\n * `textContent`). `command`, where present, is safe to show and to run: the\n * server's name and the address in it are words that every shell (POSIX\n * shells, PowerShell, cmd.exe) reads as plain, with nothing to quote. It is\n * absent for apps without a command, and when the address is not\n * shell-plain (only http or https, letters, digits and `. : [ ] / _ ~ -`);\n * then `text` names the command instead. The relay's addresses are\n * shell-plain.\n */\nexport interface SetupInstruction extends SetupStep {\n\t/** Which app, stable across versions: `claude`, `chatgpt`, `claude-code` or `codex`. */\n\tid: \"claude\" | \"chatgpt\" | \"claude-code\" | \"codex\";\n}\n\n/**\n * The steps to add `address` (the page's MCP address from the relay) to\n * Claude, ChatGPT, Claude Code and Codex, in that order. `serverName` is the\n * page's `server.name`; the commands name the server by it, reduced to a\n * shell-plain label (lower case, letters without marks, each run of other\n * characters as `-`, at most 40 characters, `tools` if nothing is left).\n * End the list with a link to {@link SETUP_GUIDE}: the steps here are the\n * minimum (CU 20), the guide has the rest and follows the apps' menus.\n */\nexport function setupInstructions(\n\tserverName: string,\n\taddress: string,\n): SetupInstruction[] {\n\tconst n = commandName(serverName);\n\tconst a = commandAddress(address);\n\tconst run = (command: string) =>\n\t\ta === undefined ? {} : { text: \"Run:\", command };\n\treturn [\n\t\t{\n\t\t\tid: \"claude\",\n\t\t\tapp: \"Claude (claude.ai and the desktop app)\",\n\t\t\ttext: \"Settings → Connectors → Add custom connector, then paste the address.\",\n\t\t},\n\t\t{\n\t\t\tid: \"chatgpt\",\n\t\t\tapp: \"ChatGPT\",\n\t\t\ttext: \"On chatgpt.com: Plugins, add an MCP server with the address, then Connect. The Mac app needs more steps: see the guide.\",\n\t\t},\n\t\t{\n\t\t\tid: \"claude-code\",\n\t\t\tapp: \"Claude Code\",\n\t\t\ttext: \"Add the address with claude mcp add --transport http.\",\n\t\t\t...run(`claude mcp add --transport http ${n} ${a}`),\n\t\t\t// The command only adds the server; the sign-in that asks for the\n\t\t\t// code starts in Claude Code (CU 6).\n\t\t\tnote: [\n\t\t\t\t{ text: \"Then type \" },\n\t\t\t\t{ code: \"/mcp\" },\n\t\t\t\t{ text: \" in Claude Code and choose Authenticate.\" },\n\t\t\t],\n\t\t},\n\t\t{\n\t\t\tid: \"codex\",\n\t\t\tapp: \"Codex\",\n\t\t\ttext: `Run codex features enable ${CODEX_FEATURE}, then add the address with codex mcp add --url and sign in with codex mcp login.`,\n\t\t\t...run(\n\t\t\t\t`codex features enable ${CODEX_FEATURE}\\ncodex mcp add ${n} --url ${a}\\ncodex mcp login ${n}`,\n\t\t\t),\n\t\t\tnote: [\n\t\t\t\t{\n\t\t\t\t\ttext: \"The last line opens the sign-in that asks for the code. Start a new chat in Codex after it connects.\",\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t];\n}\n"
|
|
7
|
-
],
|
|
8
|
-
"mappings": ";AAcO,SAAS,WAAW,CAAC,MAAsB;AAAA,EACjD,MAAM,QAAQ,KACZ,UAAU,MAAM,EAChB,QAAQ,WAAW,EAAE,EACrB,YAAY,EACZ,QAAQ,iBAAiB,GAAG,EAC5B,QAAQ,UAAU,GAAG,EACrB,QAAQ,YAAY,EAAE,EACtB,MAAM,GAAG,EAAE,EACX,QAAQ,OAAO,EAAE;AAAA,EACnB,OAAO,UAAU,KAAK,UAAU;AAAA;AAQ1B,SAAS,cAAc,CAAC,SAAqC;AAAA,EACnE,IAAI;AAAA,IACH,MAAM,OAAO,IAAI,IAAI,OAAO,EAAE;AAAA,IAC9B,OAAO,qCAAqC,KAAK,IAAI,IAAI,OAAO;AAAA,IAC/D,MAAM;AAAA,IACP;AAAA;AAAA;;;ACxBK,IAAM,eAAc;AAG3B,IAAM,gBAAgB;AA0Bf,SAAS,kBAAiB,CAChC,YACA,SACqB;AAAA,EACrB,MAAM,IAAI,YAAY,UAAU;AAAA,EAChC,MAAM,IAAI,eAAe,OAAO;AAAA,EAChC,MAAM,MAAM,CAAC,YACZ,MAAM,YAAY,CAAC,IAAI,EAAE,MAAM,QAAQ,QAAQ;AAAA,EAChD,OAAO;AAAA,IACN;AAAA,MACC,IAAI;AAAA,MACJ,KAAK;AAAA,MACL,MAAM;AAAA,IACP;AAAA,IACA;AAAA,MACC,IAAI;AAAA,MACJ,KAAK;AAAA,MACL,MAAM;AAAA,IACP;AAAA,IACA;AAAA,MACC,IAAI;AAAA,MACJ,KAAK;AAAA,MACL,MAAM;AAAA,SACH,IAAI,mCAAmC,KAAK,GAAG;AAAA,MAGlD,MAAM;AAAA,QACL,EAAE,MAAM,aAAa;AAAA,QACrB,EAAE,MAAM,OAAO;AAAA,QACf,EAAE,MAAM,2CAA2C;AAAA,MACpD;AAAA,IACD;AAAA,IACA;AAAA,MACC,IAAI;AAAA,MACJ,KAAK;AAAA,MACL,MAAM,6BAA6B;AAAA,SAChC,IACF,yBAAyB;AAAA,gBAAgC,WAAW;AAAA,kBAAsB,GAC3F;AAAA,MACA,MAAM;AAAA,QACL;AAAA,UACC,MAAM;AAAA,QACP;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAAA;",
|
|
9
|
-
"debugId": "B45ED3D4D77794A664756E2164756E21",
|
|
10
|
-
"names": []
|
|
11
|
-
}
|
package/index-c1c266tm.js.map
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/strings.ts", "../src/dialog.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"/**\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\t/** `alwaysAllow: true`: kept until the app is disconnected. */\n\talwaysAllow: \"Always allow\",\n\talwaysAllowNote:\n\t\t\"Always allow: {tool} will run for {client} without asking, with any arguments, until you disconnect {client} from this page.\",\n\t/** `alwaysAllow: \"until-reload\"`, or kept in memory only (`storage: null`). */\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: \"Disconnect all apps\",\n\tnewAddressNote:\n\t\t\"An AI app is connected that should not be? This disconnects every AI app from this page; each one has to connect again with a new code.\",\n\tnewAddressQuestionOne:\n\t\t\"This disconnects {apps}. To use this page with it again, connect it again and enter a new code.\",\n\tnewAddressQuestionMany:\n\t\t\"This disconnects {apps}. To use this page with them again, connect them again and enter a new code.\",\n\tnewAddressConfirm: \"Disconnect all\",\n\tcancel: \"Cancel\",\n\tgettingNewAddress: \"Disconnecting…\",\n\tnewAddressDone: \"Every AI app is disconnected. Connect yours 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: a switch per tool that asks, and one for all.\n\trunsWithoutAsking: \"Runs without asking\",\n\t/** After a tool's name: it may delete or overwrite (`destructiveHint`). */\n\tdestructive: \"destructive\",\n\t/** A tool's switch, as read out: starts with what it shows (WCAG 2.5.3). */\n\tallowToolApp: \"{tool} runs without asking for {app}\",\n\tallowDestructiveToolApp: \"{tool} (destructive) runs without asking for {app}\",\n\tallowEverything: \"Allow everything, no questions asked\",\n\tallowEverythingApp: \"Allow everything, no questions asked, for {app}\",\n\tallowEverythingNote:\n\t\t\"Every tool of this page runs for {app} without asking, with any arguments: also tools you have not seen yet and ones that delete or overwrite.\",\n\tcloseNote:\n\t\t\"Closing this stops the code. 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 what this page keeps to connect. “Disconnect all apps” ends that; then connect your AI apps again with a new code.\",\n\ttakenOverAgain:\n\t\t\"It was taken over again before its AI apps were disconnected. Try again.\",\n\t/** `{reason}`: why disconnecting all apps 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",
|
|
6
|
-
"/**\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) { 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: grid; flex-basis: 100%; gap: 0.25rem; padding-top: 0.5rem; border-top: 1px solid var(--_tab-mcp-line); font-size: 0.875em; overflow-wrap: anywhere; }\n.tab-mcp-allowed-title { font-weight: 600; color: var(--_tab-mcp-muted); }\n.tab-mcp-switches { display: grid; gap: 0.125rem; }\n.tab-mcp-switch { display: flex; align-items: center; gap: 0.625rem; min-height: 2rem; cursor: pointer; }\n.tab-mcp-switch > :where(input) { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 2.25rem; height: 1.25rem; margin: 0; padding: 0; border: 1px solid var(--_tab-mcp-line); border-radius: 0.625rem; background: var(--_tab-mcp-surface); cursor: pointer; }\n.tab-mcp-switch > :where(input)::before { content: \"\"; position: absolute; top: 2px; left: 2px; width: calc(1.25rem - 6px); height: calc(1.25rem - 6px); border-radius: 50%; background: var(--_tab-mcp-muted); }\n.tab-mcp-switch > :where(input:checked) { background: var(--tab-mcp-accent, var(--_tab-mcp-fg)); border-color: transparent; }\n.tab-mcp-switch > :where(input:checked)::before { left: calc(100% - 1.25rem + 4px); background: var(--tab-mcp-accent-text, var(--_tab-mcp-bg)); }\nhtml dialog.tab-mcp-dialog :where(.tab-mcp-switch > input:disabled) { opacity: 0.45; cursor: not-allowed; }\n.tab-mcp-destructive { color: var(--_tab-mcp-danger); }\n.tab-mcp-everything { font-weight: 600; }\n.tab-mcp-everything-note { color: var(--_tab-mcp-muted); }\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); } .tab-mcp-switch > :where(input)::before { transition: left 0.15s ease-out; } }\n@media (forced-colors: active) { html button.tab-mcp-primary { border-color: ButtonText; } .tab-mcp-switch > :where(input) { forced-color-adjust: none; background: Canvas; border-color: ButtonText; } .tab-mcp-switch > :where(input)::before { forced-color-adjust: none; background: ButtonText; } .tab-mcp-switch > :where(input:checked) { background: Highlight; } .tab-mcp-switch > :where(input:checked)::before { background: HighlightText; } }\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"
|
|
7
|
-
],
|
|
8
|
-
"mappings": ";;;;;AASO,IAAM,UAAU;AAAA,EACtB,MAAM;AAAA,EACN,KAAK;AAAA,EAEL,KAAK;AAAA,EAGL,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,MAAM;AAAA,EACN,OAAO;AAAA,EAEP,aAAa;AAAA,EACb,iBACC;AA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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;",
|
|
9
|
-
"debugId": "461C87FA3A5E330064756E2164756E21",
|
|
10
|
-
"names": []
|
|
11
|
-
}
|
package/webmcp-zq1enyz0.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
// src/webmcp.ts
|
|
2
|
-
var HINTS = [
|
|
3
|
-
"readOnlyHint",
|
|
4
|
-
"untrustedContentHint",
|
|
5
|
-
"consequentialHint",
|
|
6
|
-
"debugging"
|
|
7
|
-
];
|
|
8
|
-
function mirror(registry, context, call) {
|
|
9
|
-
const mirrors = new Map;
|
|
10
|
-
const warned = new Set;
|
|
11
|
-
const sync = () => {
|
|
12
|
-
for (const [tool, controller] of mirrors) {
|
|
13
|
-
if (registry.get(tool.name) === tool)
|
|
14
|
-
continue;
|
|
15
|
-
controller.abort();
|
|
16
|
-
mirrors.delete(tool);
|
|
17
|
-
}
|
|
18
|
-
for (const tool of registry.list()) {
|
|
19
|
-
const { annotations, callers } = tool;
|
|
20
|
-
const consequential = annotations.consequentialHint ?? annotations.destructiveHint;
|
|
21
|
-
if (mirrors.has(tool) || !(callers?.includes("webmcp") ?? !consequential))
|
|
22
|
-
continue;
|
|
23
|
-
const controller = new AbortController;
|
|
24
|
-
mirrors.set(tool, controller);
|
|
25
|
-
const hints = {
|
|
26
|
-
consequentialHint: consequential
|
|
27
|
-
};
|
|
28
|
-
for (const key of HINTS)
|
|
29
|
-
hints[key] ??= annotations[key];
|
|
30
|
-
const { signal } = controller;
|
|
31
|
-
Promise.resolve().then(() => signal.aborted || context.registerTool({
|
|
32
|
-
name: tool.name,
|
|
33
|
-
title: tool.title,
|
|
34
|
-
description: tool.description,
|
|
35
|
-
inputSchema: tool.inputSchema,
|
|
36
|
-
outputSchema: tool.outputSchema,
|
|
37
|
-
annotations: hints,
|
|
38
|
-
execute: (input, options) => call(tool, input, options?.signal)
|
|
39
|
-
}, { signal, exposedTo: tool.exposedTo })).catch((error) => {
|
|
40
|
-
if (signal.aborted)
|
|
41
|
-
return;
|
|
42
|
-
if (warned.has(tool.name))
|
|
43
|
-
return;
|
|
44
|
-
warned.add(tool.name);
|
|
45
|
-
console.warn(`tab-mcp: ${tool.name} is not offered through WebMCP:`, error);
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
registry.onChange(sync);
|
|
50
|
-
sync();
|
|
51
|
-
}
|
|
52
|
-
export {
|
|
53
|
-
mirror
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
//# debugId=68007C67B049549964756E2164756E21
|
|
57
|
-
//# sourceMappingURL=webmcp-zq1enyz0.js.map
|
package/webmcp-zq1enyz0.js.map
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/webmcp.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"/**\n * Mirroring the tools into the browser's own WebMCP (iteration 25, DEC-115,\n * DEC-119, DEC-143): with `webmcp: true`, each tool that is offered there is\n * also registered with `document.modelContext.registerTool()`, under its own\n * `AbortController`, aborted when the tool leaves the registry. A chunk of\n * its own (DEC-171), loaded by a `TabMcp` whose constructor found native\n * WebMCP (`nativeContext` in the core); a call loads the connection chunk,\n * which checks, confirms and runs it.\n */\n\nimport type { RegisteredTool, ToolRegistry } from \"./registry.ts\";\n\n/** What the library uses of the browser's `ModelContext`. */\nexport interface ModelContext {\n\tregisterTool(\n\t\ttool: object,\n\t\toptions: { signal: AbortSignal; exposedTo: string[] | undefined },\n\t): unknown;\n}\n\n/** Runs a call of a mirrored tool; `signal` is the browser's, if it gives one. */\nexport type WebMcpCall = (\n\ttool: RegisteredTool,\n\tinput: unknown,\n\tsignal: unknown,\n) => Promise<unknown>;\n\n/** The WebMCP hints; the MCP-only ones are left out. */\nconst HINTS = [\n\t\"readOnlyHint\",\n\t\"untrustedContentHint\",\n\t\"consequentialHint\",\n\t\"debugging\",\n] as const;\n\n/**\n * Mirror `registry`'s tools into `context`, now and whenever the registry\n * changes: those whose `callers` list `\"webmcp\"`, and without `callers` those\n * not marked consequential, where MCP's `destructiveHint` counts as\n * `consequentialHint` (DEC-143, DEC-165). Every failure of the native `registerTool()`\n * stays here: warned once per name, the tool still offered through the relay.\n */\nexport function mirror(\n\tregistry: ToolRegistry,\n\tcontext: ModelContext,\n\tcall: WebMcpCall,\n): void {\n\tconst mirrors = new Map<RegisteredTool, AbortController>();\n\tconst warned = new Set<string>();\n\tconst sync = (): void => {\n\t\tfor (const [tool, controller] of mirrors) {\n\t\t\tif (registry.get(tool.name) === tool) continue;\n\t\t\tcontroller.abort();\n\t\t\tmirrors.delete(tool);\n\t\t}\n\t\tfor (const tool of registry.list()) {\n\t\t\tconst { annotations, callers } = tool;\n\t\t\tconst consequential =\n\t\t\t\tannotations.consequentialHint ?? annotations.destructiveHint;\n\t\t\t// The one place of the rule for WebMCP (the relay and a port: `toolsFor`).\n\t\t\tif (mirrors.has(tool) || !(callers?.includes(\"webmcp\") ?? !consequential))\n\t\t\t\tcontinue;\n\t\t\tconst controller = new AbortController();\n\t\t\tmirrors.set(tool, controller);\n\t\t\tconst hints: Record<string, boolean | undefined> = {\n\t\t\t\tconsequentialHint: consequential,\n\t\t\t};\n\t\t\tfor (const key of HINTS) hints[key] ??= annotations[key];\n\t\t\tconst { signal } = controller;\n\t\t\tPromise.resolve()\n\t\t\t\t// Not once unmirrored: whatever the browser does with an aborted\n\t\t\t\t// signal.\n\t\t\t\t.then(\n\t\t\t\t\t() =>\n\t\t\t\t\t\tsignal.aborted ||\n\t\t\t\t\t\tcontext.registerTool(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: tool.name,\n\t\t\t\t\t\t\t\t// WebIDL dictionaries: `undefined` is the same as left out.\n\t\t\t\t\t\t\t\ttitle: tool.title,\n\t\t\t\t\t\t\t\tdescription: tool.description,\n\t\t\t\t\t\t\t\tinputSchema: tool.inputSchema,\n\t\t\t\t\t\t\t\toutputSchema: tool.outputSchema,\n\t\t\t\t\t\t\t\tannotations: hints,\n\t\t\t\t\t\t\t\texecute: (input: unknown, options?: { signal?: unknown }) =>\n\t\t\t\t\t\t\t\t\tcall(tool, input, options?.signal),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{ signal, exposedTo: tool.exposedTo },\n\t\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\t.catch((error: unknown) => {\n\t\t\t\t\tif (signal.aborted) return; // unmirrored meanwhile\n\t\t\t\t\tif (warned.has(tool.name)) return;\n\t\t\t\t\twarned.add(tool.name);\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t`tab-mcp: ${tool.name} is not offered through WebMCP:`,\n\t\t\t\t\t\terror,\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t}\n\t};\n\tregistry.onChange(sync);\n\tsync();\n}\n"
|
|
6
|
-
],
|
|
7
|
-
"mappings": ";AA4BA,IAAM,QAAQ;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AASO,SAAS,MAAM,CACrB,UACA,SACA,MACO;AAAA,EACP,MAAM,UAAU,IAAI;AAAA,EACpB,MAAM,SAAS,IAAI;AAAA,EACnB,MAAM,OAAO,MAAY;AAAA,IACxB,YAAY,MAAM,eAAe,SAAS;AAAA,MACzC,IAAI,SAAS,IAAI,KAAK,IAAI,MAAM;AAAA,QAAM;AAAA,MACtC,WAAW,MAAM;AAAA,MACjB,QAAQ,OAAO,IAAI;AAAA,IACpB;AAAA,IACA,WAAW,QAAQ,SAAS,KAAK,GAAG;AAAA,MACnC,QAAQ,aAAa,YAAY;AAAA,MACjC,MAAM,gBACL,YAAY,qBAAqB,YAAY;AAAA,MAE9C,IAAI,QAAQ,IAAI,IAAI,KAAK,EAAE,SAAS,SAAS,QAAQ,KAA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