import type { PermissionPromptDecision, PermissionPromptRequest } from '../../permissions/prompt.js'; import type { ApprovalRaiser } from '../permissions/permission-composition.js'; import type { DaemonVerbCaller } from './daemon-verbs.js'; import type { ApprovalUpdateNotice, ApprovalUpdateSubscription } from './approval-updates.js'; /** * How this surface opens the approval-update stream. A product supplies it * because resolving a base URL and proving this surface may subscribe are * trust-boundary concerns the SDK core deliberately never reaches into, the * same carve-out `DaemonVerbCaller` records. * * Returning null means "no stream right now", which is a supported answer: * the raiser falls back to reading the record on an interval. */ export type ApprovalUpdateSubscriber = (onUpdate: (notice: ApprovalUpdateNotice) => void) => Promise; /** The local ask: draw a prompt on this surface and resolve with what the user chose. */ export type LocalPermissionPrompt = (request: PermissionPromptRequest) => Promise; export interface ClientApprovalRaiserOptions { readonly verbs: DaemonVerbCaller; /** The prompt this surface draws. Late-bound: the UI layer patches it in after boot. */ readonly localPrompt: () => LocalPermissionPrompt; /** * How this surface names itself when it reports its own decision back. The * daemon records it on the approval, so every other surface can see WHERE the * answer came from; there is no honest default, so each product states its own. */ readonly actor: string; /** The live session id an ask belongs to, when there is one. */ readonly sessionId?: () => string | null | undefined; /** * The push channel for decisions made elsewhere. Omitted ⇒ this surface * reads the record on an interval instead, which still works and is slower. */ readonly subscribeApprovalUpdates?: ApprovalUpdateSubscriber | undefined; /** Poll interval override (tests), and the fallback interval. */ readonly pollIntervalMs?: number; /** Injectable sleep (tests). */ readonly sleep?: (ms: number) => Promise; } export declare function createClientApprovalRaiser(options: ClientApprovalRaiserOptions): ApprovalRaiser; //# sourceMappingURL=approval-raiser.d.ts.map