import type { SubmitSharedSessionMessageInput } from './session-types.js'; import type { SharedSessionInputIntent, SharedSessionInputRecord, SharedSessionSurfaceReplyBinding } from './session-intents.js'; import type { SharedSessionRecord } from './session-types.js'; export interface SharedSessionInputStore { readonly sessions: Map; readonly inputs: Map; } export declare function touchSharedSession(store: SharedSessionInputStore, sessionId: string): void; export declare function refreshPendingInputCount(store: SharedSessionInputStore, sessionId: string): void; export declare function recordSharedSessionInput(store: SharedSessionInputStore, input: { readonly sessionId: string; readonly intent: SharedSessionInputIntent; readonly message: SubmitSharedSessionMessageInput; readonly routeId?: string | undefined; readonly causationId?: string | undefined; readonly maxPersistedInputs: number; }): SharedSessionInputRecord; export declare function updateSharedSessionInput(store: SharedSessionInputStore, sessionId: string, inputId: string, transform: (input: SharedSessionInputRecord) => SharedSessionInputRecord): SharedSessionInputRecord | null; export declare function claimNextQueuedSessionInput(store: SharedSessionInputStore, sessionId: string, agentId: string): SharedSessionInputRecord | null; /** * Collection read for a live surface: filter a session's inputs by state and/or a * `since` cursor (createdAt, exclusive), oldest-first, capped to `limit`. With * `state: 'queued'` + the last-seen cursor this yields exactly the PENDING inputs * a surface has not collected yet (see SharedSessionBroker.getInputsSince). */ export declare function filterSessionInputsSince(bucket: readonly SharedSessionInputRecord[], options: { readonly state?: SharedSessionInputRecord['state'] | undefined; readonly since?: number | undefined; readonly limit?: number | undefined; }): SharedSessionInputRecord[]; /** * Surface delivery marking: advance a queued/delivered input as a live surface * collects it (`consumed:false` → 'delivered') or finishes acting on it * (`consumed:true` → 'completed'). Only queued/delivered inputs advance; anything * else is returned unchanged. Returns null when the input is unknown. */ export declare function markSurfaceInputDelivered(store: SharedSessionInputStore, sessionId: string, inputId: string, consumed: boolean): SharedSessionInputRecord | null; /** * Apply a live surface's report about a queued input: it collected the input * (`consumed:false`), or finished acting on it (`consumed:true`), and, when it * names one, the agent that is answering it. * * The agent pairing is the half that routes an answer home. The daemon's own * spawn takes `bindAgent`, which claims whatever input is NEXT in the queue for * the agent it just started; a surface has already named the exact input, so * this stamps that one, makes the agent the session's active agent, and * announces the reply binding. The announcement is the whole point: without it * a message that arrived over a channel and was dispatched to a surface was * answered into nothing. Idempotent, a repeated report re-announces, and the * binder is required to be idempotent for exactly that reason. */ export declare function applySurfaceInputDelivery(store: SharedSessionInputStore, sessionId: string, inputId: string, options: { readonly consumed?: boolean | undefined; readonly agentId?: string | undefined; }, hooks: { readonly publish: (event: string, payload: unknown) => void; readonly publishInput: (event: string, input: SharedSessionInputRecord, extra: Record) => void; readonly announce: (binding: SharedSessionSurfaceReplyBinding) => void; }): SharedSessionInputRecord | null; export declare function finalizeAgentSessionInputs(store: SharedSessionInputStore, sessionId: string, agentId: string, nextState: Extract, error?: string): SharedSessionInputRecord[]; //# sourceMappingURL=session-broker-inputs.d.ts.map