UNPKG

@hashgraphonline/conversational-agent

Version:

Hashgraph Online conversational AI agent implementing HCS-10 communication, HCS-2 registries, and content inscription on Hedera. https://hol.org

82 lines (80 loc) 2.29 kB
import { Logger } from '@hashgraphonline/standards-sdk'; import { SmartMemoryManager } from '../memory/smart-memory-manager'; import { FormEngine, ToolExecutionResult } from '../forms/form-engine'; import { ToolRegistry, ToolRegistryEntry } from '../core/tool-registry'; /** * Session context for tool execution */ export interface SessionContext { sessionId: string; userId?: string; timestamp: number; conversationId?: string; } /** * Context passed through execution pipeline */ export interface ExecutionContext { toolName: string; input: unknown; session: SessionContext; memory: SmartMemoryManager; traceId: string; toolEntry: ToolRegistryEntry; } /** * Result of tool execution with metadata */ export interface ExecutionResult extends ToolExecutionResult { traceId: string; executionTime: number; } /** * ExecutionPipeline handles tool execution coordination */ export declare class ExecutionPipeline { private logger; private toolRegistry; private formEngine; private memory; constructor(toolRegistry: ToolRegistry, formEngine: FormEngine, memory: SmartMemoryManager, logger?: Logger); /** * Execute a tool through the pipeline */ execute(toolName: string, input: unknown, sessionContext?: SessionContext): Promise<ExecutionResult>; /** * Execute tool with validation */ executeWithValidation(toolName: string, input: unknown, sessionContext?: SessionContext): Promise<ExecutionResult>; /** * Process form submission */ processFormSubmission(toolName: string, formId: string, parameters: Record<string, unknown>, sessionContext?: SessionContext): Promise<ExecutionResult>; /** * Check if form generation is required */ private checkFormGeneration; /** * Execute tool directly */ private executeToolDirect; /** * Execute wrapped tool */ private executeWrappedTool; /** * Handle execution error */ private handleExecutionError; /** * Build default session context */ private buildDefaultSession; /** * Get statistics about the pipeline */ getStatistics(): { totalMiddleware: number; registeredMiddleware: string[]; }; }