import type { AutomationRouteBinding } from '../automation/routes.js'; import type { AutomationSurfaceKind } from '../automation/types.js'; import type { ProviderFailurePolicy, ProviderRoutingSelection } from '../automation/types.js'; import type { ExecutionIntent } from '../runtime/execution-intents.js'; import { type ModelIdCandidate } from '../providers/model-id-resolution.js'; export declare const SHARED_SESSION_INPUT_INTENTS: readonly ["submit", "steer", "follow-up"]; export declare const SHARED_SESSION_INPUT_STATES: readonly ["queued", "delivered", "spawned", "completed", "cancelled", "failed", "rejected"]; export type SharedSessionInputIntent = typeof SHARED_SESSION_INPUT_INTENTS[number]; export type SharedSessionInputState = typeof SHARED_SESSION_INPUT_STATES[number]; export interface SharedSessionHelperModelOverride { readonly providerId: string; readonly modelId: string; } export interface SharedSessionRoutingIntent { readonly providerId?: string | undefined; readonly modelId?: string | undefined; readonly providerSelection?: ProviderRoutingSelection | undefined; readonly providerFailurePolicy?: ProviderFailurePolicy | undefined; readonly fallbackModels?: readonly string[] | undefined; readonly helperModel?: SharedSessionHelperModelOverride | undefined; readonly executionIntent?: ExecutionIntent | undefined; readonly tools?: readonly string[] | undefined; readonly reasoningEffort?: string | undefined; } export interface SharedSessionInputRecord { readonly id: string; readonly sessionId: string; readonly intent: SharedSessionInputIntent; readonly state: SharedSessionInputState; readonly correlationId: string; readonly causationId?: string | undefined; readonly body: string; readonly createdAt: number; readonly updatedAt: number; readonly routeId?: string | undefined; readonly surfaceKind?: AutomationSurfaceKind | undefined; readonly surfaceId?: string | undefined; readonly externalId?: string | undefined; readonly threadId?: string | undefined; readonly userId?: string | undefined; readonly displayName?: string | undefined; readonly activeAgentId?: string | undefined; readonly metadata: Record; readonly routing?: SharedSessionRoutingIntent | undefined; readonly error?: string | undefined; } export interface SharedSessionContinuationRequest { readonly sessionId: string; readonly input: SharedSessionInputRecord; readonly task: string; readonly routeBinding?: AutomationRouteBinding | undefined; } export interface SharedSessionContinuationResult { readonly agentId: string; } export type SharedSessionContinuationRunner = (input: SharedSessionContinuationRequest) => SharedSessionContinuationResult | Promise | null; /** * "This agent is going to answer THIS message, and the message came in over a * channel." * * The broker is the one place every route into a shared session converges on, * a webhook adapter, a polled surface, an HTTP route, a gateway method, and the * shared-session continuation runner all end up here. Announcing the pairing * from the broker is therefore the only way to guarantee the answer is routed * back to the conversation it came from on EVERY path; binding it per adapter * covered the fresh-spawn branch only, so a message that landed in an existing * live session was answered into the void. * * Implementations must be idempotent: several paths legitimately announce the * same (agent, input) pairing, and the reply must be sent once. */ export interface SharedSessionSurfaceReplyBinding { readonly sessionId: string; /** The agent whose completion carries the answer. */ readonly agentId: string; /** The route binding id for the originating conversation, when known. */ readonly routeId?: string | undefined; readonly surfaceKind?: AutomationSurfaceKind | undefined; /** The owner's own words, for the reply header. */ readonly task: string; /** How this pairing came about, carried into logs when nothing can be sent. */ readonly reason: 'spawn-claimed-input' | 'continued-live' | 'continuation-runner'; } export type SharedSessionSurfaceReplyBinder = (binding: SharedSessionSurfaceReplyBinding) => void; export interface SharedSessionAgentSpawnRoutingInput { readonly model?: string | undefined; readonly provider?: string | undefined; readonly tools?: string[] | undefined; readonly restrictTools?: boolean | undefined; readonly routing?: { readonly providerSelection?: ProviderRoutingSelection | undefined; readonly providerFailurePolicy?: ProviderFailurePolicy | undefined; readonly fallbackModels?: string[] | undefined; } | undefined; readonly executionIntent?: ExecutionIntent | undefined; readonly reasoningEffort?: string | undefined; } export declare function buildSharedSessionAgentSpawnRoutingInput(routing: SharedSessionRoutingIntent | undefined, options?: { readonly restrictTools?: boolean | undefined; /** The live registry's model candidates, enables bare model id resolution when supplied. */ readonly modelCandidates?: readonly ModelIdCandidate[] | undefined; }): SharedSessionAgentSpawnRoutingInput; export interface SharedSessionCompletion { readonly session: { readonly id: string; readonly activeAgentId?: string | undefined; }; readonly continuedInput?: SharedSessionInputRecord | undefined; readonly continuedAgentId?: string | undefined; } //# sourceMappingURL=session-intents.d.ts.map