//#region src/utils/in-process-fetch.d.ts
/**
 * In-process fetch transport for internal self-calls.
 *
 * Routes requests through the Hono app's full middleware stack in-process
 * rather than over the network. This guarantees same-instance execution,
 * which is critical for features that rely on process-local state
 * (e.g. the stream helper registry for real-time SSE streaming).
 *
 * Drop-in replacement for `fetch()` — same signature, same return type.
 * Throws in production if the app hasn't been registered.
 * Falls back to global `fetch` in test environments where the full app
 * may not be initialized.
 *
 * **IMPORTANT**: Any code making internal A2A calls or self-referencing API
 * calls within the agents service MUST use `getInProcessFetch()` instead of
 * global `fetch`. Using regular `fetch` for same-service calls causes requests
 * to leave the process and hit the load balancer, which may route them to a
 * different instance — breaking features that depend on process-local state
 * (e.g. stream helper registry, in-memory caches). This only manifests under
 * load in multi-instance deployments and is extremely difficult to debug.
 *
 * @example
 * import { getInProcessFetch } from '@inkeep/agents-core';
 * const response = await getInProcessFetch()(url, init);
 */
declare function registerAppFetch(fn: typeof fetch): void;
declare function getInProcessFetch(): typeof fetch;
//#endregion
export { getInProcessFetch, registerAppFetch };