import type { Part, ToolPart } from "./message-parts.js"; import type { ChatImage, ChatPermission, ChatQuestion, ChatSubtask } from "@openremotecode/protocol"; export declare function resolveImages(nativeParts: Part[]): Promise>; export interface PermissionRequest { id: string; sessionID: string; permission: string; patterns?: string[]; } export declare function subtaskSummary(part: ToolPart): ChatSubtask; export interface QuestionRequest { id: string; sessionID: string; questions?: { question?: unknown; header?: unknown; multiple?: unknown; custom?: unknown; options?: { label?: unknown; description?: unknown; }[]; }[]; } /** * Sanitizes and caps a raw `questions` array to the same bounds everywhere this data * crosses the boundary -- the live pending batch (see ADR 0011) and a completed * `question` tool part's own `input.questions` (see "Update: a persisted asked/answered * record" in ADR 0011) both go through this one function, so both present identically. * A malformed entry is dropped rather than presented empty. */ interface QuestionPromptSource { question?: unknown; header?: unknown; multiple?: unknown; custom?: unknown; options?: { label?: unknown; description?: unknown; }[]; } export declare function sanitizeQuestionPrompt(entry: QuestionPromptSource): ChatQuestion["questions"][number] | undefined; export declare function sanitizeQuestionPrompts(raw: unknown): ChatQuestion["questions"] | undefined; /** * Normalizes the whole pending batch, in OpenCode's own order. OpenCode's `question` tool * can ask several at once, all sharing one request id and answered together -- see ADR * 0011. Returns undefined when nothing is presentable, so a malformed payload becomes * "no question" rather than an empty prompt. */ export declare function questionSummary(request: QuestionRequest): ChatQuestion | undefined; export interface AnsweredQuestionBatch { questions: ChatQuestion["questions"]; answers: string[]; } export declare function permissionSummary(permission: PermissionRequest): ChatPermission; export declare function chatMessageContent(role: string, nativeParts: Part[], subtasks?: ReadonlyMap, options?: { includeTools?: boolean; includeShell?: boolean; includeCode?: boolean; includeActivities?: boolean; messageFinished?: boolean; sessionSettled?: boolean; directory?: string; images?: ReadonlyMap; answeredQuestions?: readonly AnsweredQuestionBatch[]; }): { parts?: ({ id: string; type: "text"; text: string; } | { id: string; type: "reasoning"; text: string; time?: { start: number; end?: number | undefined; } | undefined; activity?: { kind: "reasoning" | "tool" | "search" | "read" | "write" | "edit" | "apply_patch" | "list" | "execute" | "fetch" | "update_tasks" | "subtask"; state: "pending" | "running" | "completed" | "failed" | "cancelled" | "unknown"; } | undefined; } | { id: string; type: "tool"; text: string; tool: { operation: "tool" | "search" | "read" | "write" | "edit" | "list" | "execute" | "fetch" | "question"; status: "pending" | "running" | "completed" | "error" | "unknown"; description?: string | undefined; durationMs?: number | undefined; shell?: { command: string; output: string; truncated: boolean; } | undefined; code?: { source: string; output: string; truncated: boolean; } | undefined; }; activity?: { kind: "reasoning" | "tool" | "search" | "read" | "write" | "edit" | "apply_patch" | "list" | "execute" | "fetch" | "update_tasks" | "subtask"; state: "pending" | "running" | "completed" | "failed" | "cancelled" | "unknown"; } | undefined; } | { id: string; type: "subtask"; text: string; task: { title: string; agent: string; status: "pending" | "running" | "completed" | "error" | "unknown" | "retry"; background: boolean; sessionId?: string | undefined; stats?: { toolCalls: number; complete: boolean; durationMs?: number | undefined; } | undefined; }; activity?: { kind: "reasoning" | "tool" | "search" | "read" | "write" | "edit" | "apply_patch" | "list" | "execute" | "fetch" | "update_tasks" | "subtask"; state: "pending" | "running" | "completed" | "failed" | "cancelled" | "unknown"; } | undefined; } | { id: string; type: "image"; text: ""; image: { mime: "image/jpeg"; data: string; width?: number | undefined; height?: number | undefined; }; })[]; text: string; truncated: boolean; }; export {}; //# sourceMappingURL=chat-message.d.ts.map