import { z } from 'zod'; import { normalizeOptionalString as toText } from '../utils/string-coerce.js'; export type ClaudeChannelMode = "off" | "on" | "auto"; export type ConversationDescriptor = { sessionKey: string; channel: string; to: string; accountId?: string; threadId?: string | number; label?: string; displayName?: string; derivedTitle?: string; lastMessagePreview?: string; updatedAt?: number | null; }; export type SessionRow = { key: string; channel?: string; lastChannel?: string; lastTo?: string; lastAccountId?: string; lastThreadId?: string | number; deliveryContext?: { channel?: string; to?: string; accountId?: string; threadId?: string | number; }; origin?: { provider?: string; accountId?: string; threadId?: string | number; }; label?: string; displayName?: string; derivedTitle?: string; lastMessagePreview?: string; updatedAt?: number | null; }; export type SessionListResult = { sessions?: SessionRow[]; }; export type ChatHistoryResult = { messages?: Array<{ id?: string; role?: string; content?: unknown; [key: string]: unknown; }>; }; export type SessionMessagePayload = { sessionKey?: string; messageId?: string; messageSeq?: number; message?: { role?: string; content?: unknown; [key: string]: unknown; }; lastChannel?: string; lastTo?: string; lastAccountId?: string; lastThreadId?: string | number; [key: string]: unknown; }; export type ApprovalKind = "exec" | "plugin"; export type ApprovalDecision = "allow-once" | "allow-always" | "deny"; export type PendingApproval = { kind: ApprovalKind; id: string; request?: Record; createdAtMs?: number; expiresAtMs?: number; }; export type QueueEvent = { cursor: number; type: "message"; sessionKey: string; conversation?: ConversationDescriptor; messageId?: string; messageSeq?: number; role?: string; text?: string; raw: SessionMessagePayload; } | { cursor: number; type: "claude_permission_request"; requestId: string; toolName: string; description: string; inputPreview: string; } | { cursor: number; type: "exec_approval_requested" | "exec_approval_resolved"; raw: Record; } | { cursor: number; type: "plugin_approval_requested" | "plugin_approval_resolved"; raw: Record; }; export type ClaudePermissionRequest = { toolName: string; description: string; inputPreview: string; }; export type WaitFilter = { afterCursor: number; sessionKey?: string; }; export declare const ClaudePermissionRequestSchema: z.ZodObject<{ method: z.ZodLiteral<"notifications/claude/channel/permission_request">; params: z.ZodObject<{ request_id: z.ZodString; tool_name: z.ZodString; description: z.ZodString; input_preview: z.ZodString; }, z.core.$strip>; }, z.core.$strip>; export { toText }; export declare function resolveMessageId(entry: Record): string | undefined; export declare function summarizeResult(label: string, count: number): { content: Array<{ type: "text"; text: string; }>; }; export declare function resolveConversationChannel(row: SessionRow): string | undefined; export declare function toConversation(row: SessionRow): ConversationDescriptor | null; export declare function matchEventFilter(event: QueueEvent, filter: WaitFilter): boolean; export declare function extractAttachmentsFromMessage(message: unknown): unknown[]; export declare function normalizeApprovalId(value: unknown): string | undefined;