/** * Fred Service Composition * * This module provides the aggregate FredLayers layer that composes all * Effect services, plus runtime creation utilities. */ import { Effect, Layer, Runtime, Scope } from 'effect'; import { ToolRegistryService, ToolRegistryServiceLive } from './tool/service'; import { ToolGateService, ToolGateServiceLive } from './tool-gate/service'; import type { ToolGateServiceApi } from './tool-gate/types'; import { HookManagerService, HookManagerServiceLive } from './hooks/service'; import { ProviderRegistryService, ProviderRegistryServiceLive } from './platform/service'; import { ProviderConnectionService } from './platform/connections'; import { ContextStorageService, ContextStorageServiceLive, ContextStorageServiceLiveWithAdapter } from './context/service'; import type { ContextStorage } from './context/context'; import { SessionService, SessionServiceLive } from './context/session-service'; import { AgentService, AgentServiceLive } from './agent/service'; import { DefaultPromptSourceLayer, PromptSourceService, type PromptSourceService as PromptSourceServiceApi } from './agent/prompt-source'; import { WorkflowService, WorkflowServiceLive } from './workflow/service'; import { CheckpointService } from './pipeline/checkpoint/service'; import { PauseService, PauseServiceLive } from './pipeline/pause/service'; import { PipelineService, PipelineServiceLive } from './pipeline/service'; import { MessageProcessorService, MessageProcessorServiceLive } from './message-processor/service'; import { IntentMatcherService, IntentMatcherServiceLive } from './intent/service'; import { IntentRouterService, IntentRouterServiceLive } from './intent/service'; import { SubagentService, SubagentServiceLive } from './subagent/service'; import { MessageRouterService, MessageRouterServiceLiveWithConfig } from './routing/service'; import { ObservabilityService, ObservabilityServiceLive } from './observability/service'; import { AgentStatusService, AgentStatusServiceLive } from './observability/status'; import type { ObservabilityLayers } from './observability/otel'; import type { CheckpointStorage } from './pipeline/checkpoint/types'; import type { RoutingConfig } from './routing/types'; /** * Core Fred service types included in FredLayers. */ export type FredServices = ToolRegistryService | ToolGateServiceApi | HookManagerService | ProviderRegistryService | ProviderConnectionService | ContextStorageService | PromptSourceServiceApi | AgentService | WorkflowService | CheckpointService | PauseService | PipelineService | MessageProcessorService | SubagentService | IntentMatcherService | IntentRouterService | MessageRouterService | SessionService | ObservabilityService | AgentStatusService; /** * Fred runtime type with all services */ export type FredRuntime = Runtime.Runtime; declare const CheckpointServiceLive: Layer.Layer; /** * Complete Fred layers - all services composed * * Dependency graph: * ``` * ToolRegistryService (Wave 1) * HookManagerService (Wave 1) * ObservabilityService (Wave 1) * | * v * ProviderRegistryService (Wave 2) * ContextStorageService (Wave 2) * CheckpointService (Wave 2) * | * v * PauseService (Wave 2.5 - depends on Checkpoint) * | * v * AgentService (Wave 3 - depends on Tool, Provider) * | * v * PipelineService (Wave 4 - depends on Agent, Hook, Checkpoint, Pause) * | * v * MessageProcessorService (Wave 5 - depends on Agent, Pipeline, Context) * | * v * IntentMatcherService (Wave 6) * IntentRouterService (Wave 6 - depends on Agent) * MessageRouterService (Wave 6 - default no-op) * ``` */ export declare const makeFredLayers: (promptSourceLayer?: Layer.Layer, contextStorageLayer?: Layer.Layer, checkpointServiceLayer?: Layer.Layer, messageRouterLayer?: Layer.Layer, providerConnectionLayer?: Layer.Layer) => Layer.Layer; export declare const FredLayers: Layer.Layer; /** * Build Fred layers with a config-driven MessageRouterService. * * Composes FredLayers (which includes a default no-op router) with the * config-driven MessageRouterService. Layer.merge gives the second (right) * layer priority, so the config-driven router replaces the no-op default. */ export declare const makeFredLayersWithLeafRouting: (routerConfig: RoutingConfig, promptSourceLayer?: Layer.Layer) => Layer.Layer; export interface FredLayerOptions { routingConfig?: RoutingConfig; observabilityLayers?: ObservabilityLayers; promptSourceLayer?: Layer.Layer; storage?: ContextStorage; checkpointStorage?: CheckpointStorage; checkpointTtlMs?: number; /** Explicit provider-connection service, such as an encrypted Postgres store. */ providerConnectionLayer?: Layer.Layer; } /** * Compose Fred layers from runtime options. */ export declare const makeFredRuntimeLayer: (options?: FredLayerOptions) => Layer.Layer; /** * Create a Fred runtime from runtime composition options. */ export declare const createFredRuntimeWithOptions: (options?: FredLayerOptions) => Effect.Effect; /** * Create a Fred runtime with all services. * * The runtime is scoped and will clean up resources when the scope closes. * Use this for applications that need long-running Fred instances. * * @example * ```typescript * const runtime = await createFredRuntime(); * * // Use runtime to run Effects * const result = await Effect.runPromise( * myEffect.pipe(Effect.provide(runtime)) * ); * ``` */ export declare const createFredRuntime: () => Effect.Effect; /** * Create a scoped Fred runtime that auto-cleans up. * * @example * ```typescript * const runtime = await createScopedFredRuntime(); * // runtime is ready to use * // cleanup happens when process exits * ``` */ export declare const createScopedFredRuntime: () => Promise; export { ToolRegistryService, ToolRegistryServiceLive, ToolGateService, ToolGateServiceLive, HookManagerService, HookManagerServiceLive, ProviderRegistryService, ProviderRegistryServiceLive, ProviderConnectionService, ContextStorageService, ContextStorageServiceLive, ContextStorageServiceLiveWithAdapter, SessionService, SessionServiceLive, PromptSourceService, DefaultPromptSourceLayer, AgentService, AgentServiceLive, WorkflowService, WorkflowServiceLive, CheckpointService, CheckpointServiceLive, PauseService, PauseServiceLive, PipelineService, PipelineServiceLive, MessageProcessorService, MessageProcessorServiceLive, SubagentService, SubagentServiceLive, IntentMatcherService, IntentMatcherServiceLive, IntentRouterService, IntentRouterServiceLive, MessageRouterService, MessageRouterServiceLiveWithConfig, ObservabilityService, ObservabilityServiceLive, AgentStatusService, AgentStatusServiceLive, }; //# sourceMappingURL=services.d.ts.map