/** Deterministic, LLM-free resolution of an agent's INTENT against a provider's service * CATALOG — the core of intent-native smart_pay. (F6) * * A provider can monetize many endpoints (price of BTC, ETH, XRP…) behind ONE catalog * served at its registered endpoint. When an agent calls smart_pay with a capability plus an * intent — loose tokens like ["bitcoin"], or structured params like {coinId:"bitcoin"} — this * module picks the right catalog entry and substitutes the path params, in pure code, with no * model in the loop. On a miss it returns the menu (options) so the agent retries in one * free round-trip instead of hitting a dead end. * * Full URL contract (per CatalogEntry): the concrete URL is `${baseUrl}${entry.path}`. */ import type { CatalogEntry } from '@azeth/common'; /** Parse a fetched response body into a catalog, tolerating common envelopes: * a bare array, `{ catalog: [...] }`, or `{ data: { catalog: [...] } }`. * Returns null if the body is not JSON or has no catalog entries. */ export declare function parseCatalogBody(bodyText: string): CatalogEntry[] | null; export interface ResolveIntentInput { entries: CatalogEntry[]; /** Capabilities of the parent service; inherited by entries that declare none. */ parentCapabilities: string[]; capability: string; /** Loose intent tokens (e.g. ["bitcoin"]) matched against the catalog's param value enums. */ intent?: string[]; /** Structured param overrides (e.g. {coinId:"bitcoin"}) — precise, take precedence. */ params?: Record; /** The provider's base endpoint; full URL = `${baseUrl}${entry.path}`. */ baseUrl: string; } /** A catalog entry surfaced back to the agent when the intent can't be resolved — the menu. */ export interface CatalogOption { name: string; path: string; description?: string; pricing?: string; /** param name → allowed values parsed from the catalog (what the agent should pick from). */ params: Record; capabilities: string[]; } export interface ResolvedCatalogEntry { /** Concrete priced URL to fetch + pay. */ url: string; entryName: string; boundParams: Record; pricing?: string; } export interface ResolveIntentResult { resolved?: ResolvedCatalogEntry; reason?: 'no_capability_match' | 'intent_unmatched'; /** The menu to retry against (the capability-matching paid entries). */ options: CatalogOption[]; } /** Resolve an intent against a catalog. Pure + deterministic — never invents a param value, * never auto-pays an entry whose path slots aren't all bound from the caller's input. */ export declare function resolveIntent(input: ResolveIntentInput): ResolveIntentResult; //# sourceMappingURL=catalog-resolve.d.ts.map