([\s\S]*?)<\/code>/g, '`$1`')
- .replace(/<[^>]+>/g, '')
- .trim()
- const section = (heading) => {
- const match = new RegExp(`${heading}
([\\s\\S]*?)`).exec(body)
- if (!match) fail(`index.md has no section "${heading}"`)
- return match[1]
- }
- const paragraphs = (chunk) => [...chunk.matchAll(/]*>([\s\S]*?)<\/p>/g)].map((m) => html(m[1]))
- const [lede] = paragraphs(section('The polyfills'))
- const poc = /
([\s\S]*?)<\/p>/.exec(body)
- if (!poc) fail('index.md has no proof-of-concept notice (
)')
- const notice = html(poc[1].replace(/([\s\S]*?)<\/strong>/g, '**$1**'))
- const card = (p) => {
- const cut = media.cuts.find((c) => c.name === p.cut)
- const hosts = HOSTS.filter(({ name }) => p.hosts.includes(name))
- const lines = [
- `### ${p.name} (\`${p.plugin}\`)`,
- '',
- `${p.id ? `\`${p.id}\`, ` : ''}${p.spec}. Early.`,
- '',
- p.line,
- '',
- 'Hosts:',
- '',
- ...hosts.map(({ name }) => `- ${name}`),
- ]
- const block = (command, language) => [language ? `\`\`\`${language}` : command.startsWith('/') ? '```' : command.startsWith('{') ? '```json' : '```bash', command, '```']
- if (p.addStep) lines.push('', p.addStep)
- for (const host of hosts) {
- const form = FORMS[host.name]?.[p.plugin]
- const add = form?.add ?? p[host.addKey]
- const ask = form?.ask ?? p.ask
- const command = form?.command ?? host.command
- const start = host.start ?? `start \`${command}\``
- lines.push('', `**${host.name}**`, '')
- if (add?.startsWith('{') || form?.language === 'yaml') lines.push(`In \`${host.config}\`:`, '')
- if (add) lines.push(...block(add, form?.language), '', `Then ${start} and ask: "${ask}"`)
- else lines.push(`Nothing to set up. ${start[0].toUpperCase()}${start.slice(1)} and ask: "${ask}"`)
- }
- if (p.then) lines.push('', p.then)
- if (p.note) lines.push('', p.note)
- if (p.plugin === 'mcp-apps-cli') lines.push('', PI_APPS_LIMIT, '', OPENCODE_APPS_LIMIT, '', ANTIGRAVITY_APPS_LIMIT, '', COPILOT_APPS)
- lines.push('', videoLine({ file: cut.file, seconds: cut.seconds, description: p.alt }), '', `The ${p.name} guide: ${resolveLink(p.link, 'index')}`)
- return lines.join('\n')
- }
- const cards = home.polyfills.map(card)
- const beyondCards = home.beyond.map(card)
- const audiences = home.audiences.map((a) => `- **${a.title}.** ${a.text} [${a.linkText}](${resolveLink(a.link, 'index')})`)
-
- return `# ${data.title ?? 'AgentPolyfill'}
-
-> ${/[.!?]$/.test(text) ? text : `${text}.`} ${tagline}
-
-${notice}
-
-${hostTable()}
-
-## Install
-
-**Claude Code** (2.1.329 or newer). At the prompt of a \`claude\` session, install every polyfill at once, then start a new session:
-
-\`\`\`
-${INSTALL}
-\`\`\`
-
-The same works in a terminal: \`${INSTALL_CLI}\`. ${CLAUDE_CODE_SKILLS}
-
-**Codex** (0.170 or newer; Skills was tested on 0.172; Node 20 or newer). In a terminal:
-
-\`\`\`bash
-${INSTALL_CODEX.join('\n')}
-\`\`\`
-
-Apps isn't in Codex yet, and Codex has no bundle.
-
-**Pi** (1.6.0, the version tested; Node 22 or newer). In a terminal:
-
-\`\`\`bash
-${INSTALL_PI.join('\n')}
-\`\`\`
-
-${PI_INSTALL_NOTES}
-
-${PI_APPS_LIMIT}
-
-**OpenCode** (2.4 or newer, tested with 2.4.1; Git). In a terminal:
-
-\`\`\`bash
-${INSTALL_OPENCODE.join('\n')}
-\`\`\`
-
-${OPENCODE_INSTALL_NOTES}
-
-${OPENCODE_APPS_LIMIT}
-
-**Antigravity** (App v2.35.1 and CLI v1.5.17; not supported in the IDE, which documents no plugin hooks; Node 20 or newer and Git on \`PATH\`). From GitHub, with the Antigravity CLI:
-
-\`\`\`bash
-${INSTALL_ANTIGRAVITY.join('\n')}
-\`\`\`
-
-${ANTIGRAVITY_INSTALL_NOTES}
-
-${ANTIGRAVITY_ADD_NOTES}
-
-${ANTIGRAVITY_APPS_LIMIT}
-
-**Copilot CLI** (1.0.115, the version tested). In a terminal, from a clone:
-
-\`\`\`bash
-${INSTALL_COPILOT.join('\n')}
-\`\`\`
-
-${COPILOT_INSTALL_NOTES}
-
-${COPILOT_BUILT_IN}
-
-**Hermes Agent** (v0.23.4, the version tested; Node 20 or newer on the gateway's machine). In a terminal:
-
-\`\`\`bash
-${INSTALL_HERMES.join('\n')}
-\`\`\`
-
-${HERMES_INSTALL_NOTES}
-
-${HERMES_APPS}
-
-**T3 Code.** ${T3_NOTE}
-
-Beyond MCP, ARD is a draft. Every search asks you first and goes to a registry you choose. Install it separately:
-
-- **Claude Code:** \`/plugin install ard-discovery --marketplace idosal/AgentPolyfill\`; it isn't in the bundle.
-- **Codex:** \`codex plugin add ard-discovery@agent-polyfill\`.
-- **Pi:** \`pi install ./polyfills/ard/pi/extension\` from a clone; it is left out of the one-line install.
-- **OpenCode:** \`${OPENCODE_FORMS['ard-discovery'].add}\` (included in the commands above).
-- **Antigravity:** \`${ANTIGRAVITY_FORMS['ard-discovery'].add}\` (included in the commands above).
-- **Copilot CLI:** \`copilot plugin install ard-discovery@agent-polyfill\`, with the marketplace added (included in the commands above).
-- **Hermes:** \`hermes plugins install idosal/AgentPolyfill/polyfills/ard/hermes/plugin --enable\` (included in the commands above).
-
-${videoLine({ file: media.launch.file, seconds: media.launch.seconds, description: media.launch.description })}
-
-## The polyfills
-
-${lede}
-
-${cards.join('\n\n')}
-
-## Beyond MCP
-
-${beyondCards.join('\n\n')}
-
-## Who it is for
-
-${audiences.join('\n')}
-
----
-
-This page on the web: ${pageUrl('index')}
-`
+ const installGuide = /^## Install$[\s\S]*?(?=^## (?!#)|^---$)/m.exec(pageMarkdown('guide/getting-started'))
+ if (!installGuide) fail('getting-started.md needs an Install section')
+ const cards = [...home.polyfills, ...home.beyond].map((entry) => {
+ const cut = media.cuts.find((video) => video.name === entry.cut)
+ return [
+ `## ${entry.name}`,
+ `${entry.line} ${entry.note ?? ''}`.trim(),
+ `Plugin: \`${entry.plugin}\`. Hosts: ${entry.hosts.join(', ')}. Specification: ${entry.spec}.`,
+ `[Setup and examples](${resolveLink(entry.link, 'index')})`,
+ videoLine({ ...cut, description: entry.alt }),
+ ].join('\n\n')
+ })
+ return [
+ '# AgentPolyfill',
+ description('index'),
+ `[Install a plugin](${markdownUrl('guide/getting-started')}) · [Host support](${markdownUrl('guide/introduction')})`,
+ installGuide[0].trim(),
+ videoLine(media.launch),
+ ...cards,
+ `[Contribute a polyfill](${markdownUrl('guide/contributing')}) · [Security](${markdownUrl('guide/security')})`,
+ ].join('\n\n') + '\n'
}
// The community directory as Markdown: one item per listed polyfill.
@@ -523,138 +232,17 @@ function title(page) {
}
function llmsTxt() {
- const { data } = frontMatter(readFileSync(join(site, 'index.md'), 'utf8'))
const sections = SECTIONS.map(
([heading, list]) => `## ${heading}\n\n${list.map((page) => `- [${title(page)}](${markdownUrl(page)}): ${description(page)}`).join('\n')}`,
)
return `# AgentPolyfill
-> ${data.description}
-
-AgentPolyfill makes polyfills for agent protocols: it brings more of MCP to the clients you already use, before they support it. Each MCP polyfill implements the client side of one published extension, follows that extension's spec with stated exceptions, and can be removed or disabled once the host ships its own. Servers don't change.
-
-${hostTable()}
-
-The MCP polyfills implement Events (SEP-3415), Skills (SEP-2640), Server Cards (SEP-2127) and Apps (MCP Apps 2026-01-26). It's an early proof of concept: some gaps, like servers behind OAuth, need small changes to the hosts' plugin APIs (${origin}/guide/how-it-works.md). ${PI_APPS_LIMIT} ${OPENCODE_APPS_LIMIT} ${ANTIGRAVITY_APPS_LIMIT} ${COPILOT_BUILT_IN} ${HERMES_APPS}
-
-Beyond MCP, \`ard-discovery\` adds Agentic Resource Discovery v0.91 (a draft). A search sends the words of your request to the ARD registry you choose and asks you first every time, so ARD is installed separately. Checked in Pi 1.6.0: domain discovery, and an approved search of the repository's demo registry. Checked in OpenCode 2.4.1: reading buildkite.com's \`ard.json\`, and a search of the repository's demo registry after OpenCode asked (no public registry that takes an unauthenticated search was found). In Antigravity, every registry search and every addition is put to you in Antigravity's approval card. Checked in Copilot CLI 1.0.115: domain discovery, and a search of the repository's demo registry going out only after Copilot's tool prompt and the plugin's form. In Pi, OpenCode and Copilot CLI, adding through ARD is checked by the forms' tests only. Checked in Hermes v0.23.4: domain discovery of buildkite.com; search, referrals and adding are checked by the form's tests only.
-
-## Install
-
-- **Claude Code 2.1.329 or newer:** every MCP polyfill, the \`agent-polyfill\` bundle, from a terminal: \`${INSTALL_CLI}\`. At the prompt of a \`claude\` session it is \`${INSTALL}\`. Start a new session for the plugins to load. ARD is separate: \`/plugin install ard-discovery --marketplace idosal/AgentPolyfill\`. ${CLAUDE_CODE_SKILLS}
-- **Codex 0.170 or newer (Node 20 or newer):** from a terminal: \`${INSTALL_CODEX.join(' && ')}\`. ARD is separate: \`codex plugin add ard-discovery@agent-polyfill\`. There is no bundle.
-- **Pi 1.6.0 (the version tested; Node 22 or newer):** one line installs Events, Skills and Server Cards together; the commands are below.
-- **OpenCode 2.4 or newer (tested with 2.4.1; Git; no Node):** one \`opencode plugin add\` per polyfill, from GitHub, after Pi's below.
-- **Antigravity (App v2.35.1 and CLI v1.5.17; not supported in the IDE; Node 20 or newer on \`PATH\`; installing needs the Antigravity CLI):** use the Antigravity clone commands after OpenCode's below.
-- **Copilot CLI 1.0.115 (the version tested):** from a terminal, from a clone: \`${INSTALL_COPILOT.join(' && ')}\`. ARD is in those commands. Events needs experimental mode (\`copilot --experimental\`); Server Cards and ARD need Node 20 or newer. There is no bundle; the notes follow Antigravity's below.
-- **Hermes Agent v0.23.4 (the version tested; Node 20 or newer on the gateway):** one plugin per form; the commands and required settings follow Copilot's below.
-- **T3 Code:** not a host of its own here; see the T3 Code paragraph below.
-
-\`\`\`bash
-${INSTALL_PI.join('\n')}
-\`\`\`
-
-${PI_INSTALL_NOTES}
-
-In Pi, Events and Skills use their own MCP connections, so a local (stdio) server runs twice. They cannot use Pi's OAuth or \`auth.provider\` sign-ins, and never read Pi's stored credentials. An \`Authorization\` header in \`mcp.json\` works, written out or using \`\${VARIABLE}\` or \`!command\`. Events needs protocol revision 2026-07-28; Pi's own client stops at 2025-11-25. With Pi's MCP support off, Events and Skills stand down too. Servers another extension registers later are reached after \`/reload\`.
-
-Pi runs tools without asking unless a permission extension asks. Each polyfill asks before its consequential step: a watch, a skill load, a search or an add. Skills meets X8: a cross-server read while a served skill is loaded asks first, naming both servers. There is no per-skill switch in Pi; server-level \`skip\` in \`mcp-skills/settings.json\` leaves out a server's skills. None of the Pi forms detects native support automatically; remove it or use its off switch when Pi supports it itself:
-
-| Pi form | Off switch |
-|---|---|
-| Events | \`MCP_EVENTS_OFF=1\` |
-| Skills | \`MCP_SKILLS_OFF=1\` |
-| Server Cards | \`MCP_SERVER_CARDS_DISABLED=1\` |
-| ARD | \`ARD_DISCOVERY_DISABLED=1\` |
-
-OpenCode, one plugin per polyfill, from a terminal:
-
-\`\`\`bash
-${INSTALL_OPENCODE.join('\n')}
-\`\`\`
-
-${OPENCODE_INSTALL_NOTES}
-
-In OpenCode, Events and Skills use their own MCP connections, so a local server runs twice. They cannot reach a server OpenCode signs in to with OAuth (\`opencode mcp auth\`), and never read OpenCode's stored credentials; the headers in a server's OpenCode configuration work. Server Cards and ARD add a server to OpenCode's MCP servers for the project, and OpenCode connects it with its own client and sign-in. Only streamable HTTP servers are added, and for a card that needs a secret the answer gives the \`opencode.json\` entry, with \`{env:VAR}\`, to add by hand. Events watches resume when OpenCode next opens the project. Events departs from contract rule 4: OpenCode's own client takes push events for its automations, but doesn't poll or take webhooks and skips event types whose schemas it can't check, so the polyfill watches every type and tells the model to use a watch or an automation for an event type, not both.
-
-OpenCode's shipped permission rules allow every action. Each polyfill puts its own actions to those rules and asks by default: a watch, a skill load, a read of another server's resource while a served skill is loaded (X8, naming both servers), an addition or a search. A \`deny\` or \`ask\` rule you write wins; with nobody there to answer, OpenCode refuses. The plugin option \`askByDefault: false\`, or the variable below, leaves it to OpenCode's rules alone; an \`allow\` rule you write doesn't skip the question. In OpenCode 2.4.1's TUI, the prompt says only "Call tool ", with the details on the model's call line above it, and a prompt for a registry an ARD referral names shows no host. After a load or a wake, what the model does goes through OpenCode's rules, whose default allows it. When OpenCode supports an extension itself, remove that plugin or use its off switch:
-
-| OpenCode form | Off switch | Leave it to OpenCode's rules |
-|---|---|---|
-| Events | \`MCP_EVENTS_OFF=1\` | \`MCP_EVENTS_ASK_BY_DEFAULT=0\` |
-| Skills | \`MCP_SKILLS_OFF=1\` | \`MCP_SKILLS_ASK_BY_DEFAULT=0\` |
-| Server Cards | \`MCP_SERVER_CARDS_DISABLED=1\` | \`MCP_SERVER_CARDS_ASK_BY_DEFAULT=0\` |
-| ARD | \`ARD_DISCOVERY_DISABLED=1\` | \`ARD_DISCOVERY_ASK_BY_DEFAULT=0\` |
-
-Each also takes the plugin options \`{"off": true}\` and \`{"askByDefault": false}\`, in the object form of its entry in \`plugins\`.
-
-Antigravity, from GitHub:
-
-\`\`\`bash
-${INSTALL_ANTIGRAVITY.join('\n')}
-\`\`\`
-
-${ANTIGRAVITY_INSTALL_NOTES}
-
-${ANTIGRAVITY_ADD_NOTES}
-
-In Antigravity, an MCP server isn't told which conversation calls it, and Antigravity's MCP client cancels every elicitation request without showing it. So each plugin pairs its MCP server with a \`PreToolUse\` hook, which passes the conversation id to the call and asks through Antigravity's own approval card (\`force_ask\`). The hook leaves a one-use ticket for exactly that call, and the server acts only with it. A watch asks in the approval card. New events reach a conversation at its next model call, through the plugin's \`PreInvocation\` hook (checked in CLI 1.5.17; Antigravity's plugins page doesn't list \`PreInvocation\` among plugin hooks), as fixed text with a count and the plugin's own watch ids, nothing a server wrote. Only App conversations can be woken, through the sidecar. A watch restarts when its conversation next calls the plugin, as a resumed CLI conversation did. The IDE documents no plugin hooks, so the forms aren't supported there, and their gated calls are refused. Events and Skills read \`~/.gemini/config/mcp_config.json\`, header values included, and can't reach servers behind Antigravity's own sign-in. A card that needs a secret can't be added: Antigravity's personal \`mcp_config.json\` reads no \`\${VAR}\`, and the plugin never writes a secret. Skills doesn't meet X8: once a served skill is loaded, its hook asks (\`force_ask\`) before a \`read_resource\` from another server, but Antigravity (CLI 1.5.17, App 2.35.1) ignores that question, shows no card and lets the read go ahead. ARD carries the Server Cards checks and add step itself, and has no default registry: name one, or set \`ARD_DISCOVERY_REGISTRY\` in the environment Antigravity starts in.
-
-Antigravity's own approval system is the boundary. Each form's own actions (a watch, a new or changed skill load, an addition, a registry search) ask in the approval card through \`force_ask\`, yes or no; the App greys out its "always allow" choices, and the CLI's card still lists them and shows only the question's first two lines. Nothing is auto-approved. The other Events tools, an approved unchanged skill load and skill file reads pass with a ticket and then get Antigravity's usual MCP question, which allow rules can skip. By default that question is asked: the interactive CLI starts in auto mode, where an MCP tool call still asks, and headless \`agy -p\` reports \`request-review\` and denies a call nobody answers. Whether \`--dangerously-skip-permissions\` also skips \`force_ask\` hasn't been checked. In CLI 1.5.17 a \`PreToolUse\` hook that fails makes the call fail. Upstream conformance (suite at c8625de): Skills passes all four client scenarios; Events passes 17 of 17 checks of conformance PR #541, through the form's MCP server and its real hook. Editors on \`agy acp\` see the tool and its arguments, not the question. The forms never open \`~/.gemini/antigravity/mcp_oauth_tokens.json\` or any sign-in store. Not checked: a webhook watch, and an addition through ARD in the App. None of them detects native support; Antigravity tells plugins nothing about its MCP client's extensions. Disable or uninstall the plugin (\`agy plugin disable \`), or use its off switch:
-
-| Antigravity form | Off switch |
-|---|---|
-| Events | \`MCP_EVENTS_OFF=1\`, or \`{"MCP_EVENTS_OFF": "1"}\` in \`~/.gemini/agentpolyfill/mcp-events/settings.json\` |
-| Skills | \`MCP_SKILLS_DISABLED=1\`, or \`"off": true\` in \`~/.gemini/agentpolyfill/mcp-skills/settings.json\` |
-| Server Cards | \`MCP_SERVER_CARDS_DISABLED=1\` |
-| ARD | \`ARD_DISCOVERY_DISABLED=1\` |
-
-Copilot CLI, from a clone added as a marketplace:
-
-\`\`\`bash
-${INSTALL_COPILOT.join('\n')}
-\`\`\`
-
-${COPILOT_INSTALL_NOTES}
-
-In Copilot CLI, Events uses Copilot's extension API, which is experimental: extensions load only in experimental mode, and the API may change in any release. \`copilot --acp\` loads no extensions, and \`copilot -p\` ends the session with the prompt, so nothing is woken there. Events opens its own MCP connection, so a local (stdio) server runs twice. It can't use a sign-in through Copilot (\`/mcp auth\`, OAuth). A header in \`mcp-config.json\` works, written out or from \`\${VARIABLE}\`, except variables Copilot strips from extensions. It reads only the servers Copilot enables for the session, from \`mcp-config.json\` and a trusted project's \`.mcp.json\` or \`.github/mcp.json\`; servers a plugin brings, \`--additional-mcp-config\` and the built-in GitHub server are listed as unavailable. It needs an open session; \`copilot --resume\` picks watches up from their cursors. Server Cards and ARD add a server with \`copilot mcp add\`; it connects after \`/mcp reload\` or in the next session. Copilot declines their form in \`copilot -p\`, even with \`--yolo\`, so adding works in the interactive session only. Neither compares a card with the live server (S-3). Checked in VS Code 1.147.0's Copilot harness: Events end to end, where a wake shows as a message from the plugin, then the turn; and Server Cards adding a server, through VS Code's tool prompt and then the plugin's form, which VS Code shows as one paragraph. ARD's server loads there, but no search was checked through it.
-
-Copilot can approve a tool call without asking you: in assisted mode (an LLM review, which an organisation can make the default) or with allow-all. So each Copilot form asks its own question after Copilot's tool prompt. \`watch_event\` and \`unwatch_event\` go through Copilot's tool prompt, then, before a watch starts, Events asks in a Copilot dialog, naming the server, the event type, the filters and the note, and saying that events will start turns; **Don't watch it** comes first. Where nobody can be asked (\`copilot -p\`), the watch is refused. \`MCP_EVENTS_ASK_BY_DEFAULT=0\` turns that question off and leaves watches to Copilot's rules alone. This question was not checked in VS Code. \`add_mcp_server\` and \`ard_search\` go through Copilot's tool prompt, then the plugin's form, which Copilot declines where nobody can be asked (\`copilot -p\`, even with \`--yolo\`). \`ard_search\` is marked as not read-only, because Copilot's default mode runs read-only tools without asking. Once you grant it elevated permissions, the Events extension skips the prompt only for its four tools that only read. Events uses only the servers Copilot enables for the session, and lets go of one you switch off. None reads Copilot's stored credentials. None of the Copilot forms detects native support; when Copilot supports an extension itself, uninstall or disable the plugin (\`copilot plugin disable @agent-polyfill\`), or use its off switch:
-
-| Copilot CLI form | Off switch |
-|---|---|
-| Events | \`MCP_EVENTS_OFF=1\` |
-| Server Cards | \`MCP_SERVER_CARDS_DISABLED=1\` |
-| ARD | \`ARD_DISCOVERY_DISABLED=1\` |
-
-Hermes Agent, one plugin per form:
-
-\`\`\`bash
-${INSTALL_HERMES.join('\n')}
-\`\`\`
-
-${HERMES_INSTALL_NOTES}
-
-${HERMES_BEHAVIOR}
-
-When Hermes supports a form itself, disable it with \`hermes plugins disable \`. Events already leaves servers with \`events: true\` to Hermes, from the next turn after the setting changes.
-
-| Hermes form | Off switch |
-|---|---|
-| Events | \`hermes plugins disable mcp-events\` |
-| Skills | \`hermes plugins disable mcp-skills\` |
-| Server Cards | \`hermes plugins disable mcp-server-cards\` |
-| ARD | \`hermes plugins disable ard-discovery\` |
-
-${T3_NOTE}
-
-Anyone can build a polyfill to the contract, bring an existing one to another host, or list one they keep in their own repository in the community directory (${origin}/guide/community.md).
-
-By Ido Salomon (https://x.com/idosal1). Not affiliated with Anthropic, OpenAI, GitHub, MCP, Agentic Resource Discovery or the Agentic AI Foundation (AAIF). Source: https://github.com/idosal/AgentPolyfill (Apache-2.0).
-
-Every page of this site is also plain Markdown at its address plus \`.md\`, and all of them together are at ${origin}/llms-full.txt.
+> ${description('index')}
-- [Home](${markdownUrl('index')}): what a polyfill does, the install for each host, the polyfills with a demo server and a first question for each, and the launch video.
+- [Host support](${markdownUrl('guide/introduction')}#the-polyfills)
+- [Install a plugin](${markdownUrl('guide/getting-started')}#install)
+- [All guides in one file](${origin}/llms-full.txt)
+- [Source](https://github.com/idosal/AgentPolyfill)
${sections.join('\n\n')}
`