import type { SystemModelMessage } from 'ai'; import type { Instructions } from '../types/agentConfig.js'; import type { FlowState, ReplyNode, CollectNode } from '../types/flow.js'; import type { ResolvedNode } from '../types/channel.js'; import type { AnyTool } from '../types/effectTool.js'; export declare function resolveInstructions(instructions: Instructions, state: FlowState): string; export declare function buildNodePrompt(node: ReplyNode, state: FlowState): string; /** * Compose the agent base layer into a stable system-message array. * Returned as `SystemModelMessage[]` so a cache breakpoint can annotate the * last message — a single string cannot carry per-message providerOptions. */ /** * Tells the model it may issue several tool calls in one response. * * The runtime already runs parallel-safe calls from a single response concurrently and * fires ONE follow-up completion for the batch (`dispatchModelToolCalls`). Nothing told * the model to batch, so it emitted one call per response and that machinery never fired * — a turn was measured spending ~10,400 ms on six sequential tool round-trips at ~1.7 s * each, while tool execution across the whole turn was 15 ms. * * Round-trip COUNT dominates turn latency, and it is the model that decides the count. * Wording follows Eve's, including the independence caveat: batching calls that depend on * each other is a correctness bug, not a speed-up. * * Lives in the stable head so it sits inside the cache breakpoint rather than being * re-billed every turn. */ export declare const PARALLEL_TOOL_INSTRUCTION: string; export declare function composeSystem(base: Instructions | undefined, nodeSystem: string, state: FlowState, skillPrompt?: string, workingMemoryPrompt?: string): SystemModelMessage[]; /** Flatten system messages to a string for callers that still need one (e.g. structured decide). */ export declare function systemMessagesText(messages: readonly SystemModelMessage[]): string; export declare function resolveReplyNode(node: ReplyNode, state: FlowState, options?: { freeConversation?: boolean; }): ResolvedNode; export declare function resolveCollectExtractionNode(collectNode: CollectNode, missing: string[], state: FlowState, submitTool: AnyTool): ResolvedNode;