/** * Custom message types and transformers for the coding agent. * * Extends the base AgentMessage type with coding-agent specific message types, * and provides a transformer to convert them to LLM-compatible messages. */ import type { AgentMessage } from "@elyracode/agent-core"; import type { ImageContent, Message, TextContent } from "@elyracode/ai"; export declare const COMPACTION_SUMMARY_PREFIX = "The conversation history before this point was compacted into the following summary:\n\n\n"; export declare const COMPACTION_SUMMARY_SUFFIX = "\n"; export declare const BRANCH_SUMMARY_PREFIX = "The following is a summary of a branch that this conversation came back from:\n\n\n"; export declare const BRANCH_SUMMARY_SUFFIX = ""; /** * Reserved `customType` for mid-conversation system messages. No provider offers a * portable mid-stream system role (Anthropic, Bedrock, and Google only accept a * top-level system prompt), so these ride along as user messages wrapped in a * marker the model is told to treat as instructions rather than user content. */ export declare const SYSTEM_REMINDER_CUSTOM_TYPE = "system-reminder"; export declare const SYSTEM_REMINDER_PREFIX = "\n"; export declare const SYSTEM_REMINDER_SUFFIX = "\n"; /** Wrap system-reminder text for the LLM. Exported so tests and renderers can match it. */ export declare function systemReminderToText(text: string): string; /** * Message type for bash executions via the ! command. */ export interface BashExecutionMessage { role: "bashExecution"; command: string; output: string; exitCode: number | undefined; cancelled: boolean; truncated: boolean; fullOutputPath?: string; timestamp: number; /** If true, this message is excluded from LLM context (!! prefix) */ excludeFromContext?: boolean; } /** * Message type for extension-injected messages via sendMessage(). * These are custom messages that extensions can inject into the conversation. */ export interface CustomMessage { role: "custom"; customType: string; content: string | (TextContent | ImageContent)[]; display: boolean; details?: T; timestamp: number; } export interface BranchSummaryMessage { role: "branchSummary"; summary: string; fromId: string; timestamp: number; } export interface CompactionSummaryMessage { role: "compactionSummary"; summary: string; tokensBefore: number; timestamp: number; } declare module "@elyracode/agent-core" { interface CustomAgentMessages { bashExecution: BashExecutionMessage; custom: CustomMessage; branchSummary: BranchSummaryMessage; compactionSummary: CompactionSummaryMessage; } } /** * Convert a BashExecutionMessage to user message text for LLM context. */ export declare function bashExecutionToText(msg: BashExecutionMessage): string; export declare function createBranchSummaryMessage(summary: string, fromId: string, timestamp: string): BranchSummaryMessage; export declare function createCompactionSummaryMessage(summary: string, tokensBefore: number, timestamp: string): CompactionSummaryMessage; /** Convert CustomMessageEntry to AgentMessage format */ export declare function createCustomMessage(customType: string, content: string | (TextContent | ImageContent)[], display: boolean, details: unknown | undefined, timestamp: string): CustomMessage; /** * Transform AgentMessages (including custom types) to LLM-compatible Messages. * * This is used by: * - Agent's transormToLlm option (for prompt calls and queued messages) * - Compaction's generateSummary (for summarization) * - Custom extensions and tools */ export declare function convertToLlm(messages: AgentMessage[]): Message[]; //# sourceMappingURL=messages.d.ts.map