export type FakeRequestContext = { /** Zero-indexed substantive turn — autoSkip-handled requests don't increment. */ turnIndex: number; }; export type FakeUpstreamOpts = { /** Path the fake responds to (anything else returns 404). */ pathMatch: (url: string) => boolean; /** Either a per-turn array, or a callback computing the response. */ respond: TScripted[] | ((req: TReq, ctx: FakeRequestContext) => TScripted | Promise); /** Build the JSON response body to send. Receives the user's scripted entry plus the parsed request. */ buildBody: (scripted: TScripted, parsedReq: TReq) => unknown; /** * Optional pre-filter. Return non-null to short-circuit with that * body and not consume the script / not call respond. Useful for * auxiliary calls the agent makes that aren't part of the * substantive turn (title generation, model routing, etc.). */ autoSkip?: (parsedReq: TReq) => unknown | null; /** Human-readable name in error messages — defaults to "fake-upstream". */ scriptName?: string; }; export type FakeUpstream = { url: string; close: () => Promise; }; export declare function startFakeUpstream(opts: FakeUpstreamOpts): Promise; //# sourceMappingURL=fake-upstream.d.ts.map