docs(add):新增Arabica Sprint2 系统组件架构设计文档架构图

Signed-off-by: gzkoala <guohao@gitconomy.org>
This commit is contained in:
gzkoala
2026-03-05 15:22:34 +08:00
parent 568ee82e54
commit e42632e56b

View File

@@ -0,0 +1,397 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1280 1000" width="100%" height="100%">
<!--
================================================================================
图表名称Arabica Sprint 2 架构图 (Arabica Sprint 2 Architecture)
文件命名arabica-srpint2-architecture-design.svg
用途:展示 Project Caffeine 提示词策略 MCP Server 在 Sprint 2 中的多维思维框架接入与意图拆解工作流。
版本v1.0.0
作者Gitconomy Research-郭晧
SPDX-License-Identifier: MIT & CC-BY-SA-4.0
创建日期2026-03-05
================================================================================
-->
<!-- 头部注释:图表背景声明 -->
<!-- Background: Solid White -->
<rect width="100%" height="100%" fill="#FFFFFF" />
<defs>
<style>
:root {
/* 语义色定义 */
--c-cloud-blue: #0099FF;
--c-cloud-blue-light: rgba(0, 153, 255, 0.08);
--c-local-green: #009900;
--c-local-green-light: rgba(0, 153, 0, 0.08);
--c-risk-amber: #F97316;
--c-risk-amber-light: rgba(249, 115, 22, 0.08);
--c-gov-blue: #3B82F6;
--c-gov-blue-light: rgba(59, 130, 246, 0.08);
--c-neutral-gray: #475569;
--c-neutral-gray-light: #E2E8F0;
/* 步骤高亮色 */
--c-step-red: #EF4444;
}
/* 字体降级机制 */
.font-sans { font-family: 'Noto Sans', 'Helvetica Neue', Arial, sans-serif; }
.font-mono { font-family: 'JetBrains Mono', Consolas, 'Courier New', monospace; }
/* 文本层级 */
.card-title { font-size: 15px; font-weight: bold; fill: #FFFFFF; }
.card-text { font-size: 13px; fill: var(--c-neutral-gray); }
.text-code { font-size: 13px; font-weight: bold; fill: #0F172A; }
.label-text { font-size: 12px; font-weight: bold; fill: var(--c-neutral-gray); }
.step-text { font-size: 13px; font-weight: bold; fill: #FFFFFF; }
</style>
<!-- 箭头标记 -->
<marker id="arrow-gray" markerWidth="8" markerHeight="8" refX="7" refY="4" orient="auto">
<path d="M 0 0 L 8 4 L 0 8 Z" fill="var(--c-neutral-gray)" />
</marker>
<marker id="arrow-green" markerWidth="8" markerHeight="8" refX="7" refY="4" orient="auto">
<path d="M 0 0 L 8 4 L 0 8 Z" fill="var(--c-local-green)" />
</marker>
<marker id="arrow-blue" markerWidth="8" markerHeight="8" refX="7" refY="4" orient="auto">
<path d="M 0 0 L 8 4 L 0 8 Z" fill="var(--c-cloud-blue)" />
</marker>
</defs>
<!--
===========================================================================
顶层标题块 (Title Block)
===========================================================================
-->
<g id="title-block" transform="translate(640, 40)">
<text y="0" text-anchor="middle" class="font-mono" font-size="12" fill="var(--c-neutral-gray)" letter-spacing="1">FIG-01</text>
<text y="30" text-anchor="middle" class="font-sans" font-weight="bold" font-size="24" fill="#000000">Arabica Sprint 2 系统开发组件架构图</text>
<text y="55" text-anchor="middle" class="font-mono" font-size="14" fill="var(--c-neutral-gray)">架构图 &gt; Arabica Sprint 2 &gt; 多维思维框架与意图拆解工作流</text>
<!-- Context Indicator: Y=70 -->
<rect x="-30" y="70" width="60" height="3" fill="var(--c-cloud-blue)" />
</g>
<!--
===========================================================================
架构图主体内容 (Diagram Content)
===========================================================================
-->
<g id="diagram-content" transform="translate(0, 80)">
<!-- 物理边界与容器 -->
<g id="boundaries" transform="translate(0, 240)">
<!-- Node.js MCP Server Runtime Boundary -->
<rect x="290" y="0" width="700" height="540" rx="12" fill="var(--c-local-green-light)" stroke="var(--c-local-green)" stroke-dasharray="4 4" stroke-width="2" />
<rect x="290" y="0" width="700" height="36" fill="var(--c-local-green)" opacity="0.1" rx="12"/>
<text x="310" y="23" class="font-mono" font-size="14" font-weight="bold" fill="var(--c-local-green)">📦 MCP Server RuntimeSprint2) </text>
</g>
<!--
===========================================================================
核心连线与数据流向 (Connections)
===========================================================================
-->
<g id="connections" fill="none" stroke-width="2">
<!-- User to Cherry Studio -->
<path d="M 400 110 L 482 110" stroke="var(--c-neutral-gray)" marker-end="url(#arrow-gray)" />
<path d="M 490 140 L 408 140" stroke="var(--c-neutral-gray)" marker-end="url(#arrow-gray)" />
<!-- Cherry Studio to Remote LLM -->
<path d="M 760 100 L 892 100" stroke="var(--c-cloud-blue)" stroke-dasharray="4 2" marker-end="url(#arrow-blue)" />
<path d="M 760 120 L 892 120" stroke="var(--c-cloud-blue)" stroke-dasharray="4 2" marker-end="url(#arrow-blue)" />
<path d="M 900 140 L 768 140" stroke="var(--c-cloud-blue)" stroke-dasharray="4 2" marker-end="url(#arrow-blue)" />
<!-- stdio Transport -->
<path d="M 600 170 L 600 292" stroke="var(--c-local-green)" marker-end="url(#arrow-green)" />
<path d="M 640 300 L 640 178" stroke="var(--c-local-green)" marker-end="url(#arrow-green)" />
<!-- app.ts to Controllers -->
<path d="M 600 370 L 600 400 L 410 400 L 410 422" stroke="var(--c-neutral-gray)" marker-end="url(#arrow-gray)" />
<path d="M 640 370 L 640 422" stroke="var(--c-neutral-gray)" marker-end="url(#arrow-gray)" />
<path d="M 680 370 L 680 400 L 870 400 L 870 422" stroke="var(--c-neutral-gray)" marker-end="url(#arrow-gray)" />
<!-- Controllers to Services -->
<path d="M 410 490 L 410 532" stroke="var(--c-neutral-gray)" marker-end="url(#arrow-gray)" />
<path d="M 640 490 L 640 532" stroke="var(--c-neutral-gray)" marker-end="url(#arrow-gray)" />
<path d="M 870 490 L 870 532" stroke="var(--c-neutral-gray)" marker-end="url(#arrow-gray)" />
<!-- Services to Schemas/Frameworks -->
<path d="M 410 620 L 410 642" stroke="var(--c-neutral-gray)" stroke-dasharray="2 2" marker-end="url(#arrow-gray)" />
<path d="M 640 620 L 640 642" stroke="var(--c-neutral-gray)" stroke-dasharray="2 2" marker-end="url(#arrow-gray)" />
<!-- resourceService to Local Vault -->
<path d="M 870 620 L 870 672" stroke="var(--c-local-green)" marker-end="url(#arrow-green)" />
</g>
<!--
===========================================================================
路径标签说明 (Path Labels)
===========================================================================
-->
<g id="path-labels" class="font-sans label-text">
<!-- Top Level -->
<text x="445" y="95" text-anchor="middle">Query</text>
<text x="445" y="160" text-anchor="middle">Report</text>
<text x="830" y="85" text-anchor="middle" fill="var(--c-cloud-blue)">Reasoning</text>
<text x="830" y="160" text-anchor="middle" fill="var(--c-cloud-blue)">LLM Result</text>
<!-- stdio Link -->
<text x="585" y="200" text-anchor="end" fill="var(--c-local-green)">prompts/get</text>
<text x="585" y="220" text-anchor="end" fill="var(--c-local-green)">tools/call</text>
<text x="655" y="210" text-anchor="start" fill="var(--c-local-green)">Result Data</text>
<rect x="585" y="250" width="70" height="20" rx="4" fill="#FFFFFF" stroke="var(--c-local-green)" />
<text x="620" y="264" text-anchor="middle" class="font-mono" font-size="11" fill="var(--c-local-green)">stdio</text>
</g>
<!--
===========================================================================
架构节点卡片 (Node Cards)
===========================================================================
-->
<g id="nodes">
<!-- 1. User Node -->
<g transform="translate(280, 95)">
<rect x="0" y="0" width="110" height="60" rx="8" fill="#F8FAFC" stroke="var(--c-neutral-gray)" stroke-width="2" />
<circle cx="55" cy="22" r="10" fill="var(--c-neutral-gray)" />
<path d="M 35 50 C 35 35, 75 35, 75 50" fill="none" stroke="var(--c-neutral-gray)" stroke-width="3" stroke-linecap="round"/>
<text x="55" y="75" text-anchor="middle" class="font-sans label-text">User / 用户</text>
</g>
<!-- 2. Cherry Studio -->
<g transform="translate(490, 80)">
<rect x="0" y="0" width="260" height="90" rx="8" fill="var(--c-gov-blue-light)" stroke="var(--c-gov-blue)" stroke-width="2" />
<rect x="0" y="0" width="260" height="30" fill="var(--c-gov-blue)" rx="8" />
<rect x="0" y="20" width="260" height="10" fill="var(--c-gov-blue)" />
<text x="130" y="20" text-anchor="middle" class="font-sans card-title">Cherry Studio (MCP Client)</text>
<text x="130" y="55" text-anchor="middle" class="font-sans card-text" font-weight="bold">大模型对话与调度宿主</text>
<text x="130" y="75" text-anchor="middle" class="font-mono card-text" font-size="11">Initiates stdio subprocess</text>
</g>
<!-- 3. Remote LLM Brain -->
<g transform="translate(970, 120)">
<polygon points="0,-45 40,-20 40,20 0,45 -40,20 -40,-20" fill="var(--c-cloud-blue-light)" stroke="var(--c-cloud-blue)" stroke-width="3" />
<text x="0" y="-5" text-anchor="middle" class="font-mono card-test" fill="var(--c-cloud-blue)" font-size="14">LLM</text>
<text x="0" y="15" text-anchor="middle" class="font-mono card-text" font-size="10" fill="var(--c-cloud-blue)">(Remote)</text>
</g>
<!-- 4. app.ts -->
<g transform="translate(560, 300)">
<rect x="-10" y="0" width="180" height="70" rx="6" fill="#FFFFFF" stroke="var(--c-local-green)" stroke-width="2" />
<rect x="-10" y="0" width="180" height="26" fill="var(--c-local-green)" rx="6" />
<rect x="-10" y="20" width="180" height="6" fill="var(--c-local-green)" />
<text x="80" y="18" text-anchor="middle" class="font-mono card-title">app.ts</text>
<text x="80" y="45" text-anchor="middle" class="font-sans text-code" font-size="12">McpServer 注册原语</text>
<text x="80" y="62" text-anchor="middle" class="font-mono card-text" font-size="10">Prompts &amp; Tools (stdio)</text>
</g>
<!-- 5. promptsController.ts -->
<g transform="translate(320, 430)">
<rect x="0" y="0" width="180" height="60" rx="6" fill="#FFFFFF" stroke="var(--c-risk-amber)" stroke-width="2" />
<rect x="0" y="0" width="180" height="26" fill="var(--c-risk-amber)" rx="6" />
<rect x="0" y="20" width="180" height="6" fill="var(--c-risk-amber)" />
<text x="90" y="18" text-anchor="middle" class="font-mono card-title">promptsController</text>
<text x="90" y="48" text-anchor="middle" class="font-sans card-text">处理 prompts/get 和 list</text>
</g>
<!-- 6. toolsController.ts -->
<g transform="translate(550, 430)">
<rect x="0" y="0" width="180" height="60" rx="6" fill="#FFFFFF" stroke="var(--c-risk-amber)" stroke-width="2" />
<rect x="0" y="0" width="180" height="26" fill="var(--c-risk-amber)" rx="6" />
<rect x="0" y="20" width="180" height="6" fill="var(--c-risk-amber)" />
<text x="90" y="18" text-anchor="middle" class="font-mono card-title">toolsController</text>
<text x="90" y="48" text-anchor="middle" class="font-sans card-text">处理 tools 工具调度分发</text>
</g>
<!-- 7. resourcesController.ts -->
<g transform="translate(780, 430)">
<rect x="0" y="0" width="180" height="60" rx="6" fill="#FFFFFF" stroke="var(--c-risk-amber)" stroke-width="2" stroke-dasharray="2 2" opacity="0.8"/>
<rect x="0" y="0" width="180" height="26" fill="var(--c-risk-amber)" rx="6" />
<rect x="0" y="20" width="180" height="6" fill="var(--c-risk-amber)" />
<text x="90" y="18" text-anchor="middle" class="font-mono card-title">resourcesController</text>
<text x="90" y="48" text-anchor="middle" class="font-sans card-text">处理 resources 请求分发</text>
</g>
<!-- 8. promptService.ts -->
<g transform="translate(320, 540)">
<rect x="0" y="0" width="180" height="80" rx="6" fill="#FFFFFF" stroke="var(--c-local-green)" stroke-width="2" />
<rect x="0" y="0" width="180" height="26" fill="var(--c-local-green)" rx="6" />
<rect x="0" y="20" width="180" height="6" fill="var(--c-local-green)" />
<text x="90" y="18" text-anchor="middle" class="font-mono card-title">promptService.ts</text>
<text x="90" y="50" text-anchor="middle" class="font-sans text-code" font-size="12" fill="var(--c-local-green)">管理多维思维框架库</text>
<text x="90" y="70" text-anchor="middle" class="font-sans card-text" font-size="11">返回静态结构化模板</text>
</g>
<!-- 9. intentService.ts -->
<g transform="translate(550, 540)">
<rect x="0" y="0" width="180" height="80" rx="6" fill="#FFFFFF" stroke="var(--c-local-green)" stroke-width="2" />
<rect x="0" y="0" width="180" height="26" fill="var(--c-local-green)" rx="6" />
<rect x="0" y="20" width="180" height="6" fill="var(--c-local-green)" />
<text x="90" y="18" text-anchor="middle" class="font-mono card-title">intentService.ts</text>
<rect x="25" y="35" width="130" height="20" rx="3" fill="var(--c-risk-amber-light)" />
<text x="90" y="50" text-anchor="middle" class="font-sans text-code" font-size="12" fill="var(--c-risk-amber)">意图拆解核心算法</text>
<text x="90" y="70" text-anchor="middle" class="font-sans card-text" font-size="11">生成专业检索词(3~5个)</text>
</g>
<!-- 10. resourceService.ts -->
<g transform="translate(780, 540)">
<rect x="0" y="0" width="180" height="80" rx="6" fill="#FFFFFF" stroke="var(--c-local-green)" stroke-width="2" stroke-dasharray="2 2" opacity="0.8"/>
<rect x="0" y="0" width="180" height="26" fill="var(--c-local-green)" rx="6" />
<rect x="0" y="20" width="180" height="6" fill="var(--c-local-green)" />
<text x="90" y="18" text-anchor="middle" class="font-mono card-title">resourceService.ts</text>
<text x="90" y="50" text-anchor="middle" class="font-sans text-code" font-size="12">文件系统 I/O 交互</text>
<text x="90" y="70" text-anchor="middle" class="font-sans card-text" font-size="11">读取本地知识库</text>
</g>
<!-- 11. models/frameworks -->
<g transform="translate(320, 650)">
<rect x="0" y="0" width="180" height="60" rx="6" fill="#F8FAFC" stroke="var(--c-neutral-gray)" stroke-width="1.5" stroke-dasharray="4 2" />
<path d="M 0 20 L 180 20" stroke="var(--c-neutral-gray)" stroke-width="1.5" stroke-dasharray="4 2" />
<text x="90" y="14" text-anchor="middle" class="font-mono text-code" font-size="11">models/frameworks/</text>
<text x="90" y="38" text-anchor="middle" class="font-mono card-text" font-size="11">5w3h.json, scqa.json</text>
<text x="90" y="52" text-anchor="middle" class="font-mono card-text" font-size="11">swot.json, pestle.json</text>
</g>
<!-- 12. schemas.ts -->
<g transform="translate(595, 650)">
<rect x="0" y="0" width="90" height="60" rx="6" fill="#F8FAFC" stroke="var(--c-neutral-gray)" stroke-width="1.5" />
<text x="45" y="25" text-anchor="middle" class="font-mono text-code" font-size="12">schemas.ts</text>
<text x="45" y="45" text-anchor="middle" class="font-sans card-text" font-size="11">Zod 强校验</text>
</g>
<!-- 13. External Resources -->
<g transform="translate(820, 680)">
<path d="M 0 15 A 50 15 0 1 0 100 15 V 60 A 50 15 0 1 1 0 60 Z" fill="var(--c-local-green-light)" stroke="var(--c-neutral-gray)" stroke-width="2" stroke-dasharray="2 2" />
<ellipse cx="50" cy="15" rx="50" ry="15" fill="var(--c-local-green-light)" stroke="var(--c-neutral-gray)" stroke-width="2" stroke-dasharray="2 2" />
<text x="50" y="55" text-anchor="middle" class="font-sans card-text" fill="var(--c-neutral-gray)" font-size="12">Local Vault</text>
</g>
</g>
<!--
===========================================================================
步骤侧边栏与流程图注 (Execution Steps)
===========================================================================
-->
<g id="execution-steps">
<g transform="translate(440, 110)">
<circle cx="0" cy="0" r="10" fill="var(--c-step-red)" />
<text x="0" y="4.5" text-anchor="middle" class="font-sans step-text">1</text>
</g>
<g transform="translate(830, 100)">
<circle cx="0" cy="0" r="10" fill="var(--c-step-red)" />
<text x="0" y="4.5" text-anchor="middle" class="font-sans step-text">2</text>
</g>
<g transform="translate(600, 200)">
<circle cx="0" cy="0" r="10" fill="var(--c-step-red)" />
<text x="0" y="4.5" text-anchor="middle" class="font-sans step-text">3</text>
</g>
<g transform="translate(410, 505)">
<circle cx="0" cy="0" r="10" fill="var(--c-step-red)" />
<text x="0" y="4.5" text-anchor="middle" class="font-sans step-text">4</text>
</g>
<g transform="translate(830, 140)">
<circle cx="0" cy="0" r="10" fill="var(--c-step-red)" />
<text x="0" y="4.5" text-anchor="middle" class="font-sans step-text">5</text>
</g>
<g transform="translate(640, 505)">
<circle cx="0" cy="0" r="10" fill="var(--c-step-red)" />
<text x="0" y="4.5" text-anchor="middle" class="font-sans step-text">6</text>
</g>
<g transform="translate(440, 140)">
<circle cx="0" cy="0" r="10" fill="var(--c-step-red)" />
<text x="0" y="4.5" text-anchor="middle" class="font-sans step-text">7</text>
</g>
<!-- 步骤流程侧边栏 -->
<g transform="translate(20, 280)">
<rect x="0" y="0" width="260" height="210" rx="8" fill="#FEF2F2" stroke="var(--c-step-red)" stroke-width="1.5" />
<text x="130" y="25" text-anchor="middle" class="font-sans" font-size="14" font-weight="bold" fill="var(--c-step-red)">Sprint 2 执行步骤流</text>
<line x1="15" y1="35" x2="245" y2="35" stroke="var(--c-step-red)" stroke-dasharray="2 2" />
<g transform="translate(15, 55)">
<circle cx="6" cy="-4" r="7" fill="var(--c-step-red)" />
<text x="6" y="0" text-anchor="middle" class="font-sans step-text" font-size="10">1</text>
<text x="20" y="0" class="font-sans card-text" fill="#000000">用户在 Cherry Studio 输入查询</text>
</g>
<g transform="translate(15, 75)">
<circle cx="6" cy="-4" r="7" fill="var(--c-step-red)" />
<text x="6" y="0" text-anchor="middle" class="font-sans step-text" font-size="10">2</text>
<text x="20" y="0" class="font-sans card-text" fill="#000000">大模型判断需要调用多维思维框架</text>
</g>
<g transform="translate(15, 95)">
<circle cx="6" cy="-4" r="7" fill="var(--c-step-red)" />
<text x="6" y="0" text-anchor="middle" class="font-sans step-text" font-size="10">3</text>
<text x="20" y="0" class="font-sans card-text" fill="#000000">Client发起 prompts/get 获取模板</text>
</g>
<g transform="translate(15, 115)">
<circle cx="6" cy="-4" r="7" fill="var(--c-step-red)" />
<text x="6" y="0" text-anchor="middle" class="font-sans step-text" font-size="10">4</text>
<text x="20" y="0" class="font-sans card-text" fill="#000000">组合模板与查询,大模型初步推理</text>
</g>
<g transform="translate(15, 135)">
<circle cx="6" cy="-4" r="7" fill="var(--c-step-red)" />
<text x="6" y="0" text-anchor="middle" class="font-sans step-text" font-size="10">5</text>
<text x="20" y="0" class="font-sans card-text" fill="#000000">调用 tools/call 获取专业检索词</text>
</g>
<g transform="translate(15, 155)">
<circle cx="6" cy="-4" r="7" fill="var(--c-step-red)" />
<text x="6" y="0" text-anchor="middle" class="font-sans step-text" font-size="10">6</text>
<text x="20" y="0" class="font-sans card-text" fill="#000000">Server 执行意图拆解并返回结果</text>
</g>
<g transform="translate(15, 175)">
<circle cx="6" cy="-4" r="7" fill="var(--c-step-red)" />
<text x="6" y="0" text-anchor="middle" class="font-sans step-text" font-size="10">7</text>
<text x="20" y="0" class="font-sans card-text" fill="#000000">大模型结合检索词完成深度报告</text>
</g>
</g>
</g>
</g>
<!--
===========================================================================
底部图例与注释块 (Legend & Key Block)
===========================================================================
-->
<g id="legend" transform="translate(640, 920)">
<!-- 统一的半透明背景容器 -->
<rect x="-440" y="-16" width="880" height="40" rx="4" fill="rgba(255, 255, 255, 0.9)" stroke="var(--c-neutral-gray)" stroke-width="0.5"/>
<g transform="translate(-420, 0)">
<!-- 图例引导文本 -->
<text x="0" y="8" class="font-sans" font-size="13" font-weight="bold" fill="var(--c-neutral-gray)">组件与语义对照:</text>
<!-- 图例项 1 -->
<g transform="translate(130, 0)">
<rect x="-6" y="-6" width="12" height="12" rx="2" fill="var(--c-gov-blue)" />
<text x="12" y="8" class="font-sans" font-size="12" fill="var(--c-neutral-gray)">宿主客户端架构</text>
</g>
<!-- 图例项 2 -->
<g transform="translate(280, 0)">
<rect x="-6" y="-6" width="12" height="12" rx="2" fill="var(--c-risk-amber)" />
<text x="12" y="8" class="font-sans" font-size="12" fill="var(--c-neutral-gray)">请求分发控制器 (Controllers)</text>
</g>
<!-- 图例项 3 -->
<g transform="translate(490, 0)">
<rect x="-6" y="-6" width="12" height="12" rx="2" fill="var(--c-local-green)" />
<text x="12" y="8" class="font-sans" font-size="12" fill="var(--c-neutral-gray)">核心执行引擎与资源层</text>
</g>
<!-- 图例项 4 -->
<g transform="translate(680, 0)">
<rect x="-6" y="-6" width="12" height="12" rx="2" fill="var(--c-neutral-gray)" />
<text x="12" y="8" class="font-sans" font-size="12" fill="var(--c-neutral-gray)">Sprint 3 预留扩展 (灰色)</text>
</g>
</g>
</g>
<!--
===========================================================================
版权许可声明 (License)
===========================================================================
-->
<text x="640" y="980" text-anchor="middle" class="font-sans" font-size="11" fill="var(--c-neutral-gray)">
本作品采用 CC-BY-SA 4.0 进行许可,© 2025-2026 Gitconomy Research社区
</text>
</svg>

After

Width:  |  Height:  |  Size: 23 KiB