项目实践

MCU Agentd

MCU Agentd 是可配置 MCU 管理工具,包含每项目 daemon/CLI mcu-agentd 和用户级辅助 daemon mcu-managerd。README.md 明确它通过 mcu-agentd.toml 定义多个 MCU target,并基于 espflash 与 probe-rs 执行操作,当前 v1 只支持 ELF artifact 和固定策略。

  • Ops tool
  • Rust web service
  • Embedded admin UI
  • React app
  • Service ports
  • Storybook component QA
  • Config-driven ops
  • MCU flashing integration
  • Embedded USB control plane

目录

技术栈

运行与交付

CI 工作流
  • ci.yml
能力标记
  • cargo_toml
  • github_actions
JSON

Purpose

MCU Agentd 是可配置 MCU 管理工具,包含每项目 daemon/CLI mcu-agentd 和用户级辅助 daemon mcu-managerd。README.md 明确它通过 mcu-agentd.toml 定义多个 MCU target,并基于 espflash 与 probe-rs 执行操作,当前 v1 只支持 ELF artifact 和固定策略。

Taxonomy

  • Tags: Ops tool, Rust web service, Embedded admin UI, React app, Service ports, Storybook component QA, Config-driven ops, MCU flashing integration, Embedded USB control plane
  • Why / evidence: 这些 tags 来自 checked-out repo 和 catalog record。主要证据包括 README.md、Cargo.toml、src/、tests/、web/package.json、web/.storybook/main.ts、web/scripts/test-storybook.ts、web/scripts/test-storybook-ci.ts。Topic token 的大小写以对应技术/工作流的官方写法为准;slug 只作为稳定 ID,不直接充当项目标题。

Repository map

  • Cargo.toml 是 Rust daemon/CLI manifest,依赖 espflash、serialport、probe-rs 相关调用、Axum、Tokio、TOML。
  • src/ 保存 daemon、CLI、registry、monitor lifecycle 和 HTTP API。
  • web/ 是 React 管理 UI,web/.storybook 和 web/scripts/test-storybook*.ts 提供 component QA。
  • docs/ 保存 design/plan 记录,tests/ 覆盖服务行为。

Runtime and delivery

运行模型是 per-project agent + user-level manager。项目通过 mcu-agentd.toml 声明 MCU、backend、chip、artifact_elf、selector cache 和 backend-specific 参数。Web UI/HTTP API 服务于跨项目资源仲裁、日志、monitor 生命周期和升级协调。

Architecture notes

关键抽象是 config-driven MCU target:上层命令不透传底层任意参数,而是根据固定配置执行 flash/monitor/log。这样能把安全边界留在配置和策略里,避免每个项目脚本随意拼接 espflash/probe-rs 命令。

Workflow and quality gates

.github/workflows/ci.yml 是当前 CI 入口。Web 子项目有 build-storybook、test-storybook、test-storybook:ci;因为 .storybook/main.ts 没有 accessibility addon,Topic 应是 Storybook component QA。

Reusable decisions

  • 用 mcu-agentd.toml 作为跨项目硬件操作 contract,减少一次性脚本。
  • 限制底层参数透传,优先固定策略,适合多 Agent 操作真实硬件。
  • 把 manager UI 与 daemon 放在同仓库,方便协议同步。

Risks and open questions

  • 真实硬件操作有副作用,自动化 Agent 必须尊重配置和串口选择。
  • espflash/probe-rs 版本变化会影响 flashing/monitor 行为。
  • Storybook 只能证明 UI states,不能证明硬件操作安全。

Evidence index

  • README.md
  • Cargo.toml
  • src/
  • tests/
  • web/package.json
  • web/.storybook/main.ts
  • web/scripts/test-storybook.ts
  • web/scripts/test-storybook-ci.ts
  • docs/
  • .github/workflows/ci.yml