/** * Aggregation helper — run a bag of named async fetchers in parallel via * `Promise.allSettled`, push labeled rejection messages onto a caveats array, * and return a typed object whose values are `null` for any rejected fetcher. * * Designed for the aggregation-tool pattern where one failed sub-call should * not poison the whole response (the surviving values still flow through, and * the partial-data condition is surfaced via the returned `caveats` array). * * Each consumer MCP previously inlined this logic — typically 10-15 lines per * aggregation tool. This helper is the deduplication. */ export type Fetchers = Record Promise>; export type Aggregated = { [K in keyof T]: Awaited> | null; }; /** * Default rejection-reason → string formatter. Handles Error instances, * strings, and falls back to JSON.stringify. Override per call when the API * client throws structured exceptions you want to unpack differently. */ export declare function defaultFormatReason(reason: unknown): string; export declare function aggregate(fetchers: T, caveats: string[], formatReason?: (reason: unknown) => string): Promise>; //# sourceMappingURL=aggregate.d.ts.map