/** * Consent Popup Launcher * * The framework returns a *markdown link* by default when a tool requires * delegation: the agent surfaces the link to the user, who clicks through to * the consent page in a normal browser tab. * * For clients that ship an embedded browser (today: `.mcpb`-installed Claude * Desktop), we can do better — return a structured-content UI resource that * opens a stripped-chrome popup window with the consent URL preloaded. The * popup closes itself on success. The user never leaves the chat. * * This module is runtime-agnostic. It returns plain data; the runtime adapter * (e.g. `@kya-os/mcp-i-cloudflare`) is responsible for delivering the chosen * representation back to the MCP client. * * @module @kya-os/consent/popup/launcher */ /** * Stable identifiers for clients that support the embedded popup launcher. * * These IDs match the canonical IDs in `@kya-os/mcp-i-cloudflare`'s * `findKnownClient` registry. Adding a new client here requires that the * client also surface a usable embedded browser. */ export declare const POPUP_CAPABLE_CLIENT_IDS: readonly ["claude"]; export type PopupCapableClientId = (typeof POPUP_CAPABLE_CLIENT_IDS)[number]; /** * Decide whether the consent flow should be presented as a popup for this * client + config combination. Falls back to `false` when either input * disqualifies the popup path. * * @param clientId - Canonical client id from `findKnownClient`. Pass the * `id` field, not the raw `clientInfo.name` string. * @param popupEnabled - The resolved `popupEnabled` flag from `ResolvedUI`. */ export declare function shouldUsePopup(clientId: string | undefined, popupEnabled: boolean | undefined): clientId is PopupCapableClientId; /** * Default popup window size. Matches the consent screen's max width * (`max-w-[512px]`) plus enough vertical room for the capability list and * the action bar. */ export declare const POPUP_WINDOW_FEATURES: { readonly width: 520; readonly height: 760; }; /** * The structured-content payload returned to the MCP client when we want it to * open the consent page in a popup. The MCP client must be able to render * `application/vnd.kya-os.consent-popup+json` as an action; otherwise the * runtime should fall back to the markdown link. * * The schema mirrors the MCP UI resource shape: a single content block with * a uri (the consent URL) and a hint to open in a popup with the given * window features. */ export interface ConsentPopupResource { type: "kya-os/consent-popup"; consentUrl: string; features: { width: number; height: number; }; /** * Markdown fallback the client can display if it does not understand the * popup hint. Same content as `buildConsentMarkdownLink`, included so a * single response works for both popup-aware and popup-naive clients. */ fallbackMarkdown: string; } /** * Build the popup resource payload for a given consent URL. */ export declare function buildPopupResource(consentUrl: string): ConsentPopupResource; /** * Markdown text the framework returns when the client doesn't support the * popup path. Identical to the historical `Authorize the action here →` * line so existing flows are unchanged. */ export declare function buildConsentMarkdownLink(consentUrl: string): string; //# sourceMappingURL=launcher.d.ts.map