/** * System-Prompt slot subflow builder * * Pattern: Builder (returns a FlowChart mountable via addSubFlowChartNext). * Role: Layer-3 context engineering; inside Layer-5 primitives * (LLMCall, Agent). Ported from v1's buildSystemPromptSubflow * to InjectionRecord + SlotComposition shape. * Emits: None directly. Writes to conventional scope keys; ContextRecorder * observes and emits context.* events. * * Minimal scope for Phase 3e: static prompt string OR a dynamic function * of the input. Full SystemPromptProvider / Skill / RAG integration * arrives in Phase 5. */ import type { FlowChart } from 'footprintjs'; /** * Function that produces the system prompt string given runtime scope * context. Receives the subflow's $getArgs() payload. */ export type SystemPromptFn = (args: { readonly userMessage?: string; readonly iteration?: number; }) => string | Promise; export interface SystemPromptSlotConfig { /** Static string OR a function. Empty string → no injection, empty slot. */ readonly prompt: string | SystemPromptFn; /** Budget cap (chars). Default: 4000. */ readonly budgetCap?: number; /** Optional description — where this prompt originated (e.g. "agent.system()"). */ readonly reason?: string; } /** * Build the System-Prompt slot subflow. * * Mount with: * builder.addSubFlowChartNext(SUBFLOW_IDS.SYSTEM_PROMPT, buildSystemPromptSlot(cfg), 'System Prompt', { * inputMapper: (parent) => ({ userMessage: parent.userMessage, iteration: parent.iteration }), * outputMapper: (sf) => ({ systemPromptInjections: sf.systemPromptInjections }), * }) */ export declare function buildSystemPromptSlot(config: SystemPromptSlotConfig): FlowChart;