/** * On serverless, returning from the dispatching handler before the outbound * TCP handshake starts can freeze the function with the dispatch request stuck * in the queue. Racing the fetch against a short timer gives the request a * chance to leave the box at the cost of a little added latency on the * dispatching call. Mirrors the 250ms used by the A2A/webhook paths. */ export declare const DEFAULT_DISPATCH_SETTLE_MS = 250; /** * Resolve the base URL to fire a self-dispatch request at. Prefers explicit env * vars (most reliable on serverless, where inbound host headers can be the * platform's internal hostname), falling back to the inbound request headers * and finally localhost in dev. * * Throws in production / shared deployments when no env var is set — a silent * fallback to a bad host there would drop background work invisibly. */ export declare function resolveSelfDispatchBaseUrl(event?: any): string; export interface FireInternalDispatchOptions { /** Base URL of this deployment. Defaults to `resolveSelfDispatchBaseUrl(event)`. */ baseUrl?: string; /** Request event used to derive the base URL when `baseUrl` is omitted. */ event?: any; /** Framework route path to POST to (e.g. "/_agent-native/agent-teams/_process-run"). */ path: string; /** Task/run id the processor will claim. Used to sign the HMAC token and as the default body. */ taskId: string; /** Extra fields merged into the JSON body alongside `{ taskId }`. */ body?: Record; /** Max ms to wait for the outbound request to leave the box. Default 250ms. */ settleMs?: number; /** * Await the dispatch response fully instead of racing the settle timer. * * The 250ms settle race is correct for a synchronous handler that must * respond to its own caller quickly — but it is WRONG for a handoff fired * from a function that is about to finish (e.g. a background worker chaining * its continuation chunk): once the handler's promise resolves, the Lambda * freezes and a still-in-flight dispatch fetch is killed WITHOUT rejecting, * so the handoff is lost silently — the error path never fires. With * `awaitResponse: true` the call resolves only after the target confirmed * receipt (Netlify background functions 202 on enqueue, normally well under * a second) and throws on any network error or non-2xx, bounded by * `responseTimeoutMs`. */ awaitResponse?: boolean; /** Max ms to await the dispatch response when `awaitResponse` is set. Default 15s. */ responseTimeoutMs?: number; } export declare function fireInternalDispatch(options: FireInternalDispatchOptions): Promise; //# sourceMappingURL=self-dispatch.d.ts.map