{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "trainer-types",
  "title": "Trainer types",
  "description": "Wire types for the ranges API as the trainer reads it: games, positions, nodes, actions and hand classes.",
  "files": [
    {
      "path": "src/lib/trainer/types.ts",
      "content": "/**\n * Wire types for the ranges API as the trainer consumes it.\n *\n * Ported from the mobile app (`mobile/src/lib/api/types.ts`) — the trainer UI\n * that used to live only in Expo now runs here too, and both clients read the\n * same `/api/ranges/*` payloads. Keep the two in sync.\n */\n\nexport type Game = \"nl\" | \"plo\" | \"plo6hu\" | \"plo5\";\n\nexport type Position = \"UTG\" | \"MP\" | \"LJ\" | \"HJ\" | \"CO\" | \"BTN\" | \"SB\" | \"BB\";\n\nexport type ActionKind = \"fold\" | \"call\" | \"raise\" | \"allin\" | \"other\";\n\n/** NL: a 169-grid class (\"AKs\"). PLO: a MonkerSolver hand string (\"(KA)(KA)\"). */\nexport type HandClass = string;\n\nexport interface Manifest {\n  game: Game;\n  generatedAt: string;\n  bundleCount: number;\n  stacks: number[];\n  positions: Position[];\n}\n\nexport interface NodeAction {\n  action: string;\n  kind: ActionKind;\n  /** hand → frequency in [0, 1] for this action. */\n  weights: Record<HandClass, number>;\n  // NL-only\n  sizePct?: number;\n  combos?: number;\n  // PLO-only\n  raiseDepth?: number;\n  sizeCode?: number;\n  hands?: number;\n  /**\n   * hand → EV in small blinds. Present for PLO, and for NL via the v2 bundles\n   * (`/api/ranges/nl/v2/*`). Only hands that actually take this action are\n   * keyed — an unplayed action carries no EV for the hand, which is why\n   * `gradeAction` has an estimated-basis fallback.\n   */\n  evs?: Record<HandClass, number>;\n  /**\n   * hand → the export's EV source tag, keyed only where the EV is an estimate\n   * (HydraSolver PLO5, and NLH via `/api/ranges/nlh8-hydra`). An exact EV has no entry.\n   */\n  evSources?: Record<HandClass, string>;\n  /**\n   * hand → standard error of that hand's estimated EV, in big blinds. When it\n   * is above `EV_UNCERTAIN_STDERR_BB` the grader ignores the EV.\n   */\n  evStdErrs?: Record<HandClass, number>;\n}\n\nexport interface NodeResponse {\n  game: Game;\n  stack: number;\n  history: string;\n  actor: Position;\n  actions: NodeAction[];\n  /** NL: weighted combos continuing. */\n  continuingCombos?: number;\n  /** PLO: count of hand classes continuing. */\n  continuingHands?: number;\n  hand?: HandClass;\n  strategy?: Record<string, number>;\n}\n\nexport interface SpotIndexEntry {\n  history: string;\n  depth: 1 | 2 | 3 | 4;\n}\n\nexport interface SpotIndex {\n  game: Game;\n  stack: number;\n  generatedAt: string;\n  spots: SpotIndexEntry[];\n}\n",
      "type": "registry:lib",
      "target": "lib/trainer/types.ts"
    }
  ],
  "type": "registry:lib"
}