import * as s from '../schemas'; import type { Transport } from './transport'; /** * The thread-list filter set (GET `/api/conversations/{route}/threads` query * params, alongside `page`/`pageSize`). `status` narrows to threads whose newest * record sits in one delivery state; `address` is a SUBSTRING match over the * client address. Both omitted when undefined — an unfiltered listing. */ export interface ConversationThreadFilters { readonly status?: s.ConversationDeliveryStatus; readonly address?: string; } /** * One transcript read (GET `/api/conversations/{route}/transcript` query params). * `order` is not a default the caller may skip: `asc` reads the thread from its * beginning and `desc` from its newest end, and which one a screen wants is a * decision that screen must make. `q` narrows the page to records whose text * matches it (a SUBSTRING), omitted for an unfiltered read. */ export interface ConversationTranscriptQuery { readonly routeName: string; readonly threadId: string; readonly page: number; readonly pageSize: number; readonly order: s.TranscriptOrder; readonly q?: string; } /** * A route-scoped message search (GET * `/api/conversations/{route}/messages/search` query params). `q` is the required * needle — a substring over record text, across every thread on the route; `page` * is supplied per-request by the infinite query. */ export interface ConversationMessageSearchQuery { readonly routeName: string; readonly q: string; readonly page: number; readonly pageSize: number; } /** * Body for sending a message into a thread (POST * `/api/conversations/{route}/thread/messages`). `thread_id` names the thread * (an api-door address, passed as a value); `text` is the message. `address` is * an optional override the server otherwise derives from the thread, omitted * when undefined. */ export interface ConversationThreadMessageBody { readonly thread_id: string; readonly text: string; readonly address?: string; } export declare function conversationsClient(t: Transport): { listConversationRoutes: (signal?: AbortSignal) => Promise<{ items: { callback_secret: string | null; callback_url: string | null; cancel_expr: { content?: string | undefined; id?: string | undefined; kwargs?: Record | undefined; } | null; channel: string | null; door: "channel" | "api"; error_reply_text: string | null; execution_key: string; execution_key_fingerprint: string; extras_expr: { content?: string | undefined; id?: string | undefined; kwargs?: Record | undefined; } | null; initial_mode: "agent" | "manual"; locale: string | null; our_identity: string | null; overlap: { deliver: "one" | "all"; running: "continue" | "cancel"; settle_seconds: number; }; reply_expr: { content?: string | undefined; id?: string | undefined; kwargs?: Record | undefined; } | null; resume_expr: { content?: string | undefined; id?: string | undefined; kwargs?: Record | undefined; } | null; route_name: string; start_expr: { content?: string | undefined; id?: string | undefined; kwargs?: Record | undefined; } | null; target_kind: "tool" | "agent"; target_name: string; turns_per_hour_override: number | null; }[]; total: number; }>; createOrReplaceConversationRoute: (route: s.ConversationRouteCreate) => Promise<{ created: boolean; route_name: string; route: { callback_secret: string | null; callback_url: string | null; cancel_expr: { content?: string | undefined; id?: string | undefined; kwargs?: Record | undefined; } | null; channel: string | null; door: "channel" | "api"; error_reply_text: string | null; execution_key: string; execution_key_fingerprint: string; extras_expr: { content?: string | undefined; id?: string | undefined; kwargs?: Record | undefined; } | null; initial_mode: "agent" | "manual"; locale: string | null; our_identity: string | null; overlap: { deliver: "one" | "all"; running: "continue" | "cancel"; settle_seconds: number; }; reply_expr: { content?: string | undefined; id?: string | undefined; kwargs?: Record | undefined; } | null; resume_expr: { content?: string | undefined; id?: string | undefined; kwargs?: Record | undefined; } | null; route_name: string; start_expr: { content?: string | undefined; id?: string | undefined; kwargs?: Record | undefined; } | null; target_kind: "tool" | "agent"; target_name: string; turns_per_hour_override: number | null; }; callback_secret: string | null; }>; deleteConversationRoute: (routeName: string) => Promise<{ removed: boolean; route_name: string; }>; listConversationThreads: (routeName: string, page: number, pageSize: number, filters?: ConversationThreadFilters, signal?: AbortSignal) => Promise<{ total: number; page: number; page_size: number; next_page: number | null; truncated: boolean; items: { thread_id: string; client_address: string; last_activity_at: number; message_count: number; last_delivery_status: "failed" | "accepted" | "pending_delivery" | "provisional" | "delivered" | "shed" | "silent" | "merged" | "superseded"; }[]; }>; readConversationTranscript: (query: ConversationTranscriptQuery, signal?: AbortSignal) => Promise<{ order: "asc" | "desc"; total: number; page: number; page_size: number; next_page: number | null; truncated: boolean; items: { message_id: string; route_name: string; door: "channel" | "api"; thread_id: string; client_address: string; caller_principal: string | null; inbound_text: string; answer_status: "error" | "silent" | "merged" | "superseded" | "answered" | null; answer: string | null; successor_id: string | null; origin: "client" | "operator"; delivery_status: "failed" | "accepted" | "pending_delivery" | "provisional" | "delivered" | "shed" | "silent" | "merged" | "superseded"; created_at: number; updated_at: number; channel?: string | null | undefined; our_identity?: string | null | undefined; provider_message_id?: string | null | undefined; callback_url?: string | null | undefined; error?: string | null | undefined; outbound_message_ids?: string[] | undefined; attempts?: number | undefined; }[]; }>; searchConversationMessages: (query: ConversationMessageSearchQuery, signal?: AbortSignal) => Promise<{ total: number; page: number; page_size: number; next_page: number | null; truncated: boolean; items: { message_id: string; route_name: string; door: "channel" | "api"; thread_id: string; client_address: string; caller_principal: string | null; inbound_text: string; answer_status: "error" | "silent" | "merged" | "superseded" | "answered" | null; answer: string | null; successor_id: string | null; origin: "client" | "operator"; delivery_status: "failed" | "accepted" | "pending_delivery" | "provisional" | "delivered" | "shed" | "silent" | "merged" | "superseded"; created_at: number; updated_at: number; channel?: string | null | undefined; our_identity?: string | null | undefined; provider_message_id?: string | null | undefined; callback_url?: string | null | undefined; error?: string | null | undefined; outbound_message_ids?: string[] | undefined; attempts?: number | undefined; }[]; }>; sendConversationThreadMessage: (routeName: string, body: ConversationThreadMessageBody) => Promise<{ message_id: string; thread_id: string; }>; getConversationThreadMode: (routeName: string, threadId: string, signal?: AbortSignal) => Promise<{ mode: "agent" | "manual"; source: "route" | "thread"; }>; setConversationThreadMode: (routeName: string, threadId: string, mode: s.ConversationThreadMode) => Promise<{ mode: "agent" | "manual"; source: "route" | "thread"; }>; listConversationConfigs: (signal?: AbortSignal) => Promise<{ items: { greeting_template: string | null; multichannel: boolean; state_binding: { states: { input_injections: { into: string; jq: { content?: string | undefined; id?: string | undefined; kwargs?: Record | undefined; } | null; template_jq: string | null; }[]; scope_expr: { content?: string | undefined; id?: string | undefined; kwargs?: Record | undefined; } | null; state: string; subject_expr: { content?: string | undefined; id?: string | undefined; kwargs?: Record | undefined; }; templates: string[]; updates: { adapter: { content?: string | undefined; id?: string | undefined; kwargs?: Record | undefined; } | null; jq: { content?: string | undefined; id?: string | undefined; kwargs?: Record | undefined; } | null; op_id: { content?: string | undefined; id?: string | undefined; kwargs?: Record | undefined; } | null; template_jq: string | null; }[]; }[]; } | null; target_kind: "tool" | "agent"; target_name: string; }[]; total: number; }>; getConversationConfig: (targetKind: s.ConversationTargetKind, targetName: string, signal?: AbortSignal) => Promise<{ greeting_template: string | null; multichannel: boolean; state_binding: { states: { input_injections: { into: string; jq: { content?: string | undefined; id?: string | undefined; kwargs?: Record | undefined; } | null; template_jq: string | null; }[]; scope_expr: { content?: string | undefined; id?: string | undefined; kwargs?: Record | undefined; } | null; state: string; subject_expr: { content?: string | undefined; id?: string | undefined; kwargs?: Record | undefined; }; templates: string[]; updates: { adapter: { content?: string | undefined; id?: string | undefined; kwargs?: Record | undefined; } | null; jq: { content?: string | undefined; id?: string | undefined; kwargs?: Record | undefined; } | null; op_id: { content?: string | undefined; id?: string | undefined; kwargs?: Record | undefined; } | null; template_jq: string | null; }[]; }[]; } | null; target_kind: "tool" | "agent"; target_name: string; }>; setConversationConfig: (config: s.TargetConversationConfig) => Promise<{ created: boolean; target_kind: "tool" | "agent"; target_name: string; config: { greeting_template: string | null; multichannel: boolean; state_binding: { states: { input_injections: { into: string; jq: { content?: string | undefined; id?: string | undefined; kwargs?: Record | undefined; } | null; template_jq: string | null; }[]; scope_expr: { content?: string | undefined; id?: string | undefined; kwargs?: Record | undefined; } | null; state: string; subject_expr: { content?: string | undefined; id?: string | undefined; kwargs?: Record | undefined; }; templates: string[]; updates: { adapter: { content?: string | undefined; id?: string | undefined; kwargs?: Record | undefined; } | null; jq: { content?: string | undefined; id?: string | undefined; kwargs?: Record | undefined; } | null; op_id: { content?: string | undefined; id?: string | undefined; kwargs?: Record | undefined; } | null; template_jq: string | null; }[]; }[]; } | null; target_kind: "tool" | "agent"; target_name: string; }; }>; deleteConversationConfig: (targetKind: s.ConversationTargetKind, targetName: string) => Promise<{ removed: boolean; target_kind: "tool" | "agent"; target_name: string; }>; listFailedConversationMessages: (signal?: AbortSignal) => Promise<{ items: { message_id: string; route_name: string; door: "channel" | "api"; thread_id: string; client_address: string; caller_principal: string | null; inbound_text: string; answer_status: "error" | "silent" | "merged" | "superseded" | "answered" | null; answer: string | null; successor_id: string | null; origin: "client" | "operator"; delivery_status: "failed" | "accepted" | "pending_delivery" | "provisional" | "delivered" | "shed" | "silent" | "merged" | "superseded"; created_at: number; updated_at: number; channel?: string | null | undefined; our_identity?: string | null | undefined; provider_message_id?: string | null | undefined; callback_url?: string | null | undefined; error?: string | null | undefined; outbound_message_ids?: string[] | undefined; attempts?: number | undefined; }[]; total: number; }>; deleteConversationThread: (routeName: string, threadId: string) => Promise<{ removed: number; route_name: string; thread_id: string; }>; deleteConversationPerson: (personId: string) => Promise<{ person_id: string; removed: number; erased: boolean; }>; }; //# sourceMappingURL=conversations-client.d.ts.map