import { type Session } from "../shared/types.js"; export declare const CALLBACK_DELIVERY_RETRY_DELAYS_MS: readonly [1000, 5000, 30000]; export declare const CALLBACK_DELIVERY_MAX_ATTEMPTS: number; export declare const CALLBACK_REPLY_MAX_CHARS = 128000; export interface ManagerVisibilityDetails { manager: string; managerDisplay: string; delegator: string | null; delegatorDisplay: string; employee: string; employeeDisplay: string; childSessionId: string; workItemId: string; title: string; } /** * Give a manager lightweight visibility into one skip-level delegation. The * session-message route persists this notification in the restart-safe internal * queue before its manager turn starts. Fire-and-forget, like parent callbacks. */ export declare function notifyManagerVisibility(managerSessionId: string, details: ManagerVisibilityDetails): void; /** * Notify the parent session that a child session has replied. * Sends an internal message to the parent via the local HTTP API. * Fire-and-forget compatibility wrapper. Turn settlement uses the awaited * variant below so a source-drain hold cannot release before the final durable * callback is accepted. */ export declare function notifyParentSession(childSession: Session, result: { result?: string | null; error?: string | null; cost?: number; durationMs?: number; }, options?: { alwaysNotify?: boolean; }): void; /** Awaitable parent notification for completion paths that need durable ordering. */ export declare function notifyParentSessionAndWait(childSession: Session, result: { result?: string | null; error?: string | null; cost?: number; durationMs?: number; }, options?: { alwaysNotify?: boolean; }): Promise; /** * Post-listen restart recovery for a claim persisted before its continuation * notification reached the durable queue. Surface first; mark surfaced only * after the parent-message route accepts it. Failure leaves `nudged` intact so * the next restart retries instead of silently stranding the delegation. */ export declare function recoverOrphanedDelegationCompletionClaims(): Promise; /** Replay callback intents claimed before their parent route accepted the * queue/message transaction. Accepted rows are absent from this scan, so boot * recovery can never emit or wake an already delivered callback again. */ export declare function recoverPendingSessionDeliveries(): Promise; /** Startup owns callback recovery before orphan-guard recovery. Each phase is * caught independently so poison or transport failure cannot reject boot. */ export declare function recoverSessionDeliveryStateOnStartup(): Promise<{ pendingRecovered: number; orphanedRecovered: number; }>; /** * Notify the parent session that a child session has been rate-limited and will auto-resume. * Fire-and-forget — errors are logged but never rethrown. */ export declare function notifyRateLimited(childSession: Session, estimatedResumeTime?: string): void; /** * Notify the parent session that a rate-limited child session has successfully resumed. * Fire-and-forget — errors are logged but never rethrown. */ export declare function notifyRateLimitResumed(childSession: Session): void; /** * Send a fixed notification to the operator's configured channel * (`notifications.connector` + `notifications.channel`; Discord by default). * Used for alerts that must reach a human without depending on an LLM — rate * limits, and a workflow parked on a decision with no employee session to wake. * Fire-and-forget — errors are logged but never rethrown. */ export declare function notifyOperatorChannel(message: string): void; type SessionDeliveryAttemptResult = "accepted" | "scheduled" | "deferred"; export declare function deliverClaimedSessionDelivery(deliveryId: string): Promise; export declare function __resetCallbackRetrySweepForTest(): void; export {}; //# sourceMappingURL=callbacks.d.ts.map