<?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="1700" pageHeight="1050" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>
        <mxCell id="title" value="Engine 与 Tenant Runtime 组件图" 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="1600" height="42" as="geometry"/></mxCell>
        <mxCell id="process" value="Node.js 进程 · Engine" style="swimlane;startSize=36;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="125" width="520" height="780" as="geometry"/></mxCell>
        <mxCell id="start" 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="process"><mxGeometry x="55" y="65" width="190" height="70" as="geometry"/></mxCell>
        <mxCell id="bootstrap" value="bootstrapEngine()" 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="process"><mxGeometry x="285" y="65" width="180" height="70" as="geometry"/></mxCell>
        <mxCell id="maintenance" value="Maintenance 状态&#xa;readiness / self-fence" 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="process"><mxGeometry x="55" y="190" width="190" height="82" as="geometry"/></mxCell>
        <mxCell id="shutdown" value="shutdown()&#xa;暂停 / 取消 / 释放" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#fdeaea;strokeColor=#b85450;fontColor=#263238;fontSize=13;fontStyle=0;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="process"><mxGeometry x="285" y="190" width="180" height="82" as="geometry"/></mxCell>
        <mxCell id="shared" value="进程共享服务" style="swimlane;startSize=36;html=1;container=1;collapsible=0;pointerEvents=0;fillColor=#f3f5f7;swimlaneFillColor=#ffffff;strokeColor=#68737d;fontColor=#263238;fontSize=15;fontStyle=1;dashed=0;strokeWidth=1.5;rounded=0;shadow=0" vertex="1" parent="process"><mxGeometry x="55" y="340" width="410" height="360" as="geometry"/></mxCell>
        <mxCell id="modelproxy" value="ModelProxyService" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#f3f5f7;strokeColor=#68737d;fontColor=#263238;fontSize=12;fontStyle=0;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="shared"><mxGeometry x="35" y="55" width="150" height="55" as="geometry"/></mxCell>
        <mxCell id="globalcache" value="myCache" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#f3f5f7;strokeColor=#68737d;fontColor=#263238;fontSize=12;fontStyle=0;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="shared"><mxGeometry x="225" y="55" width="150" height="55" as="geometry"/></mxCell>
        <mxCell id="broadcast" value="BroadcastBus" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#fff6d9;strokeColor=#c28b20;fontColor=#263238;fontSize=12;fontStyle=0;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="shared"><mxGeometry x="35" y="145" width="150" height="55" as="geometry"/></mxCell>
        <mxCell id="langfuse" value="Langfuse / OTel" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#f3f5f7;strokeColor=#68737d;fontColor=#263238;fontSize=12;fontStyle=0;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="shared"><mxGeometry x="225" y="145" width="150" height="55" as="geometry"/></mxCell>
        <mxCell id="heartbeat" value="Runtime Replica&#xa;Heartbeat" 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="shared"><mxGeometry x="35" y="235" width="150" height="65" as="geometry"/></mxCell>
        <mxCell id="monitor" value="Replica Monitor&#xa;Leader" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#fff6d9;strokeColor=#c28b20;fontColor=#263238;fontSize=12;fontStyle=0;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="shared"><mxGeometry x="225" y="235" width="150" height="65" as="geometry"/></mxCell>
        <mxCell id="registry" value="Tenant Runtime Registry&#xa;list / get / shutdown" 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="1"><mxGeometry x="650" y="375" width="280" height="115" as="geometry"/></mxCell>
        <mxCell id="tenant-a" value="Tenant Runtime · tenant-a" style="swimlane;startSize=36;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="1010" y="120" width="630" height="380" as="geometry"/></mxCell>
        <mxCell id="a-config" value="bootCfg + ConfigStore" 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="tenant-a"><mxGeometry x="35" y="60" width="250" height="65" as="geometry"/></mxCell>
        <mxCell id="a-agent" value="AgentRegistry + ModelGateway" 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="tenant-a"><mxGeometry x="335" y="60" width="250" height="65" as="geometry"/></mxCell>
        <mxCell id="a-dispatch" value="Dispatcher + Ledger + EventBus" 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="tenant-a"><mxGeometry x="35" y="155" width="250" height="65" as="geometry"/></mxCell>
        <mxCell id="a-session" value="Session + Memory + TaskRuns" 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="tenant-a"><mxGeometry x="335" y="155" width="250" height="65" as="geometry"/></mxCell>
        <mxCell id="a-io" value="Channel + Schedule + MyFS" 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="tenant-a"><mxGeometry x="35" y="250" width="250" height="65" as="geometry"/></mxCell>
        <mxCell id="a-ext" value="Extension + Plugin Runtime" 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="tenant-a"><mxGeometry x="335" y="250" width="250" height="65" as="geometry"/></mxCell>
        <mxCell id="tenant-b" value="Tenant Runtime · tenant-b" style="swimlane;startSize=36;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="1010" y="550" width="630" height="315" as="geometry"/></mxCell>
        <mxCell id="b-config" value="独立配置与路径" 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="tenant-b"><mxGeometry x="35" y="65" width="250" height="65" as="geometry"/></mxCell>
        <mxCell id="b-agent" value="独立 Agent / Model" 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="tenant-b"><mxGeometry x="335" y="65" width="250" height="65" as="geometry"/></mxCell>
        <mxCell id="b-session" value="独立 Session / Memory" 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="tenant-b"><mxGeometry x="35" y="170" width="250" height="65" as="geometry"/></mxCell>
        <mxCell id="b-file" value="独立 DB / Workspace / MyFS" 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="tenant-b"><mxGeometry x="335" y="170" width="250" height="65" as="geometry"/></mxCell>
        <mxCell id="truth" value="跨副本事实源&#xa;DB · Redis · Object Storage" style="shape=cylinder3;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="1"><mxGeometry x="650" y="700" width="280" height="105" as="geometry"/></mxCell>
        <mxCell id="start-bootstrap" 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="start" target="bootstrap"><mxGeometry relative="1" as="geometry"></mxGeometry></mxCell>
        <mxCell id="bootstrap-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.35;exitDx=0;exitDy=0;entryDx=0;entryDy=0" edge="1" parent="1" source="bootstrap" target="registry"><mxGeometry relative="1" as="geometry"></mxGeometry></mxCell>
        <mxCell id="registry-a" value="按 tenantCode" 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="registry" target="tenant-a"><mxGeometry relative="1" as="geometry"></mxGeometry></mxCell>
        <mxCell id="registry-b" value="按 tenantCode" 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="registry" target="tenant-b"><mxGeometry relative="1" as="geometry"></mxGeometry></mxCell>
        <mxCell id="shared-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.7;exitDx=0;exitDy=0;entryDx=0;entryDy=0" edge="1" parent="1" source="shared" target="registry"><mxGeometry relative="1" as="geometry"></mxGeometry></mxCell>
        <mxCell id="a-truth" 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;exitY=0.8;entryX=1;entryY=0.3;exitDx=0;exitDy=0;entryDx=0;entryDy=0" edge="1" parent="1" source="tenant-a" target="truth"><mxGeometry relative="1" as="geometry"></mxGeometry></mxCell>
        <mxCell id="b-truth" 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;exitY=0.5;entryX=1;entryY=0.7;exitDx=0;exitDy=0;entryDx=0;entryDy=0" edge="1" parent="1" source="tenant-b" target="truth"><mxGeometry relative="1" as="geometry"></mxGeometry></mxCell>
        <mxCell id="fence-maintenance" 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;exitY=0.5;entryX=0;entryY=0.5;exitDx=0;exitDy=0;entryDx=0;entryDy=0" edge="1" parent="1" source="heartbeat" target="maintenance"><mxGeometry relative="1" as="geometry"><Array as="points"><mxPoint x="70" y="610"/><mxPoint x="70" y="355"/></Array></mxGeometry></mxCell>
        <mxCell id="maintenance-shutdown" 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="maintenance" target="shutdown"><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="930" 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="930" width="160" height="36" as="geometry"/></mxCell>
      </root>
    </mxGraphModel>
  </diagram>
</mxfile>
