import type { FafData } from '../core/types.js'; import { type ContextBlockOptions } from './context-block.js'; export declare const A2A_PROTOCOL_BINDING = "JSONRPC"; export declare const A2A_PROTOCOL_VERSION = "1.0"; /** The three FAF-family media types, in family order. */ export declare const FAF_MEDIA_TYPES: readonly ["application/vnd.faf+yaml", "application/vnd.fafm+yaml", "application/vnd.fafa+yaml"]; /** The only `$schema` a Server Card may carry (modelcontextprotocol/ext-server-card). */ export declare const SERVER_CARD_SCHEMA = "https://static.modelcontextprotocol.io/schemas/v1/server-card.schema.json"; /** The dated registry schema a `server.json` declares (latest release 2025-12-11). */ export declare const SERVER_JSON_SCHEMA = "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json"; export declare const AI_CATALOG_SPEC_VERSION = "1.0"; export declare const FAFA_SPEC_VERSION = "1.0"; /** Media types a catalog entry uses for each card it lists (AI Catalog's own list). */ export declare const CARD_MEDIA_TYPES: { readonly a2a: "application/a2a-agent-card+json"; readonly server_card: "application/mcp-server-card+json"; readonly fafa: "application/vnd.fafa+yaml"; }; export interface FafaAgent { name?: string; displayName?: string; id?: string; vendor?: string; version?: string; description?: string; homepage?: string; license?: string; } export interface FafaCapability { name?: string; type?: string; description?: string; tags?: unknown; /** MIME type this capability reads, when it's one of the FAF family — drives the skill's `inputModes` and the card's `defaultInputModes`. */ cites_spec?: string; } export interface FafaEndpoint { protocol?: string; transport?: string; location?: string; version?: string; } /** Facts only some cards carry, kept in the `.fafa` under `metadata.cards` so the file stays the one source. */ export interface PackExtras { domain?: string; repository?: string; icon?: string; organizationUrl?: string; keywords?: string[]; examples?: string[]; packages?: PackPackage[]; } export interface PackPackage { registryType: string; identifier: string; version?: string; } export interface FafaDoc { /** `.fafa` spec version this document is authored against, e.g. `"1.0"` — not `agent.version`. */ version?: string; agent?: FafaAgent; capabilities?: FafaCapability[]; endpoints?: FafaEndpoint[]; provenance?: Record; metadata?: { persona?: string; cards?: PackExtras; [key: string]: unknown; }; [key: string]: unknown; } export interface A2AExtension { uri: string; description: string; required: boolean; params: Record; } export interface ProjectedA2A { name: string; description: string; supportedInterfaces: Array<{ url: string; protocolBinding: string; protocolVersion: string; }>; /** Omitted entirely when `agent.vendor` or `agent.homepage` is absent — A2A optional, never a guessed org name. */ provider?: { organization: string; url: string; }; version: string; capabilities: { streaming: boolean; pushNotifications: boolean; extendedAgentCard: boolean; extensions: A2AExtension[]; }; defaultInputModes: string[]; defaultOutputModes: string[]; skills: Array<{ id: string; name: string; description: string; tags: string[]; inputModes?: string[]; }>; } export declare function a2aEndpoints(fafa: FafaDoc): FafaEndpoint[]; /** Authored A2A endpoints, else a single `doorUrl`. Never invents a door. */ export declare function a2aDoors(fafa: FafaDoc, opts?: { doorUrl?: string; }): FafaEndpoint[]; /** * FAF's context extension for the A2A card (BEST). Its `params` are a superset * of {@link fafContextBlock}, enriched with `.fafa`-specific identity that only * makes sense for an agent card (agentId, passport, the full FAF media-type * family). Nests the base block's `faf`/`mediaType` under `provenance` rather * than flattening them, per the extension's own shape (`§7` of the field * mapping). The Server Card and registry `_meta` stay on the plain * {@link fafContextBlock} shape. */ export declare function fafaContextExtension(fafa: FafaDoc, faf: FafData, opts?: ContextBlockOptions): A2AExtension; /** * The A2A Agent Card from a `.fafa`: every field comes from the document, and * `capabilities.extensions` holds exactly the extensions passed (none by default). */ export declare function projectA2ACard(fafa: FafaDoc, opts?: { doorUrl?: string; extensions?: A2AExtension[]; }): ProjectedA2A; /** What someone tells the front door. Keys match the crosswalk's slot ids. */ export interface PackAnswers { display_name: string; handle: string; domain: string; description: string; version: string; endpoints?: Array<{ protocol: string; url: string; }>; skills?: Array<{ name: string; description?: string; type?: string; }>; organization?: string; organization_url?: string; homepage?: string; icon?: string; repository?: string; license?: string; tags?: string[]; example_requests?: string[]; packages?: PackPackage[]; /** What the packages are: an MCP server (default), a CLI or a library. It is * the protocol of each package's stdio endpoint. */ package_kind?: string; } /** What a package can be. The `.fafa` endpoint protocol is an open vocabulary; * these are the ones faf writes for a package. */ export declare const PACKAGE_KINDS: readonly ["mcp", "cli", "library"]; /** Write the `.fafa` a set of answers describes. Throws, naming the answer, when one is missing or malformed. */ export declare function answersToFafa(a: PackAnswers): FafaDoc; /** The `.fafa` as the YAML document people keep. */ export declare function fafaYaml(fafa: FafaDoc): string; /** Where the `.fafa` says it is published: `agent.id` (urn:air), else metadata, else the homepage host. */ export declare function fafaDomain(fafa: FafaDoc): string; /** The stable short name a card is filed under: `agent.name`, lowercased and * reduced to the characters an identifier may carry. The `{name}` of * `urn:air:{publisher}:{namespace}:{name}` — never a display string. */ export declare function fafaHandle(fafa: FafaDoc): string; /** MCP names are reverse-DNS: example.com + weather → com.example/weather. */ export declare function mcpName(fafa: FafaDoc): string; /** The `.fafa`'s MCP endpoints at an http(s) URL — what a Server Card describes. */ export declare function mcpRemotes(fafa: FafaDoc): Array<{ type: string; url: string; }>; /** True when the `.fafa` names an MCP endpoint, at a URL or as a package. A * CLI, a library or an A2A agent has none, and gets no MCP card. */ export declare function hasMcpEndpoint(fafa: FafaDoc): boolean; /** True when the `.fafa` gives a registry entry: an MCP endpoint, and a package * or a remote MCP URL. */ export declare function hasRegistryEntry(fafa: FafaDoc): boolean; /** The registry identity from the `.fafa`: `name`, and `title` when it has one. */ export declare function registryIdentity(fafa: FafaDoc): { name: string; title?: string; }; /** The MCP Server Card for a remote MCP server. With a project.faf (`faf`, * BEST) it carries FAF's context block at `_meta["one.faf/context"]`. */ export declare function projectServerCard(fafa: FafaDoc, faf?: FafData, opts?: ContextBlockOptions): Record; /** The MCP Registry `server.json` (publishing it stays the owner's step). With * a project.faf (`faf`, BEST) it carries FAF's context block in the registry's * publisher-provided `_meta`. */ export declare function projectServerJson(fafa: FafaDoc, faf?: FafData, opts?: ContextBlockOptions): Record; export type PackCard = 'a2a' | 'server_card' | 'server_json' | 'ai_catalog' | 'ard' | 'fafa'; export interface CatalogRow { identifier: string; displayName: string; type: string; description: string; url: string; version?: string; updatedAt: string; } /** Options for the catalog rows. */ export interface CatalogRowOptions { /** `updatedAt` for the rows; otherwise now. */ now?: string; /** List the `.fafa` itself (served at /.well-known/fafa). Default true: it is * the source of the cards — what makes them BETTER. */ listFafa?: boolean; /** Public URL of the A2A card; default the domain's /.well-known/agent-card.json. */ a2aCardUrl?: string; /** An A2A door when the `.fafa` names none (as `faf cards --door-url`). */ doorUrl?: string; } /** One row per card the domain serves: the A2A card (when the `.fafa` names an * A2A door), the Server Card (when it names a remote MCP URL), and the `.fafa`. */ export declare function catalogRows(fafa: FafaDoc, cards: PackCard[], opts?: CatalogRowOptions): CatalogRow[]; /** Who publishes a catalog: AI Catalog's `host` object. */ export interface CatalogHost { displayName: string; identifier?: string; } /** * The catalog's `host` — who publishes these entries. Naming one is what * lifts a catalog from Level 1 "minimal" to Level 2 "discoverable", and * `displayName` is the field that does it: the validator takes an empty one * as *invalid*, not as minimal. So a `.fafa` that names nobody gets no host * at all — a minimal catalog that validates beats a discoverable one that * does not. `identifier` rides along whenever the `.fafa` says where it * lives, and is left off when it does not. */ export declare function catalogHost(fafa: FafaDoc): CatalogHost | undefined; /** The AI Catalog for the domain: every row above, with the host named. */ export declare function projectAiCatalog(fafa: FafaDoc, cards: PackCard[], opts?: CatalogRowOptions): Record; /** * The search hints ARD reads, from the `.fafa`: `metadata.cards.keywords` and * `metadata.cards.examples`. An entry with no `representativeQueries` is, in * the conformance CLI's own words, "a valid catalog entry but not a * discoverable ARD entry" — the semantic index is built from that term. */ export declare function ardHints(fafa: FafaDoc): { tags?: string[]; representativeQueries?: string[]; }; /** The ARD manifest: the catalog, plus the search hints ARD reads. ARD builds * on ai-catalog (spec §4), so the document is the same shape — the entries * carry more. */ export declare function projectArd(fafa: FafaDoc, cards: PackCard[], opts?: CatalogRowOptions): Record; export interface PackOptions extends ContextBlockOptions { /** Which cards to build; the `.fafa` is always written. */ cards: PackCard[]; /** `updatedAt` for catalog rows (tests); otherwise now. */ now?: string; /** List the `.fafa` itself in the catalog and ARD manifest (it is then served * at /.well-known/fafa). Default true; `false` leaves it out. */ listFafa?: boolean; /** Extensions to put on the A2A card, besides FAF's own (added with `faf`). */ a2aExtensions?: A2AExtension[]; /** project.faf (BEST): adds FAF's context block to the A2A card, the Server * Card and server.json. Without it the cards are plain (BETTER). */ faf?: FafData; } export interface Pack { fafa: FafaDoc; fafaText: string; a2a?: ProjectedA2A; server_card?: Record; server_json?: Record; ai_catalog?: Record; ard?: Record; } /** Every card a `.fafa` can feed, for the cards asked. */ export declare function projectPack(fafa: FafaDoc, opts: PackOptions): Pack; /** Answers in, the `.fafa` and every card asked for out. */ export declare function buildPack(answers: PackAnswers, opts: PackOptions): Pack;