/** * Maps an n8n `toolHttpRequest` / `httpRequestTool` agent-tool node onto a real, * self-contained Pikku tool function that performs the configured HTTP call — * the agent-tool sibling of the main-flow `httpRequest` → `graph:httpRequest` * mapping. Only a *static* request is convertible: a runtime-dynamic URL * (`$fromAI`, `{{ … }}`, `{placeholder}`) needs an LLM-filled input schema (a v2 * concern) and stays a throwing stub, exactly like `httpAuthRecipe` returning * `undefined`. Auth reuses the same `httpAuthRecipe` recipe table as the main * `httpRequest` node, so OAuth2 / custom auth also stay stubs. */ import type { HttpAuthDescriptor, N8nCredentialRef } from './types.js'; import { type AuthNode } from './http-auth-map.js'; /** The node fields a tool spec reads — satisfied by both N8nNode and ParsedNode. */ export interface HttpToolNode extends AuthNode { name: string; typeShort?: string; parameters?: Record; credentials?: Record; } /** A fully-static HTTP tool call, ready to emit as a real Pikku function. */ export interface HttpToolSpec { url: string; method: string; /** Static request headers (dynamic-valued headers are dropped). */ headers: Record; /** Static query-string parameters (dynamic-valued params are dropped). */ query: Record; /** The tool description the agent surfaces to the LLM. */ description: string; /** Auth resolved from a secret at runtime; absent for a no-auth tool. */ auth?: HttpAuthDescriptor; } export declare function isHttpRequestTool(typeShort: string): boolean; /** * The static HTTP tool spec for a `toolHttpRequest` node, or `undefined` when the * request can't be lowered to a fixed call (dynamic URL, or OAuth2/custom auth * with no static recipe) — the caller then leaves the node a throwing stub. */ export declare function httpToolSpec(node: HttpToolNode): HttpToolSpec | undefined;