{
  "$schema": "https://www.ai-dc.ai/developer/schemas/aidc-ui.schema.json",
  "aidcUi": "1.0",
  "title": "系统总图",
  "body": [
    {
      "type": "PageHeader",
      "title": "系统总图",
      "description": "Demo Company 的智能体系统：三层，两种机器。点图上方的胶囊，看一条消息怎么走。"
    },
    {
      "type": "Stats",
      "items": [
        {
          "label": "智能体",
          "value": 24,
          "unit": "个",
          "hint": "21 个在共用机器，3 个在自己的机器"
        },
        {
          "label": "现在醒着",
          "value": 3,
          "unit": "个",
          "hint": "其余缩到零，只占盘"
        },
        {
          "label": "冷启动多等",
          "value": "3.2",
          "unit": "秒",
          "hint": "醒着的马上回"
        },
        {
          "label": "入口",
          "value": "一直在线",
          "hint": "主备两台，一个机器人一条长连接"
        }
      ]
    },
    {
      "type": "Card",
      "title": "总图：三层，两种机器",
      "description": "橙色是点亮的路径；虚线是平台登记、发凭证、叫醒智能体",
      "children": [
        {
          "type": "Diagram",
          "summary": "系统总图：三层，两种机器。员工的消息经入口到平台，智能体在共用机器或客户机器上按需运行；点上面的胶囊看一条消息怎么走",
          "groups": [
            {
              "label": "客户机器",
              "sub": "一家一台 · 按同时醒着几个选大小",
              "col": 1,
              "row": 3,
              "cols": 3
            }
          ],
          "nodes": [
            {
              "id": "im",
              "label": "钉钉 · 企业微信",
              "sub": "员工发消息、收文件",
              "col": 0,
              "row": 0,
              "on": [
                "shared",
                "box"
              ]
            },
            {
              "id": "mail",
              "label": "邮件",
              "sub": "每个智能体一个邮箱",
              "col": 0,
              "row": 1
            },
            {
              "id": "web",
              "label": "网页 · API · Adis",
              "sub": "用 Agent Key 调用",
              "col": 0,
              "row": 2
            },
            {
              "id": "entry",
              "label": "共享入口",
              "sub": "一直在线 · 主备两台",
              "lines": [
                "一个机器人一条长连接"
              ],
              "col": 1,
              "row": 0,
              "on": [
                "shared"
              ]
            },
            {
              "id": "platform",
              "label": "平台",
              "sub": "被调用才运行",
              "lines": [
                "· 注册表：谁、在哪、能读谁",
                "· 调度：作业、定时",
                "· Agent Key 网关",
                "· 模型通道：换模型只在这",
                "· 数据集与对象",
                "· 邮件收发"
              ],
              "col": 2,
              "row": 0,
              "rows": 3,
              "on": [
                "shared"
              ]
            },
            {
              "id": "shared",
              "label": "共用机器",
              "sub": "几家共用 · 按需运行",
              "meters": [
                {
                  "label": "公司 A 19",
                  "value": 19,
                  "max": 200
                },
                {
                  "label": "公司 B 119",
                  "value": 119,
                  "max": 200
                },
                {
                  "label": "公司 C 157",
                  "value": 157,
                  "max": 200
                }
              ],
              "lines": [
                "每家一个份额和一块盘",
                "闲 60 秒冻结 · 再闲缩到零"
              ],
              "col": 3,
              "row": 0,
              "rows": 2,
              "on": [
                "shared"
              ]
            },
            {
              "id": "boxin",
              "label": "机器上的入口",
              "sub": "一直在线 · 很小",
              "lines": [
                "睡着先落盘，再叫醒"
              ],
              "col": 1,
              "row": 3,
              "on": [
                "box"
              ]
            },
            {
              "id": "agent",
              "label": "智能体",
              "sub": "来消息才起",
              "lines": [
                "闲 10 分钟安静地停"
              ],
              "col": 2,
              "row": 3,
              "on": [
                "box"
              ]
            },
            {
              "id": "hands",
              "label": "手",
              "sub": "命令 · 文件 · 本机服务",
              "lines": [
                "业务系统（只出站）"
              ],
              "col": 3,
              "row": 3,
              "on": [
                "shared",
                "box"
              ]
            },
            {
              "id": "model",
              "label": "模型",
              "sub": "智能体手里只有令牌；换模型、换推理强度只在平台做",
              "col": 1,
              "row": 4,
              "cols": 3,
              "on": [
                "shared",
                "box"
              ]
            }
          ],
          "edges": [
            {
              "from": "im",
              "to": "entry",
              "label": "长连接",
              "on": [
                "shared"
              ]
            },
            {
              "from": "entry",
              "to": "platform",
              "label": "规范化 · 流式",
              "on": [
                "shared"
              ]
            },
            {
              "from": "platform",
              "to": "shared",
              "label": "派活 · 叫醒",
              "on": [
                "shared"
              ]
            },
            {
              "from": "shared",
              "to": "hands",
              "label": "远程执行",
              "on": [
                "shared"
              ]
            },
            {
              "from": "shared",
              "to": "model",
              "label": "令牌",
              "via": "right",
              "on": [
                "shared"
              ]
            },
            {
              "from": "im",
              "to": "boxin",
              "label": "长连接",
              "via": "left",
              "on": [
                "box"
              ]
            },
            {
              "from": "boxin",
              "to": "agent",
              "label": "叫醒 · 转发",
              "on": [
                "box"
              ]
            },
            {
              "from": "agent",
              "to": "hands",
              "label": "本机",
              "on": [
                "box"
              ]
            },
            {
              "from": "agent",
              "to": "model",
              "label": "令牌",
              "on": [
                "box"
              ]
            },
            {
              "from": "mail",
              "to": "platform",
              "label": "收信 → 一轮"
            },
            {
              "from": "web",
              "to": "platform",
              "label": "Agent Key"
            },
            {
              "from": "platform",
              "to": "agent",
              "label": "登记 · 凭证 · 叫醒",
              "dashed": true
            }
          ],
          "paths": [
            {
              "id": "shared",
              "label": "智能体在共用机器",
              "steps": [
                {
                  "title": "钉钉把消息推给共享入口",
                  "detail": "一个机器人一条长连接"
                },
                {
                  "title": "入口整理好交给平台",
                  "detail": "带上这个智能体的 Key，流式"
                },
                {
                  "title": "平台把活派给共用机器上的智能体",
                  "detail": "醒着马上开始；冻结的热启动几十毫秒，停了的冷启动约 3 秒"
                },
                {
                  "title": "要跑命令、读文件时，在这家的客户机器上执行",
                  "detail": "每个智能体一把钥匙，只能动自己的东西"
                },
                {
                  "title": "回复原路回到钉钉",
                  "detail": "正文只过境，不落平台库"
                },
                {
                  "title": "闲 60 秒冻结在内存里；再闲缩到零",
                  "detail": "保活按它自己的使用间隔"
                }
              ]
            },
            {
              "id": "box",
              "label": "智能体在客户机器",
              "steps": [
                {
                  "title": "钉钉把消息推给客户机器上的入口",
                  "detail": "一个机器人一条长连接"
                },
                {
                  "title": "智能体睡着：入口先把消息落盘，再叫醒它",
                  "detail": "叫醒到连上 3–4 秒"
                },
                {
                  "title": "入口按顺序把消息原样交给它",
                  "detail": "还是钉钉原来的协议"
                },
                {
                  "title": "智能体在本机干活",
                  "detail": "命令、文件、本机服务、自己的出口 IP"
                },
                {
                  "title": "闲 10 分钟安静地停",
                  "detail": "不往群里发「关机」"
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "type": "Table",
      "caption": "三层各做什么",
      "columns": [
        {
          "key": "layer",
          "label": "层"
        },
        {
          "key": "does",
          "label": "做什么"
        },
        {
          "key": "on",
          "label": "一直在线吗",
          "kind": "badge"
        },
        {
          "key": "where",
          "label": "在哪"
        }
      ],
      "rows": [
        {
          "layer": "入口",
          "does": "守着钉钉、企业微信、邮件的连接；消息先到这里",
          "on": {
            "text": "一直在线，很小",
            "tone": "good"
          },
          "where": "共享入口两台；要本地的智能体，入口在客户机器上"
        },
        {
          "layer": "平台",
          "does": "登记、调度、Agent Key、模型通道、数据集与对象",
          "on": {
            "text": "被调用才运行",
            "tone": "neutral"
          },
          "where": "云上"
        },
        {
          "layer": "智能体",
          "does": "读消息、想、动手",
          "on": {
            "text": "按需，闲了缩到零",
            "tone": "signal"
          },
          "where": "共用机器或客户机器"
        }
      ]
    },
    {
      "type": "Grid",
      "columns": 2,
      "children": [
        {
          "type": "Card",
          "title": "共用机器",
          "description": "几家共用，每家一个份额和一块盘",
          "children": [
            {
              "type": "KeyValue",
              "items": [
                {
                  "label": "放什么",
                  "value": "不用本地东西的智能体"
                },
                {
                  "label": "闲了",
                  "value": "60 秒冻结，再闲缩到零"
                },
                {
                  "label": "回复多等",
                  "value": "冻结的几十毫秒，停了的约 3 秒"
                }
              ]
            }
          ]
        },
        {
          "type": "Card",
          "title": "客户机器",
          "description": "一家一台，按同时醒着最多几个选大小",
          "children": [
            {
              "type": "KeyValue",
              "items": [
                {
                  "label": "放什么",
                  "value": "要用本地服务、插件、自己出口 IP 的智能体"
                },
                {
                  "label": "闲了",
                  "value": "10 分钟安静地停"
                },
                {
                  "label": "回复多等",
                  "value": "叫醒到连上 3–4 秒"
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}
