/**
 * The demo-kit barrel.
 *
 * Two audiences, and the split between them matters.
 *
 * A DEMO under `src/demos/` may import from `@/lib/demo-kit` and from nothing
 * else in the shell. What it should actually reach for is the first block
 * below: the contract types, the two `define*` wrappers, and the two pure
 * helpers it needs to render a score without inventing one. That restriction is
 * enforced by `scripts/check-demos.mjs`, not by what this file happens to
 * export — the shell's own surfaces import through here too, and splitting them
 * into a second barrel would only mean the check script had two paths to allow
 * instead of one.
 *
 * The SHELL may import anything here, or reach into the individual modules
 * (`@/lib/demo-kit/player`, `/registry`, `/episode`, `/reward`, `/verify`) when
 * it wants one thing without the rest.
 */

/* -- The contract. Demos live here. --------------------------------------- */

export type {
  DemoEpisode,
  DemoMeta,
  DemoModule,
  DemoStatus,
  DemoStep,
  Limit,
  ModelCall,
  Narrative,
  Provenance,
  RewardComponent,
  RewardSpec,
  RewardValues,
  RunRef,
  DemoTabId,
  Vertical,
} from './types';

export { DEMO_TABS } from './types';
export { defineDemo, defineMeta } from './define';

/** `null` is "not scored", never 0.0. Every absence goes through these two. */
export { isNotScored, rewardTotal } from './episode';

/* -- Shell machinery. ------------------------------------------------------ */

export {
  demos,
  getDemo,
  getVertical,
  hasDemo,
  listDemos,
  listVerticals,
  loadDemoModule,
  VERTICAL_LABELS,
  VERTICAL_ORDER,
} from './registry';
export type { AnyDemoModule, VerticalGroup } from './registry';

export {
  clearEpisodeCache,
  listRuns,
  loadEpisode,
  loadManifest,
  MANIFEST_PATH,
  scoredCount,
} from './episode';
export type { RunManifest } from './episode';

export {
  FALLBACK_STEP_MS,
  isPlaybackSpeed,
  PLAYBACK_SPEEDS,
  usePlayer,
  usePrefersReducedMotion,
} from './player';
export type { PlaybackSpeed, Player, PlayerOptions } from './player';

export {
  decompose,
  isEdited,
  pruneOverrides,
  reweight,
  WEIGHT_EPSILON,
  weightsAreDegenerate,
} from './reward';
export type { RewardBreakdown, RewardRow, WeightOverrides } from './reward';

export { recomputeRewards, verifyEpisode, verifySummary, VERIFY_TOLERANCE } from './verify';
export type { ComponentComparison, VerifyResult, VerifyStatus } from './verify';
