/** * Messages slot subflow builder * * Pattern: Builder (returns a FlowChart mountable via addSubFlowChartNext). * Role: Layer-3 context engineering. Produces InjectionRecord[] from * the current conversation history. For LLMCall, that's one * user message. For Agent, it's user + assistant + tool-result * messages accumulated over iterations. * Emits: None directly; ContextRecorder sees the writes. * * Minimal scope for Phase 3e: pass-through of an input message history * array. Full MessageStrategy (windowing, summarizing) arrives in Phase 5. */ import type { FlowChart } from 'footprintjs'; import type { ContextRole } from '../../events/types.js'; /** * A single message supplied by the caller. Structurally matches the * LLMMessage adapter type but local-aliased to keep this file free of * adapter-layer coupling. */ export interface InputMessage { readonly role: ContextRole; readonly content: string; readonly toolCallId?: string; readonly toolName?: string; } export interface MessagesSlotConfig { /** Budget cap (chars). Default: 10000. */ readonly budgetCap?: number; } /** * Build the Messages slot subflow. * * Mount with: * builder.addSubFlowChartNext(SUBFLOW_IDS.MESSAGES, buildMessagesSlot(cfg), 'Messages', { * inputMapper: (parent) => ({ messages: parent.messages, iteration: parent.iteration }), * outputMapper: (sf) => ({ messagesInjections: sf.messagesInjections }), * }) */ export declare function buildMessagesSlot(config?: MessagesSlotConfig): FlowChart;