// src/lisp/index.ts
// LISP-on-Protocol - Public API
//
// This module provides the core LISP evaluation engine for Matrix.
// It enables:
// - S-expression parsing (traditional LISP syntax to JSON wire format)
// - Pure LISP evaluation (standalone or Matrix-integrated)
// - Virtual LISP Machine primitives (distributed evaluation)
// - Reactive stream runtime

// Core types
export type { SExpr } from './SExpr';
export type { ILambdaClosure } from './ILambdaClosure';
export type { IMacroDef } from './IMacroDef';
export type { IStream } from './IStream';
export type { IStreamOperator } from './IStreamOperator';
export type { IActiveSubscription } from './IActiveSubscription';
export type { ITravelingMessage } from './ITravelingMessage';
export type { Environment, Definitions } from './EnvironmentTypes';

// Configuration
export {
  getLispConfig,
  setLispConfig,
  resetLispConfig,
  DEFAULT_LISP_CONFIG,
} from './config';
export type { ILispConfig } from './config';

// Core interpreter
export { Interpreter } from './core/Interpreter';
export type { IRemoteCallHandler, IInterpreterOptions } from './core/Interpreter';
export { EvalContext } from './core/Environment';
export { StreamRuntime } from './core/StreamRuntime';
export type { ApplyLambdaFn, EmitFn } from './core/StreamRuntime';

// S-expression parser
export {
  parseSExpr,
  parseSExprSingle,
  parseForEval,
  toSExpr,
  prettySExpr,
  wrapInDo,
  SCHEME_EXAMPLES,
  parseSchemeExample,
} from './core/SExprParser';

// VLM (Virtual LISP Machine)
export {
  METACIRCULAR_EVAL,
  getMetacircularEval,
  PARALLELIZABLE_OPS,
  canAtomize,
  allArgsAreAtoms,
  getVLMNamespace,
  // VLM Components
  VLMRouter,
  VLMJoinCoordinator,
  VLMAtomizer,
  VLMBootstrapNode,
  VLMEntryPoint,
} from './vlm';
export type {
  IVLMTrace,
  IJoinInfo,
  IVLMTravelingMessage,
  IAtomizedMessage,
  INodeInfo,
  IJoinState,
  VLMEventType,
  IVLMEvent,
} from './vlm';

// Primitives
export {
  allPrimitives,
  primitiveMap,
  buildPrimitiveMap,
  isPrimitive,
  getPrimitive,
  getAllPrimitiveNames,
  getPrimaryPrimitiveNames,
  primitivesByCategory,
  categoryNames,
  // Individual collections
  mccarthyPrimitives,
  arithmeticPrimitives,
  comparisonPrimitives,
  booleanPrimitives,
  listPrimitives,
  higherOrderPrimitives,
  stringPrimitives,
  streamPrimitives,
  matrixPrimitives,
  metaPrimitives,
} from './primitives';
export type { IPrimitiveDefinition, PrimitiveHandler } from './primitives';

// Components (MatrixActor wrappers)
export {
  LispEval,
  SchemeEval,
  BootstrapNode,
} from './components';
