import type { Attachment, ChatToolResult, MessagingBot, ConversationContext, ConversationEvent, ConversationLogMessage, LoggedAttachment, MessagingEventHandler, OfficeAddress, SubagentProgressSnapshot } from "../types.js"; export type ChatResponseErrorOperation = "respond" | "replace_response" | "respond_diagnostic" | "set_working"; export interface ChatResponseErrorContext { platform: string; conversationId: string; messageId: string; sessionKey: string; conversationKind: string; operation: ChatResponseErrorOperation; channelId?: string; chatId?: number; responseMessageId?: string | number | null; threadTs?: string; replyTargetId?: string; replyToId?: number | null; isThreaded?: boolean; extra?: Record; } export type ChatResponseErrorReporter = (err: unknown, operation: ChatResponseErrorOperation, extra?: Record) => void; export interface RetryOptions { isRateLimited: (err: Error) => boolean; maxAttempts?: number; baseDelayMs?: number; } export interface ResolveStopTargetInput { handler: MessagingEventHandler; address: OfficeAddress; sessionKey?: string; } export interface HandleTooLongInput { text: string; operation: "render" | "replace"; options: { createOverflowLink?: () => string; } | undefined; responseId: string | null; write: (text: string) => Promise; getResponseId: () => string | null; } interface ProgressiveStreamTransport { start(text: string): Promise; append(messageId: string, delta: string): Promise; stop(messageId: string): Promise; } export interface ProgressiveRendererPlatform { label: string; maxLength: number; flushIntervalMs?: number; initialResponseId?: string | null; formatContinuation: (partNum: number) => string; errorPrefix: string; sanitize?: (text: string) => string; workingIndicator?: string; formatProvisional?: (text: string, working: boolean) => string; prepareSource?: (text: string, working: boolean) => string; onWorkingChanged?: (working: boolean, responseId: string | null) => Promise; setTyping?: (isTyping: boolean, responseId: string | null) => Promise; onFinish?: (text: string, responseId: string | null) => void | Promise; logIntermediateResponses?: boolean; showsPartialAnswer?: boolean; stream?: ProgressiveStreamTransport; needsCanonicalRender?: (text: string) => boolean; formatSubagentProgress?: (progress: SubagentProgressSnapshot) => string; typing?: { send: () => Promise; intervalMs: number; stopOnSend?: boolean; }; formatToolResult: (result: ChatToolResult) => string; responseErrorContext?: (responseId: string | null) => Omit; notifySendFailure?: (errorMessage: string) => Promise; post: (text: string) => Promise; update: (id: string, text: string) => Promise; postExtra: (text: string, responseId: string | null) => Promise; postDiagnostic?: (text: string, options: { style?: "muted" | "error"; }, responseId: string | null) => Promise>; delete?: (id: string) => Promise; deleteExtra?: (id: string | number) => Promise; logBotResponse?: (text: string, id: string) => void; uploadFile?: (filePath: string, title?: string) => Promise; uploadFallbackNote?: (name: string) => string; react?: (emoji: string) => Promise; isTooLongError?: (err: unknown) => boolean; handleTooLong?: (input: HandleTooLongInput) => Promise<{ text: string; prefixLength?: number; }>; } export type MessageIntakeOutcome = "magic-word" | "not-triggered" | "rejected-busy" | "enqueued"; export type QueueAdmission = "started" | "waiting" | "closed"; export interface MagicWordIntakeOptions { text?: string; addressed: boolean; scopeFallback: "top-level" | "always" | "never"; } export interface IncomingAttachment { name: string; timestampMs?: number; download(destPath: string): Promise; } export interface SavedAttachments { saved: Attachment[]; failed: { name: string; error: unknown; }[]; } export interface MessageIntakeOptions { eventBase: TEvent; addressed: boolean; magicWord: MagicWordIntakeOptions; busyPolicy: "queue" | "reject"; logEntryBase: ConversationLogMessage; log?: (entry: ConversationLogMessage) => void; processAttachments: () => Promise; queueKey: string; enqueue: (queueKey: string, work: () => Promise) => QueueAdmission; react?: (emoji: string) => Promise; handler: MessagingEventHandler; bot: MessagingBot; createContext: (event: TEvent) => ConversationContext; deferAttachmentsUntilRun?: boolean; } export interface MarkdownTable { headers: string[]; rows: string[][]; startLine: number; endLine: number; } export {}; //# sourceMappingURL=types.d.ts.map