import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; import type { ClientFrame, ServerFrame, TimelineEvent } from "../protocol/v2/index.js"; import type { Correlation, TimelineRuntime, TimelineStarted } from "./runtime.js"; import { type UserDeliveryEnqueueResult, type UserDeliveryScopeInput, type UserDeliverySteerResult } from "./user_delivery.js"; import type { TimelineV2Service } from "./v2_service.js"; type UserMessageFrame = Extract; export type UserDeliveryTarget = { readonly service: TimelineV2Service; readonly sessionId: string; }; export type UserDeliveryBindingOptions = { isIdle: () => boolean; canAcceptNormal: () => boolean; getPi: () => ExtensionAPI | null; getTimeline: () => TimelineRuntime | null; getCurrentSessionId: () => string | null; getGeneration: () => string; findTarget: (ownerId: string) => UserDeliveryTarget | null; sendFrames: (ownerId: string, frames: readonly ServerFrame[]) => void; }; export declare class UserDeliveryBinding { private readonly options; private readonly queue; constructor(options: UserDeliveryBindingOptions); submit(frame: UserMessageFrame, correlation: Correlation, scope: UserDeliveryScopeInput): UserDeliveryEnqueueResult | true; snapshot(ownerId: string, service: TimelineV2Service): ServerFrame[]; clearQueued(ownerId: string, service: TimelineV2Service, targetId?: string): string[]; steerQueued(ownerId: string, service: TimelineV2Service, targetId: string): UserDeliverySteerResult; onStarted(started: TimelineStarted): void; onPublished(event: TimelineEvent, correlation: Correlation): void; clearOwner(ownerId: string, service?: TimelineV2Service): void; clearAll(): void; scheduleDrain(): void; private sendSteer; private send; private isCurrent; private sendSnapshot; private sendScope; } export {};