{
  "schema_version": 2,
  "diagram_type": "workflow",
  "meta": {
    "title": "Kimi Datasource｜动态文档驱动的数据调用",
    "locale": "zh-CN",
    "quality_profile": "showcase",
    "legend": {
      "mode": "hidden"
    },
    "views": [
      {
        "id": "main-flow",
        "label": "内部主流程",
        "focus": [
          "request",
          "route",
          "step1",
          "step2",
          "step3",
          "step4",
          "output"
        ],
        "note": "从任务触发、路由选择到实际处理与交付。"
      },
      {
        "id": "tools-gates",
        "label": "工具与闸门",
        "focus": [
          "step1",
          "step3",
          "tool1",
          "tool2"
        ],
        "note": "查看真实脚本、外部服务以及质量或安全边界。"
      }
    ]
  },
  "lanes": [
    {
      "id": "task",
      "label": "kimi-datasource · 任务与交付"
    },
    {
      "id": "skill",
      "label": "kimi-datasource · 内部流程"
    },
    {
      "id": "runtime",
      "label": "实际工具、脚本与质量/安全闸门"
    }
  ],
  "phases": [
    {
      "id": "intake",
      "label": "触发与路由",
      "fromCol": 0,
      "toCol": 1
    },
    {
      "id": "execution",
      "label": "内部执行",
      "fromCol": 2,
      "toCol": 4,
      "variant": "emphasis"
    },
    {
      "id": "delivery",
      "label": "验证与交付",
      "fromCol": 5,
      "toCol": 5
    }
  ],
  "mainPath": [
    "request",
    "route",
    "step1",
    "step2",
    "step3",
    "step4",
    "output"
  ],
  "nodes": [
    {
      "id": "request",
      "lane": "task",
      "col": 0,
      "type": "external",
      "label": "金融 / 科研 / 宏观查询",
      "sublabel": "35 个外部数据源",
      "width": 155
    },
    {
      "id": "route",
      "lane": "task",
      "col": 1,
      "type": "security",
      "label": "只选一个最匹配数据源",
      "sublabel": "用户点名优先；跨源对比需明确",
      "width": 170
    },
    {
      "id": "output",
      "lane": "task",
      "col": 5,
      "type": "frontend",
      "label": "答案或数据附件",
      "sublabel": "覆盖问题即停止，不多源乱查",
      "width": 175
    },
    {
      "id": "step1",
      "lane": "skill",
      "col": 2,
      "type": "backend",
      "label": "读取数据源 desc",
      "sublabel": "现场获取 API、参数与约束",
      "width": 175
    },
    {
      "id": "step2",
      "lane": "skill",
      "col": 3,
      "type": "backend",
      "label": "发现实体或字段",
      "sublabel": "公司搜索 / wind fields / caixin API",
      "width": 175
    },
    {
      "id": "step3",
      "lane": "skill",
      "col": 4,
      "type": "backend",
      "label": "调用真正取数 API",
      "sublabel": "call_data_source_tool 按文档传参",
      "width": 175
    },
    {
      "id": "step4",
      "lane": "skill",
      "col": 5,
      "type": "backend",
      "label": "读取结果并停止",
      "sublabel": "data_preview / JSON / CSV 落盘",
      "width": 175
    },
    {
      "id": "tool1",
      "lane": "runtime",
      "col": 2,
      "type": "messagebus",
      "label": "Datasource MCP",
      "sublabel": "get_data_source_desc → call tool",
      "width": 180
    },
    {
      "id": "tool2",
      "lane": "runtime",
      "col": 4,
      "type": "security",
      "label": "身份与代码核验",
      "sublabel": "股票代码 WebSearch · 企业全称",
      "width": 180
    }
  ],
  "edges": [
    {
      "id": "requestRoute",
      "from": "request",
      "to": "route"
    },
    {
      "id": "routeStep1",
      "from": "route",
      "to": "step1",
      "variant": "emphasis"
    },
    {
      "id": "step1Step2",
      "from": "step1",
      "to": "step2",
      "variant": "emphasis"
    },
    {
      "id": "step2Step3",
      "from": "step2",
      "to": "step3",
      "variant": "emphasis"
    },
    {
      "id": "step3Step4",
      "from": "step3",
      "to": "step4",
      "variant": "emphasis"
    },
    {
      "id": "step4Output",
      "from": "step4",
      "to": "output",
      "variant": "emphasis"
    },
    {
      "id": "tool1Step1",
      "from": "tool1",
      "to": "step1",
      "variant": "dashed",
      "role": "branch"
    },
    {
      "id": "tool2Step3",
      "from": "tool2",
      "to": "step3",
      "variant": "dashed",
      "role": "branch"
    }
  ],
  "cards": [
    {
      "dot": "cyan",
      "title": "实际命令 / 调用关系",
      "items": [
        "get_data_source_desc({name}) → call_data_source_tool(...)",
        "CSV：先看 data_preview；复杂分析再 Read 完整文件"
      ]
    },
    {
      "dot": "amber",
      "title": "内部约束 / 异常边界",
      "items": [
        "未读 desc 不硬猜 api_name；错误后端 bug 不盲目重试",
        "无登录凭据先 /login；不在 Bash 手跑数据源脚本"
      ]
    },
    {
      "dot": "slate",
      "title": "SKILL.md 来源定位",
      "items": [
        "kimi-datasource/SKILL.md:10-23 调用与数据源",
        ":63-100 选源和标准流程；:128-163 铁律与结果"
      ]
    }
  ]
}
