{
  "schemaVersion": 1,
  "atomId": "level_lifecycle.aicomponent",
  "bundleType": "aicomponent",
  "category": "component",
  "mode": "fixed",
  "label": { "zh": "关卡生命周期控制器", "en": "Level lifecycle controller" },
  "tags": ["lifecycle", "lives", "timer", "gameover", "win", "lose", "next-level"],
  "bindingRoles": ["levelLifecycleController"],
  "scaffold": {
    "files": {
      "src/game/scenes/GameUI/LevelLifecycle.ts": {
        "source": "ref/LevelLifecycle.ts",
        "mode": "full",
        "weight": 10
      }
    }
  },
  "imports": [
    { "slot": "engine",      "pinAtomId": "phaser.aicomponent",        "edgeKind": "requires", "bindAs": "engine" },
    { "slot": "levelState",  "pinAtomId": "level_state.aicomponent",   "edgeKind": "requires", "bindAs": "levelState" },
    {
      "slot": "gameOverDialog",
      "description": "游戏结束面板组件（胜利/失败结果展示）",
      "bindAs": "gameOverPanel",
      "required": true,
      "edgeKind": "compatibleWith",
      "matchBindingRoles": ["gameOverDialog"],
      "allowedBundleTypes": ["aicomponent"]
    },
    {
      "slot": "sfxSuccess",
      "description": "关卡通关成功音效",
      "bindAs": "sfxSuccess",
      "required": false,
      "edgeKind": "compatibleWith",
      "matchBindingRoles": ["sfxSuccess"],
      "allowedBundleTypes": ["aiaudio"]
    },
    {
      "slot": "sfxFail",
      "description": "关卡失败音效",
      "bindAs": "sfxFail",
      "required": false,
      "edgeKind": "compatibleWith",
      "matchBindingRoles": ["sfxFail"],
      "allowedBundleTypes": ["aiaudio"]
    },
    {
      "slot": "sfxLose",
      "description": "生命耗尽/游戏结束音效",
      "bindAs": "sfxLose",
      "required": false,
      "edgeKind": "compatibleWith",
      "matchBindingRoles": ["sfxLose"],
      "allowedBundleTypes": ["aiaudio"]
    },
    {
      "slot": "dangerFlashOverlay",
      "description": "危险提示全屏闪光覆盖层图片",
      "bindAs": "dangerFlashOverlay",
      "required": false,
      "edgeKind": "compatibleWith",
      "matchBindingRoles": ["dangerFlashOverlay"],
      "allowedBundleTypes": ["aiimage"]
    }
  ],
  "exports": [
    { "name": "LevelLifecycle",         "kind": "class",     "location": "src/game/scenes/GameUI/LevelLifecycle.ts" },
    { "name": "LevelLifecycleGameRef",  "kind": "interface", "location": "src/game/scenes/GameUI/LevelLifecycle.ts" }
  ],
  "neutralDescriptor": {
    "geometry": "level state machine managing lives count, win condition detection, game-over display, and automatic level progression",
    "layers": ["state-machine", "ui-trigger", "progression"],
    "replaceable": ["auto-next-level behavior", "game-over panel animation", "life display style"]
  },
  "usageHints": [
    "loseLife() 扣除一条命，命归零时自动触发 handleOutOfLives()",
    "handleLevelSuccess() 在所有路径消除后由 InputHandler 调用，触发胜利流程",
    "handleTimeOut() 倒计时归零时由 CountdownDisplay 调用",
    "playDangerFrame() 生命不足时触发全屏危险闪光（调用 nomove_hint 资源）"
  ],
  "files": {
    "skill": "SKILL.md",
    "levelLifecycle": "ref/LevelLifecycle.ts"
  }
}
