// src/flow/index.ts
//
// Flow Module - Fluent API for distributed flows over Matrix.
// Inspired by LINQ's IEnumerable<T> and Rx's IObservable<T>,
// the flow DSL provides IMatrixComponent as a strongly-typed
// return type for component operations.

// Core types
export type {
  IMatrixComponent,
  IComponentMetadata,
  IMatrixComponentOptions,
} from './IMatrixComponent';

export { isMatrixComponent } from './IMatrixComponent';

// Implementation
export {
  MatrixComponentImpl,
  createComponent,
  getComponent,
} from './MatrixComponentImpl';

// FlowBuilder
export { FlowBuilder } from './FlowBuilder';

// Shell Registry for type-based shell lookup
// ShellRegistryComponent is a MatrixActor service mounted at system.registry.shell
export { ShellRegistry, ShellRegistryComponent, RegisterShell } from './ShellRegistry';
export type { IShellInfo } from './ShellRegistry';
export type { IShellRegistry } from './IShellRegistry';

// ResultsPanel - MatrixActor for hosting query results as child components
export { ResultsPanel } from './ResultsPanel';
export type { ResultType, IResultDescriptor, IResultInfo } from './ResultsPanel';

// Result viewer components
export { DataViewer, ErrorViewer, CommandResultViewer } from './viewers';

// Context
export { FlowContext, createFlowContext } from './FlowContext';
export type { IFlowContextData } from './FlowContext';

// Engine
export { FlowEngine } from './FlowEngine';

// Plan & Types
export type { IFlowPlan } from './FlowPlan';
export { cloneFlowPlan } from './FlowPlan';
export type {
  AnyStage,
  ILocalMapStage,
  ILocalFilterStage,
  IRemoteRRStage,
  IRemoteSinkStage,
} from './FlowTypes';
