{
  "schema_version": 3,
  "diagram_type": "lifecycle",
  "meta": {
    "title": "Starter · 生活循环与点击",
    "locale": "zh-CN",
    "output": ".archify/lifecycle-tier-actions-20261019-124804/starter-daily/starter-daily.html",
    "quality_profile": "showcase",
    "repository": {
      "url": "https://github.com/KiddyPet/desktop-pet.git",
      "revision": "e8beb36cba40d740c227c25450b629021969c694",
      "link_mode": "local-only"
    }
  },
  "mainPath": [
    "startup",
    "awake",
    "pending",
    "sleep"
  ],
  "states": [
    {
      "id": "startup",
      "type": "start",
      "label": "启动 / 恢复",
      "sublabel": "按时段与久别信息进入",
      "sources": [
        {
          "path": "apps/desktop/src/pet-runtime/playback/StateEngine.ts",
          "line": 177,
          "end_line": 211
        }
      ]
    },
    {
      "id": "awake",
      "type": "active",
      "label": "清醒待机",
      "sublabel": "IDLE_PRONE / IDLE_WALK",
      "sources": [
        {
          "path": "apps/desktop/src/pet-runtime/playback/StateEngine.ts",
          "line": 804,
          "end_line": 849
        }
      ]
    },
    {
      "id": "pending",
      "type": "waiting",
      "label": "入睡预告",
      "sublabel": "sleepPending · 1.2 秒",
      "sources": [
        {
          "path": "apps/desktop/src/pet-runtime/playback/StateEngine.ts",
          "line": 1721,
          "end_line": 1724
        }
      ]
    },
    {
      "id": "sleep",
      "type": "waiting",
      "label": "睡眠动作池",
      "sublabel": "3 种基础睡姿",
      "sources": [
        {
          "path": "apps/desktop/src/pet-runtime/playback/StateEngine.ts",
          "line": 746,
          "end_line": 801
        }
      ]
    },
    {
      "id": "activity",
      "type": "active",
      "label": "随机 / 点击单次动作",
      "sublabel": "3 种活动候选",
      "sources": [
        {
          "path": "apps/desktop/src/pet-runtime/playback/StateEngine.ts",
          "line": 980,
          "end_line": 992
        },
        {
          "path": "apps/desktop/src/pet-runtime/playback/StateEngine.ts",
          "line": 692,
          "end_line": 699
        }
      ]
    },
    {
      "id": "dream",
      "type": "active",
      "label": "偶发梦中踢腿",
      "sublabel": "IDLE_DREAM_KICK",
      "sources": [
        {
          "path": "apps/desktop/src/pet-runtime/playback/StateEngine.ts",
          "line": 1770,
          "end_line": 1781
        },
        {
          "path": "apps/desktop/src/pet-runtime/playback/StateEngine.ts",
          "line": 783,
          "end_line": 801
        }
      ]
    },
    {
      "id": "posture",
      "type": "decision",
      "label": "选下一待机姿态",
      "sublabel": "保留清醒周期",
      "sources": [
        {
          "path": "apps/desktop/src/pet-runtime/playback/StateEngine.ts",
          "line": 847,
          "end_line": 849
        }
      ]
    }
  ],
  "transitions": [
    {
      "id": "startup-awake",
      "from": "startup",
      "to": "awake",
      "label": "日间默认"
    },
    {
      "id": "awake-pending",
      "from": "awake",
      "to": "pending",
      "label": "清醒时长到期"
    },
    {
      "id": "pending-sleep",
      "from": "pending",
      "to": "sleep",
      "label": "预告结束"
    },
    {
      "id": "startup-sleep",
      "from": "startup",
      "to": "sleep",
      "label": "深夜 / 配置睡眠"
    },
    {
      "id": "sleep-awake",
      "from": "sleep",
      "to": "awake",
      "label": "到期且用户在场"
    },
    {
      "id": "awake-activity",
      "from": "awake",
      "to": "activity",
      "label": "活动计时到期"
    },
    {
      "id": "activity-awake",
      "from": "activity",
      "to": "awake",
      "label": "完成且无排队"
    },
    {
      "id": "sleep-dream",
      "from": "sleep",
      "to": "dream",
      "label": "换姿时命中且有媒体"
    },
    {
      "id": "dream-sleep",
      "from": "dream",
      "to": "sleep",
      "label": "单次结束"
    },
    {
      "id": "sleep-sleep",
      "from": "sleep",
      "to": "sleep",
      "label": "换姿或续睡"
    },
    {
      "id": "awake-posture",
      "from": "awake",
      "to": "posture",
      "label": "待机到期"
    },
    {
      "id": "posture-awake",
      "from": "posture",
      "to": "awake",
      "label": "换片"
    }
  ],
  "cards": [
    {
      "dot": "cyan",
      "title": "档位与动作池",
      "items": [
        "商业独立视频目标 13，图中节点数不代表视频数。",
        "睡眠：IDLE_LOAF_1、IDLE_CURL、IDLE_PAW_PILLOW_SLEEP。",
        "活动：IDLE_STRETCH_2、IDLE_PLAY_1、IDLE_PLAY_3。",
        "点击：IDLE_PRONE、IDLE_WALK、IDLE_STRETCH_2、IDLE_PLAY_1、IDLE_PLAY_3；过滤缺失媒体、未解锁和重复项。"
      ]
    },
    {
      "dot": "amber",
      "title": "当前源码的时钟",
      "items": [
        "趴卧停留 25–40 秒；其他清醒循环 60–90 秒，按媒体周期向上对齐。",
        "随机活动独立计时默认 60–120 秒；当前 tick 会在到期时进入活动。",
        "睡姿 2–3 分钟切换；睡眠周期由时段表决定。梦中踢腿每睡眠周期最多一次、换姿时 10%，且须能在周期结束前播完。",
        "用户不在场时，awake/activity/hover 转睡眠；睡眠到期继续延长。"
      ]
    },
    {
      "dot": "rose",
      "title": "范围与分歧",
      "items": [
        "本图是生活专题子状态机；hover、菜单互动、寻人、拖拽在同页其他专题展示。",
        "久别 ≥7 天使用回归文案，仍进入普通清醒。",
        "产品合同要求活动在自然边界插入；cycleAwakeAtBoundary 虽已定义，tick 当前未调用。这里保留实际执行路径。"
      ]
    },
    {
      "dot": "violet",
      "title": "跨专题出口",
      "items": [
        "awake 在场且寻人时段命中时进入寻人；activity/sleep 中先排队，分别在动作/睡眠完成后进入寻人。详见寻人专题。",
        "点击按媒体 loop 分类；详见点击专题的显式转换。"
      ]
    },
    {
      "dot": "cyan",
      "title": "清醒自循环箭头",
      "items": [
        "awake → 选下一待机姿态 → awake：待机姿态停留到期时从 awakeLoopPool 选择下一条循环，保留完整清醒周期。"
      ]
    }
  ]
}