<?xml version="1.0" encoding="UTF-8"?>
<mxfile host="drawio" version="26.0.0">
  <diagram name="Architecture">
    <mxGraphModel dx="1422" dy="794" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1600" pageHeight="1100" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>
        <mxCell id="title" value="单进程运行时分层图" style="text;html=1;strokeColor=none;fillColor=none;fontSize=26;fontColor=#263238;fontStyle=1;align=left;verticalAlign=middle;whiteSpace=wrap" vertex="1" parent="1"><mxGeometry x="50" y="25" width="1500" height="42" as="geometry"/></mxCell>
        <mxCell id="access-layer" value="1 · 接入与展示层" style="swimlane;startSize=30;html=1;container=1;collapsible=0;pointerEvents=0;fillColor=#e8f1fb;swimlaneFillColor=#ffffff;strokeColor=#3b82a0;fontColor=#263238;fontSize=15;fontStyle=1;dashed=0;strokeWidth=1.5;rounded=0;shadow=0" vertex="1" parent="1"><mxGeometry x="50" y="130" width="1500" height="130" as="geometry"/></mxCell>
        <mxCell id="engine-layer" value="2 · Engine 入口与生命周期层" style="swimlane;startSize=30;html=1;container=1;collapsible=0;pointerEvents=0;fillColor=#fff0df;swimlaneFillColor=#ffffff;strokeColor=#c96f2d;fontColor=#263238;fontSize=15;fontStyle=1;dashed=0;strokeWidth=1.5;rounded=0;shadow=0" vertex="1" parent="1"><mxGeometry x="50" y="290" width="1500" height="130" as="geometry"/></mxCell>
        <mxCell id="runtime-layer" value="3 · Tenant Runtime 与调度层" style="swimlane;startSize=30;html=1;container=1;collapsible=0;pointerEvents=0;fillColor=#e9f5ec;swimlaneFillColor=#ffffff;strokeColor=#4f8a5b;fontColor=#263238;fontSize=15;fontStyle=1;dashed=0;strokeWidth=1.5;rounded=0;shadow=0" vertex="1" parent="1"><mxGeometry x="50" y="450" width="1500" height="170" as="geometry"/></mxCell>
        <mxCell id="execution-layer" value="4 · Agent 执行与领域能力层" style="swimlane;startSize=30;html=1;container=1;collapsible=0;pointerEvents=0;fillColor=#fff6d9;swimlaneFillColor=#ffffff;strokeColor=#c28b20;fontColor=#263238;fontSize=15;fontStyle=1;dashed=0;strokeWidth=1.5;rounded=0;shadow=0" vertex="1" parent="1"><mxGeometry x="50" y="650" width="1500" height="170" as="geometry"/></mxCell>
        <mxCell id="data-layer" value="5 · 事件、回复与持久化层" style="swimlane;startSize=30;html=1;container=1;collapsible=0;pointerEvents=0;fillColor=#e5f5f3;swimlaneFillColor=#ffffff;strokeColor=#3c8d87;fontColor=#263238;fontSize=15;fontStyle=1;dashed=0;strokeWidth=1.5;rounded=0;shadow=0" vertex="1" parent="1"><mxGeometry x="50" y="850" width="1500" height="150" as="geometry"/></mxCell>
        <mxCell id="ui" value="Web Chat / Console / Embed" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#e8f1fb;strokeColor=#3b82a0;fontColor=#263238;fontSize=13;fontStyle=0;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="access-layer"><mxGeometry x="35" y="50" width="300" height="55" as="geometry"/></mxCell>
        <mxCell id="route" value="HTTP API / OpenAPI" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#e8f1fb;strokeColor=#3b82a0;fontColor=#263238;fontSize=13;fontStyle=0;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="access-layer"><mxGeometry x="410" y="50" width="300" height="55" as="geometry"/></mxCell>
        <mxCell id="channel" value="Web / IM Channel" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#e8f1fb;strokeColor=#3b82a0;fontColor=#263238;fontSize=13;fontStyle=0;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="access-layer"><mxGeometry x="785" y="50" width="260" height="55" as="geometry"/></mxCell>
        <mxCell id="scheduler" value="Scheduler / Async Task" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#e8f1fb;strokeColor=#3b82a0;fontColor=#263238;fontSize=13;fontStyle=0;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="access-layer"><mxGeometry x="1120" y="50" width="300" height="55" as="geometry"/></mxCell>
        <mxCell id="instrument" value="进程启动&#xa;初始化 Engine" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#fff0df;strokeColor=#c96f2d;fontColor=#263238;fontSize=13;fontStyle=0;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="engine-layer"><mxGeometry x="80" y="45" width="300" height="58" as="geometry"/></mxCell>
        <mxCell id="singleton" value="Engine 单例&#xa;单副本内复用" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#fff0df;strokeColor=#c96f2d;fontColor=#263238;fontSize=13;fontStyle=0;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="engine-layer"><mxGeometry x="470" y="45" width="330" height="58" as="geometry"/></mxCell>
        <mxCell id="getengine" value="Engine 服务入口" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#fff0df;strokeColor=#c96f2d;fontColor=#263238;fontSize=13;fontStyle=1;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="engine-layer"><mxGeometry x="890" y="45" width="260" height="58" as="geometry"/></mxCell>
        <mxCell id="role" value="运行角色&#xa;组合 / Gateway / Runtime" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#f1eafa;strokeColor=#8064a2;fontColor=#263238;fontSize=13;fontStyle=0;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="engine-layer"><mxGeometry x="1220" y="45" width="230" height="58" as="geometry"/></mxCell>
        <mxCell id="tenant-resolve" value="身份与租户解析" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#e9f5ec;strokeColor=#4f8a5b;fontColor=#263238;fontSize=13;fontStyle=0;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="runtime-layer"><mxGeometry x="40" y="55" width="240" height="65" as="geometry"/></mxCell>
        <mxCell id="registry" value="Tenant Runtime Registry" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#e9f5ec;strokeColor=#4f8a5b;fontColor=#263238;fontSize=13;fontStyle=1;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="runtime-layer"><mxGeometry x="340" y="55" width="260" height="65" as="geometry"/></mxCell>
        <mxCell id="runtime" value="Tenant Runtime&#xa;Config · Agent · Session · Memory" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#e9f5ec;strokeColor=#4f8a5b;fontColor=#263238;fontSize=13;fontStyle=0;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="runtime-layer"><mxGeometry x="660" y="45" width="350" height="85" as="geometry"/></mxCell>
        <mxCell id="dispatch" value="Dispatcher · Ledger · Trigger" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#fff6d9;strokeColor=#c28b20;fontColor=#263238;fontSize=13;fontStyle=0;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="runtime-layer"><mxGeometry x="1070" y="55" width="320" height="65" as="geometry"/></mxCell>
        <mxCell id="queue" value="会话队列 / Chat ownership" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#fff6d9;strokeColor=#c28b20;fontColor=#263238;fontSize=11;fontStyle=0;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="runtime-layer"><mxGeometry x="1130" y="125" width="260" height="32" as="geometry"/></mxCell>
        <mxCell id="runner" value="Agent Runner&#xa;Claude Agent SDK query()" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#fff6d9;strokeColor=#c28b20;fontColor=#263238;fontSize=13;fontStyle=1;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="execution-layer"><mxGeometry x="55" y="50" width="310" height="82" as="geometry"/></mxCell>
        <mxCell id="model" value="Model Gateway / LLM" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#fff0df;strokeColor=#c96f2d;fontColor=#263238;fontSize=13;fontStyle=0;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="execution-layer"><mxGeometry x="420" y="60" width="260" height="62" as="geometry"/></mxCell>
        <mxCell id="skilltool" value="Skill / Tool / MCP" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#fff0df;strokeColor=#c96f2d;fontColor=#263238;fontSize=13;fontStyle=0;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="execution-layer"><mxGeometry x="735" y="60" width="260" height="62" as="geometry"/></mxCell>
        <mxCell id="domain" value="Session / Memory / File" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#f1eafa;strokeColor=#8064a2;fontColor=#263238;fontSize=13;fontStyle=0;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="execution-layer"><mxGeometry x="1050" y="60" width="260" height="62" as="geometry"/></mxCell>
        <mxCell id="plugin" value="Extension / Plugin Runtime" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#f1eafa;strokeColor=#8064a2;fontColor=#263238;fontSize=11;fontStyle=0;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="execution-layer"><mxGeometry x="1050" y="128" width="260" height="30" as="geometry"/></mxCell>
        <mxCell id="events" value="EventBus / ChatTask" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#fff6d9;strokeColor=#c28b20;fontColor=#263238;fontSize=13;fontStyle=0;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="data-layer"><mxGeometry x="45" y="48" width="280" height="62" as="geometry"/></mxCell>
        <mxCell id="response" value="SSE / Channel Reply / Callback" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#e8f1fb;strokeColor=#3b82a0;fontColor=#263238;fontSize=13;fontStyle=0;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="data-layer"><mxGeometry x="375" y="48" width="330" height="62" as="geometry"/></mxCell>
        <mxCell id="database" value="SQLite / MySQL" style="shape=cylinder3;arcSize=8;whiteSpace=wrap;html=1;fillColor=#e9f5ec;strokeColor=#4f8a5b;fontColor=#263238;fontSize=13;fontStyle=0;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="data-layer"><mxGeometry x="755" y="42" width="230" height="75" as="geometry"/></mxCell>
        <mxCell id="cache" value="Redis&#xa;缓存 / 广播 / 租约" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#fff6d9;strokeColor=#c28b20;fontColor=#263238;fontSize=13;fontStyle=0;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="data-layer"><mxGeometry x="1040" y="42" width="210" height="75" as="geometry"/></mxCell>
        <mxCell id="myfs" value="MyFS&#xa;本地 / 对象存储" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#e5f5f3;strokeColor=#3c8d87;fontColor=#263238;fontSize=13;fontStyle=0;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="data-layer"><mxGeometry x="1305" y="42" width="150" height="75" as="geometry"/></mxCell>
        <mxCell id="access-engine" value="调用" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#64748b;fontColor=#475569;fontSize=11;strokeWidth=1.5;dashed=0;endArrow=block;endFill=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;exitDx=0;exitDy=0;entryDx=0;entryDy=0" edge="1" parent="1" source="route" target="getengine"><mxGeometry relative="1" as="geometry"></mxGeometry></mxCell>
        <mxCell id="instrument-singleton" value="启动并复用" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#64748b;fontColor=#475569;fontSize=11;strokeWidth=1.5;dashed=0;endArrow=block;endFill=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;exitDx=0;exitDy=0;entryDx=0;entryDy=0" edge="1" parent="1" source="instrument" target="singleton"><mxGeometry relative="1" as="geometry"></mxGeometry></mxCell>
        <mxCell id="singleton-get" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#64748b;fontColor=#475569;fontSize=11;strokeWidth=1.5;dashed=0;endArrow=block;endFill=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;exitDx=0;exitDy=0;entryDx=0;entryDy=0" edge="1" parent="1" source="singleton" target="getengine"><mxGeometry relative="1" as="geometry"></mxGeometry></mxCell>
        <mxCell id="get-registry" value="解析租户 Runtime" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#64748b;fontColor=#475569;fontSize=11;strokeWidth=1.5;dashed=0;endArrow=block;endFill=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;exitDx=0;exitDy=0;entryDx=0;entryDy=0" edge="1" parent="1" source="getengine" target="registry"><mxGeometry relative="1" as="geometry"></mxGeometry></mxCell>
        <mxCell id="resolve-registry" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#64748b;fontColor=#475569;fontSize=11;strokeWidth=1.5;dashed=0;endArrow=block;endFill=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;exitDx=0;exitDy=0;entryDx=0;entryDy=0" edge="1" parent="1" source="tenant-resolve" target="registry"><mxGeometry relative="1" as="geometry"></mxGeometry></mxCell>
        <mxCell id="registry-runtime" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#64748b;fontColor=#475569;fontSize=11;strokeWidth=1.5;dashed=0;endArrow=block;endFill=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;exitDx=0;exitDy=0;entryDx=0;entryDy=0" edge="1" parent="1" source="registry" target="runtime"><mxGeometry relative="1" as="geometry"></mxGeometry></mxCell>
        <mxCell id="runtime-dispatch" value="任务路由" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#64748b;fontColor=#475569;fontSize=11;strokeWidth=1.5;dashed=0;endArrow=block;endFill=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;exitDx=0;exitDy=0;entryDx=0;entryDy=0" edge="1" parent="1" source="runtime" target="dispatch"><mxGeometry relative="1" as="geometry"></mxGeometry></mxCell>
        <mxCell id="dispatch-runner" value="执行" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#64748b;fontColor=#475569;fontSize=11;strokeWidth=1.5;dashed=0;endArrow=block;endFill=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;exitDx=0;exitDy=0;entryDx=0;entryDy=0" edge="1" parent="1" source="dispatch" target="runner"><mxGeometry relative="1" as="geometry"><Array as="points"><mxPoint x="1450" y="635"/><mxPoint x="210" y="635"/></Array></mxGeometry></mxCell>
        <mxCell id="runner-model" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#64748b;fontColor=#475569;fontSize=11;strokeWidth=1.5;dashed=0;endArrow=block;endFill=1;exitX=1;exitY=0.3;entryX=0;entryY=0.5;exitDx=0;exitDy=0;entryDx=0;entryDy=0" edge="1" parent="1" source="runner" target="model"><mxGeometry relative="1" as="geometry"></mxGeometry></mxCell>
        <mxCell id="runner-tools" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#64748b;fontColor=#475569;fontSize=11;strokeWidth=1.5;dashed=0;endArrow=block;endFill=1;exitX=1;exitY=0.7;entryX=0;entryY=0.5;exitDx=0;exitDy=0;entryDx=0;entryDy=0" edge="1" parent="1" source="runner" target="skilltool"><mxGeometry relative="1" as="geometry"></mxGeometry></mxCell>
        <mxCell id="runner-domain" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#64748b;fontColor=#475569;fontSize=11;strokeWidth=1.5;dashed=0;endArrow=block;endFill=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;exitDx=0;exitDy=0;entryDx=0;entryDy=0" edge="1" parent="1" source="runner" target="domain"><mxGeometry relative="1" as="geometry"><Array as="points"><mxPoint x="210" y="830"/><mxPoint x="1180" y="830"/></Array></mxGeometry></mxCell>
        <mxCell id="runner-events" value="流式事件 / 终态" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#64748b;fontColor=#475569;fontSize=11;strokeWidth=1.5;dashed=0;endArrow=block;endFill=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;exitDx=0;exitDy=0;entryDx=0;entryDy=0" edge="1" parent="1" source="runner" target="events"><mxGeometry relative="1" as="geometry"></mxGeometry></mxCell>
        <mxCell id="events-response" value="返回" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#64748b;fontColor=#475569;fontSize=11;strokeWidth=1.5;dashed=0;endArrow=block;endFill=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;exitDx=0;exitDy=0;entryDx=0;entryDy=0" edge="1" parent="1" source="events" target="response"><mxGeometry relative="1" as="geometry"></mxGeometry></mxCell>
        <mxCell id="events-db" value="消息 / 状态 / 用量" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#64748b;fontColor=#475569;fontSize=11;strokeWidth=1.5;dashed=0;endArrow=block;endFill=1;exitX=1;exitY=0.7;entryX=0;entryY=0.5;exitDx=0;exitDy=0;entryDx=0;entryDy=0" edge="1" parent="1" source="events" target="database"><mxGeometry relative="1" as="geometry"></mxGeometry></mxCell>
        <mxCell id="domain-myfs" value="文件 / 归档" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#64748b;fontColor=#475569;fontSize=11;strokeWidth=1.5;dashed=0;endArrow=block;endFill=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;exitDx=0;exitDy=0;entryDx=0;entryDy=0" edge="1" parent="1" source="domain" target="myfs"><mxGeometry relative="1" as="geometry"></mxGeometry></mxCell>
        <mxCell id="legend-current" value="当前已落地" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#e9f5ec;strokeColor=#4f8a5b;fontColor=#263238;fontSize=12;fontStyle=0;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="1"><mxGeometry x="50" y="1025" width="150" height="36" as="geometry"/></mxCell>
        <mxCell id="legend-planned" value="规划 / 待完善" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#f1eafa;strokeColor=#8064a2;fontColor=#263238;fontSize=12;fontStyle=0;dashed=1;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="1"><mxGeometry x="220" y="1025" width="160" height="36" as="geometry"/></mxCell>
      </root>
    </mxGraphModel>
  </diagram>
</mxfile>
