import type { PermissionGrant, Principal, RunContext } from "../../core/index.js"; import type { Connector } from "./connector.js"; /** 04-actions §3 — what a per-principal connector headers resolver sees: the * acting principal plus the presence/grant context of the execution. Descriptor * listing resolves WITHOUT a principal (a system context). */ export interface ConnectorAuthContext { principal?: Principal; presence?: RunContext["presence"]; grant?: PermissionGrant; } /** Async per-principal credential resolution for a connector. Shared static * headers remain the simple default. */ export type ConnectorHeadersResolver = (auth: ConnectorAuthContext) => Promise> | Record; /** * Any REST API with an OpenAPI document becomes agent tools: the document goes * through the SAME extractor `vendo sync` runs over a spec file, and the tools * execute through the SAME HTTP dispatch a host tool executes through — so a * spec handed here and a spec in the repo behave identically. * * `spec` is the document itself (JSON/YAML text, or already parsed), never a * path or a URL: reading and fetching are the caller's business, which keeps * this usable on every runtime. */ export declare function openApiConnector(config: { spec: string | Record; /** Wins over the spec's own `servers[0]`. */ baseUrl?: string; headers?: Record | ConnectorHeadersResolver; name?: string; }): Connector;