# 架构草图 ```mermaid flowchart LR UI["Renderer: 对话式管理员助手"] --> IPC["Preload IPC Bridge"] IPC --> Runner["Main: Agent Runner"] Runner --> Registry["Task Registry"] Runner --> Client["SMQJH Cloud Client"] Runner --> Config["Config Store"] Runner --> Logs["Log Store"] Client --> Gateway["smqjh-gateway :8080"] Gateway --> Auth["smqjh-auth :9000"] Gateway --> System["smqjh-system :8800"] Gateway --> PMS["smqjh-pms :8802"] Gateway --> OMS["smqjh-oms :8803"] ``` ## 关键边界 - 页面层是对话优先,不直接持有 token,只通过 preload 暴露的安全 IPC 调主进程。 - 主进程维护当前会话 token,配置落盘到 Electron `userData/config.json`。 - 任务统一登记在 `src/main/agent/tasks.ts`,后续新增管理员操作时优先补这里。 - `dryRun` 默认开启,复核级任务不会直接写后端。 ## 和 smqjh-cloud 的已知关系 - `smqjh-cloud` 是 Spring Boot 3.2.3 / Spring Cloud 2023 多模块。 - 网关 profile 默认端口是 8080。 - 认证服务 profile 默认端口是 9000。 - 后台 OAuth 客户端在 `AuthorizationServerConfig` 初始化为 `mall-admin / 123456`。 - 登录接口由 OAuth2 token filter 处理,不在 `AuthController` 中。