diff --git a/changelog/unreleased/2026-08-28-interactive-runtime-architecture-diagram.md b/changelog/unreleased/2026-08-28-interactive-runtime-architecture-diagram.md new file mode 100644 index 000000000..7df5b787e --- /dev/null +++ b/changelog/unreleased/2026-08-28-interactive-runtime-architecture-diagram.md @@ -0,0 +1,16 @@ +# Interactive AgentPool Runtime Architecture Diagram + +Added a self-contained interactive architecture diagram at +`docs/explanation/agentpool-runtime-architecture.html`, linked from +Reference → Architecture in the docs navigation. + +The diagram maps the AgentPool runtime: the four protocol adapters +(ACP, AG-UI, OpenCode, MCP) entering the SessionPool → +SessionController → RunHandle orchestration chain, the native +PydanticAI agent and capability stack, the session-scoped EventBus, +and the AgentPool service hub. The HTML is a single portable artifact +(no external dependencies) with theme switching, node search, focused +routes, and PNG/SVG/WebM export built in. + +Generated with the Archify skill against the live source tree; the same +artifact is deployable as a standalone file or embedded in the docs site. \ No newline at end of file diff --git a/docs/explanation/agentpool-runtime-architecture.html b/docs/explanation/agentpool-runtime-architecture.html new file mode 100644 index 000000000..7960d2641 --- /dev/null +++ b/docs/explanation/agentpool-runtime-architecture.html @@ -0,0 +1,14752 @@ + + + + + + + AgentPool 运行时架构 + + + + + + + + + + + +
+ +
+
+
+

AgentPool 运行时架构

+
+
+ + + + + + + +
+ + AgentPool 运行时架构 + 由 Archify 生成的架构图。 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 客户端 · ACP · AG-UI · OpenCode · MCP · 架构组件 + + + + 客户端 + ACP · AG-UI · OpenCode · MCP + + + + ACPServer · JSON-RPC stdio/WS · Protocol Layer — wolfharness_server + + + + ACPServer + JSON-RPC stdio/WS + + + + OpenCodeServer · HTTP + SSE · Protocol Layer — wolfharness_server + + + + OpenCodeServer + HTTP + SSE + + + + AGUIServer · stateless HTTP · Protocol Layer — wolfharness_server + + + + AGUIServer + stateless HTTP + + + + MCPServer · tools · resources · Protocol Layer — wolfharness_server + + + + MCPServer + tools · resources + + + + SessionPool · send_message · process_prompt · 架构组件 + + + + SessionPool + send_message · process_prompt + + + + SessionController · SessionState · routing · 架构组件 + + + + SessionController + SessionState · routing + + + + RunHandle · RunLoop · HookAwareTurn · 架构组件 + + + + RunHandle + RunLoop · HookAwareTurn + + + + Native Agent · pydantic-ai AgentRun · 架构组件 + + + + Native Agent + pydantic-ai AgentRun + + + + Capability Stack · MCP · Skills · Hooks · Subagent · 架构组件 + + + + Capability Stack + MCP · Skills · Hooks · Subagent + + + + EventBus · session-scoped pub/sub · 架构组件 + + + + EventBus + session-scoped pub/sub + + + + AgentPool · manifest · hub · 架构组件 + + + + AgentPool + manifest · hub + + + + + + HTTPS + SSE + + + + stdio/WS + + + + + + process_prompt + + + + + + + route message + + + + start run + + + + execute turn + + + + capabilities + + + + publish events + + + + creates + + + + MCP · Skills + + + + + + Protocol Layer — wolfharness_server + + + + + 图例 + + + 后端 + + + + 云服务 + + + + 消息总线 + + + + 外部系统 + + + +

+ + + + + + + + + +
+ + +
+
+
+
+

入口

+
+
    +
  • • 四个协议适配器共享同一个 AgentPool
  • +
  • • ACP 全会话模型 · OpenCode SSE 流式
  • +
  • • AG-UI 无状态 HTTP · MCP 经 SubagentCapability
  • +
+
+ +
+
+
+

编排

+
+
    +
  • • SessionPool → SessionController → 每个 prompt 一个 RunHandle
  • +
  • • DeliveryMode: STEER 立即注入 / QUEUE 空闲执行
  • +
  • • HookAwareTurn 触发钩子并记录工具执行日志
  • +
+
+ +
+
+
+

会话状态

+
+
    +
  • • SessionState 持有 6 个生命周期维度
  • +
  • • Memory / Durable (SQLite WAL) 双实现
  • +
  • • ExtensionRegistry 四级作用域: POOL → AGENT → SESSION → TURN
  • +
+
+ +
+
+
+

事件回流

+
+
    +
  • • 运行期事件发布到会话级 EventBus (OpenCode SSE / ACP SessionUpdate)
  • +
  • • 协议服务器经 ProtocolEventConsumerMixin 消费回流事件
  • +
  • • evidence 型节点可固定到单一 commit 的源码行
  • +
+
+
+ +
+ + + + diff --git a/mkdocs.yml b/mkdocs.yml index e7360260c..5196f0bcc 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -273,6 +273,7 @@ nav: - EventBus & SessionController: reference/api/eventbus.md - Architecture: - Module Structure: explanation/module-structure.md + - AgentPool Runtime Architecture: explanation/agentpool-runtime-architecture.html - Graph Architecture: explanation/graph-architecture.md - Session Orchestration: explanation/session-orchestration.md - Lifecycle Dimensions: explanation/lifecycle-dimensions.md