94 lines
5.9 KiB
XML
94 lines
5.9 KiB
XML
<svg xmlns="http://www.w3.org/2000/svg" width="1440" height="860" viewBox="0 0 1440 860" role="img" aria-labelledby="title desc">
|
|
<title id="title">启动装配会创建 Fiber 并等待服务依赖</title>
|
|
<desc id="desc">Profile、Bundle 和 patch 先形成有效配置,Cordis Loader 再创建插件 Fiber;虚线表示服务依赖,不表示请求调用顺序。</desc>
|
|
<defs>
|
|
<style>
|
|
.bg { fill: #f7f4ec; }
|
|
.title { font: 700 30px -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans CJK SC", sans-serif; fill: #183a34; }
|
|
.subtitle { font: 400 18px -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; fill: #60706a; }
|
|
.box { fill: #fffdf8; stroke: #286458; stroke-width: 2; rx: 18; }
|
|
.config { fill: #edf5f1; stroke: #286458; stroke-width: 2; rx: 16; }
|
|
.focus { fill: #fff2df; stroke: #ca6715; stroke-width: 2.4; rx: 18; }
|
|
.pending { fill: #fff9e8; stroke: #aa7a12; stroke-width: 2; rx: 18; }
|
|
.label { font: 650 20px -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; fill: #1f413a; }
|
|
.body { font: 400 17px -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; fill: #354c47; }
|
|
.small { font: 400 15px -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; fill: #66766f; }
|
|
.solid { stroke: #286458; stroke-width: 3; fill: none; marker-end: url(#arrow); }
|
|
.dash { stroke: #b17220; stroke-width: 2.5; stroke-dasharray: 9 8; fill: none; marker-end: url(#arrow-orange); }
|
|
.divider { stroke: #cdd8d2; stroke-width: 1.5; }
|
|
</style>
|
|
<marker id="arrow" markerWidth="10" markerHeight="10" refX="8" refY="3" orient="auto" markerUnits="strokeWidth"><path d="M0,0 L0,6 L9,3 z" fill="#286458"/></marker>
|
|
<marker id="arrow-orange" markerWidth="10" markerHeight="10" refX="8" refY="3" orient="auto" markerUnits="strokeWidth"><path d="M0,0 L0,6 L9,3 z" fill="#b17220"/></marker>
|
|
</defs>
|
|
<rect class="bg" width="1440" height="860" rx="32"/>
|
|
<text class="title" x="64" y="64">启动装配会创建 Fiber 并等待服务依赖</text>
|
|
<text class="subtitle" x="64" y="98">这是一张依赖和生命周期图,不是一次用户请求的调用顺序。</text>
|
|
|
|
<text class="small" x="66" y="143">第一步:多层配置合成最终插件清单</text>
|
|
<rect class="config" x="64" y="165" width="240" height="102"/>
|
|
<text class="label" x="88" y="201">Bundle</text>
|
|
<text class="body" x="88" y="232">可复用的默认插件组合</text>
|
|
<rect class="config" x="344" y="165" width="240" height="102"/>
|
|
<text class="label" x="368" y="201">Profile patch</text>
|
|
<text class="body" x="368" y="232">为某种产品形态做选择</text>
|
|
<rect class="config" x="624" y="165" width="240" height="102"/>
|
|
<text class="label" x="648" y="201">Harness home patch</text>
|
|
<text class="body" x="648" y="232">用户或部署环境覆盖</text>
|
|
<rect class="config" x="904" y="165" width="210" height="102"/>
|
|
<text class="label" x="928" y="201">CLI --patch</text>
|
|
<text class="body" x="928" y="232">本次启动覆盖</text>
|
|
<rect class="focus" x="1154" y="165" width="222" height="102"/>
|
|
<text class="label" x="1178" y="201">有效配置行</text>
|
|
<text class="body" x="1178" y="232">按稳定 id 得到结果</text>
|
|
<path class="solid" d="M304 216 H336"/>
|
|
<path class="solid" d="M584 216 H616"/>
|
|
<path class="solid" d="M864 216 H896"/>
|
|
<path class="solid" d="M1114 216 H1146"/>
|
|
<text class="small" x="1065" y="292">后层命中同一 id 时,整段 config 替换,不做深合并</text>
|
|
|
|
<line class="divider" x1="64" y1="326" x2="1376" y2="326"/>
|
|
<text class="small" x="66" y="371">第二步:Loader 为配置行创建 Fiber;Fiber 是否启动由服务依赖决定</text>
|
|
<path class="solid" d="M1000 364 H1050"/>
|
|
<text class="small" x="1060" y="370">Loader 创建 Fiber</text>
|
|
<path class="dash" d="M1212 364 H1262"/>
|
|
<text class="small" x="1272" y="370">消费者 → 提供方</text>
|
|
<rect class="focus" x="524" y="394" width="392" height="92"/>
|
|
<text class="label" x="550" y="430">Root Context + Loader</text>
|
|
<text class="body" x="550" y="460">读取有效配置,为每一行挂载运行实例 Fiber</text>
|
|
|
|
<rect class="box" x="70" y="560" width="245" height="128"/>
|
|
<text class="label" x="94" y="598">LLM provider Fiber</text>
|
|
<text class="body" x="94" y="630">提供 ctx.llm</text>
|
|
<text class="small" x="94" y="660">ACTIVE</text>
|
|
|
|
<rect class="box" x="370" y="560" width="245" height="128"/>
|
|
<text class="label" x="394" y="598">Tools provider Fiber</text>
|
|
<text class="body" x="394" y="630">提供 ctx.tools</text>
|
|
<text class="small" x="394" y="660">ACTIVE</text>
|
|
|
|
<rect class="pending" x="670" y="560" width="245" height="128"/>
|
|
<text class="label" x="694" y="598">greet-tool Fiber</text>
|
|
<text class="body" x="694" y="630">inject: tools</text>
|
|
<text class="small" x="694" y="660">PENDING → ACTIVE</text>
|
|
|
|
<rect class="pending" x="970" y="540" width="330" height="168"/>
|
|
<text class="label" x="994" y="578">Agent loop Fiber</text>
|
|
<text class="body" x="994" y="610">inject: agents, sessions,</text>
|
|
<text class="body" x="994" y="638">llm, tools, systemPrompt</text>
|
|
<text class="small" x="994" y="674">依赖齐全后才能处理请求</text>
|
|
|
|
<path class="solid" d="M650 486 L206 550"/>
|
|
<path class="solid" d="M690 486 L500 550"/>
|
|
<path class="solid" d="M750 486 L792 550"/>
|
|
<path class="solid" d="M810 486 L1110 530"/>
|
|
<path class="dash" d="M670 624 H625"/>
|
|
<text class="small" x="628" y="610">等待 tools</text>
|
|
<path class="dash" d="M970 592 C850 505 350 500 248 551"/>
|
|
<text class="small" x="625" y="516">等待 llm</text>
|
|
<path class="dash" d="M970 650 C860 710 694 720 600 676"/>
|
|
<text class="small" x="735" y="744">等待 tools 等服务</text>
|
|
|
|
<rect class="config" x="64" y="770" width="1312" height="58"/>
|
|
<text class="body" x="88" y="806">记忆锚点:配置行决定“挂载什么”;inject 决定“何时能启动”;Fiber/effect 决定“变化时怎样卸载和重建”。</text>
|
|
</svg>
|