import { Context, Effect, Layer } from 'effect'; import type * as Schema from 'effect/Schema'; import type { AgentConfig, AgentInstance, AnyAgentInstance } from './agent'; import { AgentNotFoundError, AgentAlreadyExistsError, AgentCreationError } from './errors'; import { ToolRegistryService } from '../tool/service'; import { ProviderRegistryService } from '../platform/service'; import { ProviderConnectionService } from '../platform/connections'; import type { Tracer } from '../tracing'; import type { TemplateEngine } from '../template/engine'; import type { FrameworkConfig } from '../config/types'; import type { MCPServerRegistry } from '../mcp'; import { PromptSourceService, type PromptSourceService as PromptSourceServiceApi } from './prompt-source'; /** * AgentService interface for Effect-based agent lifecycle management */ export interface AgentService { /** * Create an agent from configuration */ createAgent(config: AgentConfig): Effect.Effect, AgentCreationError | AgentAlreadyExistsError>; /** * Get an agent by ID */ getAgent(id: string): Effect.Effect; /** * Get an agent by ID (returns undefined if not found) */ getAgentOptional(id: string): Effect.Effect; /** * Check if an agent exists */ hasAgent(id: string): Effect.Effect; /** * Remove an agent */ removeAgent(id: string): Effect.Effect; /** * Get all agents */ getAllAgents(): Effect.Effect; /** * Clear all agents */ clear(): Effect.Effect; /** * Set the tracer for agent creation */ setTracer(tracer?: Tracer): Effect.Effect; /** * Set default system message for agents */ setDefaultSystemMessage(systemMessage?: string): Effect.Effect; /** * Set global variables resolver */ setGlobalVariablesResolver(resolver: () => Record): Effect.Effect; setTemplateEngine(engine: TemplateEngine): Effect.Effect; setTemplateCustomNamespaces(namespaces: Record): Effect.Effect; setTemplateEnvAllowlist(envAllowlist: string[]): Effect.Effect; setTemplateFredConfig(config: Partial): Effect.Effect; /** Set the client-owned MCP registry used while creating agents. */ setMCPServerRegistry(registry: MCPServerRegistry): Effect.Effect; /** * Match agent by utterance */ matchAgentByUtterance(message: string, semanticMatcher?: (message: string, utterances: string[]) => Promise<{ matched: boolean; confidence: number; utterance?: string; }>): Effect.Effect<{ agentId: string; confidence: number; matchType: 'exact' | 'regex' | 'semantic'; } | null>; /** * Get MCP client connection metrics */ getMCPMetrics(): Effect.Effect; /** * Register shutdown hooks for MCP client cleanup */ registerShutdownHooks(): Effect.Effect; } export declare const AgentService: Context.Tag; /** * Live layer providing AgentService with dependencies on ToolRegistryService and ProviderRegistryService */ export declare const AgentServiceLayer: Layer.Layer; export declare const makeAgentServiceLive: (promptSourceLayer?: Layer.Layer) => Layer.Layer; /** Default AgentService using core string/template prompt resolution. */ export declare const AgentServiceLive: Layer.Layer; //# sourceMappingURL=service.d.ts.map