export interface QueryResult { confidence: number; action: string; } export interface LLMService { query(prompt: string): Promise; } export interface State { [key: string]: any; } export class DummyLlmService implements LLMService { query(prompt: string): Promise; } export class WorkflowOperator { constructor(name: string, operation: (state: State) => Promise); name: string; execute(state: State): Promise; } export class ManifoldRegion { constructor(name: string, operators?: WorkflowOperator[]); name: string; operators: WorkflowOperator[]; adjacentRegions: Set; addOperator(operator: WorkflowOperator): void; connectTo(region: ManifoldRegion): void; getValidOperators(state: State): Promise; } export class NestedManifoldRegion extends ManifoldRegion { constructor(name: string, nestedManifold: WorkflowFunctionManifold); nestedManifold: WorkflowFunctionManifold; navigate(prompt: string): Promise; executeWorkflow(prompt: string): Promise; } export class WorkflowFunctionManifold { constructor(llmService: LLMService); llmService: LLMService; regions: Map; currentRegion: ManifoldRegion | NestedManifoldRegion | null; state: State; addRegion(region: ManifoldRegion | NestedManifoldRegion): void; navigate(prompt: string): Promise; executeWorkflow(prompt: string): Promise; }