/** * Running one operation across every configured account. * * This is the shape the whole server is built around: a cross-account call must * degrade rather than fail, because one revoked account taking down a search * over the other four is worse than useless — it is silently wrong. * * Deliberately NOT a merge helper. Each caller merges its own way: email by * date, Drive by modification time, free/busy by interval intersection. A * generic merge would have to be wrong for two of the three. */ import type { AccountId } from './errors.js'; export interface AccountOutcome { account: AccountId; ok: boolean; value?: T; error?: string; } export interface AcrossAccounts { /** Every account, in configuration order, successes and failures alike. */ outcomes: AccountOutcome[]; /** The accounts that answered. */ succeeded: AccountId[]; /** Only the failures, in the shape tool responses report them. */ failures: { account: AccountId; error: string; }[]; /** The values of the accounts that answered, in configuration order. */ values: T[]; } /** * Runs `task` once per configured account, in parallel, capturing failures as * values instead of exceptions. * * `only` restricts the run to a subset — emails or aliases. Omitted, it means * every configured account. * * Throws only when there is nothing to run against at all: an empty account * list is a configuration problem the user has to fix, not a partial result. */ export declare function runAcrossAccounts(task: (account: AccountId) => Promise, only?: readonly AccountId[]): Promise>; //# sourceMappingURL=accounts.d.ts.map