/** * Flow Registry * * Central registry for loaded flows. Provides flow lookup, intent matching, * and instruction loading. LLM intent detection is sourced from chatter's * flow engine (`@diegoaltoworks/chatter/flows`) instead of a duplicate * raw-fetch implementation, loaded on demand so the optional peer stays * optional (see `./engine.ts`); directory loading stays talker's own (see * `./loader.ts` - chatter's loader requires at least one schema property per * flow, which would silently drop zero-parameter flows like this registry's * own keyword-triggered "transfer" handoff). */ import type { TalkerDependencies } from "../types"; import { type FlowEngine, type FlowEngineLoader } from "./engine"; import type { LoadedFlow } from "./types"; export declare class FlowRegistry { private flows; private flowsDir; private engineLoader; /** * @param flowsDir Directory of flow definitions. * @param engineLoader Override for chatter's flow engine (tests only). */ constructor(flowsDir: string, engineLoader?: FlowEngineLoader); /** * Chatter's flow engine, loaded on first use. The registry owns the handle * so `processFlow` reaches the engine through the same seam. * * Rejects with an actionable message when the optional peer is absent. */ getEngine(): Promise; /** * Load all flows from the flows directory */ loadFlows(): Promise; /** * Get a flow by name */ getFlow(name: string): LoadedFlow | undefined; /** * Match user message to a flow using hybrid approach: * 1. Critical keyword detection (immediate) * 2. LLM intent classification */ matchFlow(deps: TalkerDependencies, phoneNumber: string, message: string, conversationContext?: string[]): Promise; /** * Get all loaded flows */ getAllFlows(): LoadedFlow[]; /** * Get flow instructions content */ getInstructions(flowName: string): string; }