/** * Which upstream requests produced a tool result. * * Each tool call runs inside an AsyncLocalStorage context. The HTTP client * records every successful request in it: the URL without credentials (the * same identity used for cache keys), when the data was fetched, and whether * it came from the cache. The server then adds them to the result's * `meta.sources`, so a model can cite where numbers came from and see how * fresh they are. */ export interface SourceRecord { /** Request URL without API keys or other credentials. */ url: string; method: "GET" | "POST"; /** When the data was fetched from the upstream API (epoch ms). */ fetchedAt: number; /** True when served from the response cache. */ cached: boolean; } /** Record a request in the current tool call's context (no-op outside one). */ export declare function recordSource(source: SourceRecord): void; /** Run `fn`, collecting the sources recorded while it runs. */ export declare function trackSources(fn: () => Promise): Promise<{ result: T; sources: SourceRecord[]; }>; //# sourceMappingURL=request-context.d.ts.map