import { type LocalIntegrationDiagnosticIdentity } from "./local-integration-errors.js"; import type { IntegrationToolMeta } from "./schema.js"; type IntegrationEndpoint = NonNullable; /** A fully constructed request admitted to the local integration transport. */ export interface LocalIntegrationEndpointTransportRequest { readonly url: URL; readonly init: RequestInit; readonly allowedOrigin: string; } /** Internal transport seam used to verify request construction without network access. */ export type LocalIntegrationEndpointTransport = (request: LocalIntegrationEndpointTransportRequest) => Promise; export interface ExecuteLocalIntegrationEndpointOptions extends LocalIntegrationDiagnosticIdentity { readonly endpoint: IntegrationEndpoint; readonly args: Record; readonly authHeaders: Readonly>; readonly allowedOrigin: string; readonly signal?: AbortSignal; /** * Body serialized by {@link snapshotLocalIntegrationEndpointArguments} before * any credential was resolved. Supply it whenever the arguments were * snapshotted: re-serializing here would run after caller-supplied credential * code, which can change what `JSON.stringify` produces, so the body sent * would not be the body that was checked. */ readonly body?: string | undefined; /** Internal test seam. Production callers use the standard integration deadline. */ readonly timeoutMs?: number; /** Internal test seam. Production callers use the guarded egress transport. */ readonly transport?: LocalIntegrationEndpointTransport; } export interface ExecuteLocalIntegrationJsonRequestOptions extends LocalIntegrationDiagnosticIdentity { readonly url: string; readonly method: "POST"; readonly headers: Readonly>; readonly body: string; readonly allowedOrigin: string; readonly signal?: AbortSignal; readonly timeoutMs?: number; readonly transport?: LocalIntegrationEndpointTransport; } export interface LocalIntegrationJsonResult { readonly status: number; readonly value: unknown; } /** @internal Snapshot and validate tool arguments before any credential or network work. */ export declare function snapshotLocalIntegrationEndpointArguments(endpoint: IntegrationEndpoint, args: Record): { args: Record; body: string | undefined; endpointOrigin: string | undefined; }; /** @internal Validate and serialize endpoint input without resolving its URL authority. */ export declare function snapshotLocalIntegrationEndpointInput(endpoint: IntegrationEndpoint, args: Record): { args: Record; body: string | undefined; }; /** @internal Resolve the admitted origin after host templates have been pinned. */ export declare function resolveLocalIntegrationEndpointOrigin(endpoint: IntegrationEndpoint, args: Record): string | undefined; /** Execute one admitted catalog REST endpoint through a bounded guarded transport. */ export declare function executeLocalIntegrationEndpoint(options: ExecuteLocalIntegrationEndpointOptions): Promise; /** Execute one fixed-origin JSON request, including OAuth token requests. */ export declare function executeLocalIntegrationJsonRequest(options: ExecuteLocalIntegrationJsonRequestOptions): Promise; export {}; //# sourceMappingURL=local-endpoint-executor.d.ts.map