/** * Pipeline Context Manager * * Manages pipeline execution context with accumulation of step outputs * and support for isolated context views. */ import type { AgentMessage } from '../agent/agent'; /** * Pipeline execution context. * Accumulates step outputs and provides context for each step. */ export interface PipelineContext { /** Original user input message */ input: unknown; /** Step outputs keyed by step name */ outputs: Record; /** Conversation history (from thread memory) */ history: AgentMessage[]; /** Metadata injected by hooks */ metadata: Record; /** Pipeline ID */ pipelineId: string; /** Optional conversation/thread ID */ conversationId?: string; } /** * Manages pipeline context accumulation and step views. */ export declare class PipelineContextManager { private context; constructor(options: { pipelineId: string; input: unknown; history?: AgentMessage[]; conversationId?: string; }); /** * Get context view for a step. * @param view - 'accumulated' (default) or 'isolated' */ getStepContext(view?: 'accumulated' | 'isolated'): PipelineContext; /** * Record a step's output. * @param stepName - Step name (must be unique) * @param output - Step result */ recordStepOutput(stepName: string, output: unknown): void; /** * Add metadata (typically from hooks). */ addMetadata(key: string, value: unknown): void; /** * Merge metadata object. */ mergeMetadata(metadata: Record): void; /** * Append message to history. */ appendToHistory(message: AgentMessage): void; /** * Get the full accumulated context (for final result). */ getFullContext(): PipelineContext; /** * Get specific step output by name. */ getStepOutput(stepName: string): unknown | undefined; /** * Check if step has recorded output. */ hasStepOutput(stepName: string): boolean; } /** * Create a new pipeline context. */ export declare function createPipelineContext(options: { pipelineId: string; input: unknown; history?: AgentMessage[]; conversationId?: string; }): PipelineContextManager; //# sourceMappingURL=context.d.ts.map