import type { AgentClient, FeedbackReason, HitlResponse, PortableUpload, ThreadMessage, ThreadMessageQueueState } from "@agents24/client"; import type { ChatAttachment, ChatHitlPart, ChatMessage, StoredChatThread } from "./model"; import type { AgentChatOperation, AgentChatState } from "./state"; import type { HitlSubmissionOptions, HitlSubmissionState } from "./hitl-submission"; import type { RetractedMessageDraft } from "./thread-message-queue"; export type AgentChatSubmitInput = { dictationSessionId?: string; text: string; attachmentIds?: readonly string[]; attachments?: ChatAttachment[]; uploads?: readonly PortableUpload[]; requestedModelId?: string; requestedAgentId?: string; }; export type UseAgentChatOptions = { /** Explicit processed_text export names to request and display in place of attachments. */ attachmentTextOutputs?: readonly string[]; activeThreadId?: string | null; client?: AgentClient; pageSize?: number; threadPageSize?: number; observation?: "on-demand" | "realtime"; }; export type AgentChatController = AgentChatState & { pendingMessages: readonly ThreadMessage[]; messageQueue: ThreadMessageQueueState | null; activeThread: StoredChatThread | null; hasOlderTurns: boolean; hasMoreThreads: boolean; isLoadingHistory: boolean; isLoadingMoreThreads: boolean; isLoadingOlder: boolean; isLoadingThreads: boolean; isSubmitting: boolean; attachRun(runId: string, cursor?: number): Promise; cancelRun(): Promise; clearBackgroundError(): void; clearOperationError(operation?: AgentChatOperation): void; deleteThread(threadId: string): Promise; detach(): void; loadOlder(): Promise; loadMoreThreads(): Promise; openThread(threadId: string): Promise; refreshThreads(): Promise; regenerate(message: ChatMessage): Promise; refreshMessages(threadId?: string): Promise; editPendingMessage(message: ThreadMessage, input: Pick): Promise; steerPendingMessage(message: ThreadMessage): Promise; removePendingMessage(message: ThreadMessage): Promise; retractPendingMessage(message: ThreadMessage): Promise; resumeQueue(): Promise; steer(text: string): Promise; resumeHitl(part: ChatHitlPart, response: HitlResponse, options?: HitlSubmissionOptions): Promise; getHitlSubmissionState(part: ChatHitlPart): HitlSubmissionState | undefined; setFeedback(message: ChatMessage, input: { rating: "like" | "dislike" | null; reason?: FeedbackReason | null; comment?: string | null; }): Promise; startNewThread(): void; submit(input: AgentChatSubmitInput): Promise; };