evOo-local/packages/adapters/src/undici-fetch.ts
cynarAI 6c7eed7580 Initial clean evOo-local from f00577b
Fresh history cut from cynarAI/evoo antigravity-handoff/project-timeline
(Voice First + project timeline). Brand docs/titles as evOo; keep @rakazo/*
packages as tech debt. Excludes node_modules, caches, secrets, voice blobs.
2026-09-20 17:15:16 +02:00

12 lines
616 B
TypeScript

import { fetch as undiciFetch } from "undici";
/** The fetch that must drive any `Agent` built from the `undici` package.
*
* Node's built-in fetch bundles its own undici, and the two diverge: undici 8
* only accepts the current handler protocol (`onRequestStart`), so a request
* from Node's fetch through a package `Agent` fails with "invalid
* onRequestStart method" before a socket opens. Pairing the package's fetch
* with its `Agent` keeps both on one version. Callers still inject a fetch
* for tests and emulators. */
export const dispatcherFetch = undiciFetch as unknown as typeof globalThis.fetch;