// src/core/index.ts

export type { Position } from './composite/Position';

// ═══════════════════════════════════════════════════════════════════════════
// Composite interfaces (extracted to separate files)
// ═══════════════════════════════════════════════════════════════════════════
export type {
  IAddChildOptions,
  IChildDescriptorEntry,
  IChildInfo,
  IComponentTreeDescriptor,
  ICompositeIntrospectChild,
  IDynamicComponentDefinition,
  IRemoteChildInfo,
} from './composite';

// ═══════════════════════════════════════════════════════════════════════════
// Actor system (Phase 2 extraction)
// ═══════════════════════════════════════════════════════════════════════════
export { ActorBehavior } from './actor/ActorBehavior';
export type { ActorBehaviorOptions, IActorBehaviorOptions } from './actor/ActorBehavior';
export type { AcceptsDefinition } from './actor/AcceptsDefinition';
export type { IActorBehavior } from './actor/IActorBehavior';
export type { IDispatchStrategy } from './actor/IDispatchStrategy';
export type { IMessageMeta, MessageMeta } from './actor/IMessageMeta';
export type { IDispatchPriorities, DispatchPriorities } from './actor/IDispatchPriorities';
export { DEFAULT_PRIORITIES } from './actor/IDispatchPriorities';
export type { IBecomePayload, BecomePayload } from './actor/IBecomePayload';

// ═══════════════════════════════════════════════════════════════════════════
// Children management (Phase 3 extraction)
// ═══════════════════════════════════════════════════════════════════════════
export { ChildManager } from './children/ChildManager';
export type { IChildEntry, IAddChildOptions as ChildAddOptions, IComponentClass } from './children/ChildManager';

// ═══════════════════════════════════════════════════════════════════════════
// Messaging helpers (Phase 1 extraction)
// ═══════════════════════════════════════════════════════════════════════════
export { RequestReplyHelper } from './messaging/RequestReplyHelper';

// ═══════════════════════════════════════════════════════════════════════════
// LISP dispatch (Phase 4 extraction)
// ═══════════════════════════════════════════════════════════════════════════
export { LispDispatchStrategy } from './lisp/LispDispatchStrategy';

export { MatrixRuntime } from '../runtime/MatrixRuntime';
export type { IRuntimeConfig } from '../runtime/IRuntimeConfig';

export { HeadlessComponentRegistry } from './ComponentRegistry';
export type {
  IComponentRegistry,
  ComponentConstructor,
  ComponentLoader,
} from './IComponentRegistry';

// Descriptor types - canonical definitions in engine/core/
export type { IChildDescriptor } from '../engine/core/IChildDescriptor';
export type { IComponentDescriptor, InstantiationMode } from '../engine/core/IComponentDescriptor';
export type { ICreateOrGetResult } from '../engine/core/IMatrixRuntime';

export { Supervisor, DEFAULT_SUPERVISION_POLICY } from './Supervision';
export type {
  ISupervisionError,
  SupervisionAction,
  BuiltinStrategy,
  SupervisionFn,
  SupervisionStrategy,
  IRestartLimits,
  ISupervisionPolicy,
} from './Supervision';

export { CheatDetector } from './CheatDetector';
export {
  TARGET_KEY_SEPARATOR,
  canonicalTargetKey,
  isTargetRef,
  normalizeAuthorityRoot,
  normalizeLogicalMount,
} from './identity/TargetRef';
export type { TargetArtifactKind, TargetRef } from './identity/TargetRef';

// ═══════════════════════════════════════════════════════════════════════════
// Security module (Vision 27 - Capability-based security)
// ═══════════════════════════════════════════════════════════════════════════
export * from './security';

// ═══════════════════════════════════════════════════════════════════════════
// Session management (Vision 27 §11.11 - Session Isolation)
// Pure functions only - NO SINGLETONS (Uncle Bob)
// ═══════════════════════════════════════════════════════════════════════════
export {
  generateSessionId,
  getSessionId,
  clearSessionId,
  getSession,
  getSharedSession,
  DEFAULT_SESSION_STORAGE_KEY,
} from './session';
export type {
  ISessionConfig,
  ISessionInfo,
  ISharedSessionConfig,
  ISharedSessionInfo,
} from './session';
