Skip to content

Commit c35be84

Browse files
ZCode Marketplace Botgeer1895
andcommitted
github-pr-195: feat(rfauto): 新增 RFAuto 射频/微波 EDA 插件
Source-Commit: 7e27fa50570c096811fec7da199271ebbb9d9b17 Co-authored-by: geer1895 <geer1895@users.noreply.github.com>
1 parent 6e3951d commit c35be84

55 files changed

Lines changed: 7445 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎assets/icon-sources.json‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2575,5 +2575,12 @@
25752575
"mimeType": "image/png",
25762576
"sha256": "4da1173e29c7e0d7428f50c00212d5093a1fb3c2fe90ae078ae33e4b7bc85505",
25772577
"transformation": "SVG rendered to 512x512 PNG with transparent background; no baked corner radius"
2578+
},
2579+
{
2580+
"name": "rfauto",
2581+
"icon": "rfauto/icon.png",
2582+
"source": "original artwork for the rfauto plugin, generated by devtests/make_rfauto_icon.py from a geometric description of an |S11| resonance dip on a VNA graticule (no third-party material); released with the plugin under GPL-3.0-only",
2583+
"mimeType": "image/png",
2584+
"sha256": "a8095016915887061ae5191c98a5396f8b9d09fd422868f6c4ffed7436351485"
25782585
}
25792586
]

‎assets/rfauto/icon.png‎

20.3 KB
Loading

‎external_plugins/rfauto/.mcp.json‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"mcpServers": {
3+
"rfauto": {
4+
"type": "stdio",
5+
"command": "python",
6+
"args": ["${ZCODE_PLUGIN_ROOT}/scripts/serve_mcp.py"],
7+
"cwd": "${ZCODE_PROJECT_DIR}",
8+
"env": {
9+
"RFAUTO_PYTHON": "${user_config.pythonPath}",
10+
"RFAUTO_SRC": "${user_config.rfautoSrc}",
11+
"RFAUTO_PLUGIN_ROOT": "${ZCODE_PLUGIN_ROOT}",
12+
"RFAUTO_PLUGIN_DATA": "${ZCODE_PLUGIN_DATA}"
13+
},
14+
"timeoutMs": 120000
15+
}
16+
}
17+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"name": "rfauto",
3+
"displayName": "RFAuto",
4+
"version": "0.1.0",
5+
"description": "把 RFAuto 射频/微波 EDA 框架接入 ZCode 会话:提供 208 个 MCP 工具(器件综合、仿真作业、质量门、结果判读),另附一个判读裁判 agent 和 7 张器件技能卡。所有物理数字都出自 RFAuto 确定性内核与求解器,不由模型生成。",
6+
"description_i18n": {
7+
"en": "Drive the RFAuto RF/microwave EDA framework from any ZCode session: 208 deterministic MCP tools covering device synthesis, simulation jobs, quality gates, and result verdicts, plus a judge agent and device skill cards. Every physical number comes from the RFAuto deterministic kernel and solvers, never from the model.",
8+
"zh-CN": "把 RFAuto 射频/微波 EDA 框架接入 ZCode 会话:提供 208 个 MCP 工具(器件综合、仿真作业、质量门、结果判读),另附一个判读裁判 agent 和 7 张器件技能卡。所有物理数字都出自 RFAuto 确定性内核与求解器,不由模型生成。"
9+
},
10+
"author": {
11+
"name": "geer1895",
12+
"url": "https://github.com/geer1895"
13+
},
14+
"homepage": "https://github.com/geer1895/rfauto",
15+
"repository": "https://github.com/geer1895/rfauto",
16+
"license": "GPL-3.0-only",
17+
"keywords": [
18+
"rf",
19+
"microwave",
20+
"eda",
21+
"hfss",
22+
"openems",
23+
"simulation",
24+
"mcp",
25+
"s-parameters",
26+
"touchstone",
27+
"RFAuto"
28+
],
29+
"commands": "commands",
30+
"skills": "skills",
31+
"agents": "agents",
32+
"mcpServers": ".mcp.json",
33+
"userConfig": {
34+
"pythonPath": {
35+
"title": "rfauto Python 解释器",
36+
"description": "装有 rfauto[mcp] 的 Python 解释器,需 3.10–3.12。留空则使用运行本启动器的解释器。安装命令:pip install \"rfauto[mcp] @ https://github.com/geer1895/rfauto/releases/download/v0.14.0/rfauto-0.14.0-source.zip#sha256=47b2a7db4a6345d1d92cd038d275d75be3edbd8f40ecd5db327a79c05b8ebe6d\"",
37+
"type": "file",
38+
"default": ""
39+
},
40+
"rfautoSrc": {
41+
"title": "rfauto 源码目录(可选)",
42+
"description": "指向 rfauto 检出目录下的 src/。设置后将其前置到 PYTHONPATH,以这份源码为准,不用已安装的 rfauto 包。",
43+
"type": "directory",
44+
"default": ""
45+
}
46+
}
47+
}

