import { type ToolOutcome } from "../../core/index.js"; import type { HttpMethod, OpenApiBinding, PrimitiveToolBinding, RouteBinding, TrpcBinding } from "../formats.js"; /** * The HTTP leg every API-backed tool call travels: bind arguments onto the * binding's declared shape, then make the request. Shared by the registry's * host tools and by `openApiConnector`, so a spec handed to the connector * executes through exactly the path `.vendo/tools.json` executes through. * * Authentication is NOT here: who a call is made as is the caller's business * (the registry's ActAs/forwarding rules, the connector's headers resolver). */ /** The HTTP request one tool call becomes. */ export interface HostRequest { url: URL; method: HttpMethod; body: string | undefined; } /** Bind the call's arguments onto the tool's declared shape: the tRPC envelope, * or path substitution and then query/body per the binding's `argsIn`. */ export declare function hostRequest(binding: RouteBinding | OpenApiBinding | TrpcBinding, args: Record, tool: string, configuredBaseUrl?: string): { request: HostRequest; } | { error: ToolOutcome; }; /** The request itself. Every failure — transport, status, body — comes back as * an outcome, so the caller's audit enrichment always runs. `headers` carries * whatever the caller authenticates with; the JSON envelope is set here. */ export declare function fetchHostTool(binding: PrimitiveToolBinding, tool: string, { url, method, body }: HostRequest, headers: Record, fetchImpl?: typeof fetch): Promise;