‎external_plugins/rfauto/LICENSE‎

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

‎external_plugins/rfauto/README.md‎

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# RFAuto · ZCode plugin
2+
3+
[简体中文](README_CN.md)
4+
5+
Drives the [RFAuto/rfauto](https://github.com/geer1895/rfauto) RF/microwave EDA
6+
framework from a ZCode session: closed-form synthesis, multi-engine simulation
7+
jobs, quality gates and result verdicts. Every physical number (frequency, loss,
8+
geometry) comes from the rfauto deterministic kernel and solvers. The language
9+
model does not generate them.
10+
11+
- Author: [geer1895](https://github.com/geer1895)
12+
- License: GPL-3.0-only
13+
14+
## Components
15+
16+
| Component | Purpose |
17+
|---|---|
18+
| MCP server (`rfauto`) | The rfauto MCP server with 208 tools: device synthesis, simulation jobs, metric readout, quality gates, reports. It also exposes the toolset directory and the 7 device cards as resources |
19+
| `rfauto-mcp-navigator` skill | Tool navigation. Lists 18 commonly used tools up front; the other tools are grouped into 14 toolsets in a reference file. Use at session start or when unsure which tool to call |
20+
| `rf-verdict` skill | Judges simulation results from any origin (human, script or agent) and returns TRUSTED / SUSPECT / STALE / UNVERIFIABLE with per-gate evidence. Use when deciding whether a result can be trusted |
21+
| `rf-judge` agent | Read-only verdict sub-agent with a fixed whitelist of quality-gate tools (runs_verify, em_doctor_check, em_metrics_from_run, ...). Dispatch it for an independent verdict |
22+
| `/rf-check` command | Runs the verdict workflow on one run directory or Touchstone file |
23+
| 7 device skill cards | Wilkinson power divider, branchline coupler, rectangular patch antenna, PIFA, CPW, microstrip synthesis, Verilog-A authoring (from the rfauto repo). Use when a request names one of these devices |
24+
25+
## Usage
26+
27+
For a person:
28+
29+
1. In a session, type `/rf-check <run directory or .sNp file>` to get a verdict report.
30+
2. Ask: "run the rfauto doctor tool". A successful call returns rfauto's environment envelope.
31+
3. Ask for a design, for example "Design a 2.4 GHz Wilkinson power divider with rfauto". The matching device card loads automatically.
32+
33+
For an agent:
34+
35+
- Skills load on their own when a request matches their description. The trigger terms are listed in each `SKILL.md`.
36+
- Ask it to "use rf-judge" to get an independent verdict on a run.
37+
- Tools are named `mcp__plugin_rfauto_rfauto__<tool>`. `tools/list` returns all 208.
38+
39+
## Requirements
40+
41+
- A ZCode client with plugin and MCP support.
42+
- Python 3.10–3.12 with rfauto v0.14.0 installed, once. The command below installs the public release source archive v0.14.0 (commit `3d7b15d`), with its SHA256 checked, so unreleased local changes are not included:
43+
44+
```bash
45+
pip install "rfauto[mcp] @ https://github.com/geer1895/rfauto/releases/download/v0.14.0/rfauto-0.14.0-source.zip#sha256=47b2a7db4a6345d1d92cd038d275d75be3edbd8f40ecd5db327a79c05b8ebe6d"
46+
```
47+
48+
From a clone of the rfauto repository, the upstream route is `pip install -e ".[mcp]"` in the repository root. Alternatively, install the tag directly with `pip install "rfauto[mcp] @ git+https://github.com/geer1895/rfauto.git@v0.14.0"` when git can reach github.com (not verified on the maintainer machine).
49+
- The launcher is started by `python` from `PATH` and needs only the standard library. Make sure that `python` is a Python 3 interpreter.
50+
- HFSS needs Ansys AEDT 2025 R1 and its own license. ADS is a commercial Keysight tool. Neither is bundled.
51+
- openEMS is open source (GPL) and not bundled. Build it from the upstream sources (`docs/openems_build_guide.md`). The built-in `fake` channel needs no license and no external engine. It is a closed-form model, so use it to check the pipeline, not for physics.
52+
53+
## Setup
54+
55+
1. Install the plugin from a marketplace or a local directory source.
56+
2. Point the plugin at an interpreter, either way:
57+
- In the plugin settings, fill in **rfauto Python 解释器** (`pythonPath`) with a Python that has rfauto installed. Leave it empty to use the launcher's own interpreter. Optionally set **rfauto 源码目录** (`rfautoSrc`) to a checkout's `src/` directory to pin an exact source tree.
58+
- Or write `launcher.json` into the plugin data directory: `{"pythonPath": "...", "rfautoSrc": "..."}`. The exact path is printed in the `rf_env_doctor` report. If both are set, userConfig wins.
59+
3. Restart the session and ask for "the rfauto doctor tool". You should get rfauto's environment envelope.
60+
4. If the MCP server cannot start, the plugin falls back to a diagnostic server that exposes only `rf_env_doctor`. Call it and follow the report, which gives the exact install command and the setting to change.
61+
62+
## Permissions, network and side effects
63+
64+
- **Plugin network**: none. The plugin makes no network requests itself. The only online step is the pip install above.
65+
- **MCP server network**: rfauto's MCP tools open network connections only in these cases, and each needs your own configuration:
66+
- remote-machine tools (`remote_probe_machine`, `remote_machine_status`) contact machines you registered (a TCP probe, or SSH through paramiko);
67+
- campaigns whose stages are routed to remote machines (SFTP upload and download, SSH commands);
68+
- HFSS runs that target a registered remote AEDT host;
69+
- a TCP probe of a license server, when a license-server environment variable is set.
70+
71+
Other network paths in rfauto (LLM chat, literature and model downloads, notification webhooks) exist only in its CLI, workbench or scripts. The MCP tools do not trigger them.
72+
- **Telemetry**: none found in the upstream code.
73+
- **Credentials**: the plugin neither reads nor stores credentials. SSH authentication for registered machines is handled by rfauto through paramiko, using your local SSH setup.
74+
- **Dependencies**: the MCP server needs rfauto's `[mcp]` extra (fastmcp, mcp). Other runtime packages (numpy, scipy, scikit-rf, pydantic and so on) are installed by pip and are not distributed with the plugin.
75+
- **File writes**: simulation runs write their artifacts (`runs/`, dataset and database files) into the current workspace, as rfauto normally does. Remote campaigns also copy files to and from the remote machines. The verdict components (`rf-verdict`, `rf-judge`, `/rf-check`) are read-only.
76+
- **Command execution**: `scripts/serve_mcp.py` finds the configured interpreter and starts `python -m rfauto.mcp_server` as a child process, with stdio passed straight through. If that fails, it falls back to the diagnostic server.
77+
- **Hooks**: none.
78+
79+
## Third-party material: source and license
80+
81+
- This plugin wraps the public capabilities of [geer1895/rfauto](https://github.com/geer1895/rfauto) (GPL-3.0-only). The 7 device skill cards (`skills/rfauto-*`, `skills/veriloga-authoring`) are copied from that repository's `skills/` directory. Their bodies and reference files are unchanged, each keeps its own `LICENSE.txt`, and only the frontmatter `description` and `compatibility` are translated into Chinese. The MCP server process is rfauto's own `rfauto.mcp_server`, unmodified.
82+
- The plugin itself (navigator and verdict skills, agent, command, launcher script, icon) is distributed under GPL-3.0-only, the same as the upstream `LICENSE`.
83+
- Some upstream documents, including `THIRD_PARTY_NOTICES.md`, describe rfauto as MIT. That contradicts the upstream `LICENSE` file and `pyproject.toml`, which both say GPL-3.0-only. This plugin follows the `LICENSE` file.
84+
- The upstream third-party list is incomplete. The license of each installed dependency is in its package metadata.
85+
86+
## Iron rule 7
87+
88+
Every skill and agent here enforces rfauto's core rule: the agent orchestrates, interprets and judges, and every physical number traces back to a tool call. A FAIL is reported as FAIL and is never massaged into a pass.
89+
90+
## Known limitations
91+
92+
- The public repository publishes v0.14.0 as a GitHub Release (source zip) and does not document a PyPI release. The install command is pinned to the v0.14.0 release archive, with its SHA256 checked. When the plugin moves to a newer release, update the command in `.zcode-plugin/plugin.json` and `scripts/serve_mcp.py` together.
93+
- The four verdict states (TRUSTED, SUSPECT, STALE, UNVERIFIABLE) are this plugin's own convention. rfauto has no definition with these names.
94+
- In our test, the MCP server took about 30 seconds from launch to a completed handshake, because the rfauto import chain is heavy. Allow for that on the first call of a session.
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# RFAuto · ZCode 插件
2+
3+
在 ZCode 会话里驱动 [RFAuto/rfauto](https://github.com/geer1895/rfauto) 射频/微波 EDA 框架,做闭式综合、多引擎仿真作业、质量门和结果判读。所有物理数字(频率、损耗、几何尺寸)都来自 rfauto 确定性内核与求解器,不由大语言模型生成。
4+
5+
- 作者:[geer1895](https://github.com/geer1895)
6+
- 许可证:GPL-3.0-only
7+
8+
## 组件
9+
10+
| 组件 | 用途 |
11+
|---|---|
12+
| MCP 服务器(`rfauto`) | rfauto 的 208 个工具:器件综合、仿真作业、指标读取、质量门、报告。另以资源形式提供工具集目录和 7 张器件卡 |
13+
| `rfauto-mcp-navigator` 技能 | 选工具用。先列出 18 个常用工具,其余工具按 14 个工具集归类,放在参考文件里。会话开始时,或不确定该调哪个工具时用 |
14+
| `rf-verdict` 技能 | 判读任意来源(人工、脚本、其他 agent)的仿真结果,给出 TRUSTED / SUSPECT / STALE / UNVERIFIABLE 四态判定,每道门附证据。要判断某个结果能不能采信时用 |
15+
| `rf-judge` 子代理 | 只读判读裁判,只能调用固定的质量门工具(runs_verify、em_doctor_check、em_metrics_from_run 等)。需要一个独立的判定结论时派发 |
16+
| `/rf-check` 命令 | 对一个 run 目录或一个 Touchstone 文件执行判读流程 |
17+
| 7 张器件技能卡 | Wilkinson 功分器、branchline 耦合器、矩形贴片天线、PIFA、CPW、微带线综合、Verilog-A 编写,来自 rfauto 仓库。遇到这些器件或 Verilog-A 模型的任务时用 |
18+
19+
## 使用
20+
21+
给人:
22+
23+
1. 在会话里输入 `/rf-check <run 目录或 .sNp 文件>`,得到判定报告。
24+
2. 说“用 rfauto doctor 工具体检”。调用成功会返回 rfauto 的环境信封。
25+
3. 提出设计需求,例如“用 rfauto 设计一个 2.4 GHz 的 Wilkinson 功分器”。匹配的器件技能卡会自动加载。
26+
27+
给 Agent:
28+
29+
- 技能按描述自动加载,触发词写在各自的 `SKILL.md` 里。
30+
- 要独立判定一个 run 时,说“派 rf-judge 判读某某 run”。
31+
- 工具名形如 `mcp__plugin_rfauto_rfauto__<tool>`,`tools/list` 返回全部 208 个。
32+
33+
## 环境要求
34+
35+
- 支持插件与 MCP 的 ZCode 客户端。
36+
- Python 3.10–3.12,并装好 rfauto v0.14.0(只需一次)。下面的命令安装公开仓 v0.14.0 的源码包(提交 `3d7b15d`,并校验 SHA256),不包含本地尚未发布的开发改动:
37+
38+
```bash
39+
pip install "rfauto[mcp] @ https://github.com/geer1895/rfauto/releases/download/v0.14.0/rfauto-0.14.0-source.zip#sha256=47b2a7db4a6345d1d92cd038d275d75be3edbd8f40ecd5db327a79c05b8ebe6d"
40+
```
41+
42+
从 rfauto 仓库的克隆安装时,上游文档的做法是在仓根执行 `pip install -e ".[mcp]"`。也可以直接用标签安装:`pip install "rfauto[mcp] @ git+https://github.com/geer1895/rfauto.git@v0.14.0"`(需要 git 且能连通 github.com,本机未验证)。
43+
- 启动器由 `PATH` 中的 `python` 启动,只用标准库。请确认该 `python` 是 Python 3。
44+
- HFSS 需要 Ansys AEDT 2025 R1 及其许可证;ADS 是 Keysight 的商用软件。两者都不随插件分发。
45+
- openEMS 是开源(GPL)软件,不随插件分发,需按上游文档 `docs/openems_build_guide.md` 从源码编译。内置的 `fake` 通道不需要许可证和外部引擎,可跑通全流程,但它是闭式解析模型,只用来检查流程,不用于物理结论。
46+
47+
## 安装与配置
48+
49+
1. 从插件市场或本地目录安装本插件。
50+
2. 指定解释器,两种方式任选其一:
51+
- 在插件设置里填写 **rfauto Python 解释器**(`pythonPath`),即装有 rfauto 的 Python 路径;留空则使用启动器自身的解释器。如要锁定某份源码,再填 **rfauto 源码目录**(`rfautoSrc`),指向检出目录下的 `src/`。
52+
- 或在插件数据目录下写一个 `launcher.json`:`{"pythonPath": "...", "rfautoSrc": "..."}`,确切路径见 `rf_env_doctor` 的报告。两处同时设置时以 userConfig 为准。
53+
3. 重启会话,发一句“用 rfauto doctor 工具体检”。返回 rfauto 环境信封,说明配置生效。
54+
4. MCP 服务器起不来时,插件会降级为只提供 `rf_env_doctor` 的诊断服务器。调用它,按报告修复;报告里有确切的安装命令和需要配置的项。
55+
56+
## 权限、网络与副作用
57+
58+
- **插件网络**:插件本身不发起任何网络请求。唯一的联网步骤是上面的 pip 安装。
59+
- **MCP 服务器网络**:rfauto 的工具只在以下几种情况下建立网络连接,且都需要你自己配置:
60+
- 远程主机工具(`remote_probe_machine`、`remote_machine_status`)访问你登记过的主机(TCP 探测,或经 paramiko 的 SSH);
61+
- 分发到远程机器的 campaign 阶段(SFTP 上传下载、SSH 执行命令);
62+
- 指向已登记远程 AEDT 主机的 HFSS 运行;
63+
- 设置了许可证服务器环境变量时,对该服务器做 TCP 探测。
64+
65+
rfauto 的其他网络路径(大模型对话、文献和模型下载、通知 webhook)只出现在它的命令行、工作台或脚本中,MCP 工具不会触发。
66+
- **遥测**:上游代码中未发现遥测。
67+
- **凭据**:插件不读取也不保存凭据。登记远程主机的 SSH 认证由 rfauto 通过 paramiko 完成,使用你本机的 SSH 配置。
68+
- **依赖**:MCP 服务器依赖 rfauto 的 `[mcp]` 可选依赖(fastmcp、mcp)。numpy、scipy、scikit-rf、pydantic 等其他运行时包由 pip 安装,不随插件分发。
69+
- **文件写入**:仿真 run 的产物(`runs/`、数据集与数据库文件)按 rfauto 的正常行为写入当前工作区。远程 campaign 还会在本机与远程机器之间复制文件。判读三件套(`rf-verdict`、`rf-judge`、`/rf-check`)只读。
70+
- **命令执行**:启动器 `scripts/serve_mcp.py` 找到配置的解释器,以 `python -m rfauto.mcp_server` 启动子进程,stdio 直接透传。启动失败时降级为诊断服务器。
71+
- **Hook**:本插件不注册任何 hook。
72+
73+
## 第三方材料来源与许可证
74+
75+
- 本插件包装的是 [geer1895/rfauto](https://github.com/geer1895/rfauto)(GPL-3.0-only)的公开能力。随包分发的 7 张器件技能卡(`skills/rfauto-*`、`skills/veriloga-authoring`)复制自该仓库的 `skills/` 目录:正文与参考文件保持不变,各自保留 `LICENSE.txt`;仅 frontmatter 的 `description` 与 `compatibility` 译成了中文。MCP 服务器进程就是 rfauto 自带的 `rfauto.mcp_server`,本插件不改动它。
76+
- 插件本体(导航与判读技能、agent、命令、启动器脚本、图标)以 GPL-3.0-only 分发,与上游 `LICENSE` 一致。
77+
- 上游的部分文档(包括 `THIRD_PARTY_NOTICES.md`)把 rfauto 写成 MIT。这与上游的 `LICENSE` 文件和 `pyproject.toml`(均为 GPL-3.0-only)矛盾。本插件以 `LICENSE` 文件为准。
78+
- 上游的第三方清单并不完整,各依赖的许可证以安装包的元数据为准。
79+
80+
## 铁律 7
81+
82+
所有技能和 agent 都遵守 rfauto 的核心约定:agent 负责编排、解读和判定,每个物理数字都能追溯到某次工具调用。判定为 FAIL 就如实报 FAIL,不凑绿。
83+
84+
## 已知限制
85+
86+
- 公开仓以 GitHub Release 发布 v0.14.0(源码包),未记录 PyPI 发布。安装命令固定到 v0.14.0 的 Release 源码包(校验 SHA256);插件升级到新版本时,需同时修改 `.zcode-plugin/plugin.json` 与 `scripts/serve_mcp.py` 中的命令。
87+
- 四态判定(TRUSTED、SUSPECT、STALE、UNVERIFIABLE)是本插件的约定,rfauto 中没有同名定义。
88+
- 本机测试中,MCP 服务器从启动到握手完成约 30 秒(rfauto 的导入链较重)。会话里第一次调用时请留出这段时间。

0 commit comments

Comments
 (0)